|
rofi 2.1.0
|
#include <config.h>#include <errno.h>#include <locale.h>#include <signal.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <unistd.h>#include <xcb/xcb_ewmh.h>#include <xcb/xcb_icccm.h>#include <xcb/xkb.h>#include <xkbcommon/xkbcommon-x11.h>#include <cairo-xcb.h>#include <cairo.h>#include <gio/gio.h>#include "rofi.h"#include <libsn/sn.h>#include "settings.h"#include "timings.h"#include "display.h"#include "helper-theme.h"#include "helper.h"#include "mode.h"#include "modes/modes.h"#include "xcb-internal.h"#include "xrmoptions.h"#include "view-internal.h"#include "view.h"#include "theme.h"#include "xcb.h"
Go to the source code of this file.
Data Structures | |
| struct | [struct].XcbState |
| struct | [struct].BenchMark |
Macros | |
| #define | G_LOG_DOMAIN "View" |
| #define | SN_API_NOT_YET_FROZEN |
Variables | |
| GThreadPool * | tpool |
| static struct | XcbState |
| gboolean | do_bench = TRUE |
| static struct | BenchMark = {.time = NULL, .draws = 0, .last_ts = 0.0, .min = G_MAXDOUBLE} |
| static const int | loc_transtable [9] |
| static view_proxy | view_ |
| const view_proxy * | xcb_view_proxy = &view_ |
| #define SN_API_NOT_YET_FROZEN |
|
static |
Definition at line 168 of file view.c.
References bench_update(), BenchMark, Settings::benchmark_ui, and config.
Referenced by bench_update(), and xcb_rofi_view_repaint().


|
static |
Definition at line 395 of file view.c.
References CURSOR_DEFAULT, CURSOR_POINTER, CURSOR_TEXT, ROFI_CURSOR_DEFAULT, ROFI_CURSOR_POINTER, ROFI_CURSOR_TEXT, and rofi_cursor_type_to_x11_cursor_type().
Referenced by rofi_cursor_type_to_x11_cursor_type(), and xcb_rofi_view_set_cursor().


|
static |
Definition at line 610 of file view.c.
References box_create(), CacheState, config, _xcb_stuff::connection, depth, Settings::dpi, Settings::enable_imdkit, _xcb_stuff::ewmh, _rofi_view_cache_state::flags, helper_validate_font(), input_history_initialize(), _rofi_view_cache_state::main_window, map, Settings::menu_font, MENU_NORMAL_WINDOW, MENU_TRANSIENT_WINDOW, monitor_active(), netatoms, ROFI_ORIENTATION_HORIZONTAL, rofi_theme_get_boolean(), rofi_theme_get_string(), _xcb_stuff::screen, _xcb_stuff::screen_nbr, _xcb_stuff::sncontext, textbox_set_pango_context(), TICK_N, visual, WIDGET, widget_free(), window_set_atom_prop(), x11_disable_decoration(), xcb, xcb___create_window(), xcb_rofi_view_set_window_title(), xcb_rofi_view_setup_fake_transparency(), xcb_stuff_get_root_window(), and XcbState.
Referenced by xcb___create_window().


|
static |
Definition at line 883 of file view.c.
References distance_get_pixel(), RofiViewState::main_window, ROFI_ORIENTATION_VERTICAL, rofi_theme_get_distance(), WIDGET, widget_get_desired_height(), RofiViewState::width, xcb_rofi_view_calculate_window_height(), and XcbState.
Referenced by xcb_rofi_view_calculate_window_height().


|
static |
Definition at line 279 of file view.c.
References config, distance_get_pixel(), RofiViewState::height, loc_transtable, Settings::location, RofiViewState::main_window, rofi_fallthrough, ROFI_ORIENTATION_HORIZONTAL, ROFI_ORIENTATION_VERTICAL, rofi_theme_get_distance(), rofi_theme_get_position(), WIDGET, RofiViewState::width, WL_CENTER, WL_EAST, WL_NORTH, WL_NORTH_EAST, WL_NORTH_WEST, WL_SOUTH, WL_SOUTH_EAST, WL_SOUTH_WEST, WL_WEST, RofiViewState::x, Settings::x_offset, xcb_rofi_view_calculate_window_position(), XcbState, RofiViewState::y, and Settings::y_offset.
Referenced by xcb_rofi_view_calculate_window_position().


|
static |
| state | Internal state of the menu. |
Calculate the width of the window and the width of an element.
Definition at line 812 of file view.c.
References DEFAULT_MENU_WIDTH, distance_get_pixel(), RofiViewState::main_window, ROFI_ORIENTATION_HORIZONTAL, rofi_theme_get_distance(), WIDGET, RofiViewState::width, xcb_rofi_view_calculate_window_width(), and XcbState.
Referenced by xcb_rofi_view_calculate_window_width().


|
static |
Definition at line 908 of file view.c.
References CacheState, _xcb_stuff::connection, input_history_save(), _rofi_view_cache_state::main_window, map, _rofi_view_cache_state::overlay_timeout, _rofi_view_cache_state::refilter_timeout, _rofi_view_cache_state::user_timeout, _rofi_view_cache_state::views, xcb, xcb_rofi_view_cleanup(), xcb_stuff_set_clipboard(), XCB_WINDOW_NONE, and XcbState.
Referenced by xcb_rofi_view_cleanup().


|
static |
Definition at line 874 of file view.c.
References xcb_rofi_view_frame_callback(), xcb_rofi_view_repaint(), and XcbState.
Referenced by xcb_rofi_view_frame_callback().


|
static |
Definition at line 139 of file view.c.
References xcb_rofi_view_get_current_monitor(), and XcbState.
Referenced by xcb_rofi_view_get_current_monitor().


|
static |
Definition at line 962 of file view.c.
References CacheState, _rofi_view_cache_state::main_window, and xcb_rofi_view_get_window().
Referenced by xcb_rofi_view_get_window().


|
static |
Definition at line 900 of file view.c.
References CacheState, _xcb_stuff::connection, display_early_cleanup(), display_revert_input_focus(), _rofi_view_cache_state::main_window, xcb, xcb_rofi_view_hide(), and XCB_WINDOW_NONE.
Referenced by xcb_rofi_view_hide().


|
static |
Definition at line 422 of file view.c.
References CacheState, config, _xcb_stuff::connection, Settings::hover_select, _rofi_view_cache_state::main_window, rofi_view_handle_mouse_motion(), xcb, and xcb_rofi_view_ping_mouse().
Referenced by xcb_rofi_view_ping_mouse().


|
static |
Definition at line 466 of file view.c.
References rofi_view_get_active(), xcb_rofi_view_queue_redraw(), xcb_rofi_view_repaint(), and XcbState.
Referenced by xcb_rofi_view_queue_redraw(), and xcb_rofi_view_reload_idle().


|
static |
Definition at line 459 of file view.c.
References xcb_rofi_view_reload(), xcb_rofi_view_reload_idle(), and XcbState.
Referenced by xcb_rofi_view_reload().


|
static |
Definition at line 438 of file view.c.
References mode_get_num_entries(), RofiViewState::refilter, RofiViewState::reload, rofi_view_get_active(), RofiViewState::sw, RofiViewState::tb_total_rows, textbox_text(), xcb_rofi_view_queue_redraw(), xcb_rofi_view_reload_idle(), and XcbState.
Referenced by xcb_rofi_view_reload(), and xcb_rofi_view_reload_idle().


|
static |
Definition at line 192 of file view.c.
References bench_update(), CacheState, _xcb_stuff::connection, RofiViewState::height, _rofi_view_cache_state::main_window, rofi_view_get_active(), rofi_view_update(), TICK_N, RofiViewState::width, xcb, xcb_rofi_view_repaint(), and XcbState.
Referenced by xcb_rofi_view_frame_callback(), xcb_rofi_view_queue_redraw(), and xcb_rofi_view_repaint().


|
static |
Definition at line 410 of file view.c.
References CacheState, _rofi_view_cache_state::main_window, rofi_cursor_type_to_x11_cursor_type(), x11_set_cursor(), xcb_rofi_view_set_cursor(), and XcbState.
Referenced by xcb_rofi_view_set_cursor().


|
static |
Definition at line 966 of file view.c.
References CacheState, _xcb_stuff::connection, _xcb_stuff::ewmh, _rofi_view_cache_state::main_window, xcb, and xcb_rofi_view_set_window_title().
Referenced by xcb___create_window(), and xcb_rofi_view_set_window_title().


|
static |
Select Background to use for fake transparency. Current options: 'real', 'screenshot','background'
Definition at line 478 of file view.c.
References cairo_image_surface_blur(), rofi_expand_path(), rofi_theme_get_integer(), TICK_N, WIDGET, x11_helper_get_bg_surface(), x11_helper_get_screenshot_surface(), xcb_rofi_view_setup_fake_transparency(), and XcbState.
Referenced by xcb___create_window(), and xcb_rofi_view_setup_fake_transparency().


|
static |
Quit rofi on click (outside of view )
Definition at line 864 of file view.c.
References CacheState, _rofi_view_cache_state::flags, _rofi_view_cache_state::main_window, MENU_CANCEL, MENU_NORMAL_WINDOW, RofiViewState::quit, RofiViewState::retv, and xcb_rofi_view_temp_click_to_exit().
Referenced by xcb_rofi_view_temp_click_to_exit().


|
static |
Handle window configure event. Handles resizes.
Definition at line 830 of file view.c.
References CacheState, _xcb_stuff::connection, depth, RofiViewState::height, _rofi_view_cache_state::main_window, RofiViewState::main_window, visual, WIDGET, widget_queue_redraw(), widget_resize(), RofiViewState::width, RofiViewState::x, xcb, xcb_rofi_view_temp_configure_notify(), XcbState, and RofiViewState::y.
Referenced by xcb_rofi_view_temp_configure_notify().


|
static |
| state | The handle to the view |
| qr | Indicate if queue_redraw should be called on changes. |
Update the state of the view. This involves filter state.
Definition at line 218 of file view.c.
References config, Settings::enable_imdkit, RofiViewState::main_window, rofi_set_im_window_pos(), rofi_view_queue_redraw(), RofiViewState::text, textbox_get_cursor_x_pos(), TICK, TICK_N, WIDGET, textbox::widget, widget_draw(), widget_get_height(), widget_get_x_pos(), widget_get_y_pos(), widget_need_redraw(), RofiViewState::x, xcb_rofi_view_update(), XcbState, and RofiViewState::y.
Referenced by xcb_rofi_view_update().


|
static |
Definition at line 366 of file view.c.
References CacheState, _xcb_stuff::connection, depth, RofiViewState::height, _rofi_view_cache_state::main_window, RofiViewState::main_window, visual, WIDGET, widget_resize(), RofiViewState::width, RofiViewState::x, xcb, xcb_rofi_view_window_update_size(), XcbState, and RofiViewState::y.
Referenced by xcb_rofi_view_window_update_size().


| struct [struct].BenchMark BenchMark |
Referenced by bench_update().
| gboolean do_bench = TRUE |
|
static |
Calculates the window position Convert the old location to the new location type. 123 804 765
nw n ne w c e sw s se
|
static |
| struct [struct].XcbState XcbState |
Referenced by xcb___create_window(), xcb_rofi_view_calculate_window_height(), xcb_rofi_view_calculate_window_position(), xcb_rofi_view_calculate_window_width(), xcb_rofi_view_cleanup(), xcb_rofi_view_frame_callback(), xcb_rofi_view_get_current_monitor(), xcb_rofi_view_queue_redraw(), xcb_rofi_view_reload(), xcb_rofi_view_reload_idle(), xcb_rofi_view_repaint(), xcb_rofi_view_set_cursor(), xcb_rofi_view_setup_fake_transparency(), xcb_rofi_view_temp_configure_notify(), xcb_rofi_view_update(), and xcb_rofi_view_window_update_size().