rofi 2.1.0
ViewHandle
Collaboration diagram for ViewHandle:

Data Structures

struct  RofiViewState
struct  RofiViewState::[struct].mouse

Typedefs

typedef struct RofiViewState RofiViewState

Enumerations

enum  MenuFlags {
  MENU_NORMAL = 0 , MENU_PASSWORD = 1 , MENU_NORMAL_WINDOW = 2 , MENU_ERROR_DIALOG = 4 ,
  MENU_TRANSIENT_WINDOW = 8
}

Functions

RofiViewState * rofi_view_create (Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
void rofi_view_finalize (RofiViewState *state)
MenuReturn rofi_view_get_return_value (const RofiViewState *state)
unsigned int rofi_view_get_next_position (const RofiViewState *state)
void rofi_view_handle_text (RofiViewState *state, const char *text)
void rofi_view_handle_mouse_motion (RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
void rofi_view_maybe_update (RofiViewState *state)
void rofi_view_temp_configure_notify (RofiViewState *state, xcb_configure_notify_event_t *xce)
void rofi_view_temp_click_to_exit (RofiViewState *state, xcb_window_t target)
void rofi_view_frame_callback (void)
unsigned int rofi_view_get_completed (const RofiViewState *state)
const char * rofi_view_get_user_input (const RofiViewState *state)
void rofi_view_set_selected_line (RofiViewState *state, unsigned int selected_line)
unsigned int rofi_view_get_selected_line (const RofiViewState *state)
unsigned int rofi_view_get_element_pitch (const RofiViewState *state, RofiOrientation orientation)
void rofi_view_restart (RofiViewState *state)
gboolean rofi_view_check_action (RofiViewState *state, BindingsScope scope, guint action)
void rofi_view_trigger_action (RofiViewState *state, BindingsScope scope, guint action)
void rofi_view_free (RofiViewState *state)

Detailed Description

Typedef Documentation

◆ RofiViewState

typedef struct RofiViewState RofiViewState

Definition at line 54 of file view.h.

Enumeration Type Documentation

◆ MenuFlags

enum MenuFlags
Enumerator
MENU_NORMAL 

Create a menu for entering text

MENU_PASSWORD 

Create a menu for entering passwords

MENU_NORMAL_WINDOW 

Create amanaged window.

MENU_ERROR_DIALOG 

ERROR dialog

MENU_TRANSIENT_WINDOW 

Create transient window.

Definition at line 55 of file view.h.

Function Documentation

◆ rofi_view_check_action()

gboolean rofi_view_check_action ( RofiViewState * state,
BindingsScope scope,
guint action )

◆ rofi_view_create()

RofiViewState * rofi_view_create ( Mode * sw,
const char * input,
MenuFlags menu_flags,
void(* finalize )(RofiViewState *) )
Parameters
swthe Mode to show.
inputA pointer to a string where the inputted data is placed.
menu_flagsFlags indicating state of the menu.
finalizethe finalize callback

Main menu callback.

Returns
The command issued (see MenuReturn)

Definition at line 1860 of file view.c.

References __rofi_view_state_create(), box_create(), CacheState, config, _xcb_stuff::connection, Settings::disable_history, display_set_input_focus(), RofiViewState::distance, _rofi_view_cache_state::entry_history_enable, RofiViewState::finalize, _rofi_view_cache_state::flags, RofiViewState::height, RofiViewState::line_map, RofiViewState::list_view, listview_set_fixed_num_lines(), _rofi_view_cache_state::main_window, RofiViewState::main_window, MENU_CANCEL, RofiViewState::menu_flags, MENU_NORMAL_WINDOW, MENU_PASSWORD, mode_get_display_name(), mode_get_num_entries(), RofiViewState::mouse_seen, RofiViewState::num_lines, RofiViewState::previous_line, RofiViewState::quit, RofiViewState::refilter, RofiViewState::retv, ROFI_ORIENTATION_VERTICAL, rofi_theme_get_list_strings(), rofi_view_add_widget(), rofi_view_calculate_window_height(), rofi_view_calculate_window_position(), rofi_view_calculate_window_width(), rofi_view_create(), rofi_view_ping_mouse(), rofi_view_refilter(), rofi_view_set_user_timeout(), rofi_view_set_window_title(), 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(), and xcb.

Referenced by dmenu_mode_dialog(), rofi_view_create(), and run_mode_index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_finalize()

void rofi_view_finalize ( RofiViewState * state)
Parameters
stateThe Menu Handle

Check if a finalize function is set, and if sets executes it.

Definition at line 1003 of file view.c.

References RofiViewState::finalize, and rofi_view_finalize().

Referenced by rofi_view_finalize(), and rofi_view_maybe_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_frame_callback()

void rofi_view_frame_callback ( void )

Update the state if needed.

Definition at line 2191 of file view.c.

References _view_proxy::frame_callback, proxy, and rofi_view_frame_callback().

Referenced by main_loop_x11_event_handler_view(), rofi_view_frame_callback(), and wayland_frame_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_free()

void rofi_view_free ( RofiViewState * state)
Parameters
stateThe 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 392 of file view.c.

References RofiViewState::distance, helper_tokenize_free(), RofiViewState::line_map, RofiViewState::main_window, RofiViewState::modes, RofiViewState::num_modes, rofi_view_free(), RofiViewState::tokens, WIDGET, and widget_free().

Referenced by dmenu_finish(), process_result(), and rofi_view_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_get_completed()

unsigned int rofi_view_get_completed ( const RofiViewState * state)
Parameters
statethe Menu handle
Returns
returns if this state is completed.

Definition at line 435 of file view.c.

References RofiViewState::quit, and rofi_view_get_completed().

Referenced by rofi_view_get_completed(), and rofi_view_maybe_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_get_element_pitch()

unsigned int rofi_view_get_element_pitch ( const RofiViewState * state,
RofiOrientation orientation )
Parameters
stateThe Menu Handle
orientationThe axis to measure along

The distance from one list element to the next along the axis.

Returns
the distance in pixels, or 0 if the menu shows no list elements.

Definition at line 418 of file view.c.

References RofiViewState::list_view, listview_get_element_pitch(), and rofi_view_get_element_pitch().

Referenced by rofi_view_get_element_pitch(), and wayland_touch_scroll_step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_get_next_position()

unsigned int rofi_view_get_next_position ( const RofiViewState * state)
Parameters
statethe Menu handle

Returns the index of the next visible position.

Returns
the next position.

Definition at line 426 of file view.c.

References RofiViewState::line_map, RofiViewState::list_view, listview_get_selected(), RofiViewState::num_lines, rofi_view_get_next_position(), and RofiViewState::selected_line.

Referenced by dmenu_finalize(), and rofi_view_get_next_position().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_get_return_value()

MenuReturn rofi_view_get_return_value ( const RofiViewState * state)
Parameters
statethe Menu handle

Get the return value associated to the users action.

Returns
the return value

Definition at line 410 of file view.c.

References RofiViewState::retv, and rofi_view_get_return_value().

Referenced by dmenu_finalize(), process_result(), and rofi_view_get_return_value().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_get_selected_line()

unsigned int rofi_view_get_selected_line ( const RofiViewState * state)
Parameters
stateThe Menu Handle

Get the selected line.

Returns
the selected line or UINT32_MAX if none selected.

Definition at line 414 of file view.c.

References rofi_view_get_selected_line(), and RofiViewState::selected_line.

Referenced by dmenu_finalize(), process_result(), and rofi_view_get_selected_line().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_get_user_input()

const char * rofi_view_get_user_input ( const RofiViewState * state)
Parameters
statethe Menu handle
Returns
the raw user input.

Definition at line 439 of file view.c.

References rofi_view_get_user_input(), RofiViewState::text, and textbox::text.

Referenced by dmenu_finalize(), process_result(), and rofi_view_get_user_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_handle_mouse_motion()

void rofi_view_handle_mouse_motion ( RofiViewState * state,
gint x,
gint y,
gboolean find_mouse_target )
Parameters
statethe Menu handle
xThe X coordinates of the motion
yThe Y coordinates of the motion
find_mouse_targetif we should handle pure mouse motion

Update the state if needed.

Definition at line 1500 of file view.c.

References RofiViewState::main_window, RofiViewState::mouse, rofi_view_handle_mouse_motion(), rofi_view_resolve_cursor(), rofi_view_set_cursor(), WIDGET, widget_find_mouse_target(), widget_motion_notify(), WIDGET_TYPE_LISTVIEW_ELEMENT, widget_xy_to_relative(), RofiViewState::x, and RofiViewState::y.

Referenced by main_loop_x11_event_handler_view(), rofi_view_handle_mouse_motion(), wayland_pointer_send_events(), and xcb_rofi_view_ping_mouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_handle_text()

void rofi_view_handle_text ( RofiViewState * state,
const char * text )
Parameters
statethe Menu handle
textThe text to add to the input box

Update the state if needed.

Definition at line 1463 of file view.c.

References RofiViewState::refilter, rofi_view_handle_text(), rofi_view_input_changed(), RofiViewState::text, and textbox_append_text().

Referenced by rofi_key_press_event_handler(), rofi_view_handle_text(), rofi_view_paste(), text_input_commit_string(), wayland_key_repeat(), wayland_key_repeat_delay(), and wayland_keyboard_key().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_maybe_update()

◆ rofi_view_restart()

void rofi_view_restart ( RofiViewState * state)
Parameters
stateThe Menu Handle

Restart the menu so it can be displayed again. Resets RofiViewState::quit and RofiViewState::retv.

Definition at line 316 of file view.c.

References MENU_CANCEL, RofiViewState::quit, RofiViewState::retv, and rofi_view_restart().

Referenced by dmenu_finalize(), rofi_view_restart(), and rofi_view_switch_mode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_set_selected_line()

void rofi_view_set_selected_line ( RofiViewState * state,
unsigned int selected_line )
Parameters
stateThe Menu Handle
selected_lineThe line to select.

Select a line.

Definition at line 369 of file view.c.

References Settings::backend, CacheState, config, _xcb_stuff::connection, DISPLAY_XCB, RofiViewState::filtered_lines, RofiViewState::line_map, RofiViewState::list_view, listview_set_selected(), _rofi_view_cache_state::main_window, rofi_view_set_selected_line(), RofiViewState::selected_line, and xcb.

Referenced by dmenu_finalize(), dmenu_mode_dialog(), rofi_view_clear_input(), rofi_view_set_selected_line(), run_mode_index(), and script_mode_result().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_temp_click_to_exit()

void rofi_view_temp_click_to_exit ( RofiViewState * state,
xcb_window_t target )

Definition at line 2187 of file view.c.

References proxy, rofi_view_temp_click_to_exit(), and _view_proxy::temp_click_to_exit.

Referenced by main_loop_x11_event_handler_view(), and rofi_view_temp_click_to_exit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_temp_configure_notify()

void rofi_view_temp_configure_notify ( RofiViewState * state,
xcb_configure_notify_event_t * xce )

Definition at line 2182 of file view.c.

References proxy, rofi_view_temp_configure_notify(), and _view_proxy::temp_configure_notify.

Referenced by main_loop_x11_event_handler_view(), and rofi_view_temp_configure_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_view_trigger_action()