|
rofi 2.1.0
|


Go to the source code of this file.
Typedefs | |
| typedef guint(*) | disp_scale_func(void) |
Variables | |
| ThemeWidget * | rofi_theme |
| ThemeWidget * | rofi_configuration |
| typedef guint(*) disp_scale_func(void) |
| void distance_get_linestyle | ( | RofiDistance | d, |
| cairo_t * | draw ) |
| d | The distance handle. |
| draw | The cairo drawable. |
Set linestyle.
Definition at line 1408 of file theme.c.
References distance_get_linestyle(), ROFI_HL_DASH, and RofiDistance::style.
Referenced by distance_get_linestyle(), rofi_theme_parse_string(), and widget_draw().


| int distance_get_pixel | ( | RofiDistance | d, |
| RofiOrientation | ori ) |
| d | The distance handle. |
| ori | The orientation. |
Convert RofiDistance into pixels.
Definition at line 1404 of file theme.c.
References RofiDistance::base, distance_get_pixel(), and distance_unit_get_pixel().
Referenced by barview_draw(), box_get_desired_height(), box_get_desired_width(), distance_get_pixel(), hori_calculate_size(), icon_create(), listview_draw(), listview_get_desired_height(), listview_get_element_pitch(), listview_resize(), rofi_get_offset_px(), rofi_theme_parse_string(), scrollbar_create(), textbox_draw(), textbox_get_desired_width(), textbox_tab_stops(), vert_calculate_size(), wayland_rofi_view_calculate_window_height(), wayland_rofi_view_calculate_window_width(), widget_draw(), widget_padding_get_bottom(), widget_padding_get_left(), widget_padding_get_right(), widget_padding_get_top(), xcb_rofi_view_calculate_window_height(), xcb_rofi_view_calculate_window_position(), and xcb_rofi_view_calculate_window_width().


| ThemeWidget * rofi_theme_find_or_create_name | ( | ThemeWidget * | base, |
| const char * | name ) |
| base | Handle to the current level in the theme. |
| name | Name of the new element. |
Create a new element in the theme structure.
Definition at line 83 of file theme.c.
References ThemeWidget::name, ThemeWidget::num_widgets, ThemeWidget::parent, rofi_theme_find_or_create_name(), and ThemeWidget::widgets.
Referenced by dmenu_mode_init(), rofi_theme_find_or_create_name(), and rofi_theme_parse_merge_widgets().


| ThemeWidget * rofi_theme_find_widget | ( | const char * | name, |
| const char * | state, | ||
| gboolean | exact ) |
Low-level functions. These can be used by non-widgets to obtain values.
| name | The name of the element to find. |
| state | The state of the element. |
| exact | If the match should be exact, or parent can be included. |
Find the theme element. If not exact, the closest specified element is returned.
Definition at line 790 of file theme.c.
References rofi_theme, rofi_theme_find(), rofi_theme_find_single(), and rofi_theme_find_widget().
Referenced by rofi_theme_find_widget(), rofi_theme_get_boolean(), rofi_theme_get_boolean_inside(), rofi_theme_get_color(), rofi_theme_get_color_inside(), rofi_theme_get_cursor_type(), rofi_theme_get_cursor_type_inside(), rofi_theme_get_distance(), rofi_theme_get_distance_inside(), rofi_theme_get_double(), rofi_theme_get_double_inside(), rofi_theme_get_double_integer_fb_inside(), rofi_theme_get_highlight(), rofi_theme_get_highlight_inside(), rofi_theme_get_image(), rofi_theme_get_image_inside(), rofi_theme_get_integer(), rofi_theme_get_integer_inside(), rofi_theme_get_list_distance(), rofi_theme_get_list_inside(), rofi_theme_get_list_strings(), rofi_theme_get_orientation(), rofi_theme_get_orientation_inside(), rofi_theme_get_padding(), rofi_theme_get_padding_inside(), rofi_theme_get_position(), rofi_theme_get_position_inside(), rofi_theme_get_string(), rofi_theme_get_string_inside(), rofi_theme_has_property(), rofi_theme_has_property_inside(), and rofi_theme_parse_string().


| void rofi_theme_free | ( | ThemeWidget * | widget | ) |
| widget |
Free the widget and alll children.
Definition at line 242 of file theme.c.
References ThemeWidget::media, ThemeWidget::name, ThemeWidget::num_widgets, ThemeWidget::properties, rofi_theme_free(), and ThemeWidget::widgets.
Referenced by cleanup(), main(), rofi_theme_free(), rofi_theme_parse_process_conditionals_int(), and rofi_theme_reset().


| void rofi_theme_free_parsed_files | ( | void | ) |
Free memory.
cleanup (free) the list of parsed config files.
Definition at line 56 of file theme.c.
References parsed_config_files, and rofi_theme_free_parsed_files().
Referenced by cleanup(), rofi_theme_free_parsed_files(), and rofi_theme_parse_string().


| int rofi_theme_get_boolean | ( | const widget * | widget, |
| const char * | property, | ||
| int | def ) |
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the boolean of the widget.
Definition at line 903 of file theme.c.
References _widget::name, P_BOOLEAN, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_boolean(), rofi_theme_get_boolean_inside(), and _widget::state.
Referenced by box_add(), icon_create(), listview_create(), rofi_theme_get_boolean(), rofi_theme_parse_string(), scrollbar_draw(), textbox_create(), textbox_draw(), wayland___create_window(), widget_init(), and xcb___create_window().


| void rofi_theme_get_color | ( | const widget * | widget, |
| const char * | property, | ||
| cairo_t * | d ) |
| widget | The widget to query |
| property | The property to query. |
| d | The drawable to apply color. |
Obtain the color of the widget and applies this to the drawable d.
Definition at line 1067 of file theme.c.
References _widget::name, P_COLOR, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_color(), rofi_theme_get_color_inside(), and _widget::state.
Referenced by icon_draw(), rofi_theme_get_color(), rofi_theme_parse_string(), scrollbar_draw(), textbox_draw(), and widget_draw().


| RofiCursorType rofi_theme_get_cursor_type | ( | const widget * | widget, |
| const char * | property, | ||
| RofiCursorType | def ) |
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the cursor indicated by property of the widget.
Definition at line 962 of file theme.c.
References _widget::name, P_CURSOR, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_cursor_type(), rofi_theme_get_cursor_type_inside(), and _widget::state.
Referenced by rofi_theme_get_cursor_type(), rofi_theme_parse_string(), and widget_init().


| RofiDistance rofi_theme_get_distance | ( | const widget * | widget, |
| const char * | property, | ||
| int | def ) |
Public API
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the distance of the widget.
Definition at line 877 of file theme.c.
References _widget::name, P_PADDING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_distance(), rofi_theme_get_distance_inside(), and _widget::state.
Referenced by box_create(), box_get_desired_width(), icon_create(), listview_create(), rofi_get_offset_px(), rofi_theme_get_distance(), rofi_theme_parse_string(), scrollbar_create(), textbox_draw(), textbox_get_desired_width(), wayland_rofi_view_calculate_window_height(), wayland_rofi_view_calculate_window_width(), xcb_rofi_view_calculate_window_height(), xcb_rofi_view_calculate_window_position(), and xcb_rofi_view_calculate_window_width().


| double rofi_theme_get_double | ( | const widget * | widget, |
| const char * | property, | ||
| double | def ) |
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the double of the widget.
Definition at line 1040 of file theme.c.
References _widget::name, P_DOUBLE, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_double(), rofi_theme_get_double_inside(), and _widget::state.
Referenced by icon_create(), rofi_theme_get_double(), rofi_theme_parse_string(), textbox_create(), and textbox_draw().


| RofiHighlightColorStyle rofi_theme_get_highlight | ( | widget * | widget, |
| const char * | property, | ||
| RofiHighlightColorStyle | th ) |
| widget | The widget to query |
| property | The property to query. |
| th | The default value. |
Obtain the highlight .
Definition at line 1308 of file theme.c.
References _widget::name, P_COLOR, P_HIGHLIGHT, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_highlight(), rofi_theme_get_highlight_inside(), and _widget::state.
Referenced by __textbox_update_pango_text(), rofi_theme_get_highlight(), rofi_theme_parse_string(), and update_callback().


| gboolean rofi_theme_get_image | ( | const widget * | widget, |
| const char * | property, | ||
| cairo_t * | d ) |
| widget | The widget to query |
| property | The property to query. |
| d | The drawable to apply color. |
Obtain the image of the widget and applies this to the drawable d.
Definition at line 1174 of file theme.c.
References _widget::name, P_IMAGE, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_image(), rofi_theme_get_image_inside(), and _widget::state.
Referenced by rofi_theme_get_image(), rofi_theme_parse_string(), and widget_draw().


| int rofi_theme_get_integer | ( | const widget * | widget, |
| const char * | property, | ||
| int | def ) |
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the integer of the widget.
Definition at line 842 of file theme.c.
References _widget::name, P_INTEGER, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_integer(), rofi_theme_get_integer_inside(), and _widget::state.
Referenced by listview_create(), rofi_theme_get_integer(), rofi_theme_parse_string(), rofi_view_set_overlay_timeout(), and xcb_rofi_view_setup_fake_transparency().


| GList * rofi_theme_get_list_distance | ( | const widget * | widget, |
| const char * | property ) |
| widget | The widget handle. |
| property | The property to query. |
Returns a list of allocated RofiDistance objects that should be freed.
Definition at line 1234 of file theme.c.
References _PropertyValue::i, RofiPadding::left, _widget::name, P_INTEGER, P_LIST, P_PADDING, _PropertyValue::padding, ROFI_DISTANCE_MODIFIER_NONE, ROFI_HL_SOLID, ROFI_PU_PX, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_list_distance(), rofi_theme_get_list_inside(), _widget::state, Property::type, and Property::value.
Referenced by rofi_theme_get_list_distance(), rofi_theme_print_parsed_files(), and textbox_tab_stops().


| GList * rofi_theme_get_list_strings | ( | const widget * | widget, |
| const char * | property ) |
| widget | The widget handle. |
| property | The property to query. |
Returns a list of allocated strings othat should be freed.
Definition at line 1260 of file theme.c.
References _widget::name, P_LIST, P_STRING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_list_inside(), rofi_theme_get_list_strings(), _PropertyValue::s, _widget::state, Property::type, and Property::value.
Referenced by listview_add_widget(), listview_create_row(), rofi_theme_get_list_strings(), rofi_theme_print_parsed_files(), rofi_view_add_widget(), and rofi_view_create().


| RofiOrientation rofi_theme_get_orientation | ( | const widget * | widget, |
| const char * | property, | ||
| RofiOrientation | def ) |
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the orientation indicated by property of the widget.
Definition at line 931 of file theme.c.
References _widget::name, P_ORIENTATION, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_orientation(), rofi_theme_get_orientation_inside(), and _widget::state.
Referenced by box_create(), listview_create(), rofi_theme_get_orientation(), and rofi_theme_parse_string().


| RofiPadding rofi_theme_get_padding | ( | const widget * | widget, |
| const char * | property, | ||
| RofiPadding | pad ) |
| widget | The widget to query |
| property | The property to query. |
| pad | The default value. |
Obtain the padding of the widget.
Definition at line 1208 of file theme.c.
References _widget::name, P_PADDING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_padding(), rofi_theme_get_padding_inside(), and _widget::state.
Referenced by rofi_theme_get_padding(), rofi_theme_parse_string(), widget_init(), and widget_set_state().


| int rofi_theme_get_position | ( | const widget * | widget, |
| const char * | property, | ||
| int | def ) |
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the position of the widget.
Definition at line 818 of file theme.c.
References _widget::name, P_POSITION, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_position(), rofi_theme_get_position_inside(), and _widget::state.
Referenced by rofi_get_location(), rofi_theme_get_position(), rofi_theme_parse_string(), and xcb_rofi_view_calculate_window_position().


| const char * rofi_theme_get_string | ( | const widget * | widget, |
| const char * | property, | ||
| const char * | def ) |
| widget | The widget to query |
| property | The property to query. |
| def | The default value. |
Obtain the string of the widget.
Definition at line 989 of file theme.c.
References _widget::name, P_STRING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_string(), rofi_theme_get_string_inside(), and _widget::state.
Referenced by icon_create(), listview_add_widget(), rofi_theme_get_string(), rofi_theme_parse_string(), rofi_view_add_widget(), textbox_button_trigger_action(), textbox_create(), textbox_initialize_font(), wayland___create_window(), and xcb___create_window().


| gboolean rofi_theme_has_property | ( | const widget * | widget, |
| const PropertyType | type, | ||
| const char * | property ) |
| widget | The widget to query |
| type | The type to check |
| property | The property to query. |
Check if a rofi theme has a property set.
Definition at line 1653 of file theme.c.
References _widget::name, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_has_property(), rofi_theme_has_property_inside(), and _widget::state.
Referenced by icon_draw(), rofi_theme_has_property(), and rofi_theme_parse_string().


| gboolean rofi_theme_parse_file | ( | const char * | file | ) |
| file | filename to parse. |
Parse the input theme file.
References rofi_theme_parse_file().
Referenced by main(), rofi_theme_parse_file(), and rofi_theme_rasi_validate().


| ThemeMediaType rofi_theme_parse_media_type | ( | const char * | type | ) |
| type | the media type to parse. |
Returns the media type described by type.
Definition at line 1607 of file theme.c.
References rofi_theme_parse_media_type(), THEME_MEDIA_TYPE_BOOLEAN, THEME_MEDIA_TYPE_INVALID, THEME_MEDIA_TYPE_MAX_ASPECT_RATIO, THEME_MEDIA_TYPE_MAX_HEIGHT, THEME_MEDIA_TYPE_MAX_WIDTH, THEME_MEDIA_TYPE_MIN_ASPECT_RATIO, THEME_MEDIA_TYPE_MIN_HEIGHT, THEME_MEDIA_TYPE_MIN_WIDTH, and THEME_MEDIA_TYPE_MON_ID.
Referenced by rofi_theme_parse_media_type(), and rofi_theme_parse_string().


| void rofi_theme_parse_merge_widgets | ( | ThemeWidget * | parent, |
| ThemeWidget * | child ) |
| parent | target theme tree |
| child | source theme three |
Merge all the settings from child into parent.
Definition at line 1428 of file theme.c.
References ThemeWidget::media, ThemeWidget::name, ThemeWidget::num_widgets, ThemeWidget::properties, rofi_theme, rofi_theme_find_or_create_name(), rofi_theme_parse_merge_widgets(), rofi_theme_widget_add_properties(), and ThemeWidget::widgets.
Referenced by rofi_theme_parse_merge_widgets(), rofi_theme_parse_process_conditionals_int(), and rofi_theme_parse_string().


| char * rofi_theme_parse_prepare_file | ( | const char * | file | ) |
| file | File name to prepare. |
Tries to find full path relative to parent file.
Definition at line 1417 of file theme.c.
References parsed_config_files, and rofi_theme_parse_prepare_file().
Referenced by rofi_theme_parse_prepare_file(), and rofi_theme_parse_string().


| void rofi_theme_parse_process_conditionals | ( | void | ) |
Process conditionals.
Definition at line 1601 of file theme.c.
References monitor_active(), rofi_theme, rofi_theme_parse_process_conditionals(), and rofi_theme_parse_process_conditionals_int().
Referenced by main(), rofi_theme_parse_process_conditionals(), and rofi_theme_parse_string().


| void rofi_theme_parse_process_links | ( | void | ) |
Process links.
Definition at line 1597 of file theme.c.
References rofi_theme, rofi_theme_parse_process_links(), and rofi_theme_parse_process_links_int().
Referenced by main(), rofi_theme_parse_process_links(), rofi_theme_parse_string(), and rofi_theme_rasi_validate().


| gboolean rofi_theme_parse_string | ( | const char * | string | ) |
| string | to parse. |
Parse the input string in addition to theme file.
References distance_get_linestyle(), distance_get_pixel(), rofi_theme_find_widget(), rofi_theme_free_parsed_files(), rofi_theme_get_boolean(), rofi_theme_get_color(), rofi_theme_get_cursor_type(), rofi_theme_get_distance(), rofi_theme_get_double(), rofi_theme_get_highlight(), rofi_theme_get_image(), rofi_theme_get_integer(), rofi_theme_get_orientation(), rofi_theme_get_padding(), rofi_theme_get_position(), rofi_theme_get_string(), rofi_theme_has_property(), rofi_theme_parse_media_type(), rofi_theme_parse_merge_widgets(), rofi_theme_parse_prepare_file(), rofi_theme_parse_process_conditionals(), rofi_theme_parse_process_links(), rofi_theme_parse_string(), rofi_theme_property_copy_distance(), rofi_theme_rasi_validate(), rofi_theme_reset(), and rofi_theme_widget_add_properties().
Referenced by config_parse_cmd_options(), main(), parse_header_entry(), and rofi_theme_parse_string().


| void rofi_theme_print | ( | ThemeWidget * | widget | ) |
| widget | The widget handle. |
Print out the widget to the commandline.
Definition at line 595 of file theme.c.
References rofi_theme_print(), and rofi_theme_print_index().
Referenced by main(), and rofi_theme_print().


| void rofi_theme_print_index | ( | ThemeWidget * | widget, |
| int | index ) |
| widget | The widget handle. |
| index | The indenting index. |
Print out the widget to the commandline indented by index.
Definition at line 535 of file theme.c.
References ThemeWidget::media, Property::name, ThemeWidget::name, ThemeWidget::num_widgets, ThemeWidget::parent, ThemeWidget::properties, rofi_theme_print_index(), rofi_theme_print_property_index(), and ThemeWidget::widgets.
Referenced by config_parse_dump_config_rasi_format(), rofi_theme_print(), and rofi_theme_print_index().


| void rofi_theme_print_parsed_files | ( | int | is_term | ) |
| is_term | Indicate if printed to terminal. |
Print the list of parsed config files.
References rofi_theme_get_list_distance(), rofi_theme_get_list_strings(), and rofi_theme_print_parsed_files().

| p | The property to free. |
| data | User data (unused) |
Make a newly allocted copy of the property.
Definition at line 133 of file theme.c.
References RofiPadding::bottom, RofiImage::colors, _PropertyValue::image, RofiPadding::left, _PropertyValue::link, _PropertyValue::list, Property::name, P_IMAGE, P_LINK, P_LIST, P_PADDING, P_STRING, _PropertyValue::padding, RofiPadding::right, rofi_theme_property_copy(), rofi_theme_property_copy_distance(), rofi_theme_property_create(), _PropertyValue::s, RofiPadding::top, Property::type, RofiImage::url, and Property::value.
Referenced by config_parse_set_property(), rofi_theme_copy_property_int(), and rofi_theme_property_copy().


| RofiDistance rofi_theme_property_copy_distance | ( | RofiDistance const | distance | ) |
| distance | The distance object to copy. |
Definition at line 121 of file theme.c.
References RofiDistance::base, RofiDistanceUnit::left, RofiDistanceUnit::right, rofi_theme_property_copy_distance(), and rofi_theme_property_copy_distance_unit().
Referenced by rofi_theme_parse_string(), rofi_theme_property_copy(), and rofi_theme_property_copy_distance().


| Property * rofi_theme_property_create | ( | PropertyType | type | ) |
| type | The type of the property to create. |
Create a theme property of type.
Properties
Definition at line 103 of file theme.c.
References rofi_theme_property_create(), and Property::type.
Referenced by dmenu_mode_init(), rofi_theme_property_copy(), and rofi_theme_property_create().


| void rofi_theme_property_free | ( | Property * | p | ) |
| p | The property to free. |
Free the content of the property.
Definition at line 205 of file theme.c.
References RofiPadding::bottom, RofiImage::colors, _PropertyValue::image, RofiPadding::left, _PropertyValue::link, _PropertyValue::list, Property::name, P_IMAGE, P_LINK, P_LIST, P_PADDING, P_STRING, _PropertyValue::padding, RofiPadding::right, rofi_theme_distance_property_free(), rofi_theme_property_free(), _PropertyValue::s, RofiPadding::top, Property::type, RofiImage::url, and Property::value.
Referenced by config_parse_set_property(), config_xresource_free(), dmenu_mode_init(), rofi_theme_property_free(), and rofi_theme_widget_add_properties().


| int rofi_theme_rasi_validate | ( | const char * | filename | ) |
| filename | The file to validate. |
Definition at line 1393 of file rofi.c.
References list_of_error_msgs, list_of_warning_msgs, rofi_theme_parse_file(), rofi_theme_parse_process_links(), and rofi_theme_rasi_validate().
Referenced by main(), rofi_theme_parse_string(), and rofi_theme_rasi_validate().


| void rofi_theme_reset | ( | void | ) |
Reset the current theme.
Definition at line 236 of file theme.c.
References ThemeWidget::name, rofi_theme, rofi_theme_free(), and rofi_theme_reset().
Referenced by main(), rofi_theme_parse_string(), and rofi_theme_reset().


| void rofi_theme_set_disp_scale_func | ( | disp_scale_func | func | ) |
| func | The function pointer to scale getter. |
Dependency injection for changing display scale without theme library depending on the display library
Definition at line 1660 of file theme.c.
References disp_scale, and rofi_theme_set_disp_scale_func().
Referenced by main(), and rofi_theme_set_disp_scale_func().


| void rofi_theme_widget_add_properties | ( | ThemeWidget * | widget, |
| GHashTable * | table ) |
| widget | The widget handle. |
| table | HashTable containing properties set. |
Merge properties with widgets current property.
Definition at line 656 of file theme.c.
References ThemeWidget::properties, rofi_theme_copy_property_int(), rofi_theme_property_free(), and rofi_theme_widget_add_properties().
Referenced by dmenu_mode_init(), rofi_theme_parse_merge_widgets(), rofi_theme_parse_string(), and rofi_theme_widget_add_properties().


|
extern |
Used to store config options.
Definition at line 42 of file xrmoptions.c.
Referenced by cleanup(), config_parse_dump_config_rasi_format(), main(), and rofi_config_find_widget().
|
extern |
Global pointer to the current active theme.
Referenced by cleanup(), dmenu_mode_init(), main(), rofi_theme_find_widget(), rofi_theme_parse_merge_widgets(), rofi_theme_parse_process_conditionals(), rofi_theme_parse_process_links(), rofi_theme_reset(), and rofi_theme_resolve_link_property().