From 4a7a667f5ff510ea9b898896076038cec7bcba3c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 26 Jun 2011 21:36:11 -0400 Subject: [PATCH] Drop GailSeparator Instead, just set a suitable role on a GtkWidgetAccessible. --- gtk/a11y/Makefile.am | 2 -- gtk/a11y/gail.c | 3 --- gtk/a11y/gailseparator.c | 52 ---------------------------------------- gtk/a11y/gailseparator.h | 51 --------------------------------------- gtk/gtkseparator.c | 16 ++++++++++++- 5 files changed, 15 insertions(+), 109 deletions(-) delete mode 100644 gtk/a11y/gailseparator.c delete mode 100644 gtk/a11y/gailseparator.h diff --git a/gtk/a11y/Makefile.am b/gtk/a11y/Makefile.am index 8674a264fd..ab3212b423 100644 --- a/gtk/a11y/Makefile.am +++ b/gtk/a11y/Makefile.am @@ -42,7 +42,6 @@ gail_c_sources = \ gailscalebutton.c \ gailscrollbar.c \ gailscrolledwindow.c \ - gailseparator.c \ gtkspinbuttonaccessible.c \ gailsubmenuitem.c \ gailstatusbar.c \ @@ -97,7 +96,6 @@ gail_private_h_sources = \ gailscalebutton.h \ gailscrollbar.h \ gailscrolledwindow.h \ - gailseparator.h \ gtkspinbuttonaccessible.h \ gailsubmenuitem.h \ gailstatusbar.h \ diff --git a/gtk/a11y/gail.c b/gtk/a11y/gail.c index 31fd181f51..7ca070bd25 100644 --- a/gtk/a11y/gail.c +++ b/gtk/a11y/gail.c @@ -51,7 +51,6 @@ #include "gailscalebutton.h" #include "gailscrollbar.h" #include "gailscrolledwindow.h" -#include "gailseparator.h" #include "gailstatusbar.h" #include "gailtextcell.h" #include "gailtogglebutton.h" @@ -127,7 +126,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_b 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_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) @@ -903,7 +901,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); diff --git a/gtk/a11y/gailseparator.c b/gtk/a11y/gailseparator.c deleted file mode 100644 index 22e9146899..0000000000 --- a/gtk/a11y/gailseparator.c +++ /dev/null @@ -1,52 +0,0 @@ -/* GAIL - The GNOME Accessibility Enabling Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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. - */ - -#include "config.h" - -#include -#include "gailseparator.h" - -static void gail_separator_class_init (GailSeparatorClass *klass); -static void gail_separator_init (GailSeparator *accessible); -static void gail_separator_initialize (AtkObject *accessible, - gpointer data); - -G_DEFINE_TYPE (GailSeparator, gail_separator, GAIL_TYPE_WIDGET) - -static void -gail_separator_class_init (GailSeparatorClass *klass) -{ - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - - class->initialize = gail_separator_initialize; -} - -static void -gail_separator_init (GailSeparator *accessible) -{ -} - -static void -gail_separator_initialize (AtkObject *accessible, - gpointer data) -{ - ATK_OBJECT_CLASS (gail_separator_parent_class)->initialize (accessible, data); - - accessible->role = ATK_ROLE_SEPARATOR; -} diff --git a/gtk/a11y/gailseparator.h b/gtk/a11y/gailseparator.h deleted file mode 100644 index 1f3b37729c..0000000000 --- a/gtk/a11y/gailseparator.h +++ /dev/null @@ -1,51 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems 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. - */ - -#ifndef __GAIL_SEPARATOR_H__ -#define __GAIL_SEPARATOR_H__ - -#include "gailwidget.h" - -G_BEGIN_DECLS - -#define GAIL_TYPE_SEPARATOR (gail_separator_get_type ()) -#define GAIL_SEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_SEPARATOR, GailSeparator)) -#define GAIL_SEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_SEPARATOR, GailSeparatorClass)) -#define GAIL_IS_SEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_SEPARATOR)) -#define GAIL_IS_SEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_SEPARATOR)) -#define GAIL_SEPARATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_SEPARATOR, GailSeparatorClass)) - -typedef struct _GailSeparator GailSeparator; -typedef struct _GailSeparatorClass GailSeparatorClass; - -struct _GailSeparator -{ - GailWidget parent; -}; - -GType gail_separator_get_type (void); - -struct _GailSeparatorClass -{ - GailWidgetClass parent_class; -}; - -G_END_DECLS - -#endif /* __GAIL_SEPARATOR_H__ */ diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c index e285a40e74..d67ab2ec6f 100644 --- a/gtk/gtkseparator.c +++ b/gtk/gtkseparator.c @@ -72,6 +72,7 @@ static void gtk_separator_get_preferred_height gint *natural); static gboolean gtk_separator_draw (GtkWidget *widget, cairo_t *cr); +static AtkObject *gtk_separator_get_accessible (GtkWidget *widget); G_DEFINE_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET, @@ -91,7 +92,8 @@ gtk_separator_class_init (GtkSeparatorClass *class) widget_class->get_preferred_width = gtk_separator_get_preferred_width; widget_class->get_preferred_height = gtk_separator_get_preferred_height; - widget_class->draw = gtk_separator_draw; + widget_class->draw = gtk_separator_draw; + widget_class->get_accessible = gtk_separator_get_accessible; g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation"); @@ -272,6 +274,18 @@ gtk_separator_draw (GtkWidget *widget, return FALSE; } +static AtkObject * +gtk_separator_get_accessible (GtkWidget *widget) +{ + AtkObject *obj; + + obj = GTK_WIDGET_CLASS (gtk_separator_parent_class)->get_accessible (widget); + + atk_object_set_role (obj, ATK_ROLE_SEPARATOR); + + return obj; +} + /** * gtk_separator_new: * @orientation: the separator's orientation.