summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-06-02 14:05:19 +0200
committerDave Davenport <qball@gmpclient.org>2017-06-02 14:05:19 +0200
commiteec5c6eadcc5de3c5285a5240db6da2e439d287a (patch)
tree9bb05b3f142d1ec577e62d696523d24f5a50122c /lexer
parent85b6e32158b17a117033df659e39ecd793553327 (diff)
Add orientation property.
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-lexer.l9
-rw-r--r--lexer/theme-parser.y14
2 files changed, 23 insertions, 0 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index 4bb1c60a..38647f60 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -199,6 +199,12 @@ ANGLE_GRAD "grad"
ANGLE_RAD "rad"
ANGLE_TURN "turn"
+
+/* Orientation */
+
+ORIENTATION_HORI "horizontal"
+ORIENTATION_VERT "vertical"
+
/* Color schema */
RGBA rgb[a]?
HWB "hwb"
@@ -484,6 +490,9 @@ if ( queue == NULL ){
<PROPERTIES>{ANGLE_GRAD} { return T_ANGLE_GRAD; }
<PROPERTIES>{ANGLE_TURN} { return T_ANGLE_TURN; }
+<PROPERTIES>{ORIENTATION_HORI} { return ORIENTATION_HORI; }
+<PROPERTIES>{ORIENTATION_VERT} { return ORIENTATION_VERT; }
+
<PROPERTIES>{COLOR_TRANSPARENT} {
return T_COLOR_TRANSPARENT;
}
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index fd290e85..0ed5391b 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -188,6 +188,9 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token T_ANGLE_RAD "Radians"
%token T_ANGLE_TURN "Turns"
+%token ORIENTATION_HORI "Horizontal"
+%token ORIENTATION_VERT "Vertical"
+
%token T_COL_RGBA "rgb[a] colorscheme"
%token T_COL_HSL "hsl colorscheme"
%token T_COL_HWB "hwb colorscheme"
@@ -236,6 +239,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%type <ival> t_property_highlight_style
%type <ival> t_property_line_style
%type <list> t_property_element_list
+%type <ival> t_property_orientation
%start t_entry_list
%%
@@ -372,6 +376,11 @@ t_property
$$->name = $1;
$$->value.list = $4;
}
+| t_property_name T_PSEP t_property_orientation T_PCLOSE {
+ $$ = rofi_theme_property_create ( P_ORIENTATION );
+ $$->name = $1;
+ $$->value.i = $3;
+}
;
/** List of elements */
@@ -569,6 +578,11 @@ t_property_color_value
| T_INT { $$ = $1; }
;
+t_property_orientation
+: ORIENTATION_HORI { $$ = ORIENTATION_HORIZONTAL; }
+| ORIENTATION_VERT { $$ = ORIENTATION_VERTICAL; }
+;
+
/** Property name */
t_property_name
: T_PROP_NAME { $$ = $1; }