rofi
1.5.4
|
#include <config.h>
#include <xcb/xcb.h>
#include <ctype.h>
#include <string.h>
#include <glib.h>
#include <math.h>
#include "widgets/textbox.h"
#include "keyb.h"
#include "helper.h"
#include "helper-theme.h"
#include "mode.h"
#include "view.h"
#include "theme.h"
Go to the source code of this file.
Data Structures | |
struct | TBFontConfig |
Macros | |
#define | DOT_OFFSET 15 |
Typedefs | |
typedef struct TBFontConfig | TBFontConfig |
Variables | |
static PangoContext * | p_context = NULL |
static PangoFontMetrics * | p_metrics = NULL |
static GHashTable * | tbfc_cache = NULL |
const char *const | theme_prop_names [][3] |
const char * | default_font_name = "default" |
static double | char_height = -1 |
static double | char_width = -1 |
static double | ch_width = -1 |
#define DOT_OFFSET 15 |
typedef struct TBFontConfig TBFontConfig |
Cache to hold font descriptions. This it to avoid having to lookup each time.
|
static |
tb | The textbox object. |
Update the pango layout's text. It does this depending on the textbox flags.
Definition at line 265 of file textbox.c.
References textbox::flags, textbox::layout, MARKUP, TB_MARKUP, TB_PASSWORD, textbox::tbft, and textbox::text.
Referenced by textbox_draw(), textbox_get_desired_height(), and textbox_text().
|
static |
Definition at line 870 of file textbox.c.
References textbox::flags, _widget::h, TB_AUTOHEIGHT, textbox_get_height(), and textbox::widget.
Referenced by textbox_create().
|
static |
Definition at line 825 of file textbox.c.
References TBFontConfig::metrics, and TBFontConfig::pfd.
Referenced by textbox_setup().
|
static |
Definition at line 72 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 686 of file textbox.c.
References textbox::cursor, textbox_cursor_dec(), and textbox_cursor_del().
Referenced by textbox_keybinding().
|
static |
Definition at line 693 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 530 of file textbox.c.
References textbox::cursor, and textbox_cursor().
Referenced by textbox_cursor_bkspc(), and textbox_keybinding().
|
static |
Definition at line 568 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 673 of file textbox.c.
References textbox::cursor, textbox::text, and textbox_delete().
Referenced by textbox_cursor_bkspc(), and textbox_keybinding().
|
static |
Definition at line 703 of file textbox.c.
References textbox::cursor, textbox::text, and textbox_delete().
Referenced by textbox_keybinding().
|
static |
Definition at line 712 of file textbox.c.
References textbox::cursor, and textbox_delete().
Referenced by textbox_keybinding().
|
static |
Definition at line 721 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 516 of file textbox.c.
References textbox::cursor, and textbox_cursor().
Referenced by textbox_keybinding().
|
static |
Definition at line 538 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 416 of file textbox.c.
References __textbox_update_pango_text(), textbox::blink, textbox::changed, textbox::cursor, DOT_OFFSET, textbox::flags, _widget::h, textbox::icon, textbox::layout, textbox::left_offset, textbox::metrics, rofi_theme_get_color(), SELECTED, TB_EDITABLE, TB_ICON, TB_INDICATOR, textbox::tbft, _widget::w, textbox::widget, 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 104 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 393 of file textbox.c.
References textbox::blink_timeout, textbox::icon, textbox::layout, and textbox::text.
Referenced by textbox_create().
|
static |
Definition at line 91 of file textbox.c.
References __textbox_update_pango_text(), textbox::changed, textbox::flags, _widget::h, TB_AUTOHEIGHT, textbox_get_height(), and textbox::widget.
Referenced by textbox_create().
|
static |
Definition at line 860 of file textbox.c.
References DOT_OFFSET, textbox::flags, TB_AUTOWIDTH, TB_INDICATOR, textbox_get_font_width(), _widget::w, textbox::widget, and widget_padding_get_padding_width().
Referenced by textbox_create().
|
static |
Definition at line 134 of file textbox.c.
References TBFontConfig::height, helper_validate_font(), textbox::layout, textbox::left_offset, textbox::metrics, TBFontConfig::metrics, p_context, p_metrics, TBFontConfig::pfd, rofi_theme_get_string(), tbfc_cache, textbox_get_estimated_char_height(), and WIDGET.
Referenced by textbox_create().
|
static |
Definition at line 86 of file textbox.c.
References textbox_moveresize(), textbox::widget, _widget::x, and _widget::y.
Referenced by textbox_create().
|
static |
Cache storing the estimated width of a digit (ch).
Definition at line 920 of file textbox.c.
Referenced by textbox_get_estimated_ch().
|
static |
Caching for the estimated character height. (em)
Definition at line 898 of file textbox.c.
Referenced by textbox_get_estimated_char_height().
|
static |
Caching for the expected character width.
Definition at line 909 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 839 of file textbox.c.
Referenced by textbox_set_pango_context().
|
static |
Default pango context
Definition at line 54 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 56 of file textbox.c.
Referenced by textbox_get_estimated_ch(), textbox_get_estimated_char_height(), textbox_get_estimated_char_width(), textbox_initialize_font(), and textbox_set_pango_context().
|
static |
HashMap of previously parsed font descriptions.
Definition at line 70 of file textbox.c.
Referenced by textbox_cleanup(), textbox_initialize_font(), textbox_set_pango_context(), and textbox_setup().
const char* const theme_prop_names[][3] |
State names used for theming.
Definition at line 222 of file textbox.c.
Referenced by textbox_font().