From 686be5856ce421edf79d147abd52954f7d0cb634 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 17 Aug 2017 19:04:01 +0200 Subject: Move PropertyType into rofi-types header and add check for names pairs. --- include/rofi-types.h | 37 ++++++++++++++++++++++++++++++++++++- include/theme.h | 31 ++----------------------------- 2 files changed, 38 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/include/rofi-types.h b/include/rofi-types.h index 4970e453..0e75c389 100644 --- a/include/rofi-types.h +++ b/include/rofi-types.h @@ -1,6 +1,41 @@ #ifndef INCLUDE_ROFI_TYPES_H #define INCLUDE_ROFI_TYPES_H -extern const char *PropertyTypeName[]; +/** + * Type of property + */ +typedef enum +{ + /** Integer */ + P_INTEGER, + /** Double */ + P_DOUBLE, + /** String */ + P_STRING, + /** Boolean */ + P_BOOLEAN, + /** Color */ + P_COLOR, + /** RofiPadding */ + P_PADDING, + /** Link to global setting */ + P_LINK, + /** Position */ + P_POSITION, + /** Highlight */ + P_HIGHLIGHT, + /** List */ + P_LIST, + /** Orientation */ + P_ORIENTATION, + /** Number of types. */ + P_NUM_TYPES, +} PropertyType; + +/** + * This array maps PropertyType to a user-readable name. + * It is important this is kept in sync. + */ +extern const char * const PropertyTypeName[P_NUM_TYPES]; #endif // INCLUDE_ROFI_TYPES_H diff --git a/include/theme.h b/include/theme.h index c0182e64..5e554b4c 100644 --- a/include/theme.h +++ b/include/theme.h @@ -31,7 +31,8 @@ #include #include #include -#include "theme.h" + +#include "rofi-types.h" /** Style of text highlight */ typedef enum @@ -95,34 +96,6 @@ typedef enum ROFI_ORIENTATION_VERTICAL, ROFI_ORIENTATION_HORIZONTAL } RofiOrientation; -/** - * Type of property - */ -typedef enum -{ - /** Integer */ - P_INTEGER, - /** Double */ - P_DOUBLE, - /** String */ - P_STRING, - /** Boolean */ - P_BOOLEAN, - /** Color */ - P_COLOR, - /** RofiPadding */ - P_PADDING, - /** Link to global setting */ - P_LINK, - /** Position */ - P_POSITION, - /** Highlight */ - P_HIGHLIGHT, - /** List */ - P_LIST, - /** Orientation */ - P_ORIENTATION, -} PropertyType; /** * Represent the color in theme. -- cgit v1.2.3