[gtk+/drop-gail: 9/9] Drop create func from GTK_ACCESSIBLE_FACTORY macro



commit d3cb9adb5a7f3431c7d509748499f06a01df313e
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 21 03:14:41 2011 -0500

    Drop create func from GTK_ACCESSIBLE_FACTORY macro

 gtk/gtkaccessibility.h |    8 +++-----
 gtk/gtkcontainer.c     |   15 ++-------------
 gtk/gtkimage.c         |   13 +------------
 gtk/gtkwidget.c        |   13 +------------
 4 files changed, 7 insertions(+), 42 deletions(-)
---
diff --git a/gtk/gtkaccessibility.h b/gtk/gtkaccessibility.h
index 674004b..0460225 100644
--- a/gtk/gtkaccessibility.h
+++ b/gtk/gtkaccessibility.h
@@ -30,14 +30,12 @@ G_BEGIN_DECLS
  * GTK_ACCESSIBLE_FACTORY:
  * @type: GType of the accessible which is created by the factory
  * @prefix: prefix of the accessible object methods
- * @create_accessible_func: function to instantiate the accessible for a
- *     given object
  *
  * Implements a new #AtkObjectFactory to create accessible objects of a
  * specific type. It defines the GType of the factory and implements
  * the relevant #AtkObjectFactory methods.
  */
-#define GTK_ACCESSIBLE_FACTORY(type, prefix, create_accessible_func)    \
+#define GTK_ACCESSIBLE_FACTORY(type, prefix)                            \
 static GType                                                            \
 prefix ## _factory_get_accessible_type (void)                           \
 {                                                                       \
@@ -47,10 +45,10 @@ prefix ## _factory_get_accessible_type (void)                           \
 static AtkObject *                                                      \
 prefix ## _factory_create_accessible (GObject *obj)                     \
 {                                                                       \
-  GtkWidget *widget = GTK_WIDGET (obj);                                 \
   AtkObject *accessible;                                                \
                                                                         \
-  accessible = create_accessible_func (widget);                         \
+  accessible = g_object_new (type, NULL);                               \
+  atk_object_initialize (accessible, obj);                              \
                                                                         \
   return accessible;                                                    \
 }                                                                       \
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 1602a97..efa690e 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -3431,7 +3431,7 @@ gtk_container_accessible_initialize (AtkObject *obj,
     obj->role = ATK_ROLE_VIEWPORT;
   else
 #endif
-    obj->role = ATK_ROLE_PANEL;
+  atk_object_set_role (obj, ATK_ROLE_PANEL);
 }
 
 static void
@@ -3466,15 +3466,4 @@ gtk_container_accessible_init (GtkContainerAccessible *container)
   container->children = NULL;
 }
 
-static AtkObject *
-gtk_container_accessible_new (GtkWidget *widget)
-{
-  AtkObject *accessible;
-
-  accessible = g_object_new (GTK_TYPE_CONTAINER_ACCESSIBLE, NULL);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
-GTK_ACCESSIBLE_FACTORY(GTK_TYPE_CONTAINER, gtk_container_accessible, gtk_container_accessible_new)
+GTK_ACCESSIBLE_FACTORY(GTK_TYPE_CONTAINER_ACCESSIBLE, gtk_container_accessible)
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 84884e0..077d93a 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -2296,15 +2296,4 @@ atk_image_interface_init (AtkImageIface *iface)
   iface->get_image_position = gtk_image_accessible_get_image_position;
 }
 
-static AtkObject *
-gtk_image_accessible_new (GtkWidget *widget)
-{
-  AtkObject *accessible;
-
-  accessible = g_object_new (GTK_TYPE_IMAGE_ACCESSIBLE, NULL);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
-GTK_ACCESSIBLE_FACTORY(GTK_TYPE_IMAGE_ACCESSIBLE, gtk_image_accessible, gtk_image_accessible_new)
+GTK_ACCESSIBLE_FACTORY(GTK_TYPE_IMAGE_ACCESSIBLE, gtk_image_accessible)
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 17f041f..612aea3 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15063,15 +15063,4 @@ atk_component_interface_init (AtkComponentIface *iface)
   iface->grab_focus = gtk_widget_accessible_grab_focus;
 }
 
-static AtkObject *
-gtk_widget_accessible_new (GtkWidget *widget)
-{
-  AtkObject *accessible;
-
-  accessible = g_object_new (GTK_TYPE_WIDGET_ACCESSIBLE, NULL);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
-GTK_ACCESSIBLE_FACTORY(GTK_TYPE_WIDGET, gtk_widget_accessible, gtk_widget_accessible_new)
+GTK_ACCESSIBLE_FACTORY(GTK_TYPE_WIDGET_ACCESSIBLE, gtk_widget_accessible)



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