libgnomecanvas r1317 - in trunk: . libgnomecanvas
- From: herzi svn gnome org
- To: svn-commits-list gnome org
- Subject: libgnomecanvas r1317 - in trunk: . libgnomecanvas
- Date: Tue, 12 Aug 2008 19:11:03 +0000 (UTC)
Author: herzi
Date: Tue Aug 12 19:11:03 2008
New Revision: 1317
URL: http://svn.gnome.org/viewvc/libgnomecanvas?rev=1317&view=rev
Log:
2008-08-12 Sven Herzberg <sven imendio com>
Bug 469482 â need to register gailcanvas into a11y type system
* libgnomecanvas/gailcanvas.c,
* libgnomecanvas/gailcanvas.h,
* libgnomecanvas/gnome-canvas.c: properly initialize gail canvas
Modified:
trunk/ChangeLog
trunk/libgnomecanvas/gailcanvas.c
trunk/libgnomecanvas/gailcanvas.h
trunk/libgnomecanvas/gnome-canvas.c
Modified: trunk/libgnomecanvas/gailcanvas.c
==============================================================================
--- trunk/libgnomecanvas/gailcanvas.c (original)
+++ trunk/libgnomecanvas/gailcanvas.c Tue Aug 12 19:11:03 2008
@@ -21,6 +21,7 @@
#include <libgnomecanvas/gnome-canvas.h>
#include <libgnomecanvas/gnome-canvas-text.h>
#include <libgnomecanvas/gnome-canvas-rich-text.h>
+#include <libgnomecanvas/gnome-canvas-widget.h>
#include "gailcanvas.h"
#include "gailcanvasitem.h"
#include "gailcanvasgroupfactory.h"
@@ -39,7 +40,42 @@
static void adjustment_changed (GtkAdjustment *adjustment,
GnomeCanvas *canvas);
+static void gail_canvas_factory_class_init (GailCanvasFactoryClass *klass);
+static AtkObject* gail_canvas_factory_create_accessible (GObject *obj);
+
+static GType gail_canvas_factory_get_accessible_type (void);
+
+G_DEFINE_TYPE (GailCanvasFactory,
+ gail_canvas_factory,
+ ATK_TYPE_OBJECT_FACTORY);
+
+static void
+gail_canvas_factory_init (GailCanvasFactory *foo)
+{
+ ;
+}
+
+static void
+gail_canvas_factory_class_init (GailCanvasFactoryClass *klass)
+{
+ AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
+
+ class->create_accessible = gail_canvas_factory_create_accessible;
+ class->get_accessible_type = gail_canvas_factory_get_accessible_type;
+}
+
+static AtkObject*
+gail_canvas_factory_create_accessible (GObject *obj)
+{
+ return gail_canvas_new (GTK_WIDGET (obj));
+}
+
+static GType
+gail_canvas_factory_get_accessible_type (void)
+{
+ return GAIL_TYPE_CANVAS;
+}
GType
gail_canvas_get_type (void)
@@ -48,7 +84,7 @@
if (!type)
{
- GType parent_type = g_type_parent (GNOME_TYPE_CANVAS_ITEM);
+ GType parent_type = g_type_parent (GNOME_TYPE_CANVAS);
AtkObjectFactory *factory = atk_registry_get_factory (
atk_get_default_registry (),
parent_type);
@@ -72,7 +108,7 @@
tinfo.instance_size = query.instance_size;
/* use the size obtained from the parent type factory */
- type = g_type_register_static (parent_type,
+ type = g_type_register_static (atkobject_parent_type,
"GailCanvas", &tinfo, 0);
}
@@ -85,11 +121,11 @@
* Tell ATK how to create the appropriate AtkObject peers
**/
void
-gail_canvas_init (GType widget_type)
+gail_canvas_init (void)
{
atk_registry_set_factory_type (atk_get_default_registry (),
- widget_type,
- gail_canvas_widget_factory_get_type ());
+ GNOME_TYPE_CANVAS,
+ gail_canvas_factory_get_type ());
atk_registry_set_factory_type (atk_get_default_registry (),
GNOME_TYPE_CANVAS_GROUP,
gail_canvas_group_factory_get_type ());
@@ -100,6 +136,9 @@
GNOME_TYPE_CANVAS_RICH_TEXT,
gail_canvas_text_factory_get_type ());
atk_registry_set_factory_type (atk_get_default_registry (),
+ GNOME_TYPE_CANVAS_WIDGET,
+ gail_canvas_widget_factory_get_type());
+ atk_registry_set_factory_type (atk_get_default_registry (),
GNOME_TYPE_CANVAS_ITEM,
gail_canvas_item_factory_get_type ());
}
Modified: trunk/libgnomecanvas/gailcanvas.h
==============================================================================
--- trunk/libgnomecanvas/gailcanvas.h (original)
+++ trunk/libgnomecanvas/gailcanvas.h Tue Aug 12 19:11:03 2008
@@ -34,8 +34,28 @@
#define GAIL_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS))
#define GAIL_CANVAS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS, GailCanvasClass))
+#define GAIL_TYPE_CANVAS_FACTORY (gail_canvas_factory_get_type ())
+#define GAIL_CANVAS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_FACTORY, GailCanvasFactory))
+#define GAIL_CANVAS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_FACTORY, GailCanvasFactoryClass))
+#define GAIL_IS_CANVAS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_FACTORY))
+#define GAIL_IS_CANVAS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_FACTORY))
+#define GAIL_CANVAS_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_FACTORY, GailCanvasFactoryClass))
+
typedef struct _GailCanvas GailCanvas;
typedef struct _GailCanvasClass GailCanvasClass;
+typedef struct _GailCanvasFactory GailCanvasFactory;
+typedef struct _GailCanvasFactoryClass GailCanvasFactoryClass;
+
+struct _GailCanvasFactory
+{
+ AtkObjectFactory parent;
+};
+
+struct _GailCanvasFactoryClass
+{
+ AtkObjectFactoryClass parent_class;
+};
+
GType gail_canvas_get_type (void);
@@ -45,7 +65,9 @@
AtkObject* gail_canvas_new (GtkWidget *widget);
-void gail_canvas_init (GType canvas_type);
+void gail_canvas_init (void);
+
+GType gail_canvas_factory_get_type(void);
G_END_DECLS
Modified: trunk/libgnomecanvas/gnome-canvas.c
==============================================================================
--- trunk/libgnomecanvas/gnome-canvas.c (original)
+++ trunk/libgnomecanvas/gnome-canvas.c Tue Aug 12 19:11:03 2008
@@ -81,6 +81,7 @@
#include <gdk/gdkprivate.h>
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
+#include "gailcanvas.h"
#include "gnome-canvas.h"
#include "gnome-canvas-i18n.h"
#include "libart_lgpl/art_rect.h"
@@ -2076,6 +2077,8 @@
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
+
+ gail_canvas_init();
}
/* Callback used when the root item of a canvas is destroyed. The user should
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]