diff --git a/configure.ac b/configure.ac index a77ce00e..0445e422 100644 --- a/configure.ac +++ b/configure.ac @@ -101,6 +101,7 @@ AC_CHECK_FUNC([fcntl],, AC_MSG_ERROR("Could not find fcntl")) AC_CHECK_FUNC([setlocale],,AC_MSG_ERROR("Could not find setlocale")) AC_CHECK_FUNC([atexit],, AC_MSG_ERROR("Could not find atexit in c library")) AC_CHECK_FUNC([glob],, AC_MSG_ERROR("Could not find glob in c library")) +AC_CHECK_FUNC([toupper],, AC_MSG_ERROR("Could not find toupper in c library")) AC_CHECK_HEADER([math.h],, AC_MSG_ERROR("Could not find math.h header file")) AC_SEARCH_LIBS([floor],[m],, AC_MSG_ERROR("Could not find floor in math library")) @@ -122,6 +123,9 @@ PKG_CHECK_MODULES([pango], [pango pangocairo]) PKG_CHECK_MODULES([cairo], [cairo cairo-xcb]) PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0 ]) +dnl --------------------------------------------------------------------- +dnl check - Unit testing. +dnl --------------------------------------------------------------------- AC_ARG_ENABLE([check], AS_HELP_STRING([--disable-check], [Build with checks using check library (default: enabled)])) AS_IF([test "x${enable_check}" != "xno"], [ PKG_CHECK_MODULES([check],[check >= 0.11.0], [HAVE_CHECK=1]) ]) diff --git a/doc/rofi-theme-manpage.markdown b/doc/rofi-theme-manpage.markdown index 313978db..27bec018 100644 --- a/doc/rofi-theme-manpage.markdown +++ b/doc/rofi-theme-manpage.markdown @@ -282,6 +282,7 @@ For example: ``` background: #FF0000; foreground: rgba(0,0,1, 0.5); +text: SeaGreen; ``` ## Text style diff --git a/doc/rofi-theme.5 b/doc/rofi-theme.5 index 5036f07b..a13702a6 100644 --- a/doc/rofi-theme.5 +++ b/doc/rofi-theme.5 @@ -429,6 +429,7 @@ For example: background: #FF0000; foreground: rgba(0,0,1, 0\.5); +text: SeaGreen; . .fi . diff --git a/include/theme.h b/include/theme.h index 16d03c1d..e6ca825f 100644 --- a/include/theme.h +++ b/include/theme.h @@ -42,6 +42,8 @@ typedef enum HL_BOLD = 1, /** underline */ HL_UNDERLINE = 2, + /** strikethrough */ + HL_STRIKETHROUGH = 16, /** italic */ HL_ITALIC = 4, /** color */ diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index 36fbccab..cf85a0fb 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -184,10 +184,11 @@ EAST "east" WEST "west" /* Line Style */ -NONE "none" -BOLD "bold" -UNDERLINE "underline" -ITALIC "italic" +NONE "none" +BOLD "bold" +UNDERLINE "underline" +ITALIC "italic" +STRIKETHROUGH "strikethrough" /* ANGLES */ @@ -439,31 +440,32 @@ if ( queue == NULL ){ return T_COLOR; } /* Color schemes */ -{RGBA} { return T_COL_RGBA; } -{HSL} { return T_COL_HSL; } -{HWB} { return T_COL_HWB; } -{CMYK} { return T_COL_CMYK; } +{RGBA} { return T_COL_RGBA; } +{HSL} { return T_COL_HSL; } +{HWB} { return T_COL_HWB; } +{CMYK} { return T_COL_CMYK; } /* Fluff */ -{S_T_PARENT_LEFT} { return T_PARENT_LEFT; } -{S_T_PARENT_RIGHT} { return T_PARENT_RIGHT;} -{COMMA} { return T_COMMA; } -{FORWARD_SLASH} { return T_FORWARD_SLASH; } +{S_T_PARENT_LEFT} { return T_PARENT_LEFT; } +{S_T_PARENT_RIGHT} { return T_PARENT_RIGHT; } +{COMMA} { return T_COMMA; } +{FORWARD_SLASH} { return T_FORWARD_SLASH; } /* Position */ -{CENTER} { return T_POS_CENTER; } -{EAST} { return T_POS_EAST; } -{WEST} { return T_POS_WEST; } -{SOUTH} { return T_POS_SOUTH; } -{NORTH} { return T_POS_NORTH; } +{CENTER} { return T_POS_CENTER; } +{EAST} { return T_POS_EAST; } +{WEST} { return T_POS_WEST; } +{SOUTH} { return T_POS_SOUTH; } +{NORTH} { return T_POS_NORTH; } /* Highlight style */ -{NONE} { return T_NONE; } -{BOLD} { return T_BOLD; } -{ITALIC} { return T_ITALIC; } -{UNDERLINE} { return T_UNDERLINE; } +{NONE} { return T_NONE; } +{BOLD} { return T_BOLD; } +{ITALIC} { return T_ITALIC; } +{UNDERLINE} { return T_UNDERLINE; } +{STRIKETHROUGH} { return T_STRIKETHROUGH; } -{ANGLE_DEG} { return T_ANGLE_DEG; } -{ANGLE_RAD} { return T_ANGLE_RAD; } -{ANGLE_GRAD} { return T_ANGLE_GRAD; } -{ANGLE_TURN} { return T_ANGLE_TURN; } +{ANGLE_DEG} { return T_ANGLE_DEG; } +{ANGLE_RAD} { return T_ANGLE_RAD; } +{ANGLE_GRAD} { return T_ANGLE_GRAD; } +{ANGLE_TURN} { return T_ANGLE_TURN; } {COLOR_TRANSPARENT} { return T_COLOR_TRANSPARENT; diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 816bbd7c..e721b346 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -173,6 +173,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b) %token T_BOLD "Bold" %token T_ITALIC "Italic" %token T_UNDERLINE "Underline" +%token T_STRIKETHROUGH "Strikethrough" %token T_DASH "Dash" %token T_SOLID "Solid" @@ -394,10 +395,11 @@ t_property_highlight_styles ; /** Single style. */ t_property_highlight_style -: T_NONE { $$ = HL_NONE; } -| T_BOLD { $$ = HL_BOLD; } -| T_UNDERLINE { $$ = HL_UNDERLINE; } -| T_ITALIC { $$ = HL_ITALIC; } +: T_NONE { $$ = HL_NONE; } +| T_BOLD { $$ = HL_BOLD; } +| T_UNDERLINE { $$ = HL_UNDERLINE; } +| T_STRIKETHROUGH { $$ = HL_STRIKETHROUGH; } +| T_ITALIC { $$ = HL_ITALIC; } ; /** Distance. */ diff --git a/source/helper.c b/source/helper.c index d31a4e20..e14a5e68 100644 --- a/source/helper.c +++ b/source/helper.c @@ -423,6 +423,12 @@ PangoAttrList *helper_token_match_get_pango_attr ( ThemeHighlight th, GRegex **t pa->end_index = end; pango_attr_list_insert ( retv, pa ); } + if ( th.style & HL_STRIKETHROUGH ) { + PangoAttribute *pa = pango_attr_strikethrough_new ( TRUE ); + pa->start_index = start; + pa->end_index = end; + pango_attr_list_insert ( retv, pa ); + } if ( th.style & HL_ITALIC ) { PangoAttribute *pa = pango_attr_style_new ( PANGO_STYLE_ITALIC ); pa->start_index = start; diff --git a/source/theme.c b/source/theme.c index 03f3e859..601738ea 100644 --- a/source/theme.c +++ b/source/theme.c @@ -169,6 +169,9 @@ static void rofi_theme_print_property_index ( size_t pnl, int depth, Property *p if ( p->value.highlight.style & HL_UNDERLINE ) { printf ( "underline " ); } + if ( p->value.highlight.style & HL_STRIKETHROUGH ) { + printf ( "strikethrough " ); + } if ( p->value.highlight.style & HL_ITALIC ) { printf ( "italic " ); }