rofi 1.7.5
|
#include "widgets/textbox.h"
#include "helper-theme.h"
#include "helper.h"
#include "keyb.h"
#include "mode.h"
#include "view.h"
#include <ctype.h>
#include <glib.h>
#include <math.h>
#include <string.h>
#include <xcb/xcb.h>
#include "theme.h"
Go to the source code of this file.
Variables | |
static PangoContext * | p_context = NULL |
static PangoFontMetrics * | p_metrics = NULL |
static TBFontConfig * | tbfc_default = NULL |
static GHashTable * | tbfc_cache = NULL |
const char *const | theme_prop_names [][3] |
const char * | default_font_name = "default" |
static double | char_width = -1 |
static double | ch_width = -1 |
|
static |
tb | The textbox object. |
Update the pango layout's text. It does this depending on the textbox flags.
Definition at line 309 of file textbox.c.
References textbox::flags, helper_token_match_set_pango_attr_on_style(), textbox::layout, MARKUP, textbox::placeholder, rofi_theme_get_highlight(), textbox::show_placeholder, RofiHighlightColorStyle::style, TB_MARKUP, TB_PASSWORD, textbox::tbft, textbox::text, and WIDGET.
Referenced by textbox_draw(), textbox_get_desired_height(), and textbox_text().
|
static |
Definition at line 906 of file textbox.c.
References textbox::flags, _widget::h, textbox::layout, TB_AUTOHEIGHT, textbox_get_estimated_height(), and textbox::widget.
Referenced by textbox_create().
|
static |
Definition at line 857 of file textbox.c.
References TBFontConfig::metrics, and TBFontConfig::pfd.
Referenced by textbox_setup().
|
static |
Definition at line 60 of file textbox.c.
References textbox::blink, rofi_view_queue_redraw(), WIDGET, and widget_queue_redraw().
Referenced by textbox_create().
|
static |
tb | Handle to the textbox |
Delete character before cursor.
Definition at line 727 of file textbox.c.
References textbox::cursor, textbox_cursor_dec(), and textbox_cursor_del().
Referenced by textbox_keybinding().
|
static |
Definition at line 733 of file textbox.c.
References textbox::cursor, textbox_cursor_dec_word(), and textbox_delete().
Referenced by textbox_keybinding().
|
static |
tb | Handle to the textbox |
Move cursor one position backward.
Definition at line 574 of file textbox.c.
References textbox::cursor, and textbox_cursor().
Referenced by textbox_cursor_bkspc(), and textbox_keybinding().
|
static |
Definition at line 612 of file textbox.c.
References textbox::cursor, textbox::text, and textbox_cursor().
Referenced by textbox_cursor_bkspc_word(), and textbox_keybinding().
|
static |
tb | Handle to the textbox |
Delete character after cursor.
Definition at line 715 of file textbox.c.
References textbox::cursor, textbox::text, and textbox_delete().
Referenced by textbox_cursor_bkspc(), and textbox_keybinding().
|
static |
Definition at line 742 of file textbox.c.
References textbox::cursor, textbox::text, and textbox_delete().
Referenced by textbox_keybinding().
|
static |
Definition at line 750 of file textbox.c.
References textbox::cursor, and textbox_delete().
Referenced by textbox_keybinding().
|
static |
Definition at line 756 of file textbox.c.
References textbox::cursor, textbox_cursor_inc_word(), and textbox_delete().
Referenced by textbox_keybinding().
|
static |
tb | Handle to the textbox |
Move cursor one position forward.
Definition at line 561 of file textbox.c.
References textbox::cursor, and textbox_cursor().
Referenced by textbox_keybinding().
|
static |
Definition at line 581 of file textbox.c.
References textbox::cursor, textbox::text, and textbox_cursor().
Referenced by textbox_cursor_del_word(), and textbox_keybinding().
|
static |
Definition at line 452 of file textbox.c.
References __textbox_update_pango_text(), textbox::blink, textbox::changed, textbox::cursor, textbox::flags, _widget::h, textbox::layout, TBFontConfig::metrics, rofi_theme_get_color(), textbox::show_placeholder, TB_EDITABLE, textbox::tbfc, _widget::w, WIDGET, textbox::widget, widget_padding_get_bottom(), widget_padding_get_left(), widget_padding_get_padding_width(), widget_padding_get_top(), textbox::xalign, and textbox::yalign.
Referenced by textbox_create().
|
static |
Definition at line 96 of file textbox.c.
References textbox::layout, MOUSE_CLICK_DOWN, MOUSE_CLICK_UP, MOUSE_DCLICK_DOWN, MOUSE_DCLICK_UP, textbox_cursor(), textbox_cursor_end(), textbox_get_font_width(), widget_padding_get_left(), WIDGET_TRIGGER_ACTION_RESULT_HANDLED, and WIDGET_TRIGGER_ACTION_RESULT_IGNORED.
Referenced by textbox_create().
|
static |
Definition at line 434 of file textbox.c.
References textbox::blink_timeout, textbox::layout, and textbox::text.
Referenced by textbox_create().
|
static |
Definition at line 76 of file textbox.c.
References __textbox_update_pango_text(), textbox::changed, textbox::flags, _widget::h, textbox::layout, TB_AUTOHEIGHT, textbox_get_estimated_height(), WIDGET, textbox::widget, and widget_padding_get_padding_width().
Referenced by textbox_create().
int textbox_get_desired_width | ( | widget * | wid, |
G_GNUC_UNUSED const int | height ) |
Definition at line 958 of file textbox.c.
References distance_get_pixel(), _widget::expand, textbox::flags, textbox::layout, ROFI_ORIENTATION_HORIZONTAL, rofi_theme_get_distance(), TB_AUTOWIDTH, textbox_get_font_width(), WIDGET, widget_padding_get_left(), widget_padding_get_padding_width(), and widget_padding_get_right().
Referenced by textbox_create().
|
static |
Definition at line 898 of file textbox.c.
References textbox::flags, TB_AUTOWIDTH, textbox_get_font_width(), _widget::w, textbox::widget, and widget_padding_get_padding_width().
Referenced by textbox_create().
|
static |
Definition at line 125 of file textbox.c.
References TBFontConfig::height, helper_validate_font(), textbox::layout, TBFontConfig::metrics, p_context, TBFontConfig::pfd, rofi_theme_get_string(), textbox::tbfc, tbfc_cache, tbfc_default, and WIDGET.
Referenced by textbox_create().
|
static |
Definition at line 72 of file textbox.c.
References textbox_moveresize(), textbox::widget, _widget::x, and _widget::y.
Referenced by textbox_create().
|
static |
Definition at line 161 of file textbox.c.
References distance_get_pixel(), textbox::layout, ROFI_ORIENTATION_HORIZONTAL, rofi_theme_get_list_distance(), and WIDGET.
Referenced by textbox_create().
|
static |
Cache storing the estimated width of a digit (ch).
Definition at line 945 of file textbox.c.
Referenced by textbox_get_estimated_ch().
|
static |
Caching for the expected character width.
Definition at line 935 of file textbox.c.
Referenced by textbox_get_estimated_char_width().
const char* default_font_name = "default" |
Name of the default font (if none is given)
Definition at line 870 of file textbox.c.
Referenced by textbox_set_pango_context().
|
static |
Default pango context
Definition at line 50 of file textbox.c.
Referenced by textbox_cleanup(), textbox_create(), textbox_initialize_font(), and textbox_set_pango_context().
|
static |
The pango font metrics
Definition at line 52 of file textbox.c.
Referenced by textbox_get_estimated_ch(), textbox_get_estimated_char_width(), and textbox_set_pango_context().
|
static |
HashMap of previously parsed font descriptions.
Definition at line 58 of file textbox.c.
Referenced by textbox_cleanup(), textbox_initialize_font(), textbox_set_pango_context(), and textbox_setup().
|
static |
Default tbfc
Definition at line 55 of file textbox.c.
Referenced by textbox_get_estimated_char_height(), textbox_initialize_font(), and textbox_set_pango_context().
const char* const theme_prop_names[][3] |
State names used for theming.
Definition at line 268 of file textbox.c.
Referenced by textbox_font().