rofi
1.5.4
|
Data Structures | |
struct | RofiViewState |
Typedefs | |
typedef struct RofiViewState | RofiViewState |
Enumerations | |
enum | MenuFlags { MENU_NORMAL = 0, MENU_PASSWORD = 1, MENU_NORMAL_WINDOW = 2, MENU_ERROR_DIALOG = 4, MENU_INDICATOR = 8 } |
typedef struct RofiViewState RofiViewState |
enum MenuFlags |
RofiViewState* rofi_view_create | ( | Mode * | sw, |
const char * | input, | ||
MenuFlags | menu_flags, | ||
void(*)(RofiViewState *) | finalize | ||
) |
sw | the Mode to show. |
input | A pointer to a string where the inputted data is placed. |
menu_flags | Flags indicating state of the menu. |
finalize | the finailze callback |
Main menu callback.
Definition at line 1693 of file view.c.
References __rofi_view_state_create(), box_create(), CacheState, _xcb_stuff::connection, RofiViewState::distance, RofiViewState::finalize, RofiViewState::height, RofiViewState::line_map, RofiViewState::list_view, listview_set_fixed_num_lines(), RofiViewState::main_window, MENU_CANCEL, RofiViewState::menu_flags, MENU_NORMAL_WINDOW, mode_get_num_entries(), RofiViewState::mouse_seen, RofiViewState::num_lines, RofiViewState::quit, RofiViewState::refilter, RofiViewState::retv, ROFI_ORIENTATION_VERTICAL, rofi_theme_get_list(), rofi_view_add_widget(), rofi_view_calculate_height(), rofi_view_calculate_window_position(), rofi_view_calculate_window_width(), rofi_view_refilter(), rofi_view_update(), rofi_view_window_update_size(), RofiViewState::selected_line, RofiViewState::skip_absorb, _xcb_stuff::sncontext, RofiViewState::sw, RofiViewState::text, textbox_cursor_end(), textbox_text(), TICK, TICK_N, WIDGET, widget_queue_redraw(), widget_resize(), RofiViewState::width, and xcb.
Referenced by dmenu_switcher_dialog(), and run_switcher().
void rofi_view_finalize | ( | RofiViewState * | state | ) |
state | The Menu Handle |
Check if a finalize function is set, and if sets executes it.
Definition at line 1126 of file view.c.
References RofiViewState::finalize.
Referenced by rofi_view_maybe_update().
void rofi_view_frame_callback | ( | void | ) |
Update the state if needed.
Definition at line 1481 of file view.c.
References CacheState, and rofi_view_repaint().
Referenced by main_loop_x11_event_handler_view().
void rofi_view_free | ( | RofiViewState * | state | ) |
state | The handle to the view |
Free's the memory allocated for this handle. After a call to this function, state is invalid and can no longer be used.
Definition at line 491 of file view.c.
References RofiViewState::distance, helper_tokenize_free(), RofiViewState::line_map, RofiViewState::main_window, RofiViewState::modi, RofiViewState::num_modi, RofiViewState::tokens, WIDGET, and widget_free().
Referenced by dmenu_finish(), and process_result().
unsigned int rofi_view_get_completed | ( | const RofiViewState * | state | ) |
state | the Menu handle |
Definition at line 530 of file view.c.
References RofiViewState::quit.
Referenced by rofi_view_maybe_update().
unsigned int rofi_view_get_next_position | ( | const RofiViewState * | state | ) |
state | the Menu handle |
Returns the index of the next visible position.
Definition at line 520 of file view.c.
References RofiViewState::line_map, RofiViewState::list_view, listview_get_selected(), RofiViewState::num_lines, and RofiViewState::selected_line.
Referenced by dmenu_finalize().
MenuReturn rofi_view_get_return_value | ( | const RofiViewState * | state | ) |
state | the Menu handle |
Get the return value associated to the users action.
Definition at line 510 of file view.c.
References RofiViewState::retv.
Referenced by dmenu_finalize(), and process_result().
unsigned int rofi_view_get_selected_line | ( | const RofiViewState * | state | ) |
state | The Menu Handle |
Get the selected line.
Definition at line 515 of file view.c.
References RofiViewState::selected_line.
Referenced by dmenu_finalize(), and process_result().
const char* rofi_view_get_user_input | ( | const RofiViewState * | state | ) |
state | the Menu handle |
Definition at line 535 of file view.c.
References RofiViewState::text, and textbox::text.
Referenced by dmenu_finalize(), and process_result().
void rofi_view_handle_mouse_motion | ( | RofiViewState * | state, |
gint | x, | ||
gint | y | ||
) |
state | the Menu handle |
x | The X coordinates of the motion |
y | The Y coordinates of the motion |
Update the state if needed.
Definition at line 1403 of file view.c.
References RofiViewState::motion_target, RofiViewState::mouse, widget_motion_notify(), widget_xy_to_relative(), RofiViewState::x, and RofiViewState::y.
Referenced by main_loop_x11_event_handler_view().
void rofi_view_handle_text | ( | RofiViewState * | state, |
char * | text | ||
) |
state | the Menu handle |
text | The text to add to the input box |
Update the state if needed.
Definition at line 1396 of file view.c.
References RofiViewState::refilter, RofiViewState::text, and textbox_append_text().
Referenced by main_loop_x11_event_handler_view(), and rofi_view_paste().
void rofi_view_maybe_update | ( | RofiViewState * | state | ) |
state | the Menu handle |
Update the state if needed.
Definition at line 1413 of file view.c.
References RofiViewState::refilter, rofi_quit_main_loop(), rofi_view_finalize(), rofi_view_get_active(), rofi_view_get_completed(), rofi_view_refilter(), and rofi_view_update().
Referenced by main_loop_x11_event_handler(), and main_loop_x11_event_handler_view().
void rofi_view_restart | ( | RofiViewState * | state | ) |
state | The Menu Handle |
Restart the menu so it can be displayed again. Resets RofiViewState::quit and RofiViewState::retv.
Definition at line 441 of file view.c.
References MENU_CANCEL, RofiViewState::quit, and RofiViewState::retv.
Referenced by dmenu_finalize(), and rofi_view_switch_mode().
void rofi_view_set_selected_line | ( | RofiViewState * | state, |
unsigned int | selected_line | ||
) |
state | The Menu Handle |
selected_line | The line to select. |
Select a line.
Definition at line 475 of file view.c.
References CacheState, _xcb_stuff::connection, RofiViewState::filtered_lines, RofiViewState::line_map, RofiViewState::list_view, listview_set_selected(), RofiViewState::selected_line, and xcb.
Referenced by dmenu_finalize(), dmenu_switcher_dialog(), and rofi_view_clear_input().
void rofi_view_temp_click_to_exit | ( | RofiViewState * | state, |
xcb_window_t | target | ||
) |
Quit rofi on click (outside of view )
Definition at line 1471 of file view.c.
References CacheState, MENU_CANCEL, MENU_NORMAL_WINDOW, RofiViewState::quit, and RofiViewState::retv.
Referenced by main_loop_x11_event_handler_view().
void rofi_view_temp_configure_notify | ( | RofiViewState * | state, |
xcb_configure_notify_event_t * | xce | ||
) |
Handle window configure event. Handles resizes.
Definition at line 1440 of file view.c.
References CacheState, _xcb_stuff::connection, depth, RofiViewState::height, RofiViewState::main_window, visual, WIDGET, widget_queue_redraw(), widget_resize(), RofiViewState::width, RofiViewState::x, xcb, and RofiViewState::y.
Referenced by main_loop_x11_event_handler_view().
gboolean rofi_view_trigger_action | ( | RofiViewState * | state, |
BindingsScope | scope, | ||
guint | action | ||
) |
state | The handle to the view |
scope | The scope of the action |
action | The action |
Definition at line 1358 of file view.c.
References RofiViewState::main_window, RofiViewState::motion_target, RofiViewState::mouse, rofi_view_trigger_global_action(), SCOPE_GLOBAL, SCOPE_MOUSE_EDITBOX, SCOPE_MOUSE_LISTVIEW, SCOPE_MOUSE_LISTVIEW_ELEMENT, SCOPE_MOUSE_MODE_SWITCHER, SCOPE_MOUSE_SCROLLBAR, WIDGET, widget_find_mouse_target(), widget_trigger_action(), WIDGET_TRIGGER_ACTION_RESULT_GRAB_MOTION_BEGIN, WIDGET_TRIGGER_ACTION_RESULT_GRAB_MOTION_END, WIDGET_TRIGGER_ACTION_RESULT_HANDLED, WIDGET_TRIGGER_ACTION_RESULT_IGNORED, widget_xy_to_relative(), RofiViewState::x, and RofiViewState::y.
Referenced by binding_trigger_action().