From 7c613f6a4ca4354165e2cab987d0db1e7ce32c5a Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Fri, 20 Sep 2019 15:05:36 +0200 Subject: 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 --- include/theme.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include') diff --git a/include/theme.h b/include/theme.h index 0a7c5fc3..2196887e 100644 --- a/include/theme.h +++ b/include/theme.h @@ -32,6 +32,24 @@ #include #include "rofi-types.h" + +typedef enum { + THEME_MEDIA_TYPE_MIN_WIDTH, + THEME_MEDIA_TYPE_MAX_WIDTH, + THEME_MEDIA_TYPE_MIN_HEIGHT, + THEME_MEDIA_TYPE_MAX_HEIGHT, + THEME_MEDIA_TYPE_MON_ID, + THEME_MEDIA_TYPE_MIN_ASPECT_RATIO, + THEME_MEDIA_TYPE_MAX_ASPECT_RATIO, + THEME_MEDIA_TYPE_INVALID, +} ThemeMediaType; + + +typedef struct ThemeMedia { + ThemeMediaType type; + double value; +} ThemeMedia; + /** * ThemeWidget. */ @@ -43,6 +61,8 @@ typedef struct ThemeWidget unsigned int num_widgets; struct ThemeWidget **widgets; + ThemeMedia *media; + GHashTable *properties; struct ThemeWidget *parent; @@ -323,4 +343,11 @@ char *helper_get_theme_path ( const char *file ); * @returns full path to file. */ char * rofi_theme_parse_prepare_file ( const char *file, const char *parent_file ); + +/** + * Process conditionals. + */ +void rofi_theme_parse_process_conditionals ( void ); +void rofi_theme_parse_merge_widgets ( ThemeWidget *parent, ThemeWidget *child ); +ThemeMediaType rofi_theme_parse_media_type ( const char *type ); #endif -- cgit v1.2.3