r3027 - in trunk/src/target/OM-2007.2/libraries/moko-gtk-engine: . src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Fri Sep 21 16:26:37 CEST 2007
Author: thomas
Date: 2007-09-21 16:26:35 +0200 (Fri, 21 Sep 2007)
New Revision: 3027
Modified:
trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c
trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h
Log:
* src/moko-style.c: (moko_rc_style_merge), (moko_rc_style_parse):
* src/moko-style.h:
Use bit flag to indicate which engine options have been set (fixes any
options not set in the first matched style)
Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog 2007-09-21 11:22:30 UTC (rev 3026)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog 2007-09-21 14:26:35 UTC (rev 3027)
@@ -1,5 +1,13 @@
2007-09-21 Thomas Wood <thomas at openedhand.com>
+ * src/moko-style.c: (moko_rc_style_merge), (moko_rc_style_parse):
+ * src/moko-style.h:
+
+ Use bit flag to indicate which engine options have been set (fixes any
+ options not set in the first matched style)
+
+2007-09-21 Thomas Wood <thomas at openedhand.com>
+
* data/gtkrc: Define some standard icon sizes
2007-09-20 Thomas Wood <thomas at openedhand.com>
Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c 2007-09-21 11:22:30 UTC (rev 3026)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c 2007-09-21 14:26:35 UTC (rev 3027)
@@ -107,11 +107,19 @@
{
if (MOKO_IS_RC_STYLE (src))
{
+ guint flags;
MokoRcStyle *src_data = MOKO_RC_STYLE (src);
MokoRcStyle *dest_data = MOKO_RC_STYLE (dest);
- dest_data->has_border = src_data->has_border;
- dest_data->has_gradient = src_data->has_gradient;
+ flags = (~dest_data->flags) & src_data->flags;
+
+ if (flags & BORDER_SET)
+ dest_data->has_border = src_data->has_border;
+
+ if (flags & GRADIENT_SET)
+ dest_data->has_gradient = src_data->has_gradient;
+
+ dest_data->flags = dest_data->flags | src_data->flags;
}
moko_parent_rc_style_class->merge (dest, src);
@@ -182,12 +190,14 @@
if (token != G_TOKEN_NONE)
break;
theme_data->has_border = i;
+ theme_data->flags = theme_data->flags | BORDER_SET;
break;
case TOKEN_HAS_GRADIENT:
token = moko_rc_parse_boolean (scanner, TOKEN_HAS_GRADIENT, &i);
if (token != G_TOKEN_NONE)
break;
theme_data->has_gradient = i;
+ theme_data->flags = theme_data->flags | GRADIENT_SET;
break;
default:
Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h 2007-09-21 11:22:30 UTC (rev 3026)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h 2007-09-21 14:26:35 UTC (rev 3027)
@@ -75,10 +75,17 @@
typedef struct _MokoRcStyle MokoRcStyle;
typedef struct _MokoRcStyleClass MokoRcStyleClass;
+/* which properties have been set? */
+enum {
+ BORDER_SET = 1,
+ GRADIENT_SET = 2
+};
+
struct _MokoRcStyle
{
GtkRcStyle parent_instance;
+ guint flags;
gboolean has_border;
gboolean has_gradient;
};
More information about the commitlog
mailing list