Commit graph

185 commits

Author SHA1 Message Date
Dave Davenport
9a3d4b1d2e [Test] Fix compiler warning, theme test (bug in lexer) and more. 2020-04-26 11:43:14 +02:00
Dave Davenport
151547a99e
[Themes] add calc() support to distance in theme format. (#1105)
* Initial test to allow math in distances.

Support + and -
Needs spaces around + and -.

* [THEME] Fix printing theme with math in distance.

* [Theme] use calc() syntax.

* [Theme] Add * and /  to calc().

* [Theme] Fix the precedense ordering in parsing. Also avoid making copies.

* [Theme] Don't print unneeded ().

* [Theme] Add modulo to calc.
2020-04-24 19:54:08 +02:00
Dave Davenport
7c613f6a4c
Issue893: Add support for @media in the theme format. (#1015)
* [Lexer] Add support for @media.

Issue: #893

* [Theme] @media limit to px.

* [Theme@Media] add *{} support.

* [Theme@Media] Add support for monitor-id media.

* [Theme@Media] Code cleanup.

* [Theme@Media] Add min/max-aspect-ratio.

* [Theme@Media] Remove some debug output

Fixes: #893
2019-09-20 15:05:36 +02:00
Quentin Glidic
7416f344a3
Use g_list_free_full()
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2019-04-19 10:00:58 +02:00
Quentin Glidic
a9dae788d1
Correctly include config.h first
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2019-04-19 09:59:53 +02:00
Dave Davenport
e17d63f5ae [Lexer] Fix nested () in variable default field.
- var ( a, rgba(0,0,0,0)) was broke

Fixes: #936
2019-03-21 10:33:50 +01:00
Dave Davenport
40da1b25e2 [Theme3.0] Change reference to use the CSS like var() syntax.
Supports defaults var(name, default); var(name);
Where default can be another property.
(https://www.w3schools.com/css/css3_variables.asp)

This deprecates the @name syntax.

Fixes: #876
2019-01-29 17:56:45 +01:00
Dave Davenport
0dfc671bcc [GrammarParser] Fix memory leak of Property after parsing config entry. 2019-01-29 07:32:07 +01:00
Dave Davenport
0058088962 [Lexer] Remove Ambiguity in parser on empty input. 2018-07-21 18:43:03 +02:00
Dave Davenport
06165f867a [Lexer] Only allow configuration blocks before theme. 2018-07-15 11:04:47 +02:00
Dave Davenport
09db7d5d3f [Tests] Fix window test. 2018-07-10 13:53:40 +02:00
Dave Davenport
8e77a7f8c9 [Lexer] Also allow non-capitalized environment variables 2018-07-09 11:57:21 +02:00
Dave Davenport
711d4517b9 [Lexer] Add support for environment variables.
You can do ${TEST} to parse the content of TEST. This will be fed into
the lexer again, and should parse all properties.
2018-07-09 11:48:32 +02:00
Dave Davenport
441c511296
Add an generic icon fetcher that can be used by any widget and re-uses the main threadpool.
Add an generic icon fetcher that can be used by any widget and re-uses the main threadpool.

* Make threadpool more generic usable.
* Add generic icon fetcher, that caches icons.
* Make DRUN use this fetcher.
* Add icon widget.

#809
2018-06-09 19:13:57 +02:00
Dave Davenport
ef6ace4333 [Lexer] Allow quoted utf8 string in list type. 2018-04-28 15:30:01 +02:00
Dave Davenport
02baaf4df4 [Lexer] Make not finding a configuration option a warning, not an error. 2018-04-28 15:29:17 +02:00
Edward Betts
79adae77d7 Correct spelling mistakes. (#722) 2017-11-23 18:41:52 +01:00
Dave Davenport
f992e0e21a Add the prompt colon to the default theme.
- Fix dumping of theme localization of the decimal-point. Force it to
be always a '.'.
2017-11-05 12:56:41 +01:00
Dave Davenport
ad877bb2e6 [ThemeParser] Give a more detailed error when only 7 elements are specified in argb syntax. 2017-10-30 17:07:13 +01:00
Dave Davenport
847d2e82a0 [Lexer/Parser] Make the '#' before element optional. 2017-10-22 12:42:33 +02:00
Dave Davenport
99f2a1a9bf Add @theme import command, that resets the current theme. 2017-09-18 17:48:13 +02:00
Dave Davenport
ae0323211b small update to default theme 2017-09-18 07:49:24 +02:00
Dave Davenport
d4bf5ad020 Allow 0 in padding when passing more then 1 argument. 2017-09-07 08:43:00 +02:00
Dave Davenport
2a5cb6f621 Alias 'color' property name to 'text-color' 2017-09-07 08:35:09 +02:00
Dave Davenport
7c1ecb4707 Add support for multiple selectors. #dummy0, dummy1 {} 2017-09-06 23:11:03 +02:00
Dave Davenport
50998b8f04 Flatten hierarchy, don't inherit by default.
* add keyword inherit to language parser and theme structure.
2017-09-06 10:03:44 +02:00
Dave Davenport
ba296f9210 Add ch as size unit. 2017-09-05 13:52:21 +02:00
Dave Davenport
da00848416 Do better error reporting on configuration entries in rasi format. 2017-06-20 18:10:18 +02:00
Dave Davenport
8375fbb513 Support a config.rasi configuration file in the new format 2017-06-20 17:56:27 +02:00
Dave Davenport
22aacb8f94 Add extra check for rofi_theme_parse_prepare_file 2017-06-14 16:19:17 +02:00
Dave Davenport
32f67ab5a5 Add list property test, allow empty lists. 2017-06-14 08:18:59 +02:00
Dave Davenport
6e5e21b66d Initialize all fields in hsl_to_rgb conversion 2017-06-13 10:41:58 +02:00
Dave Davenport
47c7518656 Fix parsing old themes from rofi-themes repo. 2017-06-07 20:41:43 +02:00
Dave Davenport
8c27289d95 Support empty strings as property. 2017-06-07 13:28:43 +02:00
Dave Davenport
9b0d1faacf Replace g_log by g_debug 2017-06-02 22:39:20 +02:00
Dave Davenport
bac92616d3 Remove toupper from lexer.c replace by glib equiv. 2017-06-02 22:33:55 +02:00
Dave Davenport
218886f897 Make matching keywords like Vertical case-insensitive add test.
- Make keywords like dash, horizontal, etc case-insensitive.
 - Add test for orientation property.
2017-06-02 22:12:00 +02:00
Dave Davenport
3e46228074 Change Padding to RofiPadding 2017-06-02 16:44:16 +02:00
Dave Davenport
ea7d20d150 Change Orientation enum to RofiOrientation. 2017-06-02 16:34:52 +02:00
Dave Davenport
9915857a2e Change Distance struct to RofiDistance. 2017-06-02 16:25:47 +02:00
Dave Davenport
7352f1c2ba Change PixelWidth to RofiPixelUnit. 2017-06-02 16:21:05 +02:00
Dave Davenport
48bf1709b6 Rename HL_ to ROFI_HL_ and fix box test. 2017-06-02 16:09:20 +02:00
Dave Davenport
eec5c6eadc Add orientation property. 2017-06-02 14:05:19 +02:00
Dave Davenport
28f116b4a2 Allow textbox to be added in theme 2017-05-28 18:05:02 +02:00
Dave Davenport
e65c306e1a Merge remote-tracking branch 'origin/master' into barview 2017-05-28 17:07:23 +02:00
Dave Davenport
85e6bfcc78 Add strings.h to lexer file for strncasecmp. 2017-05-28 17:06:41 +02:00
Dave Davenport
c23df70aeb Allow interface to be dynamically changed. 2017-05-25 23:41:15 +02:00
Dave Davenport
dca5caaa47 [Theme] Add small caps options (not working?) 2017-05-22 09:24:05 +02:00
Dave Davenport
72afc7b039 Add strikethrough highlight method. 2017-05-18 07:59:37 +02:00
Dave Davenport
41a7e06919 [Theme] Update theme-manpage 2017-05-17 08:24:28 +02:00
Dave Davenport
30fb8c514e Change ARGB to RGBA, fix in theme converter 2017-05-16 21:55:52 +02:00
Dave Davenport
494550d38d [ThemeParser] Add CSS color names support
* [ThemeParser] Add css color names

* Add CSS color support (WIP)

* Parse color names in the lexer.

* Add test for css color names

* Indent and fix ordering
2017-05-15 22:46:33 +02:00
Dave Davenport
e397c346da [ThemeParser] Extend color formats.
- Support whitespace format.
 - Support deg,rad, grad, turn angle.
 - Add alpha channel support to hwb
2017-05-15 15:05:40 +02:00
Dave Davenport
f0ceeb86d8 [Lexer] Support hsla 2017-05-15 09:10:02 +02:00
Dave Davenport
94ee637102 [Parser] Fix HWB parser alpha channel and add test. 2017-05-13 22:51:10 +02:00
Dave Davenport
76244fedc0 Make property name rule consistent. 2017-05-11 18:25:38 +02:00
Dave Davenport
ed11c3265d Cleanup parser (document some rules) 2017-05-11 18:23:36 +02:00
Dave Davenport
aaea2b2c8a Add hsl and cmyk test, add extra error checking 2017-05-10 20:54:16 +02:00
Dave Davenport
f5b1e4b3d4 Move most of the parsing to yacc instead of lexer 2017-05-10 12:41:06 +02:00
Dave Davenport
00e297c5ca Update highlight style parsing 2017-05-09 14:12:03 +02:00
Dave Davenport
cf8796ccd3 Move position parsing to bison file. 2017-05-09 13:53:45 +02:00
Dave Davenport
2a381856aa Allow more whitespace in colortype() structure 2017-05-08 22:21:01 +02:00
Dave Davenport
a8bf476db3 Add support for hwb,hsl,cmyk (need tests) 2017-05-06 16:10:20 +02:00
Quentin Glidic
4fccb3efdc
theme-parser: Drop lexer/ in #includes
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-05-04 13:40:12 +02:00
Dave Davenport
cc714f8f91 Fix more compiler warning 2017-05-04 07:56:40 +02:00
Dave Davenport
484aa35716 [Lexer] Fix color parsing. 2017-04-26 22:45:14 +02:00
Dave Davenport
d79423f2cf [Lexer] Fix wrong division factor for #RGB color parsing (15 not 16) 2017-04-26 18:43:49 +02:00
Dave Davenport
38f91e8953 [Test,Lexer] Add test for distance parsing, fix bug in em (double)
* Parsed as int, not double.
2017-04-26 08:05:04 +02:00
Dave Davenport
97fe894f43 Add some theme name resolving functions. 2017-04-17 17:46:01 +02:00
Quentin Glidic
9a68b22009
Fix licenses headers
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-04-15 12:32:05 +02:00
Dave Davenport
d6af6d29fc Small memory leak in theme-config parser. 2017-04-12 09:22:26 +02:00
Dave Davenport
79c33cfca6 Improve error messages when type does not match. 2017-04-09 15:27:23 +02:00
Dave Davenport
898b5466f0 Fix memory leak on parser fail. 2017-04-06 09:12:03 +02:00
Dave Davenport
387093a673 Fix EM always being real 2017-04-05 21:27:35 +02:00
Dave Davenport
557241ba94 New FLEX version compares against 0 for EOF other (old) against EOF (-1) 2017-04-05 08:26:11 +02:00
Dave Davenport
66c5c6ab55 Change back to int. (did not do what expected) 2017-04-04 08:58:20 +02:00
Dave Davenport
358759e0ab Reset pointer to NULL after free'ing. 2017-04-04 08:31:25 +02:00
Dave Davenport
ed647dc4c1 Fix some conversion compatibility 2017-04-02 12:47:53 +02:00
Dave Davenport
a754815d14 Add converter back for old theme format. 2017-04-02 12:32:11 +02:00
Dave Davenport
28f74e3a5a Change Configuration to configuration 2017-03-29 19:54:13 +02:00
Dave Davenport
5259eb11bc Merge the configuration loading into something more simple (3) 2017-03-28 17:33:43 +02:00
Dave Davenport
958bb0ebc6 Use lexer type so signedness is correct. 2017-03-28 10:16:22 +02:00
Dave Davenport
439532450a Fix position in first parsed file. 2017-03-28 09:19:04 +02:00
Dave Davenport
c7daf2d06c I am bad, and that is good - Ralph. Fix missing include 2017-03-28 09:02:39 +02:00
Dave Davenport
b91a9fb0c0 Add 'Configuration' section to rasi format that parses config option. 2017-03-27 09:04:55 +02:00
Dave Davenport
5814478723 Add UTF8 string support to lex (I hope) 2017-03-26 22:54:53 +02:00
Dave Davenport
606f4e89c5 Add teardown debug message 2017-03-21 19:46:56 +01:00
Dave Davenport
9cfb075bc4 Add filename to location in error message. 2017-03-13 16:42:17 +01:00
Dave Davenport
d67a562d88 Get full canonical path for duplicate filtering. 2017-03-13 16:17:11 +01:00
Dave Davenport
ab9a2b05d3 Don't parse same files, multiple times. 2017-03-13 14:16:38 +01:00
Dave Davenport
1ca69704db Cleanup lexer a bit 2017-03-13 10:49:33 +01:00
Dave Davenport
be036f086d Reset location when importing, correctly resolve relative path 2017-03-13 08:54:55 +01:00
Dave Davenport
b7f4b7484f Some initial support for @import in theme and try to fall back when theme fails to load 2017-03-11 17:06:06 +01:00
Dave Davenport
cb9255bbea Allow slice allocator for theme 2017-03-04 20:09:19 +01:00
Dave Davenport
63d8bfb071 Updates 2017-01-11 23:19:29 +01:00
Dave Davenport
ca01af6338 Try to improve error handling and messages 2017-01-09 22:29:31 +01:00
Dave Davenport
854aa55453 Better error reporting (1) 2017-01-09 18:32:26 +01:00
Dave Davenport
a199fa3275 Improve error message theme a little bit 2017-01-09 08:55:51 +01:00
Dave Davenport
713d41f619 Allow matching highlighting to be set. Fixes #522 2017-01-09 00:09:02 +01:00
Dave Davenport
3944a5bde2 Reset parsing queue on EOF. 2017-01-08 16:16:09 +01:00