mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 06:10:15 +00:00
Drop separate scrollbar accessible implementation
It didn't really add anything to the range accessible implementation.
This commit is contained in:
parent
9e9824a0a1
commit
12f9b81b1e
@ -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 \
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#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;
|
||||
}
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GTK_SCROLLBAR_ACCESSIBLE_H__
|
||||
#define __GTK_SCROLLBAR_ACCESSIBLE_H__
|
||||
|
||||
#include <gtk/a11y/gtkrangeaccessible.h>
|
||||
|
||||
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__ */
|
@ -59,7 +59,6 @@
|
||||
#include <gtk/a11y/gtkrenderercellaccessible.h>
|
||||
#include <gtk/a11y/gtkscaleaccessible.h>
|
||||
#include <gtk/a11y/gtkscalebuttonaccessible.h>
|
||||
#include <gtk/a11y/gtkscrollbaraccessible.h>
|
||||
#include <gtk/a11y/gtkscrolledwindowaccessible.h>
|
||||
#include <gtk/a11y/gtkspinbuttonaccessible.h>
|
||||
#include <gtk/a11y/gtkspinneraccessible.h>
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user