[gtk+/drop-gail: 16/24] Move GailSeparator to GtkSeparatorAccessible
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/drop-gail: 16/24] Move GailSeparator to GtkSeparatorAccessible
- Date: Sun, 15 May 2011 02:13:26 +0000 (UTC)
commit b656c921dd2551b6292c428fdebee7d6a83d6aa5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 25 00:54:12 2011 -0500
Move GailSeparator to GtkSeparatorAccessible
gtk/Makefile.am | 1 +
gtk/gtkseparator.c | 32 ++++++++++++++++++++++++
gtk/gtkseparatoraccessible.h | 55 ++++++++++++++++++++++++++++++++++++++++++
modules/other/gail/gail.c | 11 +++-----
4 files changed, 92 insertions(+), 7 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 5d5d369..031bc66 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -431,6 +431,7 @@ gtk_private_h_sources = \
gtksearchenginesimple.h \
gtkselectionprivate.h \
gtksettingsprivate.h \
+ gtkseparatoraccessible.h \
gtksizegroup-private.h \
gtksocketprivate.h \
gtkstylecontextprivate.h \
diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c
index 013247a..769670c 100644
--- a/gtk/gtkseparator.c
+++ b/gtk/gtkseparator.c
@@ -288,3 +288,35 @@ gtk_separator_new (GtkOrientation orientation)
"orientation", orientation,
NULL);
}
+
+/* --- Accessibility --- */
+
+#include "gtkaccessibility.h"
+#include "gtkseparatoraccessible.h"
+
+G_DEFINE_TYPE (GtkSeparatorAccessible, gtk_separator_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
+
+static void
+gtk_separator_accessible_initialize (AtkObject *accessible,
+ gpointer data)
+{
+ ATK_OBJECT_CLASS (gtk_separator_accessible_parent_class)->initialize (accessible, data);
+
+ /* FIXME: this is the *only* difference to GtkWidgetAccessible */
+ atk_object_set_role (accessible, ATK_ROLE_SEPARATOR);
+}
+
+static void
+gtk_separator_accessible_class_init (GtkSeparatorAccessibleClass *klass)
+{
+ AtkObjectClass *atkobject_class = ATK_OBJECT_CLASS (klass);
+
+ atkobject_class->initialize = gtk_separator_accessible_initialize;
+}
+
+static void
+gtk_separator_accessible_init (GtkSeparatorAccessible *accessible)
+{
+}
+
+GTK_ACCESSIBLE_FACTORY(GTK_TYPE_SEPARATOR_ACCESSIBLE, gtk_separator_accessible)
diff --git a/gtk/gtkseparatoraccessible.h b/gtk/gtkseparatoraccessible.h
new file mode 100644
index 0000000..5698305
--- /dev/null
+++ b/gtk/gtkseparatoraccessible.h
@@ -0,0 +1,55 @@
+/* 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_SEPARATOR_ACCESSIBLE_H__
+#define __GTK_SEPARATOR_ACCESSIBLE_H__
+
+#include <gtk/gtkwidgetaccessible.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_SEPARATOR_ACCESSIBLE (gtk_separator_accessible_get_type ())
+#define GTK_SEPARATOR_ACCESSIBLE(obj)(G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SEPARATOR_ACCESSIBLE, GtkSeparatorAccessible))
+#define GTK_SEPARATOR_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SEPARATOR_ACCESSIBLE, GtkSeparatorAccessibleClass))
+
+typedef struct _GtkSeparatorAccessible GtkSeparatorAccessible;
+typedef struct _GtkSeparatorAccessibleClass GtkSeparatorAccessibleClass;
+
+struct _GtkSeparatorAccessible
+{
+ GtkWidgetAccessible parent;
+};
+
+struct _GtkSeparatorAccessibleClass
+{
+ GtkWidgetAccessibleClass parent_class;
+};
+
+
+GType gtk_separator_accessible_get_type (void) G_GNUC_CONST;
+GType gtk_separator_accessible_factory_get_type (void) G_GNUC_CONST;
+
+
+G_END_DECLS
+
+#endif /* __GTK_SEPARATOR_ACCESSIBLE_H__ */
diff --git a/modules/other/gail/gail.c b/modules/other/gail/gail.c
index 04c3e7a..a4ff6ca 100644
--- a/modules/other/gail/gail.c
+++ b/modules/other/gail/gail.c
@@ -27,6 +27,7 @@
#include <gtk/gtkcontaineraccessible.h>
#include <gtk/gtkimageaccessible.h>
#include <gtk/gtkprogressbaraccessible.h>
+#include <gtk/gtkseparatoraccessible.h>
#include <gtk/gtkwidgetaccessible.h>
#include "gail.h"
@@ -77,13 +78,10 @@ static guint focus_notify_handler = 0;
static guint focus_tracker_id = 0;
static GQuark quark_focus_object = 0;
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BUTTON, GailButton, gail_button, GTK_TYPE_BUTTON)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LINK_BUTTON, GailLinkButton, gail_link_button, GTK_TYPE_LINK_BUTTON)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_MENU_ITEM, GailMenuItem, gail_menu_item, gail_menu_item_new)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, GailToggleButton, gail_toggle_button, GTK_TYPE_TOGGLE_BUTTON)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_IMAGE, GailImage, gail_image, GTK_TYPE_IMAGE)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TEXT_VIEW, GailTextView, gail_text_view, GTK_TYPE_TEXT_VIEW)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO_BOX, GailComboBox, gail_combo_box, GTK_TYPE_COMBO_BOX)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ENTRY, GailEntry, gail_entry, GTK_TYPE_ENTRY)
@@ -97,13 +95,10 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LABEL, GailLabel, gail_label, GTK_TYPE_LABEL)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CALENDAR, GailCalendar, gail_calendar, GTK_TYPE_CALENDAR)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_bar, GTK_TYPE_PROGRESS_BAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SPIN_BUTTON, GailSpinButton, gail_spin_button, GTK_TYPE_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_ARROW, GailArrow, gail_arrow, GTK_TYPE_ARROW)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SEPARATOR, GailSeparator, gail_separator, GTK_TYPE_SEPARATOR)
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)
@@ -905,6 +900,9 @@ gail_accessibility_module_init (void)
atk_registry_set_factory_type (atk_get_default_registry (),
GTK_TYPE_PROGRESS_BAR,
gtk_progress_bar_accessible_factory_get_type ());
+ atk_registry_set_factory_type (atk_get_default_registry (),
+ GTK_TYPE_SEPARATOR,
+ gtk_separator_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);
@@ -929,7 +927,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_SEPARATOR, gail_separator);
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]