rofi  1.7.0
theme.c File Reference
#include "config.h"
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "helper.h"
#include "rofi-icon-fetcher.h"
#include "rofi-types.h"
#include "rofi.h"
#include "settings.h"
#include "theme-parser.h"
#include "theme.h"
#include "view.h"
#include "widgets/textbox.h"
#include <gio/gio.h>
Include dependency graph for theme.c:

Go to the source code of this file.

Macros

#define G_LOG_DOMAIN   "Theme"
 

Functions

void yyerror (YYLTYPE *yylloc, const char *, const char *)
 
static gboolean distance_compare (RofiDistance d, RofiDistance e)
 
static gpointer rofi_g_list_strdup (gconstpointer data, G_GNUC_UNUSED gpointer user_data)
 
ThemeWidgetrofi_theme_find_or_create_name (ThemeWidget *base, const char *name)
 
Propertyrofi_theme_property_create (PropertyType type)
 
static RofiDistanceUnitrofi_theme_property_copy_distance_unit (RofiDistanceUnit *unit)
 
RofiDistance rofi_theme_property_copy_distance (RofiDistance const distance)
 
Propertyrofi_theme_property_copy (const Property *p)
 
static void rofi_theme_distance_unit_property_free (RofiDistanceUnit *unit)
 
static void rofi_theme_distance_property_free (RofiDistance *distance)
 
void rofi_theme_property_free (Property *p)
 
void rofi_theme_reset (void)
 
void rofi_theme_free (ThemeWidget *widget)
 
static void printf_double (double d)
 
static void rofi_theme_print_distance_unit (RofiDistanceUnit *unit)
 
static void rofi_theme_print_distance (RofiDistance d)
 
static void int_rofi_theme_print_property (Property *p)
 
static void rofi_theme_print_property_index (size_t pnl, int depth, Property *p)
 
void rofi_theme_print_index (ThemeWidget *widget, int index)
 
void rofi_theme_print (ThemeWidget *widget)
 
int yyparse ()
 
void yylex_destroy (void)
 
static void rofi_theme_copy_property_int (G_GNUC_UNUSED gpointer key, gpointer value, gpointer user_data)
 
void rofi_theme_widget_add_properties (ThemeWidget *widget, GHashTable *table)
 
static ThemeWidgetrofi_theme_find_single (ThemeWidget *widget, const char *name)
 
static ThemeWidgetrofi_theme_find (ThemeWidget *widget, const char *name, const gboolean exact)
 
static void rofi_theme_resolve_link_property (Property *p, int depth)
 
Propertyrofi_theme_find_property (ThemeWidget *widget, PropertyType type, const char *property, gboolean exact)
 
ThemeWidgetrofi_config_find_widget (const char *name, const char *state, gboolean exact)
 
ThemeWidgetrofi_theme_find_widget (const char *name, const char *state, gboolean exact)
 
static int rofi_theme_get_position_inside (Property *p, const widget *widget, const char *property, int def)
 
int rofi_theme_get_position (const widget *widget, const char *property, int def)
 
static int rofi_theme_get_integer_inside (Property *p, const widget *widget, const char *property, int def)
 
int rofi_theme_get_integer (const widget *widget, const char *property, int def)
 
static RofiDistance rofi_theme_get_distance_inside (Property *p, const widget *widget, const char *property, int def)
 
RofiDistance rofi_theme_get_distance (const widget *widget, const char *property, int def)
 
static int rofi_theme_get_boolean_inside (Property *p, const widget *widget, const char *property, int def)
 
int rofi_theme_get_boolean (const widget *widget, const char *property, int def)
 
static RofiOrientation rofi_theme_get_orientation_inside (Property *p, const widget *widget, const char *property, RofiOrientation def)
 
RofiOrientation rofi_theme_get_orientation (const widget *widget, const char *property, RofiOrientation def)
 
static RofiCursorType rofi_theme_get_cursor_type_inside (Property *p, const widget *widget, const char *property, RofiCursorType def)
 
RofiCursorType rofi_theme_get_cursor_type (const widget *widget, const char *property, RofiCursorType def)
 
static const char * rofi_theme_get_string_inside (Property *p, const widget *widget, const char *property, const char *def)
 
const char * rofi_theme_get_string (const widget *widget, const char *property, const char *def)
 
static double rofi_theme_get_double_inside (const widget *orig, Property *p, const widget *widget, const char *property, double def)
 
double rofi_theme_get_double (const widget *widget, const char *property, double def)
 
static void rofi_theme_get_color_inside (const widget *widget, Property *p, const char *property, cairo_t *d)
 
void rofi_theme_get_color (const widget *widget, const char *property, cairo_t *d)
 
static gboolean rofi_theme_get_image_inside (Property *p, const widget *widget, const char *property, cairo_t *d)
 
gboolean rofi_theme_get_image (const widget *widget, const char *property, cairo_t *d)
 
static RofiPadding rofi_theme_get_padding_inside (Property *p, const widget *widget, const char *property, RofiPadding pad)
 
RofiPadding rofi_theme_get_padding (const widget *widget, const char *property, RofiPadding pad)
 
static GList * rofi_theme_get_list_inside (Property *p, const widget *widget, const char *property, const char *defaults)
 
GList * rofi_theme_get_list (const widget *widget, const char *property, const char *defaults)
 
static RofiHighlightColorStyle rofi_theme_get_highlight_inside (Property *p, widget *widget, const char *property, RofiHighlightColorStyle th)
 
RofiHighlightColorStyle rofi_theme_get_highlight (widget *widget, const char *property, RofiHighlightColorStyle th)
 
static int get_pixels (RofiDistanceUnit *unit, RofiOrientation ori)
 
static int distance_unit_get_pixel (RofiDistanceUnit *unit, RofiOrientation ori)
 
int distance_get_pixel (RofiDistance d, RofiOrientation ori)
 
void distance_get_linestyle (RofiDistance d, cairo_t *draw)
 
gboolean rofi_theme_is_empty (void)
 
char * rofi_theme_parse_prepare_file (const char *file, const char *parent_file)
 
static void rofi_theme_parse_merge_widgets_no_media (ThemeWidget *parent, ThemeWidget *child)
 
void rofi_theme_parse_merge_widgets (ThemeWidget *parent, ThemeWidget *child)
 
static void rofi_theme_parse_process_conditionals_int (workarea mon, ThemeWidget *rwidget)
 
void rofi_theme_parse_process_conditionals (void)
 
ThemeMediaType rofi_theme_parse_media_type (const char *type)
 
static gboolean rofi_theme_has_property_inside (Property *p, const widget *widget, const char *property)
 
gboolean rofi_theme_has_property (const widget *widget, const char *property)
 

Variables

const char *const RofiCursorTypeStr [3]
 
FILE * yyin
 

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "Theme"

Log domain used by the theme engine.

Definition at line 29 of file theme.c.

Function Documentation

◆ distance_compare()

static gboolean distance_compare ( RofiDistance  d,
RofiDistance  e 
)
static

Definition at line 50 of file theme.c.

References RofiDistance::base, RofiDistanceUnit::distance, RofiDistance::style, and RofiDistanceUnit::type.

Referenced by int_rofi_theme_print_property().

Here is the caller graph for this function:

◆ distance_get_linestyle()

void distance_get_linestyle ( RofiDistance  d,
cairo_t *  draw 
)
Parameters
dThe distance handle.
drawThe cairo drawable.

Set linestyle.

Definition at line 1286 of file theme.c.

References ROFI_HL_DASH, and RofiDistance::style.

Referenced by widget_draw().

Here is the caller graph for this function:

◆ distance_get_pixel()

int distance_get_pixel ( RofiDistance  d,
RofiOrientation  ori 
)

◆ distance_unit_get_pixel()

◆ get_pixels()

static int get_pixels ( RofiDistanceUnit unit,
RofiOrientation  ori 
)
static

◆ int_rofi_theme_print_property()

◆ printf_double()

static void printf_double ( double  d)
inlinestatic

print

Definition at line 238 of file theme.c.

Referenced by rofi_theme_print_distance_unit().

Here is the caller graph for this function:

◆ rofi_config_find_widget()

ThemeWidget* rofi_config_find_widget ( const char *  name,
const char *  state,
gboolean  exact 
)
Parameters
nameThe name of the element to find.
stateThe state of the element.
exactIf the match should be exact, or parent can be included.

Find the configuration element. If not exact, the closest specified element is returned.

Returns
the ThemeWidget if found, otherwise NULL.

Definition at line 732 of file theme.c.

References rofi_configuration, rofi_theme_find(), and rofi_theme_find_single().

Referenced by combi_mgrv(), file_browser_mode_init_config(), file_browser_mode_init_current_dir(), get_apps(), mode_get_display_name(), rofi_view_set_user_timeout(), and rofi_view_user_timeout().

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

◆ rofi_g_list_strdup()

static gpointer rofi_g_list_strdup ( gconstpointer  data,
G_GNUC_UNUSED gpointer  user_data 
)
static

Definition at line 56 of file theme.c.

Referenced by rofi_theme_get_list_inside(), and rofi_theme_property_copy().

Here is the caller graph for this function:

◆ rofi_theme_copy_property_int()

static void rofi_theme_copy_property_int ( G_GNUC_UNUSED gpointer  key,
gpointer  value,
gpointer  user_data 
)
static

Definition at line 599 of file theme.c.

References Property::name, and rofi_theme_property_copy().

Referenced by rofi_theme_widget_add_properties().

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

◆ rofi_theme_distance_property_free()

static void rofi_theme_distance_property_free ( RofiDistance distance)
static

Definition at line 171 of file theme.c.

References RofiDistance::base, RofiDistanceUnit::left, RofiDistanceUnit::right, and rofi_theme_distance_unit_property_free().

Referenced by rofi_theme_property_free().

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

◆ rofi_theme_distance_unit_property_free()

static void rofi_theme_distance_unit_property_free ( RofiDistanceUnit unit)
static

Definition at line 160 of file theme.c.

References RofiDistanceUnit::left, and RofiDistanceUnit::right.

Referenced by rofi_theme_distance_property_free().

Here is the caller graph for this function:

◆ rofi_theme_find()

static ThemeWidget* rofi_theme_find ( ThemeWidget widget,
const char *  name,
const gboolean  exact 
)
static

Definition at line 631 of file theme.c.

References rofi_theme_find_single().

Referenced by rofi_config_find_widget(), and rofi_theme_find_widget().

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

◆ rofi_theme_find_or_create_name()

ThemeWidget* rofi_theme_find_or_create_name ( ThemeWidget base,
const char *  name 
)
Parameters
baseHandle to the current level in the theme.
nameName of the new element.

Create a new element in the theme structure.

Returns
handle to the new entry.

Definition at line 61 of file theme.c.

References ThemeWidget::name, ThemeWidget::num_widgets, ThemeWidget::parent, and ThemeWidget::widgets.

Referenced by dmenu_mode_init(), rofi_theme_parse_merge_widgets(), and rofi_theme_parse_merge_widgets_no_media().

Here is the caller graph for this function:

◆ rofi_theme_find_property()

Property* rofi_theme_find_property ( ThemeWidget widget,
PropertyType  type,
const char *  property,
gboolean  exact 
)
Parameters
widgetThe widget to find the property on.
typeThe PropertyType to find.
propertyThe property to find.
exactIf the property should only be found on this widget, or on parents if not found.

Find the property on the widget. If not exact, the parents are searched recursively until match is found.

Returns
the Property if found, otherwise NULL.

Definition at line 694 of file theme.c.

References _PropertyValue::link, _widget::name, P_INHERIT, P_INTEGER, P_LINK, P_PADDING, _widget::parent, PropertyTypeName, _PropertyValue::ref, rofi_theme_resolve_link_property(), Property::type, and Property::value.

Referenced by combi_mgrv(), file_browser_mode_init_config(), file_browser_mode_init_current_dir(), get_apps(), mode_get_display_name(), 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_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(), rofi_theme_get_list_inside(), 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(), rofi_view_set_user_timeout(), and rofi_view_user_timeout().

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

◆ rofi_theme_find_single()

static ThemeWidget* rofi_theme_find_single ( ThemeWidget widget,
const char *  name 
)
inlinestatic

Public API

Definition at line 621 of file theme.c.

References _widget::name.

Referenced by rofi_config_find_widget(), rofi_theme_find(), and rofi_theme_find_widget().

Here is the caller graph for this function:

◆ rofi_theme_find_widget()

ThemeWidget* rofi_theme_find_widget ( const char *  name,
const char *  state,
gboolean  exact 
)

◆ rofi_theme_free()

void rofi_theme_free ( ThemeWidget widget)
Parameters
widgetFree the widget and alll children.

Definition at line 216 of file theme.c.

References _widget::name.

Referenced by cleanup(), main(), and rofi_theme_reset().

Here is the caller graph for this function:

◆ rofi_theme_get_boolean()

int rofi_theme_get_boolean ( const widget widget,
const char *  property,
int  def 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the boolean of the widget.

Returns
The boolean value of this property for this widget.

Definition at line 856 of file theme.c.

References _widget::name, P_BOOLEAN, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_boolean_inside(), and _widget::state.

Referenced by __create_window(), box_add(), icon_create(), listview_create(), textbox_create(), and widget_init().

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

◆ rofi_theme_get_boolean_inside()

static int rofi_theme_get_boolean_inside ( Property p,
const widget widget,
const char *  property,
int  def 
)
static

Definition at line 837 of file theme.c.

References _PropertyValue::b, _widget::name, P_BOOLEAN, P_INHERIT, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_boolean().

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

◆ rofi_theme_get_color()

void rofi_theme_get_color ( const widget widget,
const char *  property,
cairo_t *  d 
)
Parameters
widgetThe widget to query
propertyThe property to query.
dThe drawable to apply color.

Obtain the color of the widget and applies this to the drawable d.

Definition at line 996 of file theme.c.

References _widget::name, P_COLOR, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_color_inside(), and _widget::state.

Referenced by scrollbar_draw(), textbox_draw(), and widget_draw().

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

◆ rofi_theme_get_color_inside()

static void rofi_theme_get_color_inside ( const widget widget,
Property p,
const char *  property,
cairo_t *  d 
)
static

Definition at line 975 of file theme.c.

References ThemeColor::alpha, ThemeColor::blue, _PropertyValue::color, ThemeColor::green, _widget::name, P_COLOR, P_INHERIT, _widget::parent, ThemeColor::red, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_color().

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

◆ rofi_theme_get_cursor_type()

RofiCursorType rofi_theme_get_cursor_type ( const widget widget,
const char *  property,
RofiCursorType  def 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the cursor indicated by property of the widget.

Returns
The cursor for this widget or def if not found.

Definition at line 913 of file theme.c.

References _widget::name, P_CURSOR, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_cursor_type_inside(), and _widget::state.

Referenced by widget_init().

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

◆ rofi_theme_get_cursor_type_inside()

static RofiCursorType rofi_theme_get_cursor_type_inside ( Property p,
const widget widget,
const char *  property,
RofiCursorType  def 
)
static

Definition at line 892 of file theme.c.

References _PropertyValue::i, _widget::name, P_CURSOR, P_INHERIT, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_cursor_type().

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

◆ rofi_theme_get_distance()

RofiDistance rofi_theme_get_distance ( const widget widget,
const char *  property,
int  def 
)

Public API

Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the distance of the widget.

Returns
The distance value of this property for this widget.

Definition at line 830 of file theme.c.

References _widget::name, P_PADDING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_distance_inside(), and _widget::state.

Referenced by box_create(), box_get_desired_width(), icon_create(), listview_create(), rofi_view_calculate_height(), rofi_view_calculate_window_position(), rofi_view_calculate_window_width(), scrollbar_create(), and textbox_get_desired_width().

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

◆ rofi_theme_get_distance_inside()

static RofiDistance rofi_theme_get_distance_inside ( Property p,
const widget widget,
const char *  property,
int  def 
)
static

◆ rofi_theme_get_double()

double rofi_theme_get_double ( const widget widget,
const char *  property,
double  def 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the double of the widget.

Returns
The double value of this property for this widget.

Definition at line 969 of file theme.c.

References _widget::name, P_DOUBLE, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_double_inside(), and _widget::state.

Referenced by icon_create(), and textbox_create().

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

◆ rofi_theme_get_double_inside()

static double rofi_theme_get_double_inside ( const widget orig,
Property p,
const widget widget,
const char *  property,
double  def 
)
static

Definition at line 947 of file theme.c.

References _PropertyValue::f, _widget::name, P_DOUBLE, P_INHERIT, P_INTEGER, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_integer_inside(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_double().

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

◆ rofi_theme_get_highlight()

RofiHighlightColorStyle rofi_theme_get_highlight ( widget widget,
const char *  property,
RofiHighlightColorStyle  th 
)
Parameters
widgetThe widget to query
propertyThe property to query.
thThe default value.

Obtain the highlight .

Returns
The highlight of this property for this widget.

Definition at line 1205 of file theme.c.

References _widget::name, P_HIGHLIGHT, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_highlight_inside(), and _widget::state.

Referenced by update_callback().

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

◆ rofi_theme_get_highlight_inside()

static RofiHighlightColorStyle rofi_theme_get_highlight_inside ( Property p,
widget widget,
const char *  property,
RofiHighlightColorStyle  th 
)
static

Definition at line 1184 of file theme.c.

References _PropertyValue::highlight, _widget::name, P_HIGHLIGHT, P_INHERIT, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_highlight().

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

◆ rofi_theme_get_image()

gboolean rofi_theme_get_image ( const widget widget,
const char *  property,
cairo_t *  d 
)
Parameters
widgetThe widget to query
propertyThe property to query.
dThe drawable to apply color.

Obtain the image of the widget and applies this to the drawable d.

Returns
true if image is set.

Definition at line 1107 of file theme.c.

References _widget::name, P_IMAGE, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_image_inside(), and _widget::state.

Referenced by widget_draw().

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

◆ rofi_theme_get_image_inside()

◆ rofi_theme_get_integer()

int rofi_theme_get_integer ( const widget widget,
const char *  property,
int  def 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the integer of the widget.

Returns
The integer value of this property for this widget.

Definition at line 793 of file theme.c.

References _widget::name, P_INTEGER, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_integer_inside(), and _widget::state.

Referenced by listview_create(), rofi_view_add_widget(), and rofi_view_setup_fake_transparency().

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

◆ rofi_theme_get_integer_inside()

static int rofi_theme_get_integer_inside ( Property p,
const widget widget,
const char *  property,
int  def 
)
static

Definition at line 774 of file theme.c.

References _PropertyValue::i, _widget::name, P_INHERIT, P_INTEGER, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_double_inside(), and rofi_theme_get_integer().

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

◆ rofi_theme_get_list()

GList* rofi_theme_get_list ( const widget widget,
const char *  property,
const char *  defaults 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defaultsThe default value.

Obtain list of elements (strings) of the widget.

Returns
a GList holding the names in the list of this property for this widget.

Definition at line 1176 of file theme.c.

References _widget::name, P_LIST, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_list_inside(), and _widget::state.

Referenced by listview_add_widget(), listview_create_row(), rofi_view_add_widget(), and rofi_view_create().

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

◆ rofi_theme_get_list_inside()

static GList* rofi_theme_get_list_inside ( Property p,
const widget widget,
const char *  property,
const char *  defaults 
)
static

Definition at line 1149 of file theme.c.

References _PropertyValue::list, _widget::name, P_INHERIT, P_LIST, _widget::parent, rofi_g_list_strdup(), rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_list().

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

◆ rofi_theme_get_orientation()

RofiOrientation rofi_theme_get_orientation ( const widget widget,
const char *  property,
RofiOrientation  def 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the orientation indicated by property of the widget.

Returns
The orientation of this property for this widget or def not found.

Definition at line 884 of file theme.c.

References _widget::name, P_ORIENTATION, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_orientation_inside(), and _widget::state.

Referenced by box_create(), and listview_create().

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

◆ rofi_theme_get_orientation_inside()

static RofiOrientation rofi_theme_get_orientation_inside ( Property p,
const widget widget,
const char *  property,
RofiOrientation  def 
)
static

Definition at line 863 of file theme.c.

References _PropertyValue::b, _widget::name, P_INHERIT, P_ORIENTATION, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_orientation().

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

◆ rofi_theme_get_padding()

RofiPadding rofi_theme_get_padding ( const widget widget,
const char *  property,
RofiPadding  pad 
)
Parameters
widgetThe widget to query
propertyThe property to query.
padThe default value.

Obtain the padding of the widget.

Returns
The padding of this property for this widget.

Definition at line 1142 of file theme.c.

References _widget::name, P_PADDING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_padding_inside(), and _widget::state.

Referenced by widget_init(), and widget_set_state().

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

◆ rofi_theme_get_padding_inside()

static RofiPadding rofi_theme_get_padding_inside ( Property p,
const widget widget,
const char *  property,
RofiPadding  pad 
)
static

◆ rofi_theme_get_position()

int rofi_theme_get_position ( const widget widget,
const char *  property,
int  def 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the position of the widget.

Returns
The position value of this property for this widget.

Definition at line 768 of file theme.c.

References _widget::name, P_POSITION, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_position_inside(), and _widget::state.

Referenced by rofi_view_calculate_window_position().

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

◆ rofi_theme_get_position_inside()

static int rofi_theme_get_position_inside ( Property p,
const widget widget,
const char *  property,
int  def 
)
static

Definition at line 749 of file theme.c.

References _PropertyValue::i, _widget::name, P_INHERIT, P_POSITION, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_position().

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

◆ rofi_theme_get_string()

const char* rofi_theme_get_string ( const widget widget,
const char *  property,
const char *  def 
)
Parameters
widgetThe widget to query
propertyThe property to query.
defThe default value.

Obtain the string of the widget.

Returns
The string value of this property for this widget.

Definition at line 941 of file theme.c.

References _widget::name, P_STRING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_get_string_inside(), and _widget::state.

Referenced by __create_window(), icon_create(), rofi_view_add_widget(), textbox_button_trigger_action(), textbox_create(), and textbox_initialize_font().

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

◆ rofi_theme_get_string_inside()

static const char* rofi_theme_get_string_inside ( Property p,
const widget widget,
const char *  property,
const char *  def 
)
static

Definition at line 920 of file theme.c.

References _widget::name, P_INHERIT, P_STRING, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _PropertyValue::s, _widget::state, Property::type, and Property::value.

Referenced by rofi_theme_get_string().

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

◆ rofi_theme_has_property()

gboolean rofi_theme_has_property ( const widget widget,
const char *  property 
)
Parameters
widgetThe widget to query
propertyThe property to query.

Check if a rofi theme has a property set.

Definition at line 1494 of file theme.c.

References _widget::name, P_STRING, rofi_theme_find_property(), rofi_theme_find_widget(), rofi_theme_has_property_inside(), and _widget::state.

Here is the call graph for this function:

◆ rofi_theme_has_property_inside()

static gboolean rofi_theme_has_property_inside ( Property p,
const widget widget,
const char *  property 
)
static

Definition at line 1476 of file theme.c.

References _widget::name, P_INHERIT, P_STRING, _widget::parent, rofi_theme_find_property(), rofi_theme_find_widget(), _widget::state, and Property::type.

Referenced by rofi_theme_has_property().

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

◆ rofi_theme_is_empty()

gboolean rofi_theme_is_empty ( void  )

Checks if a theme is set, or is empty.

Returns
TRUE when empty.

Definition at line 1295 of file theme.c.

References ThemeWidget::num_widgets, ThemeWidget::properties, and rofi_theme.

◆ rofi_theme_parse_media_type()

ThemeMediaType rofi_theme_parse_media_type ( const char *  type)

◆ rofi_theme_parse_merge_widgets()

void rofi_theme_parse_merge_widgets ( ThemeWidget parent,
ThemeWidget child 
)
Parameters
parenttarget theme tree
childsource theme three

Merge all the settings from child into parent.

Definition at line 1339 of file theme.c.

References ThemeWidget::media, ThemeWidget::name, ThemeWidget::num_widgets, ThemeWidget::properties, rofi_theme, rofi_theme_find_or_create_name(), rofi_theme_widget_add_properties(), and ThemeWidget::widgets.

Here is the call graph for this function:

◆ rofi_theme_parse_merge_widgets_no_media()

static void rofi_theme_parse_merge_widgets_no_media ( ThemeWidget parent,
ThemeWidget child 
)
static

Definition at line 1323 of file theme.c.

References ThemeWidget::name, ThemeWidget::num_widgets, ThemeWidget::properties, rofi_theme, rofi_theme_find_or_create_name(), rofi_theme_widget_add_properties(), and ThemeWidget::widgets.

Referenced by rofi_theme_parse_process_conditionals_int().

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

◆ rofi_theme_parse_prepare_file()

char* rofi_theme_parse_prepare_file ( const char *  file,
const char *  parent_file 
)
Parameters
fileFile name to prepare.
parent_fileFilename of parent file.

Tries to find full path relative to parent file.

Returns
full path to file.

Definition at line 1305 of file theme.c.

References rofi_expand_path().

Here is the call graph for this function:

◆ rofi_theme_parse_process_conditionals()

void rofi_theme_parse_process_conditionals ( void  )

Process conditionals.

Definition at line 1445 of file theme.c.

References mon, monitor_active(), rofi_theme, and rofi_theme_parse_process_conditionals_int().

Referenced by main().

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

◆ rofi_theme_parse_process_conditionals_int()

◆ rofi_theme_print()

void rofi_theme_print ( ThemeWidget widget)
Parameters
widgetThe widget handle.

Print out the widget to the commandline.

Definition at line 539 of file theme.c.

References rofi_theme_print_index().

Referenced by main().

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

◆ rofi_theme_print_distance()

static void rofi_theme_print_distance ( RofiDistance  d)
static

Definition at line 293 of file theme.c.

References RofiDistance::base, RofiDistanceUnit::modtype, ROFI_DISTANCE_MODIFIER_GROUP, ROFI_HL_DASH, rofi_theme_print_distance_unit(), and RofiDistance::style.

Referenced by int_rofi_theme_print_property().

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

◆ rofi_theme_print_distance_unit()

◆ rofi_theme_print_index()

void rofi_theme_print_index ( ThemeWidget widget,
int  index 
)
Parameters
widgetThe widget handle.
indexThe indenting index.

Print out the widget to the commandline indented by index.

Definition at line 479 of file theme.c.

References ThemeWidget::media, Property::name, ThemeWidget::name, _widget::name, ThemeWidget::parent, and rofi_theme_print_property_index().

Referenced by config_parse_dump_config_rasi_format(), and rofi_theme_print().

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

◆ rofi_theme_print_property_index()

static void rofi_theme_print_property_index ( size_t  pnl,
int  depth,
Property p 
)
static

Definition at line 470 of file theme.c.

References depth, int_rofi_theme_print_property(), and Property::name.

Referenced by rofi_theme_print_index().

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

◆ rofi_theme_property_copy()

◆ rofi_theme_property_copy_distance()

RofiDistance rofi_theme_property_copy_distance ( RofiDistance const  distance)
Parameters
distanceThe distance object to copy.
Returns
a copy of the distance.

Definition at line 99 of file theme.c.

References RofiDistance::base, RofiDistanceUnit::left, RofiDistanceUnit::right, and rofi_theme_property_copy_distance_unit().

Referenced by rofi_theme_property_copy().

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

◆ rofi_theme_property_copy_distance_unit()

static RofiDistanceUnit* rofi_theme_property_copy_distance_unit ( RofiDistanceUnit unit)
static

Definition at line 88 of file theme.c.

References RofiDistanceUnit::left, and RofiDistanceUnit::right.

Referenced by rofi_theme_property_copy_distance().

Here is the caller graph for this function:

◆ rofi_theme_property_create()

Property* rofi_theme_property_create ( PropertyType  type)

Properties

Definition at line 81 of file theme.c.

References Property::type.

Referenced by dmenu_mode_init(), and rofi_theme_property_copy().

Here is the caller graph for this function:

◆ rofi_theme_property_free()

void rofi_theme_property_free ( Property p)

◆ rofi_theme_reset()

void rofi_theme_reset ( void  )

Reset the current theme.

Definition at line 210 of file theme.c.

References ThemeWidget::name, rofi_theme, and rofi_theme_free().

Referenced by main().

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

◆ rofi_theme_resolve_link_property()

static void rofi_theme_resolve_link_property ( Property p,
int  depth 
)
static

◆ rofi_theme_widget_add_properties()

void rofi_theme_widget_add_properties ( ThemeWidget widget,
GHashTable *  table 
)
Parameters
widgetThe widget handle.
tableHashTable containing properties set.

Merge properties with widgets current property.

Definition at line 605 of file theme.c.

References rofi_theme_copy_property_int(), and rofi_theme_property_free().

Referenced by dmenu_mode_init(), rofi_theme_parse_merge_widgets(), and rofi_theme_parse_merge_widgets_no_media().

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

◆ yyerror()

void yyerror ( YYLTYPE *  yylloc,
const char *  what,
const char *  s 
)
Parameters
yyllocThe file location.
whatWhat we are parsing, filename or string.
sError message string.

Error handler for the lex parser.

Definition at line 569 of file theme.c.

References rofi_add_error_message().

Here is the call graph for this function:

◆ yylex_destroy()

void yylex_destroy ( void  )

Destroy the internal of lex parser.

◆ yyparse()

int yyparse ( )

Main lex parser.

Variable Documentation

◆ RofiCursorTypeStr

const char* const RofiCursorTypeStr[3]
Initial value:
= {
"default",
"pointer",
"text",
}

Textual representation of RofiCursorType

Definition at line 306 of file theme.c.

Referenced by int_rofi_theme_print_property().

◆ yyin

FILE* yyin
extern

Global handle input file to flex parser.