[gtk+] Don't use object data for layer
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Don't use object data for layer
- Date: Mon, 18 Jul 2011 03:18:36 +0000 (UTC)
commit 3bfa69fa53461aceb5f1ab87b90c24090b72fc86
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jul 17 23:17:38 2011 -0400
Don't use object data for layer
Just add a regular member in GtkWidgetAccessible for it.
gtk/a11y/gtkmenuaccessible.c | 2 +-
gtk/a11y/gtkmenuitemaccessible.c | 2 +-
gtk/a11y/gtkwidgetaccessible.c | 17 +++--------------
gtk/a11y/gtkwidgetaccessible.h | 5 ++---
gtk/a11y/gtkwindowaccessible.c | 2 +-
5 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/gtk/a11y/gtkmenuaccessible.c b/gtk/a11y/gtkmenuaccessible.c
index fb4ac8b..df30d98 100644
--- a/gtk/a11y/gtkmenuaccessible.c
+++ b/gtk/a11y/gtkmenuaccessible.c
@@ -32,7 +32,7 @@ gtk_menu_accessible_initialize (AtkObject *obj,
obj->role = ATK_ROLE_MENU;
- _gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_POPUP);
+ GTK_WIDGET_ACCESSIBLE (obj)->layer = ATK_LAYER_POPUP;
}
static AtkObject *
diff --git a/gtk/a11y/gtkmenuitemaccessible.c b/gtk/a11y/gtkmenuitemaccessible.c
index 3345a55..57df489 100644
--- a/gtk/a11y/gtkmenuitemaccessible.c
+++ b/gtk/a11y/gtkmenuitemaccessible.c
@@ -63,7 +63,7 @@ gtk_menu_item_accessible_initialize (AtkObject *obj,
atk_object_set_parent (obj, gtk_widget_get_accessible (parent_widget));
}
- _gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_POPUP);
+ GTK_WIDGET_ACCESSIBLE (obj)->layer = ATK_LAYER_POPUP;
if (GTK_IS_TEAROFF_MENU_ITEM (data))
obj->role = ATK_ROLE_TEAR_OFF_MENU_ITEM;
diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c
index c631da9..5a1fa4f 100644
--- a/gtk/a11y/gtkwidgetaccessible.c
+++ b/gtk/a11y/gtkwidgetaccessible.c
@@ -127,6 +127,7 @@ gtk_widget_accessible_initialize (AtkObject *obj,
g_signal_connect (widget, "map", G_CALLBACK (map_cb), NULL);
g_signal_connect (widget, "unmap", G_CALLBACK (map_cb), NULL);
+ GTK_WIDGET_ACCESSIBLE (obj)->layer = ATK_LAYER_WIDGET;
obj->role = ATK_ROLE_UNKNOWN;
}
@@ -620,21 +621,9 @@ gtk_widget_accessible_get_size (AtkComponent *component,
static AtkLayer
gtk_widget_accessible_get_layer (AtkComponent *component)
{
- gint layer;
+ GtkWidgetAccessible *accessible = GTK_WIDGET_ACCESSIBLE (component);
- layer = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (component), "atk-component-layer"));
-
- if (layer == 0)
- return ATK_LAYER_WIDGET;
- else
- return (AtkLayer) layer;
-}
-
-void
-_gtk_widget_accessible_set_layer (GtkWidgetAccessible *accessible,
- AtkLayer layer)
-{
- g_object_set_data (G_OBJECT (accessible), "atk-component-layer", GINT_TO_POINTER (layer));
+ return accessible->layer;
}
static gboolean
diff --git a/gtk/a11y/gtkwidgetaccessible.h b/gtk/a11y/gtkwidgetaccessible.h
index 5d78d17..3f9d4ca 100644
--- a/gtk/a11y/gtkwidgetaccessible.h
+++ b/gtk/a11y/gtkwidgetaccessible.h
@@ -37,6 +37,8 @@ typedef struct _GtkWidgetAccessibleClass GtkWidgetAccessibleClass;
struct _GtkWidgetAccessible
{
GtkAccessible parent;
+
+ AtkLayer layer;
};
struct _GtkWidgetAccessibleClass
@@ -53,9 +55,6 @@ struct _GtkWidgetAccessibleClass
GType _gtk_widget_accessible_get_type (void);
-void _gtk_widget_accessible_set_layer (GtkWidgetAccessible *obj,
- AtkLayer layer);
-
G_END_DECLS
#endif /* __GTK_WIDGET_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkwindowaccessible.c b/gtk/a11y/gtkwindowaccessible.c
index 815577b..badffce 100644
--- a/gtk/a11y/gtkwindowaccessible.c
+++ b/gtk/a11y/gtkwindowaccessible.c
@@ -107,7 +107,7 @@ gtk_window_accessible_initialize (AtkObject *obj,
ATK_OBJECT_CLASS (_gtk_window_accessible_parent_class)->initialize (obj, data);
g_signal_connect (data, "window-state-event", G_CALLBACK (window_state_event_cb), NULL);
- _gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_WINDOW);
+ GTK_WIDGET_ACCESSIBLE (obj)->layer = ATK_LAYER_WINDOW;
if (GTK_IS_FILE_CHOOSER_DIALOG (widget))
obj->role = ATK_ROLE_FILE_CHOOSER;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]