gtksourceview r2106 - in trunk: . gtksourceview



Author: muntyan
Date: Tue Dec 16 18:58:11 2008
New Revision: 2106
URL: http://svn.gnome.org/viewvc/gtksourceview?rev=2106&view=rev

Log:
2008-12-16  Yevgen Muntyan  <muntyan tamu edu>

	* gtksourceview/gtksourcestyle.c (gtk_source_style_class_init),
	(gtk_source_style_set_property): disabled setting xxx-set properties,
	because that can't work while the properties are of CONSTRUCT type.
	See bug #564425.



Modified:
   trunk/ChangeLog
   trunk/gtksourceview/gtksourcestyle.c

Modified: trunk/gtksourceview/gtksourcestyle.c
==============================================================================
--- trunk/gtksourceview/gtksourcestyle.c	(original)
+++ trunk/gtksourceview/gtksourcestyle.c	Tue Dec 16 18:58:11 2008
@@ -126,7 +126,7 @@
 							       _("Line background set"),
 							       _("Whether line background color is set"),
 							       FALSE,
-							       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+							       G_PARAM_READWRITE));
 
 	g_object_class_install_property (object_class,
 					 PROP_FOREGROUND_SET,
@@ -134,7 +134,7 @@
 							       _("Foreground set"),
 							       _("Whether foreground color is set"),
 							       FALSE,
-							       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+							       G_PARAM_READWRITE));
 
 	g_object_class_install_property (object_class,
 					 PROP_BACKGROUND_SET,
@@ -142,7 +142,7 @@
 							       _("Background set"),
 							       _("Whether background color is set"),
 							       FALSE,
-							       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+							       G_PARAM_READWRITE));
 
 	g_object_class_install_property (object_class,
 					 PROP_BOLD_SET,
@@ -150,7 +150,7 @@
 							       _("Bold set"),
 							       _("Whether bold attribute is set"),
 							       FALSE,
-							       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+							       G_PARAM_READWRITE));
 
 	g_object_class_install_property (object_class,
 					 PROP_ITALIC_SET,
@@ -158,7 +158,7 @@
 							       _("Italic set"),
 							       _("Whether italic attribute is set"),
 							       FALSE,
-							       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+							       G_PARAM_READWRITE));
 
 	g_object_class_install_property (object_class,
 					 PROP_UNDERLINE_SET,
@@ -166,7 +166,7 @@
 							       _("Underline set"),
 							       _("Whether underline attribute is set"),
 							       FALSE,
-							       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+							       G_PARAM_READWRITE));
 
 	g_object_class_install_property (object_class,
 					 PROP_STRIKETHROUGH_SET,
@@ -174,7 +174,7 @@
 							       _("Strikethrough set"),
 							       _("Whether strikethrough attribute is set"),
 							       FALSE,
-							       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+							       G_PARAM_READWRITE));
 }
 
 static void
@@ -186,15 +186,7 @@
 }
 
 #define SET_MASK(style,name) (style)->mask |= (GTK_SOURCE_STYLE_USE_##name)
-#define UNSET_MASK(style,name) (style)->mask &= (GTK_SOURCE_STYLE_USE_##name)
-
-#define MODIFY_MASK(style,value,name)		\
-G_STMT_START {					\
-	if (g_value_get_boolean (value))	\
-		SET_MASK (style, name);		\
-	else					\
-		UNSET_MASK (style, name);	\
-} G_STMT_END
+#define UNSET_MASK(style,name) (style)->mask &= ~(GTK_SOURCE_STYLE_USE_##name)
 
 #define GET_MASK(style,value,name)		\
 	g_value_set_boolean (value, ((style)->mask & GTK_SOURCE_STYLE_USE_##name) != 0)
@@ -269,26 +261,18 @@
 			SET_MASK (style, STRIKETHROUGH);
 			break;
 
+		/* These properties have to stay WRITABLE for backwards compatibility,
+		 * but they must not work either, see
+		 * http://bugzilla.gnome.org/show_bug.cgi?id=564425 for discussion */
 		case PROP_FOREGROUND_SET:
-			MODIFY_MASK (style, value, FOREGROUND);
-			break;
 		case PROP_BACKGROUND_SET:
-			MODIFY_MASK (style, value, BACKGROUND);
-			break;
 		case PROP_LINE_BACKGROUND_SET:
-			MODIFY_MASK (style, value, LINE_BACKGROUND);
-			break;
 		case PROP_BOLD_SET:
-			MODIFY_MASK (style, value, BOLD);
-			break;
 		case PROP_ITALIC_SET:
-			MODIFY_MASK (style, value, ITALIC);
-			break;
 		case PROP_UNDERLINE_SET:
-			MODIFY_MASK (style, value, UNDERLINE);
-			break;
 		case PROP_STRIKETHROUGH_SET:
-			MODIFY_MASK (style, value, STRIKETHROUGH);
+			g_warning ("property '%s' of object '%s' may not be modified",
+				   pspec->name, g_type_name (G_OBJECT_TYPE (object)));
 			break;
 
 		default:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]