css: Fix GtkCssChange enum

Get rid of unused values (POSITION_ENUM) and use different values for
NAME and ID.
This commit is contained in:
Benjamin Otte 2015-08-27 14:06:13 +02:00
parent f1ca75d181
commit 4ebb5781ea
2 changed files with 42 additions and 36 deletions

View File

@ -54,6 +54,7 @@ _gtk_css_change_for_sibling (GtkCssChange match)
static const GtkCssChangeTranslation table[] = {
{ GTK_CSS_CHANGE_CLASS, GTK_CSS_CHANGE_SIBLING_CLASS },
{ GTK_CSS_CHANGE_NAME, GTK_CSS_CHANGE_SIBLING_NAME },
{ GTK_CSS_CHANGE_ID, GTK_CSS_CHANGE_SIBLING_ID },
{ GTK_CSS_CHANGE_FIRST_CHILD, GTK_CSS_CHANGE_SIBLING_FIRST_CHILD },
{ GTK_CSS_CHANGE_LAST_CHILD, GTK_CSS_CHANGE_SIBLING_LAST_CHILD },
{ GTK_CSS_CHANGE_NTH_CHILD, GTK_CSS_CHANGE_NTH_CHILD | GTK_CSS_CHANGE_SIBLING_NTH_CHILD },
@ -72,6 +73,7 @@ _gtk_css_change_for_child (GtkCssChange match)
static const GtkCssChangeTranslation table[] = {
{ GTK_CSS_CHANGE_CLASS, GTK_CSS_CHANGE_PARENT_CLASS },
{ GTK_CSS_CHANGE_NAME, GTK_CSS_CHANGE_PARENT_NAME },
{ GTK_CSS_CHANGE_ID, GTK_CSS_CHANGE_PARENT_ID },
{ GTK_CSS_CHANGE_FIRST_CHILD, GTK_CSS_CHANGE_PARENT_FIRST_CHILD },
{ GTK_CSS_CHANGE_LAST_CHILD, GTK_CSS_CHANGE_PARENT_LAST_CHILD },
{ GTK_CSS_CHANGE_NTH_CHILD, GTK_CSS_CHANGE_PARENT_NTH_CHILD },
@ -79,6 +81,7 @@ _gtk_css_change_for_child (GtkCssChange match)
{ GTK_CSS_CHANGE_STATE, GTK_CSS_CHANGE_PARENT_STATE },
{ GTK_CSS_CHANGE_SIBLING_CLASS, GTK_CSS_CHANGE_PARENT_SIBLING_CLASS },
{ GTK_CSS_CHANGE_SIBLING_NAME, GTK_CSS_CHANGE_PARENT_SIBLING_NAME },
{ GTK_CSS_CHANGE_SIBLING_ID, GTK_CSS_CHANGE_PARENT_SIBLING_ID },
{ GTK_CSS_CHANGE_SIBLING_FIRST_CHILD, GTK_CSS_CHANGE_PARENT_SIBLING_FIRST_CHILD },
{ GTK_CSS_CHANGE_SIBLING_LAST_CHILD, GTK_CSS_CHANGE_PARENT_SIBLING_LAST_CHILD },
{ GTK_CSS_CHANGE_SIBLING_NTH_CHILD, GTK_CSS_CHANGE_PARENT_SIBLING_NTH_CHILD },

View File

@ -31,43 +31,44 @@ typedef struct _GtkStyleProviderPrivate GtkStyleProviderPrivate; /* dummy typede
#define GTK_CSS_CHANGE_CLASS (1ULL << 0)
#define GTK_CSS_CHANGE_NAME (1ULL << 1)
#define GTK_CSS_CHANGE_ID (1ULL << 1) /* = GTK_CSS_CHANGE_NAME */
#define GTK_CSS_CHANGE_REGION (1ULL << 1) /* = GTK_CSS_CHANGE_NAME */
#define GTK_CSS_CHANGE_FIRST_CHILD (1ULL << 2)
#define GTK_CSS_CHANGE_LAST_CHILD (1ULL << 3)
#define GTK_CSS_CHANGE_NTH_CHILD (1ULL << 4)
#define GTK_CSS_CHANGE_NTH_LAST_CHILD (1ULL << 5)
#define GTK_CSS_CHANGE_STATE (1ULL << 6)
#define GTK_CSS_CHANGE_SIBLING_CLASS (1ULL << 7)
#define GTK_CSS_CHANGE_SIBLING_NAME (1ULL << 8)
#define GTK_CSS_CHANGE_SIBLING_FIRST_CHILD (1ULL << 9)
#define GTK_CSS_CHANGE_SIBLING_LAST_CHILD (1ULL << 10)
#define GTK_CSS_CHANGE_SIBLING_NTH_CHILD (1ULL << 11)
#define GTK_CSS_CHANGE_SIBLING_NTH_LAST_CHILD (1ULL << 12)
#define GTK_CSS_CHANGE_SIBLING_STATE (1ULL << 13)
#define GTK_CSS_CHANGE_PARENT_CLASS (1ULL << 14)
#define GTK_CSS_CHANGE_PARENT_NAME (1ULL << 15)
#define GTK_CSS_CHANGE_PARENT_REGION (1ULL << 15) /* = GTK_CSS_CHANGE_PARENT_NAME */
#define GTK_CSS_CHANGE_PARENT_POSITION_ENUM (1ULL << 16)
#define GTK_CSS_CHANGE_PARENT_FIRST_CHILD (1ULL << 17)
#define GTK_CSS_CHANGE_PARENT_LAST_CHILD (1ULL << 18)
#define GTK_CSS_CHANGE_PARENT_NTH_CHILD (1ULL << 19)
#define GTK_CSS_CHANGE_PARENT_NTH_LAST_CHILD (1ULL << 20)
#define GTK_CSS_CHANGE_PARENT_STATE (1ULL << 21)
#define GTK_CSS_CHANGE_PARENT_SIBLING_CLASS (1ULL << 22)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NAME (1ULL << 23)
#define GTK_CSS_CHANGE_PARENT_SIBLING_FIRST_CHILD (1ULL << 24)
#define GTK_CSS_CHANGE_PARENT_SIBLING_LAST_CHILD (1ULL << 25)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_CHILD (1ULL << 26)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_LAST_CHILD (1ULL << 27)
#define GTK_CSS_CHANGE_PARENT_SIBLING_POSITION_ENUM (1ULL << 28)
#define GTK_CSS_CHANGE_PARENT_SIBLING_STATE (1ULL << 29)
#define GTK_CSS_CHANGE_REGION GTK_CSS_CHANGE_NAME
#define GTK_CSS_CHANGE_ID (1ULL << 2)
#define GTK_CSS_CHANGE_FIRST_CHILD (1ULL << 3)
#define GTK_CSS_CHANGE_LAST_CHILD (1ULL << 4)
#define GTK_CSS_CHANGE_NTH_CHILD (1ULL << 5)
#define GTK_CSS_CHANGE_NTH_LAST_CHILD (1ULL << 6)
#define GTK_CSS_CHANGE_STATE (1ULL << 7)
#define GTK_CSS_CHANGE_SIBLING_CLASS (1ULL << 8)
#define GTK_CSS_CHANGE_SIBLING_NAME (1ULL << 9)
#define GTK_CSS_CHANGE_SIBLING_ID (1ULL << 10)
#define GTK_CSS_CHANGE_SIBLING_FIRST_CHILD (1ULL << 11)
#define GTK_CSS_CHANGE_SIBLING_LAST_CHILD (1ULL << 12)
#define GTK_CSS_CHANGE_SIBLING_NTH_CHILD (1ULL << 13)
#define GTK_CSS_CHANGE_SIBLING_NTH_LAST_CHILD (1ULL << 14)
#define GTK_CSS_CHANGE_SIBLING_STATE (1ULL << 15)
#define GTK_CSS_CHANGE_PARENT_CLASS (1ULL << 16)
#define GTK_CSS_CHANGE_PARENT_NAME (1ULL << 17)
#define GTK_CSS_CHANGE_PARENT_REGION GTK_CSS_CHANGE_PARENT_NAME
#define GTK_CSS_CHANGE_PARENT_ID (1ULL << 18)
#define GTK_CSS_CHANGE_PARENT_FIRST_CHILD (1ULL << 19)
#define GTK_CSS_CHANGE_PARENT_LAST_CHILD (1ULL << 20)
#define GTK_CSS_CHANGE_PARENT_NTH_CHILD (1ULL << 21)
#define GTK_CSS_CHANGE_PARENT_NTH_LAST_CHILD (1ULL << 22)
#define GTK_CSS_CHANGE_PARENT_STATE (1ULL << 23)
#define GTK_CSS_CHANGE_PARENT_SIBLING_CLASS (1ULL << 24)
#define GTK_CSS_CHANGE_PARENT_SIBLING_ID (1ULL << 25)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NAME (1ULL << 26)
#define GTK_CSS_CHANGE_PARENT_SIBLING_FIRST_CHILD (1ULL << 27)
#define GTK_CSS_CHANGE_PARENT_SIBLING_LAST_CHILD (1ULL << 28)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_CHILD (1ULL << 29)
#define GTK_CSS_CHANGE_PARENT_SIBLING_NTH_LAST_CHILD (1ULL << 30)
#define GTK_CSS_CHANGE_PARENT_SIBLING_STATE (1ULL << 31)
/* add more */
#define GTK_CSS_CHANGE_SOURCE (1ULL << 30)
#define GTK_CSS_CHANGE_PARENT_STYLE (1ULL << 31)
#define GTK_CSS_CHANGE_TIMESTAMP (1ULL << 32)
#define GTK_CSS_CHANGE_ANIMATIONS (1ULL << 33)
#define GTK_CSS_CHANGE_SOURCE (1ULL << 32)
#define GTK_CSS_CHANGE_PARENT_STYLE (1ULL << 33)
#define GTK_CSS_CHANGE_TIMESTAMP (1ULL << 34)
#define GTK_CSS_CHANGE_ANIMATIONS (1ULL << 35)
#define GTK_CSS_CHANGE_RESERVED_BIT (1ULL << 62) /* Used internally in gtkcssselector.c */
@ -84,11 +85,13 @@ typedef guint64 GtkCssChange;
#define GTK_CSS_CHANGE_ANY ((1 << 19) - 1)
#define GTK_CSS_CHANGE_ANY_SELF (GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_STATE)
#define GTK_CSS_CHANGE_ANY_SELF (GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_ID | GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_STATE)
#define GTK_CSS_CHANGE_ANY_SIBLING (GTK_CSS_CHANGE_SIBLING_CLASS | GTK_CSS_CHANGE_SIBLING_NAME | \
GTK_CSS_CHANGE_SIBLING_ID | \
GTK_CSS_CHANGE_SIBLING_POSITION | GTK_CSS_CHANGE_SIBLING_STATE)
#define GTK_CSS_CHANGE_ANY_PARENT (GTK_CSS_CHANGE_PARENT_CLASS | GTK_CSS_CHANGE_PARENT_SIBLING_CLASS | \
GTK_CSS_CHANGE_PARENT_NAME | GTK_CSS_CHANGE_PARENT_SIBLING_NAME | \
GTK_CSS_CHANGE_PARENT_ID | GTK_CSS_CHANGE_PARENT_SIBLING_ID | \
GTK_CSS_CHANGE_PARENT_POSITION | GTK_CSS_CHANGE_PARENT_SIBLING_POSITION | \
GTK_CSS_CHANGE_PARENT_STATE | GTK_CSS_CHANGE_PARENT_SIBLING_STATE)