[gtk+/quartz-integration: 526/563] Drop use of factories for cell accessibles
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/quartz-integration: 526/563] Drop use of factories for cell accessibles
- Date: Sat, 9 Jul 2011 06:50:13 +0000 (UTC)
commit 971d7dad2375a207e06887317f71e244af901bd0
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jul 3 12:40:40 2011 -0400
Drop use of factories for cell accessibles
gtk/a11y/Makefile.am | 1 -
gtk/a11y/gail.c | 18 ------
gtk/a11y/gailfactory.h | 110 --------------------------------------
gtk/a11y/gtktreeviewaccessible.c | 25 ++++-----
4 files changed, 12 insertions(+), 142 deletions(-)
---
diff --git a/gtk/a11y/Makefile.am b/gtk/a11y/Makefile.am
index 150020b..6f5dd5f 100644
--- a/gtk/a11y/Makefile.am
+++ b/gtk/a11y/Makefile.am
@@ -70,7 +70,6 @@ gail_private_h_sources = \
gailcontainercell.h \
gtkentryaccessible.h \
gtkexpanderaccessible.h \
- gailfactory.h \
gtkframeaccessible.h \
gtkimageaccessible.h \
gailimagecell.h \
diff --git a/gtk/a11y/gail.c b/gtk/a11y/gail.c
index 69763ac..3d0c864 100644
--- a/gtk/a11y/gail.c
+++ b/gtk/a11y/gail.c
@@ -23,17 +23,9 @@
#include <stdlib.h>
#include <gtk/gtkx.h>
-#include "gailbooleancell.h"
-#include "gailcell.h"
-#include "gailcontainercell.h"
-#include "gailimagecell.h"
-#include "gailrenderercell.h"
-#include "gailtextcell.h"
#include "gailtoplevel.h"
#include "gailutil.h"
-#include "gailfactory.h"
-
#define GNOME_ACCESSIBILITY_ENV "GNOME_ACCESSIBILITY"
static gboolean gail_focus_watcher (GSignalInvocationHint *ihint,
@@ -76,11 +68,6 @@ static guint focus_notify_handler = 0;
static guint focus_tracker_id = 0;
static GQuark quark_focus_object = 0;
-GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_RENDERER_CELL, GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_RENDERER, gail_renderer_cell_new)
-GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_BOOLEAN_CELL, GailBooleanCell, gail_boolean_cell, GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell_new)
-GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_IMAGE_CELL, GailImageCell, gail_image_cell, GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell_new)
-GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_TEXT_CELL, GailTextCell, gail_text_cell, GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell_new)
-
static AtkObject*
gail_get_accessible_for_widget (GtkWidget *widget,
gboolean *transient)
@@ -820,11 +807,6 @@ gail_accessibility_module_init (void)
if (a_t_support)
fprintf (stderr, "GTK Accessibility Module initialized\n");
- GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell);
- GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell);
- GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
- GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER, gail_renderer_cell);
-
atk_focus_tracker_init (gail_focus_tracker_init);
focus_tracker_id = atk_add_focus_tracker (gail_focus_tracker);
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index fb8ae47..7329020 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -27,6 +27,7 @@
#include "gtktreeviewaccessible.h"
#include "gailrenderercell.h"
#include "gailbooleancell.h"
+#include "gailimagecell.h"
#include "gailcontainercell.h"
#include "gailtextcell.h"
#include "gailcellparent.h"
@@ -477,8 +478,6 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
GtkTreeViewColumn *tv_col;
GtkTreeSelection *selection;
GtkTreePath *path;
- AtkRegistry *default_registry;
- AtkObjectFactory *factory;
AtkObject *child;
AtkObject *parent;
GtkTreeViewColumn *expander_tv;
@@ -579,11 +578,7 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
GtkCellRenderer *fake_renderer;
fake_renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, NULL);
- default_registry = atk_get_default_registry ();
- factory = atk_registry_get_factory (default_registry,
- G_OBJECT_TYPE (fake_renderer));
- child = atk_object_factory_create_accessible (factory,
- G_OBJECT (fake_renderer));
+ child = gail_text_cell_new ();
cell = GAIL_CELL (child);
renderer_cell = GAIL_RENDERER_CELL (child);
renderer_cell->renderer = fake_renderer;
@@ -610,13 +605,17 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
renderer = GTK_CELL_RENDERER (l->data);
if (GTK_IS_CELL_RENDERER_TEXT (renderer))
- g_object_get (G_OBJECT (renderer), "editable", &editable, NULL);
+ {
+ g_object_get (G_OBJECT (renderer), "editable", &editable, NULL);
+ child = gail_text_cell_new ();
+ }
+ else if (GTK_IS_CELL_RENDERER_TOGGLE (renderer))
+ child = gail_boolean_cell_new ();
+ else if (GTK_IS_CELL_RENDERER_PIXBUF (renderer))
+ child = gail_image_cell_new ();
+ else
+ child = gail_renderer_cell_new ();
- default_registry = atk_get_default_registry ();
- factory = atk_registry_get_factory (default_registry,
- G_OBJECT_TYPE (renderer));
- child = atk_object_factory_create_accessible (factory,
- G_OBJECT (renderer));
cell = GAIL_CELL (child);
renderer_cell = GAIL_RENDERER_CELL (child);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]