[gtk+] a11y: Use cell renderer creation funcs unconditionally
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Use cell renderer creation funcs unconditionally
- Date: Fri, 16 Dec 2011 03:59:19 +0000 (UTC)
commit 8ac579602cbaba69280681a35fbdc8a7b4a54ce2
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 15 23:08:16 2011 +0100
a11y: Use cell renderer creation funcs unconditionally
Also delete the previous "new" functions and actually set the real cell
renderer here.
gtk/a11y/gtkbooleancellaccessible.c | 23 -----------------------
gtk/a11y/gtkbooleancellaccessible.h | 1 -
gtk/a11y/gtkimagecellaccessible.c | 22 ----------------------
gtk/a11y/gtkimagecellaccessible.h | 1 -
gtk/a11y/gtkrenderercellaccessible.c | 1 +
gtk/a11y/gtktextcellaccessible.c | 22 ----------------------
gtk/a11y/gtktextcellaccessible.h | 1 -
gtk/a11y/gtktreeviewaccessible.c | 9 +--------
8 files changed, 2 insertions(+), 78 deletions(-)
---
diff --git a/gtk/a11y/gtkbooleancellaccessible.c b/gtk/a11y/gtkbooleancellaccessible.c
index 67ae74e..d918222 100644
--- a/gtk/a11y/gtkbooleancellaccessible.c
+++ b/gtk/a11y/gtkbooleancellaccessible.c
@@ -86,26 +86,3 @@ _gtk_boolean_cell_accessible_init (GtkBooleanCellAccessible *cell)
{
}
-AtkObject *
-_gtk_boolean_cell_accessible_new (void)
-{
- GObject *object;
- AtkObject *atk_object;
- GtkRendererCellAccessible *cell;
- GtkBooleanCellAccessible *boolean_cell;
-
- object = g_object_new (GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, NULL);
-
- atk_object = ATK_OBJECT (object);
- atk_object->role = ATK_ROLE_TABLE_CELL;
-
- cell = GTK_RENDERER_CELL_ACCESSIBLE (object);
- cell->renderer = gtk_cell_renderer_toggle_new ();
- g_object_ref_sink (cell->renderer);
-
- boolean_cell = GTK_BOOLEAN_CELL_ACCESSIBLE (object);
- boolean_cell->cell_value = FALSE;
- boolean_cell->cell_sensitive = TRUE;
-
- return atk_object;
-}
diff --git a/gtk/a11y/gtkbooleancellaccessible.h b/gtk/a11y/gtkbooleancellaccessible.h
index 86a8c2c..35cd7af 100644
--- a/gtk/a11y/gtkbooleancellaccessible.h
+++ b/gtk/a11y/gtkbooleancellaccessible.h
@@ -48,7 +48,6 @@ struct _GtkBooleanCellAccessibleClass
};
GType _gtk_boolean_cell_accessible_get_type (void);
-AtkObject *_gtk_boolean_cell_accessible_new (void);
G_END_DECLS
diff --git a/gtk/a11y/gtkimagecellaccessible.c b/gtk/a11y/gtkimagecellaccessible.c
index 1db1470..e87eaab 100644
--- a/gtk/a11y/gtkimagecellaccessible.c
+++ b/gtk/a11y/gtkimagecellaccessible.c
@@ -60,28 +60,6 @@ _gtk_image_cell_accessible_class_init (GtkImageCellAccessibleClass *klass)
renderer_cell_class->property_list = property_list;
}
-AtkObject *
-_gtk_image_cell_accessible_new (void)
-{
- GObject *object;
- AtkObject *atk_object;
- GtkRendererCellAccessible *cell;
-
- object = g_object_new (GTK_TYPE_IMAGE_CELL_ACCESSIBLE, NULL);
-
- g_return_val_if_fail (object != NULL, NULL);
-
- atk_object = ATK_OBJECT (object);
- atk_object->role = ATK_ROLE_TABLE_CELL;
-
- cell = GTK_RENDERER_CELL_ACCESSIBLE (object);
-
- cell->renderer = gtk_cell_renderer_pixbuf_new ();
- g_object_ref_sink (cell->renderer);
-
- return atk_object;
-}
-
static void
_gtk_image_cell_accessible_init (GtkImageCellAccessible *image_cell)
{
diff --git a/gtk/a11y/gtkimagecellaccessible.h b/gtk/a11y/gtkimagecellaccessible.h
index 7920c5b..b30c1fd 100644
--- a/gtk/a11y/gtkimagecellaccessible.h
+++ b/gtk/a11y/gtkimagecellaccessible.h
@@ -49,7 +49,6 @@ struct _GtkImageCellAccessibleClass
};
GType _gtk_image_cell_accessible_get_type (void);
-AtkObject *_gtk_image_cell_accessible_new (void);
G_END_DECLS
diff --git a/gtk/a11y/gtkrenderercellaccessible.c b/gtk/a11y/gtkrenderercellaccessible.c
index 2318f9c..381ac46 100644
--- a/gtk/a11y/gtkrenderercellaccessible.c
+++ b/gtk/a11y/gtkrenderercellaccessible.c
@@ -125,6 +125,7 @@ _gtk_renderer_cell_accessible_new (GtkCellRenderer *renderer)
g_return_val_if_fail (GTK_IS_CELL_RENDERER (renderer), NULL);
object = g_object_new (_gtk_cell_renderer_get_accessible_type (renderer),
+ "renderer", renderer,
NULL);
atk_object_set_role (object, ATK_ROLE_TABLE_CELL);
diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c
index f289f93..194da57 100644
--- a/gtk/a11y/gtktextcellaccessible.c
+++ b/gtk/a11y/gtktextcellaccessible.c
@@ -245,28 +245,6 @@ _gtk_text_cell_accessible_init (GtkTextCellAccessible *text_cell)
text_cell->cell_length = 0;
}
-AtkObject *
-_gtk_text_cell_accessible_new (void)
-{
- GObject *object;
- AtkObject *atk_object;
- GtkRendererCellAccessible *cell;
-
- object = g_object_new (GTK_TYPE_TEXT_CELL_ACCESSIBLE, NULL);
-
- g_return_val_if_fail (object != NULL, NULL);
-
- atk_object = ATK_OBJECT (object);
- atk_object->role = ATK_ROLE_TABLE_CELL;
-
- cell = GTK_RENDERER_CELL_ACCESSIBLE(object);
-
- cell->renderer = gtk_cell_renderer_text_new ();
- g_object_ref_sink (cell->renderer);
-
- return atk_object;
-}
-
static gchar *
gtk_text_cell_accessible_get_text (AtkText *atk_text,
gint start_pos,
diff --git a/gtk/a11y/gtktextcellaccessible.h b/gtk/a11y/gtktextcellaccessible.h
index fd656d5..ac54986 100644
--- a/gtk/a11y/gtktextcellaccessible.h
+++ b/gtk/a11y/gtktextcellaccessible.h
@@ -49,7 +49,6 @@ struct _GtkTextCellAccessibleClass
};
GType _gtk_text_cell_accessible_get_type (void);
-AtkObject *_gtk_text_cell_accessible_new (void);
G_END_DECLS
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 4da3fff..b472e22 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -455,14 +455,7 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
{
renderer = GTK_CELL_RENDERER (l->data);
- if (GTK_IS_CELL_RENDERER_TEXT (renderer))
- child = _gtk_text_cell_accessible_new ();
- else if (GTK_IS_CELL_RENDERER_TOGGLE (renderer))
- child = _gtk_boolean_cell_accessible_new ();
- else if (GTK_IS_CELL_RENDERER_PIXBUF (renderer))
- child = _gtk_image_cell_accessible_new ();
- else
- child = _gtk_renderer_cell_accessible_new (renderer);
+ child = _gtk_renderer_cell_accessible_new (renderer);
cell = GTK_CELL_ACCESSIBLE (child);
renderer_cell = GTK_RENDERER_CELL_ACCESSIBLE (child);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]