glade3 r1759 - in branches/builder: . gladeui plugins/gtk+



Author: tvb
Date: Wed Apr  2 09:22:18 2008
New Revision: 1759
URL: http://svn.gnome.org/viewvc/glade3?rev=1759&view=rev

Log:
	  - Implemented loading of atk actions now...



Modified:
   branches/builder/ChangeLog
   branches/builder/gladeui/glade-property-class.c
   branches/builder/gladeui/glade-property-class.h
   branches/builder/gladeui/glade-widget-adaptor.c
   branches/builder/plugins/gtk+/glade-gtk.c

Modified: branches/builder/gladeui/glade-property-class.c
==============================================================================
--- branches/builder/gladeui/glade-property-class.c	(original)
+++ branches/builder/gladeui/glade-property-class.c	Wed Apr  2 09:22:18 2008
@@ -1100,57 +1100,6 @@
 }
 
 /**
- * glade_property_class_list_atk_relations:
- * @handle: A generic pointer (i.e. a #GladeWidgetClass)
- * @owner_type: The #GType of the owning widget class.
- *
- * Returns: a #GList of newly created atk relation #GladePropertyClass.
- */
-GList *
-glade_property_class_list_atk_relations (gpointer handle,
-					 GType    owner_type)
-{
-	const GPCAtkPropertyTab *relation_tab = NULL;
-	GladePropertyClass      *property_class;
-	GList                   *list = NULL;
-	gint                     i;
-	
-	/* Loop through our hard-coded table enties */
-	for (i = 0; i < G_N_ELEMENTS (relation_names_table); i++)
-	{
-		relation_tab = &relation_names_table[i];
-
-		property_class                    = glade_property_class_new (handle);
-		property_class->pspec             = 
-			glade_param_spec_objects (relation_tab->id,
-						  _(relation_tab->name),
-						  _(relation_tab->tooltip),
-						  ATK_TYPE_IMPLEMENTOR,
-						  G_PARAM_READWRITE);
-		
-		property_class->pspec->owner_type = owner_type;
-		property_class->id                = g_strdup (relation_tab->id);
-		property_class->name              = g_strdup (_(relation_tab->name));
-		property_class->tooltip           = g_strdup (_(relation_tab->tooltip));
-		property_class->type              = GPC_ATK_RELATION;
-		property_class->visible_lines     = 2;
-		property_class->ignore            = TRUE;
-
-		property_class->def = 
-			glade_property_class_make_gvalue_from_string
-			(property_class, "", NULL);
-		
-		property_class->orig_def = 
-			glade_property_class_make_gvalue_from_string
-			(property_class, "", NULL);
-
-		list = g_list_prepend (list, property_class);
-	}
-
-	return g_list_reverse (list);
-}
-
-/**
  * glade_property_class_new_from_spec:
  * @handle: A generic pointer (i.e. a #GladeWidgetClass)
  * @spec: A #GParamSpec

Modified: branches/builder/gladeui/glade-property-class.h
==============================================================================
--- branches/builder/gladeui/glade-property-class.h	(original)
+++ branches/builder/gladeui/glade-property-class.h	Wed Apr  2 09:22:18 2008
@@ -166,13 +166,6 @@
 
 GladePropertyClass *glade_property_class_new_from_spec           (gpointer             handle,
 								  GParamSpec          *spec);
- 
-GList              *glade_property_class_list_atk_relations      (gpointer             handle,
-								  GType                owner_type);
-
-GladePropertyClass *glade_property_class_accel_property          (gpointer             handle,
-								  GType                owner_type);
-
 
 GladePropertyClass *glade_property_class_clone                   (GladePropertyClass  *property_class);
 

Modified: branches/builder/gladeui/glade-widget-adaptor.c
==============================================================================
--- branches/builder/gladeui/glade-widget-adaptor.c	(original)
+++ branches/builder/gladeui/glade-widget-adaptor.c	Wed Apr  2 09:22:18 2008
@@ -403,9 +403,6 @@
 				       g_list_reverse (list));
 }
 
-/* XXX Atk relations and accel props disregarded - they should
- *     be implemented from the gtk+ catalog instead I think.
- */
 static void
 gwa_setup_properties (GladeWidgetAdaptor *adaptor,
 		      GObjectClass       *object_class,

Modified: branches/builder/plugins/gtk+/glade-gtk.c
==============================================================================
--- branches/builder/plugins/gtk+/glade-gtk.c	(original)
+++ branches/builder/plugins/gtk+/glade-gtk.c	Wed Apr  2 09:22:18 2008
@@ -243,15 +243,16 @@
 }
 
 /* ----------------------------- GtkWidget ------------------------------ */
-#define GLADE_TAG_ACCEL                       "accelerator"
-#define GLADE_TAG_ACCEL_KEY                   "key"
-#define GLADE_TAG_ACCEL_MODIFIERS             "modifiers"
-#define GLADE_TAG_ACCEL_SIGNAL                "signal"
-
-#define GLADE_TAG_A11Y_A11Y                    "accessibility"
-#define GLADE_TAG_A11Y_ACTION                  "atkaction"
-#define GLADE_TAG_A11Y_PROPERTY                "atkproperty"
-
+#define GLADE_TAG_ACCEL             "accelerator"
+#define GLADE_TAG_ACCEL_KEY         "key"
+#define GLADE_TAG_ACCEL_MODIFIERS   "modifiers"
+#define GLADE_TAG_ACCEL_SIGNAL      "signal"
+
+#define GLADE_TAG_A11Y_A11Y         "accessibility"
+#define GLADE_TAG_A11Y_ACTION       "atkaction"
+#define GLADE_TAG_A11Y_PROPERTY     "atkproperty"
+#define GLADE_TAG_A11Y_ACTION_NAME  "action_name" /* We should make -/_ synonymous */
+#define GLADE_TAG_A11Y_DESC         "description"
 
 
 static GdkModifierType
@@ -373,16 +374,26 @@
 	GValue        *gvalue;
 	gchar         *value, *name, *id, *comment;
 	gint           translatable, has_context;
+	gboolean       is_action;
 
 	for (prop = glade_xml_node_get_children (node); 
 	     prop; prop = glade_xml_node_next (prop))
 	{
-		if (!glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_PROPERTY))
+		if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_PROPERTY))
+			is_action = FALSE;
+		else if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_ACTION))
+			is_action = TRUE;
+		else 
 			continue;
 
-		if (!(name = glade_xml_get_property_string_required
+		if (!is_action && 
+		    !(name = glade_xml_get_property_string_required
 		      (prop, GLADE_XML_TAG_NAME, NULL)))
 			continue;
+		else if (is_action && 
+			 !(name = glade_xml_get_property_string_required
+			   (prop, GLADE_TAG_A11Y_ACTION_NAME, NULL)))
+			continue;
 
 		/* Make sure we are working with dashes and
 		 * not underscores ... 
@@ -390,15 +401,38 @@
 		id = glade_util_read_prop_name (name);
 		g_free (name);
 
+		/* We are namespacing the action properties internally
+		 * just incase they clash (all property names must be
+		 * unique...)
+		 */
+		if (is_action) 
+		{
+			name = g_strdup_printf ("atk-%s", id);
+			g_free (id);
+			id = name;
+		}
+
 		if ((property = glade_widget_get_property (widget, id)) != NULL)
 		{
-			if (!(value = glade_xml_get_content (prop)))
+
+			g_print ("Found property '%s'\n", id);
+
+			/* Complex statement just getting the value here... */
+			if ((!is_action && 
+			     !(value = glade_xml_get_content (prop))) ||
+			    (is_action &&
+			     !(value = glade_xml_get_property_string_required
+			       (prop, GLADE_TAG_A11Y_DESC, NULL))))
 			{
-				/* XXX should be glade_xml_get_content_required()... */
+				/* XXX should be a glade_xml_get_content_required()... */
 				g_free (id);
 				continue;
 			}
 
+
+			g_print ("got value '%s' for property '%s'\n", value, id);
+
+
 			/* Set the parsed value on the property ... */
 			gvalue = glade_property_class_make_gvalue_from_string
 				(property->klass, value, widget->project);
@@ -438,11 +472,9 @@
 	if ((atk_node = 
 	     glade_xml_search_child (node, GLADE_TAG_A11Y_A11Y)) != NULL)
 	{
-		/* Properties */
+		/* Properties & actions */
 		glade_gtk_parse_atk_props (widget, atk_node);
 
-		/* Actions */
-
 		/* Relations */
 
 	}



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