rofi  1.5.1
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 
49 } ThemeWidget;
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 
283 GList *rofi_theme_get_list ( const widget *widget, const char * property, const char *defaults );
288 gboolean rofi_theme_is_empty ( void );
289 
293 void rofi_theme_reset ( void );
294 #ifdef THEME_CONVERTER
295 
298 void rofi_theme_convert_old ( void );
299 #endif
300 
306 char *helper_get_theme_path ( const char *file );
307 
316 char * rofi_theme_parse_prepare_file ( const char *file, const char *parent_file );
317 #endif
int rofi_theme_get_position(const widget *widget, const char *property, int def)
Definition: theme.c:516
char * helper_get_theme_path(const char *file)
Definition: helper.c:1034
int rofi_theme_get_boolean(const widget *widget, const char *property, int def)
Definition: theme.c:571
gboolean rofi_theme_is_empty(void)
Definition: theme.c:769
void rofi_theme_print(ThemeWidget *widget)
Definition: theme.c:329
struct ThemeWidget ** widgets
Definition: theme.h:44
void rofi_theme_free(ThemeWidget *widget)
Definition: theme.c:122
ThemeWidget * rofi_theme_find_or_create_name(ThemeWidget *base, const char *name)
Definition: theme.c:52
RofiOrientation rofi_theme_get_orientation(const widget *widget, const char *property, RofiOrientation def)
Definition: theme.c:587
int rofi_theme_get_integer(const widget *widget, const char *property, int def)
Definition: theme.c:533
Property * rofi_theme_property_copy(Property *p)
Definition: theme.c:77
unsigned int num_widgets
Definition: theme.h:43
GList * rofi_theme_get_list(const widget *widget, const char *property, const char *defaults)
Definition: theme.c:692
int distance_get_pixel(RofiDistance d, RofiOrientation ori)
Definition: theme.c:735
gboolean rofi_theme_parse_file(const char *file)
double rofi_theme_get_double(const widget *widget, const char *property, double def)
Definition: theme.c:620
ThemeWidget * rofi_theme_find_widget(const char *name, const char *state, gboolean exact)
Definition: theme.c:507
RofiOrientation
Definition: rofi-types.h:105
char * rofi_theme_parse_prepare_file(const char *file, const char *parent_file)
Definition: theme.c:920
const char * rofi_theme_get_string(const widget *widget, const char *property, const char *def)
Definition: theme.c:604
RofiHighlightColorStyle rofi_theme_get_highlight(widget *widget, const char *property, RofiHighlightColorStyle th)
Definition: theme.c:718
struct ThemeWidget * parent
Definition: theme.h:48
RofiPadding rofi_theme_get_padding(const widget *widget, const char *property, RofiPadding pad)
Definition: theme.c:669
struct ThemeWidget ThemeWidget
void distance_get_linestyle(RofiDistance d, cairo_t *draw)
Definition: theme.c:758
RofiDistance rofi_theme_get_distance(const widget *widget, const char *property, int def)
Definition: theme.c:549
ThemeWidget * rofi_theme
void rofi_theme_reset(void)
Definition: theme.c:115
GHashTable * properties
Definition: theme.h:46
void rofi_theme_property_free(Property *p)
Definition: theme.c:100
Property * rofi_theme_property_create(PropertyType type)
Definition: theme.c:71
void rofi_theme_get_color(const widget *widget, const char *property, cairo_t *d)
Definition: theme.c:647
void rofi_theme_widget_add_properties(ThemeWidget *widget, GHashTable *table)
Definition: theme.c:385
PropertyType
Definition: rofi-types.h:10
gboolean rofi_theme_parse_string(const char *string)
char * name
Definition: theme.h:41
Property * rofi_theme_find_property(ThemeWidget *widget, PropertyType type, const char *property, gboolean exact)
Definition: theme.c:469