rofi  1.5.4
theme.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2017 Qball Cow <qball@gmpclient.org>
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject to
13  * the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  */
27 
28 #ifndef THEME_H
29 #define THEME_H
30 #include <glib.h>
31 #include <cairo.h>
32 #include <widgets/widget.h>
33 #include "rofi-types.h"
34 
38 typedef struct ThemeWidget
39 {
40  int set;
41  char *name;
42 
43  unsigned int num_widgets;
44  struct ThemeWidget **widgets;
45 
46  GHashTable *properties;
47 
50 
54 extern ThemeWidget *rofi_theme;
55 
65 
72 
81 
88 
101 
109 gboolean rofi_theme_parse_file ( const char *file );
110 
118 gboolean rofi_theme_parse_string ( const char *string );
119 
126 void rofi_theme_widget_add_properties ( ThemeWidget *widget, GHashTable *table );
127 
141 RofiDistance rofi_theme_get_distance ( const widget *widget, const char *property, int def );
142 
152 int rofi_theme_get_integer ( const widget *widget, const char *property, int def );
153 
163 int rofi_theme_get_position ( const widget *widget, const char *property, int def );
164 
174 int rofi_theme_get_boolean ( const widget *widget, const char *property, int def );
175 
185 RofiOrientation rofi_theme_get_orientation ( const widget *widget, const char *property, RofiOrientation def );
195 const char *rofi_theme_get_string ( const widget *widget, const char *property, const char *def );
196 
206 double rofi_theme_get_double ( const widget *widget, const char *property, double def );
207 
216 void rofi_theme_get_color ( const widget *widget, const char *property, cairo_t *d );
217 
227 RofiPadding rofi_theme_get_padding ( const widget *widget, const char *property, RofiPadding pad );
228 
239 
254 void distance_get_linestyle ( RofiDistance d, cairo_t *draw );
255 
269 ThemeWidget *rofi_theme_find_widget ( const char *name, const char *state, gboolean exact );
270 
281 Property *rofi_theme_find_property ( ThemeWidget *widget, PropertyType type, const char *property, gboolean exact );
282 
292 GList *rofi_theme_get_list ( const widget *widget, const char * property, const char *defaults );
297 gboolean rofi_theme_is_empty ( void );
298 
302 void rofi_theme_reset ( void );
303 #ifdef THEME_CONVERTER
304 
307 void rofi_theme_convert_old ( void );
308 #endif
309 
315 char *helper_get_theme_path ( const char *file );
316 
325 char * rofi_theme_parse_prepare_file ( const char *file, const char *parent_file );
326 #endif
rofi_theme_get_highlight
RofiHighlightColorStyle rofi_theme_get_highlight(widget *widget, const char *property, RofiHighlightColorStyle th)
Definition: theme.c:748
rofi_theme_print
void rofi_theme_print(ThemeWidget *widget)
Definition: theme.c:352
PropertyType
PropertyType
Definition: rofi-types.h:11
rofi_theme_reset
void rofi_theme_reset(void)
Definition: theme.c:127
helper_get_theme_path
char * helper_get_theme_path(const char *file)
Definition: helper.c:1023
rofi_theme_property_create
Property * rofi_theme_property_create(PropertyType type)
Definition: theme.c:77
rofi_theme
ThemeWidget * rofi_theme
rofi_theme_get_position
int rofi_theme_get_position(const widget *widget, const char *property, int def)
Definition: theme.c:546
rofi-types.h
ThemeWidget::widgets
struct ThemeWidget ** widgets
Definition: theme.h:44
rofi_theme_find_or_create_name
ThemeWidget * rofi_theme_find_or_create_name(ThemeWidget *base, const char *name)
Definition: theme.c:58
rofi_theme_parse_file
gboolean rofi_theme_parse_file(const char *file)
rofi_theme_get_double
double rofi_theme_get_double(const widget *widget, const char *property, double def)
Definition: theme.c:650
distance_get_linestyle
void distance_get_linestyle(RofiDistance d, cairo_t *draw)
Definition: theme.c:788
RofiDistance
Definition: rofi-types.h:93
widget.h
Property
Definition: rofi-types.h:213
ThemeWidget::parent
struct ThemeWidget * parent
Definition: theme.h:48
rofi_theme_parse_prepare_file
char * rofi_theme_parse_prepare_file(const char *file, const char *parent_file)
Definition: theme.c:950
RofiPadding
Definition: rofi-types.h:130
rofi_theme_parse_string
gboolean rofi_theme_parse_string(const char *string)
ThemeWidget::num_widgets
unsigned int num_widgets
Definition: theme.h:43
rofi_theme_get_distance
RofiDistance rofi_theme_get_distance(const widget *widget, const char *property, int def)
Definition: theme.c:579
ThemeWidget::set
int set
Definition: theme.h:40
rofi_theme_property_free
void rofi_theme_property_free(Property *p)
Definition: theme.c:109
rofi_theme_get_integer
int rofi_theme_get_integer(const widget *widget, const char *property, int def)
Definition: theme.c:563
rofi_theme_property_copy
Property * rofi_theme_property_copy(Property *p)
Definition: theme.c:83
rofi_theme_free
void rofi_theme_free(ThemeWidget *widget)
Definition: theme.c:134
rofi_theme_get_color
void rofi_theme_get_color(const widget *widget, const char *property, cairo_t *d)
Definition: theme.c:677
rofi_theme_widget_add_properties
void rofi_theme_widget_add_properties(ThemeWidget *widget, GHashTable *table)
Definition: theme.c:408
rofi_theme_is_empty
gboolean rofi_theme_is_empty(void)
Definition: theme.c:799
rofi_theme_get_list
GList * rofi_theme_get_list(const widget *widget, const char *property, const char *defaults)
Definition: theme.c:722
ThemeWidget
Definition: theme.h:39
rofi_theme_find_property
Property * rofi_theme_find_property(ThemeWidget *widget, PropertyType type, const char *property, gboolean exact)
Definition: theme.c:499
rofi_theme_find_widget
ThemeWidget * rofi_theme_find_widget(const char *name, const char *state, gboolean exact)
Definition: theme.c:537
RofiHighlightColorStyle
Definition: rofi-types.h:141
rofi_theme_get_orientation
RofiOrientation rofi_theme_get_orientation(const widget *widget, const char *property, RofiOrientation def)
Definition: theme.c:617
RofiOrientation
RofiOrientation
Definition: rofi-types.h:106
_widget
Definition: widget-internal.h:36
ThemeWidget
struct ThemeWidget ThemeWidget
distance_get_pixel
int distance_get_pixel(RofiDistance d, RofiOrientation ori)
Definition: theme.c:765
ThemeWidget::properties
GHashTable * properties
Definition: theme.h:46
rofi_theme_get_padding
RofiPadding rofi_theme_get_padding(const widget *widget, const char *property, RofiPadding pad)
Definition: theme.c:699
rofi_theme_get_string
const char * rofi_theme_get_string(const widget *widget, const char *property, const char *def)
Definition: theme.c:634
ThemeWidget::name
char * name
Definition: theme.h:41
rofi_theme_get_boolean
int rofi_theme_get_boolean(const widget *widget, const char *property, int def)
Definition: theme.c:601