[cairo-commit] goocanvas/src goocanvasgroupview.c, 1.20, 1.21 goocanvasitemviewsimple.c, 1.11, 1.12 goocanvasview.c, 1.29, 1.30

Damon Chaplin commit at pdx.freedesktop.org
Sun Aug 27 05:20:43 PDT 2006


Committed by: damon

Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv15240/src

Modified Files:
	goocanvasgroupview.c goocanvasitemviewsimple.c goocanvasview.c 
Log Message:
2006-08-27  Damon Chaplin  <damon at gnome.org>

	* src/goocanvasview.c (goo_canvas_view_class_init): 
	* src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_class_init) 
	* src/goocanvasgroupview.c (goo_canvas_group_view_class_init): only
	register the accessible factories if accessibility is enabled (i.e.
	GtkWidget has registered a factory).

	* src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_setup_accessibility): 
	* src/goocanvasgroupview.c (goo_canvas_group_view_set_group): only
	set the accessible title & description and connect the signal handlers
	if accessibility is enabled. (It would be better to not call
	atk_gobject_accessible_for_object() at all, as it isn't useful.)

	* demo/scalability-demo.c: start of new demo/test for scalability.
	We are currently hitting the cairo 16-bit limit (transformed coords
	can't be larger than 16-bit ints). A workaround would be nice.
	I also want to profile it and see if there are any major bottlenecks.
	(Creating canvases with thousands of items is very slow, though
	scrolling etc. is OK as long as the canvas is split into groups.)



Index: goocanvasgroupview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasgroupview.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- goocanvasgroupview.c	24 Aug 2006 08:06:23 -0000	1.20
+++ goocanvasgroupview.c	27 Aug 2006 12:20:40 -0000	1.21
@@ -75,9 +75,13 @@
   gobject_class->get_property = goo_canvas_group_view_get_property;
   gobject_class->set_property = goo_canvas_group_view_set_property;
 
-  atk_registry_set_factory_type (atk_get_default_registry (),
-				 GOO_TYPE_CANVAS_GROUP_VIEW,
-				 goo_canvas_item_view_accessible_factory_get_type ());
+  /* Register our accessible factory, but only if accessibility is enabled. */
+  if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET)))
+    {
+      atk_registry_set_factory_type (atk_get_default_registry (),
+				     GOO_TYPE_CANVAS_GROUP_VIEW,
+				     goo_canvas_item_view_accessible_factory_get_type ());
+    }
 
   g_object_class_override_property (gobject_class, PROP_CAN_FOCUS,
 				    "can-focus");
@@ -160,19 +164,22 @@
 		NULL);
 
   accessible = atk_gobject_accessible_for_object (G_OBJECT (group_view));
-  if (title)
-    atk_object_set_name (accessible, title);
-  if (description)
-    atk_object_set_description (accessible, description);
-  g_free (title);
-  g_free (description);
+  if (!ATK_IS_NO_OP_OBJECT (accessible))
+    {
+      if (title)
+	atk_object_set_name (accessible, title);
+      if (description)
+	atk_object_set_description (accessible, description);
+      g_free (title);
+      g_free (description);
 
-  g_signal_connect (group, "notify::title",
-		    G_CALLBACK (goo_canvas_group_view_title_changed),
-		    group_view);
-  g_signal_connect (group, "notify::description",
-		    G_CALLBACK (goo_canvas_group_view_description_changed),
-		    group_view);
+      g_signal_connect (group, "notify::title",
+			G_CALLBACK (goo_canvas_group_view_title_changed),
+			group_view);
+      g_signal_connect (group, "notify::description",
+			G_CALLBACK (goo_canvas_group_view_description_changed),
+			group_view);
+    }
 
   add_child_views_recursively (group_view);
   connect_group_signals (group_view);

Index: goocanvasitemviewsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemviewsimple.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- goocanvasitemviewsimple.c	23 Aug 2006 11:56:05 -0000	1.11
+++ goocanvasitemviewsimple.c	27 Aug 2006 12:20:40 -0000	1.12
@@ -59,9 +59,13 @@
   gobject_class->get_property = goo_canvas_item_view_simple_get_property;
   gobject_class->set_property = goo_canvas_item_view_simple_set_property;
 
-  atk_registry_set_factory_type (atk_get_default_registry (),
-				 GOO_TYPE_CANVAS_ITEM_VIEW_SIMPLE,
-				 goo_canvas_item_view_accessible_factory_get_type ());
+  /* Register our accessible factory, but only if accessibility is enabled. */
+  if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET)))
+    {
+      atk_registry_set_factory_type (atk_get_default_registry (),
+				     GOO_TYPE_CANVAS_ITEM_VIEW_SIMPLE,
+				     goo_canvas_item_view_accessible_factory_get_type ());
+    }
 
   g_object_class_override_property (gobject_class, PROP_CAN_FOCUS,
 				    "can-focus");
@@ -450,15 +454,18 @@
   AtkObject *accessible;
 
   accessible = atk_gobject_accessible_for_object (G_OBJECT (simple_view));
-  if (simple->title)
-    atk_object_set_name (accessible, simple->title);
-  if (simple->description)
-    atk_object_set_description (accessible, simple->description);
+  if (!ATK_IS_NO_OP_OBJECT (accessible))
+    {
+      if (simple->title)
+	atk_object_set_name (accessible, simple->title);
+      if (simple->description)
+	atk_object_set_description (accessible, simple->description);
 
-  g_signal_connect (simple, "notify::title",
-		    G_CALLBACK (goo_canvas_item_view_simple_title_changed),
-		    simple_view);
-  g_signal_connect (simple, "notify::description",
-		    G_CALLBACK (goo_canvas_item_view_simple_description_changed),
-		    simple_view);
+      g_signal_connect (simple, "notify::title",
+			G_CALLBACK (goo_canvas_item_view_simple_title_changed),
+			simple_view);
+      g_signal_connect (simple, "notify::description",
+			G_CALLBACK (goo_canvas_item_view_simple_description_changed),
+			simple_view);
+    }
 }

Index: goocanvasview.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasview.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- goocanvasview.c	24 Aug 2006 08:06:23 -0000	1.29
+++ goocanvasview.c	27 Aug 2006 12:20:40 -0000	1.30
@@ -225,9 +225,13 @@
 
   klass->set_scroll_adjustments      = goo_canvas_view_set_adjustments;
 
-  atk_registry_set_factory_type (atk_get_default_registry (),
-				 GOO_TYPE_CANVAS_VIEW,
-				 goo_canvas_view_accessible_factory_get_type ());
+  /* Register our accessible factory, but only if accessibility is enabled. */
+  if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET)))
+    {
+      atk_registry_set_factory_type (atk_get_default_registry (),
+				     GOO_TYPE_CANVAS_VIEW,
+				     goo_canvas_view_accessible_factory_get_type ());
+    }
 
   g_object_class_install_property (gobject_class, PROP_MODEL,
                                    g_param_spec_object ("model",



More information about the cairo-commit mailing list