[gtk+/drop-gail: 18/24] Move GailBox to GtkBoxAccessible
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/drop-gail: 18/24] Move GailBox to GtkBoxAccessible
- Date: Sun, 15 May 2011 02:13:36 +0000 (UTC)
commit 10d3f43f4c0cfd006cef5b87bb6d20e84ffb49a5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 25 00:54:57 2011 -0500
Move GailBox to GtkBoxAccessible
gtk/Makefile.am | 1 +
gtk/gtkbox.c | 35 +++++++++++++++++++++++++++
gtk/gtkboxaccessible.h | 57 +++++++++++++++++++++++++++++++++++++++++++++
modules/other/gail/gail.c | 8 ++++-
4 files changed, 99 insertions(+), 2 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 71cb7b7..fc59795 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -385,6 +385,7 @@ gtk_private_h_sources = \
gtkappchoosermodule.h \
gtkappchooseronline.h \
gtkbindingsprivate.h \
+ gtkboxaccessible.h \
gtkbuilderprivate.h \
gtkbuttonprivate.h \
gtkcalendaraccessible.h \
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 9a20579..d43d40a 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -1742,3 +1742,38 @@ _gtk_box_get_children (GtkBox *box)
return g_list_reverse (retval);
}
+
+
+/* --- Accessibility --- */
+
+#include "gtkaccessibility.h"
+#include "gtkboxaccessible.h"
+
+G_DEFINE_TYPE (GtkBoxAccessible, gtk_box_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
+
+static void
+gtk_box_accessible_initialize (AtkObject *accessible,
+ gpointer data)
+{
+ ATK_OBJECT_CLASS (gtk_box_accessible_parent_class)->initialize (accessible, data);
+
+ /* FIXME: this is the *only* change to GtkContainerAccessible
+ * this does not deserve a separate class
+ */
+ atk_object_set_role (accessible, ATK_ROLE_FILLER);
+}
+
+static void
+gtk_box_accessible_class_init (GtkBoxAccessibleClass *klass)
+{
+ AtkObjectClass *atkobject_class = ATK_OBJECT_CLASS (klass);
+
+ atkobject_class->initialize = gtk_box_accessible_initialize;
+}
+
+static void
+gtk_box_accessible_init (GtkBoxAccessible *accessible)
+{
+}
+
+GTK_ACCESSIBLE_FACTORY(GTK_TYPE_BOX_ACCESSIBLE, gtk_box_accessible)
diff --git a/gtk/gtkboxaccessible.h b/gtk/gtkboxaccessible.h
new file mode 100644
index 0000000..d9990c4
--- /dev/null
+++ b/gtk/gtkboxaccessible.h
@@ -0,0 +1,57 @@
+/* GTK - The GIMP Toolkit
+ * Copyright 2011 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_BOX_ACCESSIBLE_H__
+#define __GTK_BOX_ACCESSIBLE_H__
+
+#include <gtk/gtkcontaineraccessible.h>
+#include <gtk/gtkbox.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_BOX_ACCESSIBLE (gtk_box_accessible_get_type ())
+#define GTK_BOX_ACCESSIBLE(obj)(G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessible))
+#define GTK_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
+#define GTK_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
+
+typedef struct _GtkBoxAccessible GtkBoxAccessible;
+typedef struct _GtkBoxAccessibleClass GtkBoxAccessibleClass;
+
+struct _GtkBoxAccessible
+{
+ GtkContainerAccessible parent;
+};
+
+struct _GtkBoxAccessibleClass
+{
+ GtkContainerAccessibleClass parent_class;
+};
+
+
+GType gtk_box_accessible_get_type (void) G_GNUC_CONST;
+GType gtk_box_accessible_factory_get_type (void) G_GNUC_CONST;
+
+
+G_END_DECLS
+
+#endif /* __GTK_BOX_ACCESSIBLE_H__ */
diff --git a/modules/other/gail/gail.c b/modules/other/gail/gail.c
index a4ff6ca..01e4480 100644
--- a/modules/other/gail/gail.c
+++ b/modules/other/gail/gail.c
@@ -23,6 +23,9 @@
#include <stdlib.h>
#include <gtk/gtkx.h>
+#include <gtk/gtkadjustmentaccessible.h>
+#include <gtk/gtkarrowaccessible.h>
+#include <gtk/gtkboxaccessible.h>
#include <gtk/gtkcalendaraccessible.h>
#include <gtk/gtkcontaineraccessible.h>
#include <gtk/gtkimageaccessible.h>
@@ -99,7 +102,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SPIN_BUTTON, GailSpinButton, gail_spin_button,
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BOX, GailBox, gail_box, GTK_TYPE_BOX)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLBAR, GailScrollbar, gail_scrollbar, GTK_TYPE_SCROLLBAR)
@@ -903,6 +905,9 @@ gail_accessibility_module_init (void)
atk_registry_set_factory_type (atk_get_default_registry (),
GTK_TYPE_SEPARATOR,
gtk_separator_accessible_factory_get_type ());
+ atk_registry_set_factory_type (atk_get_default_registry (),
+ GTK_TYPE_BOX,
+ gtk_box_accessible_factory_get_type ());
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_BUTTON, gail_button);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_LINK_BUTTON, gail_link_button);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU_ITEM, gail_menu_item);
@@ -927,7 +932,6 @@ gail_accessibility_module_init (void)
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER, gail_renderer_cell);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_RADIO_BUTTON, gail_radio_button);
- GAIL_WIDGET_SET_FACTORY (GTK_TYPE_BOX, gail_box);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCROLLED_WINDOW, gail_scrolled_window);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_PANED, gail_paned);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCROLLBAR, gail_scrollbar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]