summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-03 20:45:16 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-03 20:45:16 +0200
commit68641a21438ae402a28c5995128e28d8b14981d0 (patch)
tree7937087c270e3ee66f197ee6b755c41ba53bcffa
parent9a62bfd17284a424cafd4ce649076127eafc2f5d (diff)
Add new keywords to theme printer
-rw-r--r--include/theme.h2
-rw-r--r--source/theme.c17
2 files changed, 16 insertions, 3 deletions
diff --git a/include/theme.h b/include/theme.h
index eae2e7e1..b956af0e 100644
--- a/include/theme.h
+++ b/include/theme.h
@@ -376,7 +376,7 @@ RofiOrientation rofi_theme_get_orientation ( const widget *widget, const char *p
*
* @returns The string value of this property for this widget.
*/
-const char *rofi_theme_get_string ( const widget *widget, const char *property, char *def );
+const char *rofi_theme_get_string ( const widget *widget, const char *property, const char *def );
/**
* @param widget The widget to query
diff --git a/source/theme.c b/source/theme.c
index 3cc64a29..e261c0ee 100644
--- a/source/theme.c
+++ b/source/theme.c
@@ -163,6 +163,19 @@ static void rofi_theme_print_property_index ( size_t pnl, int depth, Property *p
printf ( "%*s%s:%*s ", depth, "", p->name, (int) pnl - pl, "" );
switch ( p->type )
{
+ case P_LIST:
+ printf ("[ ");
+ for ( GList *iter = p->value.list; iter != NULL; iter = g_list_next ( iter ) ) {
+ printf("%s", (char*)(iter->data));
+ if ( iter->next != NULL ) {
+ printf(",");
+ }
+ }
+ printf (" ];");
+ break;
+ case P_ORIENTATION:
+ printf("%s;", (p->value.i == ROFI_ORIENTATION_HORIZONTAL)? "horizontal":"vertical" );
+ break;
case P_HIGHLIGHT:
if ( p->value.highlight.style & ROFI_HL_BOLD ) {
printf ( "bold " );
@@ -552,7 +565,7 @@ RofiOrientation rofi_theme_get_orientation ( const widget *widget, const char *p
return def;
}
-const char *rofi_theme_get_string ( const widget *widget, const char *property, char *def )
+const char *rofi_theme_get_string ( const widget *widget, const char *property, const char *def )
{
ThemeWidget *wid = rofi_theme_find_widget ( widget->name, widget->state, FALSE );
Property *p = rofi_theme_find_property ( wid, P_STRING, property, FALSE );
@@ -611,7 +624,7 @@ GList *rofi_theme_get_list ( const widget *widget, const char * property, const
Property *p = rofi_theme_find_property ( wid2, P_LIST, property, TRUE );
if ( p ) {
if ( p->type == P_LIST ) {
- return g_list_copy_deep ( p->value.list, g_strdup, NULL );
+ return g_list_copy_deep ( p->value.list, (GCopyFunc)g_strdup, NULL );
}
}
char **r = defaults ? g_strsplit ( defaults, ",", 0 ) : NULL;