From 12f9b81b1eb3d6e172638317524d26c72531a874 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 27 Dec 2012 02:10:51 -0500 Subject: [PATCH] Drop separate scrollbar accessible implementation It didn't really add anything to the range accessible implementation. --- gtk/a11y/Makefile.am | 2 - gtk/a11y/gtkscrollbaraccessible.c | 91 ------------------------------- gtk/a11y/gtkscrollbaraccessible.h | 56 ------------------- gtk/gtk-a11y.h | 1 - gtk/gtkscrollbar.c | 4 +- 5 files changed, 1 insertion(+), 153 deletions(-) delete mode 100644 gtk/a11y/gtkscrollbaraccessible.c delete mode 100644 gtk/a11y/gtkscrollbaraccessible.h diff --git a/gtk/a11y/Makefile.am b/gtk/a11y/Makefile.am index 9c5d9f96c0..3ad5bae672 100644 --- a/gtk/a11y/Makefile.am +++ b/gtk/a11y/Makefile.am @@ -38,7 +38,6 @@ gtka11y_c_sources = \ gtkrenderercellaccessible.c \ gtkscaleaccessible.c \ gtkscalebuttonaccessible.c \ - gtkscrollbaraccessible.c \ gtkscrolledwindowaccessible.c \ gtkspinbuttonaccessible.c \ gtkspinneraccessible.c \ @@ -85,7 +84,6 @@ gtka11yinclude_HEADERS = \ gtkrenderercellaccessible.h \ gtkscaleaccessible.h \ gtkscalebuttonaccessible.h \ - gtkscrollbaraccessible.h \ gtkscrolledwindowaccessible.h \ gtkspinbuttonaccessible.h \ gtkspinneraccessible.h \ diff --git a/gtk/a11y/gtkscrollbaraccessible.c b/gtk/a11y/gtkscrollbaraccessible.c deleted file mode 100644 index b9cd206c3f..0000000000 --- a/gtk/a11y/gtkscrollbaraccessible.c +++ /dev/null @@ -1,91 +0,0 @@ -/* GTK+ - accessibility implementations - * 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, see . - */ - -#include "config.h" - -#include -#include "gtkscrollbaraccessible.h" - - -G_DEFINE_TYPE (GtkScrollbarAccessible, gtk_scrollbar_accessible, GTK_TYPE_RANGE_ACCESSIBLE) - -static void -gtk_scrollbar_accessible_init (GtkScrollbarAccessible *accessible) -{ -} - -static void -gtk_scrollbar_accessible_initialize (AtkObject *accessible, - gpointer data) -{ - ATK_OBJECT_CLASS (gtk_scrollbar_accessible_parent_class)->initialize (accessible, data); - - accessible->role = ATK_ROLE_SCROLL_BAR; -} - -static gint -gtk_scrollbar_accessible_get_index_in_parent (AtkObject *accessible) -{ - GtkWidget *widget; - GtkWidget *parent; - GtkWidget *child; - GtkScrolledWindow *scrolled_window; - gint id; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible)); - if (widget == NULL) - return -1; - - parent = gtk_widget_get_parent (widget); - if (!GTK_IS_SCROLLED_WINDOW (parent)) - return ATK_OBJECT_CLASS (gtk_scrollbar_accessible_parent_class)->get_index_in_parent (accessible); - - scrolled_window = GTK_SCROLLED_WINDOW (parent); - id = 0; - child = gtk_bin_get_child (GTK_BIN (scrolled_window)); - if (child) - { - if (widget == child) - return id; - id++; - } - - child = gtk_scrolled_window_get_hscrollbar (scrolled_window); - if (child) - { - if (widget == child) - return id; - id++; - } - child = gtk_scrolled_window_get_vscrollbar (scrolled_window); - if (child) - { - if (widget == child) - return id; - } - - return -1; -} - -static void -gtk_scrollbar_accessible_class_init (GtkScrollbarAccessibleClass *klass) -{ - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - - class->initialize = gtk_scrollbar_accessible_initialize; - class->get_index_in_parent = gtk_scrollbar_accessible_get_index_in_parent; -} diff --git a/gtk/a11y/gtkscrollbaraccessible.h b/gtk/a11y/gtkscrollbaraccessible.h deleted file mode 100644 index 57b9847692..0000000000 --- a/gtk/a11y/gtkscrollbaraccessible.h +++ /dev/null @@ -1,56 +0,0 @@ -/* GTK+ - accessibility implementations - * 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, see . - */ - -#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __GTK_SCROLLBAR_ACCESSIBLE_H__ -#define __GTK_SCROLLBAR_ACCESSIBLE_H__ - -#include - -G_BEGIN_DECLS - -#define GTK_TYPE_SCROLLBAR_ACCESSIBLE (gtk_scrollbar_accessible_get_type ()) -#define GTK_SCROLLBAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCROLLBAR_ACCESSIBLE, GtkScrollbarAccessible)) -#define GTK_SCROLLBAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCROLLBAR_ACCESSIBLE, GtkScrollbarAccessibleClass)) -#define GTK_IS_SCROLLBAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCROLLBAR_ACCESSIBLE)) -#define GTK_IS_SCROLLBAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCROLLBAR_ACCESSIBLE)) -#define GTK_SCROLLBAR_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCROLLBAR_ACCESSIBLE, GtkScrollbarAccessibleClass)) - -typedef struct _GtkScrollbarAccessible GtkScrollbarAccessible; -typedef struct _GtkScrollbarAccessibleClass GtkScrollbarAccessibleClass; -typedef struct _GtkScrollbarAccessiblePrivate GtkScrollbarAccessiblePrivate; - -struct _GtkScrollbarAccessible -{ - GtkRangeAccessible parent; - - GtkScrollbarAccessiblePrivate *priv; -}; - -struct _GtkScrollbarAccessibleClass -{ - GtkRangeAccessibleClass parent_class; -}; - -GType gtk_scrollbar_accessible_get_type (void); - -G_END_DECLS - -#endif /* __GTK_SCROLLBAR_ACCESSIBLE_H__ */ diff --git a/gtk/gtk-a11y.h b/gtk/gtk-a11y.h index e9c6ea806e..f5c5ec09af 100644 --- a/gtk/gtk-a11y.h +++ b/gtk/gtk-a11y.h @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index 9062118b80..63cdf381cd 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -31,8 +31,6 @@ #include "gtkintl.h" #include "gtkprivate.h" -#include "a11y/gtkscrollbaraccessible.h" - /** * SECTION:gtkscrollbar @@ -111,7 +109,7 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class) FALSE, GTK_PARAM_READABLE)); - gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_SCROLLBAR_ACCESSIBLE); + gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_SCROLL_BAR); } static void