rofi
1.5.4
|
The 'object' that makes a mode in rofi. More...
Typedefs | |
typedef struct rofi_mode | Mode |
Enumerations | |
enum | ModeMode { MODE_EXIT = 1000, NEXT_DIALOG = 1001, RELOAD_DIALOG = 1002, PREVIOUS_DIALOG = 1003, RESET_DIALOG = 1004 } |
enum | MenuReturn { MENU_OK = 0x00010000, MENU_CANCEL = 0x00020000, MENU_NEXT = 0x00040000, MENU_CUSTOM_INPUT = 0x00080000, MENU_ENTRY_DELETE = 0x00100000, MENU_QUICK_SWITCH = 0x00200000, MENU_PREVIOUS = 0x00400000, MENU_CUSTOM_ACTION = 0x10000000, MENU_LOWER_MASK = 0x0000FFFF } |
Functions | |
void | mode_destroy (Mode *mode) |
unsigned int | mode_get_num_entries (const Mode *mode) |
char * | mode_get_display_value (const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry) |
cairo_surface_t * | mode_get_icon (const Mode *mode, unsigned int selected_line, int height) |
char * | mode_get_completion (const Mode *mode, unsigned int selected_line) |
ModeMode | mode_result (Mode *mode, int menu_retv, char **input, unsigned int selected_line) |
int | mode_token_match (const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line) |
const char * | mode_get_name (const Mode *mode) |
void | mode_free (Mode **mode) |
void * | mode_get_private_data (const Mode *mode) |
void | mode_set_private_data (Mode *mode, void *pd) |
const char * | mode_get_display_name (const Mode *mode) |
void | mode_set_config (Mode *mode) |
char * | mode_preprocess_input (Mode *mode, const char *input) |
char * | mode_get_message (const Mode *mode) |
int | mode_init (Mode *mode) |
The 'object' that makes a mode in rofi.
enum MenuReturn |
State returned by the rofi window.
enum ModeMode |
void mode_destroy | ( | Mode * | mode | ) |
mode | The mode to destroy |
Destroy the mode
Definition at line 49 of file mode.c.
References rofi_mode::_destroy.
Referenced by cleanup(), combi_mode_destroy(), and dmenu_finish().
void mode_free | ( | Mode ** | mode | ) |
mode | The mode to query |
Free the resources allocated for this mode.
Definition at line 118 of file mode.c.
Referenced by rofi_collect_modi_destroy().
char* mode_get_completion | ( | const Mode * | mode, |
unsigned int | selected_line | ||
) |
mode | The mode to query |
selected_line | The entry to query |
Return a string that can be used for completion. It has should have no markup.
Definition at line 84 of file mode.c.
References rofi_mode::_get_completion, and rofi_mode::_get_display_value.
Referenced by combi_get_completion(), filter_elements(), and rofi_view_nav_row_select().
const char* mode_get_display_name | ( | const Mode * | mode | ) |
mode | The mode to query |
Get the name of the mode as it should be presented to the user.
Definition at line 143 of file mode.c.
References rofi_mode::display_name, and rofi_mode::name.
Referenced by combi_mgrv(), rofi_view_add_widget(), and rofi_view_update_prompt().
char* mode_get_display_value | ( | const Mode * | mode, |
unsigned int | selected_line, | ||
int * | state, | ||
GList ** | attribute_list, | ||
int | get_entry | ||
) |
mode | The mode to query |
selected_line | The entry to query |
state | The state of the entry [out] |
attribute_list | List of extra (pango) attribute to apply when displaying. [out][null] |
get_entry | If the should be returned. |
Returns the string as it should be displayed for the entry and the state of how it should be displayed.
Definition at line 63 of file mode.c.
References rofi_mode::_get_display_value.
Referenced by combi_mgrv(), and update_callback().
cairo_surface_t* mode_get_icon | ( | const Mode * | mode, |
unsigned int | selected_line, | ||
int | height | ||
) |
mode | The mode to query |
selected_line | The entry to query |
height | The desired height of the icon. |
Returns the icon for the selected_line
Definition at line 72 of file mode.c.
References rofi_mode::_get_icon.
Referenced by combi_get_icon(), and update_callback().
char* mode_get_message | ( | const Mode * | mode | ) |
mode | The mode to query |
Query the mode for a user display.
Definition at line 164 of file mode.c.
References rofi_mode::_get_message.
Referenced by rofi_view_reload_message_bar().
const char* mode_get_name | ( | const Mode * | mode | ) |
mode | The mode to query |
Get the name of the mode.
Definition at line 112 of file mode.c.
References rofi_mode::name.
Referenced by combi_get_completion(), combi_mode_result(), combi_preprocess_input(), and switcher_get().
unsigned int mode_get_num_entries | ( | const Mode * | mode | ) |
mode | The mode to query |
Get the number of entries in the mode.
Definition at line 56 of file mode.c.
References rofi_mode::_get_num_entries.
Referenced by _rofi_view_reload_row(), combi_mode_get_num_entries(), combi_mode_init(), and rofi_view_create().
void* mode_get_private_data | ( | const Mode * | mode | ) |
mode | The mode to query |
Helper functions for mode. Get the private data object.
Definition at line 128 of file mode.c.
References rofi_mode::private_data.
Referenced by _get_display_value(), combi_get_completion(), combi_get_icon(), combi_mgrv(), combi_mode_destroy(), combi_mode_get_num_entries(), combi_mode_init(), combi_mode_match(), combi_mode_parse_switchers(), combi_mode_result(), combi_preprocess_input(), dmenu_get_icon(), dmenu_get_message(), dmenu_mode_free(), dmenu_mode_get_num_entries(), dmenu_mode_init(), dmenu_token_match(), get_display_data(), help_keys_mode_destroy(), help_keys_mode_get_num_entries(), help_keys_mode_init(), help_keys_token_match(), script_get_icon(), ssh_mode_destroy(), ssh_mode_get_num_entries(), ssh_mode_init(), ssh_mode_result(), and ssh_token_match().
int mode_init | ( | Mode * | mode | ) |
mode | The mode to initialize |
Initialize mode
Definition at line 42 of file mode.c.
References rofi_mode::_init.
Referenced by combi_mode_init(), dmenu_switcher_dialog(), and run_switcher().
char* mode_preprocess_input | ( | Mode * | mode, |
const char * | input | ||
) |
mode | The mode to query |
input | The input to process |
This processes the input so it can be used for matching and sorting. This includes removing pango markup.
Definition at line 157 of file mode.c.
References rofi_mode::_preprocess_input.
Referenced by rofi_view_refilter().
mode | The mode to query |
menu_retv | The menu return value. |
input | Pointer to the user input string. [in][out] |
selected_line | the line selected by the user. |
Acts on the user interaction.
Definition at line 97 of file mode.c.
References rofi_mode::_result.
Referenced by combi_mode_result(), and process_result().
void mode_set_config | ( | Mode * | mode | ) |
mode | The mode to query |
Should be called once for each mode. This adds the display-name configuration option for the mode.
Definition at line 151 of file mode.c.
References rofi_mode::cfg_name_key, config_parser_add_option(), rofi_mode::display_name, rofi_mode::name, and xrm_String.
Referenced by rofi_collect_modi_setup().
void mode_set_private_data | ( | Mode * | mode, |
void * | pd | ||
) |
mode | The mode to query |
pd | Pointer to private data to attach to the mode. |
Helper functions for mode. Set the private data object.
Definition at line 134 of file mode.c.
References rofi_mode::private_data.
Referenced by combi_mode_destroy(), combi_mode_init(), dmenu_mode_free(), dmenu_mode_init(), help_keys_mode_destroy(), help_keys_mode_init(), ssh_mode_destroy(), and ssh_mode_init().
int mode_token_match | ( | const Mode * | mode, |
rofi_int_matcher ** | tokens, | ||
unsigned int | selected_line | ||
) |
mode | The mode to query |
tokens | The set of tokens to match against |
selected_line | The index of the entry to match |
Match entry against the set of tokens.
Definition at line 105 of file mode.c.
References rofi_mode::_token_match.
Referenced by combi_mode_match(), and filter_elements().