diff --git a/README.md b/README.md
index 3f092f4d0c..50d6a3d9ee 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,6 @@ building for:
- [Pango](https://download.gnome.org/sources/pango)
- [Epoxy](https://github.com/anholt/libepoxy)
- [Graphene](https://github.com/ebassi/graphene)
- - [ATK](https://download.gnome.org/sources/atk)
- [Xkb-common](https://github.com/xkbcommon/libxkbcommon)
If you are building the X11 backend, you will also need:
@@ -70,7 +69,6 @@ If you are building the X11 backend, you will also need:
- xcursor
- xdamage
- xcomposite
- - [atk-bridge-2.0](https://download.gnome.org/sources/at-spi2-atk)
If you are building the Wayland backend, you will also need:
diff --git a/demos/gtk-demo/demo.ui b/demos/gtk-demo/demo.ui
index 7cb39a33e7..c93d6d46b5 100644
--- a/demos/gtk-demo/demo.ui
+++ b/demos/gtk-demo/demo.ui
@@ -95,9 +95,6 @@
Builder demo
gtk3-demo
True
-
-
-
-
-
-
1
1
@@ -149,9 +140,6 @@
-
-
-
1
0
@@ -165,9 +153,6 @@
-
-
-
0
2
@@ -197,9 +182,6 @@
-
-
-
0
3
diff --git a/demos/gtk-demo/listbox.ui b/demos/gtk-demo/listbox.ui
index 6b63609362..feb9307b59 100644
--- a/demos/gtk-demo/listbox.ui
+++ b/demos/gtk-demo/listbox.ui
@@ -84,9 +84,6 @@
0
Message
1
-
-
-
1
1
diff --git a/demos/gtk-demo/scale.ui b/demos/gtk-demo/scale.ui
index 9859d17408..be6d0de3a0 100644
--- a/demos/gtk-demo/scale.ui
+++ b/demos/gtk-demo/scale.ui
@@ -33,9 +33,6 @@
Plain
0
-
-
-
0
0
@@ -48,9 +45,6 @@
0
adjustment1
1
-
-
-
1
0
@@ -61,9 +55,6 @@
Marks
0
-
-
-
0
1
@@ -83,9 +74,6 @@
-
-
-
1
1
@@ -96,9 +84,6 @@
Discrete
0
-
-
-
0
2
@@ -112,9 +97,6 @@
0
adjustment3
1
-
-
-
diff --git a/demos/icon-browser/window.ui b/demos/icon-browser/window.ui
index ab76bb5bac..651db7b3e9 100644
--- a/demos/icon-browser/window.ui
+++ b/demos/icon-browser/window.ui
@@ -245,9 +245,6 @@
center
end
-
-
-
0
1
@@ -258,9 +255,6 @@
center
end
-
-
-
1
1
@@ -271,9 +265,6 @@
center
end
-
-
-
2
1
@@ -284,9 +275,6 @@
center
end
-
-
-
3
1
@@ -297,9 +285,6 @@
center
end
-
-
-
4
1
@@ -310,9 +295,6 @@
center
end
-
-
-
5
1
@@ -323,9 +305,6 @@
center
end
-
-
-
6
1
@@ -336,9 +315,6 @@
center
end
-
-
-
7
1
@@ -353,9 +329,6 @@
-
-
-
0
2
@@ -370,9 +343,6 @@
-
-
-
1
2
@@ -387,9 +357,6 @@
-
-
-
2
2
@@ -404,9 +371,6 @@
-
-
-
3
2
@@ -421,9 +385,6 @@
-
-
-
4
2
@@ -438,9 +399,6 @@
-
-
-
5
2
@@ -455,9 +413,6 @@
-
-
-
6
2
@@ -472,9 +427,6 @@
-
-
-
7
2
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index abc5fd12ba..6d682992ea 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -565,7 +565,6 @@ on_scale_button_value_changed (GtkScaleButton *button,
}
gtk_widget_set_tooltip_text (GTK_WIDGET (button), str);
- atk_object_set_description (gtk_widget_get_accessible (GTK_WIDGET (button)), str);
g_free (str);
}
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 0083826df7..e8e1db8052 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -3029,9 +3029,6 @@ bad things might happen.
20
20
To free the princess, you have to slay the dragon.
-
-
-
@@ -3231,9 +3228,6 @@ bad things might happen.
Title:
1
-
-
-
@@ -3241,9 +3235,6 @@ bad things might happen.
start
Description:
1
-
-
-
1
@@ -3259,9 +3250,6 @@ bad things might happen.
100
-
-
-
@@ -3274,9 +3262,6 @@ bad things might happen.
1
-
-
-
1
2
@@ -3357,9 +3342,6 @@ bad things might happen.
No updates at this time
-
-
-
@@ -3368,9 +3350,6 @@ bad things might happen.
You're in too deep!
-
-
-
diff --git a/docs/reference/gtk/building.md b/docs/reference/gtk/building.md
index 1f676faae8..7412e25473 100644
--- a/docs/reference/gtk/building.md
+++ b/docs/reference/gtk/building.md
@@ -127,7 +127,7 @@ compilation flags needed for that library along with version number
information.)
Some of the libraries that GTK depends on are maintained by the
-GTK team: GLib, GdkPixbuf, Pango, ATK and GObject Introspection.
+GTK team: GLib, GdkPixbuf, Pango, and GObject Introspection.
Other libraries are maintained separately.
- The GLib library provides core non-graphical functionality
@@ -139,10 +139,6 @@ Other libraries are maintained separately.
file formats. It is available [here](ttps://download.gnome.org/sources/gdk-pixbuf/).
- [Pango](http://www.pango.org) is a library for internationalized
text handling. It is available [here](https://download.gnome.org/sources/pango/).
-- ATK is the Accessibility Toolkit. It provides a set of generic
- interfaces allowing accessibility technologies such as
- screen readers to interact with a graphical user interface.
- It is available [here](https://download.gnome.org/sources/atk/).
- [GObject Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection)
is a framework for making introspection data available to language
bindings. It is available [here](https://download.gnome.org/sources/gobject-introspection/).
@@ -192,7 +188,7 @@ you'll have all of these installed already, or they will be easily
accessible through your operating system package repositories.
Then build and install the GTK libraries in the order:
-GLib, Cairo, Pango, ATK, then GTK. For each library, follow the
+GLib, Cairo, Pango, then GTK. For each library, follow the
instructions they provide, and make sure to share common settings
between them and the GTK build; if you are using a separate prefix
for GTK, for instance, you will need to use the same prefix for
diff --git a/docs/reference/gtk/compiling.md b/docs/reference/gtk/compiling.md
index 55e154bd17..1cceedded1 100644
--- a/docs/reference/gtk/compiling.md
+++ b/docs/reference/gtk/compiling.md
@@ -9,9 +9,9 @@ is used (the actual output on your system may be different):
```
$ pkg-config --cflags gtk4
- -pthread -I/usr/include/gtk-4.0 -I/usr/lib64/gtk-4.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
+ -pthread -I/usr/include/gtk-4.0 -I/usr/lib64/gtk-4.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
$ pkg-config --libs gtk4
- -pthread -lgtk-4 -lgdk-4 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
+ -pthread -lgtk-4 -lgdk-4 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
```
The simplest way to compile a program is to use the "backticks"
feature of the shell. If you enclose a command in backticks
diff --git a/docs/reference/gtk/overview.xml b/docs/reference/gtk/overview.xml
index f49ce93eb8..0435836586 100644
--- a/docs/reference/gtk/overview.xml
+++ b/docs/reference/gtk/overview.xml
@@ -61,18 +61,6 @@ other widgets that display text.
-
-ATK
-
-ATK is the Accessibility Toolkit. It provides a set of generic
-interfaces allowing accessibility technologies to interact with a
-graphical user interface. For example, a screen reader uses ATK to
-discover the text in an interface and read it to blind users. GTK
-widgets have built-in support for accessibility using the ATK
-framework.
-
-
-
GdkPixbuf
diff --git a/gtk/a11y/gtk-a11y-autocleanups.h b/gtk/a11y/gtk-a11y-autocleanups.h
deleted file mode 100644
index 33be4124c0..0000000000
--- a/gtk/a11y/gtk-a11y-autocleanups.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * 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 .
- */
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#ifndef __GI_SCANNER__
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkBooleanCellAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAccessibleParent, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkComboBoxAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkContainerCellAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkEntryAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkExpanderAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFlowBoxAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFlowBoxChildAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFrameAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkIconViewAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkImageAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkImageCellAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLabelAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLevelBarAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLinkButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListBoxAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListBoxRowAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLockButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkNotebookAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkNotebookPageAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPanedAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPopoverAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkProgressBarAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRangeAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRendererCellAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkScaleAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkScaleButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkScrolledWindowAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSpinButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSpinnerAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStatusbarAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSwitchAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkTextCellAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkTextViewAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkToggleButtonAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkToplevelAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkTreeViewAccessible, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkWindowAccessible, g_object_unref)
-
-#endif
diff --git a/gtk/a11y/gtkaccessibility.c b/gtk/a11y/gtkaccessibility.c
deleted file mode 100644
index ad9d3b0e1c..0000000000
--- a/gtk/a11y/gtkaccessibility.c
+++ /dev/null
@@ -1,43 +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 "gtkaccessibility.h"
-#include "gtkaccessibilityutil.h"
-
-#ifdef GDK_WINDOWING_X11
-#include
-#endif
-
-static int initialized = FALSE;
-
-void
-_gtk_accessibility_init (void)
-{
- if (initialized)
- return;
-
- initialized = TRUE;
-
- _gtk_accessibility_override_atk_util ();
-
-#ifdef GDK_WINDOWING_X11
- atk_bridge_adaptor_init (NULL, NULL);
-#endif
-
-}
diff --git a/gtk/a11y/gtkaccessibility.h b/gtk/a11y/gtkaccessibility.h
deleted file mode 100644
index 67401f8e96..0000000000
--- a/gtk/a11y/gtkaccessibility.h
+++ /dev/null
@@ -1,30 +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 .
- */
-
-#ifndef __GTK_ACCESSIBILITY_H__
-#define __GTK_ACCESSIBILITY_H__
-
-#include
-#include "gtk/gtkwidget.h"
-
-G_BEGIN_DECLS
-
-void _gtk_accessibility_init (void);
-
-G_END_DECLS
-
-#endif /* __GTK_ACCESSIBILITY_H__ */
diff --git a/gtk/a11y/gtkaccessibilityutil.c b/gtk/a11y/gtkaccessibilityutil.c
deleted file mode 100644
index 8414776bb3..0000000000
--- a/gtk/a11y/gtkaccessibilityutil.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2011, F123 Consulting & Mais Diferenças
- * Copyright 2001, 2002, 2003 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
-#include "gtkaccessibility.h"
-#include "gtkaccessibilityutil.h"
-#include "gtktoplevelaccessible.h"
-
-static GSList *key_listener_list = NULL;
-
-typedef struct {
- AtkKeySnoopFunc func;
- gpointer data;
- guint key;
-} KeyEventListener;
-
-static guint
-add_key_event_listener (AtkKeySnoopFunc listener_func,
- gpointer listener_data)
-{
- static guint key = 0;
- KeyEventListener *listener;
-
- key++;
-
- listener = g_slice_new0 (KeyEventListener);
- listener->func = listener_func;
- listener->data = listener_data;
- listener->key = key;
-
- key_listener_list = g_slist_append (key_listener_list, listener);
-
- return key;
-}
-
-static void
-remove_key_event_listener (guint listener_key)
-{
- GSList *l;
-
- for (l = key_listener_list; l; l = l->next)
- {
- KeyEventListener *listener = l->data;
-
- if (listener->key == listener_key)
- {
- g_slice_free (KeyEventListener, listener);
- key_listener_list = g_slist_delete_link (key_listener_list, l);
-
- break;
- }
- }
-}
-
-static AtkObject *
-get_root (void)
-{
- static AtkObject *root = NULL;
-
- if (!root)
- {
- root = g_object_new (GTK_TYPE_TOPLEVEL_ACCESSIBLE, NULL);
- atk_object_initialize (root, NULL);
- }
-
- return root;
-}
-
-static const gchar *
-get_toolkit_name (void)
-{
- return "gtk";
-}
-
-static const gchar *
-get_toolkit_version (void)
-{
- return GTK_VERSION;
-}
-
-void
-_gtk_accessibility_override_atk_util (void)
-{
- AtkUtilClass *atk_class = ATK_UTIL_CLASS (g_type_class_ref (ATK_TYPE_UTIL));
-
- atk_class->add_key_event_listener = add_key_event_listener;
- atk_class->remove_key_event_listener = remove_key_event_listener;
- atk_class->get_root = get_root;
- atk_class->get_toolkit_name = get_toolkit_name;
- atk_class->get_toolkit_version = get_toolkit_version;
-}
diff --git a/gtk/a11y/gtkaccessibilityutil.h b/gtk/a11y/gtkaccessibilityutil.h
deleted file mode 100644
index 7ab28c39ef..0000000000
--- a/gtk/a11y/gtkaccessibilityutil.h
+++ /dev/null
@@ -1,29 +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 .
- */
-
-#ifndef __GTK_ACCESSIBILITY_UTIL_H__
-#define __GTK_ACCESSIBILITY_UTIL_H__
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_accessibility_override_atk_util (void);
-
-G_END_DECLS
-
-#endif /* __GTK_ACCESSIBILITY_UTIL_H__ */
diff --git a/gtk/a11y/gtkbooleancellaccessible.c b/gtk/a11y/gtkbooleancellaccessible.c
deleted file mode 100644
index 694f86710d..0000000000
--- a/gtk/a11y/gtkbooleancellaccessible.c
+++ /dev/null
@@ -1,164 +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
-#include "gtkbooleancellaccessible.h"
-
-struct _GtkBooleanCellAccessiblePrivate
-{
- gboolean cell_value;
- gboolean cell_sensitive;
-};
-
-static AtkActionIface *parent_action_iface;
-
-static gint
-gtk_boolean_cell_accessible_get_n_actions (AtkAction *action)
-{
- return parent_action_iface->get_n_actions (action) + 1;
-}
-
-static const gchar *
-gtk_boolean_cell_accessible_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Toggles the cell");
-
- return parent_action_iface->get_description (action, i - 1);
-}
-
-static const gchar *
-gtk_boolean_cell_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return "toggle";
-
- return parent_action_iface->get_description (action, i - 1);
-}
-
-static const gchar *
-gtk_boolean_cell_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Toggle");
-
- return parent_action_iface->get_description (action, i - 1);
-}
-
-static gboolean
-gtk_boolean_cell_accessible_do_action (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return parent_action_iface->do_action (action, 2);
-
- return parent_action_iface->do_action (action, i - 1);
-}
-
-static void
-gtk_boolean_cell_accessible_action_interface_init (AtkActionIface *iface)
-{
- parent_action_iface = g_type_interface_peek_parent (iface);
-
- iface->do_action = gtk_boolean_cell_accessible_do_action;
- iface->get_n_actions = gtk_boolean_cell_accessible_get_n_actions;
- iface->get_description = gtk_boolean_cell_accessible_get_description;
- iface->get_name = gtk_boolean_cell_accessible_action_get_name;
- iface->get_localized_name = gtk_boolean_cell_accessible_action_get_localized_name;
-}
-
-
-G_DEFINE_TYPE_WITH_CODE (GtkBooleanCellAccessible, gtk_boolean_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
- G_ADD_PRIVATE (GtkBooleanCellAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, gtk_boolean_cell_accessible_action_interface_init))
-
-
-static AtkStateSet *
-gtk_boolean_cell_accessible_ref_state_set (AtkObject *accessible)
-{
- GtkBooleanCellAccessible *cell = GTK_BOOLEAN_CELL_ACCESSIBLE (accessible);
- AtkStateSet *state_set;
-
- state_set = ATK_OBJECT_CLASS (gtk_boolean_cell_accessible_parent_class)->ref_state_set (accessible);
-
- if (cell->priv->cell_value)
- atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
-
- if (cell->priv->cell_sensitive)
- atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
- else
- atk_state_set_remove_state (state_set, ATK_STATE_SENSITIVE);
-
- return state_set;
-}
-
-static void
-gtk_boolean_cell_accessible_update_cache (GtkCellAccessible *cell,
- gboolean emit_signal)
-{
- GtkBooleanCellAccessible *boolean_cell = GTK_BOOLEAN_CELL_ACCESSIBLE (cell);
- gboolean active;
- gboolean sensitive;
- GtkCellRenderer *renderer;
-
- g_object_get (cell, "renderer", &renderer, NULL);
- g_object_get (renderer,
- "active", &active,
- "sensitive", &sensitive,
- NULL);
- g_object_unref (renderer);
-
- if (boolean_cell->priv->cell_value != active)
- {
- boolean_cell->priv->cell_value = !boolean_cell->priv->cell_value;
-
- if (emit_signal)
- atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, active);
- }
-
- if (boolean_cell->priv->cell_sensitive != sensitive)
- {
- boolean_cell->priv->cell_sensitive = !boolean_cell->priv->cell_sensitive;
-
- if (emit_signal)
- atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_SENSITIVE, sensitive);
- }
-}
-
-static void
-gtk_boolean_cell_accessible_class_init (GtkBooleanCellAccessibleClass *klass)
-{
- GtkCellAccessibleClass *cell_class = GTK_CELL_ACCESSIBLE_CLASS (klass);
- AtkObjectClass *atkobject_class = ATK_OBJECT_CLASS (klass);
-
- atkobject_class->ref_state_set = gtk_boolean_cell_accessible_ref_state_set;
-
- cell_class->update_cache = gtk_boolean_cell_accessible_update_cache;
-}
-
-static void
-gtk_boolean_cell_accessible_init (GtkBooleanCellAccessible *cell)
-{
- cell->priv = gtk_boolean_cell_accessible_get_instance_private (cell);
-}
-
diff --git a/gtk/a11y/gtkbooleancellaccessible.h b/gtk/a11y/gtkbooleancellaccessible.h
deleted file mode 100644
index ba344e6cfc..0000000000
--- a/gtk/a11y/gtkbooleancellaccessible.h
+++ /dev/null
@@ -1,58 +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 .
- */
-
-#ifndef __GTK_BOOLEAN_CELL_ACCESSIBLE_H__
-#define __GTK_BOOLEAN_CELL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE (gtk_boolean_cell_accessible_get_type ())
-#define GTK_BOOLEAN_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, GtkBooleanCellAccessible))
-#define GTK_BOOLEAN_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_BOOLEAN_CELL, GtkBooleanCellAccessibleClass))
-#define GTK_IS_BOOLEAN_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE))
-#define GTK_IS_BOOLEAN_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE))
-#define GTK_BOOLEAN_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, GtkBooleanCellAccessibleClass))
-
-typedef struct _GtkBooleanCellAccessible GtkBooleanCellAccessible;
-typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass;
-typedef struct _GtkBooleanCellAccessiblePrivate GtkBooleanCellAccessiblePrivate;
-
-struct _GtkBooleanCellAccessible
-{
- GtkRendererCellAccessible parent;
-
- GtkBooleanCellAccessiblePrivate *priv;
-};
-
-struct _GtkBooleanCellAccessibleClass
-{
- GtkRendererCellAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_boolean_cell_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GAIL_TREE_VIEW_BOOLEAN_CELL_H__ */
diff --git a/gtk/a11y/gtkbuttonaccessible.c b/gtk/a11y/gtkbuttonaccessible.c
deleted file mode 100644
index 3c1385dc78..0000000000
--- a/gtk/a11y/gtkbuttonaccessible.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include
-#include "gtkbuttonaccessible.h"
-
-
-static void atk_action_interface_init (AtkActionIface *iface);
-static void atk_image_interface_init (AtkImageIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkButtonAccessible, gtk_button_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
-
-static void
-gtk_button_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkWidget *parent;
-
- ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->initialize (obj, data);
-
- parent = gtk_widget_get_parent (gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)));
- if (GTK_IS_TREE_VIEW (parent))
- {
- /* Even though the accessible parent of the column header will
- * be reported as the table because the parent widget of the
- * GtkTreeViewColumn's button is the GtkTreeView we set
- * the accessible parent for column header to be the table
- * to ensure that atk_object_get_index_in_parent() returns
- * the correct value; see gail_widget_get_index_in_parent().
- */
- atk_object_set_parent (obj, gtk_widget_get_accessible (parent));
- obj->role = ATK_ROLE_TABLE_COLUMN_HEADER;
- }
- else
- obj->role = ATK_ROLE_PUSH_BUTTON;
-}
-
-static GtkWidget *
-get_image_from_button (GtkWidget *button)
-{
- GtkWidget *image;
-
- image = gtk_button_get_child (GTK_BUTTON (button));
- if (GTK_IS_IMAGE (image))
- return image;
-
- return NULL;
-}
-
-static GtkWidget *
-find_label_child (GtkWidget *widget)
-{
- GtkWidget *child;
-
- for (child = gtk_widget_get_first_child (widget);
- child != NULL;
- child = gtk_widget_get_next_sibling (widget))
- {
- if (GTK_IS_LABEL (child))
- return child;
- else
- {
- GtkWidget *w = find_label_child (child);
- if (w)
- return w;
- }
- }
-
- return NULL;
-}
-
-static GtkWidget *
-get_label_from_button (GtkWidget *button)
-{
- GtkWidget *child;
-
- child = gtk_button_get_child (GTK_BUTTON (button));
-
- if (!GTK_IS_LABEL (child))
- child = find_label_child (child);
-
- return child;
-}
-
-static const gchar *
-gtk_button_accessible_get_name (AtkObject *obj)
-{
- const gchar *name = NULL;
- GtkWidget *widget;
- GtkWidget *child;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->get_name (obj);
- if (name != NULL)
- return name;
-
- child = get_label_from_button (widget);
- if (GTK_IS_LABEL (child))
- name = gtk_label_get_text (GTK_LABEL (child));
- else
- {
- GtkWidget *image;
-
- image = get_image_from_button (widget);
- if (GTK_IS_IMAGE (image))
- {
- AtkObject *atk_obj;
-
- atk_obj = gtk_widget_get_accessible (image);
- name = atk_object_get_name (atk_obj);
- }
- }
-
- return name;
-}
-
-static gint
-gtk_button_accessible_get_n_children (AtkObject* obj)
-{
- return 0;
-}
-
-static AtkObject *
-gtk_button_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- return NULL;
-}
-
-static AtkStateSet *
-gtk_button_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- state_set = ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->ref_state_set (obj);
-
- if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_ACTIVE) != 0)
- atk_state_set_add_state (state_set, ATK_STATE_ARMED);
-
- if (!gtk_widget_get_can_focus (widget))
- atk_state_set_remove_state (state_set, ATK_STATE_SELECTABLE);
-
- return state_set;
-}
-
-void
-gtk_button_accessible_update_label (GtkButtonAccessible *self)
-{
- g_return_if_fail (GTK_IS_BUTTON_ACCESSIBLE (self));
-
- /* If we don't have an overridden name, we use the label as the
- * accessible name
- */
- if (atk_object_get_name (ATK_OBJECT (self)) == NULL)
- g_object_notify (G_OBJECT (self), "accessible-name");
-
- g_signal_emit_by_name (self, "visible-data-changed");
-}
-
-static void
-gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_name = gtk_button_accessible_get_name;
- class->get_n_children = gtk_button_accessible_get_n_children;
- class->ref_child = gtk_button_accessible_ref_child;
- class->ref_state_set = gtk_button_accessible_ref_state_set;
- class->initialize = gtk_button_accessible_initialize;
-}
-
-static void
-gtk_button_accessible_init (GtkButtonAccessible *button)
-{
-}
-
-static gboolean
-gtk_button_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- g_signal_emit_by_name (widget, "clicked");
- return TRUE;
-}
-
-static gint
-gtk_button_accessible_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_button_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- gchar *return_value = NULL;
- GtkWidget *widget;
- GtkWidget *label;
- guint key_val;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return NULL;
-
- if (i != 0)
- return NULL;
-
- label = get_label_from_button (widget);
- if (GTK_IS_LABEL (label))
- {
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
- if (return_value == NULL)
- {
- /* Find labelled-by relation */
- AtkRelationSet *set;
- AtkRelation *relation;
- GPtrArray *target;
- gpointer target_object;
-
- set = atk_object_ref_relation_set (ATK_OBJECT (action));
- if (set)
- {
- relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
- if (relation)
- {
- target = atk_relation_get_target (relation);
- target_object = g_ptr_array_index (target, 0);
- label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
- }
- g_object_unref (set);
- }
-
- if (GTK_IS_LABEL (label))
- {
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
- }
- return return_value;
-}
-
-static const gchar *
-gtk_button_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return "click";
- return NULL;
-}
-
-static const gchar *
-gtk_button_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Click");
- return NULL;
-}
-
-static const gchar *
-gtk_button_accessible_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Clicks the button");
- return NULL;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_button_accessible_do_action;
- iface->get_n_actions = gtk_button_accessible_get_n_actions;
- iface->get_keybinding = gtk_button_accessible_get_keybinding;
- iface->get_name = gtk_button_accessible_action_get_name;
- iface->get_localized_name = gtk_button_accessible_action_get_localized_name;
- iface->get_description = gtk_button_accessible_action_get_description;
-}
-
-static const gchar *
-gtk_button_accessible_get_image_description (AtkImage *image)
-{
- GtkWidget *widget;
- GtkWidget *button_image;
- AtkObject *obj;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
- if (widget == NULL)
- return NULL;
-
- button_image = get_image_from_button (widget);
- if (GTK_IS_IMAGE (button_image))
- {
- obj = gtk_widget_get_accessible (button_image);
- return atk_image_get_image_description (ATK_IMAGE (obj));
- }
-
- return NULL;
-}
-
-static void
-gtk_button_accessible_get_image_position (AtkImage *image,
- gint *x,
- gint *y,
- AtkCoordType coord_type)
-{
- GtkWidget *widget;
- GtkWidget *button_image;
- AtkObject *obj;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
- if (widget == NULL)
- {
- *x = G_MININT;
- *y = G_MININT;
- return;
- }
-
- button_image = get_image_from_button (widget);
- if (button_image != NULL)
- {
- obj = gtk_widget_get_accessible (button_image);
- atk_component_get_extents (ATK_COMPONENT (obj), x, y, NULL, NULL,
- coord_type);
- }
- else
- {
- *x = G_MININT;
- *y = G_MININT;
- }
-}
-
-static void
-gtk_button_accessible_get_image_size (AtkImage *image,
- gint *width,
- gint *height)
-{
- GtkWidget *widget;
- GtkWidget *button_image;
- AtkObject *obj;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
- if (widget == NULL)
- {
- *width = -1;
- *height = -1;
- return;
- }
-
- button_image = get_image_from_button (widget);
- if (GTK_IS_IMAGE (button_image))
- {
- obj = gtk_widget_get_accessible (GTK_WIDGET (button_image));
- atk_image_get_image_size (ATK_IMAGE (obj), width, height);
- }
- else
- {
- *width = -1;
- *height = -1;
- }
-}
-
-static gboolean
-gtk_button_accessible_set_image_description (AtkImage *image,
- const gchar *description)
-{
- GtkWidget *widget;
- GtkWidget *button_image;
- AtkObject *obj;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
-
- if (widget == NULL)
- return FALSE;
-
- button_image = get_image_from_button (widget);
- if (GTK_IMAGE (button_image))
- {
- obj = gtk_widget_get_accessible (GTK_WIDGET (button_image));
- return atk_image_set_image_description (ATK_IMAGE (obj), description);
- }
-
- return FALSE;
-}
-
-static void
-atk_image_interface_init (AtkImageIface *iface)
-{
- iface->get_image_description = gtk_button_accessible_get_image_description;
- iface->get_image_position = gtk_button_accessible_get_image_position;
- iface->get_image_size = gtk_button_accessible_get_image_size;
- iface->set_image_description = gtk_button_accessible_set_image_description;
-}
diff --git a/gtk/a11y/gtkbuttonaccessible.h b/gtk/a11y/gtkbuttonaccessible.h
deleted file mode 100644
index 1c49c329b6..0000000000
--- a/gtk/a11y/gtkbuttonaccessible.h
+++ /dev/null
@@ -1,60 +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 .
- */
-
-#ifndef __GTK_BUTTON_ACCESSIBLE_H__
-#define __GTK_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_BUTTON_ACCESSIBLE (gtk_button_accessible_get_type ())
-#define GTK_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessible))
-#define GTK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass))
-#define GTK_IS_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUTTON_ACCESSIBLE))
-#define GTK_IS_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_ACCESSIBLE))
-#define GTK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass))
-
-typedef struct _GtkButtonAccessible GtkButtonAccessible;
-typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass;
-typedef struct _GtkButtonAccessiblePrivate GtkButtonAccessiblePrivate;
-
-struct _GtkButtonAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkButtonAccessiblePrivate *priv;
-};
-
-struct _GtkButtonAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_button_accessible_get_type (void);
-
-/*< private >*/
-void gtk_button_accessible_update_label (GtkButtonAccessible *self);
-
-G_END_DECLS
-
-#endif /* __GTK_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkcellaccessible.c b/gtk/a11y/gtkcellaccessible.c
deleted file mode 100644
index e55144ba02..0000000000
--- a/gtk/a11y/gtkcellaccessible.c
+++ /dev/null
@@ -1,533 +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
-#include "gtkcontainercellaccessible.h"
-#include "gtkcellaccessibleprivate.h"
-#include "gtkcellaccessibleparent.h"
-
-struct _GtkCellAccessiblePrivate
-{
- AtkObject *parent;
-};
-
-static const struct {
- AtkState atk_state;
- GtkCellRendererState renderer_state;
- gboolean invert;
-} state_map[] = {
- { ATK_STATE_SENSITIVE, GTK_CELL_RENDERER_INSENSITIVE, TRUE },
- { ATK_STATE_ENABLED, GTK_CELL_RENDERER_INSENSITIVE, TRUE },
- { ATK_STATE_SELECTED, GTK_CELL_RENDERER_SELECTED, FALSE },
- /* XXX: why do we map ACTIVE here? */
- { ATK_STATE_ACTIVE, GTK_CELL_RENDERER_FOCUSED, FALSE },
- { ATK_STATE_FOCUSED, GTK_CELL_RENDERER_FOCUSED, FALSE },
- { ATK_STATE_EXPANDABLE,GTK_CELL_RENDERER_EXPANDABLE, FALSE },
- { ATK_STATE_EXPANDED, GTK_CELL_RENDERER_EXPANDED, FALSE },
-};
-
-static GtkCellRendererState gtk_cell_accessible_get_state (GtkCellAccessible *cell);
-static void atk_action_interface_init (AtkActionIface *iface);
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void atk_table_cell_interface_init (AtkTableCellIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkCellAccessible, gtk_cell_accessible, GTK_TYPE_ACCESSIBLE,
- G_ADD_PRIVATE (GtkCellAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE_CELL, atk_table_cell_interface_init))
-
-static gint
-gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
-{
- GtkCellAccessible *cell;
- AtkObject *parent;
-
- cell = GTK_CELL_ACCESSIBLE (obj);
-
- if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent))
- return g_list_index (gtk_container_cell_accessible_get_children (GTK_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent)), obj);
-
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
- if (parent == NULL)
- return -1;
-
- return gtk_cell_accessible_parent_get_child_index (GTK_CELL_ACCESSIBLE_PARENT (cell->priv->parent), cell);
-}
-
-static AtkRelationSet *
-gtk_cell_accessible_ref_relation_set (AtkObject *object)
-{
- GtkCellAccessible *cell;
- AtkRelationSet *relationset;
- AtkObject *parent;
-
- relationset = ATK_OBJECT_CLASS (gtk_cell_accessible_parent_class)->ref_relation_set (object);
- if (relationset == NULL)
- relationset = atk_relation_set_new ();
-
- cell = GTK_CELL_ACCESSIBLE (object);
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
-
- gtk_cell_accessible_parent_update_relationset (GTK_CELL_ACCESSIBLE_PARENT (parent),
- cell,
- relationset);
-
- return relationset;
-}
-
-static AtkStateSet *
-gtk_cell_accessible_ref_state_set (AtkObject *accessible)
-{
- GtkCellAccessible *cell_accessible;
- AtkStateSet *state_set;
- GtkCellRendererState flags;
- guint i;
-
- cell_accessible = GTK_CELL_ACCESSIBLE (accessible);
-
- state_set = atk_state_set_new ();
-
- if (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell_accessible)) == NULL)
- {
- atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
- return state_set;
- }
-
- flags = gtk_cell_accessible_get_state (cell_accessible);
-
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
- atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
- atk_state_set_add_state (state_set, ATK_STATE_TRANSIENT);
- atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);
-
- for (i = 0; i < G_N_ELEMENTS (state_map); i++)
- {
- if (flags & state_map[i].renderer_state)
- {
- if (!state_map[i].invert)
- atk_state_set_add_state (state_set, state_map[i].atk_state);
- }
- else
- {
- if (state_map[i].invert)
- atk_state_set_add_state (state_set, state_map[i].atk_state);
- }
- }
-
- if (gtk_widget_get_mapped (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell_accessible))))
- atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
-
- return state_set;
-}
-
-static AtkObject *
-gtk_cell_accessible_get_parent (AtkObject *object)
-{
- GtkCellAccessible *cell = GTK_CELL_ACCESSIBLE (object);
-
- return cell->priv->parent;
-}
-
-static void
-gtk_cell_accessible_class_init (GtkCellAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_index_in_parent = gtk_cell_accessible_get_index_in_parent;
- class->ref_state_set = gtk_cell_accessible_ref_state_set;
- class->ref_relation_set = gtk_cell_accessible_ref_relation_set;
- class->get_parent = gtk_cell_accessible_get_parent;
-}
-
-static void
-gtk_cell_accessible_init (GtkCellAccessible *cell)
-{
- cell->priv = gtk_cell_accessible_get_instance_private (cell);
-}
-
-void
-_gtk_cell_accessible_initialize (GtkCellAccessible *cell,
- GtkWidget *widget,
- AtkObject *parent)
-{
- gtk_accessible_set_widget (GTK_ACCESSIBLE (cell), widget);
- cell->priv->parent = parent;
-}
-
-gboolean
-_gtk_cell_accessible_add_state (GtkCellAccessible *cell,
- AtkStateType state_type,
- gboolean emit_signal)
-{
- /* The signal should only be generated if the value changed,
- * not when the cell is set up. So states that are set
- * initially should pass FALSE as the emit_signal argument.
- */
- if (emit_signal)
- {
- atk_object_notify_state_change (ATK_OBJECT (cell), state_type, TRUE);
- /* If state_type is ATK_STATE_VISIBLE, additional notification */
- if (state_type == ATK_STATE_VISIBLE)
- g_signal_emit_by_name (cell, "visible-data-changed");
- }
-
- /* If the parent is a flyweight container cell, propagate the state
- * change to it also
- */
- if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent))
- _gtk_cell_accessible_add_state (GTK_CELL_ACCESSIBLE (cell->priv->parent), state_type, emit_signal);
-
- return TRUE;
-}
-
-gboolean
-_gtk_cell_accessible_remove_state (GtkCellAccessible *cell,
- AtkStateType state_type,
- gboolean emit_signal)
-{
- /* The signal should only be generated if the value changed,
- * not when the cell is set up. So states that are set
- * initially should pass FALSE as the emit_signal argument.
- */
- if (emit_signal)
- {
- atk_object_notify_state_change (ATK_OBJECT (cell), state_type, FALSE);
- /* If state_type is ATK_STATE_VISIBLE, additional notification */
- if (state_type == ATK_STATE_VISIBLE)
- g_signal_emit_by_name (cell, "visible-data-changed");
- }
-
- /* If the parent is a flyweight container cell, propagate the state
- * change to it also
- */
- if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (cell->priv->parent))
- _gtk_cell_accessible_remove_state (GTK_CELL_ACCESSIBLE (cell->priv->parent), state_type, emit_signal);
-
- return TRUE;
-}
-
-static gint
-gtk_cell_accessible_action_get_n_actions (AtkAction *action)
-{
- return 3;
-}
-
-static const gchar *
-gtk_cell_accessible_action_get_name (AtkAction *action,
- gint index)
-{
- switch (index)
- {
- case 0:
- return "expand or contract";
- case 1:
- return "edit";
- case 2:
- return "activate";
- default:
- return NULL;
- }
-}
-
-static const gchar *
-gtk_cell_accessible_action_get_localized_name (AtkAction *action,
- gint index)
-{
- switch (index)
- {
- case 0:
- return C_("Action name", "Expand or contract");
- case 1:
- return C_("Action name", "Edit");
- case 2:
- return C_("Action name", "Activate");
- default:
- return NULL;
- }
-}
-
-static const gchar *
-gtk_cell_accessible_action_get_description (AtkAction *action,
- gint index)
-{
- switch (index)
- {
- case 0:
- return C_("Action description", "Expands or contracts the row in the tree view containing this cell");
- case 1:
- return C_("Action description", "Creates a widget in which the contents of the cell can be edited");
- case 2:
- return C_("Action description", "Activates the cell");
- default:
- return NULL;
- }
-}
-
-static const gchar *
-gtk_cell_accessible_action_get_keybinding (AtkAction *action,
- gint index)
-{
- return NULL;
-}
-
-static gboolean
-gtk_cell_accessible_action_do_action (AtkAction *action,
- gint index)
-{
- GtkCellAccessible *cell = GTK_CELL_ACCESSIBLE (action);
- GtkCellAccessibleParent *parent;
-
- if (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)) == NULL)
- return FALSE;
-
- parent = GTK_CELL_ACCESSIBLE_PARENT (gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell))));
-
- switch (index)
- {
- case 0:
- gtk_cell_accessible_parent_expand_collapse (parent, cell);
- break;
- case 1:
- gtk_cell_accessible_parent_edit (parent, cell);
- break;
- case 2:
- gtk_cell_accessible_parent_activate (parent, cell);
- break;
- default:
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->get_n_actions = gtk_cell_accessible_action_get_n_actions;
- iface->do_action = gtk_cell_accessible_action_do_action;
- iface->get_name = gtk_cell_accessible_action_get_name;
- iface->get_localized_name = gtk_cell_accessible_action_get_localized_name;
- iface->get_description = gtk_cell_accessible_action_get_description;
- iface->get_keybinding = gtk_cell_accessible_action_get_keybinding;
-}
-
-static void
-gtk_cell_accessible_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkCellAccessible *cell;
- AtkObject *parent;
-
- cell = GTK_CELL_ACCESSIBLE (component);
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
-
- gtk_cell_accessible_parent_get_cell_extents (GTK_CELL_ACCESSIBLE_PARENT (parent),
- cell,
- x, y, width, height, coord_type);
-}
-
-static gboolean
-gtk_cell_accessible_grab_focus (AtkComponent *component)
-{
- GtkCellAccessible *cell;
- AtkObject *parent;
-
- cell = GTK_CELL_ACCESSIBLE (component);
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
-
- return gtk_cell_accessible_parent_grab_focus (GTK_CELL_ACCESSIBLE_PARENT (parent), cell);
-}
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- iface->get_extents = gtk_cell_accessible_get_extents;
- iface->grab_focus = gtk_cell_accessible_grab_focus;
-}
-
-static int
-gtk_cell_accessible_get_column_span (AtkTableCell *table_cell)
-{
- return 1;
-}
-
-static GPtrArray *
-gtk_cell_accessible_get_column_header_cells (AtkTableCell *table_cell)
-{
- GtkCellAccessible *cell;
- AtkObject *parent;
-
- cell = GTK_CELL_ACCESSIBLE (table_cell);
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
-
- return gtk_cell_accessible_parent_get_column_header_cells (GTK_CELL_ACCESSIBLE_PARENT (parent),
- cell);
-}
-
-static gboolean
-gtk_cell_accessible_get_position (AtkTableCell *table_cell,
- gint *row,
- gint *column)
-{
- GtkCellAccessible *cell;
- AtkObject *parent;
-
- cell = GTK_CELL_ACCESSIBLE (table_cell);
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
-
- gtk_cell_accessible_parent_get_cell_position (GTK_CELL_ACCESSIBLE_PARENT (parent),
- cell,
- row, column);
- return ((row && *row > 0) || (column && *column > 0));
-}
-
-static int
-gtk_cell_accessible_get_row_span (AtkTableCell *table_cell)
-{
- return 1;
-}
-
-static GPtrArray *
-gtk_cell_accessible_get_row_header_cells (AtkTableCell *table_cell)
-{
- GtkCellAccessible *cell;
- AtkObject *parent;
-
- cell = GTK_CELL_ACCESSIBLE (table_cell);
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
-
- return gtk_cell_accessible_parent_get_row_header_cells (GTK_CELL_ACCESSIBLE_PARENT (parent),
- cell);
-}
-
-static AtkObject *
-gtk_cell_accessible_get_table (AtkTableCell *table_cell)
-{
- AtkObject *obj;
-
- obj = ATK_OBJECT (table_cell);
- do
- {
- AtkRole role;
- obj = atk_object_get_parent (obj);
- role = atk_object_get_role (obj);
- if (role == ATK_ROLE_TABLE || role == ATK_ROLE_TREE_TABLE)
- break;
- }
- while (obj);
- return obj;
-}
-
-static void
-atk_table_cell_interface_init (AtkTableCellIface *iface)
-{
- iface->get_column_span = gtk_cell_accessible_get_column_span;
- iface->get_column_header_cells = gtk_cell_accessible_get_column_header_cells;
- iface->get_position = gtk_cell_accessible_get_position;
- iface->get_row_span = gtk_cell_accessible_get_row_span;
- iface->get_row_header_cells = gtk_cell_accessible_get_row_header_cells;
- iface->get_table = gtk_cell_accessible_get_table;
-}
-
-static GtkCellRendererState
-gtk_cell_accessible_get_state (GtkCellAccessible *cell)
-{
- AtkObject *parent;
-
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), 0);
-
- parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
- if (parent == NULL)
- return 0;
-
- return gtk_cell_accessible_parent_get_renderer_state (GTK_CELL_ACCESSIBLE_PARENT (parent), cell);
-}
-
-/*
- * gtk_cell_accessible_state_changed:
- * @cell: a #GtkCellAccessible
- * @added: the flags that were added from @cell
- * @removed: the flags that were removed from @cell
- *
- * Notifies @cell of state changes. Multiple states may be added
- * or removed at the same time. A state that is @added may not be
- * @removed at the same time.
- **/
-void
-_gtk_cell_accessible_state_changed (GtkCellAccessible *cell,
- GtkCellRendererState added,
- GtkCellRendererState removed)
-{
- AtkObject *object;
- guint i;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
- g_return_if_fail ((added & removed) == 0);
-
- object = ATK_OBJECT (cell);
-
- for (i = 0; i < G_N_ELEMENTS (state_map); i++)
- {
- if (added & state_map[i].renderer_state)
- atk_object_notify_state_change (object,
- state_map[i].atk_state,
- !state_map[i].invert);
- if (removed & state_map[i].renderer_state)
- atk_object_notify_state_change (object,
- state_map[i].atk_state,
- state_map[i].invert);
- }
-}
-
-/*
- * gtk_cell_accessible_update_cache:
- * @cell: the cell that is changed
- * @emit_signal: whether or not to notify the ATK bridge
- *
- * Notifies the cell that the values in the data in the row that
- * is used to feed the cell renderer with has changed. The
- * cell_changed function of @cell is called to send update
- * notifications for the properties it takes from its cell
- * renderer. If @emit_signal is TRUE, also notify the ATK bridge
- * of the change. The bridge should be notified when an existing
- * cell changes; not when a newly-created cell is being set up.
- *
- * Note that there is no higher granularity available about which
- * properties changed, so you will need to make do with this
- * function.
- **/
-void
-_gtk_cell_accessible_update_cache (GtkCellAccessible *cell,
- gboolean emit_signal)
-{
- GtkCellAccessibleClass *klass;
-
- g_return_if_fail (GTK_CELL_ACCESSIBLE (cell));
-
- klass = GTK_CELL_ACCESSIBLE_GET_CLASS (cell);
-
- if (klass->update_cache)
- klass->update_cache (cell, emit_signal);
-}
diff --git a/gtk/a11y/gtkcellaccessible.h b/gtk/a11y/gtkcellaccessible.h
deleted file mode 100644
index e144eed0ad..0000000000
--- a/gtk/a11y/gtkcellaccessible.h
+++ /dev/null
@@ -1,60 +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 .
- */
-
-#ifndef __GTK_CELL_ACCESSIBLE_H__
-#define __GTK_CELL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_CELL_ACCESSIBLE (gtk_cell_accessible_get_type ())
-#define GTK_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_ACCESSIBLE, GtkCellAccessible))
-#define GTK_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_ACCESSIBLE, GtkCellAccessibleClass))
-#define GTK_IS_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_ACCESSIBLE))
-#define GTK_IS_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_ACCESSIBLE))
-#define GTK_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_ACCESSIBLE, GtkCellAccessibleClass))
-
-typedef struct _GtkCellAccessible GtkCellAccessible;
-typedef struct _GtkCellAccessibleClass GtkCellAccessibleClass;
-typedef struct _GtkCellAccessiblePrivate GtkCellAccessiblePrivate;
-
-struct _GtkCellAccessible
-{
- GtkAccessible parent;
-
- GtkCellAccessiblePrivate *priv;
-};
-
-struct _GtkCellAccessibleClass
-{
- GtkAccessibleClass parent_class;
- void (*update_cache) (GtkCellAccessible *cell,
- gboolean emit_signal);
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_cell_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_CELL_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkcellaccessibleparent.c b/gtk/a11y/gtkcellaccessibleparent.c
deleted file mode 100644
index 535d907d09..0000000000
--- a/gtk/a11y/gtkcellaccessibleparent.c
+++ /dev/null
@@ -1,271 +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 "gtkcellaccessibleparent.h"
-
-GType
-gtk_cell_accessible_parent_get_type (void)
-{
- static volatile gsize g_define_type_id__volatile = 0;
-
- if (g_once_init_enter (&g_define_type_id__volatile))
- {
- GType g_define_type_id =
- g_type_register_static_simple (G_TYPE_INTERFACE,
- g_intern_static_string ("GtkCellAccessibleParent"),
- sizeof (GtkCellAccessibleParentIface),
- NULL,
- 0,
- NULL,
- 0);
-
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
- }
-
- return g_define_type_id__volatile;
-}
-
-/**
- * gtk_cell_accessible_parent_get_cell_extents:
- * @x: (out):
- * @y: (out):
- * @width: (out):
- * @height: (out):
- */
-void
-gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->get_cell_extents)
- (iface->get_cell_extents) (parent, cell, x, y, width, height, coord_type);
-}
-
-/**
- * gtk_cell_accessible_parent_get_cell_area:
- * @cell_rect: (out):
- */
-void
-gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- GdkRectangle *cell_rect)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- g_return_if_fail (cell_rect);
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->get_cell_area)
- (iface->get_cell_area) (parent, cell, cell_rect);
-}
-
-gboolean
-gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->grab_focus)
- return (iface->grab_focus) (parent, cell);
- else
- return FALSE;
-}
-
-int
-gtk_cell_accessible_parent_get_child_index (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->get_child_index)
- return (iface->get_child_index) (parent, cell);
- else
- return -1;
-}
-
-GtkCellRendererState
-gtk_cell_accessible_parent_get_renderer_state (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), 0);
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), 0);
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->get_renderer_state)
- return (iface->get_renderer_state) (parent, cell);
- else
- return 0;
-}
-
-void
-gtk_cell_accessible_parent_expand_collapse (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->expand_collapse)
- (iface->expand_collapse) (parent, cell);
-}
-
-void
-gtk_cell_accessible_parent_activate (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->activate)
- (iface->activate) (parent, cell);
-}
-
-void
-gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->edit)
- (iface->edit) (parent, cell);
-}
-
-void
-gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- AtkRelationSet *relationset)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
- g_return_if_fail (ATK_IS_RELATION_SET (relationset));
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->update_relationset)
- (iface->update_relationset) (parent, cell, relationset);
-}
-
-/**
- * gtk_cell_accessible_parent_get_cell_position:
- * @row: (out):
- * @column: (out):
- */
-void
-gtk_cell_accessible_parent_get_cell_position (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *row,
- gint *column)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->get_cell_position)
- (iface->get_cell_position) (parent, cell, row, column);
- else
- {
- if (row)
- *row = -1;
- if (column)
- *column = -1;
- }
-}
-
-/**
- * gtk_cell_accessible_parent_get_column_header_cells:
- * Returns: (transfer full) (element-type AtkObject)
- */
-GPtrArray *
-gtk_cell_accessible_parent_get_column_header_cells (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), NULL);
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), NULL);
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->get_column_header_cells)
- return (iface->get_column_header_cells) (parent, cell);
- else
- return NULL;
-}
-
-/**
- * gtk_cell_accessible_parent_get_row_header_cells:
- * Returns: (transfer full) (element-type AtkObject)
- */
-GPtrArray *
-gtk_cell_accessible_parent_get_row_header_cells (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkCellAccessibleParentIface *iface;
-
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), NULL);
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), NULL);
-
- iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
-
- if (iface->get_row_header_cells)
- return (iface->get_row_header_cells) (parent, cell);
- else
- return NULL;
-}
diff --git a/gtk/a11y/gtkcellaccessibleparent.h b/gtk/a11y/gtkcellaccessibleparent.h
deleted file mode 100644
index 1a8c2c62fb..0000000000
--- a/gtk/a11y/gtkcellaccessibleparent.h
+++ /dev/null
@@ -1,140 +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 .
- */
-
-#ifndef __GTK_CELL_ACCESSIBLE_PARENT_H__
-#define __GTK_CELL_ACCESSIBLE_PARENT_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-/*
- * The GtkCellAccessibleParent interface should be supported by any object
- * which contains children which are flyweights, i.e. do not have corresponding
- * widgets and the children need help from their parent to provide
- * functionality. One example is GtkTreeViewAccessible where the children
- * GtkCellAccessible need help from the GtkTreeViewAccessible in order to
- * implement atk_component_get_extents().
- */
-
-#define GTK_TYPE_CELL_ACCESSIBLE_PARENT (gtk_cell_accessible_parent_get_type ())
-#define GTK_IS_CELL_ACCESSIBLE_PARENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT)
-#define GTK_CELL_ACCESSIBLE_PARENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT, GtkCellAccessibleParent)
-#define GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT, GtkCellAccessibleParentIface))
-
-typedef struct _GtkCellAccessibleParent GtkCellAccessibleParent;
-typedef struct _GtkCellAccessibleParentIface GtkCellAccessibleParentIface;
-
-struct _GtkCellAccessibleParentIface
-{
- GTypeInterface parent;
- void ( *get_cell_extents) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type);
- void ( *get_cell_area) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- GdkRectangle *cell_rect);
- gboolean ( *grab_focus) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
- int ( *get_child_index) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
- GtkCellRendererState
- ( *get_renderer_state) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
- /* actions */
- void ( *expand_collapse) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
- void ( *activate) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
- void ( *edit) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
- /* end of actions */
- void ( *update_relationset) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- AtkRelationSet *relationset);
- void ( *get_cell_position) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *row,
- gint *column);
- GPtrArray * ( *get_column_header_cells) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
- GPtrArray * ( *get_row_header_cells) (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_cell_accessible_parent_get_type (void);
-
-GDK_AVAILABLE_IN_ALL
-void gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type);
-GDK_AVAILABLE_IN_ALL
-void gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- GdkRectangle *cell_rect);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-GDK_AVAILABLE_IN_ALL
-int gtk_cell_accessible_parent_get_child_index (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-GDK_AVAILABLE_IN_ALL
-GtkCellRendererState
- gtk_cell_accessible_parent_get_renderer_state(GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-GDK_AVAILABLE_IN_ALL
-void gtk_cell_accessible_parent_expand_collapse (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-GDK_AVAILABLE_IN_ALL
-void gtk_cell_accessible_parent_activate (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-GDK_AVAILABLE_IN_ALL
-void gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-GDK_AVAILABLE_IN_ALL
-void gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- AtkRelationSet *relationset);
-GDK_AVAILABLE_IN_ALL
-void gtk_cell_accessible_parent_get_cell_position(GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *row,
- gint *column);
-GDK_AVAILABLE_IN_ALL
-GPtrArray *gtk_cell_accessible_parent_get_column_header_cells (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-GDK_AVAILABLE_IN_ALL
-GPtrArray *gtk_cell_accessible_parent_get_row_header_cells (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell);
-
-G_END_DECLS
-
-#endif /* __GTK_CELL_ACCESSIBLE_PARENT_H__ */
diff --git a/gtk/a11y/gtkcellaccessibleprivate.h b/gtk/a11y/gtkcellaccessibleprivate.h
deleted file mode 100644
index 80fb1435c9..0000000000
--- a/gtk/a11y/gtkcellaccessibleprivate.h
+++ /dev/null
@@ -1,42 +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 .
- */
-
-#ifndef __GTK_CELL_ACCESSIBLE_PRIVATE_H__
-#define __GTK_CELL_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_cell_accessible_state_changed (GtkCellAccessible *cell,
- GtkCellRendererState added,
- GtkCellRendererState removed);
-void _gtk_cell_accessible_update_cache (GtkCellAccessible *cell,
- gboolean emit_signal);
-void _gtk_cell_accessible_initialize (GtkCellAccessible *cell,
- GtkWidget *widget,
- AtkObject *parent);
-gboolean _gtk_cell_accessible_add_state (GtkCellAccessible *cell,
- AtkStateType state_type,
- gboolean emit_signal);
-gboolean _gtk_cell_accessible_remove_state (GtkCellAccessible *cell,
- AtkStateType state_type,
- gboolean emit_signal);
-
-G_END_DECLS
-
-#endif /* __GTK_CELL_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkcolorswatchaccessible.c b/gtk/a11y/gtkcolorswatchaccessible.c
deleted file mode 100644
index 1c52fda18c..0000000000
--- a/gtk/a11y/gtkcolorswatchaccessible.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2012 Red Hat, 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 "gtkcolorswatchaccessibleprivate.h"
-#include "gtkcolorswatchprivate.h"
-
-#include
-
-static void atk_action_interface_init (AtkActionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkColorSwatchAccessible, _gtk_color_swatch_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static void
-state_changed_cb (GtkWidget *widget,
- GtkStateFlags previous_flags,
- AtkObject *accessible)
-{
- GtkStateFlags flags;
- gboolean was_selected;
- gboolean selected;
-
- flags = gtk_widget_get_state_flags (widget);
-
- was_selected = (previous_flags & GTK_STATE_FLAG_SELECTED) != 0;
- selected = (flags & GTK_STATE_FLAG_SELECTED) != 0;
-
- if (selected && !was_selected)
- atk_object_notify_state_change (accessible, ATK_STATE_CHECKED, TRUE);
- else if (!selected && was_selected)
- atk_object_notify_state_change (accessible, ATK_STATE_CHECKED, FALSE);
-}
-
-static void
-on_selectable_changed_cb (GObject *gobject,
- GParamSpec *pspec,
- AtkObject *accessible)
-{
- GtkColorSwatch *swatch = GTK_COLOR_SWATCH (gobject);
- AtkRole role;
-
- if (gtk_color_swatch_get_selectable (swatch))
- role = ATK_ROLE_RADIO_BUTTON;
- else
- role = ATK_ROLE_PUSH_BUTTON;
-
- atk_object_set_role (accessible, role);
-}
-
-static void
-gtk_color_swatch_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkColorSwatch *swatch = data;
-
- ATK_OBJECT_CLASS (_gtk_color_swatch_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect (data, "state-flags-changed",
- G_CALLBACK (state_changed_cb),
- obj);
- g_signal_connect (data, "notify::selectable",
- G_CALLBACK (on_selectable_changed_cb),
- obj);
-
- obj->role = gtk_color_swatch_get_selectable (swatch)
- ? ATK_ROLE_RADIO_BUTTON
- : ATK_ROLE_PUSH_BUTTON;
-}
-
-static AtkStateSet *
-gtk_color_swatch_accessible_ref_state_set (AtkObject *accessible)
-{
- GtkWidget *widget;
- AtkStateSet *state_set;
-
- state_set = ATK_OBJECT_CLASS (_gtk_color_swatch_accessible_parent_class)->ref_state_set (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget != NULL)
- {
- if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_SELECTED) != 0)
- atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
- }
-
- return state_set;
-}
-
-static void
-_gtk_color_swatch_accessible_class_init (GtkColorSwatchAccessibleClass *klass)
-{
- AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
-
- atk_class->initialize = gtk_color_swatch_accessible_initialize;
- atk_class->ref_state_set = gtk_color_swatch_accessible_ref_state_set;
-}
-
-static void
-_gtk_color_swatch_accessible_init (GtkColorSwatchAccessible *self)
-{
- ATK_OBJECT (self)->role = ATK_ROLE_RADIO_BUTTON;
-}
-
-static gint
-gtk_color_swatch_accessible_get_n_actions (AtkAction *action)
-{
- return 3;
-}
-
-static const gchar *
-gtk_color_swatch_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- return NULL;
-}
-
-static const gchar *
-gtk_color_swatch_accessible_get_name (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0: return "select";
- case 1: return "activate";
- case 2: return "customize";
- default: return NULL;
- }
-}
-
-static const gchar *
-gtk_color_swatch_accessible_get_localized_name (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0: return C_("Action name", "Select");
- case 1: return C_("Action name", "Activate");
- case 2: return C_("Action name", "Customize");
- default: return NULL;
- }
-}
-
-static const gchar *
-gtk_color_swatch_accessible_get_description (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0: return C_("Action description", "Selects the color");
- case 1: return C_("Action description", "Activates the color");
- case 2: return C_("Action description", "Customizes the color");
- default: return NULL;
- }
-}
-
-static gboolean
-gtk_color_swatch_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- switch (i)
- {
- case 0:
- gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_SELECTED, FALSE);
- break;
-
- case 1:
- g_signal_emit_by_name (widget, "activate");
- break;
-
- case 2:
- g_signal_emit_by_name (widget, "customize");
- break;
-
- default:
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_color_swatch_accessible_do_action;
- iface->get_n_actions = gtk_color_swatch_accessible_get_n_actions;
- iface->get_keybinding = gtk_color_swatch_accessible_get_keybinding;
- iface->get_name = gtk_color_swatch_accessible_get_name;
- iface->get_localized_name = gtk_color_swatch_accessible_get_localized_name;
- iface->get_description = gtk_color_swatch_accessible_get_description;
-}
diff --git a/gtk/a11y/gtkcolorswatchaccessibleprivate.h b/gtk/a11y/gtkcolorswatchaccessibleprivate.h
deleted file mode 100644
index 123f65f7a8..0000000000
--- a/gtk/a11y/gtkcolorswatchaccessibleprivate.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2012, 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, see .
- */
-
-#ifndef __GTK_COLOR_SWATCH_ACCESSIBLE_H__
-#define __GTK_COLOR_SWATCH_ACCESSIBLE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_COLOR_SWATCH_ACCESSIBLE (_gtk_color_swatch_accessible_get_type ())
-#define GTK_COLOR_SWATCH_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE, GtkColorSwatchAccessible))
-#define GTK_COLOR_SWATCH_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE, GtkColorSwatchAccessibleClass))
-#define GTK_IS_COLOR_SWATCH_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE))
-#define GTK_IS_COLOR_SWATCH_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE))
-#define GTK_COLOR_SWATCH_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE, GtkColorSwatchAccessibleClass))
-
-typedef struct _GtkColorSwatchAccessible GtkColorSwatchAccessible;
-typedef struct _GtkColorSwatchAccessibleClass GtkColorSwatchAccessibleClass;
-typedef struct _GtkColorSwatchAccessiblePrivate GtkColorSwatchAccessiblePrivate;
-
-struct _GtkColorSwatchAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkColorSwatchAccessiblePrivate *priv;
-};
-
-struct _GtkColorSwatchAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GType _gtk_color_swatch_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_COLOR_SWATCH_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkcomboboxaccessible.c b/gtk/a11y/gtkcomboboxaccessible.c
deleted file mode 100644
index bb9f7c9acf..0000000000
--- a/gtk/a11y/gtkcomboboxaccessible.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2004 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
-#include "gtkcomboboxaccessible.h"
-
-struct _GtkComboBoxAccessiblePrivate
-{
- gchar *name;
- gint old_selection;
- gboolean popup_set;
-};
-
-static void atk_action_interface_init (AtkActionIface *iface);
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkComboBoxAccessible, gtk_combo_box_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkComboBoxAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
-
-static void
-changed_cb (GtkWidget *widget)
-{
- GtkComboBox *combo_box;
- AtkObject *obj;
- GtkComboBoxAccessible *accessible;
- gint index;
-
- combo_box = GTK_COMBO_BOX (widget);
-
- index = gtk_combo_box_get_active (combo_box);
- obj = gtk_widget_get_accessible (widget);
- accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);
- if (accessible->priv->old_selection != index)
- {
- accessible->priv->old_selection = index;
- g_object_notify (G_OBJECT (obj), "accessible-name");
- g_signal_emit_by_name (obj, "selection-changed");
- }
-}
-
-static void
-gtk_combo_box_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkComboBox *combo_box;
- GtkComboBoxAccessible *accessible;
- AtkObject *popup;
-
- ATK_OBJECT_CLASS (gtk_combo_box_accessible_parent_class)->initialize (obj, data);
-
- combo_box = GTK_COMBO_BOX (data);
- accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);
-
- g_signal_connect (combo_box, "changed", G_CALLBACK (changed_cb), NULL);
- accessible->priv->old_selection = gtk_combo_box_get_active (combo_box);
-
- popup = gtk_combo_box_get_popup_accessible (combo_box);
- if (popup)
- {
- atk_object_set_parent (popup, obj);
- accessible->priv->popup_set = TRUE;
- }
- if (gtk_combo_box_get_has_entry (combo_box))
- atk_object_set_parent (gtk_widget_get_accessible (gtk_combo_box_get_child (GTK_COMBO_BOX (combo_box))), obj);
-
- obj->role = ATK_ROLE_COMBO_BOX;
-}
-
-static void
-gtk_combo_box_accessible_finalize (GObject *object)
-{
- GtkComboBoxAccessible *combo_box = GTK_COMBO_BOX_ACCESSIBLE (object);
-
- g_free (combo_box->priv->name);
-
- G_OBJECT_CLASS (gtk_combo_box_accessible_parent_class)->finalize (object);
-}
-
-static const gchar *
-gtk_combo_box_accessible_get_name (AtkObject *obj)
-{
- GtkWidget *widget;
- GtkComboBox *combo_box;
- GtkComboBoxAccessible *accessible;
- GtkTreeIter iter;
- const gchar *name;
- GtkTreeModel *model;
- gint n_columns;
- gint i;
-
- name = ATK_OBJECT_CLASS (gtk_combo_box_accessible_parent_class)->get_name (obj);
- if (name)
- return name;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- combo_box = GTK_COMBO_BOX (widget);
- accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);
- if (gtk_combo_box_get_active_iter (combo_box, &iter))
- {
- model = gtk_combo_box_get_model (combo_box);
- n_columns = gtk_tree_model_get_n_columns (model);
- for (i = 0; i < n_columns; i++)
- {
- GValue value = G_VALUE_INIT;
-
- gtk_tree_model_get_value (model, &iter, i, &value);
- if (G_VALUE_HOLDS_STRING (&value))
- {
- g_free (accessible->priv->name);
- accessible->priv->name = g_strdup (g_value_get_string (&value));
- g_value_unset (&value);
- break;
- }
- else
- g_value_unset (&value);
- }
- }
- return accessible->priv->name;
-}
-
-static gint
-gtk_combo_box_accessible_get_n_children (AtkObject* obj)
-{
- gint n_children = 0;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return 0;
-
- n_children++;
- if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget)))
- n_children++;
-
- return n_children;
-}
-
-static AtkObject *
-gtk_combo_box_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- GtkWidget *widget;
- AtkObject *child;
- GtkComboBoxAccessible *box;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- if (i == 0)
- {
- child = gtk_combo_box_get_popup_accessible (GTK_COMBO_BOX (widget));
- box = GTK_COMBO_BOX_ACCESSIBLE (obj);
- if (!box->priv->popup_set)
- {
- atk_object_set_parent (child, obj);
- box->priv->popup_set = TRUE;
- }
- }
- else if (i == 1 && gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget)))
- {
- child = gtk_widget_get_accessible (gtk_combo_box_get_child (GTK_COMBO_BOX (widget)));
- }
- else
- {
- return NULL;
- }
-
- return g_object_ref (child);
-}
-
-static void
-gtk_combo_box_accessible_class_init (GtkComboBoxAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- gobject_class->finalize = gtk_combo_box_accessible_finalize;
-
- class->get_name = gtk_combo_box_accessible_get_name;
- class->get_n_children = gtk_combo_box_accessible_get_n_children;
- class->ref_child = gtk_combo_box_accessible_ref_child;
- class->initialize = gtk_combo_box_accessible_initialize;
-}
-
-static void
-gtk_combo_box_accessible_init (GtkComboBoxAccessible *combo_box)
-{
- combo_box->priv = gtk_combo_box_accessible_get_instance_private (combo_box);
- combo_box->priv->old_selection = -1;
- combo_box->priv->name = NULL;
- combo_box->priv->popup_set = FALSE;
-}
-
-static gboolean
-gtk_combo_box_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkComboBox *combo_box;
- GtkWidget *widget;
- gboolean popup_shown;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- combo_box = GTK_COMBO_BOX (widget);
- g_object_get (combo_box, "popup-shown", &popup_shown, NULL);
- if (popup_shown)
- gtk_combo_box_popdown (combo_box);
- else
- gtk_combo_box_popup (combo_box);
-
- return TRUE;
-}
-
-static gint
-gtk_combo_box_accessible_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_combo_box_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- GtkComboBoxAccessible *combo_box;
- GtkWidget *widget;
- GtkWidget *label;
- AtkRelationSet *set;
- AtkRelation *relation;
- GPtrArray *target;
- gpointer target_object;
- guint key_val;
- gchar *return_value = NULL;
-
- if (i != 0)
- return NULL;
-
- combo_box = GTK_COMBO_BOX_ACCESSIBLE (action);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (combo_box));
- if (widget == NULL)
- return NULL;
-
- set = atk_object_ref_relation_set (ATK_OBJECT (action));
- if (set == NULL)
- return NULL;
-
- label = NULL;
- relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
- if (relation)
- {
- target = atk_relation_get_target (relation);
- target_object = g_ptr_array_index (target, 0);
- label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
- }
- g_object_unref (set);
- if (GTK_IS_LABEL (label))
- {
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
-
- return return_value;
-}
-
-static const gchar *
-gtk_combo_box_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return "press";
- return NULL;
-}
-
-static const gchar *
-gtk_combo_box_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Press");
- return NULL;
-}
-
-static const gchar *
-gtk_combo_box_accessible_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Presses the combobox");
- return NULL;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_combo_box_accessible_do_action;
- iface->get_n_actions = gtk_combo_box_accessible_get_n_actions;
- iface->get_keybinding = gtk_combo_box_accessible_get_keybinding;
- iface->get_name = gtk_combo_box_accessible_action_get_name;
- iface->get_localized_name = gtk_combo_box_accessible_action_get_localized_name;
- iface->get_description = gtk_combo_box_accessible_action_get_description;
-}
-
-static gboolean
-gtk_combo_box_accessible_add_selection (AtkSelection *selection,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (widget), i);
-
- return TRUE;
-}
-
-static gboolean
-gtk_combo_box_accessible_clear_selection (AtkSelection *selection)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (widget), -1);
-
- return TRUE;
-}
-
-static AtkObject *
-gtk_combo_box_accessible_ref_selection (AtkSelection *selection,
- gint i)
-{
- GtkComboBox *combo_box;
- GtkWidget *widget;
- AtkObject *obj;
- gint index;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return NULL;
-
- if (i != 0)
- return NULL;
-
- combo_box = GTK_COMBO_BOX (widget);
-
- obj = gtk_combo_box_get_popup_accessible (combo_box);
- index = gtk_combo_box_get_active (combo_box);
-
- return atk_object_ref_accessible_child (obj, index);
-}
-
-static gint
-gtk_combo_box_accessible_get_selection_count (AtkSelection *selection)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return 0;
-
- return (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)) == -1) ? 0 : 1;
-}
-
-static gboolean
-gtk_combo_box_accessible_is_child_selected (AtkSelection *selection,
- gint i)
-{
- GtkWidget *widget;
- gint j;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
-
- if (widget == NULL)
- return FALSE;
-
- j = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
-
- return (j == i);
-}
-
-static gboolean
-gtk_combo_box_accessible_remove_selection (AtkSelection *selection,
- gint i)
-{
- if (atk_selection_is_child_selected (selection, i))
- atk_selection_clear_selection (selection);
-
- return TRUE;
-}
-
-static void
-atk_selection_interface_init (AtkSelectionIface *iface)
-{
- iface->add_selection = gtk_combo_box_accessible_add_selection;
- iface->clear_selection = gtk_combo_box_accessible_clear_selection;
- iface->ref_selection = gtk_combo_box_accessible_ref_selection;
- iface->get_selection_count = gtk_combo_box_accessible_get_selection_count;
- iface->is_child_selected = gtk_combo_box_accessible_is_child_selected;
- iface->remove_selection = gtk_combo_box_accessible_remove_selection;
-}
diff --git a/gtk/a11y/gtkcomboboxaccessible.h b/gtk/a11y/gtkcomboboxaccessible.h
deleted file mode 100644
index 4ce10b1e8b..0000000000
--- a/gtk/a11y/gtkcomboboxaccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2004 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 .
- */
-
-#ifndef __GTK_COMBO_BOX_ACCESSIBLE_H__
-#define __GTK_COMBO_BOX_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_COMBO_BOX_ACCESSIBLE (gtk_combo_box_accessible_get_type ())
-#define GTK_COMBO_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO_BOX_ACCESSIBLE, GtkComboBoxAccessible))
-#define GTK_COMBO_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMBO_BOX_ACCESSIBLE, GtkComboBoxAccessibleClass))
-#define GTK_IS_COMBO_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO_BOX_ACCESSIBLE))
-#define GTK_IS_COMBO_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO_BOX_ACCESSIBLE))
-#define GTK_COMBO_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO_BOX_ACCESSIBLE, GtkComboBoxAccessibleClass))
-
-typedef struct _GtkComboBoxAccessible GtkComboBoxAccessible;
-typedef struct _GtkComboBoxAccessibleClass GtkComboBoxAccessibleClass;
-typedef struct _GtkComboBoxAccessiblePrivate GtkComboBoxAccessiblePrivate;
-
-struct _GtkComboBoxAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkComboBoxAccessiblePrivate *priv;
-};
-
-struct _GtkComboBoxAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_combo_box_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_COMBO_BOX_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkcompositeaccessible.c b/gtk/a11y/gtkcompositeaccessible.c
deleted file mode 100644
index 8e8a6297b3..0000000000
--- a/gtk/a11y/gtkcompositeaccessible.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2020 Red Hat, 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 "gtkcompositeaccessible.h"
-
-#include
-
-#include "gtkwidgetprivate.h"
-
-G_DEFINE_TYPE (GtkCompositeAccessible, gtk_composite_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static int
-gtk_composite_accessible_get_n_children (AtkObject *obj)
-{
- GtkWidget *widget;
- GtkWidget *child;
- int count = 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return 0;
-
- for (child = gtk_widget_get_first_child (widget); child; child = gtk_widget_get_next_sibling (child))
- count++;
-
- return count;
-}
-
-static AtkObject *
-gtk_composite_accessible_ref_child (AtkObject *obj,
- int i)
-{
- GtkWidget *widget;
- GtkWidget *child;
- int pos;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- for (child = gtk_widget_get_first_child (widget), pos = 0; child && pos < i; child = gtk_widget_get_next_sibling (child), pos++);
-
- if (child)
- return g_object_ref (gtk_widget_get_accessible (GTK_WIDGET (child)));
-
- return NULL;
-}
-
-static void
-gtk_composite_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_composite_accessible_parent_class)->initialize (obj, data);
-
- obj->role = ATK_ROLE_FILLER;
-}
-
-static void
-gtk_composite_accessible_class_init (GtkCompositeAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->initialize = gtk_composite_accessible_initialize;
- class->get_n_children = gtk_composite_accessible_get_n_children;
- class->ref_child = gtk_composite_accessible_ref_child;
-}
-
-static void
-gtk_composite_accessible_init (GtkCompositeAccessible *composite)
-{
-}
diff --git a/gtk/a11y/gtkcompositeaccessible.h b/gtk/a11y/gtkcompositeaccessible.h
deleted file mode 100644
index bc6a2bbafc..0000000000
--- a/gtk/a11y/gtkcompositeaccessible.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2020 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, see .
- */
-
-#ifndef __GTK_COMPOSITE_ACCESSIBLE_H__
-#define __GTK_COMPOSITE_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_COMPOSITE_ACCESSIBLE (gtk_composite_accessible_get_type ())
-#define GTK_COMPOSITE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMPOSITE_ACCESSIBLE, GtkCompositeAccessible))
-#define GTK_COMPOSITE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMPOSITE_ACCESSIBLE, GtkCompositeAccessibleClass))
-#define GTK_IS_COMPOSITE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMPOSITE_ACCESSIBLE))
-#define GTK_IS_COMPOSITE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMPOSITE_ACCESSIBLE))
-#define GTK_COMPOSITE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMPOSITE_ACCESSIBLE, GtkCompositeAccessibleClass))
-
-typedef struct _GtkCompositeAccessible GtkCompositeAccessible;
-typedef struct _GtkCompositeAccessibleClass GtkCompositeAccessibleClass;
-
-struct _GtkCompositeAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkCompositeAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_composite_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_COMPOSITE_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkcontainercellaccessible.c b/gtk/a11y/gtkcontainercellaccessible.c
deleted file mode 100644
index a756e3cadf..0000000000
--- a/gtk/a11y/gtkcontainercellaccessible.c
+++ /dev/null
@@ -1,180 +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 "gtkcontainercellaccessible.h"
-#include "gtkcellaccessibleprivate.h"
-
-struct _GtkContainerCellAccessiblePrivate
-{
- GList *children;
- gint n_children;
-};
-
-G_DEFINE_TYPE_WITH_PRIVATE (GtkContainerCellAccessible, gtk_container_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
-
-
-static void
-gtk_container_cell_accessible_finalize (GObject *obj)
-{
- GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
-
- g_list_free_full (container->priv->children, g_object_unref);
-
- G_OBJECT_CLASS (gtk_container_cell_accessible_parent_class)->finalize (obj);
-}
-
-
-static gint
-gtk_container_cell_accessible_get_n_children (AtkObject *obj)
-{
- GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
-
- return cell->priv->n_children;
-}
-
-static AtkObject *
-gtk_container_cell_accessible_ref_child (AtkObject *obj,
- gint child)
-{
- GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
- GList *l;
-
- l = g_list_nth (cell->priv->children, child);
- if (l == NULL)
- return NULL;
-
- return g_object_ref (ATK_OBJECT (l->data));
-}
-
-static void
-gtk_container_cell_accessible_update_cache (GtkCellAccessible *cell,
- gboolean emit_signal)
-{
- GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (cell);
- GList *l;
-
- for (l = container->priv->children; l; l = l->next)
- _gtk_cell_accessible_update_cache (l->data, emit_signal);
-}
-
-static void
-gtk_container_cell_widget_set (GtkAccessible *accessible)
-{
- GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible);
- GList *l;
-
- for (l = container->priv->children; l; l = l->next)
- gtk_accessible_set_widget (l->data, gtk_accessible_get_widget (accessible));
-
- GTK_ACCESSIBLE_CLASS (gtk_container_cell_accessible_parent_class)->widget_set (accessible);
-}
-
-static void
-gtk_container_cell_widget_unset (GtkAccessible *accessible)
-{
- GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible);
- GList *l;
-
- for (l = container->priv->children; l; l = l->next)
- gtk_accessible_set_widget (l->data, NULL);
-
- GTK_ACCESSIBLE_CLASS (gtk_container_cell_accessible_parent_class)->widget_unset (accessible);
-}
-
-static void
-gtk_container_cell_accessible_class_init (GtkContainerCellAccessibleClass *klass)
-{
- GtkCellAccessibleClass *cell_class = GTK_CELL_ACCESSIBLE_CLASS (klass);
- GtkAccessibleClass *accessible_class = GTK_ACCESSIBLE_CLASS (klass);
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
- GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
-
- g_object_class->finalize = gtk_container_cell_accessible_finalize;
-
- class->get_n_children = gtk_container_cell_accessible_get_n_children;
- class->ref_child = gtk_container_cell_accessible_ref_child;
-
- accessible_class->widget_set = gtk_container_cell_widget_set;
- accessible_class->widget_unset = gtk_container_cell_widget_unset;
-
- cell_class->update_cache = gtk_container_cell_accessible_update_cache;
-}
-
-static void
-gtk_container_cell_accessible_init (GtkContainerCellAccessible *cell)
-{
- cell->priv = gtk_container_cell_accessible_get_instance_private (cell);
-}
-
-GtkContainerCellAccessible *
-gtk_container_cell_accessible_new (void)
-{
- GObject *object;
-
- object = g_object_new (GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, NULL);
-
- ATK_OBJECT (object)->role = ATK_ROLE_TABLE_CELL;
-
- return GTK_CONTAINER_CELL_ACCESSIBLE (object);
-}
-
-void
-gtk_container_cell_accessible_add_child (GtkContainerCellAccessible *container,
- GtkCellAccessible *child)
-{
- g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
-
- g_object_ref (child);
-
- container->priv->n_children++;
- container->priv->children = g_list_append (container->priv->children, child);
- atk_object_set_parent (ATK_OBJECT (child), ATK_OBJECT (container));
-}
-
-void
-gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *container,
- GtkCellAccessible *child)
-{
- g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
- g_return_if_fail (container->priv->n_children > 0);
-
- container->priv->children = g_list_remove (container->priv->children, child);
- container->priv->n_children--;
-
- g_object_unref (child);
-}
-
-/**
- * gtk_container_cell_accessible_get_children:
- * @container: the container
- *
- * Get a list of children.
- *
- * Returns: (transfer none) (element-type Gtk.CellAccessible)
- */
-GList *
-gtk_container_cell_accessible_get_children (GtkContainerCellAccessible *container)
-{
- g_return_val_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container), NULL);
-
- return container->priv->children;
-}
diff --git a/gtk/a11y/gtkcontainercellaccessible.h b/gtk/a11y/gtkcontainercellaccessible.h
deleted file mode 100644
index d05d8b19e0..0000000000
--- a/gtk/a11y/gtkcontainercellaccessible.h
+++ /dev/null
@@ -1,69 +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 .
- */
-
-#ifndef __GTK_CONTAINER_CELL_ACCESSIBLE_H__
-#define __GTK_CONTAINER_CELL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_CONTAINER_CELL_ACCESSIBLE (gtk_container_cell_accessible_get_type ())
-#define GTK_CONTAINER_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, GtkContainerCellAccessible))
-#define GTK_CONTAINER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, GtkContainerCellAccessibleClass))
-#define GTK_IS_CONTAINER_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE))
-#define GTK_IS_CONTAINER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE))
-#define GTK_CONTAINER_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, GtkContainerCellAccessibleClass))
-
-typedef struct _GtkContainerCellAccessible GtkContainerCellAccessible;
-typedef struct _GtkContainerCellAccessibleClass GtkContainerCellAccessibleClass;
-typedef struct _GtkContainerCellAccessiblePrivate GtkContainerCellAccessiblePrivate;
-
-struct _GtkContainerCellAccessible
-{
- GtkCellAccessible parent;
-
- GtkContainerCellAccessiblePrivate *priv;
-};
-
-struct _GtkContainerCellAccessibleClass
-{
- GtkCellAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_container_cell_accessible_get_type (void);
-
-GDK_AVAILABLE_IN_ALL
-GtkContainerCellAccessible *gtk_container_cell_accessible_new (void);
-GDK_AVAILABLE_IN_ALL
-void gtk_container_cell_accessible_add_child (GtkContainerCellAccessible *container,
- GtkCellAccessible *child);
-GDK_AVAILABLE_IN_ALL
-void gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *container,
- GtkCellAccessible *child);
-GDK_AVAILABLE_IN_ALL
-GList *gtk_container_cell_accessible_get_children (GtkContainerCellAccessible *container);
-
-G_END_DECLS
-
-#endif /* __GTK_CONTAINER_CELL_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c
deleted file mode 100644
index f8a874833c..0000000000
--- a/gtk/a11y/gtkentryaccessible.c
+++ /dev/null
@@ -1,1537 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 "gtkentryaccessible.h"
-
-#include "gtkcomboboxaccessible.h"
-
-#include "gtkentryprivate.h"
-#include "gtklabel.h"
-#include "gtkpango.h"
-#include "gtkstylecontextprivate.h"
-#include "gtktextprivate.h"
-#include "gtkwidgetprivate.h"
-
-#include "gdk/gdkeventsprivate.h"
-
-#include
-#include
-
-#define GTK_TYPE_ENTRY_ICON_ACCESSIBLE (gtk_entry_icon_accessible_get_type ())
-#define GTK_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
-#define GTK_IS_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE))
-
-struct _GtkEntryAccessiblePrivate
-{
- gint cursor_position;
- gint selection_bound;
- AtkObject *icons[2];
-};
-
-typedef struct _GtkEntryIconAccessible GtkEntryIconAccessible;
-typedef struct _GtkEntryIconAccessibleClass GtkEntryIconAccessibleClass;
-
-struct _GtkEntryIconAccessible
-{
- AtkObject parent;
-
- GtkEntryAccessible *entry;
- GtkEntryIconPosition pos;
-};
-
-struct _GtkEntryIconAccessibleClass
-{
- AtkObjectClass parent_class;
-};
-
-static void icon_atk_action_interface_init (AtkActionIface *iface);
-static void icon_atk_component_interface_init (AtkComponentIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkEntryIconAccessible, gtk_entry_icon_accessible, ATK_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, icon_atk_action_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, icon_atk_component_interface_init))
-
-static void
-gtk_entry_icon_accessible_remove_entry (gpointer data, GObject *obj)
-{
- GtkEntryIconAccessible *icon = data;
-
- if (icon->entry)
- {
- icon->entry = NULL;
- g_object_notify (G_OBJECT (icon), "accessible-parent");
- atk_object_notify_state_change (ATK_OBJECT (icon), ATK_STATE_DEFUNCT, TRUE);
- }
-}
-
-static AtkObject *
-gtk_entry_icon_accessible_new (GtkEntryAccessible *entry,
- GtkEntryIconPosition pos)
-{
- GtkEntryIconAccessible *icon;
- AtkObject *accessible;
-
- icon = g_object_new (gtk_entry_icon_accessible_get_type (), NULL);
- icon->entry = entry;
- g_object_weak_ref (G_OBJECT (entry),
- gtk_entry_icon_accessible_remove_entry,
- icon);
- icon->pos = pos;
-
- accessible = ATK_OBJECT (icon);
- atk_object_initialize (accessible, NULL);
- return accessible;
-}
-
-static void
-gtk_entry_icon_accessible_init (GtkEntryIconAccessible *icon)
-{
-}
-
-static void
-gtk_entry_icon_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (obj);
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- GtkEntry *gtk_entry = GTK_ENTRY (widget);
- const gchar *name;
- gchar *text;
-
- ATK_OBJECT_CLASS (gtk_entry_icon_accessible_parent_class)->initialize (obj, data);
- atk_object_set_role (obj, ATK_ROLE_ICON);
-
- name = gtk_entry_get_icon_name (gtk_entry, icon->pos);
- if (name)
- atk_object_set_name (obj, name);
-
- text = gtk_entry_get_icon_tooltip_text (gtk_entry, icon->pos);
- if (text)
- {
- atk_object_set_description (obj, text);
- g_free (text);
- }
-
- atk_object_set_parent (obj, ATK_OBJECT (icon->entry));
-}
-
-static AtkObject *
-gtk_entry_icon_accessible_get_parent (AtkObject *accessible)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
-
- return ATK_OBJECT (icon->entry);
-}
-
-static AtkStateSet *
-gtk_entry_icon_accessible_ref_state_set (AtkObject *accessible)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
- AtkStateSet *set = atk_state_set_new ();
- AtkStateSet *entry_set;
- GtkWidget *widget;
- GtkEntry *gtk_entry;
-
- if (!icon->entry)
- {
- atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
- return set;
- }
-
- entry_set = atk_object_ref_state_set (ATK_OBJECT (icon->entry));
- if (!entry_set || atk_state_set_contains_state (entry_set, ATK_STATE_DEFUNCT))
- {
- atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
- g_clear_object (&entry_set);
- return set;
- }
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- gtk_entry = GTK_ENTRY (widget);
-
- if (atk_state_set_contains_state (entry_set, ATK_STATE_ENABLED))
- atk_state_set_add_state (set, ATK_STATE_ENABLED);
- if (atk_state_set_contains_state (entry_set, ATK_STATE_SENSITIVE))
- atk_state_set_add_state (set, ATK_STATE_SENSITIVE);
- if (atk_state_set_contains_state (entry_set, ATK_STATE_SHOWING))
- atk_state_set_add_state (set, ATK_STATE_SHOWING);
- if (atk_state_set_contains_state (entry_set, ATK_STATE_VISIBLE))
- atk_state_set_add_state (set, ATK_STATE_VISIBLE);
-
- if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos))
- atk_state_set_remove_state (set, ATK_STATE_SENSITIVE);
- if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
- atk_state_set_remove_state (set, ATK_STATE_ENABLED);
-
- g_object_unref (entry_set);
- return set;
-}
-
-static void
-gtk_entry_icon_accessible_invalidate (GtkEntryIconAccessible *icon)
-{
- if (!icon->entry)
- return;
- g_object_weak_unref (G_OBJECT (icon->entry),
- gtk_entry_icon_accessible_remove_entry,
- icon);
- gtk_entry_icon_accessible_remove_entry (icon, NULL);
-}
-
-static void
-gtk_entry_icon_accessible_finalize (GObject *object)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (object);
-
- gtk_entry_icon_accessible_invalidate (icon);
-
- G_OBJECT_CLASS (gtk_entry_icon_accessible_parent_class)->finalize (object);
-}
-
-static void
-gtk_entry_icon_accessible_class_init (GtkEntryIconAccessibleClass *klass)
-{
- AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
- atk_class->initialize = gtk_entry_icon_accessible_initialize;
- atk_class->get_parent = gtk_entry_icon_accessible_get_parent;
- atk_class->ref_state_set = gtk_entry_icon_accessible_ref_state_set;
-
- gobject_class->finalize = gtk_entry_icon_accessible_finalize;
-}
-
-static gboolean
-gtk_entry_icon_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkEntryIconAccessible *icon = (GtkEntryIconAccessible *)action;
- GtkWidget *widget;
- GtkEntry *gtk_entry;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- if (widget == NULL)
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- gtk_entry = GTK_ENTRY (widget);
-
- if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos) ||
- !gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
- return FALSE;
-
- g_signal_emit_by_name (widget, "icon-press", 0, icon->pos);
- return TRUE;
-}
-
-static gint
-gtk_entry_icon_accessible_get_n_actions (AtkAction *action)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- GtkEntry *gtk_entry = GTK_ENTRY (widget);
-
- return (gtk_entry_get_icon_activatable (gtk_entry, icon->pos) ? 1 : 0);
-}
-
-static const gchar *
-gtk_entry_icon_accessible_get_name (AtkAction *action,
- gint i)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- GtkEntry *gtk_entry = GTK_ENTRY (widget);
-
- if (i != 0)
- return NULL;
- if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
- return NULL;
-
- return "activate";
-}
-
-static void
-icon_atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_entry_icon_accessible_do_action;
- iface->get_n_actions = gtk_entry_icon_accessible_get_n_actions;
- iface->get_name = gtk_entry_icon_accessible_get_name;
-}
-
-static void
-gtk_entry_icon_accessible_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
- GdkRectangle icon_area;
- GtkEntry *gtk_entry;
- GtkWidget *widget;
-
- *x = G_MININT;
- atk_component_get_extents (ATK_COMPONENT (icon->entry), x, y, width, height,
- coord_type);
- if (*x == G_MININT)
- return;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- gtk_entry = GTK_ENTRY (widget);
- gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
- *width = icon_area.width;
- *height = icon_area.height;
- *x += icon_area.x;
- *y += icon_area.y;
-}
-
-static void
-gtk_entry_icon_accessible_get_position (AtkComponent *component,
- gint *x,
- gint *y,
- AtkCoordType coord_type)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
- GdkRectangle icon_area;
- GtkEntry *gtk_entry;
- GtkWidget *widget;
-
- *x = G_MININT;
- atk_component_get_extents (ATK_COMPONENT (icon->entry), x, y, NULL, NULL,
- coord_type);
- if (*x == G_MININT)
- return;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- gtk_entry = GTK_ENTRY (widget);
- gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
- *x += icon_area.x;
- *y += icon_area.y;
-}
-
-static void
-gtk_entry_icon_accessible_get_size (AtkComponent *component,
- gint *width,
- gint *height)
-{
- GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
- GdkRectangle icon_area;
- GtkEntry *gtk_entry;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
- gtk_entry = GTK_ENTRY (widget);
- gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
- *width = icon_area.width;
- *height = icon_area.height;
-}
-
-static void
-icon_atk_component_interface_init (AtkComponentIface *iface)
-{
- iface->get_extents = gtk_entry_icon_accessible_get_extents;
- iface->get_size = gtk_entry_icon_accessible_get_size;
- iface->get_position = gtk_entry_icon_accessible_get_position;
-}
-
-/* Callbacks */
-static gboolean check_for_selection_change (GtkEntryAccessible *entry,
- GtkEditable *editable);
-
-
-static void atk_editable_text_interface_init (AtkEditableTextIface *iface);
-static void atk_text_interface_init (AtkTextIface *iface);
-static void atk_action_interface_init (AtkActionIface *iface);
-
-
-G_DEFINE_TYPE_WITH_CODE (GtkEntryAccessible, gtk_entry_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkEntryAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static GtkText *
-get_text (AtkText *atk_text)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return NULL;
-
- return gtk_entry_get_text_widget (GTK_ENTRY (widget));
-}
-
-static gboolean
-check_for_selection_change (GtkEntryAccessible *accessible,
- GtkEditable *editable)
-{
- gboolean ret_val = FALSE;
- gint start, end;
-
- if (gtk_editable_get_selection_bounds (editable, &start, &end))
- {
- if (end != accessible->priv->cursor_position ||
- start != accessible->priv->selection_bound)
- /*
- * This check is here as this function can be called
- * for notification of selection_bound and current_pos.
- * The values of current_pos and selection_bound may be the same
- * for both notifications and we only want to generate one
- * text_selection_changed signal.
- */
- ret_val = TRUE;
- }
- else
- {
- /* We had a selection */
- ret_val = (accessible->priv->cursor_position != accessible->priv->selection_bound);
- }
-
- accessible->priv->cursor_position = end;
- accessible->priv->selection_bound = start;
-
- return ret_val;
-}
-
-static void
-insert_text_cb (GtkEditable *editable,
- gchar *new_text,
- gint new_text_length,
- gint *position,
- GtkEntryAccessible *self)
-{
- int length;
-
- if (new_text_length == 0)
- return;
-
- length = g_utf8_strlen (new_text, new_text_length);
-
- g_signal_emit_by_name (self,
- "text-changed::insert",
- *position - length,
- length);
-}
-
-/* We connect to GtkEditable::delete-text, since it carries
- * the information we need. But we delay emitting our own
- * text_changed::delete signal until the entry has update
- * all its internal state and emits GtkEntry::changed.
- */
-static void
-delete_text_cb (GtkEditable *editable,
- gint start,
- gint end,
- GtkEntryAccessible *self)
-{
- GtkText *textw;
-
- textw = get_text (ATK_TEXT (self));
- if (textw == NULL)
- return;
-
- if (end < 0)
- {
- gchar *text;
-
- text = gtk_text_get_display_text (textw, 0, -1);
- end = g_utf8_strlen (text, -1);
- g_free (text);
- }
-
- if (end == start)
- return;
-
- g_signal_emit_by_name (self,
- "text-changed::delete",
- start,
- end - start);
-}
-
-static void
-on_notify (GObject *gobject,
- GParamSpec *pspec,
- GtkEntryAccessible *self)
-{
- GtkWidget *widget;
- AtkObject* atk_obj;
- GtkEntryAccessiblePrivate *priv;
-
- widget = GTK_WIDGET (gobject);
- atk_obj = gtk_widget_get_accessible (widget);
- priv = gtk_entry_accessible_get_instance_private (self);
-
- if (g_strcmp0 (pspec->name, "cursor-position") == 0)
- {
- if (check_for_selection_change (self, GTK_EDITABLE (widget)))
- g_signal_emit_by_name (atk_obj, "text-selection-changed");
- /*
- * The entry cursor position has moved so generate the signal.
- */
- g_signal_emit_by_name (atk_obj, "text-caret-moved",
- gtk_editable_get_position (GTK_EDITABLE (widget)));
- }
- else if (g_strcmp0 (pspec->name, "selection-bound") == 0)
- {
- if (check_for_selection_change (self, GTK_EDITABLE (widget)))
- g_signal_emit_by_name (atk_obj, "text-selection-changed");
- }
- else if (g_strcmp0 (pspec->name, "editable") == 0)
- {
- gboolean value;
-
- g_object_get (gobject, "editable", &value, NULL);
- atk_object_notify_state_change (atk_obj, ATK_STATE_EDITABLE, value);
- }
- else if (g_strcmp0 (pspec->name, "visibility") == 0)
- {
- gboolean visibility;
- AtkRole new_role;
-
- visibility = gtk_entry_get_visibility (GTK_ENTRY (widget));
- new_role = visibility ? ATK_ROLE_TEXT : ATK_ROLE_PASSWORD_TEXT;
- atk_object_set_role (atk_obj, new_role);
- }
- else if (g_strcmp0 (pspec->name, "primary-icon-storage-type") == 0)
- {
- if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY &&
- !priv->icons[GTK_ENTRY_ICON_PRIMARY])
- {
- priv->icons[GTK_ENTRY_ICON_PRIMARY] = gtk_entry_icon_accessible_new (self, GTK_ENTRY_ICON_PRIMARY);
- g_signal_emit_by_name (self, "children-changed::add", 0,
- priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
- }
- else if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY &&
- priv->icons[GTK_ENTRY_ICON_PRIMARY])
- {
- gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_PRIMARY]));
- g_signal_emit_by_name (self, "children-changed::remove", 0,
- priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
- g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
- }
- }
- else if (g_strcmp0 (pspec->name, "secondary-icon-storage-type") == 0)
- {
- gint index = (priv->icons[GTK_ENTRY_ICON_PRIMARY] ? 1 : 0);
- if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY &&
- !priv->icons[GTK_ENTRY_ICON_SECONDARY])
- {
- priv->icons[GTK_ENTRY_ICON_SECONDARY] = gtk_entry_icon_accessible_new (self, GTK_ENTRY_ICON_SECONDARY);
- g_signal_emit_by_name (self, "children-changed::add", index,
- priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
- }
- else if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY &&
- priv->icons[GTK_ENTRY_ICON_SECONDARY])
- {
- gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_SECONDARY]));
- g_signal_emit_by_name (self, "children-changed::remove", index,
- priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
- g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
- }
- }
- else if (g_strcmp0 (pspec->name, "primary-icon-name") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
- {
- const gchar *name;
- name = gtk_entry_get_icon_name (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY);
- if (name)
- atk_object_set_name (priv->icons[GTK_ENTRY_ICON_PRIMARY], name);
- }
- }
- else if (g_strcmp0 (pspec->name, "secondary-icon-name") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
- {
- const gchar *name;
- name = gtk_entry_get_icon_name (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY);
- if (name)
- atk_object_set_name (priv->icons[GTK_ENTRY_ICON_SECONDARY], name);
- }
- }
- else if (g_strcmp0 (pspec->name, "primary-icon-tooltip-text") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
- {
- gchar *text;
- text = gtk_entry_get_icon_tooltip_text (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY);
- if (text)
- {
- atk_object_set_description (priv->icons[GTK_ENTRY_ICON_PRIMARY], text);
- g_free (text);
- }
- else
- {
- atk_object_set_description (priv->icons[GTK_ENTRY_ICON_PRIMARY], "");
- }
- }
- }
- else if (g_strcmp0 (pspec->name, "secondary-icon-tooltip-text") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
- {
- gchar *text;
- text = gtk_entry_get_icon_tooltip_text (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY);
- if (text)
- {
- atk_object_set_description (priv->icons[GTK_ENTRY_ICON_SECONDARY], text);
- g_free (text);
- }
- else
- {
- atk_object_set_description (priv->icons[GTK_ENTRY_ICON_SECONDARY], "");
- }
- }
- }
- else if (g_strcmp0 (pspec->name, "primary-icon-activatable") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
- {
- gboolean on = gtk_entry_get_icon_activatable (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY);
- atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
- ATK_STATE_ENABLED, on);
- }
- }
- else if (g_strcmp0 (pspec->name, "secondary-icon-activatable") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
- {
- gboolean on = gtk_entry_get_icon_activatable (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY);
- atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
- ATK_STATE_ENABLED, on);
- }
- }
- else if (g_strcmp0 (pspec->name, "primary-icon-sensitive") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
- {
- gboolean on = gtk_entry_get_icon_sensitive (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY);
- atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
- ATK_STATE_SENSITIVE, on);
- }
- }
- else if (g_strcmp0 (pspec->name, "secondary-icon-sensitive") == 0)
- {
- if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
- {
- gboolean on = gtk_entry_get_icon_sensitive (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY);
- atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
- ATK_STATE_SENSITIVE, on);
- }
- }
-}
-
-static AtkStateSet *
-gtk_entry_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- gboolean value;
- GtkWidget *widget;
- GtkWidget *text;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- text = gtk_widget_get_first_child (widget);
-
- state_set = ATK_OBJECT_CLASS (gtk_entry_accessible_parent_class)->ref_state_set (accessible);
-
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
- if (gtk_widget_has_focus (text))
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
-
- g_object_get (G_OBJECT (widget), "editable", &value, NULL);
- if (value)
- atk_state_set_add_state (state_set, ATK_STATE_EDITABLE);
- atk_state_set_add_state (state_set, ATK_STATE_SINGLE_LINE);
-
- return state_set;
-}
-
-static AtkAttributeSet *
-gtk_entry_accessible_get_attributes (AtkObject *accessible)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
- AtkAttribute *placeholder_text;
- char *text = NULL;
-
- attributes = ATK_OBJECT_CLASS (gtk_entry_accessible_parent_class)->get_attributes (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return attributes;
-
- g_object_get (widget, "placeholder-text", &text, NULL);
- if (text == NULL)
- return attributes;
-
- placeholder_text = g_malloc (sizeof (AtkAttribute));
- placeholder_text->name = g_strdup ("placeholder-text");
- placeholder_text->value = text;
-
- attributes = g_slist_append (attributes, placeholder_text);
-
- return attributes;
-}
-
-static void
-gtk_entry_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkWidget *widget;
- GtkEntryAccessible *gtk_entry_accessible;
- gint start_pos, end_pos;
-
- ATK_OBJECT_CLASS (gtk_entry_accessible_parent_class)->initialize (obj, data);
-
- gtk_entry_accessible = GTK_ENTRY_ACCESSIBLE (obj);
-
- widget = GTK_WIDGET (data);
- gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start_pos, &end_pos);
- gtk_entry_accessible->priv->cursor_position = end_pos;
- gtk_entry_accessible->priv->selection_bound = start_pos;
-
- /* Set up signal callbacks */
- g_signal_connect_after (widget, "insert-text", G_CALLBACK (insert_text_cb), obj);
- g_signal_connect (widget, "delete-text", G_CALLBACK (delete_text_cb), obj);
- g_signal_connect (widget, "notify", G_CALLBACK (on_notify), obj);
-}
-
-static gint
-gtk_entry_accessible_get_index_in_parent (AtkObject *accessible)
-{
- /*
- * If the parent widget is a combo box then the index is 1
- * otherwise do the normal thing.
- */
- if (accessible->accessible_parent)
- if (GTK_IS_COMBO_BOX_ACCESSIBLE (accessible->accessible_parent))
- return 1;
-
- return ATK_OBJECT_CLASS (gtk_entry_accessible_parent_class)->get_index_in_parent (accessible);
-}
-
-static gint
-gtk_entry_accessible_get_n_children (AtkObject* obj)
-{
- GtkWidget *widget;
- gint count = 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return 0;
-
- if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
- count++;
- if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
- count++;
-
- return count;
-}
-
-static AtkObject *
-gtk_entry_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- GtkEntryAccessible *accessible = GTK_ENTRY_ACCESSIBLE (obj);
- GtkEntryAccessiblePrivate *priv = accessible->priv;
- GtkWidget *widget;
- GtkEntryIconPosition pos;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- switch (i)
- {
- case 0:
- if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
- pos = GTK_ENTRY_ICON_PRIMARY;
- else if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
- pos = GTK_ENTRY_ICON_SECONDARY;
- else
- return NULL;
- break;
- case 1:
- if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY)
- return NULL;
- if (gtk_entry_get_icon_storage_type (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
- return NULL;
- pos = GTK_ENTRY_ICON_SECONDARY;
- break;
- default:
- return NULL;
- }
-
- if (!priv->icons[pos])
- priv->icons[pos] = gtk_entry_icon_accessible_new (accessible, pos);
- return g_object_ref (priv->icons[pos]);
-}
-
-static void
-gtk_entry_accessible_finalize (GObject *object)
-{
- GtkEntryAccessible *entry = GTK_ENTRY_ACCESSIBLE (object);
- GtkEntryAccessiblePrivate *priv = entry->priv;
-
- g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
- g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
-
- G_OBJECT_CLASS (gtk_entry_accessible_parent_class)->finalize (object);
-}
-
-static void
-gtk_entry_accessible_class_init (GtkEntryAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
- class->ref_state_set = gtk_entry_accessible_ref_state_set;
- class->get_index_in_parent = gtk_entry_accessible_get_index_in_parent;
- class->initialize = gtk_entry_accessible_initialize;
- class->get_attributes = gtk_entry_accessible_get_attributes;
- class->get_n_children = gtk_entry_accessible_get_n_children;
- class->ref_child = gtk_entry_accessible_ref_child;
-
- gobject_class->finalize = gtk_entry_accessible_finalize;
-}
-
-static void
-gtk_entry_accessible_init (GtkEntryAccessible *entry)
-{
- entry->priv = gtk_entry_accessible_get_instance_private (entry);
- entry->priv->cursor_position = 0;
- entry->priv->selection_bound = 0;
-
- ATK_OBJECT (entry)->role = ATK_ROLE_TEXT;
-}
-
-static gchar *
-gtk_entry_accessible_get_text (AtkText *atk_text,
- gint start_pos,
- gint end_pos)
-{
- GtkText *text;
-
- text = get_text (atk_text);
-
- if (text == NULL)
- return NULL;
-
- return gtk_text_get_display_text (text, start_pos, end_pos);
-}
-
-static gchar *
-gtk_entry_accessible_get_text_before_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text;
-
- text = get_text (atk_text);
-
- if (text == NULL)
- return NULL;
-
- return _gtk_pango_get_text_before (gtk_text_get_layout (text),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar *
-gtk_entry_accessible_get_text_at_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text;
-
- text = get_text (atk_text);
-
- if (text == NULL)
- return NULL;
-
- return _gtk_pango_get_text_at (gtk_text_get_layout (text),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar *
-gtk_entry_accessible_get_text_after_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text;
-
- text = get_text (atk_text);
-
- if (text == NULL)
- return NULL;
-
- return _gtk_pango_get_text_after (gtk_text_get_layout (text),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gint
-gtk_entry_accessible_get_character_count (AtkText *atk_text)
-{
- GtkText *text;
- char *display_text;
- int char_count;
-
- text = get_text (atk_text);
-
- if (text == NULL)
- return 0;
-
- display_text = gtk_text_get_display_text (text, 0, -1);
-
- char_count = 0;
- if (display_text)
- {
- char_count = g_utf8_strlen (display_text, -1);
- g_free (display_text);
- }
-
- return char_count;
-}
-
-static gint
-gtk_entry_accessible_get_caret_offset (AtkText *text)
-{
- GtkWidget *widget;
- gboolean result;
- int cursor_position;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return -1;
-
- result = gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), NULL, &cursor_position);
- if (!result)
- return -1;
-
- return cursor_position;
-}
-
-static gboolean
-gtk_entry_accessible_set_caret_offset (AtkText *text,
- gint offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- gtk_editable_set_position (GTK_EDITABLE (widget), offset);
-
- return TRUE;
-}
-
-static AtkAttributeSet *
-add_text_attribute (AtkAttributeSet *attributes,
- AtkTextAttribute attr,
- gint i)
-{
- AtkAttribute *at;
-
- at = g_new (AtkAttribute, 1);
- at->name = g_strdup (atk_text_attribute_get_name (attr));
- at->value = g_strdup (atk_text_attribute_get_value (attr, i));
-
- return g_slist_prepend (attributes, at);
-}
-
-static AtkAttributeSet *
-gtk_entry_accessible_get_run_attributes (AtkText *atk_text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text;
- AtkAttributeSet *attributes;
-
- text = get_text (atk_text);
-
- if (text == NULL)
- return NULL;
-
- attributes = NULL;
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (GTK_WIDGET (text)));
- attributes = _gtk_pango_get_run_attributes (attributes,
- gtk_text_get_layout (text),
- offset,
- start_offset,
- end_offset);
-
- return attributes;
-}
-
-static AtkAttributeSet *
-gtk_entry_accessible_get_default_attributes (AtkText *atk_text)
-{
- GtkText *text;
- AtkAttributeSet *attributes;
-
- text = get_text (atk_text);
-
- if (text == NULL)
- return NULL;
-
- attributes = NULL;
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (GTK_WIDGET (text)));
- attributes = _gtk_pango_get_default_attributes (attributes,
- gtk_text_get_layout (text));
- attributes = _gtk_style_context_get_attributes (attributes,
- gtk_widget_get_style_context (GTK_WIDGET (text)));
-
- return attributes;
-}
-
-static void
-gtk_entry_accessible_get_character_extents (AtkText *atk_text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- GtkText *textw;
- PangoRectangle char_rect;
- gchar *entry_text;
- gint index, x_layout, y_layout;
- GtkAllocation allocation;
-
- textw = get_text (atk_text);
-
- if (textw == NULL)
- return;
-
- gtk_text_get_layout_offsets (textw, &x_layout, &y_layout);
- entry_text = gtk_text_get_display_text (textw, 0, -1);
- index = g_utf8_offset_to_pointer (entry_text, offset) - entry_text;
- g_free (entry_text);
-
- pango_layout_index_to_pos (gtk_text_get_layout (textw), index, &char_rect);
- pango_extents_to_pixels (&char_rect, NULL);
-
- gtk_widget_get_allocation (GTK_WIDGET (textw), &allocation);
-
- *x = allocation.x + x_layout + char_rect.x;
- *y = allocation.y + y_layout + char_rect.y;
- *width = char_rect.width;
- *height = char_rect.height;
-}
-
-static gint
-gtk_entry_accessible_get_offset_at_point (AtkText *atk_text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- GtkText *textw;
- gchar *text;
- gint index, x_layout, y_layout;
- gint x_local, y_local;
- glong offset;
-
- textw = get_text (atk_text);
-
- if (textw == NULL)
- return 1;
-
- gtk_text_get_layout_offsets (textw, &x_layout, &y_layout);
-
- x_local = x - x_layout;
- y_local = y - y_layout;
-
- if (!pango_layout_xy_to_index (gtk_text_get_layout (textw),
- x_local * PANGO_SCALE,
- y_local * PANGO_SCALE,
- &index, NULL))
- {
- if (x_local < 0 || y_local < 0)
- index = 0;
- else
- index = -1;
- }
-
- offset = -1;
- if (index != -1)
- {
- text = gtk_text_get_display_text (textw, 0, -1);
- offset = g_utf8_pointer_to_offset (text, text + index);
- g_free (text);
- }
-
- return offset;
-}
-
-static gint
-gtk_entry_accessible_get_n_selections (AtkText *text)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return 0;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- return 1;
-
- return 0;
-}
-
-static gchar *
-gtk_entry_accessible_get_selection (AtkText *text,
- gint selection_num,
- gint *start_pos,
- gint *end_pos)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- if (selection_num != 0)
- return NULL;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), start_pos, end_pos))
- return gtk_editable_get_chars (GTK_EDITABLE (widget), *start_pos, *end_pos);
-
- return NULL;
-}
-
-static gboolean
-gtk_entry_accessible_add_selection (AtkText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkEntry *entry;
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- entry = GTK_ENTRY (widget);
-
- if (!gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (entry), start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_entry_accessible_remove_selection (AtkText *text,
- gint selection_num)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (widget), end, end);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_entry_accessible_set_selection (AtkText *text,
- gint selection_num,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (widget), start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gunichar
-gtk_entry_accessible_get_character_at_offset (AtkText *atk_text,
- gint offset)
-{
- GtkText *textw;
- gchar *text;
- gchar *index;
- gunichar result;
-
- result = '\0';
-
- textw = get_text (atk_text);
-
- if (textw == NULL)
- return 0;
-
- if (!gtk_text_get_visibility (textw))
- return result;
-
- text = gtk_text_get_display_text (textw, 0, -1);
- if (offset < g_utf8_strlen (text, -1))
- {
- index = g_utf8_offset_to_pointer (text, offset);
- result = g_utf8_get_char (index);
- g_free (text);
- }
-
- return result;
-}
-
-static void
-atk_text_interface_init (AtkTextIface *iface)
-{
- iface->get_text = gtk_entry_accessible_get_text;
- iface->get_character_at_offset = gtk_entry_accessible_get_character_at_offset;
- iface->get_text_before_offset = gtk_entry_accessible_get_text_before_offset;
- iface->get_text_at_offset = gtk_entry_accessible_get_text_at_offset;
- iface->get_text_after_offset = gtk_entry_accessible_get_text_after_offset;
- iface->get_caret_offset = gtk_entry_accessible_get_caret_offset;
- iface->set_caret_offset = gtk_entry_accessible_set_caret_offset;
- iface->get_character_count = gtk_entry_accessible_get_character_count;
- iface->get_n_selections = gtk_entry_accessible_get_n_selections;
- iface->get_selection = gtk_entry_accessible_get_selection;
- iface->add_selection = gtk_entry_accessible_add_selection;
- iface->remove_selection = gtk_entry_accessible_remove_selection;
- iface->set_selection = gtk_entry_accessible_set_selection;
- iface->get_run_attributes = gtk_entry_accessible_get_run_attributes;
- iface->get_default_attributes = gtk_entry_accessible_get_default_attributes;
- iface->get_character_extents = gtk_entry_accessible_get_character_extents;
- iface->get_offset_at_point = gtk_entry_accessible_get_offset_at_point;
-}
-
-static void
-gtk_entry_accessible_set_text_contents (AtkEditableText *text,
- const gchar *string)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- if (!gtk_editable_get_editable (GTK_EDITABLE (widget)))
- return;
-
- gtk_editable_set_text (GTK_EDITABLE (widget), string);
-}
-
-static void
-gtk_entry_accessible_insert_text (AtkEditableText *text,
- const gchar *string,
- gint length,
- gint *position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- gtk_editable_insert_text (editable, string, length, position);
- gtk_editable_set_position (editable, *position);
-}
-
-static void
-gtk_entry_accessible_copy_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- gchar *str;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- str = gtk_editable_get_chars (editable, start_pos, end_pos);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
- g_free (str);
-}
-
-static void
-gtk_entry_accessible_cut_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- gchar *str;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- str = gtk_editable_get_chars (editable, start_pos, end_pos);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
- gtk_editable_delete_text (editable, start_pos, end_pos);
-}
-
-static void
-gtk_entry_accessible_delete_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- gtk_editable_delete_text (editable, start_pos, end_pos);
-}
-
-typedef struct
-{
- GtkEntry* entry;
- gint position;
-} PasteData;
-
-static void
-paste_received_cb (GObject *clipboard,
- GAsyncResult *result,
- gpointer data)
-{
- PasteData *paste = data;
- char *text;
-
- text = gdk_clipboard_read_text_finish (GDK_CLIPBOARD (clipboard), result, NULL);
- if (text)
- gtk_editable_insert_text (GTK_EDITABLE (paste->entry), text, -1,
- &paste->position);
-
- g_object_unref (paste->entry);
- g_free (paste);
- g_free (text);
-}
-
-static void
-gtk_entry_accessible_paste_text (AtkEditableText *text,
- gint position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- PasteData *paste;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- paste = g_new0 (PasteData, 1);
- paste->entry = GTK_ENTRY (widget);
- paste->position = position;
-
- g_object_ref (paste->entry);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_read_text_async (clipboard, NULL, paste_received_cb, paste);
-}
-
-static void
-atk_editable_text_interface_init (AtkEditableTextIface *iface)
-{
- iface->set_text_contents = gtk_entry_accessible_set_text_contents;
- iface->insert_text = gtk_entry_accessible_insert_text;
- iface->copy_text = gtk_entry_accessible_copy_text;
- iface->cut_text = gtk_entry_accessible_cut_text;
- iface->delete_text = gtk_entry_accessible_delete_text;
- iface->paste_text = gtk_entry_accessible_paste_text;
- iface->set_run_attributes = NULL;
-}
-
-static gboolean
-gtk_entry_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- gtk_widget_activate (widget);
-
- return TRUE;
-}
-
-static gint
-gtk_entry_accessible_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_entry_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
- GtkWidget *label;
- AtkRelationSet *set;
- AtkRelation *relation;
- GPtrArray *target;
- gpointer target_object;
- guint key_val;
-
- if (i != 0)
- return NULL;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return NULL;
-
- set = atk_object_ref_relation_set (ATK_OBJECT (action));
- if (!set)
- return NULL;
-
- label = NULL;
- relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
- if (relation)
- {
- target = atk_relation_get_target (relation);
-
- target_object = g_ptr_array_index (target, 0);
- label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
- }
-
- g_object_unref (set);
-
- if (GTK_IS_LABEL (label))
- {
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
-
- return NULL;
-}
-
-static const gchar*
-gtk_entry_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return "activate";
- return NULL;
-}
-
-static const gchar*
-gtk_entry_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Activate");
- return NULL;
-}
-
-static const gchar*
-gtk_entry_accessible_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Activates the entry");
- return NULL;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_entry_accessible_do_action;
- iface->get_n_actions = gtk_entry_accessible_get_n_actions;
- iface->get_keybinding = gtk_entry_accessible_get_keybinding;
- iface->get_name = gtk_entry_accessible_action_get_name;
- iface->get_localized_name = gtk_entry_accessible_action_get_localized_name;
- iface->get_description = gtk_entry_accessible_action_get_description;
-}
diff --git a/gtk/a11y/gtkentryaccessible.h b/gtk/a11y/gtkentryaccessible.h
deleted file mode 100644
index 7b1b5b787d..0000000000
--- a/gtk/a11y/gtkentryaccessible.h
+++ /dev/null
@@ -1,60 +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 .
- */
-
-#ifndef __GTK_ENTRY_ACCESSIBLE_H__
-#define __GTK_ENTRY_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_ENTRY_ACCESSIBLE (gtk_entry_accessible_get_type ())
-#define GTK_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_ACCESSIBLE, GtkEntryAccessible))
-#define GTK_ENTRY_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ENTRY_ACCESSIBLE, GtkEntryAccessibleClass))
-#define GTK_IS_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_ACCESSIBLE))
-#define GTK_IS_ENTRY_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_ACCESSIBLE))
-#define GTK_ENTRY_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_ACCESSIBLE, GtkEntryAccessibleClass))
-
-typedef struct _GtkEntryAccessible GtkEntryAccessible;
-typedef struct _GtkEntryAccessibleClass GtkEntryAccessibleClass;
-typedef struct _GtkEntryAccessiblePrivate GtkEntryAccessiblePrivate;
-
-struct _GtkEntryAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkEntryAccessiblePrivate *priv;
-};
-
-struct _GtkEntryAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_entry_accessible_get_type (void);
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_entry_icon_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_ENTRY_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkexpanderaccessible.c b/gtk/a11y/gtkexpanderaccessible.c
deleted file mode 100644
index a4d323df15..0000000000
--- a/gtk/a11y/gtkexpanderaccessible.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2003 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 "gtkexpanderaccessibleprivate.h"
-
-#include
-#include
-
-static void atk_action_interface_init (AtkActionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkExpanderAccessible, gtk_expander_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static const gchar *
-gtk_expander_accessible_get_full_text (GtkExpander *widget)
-{
- GtkWidget *label_widget;
-
- label_widget = gtk_expander_get_label_widget (widget);
-
- if (!GTK_IS_LABEL (label_widget))
- return NULL;
-
- return gtk_label_get_text (GTK_LABEL (label_widget));
-}
-
-static const gchar *
-gtk_expander_accessible_get_name (AtkObject *obj)
-{
- GtkWidget *widget;
- const gchar *name;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_expander_accessible_parent_class)->get_name (obj);
- if (name != NULL)
- return name;
-
- return gtk_expander_accessible_get_full_text (GTK_EXPANDER (widget));
-}
-
-static gint
-gtk_expander_accessible_get_n_children (AtkObject *obj)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return 0;
-
- if (gtk_expander_get_child (GTK_EXPANDER (widget)))
- return 1;
-
- return 0;
-}
-
-static AtkObject *
-gtk_expander_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- AtkObject *accessible;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- widget = gtk_expander_get_child (GTK_EXPANDER (widget));
- if (widget == NULL)
- return NULL;
-
- accessible = gtk_widget_get_accessible (widget);
- g_object_ref (accessible);
- return accessible;
-}
-
-void
-gtk_expander_accessible_update_label (GtkExpanderAccessible *self)
-{
- AtkObject *atk_obj = ATK_OBJECT (self);
-
- if (atk_obj->name == NULL)
- g_object_notify (G_OBJECT (atk_obj), "accessible-name");
-
- g_signal_emit_by_name (atk_obj, "visible-data-changed");
-}
-
-void
-gtk_expander_accessible_update_state (GtkExpanderAccessible *self,
- gboolean expanded)
-{
- AtkObject *atk_obj = ATK_OBJECT (self);
-
- atk_object_notify_state_change (atk_obj, ATK_STATE_CHECKED, expanded);
- atk_object_notify_state_change (atk_obj, ATK_STATE_EXPANDED, expanded);
-
- g_signal_emit_by_name (atk_obj, "visible-data-changed");
-}
-
-static AtkStateSet *
-gtk_expander_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
- GtkExpander *expander;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- state_set = ATK_OBJECT_CLASS (gtk_expander_accessible_parent_class)->ref_state_set (obj);
-
- expander = GTK_EXPANDER (widget);
-
- atk_state_set_add_state (state_set, ATK_STATE_EXPANDABLE);
-
- if (gtk_expander_get_expanded (expander))
- {
- atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
- atk_state_set_add_state (state_set, ATK_STATE_EXPANDED);
- }
-
- return state_set;
-}
-
-static void
-gtk_expander_accessible_class_init (GtkExpanderAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_name = gtk_expander_accessible_get_name;
- class->get_n_children = gtk_expander_accessible_get_n_children;
- class->ref_child = gtk_expander_accessible_ref_child;
- class->ref_state_set = gtk_expander_accessible_ref_state_set;
-}
-
-static void
-gtk_expander_accessible_init (GtkExpanderAccessible *self)
-{
- ATK_OBJECT (self)->role = ATK_ROLE_TOGGLE_BUTTON;
-}
-
-static gboolean
-gtk_expander_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- gtk_widget_activate (widget);
- return TRUE;
-}
-
-static gint
-gtk_expander_accessible_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_expander_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- gchar *return_value = NULL;
- GtkWidget *widget;
- GtkWidget *label;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return NULL;
-
- if (i != 0)
- return NULL;
-
- label = gtk_expander_get_label_widget (GTK_EXPANDER (widget));
- if (GTK_IS_LABEL (label))
- {
- guint key_val;
-
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
-
- return return_value;
-}
-
-static const gchar *
-gtk_expander_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return "activate";
- return NULL;
-}
-
-static const gchar *
-gtk_expander_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Activate");
- return NULL;
-}
-
-static const gchar *
-gtk_expander_accessible_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Activates the expander");
- return NULL;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_expander_accessible_do_action;
- iface->get_n_actions = gtk_expander_accessible_get_n_actions;
- iface->get_keybinding = gtk_expander_accessible_get_keybinding;
- iface->get_name = gtk_expander_accessible_action_get_name;
- iface->get_localized_name = gtk_expander_accessible_action_get_localized_name;
- iface->get_description = gtk_expander_accessible_action_get_description;
-}
diff --git a/gtk/a11y/gtkexpanderaccessible.h b/gtk/a11y/gtkexpanderaccessible.h
deleted file mode 100644
index ecad612efe..0000000000
--- a/gtk/a11y/gtkexpanderaccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2003 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 .
- */
-
-#ifndef __GTK_EXPANDER_ACCESSIBLE_H__
-#define __GTK_EXPANDER_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_EXPANDER_ACCESSIBLE (gtk_expander_accessible_get_type ())
-#define GTK_EXPANDER_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_EXPANDER_ACCESSIBLE, GtkExpanderAccessible))
-#define GTK_EXPANDER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_EXPANDER_ACCESSIBLE, GtkExpanderAccessibleClass))
-#define GTK_IS_EXPANDER_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_EXPANDER_ACCESSIBLE))
-#define GTK_IS_EXPANDER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_EXPANDER_ACCESSIBLE))
-#define GTK_EXPANDER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_EXPANDER_ACCESSIBLE, GtkExpanderAccessibleClass))
-
-typedef struct _GtkExpanderAccessible GtkExpanderAccessible;
-typedef struct _GtkExpanderAccessibleClass GtkExpanderAccessibleClass;
-typedef struct _GtkExpanderAccessiblePrivate GtkExpanderAccessiblePrivate;
-
-struct _GtkExpanderAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkExpanderAccessiblePrivate *priv;
-};
-
-struct _GtkExpanderAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_expander_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_EXPANDER_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkexpanderaccessibleprivate.h b/gtk/a11y/gtkexpanderaccessibleprivate.h
deleted file mode 100644
index aab9ee5e5e..0000000000
--- a/gtk/a11y/gtkexpanderaccessibleprivate.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* gtkexpanderaccessibleprivate.h: GtkExpanderAccessible private API
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 .
- */
-
-#pragma once
-
-#include "gtkexpanderaccessible.h"
-
-G_BEGIN_DECLS
-
-void gtk_expander_accessible_update_label (GtkExpanderAccessible *self);
-void gtk_expander_accessible_update_state (GtkExpanderAccessible *self,
- gboolean expanded);
-
-G_END_DECLS
diff --git a/gtk/a11y/gtkflowboxaccessible.c b/gtk/a11y/gtkflowboxaccessible.c
deleted file mode 100644
index 40b65857fc..0000000000
--- a/gtk/a11y/gtkflowboxaccessible.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 "gtkflowboxaccessibleprivate.h"
-
-#include "gtk/gtkflowbox.h"
-
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkFlowBoxAccessible, gtk_flow_box_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
-
-static void
-gtk_flow_box_accessible_init (GtkFlowBoxAccessible *accessible)
-{
-}
-
-static void
-gtk_flow_box_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_flow_box_accessible_parent_class)->initialize (obj, data);
-
- obj->role = ATK_ROLE_TABLE;
-}
-
-static AtkStateSet*
-gtk_flow_box_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gtk_flow_box_accessible_parent_class)->ref_state_set (obj);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- if (widget != NULL)
- atk_state_set_add_state (state_set, ATK_STATE_MANAGES_DESCENDANTS);
-
- return state_set;
-}
-
-static void
-gtk_flow_box_accessible_class_init (GtkFlowBoxAccessibleClass *klass)
-{
- AtkObjectClass *object_class = ATK_OBJECT_CLASS (klass);
-
- object_class->initialize = gtk_flow_box_accessible_initialize;
- object_class->ref_state_set = gtk_flow_box_accessible_ref_state_set;
-}
-
-static gboolean
-gtk_flow_box_accessible_add_selection (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- GtkWidget *child;
- int pos;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- for (child = gtk_widget_get_first_child (box), pos = 0;
- child != NULL && pos < idx;
- child = gtk_widget_get_next_sibling (child), pos++) ;
-
- if (child && pos == idx)
- {
- gtk_flow_box_select_child (GTK_FLOW_BOX (box), GTK_FLOW_BOX_CHILD (child));
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-gtk_flow_box_accessible_remove_selection (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- GtkWidget *child;
- int pos;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- for (child = gtk_widget_get_first_child (box), pos = 0;
- child != NULL && pos < idx;
- child = gtk_widget_get_next_sibling (child), pos++) ;
-
- if (child && pos == idx)
- {
- gtk_flow_box_unselect_child (GTK_FLOW_BOX (box), GTK_FLOW_BOX_CHILD (child));
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-gtk_flow_box_accessible_clear_selection (AtkSelection *selection)
-{
- GtkWidget *box;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- gtk_flow_box_unselect_all (GTK_FLOW_BOX (box));
- return TRUE;
-}
-
-static gboolean
-gtk_flow_box_accessible_select_all (AtkSelection *selection)
-{
- GtkWidget *box;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- gtk_flow_box_select_all (GTK_FLOW_BOX (box));
- return TRUE;
-}
-
-typedef struct
-{
- gint idx;
- GtkWidget *child;
-} FindSelectedData;
-
-static void
-find_selected_child (GtkFlowBox *box,
- GtkFlowBoxChild *child,
- gpointer data)
-{
- FindSelectedData *d = data;
-
- if (d->idx == 0)
- {
- if (d->child == NULL)
- d->child = GTK_WIDGET (child);
- }
- else
- d->idx -= 1;
-}
-
-static AtkObject *
-gtk_flow_box_accessible_ref_selection (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- AtkObject *accessible;
- FindSelectedData data;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return NULL;
-
- data.idx = idx;
- data.child = NULL;
- gtk_flow_box_selected_foreach (GTK_FLOW_BOX (box), find_selected_child, &data);
-
- if (data.child == NULL)
- return NULL;
-
- accessible = gtk_widget_get_accessible (data.child);
- g_object_ref (accessible);
- return accessible;
-}
-
-static void
-count_selected (GtkFlowBox *box,
- GtkFlowBoxChild *child,
- gpointer data)
-{
- gint *count = data;
- *count += 1;
-}
-
-static gint
-gtk_flow_box_accessible_get_selection_count (AtkSelection *selection)
-{
- GtkWidget *box;
- gint count;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return 0;
-
- count = 0;
- gtk_flow_box_selected_foreach (GTK_FLOW_BOX (box), count_selected, &count);
-
- return count;
-}
-
-static gboolean
-gtk_flow_box_accessible_is_child_selected (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- GtkFlowBoxChild *child;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- child = gtk_flow_box_get_child_at_index (GTK_FLOW_BOX (box), idx);
-
- return gtk_flow_box_child_is_selected (child);
-}
-
-static void atk_selection_interface_init (AtkSelectionIface *iface)
-{
- iface->add_selection = gtk_flow_box_accessible_add_selection;
- iface->remove_selection = gtk_flow_box_accessible_remove_selection;
- iface->clear_selection = gtk_flow_box_accessible_clear_selection;
- iface->ref_selection = gtk_flow_box_accessible_ref_selection;
- iface->get_selection_count = gtk_flow_box_accessible_get_selection_count;
- iface->is_child_selected = gtk_flow_box_accessible_is_child_selected;
- iface->select_all_selection = gtk_flow_box_accessible_select_all;
-}
-
-void
-_gtk_flow_box_accessible_selection_changed (GtkWidget *box)
-{
- AtkObject *accessible;
- accessible = gtk_widget_get_accessible (box);
- g_signal_emit_by_name (accessible, "selection-changed");
-}
-
-void
-_gtk_flow_box_accessible_update_cursor (GtkWidget *box,
- GtkWidget *child)
-{
- AtkObject *accessible;
- AtkObject *descendant;
- accessible = gtk_widget_get_accessible (box);
- descendant = child ? gtk_widget_get_accessible (child) : NULL;
- g_signal_emit_by_name (accessible, "active-descendant-changed", descendant);
-}
diff --git a/gtk/a11y/gtkflowboxaccessible.h b/gtk/a11y/gtkflowboxaccessible.h
deleted file mode 100644
index 8a5f8376c1..0000000000
--- a/gtk/a11y/gtkflowboxaccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 .
- */
-
-#ifndef __GTK_FLOW_BOX_ACCESSIBLE_H__
-#define __GTK_FLOW_BOX_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_FLOW_BOX_ACCESSIBLE (gtk_flow_box_accessible_get_type ())
-#define GTK_FLOW_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FLOW_BOX_ACCESSIBLE, GtkFlowBoxAccessible))
-#define GTK_FLOW_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FLOW_BOX_ACCESSIBLE, GtkFlowBoxAccessibleClass))
-#define GTK_IS_FLOW_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FLOW_BOX_ACCESSIBLE))
-#define GTK_IS_FLOW_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FLOW_BOX_ACCESSIBLE))
-#define GTK_FLOW_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FLOW_BOX_ACCESSIBLE, GtkFlowBoxAccessibleClass))
-
-typedef struct _GtkFlowBoxAccessible GtkFlowBoxAccessible;
-typedef struct _GtkFlowBoxAccessibleClass GtkFlowBoxAccessibleClass;
-typedef struct _GtkFlowBoxAccessiblePrivate GtkFlowBoxAccessiblePrivate;
-
-struct _GtkFlowBoxAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkFlowBoxAccessiblePrivate *priv;
-};
-
-struct _GtkFlowBoxAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_flow_box_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_FLOW_BOX_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkflowboxaccessibleprivate.h b/gtk/a11y/gtkflowboxaccessibleprivate.h
deleted file mode 100644
index df19ba782a..0000000000
--- a/gtk/a11y/gtkflowboxaccessibleprivate.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 .
- */
-
-#ifndef __GTK_FLOW_BOX_ACCESSIBLE_PRIVATE_H__
-#define __GTK_FLOW_BOX_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_flow_box_accessible_selection_changed (GtkWidget *box);
-void _gtk_flow_box_accessible_update_cursor (GtkWidget *box,
- GtkWidget *child);
-G_END_DECLS
-
-#endif /* __GTK_FLOW_BOX_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkflowboxchildaccessible.c b/gtk/a11y/gtkflowboxchildaccessible.c
deleted file mode 100644
index 794c4f5ee3..0000000000
--- a/gtk/a11y/gtkflowboxchildaccessible.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 "gtkflowboxchildaccessible.h"
-
-#include "gtk/gtkflowbox.h"
-
-
-G_DEFINE_TYPE (GtkFlowBoxChildAccessible, gtk_flow_box_child_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static void
-gtk_flow_box_child_accessible_init (GtkFlowBoxChildAccessible *accessible)
-{
-}
-
-static void
-gtk_flow_box_child_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_flow_box_child_accessible_parent_class)->initialize (obj, data);
-
- obj->role = ATK_ROLE_TABLE_CELL;
-}
-
-static AtkStateSet *
-gtk_flow_box_child_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget, *parent;
-
- state_set = ATK_OBJECT_CLASS (gtk_flow_box_child_accessible_parent_class)->ref_state_set (obj);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget != NULL)
- {
- parent = gtk_widget_get_parent (widget);
- if (gtk_flow_box_get_selection_mode (GTK_FLOW_BOX (parent)) != GTK_SELECTION_NONE)
- atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
-
- if (gtk_flow_box_child_is_selected (GTK_FLOW_BOX_CHILD (widget)))
- atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
- }
-
- return state_set;
-}
-
-static void
-gtk_flow_box_child_accessible_class_init (GtkFlowBoxChildAccessibleClass *klass)
-{
- AtkObjectClass *object_class = ATK_OBJECT_CLASS (klass);
-
- object_class->initialize = gtk_flow_box_child_accessible_initialize;
- object_class->ref_state_set = gtk_flow_box_child_accessible_ref_state_set;
-}
diff --git a/gtk/a11y/gtkflowboxchildaccessible.h b/gtk/a11y/gtkflowboxchildaccessible.h
deleted file mode 100644
index c010ffe25d..0000000000
--- a/gtk/a11y/gtkflowboxchildaccessible.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 .
- */
-
-#ifndef __GTK_FLOW_BOX_CHILD_ACCESSIBLE_H__
-#define __GTK_FLOW_BOX_CHILD_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_FLOW_BOX_CHILD_ACCESSIBLE (gtk_flow_box_child_accessible_get_type ())
-#define GTK_FLOW_BOX_CHILD_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FLOW_BOX_CHILD_ACCESSIBLE, GtkFlowBoxChildAccessible))
-#define GTK_FLOW_BOX_CHILD_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FLOW_BOX_CHILD_ACCESSIBLE, GtkFlowBoxChildAccessibleClass))
-#define GTK_IS_FLOW_BOX_CHILD_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FLOW_BOX_CHILD_ACCESSIBLE))
-#define GTK_IS_FLOW_BOX_CHILD_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FLOW_BOX_CHILD_ACCESSIBLE))
-#define GTK_FLOW_BOX_CHILD_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FLOW_BOX_CHILD_ACCESSIBLE, GtkFlowBoxChildAccessibleClass))
-
-typedef struct _GtkFlowBoxChildAccessible GtkFlowBoxChildAccessible;
-typedef struct _GtkFlowBoxChildAccessibleClass GtkFlowBoxChildAccessibleClass;
-
-struct _GtkFlowBoxChildAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkFlowBoxChildAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_flow_box_child_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_FLOW_BOX_CHILD_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkframeaccessible.c b/gtk/a11y/gtkframeaccessible.c
deleted file mode 100644
index 7f80a7b813..0000000000
--- a/gtk/a11y/gtkframeaccessible.c
+++ /dev/null
@@ -1,65 +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
-#include "gtkframeaccessible.h"
-
-
-G_DEFINE_TYPE (GtkFrameAccessible, gtk_frame_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static void
-gtk_frame_accessible_initialize (AtkObject *accessible,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_frame_accessible_parent_class)->initialize (accessible, data);
-
- accessible->role = ATK_ROLE_PANEL;
-}
-
-static const gchar *
-gtk_frame_accessible_get_name (AtkObject *obj)
-{
- const gchar *name;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_frame_accessible_parent_class)->get_name (obj);
- if (name != NULL)
- return name;
-
- return gtk_frame_get_label (GTK_FRAME (widget));
-}
-
-static void
-gtk_frame_accessible_class_init (GtkFrameAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->initialize = gtk_frame_accessible_initialize;
- class->get_name = gtk_frame_accessible_get_name;
-}
-
-static void
-gtk_frame_accessible_init (GtkFrameAccessible *frame)
-{
-}
diff --git a/gtk/a11y/gtkframeaccessible.h b/gtk/a11y/gtkframeaccessible.h
deleted file mode 100644
index a2cbb59c6e..0000000000
--- a/gtk/a11y/gtkframeaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_FRAME_ACCESSIBLE_H__
-#define __GTK_FRAME_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_FRAME_ACCESSIBLE (gtk_frame_accessible_get_type ())
-#define GTK_FRAME_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessible))
-#define GTK_FRAME_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
-#define GTK_IS_FRAME_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FRAME_ACCESSIBLE))
-#define GTK_IS_FRAME_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME_ACCESSIBLE))
-#define GTK_FRAME_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
-
-typedef struct _GtkFrameAccessible GtkFrameAccessible;
-typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
-typedef struct _GtkFrameAccessiblePrivate GtkFrameAccessiblePrivate;
-
-struct _GtkFrameAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkFrameAccessiblePrivate *priv;
-};
-
-struct _GtkFrameAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_frame_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_FRAME_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkiconviewaccessible.c b/gtk/a11y/gtkiconviewaccessible.c
deleted file mode 100644
index db2d56d079..0000000000
--- a/gtk/a11y/gtkiconviewaccessible.c
+++ /dev/null
@@ -1,1540 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2002, 2004 Anders Carlsson
- *
- * 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 .
- */
-
-#include "config.h"
-
-#include "gtkiconviewaccessibleprivate.h"
-
-#include
-
-#include "gtk/gtkadjustment.h"
-#include "gtk/gtkiconviewprivate.h"
-#include "gtk/gtkcellrendererpixbuf.h"
-#include "gtk/gtkcellrenderertext.h"
-#include "gtk/gtkpango.h"
-#include "gtk/gtkwidgetprivate.h"
-
-#define GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE (_gtk_icon_view_item_accessible_get_type ())
-#define GTK_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE, GtkIconViewItemAccessible))
-#define GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE))
-
-typedef struct
-{
- GList *items;
- GtkTreeModel *model;
-} GtkIconViewAccessiblePrivate;
-
-typedef struct
-{
- AtkObject parent;
-
- GtkIconViewItem *item;
- GtkWidget *widget;
- AtkStateSet *state_set;
- gchar *text;
- gchar *action_description;
- gchar *image_description;
- guint action_idle_handler;
-} GtkIconViewItemAccessible;
-
-typedef struct
-{
- AtkObjectClass parent_class;
-
-} GtkIconViewItemAccessibleClass;
-
-GType _gtk_icon_view_item_accessible_get_type (void);
-
-static gboolean gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item);
-
-static void atk_component_item_interface_init (AtkComponentIface *iface);
-static void atk_action_item_interface_init (AtkActionIface *iface);
-static void atk_text_item_interface_init (AtkTextIface *iface);
-static void atk_image_item_interface_init (AtkImageIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkIconViewItemAccessible, _gtk_icon_view_item_accessible, ATK_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_item_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_item_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_item_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_item_interface_init))
-
-
-static gboolean
-idle_do_action (gpointer data)
-{
- GtkIconViewItemAccessible *item;
- GtkIconView *icon_view;
- GtkTreePath *path;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (data);
- item->action_idle_handler = 0;
-
- if (item->widget != NULL)
- {
- icon_view = GTK_ICON_VIEW (item->widget);
- path = gtk_tree_path_new_from_indices (item->item->index, -1);
- gtk_icon_view_item_activated (icon_view, path);
- gtk_tree_path_free (path);
- }
-
- return FALSE;
-}
-
-static gboolean
-gtk_icon_view_item_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkIconViewItemAccessible *item;
-
- if (i != 0)
- return FALSE;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (action);
-
- if (!GTK_IS_ICON_VIEW (item->widget))
- return FALSE;
-
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return FALSE;
-
- if (!item->action_idle_handler)
- {
- item->action_idle_handler = g_idle_add (idle_do_action, item);
- g_source_set_name_by_id (item->action_idle_handler, "[gtk] idle_do_action");
- }
-
- return TRUE;
-}
-
-static gint
-gtk_icon_view_item_accessible_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_icon_view_item_accessible_get_description (AtkAction *action,
- gint i)
-{
- GtkIconViewItemAccessible *item;
-
- if (i != 0)
- return NULL;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (action);
-
- if (item->action_description)
- return item->action_description;
- else
- return "Activate item";
-}
-
-static const gchar *
-gtk_icon_view_item_accessible_get_name (AtkAction *action,
- gint i)
-{
- if (i != 0)
- return NULL;
-
- return "activate";
-}
-
-static gboolean
-gtk_icon_view_item_accessible_set_description (AtkAction *action,
- gint i,
- const gchar *description)
-{
- GtkIconViewItemAccessible *item;
-
- if (i != 0)
- return FALSE;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (action);
-
- g_free (item->action_description);
- item->action_description = g_strdup (description);
-
- return TRUE;
-}
-
-static void
-atk_action_item_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_icon_view_item_accessible_do_action;
- iface->set_description = gtk_icon_view_item_accessible_set_description;
- iface->get_name = gtk_icon_view_item_accessible_get_name;
- iface->get_n_actions = gtk_icon_view_item_accessible_get_n_actions;
- iface->get_description = gtk_icon_view_item_accessible_get_description;
-}
-
-static const gchar *
-gtk_icon_view_item_accessible_get_image_description (AtkImage *image)
-{
- GtkIconViewItemAccessible *item;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
-
- return item->image_description;
-}
-
-static gboolean
-gtk_icon_view_item_accessible_set_image_description (AtkImage *image,
- const gchar *description)
-{
- GtkIconViewItemAccessible *item;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
-
- g_free (item->image_description);
- item->image_description = g_strdup (description);
-
- return TRUE;
-}
-
-typedef struct {
- GdkRectangle box;
- gboolean pixbuf_found;
-} GetPixbufBoxData;
-
-static gboolean
-get_pixbuf_foreach (GtkCellRenderer *renderer,
- const GdkRectangle *cell_area,
- const GdkRectangle *cell_background,
- GetPixbufBoxData *data)
-{
- if (GTK_IS_CELL_RENDERER_PIXBUF (renderer))
- {
- data->box = *cell_area;
- data->pixbuf_found = TRUE;
- }
- return (data->pixbuf_found != FALSE);
-}
-
-static gboolean
-get_pixbuf_box (GtkIconView *icon_view,
- GtkIconViewItem *item,
- GdkRectangle *box)
-{
- GetPixbufBoxData data = { { 0, }, FALSE };
- GtkCellAreaContext *context;
-
- context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
-
- _gtk_icon_view_set_cell_data (icon_view, item);
- gtk_cell_area_foreach_alloc (icon_view->priv->cell_area, context,
- GTK_WIDGET (icon_view),
- &item->cell_area, &item->cell_area,
- (GtkCellAllocCallback)get_pixbuf_foreach, &data);
-
- *box = data.box;
-
- return data.pixbuf_found;
-}
-
-static gboolean
-get_text_foreach (GtkCellRenderer *renderer,
- gchar **text)
-{
- if (GTK_IS_CELL_RENDERER_TEXT (renderer))
- {
- g_object_get (renderer, "text", text, NULL);
- return TRUE;
- }
- return FALSE;
-}
-
-static gchar *
-get_text (GtkIconView *icon_view,
- GtkIconViewItem *item)
-{
- gchar *text = NULL;
-
- _gtk_icon_view_set_cell_data (icon_view, item);
- gtk_cell_area_foreach (icon_view->priv->cell_area,
- (GtkCellCallback) get_text_foreach,
- &text);
-
- return text;
-}
-
-static void
-gtk_icon_view_item_accessible_get_image_size (AtkImage *image,
- gint *width,
- gint *height)
-{
- GtkIconViewItemAccessible *item;
- GdkRectangle box;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
-
- if (!GTK_IS_ICON_VIEW (item->widget))
- return;
-
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return;
-
- *width = 0;
- *height = 0;
-
- if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
- {
- *width = box.width;
- *height = box.height;
- }
-}
-
-static void
-gtk_icon_view_item_accessible_get_image_position (AtkImage *image,
- gint *x,
- gint *y,
- AtkCoordType coord_type)
-{
- GtkIconViewItemAccessible *item;
- GdkRectangle box;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
-
- if (!GTK_IS_ICON_VIEW (item->widget))
- return;
-
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return;
-
- atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL,
- coord_type);
-
- if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
- {
- *x+= box.x - item->item->cell_area.x;
- *y+= box.y - item->item->cell_area.y;
- }
-
-}
-
-static void
-atk_image_item_interface_init (AtkImageIface *iface)
-{
- iface->get_image_description = gtk_icon_view_item_accessible_get_image_description;
- iface->set_image_description = gtk_icon_view_item_accessible_set_image_description;
- iface->get_image_size = gtk_icon_view_item_accessible_get_image_size;
- iface->get_image_position = gtk_icon_view_item_accessible_get_image_position;
-}
-
-static gchar *
-gtk_icon_view_item_accessible_get_text (AtkText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkIconViewItemAccessible *item;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return NULL;
-
- if (item->text)
- return g_utf8_substring (item->text, start_pos, end_pos > -1 ? end_pos : g_utf8_strlen (item->text, -1));
- else
- return g_strdup ("");
-}
-
-static gunichar
-gtk_icon_view_item_accessible_get_character_at_offset (AtkText *text,
- gint offset)
-{
- GtkIconViewItemAccessible *item;
- gchar *string;
- gchar *index;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return '\0';
-
- string = item->text;
-
- if (!string)
- return '\0';
-
- if (offset >= g_utf8_strlen (string, -1))
- return '\0';
-
- index = g_utf8_offset_to_pointer (string, offset);
-
- return g_utf8_get_char (index);
-}
-
-static PangoLayout *
-create_pango_layout (GtkIconViewItemAccessible *item)
-{
- PangoLayout *layout;
-
- layout = gtk_widget_create_pango_layout (item->widget, item->text);
-
- return layout;
-}
-
-static gchar *
-gtk_icon_view_item_accessible_get_text_before_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkIconViewItemAccessible *item;
- PangoLayout *layout;
- gchar *text;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (atk_text);
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return NULL;
-
- layout = create_pango_layout (item);
- text = _gtk_pango_get_text_before (layout, boundary_type, offset, start_offset, end_offset);
- g_object_unref (layout);
-
- return text;
-}
-
-static gchar *
-gtk_icon_view_item_accessible_get_text_at_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkIconViewItemAccessible *item;
- PangoLayout *layout;
- gchar *text;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (atk_text);
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return NULL;
-
- layout = create_pango_layout (item);
- text = _gtk_pango_get_text_at (layout, boundary_type, offset, start_offset, end_offset);
- g_object_unref (layout);
-
- return text;
-}
-
-static gchar *
-gtk_icon_view_item_accessible_get_text_after_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkIconViewItemAccessible *item;
- PangoLayout *layout;
- gchar *text;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (atk_text);
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return NULL;
-
- layout = create_pango_layout (item);
- text = _gtk_pango_get_text_after (layout, boundary_type, offset, start_offset, end_offset);
- g_object_unref (layout);
-
- return text;
-}
-
-static gint
-gtk_icon_view_item_accessible_get_character_count (AtkText *text)
-{
- GtkIconViewItemAccessible *item;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return 0;
-
- if (item->text)
- return g_utf8_strlen (item->text, -1);
- else
- return 0;
-}
-
-static void
-gtk_icon_view_item_accessible_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkIconViewItemAccessible *item;
-#if 0
- GtkIconView *icon_view;
- PangoRectangle char_rect;
- const gchar *item_text;
- gint index;
-#endif
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
-
- if (!GTK_IS_ICON_VIEW (item->widget))
- return;
-
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return;
-
-#if 0
- icon_view = GTK_ICON_VIEW (item->widget);
- /* FIXME we probably have to use GailTextCell to salvage this */
- gtk_icon_view_update_item_text (icon_view, item->item);
- item_text = pango_layout_get_text (icon_view->priv->layout);
- index = g_utf8_offset_to_pointer (item_text, offset) - item_text;
- pango_layout_index_to_pos (icon_view->priv->layout, index, &char_rect);
-
- atk_component_get_position (ATK_COMPONENT (text), x, y, coord_type);
- *x += item->item->layout_x - item->item->x + char_rect.x / PANGO_SCALE;
- /* Look at gtk_icon_view_paint_item() to see where the text is. */
- *x -= ((item->item->width - item->item->layout_width) / 2) + (MAX (item->item->pixbuf_width, icon_view->priv->item_width) - item->item->width) / 2,
- *y += item->item->layout_y - item->item->y + char_rect.y / PANGO_SCALE;
- *width = char_rect.width / PANGO_SCALE;
- *height = char_rect.height / PANGO_SCALE;
-#endif
-}
-
-static gint
-gtk_icon_view_item_accessible_get_offset_at_point (AtkText *text,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- GtkIconViewItemAccessible *item;
- gint offset = 0;
-#if 0
- GtkIconView *icon_view;
- const gchar *item_text;
- gint index;
- gint l_x, l_y;
-#endif
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
-
- if (!GTK_IS_ICON_VIEW (item->widget))
- return -1;
-
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return -1;
-
-#if 0
- icon_view = GTK_ICON_VIEW (item->widget);
- /* FIXME we probably have to use GailTextCell to salvage this */
- gtk_icon_view_update_item_text (icon_view, item->item);
- atk_component_get_position (ATK_COMPONENT (text), &l_x, &l_y, coord_type);
- x -= l_x + item->item->layout_x - item->item->x;
- x += ((item->item->width - item->item->layout_width) / 2) + (MAX (item->item->pixbuf_width, icon_view->priv->item_width) - item->item->width) / 2,
- y -= l_y + item->item->layout_y - item->item->y;
- item_text = pango_layout_get_text (icon_view->priv->layout);
- if (!pango_layout_xy_to_index (icon_view->priv->layout,
- x * PANGO_SCALE,
- y * PANGO_SCALE,
- &index, NULL))
- {
- if (x < 0 || y < 0)
- index = 0;
- else
- index = -1;
- }
- if (index == -1)
- offset = g_utf8_strlen (item_text, -1);
- else
- offset = g_utf8_pointer_to_offset (item_text, item_text + index);
-#endif
- return offset;
-}
-
-static void
-atk_text_item_interface_init (AtkTextIface *iface)
-{
- iface->get_text = gtk_icon_view_item_accessible_get_text;
- iface->get_character_at_offset = gtk_icon_view_item_accessible_get_character_at_offset;
- iface->get_text_before_offset = gtk_icon_view_item_accessible_get_text_before_offset;
- iface->get_text_at_offset = gtk_icon_view_item_accessible_get_text_at_offset;
- iface->get_text_after_offset = gtk_icon_view_item_accessible_get_text_after_offset;
- iface->get_character_count = gtk_icon_view_item_accessible_get_character_count;
- iface->get_character_extents = gtk_icon_view_item_accessible_get_character_extents;
- iface->get_offset_at_point = gtk_icon_view_item_accessible_get_offset_at_point;
-}
-
-static void
-gtk_icon_view_item_accessible_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkIconViewItemAccessible *item;
- AtkObject *parent_obj;
- gint l_x, l_y;
-
- g_return_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (component));
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (component);
- if (!GTK_IS_WIDGET (item->widget))
- return;
-
- if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
- return;
-
- *width = item->item->cell_area.width;
- *height = item->item->cell_area.height;
- if (gtk_icon_view_item_accessible_is_showing (item))
- {
- parent_obj = gtk_widget_get_accessible (item->widget);
- atk_component_get_extents (ATK_COMPONENT (parent_obj), &l_x, &l_y,
- NULL, NULL, coord_type);
- *x = l_x + item->item->cell_area.x;
- *y = l_y + item->item->cell_area.y;
- }
- else
- {
- *x = G_MININT;
- *y = G_MININT;
- }
-}
-
-static gboolean
-gtk_icon_view_item_accessible_grab_focus (AtkComponent *component)
-{
- GtkIconViewItemAccessible *item;
-
- g_return_val_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (component), FALSE);
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (component);
- if (!GTK_IS_WIDGET (item->widget))
- return FALSE;
-
- gtk_widget_grab_focus (item->widget);
- _gtk_icon_view_set_cursor_item (GTK_ICON_VIEW (item->widget), item->item, NULL);
-
- return TRUE;
-}
-
-static void
-atk_component_item_interface_init (AtkComponentIface *iface)
-{
- iface->get_extents = gtk_icon_view_item_accessible_get_extents;
- iface->grab_focus = gtk_icon_view_item_accessible_grab_focus;
-}
-
-static gboolean
-gtk_icon_view_item_accessible_add_state (GtkIconViewItemAccessible *item,
- AtkStateType state_type,
- gboolean emit_signal)
-{
- gboolean rc;
-
- rc = atk_state_set_add_state (item->state_set, state_type);
-
- /* The signal should only be generated if the value changed,
- * not when the item is set up. So states that are set
- * initially should pass FALSE as the emit_signal argument.
- */
- if (emit_signal)
- {
- atk_object_notify_state_change (ATK_OBJECT (item), state_type, TRUE);
- /* If state_type is ATK_STATE_VISIBLE, additional notification */
- if (state_type == ATK_STATE_VISIBLE)
- g_signal_emit_by_name (item, "visible-data-changed");
- }
-
- return rc;
-}
-
-static gboolean
-gtk_icon_view_item_accessible_remove_state (GtkIconViewItemAccessible *item,
- AtkStateType state_type,
- gboolean emit_signal)
-{
- if (atk_state_set_contains_state (item->state_set, state_type))
- {
- gboolean rc;
-
- rc = atk_state_set_remove_state (item->state_set, state_type);
-
- /* The signal should only be generated if the value changed,
- * not when the item is set up. So states that are set
- * initially should pass FALSE as the emit_signal argument.
- */
- if (emit_signal)
- {
- atk_object_notify_state_change (ATK_OBJECT (item), state_type, FALSE);
- /* If state_type is ATK_STATE_VISIBLE, additional notification */
- if (state_type == ATK_STATE_VISIBLE)
- g_signal_emit_by_name (item, "visible-data-changed");
- }
-
- return rc;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item)
-{
- GtkAllocation allocation;
- GtkIconView *icon_view;
- GdkRectangle visible_rect;
- gboolean is_showing;
-
- /* An item is considered "SHOWING" if any part of the item
- * is in the visible rectangle.
- */
- if (!GTK_IS_ICON_VIEW (item->widget))
- return FALSE;
-
- if (item->item == NULL)
- return FALSE;
-
- gtk_widget_get_allocation (item->widget, &allocation);
-
- icon_view = GTK_ICON_VIEW (item->widget);
- visible_rect.x = 0;
- if (icon_view->priv->hadjustment)
- visible_rect.x += gtk_adjustment_get_value (icon_view->priv->hadjustment);
- visible_rect.y = 0;
- if (icon_view->priv->vadjustment)
- visible_rect.y += gtk_adjustment_get_value (icon_view->priv->vadjustment);
- visible_rect.width = allocation.width;
- visible_rect.height = allocation.height;
-
- if (((item->item->cell_area.x + item->item->cell_area.width) < visible_rect.x) ||
- ((item->item->cell_area.y + item->item->cell_area.height) < (visible_rect.y)) ||
- (item->item->cell_area.x > (visible_rect.x + visible_rect.width)) ||
- (item->item->cell_area.y > (visible_rect.y + visible_rect.height)))
- is_showing = FALSE;
- else
- is_showing = TRUE;
-
- return is_showing;
-}
-
-static gboolean
-gtk_icon_view_item_accessible_set_visibility (GtkIconViewItemAccessible *item,
- gboolean emit_signal)
-{
- if (gtk_icon_view_item_accessible_is_showing (item))
- return gtk_icon_view_item_accessible_add_state (item, ATK_STATE_SHOWING,
- emit_signal);
- else
- return gtk_icon_view_item_accessible_remove_state (item, ATK_STATE_SHOWING,
- emit_signal);
-}
-
-static void
-_gtk_icon_view_item_accessible_init (GtkIconViewItemAccessible *item)
-{
- atk_object_set_role (ATK_OBJECT (item), ATK_ROLE_ICON);
-
- item->state_set = atk_state_set_new ();
- atk_state_set_add_state (item->state_set, ATK_STATE_ENABLED);
- atk_state_set_add_state (item->state_set, ATK_STATE_FOCUSABLE);
- atk_state_set_add_state (item->state_set, ATK_STATE_SENSITIVE);
- atk_state_set_add_state (item->state_set, ATK_STATE_SELECTABLE);
- atk_state_set_add_state (item->state_set, ATK_STATE_VISIBLE);
-
- item->action_description = NULL;
- item->image_description = NULL;
-
- item->action_idle_handler = 0;
-}
-
-static void
-_gtk_icon_view_item_accessible_finalize (GObject *object)
-{
- GtkIconViewItemAccessible *item;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (object);
-
- if (item->widget)
- g_object_remove_weak_pointer (G_OBJECT (item->widget), (gpointer) &item->widget);
-
- if (item->state_set)
- g_object_unref (item->state_set);
-
-
- g_free (item->text);
- g_free (item->action_description);
- g_free (item->image_description);
-
- if (item->action_idle_handler)
- {
- g_source_remove (item->action_idle_handler);
- item->action_idle_handler = 0;
- }
-
- G_OBJECT_CLASS (_gtk_icon_view_item_accessible_parent_class)->finalize (object);
-}
-
-static AtkObject*
-_gtk_icon_view_item_accessible_get_parent (AtkObject *obj)
-{
- GtkIconViewItemAccessible *item;
-
- g_return_val_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (obj), NULL);
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (obj);
-
- if (item->widget)
- return gtk_widget_get_accessible (item->widget);
- else
- return NULL;
-}
-
-static gint
-_gtk_icon_view_item_accessible_get_index_in_parent (AtkObject *obj)
-{
- GtkIconViewItemAccessible *item;
-
- g_return_val_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (obj), 0);
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (obj);
-
- return item->item->index;
-}
-
-static AtkStateSet *
-_gtk_icon_view_item_accessible_ref_state_set (AtkObject *obj)
-{
- GtkIconViewItemAccessible *item;
- GtkIconView *icon_view;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (obj);
- g_return_val_if_fail (item->state_set, NULL);
-
- if (!item->widget)
- return NULL;
-
- icon_view = GTK_ICON_VIEW (item->widget);
- if (icon_view->priv->cursor_item == item->item)
- atk_state_set_add_state (item->state_set, ATK_STATE_FOCUSED);
- else
- atk_state_set_remove_state (item->state_set, ATK_STATE_FOCUSED);
- if (item->item->selected)
- atk_state_set_add_state (item->state_set, ATK_STATE_SELECTED);
- else
- atk_state_set_remove_state (item->state_set, ATK_STATE_SELECTED);
-
- return g_object_ref (item->state_set);
-}
-
-static void
-_gtk_icon_view_item_accessible_class_init (GtkIconViewItemAccessibleClass *klass)
-{
- GObjectClass *gobject_class;
- AtkObjectClass *atk_class;
-
- gobject_class = (GObjectClass *)klass;
- atk_class = (AtkObjectClass *)klass;
-
- gobject_class->finalize = _gtk_icon_view_item_accessible_finalize;
-
- atk_class->get_index_in_parent = _gtk_icon_view_item_accessible_get_index_in_parent;
- atk_class->get_parent = _gtk_icon_view_item_accessible_get_parent;
- atk_class->ref_state_set = _gtk_icon_view_item_accessible_ref_state_set;
-}
-
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkIconViewAccessible, gtk_icon_view_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkIconViewAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
-
-typedef struct
-{
- AtkObject *item;
- int index;
-} ItemAccessibleInfo;
-
-
-static void
-gtk_icon_view_item_accessible_info_new (GtkIconViewAccessible *self,
- GtkIconViewItemAccessible *item,
- int index)
-{
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- ItemAccessibleInfo *info;
- ItemAccessibleInfo *tmp_info;
- GList *items;
-
- info = g_new (ItemAccessibleInfo, 1);
- info->item = ATK_OBJECT (item);
- info->index = index;
-
- items = priv->items;
- while (items)
- {
- tmp_info = items->data;
- if (tmp_info->index > index)
- break;
- items = items->next;
- }
-
- priv->items = g_list_insert_before (priv->items, items, info);
-}
-
-static gint
-gtk_icon_view_accessible_get_n_children (AtkObject *accessible)
-{
- GtkIconView *icon_view;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (!widget)
- return 0;
-
- icon_view = GTK_ICON_VIEW (widget);
-
- return g_list_length (icon_view->priv->items);
-}
-
-static GtkIconViewItemAccessible *
-gtk_icon_view_accessible_find_child (GtkIconViewAccessible *self,
- gint index)
-{
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- GList *items;
-
- items = priv->items;
-
- while (items)
- {
- ItemAccessibleInfo *info = items->data;
- GList *next = items->next;
-
- if (info->index == index)
- return GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
-
- items = next;
- }
-
- return NULL;
-}
-
-static AtkObject *
-gtk_icon_view_accessible_ref_child (AtkObject *accessible,
- gint index)
-{
- GtkIconViewAccessible *self = GTK_ICON_VIEW_ACCESSIBLE (accessible);
- GtkIconViewItemAccessible *a11y_item;
- GtkIconView *icon_view;
- GtkWidget *widget;
- GList *icons;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- icon_view = GTK_ICON_VIEW (widget);
- icons = g_list_nth (icon_view->priv->items, index);
- if (icons)
- {
- GtkIconViewItem *item = icons->data;
-
- g_return_val_if_fail (item->index == index, NULL);
-
- a11y_item = gtk_icon_view_accessible_find_child (self, index);
- if (a11y_item == NULL)
- {
- a11y_item = g_object_new (GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE, NULL);
- a11y_item->item = item;
- a11y_item->widget = widget;
-
- g_free (a11y_item->text);
- a11y_item->text = get_text (icon_view, item);
-
- gtk_icon_view_item_accessible_set_visibility (a11y_item, FALSE);
- g_object_add_weak_pointer (G_OBJECT (widget), (gpointer) &(a11y_item->widget));
-
- gtk_icon_view_item_accessible_info_new (self, a11y_item, index);
- }
-
- g_object_ref (a11y_item);
-
- return ATK_OBJECT (a11y_item);
- }
- else
- {
- return NULL;
- }
-}
-
-static void
-gtk_icon_view_accessible_traverse_items (GtkIconViewAccessible *self,
- GList *list)
-{
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- GtkWidget *widget;
- gboolean act_on_item;
- GList *items;
-
- if (priv->items == NULL)
- return;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
- if (widget == NULL)
- return;
-
- items = priv->items;
-
- act_on_item = (list == NULL);
-
- while (items)
- {
- ItemAccessibleInfo *info = items->data;
- GtkIconViewItemAccessible *item;
- GList *next = items->next;
-
- item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
-
- if (act_on_item == FALSE && list == items)
- act_on_item = TRUE;
-
- if (act_on_item)
- gtk_icon_view_item_accessible_set_visibility (item, TRUE);
-
- items = next;
- }
-}
-
-void
-gtk_icon_view_accessible_adjustment_changed (GtkIconViewAccessible *self)
-{
- gtk_icon_view_accessible_traverse_items (self, NULL);
-}
-
-static void
-gtk_icon_view_accessible_model_row_changed (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
-{
- GtkIconViewAccessible *self = user_data;
- GtkIconViewItemAccessible *a11y_item;
- int index;
-
- index = gtk_tree_path_get_indices (path)[0];
- a11y_item = gtk_icon_view_accessible_find_child (self, index);
- if (a11y_item)
- {
- GtkIconViewItem *item = a11y_item->item;
- GtkIconView *icon_view = GTK_ICON_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (self)));
-
- const char *name = atk_object_get_name (ATK_OBJECT (a11y_item));
- if (name == NULL || *name == '\0')
- {
- g_free (a11y_item->text);
- a11y_item->text = get_text (icon_view, item);
- }
- }
-
- g_signal_emit_by_name (self, "visible-data-changed");
-}
-
-static void
-gtk_icon_view_accessible_model_row_inserted (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
-{
- GtkIconViewAccessible *self = user_data;
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- GList *items;
- GList *tmp_list;
- int index;
-
- index = gtk_tree_path_get_indices (path)[0];
-
- items = priv->items;
- tmp_list = NULL;
- while (items)
- {
- ItemAccessibleInfo *info = items->data;
- GtkIconViewItemAccessible *item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
- GList *next = items->next;
-
- if (info->index != item->item->index)
- {
- if (info->index < index)
- g_warning ("Unexpected index value on insertion %d %d", index, info->index);
-
- if (tmp_list == NULL)
- tmp_list = items;
-
- info->index = item->item->index;
- }
-
- items = next;
- }
-
- gtk_icon_view_accessible_traverse_items (self, tmp_list);
- g_signal_emit_by_name (self,
- "children-changed::add",
- index, NULL, NULL);
-}
-
-static void
-gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
- GtkTreePath *path,
- gpointer user_data)
-{
- GtkIconViewAccessible *self = user_data;
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- GList *items;
- GList *tmp_list = NULL;
- GList *deleted_item = NULL;
- int index;
-
- index = gtk_tree_path_get_indices (path)[0];
-
- items = priv->items;
- while (items)
- {
- ItemAccessibleInfo *info = items->data;
- GtkIconViewItemAccessible *item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
- GList *next = items->next;
-
- if (info->index == index)
- {
- deleted_item = items;
- }
- else if (info->index != item->item->index)
- {
- if (tmp_list == NULL)
- tmp_list = items;
-
- info->index = item->item->index;
- }
-
- items = next;
- }
-
- if (deleted_item)
- {
- ItemAccessibleInfo *info = deleted_item->data;
-
- gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item),
- ATK_STATE_DEFUNCT,
- TRUE);
-
- g_signal_emit_by_name (self,
- "children-changed::remove",
- index, NULL, NULL);
-
- priv->items = g_list_delete_link (priv->items, deleted_item);
- g_object_unref (info->item);
- g_free (info);
- }
-
- gtk_icon_view_accessible_traverse_items (self, tmp_list);
-}
-
-static gint
-gtk_icon_view_accessible_item_compare (ItemAccessibleInfo *i1,
- ItemAccessibleInfo *i2)
-{
- return i1->index - i2->index;
-}
-
-static void
-gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gint *new_order,
- gpointer user_data)
-{
- GtkIconViewAccessible *self = user_data;
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- GtkIconView *icon_view;
- GList *items;
- int *order;
- int length, i;
-
- icon_view = GTK_ICON_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (self)));
- length = gtk_tree_model_iter_n_children (tree_model, NULL);
-
- order = g_new (int, length);
- for (i = 0; i < length; i++)
- order [new_order[i]] = i;
-
- items = priv->items;
- while (items)
- {
- ItemAccessibleInfo *info = items->data;
- GtkIconViewItemAccessible *item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
- GList *next = items->next;
-
- info->index = order[info->index];
- item->item = g_list_nth_data (icon_view->priv->items, info->index);
-
- items = next;
- }
-
- g_free (order);
-
- priv->items = g_list_sort (priv->items, (GCompareFunc) gtk_icon_view_accessible_item_compare);
-}
-
-static void
-gtk_icon_view_accessible_disconnect_model_signals (GtkIconViewAccessible *self)
-{
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
-
- g_signal_handlers_disconnect_by_func (priv->model, gtk_icon_view_accessible_model_row_changed, self);
- g_signal_handlers_disconnect_by_func (priv->model, gtk_icon_view_accessible_model_row_inserted, self);
- g_signal_handlers_disconnect_by_func (priv->model, gtk_icon_view_accessible_model_row_deleted, self);
- g_signal_handlers_disconnect_by_func (priv->model, gtk_icon_view_accessible_model_rows_reordered, self);
-}
-
-static void
-gtk_icon_view_accessible_connect_model_signals (GtkIconViewAccessible *self)
-{
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
-
- g_signal_connect_object (priv->model, "row-changed",
- G_CALLBACK (gtk_icon_view_accessible_model_row_changed),
- self, 0);
- g_signal_connect_object (priv->model, "row-inserted",
- G_CALLBACK (gtk_icon_view_accessible_model_row_inserted),
- self, G_CONNECT_AFTER);
- g_signal_connect_object (priv->model, "row-deleted",
- G_CALLBACK (gtk_icon_view_accessible_model_row_deleted),
- self, G_CONNECT_AFTER);
- g_signal_connect_object (priv->model, "rows-reordered",
- G_CALLBACK (gtk_icon_view_accessible_model_rows_reordered),
- self, G_CONNECT_AFTER);
-}
-
-static void
-gtk_icon_view_accessible_clear_cache (GtkIconViewAccessible *self)
-{
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- GList *items;
-
- if (priv->items == NULL)
- return;
-
- items = priv->items;
- while (items != NULL)
- {
- ItemAccessibleInfo *info = items->data;
- GList *next = items->next;
-
- gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item),
- ATK_STATE_DEFUNCT,
- TRUE);
- g_object_unref (info->item);
- g_free (info);
-
- items = next;
- }
-
- g_clear_pointer (&priv->items, g_list_free);
-}
-
-void
-gtk_icon_view_accessible_update_model (GtkIconViewAccessible *self,
- GtkTreeModel *model)
-{
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
-
- if (priv->model != NULL)
- {
- g_object_remove_weak_pointer (G_OBJECT (priv->model),
- (gpointer *) &priv->model);
- gtk_icon_view_accessible_disconnect_model_signals (self);
- }
-
- gtk_icon_view_accessible_clear_cache (self);
-
- priv->model = model;
-
- /* If there is no model the GtkIconView is probably being destroyed */
- if (priv->model != NULL)
- {
- g_object_add_weak_pointer (G_OBJECT (priv->model), (gpointer *) &priv->model);
- gtk_icon_view_accessible_connect_model_signals (self);
- }
-}
-
-static void
-gtk_icon_view_accessible_initialize (AtkObject *accessible,
- gpointer data)
-{
- GtkIconViewAccessible *self = GTK_ICON_VIEW_ACCESSIBLE (accessible);
- GtkIconViewAccessiblePrivate *priv = gtk_icon_view_accessible_get_instance_private (self);
- GtkIconView *icon_view = data;
-
- if (ATK_OBJECT_CLASS (gtk_icon_view_accessible_parent_class)->initialize)
- ATK_OBJECT_CLASS (gtk_icon_view_accessible_parent_class)->initialize (accessible, data);
-
- priv->model = icon_view->priv->model;
- if (priv->model)
- {
- g_object_add_weak_pointer (G_OBJECT (priv->model), (gpointer *) &priv->model);
- gtk_icon_view_accessible_connect_model_signals (self);
- }
-
- accessible->role = ATK_ROLE_LAYERED_PANE;
-}
-
-static void
-gtk_icon_view_accessible_finalize (GObject *object)
-{
- GtkIconViewAccessible *view = GTK_ICON_VIEW_ACCESSIBLE (object);
-
- gtk_icon_view_accessible_clear_cache (view);
-
- G_OBJECT_CLASS (gtk_icon_view_accessible_parent_class)->finalize (object);
-}
-
-static void
-gtk_icon_view_accessible_class_init (GtkIconViewAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
-
- gobject_class->finalize = gtk_icon_view_accessible_finalize;
-
- atk_class->get_n_children = gtk_icon_view_accessible_get_n_children;
- atk_class->ref_child = gtk_icon_view_accessible_ref_child;
- atk_class->initialize = gtk_icon_view_accessible_initialize;
-}
-
-static void
-gtk_icon_view_accessible_init (GtkIconViewAccessible *accessible)
-{
-}
-
-static AtkObject*
-gtk_icon_view_accessible_ref_accessible_at_point (AtkComponent *component,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- GtkWidget *widget;
- GtkIconView *icon_view;
- GtkIconViewItem *item;
- gint x_pos, y_pos;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
- if (widget == NULL)
- return NULL;
-
- icon_view = GTK_ICON_VIEW (widget);
- atk_component_get_extents (component, &x_pos, &y_pos, NULL, NULL, coord_type);
- item = _gtk_icon_view_get_item_at_coords (icon_view, x - x_pos, y - y_pos, TRUE, NULL);
- if (item)
- return gtk_icon_view_accessible_ref_child (ATK_OBJECT (component), item->index);
-
- return NULL;
-}
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- iface->ref_accessible_at_point = gtk_icon_view_accessible_ref_accessible_at_point;
-}
-
-static gboolean
-gtk_icon_view_accessible_add_selection (AtkSelection *selection,
- gint i)
-{
- GtkWidget *widget;
- GtkIconView *icon_view;
- GtkIconViewItem *item;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- icon_view = GTK_ICON_VIEW (widget);
-
- item = g_list_nth_data (icon_view->priv->items, i);
- if (!item)
- return FALSE;
-
- _gtk_icon_view_select_item (icon_view, item);
-
- return TRUE;
-}
-
-static gboolean
-gtk_icon_view_accessible_clear_selection (AtkSelection *selection)
-{
- GtkWidget *widget;
- GtkIconView *icon_view;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- icon_view = GTK_ICON_VIEW (widget);
- gtk_icon_view_unselect_all (icon_view);
-
- return TRUE;
-}
-
-static AtkObject*
-gtk_icon_view_accessible_ref_selection (AtkSelection *selection,
- gint i)
-{
- GList *l;
- GtkWidget *widget;
- GtkIconView *icon_view;
- GtkIconViewItem *item;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return NULL;
-
- icon_view = GTK_ICON_VIEW (widget);
-
- l = icon_view->priv->items;
- while (l)
- {
- item = l->data;
- if (item->selected)
- {
- if (i == 0)
- return atk_object_ref_accessible_child (gtk_widget_get_accessible (widget), item->index);
- else
- i--;
- }
- l = l->next;
- }
-
- return NULL;
-}
-
-static gint
-gtk_icon_view_accessible_get_selection_count (AtkSelection *selection)
-{
- GtkWidget *widget;
- GtkIconView *icon_view;
- GtkIconViewItem *item;
- GList *l;
- gint count;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return 0;
-
- icon_view = GTK_ICON_VIEW (widget);
-
- l = icon_view->priv->items;
- count = 0;
- while (l)
- {
- item = l->data;
-
- if (item->selected)
- count++;
-
- l = l->next;
- }
-
- return count;
-}
-
-static gboolean
-gtk_icon_view_accessible_is_child_selected (AtkSelection *selection,
- gint i)
-{
- GtkWidget *widget;
- GtkIconView *icon_view;
- GtkIconViewItem *item;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- icon_view = GTK_ICON_VIEW (widget);
-
- item = g_list_nth_data (icon_view->priv->items, i);
- if (!item)
- return FALSE;
-
- return item->selected;
-}
-
-static gboolean
-gtk_icon_view_accessible_remove_selection (AtkSelection *selection,
- gint i)
-{
- GtkWidget *widget;
- GtkIconView *icon_view;
- GtkIconViewItem *item;
- GList *l;
- gint count;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- icon_view = GTK_ICON_VIEW (widget);
- l = icon_view->priv->items;
- count = 0;
- while (l)
- {
- item = l->data;
- if (item->selected)
- {
- if (count == i)
- {
- _gtk_icon_view_unselect_item (icon_view, item);
- return TRUE;
- }
- count++;
- }
- l = l->next;
- }
-
- return FALSE;
-}
-
-static gboolean
-gtk_icon_view_accessible_select_all_selection (AtkSelection *selection)
-{
- GtkWidget *widget;
- GtkIconView *icon_view;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- icon_view = GTK_ICON_VIEW (widget);
- gtk_icon_view_select_all (icon_view);
- return TRUE;
-}
-
-static void
-atk_selection_interface_init (AtkSelectionIface *iface)
-{
- iface->add_selection = gtk_icon_view_accessible_add_selection;
- iface->clear_selection = gtk_icon_view_accessible_clear_selection;
- iface->ref_selection = gtk_icon_view_accessible_ref_selection;
- iface->get_selection_count = gtk_icon_view_accessible_get_selection_count;
- iface->is_child_selected = gtk_icon_view_accessible_is_child_selected;
- iface->remove_selection = gtk_icon_view_accessible_remove_selection;
- iface->select_all_selection = gtk_icon_view_accessible_select_all_selection;
-}
diff --git a/gtk/a11y/gtkiconviewaccessible.h b/gtk/a11y/gtkiconviewaccessible.h
deleted file mode 100644
index a6c51151a6..0000000000
--- a/gtk/a11y/gtkiconviewaccessible.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2002, 2004 Anders Carlsson
- *
- * 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 .
- */
-
-#ifndef __GTK_ICON_VIEW_ACCESSIBLE_H__
-#define __GTK_ICON_VIEW_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_ICON_VIEW_ACCESSIBLE (gtk_icon_view_accessible_get_type ())
-#define GTK_ICON_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW_ACCESSIBLE, GtkIconViewAccessible))
-#define GTK_ICON_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW_ACCESSIBLE, GtkIconViewAccessibleClass))
-#define GTK_IS_ICON_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW_ACCESSIBLE))
-#define GTK_IS_ICON_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW_ACCESSIBLE))
-#define GTK_ICON_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW_ACCESSIBLE, GtkIconViewAccessibleClass))
-
-typedef struct _GtkIconViewAccessible GtkIconViewAccessible;
-typedef struct _GtkIconViewAccessibleClass GtkIconViewAccessibleClass;
-
-struct _GtkIconViewAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkIconViewAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_icon_view_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_ICON_VIEW_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkiconviewaccessibleprivate.h b/gtk/a11y/gtkiconviewaccessibleprivate.h
deleted file mode 100644
index f5f36694ed..0000000000
--- a/gtk/a11y/gtkiconviewaccessibleprivate.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2002, 2004 Anders Carlsson
- *
- * 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 .
- */
-
-#ifndef __GTK_ICON_VIEW_ACCESSIBLE_PRIVATE_H__
-#define __GTK_ICON_VIEW_ACCESSIBLE_PRIVATE_H__
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-void gtk_icon_view_accessible_adjustment_changed (GtkIconViewAccessible *self);
-
-void gtk_icon_view_accessible_update_model (GtkIconViewAccessible *self,
- GtkTreeModel *model);
-
-G_END_DECLS
-
-#endif /* __GTK_ICON_VIEW_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkimageaccessible.c b/gtk/a11y/gtkimageaccessible.c
deleted file mode 100644
index e299f3d4cc..0000000000
--- a/gtk/a11y/gtkimageaccessible.c
+++ /dev/null
@@ -1,338 +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
-#include "gtkimageaccessible.h"
-#include "gtkimageprivate.h"
-#include "gtkintl.h"
-
-struct _GtkImageAccessiblePrivate
-{
- gchar *image_description;
- gchar *stock_name;
-};
-
-static void atk_image_interface_init (AtkImageIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkImageAccessible, gtk_image_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkImageAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
-
-static void
-gtk_image_accessible_initialize (AtkObject *accessible,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_image_accessible_parent_class)->initialize (accessible, data);
-
- accessible->role = ATK_ROLE_ICON;
-}
-
-typedef struct {
- const gchar *name;
- const gchar *label;
-} NameMapEntry;
-
-static const NameMapEntry name_map[] = {
- { "help-about", NC_("Stock label", "_About") },
- { "list-add", NC_("Stock label", "_Add") },
- { "format-text-bold", NC_("Stock label", "_Bold") },
- { "media-optical", NC_("Stock label", "_CD-ROM") },
- { "edit-clear", NC_("Stock label", "_Clear") },
- { "window-close", NC_("Stock label", "_Close") },
- { "window-minimize", N_("Minimize") },
- { "window-maximize", N_("Maximize") },
- { "window-restore", N_("Restore") },
- { "edit-copy", NC_("Stock label", "_Copy") },
- { "edit-cut", NC_("Stock label", "Cu_t") },
- { "edit-delete", NC_("Stock label", "_Delete") },
- { "dialog-error", NC_("Stock label", "Error") },
- { "dialog-information", NC_("Stock label", "Information") },
- { "dialog-question", NC_("Stock label", "Question") },
- { "dialog-warning", NC_("Stock label", "Warning") },
- { "system-run", NC_("Stock label", "_Execute") },
- { "text-x-generic", NC_("Stock label", "_File") },
- { "edit-find", NC_("Stock label", "_Find") },
- { "edit-find-replace", NC_("Stock label", "Find and _Replace") },
- { "media-floppy", NC_("Stock label", "_Floppy") },
- { "view-fullscreen", NC_("Stock label", "_Fullscreen") },
- { "go-bottom", NC_("Stock label, navigation", "_Bottom") },
- { "go-first", NC_("Stock label, navigation", "_First") },
- { "go-last", NC_("Stock label, navigation", "_Last") },
- { "go-top", NC_("Stock label, navigation", "_Top") },
- { "go-previous", NC_("Stock label, navigation", "_Back") },
- { "go-down", NC_("Stock label, navigation", "_Down") },
- { "go-next", NC_("Stock label, navigation", "_Forward") },
- { "go-up", NC_("Stock label, navigation", "_Up") },
- { "drive-harddisk", NC_("Stock label", "_Hard Disk") },
- { "help-contents", NC_("Stock label", "_Help") },
- { "go-home", NC_("Stock label", "_Home") },
- { "format-indent-more", NC_("Stock label", "Increase Indent") },
- { "format-text-italic", NC_("Stock label", "_Italic") },
- { "go-jump", NC_("Stock label", "_Jump to") },
- { "format-justify-center", NC_("Stock label", "_Center") },
- { "format-justify-fill", NC_("Stock label", "_Fill") },
- { "format-justify-left", NC_("Stock label", "_Left") },
- { "format-justify-right", NC_("Stock label", "_Right") },
- { "view-restore", NC_("Stock label", "_Leave Fullscreen") },
- { "media-seek-forward", NC_("Stock label, media", "_Forward") },
- { "media-skip-forward", NC_("Stock label, media", "_Next") },
- { "media-playback-pause", NC_("Stock label, media", "P_ause") },
- { "media-playback-start", NC_("Stock label, media", "_Play") },
- { "media-skip-backward", NC_("Stock label, media", "Pre_vious") },
- { "media-record", NC_("Stock label, media", "_Record") },
- { "media-seek-backward", NC_("Stock label, media", "R_ewind") },
- { "media-playback-stop", NC_("Stock label, media", "_Stop") },
- { "network-idle", NC_("Stock label", "_Network") },
- { "document-new", NC_("Stock label", "_New") },
- { "document-open", NC_("Stock label", "_Open") },
- { "edit-paste", NC_("Stock label", "_Paste") },
- { "document-print", NC_("Stock label", "_Print") },
- { "document-print-preview", NC_("Stock label", "Print Pre_view") },
- { "document-properties", NC_("Stock label", "_Properties") },
- { "application-exit", NC_("Stock label", "_Quit") },
- { "edit-redo", NC_("Stock label", "_Redo") },
- { "view-refresh", NC_("Stock label", "_Refresh") },
- { "list-remove", NC_("Stock label", "_Remove") },
- { "document-revert", NC_("Stock label", "_Revert") },
- { "document-save", NC_("Stock label", "_Save") },
- { "document-save-as", NC_("Stock label", "Save _As") },
- { "edit-select-all", NC_("Stock label", "Select _All") },
- { "view-sort-ascending", NC_("Stock label", "_Ascending") },
- { "view-sort-descending", NC_("Stock label", "_Descending") },
- { "tools-check-spelling", NC_("Stock label", "_Spell Check") },
- { "process-stop", NC_("Stock label", "_Stop") },
- { "format-text-strikethrough", NC_("Stock label", "_Strikethrough") },
- { "format-text-underline", NC_("Stock label", "_Underline") },
- { "edit-undo", NC_("Stock label", "_Undo") },
- { "format-indent-less", NC_("Stock label", "Decrease Indent") },
- { "zoom-original", NC_("Stock label", "_Normal Size") },
- { "zoom-fit-best", NC_("Stock label", "Best _Fit") },
- { "zoom-in", NC_("Stock label", "Zoom _In") },
- { "zoom-out", NC_("Stock label", "Zoom _Out") }
-};
-
-/* GTK+ internal methods */
-static gchar *
-elide_underscores (const gchar *original)
-{
- gchar *q, *result;
- const gchar *p, *end;
- gsize len;
- gboolean last_underscore;
-
- if (!original)
- return NULL;
-
- len = strlen (original);
- q = result = g_malloc (len + 1);
- last_underscore = FALSE;
-
- end = original + len;
- for (p = original; p < end; p++)
- {
- if (!last_underscore && *p == '_')
- last_underscore = TRUE;
- else
- {
- last_underscore = FALSE;
- if (original + 2 <= p && p + 1 <= end &&
- p[-2] == '(' && p[-1] == '_' && p[0] != '_' && p[1] == ')')
- {
- q--;
- *q = '\0';
- p++;
- }
- else
- *q++ = *p;
- }
- }
-
- if (last_underscore)
- *q++ = '_';
-
- *q = '\0';
-
- return result;
-}
-
-static gchar *
-name_from_icon_name (const gchar *icon_name)
-{
- gchar *name;
- const gchar *label;
- gint i;
-
- name = g_strdup (icon_name);
- if (g_str_has_suffix (name, "-symbolic"))
- name[strlen (name) - strlen ("-symbolic")] = '\0';
-
- for (i = 0; i < G_N_ELEMENTS (name_map); i++)
- {
- if (g_str_equal (name, name_map[i].name))
- {
- label = g_dpgettext2 (GETTEXT_PACKAGE, "Stock label", name_map[i].label);
- g_free (name);
-
- return elide_underscores (label);
- }
- }
-
- g_free (name);
- return NULL;
-}
-
-static void
-gtk_image_accessible_finalize (GObject *object)
-{
- GtkImageAccessible *aimage = GTK_IMAGE_ACCESSIBLE (object);
-
- g_free (aimage->priv->image_description);
- g_free (aimage->priv->stock_name);
-
- G_OBJECT_CLASS (gtk_image_accessible_parent_class)->finalize (object);
-}
-
-static const gchar *
-gtk_image_accessible_get_name (AtkObject *accessible)
-{
- GtkWidget* widget;
- GtkImage *image;
- GtkImageAccessible *image_accessible;
- const gchar *name;
- GtkImageType storage_type;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_image_accessible_parent_class)->get_name (accessible);
- if (name)
- return name;
-
- image = GTK_IMAGE (widget);
- image_accessible = GTK_IMAGE_ACCESSIBLE (accessible);
-
- g_free (image_accessible->priv->stock_name);
- image_accessible->priv->stock_name = NULL;
-
- storage_type = gtk_image_get_storage_type (image);
-
- if (storage_type == GTK_IMAGE_ICON_NAME)
- {
- image_accessible->priv->stock_name = name_from_icon_name (gtk_image_get_icon_name (image));
- }
- else if (storage_type == GTK_IMAGE_GICON)
- {
- GIcon *icon;
- const gchar * const *icon_names;
-
- icon = gtk_image_get_gicon (image);
- if (G_IS_THEMED_ICON (icon))
- {
- icon_names = g_themed_icon_get_names (G_THEMED_ICON (icon));
- image_accessible->priv->stock_name = name_from_icon_name (icon_names[0]);
- }
- }
-
- return image_accessible->priv->stock_name;
-}
-
-static void
-gtk_image_accessible_class_init (GtkImageAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- gobject_class->finalize = gtk_image_accessible_finalize;
- class->initialize = gtk_image_accessible_initialize;
- class->get_name = gtk_image_accessible_get_name;
-}
-
-static void
-gtk_image_accessible_init (GtkImageAccessible *image)
-{
- image->priv = gtk_image_accessible_get_instance_private (image);
-}
-
-static const gchar *
-gtk_image_accessible_get_image_description (AtkImage *image)
-{
- GtkImageAccessible *accessible = GTK_IMAGE_ACCESSIBLE (image);
-
- return accessible->priv->image_description;
-}
-
-static void
-gtk_image_accessible_get_image_position (AtkImage *image,
- gint *x,
- gint *y,
- AtkCoordType coord_type)
-{
- atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL,
- coord_type);
-}
-
-static void
-gtk_image_accessible_get_image_size (AtkImage *image,
- gint *width,
- gint *height)
-{
- GtkWidget* widget;
- GtkImage *gtk_image;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
- if (widget == NULL)
- {
- *height = -1;
- *width = -1;
- return;
- }
-
- gtk_image = GTK_IMAGE (widget);
-
- if (gtk_image_get_storage_type (gtk_image) != GTK_IMAGE_EMPTY)
- gtk_image_get_image_size (gtk_image, width, height);
- else
- {
- *height = 0;
- *width = 0;
- }
-}
-
-static gboolean
-gtk_image_accessible_set_image_description (AtkImage *image,
- const gchar *description)
-{
- GtkImageAccessible* accessible = GTK_IMAGE_ACCESSIBLE (image);
-
- g_free (accessible->priv->image_description);
- accessible->priv->image_description = g_strdup (description);
-
- return TRUE;
-}
-
-static void
-atk_image_interface_init (AtkImageIface *iface)
-{
- iface->get_image_description = gtk_image_accessible_get_image_description;
- iface->get_image_position = gtk_image_accessible_get_image_position;
- iface->get_image_size = gtk_image_accessible_get_image_size;
- iface->set_image_description = gtk_image_accessible_set_image_description;
-}
diff --git a/gtk/a11y/gtkimageaccessible.h b/gtk/a11y/gtkimageaccessible.h
deleted file mode 100644
index 47e0edc403..0000000000
--- a/gtk/a11y/gtkimageaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_IMAGE_ACCESSIBLE_H__
-#define __GTK_IMAGE_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_IMAGE_ACCESSIBLE (gtk_image_accessible_get_type ())
-#define GTK_IMAGE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IMAGE_ACCESSIBLE, GtkImageAccessible))
-#define GTK_IMAGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMAGE_ACCESSIBLE, GtkImageAccessibleClass))
-#define GTK_IS_IMAGE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IMAGE_ACCESSIBLE))
-#define GTK_IS_IMAGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE_ACCESSIBLE))
-#define GTK_IMAGE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE_ACCESSIBLE, GtkImageAccessibleClass))
-
-typedef struct _GtkImageAccessible GtkImageAccessible;
-typedef struct _GtkImageAccessibleClass GtkImageAccessibleClass;
-typedef struct _GtkImageAccessiblePrivate GtkImageAccessiblePrivate;
-
-struct _GtkImageAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkImageAccessiblePrivate *priv;
-};
-
-struct _GtkImageAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_image_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_IMAGE_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkimagecellaccessible.c b/gtk/a11y/gtkimagecellaccessible.c
deleted file mode 100644
index 152c456c26..0000000000
--- a/gtk/a11y/gtkimagecellaccessible.c
+++ /dev/null
@@ -1,123 +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 "gtkimagecellaccessible.h"
-
-struct _GtkImageCellAccessiblePrivate
-{
- gchar *image_description;
-};
-
-static void atk_image_interface_init (AtkImageIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkImageCellAccessible, gtk_image_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
- G_ADD_PRIVATE (GtkImageCellAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
-
-static void
-gtk_image_cell_accessible_finalize (GObject *object)
-{
- GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (object);
-
- g_free (image_cell->priv->image_description);
- G_OBJECT_CLASS (gtk_image_cell_accessible_parent_class)->finalize (object);
-}
-
-static void
-gtk_image_cell_accessible_class_init (GtkImageCellAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
- gobject_class->finalize = gtk_image_cell_accessible_finalize;
-}
-
-static void
-gtk_image_cell_accessible_init (GtkImageCellAccessible *image_cell)
-{
- image_cell->priv = gtk_image_cell_accessible_get_instance_private (image_cell);
-}
-
-static const gchar *
-gtk_image_cell_accessible_get_image_description (AtkImage *image)
-{
- GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (image);
-
- return image_cell->priv->image_description;
-}
-
-static gboolean
-gtk_image_cell_accessible_set_image_description (AtkImage *image,
- const gchar *description)
-{
- GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (image);
-
- g_free (image_cell->priv->image_description);
- image_cell->priv->image_description = g_strdup (description);
-
- if (image_cell->priv->image_description)
- return TRUE;
- else
- return FALSE;
-}
-
-static void
-gtk_image_cell_accessible_get_image_position (AtkImage *image,
- gint *x,
- gint *y,
- AtkCoordType coord_type)
-{
- atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL,
- coord_type);
-}
-
-static void
-gtk_image_cell_accessible_get_image_size (AtkImage *image,
- gint *width,
- gint *height)
-{
- GtkImageCellAccessible *cell = GTK_IMAGE_CELL_ACCESSIBLE (image);
- GtkCellRenderer *cell_renderer;
- GdkPixbuf *pixbuf = NULL;
-
- *width = 0;
- *height = 0;
-
- g_object_get (cell, "renderer", &cell_renderer, NULL);
- g_object_get (cell_renderer,
- "pixbuf", &pixbuf,
- NULL);
- g_object_unref (cell_renderer);
-
- if (pixbuf)
- {
- *width = gdk_pixbuf_get_width (pixbuf);
- *height = gdk_pixbuf_get_height (pixbuf);
- g_object_unref (pixbuf);
- }
-}
-
-static void
-atk_image_interface_init (AtkImageIface *iface)
-{
- iface->get_image_description = gtk_image_cell_accessible_get_image_description;
- iface->set_image_description = gtk_image_cell_accessible_set_image_description;
- iface->get_image_position = gtk_image_cell_accessible_get_image_position;
- iface->get_image_size = gtk_image_cell_accessible_get_image_size;
-}
diff --git a/gtk/a11y/gtkimagecellaccessible.h b/gtk/a11y/gtkimagecellaccessible.h
deleted file mode 100644
index 5ab1c22e6e..0000000000
--- a/gtk/a11y/gtkimagecellaccessible.h
+++ /dev/null
@@ -1,58 +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 .
- */
-
-#ifndef __GTK_IMAGE_CELL_ACCESSIBLE_H__
-#define __GTK_IMAGE_CELL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_IMAGE_CELL_ACCESSIBLE (gtk_image_cell_accessible_get_type ())
-#define GTK_IMAGE_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IMAGE_CELL_ACCESSIBLE, GtkImageCellAccessible))
-#define GTK_IMAGE_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_IMAGE_CELL_ACCESSIBLE, GtkImageCellAccessibleClass))
-#define GTK_IS_IMAGE_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IMAGE_CELL_ACCESSIBLE))
-#define GTK_IS_IMAGE_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE_CELL_ACCESSIBLE))
-#define GTK_IMAGE_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE_CELL_ACCESSIBLE, GtkImageCellAccessibleClass))
-
-typedef struct _GtkImageCellAccessible GtkImageCellAccessible;
-typedef struct _GtkImageCellAccessibleClass GtkImageCellAccessibleClass;
-typedef struct _GtkImageCellAccessiblePrivate GtkImageCellAccessiblePrivate;
-
-struct _GtkImageCellAccessible
-{
- GtkRendererCellAccessible parent;
-
- GtkImageCellAccessiblePrivate *priv;
-};
-
-struct _GtkImageCellAccessibleClass
-{
- GtkRendererCellAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_image_cell_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_IMAGE_CELL_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtklabelaccessible.c b/gtk/a11y/gtklabelaccessible.c
deleted file mode 100644
index 2048a7c0b3..0000000000
--- a/gtk/a11y/gtklabelaccessible.c
+++ /dev/null
@@ -1,1192 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 .
- */
-
-/* Preamble {{{1 */
-
-#include "config.h"
-
-#include
-#include
-#include "gtkwidgetprivate.h"
-#include "gtklabelprivate.h"
-#include "gtklabelaccessible.h"
-#include "gtklabelaccessibleprivate.h"
-#include "gtkstylecontextprivate.h"
-
-struct _GtkLabelAccessiblePrivate
-{
- gint cursor_position;
- gint selection_bound;
-
- GList *links;
-};
-
-typedef struct _GtkLabelAccessibleLink GtkLabelAccessibleLink;
-typedef struct _GtkLabelAccessibleLinkClass GtkLabelAccessibleLinkClass;
-
-struct _GtkLabelAccessibleLink
-{
- AtkHyperlink parent;
-
- GtkLabelAccessible *label;
- gint index;
- gboolean focused;
-};
-
-struct _GtkLabelAccessibleLinkClass
-{
- AtkHyperlinkClass parent_class;
-};
-
-static GtkLabelAccessibleLink *gtk_label_accessible_link_new (GtkLabelAccessible *label,
- gint idx);
-
-typedef struct _GtkLabelAccessibleLinkImpl GtkLabelAccessibleLinkImpl;
-typedef struct _GtkLabelAccessibleLinkImplClass GtkLabelAccessibleLinkImplClass;
-
-struct _GtkLabelAccessibleLinkImpl
-{
- AtkObject parent;
-
- GtkLabelAccessibleLink *link;
-};
-
-struct _GtkLabelAccessibleLinkImplClass
-{
- AtkObjectClass parent_class;
-};
-
-/* GtkLabelAccessibleLinkImpl {{{1 */
-
-GType _gtk_label_accessible_link_impl_get_type (void);
-
-static void atk_hyperlink_impl_interface_init (AtkHyperlinkImplIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkLabelAccessibleLinkImpl, _gtk_label_accessible_link_impl, ATK_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERLINK_IMPL, atk_hyperlink_impl_interface_init))
-
-static AtkHyperlink *
-gtk_label_accessible_link_impl_get_hyperlink (AtkHyperlinkImpl *atk_impl)
-{
- GtkLabelAccessibleLinkImpl *impl = (GtkLabelAccessibleLinkImpl *)atk_impl;
-
- return (AtkHyperlink *)g_object_ref (impl->link);
-}
-
-static void
-atk_hyperlink_impl_interface_init (AtkHyperlinkImplIface *iface)
-{
- iface->get_hyperlink = gtk_label_accessible_link_impl_get_hyperlink;
-}
-
-static AtkStateSet *
-gtk_label_accessible_link_impl_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkLabelAccessibleLink *link;
- GtkWidget *widget;
-
- link = ((GtkLabelAccessibleLinkImpl *)obj)->link;
-
- state_set = atk_object_ref_state_set (atk_object_get_parent (obj));
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_object_get_parent (obj)));
- if (widget)
- {
- if (gtk_widget_get_can_focus (widget))
- {
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
- if (_gtk_label_get_link_focused (GTK_LABEL (widget), link->index))
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
- else
- atk_state_set_remove_state (state_set, ATK_STATE_FOCUSED);
- }
-
- if (_gtk_label_get_link_visited (GTK_LABEL (widget), link->index))
- atk_state_set_add_state (state_set, ATK_STATE_VISITED);
- }
-
- return state_set;
-}
-
-static void
-_gtk_label_accessible_link_impl_init (GtkLabelAccessibleLinkImpl *impl)
-{
- atk_object_set_role (ATK_OBJECT (impl), ATK_ROLE_LINK);
-}
-
-static void
-_gtk_label_accessible_link_impl_finalize (GObject *obj)
-{
- GtkLabelAccessibleLinkImpl *impl = (GtkLabelAccessibleLinkImpl *)obj;
-
- g_object_unref (impl->link);
-
- G_OBJECT_CLASS (_gtk_label_accessible_link_impl_parent_class)->finalize (obj);
-}
-
-static void
-_gtk_label_accessible_link_impl_class_init (GtkLabelAccessibleLinkImplClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
- AtkObjectClass *atk_obj_class = ATK_OBJECT_CLASS (class);
-
- object_class->finalize = _gtk_label_accessible_link_impl_finalize;
- atk_obj_class->ref_state_set = gtk_label_accessible_link_impl_ref_state_set;
-}
-
-/* 'Public' API {{{2 */
-
-static GtkLabelAccessibleLinkImpl *
-gtk_label_accessible_link_impl_new (GtkLabelAccessible *label,
- gint idx)
-{
- GtkLabelAccessibleLinkImpl *impl;
-
- impl = g_object_new (_gtk_label_accessible_link_impl_get_type (), NULL);
- impl->link = gtk_label_accessible_link_new (label, idx);
- atk_object_set_parent (ATK_OBJECT (impl), ATK_OBJECT (label));
-
- return impl;
-}
-
-/* GtkLabelAccessibleLink {{{1 */
-
-GType _gtk_label_accessible_link_get_type (void);
-
-static void atk_action_interface_init (AtkActionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkLabelAccessibleLink, _gtk_label_accessible_link, ATK_TYPE_HYPERLINK,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static gchar *
-gtk_label_accessible_link_get_uri (AtkHyperlink *atk_link,
- gint i)
-{
- GtkLabelAccessibleLink *link = (GtkLabelAccessibleLink *)atk_link;
- GtkWidget *widget;
- const gchar *uri;
-
- g_return_val_if_fail (i == 0, NULL);
-
- if (link->label == NULL)
- return NULL;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (link->label));
- uri = _gtk_label_get_link_uri (GTK_LABEL (widget), link->index);
-
- return g_strdup (uri);
-}
-
-static gint
-gtk_label_accessible_link_get_n_anchors (AtkHyperlink *atk_link)
-{
- return 1;
-}
-
-static gboolean
-gtk_label_accessible_link_is_valid (AtkHyperlink *atk_link)
-{
- return TRUE;
-}
-
-static AtkObject *
-gtk_label_accessible_link_get_object (AtkHyperlink *atk_link,
- gint i)
-{
- GtkLabelAccessibleLink *link = (GtkLabelAccessibleLink *)atk_link;
-
- g_return_val_if_fail (i == 0, NULL);
-
- return ATK_OBJECT (link->label);
-}
-
-static gint
-gtk_label_accessible_link_get_start_index (AtkHyperlink *atk_link)
-{
- GtkLabelAccessibleLink *link = (GtkLabelAccessibleLink *)atk_link;
- GtkWidget *widget;
- gint start, end;
-
- if (link->label == NULL)
- return 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (link->label));
- _gtk_label_get_link_extent (GTK_LABEL (widget), link->index, &start, &end);
-
- return start;
-}
-
-static gint
-gtk_label_accessible_link_get_end_index (AtkHyperlink *atk_link)
-{
- GtkLabelAccessibleLink *link = (GtkLabelAccessibleLink *)atk_link;
- GtkWidget *widget;
- gint start, end;
-
- if (link->label == NULL)
- return 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (link->label));
- _gtk_label_get_link_extent (GTK_LABEL (widget), link->index, &start, &end);
-
- return end;
-}
-
-static void
-_gtk_label_accessible_link_init (GtkLabelAccessibleLink *link)
-{
-}
-
-static void
-_gtk_label_accessible_link_class_init (GtkLabelAccessibleLinkClass *class)
-{
- AtkHyperlinkClass *atk_link_class = ATK_HYPERLINK_CLASS (class);
-
- atk_link_class->get_uri = gtk_label_accessible_link_get_uri;
- atk_link_class->get_n_anchors = gtk_label_accessible_link_get_n_anchors;
- atk_link_class->is_valid = gtk_label_accessible_link_is_valid;
- atk_link_class->get_object = gtk_label_accessible_link_get_object;
- atk_link_class->get_start_index = gtk_label_accessible_link_get_start_index;
- atk_link_class->get_end_index = gtk_label_accessible_link_get_end_index;
-}
-
-/* 'Public' API {{{2 */
-
-static GtkLabelAccessibleLink *
-gtk_label_accessible_link_new (GtkLabelAccessible *label,
- gint idx)
-{
- GtkLabelAccessibleLink *link;
-
- link = g_object_new (_gtk_label_accessible_link_get_type (), NULL);
- link->label = label;
- link->index = idx;
-
- return link;
-}
-
-/* AtkAction implementation {{{2 */
-
-static gboolean
-gtk_label_accessible_link_do_action (AtkAction *action,
- gint i)
-{
- GtkLabelAccessibleLink *link = (GtkLabelAccessibleLink *)action;
- GtkWidget *widget;
-
- if (i != 0)
- return FALSE;
-
- if (link->label == NULL)
- return FALSE;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (link->label));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- _gtk_label_activate_link (GTK_LABEL (widget), link->index);
-
- return TRUE;
-}
-
-static gint
-gtk_label_accessible_link_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_label_accessible_link_get_name (AtkAction *action,
- gint i)
-{
- if (i != 0)
- return NULL;
-
- return "activate";
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_label_accessible_link_do_action;
- iface->get_n_actions = gtk_label_accessible_link_get_n_actions;
- iface->get_name = gtk_label_accessible_link_get_name;
-}
-
-/* GtkLabelAccessible {{{1 */
-
-static void atk_text_interface_init (AtkTextIface *iface);
-static void atk_hypertext_interface_init (AtkHypertextIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkLabelAccessible, gtk_label_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkLabelAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERTEXT, atk_hypertext_interface_init))
-
-static void
-gtk_label_accessible_init (GtkLabelAccessible *label)
-{
- label->priv = gtk_label_accessible_get_instance_private (label);
-}
-
-static void
-gtk_label_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkWidget *widget;
-
- ATK_OBJECT_CLASS (gtk_label_accessible_parent_class)->initialize (obj, data);
-
- widget = GTK_WIDGET (data);
-
- _gtk_label_accessible_update_links (GTK_LABEL (widget));
-
- /* Check whether ancestor of GtkLabel is a GtkButton
- * and if so set accessible parent for GtkLabelAccessible
- */
- while (widget != NULL)
- {
- widget = gtk_widget_get_parent (widget);
- if (GTK_IS_BUTTON (widget))
- {
- atk_object_set_parent (obj, gtk_widget_get_accessible (widget));
- break;
- }
- }
-
- obj->role = ATK_ROLE_LABEL;
-}
-
-static gboolean
-check_for_selection_change (GtkLabelAccessible *accessible,
- GtkLabel *label)
-{
- gboolean ret_val = FALSE;
- gint start, end;
-
- if (gtk_label_get_selection_bounds (label, &start, &end))
- {
- if (end != accessible->priv->cursor_position ||
- start != accessible->priv->selection_bound)
- ret_val = TRUE;
- }
- else
- {
- ret_val = (accessible->priv->cursor_position != accessible->priv->selection_bound);
- }
-
- accessible->priv->cursor_position = end;
- accessible->priv->selection_bound = start;
-
- return ret_val;
-}
-
-/* atkobject.h */
-
-static AtkStateSet *
-gtk_label_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- state_set = ATK_OBJECT_CLASS (gtk_label_accessible_parent_class)->ref_state_set (accessible);
- atk_state_set_add_state (state_set, ATK_STATE_MULTI_LINE);
-
- return state_set;
-}
-
-static AtkRelationSet *
-gtk_label_accessible_ref_relation_set (AtkObject *obj)
-{
- GtkWidget *widget;
- AtkRelationSet *relation_set;
-
- g_return_val_if_fail (GTK_IS_LABEL_ACCESSIBLE (obj), NULL);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- relation_set = ATK_OBJECT_CLASS (gtk_label_accessible_parent_class)->ref_relation_set (obj);
-
- if (!atk_relation_set_contains (relation_set, ATK_RELATION_LABEL_FOR))
- {
- /* Get the mnemonic widget.
- * The relation set is not updated if the mnemonic widget is changed
- */
- GtkWidget *mnemonic_widget;
-
- mnemonic_widget = gtk_label_get_mnemonic_widget (GTK_LABEL (widget));
-
- if (mnemonic_widget)
- {
- AtkObject *accessible_array[1];
- AtkRelation* relation;
-
- accessible_array[0] = gtk_widget_get_accessible (mnemonic_widget);
- relation = atk_relation_new (accessible_array, 1,
- ATK_RELATION_LABEL_FOR);
- atk_relation_set_add (relation_set, relation);
- /*
- * Unref the relation so that it is not leaked.
- */
- g_object_unref (relation);
- }
- }
- return relation_set;
-}
-
-static const gchar*
-gtk_label_accessible_get_name (AtkObject *accessible)
-{
- const gchar *name;
-
- g_return_val_if_fail (GTK_IS_LABEL_ACCESSIBLE (accessible), NULL);
-
- name = ATK_OBJECT_CLASS (gtk_label_accessible_parent_class)->get_name (accessible);
- if (name != NULL)
- return name;
- else
- {
- /*
- * Get the text on the label
- */
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- g_return_val_if_fail (GTK_IS_LABEL (widget), NULL);
-
- return gtk_label_get_text (GTK_LABEL (widget));
- }
-}
-
-static gint
-gtk_label_accessible_get_n_children (AtkObject *obj)
-{
- GtkLabelAccessible *accessible = GTK_LABEL_ACCESSIBLE (obj);
-
- return g_list_length (accessible->priv->links);
-}
-
-static AtkObject *
-gtk_label_accessible_ref_child (AtkObject *obj,
- gint idx)
-{
- GtkLabelAccessible *accessible = GTK_LABEL_ACCESSIBLE (obj);
- AtkObject *child;
-
- child = g_list_nth_data (accessible->priv->links, idx);
-
- if (child)
- g_object_ref (child);
-
- return child;
-}
-
-static void clear_links (GtkLabelAccessible *accessible);
-
-static void
-gtk_label_accessible_finalize (GObject *obj)
-{
- GtkLabelAccessible *accessible = GTK_LABEL_ACCESSIBLE (obj);
-
- clear_links (accessible);
-
- G_OBJECT_CLASS (gtk_label_accessible_parent_class)->finalize (obj);
-}
-
-static void
-gtk_label_accessible_class_init (GtkLabelAccessibleClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- object_class->finalize = gtk_label_accessible_finalize;
-
- class->get_name = gtk_label_accessible_get_name;
- class->ref_state_set = gtk_label_accessible_ref_state_set;
- class->ref_relation_set = gtk_label_accessible_ref_relation_set;
- class->initialize = gtk_label_accessible_initialize;
-
- class->get_n_children = gtk_label_accessible_get_n_children;
- class->ref_child = gtk_label_accessible_ref_child;
-}
-
-/* 'Public' API {{{2 */
-
-
-void
-_gtk_label_accessible_selection_bound_changed (GtkLabel *label)
-{
- AtkObject *obj;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (label));
- if (obj == NULL)
- return;
-
- if (check_for_selection_change (GTK_LABEL_ACCESSIBLE (obj), label))
- g_signal_emit_by_name (obj, "text-selection-changed");
-}
-
-void
-_gtk_label_accessible_cursor_position_changed (GtkLabel *label)
-{
- AtkObject *obj;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (label));
- if (obj == NULL)
- return;
-
- g_signal_emit_by_name (obj, "text-caret-moved", _gtk_label_get_cursor_position (label));
-
- if (check_for_selection_change (GTK_LABEL_ACCESSIBLE (obj), label))
- g_signal_emit_by_name (obj, "text-selection-changed");
-}
-
-void
-_gtk_label_accessible_text_deleted (GtkLabel *label)
-{
- AtkObject *obj;
- const char *text;
- guint length;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (label));
- if (obj == NULL)
- return;
-
- text = gtk_label_get_text (label);
- length = g_utf8_strlen (text, -1);
- if (length > 0)
- g_signal_emit_by_name (obj, "text-changed::delete", 0, length);
-}
-
-void
-_gtk_label_accessible_text_inserted (GtkLabel *label)
-{
- AtkObject *obj;
- const char *text;
- guint length;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (label));
- if (obj == NULL)
- return;
-
- text = gtk_label_get_text (label);
- length = g_utf8_strlen (text, -1);
- if (length > 0)
- g_signal_emit_by_name (obj, "text-changed::insert", 0, length);
-
- if (obj->name == NULL)
- /* The label has changed so notify a change in accessible-name */
- g_object_notify (G_OBJECT (obj), "accessible-name");
-
- g_signal_emit_by_name (obj, "visible-data-changed");
-}
-
-static void
-clear_links (GtkLabelAccessible *accessible)
-{
- GList *l;
- gint i;
- GtkLabelAccessibleLinkImpl *impl;
-
- for (l = accessible->priv->links, i = 0; l; l = l->next, i++)
- {
- impl = l->data;
- g_signal_emit_by_name (accessible, "children-changed::remove", i, impl, NULL);
- atk_object_set_parent (ATK_OBJECT (impl), NULL);
- impl->link->label = NULL;
- }
- g_list_free_full (accessible->priv->links, g_object_unref);
- accessible->priv->links = NULL;
-}
-
-static void
-create_links (GtkLabelAccessible *accessible)
-{
- GtkWidget *widget;
- gint n, i;
- GtkLabelAccessibleLinkImpl *impl;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
-
- n = _gtk_label_get_n_links (GTK_LABEL (widget));
- for (i = 0; i < n; i++)
- {
- impl = gtk_label_accessible_link_impl_new (accessible, i);
- accessible->priv->links = g_list_append (accessible->priv->links, impl);
- g_signal_emit_by_name (accessible, "children-changed::add", i, impl, NULL);
- }
-}
-
-void
-_gtk_label_accessible_update_links (GtkLabel *label)
-{
- AtkObject *obj;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (label));
- if (obj == NULL)
- return;
-
- clear_links (GTK_LABEL_ACCESSIBLE (obj));
- create_links (GTK_LABEL_ACCESSIBLE (obj));
-}
-
-void
-_gtk_label_accessible_focus_link_changed (GtkLabel *label)
-{
- AtkObject *obj;
- GtkLabelAccessible *accessible;
- GList *l;
- GtkLabelAccessibleLinkImpl *impl;
- gboolean focused;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (label));
- if (obj == NULL)
- return;
-
- accessible = GTK_LABEL_ACCESSIBLE (obj);
-
- for (l = accessible->priv->links; l; l = l->next)
- {
- impl = l->data;
- focused = _gtk_label_get_link_focused (label, impl->link->index);
- if (impl->link->focused != focused)
- {
- impl->link->focused = focused;
- atk_object_notify_state_change (ATK_OBJECT (impl), ATK_STATE_FOCUSED, focused);
- }
- }
-}
-
-/* AtkText implementation {{{2 */
-
-static gchar*
-gtk_label_accessible_get_text (AtkText *atk_text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- const gchar *text;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return NULL;
-
- text = gtk_label_get_text (GTK_LABEL (widget));
-
- if (text)
- {
- guint length;
- const gchar *start, *end;
-
- length = g_utf8_strlen (text, -1);
- if (end_pos < 0 || end_pos > length)
- end_pos = length;
- if (start_pos > length)
- start_pos = length;
- if (end_pos <= start_pos)
- return g_strdup ("");
- start = g_utf8_offset_to_pointer (text, start_pos);
- end = g_utf8_offset_to_pointer (start, end_pos - start_pos);
- return g_strndup (start, end - start);
- }
-
- return NULL;
-}
-
-static gchar *
-gtk_label_accessible_get_text_before_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- return _gtk_pango_get_text_before (gtk_label_get_layout (GTK_LABEL (widget)),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar*
-gtk_label_accessible_get_text_at_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- return _gtk_pango_get_text_at (gtk_label_get_layout (GTK_LABEL (widget)),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar*
-gtk_label_accessible_get_text_after_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- return _gtk_pango_get_text_after (gtk_label_get_layout (GTK_LABEL (widget)),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gint
-gtk_label_accessible_get_character_count (AtkText *atk_text)
-{
- GtkWidget *widget;
- const gchar *text;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return 0;
-
- text = gtk_label_get_text (GTK_LABEL (widget));
-
- if (text)
- return g_utf8_strlen (text, -1);
-
- return 0;
-}
-
-static gint
-gtk_label_accessible_get_caret_offset (AtkText *text)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return -1;
-
- /* Non-selectable labels cannot have a caret. */
- if (!gtk_label_get_selectable (GTK_LABEL (widget)))
- return -1;
-
- return _gtk_label_get_cursor_position (GTK_LABEL (widget));
-}
-
-static gboolean
-gtk_label_accessible_set_caret_offset (AtkText *text,
- gint offset)
-{
- GtkWidget *widget;
- GtkLabel *label;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- label = GTK_LABEL (widget);
-
- if (!gtk_label_get_selectable (label))
- return FALSE;
-
- gtk_label_select_region (label, offset, offset);
-
- return TRUE;
-}
-
-static gint
-gtk_label_accessible_get_n_selections (AtkText *text)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return 0;
-
- if (gtk_label_get_selection_bounds (GTK_LABEL (widget), NULL, NULL))
- return 1;
-
- return 0;
-}
-
-static gchar *
-gtk_label_accessible_get_selection (AtkText *atk_text,
- gint selection_num,
- gint *start_pos,
- gint *end_pos)
-{
- GtkWidget *widget;
- GtkLabel *label;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return NULL;
-
- if (selection_num != 0)
- return NULL;
-
- label = GTK_LABEL (widget);
-
- if (gtk_label_get_selection_bounds (label, start_pos, end_pos))
- {
- const gchar *text;
-
- text = gtk_label_get_text (label);
-
- if (text)
- return g_utf8_substring (text, *start_pos, *end_pos);
- }
-
- return NULL;
-}
-
-static gboolean
-gtk_label_accessible_add_selection (AtkText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkLabel *label;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- label = GTK_LABEL (widget);
-
- if (!gtk_label_get_selectable (label))
- return FALSE;
-
- if (!gtk_label_get_selection_bounds (label, &start, &end))
- {
- gtk_label_select_region (label, start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_label_accessible_remove_selection (AtkText *text,
- gint selection_num)
-{
- GtkWidget *widget;
- GtkLabel *label;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- label = GTK_LABEL (widget);
-
- if (!gtk_label_get_selectable (label))
- return FALSE;
-
- if (gtk_label_get_selection_bounds (label, &start, &end))
- {
- gtk_label_select_region (label, end, end);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_label_accessible_set_selection (AtkText *text,
- gint selection_num,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkLabel *label;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- label = GTK_LABEL (widget);
-
- if (!gtk_label_get_selectable (label))
- return FALSE;
-
- if (gtk_label_get_selection_bounds (label, &start, &end))
- {
- gtk_label_select_region (label, start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static void
-gtk_label_accessible_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- GtkWidget *widget;
- GtkLabel *label;
- PangoRectangle char_rect;
- const gchar *label_text;
- gint index, x_layout, y_layout;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- label = GTK_LABEL (widget);
-
- gtk_label_get_layout_offsets (label, &x_layout, &y_layout);
- label_text = gtk_label_get_text (label);
- index = g_utf8_offset_to_pointer (label_text, offset) - label_text;
- pango_layout_index_to_pos (gtk_label_get_layout (label), index, &char_rect);
- pango_extents_to_pixels (&char_rect, NULL);
-
- *x = x_layout + char_rect.x;
- *y = y_layout + char_rect.y;
- *width = char_rect.width;
- *height = char_rect.height;
-}
-
-static gint
-gtk_label_accessible_get_offset_at_point (AtkText *atk_text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- GtkWidget *widget;
- GtkLabel *label;
- const gchar *text;
- gint index, x_layout, y_layout;
- gint x_local, y_local;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return -1;
-
- label = GTK_LABEL (widget);
-
- gtk_label_get_layout_offsets (label, &x_layout, &y_layout);
-
- x_local = x - x_layout;
- y_local = y - y_layout;
-
- if (!pango_layout_xy_to_index (gtk_label_get_layout (label),
- x_local * PANGO_SCALE,
- y_local * PANGO_SCALE,
- &index, NULL))
- {
- if (x_local < 0 || y_local < 0)
- index = 0;
- else
- index = -1;
- }
-
- if (index != -1)
- {
- text = gtk_label_get_text (label);
- return g_utf8_pointer_to_offset (text, text + index);
- }
-
- return -1;
-}
-
-static AtkAttributeSet *
-add_attribute (AtkAttributeSet *attributes,
- AtkTextAttribute attr,
- const gchar *value)
-{
- AtkAttribute *at;
-
- at = g_new (AtkAttribute, 1);
- at->name = g_strdup (atk_text_attribute_get_name (attr));
- at->value = g_strdup (value);
-
- return g_slist_prepend (attributes, at);
-}
-
-static AtkAttributeSet*
-gtk_label_accessible_get_run_attributes (AtkText *text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- attributes = NULL;
- attributes = add_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- atk_text_attribute_get_value (ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (widget)));
- attributes = _gtk_pango_get_run_attributes (attributes,
- gtk_label_get_layout (GTK_LABEL (widget)),
- offset,
- start_offset,
- end_offset);
-
- return attributes;
-}
-
-static AtkAttributeSet *
-gtk_label_accessible_get_default_attributes (AtkText *text)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- attributes = NULL;
- attributes = add_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- atk_text_attribute_get_value (ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (widget)));
- attributes = _gtk_pango_get_default_attributes (attributes,
- gtk_label_get_layout (GTK_LABEL (widget)));
- attributes = _gtk_style_context_get_attributes (attributes,
- gtk_widget_get_style_context (widget));
-
- return attributes;
-}
-
-static gunichar
-gtk_label_accessible_get_character_at_offset (AtkText *atk_text,
- gint offset)
-{
- GtkWidget *widget;
- const gchar *text;
- gchar *index;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return '\0';
-
- text = gtk_label_get_text (GTK_LABEL (widget));
- if (offset >= g_utf8_strlen (text, -1))
- return '\0';
-
- index = g_utf8_offset_to_pointer (text, offset);
-
- return g_utf8_get_char (index);
-}
-
-static void
-atk_text_interface_init (AtkTextIface *iface)
-{
- iface->get_text = gtk_label_accessible_get_text;
- iface->get_character_at_offset = gtk_label_accessible_get_character_at_offset;
- iface->get_text_before_offset = gtk_label_accessible_get_text_before_offset;
- iface->get_text_at_offset = gtk_label_accessible_get_text_at_offset;
- iface->get_text_after_offset = gtk_label_accessible_get_text_after_offset;
- iface->get_character_count = gtk_label_accessible_get_character_count;
- iface->get_caret_offset = gtk_label_accessible_get_caret_offset;
- iface->set_caret_offset = gtk_label_accessible_set_caret_offset;
- iface->get_n_selections = gtk_label_accessible_get_n_selections;
- iface->get_selection = gtk_label_accessible_get_selection;
- iface->add_selection = gtk_label_accessible_add_selection;
- iface->remove_selection = gtk_label_accessible_remove_selection;
- iface->set_selection = gtk_label_accessible_set_selection;
- iface->get_character_extents = gtk_label_accessible_get_character_extents;
- iface->get_offset_at_point = gtk_label_accessible_get_offset_at_point;
- iface->get_run_attributes = gtk_label_accessible_get_run_attributes;
- iface->get_default_attributes = gtk_label_accessible_get_default_attributes;
-}
-
-/* AtkHypertext implementation {{{2 */
-
-static AtkHyperlink *
-gtk_label_accessible_get_link (AtkHypertext *hypertext,
- gint idx)
-{
- GtkLabelAccessible *label = GTK_LABEL_ACCESSIBLE (hypertext);
- GtkLabelAccessibleLinkImpl *impl;
-
- impl = (GtkLabelAccessibleLinkImpl *)g_list_nth_data (label->priv->links, idx);
-
- if (impl)
- return ATK_HYPERLINK (impl->link);
-
- return NULL;
-}
-
-static gint
-gtk_label_accessible_get_n_links (AtkHypertext *hypertext)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (hypertext));
-
- return _gtk_label_get_n_links (GTK_LABEL (widget));
-}
-
-static gint
-gtk_label_accessible_get_link_index (AtkHypertext *hypertext,
- gint char_index)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (hypertext));
-
- return _gtk_label_get_link_at (GTK_LABEL (widget), char_index);
-}
-
-static void
-atk_hypertext_interface_init (AtkHypertextIface *iface)
-{
- iface->get_link = gtk_label_accessible_get_link;
- iface->get_n_links = gtk_label_accessible_get_n_links;
- iface->get_link_index = gtk_label_accessible_get_link_index;
-}
-
-/* vim:set foldmethod=marker expandtab: */
diff --git a/gtk/a11y/gtklabelaccessible.h b/gtk/a11y/gtklabelaccessible.h
deleted file mode 100644
index 886d34cf2c..0000000000
--- a/gtk/a11y/gtklabelaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_LABEL_ACCESSIBLE_H__
-#define __GTK_LABEL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_LABEL_ACCESSIBLE (gtk_label_accessible_get_type ())
-#define GTK_LABEL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL_ACCESSIBLE, GtkLabelAccessible))
-#define GTK_LABEL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LABEL_ACCESSIBLE, GtkLabelAccessibleClass))
-#define GTK_IS_LABEL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LABEL_ACCESSIBLE))
-#define GTK_IS_LABEL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LABEL_ACCESSIBLE))
-#define GTK_LABEL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LABEL_ACCESSIBLE, GtkLabelAccessibleClass))
-
-typedef struct _GtkLabelAccessible GtkLabelAccessible;
-typedef struct _GtkLabelAccessibleClass GtkLabelAccessibleClass;
-typedef struct _GtkLabelAccessiblePrivate GtkLabelAccessiblePrivate;
-
-struct _GtkLabelAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkLabelAccessiblePrivate *priv;
-};
-
-struct _GtkLabelAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_label_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_LABEL_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtklabelaccessibleprivate.h b/gtk/a11y/gtklabelaccessibleprivate.h
deleted file mode 100644
index bd8e8ca0cb..0000000000
--- a/gtk/a11y/gtklabelaccessibleprivate.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2002, 2004 Anders Carlsson
- *
- * 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 .
- */
-
-#ifndef __GTK_LABEL_ACCESSIBLE_PRIVATE_H__
-#define __GTK_LABEL_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_label_accessible_text_deleted (GtkLabel *label);
-void _gtk_label_accessible_text_inserted (GtkLabel *label);
-void _gtk_label_accessible_update_links (GtkLabel *label);
-void _gtk_label_accessible_focus_link_changed (GtkLabel *label);
-void _gtk_label_accessible_selection_bound_changed (GtkLabel *label);
-void _gtk_label_accessible_cursor_position_changed (GtkLabel *label);
-
-G_END_DECLS
-
-#endif /* __GTK_LABEL_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtklevelbaraccessible.c b/gtk/a11y/gtklevelbaraccessible.c
deleted file mode 100644
index 071845a167..0000000000
--- a/gtk/a11y/gtklevelbaraccessible.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001, 2002, 2003 Sun Microsystems Inc.
- * Copyright 2013 SUSE LLC.
- *
- * 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 "gtklevelbaraccessible.h"
-
-#include "gtklevelbar.h"
-
-#include
-
-static void atk_value_interface_init (AtkValueIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkLevelBarAccessible, gtk_level_bar_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
-
-static void
-on_value_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer user_data)
-{
- GtkLevelBarAccessible *self = user_data;
-
- g_object_notify (G_OBJECT (self), "accessible-value");
-}
-
-static void
-gtk_level_bar_accessible_initialize (AtkObject *object,
- gpointer data)
-{
- GtkLevelBar *level_bar = data;
-
- g_signal_connect (level_bar, "notify::value", G_CALLBACK (on_value_changed), object);
-}
-
-static void
-gtk_level_bar_accessible_class_init (GtkLevelBarAccessibleClass *klass)
-{
- AtkObjectClass *object_class = ATK_OBJECT_CLASS (klass);
-
- object_class->initialize = gtk_level_bar_accessible_initialize;
-}
-
-static void
-gtk_level_bar_accessible_init (GtkLevelBarAccessible *self)
-{
- ATK_OBJECT (self)->role = ATK_ROLE_LEVEL_BAR;
-}
-
-static void
-gtk_level_bar_accessible_get_current_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkLevelBar *level_bar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- level_bar = GTK_LEVEL_BAR (widget);
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_level_bar_get_value (level_bar));
-}
-
-static void
-gtk_level_bar_accessible_get_maximum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkLevelBar *level_bar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- level_bar = GTK_LEVEL_BAR (widget);
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_level_bar_get_max_value (level_bar));
-}
-
-static void
-gtk_level_bar_accessible_get_minimum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkLevelBar *level_bar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- level_bar = GTK_LEVEL_BAR (widget);
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_level_bar_get_min_value (level_bar));
-}
-
-static gboolean
-gtk_level_bar_accessible_set_current_value (AtkValue *obj,
- const GValue *value)
-{
- GtkWidget *widget;
- GtkLevelBar *level_bar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- level_bar = GTK_LEVEL_BAR (widget);
-
- gtk_level_bar_set_value (level_bar, g_value_get_double (value));
-
- return TRUE;
-}
-
-static void
-gtk_level_bar_accessible_get_value_and_text (AtkValue *obj,
- gdouble *value,
- gchar **text)
-{
- GtkWidget *widget;
- GtkLevelBar *level_bar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- level_bar = GTK_LEVEL_BAR (widget);
-
- *value = gtk_level_bar_get_value (level_bar);
- *text = NULL;
-}
-
-static AtkRange *
-gtk_level_bar_accessible_get_range (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkLevelBar *level_bar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- level_bar = GTK_LEVEL_BAR (widget);
-
- return atk_range_new (gtk_level_bar_get_min_value (level_bar),
- gtk_level_bar_get_max_value (level_bar),
- NULL);
-}
-
-static void
-gtk_level_bar_accessible_set_value (AtkValue *obj,
- const gdouble value)
-{
- GtkWidget *widget;
- GtkLevelBar *level_bar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- level_bar = GTK_LEVEL_BAR (widget);
-
- gtk_level_bar_set_value (level_bar, value);
-}
-
-static void
-atk_value_interface_init (AtkValueIface *iface)
-{
- iface->get_current_value = gtk_level_bar_accessible_get_current_value;
- iface->get_maximum_value = gtk_level_bar_accessible_get_maximum_value;
- iface->get_minimum_value = gtk_level_bar_accessible_get_minimum_value;
- iface->set_current_value = gtk_level_bar_accessible_set_current_value;
-
- iface->get_value_and_text = gtk_level_bar_accessible_get_value_and_text;
- iface->get_range = gtk_level_bar_accessible_get_range;
- iface->set_value = gtk_level_bar_accessible_set_value;
-}
diff --git a/gtk/a11y/gtklevelbaraccessible.h b/gtk/a11y/gtklevelbaraccessible.h
deleted file mode 100644
index be037610ba..0000000000
--- a/gtk/a11y/gtklevelbaraccessible.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001 Sun Microsystems Inc.
- * Copyright 2013 SUSE LLC.
- *
- * 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 .
- */
-
-#ifndef __GTK_LEVEL_BAR_ACCESSIBLE_H__
-#define __GTK_LEVEL_BAR_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_LEVEL_BAR_ACCESSIBLE (gtk_level_bar_accessible_get_type ())
-#define GTK_LEVEL_BAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LEVEL_BAR_ACCESSIBLE, GtkLevelBarAccessible))
-#define GTK_LEVEL_BAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LEVEL_BAR_ACCESSIBLE, GtkLevelBarAccessibleClass))
-#define GTK_IS_LEVEL_BAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LEVEL_BAR_ACCESSIBLE))
-#define GTK_IS_LEVEL_BAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LEVEL_BAR_ACCESSIBLE))
-#define GTK_LEVEL_BAR_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LEVEL_BAR_ACCESSIBLE, GtkLevelBarAccessibleClass))
-
-typedef struct _GtkLevelBarAccessible GtkLevelBarAccessible;
-typedef struct _GtkLevelBarAccessibleClass GtkLevelBarAccessibleClass;
-typedef struct _GtkLevelBarAccessiblePrivate GtkLevelBarAccessiblePrivate;
-
-struct _GtkLevelBarAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkLevelBarAccessiblePrivate *priv;
-};
-
-struct _GtkLevelBarAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_level_bar_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_LEVEL_BAR_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtklinkbuttonaccessible.c b/gtk/a11y/gtklinkbuttonaccessible.c
deleted file mode 100644
index 6953cef85e..0000000000
--- a/gtk/a11y/gtklinkbuttonaccessible.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2011 Red Hat, 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 "gtklinkbuttonaccessible.h"
-
-typedef struct _GtkLinkButtonAccessibleLink GtkLinkButtonAccessibleLink;
-typedef struct _GtkLinkButtonAccessibleLinkClass GtkLinkButtonAccessibleLinkClass;
-
-struct _GtkLinkButtonAccessiblePrivate
-{
- AtkHyperlink *link;
-};
-
-struct _GtkLinkButtonAccessibleLink
-{
- AtkHyperlink parent;
-
- GtkLinkButtonAccessible *button;
-};
-
-struct _GtkLinkButtonAccessibleLinkClass
-{
- AtkHyperlinkClass parent_class;
-};
-
-static void atk_action_interface_init (AtkActionIface *iface);
-
-GType _gtk_link_button_accessible_link_get_type (void);
-
-G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessibleLink, _gtk_link_button_accessible_link, ATK_TYPE_HYPERLINK,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static AtkHyperlink *
-gtk_link_button_accessible_link_new (GtkLinkButtonAccessible *button)
-{
- GtkLinkButtonAccessibleLink *l;
-
- l = g_object_new (_gtk_link_button_accessible_link_get_type (), NULL);
- l->button = button;
-
- return ATK_HYPERLINK (l);
-}
-
-static gchar *
-gtk_link_button_accessible_link_get_uri (AtkHyperlink *atk_link,
- gint i)
-{
- GtkLinkButtonAccessibleLink *l = (GtkLinkButtonAccessibleLink *)atk_link;
- GtkWidget *widget;
- const gchar *uri;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (l->button));
- uri = gtk_link_button_get_uri (GTK_LINK_BUTTON (widget));
-
- return g_strdup (uri);
-}
-
-static gint
-gtk_link_button_accessible_link_get_n_anchors (AtkHyperlink *atk_link)
-{
- return 1;
-}
-
-static gboolean
-gtk_link_button_accessible_link_is_valid (AtkHyperlink *atk_link)
-{
- return TRUE;
-}
-
-static AtkObject *
-gtk_link_button_accessible_link_get_object (AtkHyperlink *atk_link,
- gint i)
-{
- GtkLinkButtonAccessibleLink *l = (GtkLinkButtonAccessibleLink *)atk_link;
-
- return ATK_OBJECT (l->button);
-}
-
-static void
-_gtk_link_button_accessible_link_init (GtkLinkButtonAccessibleLink *l)
-{
-}
-
-static void
-_gtk_link_button_accessible_link_class_init (GtkLinkButtonAccessibleLinkClass *class)
-{
- AtkHyperlinkClass *atk_link_class = ATK_HYPERLINK_CLASS (class);
-
- atk_link_class->get_uri = gtk_link_button_accessible_link_get_uri;
- atk_link_class->get_n_anchors = gtk_link_button_accessible_link_get_n_anchors;
- atk_link_class->is_valid = gtk_link_button_accessible_link_is_valid;
- atk_link_class->get_object = gtk_link_button_accessible_link_get_object;
-}
-
-static gboolean
-gtk_link_button_accessible_link_do_action (AtkAction *action,
- gint i)
-{
- GtkLinkButtonAccessibleLink *l = (GtkLinkButtonAccessibleLink *)action;
- GtkWidget *widget;
-
- widget = GTK_WIDGET (l->button);
- if (widget == NULL)
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- g_signal_emit_by_name (widget, "clicked");
-
- return TRUE;
-}
-
-static gint
-gtk_link_button_accessible_link_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_link_button_accessible_link_get_name (AtkAction *action,
- gint i)
-{
- if (i != 0)
- return NULL;
-
- return "activate";
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_link_button_accessible_link_do_action;
- iface->get_n_actions = gtk_link_button_accessible_link_get_n_actions;
- iface->get_name = gtk_link_button_accessible_link_get_name;
-}
-
-static gboolean
-activate_link (GtkLinkButton *button,
- AtkHyperlink *atk_link)
-{
- g_signal_emit_by_name (atk_link, "link-activated");
-
- return FALSE;
-}
-
-static AtkHyperlink *
-gtk_link_button_accessible_get_hyperlink (AtkHyperlinkImpl *impl)
-{
- GtkLinkButtonAccessible *button = GTK_LINK_BUTTON_ACCESSIBLE (impl);
-
- if (!button->priv->link)
- {
- button->priv->link = gtk_link_button_accessible_link_new (button);
- g_signal_connect (gtk_accessible_get_widget (GTK_ACCESSIBLE (button)),
- "activate-link", G_CALLBACK (activate_link), button->priv->link);
- }
-
- return g_object_ref (button->priv->link);
-}
-
-static void atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessible, gtk_link_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE,
- G_ADD_PRIVATE (GtkLinkButtonAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERLINK_IMPL, atk_hypertext_impl_interface_init))
-
-static void
-gtk_link_button_accessible_init (GtkLinkButtonAccessible *button)
-{
- button->priv = gtk_link_button_accessible_get_instance_private (button);
-}
-
-static void
-gtk_link_button_accessible_finalize (GObject *object)
-{
- GtkLinkButtonAccessible *button = GTK_LINK_BUTTON_ACCESSIBLE (object);
-
- if (button->priv->link)
- g_object_unref (button->priv->link);
-
- G_OBJECT_CLASS (gtk_link_button_accessible_parent_class)->finalize (object);
-}
-
-static AtkStateSet *
-gtk_link_button_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gtk_link_button_accessible_parent_class)->ref_state_set (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget != NULL)
- {
- if (gtk_link_button_get_visited (GTK_LINK_BUTTON (widget)))
- atk_state_set_add_state (state_set, ATK_STATE_VISITED);
- }
-
- return state_set;
-}
-
-static void
-gtk_link_button_accessible_class_init (GtkLinkButtonAccessibleClass *klass)
-{
- G_OBJECT_CLASS (klass)->finalize = gtk_link_button_accessible_finalize;
- ATK_OBJECT_CLASS (klass)->ref_state_set = gtk_link_button_ref_state_set;
-}
-
-static void
-atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface)
-{
- iface->get_hyperlink = gtk_link_button_accessible_get_hyperlink;
-}
diff --git a/gtk/a11y/gtklinkbuttonaccessible.h b/gtk/a11y/gtklinkbuttonaccessible.h
deleted file mode 100644
index afa52f9851..0000000000
--- a/gtk/a11y/gtklinkbuttonaccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* GTK+ - accessibility implementations
- * 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, see .
- */
-
-#ifndef __GTK_LINK_BUTTON_ACCESSIBLE_H__
-#define __GTK_LINK_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_LINK_BUTTON_ACCESSIBLE (gtk_link_button_accessible_get_type ())
-#define GTK_LINK_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LINK_BUTTON_ACCESSIBLE, GtkLinkButtonAccessible))
-#define GTK_LINK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LINK_BUTTON_ACCESSIBLE, GtkLinkButtonAccessibleClass))
-#define GTK_IS_LINK_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LINK_BUTTON_ACCESSIBLE))
-#define GTK_IS_LINK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LINK_BUTTON_ACCESSIBLE))
-#define GTK_LINK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LINK_BUTTON_ACCESSIBLE, GtkLinkButtonAccessibleClass))
-
-typedef struct _GtkLinkButtonAccessible GtkLinkButtonAccessible;
-typedef struct _GtkLinkButtonAccessibleClass GtkLinkButtonAccessibleClass;
-typedef struct _GtkLinkButtonAccessiblePrivate GtkLinkButtonAccessiblePrivate;
-
-struct _GtkLinkButtonAccessible
-{
- GtkButtonAccessible parent;
-
- GtkLinkButtonAccessiblePrivate *priv;
-};
-
-struct _GtkLinkButtonAccessibleClass
-{
- GtkButtonAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_link_button_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_LINK_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtklistboxaccessible.c b/gtk/a11y/gtklistboxaccessible.c
deleted file mode 100644
index f28581fd70..0000000000
--- a/gtk/a11y/gtklistboxaccessible.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 "gtklistboxaccessibleprivate.h"
-
-#include "gtk/gtklistbox.h"
-
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkListBoxAccessible, gtk_list_box_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
-
-static void
-gtk_list_box_accessible_init (GtkListBoxAccessible *accessible)
-{
-}
-
-static void
-gtk_list_box_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_list_box_accessible_parent_class)->initialize (obj, data);
-
- obj->role = ATK_ROLE_LIST_BOX;
-}
-
-static AtkStateSet*
-gtk_list_box_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gtk_list_box_accessible_parent_class)->ref_state_set (obj);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- if (widget != NULL)
- atk_state_set_add_state (state_set, ATK_STATE_MANAGES_DESCENDANTS);
-
- return state_set;
-}
-
-static void
-gtk_list_box_accessible_class_init (GtkListBoxAccessibleClass *klass)
-{
- AtkObjectClass *object_class = ATK_OBJECT_CLASS (klass);
-
- object_class->initialize = gtk_list_box_accessible_initialize;
- object_class->ref_state_set = gtk_list_box_accessible_ref_state_set;
-}
-
-static gboolean
-gtk_list_box_accessible_add_selection (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- GtkListBoxRow *row;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (box), idx);
- if (row)
- {
- gtk_list_box_select_row (GTK_LIST_BOX (box), row);
- return TRUE;
- }
- return FALSE;
-}
-
-static gboolean
-gtk_list_box_accessible_remove_selection (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- GtkListBoxRow *row;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (box), idx);
- if (row)
- {
- gtk_list_box_unselect_row (GTK_LIST_BOX (box), row);
- return TRUE;
- }
- return FALSE;
-}
-
-static gboolean
-gtk_list_box_accessible_clear_selection (AtkSelection *selection)
-{
- GtkWidget *box;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- gtk_list_box_unselect_all (GTK_LIST_BOX (box));
- return TRUE;
-}
-
-static gboolean
-gtk_list_box_accessible_select_all (AtkSelection *selection)
-{
- GtkWidget *box;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- gtk_list_box_select_all (GTK_LIST_BOX (box));
- return TRUE;
-}
-
-typedef struct
-{
- gint idx;
- GtkWidget *row;
-} FindSelectedData;
-
-static void
-find_selected_row (GtkListBox *box,
- GtkListBoxRow *row,
- gpointer data)
-{
- FindSelectedData *d = data;
-
- if (d->idx == 0)
- {
- if (d->row == NULL)
- d->row = GTK_WIDGET (row);
- }
- else
- d->idx -= 1;
-}
-
-static AtkObject *
-gtk_list_box_accessible_ref_selection (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- AtkObject *accessible;
- FindSelectedData data;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return NULL;
-
- data.idx = idx;
- data.row = NULL;
- gtk_list_box_selected_foreach (GTK_LIST_BOX (box), find_selected_row, &data);
-
- if (data.row == NULL)
- return NULL;
-
- accessible = gtk_widget_get_accessible (data.row);
- g_object_ref (accessible);
- return accessible;
-}
-
-static void
-count_selected (GtkListBox *box,
- GtkListBoxRow *row,
- gpointer data)
-{
- gint *count = data;
- *count += 1;
-}
-
-static gint
-gtk_list_box_accessible_get_selection_count (AtkSelection *selection)
-{
- GtkWidget *box;
- gint count;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return 0;
-
- count = 0;
- gtk_list_box_selected_foreach (GTK_LIST_BOX (box), count_selected, &count);
-
- return count;
-}
-
-static gboolean
-gtk_list_box_accessible_is_child_selected (AtkSelection *selection,
- gint idx)
-{
- GtkWidget *box;
- GtkListBoxRow *row;
-
- box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (box == NULL)
- return FALSE;
-
- row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (box), idx);
-
- return gtk_list_box_row_is_selected (row);
-}
-
-static void atk_selection_interface_init (AtkSelectionIface *iface)
-{
- iface->add_selection = gtk_list_box_accessible_add_selection;
- iface->remove_selection = gtk_list_box_accessible_remove_selection;
- iface->clear_selection = gtk_list_box_accessible_clear_selection;
- iface->ref_selection = gtk_list_box_accessible_ref_selection;
- iface->get_selection_count = gtk_list_box_accessible_get_selection_count;
- iface->is_child_selected = gtk_list_box_accessible_is_child_selected;
- iface->select_all_selection = gtk_list_box_accessible_select_all;
-}
-
-void
-_gtk_list_box_accessible_selection_changed (GtkListBox *box)
-{
- AtkObject *accessible;
- accessible = gtk_widget_get_accessible (GTK_WIDGET (box));
- g_signal_emit_by_name (accessible, "selection-changed");
-}
-
-void
-_gtk_list_box_accessible_update_cursor (GtkListBox *box,
- GtkListBoxRow *row)
-{
- AtkObject *accessible;
- AtkObject *descendant;
- accessible = gtk_widget_get_accessible (GTK_WIDGET (box));
- descendant = row ? gtk_widget_get_accessible (GTK_WIDGET (row)) : NULL;
- g_signal_emit_by_name (accessible, "active-descendant-changed", descendant);
-}
diff --git a/gtk/a11y/gtklistboxaccessible.h b/gtk/a11y/gtklistboxaccessible.h
deleted file mode 100644
index 2c168e9791..0000000000
--- a/gtk/a11y/gtklistboxaccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 .
- */
-
-#ifndef __GTK_LIST_BOX_ACCESSIBLE_H__
-#define __GTK_LIST_BOX_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_LIST_BOX_ACCESSIBLE (gtk_list_box_accessible_get_type ())
-#define GTK_LIST_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_BOX_ACCESSIBLE, GtkListBoxAccessible))
-#define GTK_LIST_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_BOX_ACCESSIBLE, GtkListBoxAccessibleClass))
-#define GTK_IS_LIST_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_BOX_ACCESSIBLE))
-#define GTK_IS_LIST_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_BOX_ACCESSIBLE))
-#define GTK_LIST_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_BOX_ACCESSIBLE, GtkListBoxAccessibleClass))
-
-typedef struct _GtkListBoxAccessible GtkListBoxAccessible;
-typedef struct _GtkListBoxAccessibleClass GtkListBoxAccessibleClass;
-typedef struct _GtkListBoxAccessiblePrivate GtkListBoxAccessiblePrivate;
-
-struct _GtkListBoxAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkListBoxAccessiblePrivate *priv;
-};
-
-struct _GtkListBoxAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_list_box_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_LIST_BOX_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtklistboxaccessibleprivate.h b/gtk/a11y/gtklistboxaccessibleprivate.h
deleted file mode 100644
index 2ea0de7982..0000000000
--- a/gtk/a11y/gtklistboxaccessibleprivate.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 .
- */
-
-#ifndef __GTK_LIST_BOX_ACCESSIBLE_PRIVATE_H__
-#define __GTK_LIST_BOX_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_list_box_accessible_update_cursor (GtkListBox *box,
- GtkListBoxRow *row);
-void _gtk_list_box_accessible_selection_changed (GtkListBox *box);
-
-G_END_DECLS
-
-#endif /* __GTK_LIST_BOX_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtklistboxrowaccessible.c b/gtk/a11y/gtklistboxrowaccessible.c
deleted file mode 100644
index 6a37efb1a5..0000000000
--- a/gtk/a11y/gtklistboxrowaccessible.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 "gtklistboxrowaccessible.h"
-
-#include "gtk/gtklistbox.h"
-
-
-G_DEFINE_TYPE (GtkListBoxRowAccessible, gtk_list_box_row_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static void
-gtk_list_box_row_accessible_init (GtkListBoxRowAccessible *accessible)
-{
-}
-
-static void
-gtk_list_box_row_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_list_box_row_accessible_parent_class)->initialize (obj, data);
-
- obj->role = ATK_ROLE_LIST_ITEM;
-}
-
-static AtkStateSet*
-gtk_list_box_row_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget, *parent;
-
- state_set = ATK_OBJECT_CLASS (gtk_list_box_row_accessible_parent_class)->ref_state_set (obj);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget != NULL)
- {
- parent = gtk_widget_get_parent (widget);
- if (parent != NULL &&
- GTK_IS_LIST_BOX (parent) &&
- gtk_list_box_get_selection_mode (GTK_LIST_BOX (parent)) != GTK_SELECTION_NONE)
- atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
-
- if (gtk_list_box_row_is_selected (GTK_LIST_BOX_ROW (widget)))
- atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
- }
-
- return state_set;
-}
-
-static void
-gtk_list_box_row_accessible_class_init (GtkListBoxRowAccessibleClass *klass)
-{
- AtkObjectClass *object_class = ATK_OBJECT_CLASS (klass);
-
- object_class->initialize = gtk_list_box_row_accessible_initialize;
- object_class->ref_state_set = gtk_list_box_row_accessible_ref_state_set;
-}
diff --git a/gtk/a11y/gtklistboxrowaccessible.h b/gtk/a11y/gtklistboxrowaccessible.h
deleted file mode 100644
index 47a561c0c5..0000000000
--- a/gtk/a11y/gtklistboxrowaccessible.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2013 Red Hat, 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 .
- */
-
-#ifndef __GTK_LIST_BOX_ROW_ACCESSIBLE_H__
-#define __GTK_LIST_BOX_ROW_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_LIST_BOX_ROW_ACCESSIBLE (gtk_list_box_row_accessible_get_type ())
-#define GTK_LIST_BOX_ROW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_BOX_ROW_ACCESSIBLE, GtkListBoxRowAccessible))
-#define GTK_LIST_BOX_ROW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_BOX_ROW_ACCESSIBLE, GtkListBoxRowAccessibleClass))
-#define GTK_IS_LIST_BOX_ROW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_BOX_ROW_ACCESSIBLE))
-#define GTK_IS_LIST_BOX_ROW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_BOX_ROW_ACCESSIBLE))
-#define GTK_LIST_BOX_ROW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_BOX_ROW_ACCESSIBLE, GtkListBoxRowAccessibleClass))
-
-typedef struct _GtkListBoxRowAccessible GtkListBoxRowAccessible;
-typedef struct _GtkListBoxRowAccessibleClass GtkListBoxRowAccessibleClass;
-
-struct _GtkListBoxRowAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkListBoxRowAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_list_box_row_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_LIST_BOX_ROW_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtklockbuttonaccessible.c b/gtk/a11y/gtklockbuttonaccessible.c
deleted file mode 100644
index 0e3216dcde..0000000000
--- a/gtk/a11y/gtklockbuttonaccessible.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 "gtklockbuttonaccessibleprivate.h"
-
-#include "gtk/gtklockbuttonprivate.h"
-#include "gtk/gtkwidgetprivate.h"
-
-G_DEFINE_TYPE (GtkLockButtonAccessible, gtk_lock_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE)
-
-static const gchar *
-gtk_lock_button_accessible_get_name (AtkObject *obj)
-{
- GtkLockButton *lockbutton;
-
- lockbutton = GTK_LOCK_BUTTON (gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)));
- if (lockbutton == NULL)
- return NULL;
-
- return _gtk_lock_button_get_current_text (lockbutton);
-}
-
-static void
-gtk_lock_button_accessible_class_init (GtkLockButtonAccessibleClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
-
- atk_object_class->get_name = gtk_lock_button_accessible_get_name;
-}
-
-static void
-gtk_lock_button_accessible_init (GtkLockButtonAccessible *lockbutton)
-{
-}
-
-void
-_gtk_lock_button_accessible_name_changed (GtkLockButton *lockbutton)
-{
- AtkObject *obj;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (lockbutton));
- if (obj == NULL)
- return;
-
- g_object_notify (G_OBJECT (obj), "accessible-name");
-}
-
diff --git a/gtk/a11y/gtklockbuttonaccessible.h b/gtk/a11y/gtklockbuttonaccessible.h
deleted file mode 100644
index d6b4510c7d..0000000000
--- a/gtk/a11y/gtklockbuttonaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_LOCK_BUTTON_ACCESSIBLE_H__
-#define __GTK_LOCK_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_LOCK_BUTTON_ACCESSIBLE (gtk_lock_button_accessible_get_type ())
-#define GTK_LOCK_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LOCK_BUTTON_ACCESSIBLE, GtkLockButtonAccessible))
-#define GTK_LOCK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LOCK_BUTTON_ACCESSIBLE, GtkLockButtonAccessibleClass))
-#define GTK_IS_LOCK_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LOCK_BUTTON_ACCESSIBLE))
-#define GTK_IS_LOCK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LOCK_BUTTON_ACCESSIBLE))
-#define GTK_LOCK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LOCK_BUTTON_ACCESSIBLE, GtkLockButtonAccessibleClass))
-
-typedef struct _GtkLockButtonAccessible GtkLockButtonAccessible;
-typedef struct _GtkLockButtonAccessibleClass GtkLockButtonAccessibleClass;
-typedef struct _GtkLockButtonAccessiblePrivate GtkLockButtonAccessiblePrivate;
-
-struct _GtkLockButtonAccessible
-{
- GtkButtonAccessible parent;
-
- GtkLockButtonAccessiblePrivate *priv;
-};
-
-struct _GtkLockButtonAccessibleClass
-{
- GtkButtonAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_lock_button_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_LOCK_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtklockbuttonaccessibleprivate.h b/gtk/a11y/gtklockbuttonaccessibleprivate.h
deleted file mode 100644
index 6ba82e425a..0000000000
--- a/gtk/a11y/gtklockbuttonaccessibleprivate.h
+++ /dev/null
@@ -1,31 +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 .
- */
-
-#ifndef __GTK_LOCK_BUTTON_ACCESSIBLE_PRIVATE_H__
-#define __GTK_LOCK_BUTTON_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_lock_button_accessible_name_changed (GtkLockButton *lockbutton);
-
-G_END_DECLS
-
-#endif /* __GTK_LOCK_BUTTON_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkmenubuttonaccessible.c b/gtk/a11y/gtkmenubuttonaccessible.c
deleted file mode 100644
index 75482cfc21..0000000000
--- a/gtk/a11y/gtkmenubuttonaccessible.c
+++ /dev/null
@@ -1,117 +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
-#include "gtkmenubuttonaccessible.h"
-
-
-G_DEFINE_TYPE (GtkMenuButtonAccessible, gtk_menu_button_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static void
-gtk_menu_button_accessible_initialize (AtkObject *accessible,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_menu_button_accessible_parent_class)->initialize (accessible, data);
-
- accessible->role = ATK_ROLE_TOGGLE_BUTTON;
-}
-
-static gint
-gtk_menu_button_accessible_get_n_children (AtkObject* obj)
-{
- GtkWidget *widget;
- gint count = 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return count;
-
- return count;
-}
-
-static AtkObject *
-gtk_menu_button_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- AtkObject *accessible = NULL;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- return accessible;
-}
-
-static const gchar *
-gtk_menu_button_accessible_get_name (AtkObject *obj)
-{
- const gchar *name = NULL;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_menu_button_accessible_parent_class)->get_name (obj);
- if (name != NULL)
- return name;
-
- return _("Menu");
-}
-
-static AtkStateSet *
-gtk_menu_button_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
- GtkWidget *button;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- button = gtk_widget_get_first_child (widget);
-
- state_set = ATK_OBJECT_CLASS (gtk_menu_button_accessible_parent_class)->ref_state_set (obj);
-
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
- if (gtk_widget_has_focus (button))
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
-
- return state_set;
-}
-
-static void
-gtk_menu_button_accessible_class_init (GtkMenuButtonAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_name = gtk_menu_button_accessible_get_name;
- class->initialize = gtk_menu_button_accessible_initialize;
- class->get_n_children = gtk_menu_button_accessible_get_n_children;
- class->ref_child = gtk_menu_button_accessible_ref_child;
- class->ref_state_set = gtk_menu_button_accessible_ref_state_set;
-}
-
-static void
-gtk_menu_button_accessible_init (GtkMenuButtonAccessible *menu_button)
-{
-}
diff --git a/gtk/a11y/gtkmenubuttonaccessible.h b/gtk/a11y/gtkmenubuttonaccessible.h
deleted file mode 100644
index 17168a2eb7..0000000000
--- a/gtk/a11y/gtkmenubuttonaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_MENU_BUTTON_ACCESSIBLE_H__
-#define __GTK_MENU_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_MENU_BUTTON_ACCESSIBLE (gtk_menu_button_accessible_get_type ())
-#define GTK_MENU_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_BUTTON_ACCESSIBLE, GtkMenuButtonAccessible))
-#define GTK_MENU_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_BUTTON_ACCESSIBLE, GtkMenuButtonAccessibleClass))
-#define GTK_IS_MENU_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_BUTTON_ACCESSIBLE))
-#define GTK_IS_MENU_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_BUTTON_ACCESSIBLE))
-#define GTK_MENU_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_BUTTON_ACCESSIBLE, GtkMenuButtonAccessibleClass))
-
-typedef struct _GtkMenuButtonAccessible GtkMenuButtonAccessible;
-typedef struct _GtkMenuButtonAccessibleClass GtkMenuButtonAccessibleClass;
-typedef struct _GtkMenuButtonAccessiblePrivate GtkMenuButtonAccessiblePrivate;
-
-struct _GtkMenuButtonAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkMenuButtonAccessiblePrivate *priv;
-};
-
-struct _GtkMenuButtonAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_menu_button_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_MENU_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtknotebookaccessible.c b/gtk/a11y/gtknotebookaccessible.c
deleted file mode 100644
index 468e2a4206..0000000000
--- a/gtk/a11y/gtknotebookaccessible.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 "gtknotebookaccessibleprivate.h"
-
-#include "gtknotebookpageaccessible.h"
-#include "gtknotebook.h"
-
-#include
-
-struct _GtkNotebookAccessiblePrivate
-{
- /*
- * page_cache maintains a list of pre-ref'd Notebook Pages.
- * This cache is queried by gtk_notebook_accessible_ref_child().
- * If the page is found in the list then a new page does not
- * need to be created
- */
- GHashTable * pages;
- gint selected_page;
-};
-
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkNotebookAccessible, gtk_notebook_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkNotebookAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
-
-static void
-create_notebook_page_accessible (GtkNotebookAccessible *accessible,
- GtkNotebook *notebook,
- GtkWidget *child,
- gint page_num)
-{
- AtkObject *obj;
-
- obj = gtk_notebook_page_accessible_new (accessible, child);
- g_hash_table_insert (accessible->priv->pages, child, obj);
- atk_object_set_parent (obj, ATK_OBJECT (accessible));
- g_signal_emit_by_name (accessible, "children-changed::add", page_num, obj, NULL);
-}
-
-static void
-page_added_cb (GtkNotebook *notebook,
- GtkWidget *child,
- guint page_num,
- gpointer data)
-{
- AtkObject *atk_obj;
- GtkNotebookAccessible *accessible;
-
- atk_obj = gtk_widget_get_accessible (GTK_WIDGET (notebook));
- accessible = GTK_NOTEBOOK_ACCESSIBLE (atk_obj);
- create_notebook_page_accessible (accessible, notebook, child, page_num);
-}
-
-static void
-page_removed_cb (GtkNotebook *notebook,
- GtkWidget *widget,
- guint page_num,
- gpointer data)
-{
- GtkNotebookAccessible *accessible;
- AtkObject *obj;
-
- accessible = GTK_NOTEBOOK_ACCESSIBLE (gtk_widget_get_accessible (GTK_WIDGET (notebook)));
-
- obj = g_hash_table_lookup (accessible->priv->pages, widget);
- g_return_if_fail (obj);
- g_signal_emit_by_name (accessible, "children-changed::remove",
- page_num, obj, NULL);
- gtk_notebook_page_accessible_invalidate (GTK_NOTEBOOK_PAGE_ACCESSIBLE (obj));
- g_hash_table_remove (accessible->priv->pages, widget);
-}
-
-
-static void
-gtk_notebook_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkNotebookAccessible *accessible;
- GtkNotebook *notebook;
- gint i;
-
- ATK_OBJECT_CLASS (gtk_notebook_accessible_parent_class)->initialize (obj, data);
-
- accessible = GTK_NOTEBOOK_ACCESSIBLE (obj);
- notebook = GTK_NOTEBOOK (data);
- for (i = 0; i < gtk_notebook_get_n_pages (notebook); i++)
- {
- create_notebook_page_accessible (accessible,
- notebook,
- gtk_notebook_get_nth_page (notebook, i),
- i);
- }
- accessible->priv->selected_page = gtk_notebook_get_current_page (notebook);
-
- g_signal_connect (notebook, "page-added",
- G_CALLBACK (page_added_cb), NULL);
- g_signal_connect (notebook, "page-removed",
- G_CALLBACK (page_removed_cb), NULL);
-
- obj->role = ATK_ROLE_PAGE_TAB_LIST;
-}
-
-static void
-gtk_notebook_accessible_finalize (GObject *object)
-{
- GtkNotebookAccessible *accessible = GTK_NOTEBOOK_ACCESSIBLE (object);
-
- g_hash_table_destroy (accessible->priv->pages);
-
- G_OBJECT_CLASS (gtk_notebook_accessible_parent_class)->finalize (object);
-}
-
-static AtkObject *
-gtk_notebook_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- AtkObject *child;
- GtkNotebookAccessible *accessible;
- GtkNotebook *notebook;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- accessible = GTK_NOTEBOOK_ACCESSIBLE (obj);
- notebook = GTK_NOTEBOOK (widget);
-
- child = g_hash_table_lookup (accessible->priv->pages,
- gtk_notebook_get_nth_page (notebook, i));
- /* can return NULL when i >= n_children */
-
- if (child)
- g_object_ref (child);
-
- return child;
-}
-
-void
-gtk_notebook_accessible_update_page (GtkNotebookAccessible *self,
- int page_num)
-{
- GtkNotebookAccessiblePrivate *priv = gtk_notebook_accessible_get_instance_private (self);
- AtkObject *atk_obj = ATK_OBJECT (self);
- int old_page_num = priv->selected_page;
-
- priv->selected_page = page_num;
-
- /* Notify SELECTED state change for old and new page */
- if (page_num != old_page_num)
- {
- AtkObject *child;
-
- if (old_page_num != -1)
- {
- child = gtk_notebook_accessible_ref_child (atk_obj, old_page_num);
- if (child != NULL)
- {
- atk_object_notify_state_change (child, ATK_STATE_SELECTED, FALSE);
- g_object_unref (child);
- }
- }
-
- child = gtk_notebook_accessible_ref_child (atk_obj, page_num);
- if (child != NULL)
- {
- atk_object_notify_state_change (child, ATK_STATE_SELECTED, TRUE);
- g_object_unref (child);
- }
-
- g_signal_emit_by_name (atk_obj, "selection-changed");
- g_signal_emit_by_name (atk_obj, "visible-data-changed");
- }
-}
-
-/*
- * GtkNotebook only supports the selection of one page at a time.
- * Selecting a page unselects any previous selection, so this
- * changes the current selection instead of adding to it.
- */
-static gboolean
-gtk_notebook_accessible_add_selection (AtkSelection *selection,
- gint i)
-{
- GtkNotebook *notebook;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- notebook = GTK_NOTEBOOK (widget);
- gtk_notebook_set_current_page (notebook, i);
- return TRUE;
-}
-
-static void
-gtk_notebook_accessible_class_init (GtkNotebookAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- gobject_class->finalize = gtk_notebook_accessible_finalize;
-
- class->ref_child = gtk_notebook_accessible_ref_child;
- class->initialize = gtk_notebook_accessible_initialize;
-}
-
-static void
-gtk_notebook_accessible_init (GtkNotebookAccessible *notebook)
-{
- notebook->priv = gtk_notebook_accessible_get_instance_private (notebook);
- notebook->priv->pages = g_hash_table_new_full (g_direct_hash,
- g_direct_equal,
- NULL,
- g_object_unref);
- notebook->priv->selected_page = -1;
-}
-
-static AtkObject *
-gtk_notebook_accessible_ref_selection (AtkSelection *selection,
- gint i)
-{
- AtkObject *accessible;
- GtkWidget *widget;
- GtkNotebook *notebook;
- gint pagenum;
-
- if (i != 0)
- return NULL;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return NULL;
-
- notebook = GTK_NOTEBOOK (widget);
- pagenum = gtk_notebook_get_current_page (notebook);
- if (pagenum == -1)
- return NULL;
- accessible = gtk_notebook_accessible_ref_child (ATK_OBJECT (selection), pagenum);
-
- return accessible;
-}
-
-/* Always return 1 because there can only be one page
- * selected at any time
- */
-static gint
-gtk_notebook_accessible_get_selection_count (AtkSelection *selection)
-{
- GtkWidget *widget;
- GtkNotebook *notebook;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return 0;
-
- notebook = GTK_NOTEBOOK (widget);
- if (notebook == NULL || gtk_notebook_get_current_page (notebook) == -1)
- return 0;
-
- return 1;
-}
-
-static gboolean
-gtk_notebook_accessible_is_child_selected (AtkSelection *selection,
- gint i)
-{
- GtkWidget *widget;
- GtkNotebook *notebook;
- gint pagenumber;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- notebook = GTK_NOTEBOOK (widget);
- pagenumber = gtk_notebook_get_current_page(notebook);
-
- if (pagenumber == i)
- return TRUE;
-
- return FALSE;
-}
-
-static void
-atk_selection_interface_init (AtkSelectionIface *iface)
-{
- iface->add_selection = gtk_notebook_accessible_add_selection;
- iface->ref_selection = gtk_notebook_accessible_ref_selection;
- iface->get_selection_count = gtk_notebook_accessible_get_selection_count;
- iface->is_child_selected = gtk_notebook_accessible_is_child_selected;
-}
diff --git a/gtk/a11y/gtknotebookaccessible.h b/gtk/a11y/gtknotebookaccessible.h
deleted file mode 100644
index bd34be6902..0000000000
--- a/gtk/a11y/gtknotebookaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_NOTEBOOK_ACCESSIBLE_H__
-#define __GTK_NOTEBOOK_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_NOTEBOOK_ACCESSIBLE (gtk_notebook_accessible_get_type ())
-#define GTK_NOTEBOOK_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK_ACCESSIBLE, GtkNotebookAccessible))
-#define GTK_NOTEBOOK_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK_ACCESSIBLE, GtkNotebookAccessibleClass))
-#define GTK_IS_NOTEBOOK_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK_ACCESSIBLE))
-#define GTK_IS_NOTEBOOK_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK_ACCESSIBLE))
-#define GTK_NOTEBOOK_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK_ACCESSIBLE, GtkNotebookAccessibleClass))
-
-typedef struct _GtkNotebookAccessible GtkNotebookAccessible;
-typedef struct _GtkNotebookAccessibleClass GtkNotebookAccessibleClass;
-typedef struct _GtkNotebookAccessiblePrivate GtkNotebookAccessiblePrivate;
-
-struct _GtkNotebookAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkNotebookAccessiblePrivate *priv;
-};
-
-struct _GtkNotebookAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_notebook_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_NOTEBOOK_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtknotebookaccessibleprivate.h b/gtk/a11y/gtknotebookaccessibleprivate.h
deleted file mode 100644
index 5e4ab3b9f5..0000000000
--- a/gtk/a11y/gtknotebookaccessibleprivate.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* gtknotebookaccessibleprivate.h: GtkNotebookAccessible private API
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 .
- */
-
-#pragma once
-
-#include "gtknotebookaccessible.h"
-
-G_BEGIN_DECLS
-
-void gtk_notebook_accessible_update_page (GtkNotebookAccessible *self,
- int page_num);
-
-G_END_DECLS
diff --git a/gtk/a11y/gtknotebookpageaccessible.c b/gtk/a11y/gtknotebookpageaccessible.c
deleted file mode 100644
index 09d089ebe3..0000000000
--- a/gtk/a11y/gtknotebookpageaccessible.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include "gtknotebookpageaccessible.h"
-
-
-struct _GtkNotebookPageAccessiblePrivate
-{
- GtkAccessible *notebook;
- GtkWidget *child;
-};
-
-static void atk_component_interface_init (AtkComponentIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkNotebookPageAccessible, gtk_notebook_page_accessible, ATK_TYPE_OBJECT,
- G_ADD_PRIVATE (GtkNotebookPageAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
-
-
-static GtkWidget *
-find_label_child (GtkWidget *widget)
-{
- GtkWidget *child;
-
- for (child = gtk_widget_get_first_child (widget);
- child != NULL;
- child = gtk_widget_get_next_sibling (child))
- {
- if (GTK_IS_LABEL (child))
- return child;
- else
- {
- GtkWidget *w = find_label_child (child);
- if (w)
- return w;
- }
- }
-
- return NULL;
-}
-
-static GtkWidget *
-get_label_from_notebook_page (GtkNotebookPageAccessible *page)
-{
- GtkWidget *child;
- GtkNotebook *notebook;
-
- notebook = GTK_NOTEBOOK (gtk_accessible_get_widget (page->priv->notebook));
- if (!notebook)
- return NULL;
-
- if (!gtk_notebook_get_show_tabs (notebook))
- return NULL;
-
- child = gtk_notebook_get_tab_label (notebook, page->priv->child);
-
- if (GTK_IS_LABEL (child))
- return child;
-
- return find_label_child (child);
-}
-
-static const gchar *
-gtk_notebook_page_accessible_get_name (AtkObject *accessible)
-{
- GtkWidget *label;
-
- if (accessible->name != NULL)
- return accessible->name;
-
- label = get_label_from_notebook_page (GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible));
- if (GTK_IS_LABEL (label))
- return gtk_label_get_text (GTK_LABEL (label));
-
- return NULL;
-}
-
-static AtkObject *
-gtk_notebook_page_accessible_get_parent (AtkObject *accessible)
-{
- GtkNotebookPageAccessible *page;
-
- page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible);
-
- return ATK_OBJECT (page->priv->notebook);
-}
-
-static gint
-gtk_notebook_page_accessible_get_n_children (AtkObject *accessible)
-{
- return 1;
-}
-
-static AtkObject *
-gtk_notebook_page_accessible_ref_child (AtkObject *accessible,
- gint i)
-{
- AtkObject *child_obj;
- GtkNotebookPageAccessible *page = NULL;
-
- if (i != 0)
- return NULL;
-
- page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible);
- if (!page->priv->child)
- return NULL;
-
- child_obj = gtk_widget_get_accessible (page->priv->child);
- g_object_ref (child_obj);
-
- return child_obj;
-}
-
-static AtkStateSet *
-gtk_notebook_page_accessible_ref_state_set (AtkObject *accessible)
-{
- GtkNotebookPageAccessible *page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible);
- AtkStateSet *state_set, *label_state_set, *merged_state_set;
- AtkObject *atk_label;
- GtkWidget *label;
- AtkObject *selected;
-
- state_set = ATK_OBJECT_CLASS (gtk_notebook_page_accessible_parent_class)->ref_state_set (accessible);
-
- atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
-
- selected = atk_selection_ref_selection (ATK_SELECTION (page->priv->notebook), 0);
- if (selected)
- {
- if (selected == accessible)
- atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
-
- g_object_unref (selected);
- }
-
- label = get_label_from_notebook_page (GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible));
- if (label)
- {
- atk_label = gtk_widget_get_accessible (label);
- label_state_set = atk_object_ref_state_set (atk_label);
- merged_state_set = atk_state_set_or_sets (state_set, label_state_set);
- g_object_unref (label_state_set);
- g_object_unref (state_set);
- }
- else
- {
- AtkObject *child;
-
- child = atk_object_ref_accessible_child (accessible, 0);
- if (!child)
- return state_set;
-
- merged_state_set = state_set;
- state_set = atk_object_ref_state_set (child);
- if (atk_state_set_contains_state (state_set, ATK_STATE_VISIBLE))
- {
- atk_state_set_add_state (merged_state_set, ATK_STATE_VISIBLE);
- if (atk_state_set_contains_state (state_set, ATK_STATE_ENABLED))
- atk_state_set_add_state (merged_state_set, ATK_STATE_ENABLED);
- if (atk_state_set_contains_state (state_set, ATK_STATE_SHOWING))
- atk_state_set_add_state (merged_state_set, ATK_STATE_SHOWING);
-
- }
- g_object_unref (state_set);
- g_object_unref (child);
- }
- return merged_state_set;
-}
-
-static gint
-gtk_notebook_page_accessible_get_index_in_parent (AtkObject *accessible)
-{
- GtkNotebookPageAccessible *page;
-
- page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible);
- if (!page->priv->child)
- return -1;
-
- return gtk_notebook_page_num (GTK_NOTEBOOK (gtk_accessible_get_widget (page->priv->notebook)),
- page->priv->child);
-}
-
-static void
-gtk_notebook_page_accessible_class_init (GtkNotebookPageAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_name = gtk_notebook_page_accessible_get_name;
- class->get_parent = gtk_notebook_page_accessible_get_parent;
- class->get_n_children = gtk_notebook_page_accessible_get_n_children;
- class->ref_child = gtk_notebook_page_accessible_ref_child;
- class->ref_state_set = gtk_notebook_page_accessible_ref_state_set;
- class->get_index_in_parent = gtk_notebook_page_accessible_get_index_in_parent;
-}
-
-static void
-gtk_notebook_page_accessible_init (GtkNotebookPageAccessible *page)
-{
- page->priv = gtk_notebook_page_accessible_get_instance_private (page);
-}
-
-static void
-notify_tab_label (GObject *object,
- GParamSpec *pspec,
- AtkObject *atk_obj)
-{
- if (atk_obj->name == NULL)
- g_object_notify (G_OBJECT (atk_obj), "accessible-name");
- g_signal_emit_by_name (atk_obj, "visible-data-changed");
-}
-
-AtkObject *
-gtk_notebook_page_accessible_new (GtkNotebookAccessible *notebook,
- GtkWidget *child)
-{
- GObject *object;
- AtkObject *atk_object;
- GtkNotebookPageAccessible *page;
- GtkNotebook *nb;
-
- g_return_val_if_fail (GTK_IS_NOTEBOOK_ACCESSIBLE (notebook), NULL);
- g_return_val_if_fail (GTK_WIDGET (child), NULL);
-
- object = g_object_new (GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE, NULL);
-
- page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (object);
- page->priv->notebook = GTK_ACCESSIBLE (notebook);
- page->priv->child = child;
-
- atk_object = ATK_OBJECT (page);
- atk_object->role = ATK_ROLE_PAGE_TAB;
- atk_object->layer = ATK_LAYER_WIDGET;
-
- atk_object_set_parent (gtk_widget_get_accessible (child), atk_object);
- nb = GTK_NOTEBOOK (gtk_accessible_get_widget (page->priv->notebook));
-
- g_signal_connect (gtk_notebook_get_page (nb, child),
- "notify::tab-label",
- G_CALLBACK (notify_tab_label), page);
-
- return atk_object;
-}
-
-void
-gtk_notebook_page_accessible_invalidate (GtkNotebookPageAccessible *page)
-{
- AtkObject *obj = ATK_OBJECT (page);
- GtkWidget *notebook;
-
- notebook = gtk_accessible_get_widget (page->priv->notebook);
- if (notebook)
- g_signal_handlers_disconnect_by_func (notebook, notify_tab_label, page);
-
- atk_object_notify_state_change (obj, ATK_STATE_DEFUNCT, TRUE);
- atk_object_set_parent (obj, NULL);
- page->priv->notebook = NULL;
- atk_object_set_parent (gtk_widget_get_accessible (page->priv->child), NULL);
- page->priv->child = NULL;
-}
-
-static AtkObject*
-gtk_notebook_page_accessible_ref_accessible_at_point (AtkComponent *component,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- /* There is only one child so we return it */
- AtkObject* child;
-
- child = atk_object_ref_accessible_child (ATK_OBJECT (component), 0);
-
- return child;
-}
-
-static void
-gtk_notebook_page_accessible_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkWidget *label;
- AtkObject *atk_label;
-
- label = get_label_from_notebook_page (GTK_NOTEBOOK_PAGE_ACCESSIBLE (component));
- if (!label)
- {
- AtkObject *child;
-
- *width = 0;
- *height = 0;
-
- child = atk_object_ref_accessible_child (ATK_OBJECT (component), 0);
- if (!child)
- return;
-
- atk_component_get_extents (ATK_COMPONENT (child), x, y, NULL, NULL,
- coord_type);
- g_object_unref (child);
- }
- else
- {
- atk_label = gtk_widget_get_accessible (label);
- atk_component_get_extents (ATK_COMPONENT (atk_label),
- x, y, width, height, coord_type);
- }
-}
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- /* We use the default implementations for contains, get_position, get_size */
- iface->ref_accessible_at_point = gtk_notebook_page_accessible_ref_accessible_at_point;
- iface->get_extents = gtk_notebook_page_accessible_get_extents;
-}
diff --git a/gtk/a11y/gtknotebookpageaccessible.h b/gtk/a11y/gtknotebookpageaccessible.h
deleted file mode 100644
index dfa6d6df4a..0000000000
--- a/gtk/a11y/gtknotebookpageaccessible.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 .
- */
-
-#ifndef __GTK_NOTEBOOK_PAGE_ACCESSIBLE_H__
-#define __GTK_NOTEBOOK_PAGE_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE (gtk_notebook_page_accessible_get_type ())
-#define GTK_NOTEBOOK_PAGE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE, GtkNotebookPageAccessible))
-#define GTK_NOTEBOOK_PAGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE, GtkNotebookPageAccessibleClass))
-#define GTK_IS_NOTEBOOK_PAGE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE))
-#define GTK_IS_NOTEBOOK_PAGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE))
-#define GTK_NOTEBOOK_PAGE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE, GtkNotebookPageAccessibleClass))
-
-typedef struct _GtkNotebookPageAccessible GtkNotebookPageAccessible;
-typedef struct _GtkNotebookPageAccessibleClass GtkNotebookPageAccessibleClass;
-typedef struct _GtkNotebookPageAccessiblePrivate GtkNotebookPageAccessiblePrivate;
-
-struct _GtkNotebookPageAccessible
-{
- AtkObject parent;
-
- GtkNotebookPageAccessiblePrivate *priv;
-};
-
-struct _GtkNotebookPageAccessibleClass
-{
- AtkObjectClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_notebook_page_accessible_get_type (void);
-
-GDK_AVAILABLE_IN_ALL
-AtkObject *gtk_notebook_page_accessible_new (GtkNotebookAccessible *notebook,
- GtkWidget *child);
-
-GDK_AVAILABLE_IN_ALL
-void gtk_notebook_page_accessible_invalidate (GtkNotebookPageAccessible *page);
-
-G_END_DECLS
-
-#endif /* __GTK_NOTEBOOK_PAGE_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkpanedaccessible.c b/gtk/a11y/gtkpanedaccessible.c
deleted file mode 100644
index ba574485d8..0000000000
--- a/gtk/a11y/gtkpanedaccessible.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include "gtkpanedaccessible.h"
-
-static void atk_value_interface_init (AtkValueIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkPanedAccessible, gtk_paned_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
-
-static void
-gtk_paned_accessible_position_changed (GtkWidget *widget)
-{
- AtkObject *obj = gtk_widget_get_accessible (widget);
-
- g_object_notify (G_OBJECT (obj), "accessible-value");
-}
-
-static void
-gtk_paned_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_paned_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect (data, "notify::position",
- G_CALLBACK (gtk_paned_accessible_position_changed), NULL);
-
- obj->role = ATK_ROLE_SPLIT_PANE;
-}
-
-static void
-gtk_paned_accessible_class_init (GtkPanedAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->initialize = gtk_paned_accessible_initialize;
-}
-
-static void
-gtk_paned_accessible_init (GtkPanedAccessible *paned)
-{
-}
-
-static void
-gtk_paned_accessible_get_current_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget* widget;
- gint current_value;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return;
-
- current_value = gtk_paned_get_position (GTK_PANED (widget));
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, current_value);
-}
-
-static void
-gtk_paned_accessible_get_maximum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget* widget;
- gint maximum_value;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return;
-
- g_object_get (GTK_PANED (widget),
- "max-position", &maximum_value,
- NULL);
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, maximum_value);
-}
-
-static void
-gtk_paned_accessible_get_minimum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget* widget;
- gint minimum_value;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return;
-
- g_object_get (GTK_PANED (widget),
- "min-position", &minimum_value,
- NULL);
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, minimum_value);
-}
-
-/* Calling atk_value_set_current_value() is no guarantee that the value
- * is acceptable; it is necessary to listen for accessible-value signals
- * and check whether the current value has been changed or check what the
- * maximum and minimum values are.
- */
-static gboolean
-gtk_paned_accessible_set_current_value (AtkValue *obj,
- const GValue *value)
-{
- GtkWidget* widget;
- gint new_value;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return FALSE;
-
- if (G_VALUE_HOLDS_INT (value))
- {
- new_value = g_value_get_int (value);
- gtk_paned_set_position (GTK_PANED (widget), new_value);
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static void
-gtk_paned_accessible_get_value_and_text (AtkValue *obj,
- gdouble *value,
- gchar **text)
-{
- GtkWidget *widget;
- GtkPaned *paned;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- paned = GTK_PANED (widget);
-
- *value = gtk_paned_get_position (paned);
- *text = NULL;
-}
-
-static AtkRange *
-gtk_paned_accessible_get_range (AtkValue *obj)
-{
- GtkWidget *widget;
- gint minimum_value;
- gint maximum_value;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- g_object_get (widget,
- "min-position", &minimum_value,
- "max-position", &maximum_value,
- NULL);
-
- return atk_range_new (minimum_value, maximum_value, NULL);
-}
-
-static void
-gtk_paned_accessible_set_value (AtkValue *obj,
- const gdouble value)
-{
- GtkWidget *widget;
- GtkPaned *paned;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- paned = GTK_PANED (widget);
-
- gtk_paned_set_position (paned, (gint)(value + 0.5));
-}
-
-static void
-atk_value_interface_init (AtkValueIface *iface)
-{
- iface->get_current_value = gtk_paned_accessible_get_current_value;
- iface->get_maximum_value = gtk_paned_accessible_get_maximum_value;
- iface->get_minimum_value = gtk_paned_accessible_get_minimum_value;
- iface->set_current_value = gtk_paned_accessible_set_current_value;
-
- iface->get_value_and_text = gtk_paned_accessible_get_value_and_text;
- iface->get_range = gtk_paned_accessible_get_range;
- iface->set_value = gtk_paned_accessible_set_value;
-}
diff --git a/gtk/a11y/gtkpanedaccessible.h b/gtk/a11y/gtkpanedaccessible.h
deleted file mode 100644
index a551b42e72..0000000000
--- a/gtk/a11y/gtkpanedaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_PANED_ACCESSIBLE_H__
-#define __GTK_PANED_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_PANED_ACCESSIBLE (gtk_paned_accessible_get_type ())
-#define GTK_PANED_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PANED_ACCESSIBLE, GtkPanedAccessible))
-#define GTK_PANED_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PANED_ACCESSIBLE, GtkPanedAccessibleClass))
-#define GTK_IS_PANED_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PANED_ACCESSIBLE))
-#define GTK_IS_PANED_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PANED_ACCESSIBLE))
-#define GTK_PANED_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PANED_ACCESSIBLE, GtkPanedAccessibleClass))
-
-typedef struct _GtkPanedAccessible GtkPanedAccessible;
-typedef struct _GtkPanedAccessibleClass GtkPanedAccessibleClass;
-typedef struct _GtkPanedAccessiblePrivate GtkPanedAccessiblePrivate;
-
-struct _GtkPanedAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkPanedAccessiblePrivate *priv;
-};
-
-struct _GtkPanedAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_paned_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_PANED_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkpasswordentryaccessible.c b/gtk/a11y/gtkpasswordentryaccessible.c
deleted file mode 100644
index 3b3236767f..0000000000
--- a/gtk/a11y/gtkpasswordentryaccessible.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/* gtkpasswordentryaccessible.c: A GtkWidgetAccessible for GtkPasswordEntry
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 "gtkpasswordentryaccessibleprivate.h"
-
-#include "gtkeditable.h"
-#include "gtkimage.h"
-#include "gtkintl.h"
-#include "gtklabel.h"
-#include "gtkpango.h"
-#include "gtkpasswordentryprivate.h"
-#include "gtkstylecontextprivate.h"
-#include "gtktextprivate.h"
-
-struct _GtkPasswordEntryAccessible
-{
- GtkWidgetAccessible parent_instance;
-
- int cursor_position;
- int selection_bound;
-};
-
-static void atk_editable_text_interface_init (AtkEditableTextIface *iface);
-static void atk_text_interface_init (AtkTextIface *iface);
-static void atk_action_interface_init (AtkActionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkPasswordEntryAccessible, gtk_password_entry_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static inline GtkText *
-get_text_widget (GtkAccessible *accessible)
-{
- GtkWidget *widget = gtk_accessible_get_widget (accessible);
-
- if (widget == NULL)
- return NULL;
-
- GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (widget);
-
- return gtk_password_entry_get_text_widget (entry);
-}
-
-static gunichar
-gtk_password_entry_accessible_get_character_at_offset (AtkText *atk_text,
- gint offset)
-{
- GtkText *text;
- char *contents, *index;
- gunichar result;
-
- result = '\0';
-
- text = get_text_widget (GTK_ACCESSIBLE (atk_text));
- if (text == NULL)
- return 0;
-
- if (!gtk_text_get_visibility (text))
- return result;
-
- contents = gtk_text_get_display_text (text, 0, -1);
- if (offset < g_utf8_strlen (contents, -1))
- {
- index = g_utf8_offset_to_pointer (contents, offset);
- result = g_utf8_get_char (index);
- g_free (contents);
- }
-
- return result;
-}
-
-static gint
-gtk_password_entry_accessible_get_caret_offset (AtkText *atk_text)
-{
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
-
- if (widget == NULL)
- return -1;
-
- int cursor_position = 0;
- gboolean result = gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), NULL, &cursor_position);
- if (!result)
- return -1;
-
- return cursor_position;
-}
-
-static gboolean
-gtk_password_entry_accessible_set_caret_offset (AtkText *atk_text,
- gint offset)
-{
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return FALSE;
-
- gtk_editable_set_position (GTK_EDITABLE (widget), offset);
-
- return TRUE;
-}
-
-static gint
-gtk_password_entry_accessible_get_character_count (AtkText *atk_text)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
- if (text == NULL)
- return 0;
-
- char *display_text = gtk_text_get_display_text (text, 0, -1);
-
- int char_count = 0;
- if (display_text)
- {
- char_count = g_utf8_strlen (display_text, -1);
- g_free (display_text);
- }
-
- return char_count;
-}
-
-static gint
-gtk_password_entry_accessible_get_offset_at_point (AtkText *atk_text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
- int index, x_layout, y_layout;
- int x_local, y_local;
- glong offset;
-
- if (text == NULL)
- return 1;
-
- gtk_text_get_layout_offsets (text, &x_layout, &y_layout);
-
- x_local = x - x_layout;
- y_local = y - y_layout;
-
- if (!pango_layout_xy_to_index (gtk_text_get_layout (text),
- x_local * PANGO_SCALE,
- y_local * PANGO_SCALE,
- &index, NULL))
- {
- if (x_local < 0 || y_local < 0)
- index = 0;
- else
- index = -1;
- }
-
- offset = -1;
- if (index != -1)
- {
- char *entry_text = gtk_text_get_display_text (text, 0, -1);
- offset = g_utf8_pointer_to_offset (entry_text, entry_text + index);
- g_free (entry_text);
- }
-
- return offset;
-}
-
-static void
-atk_text_interface_init (AtkTextIface *iface)
-{
- iface->get_character_at_offset = gtk_password_entry_accessible_get_character_at_offset;
- iface->get_caret_offset = gtk_password_entry_accessible_get_caret_offset;
- iface->set_caret_offset = gtk_password_entry_accessible_set_caret_offset;
- iface->get_character_count = gtk_password_entry_accessible_get_character_count;
- iface->get_offset_at_point = gtk_password_entry_accessible_get_offset_at_point;
-}
-
-static void
-gtk_password_entry_accessible_set_text_contents (AtkEditableText *text,
- const gchar *string)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- if (!gtk_editable_get_editable (GTK_EDITABLE (widget)))
- return;
-
- gtk_editable_set_text (GTK_EDITABLE (widget), string);
-}
-
-static void
-gtk_password_entry_accessible_insert_text (AtkEditableText *text,
- const gchar *string,
- gint length,
- gint *position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- int pos = 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- if (position != NULL)
- pos = *position;
-
- gtk_editable_insert_text (editable, string, length, &pos);
- gtk_editable_set_position (editable, pos);
-
- if (position != NULL)
- *position = pos;
-}
-
-static void
-gtk_password_entry_accessible_delete_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- gtk_editable_delete_text (editable, start_pos, end_pos);
-}
-
-typedef struct
-{
- GtkEditable *entry;
- int position;
-} PasteData;
-
-static void
-paste_received_cb (GObject *clipboard,
- GAsyncResult *result,
- gpointer data)
-{
- PasteData *paste = data;
- char *text;
-
- text = gdk_clipboard_read_text_finish (GDK_CLIPBOARD (clipboard), result, NULL);
- if (text != NULL)
- gtk_editable_insert_text (paste->entry,
- text, -1,
- &(paste->position));
-
- g_object_unref (paste->entry);
- g_free (paste);
- g_free (text);
-}
-
-static void
-gtk_password_entry_accessible_paste_text (AtkEditableText *text,
- gint position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- PasteData *paste;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- paste = g_new0 (PasteData, 1);
- paste->entry = GTK_EDITABLE (widget);
- paste->position = position;
-
- g_object_ref (paste->entry);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_read_text_async (clipboard, NULL, paste_received_cb, paste);
-}
-
-static void
-atk_editable_text_interface_init (AtkEditableTextIface *iface)
-{
- iface->set_text_contents = gtk_password_entry_accessible_set_text_contents;
- iface->insert_text = gtk_password_entry_accessible_insert_text;
- iface->copy_text = NULL;
- iface->cut_text = NULL;
- iface->delete_text = gtk_password_entry_accessible_delete_text;
- iface->paste_text = gtk_password_entry_accessible_paste_text;
- iface->set_run_attributes = NULL;
-}
-
-static gboolean
-gtk_password_entry_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- if (i == 0)
- {
- gtk_widget_activate (widget);
- return TRUE;
- }
-
- if (i == 1)
- {
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (action));
-
- gboolean visibility = gtk_text_get_visibility (text);
- gtk_text_set_visibility (text, !visibility);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gint
-gtk_password_entry_accessible_get_n_actions (AtkAction *action)
-{
- GtkAccessible *accessible = GTK_ACCESSIBLE (action);
-
- GtkWidget *widget = gtk_accessible_get_widget (accessible);
- if (widget == NULL)
- return 0;
-
- int n_actions = 1;
- if (gtk_password_entry_get_show_peek_icon (GTK_PASSWORD_ENTRY (widget)))
- n_actions += 1;
-
- return n_actions;
-}
-
-static const gchar *
-gtk_password_entry_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
- GtkWidget *label;
- AtkRelationSet *set;
- AtkRelation *relation;
- GPtrArray *target;
- gpointer target_object;
- guint key_val;
-
- if (i != 0)
- return NULL;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return NULL;
-
- set = atk_object_ref_relation_set (ATK_OBJECT (action));
- if (!set)
- return NULL;
-
- label = NULL;
- relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
- if (relation)
- {
- target = atk_relation_get_target (relation);
-
- target_object = g_ptr_array_index (target, 0);
- label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
- }
-
- g_object_unref (set);
-
- if (GTK_IS_LABEL (label))
- {
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
-
- return NULL;
-}
-
-static const gchar *
-gtk_password_entry_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0:
- return "activate";
-
- case 1:
- return "peek";
-
- default:
- break;
- }
-
- return NULL;
-}
-
-static const gchar*
-gtk_password_entry_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Activate");
- if (i == 1)
- return C_("Action name", "Peek");
-
- return NULL;
-}
-
-static const gchar *
-gtk_password_entry_accessible_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Activates the entry");
-
- if (i == 1)
- return C_("Action description", "Reveals the contents the entry");
-
- return NULL;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_password_entry_accessible_do_action;
- iface->get_n_actions = gtk_password_entry_accessible_get_n_actions;
- iface->get_keybinding = gtk_password_entry_accessible_get_keybinding;
- iface->get_name = gtk_password_entry_accessible_action_get_name;
- iface->get_localized_name = gtk_password_entry_accessible_action_get_localized_name;
- iface->get_description = gtk_password_entry_accessible_action_get_description;
-}
-
-static AtkAttributeSet *
-gtk_password_entry_accessible_get_attributes (AtkObject *accessible)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
- AtkAttribute *placeholder_text;
- char *text = NULL;
-
- attributes = ATK_OBJECT_CLASS (gtk_password_entry_accessible_parent_class)->get_attributes (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return attributes;
-
- g_object_get (widget, "placeholder-text", &text, NULL);
- if (text == NULL)
- return attributes;
-
- placeholder_text = g_malloc (sizeof (AtkAttribute));
- placeholder_text->name = g_strdup ("placeholder-text");
- placeholder_text->value = text;
-
- attributes = g_slist_append (attributes, placeholder_text);
-
- return attributes;
-}
-
-static gboolean
-check_for_selection_change (GtkPasswordEntryAccessible *self,
- GtkEditable *editable)
-{
- gboolean ret_val = FALSE;
- gint start, end;
-
- if (gtk_editable_get_selection_bounds (editable, &start, &end))
- {
- if (end != self->cursor_position ||
- start != self->selection_bound)
- /*
- * This check is here as this function can be called
- * for notification of selection_bound and current_pos.
- * The values of current_pos and selection_bound may be the same
- * for both notifications and we only want to generate one
- * text_selection_changed signal.
- */
- ret_val = TRUE;
- }
- else
- {
- /* We had a selection */
- ret_val = (self->cursor_position != self->selection_bound);
- }
-
- self->cursor_position = end;
- self->selection_bound = start;
-
- return ret_val;
-}
-
-static void
-on_cursor_position_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer data)
-{
- GtkPasswordEntryAccessible *self = data;
- GtkEditable *editable = GTK_EDITABLE (gobject);
-
- if (check_for_selection_change (self, editable))
- g_signal_emit_by_name (self, "text-selection-changed");
-
- // The entry cursor position has moved so generate the signal
- g_signal_emit_by_name (self, "text-caret-moved",
- gtk_editable_get_position (editable));
-}
-
-static void
-on_selection_bound_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer data)
-{
- GtkPasswordEntryAccessible *self = data;
- GtkEditable *editable = GTK_EDITABLE (gobject);
-
- if (check_for_selection_change (self, editable))
- g_signal_emit_by_name (self, "text-selection-changed");
-}
-
-static void
-insert_text_cb (GtkEditable *editable,
- gchar *new_text,
- gint new_text_length,
- gint *position,
- GtkPasswordEntryAccessible *self)
-{
- int length;
-
- if (new_text_length == 0)
- return;
-
- length = g_utf8_strlen (new_text, new_text_length);
-
- g_signal_emit_by_name (self,
- "text-changed::insert",
- *position - length,
- length);
-}
-
-static void
-delete_text_cb (GtkEditable *editable,
- gint start,
- gint end,
- GtkPasswordEntryAccessible *self)
-{
- GtkText *text;
-
- text = get_text_widget (GTK_ACCESSIBLE (self));
- if (text == NULL)
- return;
-
- if (end < 0)
- {
- char *contents;
-
- contents = gtk_text_get_display_text (text, 0, -1);
- end = g_utf8_strlen (contents, -1);
-
- g_free (contents);
- }
-
- if (end == start)
- return;
-
- g_signal_emit_by_name (self,
- "text-changed::delete",
- start,
- end - start);
-}
-
-static void
-gtk_password_entry_accessible_initialize (AtkObject *atk_object,
- gpointer data)
-{
- GtkPasswordEntryAccessible *self = GTK_PASSWORD_ENTRY_ACCESSIBLE (atk_object);
- GtkEditable *editable = data;
- GtkWidget *widget = data;
- int start_pos, end_pos;
-
- gtk_editable_get_selection_bounds (editable, &start_pos, &end_pos);
- self->cursor_position = end_pos;
- self->selection_bound = start_pos;
-
- /* Set up signal callbacks */
- g_signal_connect_after (widget, "insert-text", G_CALLBACK (insert_text_cb), self);
- g_signal_connect (widget, "delete-text", G_CALLBACK (delete_text_cb), self);
- g_signal_connect (widget, "notify::cursor-position",
- G_CALLBACK (on_cursor_position_changed), self);
- g_signal_connect (widget, "notify::selection-bound",
- G_CALLBACK (on_selection_bound_changed), self);
-}
-
-static void
-gtk_password_entry_accessible_class_init (GtkPasswordEntryAccessibleClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
-
- atk_object_class->initialize = gtk_password_entry_accessible_initialize;
- atk_object_class->get_attributes = gtk_password_entry_accessible_get_attributes;
-}
-
-static void
-gtk_password_entry_accessible_init (GtkPasswordEntryAccessible *self)
-{
- AtkObject *atk_obj = ATK_OBJECT (self);
-
- atk_obj->role = ATK_ROLE_PASSWORD_TEXT;
- atk_object_set_name (atk_obj, _("Password"));
-}
-
-void
-gtk_password_entry_accessible_update_visibility (GtkPasswordEntryAccessible *self)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (self));
-
- if (text == NULL)
- return;
-
- gboolean visibility = gtk_text_get_visibility (text);
- AtkRole role = visibility ? ATK_ROLE_TEXT : ATK_ROLE_PASSWORD_TEXT;
- atk_object_set_role (ATK_OBJECT (self), role);
-}
diff --git a/gtk/a11y/gtkpasswordentryaccessible.h b/gtk/a11y/gtkpasswordentryaccessible.h
deleted file mode 100644
index d1008426a8..0000000000
--- a/gtk/a11y/gtkpasswordentryaccessible.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* gtkpasswordentryaccessible.h: A GtkWidgetAccessible for GtkPasswordEntry
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 .
- */
-
-#pragma once
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_PASSWORD_ENTRY_ACCESSIBLE (gtk_password_entry_accessible_get_type())
-#define GTK_PASSWORD_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PASSWORD_ENTRY_ACCESSIBLE, GtkPasswordEntryAccessible))
-#define GTK_IS_PASSWORD_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PASSWORD_ENTRY_ACCESSIBLE))
-
-typedef struct _GtkPasswordEntryAccessible GtkPasswordEntryAccessible;
-typedef struct _GtkPasswordEntryAccessibleClass GtkPasswordEntryAccessibleClass;
-
-struct _GtkPasswordEntryAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_password_entry_accessible_get_type (void) G_GNUC_CONST;
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (GtkPasswordEntryAccessible, g_object_unref)
-
-G_END_DECLS
diff --git a/gtk/a11y/gtkpasswordentryaccessibleprivate.h b/gtk/a11y/gtkpasswordentryaccessibleprivate.h
deleted file mode 100644
index 5ef1153814..0000000000
--- a/gtk/a11y/gtkpasswordentryaccessibleprivate.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* gtkpasswordentryaccessibleprivate.h: Private API for GtkPasswordEntryAccessible
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 .
- */
-
-#pragma once
-
-#include "gtkpasswordentryaccessible.h"
-
-G_BEGIN_DECLS
-
-void gtk_password_entry_accessible_update_visibility (GtkPasswordEntryAccessible *self);
-
-G_END_DECLS
diff --git a/gtk/a11y/gtkpictureaccessible.c b/gtk/a11y/gtkpictureaccessible.c
deleted file mode 100644
index 9f49eaf855..0000000000
--- a/gtk/a11y/gtkpictureaccessible.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright © 2018 Benjamin Otte
- *
- * 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.1 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 .
- *
- * Authors: Benjamin Otte
- */
-
-#include "config.h"
-
-#include "gtkpictureaccessibleprivate.h"
-
-#include "gtkpicture.h"
-
-struct _GtkPictureAccessible
-{
- GtkWidgetAccessible parent_instance;
-};
-
-struct _GtkPictureAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-static const gchar *
-gtk_picture_accessible_get_image_description (AtkImage *image)
-{
- GtkWidget* widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
- if (widget == NULL)
- return NULL;
-
- return gtk_picture_get_alternative_text (GTK_PICTURE (widget));
-}
-
-static void
-gtk_picture_accessible_get_image_position (AtkImage *image,
- gint *x,
- gint *y,
- AtkCoordType coord_type)
-{
- atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL,
- coord_type);
-}
-
-static void
-gtk_picture_accessible_get_image_size (AtkImage *image,
- gint *width,
- gint *height)
-{
- GtkWidget* widget;
- GdkPaintable *paintable;
-
- *width = -1;
- *height = -1;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
- if (widget == NULL)
- return;
-
- paintable = gtk_picture_get_paintable (GTK_PICTURE (widget));
- if (paintable == NULL)
- return;
-
- *width = gdk_paintable_get_intrinsic_width (paintable);
- if (*width == 0)
- *width = -1;
-
- *height = gdk_paintable_get_intrinsic_height (paintable);
- if (*height == 0)
- *height = -1;
-}
-
-static void
-gtk_picture_accessible_image_init (AtkImageIface *iface)
-{
- iface->get_image_description = gtk_picture_accessible_get_image_description;
- iface->get_image_position = gtk_picture_accessible_get_image_position;
- iface->get_image_size = gtk_picture_accessible_get_image_size;
-}
-
-G_DEFINE_TYPE_WITH_CODE (GtkPictureAccessible, gtk_picture_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, gtk_picture_accessible_image_init))
-
-static void
-gtk_picture_accessible_initialize (AtkObject *accessible,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_picture_accessible_parent_class)->initialize (accessible, data);
-
- accessible->role = ATK_ROLE_IMAGE;
-}
-
-static const gchar *
-gtk_picture_accessible_get_name (AtkObject *accessible)
-{
- GtkWidget* widget;
- const gchar *name;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_picture_accessible_parent_class)->get_name (accessible);
- if (name)
- return name;
-
- return gtk_picture_get_alternative_text (GTK_PICTURE (widget));
-}
-
-static void
-gtk_picture_accessible_class_init (GtkPictureAccessibleClass *klass)
-{
- AtkObjectClass *atkobject_class = ATK_OBJECT_CLASS (klass);
-
- atkobject_class->initialize = gtk_picture_accessible_initialize;
- atkobject_class->get_name = gtk_picture_accessible_get_name;
-}
-
-static void
-gtk_picture_accessible_init (GtkPictureAccessible *image)
-{
-}
-
diff --git a/gtk/a11y/gtkpictureaccessibleprivate.h b/gtk/a11y/gtkpictureaccessibleprivate.h
deleted file mode 100644
index f079a350c7..0000000000
--- a/gtk/a11y/gtkpictureaccessibleprivate.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright © 2018 Benjamin Otte
- *
- * 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.1 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 .
- *
- * Authors: Benjamin Otte
- */
-
-#ifndef __GTK_PICTURE_ACCESSIBLE_PRIVATE_H__
-#define __GTK_PICTURE_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_PICTURE_ACCESSIBLE (gtk_picture_accessible_get_type ())
-
-GDK_AVAILABLE_IN_ALL
-G_DECLARE_FINAL_TYPE (GtkPictureAccessible, gtk_picture_accessible, GTK, PICTURE_ACCESSIBLE, GtkWidgetAccessible)
-
-G_END_DECLS
-
-#endif /* __GTK_PICTURE_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkpopoveraccessible.c b/gtk/a11y/gtkpopoveraccessible.c
deleted file mode 100644
index 6d222a5f5a..0000000000
--- a/gtk/a11y/gtkpopoveraccessible.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright © 2014 Red Hat 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 .
- *
- * Author: Carlos Garnacho
- */
-
-#include "config.h"
-
-#include
-#include
-#include "gtkpopoveraccessible.h"
-
-typedef struct _GtkPopoverAccessiblePrivate GtkPopoverAccessiblePrivate;
-
-G_DEFINE_TYPE (GtkPopoverAccessible, gtk_popover_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static void
-popover_update_modality (AtkObject *object,
- GtkPopover *popover)
-{
- atk_object_notify_state_change (object, ATK_STATE_MODAL,
- gtk_popover_get_autohide (popover));
-}
-
-static void
-popover_notify_cb (GtkPopover *popover,
- GParamSpec *pspec,
- AtkObject *object)
-{
- AtkObject *popover_accessible;
-
- popover_accessible = gtk_widget_get_accessible (GTK_WIDGET (popover));
-
- if (strcmp (g_param_spec_get_name (pspec), "modal") == 0)
- popover_update_modality (popover_accessible, popover);
-}
-
-static void
-gtk_popover_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkPopover *popover = GTK_POPOVER (data);
-
- ATK_OBJECT_CLASS (gtk_popover_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect (popover, "notify",
- G_CALLBACK (popover_notify_cb), obj);
- popover_update_modality (obj, popover);
-
- obj->role = ATK_ROLE_PANEL;
-}
-
-static AtkStateSet *
-gtk_popover_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gtk_popover_accessible_parent_class)->ref_state_set (obj);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- if (gtk_popover_get_autohide (GTK_POPOVER (widget)))
- atk_state_set_add_state (state_set, ATK_STATE_MODAL);
-
- return state_set;
-}
-
-static void
-gtk_popover_accessible_class_init (GtkPopoverAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->initialize = gtk_popover_accessible_initialize;
- class->ref_state_set = gtk_popover_accessible_ref_state_set;
-}
-
-static void
-gtk_popover_accessible_init (GtkPopoverAccessible *popover)
-{
-}
diff --git a/gtk/a11y/gtkpopoveraccessible.h b/gtk/a11y/gtkpopoveraccessible.h
deleted file mode 100644
index fc6d83954b..0000000000
--- a/gtk/a11y/gtkpopoveraccessible.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright © 2014 Red Hat 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 .
- *
- * Author: Carlos Garnacho
- */
-
-#ifndef __GTK_POPOVER_ACCESSIBLE_H__
-#define __GTK_POPOVER_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_POPOVER_ACCESSIBLE (gtk_popover_accessible_get_type ())
-#define GTK_POPOVER_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_POPOVER_ACCESSIBLE, GtkPopoverAccessible))
-#define GTK_POPOVER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_POPOVER_ACCESSIBLE, GtkPopoverAccessibleClass))
-#define GTK_IS_POPOVER_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_POPOVER_ACCESSIBLE))
-#define GTK_IS_POPOVER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_POPOVER_ACCESSIBLE))
-#define GTK_POPOVER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_POPOVER_ACCESSIBLE, GtkPopoverAccessibleClass))
-
-typedef struct _GtkPopoverAccessible GtkPopoverAccessible;
-typedef struct _GtkPopoverAccessibleClass GtkPopoverAccessibleClass;
-
-struct _GtkPopoverAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkPopoverAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_popover_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_POPOVER_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkprogressbaraccessible.c b/gtk/a11y/gtkprogressbaraccessible.c
deleted file mode 100644
index 99aaf95624..0000000000
--- a/gtk/a11y/gtkprogressbaraccessible.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-
-#include "gtkprogressbaraccessibleprivate.h"
-
-static void atk_value_interface_init (AtkValueIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkProgressBarAccessible, gtk_progress_bar_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
-
-void
-gtk_progress_bar_accessible_update_value (GtkProgressBarAccessible *self)
-{
- g_object_notify (G_OBJECT (self), "accessible-value");
-}
-
-static void
-gtk_progress_bar_accessible_class_init (GtkProgressBarAccessibleClass *klass)
-{
-}
-
-static void
-gtk_progress_bar_accessible_init (GtkProgressBarAccessible *self)
-{
- ATK_OBJECT (self)->role = ATK_ROLE_PROGRESS_BAR;
-}
-
-static void
-gtk_progress_bar_accessible_get_current_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (widget)));
-}
-
-static void
-gtk_progress_bar_accessible_get_maximum_value (AtkValue *obj,
- GValue *value)
-{
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, 1.0);
-}
-
-static void
-gtk_progress_bar_accessible_get_minimum_value (AtkValue *obj,
- GValue *value)
-{
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, 0.0);
-}
-
-static void
-gtk_progress_bar_accessible_get_value_and_text (AtkValue *obj,
- gdouble *value,
- gchar **text)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- *value = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (widget));
- *text = NULL;
-}
-
-static AtkRange *
-gtk_progress_bar_accessible_get_range (AtkValue *obj)
-{
- return atk_range_new (0.0, 1.0, NULL);
-}
-
-static void
-atk_value_interface_init (AtkValueIface *iface)
-{
- iface->get_current_value = gtk_progress_bar_accessible_get_current_value;
- iface->get_maximum_value = gtk_progress_bar_accessible_get_maximum_value;
- iface->get_minimum_value = gtk_progress_bar_accessible_get_minimum_value;
-
- iface->get_value_and_text = gtk_progress_bar_accessible_get_value_and_text;
- iface->get_range = gtk_progress_bar_accessible_get_range;
-}
diff --git a/gtk/a11y/gtkprogressbaraccessible.h b/gtk/a11y/gtkprogressbaraccessible.h
deleted file mode 100644
index 2c0a218049..0000000000
--- a/gtk/a11y/gtkprogressbaraccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_PROGRESS_BAR_ACCESSIBLE_H__
-#define __GTK_PROGRESS_BAR_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_PROGRESS_BAR_ACCESSIBLE (gtk_progress_bar_accessible_get_type ())
-#define GTK_PROGRESS_BAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PROGRESS_BAR_ACCESSIBLE, GtkProgressBarAccessible))
-#define GTK_PROGRESS_BAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PROGRESS_BAR_ACCESSIBLE, GtkProgressBarAccessibleClass))
-#define GTK_IS_PROGRESS_BAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PROGRESS_BAR_ACCESSIBLE))
-#define GTK_IS_PROGRESS_BAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PROGRESS_BAR_ACCESSIBLE))
-#define GTK_PROGRESS_BAR_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PROGRESS_BAR_ACCESSIBLE, GtkProgressBarAccessibleClass))
-
-typedef struct _GtkProgressBarAccessible GtkProgressBarAccessible;
-typedef struct _GtkProgressBarAccessibleClass GtkProgressBarAccessibleClass;
-typedef struct _GtkProgressBarAccessiblePrivate GtkProgressBarAccessiblePrivate;
-
-struct _GtkProgressBarAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkProgressBarAccessiblePrivate *priv;
-};
-
-struct _GtkProgressBarAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_progress_bar_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_PROGRESS_BAR_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkprogressbaraccessibleprivate.h b/gtk/a11y/gtkprogressbaraccessibleprivate.h
deleted file mode 100644
index 120d21c5b2..0000000000
--- a/gtk/a11y/gtkprogressbaraccessibleprivate.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* gtkprogressbaraccessibleprivate.h: Private GtkProgressBarAccessible API
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 .
- */
-
-#pragma once
-
-#include "gtkprogressbaraccessible.h"
-
-G_BEGIN_DECLS
-
-void gtk_progress_bar_accessible_update_value (GtkProgressBarAccessible *self);
-
-G_END_DECLS
diff --git a/gtk/a11y/gtkradiobuttonaccessible.c b/gtk/a11y/gtkradiobuttonaccessible.c
deleted file mode 100644
index df5392bb36..0000000000
--- a/gtk/a11y/gtkradiobuttonaccessible.c
+++ /dev/null
@@ -1,118 +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 "gtkradiobuttonaccessible.h"
-
-struct _GtkRadioButtonAccessiblePrivate
-{
- GSList *old_group;
-};
-
-
-G_DEFINE_TYPE_WITH_PRIVATE (GtkRadioButtonAccessible, gtk_radio_button_accessible, GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE)
-
-static void
-gtk_radio_button_accessible_initialize (AtkObject *accessible,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_radio_button_accessible_parent_class)->initialize (accessible, data);
-
- accessible->role = ATK_ROLE_RADIO_BUTTON;
-}
-
-static AtkRelationSet *
-gtk_radio_button_accessible_ref_relation_set (AtkObject *obj)
-{
- GtkWidget *widget;
- AtkRelationSet *relation_set;
- GSList *list;
- GtkRadioButtonAccessible *radio_button;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- radio_button = GTK_RADIO_BUTTON_ACCESSIBLE (obj);
-
- relation_set = ATK_OBJECT_CLASS (gtk_radio_button_accessible_parent_class)->ref_relation_set (obj);
-
- /* If the radio button'group has changed remove the relation */
- list = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget));
-
- if (radio_button->priv->old_group != list)
- {
- AtkRelation *relation;
-
- relation = atk_relation_set_get_relation_by_type (relation_set, ATK_RELATION_MEMBER_OF);
- atk_relation_set_remove (relation_set, relation);
- }
-
- if (!atk_relation_set_contains (relation_set, ATK_RELATION_MEMBER_OF))
- {
- /*
- * Get the members of the button group
- */
- radio_button->priv->old_group = list;
- if (list)
- {
- AtkObject **accessible_array;
- guint list_length;
- AtkRelation* relation;
- gint i = 0;
-
- list_length = g_slist_length (list);
- accessible_array = g_new (AtkObject *, list_length);
- while (list != NULL)
- {
- GtkWidget* list_item = list->data;
-
- accessible_array[i++] = gtk_widget_get_accessible (list_item);
-
- list = list->next;
- }
- relation = atk_relation_new (accessible_array, list_length,
- ATK_RELATION_MEMBER_OF);
- g_free (accessible_array);
-
- atk_relation_set_add (relation_set, relation);
- /*
- * Unref the relation so that it is not leaked.
- */
- g_object_unref (relation);
- }
- }
-
- return relation_set;
-}
-
-static void
-gtk_radio_button_accessible_class_init (GtkRadioButtonAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->initialize = gtk_radio_button_accessible_initialize;
- class->ref_relation_set = gtk_radio_button_accessible_ref_relation_set;
-}
-
-static void
-gtk_radio_button_accessible_init (GtkRadioButtonAccessible *radio_button)
-{
- radio_button->priv = gtk_radio_button_accessible_get_instance_private (radio_button);
-}
diff --git a/gtk/a11y/gtkradiobuttonaccessible.h b/gtk/a11y/gtkradiobuttonaccessible.h
deleted file mode 100644
index 7bb35c19e6..0000000000
--- a/gtk/a11y/gtkradiobuttonaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_RADIO_BUTTON_ACCESSIBLE_H__
-#define __GTK_RADIO_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_RADIO_BUTTON_ACCESSIBLE (gtk_radio_button_accessible_get_type ())
-#define GTK_RADIO_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RADIO_BUTTON_ACCESSIBLE, GtkRadioButtonAccessible))
-#define GTK_RADIO_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RADIO_BUTTON_ACCESSIBLE, GtkRadioButtonAccessibleClass))
-#define GTK_IS_RADIO_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RADIO_BUTTON_ACCESSIBLE))
-#define GTK_IS_RADIO_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RADIO_BUTTON_ACCESSIBLE))
-#define GTK_RADIO_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RADIO_BUTTON_ACCESSIBLE, GtkRadioButtonAccessibleClass))
-
-typedef struct _GtkRadioButtonAccessible GtkRadioButtonAccessible;
-typedef struct _GtkRadioButtonAccessibleClass GtkRadioButtonAccessibleClass;
-typedef struct _GtkRadioButtonAccessiblePrivate GtkRadioButtonAccessiblePrivate;
-
-struct _GtkRadioButtonAccessible
-{
- GtkToggleButtonAccessible parent;
-
- GtkRadioButtonAccessiblePrivate *priv;
-};
-
-struct _GtkRadioButtonAccessibleClass
-{
- GtkToggleButtonAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_radio_button_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_RADIO_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkrangeaccessible.c b/gtk/a11y/gtkrangeaccessible.c
deleted file mode 100644
index 5675e08c4b..0000000000
--- a/gtk/a11y/gtkrangeaccessible.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include "gtkrangeaccessible.h"
-
-typedef struct
-{
- GtkAdjustment *adjustment;
-
- gulong value_changed_id;
-} GtkRangeAccessiblePrivate;
-
-static void atk_value_interface_init (AtkValueIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkRangeAccessible, gtk_range_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkRangeAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
-
-static void
-gtk_range_accessible_value_changed (GtkAdjustment *adjustment,
- gpointer data)
-{
- g_object_notify (G_OBJECT (data), "accessible-value");
-}
-
-static void
-gtk_range_accessible_widget_set (GtkAccessible *accessible)
-{
- GtkRangeAccessible *self = GTK_RANGE_ACCESSIBLE (accessible);
- GtkRangeAccessiblePrivate *priv = gtk_range_accessible_get_instance_private (self);
- GtkWidget *range;
- GtkAdjustment *adj;
-
- range = gtk_accessible_get_widget (accessible);
- adj = gtk_range_get_adjustment (GTK_RANGE (range));
- if (adj != NULL)
- {
- priv->adjustment = g_object_ref (adj);
- priv->value_changed_id =
- g_signal_connect (priv->adjustment, "value-changed",
- G_CALLBACK (gtk_range_accessible_value_changed),
- self);
- }
-}
-
-static void
-gtk_range_accessible_widget_unset (GtkAccessible *accessible)
-{
- GtkRangeAccessible *self = GTK_RANGE_ACCESSIBLE (accessible);
- GtkRangeAccessiblePrivate *priv = gtk_range_accessible_get_instance_private (self);
-
- if (priv->adjustment != NULL &&
- priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-}
-
-void
-gtk_range_accessible_update_adjustment (GtkRangeAccessible *self)
-{
- gtk_range_accessible_widget_unset (GTK_ACCESSIBLE (self));
- gtk_range_accessible_widget_set (GTK_ACCESSIBLE (self));
-}
-
-static void
-gtk_range_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_range_accessible_parent_class)->initialize (obj, data);
- obj->role = ATK_ROLE_SLIDER;
-}
-
-static void
-gtk_range_accessible_dispose (GObject *gobject)
-{
- GtkRangeAccessible *self = GTK_RANGE_ACCESSIBLE (gobject);
- GtkRangeAccessiblePrivate *priv = gtk_range_accessible_get_instance_private (self);
-
- if (priv->adjustment != NULL && priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-
- G_OBJECT_CLASS (gtk_range_accessible_parent_class)->dispose (gobject);
-}
-
-static void
-gtk_range_accessible_class_init (GtkRangeAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *atkobject_class = ATK_OBJECT_CLASS (klass);
- GtkAccessibleClass *accessible_class = (GtkAccessibleClass*)klass;
-
- gobject_class->dispose = gtk_range_accessible_dispose;
-
- atkobject_class->initialize = gtk_range_accessible_initialize;
-
- accessible_class->widget_set = gtk_range_accessible_widget_set;
- accessible_class->widget_unset = gtk_range_accessible_widget_unset;
-}
-
-static void
-gtk_range_accessible_init (GtkRangeAccessible *range)
-{
-}
-
-static void
-gtk_range_accessible_get_current_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_value (adjustment));
-}
-
-static void
-gtk_range_accessible_get_maximum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
- gdouble max;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return;
-
- max = gtk_adjustment_get_upper (adjustment)
- - gtk_adjustment_get_page_size (adjustment);
-
- if (gtk_range_get_restrict_to_fill_level (GTK_RANGE (widget)))
- max = MIN (max, gtk_range_get_fill_level (GTK_RANGE (widget)));
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, max);
-}
-
-static void
-gtk_range_accessible_get_minimum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_lower (adjustment));
-}
-
-static void
-gtk_range_accessible_get_minimum_increment (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_minimum_increment (adjustment));
-}
-
-static gboolean
-gtk_range_accessible_set_current_value (AtkValue *obj,
- const GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return FALSE;
-
- gtk_adjustment_set_value (adjustment, g_value_get_double (value));
-
- return TRUE;
-}
-
-static void
-gtk_range_accessible_get_value_and_text (AtkValue *obj,
- gdouble *value,
- gchar **text)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return;
-
- *value = gtk_adjustment_get_value (adjustment);
- *text = NULL;
-}
-
-static AtkRange *
-gtk_range_accessible_get_range (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
- gdouble min, max;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return NULL;
-
- min = gtk_adjustment_get_lower (adjustment);
- max = gtk_adjustment_get_upper (adjustment)
- - gtk_adjustment_get_page_size (adjustment);
-
- if (gtk_range_get_restrict_to_fill_level (GTK_RANGE (widget)))
- max = MIN (max, gtk_range_get_fill_level (GTK_RANGE (widget)));
-
- return atk_range_new (min, max, NULL);
-}
-
-static void
-gtk_range_accessible_set_value (AtkValue *obj,
- const gdouble value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return;
-
- gtk_adjustment_set_value (adjustment, value);
-}
-
-static gdouble
-gtk_range_accessible_get_increment (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
- if (adjustment == NULL)
- return 0;
-
- return gtk_adjustment_get_minimum_increment (adjustment);
-}
-
-static void
-atk_value_interface_init (AtkValueIface *iface)
-{
- iface->get_current_value = gtk_range_accessible_get_current_value;
- iface->get_maximum_value = gtk_range_accessible_get_maximum_value;
- iface->get_minimum_value = gtk_range_accessible_get_minimum_value;
- iface->get_minimum_increment = gtk_range_accessible_get_minimum_increment;
- iface->set_current_value = gtk_range_accessible_set_current_value;
-
- iface->get_value_and_text = gtk_range_accessible_get_value_and_text;
- iface->get_range = gtk_range_accessible_get_range;
- iface->set_value = gtk_range_accessible_set_value;
- iface->get_increment = gtk_range_accessible_get_increment;
-}
diff --git a/gtk/a11y/gtkrangeaccessible.h b/gtk/a11y/gtkrangeaccessible.h
deleted file mode 100644
index 8779fb8eae..0000000000
--- a/gtk/a11y/gtkrangeaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_RANGE_ACCESSIBLE_H__
-#define __GTK_RANGE_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_RANGE_ACCESSIBLE (gtk_range_accessible_get_type ())
-#define GTK_RANGE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RANGE_ACCESSIBLE, GtkRangeAccessible))
-#define GTK_RANGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RANGE_ACCESSIBLE, GtkRangeAccessibleClass))
-#define GTK_IS_RANGE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RANGE_ACCESSIBLE))
-#define GTK_IS_RANGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RANGE_ACCESSIBLE))
-#define GTK_RANGE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RANGE_ACCESSIBLE, GtkRangeAccessibleClass))
-
-typedef struct _GtkRangeAccessible GtkRangeAccessible;
-typedef struct _GtkRangeAccessibleClass GtkRangeAccessibleClass;
-
-struct _GtkRangeAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkRangeAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_range_accessible_get_type (void);
-
-/*< private >*/
-void gtk_range_accessible_update_adjustment (GtkRangeAccessible *self);
-
-G_END_DECLS
-
-#endif /* __GTK_RANGE_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkrenderercellaccessible.c b/gtk/a11y/gtkrenderercellaccessible.c
deleted file mode 100644
index 3306c6d8ff..0000000000
--- a/gtk/a11y/gtkrenderercellaccessible.c
+++ /dev/null
@@ -1,123 +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 "gtkrenderercellaccessible.h"
-#include "gtkintl.h"
-
-struct _GtkRendererCellAccessiblePrivate
-{
- GtkCellRenderer *renderer;
-};
-
-enum {
- PROP_0,
- PROP_RENDERER
-};
-
-G_DEFINE_TYPE_WITH_PRIVATE (GtkRendererCellAccessible, gtk_renderer_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
-
-static void
-gtk_renderer_cell_accessible_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GtkRendererCellAccessible *accessible = GTK_RENDERER_CELL_ACCESSIBLE (object);
-
- switch (prop_id)
- {
- case PROP_RENDERER:
- accessible->priv->renderer = g_value_dup_object (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gtk_renderer_cell_accessible_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GtkRendererCellAccessible *accessible = GTK_RENDERER_CELL_ACCESSIBLE (object);
-
- switch (prop_id)
- {
- case PROP_RENDERER:
- g_value_set_object (value, accessible->priv->renderer);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gtk_renderer_cell_accessible_finalize (GObject *object)
-{
- GtkRendererCellAccessible *renderer_cell = GTK_RENDERER_CELL_ACCESSIBLE (object);
-
- if (renderer_cell->priv->renderer)
- g_object_unref (renderer_cell->priv->renderer);
-
- G_OBJECT_CLASS (gtk_renderer_cell_accessible_parent_class)->finalize (object);
-}
-
-static void
-gtk_renderer_cell_accessible_class_init (GtkRendererCellAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
- gobject_class->get_property = gtk_renderer_cell_accessible_get_property;
- gobject_class->set_property = gtk_renderer_cell_accessible_set_property;
- gobject_class->finalize = gtk_renderer_cell_accessible_finalize;
-
- g_object_class_install_property (gobject_class,
- PROP_RENDERER,
- g_param_spec_object ("renderer",
- P_("Cell renderer"),
- P_("The cell renderer represented by this accessible"),
- GTK_TYPE_CELL_RENDERER,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-}
-
-static void
-gtk_renderer_cell_accessible_init (GtkRendererCellAccessible *renderer_cell)
-{
- renderer_cell->priv = gtk_renderer_cell_accessible_get_instance_private (renderer_cell);
-}
-
-AtkObject *
-gtk_renderer_cell_accessible_new (GtkCellRenderer *renderer)
-{
- AtkObject *object;
-
- g_return_val_if_fail (GTK_IS_CELL_RENDERER (renderer), NULL);
-
- object = g_object_new (_gtk_cell_renderer_get_accessible_type (renderer),
- "renderer", renderer,
- NULL);
-
- atk_object_set_role (object, ATK_ROLE_TABLE_CELL);
-
- return object;
-}
diff --git a/gtk/a11y/gtkrenderercellaccessible.h b/gtk/a11y/gtkrenderercellaccessible.h
deleted file mode 100644
index ac39d89639..0000000000
--- a/gtk/a11y/gtkrenderercellaccessible.h
+++ /dev/null
@@ -1,61 +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 .
- */
-
-#ifndef __GTK_RENDERER_CELL_ACCESSIBLE_H__
-#define __GTK_RENDERER_CELL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_RENDERER_CELL_ACCESSIBLE (gtk_renderer_cell_accessible_get_type ())
-#define GTK_RENDERER_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RENDERER_CELL_ACCESSIBLE, GtkRendererCellAccessible))
-#define GTK_RENDERER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RENDERER_CELL_ACCESSIBLE, GtkRendererCellAccessibleClass))
-#define GTK_IS_RENDERER_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RENDERER_CELL_ACCESSIBLE))
-#define GTK_IS_RENDERER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RENDERER_CELL_ACCESSIBLE))
-#define GTK_RENDERER_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RENDERER_CELL_ACCESSIBLE, GtkRendererCellAccessibleClass))
-
-typedef struct _GtkRendererCellAccessible GtkRendererCellAccessible;
-typedef struct _GtkRendererCellAccessibleClass GtkRendererCellAccessibleClass;
-typedef struct _GtkRendererCellAccessiblePrivate GtkRendererCellAccessiblePrivate;
-
-struct _GtkRendererCellAccessible
-{
- GtkCellAccessible parent;
-
- GtkRendererCellAccessiblePrivate *priv;
-};
-
-struct _GtkRendererCellAccessibleClass
-{
- GtkCellAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_renderer_cell_accessible_get_type (void);
-
-GDK_AVAILABLE_IN_ALL
-AtkObject *gtk_renderer_cell_accessible_new (GtkCellRenderer * renderer);
-
-G_END_DECLS
-
-#endif /* __GTK_RENDERER_CELL_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkscaleaccessible.c b/gtk/a11y/gtkscaleaccessible.c
deleted file mode 100644
index 1a8be87793..0000000000
--- a/gtk/a11y/gtkscaleaccessible.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2004 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 "gtkscaleaccessible.h"
-
-G_DEFINE_TYPE (GtkScaleAccessible, gtk_scale_accessible, GTK_TYPE_RANGE_ACCESSIBLE)
-
-static const gchar *
-gtk_scale_accessible_get_description (AtkObject *object)
-{
- GtkWidget *widget;
- PangoLayout *layout;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
- if (widget == NULL)
- return NULL;
-
- layout = gtk_scale_get_layout (GTK_SCALE (widget));
- if (layout)
- return pango_layout_get_text (layout);
-
- return ATK_OBJECT_CLASS (gtk_scale_accessible_parent_class)->get_description (object);
-}
-
-static void
-gtk_scale_accessible_class_init (GtkScaleAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_description = gtk_scale_accessible_get_description;
-}
-
-static void
-gtk_scale_accessible_init (GtkScaleAccessible *scale)
-{
-}
diff --git a/gtk/a11y/gtkscaleaccessible.h b/gtk/a11y/gtkscaleaccessible.h
deleted file mode 100644
index a141293f3a..0000000000
--- a/gtk/a11y/gtkscaleaccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2004 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 .
- */
-
-#ifndef __GTK_SCALE_ACCESSIBLE_H__
-#define __GTK_SCALE_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SCALE_ACCESSIBLE (gtk_scale_accessible_get_type ())
-#define GTK_SCALE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCALE_ACCESSIBLE, GtkScaleAccessible))
-#define GTK_SCALE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCALE_ACCESSIBLE, GtkScaleAccessibleClass))
-#define GTK_IS_SCALE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCALE_ACCESSIBLE))
-#define GTK_IS_SCALE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCALE_ACCESSIBLE))
-#define GTK_SCALE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCALE_ACCESSIBLE, GtkScaleAccessibleClass))
-
-typedef struct _GtkScaleAccessible GtkScaleAccessible;
-typedef struct _GtkScaleAccessibleClass GtkScaleAccessibleClass;
-typedef struct _GtkScaleAccessiblePrivate GtkScaleAccessiblePrivate;
-
-struct _GtkScaleAccessible
-{
- GtkRangeAccessible parent;
-
- GtkScaleAccessiblePrivate *priv;
-};
-
-struct _GtkScaleAccessibleClass
-{
- GtkRangeAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_scale_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_SCALE_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkscalebuttonaccessible.c b/gtk/a11y/gtkscalebuttonaccessible.c
deleted file mode 100644
index caf8fff4af..0000000000
--- a/gtk/a11y/gtkscalebuttonaccessible.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2008 Jan Arne Petersen
- *
- * 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
-
-#include
-#include
-#include "gtkscalebuttonaccessible.h"
-
-#include
-
-typedef struct {
- GtkAdjustment *adjustment;
- gulong value_changed_id;
-} GtkScaleButtonAccessiblePrivate;
-
-static void atk_action_interface_init (AtkActionIface *iface);
-static void atk_value_interface_init (AtkValueIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkScaleButtonAccessible, gtk_scale_button_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkScaleButtonAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init));
-
-static void
-on_value_changed (GtkAdjustment *adjustment,
- gpointer data)
-{
- GtkScaleButtonAccessible *self = data;
-
- g_object_notify (G_OBJECT (self), "accessible-value");
-}
-
-static void
-on_adjustment_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer data)
-{
- GtkScaleButton *scale_button = GTK_SCALE_BUTTON (gobject);
- GtkScaleButtonAccessible *self = data;
- GtkScaleButtonAccessiblePrivate *priv =
- gtk_scale_button_accessible_get_instance_private (self);
- GtkAdjustment *adjustment =
- gtk_scale_button_get_adjustment (scale_button);
-
- if (priv->adjustment == adjustment)
- return;
-
- if (priv->adjustment != NULL && priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-
- if (adjustment != NULL)
- {
- priv->adjustment = g_object_ref (adjustment);
- priv->value_changed_id =
- g_signal_connect (priv->adjustment, "notify::value-changed",
- G_CALLBACK (on_value_changed),
- self);
- }
-}
-
-static void
-gtk_scale_button_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkScaleButton *scale_button = data;
-
- ATK_OBJECT_CLASS (gtk_scale_button_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect (scale_button, "notify::adjustment",
- G_CALLBACK (on_adjustment_changed),
- obj);
-}
-
-static void
-gtk_scale_button_accessible_dispose (GObject *gobject)
-{
- GtkScaleButtonAccessible *self = GTK_SCALE_BUTTON_ACCESSIBLE (gobject);
- GtkScaleButtonAccessiblePrivate *priv =
- gtk_scale_button_accessible_get_instance_private (self);
-
- if (priv->adjustment != NULL && priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-
- G_OBJECT_CLASS (gtk_scale_button_accessible_parent_class)->dispose (gobject);
-}
-
-static void
-gtk_scale_button_accessible_class_init (GtkScaleButtonAccessibleClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
- gobject_class->dispose = gtk_scale_button_accessible_dispose;
-
- atk_object_class->initialize = gtk_scale_button_accessible_initialize;
-}
-
-static void
-gtk_scale_button_accessible_init (GtkScaleButtonAccessible *self)
-{
- ATK_OBJECT (self)->role = ATK_ROLE_SLIDER;
-}
-
-static gboolean
-gtk_scale_button_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- switch (i)
- {
- case 0:
- g_signal_emit_by_name (widget, "popup");
- return TRUE;
- case 1:
- g_signal_emit_by_name (widget, "popdown");
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-static gint
-gtk_scale_button_accessible_get_n_actions (AtkAction *action)
-{
- return 2;
-}
-
-static const gchar *
-gtk_scale_button_accessible_get_description (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0:
- return C_("Action description", "Pops up the slider");
- case 1:
- return C_("Action description", "Dismisses the slider");
- default:
- return NULL;
- }
-}
-
-static const gchar *
-gtk_scale_button_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0:
- return "popup";
- case 1:
- return "popdown";
- default:
- return NULL;
- }
-}
-
-static const gchar *
-gtk_scale_button_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0:
- return C_("Action name", "Popup");
- case 1:
- return C_("Action name", "Dismiss");
- default:
- return NULL;
- }
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_scale_button_accessible_do_action;
- iface->get_n_actions = gtk_scale_button_accessible_get_n_actions;
- iface->get_description = gtk_scale_button_accessible_get_description;
- iface->get_name = gtk_scale_button_accessible_action_get_name;
- iface->get_localized_name = gtk_scale_button_accessible_action_get_localized_name;
-}
-
-static void
-gtk_scale_button_accessible_get_current_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_value (adjustment));
-}
-
-static void
-gtk_scale_button_accessible_get_maximum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_upper (adjustment));
-}
-
-static void
-gtk_scale_button_accessible_get_minimum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_lower (adjustment));
-}
-
-static void
-gtk_scale_button_accessible_get_minimum_increment (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_minimum_increment (adjustment));
-}
-
-static gboolean
-gtk_scale_button_accessible_set_current_value (AtkValue *obj,
- const GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return FALSE;
-
- gtk_adjustment_set_value (adjustment, g_value_get_double (value));
-
- return TRUE;
-}
-
-static void
-gtk_scale_button_accessible_get_value_and_text (AtkValue *obj,
- gdouble *value,
- gchar **text)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- *value = gtk_adjustment_get_value (adjustment);
- *text = NULL;
-}
-
-static AtkRange *
-gtk_scale_button_accessible_get_range (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return NULL;
-
- return atk_range_new (gtk_adjustment_get_lower (adjustment),
- gtk_adjustment_get_upper (adjustment),
- NULL);
-}
-
-static void
-gtk_scale_button_accessible_set_value (AtkValue *obj,
- const gdouble value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- gtk_adjustment_set_value (adjustment, value);
-}
-
-static gdouble
-gtk_scale_button_accessible_get_increment (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
- if (adjustment == NULL)
- return 0;
-
- return gtk_adjustment_get_minimum_increment (adjustment);
-}
-
-static void
-atk_value_interface_init (AtkValueIface *iface)
-{
- iface->get_current_value = gtk_scale_button_accessible_get_current_value;
- iface->get_maximum_value = gtk_scale_button_accessible_get_maximum_value;
- iface->get_minimum_value = gtk_scale_button_accessible_get_minimum_value;
- iface->get_minimum_increment = gtk_scale_button_accessible_get_minimum_increment;
- iface->set_current_value = gtk_scale_button_accessible_set_current_value;
-
- iface->get_value_and_text = gtk_scale_button_accessible_get_value_and_text;
- iface->get_range = gtk_scale_button_accessible_get_range;
- iface->set_value = gtk_scale_button_accessible_set_value;
- iface->get_increment = gtk_scale_button_accessible_get_increment;
-}
diff --git a/gtk/a11y/gtkscalebuttonaccessible.h b/gtk/a11y/gtkscalebuttonaccessible.h
deleted file mode 100644
index 7b0538bdb4..0000000000
--- a/gtk/a11y/gtkscalebuttonaccessible.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2008 Jan Arne Petersen
- *
- * 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 .
- */
-
-#ifndef __GTK_SCALE_BUTTON_ACCESSIBLE_H__
-#define __GTK_SCALE_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SCALE_BUTTON_ACCESSIBLE (gtk_scale_button_accessible_get_type ())
-#define GTK_SCALE_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCALE_BUTTON_ACCESSIBLE, GtkScaleButtonAccessible))
-#define GTK_SCALE_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCALE_BUTTON_ACCESSIBLE, GtkScaleButtonAccessibleClass))
-#define GTK_IS_SCALE_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCALE_BUTTON_ACCESSIBLE))
-#define GTK_IS_SCALE_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCALE_BUTTON_ACCESSIBLE))
-#define GTK_SCALE_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCALE_BUTTON_ACCESSIBLE, GtkScaleButtonAccessibleClass))
-
-typedef struct _GtkScaleButtonAccessible GtkScaleButtonAccessible;
-typedef struct _GtkScaleButtonAccessibleClass GtkScaleButtonAccessibleClass;
-
-struct _GtkScaleButtonAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkScaleButtonAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_scale_button_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_SCALE_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkscrollbaraccessible.c b/gtk/a11y/gtkscrollbaraccessible.c
deleted file mode 100644
index 6a65ecf9de..0000000000
--- a/gtk/a11y/gtkscrollbaraccessible.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include "gtkscrollbaraccessible.h"
-
-typedef struct
-{
- GtkAdjustment *adjustment;
- gulong value_changed_id;
-} GtkScrollbarAccessiblePrivate;
-
-static void atk_value_interface_init (AtkValueIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkScrollbarAccessible, gtk_scrollbar_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkScrollbarAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
-
-static void
-on_value_changed (GtkAdjustment *adjustment,
- gpointer data)
-{
- GtkScrollbarAccessible *self = data;
-
- g_object_notify (G_OBJECT (self), "accessible-value");
-}
-
-static void
-on_adjustment_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer data)
-{
- GtkScrollbar *scrollbar = GTK_SCROLLBAR (gobject);
- GtkScrollbarAccessible *self = data;
- GtkScrollbarAccessiblePrivate *priv =
- gtk_scrollbar_accessible_get_instance_private (self);
- GtkAdjustment *adjustment =
- gtk_scrollbar_get_adjustment (scrollbar);
-
- if (priv->adjustment == adjustment)
- return;
-
- if (priv->adjustment != NULL && priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-
- if (adjustment != NULL)
- {
- priv->adjustment = g_object_ref (adjustment);
- priv->value_changed_id =
- g_signal_connect (priv->adjustment, "value-changed",
- G_CALLBACK (on_value_changed),
- self);
- }
-}
-
-static void
-gtk_scrollbar_accessible_dispose (GObject *gobject)
-{
- GtkScrollbarAccessible *self = GTK_SCROLLBAR_ACCESSIBLE (gobject);
- GtkScrollbarAccessiblePrivate *priv =
- gtk_scrollbar_accessible_get_instance_private (self);
-
- if (priv->adjustment != NULL && priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-
- G_OBJECT_CLASS (gtk_scrollbar_accessible_parent_class)->dispose (gobject);
-}
-
-static void
-gtk_scrollbar_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkScrollbar *scrollbar = data;
-
- ATK_OBJECT_CLASS (gtk_scrollbar_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect (scrollbar, "notify::adjustment",
- G_CALLBACK (on_adjustment_changed),
- obj);
-}
-
-static void
-gtk_scrollbar_accessible_class_init (GtkScrollbarAccessibleClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
- atk_object_class->initialize = gtk_scrollbar_accessible_initialize;
-
- gobject_class->dispose = gtk_scrollbar_accessible_dispose;
-}
-
-static void
-gtk_scrollbar_accessible_init (GtkScrollbarAccessible *self)
-{
- ATK_OBJECT (self)->role = ATK_ROLE_SCROLL_BAR;
-}
-
-static void
-gtk_scrollbar_accessible_get_current_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_value (adjustment));
-}
-
-static void
-gtk_scrollbar_accessible_get_maximum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
- double max;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return;
-
- max = gtk_adjustment_get_upper (adjustment)
- - gtk_adjustment_get_page_size (adjustment);
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, max);
-}
-
-static void
-gtk_scrollbar_accessible_get_minimum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_lower (adjustment));
-}
-
-static void
-gtk_scrollbar_accessible_get_minimum_increment (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_minimum_increment (adjustment));
-}
-
-static gboolean
-gtk_scrollbar_accessible_set_current_value (AtkValue *obj,
- const GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return FALSE;
-
- gtk_adjustment_set_value (adjustment, g_value_get_double (value));
-
- return TRUE;
-}
-
-static void
-gtk_scrollbar_accessible_get_value_and_text (AtkValue *obj,
- double *value,
- char **text)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return;
-
- *value = gtk_adjustment_get_value (adjustment);
- *text = NULL;
-}
-
-static AtkRange *
-gtk_scrollbar_accessible_get_range (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
- double min, max;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return NULL;
-
- min = gtk_adjustment_get_lower (adjustment);
- max = gtk_adjustment_get_upper (adjustment)
- - gtk_adjustment_get_page_size (adjustment);
-
- return atk_range_new (min, max, NULL);
-}
-
-static void
-gtk_scrollbar_accessible_set_value (AtkValue *obj,
- const double value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return;
-
- gtk_adjustment_set_value (adjustment, value);
-}
-
-static double
-gtk_scrollbar_accessible_get_increment (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (widget));
- if (adjustment == NULL)
- return 0;
-
- return gtk_adjustment_get_minimum_increment (adjustment);
-}
-
-static void
-atk_value_interface_init (AtkValueIface *iface)
-{
- iface->get_current_value = gtk_scrollbar_accessible_get_current_value;
- iface->get_maximum_value = gtk_scrollbar_accessible_get_maximum_value;
- iface->get_minimum_value = gtk_scrollbar_accessible_get_minimum_value;
- iface->get_minimum_increment = gtk_scrollbar_accessible_get_minimum_increment;
- iface->set_current_value = gtk_scrollbar_accessible_set_current_value;
-
- iface->get_value_and_text = gtk_scrollbar_accessible_get_value_and_text;
- iface->get_range = gtk_scrollbar_accessible_get_range;
- iface->set_value = gtk_scrollbar_accessible_set_value;
- iface->get_increment = gtk_scrollbar_accessible_get_increment;
-}
diff --git a/gtk/a11y/gtkscrollbaraccessible.h b/gtk/a11y/gtkscrollbaraccessible.h
deleted file mode 100644
index bac0e3fd48..0000000000
--- a/gtk/a11y/gtkscrollbaraccessible.h
+++ /dev/null
@@ -1,54 +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 .
- */
-
-#ifndef __GTK_SCROLLBAR_ACCESSIBLE_H__
-#define __GTK_SCROLLBAR_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#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;
-
-struct _GtkScrollbarAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkScrollbarAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_scrollbar_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_SCROLLBAR_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkscrolledwindowaccessible.c b/gtk/a11y/gtkscrolledwindowaccessible.c
deleted file mode 100644
index fc2822686e..0000000000
--- a/gtk/a11y/gtkscrolledwindowaccessible.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 "gtkscrolledwindowaccessible.h"
-
-
-G_DEFINE_TYPE (GtkScrolledWindowAccessible, gtk_scrolled_window_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static void
-visibility_changed (GObject *object,
- GParamSpec *pspec,
- gpointer user_data)
-{
- if (!g_strcmp0 (pspec->name, "visible"))
- {
- gint index;
- gint n_children;
- gboolean child_added = FALSE;
- AtkObject *child;
- GtkWidget *widget;
- GtkScrolledWindow *scrolled_window;
- GtkWidget *hscrollbar, *vscrollbar;
- GtkAccessible *accessible = GTK_ACCESSIBLE (user_data);
-
- widget = gtk_accessible_get_widget (user_data);
- if (widget == NULL)
- return;
-
- scrolled_window = GTK_SCROLLED_WINDOW (widget);
- index = n_children = 1;
-
- hscrollbar = gtk_scrolled_window_get_hscrollbar (scrolled_window);
- vscrollbar = gtk_scrolled_window_get_vscrollbar (scrolled_window);
-
- if ((gpointer) object == (gpointer) (hscrollbar))
- {
- if (gtk_scrolled_window_get_hscrollbar (scrolled_window))
- child_added = TRUE;
-
- child = gtk_widget_get_accessible (hscrollbar);
- }
- else if ((gpointer) object == (gpointer) (vscrollbar))
- {
- if (gtk_scrolled_window_get_vscrollbar (scrolled_window))
- child_added = TRUE;
-
- child = gtk_widget_get_accessible (vscrollbar);
- if (gtk_scrolled_window_get_hscrollbar (scrolled_window))
- index = n_children + 1;
- }
- else
- {
- g_assert_not_reached ();
- return;
- }
-
- if (child_added)
- g_signal_emit_by_name (accessible, "children-changed::add", index, child, NULL);
- else
- g_signal_emit_by_name (accessible, "children-changed::remove", index, child, NULL);
-
- }
-}
-
-static void
-gtk_scrolled_window_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkScrolledWindow *window;
-
- ATK_OBJECT_CLASS (gtk_scrolled_window_accessible_parent_class)->initialize (obj, data);
-
- window = GTK_SCROLLED_WINDOW (data);
-
- g_signal_connect_object (gtk_scrolled_window_get_hscrollbar (window), "notify::visible",
- G_CALLBACK (visibility_changed),
- obj, 0);
- g_signal_connect_object (gtk_scrolled_window_get_vscrollbar (window), "notify::visible",
- G_CALLBACK (visibility_changed),
- obj, 0);
-
- obj->role = ATK_ROLE_SCROLL_PANE;
-}
-
-static int
-gtk_scrolled_window_accessible_get_n_children (AtkObject *object)
-{
- GtkWidget *widget;
- GtkScrolledWindow *scrolled_window;
- gint n_children;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
- if (widget == NULL)
- return 0;
-
- scrolled_window = GTK_SCROLLED_WINDOW (widget);
-
- n_children = 0;
- if (gtk_scrolled_window_get_child (scrolled_window))
- n_children++;
- if (gtk_scrolled_window_get_hscrollbar (scrolled_window))
- n_children++;
- if (gtk_scrolled_window_get_vscrollbar (scrolled_window))
- n_children++;
-
- return n_children;
-}
-
-static AtkObject *
-gtk_scrolled_window_accessible_ref_child (AtkObject *obj,
- gint child)
-{
- GtkWidget *widget;
- GtkScrolledWindow *scrolled_window;
- GtkWidget *hscrollbar, *vscrollbar;
- GtkWidget *c;
- GtkWidget *chosen = NULL;
-
- g_return_val_if_fail (child >= 0, NULL);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- scrolled_window = GTK_SCROLLED_WINDOW (widget);
- c = gtk_scrolled_window_get_child (scrolled_window);
- hscrollbar = gtk_scrolled_window_get_hscrollbar (scrolled_window);
- vscrollbar = gtk_scrolled_window_get_vscrollbar (scrolled_window);
-
- if (child == 2)
- chosen = vscrollbar;
- else if (child == 1)
- chosen = c ? hscrollbar : vscrollbar;
- else if (child == 0)
- chosen = c ? c : (hscrollbar ? hscrollbar : vscrollbar);
-
- if (chosen)
- return g_object_ref (gtk_widget_get_accessible (chosen));
-
- return NULL;
-}
-
-static void
-gtk_scrolled_window_accessible_class_init (GtkScrolledWindowAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_n_children = gtk_scrolled_window_accessible_get_n_children;
- class->ref_child = gtk_scrolled_window_accessible_ref_child;
- class->initialize = gtk_scrolled_window_accessible_initialize;
-}
-
-static void
-gtk_scrolled_window_accessible_init (GtkScrolledWindowAccessible *window)
-{
-}
diff --git a/gtk/a11y/gtkscrolledwindowaccessible.h b/gtk/a11y/gtkscrolledwindowaccessible.h
deleted file mode 100644
index 56d9ff8ec6..0000000000
--- a/gtk/a11y/gtkscrolledwindowaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_SCROLLED_WINDOW_ACCESSIBLE_H__
-#define __GTK_SCROLLED_WINDOW_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SCROLLED_WINDOW_ACCESSIBLE (gtk_scrolled_window_accessible_get_type ())
-#define GTK_SCROLLED_WINDOW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCROLLED_WINDOW_ACCESSIBLE, GtkScrolledWindowAccessible))
-#define GTK_SCROLLED_WINDOW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCROLLED_WINDOW_ACCESSIBLE, GtkScrolledWindowAccessibleClass))
-#define GTK_IS_SCROLLED_WINDOW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCROLLED_WINDOW_ACCESSIBLE))
-#define GTK_IS_SCROLLED_WINDOW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCROLLED_WINDOW_ACCESSIBLE))
-#define GTK_SCROLLED_WINDOW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCROLLED_WINDOW_ACCESSIBLE, GtkScrolledWindowAccessibleClass))
-
-typedef struct _GtkScrolledWindowAccessible GtkScrolledWindowAccessible;
-typedef struct _GtkScrolledWindowAccessibleClass GtkScrolledWindowAccessibleClass;
-typedef struct _GtkScrolledWindowAccessiblePrivate GtkScrolledWindowAccessiblePrivate;
-
-struct _GtkScrolledWindowAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkScrolledWindowAccessiblePrivate *priv;
-};
-
-struct _GtkScrolledWindowAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_scrolled_window_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_SCROLLED_WINDOW_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtksearchentryaccessible.c b/gtk/a11y/gtksearchentryaccessible.c
deleted file mode 100644
index eab4012e53..0000000000
--- a/gtk/a11y/gtksearchentryaccessible.c
+++ /dev/null
@@ -1,1010 +0,0 @@
-/* gtksearchentryaccessible.c: GtkWidgetAccessible for GtkSearchEntry
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 "gtksearchentryaccessible.h"
-
-#include "gtkeditable.h"
-#include "gtkimage.h"
-#include "gtkintl.h"
-#include "gtklabel.h"
-#include "gtkpango.h"
-#include "gtksearchentryprivate.h"
-#include "gtkstylecontextprivate.h"
-#include "gtktextprivate.h"
-
-struct _GtkSearchEntryAccessible
-{
- GtkWidgetAccessible parent_instance;
-
- int cursor_position;
- int selection_bound;
-};
-
-static void atk_editable_text_interface_init (AtkEditableTextIface *iface);
-static void atk_text_interface_init (AtkTextIface *iface);
-static void atk_action_interface_init (AtkActionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkSearchEntryAccessible, gtk_search_entry_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static inline GtkText *
-get_text_widget (GtkAccessible *accessible)
-{
- GtkSearchEntry *search_entry =
- GTK_SEARCH_ENTRY (gtk_accessible_get_widget (accessible));
-
- if (search_entry == NULL)
- return NULL;
-
- return gtk_search_entry_get_text_widget (search_entry);
-}
-
-static gboolean
-check_for_selection_change (GtkSearchEntryAccessible *self,
- GtkEditable *editable)
-{
- gboolean ret_val = FALSE;
- gint start, end;
-
- if (gtk_editable_get_selection_bounds (editable, &start, &end))
- {
- if (end != self->cursor_position ||
- start != self->selection_bound)
- /*
- * This check is here as this function can be called
- * for notification of selection_bound and current_pos.
- * The values of current_pos and selection_bound may be the same
- * for both notifications and we only want to generate one
- * text_selection_changed signal.
- */
- ret_val = TRUE;
- }
- else
- {
- /* We had a selection */
- ret_val = (self->cursor_position != self->selection_bound);
- }
-
- self->cursor_position = end;
- self->selection_bound = start;
-
- return ret_val;
-}
-
-static void
-insert_text_cb (GtkEditable *editable,
- gchar *new_text,
- gint new_text_length,
- gint *position,
- GtkSearchEntryAccessible *self)
-{
- int length;
-
- if (new_text_length == 0)
- return;
-
- length = g_utf8_strlen (new_text, new_text_length);
-
- g_signal_emit_by_name (self,
- "text-changed::insert",
- *position - length,
- length);
-}
-
-static void
-delete_text_cb (GtkEditable *editable,
- gint start,
- gint end,
- GtkSearchEntryAccessible *self)
-{
- GtkText *text;
-
- text = get_text_widget (GTK_ACCESSIBLE (self));
- if (text == NULL)
- return;
-
- if (end < 0)
- {
- char *contents;
-
- contents = gtk_text_get_display_text (text, 0, -1);
- end = g_utf8_strlen (contents, -1);
-
- g_free (contents);
- }
-
- if (end == start)
- return;
-
- g_signal_emit_by_name (self,
- "text-changed::delete",
- start,
- end - start);
-}
-
-static int
-gtk_search_entry_accessible_get_n_children (AtkObject *object)
-{
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
- if (widget == NULL)
- return 0;
-
- int count = 0;
- for (GtkWidget *child = gtk_widget_get_first_child (widget);
- child != NULL;
- child = gtk_widget_get_next_sibling (child))
- {
- if (GTK_IS_IMAGE (child) && gtk_widget_get_child_visible (child))
- count += 1;
- }
-
- return count;
-}
-
-static AtkObject *
-gtk_search_entry_accessible_ref_child (AtkObject *obj,
- int i)
-{
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- for (GtkWidget *child = gtk_widget_get_first_child (widget);
- child != NULL;
- child = gtk_widget_get_next_sibling (child))
- {
- if (GTK_IS_IMAGE (child) && gtk_widget_get_child_visible (child))
- return g_object_ref (gtk_widget_get_accessible (child));
- }
-
- return NULL;
-}
-
-static AtkAttributeSet *
-gtk_search_entry_accessible_get_attributes (AtkObject *accessible)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
- AtkAttribute *placeholder_text;
- char *text = NULL;
-
- attributes = ATK_OBJECT_CLASS (gtk_search_entry_accessible_parent_class)->get_attributes (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return attributes;
-
- g_object_get (widget, "placeholder-text", &text, NULL);
- if (text == NULL)
- return attributes;
-
- placeholder_text = g_malloc (sizeof (AtkAttribute));
- placeholder_text->name = g_strdup ("placeholder-text");
- placeholder_text->value = text;
-
- attributes = g_slist_append (attributes, placeholder_text);
-
- return attributes;
-}
-
-static void
-on_cursor_position_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer data)
-{
- GtkSearchEntryAccessible *self = data;
- GtkEditable *editable = GTK_EDITABLE (gobject);
-
- if (check_for_selection_change (self, editable))
- g_signal_emit_by_name (self, "text-selection-changed");
-
- // The entry cursor position has moved so generate the signal
- g_signal_emit_by_name (self, "text-caret-moved",
- gtk_editable_get_position (editable));
-}
-
-static void
-on_selection_bound_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer data)
-{
- GtkSearchEntryAccessible *self = data;
- GtkEditable *editable = GTK_EDITABLE (gobject);
-
- if (check_for_selection_change (self, editable))
- g_signal_emit_by_name (self, "text-selection-changed");
-}
-
-static void
-gtk_search_entry_accessible_initialize (AtkObject *object,
- gpointer data)
-{
- GtkSearchEntryAccessible *self = GTK_SEARCH_ENTRY_ACCESSIBLE (object);
- GtkEditable *editable = data;
- GtkWidget *widget = data;
- int start_pos, end_pos;
-
- gtk_editable_get_selection_bounds (editable, &start_pos, &end_pos);
- self->cursor_position = end_pos;
- self->selection_bound = start_pos;
-
- /* Set up signal callbacks */
- g_signal_connect_after (widget, "insert-text", G_CALLBACK (insert_text_cb), self);
- g_signal_connect (widget, "delete-text", G_CALLBACK (delete_text_cb), self);
- g_signal_connect (widget, "notify::cursor-position",
- G_CALLBACK (on_cursor_position_changed), self);
- g_signal_connect (widget, "notify::selection-bound",
- G_CALLBACK (on_selection_bound_changed), self);
-}
-
-static void
-gtk_search_entry_accessible_class_init (GtkSearchEntryAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->initialize = gtk_search_entry_accessible_initialize;
- class->get_attributes = gtk_search_entry_accessible_get_attributes;
- class->get_n_children = gtk_search_entry_accessible_get_n_children;
- class->ref_child = gtk_search_entry_accessible_ref_child;
-}
-
-static void
-gtk_search_entry_accessible_init (GtkSearchEntryAccessible *self)
-{
- AtkObject *atk_obj = ATK_OBJECT (self);
-
- atk_obj->role = ATK_ROLE_TEXT;
- atk_object_set_name (atk_obj, _("Search"));
-}
-
-static gchar *
-gtk_search_entry_accessible_get_text (AtkText *atk_text,
- gint start_pos,
- gint end_pos)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
-
- if (text == NULL)
- return NULL;
-
- return gtk_text_get_display_text (text, start_pos, end_pos);
-}
-
-static gchar *
-gtk_search_entry_accessible_get_text_before_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
-
- if (text == NULL)
- return NULL;
-
- return _gtk_pango_get_text_before (gtk_text_get_layout (text),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar *
-gtk_search_entry_accessible_get_text_at_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
-
- if (text == NULL)
- return NULL;
-
- return _gtk_pango_get_text_at (gtk_text_get_layout (text),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar *
-gtk_search_entry_accessible_get_text_after_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
-
- if (text == NULL)
- return NULL;
-
- return _gtk_pango_get_text_after (gtk_text_get_layout (text),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gint
-gtk_search_entry_accessible_get_character_count (AtkText *atk_text)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
- if (text == NULL)
- return 0;
-
- char *display_text = gtk_text_get_display_text (text, 0, -1);
-
- int char_count = 0;
- if (display_text)
- {
- char_count = g_utf8_strlen (display_text, -1);
- g_free (display_text);
- }
-
- return char_count;
-}
-
-static gint
-gtk_search_entry_accessible_get_caret_offset (AtkText *atk_text)
-{
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
-
- if (widget == NULL)
- return -1;
-
- int cursor_position = 0;
- gboolean result = gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), NULL, &cursor_position);
- if (!result)
- return -1;
-
- return cursor_position;
-}
-
-static gboolean
-gtk_search_entry_accessible_set_caret_offset (AtkText *atk_text,
- gint offset)
-{
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return FALSE;
-
- gtk_editable_set_position (GTK_EDITABLE (widget), offset);
-
- return TRUE;
-}
-
-static AtkAttributeSet *
-add_text_attribute (AtkAttributeSet *attributes,
- AtkTextAttribute attr,
- gint i)
-{
- AtkAttribute *at;
-
- at = g_new (AtkAttribute, 1);
- at->name = g_strdup (atk_text_attribute_get_name (attr));
- at->value = g_strdup (atk_text_attribute_get_value (attr, i));
-
- return g_slist_prepend (attributes, at);
-}
-
-static AtkAttributeSet *
-gtk_search_entry_accessible_get_run_attributes (AtkText *atk_text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
-
- if (text == NULL)
- return NULL;
-
- AtkAttributeSet *attributes = NULL;
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (GTK_WIDGET (text)));
- attributes = _gtk_pango_get_run_attributes (attributes,
- gtk_text_get_layout (text),
- offset,
- start_offset,
- end_offset);
-
- return attributes;
-}
-
-static AtkAttributeSet *
-gtk_search_entry_accessible_get_default_attributes (AtkText *atk_text)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
-
- if (text == NULL)
- return NULL;
-
- AtkAttributeSet *attributes = NULL;
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (GTK_WIDGET (text)));
- attributes = _gtk_pango_get_default_attributes (attributes,
- gtk_text_get_layout (text));
- attributes = _gtk_style_context_get_attributes (attributes,
- gtk_widget_get_style_context (GTK_WIDGET (text)));
-
- return attributes;
-}
-
-static void
-gtk_search_entry_accessible_get_character_extents (AtkText *atk_text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
- PangoRectangle char_rect;
- char *entry_text;
- int index, x_layout, y_layout;
- GtkAllocation allocation;
-
- if (text == NULL)
- return;
-
- gtk_text_get_layout_offsets (text, &x_layout, &y_layout);
- entry_text = gtk_text_get_display_text (text, 0, -1);
- index = g_utf8_offset_to_pointer (entry_text, offset) - entry_text;
- g_free (entry_text);
-
- pango_layout_index_to_pos (gtk_text_get_layout (text), index, &char_rect);
- pango_extents_to_pixels (&char_rect, NULL);
-
- gtk_widget_get_allocation (GTK_WIDGET (text), &allocation);
-
- *x = allocation.x + x_layout + char_rect.x;
- *y = allocation.y + y_layout + char_rect.y;
- *width = char_rect.width;
- *height = char_rect.height;
-}
-
-static gint
-gtk_search_entry_accessible_get_offset_at_point (AtkText *atk_text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- GtkText *text = get_text_widget (GTK_ACCESSIBLE (atk_text));
- int index, x_layout, y_layout;
- int x_local, y_local;
- glong offset;
-
- if (text == NULL)
- return 1;
-
- gtk_text_get_layout_offsets (text, &x_layout, &y_layout);
-
- x_local = x - x_layout;
- y_local = y - y_layout;
-
- if (!pango_layout_xy_to_index (gtk_text_get_layout (text),
- x_local * PANGO_SCALE,
- y_local * PANGO_SCALE,
- &index, NULL))
- {
- if (x_local < 0 || y_local < 0)
- index = 0;
- else
- index = -1;
- }
-
- offset = -1;
- if (index != -1)
- {
- char *entry_text = gtk_text_get_display_text (text, 0, -1);
- offset = g_utf8_pointer_to_offset (entry_text, entry_text + index);
- g_free (entry_text);
- }
-
- return offset;
-}
-
-static gint
-gtk_search_entry_accessible_get_n_selections (AtkText *text)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return 0;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- return 1;
-
- return 0;
-}
-
-static gchar *
-gtk_search_entry_accessible_get_selection (AtkText *text,
- gint selection_num,
- gint *start_pos,
- gint *end_pos)
-{
- GtkEditable *editable;
- GtkWidget *widget;
- int start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- if (selection_num != 0)
- return NULL;
-
- editable = GTK_EDITABLE (widget);
- if (gtk_editable_get_selection_bounds (editable, &start, &end))
- {
- if (start_pos != NULL)
- *start_pos = start;
- if (end_pos != NULL)
- *end_pos = end;
-
- return gtk_editable_get_chars (editable, start, end);
- }
-
- return NULL;
-}
-
-static gboolean
-gtk_search_entry_accessible_add_selection (AtkText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkEntry *entry;
- GtkWidget *widget;
- int start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- entry = GTK_ENTRY (widget);
-
- if (!gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (entry), start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_search_entry_accessible_remove_selection (AtkText *text,
- gint selection_num)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (widget), end, end);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_search_entry_accessible_set_selection (AtkText *text,
- gint selection_num,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (widget), start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gunichar
-gtk_search_entry_accessible_get_character_at_offset (AtkText *atk_text,
- gint offset)
-{
- GtkText *text;
- char *contents;
- char *index;
- gunichar result;
-
- result = '\0';
-
- text = get_text_widget (GTK_ACCESSIBLE (atk_text));
- if (text == NULL)
- return 0;
-
- if (!gtk_text_get_visibility (text))
- return result;
-
- contents = gtk_text_get_display_text (text, 0, -1);
- if (offset < g_utf8_strlen (contents, -1))
- {
- index = g_utf8_offset_to_pointer (contents, offset);
- result = g_utf8_get_char (index);
- g_free (contents);
- }
-
- return result;
-}
-
-static void
-atk_text_interface_init (AtkTextIface *iface)
-{
- iface->get_text = gtk_search_entry_accessible_get_text;
- iface->get_character_at_offset = gtk_search_entry_accessible_get_character_at_offset;
- iface->get_text_before_offset = gtk_search_entry_accessible_get_text_before_offset;
- iface->get_text_at_offset = gtk_search_entry_accessible_get_text_at_offset;
- iface->get_text_after_offset = gtk_search_entry_accessible_get_text_after_offset;
- iface->get_caret_offset = gtk_search_entry_accessible_get_caret_offset;
- iface->set_caret_offset = gtk_search_entry_accessible_set_caret_offset;
- iface->get_character_count = gtk_search_entry_accessible_get_character_count;
- iface->get_n_selections = gtk_search_entry_accessible_get_n_selections;
- iface->get_selection = gtk_search_entry_accessible_get_selection;
- iface->add_selection = gtk_search_entry_accessible_add_selection;
- iface->remove_selection = gtk_search_entry_accessible_remove_selection;
- iface->set_selection = gtk_search_entry_accessible_set_selection;
- iface->get_run_attributes = gtk_search_entry_accessible_get_run_attributes;
- iface->get_default_attributes = gtk_search_entry_accessible_get_default_attributes;
- iface->get_character_extents = gtk_search_entry_accessible_get_character_extents;
- iface->get_offset_at_point = gtk_search_entry_accessible_get_offset_at_point;
-}
-
-static void
-gtk_search_entry_accessible_set_text_contents (AtkEditableText *text,
- const gchar *string)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- if (!gtk_editable_get_editable (GTK_EDITABLE (widget)))
- return;
-
- gtk_editable_set_text (GTK_EDITABLE (widget), string);
-}
-
-static void
-gtk_search_entry_accessible_insert_text (AtkEditableText *text,
- const gchar *string,
- gint length,
- gint *position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- int pos = 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- if (position != NULL)
- pos = *position;
-
- gtk_editable_insert_text (editable, string, length, &pos);
- gtk_editable_set_position (editable, pos);
-
- if (position != NULL)
- *position = pos;
-}
-
-static void
-gtk_search_entry_accessible_copy_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- GdkClipboard *clipboard;
- char *str;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- str = gtk_editable_get_chars (editable, start_pos, end_pos);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
- g_free (str);
-}
-
-static void
-gtk_search_entry_accessible_cut_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- GdkClipboard *clipboard;
- char *str;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- str = gtk_editable_get_chars (editable, start_pos, end_pos);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
- gtk_editable_delete_text (editable, start_pos, end_pos);
-}
-
-static void
-gtk_search_entry_accessible_delete_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- gtk_editable_delete_text (editable, start_pos, end_pos);
-}
-
-typedef struct
-{
- GtkEditable *entry;
- int position;
-} PasteData;
-
-static void
-paste_received_cb (GObject *clipboard,
- GAsyncResult *result,
- gpointer data)
-{
- PasteData *paste = data;
- char *text;
-
- text = gdk_clipboard_read_text_finish (GDK_CLIPBOARD (clipboard), result, NULL);
- if (text != NULL)
- gtk_editable_insert_text (paste->entry,
- text, -1,
- &(paste->position));
-
- g_object_unref (paste->entry);
- g_free (paste);
- g_free (text);
-}
-
-static void
-gtk_search_entry_accessible_paste_text (AtkEditableText *text,
- gint position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- PasteData *paste;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- paste = g_new0 (PasteData, 1);
- paste->entry = GTK_EDITABLE (widget);
- paste->position = position;
-
- g_object_ref (paste->entry);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_read_text_async (clipboard, NULL, paste_received_cb, paste);
-}
-
-static void
-atk_editable_text_interface_init (AtkEditableTextIface *iface)
-{
- iface->set_text_contents = gtk_search_entry_accessible_set_text_contents;
- iface->insert_text = gtk_search_entry_accessible_insert_text;
- iface->copy_text = gtk_search_entry_accessible_copy_text;
- iface->cut_text = gtk_search_entry_accessible_cut_text;
- iface->delete_text = gtk_search_entry_accessible_delete_text;
- iface->paste_text = gtk_search_entry_accessible_paste_text;
- iface->set_run_attributes = NULL;
-}
-
-static gboolean
-gtk_search_entry_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- if (i == 0)
- {
- gtk_widget_activate (widget);
- return TRUE;
- }
-
- if (i == 1)
- {
- gtk_editable_set_text (GTK_EDITABLE (widget), "");
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gint
-gtk_search_entry_accessible_get_n_actions (AtkAction *action)
-{
- GtkAccessible *accessible = GTK_ACCESSIBLE (action);
-
- GtkWidget *widget = gtk_accessible_get_widget (accessible);
- if (widget == NULL)
- return 0;
-
- // If the SearchEntry widget contains text, we have a second action
- // to clear its contents
- int n_actions = 1;
- const char *str = gtk_editable_get_text (GTK_EDITABLE (widget));
- if (str != NULL && *str != '\0')
- n_actions += 1;
-
- return n_actions;
-}
-
-static const gchar *
-gtk_search_entry_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
- GtkWidget *label;
- AtkRelationSet *set;
- AtkRelation *relation;
- GPtrArray *target;
- gpointer target_object;
- guint key_val;
-
- if (i != 0)
- return NULL;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return NULL;
-
- set = atk_object_ref_relation_set (ATK_OBJECT (action));
- if (!set)
- return NULL;
-
- label = NULL;
- relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
- if (relation)
- {
- target = atk_relation_get_target (relation);
-
- target_object = g_ptr_array_index (target, 0);
- label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
- }
-
- g_object_unref (set);
-
- if (GTK_IS_LABEL (label))
- {
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
-
- return NULL;
-}
-
-static const gchar *
-gtk_search_entry_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- switch (i)
- {
- case 0:
- return "activate";
-
- case 1:
- return "clear";
-
- default:
- break;
- }
-
- return NULL;
-}
-
-static const gchar*
-gtk_search_entry_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Activate");
- if (i == 1)
- return C_("Action name", "Clear");
-
- return NULL;
-}
-
-static const gchar *
-gtk_search_entry_accessible_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Activates the entry");
-
- if (i == 1)
- return C_("Action description", "Clears the entry");
-
- return NULL;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_search_entry_accessible_do_action;
- iface->get_n_actions = gtk_search_entry_accessible_get_n_actions;
- iface->get_keybinding = gtk_search_entry_accessible_get_keybinding;
- iface->get_name = gtk_search_entry_accessible_action_get_name;
- iface->get_localized_name = gtk_search_entry_accessible_action_get_localized_name;
- iface->get_description = gtk_search_entry_accessible_action_get_description;
-}
diff --git a/gtk/a11y/gtksearchentryaccessible.h b/gtk/a11y/gtksearchentryaccessible.h
deleted file mode 100644
index 9fd2d559df..0000000000
--- a/gtk/a11y/gtksearchentryaccessible.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* gtksearchentryaccessible.h: A GtkWidgetAccessible for GtkSearchEntry
- *
- * Copyright 2020 GNOME Foundation
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * 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.1 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 .
- */
-
-#pragma once
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SEARCH_ENTRY_ACCESSIBLE (gtk_search_entry_accessible_get_type())
-#define GTK_SEARCH_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SEARCH_ENTRY_ACCESSIBLE, GtkSearchEntryAccessible))
-#define GTK_IS_SEARCH_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SEARCH_ENTRY_ACCESSIBLE))
-
-typedef struct _GtkSearchEntryAccessible GtkSearchEntryAccessible;
-typedef struct _GtkSearchEntryAccessibleClass GtkSearchEntryAccessibleClass;
-
-struct _GtkSearchEntryAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_search_entry_accessible_get_type (void) G_GNUC_CONST;
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (GtkSearchEntryAccessible, g_object_unref)
-
-G_END_DECLS
diff --git a/gtk/a11y/gtkspinbuttonaccessible.c b/gtk/a11y/gtkspinbuttonaccessible.c
deleted file mode 100644
index 01e2a15634..0000000000
--- a/gtk/a11y/gtkspinbuttonaccessible.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include "gtkspinbuttonaccessible.h"
-
-struct _GtkSpinButtonAccessiblePrivate
-{
- GtkAdjustment *adjustment;
- gulong value_changed_id;
-};
-
-static void atk_value_interface_init (AtkValueIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkSpinButtonAccessible, gtk_spin_button_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkSpinButtonAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
-
-static void
-on_value_changed (GtkAdjustment *adjustment,
- GtkSpinButtonAccessible *self)
-{
- g_object_notify (G_OBJECT (self), "accessible-value");
-}
-
-static void
-on_adjustment_changed (GObject *gobject,
- GParamSpec *pspec,
- gpointer data)
-{
- GtkSpinButton *spin = GTK_SPIN_BUTTON (gobject);
- GtkSpinButtonAccessible *self = data;
- GtkSpinButtonAccessiblePrivate *priv = gtk_spin_button_accessible_get_instance_private (self);
- GtkAdjustment *adjustment = gtk_spin_button_get_adjustment (spin);
-
- if (priv->adjustment == adjustment)
- return;
-
- if (priv->adjustment != NULL && priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-
- if (adjustment != NULL)
- {
- priv->adjustment = g_object_ref (adjustment);
- priv->value_changed_id = g_signal_connect (priv->adjustment, "value-changed",
- G_CALLBACK (on_value_changed),
- self);
- }
-}
-
-static void
-gtk_spin_button_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_spin_button_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect (data, "notify::adjustment", G_CALLBACK (on_adjustment_changed), obj);
-}
-
-static void
-gtk_spin_button_accessible_dispose (GObject *gobject)
-{
- GtkSpinButtonAccessible *self = GTK_SPIN_BUTTON_ACCESSIBLE (gobject);
- GtkSpinButtonAccessiblePrivate *priv =
- gtk_spin_button_accessible_get_instance_private (self);
-
- if (priv->adjustment != NULL && priv->value_changed_id != 0)
- {
- g_signal_handler_disconnect (priv->adjustment, priv->value_changed_id);
- priv->value_changed_id = 0;
- }
-
- g_clear_object (&priv->adjustment);
-
- G_OBJECT_CLASS (gtk_spin_button_accessible_parent_class)->dispose (gobject);
-}
-
-static void
-gtk_spin_button_accessible_class_init (GtkSpinButtonAccessibleClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
- atk_object_class->initialize = gtk_spin_button_accessible_initialize;
-
- gobject_class->dispose = gtk_spin_button_accessible_dispose;
-}
-
-static void
-gtk_spin_button_accessible_init (GtkSpinButtonAccessible *self)
-{
- ATK_OBJECT (self)->role = ATK_ROLE_SPIN_BUTTON;
-}
-
-static void
-gtk_spin_button_accessible_get_current_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_value (adjustment));
-}
-
-static void
-gtk_spin_button_accessible_get_maximum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_upper (adjustment));
-}
-
-static void
-gtk_spin_button_accessible_get_minimum_value (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_lower (adjustment));
-}
-
-static void
-gtk_spin_button_accessible_get_minimum_increment (AtkValue *obj,
- GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- memset (value, 0, sizeof (GValue));
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, gtk_adjustment_get_minimum_increment (adjustment));
-}
-
-static gboolean
-gtk_spin_button_accessible_set_current_value (AtkValue *obj,
- const GValue *value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return FALSE;
-
- gtk_adjustment_set_value (adjustment, g_value_get_double (value));
-
- return TRUE;
-}
-
-static void
-gtk_spin_button_accessible_get_value_and_text (AtkValue *obj,
- gdouble *value,
- gchar **text)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- *value = gtk_adjustment_get_value (adjustment);
- *text = NULL;
-}
-
-static AtkRange *
-gtk_spin_button_accessible_get_range (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return NULL;
-
- return atk_range_new (gtk_adjustment_get_lower (adjustment),
- gtk_adjustment_get_upper (adjustment),
- NULL);
-}
-
-static void
-gtk_spin_button_accessible_set_value (AtkValue *obj,
- const gdouble value)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return;
-
- gtk_adjustment_set_value (adjustment, value);
-}
-
-static gdouble
-gtk_spin_button_accessible_get_increment (AtkValue *obj)
-{
- GtkWidget *widget;
- GtkAdjustment *adjustment;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
- if (adjustment == NULL)
- return 0;
-
- return gtk_adjustment_get_minimum_increment (adjustment);
-}
-
-static void
-atk_value_interface_init (AtkValueIface *iface)
-{
- iface->get_current_value = gtk_spin_button_accessible_get_current_value;
- iface->get_maximum_value = gtk_spin_button_accessible_get_maximum_value;
- iface->get_minimum_value = gtk_spin_button_accessible_get_minimum_value;
- iface->get_minimum_increment = gtk_spin_button_accessible_get_minimum_increment;
- iface->set_current_value = gtk_spin_button_accessible_set_current_value;
-
- iface->get_value_and_text = gtk_spin_button_accessible_get_value_and_text;
- iface->get_range = gtk_spin_button_accessible_get_range;
- iface->set_value = gtk_spin_button_accessible_set_value;
- iface->get_increment = gtk_spin_button_accessible_get_increment;
-}
diff --git a/gtk/a11y/gtkspinbuttonaccessible.h b/gtk/a11y/gtkspinbuttonaccessible.h
deleted file mode 100644
index 8a2e597669..0000000000
--- a/gtk/a11y/gtkspinbuttonaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_SPIN_BUTTON_ACCESSIBLE_H__
-#define __GTK_SPIN_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SPIN_BUTTON_ACCESSIBLE (gtk_spin_button_accessible_get_type ())
-#define GTK_SPIN_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SPIN_BUTTON_ACCESSIBLE, GtkSpinButtonAccessible))
-#define GTK_SPIN_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SPIN_BUTTON_ACCESSIBLE, GtkSpinButtonAccessibleClass))
-#define GTK_IS_SPIN_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SPIN_BUTTON_ACCESSIBLE))
-#define GTK_IS_SPIN_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SPIN_BUTTON_ACCESSIBLE))
-#define GTK_SPIN_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SPIN_BUTTON_ACCESSIBLE, GtkSpinButtonAccessibleClass))
-
-typedef struct _GtkSpinButtonAccessible GtkSpinButtonAccessible;
-typedef struct _GtkSpinButtonAccessibleClass GtkSpinButtonAccessibleClass;
-typedef struct _GtkSpinButtonAccessiblePrivate GtkSpinButtonAccessiblePrivate;
-
-struct _GtkSpinButtonAccessible
-{
- GtkEntryAccessible parent;
-
- GtkSpinButtonAccessiblePrivate *priv;
-};
-
-struct _GtkSpinButtonAccessibleClass
-{
- GtkEntryAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_spin_button_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_SPIN_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkspinneraccessible.c b/gtk/a11y/gtkspinneraccessible.c
deleted file mode 100644
index 16b02e2d4f..0000000000
--- a/gtk/a11y/gtkspinneraccessible.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2007 John Stowers, Neil Jagdish Patel.
- * Copyright (C) 2009 Bastien Nocera, David Zeuthen
- *
- * 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 .
- *
- * Code adapted from egg-spinner
- * by Christian Hergert
- */
-
-#include "config.h"
-
-#include
-#include "gtkintl.h"
-#include "gtkspinneraccessible.h"
-
-static void atk_image_interface_init (AtkImageIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkSpinnerAccessible, gtk_spinner_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init));
-
-static void
-gtk_spinner_accessible_initialize (AtkObject *accessible,
- gpointer widget)
-{
- ATK_OBJECT_CLASS (gtk_spinner_accessible_parent_class)->initialize (accessible, widget);
-
- atk_object_set_name (accessible, C_("throbbing progress animation widget", "Spinner"));
- atk_object_set_description (accessible, _("Provides visual indication of progress"));
- atk_object_set_role (accessible, ATK_ROLE_ANIMATION);
-}
-
-static void
-gtk_spinner_accessible_class_init (GtkSpinnerAccessibleClass *klass)
-{
- AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
-
- atk_class->initialize = gtk_spinner_accessible_initialize;
-}
-
-static void
-gtk_spinner_accessible_init (GtkSpinnerAccessible *self)
-{
-}
-
-static void
-gtk_spinner_accessible_image_get_size (AtkImage *image,
- gint *width,
- gint *height)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
- if (widget == NULL)
- {
- *width = 0;
- *height = 0;
- return;
- }
-
- *width = gtk_widget_get_width (widget);
- *height = gtk_widget_get_height (widget);
-}
-
-static void
-atk_image_interface_init (AtkImageIface *iface)
-{
- iface->get_image_size = gtk_spinner_accessible_image_get_size;
-}
diff --git a/gtk/a11y/gtkspinneraccessible.h b/gtk/a11y/gtkspinneraccessible.h
deleted file mode 100644
index 5258db6f5b..0000000000
--- a/gtk/a11y/gtkspinneraccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* GTK+ - accessibility implementations
- * 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, see .
- */
-
-#ifndef __GTK_SPINNER_ACCESSIBLE_H__
-#define __GTK_SPINNER_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SPINNER_ACCESSIBLE (gtk_spinner_accessible_get_type ())
-#define GTK_SPINNER_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SPINNER_ACCESSIBLE, GtkSpinnerAccessible))
-#define GTK_SPINNER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SPINNER_ACCESSIBLE, GtkSpinnerAccessibleClass))
-#define GTK_IS_SPINNER_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SPINNER_ACCESSIBLE))
-#define GTK_IS_SPINNER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SPINNER_ACCESSIBLE))
-#define GTK_SPINNER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SPINNER_ACCESSIBLE, GtkSpinnerAccessibleClass))
-
-typedef struct _GtkSpinnerAccessible GtkSpinnerAccessible;
-typedef struct _GtkSpinnerAccessibleClass GtkSpinnerAccessibleClass;
-typedef struct _GtkSpinnerAccessiblePrivate GtkSpinnerAccessiblePrivate;
-
-struct _GtkSpinnerAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkSpinnerAccessiblePrivate *priv;
-};
-
-struct _GtkSpinnerAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_spinner_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_SPINNER_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkstackaccessible.c b/gtk/a11y/gtkstackaccessible.c
deleted file mode 100644
index 23b4e13762..0000000000
--- a/gtk/a11y/gtkstackaccessible.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2016 Timm Bäder
- *
- * 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
-#include "gtkstackaccessibleprivate.h"
-#include "gtkwidgetprivate.h"
-
-
-G_DEFINE_TYPE (GtkStackAccessible, gtk_stack_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static AtkObject*
-gtk_stack_accessible_ref_child (AtkObject *obj,
- int i)
-{
- GtkWidget *stack = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- GtkWidget *visible_child;
-
- if (stack == NULL)
- return NULL;
-
- if (i != 0)
- return NULL;
-
- visible_child = gtk_stack_get_visible_child (GTK_STACK (stack));
-
- if (visible_child == NULL)
- return NULL;
-
- return g_object_ref (gtk_widget_get_accessible (visible_child));
-}
-
-static int
-gtk_stack_accessible_get_n_children (AtkObject *obj)
-{
- GtkWidget *stack = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- if (stack == NULL)
- return 0;
-
- if (gtk_stack_get_visible_child (GTK_STACK (stack)))
- return 1;
-
- return 0;
-}
-
-static void
-gtk_stack_accessible_class_init (GtkStackAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_n_children = gtk_stack_accessible_get_n_children;
- class->ref_child = gtk_stack_accessible_ref_child;
-}
-
-static void
-gtk_stack_accessible_init (GtkStackAccessible *bar) {}
-
-
-void
-gtk_stack_accessible_update_visible_child (GtkStack *stack,
- GtkWidget *old_visible_child,
- GtkWidget *new_visible_child)
-{
- AtkObject *stack_accessible = _gtk_widget_peek_accessible (GTK_WIDGET (stack));
-
- if (stack_accessible == NULL)
- return;
-
- if (old_visible_child)
- {
- AtkObject *accessible = gtk_widget_get_accessible (old_visible_child);
- g_object_notify (G_OBJECT (accessible), "accessible-parent");
- g_signal_emit_by_name (stack_accessible, "children-changed::remove", 0, accessible, NULL);
- }
-
- if (new_visible_child)
- {
- AtkObject *accessible = gtk_widget_get_accessible (new_visible_child);
- g_object_notify (G_OBJECT (accessible), "accessible-parent");
- g_signal_emit_by_name (stack_accessible, "children-changed::add", 0, accessible, NULL);
- }
-}
-
-
-
diff --git a/gtk/a11y/gtkstackaccessible.h b/gtk/a11y/gtkstackaccessible.h
deleted file mode 100644
index 6254c33802..0000000000
--- a/gtk/a11y/gtkstackaccessible.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2016 Timm Bäder
- *
- * 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 .
- */
-
-#ifndef __GTK_STACK_ACCESSIBLE_H__
-#define __GTK_STACK_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_STACK_ACCESSIBLE (gtk_stack_accessible_get_type ())
-#define GTK_STACK_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_STACK_ACCESSIBLE, GtkStackAccessible))
-#define GTK_STACK_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STACK_ACCESSIBLE, GtkStackAccessibleClass))
-#define GTK_IS_STACK_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_STACK_ACCESSIBLE))
-#define GTK_IS_STACK_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STACK_ACCESSIBLE))
-#define GTK_STACK_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STACK_ACCESSIBLE, GtkStackAccessibleClass))
-
-typedef struct _GtkStackAccessible GtkStackAccessible;
-typedef struct _GtkStackAccessibleClass GtkStackAccessibleClass;
-
-struct _GtkStackAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkStackAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_stack_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif
diff --git a/gtk/a11y/gtkstackaccessibleprivate.h b/gtk/a11y/gtkstackaccessibleprivate.h
deleted file mode 100644
index c69a48d780..0000000000
--- a/gtk/a11y/gtkstackaccessibleprivate.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2016 Timm Bäder
- *
- * 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 .
- */
-
-#ifndef __GTK_STACK_ACCESSIBLE_PRIVATE_H__
-#define __GTK_STACK_ACCESSIBLE_PRIVATE_H__
-
-#include "gtkstackaccessible.h"
-
-G_BEGIN_DECLS
-
-void gtk_stack_accessible_update_visible_child (GtkStack *stack,
- GtkWidget *old_visible_child,
- GtkWidget *new_visible_child);
-
-
-G_END_DECLS
-
-#endif /* __GTK_STACK_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkstatusbaraccessible.c b/gtk/a11y/gtkstatusbaraccessible.c
deleted file mode 100644
index b4d2f38505..0000000000
--- a/gtk/a11y/gtkstatusbaraccessible.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include "gtkstatusbarprivate.h"
-#include "gtkstatusbaraccessible.h"
-
-
-G_DEFINE_TYPE (GtkStatusbarAccessible, gtk_statusbar_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
-
-static void
-text_changed (GtkStatusbar *statusbar,
- guint context_id,
- const gchar *text,
- AtkObject *obj)
-{
- if (!obj->name)
- g_object_notify (G_OBJECT (obj), "accessible-name");
- g_signal_emit_by_name (obj, "visible-data-changed");
-}
-
-static void
-gtk_statusbar_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkWidget *statusbar = data;
-
- ATK_OBJECT_CLASS (gtk_statusbar_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect_after (statusbar, "text-pushed",
- G_CALLBACK (text_changed), obj);
- g_signal_connect_after (statusbar, "text-popped",
- G_CALLBACK (text_changed), obj);
-
- obj->role = ATK_ROLE_STATUSBAR;
-}
-
-static const gchar *
-gtk_statusbar_accessible_get_name (AtkObject *obj)
-{
- const gchar *name;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_statusbar_accessible_parent_class)->get_name (obj);
- if (name != NULL)
- return name;
-
- return gtk_statusbar_get_message (GTK_STATUSBAR (widget));
-}
-
-static gint
-gtk_statusbar_accessible_get_n_children (AtkObject *obj)
-{
- return 0;
-}
-
-static AtkObject*
-gtk_statusbar_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- return NULL;
-}
-
-static void
-gtk_statusbar_accessible_class_init (GtkStatusbarAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_name = gtk_statusbar_accessible_get_name;
- class->get_n_children = gtk_statusbar_accessible_get_n_children;
- class->ref_child = gtk_statusbar_accessible_ref_child;
- class->initialize = gtk_statusbar_accessible_initialize;
-}
-
-static void
-gtk_statusbar_accessible_init (GtkStatusbarAccessible *bar)
-{
-}
diff --git a/gtk/a11y/gtkstatusbaraccessible.h b/gtk/a11y/gtkstatusbaraccessible.h
deleted file mode 100644
index 8a25f8dbd0..0000000000
--- a/gtk/a11y/gtkstatusbaraccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 .
- */
-
-#ifndef __GTK_STATUSBAR_ACCESSIBLE_H__
-#define __GTK_STATUSBAR_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_STATUSBAR_ACCESSIBLE (gtk_statusbar_accessible_get_type ())
-#define GTK_STATUSBAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_STATUSBAR_ACCESSIBLE, GtkStatusbarAccessible))
-#define GTK_STATUSBAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STATUSBAR_ACCESSIBLE, GtkStatusbarAccessibleClass))
-#define GTK_IS_STATUSBAR_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_STATUSBAR_ACCESSIBLE))
-#define GTK_IS_STATUSBAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STATUSBAR_ACCESSIBLE))
-#define GTK_STATUSBAR_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STATUSBAR_ACCESSIBLE, GtkStatusbarAccessibleClass))
-
-typedef struct _GtkStatusbarAccessible GtkStatusbarAccessible;
-typedef struct _GtkStatusbarAccessibleClass GtkStatusbarAccessibleClass;
-typedef struct _GtkStatusbarAccessiblePrivate GtkStatusbarAccessiblePrivate;
-
-struct _GtkStatusbarAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkStatusbarAccessiblePrivate *priv;
-};
-
-struct _GtkStatusbarAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_statusbar_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_STATUSBAR_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkswitchaccessible.c b/gtk/a11y/gtkswitchaccessible.c
deleted file mode 100644
index 669ba1f3ca..0000000000
--- a/gtk/a11y/gtkswitchaccessible.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2010 Intel Corporation
- * Copyright (C) 2010 RedHat, 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 .
- *
- * Author:
- * Emmanuele Bassi
- * Matthias Clasen
- *
- * Based on similar code from Mx.
- */
-
-#include "config.h"
-
-#include
-#include
-#include "gtkintl.h"
-#include "gtkswitchaccessible.h"
-
-
-static void atk_action_interface_init (AtkActionIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkSwitchAccessible, gtk_switch_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-static AtkStateSet *
-gtk_switch_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gtk_switch_accessible_parent_class)->ref_state_set (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return state_set;
-
- if (gtk_switch_get_active (GTK_SWITCH (widget)))
- atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
-
- return state_set;
-}
-
-static void
-gtk_switch_accessible_class_init (GtkSwitchAccessibleClass *klass)
-{
- AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
-
- atk_class->ref_state_set = gtk_switch_accessible_ref_state_set;
-}
-
-static void
-gtk_switch_accessible_init (GtkSwitchAccessible *self)
-{
-}
-
-static gint
-gtk_switch_action_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_switch_action_get_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return "toggle";
- return NULL;
-}
-
-static const gchar *
-gtk_switch_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Toggle");
- return NULL;
-}
-
-static const gchar *
-gtk_switch_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Toggles the switch");
- return NULL;
-}
-
-static gboolean
-gtk_switch_action_do_action (AtkAction *action,
- gint i)
-{
- GtkSwitch *sw;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- sw = GTK_SWITCH (widget);
- gtk_switch_set_active (sw, !gtk_switch_get_active (sw));
-
- return TRUE;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_switch_action_do_action;
- iface->get_n_actions = gtk_switch_action_get_n_actions;
- iface->get_name = gtk_switch_action_get_name;
- iface->get_localized_name = gtk_switch_action_get_localized_name;
- iface->get_description = gtk_switch_action_get_description;
-}
diff --git a/gtk/a11y/gtkswitchaccessible.h b/gtk/a11y/gtkswitchaccessible.h
deleted file mode 100644
index 1e2039e58d..0000000000
--- a/gtk/a11y/gtkswitchaccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* GTK+ - accessibility implementations
- * 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, see .
- */
-
-#ifndef __GTK_SWITCH_ACCESSIBLE_H__
-#define __GTK_SWITCH_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SWITCH_ACCESSIBLE (gtk_switch_accessible_get_type ())
-#define GTK_SWITCH_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SWITCH_ACCESSIBLE, GtkSwitchAccessible))
-#define GTK_SWITCH_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SWITCH_ACCESSIBLE, GtkSwitchAccessibleClass))
-#define GTK_IS_SWITCH_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SWITCH_ACCESSIBLE))
-#define GTK_IS_SWITCH_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SWITCH_ACCESSIBLE))
-#define GTK_SWITCH_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SWITCH_ACCESSIBLE, GtkSwitchAccessibleClass))
-
-typedef struct _GtkSwitchAccessible GtkSwitchAccessible;
-typedef struct _GtkSwitchAccessibleClass GtkSwitchAccessibleClass;
-typedef struct _GtkSwitchAccessiblePrivate GtkSwitchAccessiblePrivate;
-
-struct _GtkSwitchAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkSwitchAccessiblePrivate *priv;
-};
-
-struct _GtkSwitchAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_switch_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_SWITCH_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtktextaccessible.c b/gtk/a11y/gtktextaccessible.c
deleted file mode 100644
index 7a3b396b1a..0000000000
--- a/gtk/a11y/gtktextaccessible.c
+++ /dev/null
@@ -1,1016 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 "gdk/gdkeventsprivate.h"
-
-#include
-#include
-#include
-#include "gtkpango.h"
-#include "gtktextaccessible.h"
-#include "gtktextprivate.h"
-#include "gtkcomboboxaccessible.h"
-#include "gtkstylecontextprivate.h"
-#include "gtkwidgetprivate.h"
-
-struct _GtkTextAccessiblePrivate
-{
- gint cursor_position;
- gint selection_bound;
-};
-
-/* Callbacks */
-
-static void insert_text_cb (GtkEditable *editable,
- gchar *new_text,
- gint new_text_length,
- gint *position);
-static void delete_text_cb (GtkEditable *editable,
- gint start,
- gint end);
-
-static gboolean check_for_selection_change (GtkTextAccessible *entry,
- GtkText *gtk_text);
-
-
-static void atk_editable_text_interface_init (AtkEditableTextIface *iface);
-static void atk_text_interface_init (AtkTextIface *iface);
-static void atk_action_interface_init (AtkActionIface *iface);
-
-
-G_DEFINE_TYPE_WITH_CODE (GtkTextAccessible, gtk_text_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkTextAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
-
-
-static AtkStateSet *
-gtk_text_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- gboolean value;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- state_set = ATK_OBJECT_CLASS (gtk_text_accessible_parent_class)->ref_state_set (accessible);
-
- g_object_get (G_OBJECT (widget), "editable", &value, NULL);
- if (value)
- atk_state_set_add_state (state_set, ATK_STATE_EDITABLE);
- atk_state_set_add_state (state_set, ATK_STATE_SINGLE_LINE);
-
- return state_set;
-}
-
-static AtkAttributeSet *
-gtk_text_accessible_get_attributes (AtkObject *accessible)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
- AtkAttribute *placeholder_text;
- const gchar *text;
-
- attributes = ATK_OBJECT_CLASS (gtk_text_accessible_parent_class)->get_attributes (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return attributes;
-
- text = gtk_text_get_placeholder_text (GTK_TEXT (widget));
- if (text == NULL)
- return attributes;
-
- placeholder_text = g_malloc (sizeof (AtkAttribute));
- placeholder_text->name = g_strdup ("placeholder-text");
- placeholder_text->value = g_strdup (text);
-
- attributes = g_slist_append (attributes, placeholder_text);
-
- return attributes;
-}
-
-static void
-on_cursor_position_changed (GObject *gobject,
- GParamSpec *pspec,
- AtkObject *accessible)
-{
- GtkTextAccessible *self = GTK_TEXT_ACCESSIBLE (accessible);
- GtkTextAccessiblePrivate *priv = gtk_text_accessible_get_instance_private (self);
- GtkText *text = GTK_TEXT (gobject);
-
- if (check_for_selection_change (self, text))
- g_signal_emit_by_name (accessible, "text-selection-changed");
-
- /* The entry cursor position has moved so generate the signal */
- g_signal_emit_by_name (accessible,
- "text-caret-moved",
- priv->cursor_position);
-}
-
-static void
-on_selection_bound_changed (GObject *gobject,
- GParamSpec *pspec,
- AtkObject *accessible)
-{
- GtkTextAccessible *self = GTK_TEXT_ACCESSIBLE (accessible);
- GtkText *text = GTK_TEXT (gobject);
-
- if (check_for_selection_change (self, text))
- g_signal_emit_by_name (accessible, "text-selection-changed");
-}
-
-static void
-on_editable_changed (GObject *gobject,
- GParamSpec *pspec,
- AtkObject *accessible)
-{
- GtkEditable *editable = GTK_EDITABLE (gobject);
- gboolean value = gtk_editable_get_editable (editable);
-
- atk_object_notify_state_change (accessible, ATK_STATE_EDITABLE, value);
-}
-
-static void
-on_visibility_changed (GObject *gobject,
- GParamSpec *pspec,
- AtkObject *accessible)
-{
- GtkText *text = GTK_TEXT (gobject);
- AtkRole new_role;
-
- new_role = gtk_text_get_visibility (text)
- ? ATK_ROLE_TEXT
- : ATK_ROLE_PASSWORD_TEXT;
-
- atk_object_set_role (accessible, new_role);
-}
-
-static void
-gtk_text_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkText *entry;
- GtkTextAccessible *gtk_text_accessible;
- gint start_pos, end_pos;
-
- ATK_OBJECT_CLASS (gtk_text_accessible_parent_class)->initialize (obj, data);
-
- gtk_text_accessible = GTK_TEXT_ACCESSIBLE (obj);
-
- entry = GTK_TEXT (data);
- gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start_pos, &end_pos);
- gtk_text_accessible->priv->cursor_position = end_pos;
- gtk_text_accessible->priv->selection_bound = start_pos;
-
- /* Set up signal callbacks */
- g_signal_connect_after (entry, "insert-text", G_CALLBACK (insert_text_cb), NULL);
- g_signal_connect (entry, "delete-text", G_CALLBACK (delete_text_cb), NULL);
-
- g_signal_connect (entry, "notify::cursor-position", G_CALLBACK (on_cursor_position_changed), obj);
- g_signal_connect (entry, "notify::selection-bound", G_CALLBACK (on_selection_bound_changed), obj);
- g_signal_connect (entry, "notify::editable", G_CALLBACK (on_editable_changed), obj);
- g_signal_connect (entry, "notify::visibility", G_CALLBACK (on_visibility_changed), obj);
-
- if (gtk_text_get_visibility (entry))
- obj->role = ATK_ROLE_TEXT;
- else
- obj->role = ATK_ROLE_PASSWORD_TEXT;
-}
-
-static gint
-gtk_text_accessible_get_index_in_parent (AtkObject *accessible)
-{
- /* If the parent widget is a combo box then the index is 1
- * otherwise do the normal thing.
- */
- if (accessible->accessible_parent)
- if (GTK_IS_COMBO_BOX_ACCESSIBLE (accessible->accessible_parent))
- return 1;
-
- return ATK_OBJECT_CLASS (gtk_text_accessible_parent_class)->get_index_in_parent (accessible);
-}
-
-static void
-gtk_text_accessible_class_init (GtkTextAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->ref_state_set = gtk_text_accessible_ref_state_set;
- class->get_index_in_parent = gtk_text_accessible_get_index_in_parent;
- class->initialize = gtk_text_accessible_initialize;
- class->get_attributes = gtk_text_accessible_get_attributes;
-}
-
-static void
-gtk_text_accessible_init (GtkTextAccessible *entry)
-{
- entry->priv = gtk_text_accessible_get_instance_private (entry);
- entry->priv->cursor_position = 0;
- entry->priv->selection_bound = 0;
-}
-
-static gchar *
-gtk_text_accessible_get_text (AtkText *atk_text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return NULL;
-
- return gtk_text_get_display_text (GTK_TEXT (widget), start_pos, end_pos);
-}
-
-static gchar *
-gtk_text_accessible_get_text_before_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- return _gtk_pango_get_text_before (gtk_text_get_layout (GTK_TEXT (widget)),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar *
-gtk_text_accessible_get_text_at_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- return _gtk_pango_get_text_at (gtk_text_get_layout (GTK_TEXT (widget)),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gchar *
-gtk_text_accessible_get_text_after_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- return _gtk_pango_get_text_after (gtk_text_get_layout (GTK_TEXT (widget)),
- boundary_type, offset,
- start_offset, end_offset);
-}
-
-static gint
-gtk_text_accessible_get_character_count (AtkText *atk_text)
-{
- GtkWidget *widget;
- gchar *text;
- glong char_count;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return 0;
-
- text = gtk_text_get_display_text (GTK_TEXT (widget), 0, -1);
-
- char_count = 0;
- if (text)
- {
- char_count = g_utf8_strlen (text, -1);
- g_free (text);
- }
-
- return char_count;
-}
-
-static gint
-gtk_text_accessible_get_caret_offset (AtkText *text)
-{
- GtkWidget *widget;
- gboolean result;
- int cursor_position;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return -1;
-
- result = gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), NULL, &cursor_position);
- if (!result)
- return -1;
-
- return cursor_position;
-}
-
-static gboolean
-gtk_text_accessible_set_caret_offset (AtkText *text,
- gint offset)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- gtk_editable_set_position (GTK_EDITABLE (widget), offset);
-
- return TRUE;
-}
-
-static AtkAttributeSet *
-add_text_attribute (AtkAttributeSet *attributes,
- AtkTextAttribute attr,
- gint i)
-{
- AtkAttribute *at;
-
- at = g_new (AtkAttribute, 1);
- at->name = g_strdup (atk_text_attribute_get_name (attr));
- at->value = g_strdup (atk_text_attribute_get_value (attr, i));
-
- return g_slist_prepend (attributes, at);
-}
-
-static AtkAttributeSet *
-gtk_text_accessible_get_run_attributes (AtkText *text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- attributes = NULL;
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (widget));
- attributes = _gtk_pango_get_run_attributes (attributes,
- gtk_text_get_layout (GTK_TEXT (widget)),
- offset,
- start_offset,
- end_offset);
-
- return attributes;
-}
-
-static AtkAttributeSet *
-gtk_text_accessible_get_default_attributes (AtkText *text)
-{
- GtkWidget *widget;
- AtkAttributeSet *attributes;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- attributes = NULL;
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (widget));
- attributes = _gtk_pango_get_default_attributes (attributes,
- gtk_text_get_layout (GTK_TEXT (widget)));
- attributes = _gtk_style_context_get_attributes (attributes,
- gtk_widget_get_style_context (widget));
-
- return attributes;
-}
-
-static void
-gtk_text_accessible_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- GtkWidget *widget;
- GtkText *entry;
- PangoRectangle char_rect;
- gchar *entry_text;
- gint index, x_layout, y_layout;
- GtkAllocation allocation;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- entry = GTK_TEXT (widget);
-
- gtk_text_get_layout_offsets (entry, &x_layout, &y_layout);
- entry_text = gtk_text_get_display_text (entry, 0, -1);
- index = g_utf8_offset_to_pointer (entry_text, offset) - entry_text;
- g_free (entry_text);
-
- pango_layout_index_to_pos (gtk_text_get_layout (entry), index, &char_rect);
- pango_extents_to_pixels (&char_rect, NULL);
-
- gtk_widget_get_allocation (widget, &allocation);
-
- *x = allocation.x + x_layout + char_rect.x;
- *y = allocation.y + y_layout + char_rect.y;
- *width = char_rect.width;
- *height = char_rect.height;
-}
-
-static gint
-gtk_text_accessible_get_offset_at_point (AtkText *atk_text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- GtkWidget *widget;
- GtkText *entry;
- gchar *text;
- gint index, x_layout, y_layout;
- gint x_local, y_local;
- glong offset;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return -1;
-
- entry = GTK_TEXT (widget);
-
- gtk_text_get_layout_offsets (entry, &x_layout, &y_layout);
-
- x_local = x - x_layout;
- y_local = y - y_layout;
-
- if (!pango_layout_xy_to_index (gtk_text_get_layout (entry),
- x_local * PANGO_SCALE,
- y_local * PANGO_SCALE,
- &index, NULL))
- {
- if (x_local < 0 || y_local < 0)
- index = 0;
- else
- index = -1;
- }
-
- offset = -1;
- if (index != -1)
- {
- text = gtk_text_get_display_text (entry, 0, -1);
- offset = g_utf8_pointer_to_offset (text, text + index);
- g_free (text);
- }
-
- return offset;
-}
-
-static gint
-gtk_text_accessible_get_n_selections (AtkText *text)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return 0;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- return 1;
-
- return 0;
-}
-
-static gchar *
-gtk_text_accessible_get_selection (AtkText *text,
- gint selection_num,
- gint *start_pos,
- gint *end_pos)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- if (selection_num != 0)
- return NULL;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), start_pos, end_pos))
- return gtk_editable_get_chars (GTK_EDITABLE (widget), *start_pos, *end_pos);
-
- return NULL;
-}
-
-static gboolean
-gtk_text_accessible_add_selection (AtkText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkText *entry;
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- entry = GTK_TEXT (widget);
-
- if (!gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (entry), start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_text_accessible_remove_selection (AtkText *text,
- gint selection_num)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (widget), end, end);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_text_accessible_set_selection (AtkText *text,
- gint selection_num,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- gint start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
- {
- gtk_editable_select_region (GTK_EDITABLE (widget), start_pos, end_pos);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gunichar
-gtk_text_accessible_get_character_at_offset (AtkText *atk_text,
- gint offset)
-{
- GtkWidget *widget;
- gchar *text;
- gchar *index;
- gunichar result;
-
- result = '\0';
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return result;
-
- if (!gtk_text_get_visibility (GTK_TEXT (widget)))
- return result;
-
- text = gtk_text_get_display_text (GTK_TEXT (widget), 0, -1);
- if (offset < g_utf8_strlen (text, -1))
- {
- index = g_utf8_offset_to_pointer (text, offset);
- result = g_utf8_get_char (index);
- g_free (text);
- }
-
- return result;
-}
-
-static void
-atk_text_interface_init (AtkTextIface *iface)
-{
- iface->get_text = gtk_text_accessible_get_text;
- iface->get_character_at_offset = gtk_text_accessible_get_character_at_offset;
- iface->get_text_before_offset = gtk_text_accessible_get_text_before_offset;
- iface->get_text_at_offset = gtk_text_accessible_get_text_at_offset;
- iface->get_text_after_offset = gtk_text_accessible_get_text_after_offset;
- iface->get_caret_offset = gtk_text_accessible_get_caret_offset;
- iface->set_caret_offset = gtk_text_accessible_set_caret_offset;
- iface->get_character_count = gtk_text_accessible_get_character_count;
- iface->get_n_selections = gtk_text_accessible_get_n_selections;
- iface->get_selection = gtk_text_accessible_get_selection;
- iface->add_selection = gtk_text_accessible_add_selection;
- iface->remove_selection = gtk_text_accessible_remove_selection;
- iface->set_selection = gtk_text_accessible_set_selection;
- iface->get_run_attributes = gtk_text_accessible_get_run_attributes;
- iface->get_default_attributes = gtk_text_accessible_get_default_attributes;
- iface->get_character_extents = gtk_text_accessible_get_character_extents;
- iface->get_offset_at_point = gtk_text_accessible_get_offset_at_point;
-}
-
-static void
-gtk_text_accessible_set_text_contents (AtkEditableText *text,
- const gchar *string)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- if (!gtk_editable_get_editable (GTK_EDITABLE (widget)))
- return;
-
- gtk_editable_set_text (GTK_EDITABLE (widget), string);
-}
-
-static void
-gtk_text_accessible_insert_text (AtkEditableText *text,
- const gchar *string,
- gint length,
- gint *position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- gtk_editable_insert_text (editable, string, length, position);
- gtk_editable_set_position (editable, *position);
-}
-
-static void
-gtk_text_accessible_copy_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- gchar *str;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- str = gtk_editable_get_chars (editable, start_pos, end_pos);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
- g_free (str);
-}
-
-static void
-gtk_text_accessible_cut_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- gchar *str;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- str = gtk_editable_get_chars (editable, start_pos, end_pos);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
- gtk_editable_delete_text (editable, start_pos, end_pos);
-}
-
-static void
-gtk_text_accessible_delete_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkEditable *editable;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- gtk_editable_delete_text (editable, start_pos, end_pos);
-}
-
-typedef struct
-{
- GtkText* entry;
- gint position;
-} PasteData;
-
-static void
-paste_received_cb (GObject *clipboard,
- GAsyncResult *result,
- gpointer data)
-{
- PasteData *paste = data;
- char *text;
-
- text = gdk_clipboard_read_text_finish (GDK_CLIPBOARD (clipboard), result, NULL);
- if (text)
- gtk_editable_insert_text (GTK_EDITABLE (paste->entry), text, -1,
- &paste->position);
-
- g_object_unref (paste->entry);
- g_free (paste);
- g_free (text);
-}
-
-static void
-gtk_text_accessible_paste_text (AtkEditableText *text,
- gint position)
-{
- GtkWidget *widget;
- GtkEditable *editable;
- PasteData *paste;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- editable = GTK_EDITABLE (widget);
- if (!gtk_editable_get_editable (editable))
- return;
-
- paste = g_new0 (PasteData, 1);
- paste->entry = GTK_TEXT (widget);
- paste->position = position;
-
- g_object_ref (paste->entry);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_read_text_async (clipboard, NULL, paste_received_cb, paste);
-}
-
-static void
-atk_editable_text_interface_init (AtkEditableTextIface *iface)
-{
- iface->set_text_contents = gtk_text_accessible_set_text_contents;
- iface->insert_text = gtk_text_accessible_insert_text;
- iface->copy_text = gtk_text_accessible_copy_text;
- iface->cut_text = gtk_text_accessible_cut_text;
- iface->delete_text = gtk_text_accessible_delete_text;
- iface->paste_text = gtk_text_accessible_paste_text;
- iface->set_run_attributes = NULL;
-}
-
-static void
-insert_text_cb (GtkEditable *editable,
- gchar *new_text,
- gint new_text_length,
- gint *position)
-{
- GtkTextAccessible *accessible;
- gint length;
-
- if (new_text_length == 0)
- return;
-
- accessible = GTK_TEXT_ACCESSIBLE (gtk_widget_get_accessible (GTK_WIDGET (editable)));
- length = g_utf8_strlen (new_text, new_text_length);
-
- g_signal_emit_by_name (accessible,
- "text-changed::insert",
- *position - length,
- length);
-}
-
-/* We connect to GtkEditable::delete-text, since it carries
- * the information we need. But we delay emitting our own
- * text_changed::delete signal until the entry has update
- * all its internal state and emits GtkText::changed.
- */
-static void
-delete_text_cb (GtkEditable *editable,
- gint start,
- gint end)
-{
- GtkTextAccessible *accessible;
-
- accessible = GTK_TEXT_ACCESSIBLE (gtk_widget_get_accessible (GTK_WIDGET (editable)));
-
- if (end < 0)
- {
- gchar *text;
-
- text = gtk_text_get_display_text (GTK_TEXT (editable), 0, -1);
- end = g_utf8_strlen (text, -1);
- g_free (text);
- }
-
- if (end == start)
- return;
-
- g_signal_emit_by_name (accessible,
- "text-changed::delete",
- start,
- end - start);
-}
-
-static gboolean
-check_for_selection_change (GtkTextAccessible *accessible,
- GtkText *entry)
-{
- gboolean ret_val = FALSE;
- gint start, end;
-
- if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
- {
- if (end != accessible->priv->cursor_position ||
- start != accessible->priv->selection_bound)
- /*
- * This check is here as this function can be called
- * for notification of selection_bound and current_pos.
- * The values of current_pos and selection_bound may be the same
- * for both notifications and we only want to generate one
- * text_selection_changed signal.
- */
- ret_val = TRUE;
- }
- else
- {
- /* We had a selection */
- ret_val = (accessible->priv->cursor_position != accessible->priv->selection_bound);
- }
-
- accessible->priv->cursor_position = end;
- accessible->priv->selection_bound = start;
-
- return ret_val;
-}
-
-static gboolean
-gtk_text_accessible_do_action (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- if (i != 0)
- return FALSE;
-
- gtk_widget_activate (widget);
-
- return TRUE;
-}
-
-static gint
-gtk_text_accessible_get_n_actions (AtkAction *action)
-{
- return 1;
-}
-
-static const gchar *
-gtk_text_accessible_get_keybinding (AtkAction *action,
- gint i)
-{
- GtkWidget *widget;
- GtkWidget *label;
- AtkRelationSet *set;
- AtkRelation *relation;
- GPtrArray *target;
- gpointer target_object;
- guint key_val;
-
- if (i != 0)
- return NULL;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
- if (widget == NULL)
- return NULL;
-
- set = atk_object_ref_relation_set (ATK_OBJECT (action));
- if (!set)
- return NULL;
-
- label = NULL;
- relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
- if (relation)
- {
- target = atk_relation_get_target (relation);
-
- target_object = g_ptr_array_index (target, 0);
- label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
- }
-
- g_object_unref (set);
-
- if (GTK_IS_LABEL (label))
- {
- key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- if (key_val != GDK_KEY_VoidSymbol)
- return gtk_accelerator_name (key_val, GDK_ALT_MASK);
- }
-
- return NULL;
-}
-
-static const gchar*
-gtk_text_accessible_action_get_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return "activate";
- return NULL;
-}
-
-static const gchar*
-gtk_text_accessible_action_get_localized_name (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action name", "Activate");
- return NULL;
-}
-
-static const gchar*
-gtk_text_accessible_action_get_description (AtkAction *action,
- gint i)
-{
- if (i == 0)
- return C_("Action description", "Activates the entry");
- return NULL;
-}
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- iface->do_action = gtk_text_accessible_do_action;
- iface->get_n_actions = gtk_text_accessible_get_n_actions;
- iface->get_keybinding = gtk_text_accessible_get_keybinding;
- iface->get_name = gtk_text_accessible_action_get_name;
- iface->get_localized_name = gtk_text_accessible_action_get_localized_name;
- iface->get_description = gtk_text_accessible_action_get_description;
-}
diff --git a/gtk/a11y/gtktextaccessible.h b/gtk/a11y/gtktextaccessible.h
deleted file mode 100644
index e47be4236d..0000000000
--- a/gtk/a11y/gtktextaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_TEXT_ACCESSIBLE_H__
-#define __GTK_TEXT_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_TEXT_ACCESSIBLE (gtk_text_accessible_get_type ())
-#define GTK_TEXT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_ACCESSIBLE, GtkTextAccessible))
-#define GTK_TEXT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_ACCESSIBLE, GtkTextAccessibleClass))
-#define GTK_IS_TEXT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_ACCESSIBLE))
-#define GTK_IS_TEXT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_ACCESSIBLE))
-#define GTK_TEXT_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_ACCESSIBLE, GtkTextAccessibleClass))
-
-typedef struct _GtkTextAccessible GtkTextAccessible;
-typedef struct _GtkTextAccessibleClass GtkTextAccessibleClass;
-typedef struct _GtkTextAccessiblePrivate GtkTextAccessiblePrivate;
-
-struct _GtkTextAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkTextAccessiblePrivate *priv;
-};
-
-struct _GtkTextAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_text_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_TEXT_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c
deleted file mode 100644
index ea638743fc..0000000000
--- a/gtk/a11y/gtktextcellaccessible.c
+++ /dev/null
@@ -1,701 +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 "../gtkpango.h"
-#include "gtktextcellaccessible.h"
-#include "gtkcontainercellaccessible.h"
-#include "gtkcellaccessibleparent.h"
-#include "gtkstylecontextprivate.h"
-
-struct _GtkTextCellAccessiblePrivate
-{
- gchar *cell_text;
- gint caret_pos;
- gint cell_length;
- PangoLayout *layout;
-};
-
-static const gchar* gtk_text_cell_accessible_get_name (AtkObject *atk_obj);
-
-
-/* atktext.h */
-
-static gchar* gtk_text_cell_accessible_get_text (AtkText *text,
- gint start_pos,
- gint end_pos);
-static gunichar gtk_text_cell_accessible_get_character_at_offset (AtkText *text,
- gint offset);
-static gchar* gtk_text_cell_accessible_get_text_before_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset);
-static gchar* gtk_text_cell_accessible_get_text_at_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset);
-static gchar* gtk_text_cell_accessible_get_text_after_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset);
-static gint gtk_text_cell_accessible_get_character_count (AtkText *text);
-static gint gtk_text_cell_accessible_get_caret_offset (AtkText *text);
-static gboolean gtk_text_cell_accessible_set_caret_offset (AtkText *text,
- gint offset);
-static void gtk_text_cell_accessible_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords);
-static gint gtk_text_cell_accessible_get_offset_at_point (AtkText *text,
- gint x,
- gint y,
- AtkCoordType coords);
-static AtkAttributeSet* gtk_text_cell_accessible_get_run_attributes
- (AtkText *text,
- gint offset,
- gint *start_offset,
- gint *end_offset);
-static AtkAttributeSet* gtk_text_cell_accessible_get_default_attributes
- (AtkText *text);
-
-static GtkWidget* get_widget (GtkTextCellAccessible *cell);
-static PangoLayout* create_pango_layout (GtkTextCellAccessible *cell);
-static void add_attr (PangoAttrList *attr_list,
- PangoAttribute *attr);
-
-/* Misc */
-
-static void gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell,
- gboolean emit_signal);
-
-static void atk_text_interface_init (AtkTextIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkTextCellAccessible, gtk_text_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
- G_ADD_PRIVATE (GtkTextCellAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init))
-
-static AtkStateSet *
-gtk_text_cell_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
-
- state_set = ATK_OBJECT_CLASS (gtk_text_cell_accessible_parent_class)->ref_state_set (accessible);
-
- atk_state_set_add_state (state_set, ATK_STATE_SINGLE_LINE);
-
- return state_set;
-}
-
-static void
-gtk_text_cell_accessible_finalize (GObject *object)
-{
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (object);
-
- g_free (text_cell->priv->cell_text);
-
- if (text_cell->priv->layout)
- g_object_unref (text_cell->priv->layout);
-
- G_OBJECT_CLASS (gtk_text_cell_accessible_parent_class)->finalize (object);
-}
-
-static const gchar *
-gtk_text_cell_accessible_get_name (AtkObject *atk_obj)
-{
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (atk_obj);
-
- if (atk_obj->name)
- return atk_obj->name;
-
- return text_cell->priv->cell_text;
-}
-
-static void
-gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell,
- gboolean emit_signal)
-{
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (cell);
- AtkObject *obj = ATK_OBJECT (cell);
- gint text_length;
- gchar *text;
- GtkCellRenderer *renderer;
-
- if (text_cell->priv->layout)
- g_object_unref (text_cell->priv->layout);
- text_cell->priv->layout = create_pango_layout (text_cell);
-
- g_object_get (cell, "renderer", &renderer, NULL);
- g_object_get (renderer, "text", &text, NULL);
- g_object_unref (renderer);
-
- if (text == NULL)
- text = g_strdup ("");
- text_length = g_utf8_strlen (text, -1);
-
- if (g_strcmp0 (text_cell->priv->cell_text, text) != 0)
- {
- if (text_cell->priv->cell_length && emit_signal)
- {
- g_signal_emit_by_name (cell, "text-changed::delete",
- 0, text_cell->priv->cell_length);
- }
-
- g_free (text_cell->priv->cell_text);
- text_cell->priv->cell_text = g_strdup (text);
- text_cell->priv->cell_length = text_length;
-
- if (text_length && emit_signal)
- {
- g_signal_emit_by_name (cell, "text-changed::insert",
- 0, text_cell->priv->cell_length);
- }
-
- if (obj->name == NULL && emit_signal)
- g_object_notify (G_OBJECT (obj), "accessible-name");
- }
-
- g_free (text);
-}
-
-static void
-gtk_text_cell_accessible_class_init (GtkTextCellAccessibleClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
- GtkCellAccessibleClass *cell_class = GTK_CELL_ACCESSIBLE_CLASS (klass);
-
- cell_class->update_cache = gtk_text_cell_accessible_update_cache;
-
- atk_object_class->get_name = gtk_text_cell_accessible_get_name;
- atk_object_class->ref_state_set = gtk_text_cell_accessible_ref_state_set;
-
- gobject_class->finalize = gtk_text_cell_accessible_finalize;
-}
-
-static void
-gtk_text_cell_accessible_init (GtkTextCellAccessible *text_cell)
-{
- text_cell->priv = gtk_text_cell_accessible_get_instance_private (text_cell);
- text_cell->priv->caret_pos = -1;
-}
-
-static gchar *
-gtk_text_cell_accessible_get_text (AtkText *atk_text,
- gint start_pos,
- gint end_pos)
-{
- gchar *text;
-
- text = GTK_TEXT_CELL_ACCESSIBLE (atk_text)->priv->cell_text;
- if (text)
- return g_utf8_substring (text, start_pos, end_pos > -1 ? end_pos : g_utf8_strlen (text, -1));
- else
- return g_strdup ("");
-}
-
-static gchar *
-gtk_text_cell_accessible_get_text_before_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (atk_text);
- gchar *text;
-
- text = _gtk_pango_get_text_before (text_cell->priv->layout, boundary_type, offset, start_offset, end_offset);
-
- return text;
-}
-
-static gchar *
-gtk_text_cell_accessible_get_text_at_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (atk_text);
- gchar *text;
-
- text = _gtk_pango_get_text_at (text_cell->priv->layout, boundary_type, offset, start_offset, end_offset);
-
- return text;
-}
-
-static gchar *
-gtk_text_cell_accessible_get_text_after_offset (AtkText *atk_text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (atk_text);
- gchar *text;
-
- text = _gtk_pango_get_text_after (text_cell->priv->layout, boundary_type, offset, start_offset, end_offset);
-
- return text;
-}
-
-static gint
-gtk_text_cell_accessible_get_character_count (AtkText *text)
-{
- if (GTK_TEXT_CELL_ACCESSIBLE (text)->priv->cell_text != NULL)
- return GTK_TEXT_CELL_ACCESSIBLE (text)->priv->cell_length;
- else
- return 0;
-}
-
-static gint
-gtk_text_cell_accessible_get_caret_offset (AtkText *text)
-{
- return GTK_TEXT_CELL_ACCESSIBLE (text)->priv->caret_pos;
-}
-
-static gboolean
-gtk_text_cell_accessible_set_caret_offset (AtkText *text,
- gint offset)
-{
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (text);
-
- if (text_cell->priv->cell_text == NULL)
- return FALSE;
- else
- {
- /* Only set the caret within the bounds and if it is to a new position. */
- if (offset >= 0 &&
- offset <= text_cell->priv->cell_length &&
- offset != text_cell->priv->caret_pos)
- {
- text_cell->priv->caret_pos = offset;
-
- /* emit the signal */
- g_signal_emit_by_name (text, "text-caret-moved", offset);
- return TRUE;
- }
- else
- return FALSE;
- }
-}
-
-static AtkAttributeSet *
-gtk_text_cell_accessible_get_run_attributes (AtkText *text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- AtkAttributeSet *attrib_set = NULL;
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (text);
-
- attrib_set = _gtk_pango_get_run_attributes (NULL, text_cell->priv->layout, offset, start_offset, end_offset);
-
- return attrib_set;
-}
-
-static AtkAttributeSet *
-add_attribute (AtkAttributeSet *attributes,
- AtkTextAttribute attr,
- const gchar *value)
-{
- AtkAttribute *at;
-
- at = g_new (AtkAttribute, 1);
- at->name = g_strdup (atk_text_attribute_get_name (attr));
- at->value = g_strdup (value);
-
- return g_slist_prepend (attributes, at);
-}
-
-static AtkAttributeSet *
-gtk_text_cell_accessible_get_default_attributes (AtkText *text)
-{
- AtkAttributeSet *attrib_set = NULL;
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (text);
- GtkWidget *widget;
-
- widget = get_widget (GTK_TEXT_CELL_ACCESSIBLE (text));
-
- attrib_set = add_attribute (attrib_set, ATK_TEXT_ATTR_DIRECTION,
- atk_text_attribute_get_value (ATK_TEXT_ATTR_DIRECTION,
- gtk_widget_get_direction (widget)));
- attrib_set = _gtk_pango_get_default_attributes (NULL, text_cell->priv->layout);
-
- attrib_set = _gtk_style_context_get_attributes (attrib_set,
- gtk_widget_get_style_context (widget));
-
- return attrib_set;
-}
-
-GtkWidget *
-get_widget (GtkTextCellAccessible *text)
-{
- AtkObject *parent;
-
- parent = atk_object_get_parent (ATK_OBJECT (text));
- if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
- parent = atk_object_get_parent (parent);
-
- return gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
-}
-
-/* This function is used by gtk_text_cell_accessible_get_offset_at_point()
- * and gtk_text_cell_accessible_get_character_extents(). There is no
- * cached PangoLayout so we must create a temporary one using this function.
- */
-static PangoLayout *
-create_pango_layout (GtkTextCellAccessible *text)
-{
- GdkRGBA *foreground_rgba;
- PangoAttrList *attr_list, *attributes;
- PangoLayout *layout;
- PangoUnderline uline, underline;
- PangoFontMask mask;
- PangoFontDescription *font_desc;
- gboolean foreground_set, strikethrough_set, strikethrough;
- gboolean scale_set, underline_set, rise_set;
- gchar *renderer_text;
- gdouble scale;
- gint rise;
- GtkRendererCellAccessible *gail_renderer;
- GtkCellRendererText *gtk_renderer;
-
- gail_renderer = GTK_RENDERER_CELL_ACCESSIBLE (text);
- g_object_get (gail_renderer, "renderer", >k_renderer, NULL);
-
- g_object_get (gtk_renderer,
- "text", &renderer_text,
- "attributes", &attributes,
- "foreground-set", &foreground_set,
- "foreground-rgba", &foreground_rgba,
- "strikethrough-set", &strikethrough_set,
- "strikethrough", &strikethrough,
- "font-desc", &font_desc,
- "scale-set", &scale_set,
- "scale", &scale,
- "underline-set", &underline_set,
- "underline", &underline,
- "rise-set", &rise_set,
- "rise", &rise,
- NULL);
- g_object_unref (gtk_renderer);
-
- layout = gtk_widget_create_pango_layout (get_widget (text), renderer_text);
-
- if (attributes)
- attr_list = pango_attr_list_copy (attributes);
- else
- attr_list = pango_attr_list_new ();
-
- if (foreground_set)
- {
- add_attr (attr_list, pango_attr_foreground_new (foreground_rgba->red * 65535,
- foreground_rgba->green * 65535,
- foreground_rgba->blue * 65535));
- }
-
- if (strikethrough_set)
- add_attr (attr_list,
- pango_attr_strikethrough_new (strikethrough));
-
- mask = pango_font_description_get_set_fields (font_desc);
-
- if (mask & PANGO_FONT_MASK_FAMILY)
- add_attr (attr_list,
- pango_attr_family_new (pango_font_description_get_family (font_desc)));
-
- if (mask & PANGO_FONT_MASK_STYLE)
- add_attr (attr_list, pango_attr_style_new (pango_font_description_get_style (font_desc)));
-
- if (mask & PANGO_FONT_MASK_VARIANT)
- add_attr (attr_list, pango_attr_variant_new (pango_font_description_get_variant (font_desc)));
-
- if (mask & PANGO_FONT_MASK_WEIGHT)
- add_attr (attr_list, pango_attr_weight_new (pango_font_description_get_weight (font_desc)));
-
- if (mask & PANGO_FONT_MASK_STRETCH)
- add_attr (attr_list, pango_attr_stretch_new (pango_font_description_get_stretch (font_desc)));
-
- if (mask & PANGO_FONT_MASK_SIZE)
- add_attr (attr_list, pango_attr_size_new (pango_font_description_get_size (font_desc)));
-
- if (scale_set && scale != 1.0)
- add_attr (attr_list, pango_attr_scale_new (scale));
-
- if (underline_set)
- uline = underline;
- else
- uline = PANGO_UNDERLINE_NONE;
-
- if (uline != PANGO_UNDERLINE_NONE)
- add_attr (attr_list,
- pango_attr_underline_new (underline));
-
- if (rise_set)
- add_attr (attr_list, pango_attr_rise_new (rise));
-
- pango_layout_set_attributes (layout, attr_list);
- pango_layout_set_width (layout, -1);
- pango_attr_list_unref (attr_list);
-
- pango_font_description_free (font_desc);
- pango_attr_list_unref (attributes);
- g_free (renderer_text);
- gdk_rgba_free (foreground_rgba);
-
- return layout;
-}
-
-static void
-add_attr (PangoAttrList *attr_list,
- PangoAttribute *attr)
-{
- attr->start_index = 0;
- attr->end_index = G_MAXINT;
- pango_attr_list_insert (attr_list, attr);
-}
-
-static void
-gtk_text_cell_accessible_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- GtkRendererCellAccessible *gail_renderer;
- GtkRequisition min_size;
- GtkCellRendererText *gtk_renderer;
- GdkRectangle rendered_rect;
- GtkWidget *widget;
- AtkObject *parent;
- PangoRectangle char_rect;
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (text);
- gchar *renderer_text;
- gfloat xalign, yalign;
- gint x_offset, y_offset, index;
- gint xpad, ypad;
-
- if (!GTK_TEXT_CELL_ACCESSIBLE (text)->priv->cell_text)
- {
- *x = *y = *height = *width = 0;
- return;
- }
- if (offset < 0 || offset >= GTK_TEXT_CELL_ACCESSIBLE (text)->priv->cell_length)
- {
- *x = *y = *height = *width = 0;
- return;
- }
- gail_renderer = GTK_RENDERER_CELL_ACCESSIBLE (text);
- g_object_get (gail_renderer, "renderer", >k_renderer, NULL);
- g_object_get (gtk_renderer, "text", &renderer_text, NULL);
- if (renderer_text == NULL)
- {
- g_object_unref (gtk_renderer);
- return;
- }
-
- parent = atk_object_get_parent (ATK_OBJECT (text));
- if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
- parent = atk_object_get_parent (parent);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
- gtk_cell_accessible_parent_get_cell_area (GTK_CELL_ACCESSIBLE_PARENT (parent),
- GTK_CELL_ACCESSIBLE (text),
- &rendered_rect);
-
- gtk_cell_renderer_get_preferred_size (GTK_CELL_RENDERER (gtk_renderer),
- widget,
- &min_size, NULL);
-
- gtk_cell_renderer_get_alignment (GTK_CELL_RENDERER (gtk_renderer), &xalign, &yalign);
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- xalign = 1.0 - xalign;
- x_offset = MAX (0, xalign * (rendered_rect.width - min_size.width));
- y_offset = MAX (0, yalign * (rendered_rect.height - min_size.height));
-
- index = g_utf8_offset_to_pointer (renderer_text, offset) - renderer_text;
- pango_layout_index_to_pos (text_cell->priv->layout, index, &char_rect);
-
- gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (gtk_renderer), &xpad, &ypad);
-
- *x = (char_rect.x / PANGO_SCALE) + x_offset + rendered_rect.x + xpad;
- *y = (char_rect.y / PANGO_SCALE) + y_offset + rendered_rect.y + ypad;
- *height = char_rect.height / PANGO_SCALE;
- *width = char_rect.width / PANGO_SCALE;
-
- if (coords == ATK_XY_SCREEN)
- {
- *x = 0;
- *y = 0;
- *height = 0;
- *width = 0;
- }
-
- g_free (renderer_text);
- g_object_unref (gtk_renderer);
-}
-
-static gint
-gtk_text_cell_accessible_get_offset_at_point (AtkText *text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- AtkObject *parent;
- GtkRendererCellAccessible *gail_renderer;
- GtkCellRendererText *gtk_renderer;
- GtkRequisition min_size;
- GtkWidget *widget;
- GdkRectangle rendered_rect;
- GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (text);
- gchar *renderer_text;
- gfloat xalign, yalign;
- gint x_offset, y_offset, index;
- gint xpad, ypad;
- gint x_temp, y_temp;
- gboolean ret;
-
- if (!GTK_TEXT_CELL_ACCESSIBLE (text)->priv->cell_text)
- return -1;
-
- gail_renderer = GTK_RENDERER_CELL_ACCESSIBLE (text);
- g_object_get (gail_renderer, "renderer", >k_renderer, NULL);
- parent = atk_object_get_parent (ATK_OBJECT (text));
-
- g_object_get (gtk_renderer, "text", &renderer_text, NULL);
- if (text == NULL)
- {
- g_object_unref (gtk_renderer);
- g_free (renderer_text);
- return -1;
- }
-
- if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
- parent = atk_object_get_parent (parent);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
-
- g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), -1);
- gtk_cell_accessible_parent_get_cell_area (GTK_CELL_ACCESSIBLE_PARENT (parent),
- GTK_CELL_ACCESSIBLE (text),
- &rendered_rect);
-
- gtk_cell_renderer_get_preferred_size (GTK_CELL_RENDERER (gtk_renderer),
- widget,
- &min_size, NULL);
- gtk_cell_renderer_get_alignment (GTK_CELL_RENDERER (gtk_renderer), &xalign, &yalign);
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- xalign = 1.0 - xalign;
- x_offset = MAX (0, xalign * (rendered_rect.width - min_size.width));
- y_offset = MAX (0, yalign * (rendered_rect.height - min_size.height));
-
- gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (gtk_renderer), &xpad, &ypad);
-
- x_temp = x - (x_offset + rendered_rect.x + xpad);
- y_temp = y - (y_offset + rendered_rect.y + ypad);
-
- if (coords == ATK_XY_SCREEN)
- index = -1;
-
- ret = pango_layout_xy_to_index (text_cell->priv->layout,
- x_temp * PANGO_SCALE,
- y_temp * PANGO_SCALE,
- &index, NULL);
- if (!ret)
- {
- if (x_temp < 0 || y_temp < 0)
- index = 0;
- else
- index = -1;
- }
-
- g_object_unref (gtk_renderer);
-
- if (index == -1)
- {
- if (coords == ATK_XY_WINDOW || coords == ATK_XY_SCREEN)
- {
- glong length;
-
- length = g_utf8_strlen (renderer_text, -1);
- g_free (renderer_text);
-
- return length;
- }
-
- g_free (renderer_text);
-
- return index;
- }
- else
- {
- glong offset;
-
- offset = g_utf8_pointer_to_offset (renderer_text,
- renderer_text + index);
- g_free (renderer_text);
-
- return offset;
- }
-}
-
-static gunichar
-gtk_text_cell_accessible_get_character_at_offset (AtkText *text,
- gint offset)
-{
- gchar *index;
- gchar *string;
-
- string = GTK_TEXT_CELL_ACCESSIBLE(text)->priv->cell_text;
-
- if (!string)
- return '\0';
-
- if (offset >= g_utf8_strlen (string, -1))
- return '\0';
-
- index = g_utf8_offset_to_pointer (string, offset);
-
- return g_utf8_get_char (index);
-}
-
-static void
-atk_text_interface_init (AtkTextIface *iface)
-{
- iface->get_text = gtk_text_cell_accessible_get_text;
- iface->get_character_at_offset = gtk_text_cell_accessible_get_character_at_offset;
- iface->get_text_before_offset = gtk_text_cell_accessible_get_text_before_offset;
- iface->get_text_at_offset = gtk_text_cell_accessible_get_text_at_offset;
- iface->get_text_after_offset = gtk_text_cell_accessible_get_text_after_offset;
- iface->get_character_count = gtk_text_cell_accessible_get_character_count;
- iface->get_caret_offset = gtk_text_cell_accessible_get_caret_offset;
- iface->set_caret_offset = gtk_text_cell_accessible_set_caret_offset;
- iface->get_run_attributes = gtk_text_cell_accessible_get_run_attributes;
- iface->get_default_attributes = gtk_text_cell_accessible_get_default_attributes;
- iface->get_character_extents = gtk_text_cell_accessible_get_character_extents;
- iface->get_offset_at_point = gtk_text_cell_accessible_get_offset_at_point;
-}
diff --git a/gtk/a11y/gtktextcellaccessible.h b/gtk/a11y/gtktextcellaccessible.h
deleted file mode 100644
index 16a63b7518..0000000000
--- a/gtk/a11y/gtktextcellaccessible.h
+++ /dev/null
@@ -1,58 +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 .
- */
-
-#ifndef __GTK_TEXT_CELL_ACCESSIBLE_H__
-#define __GTK_TEXT_CELL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_TEXT_CELL_ACCESSIBLE (gtk_text_cell_accessible_get_type ())
-#define GTK_TEXT_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_CELL_ACCESSIBLE, GtkTextCellAccessible))
-#define GTK_TEXT_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TEXT_CELL_ACCESSIBLE, GtkTextCellAccessibleClass))
-#define GTK_IS_TEXT_CELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_CELL_ACCESSIBLE))
-#define GTK_IS_TEXT_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_CELL_ACCESSIBLE))
-#define GTK_TEXT_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_CELL_ACCESSIBLE, GtkTextCellAccessibleClass))
-
-typedef struct _GtkTextCellAccessible GtkTextCellAccessible;
-typedef struct _GtkTextCellAccessibleClass GtkTextCellAccessibleClass;
-typedef struct _GtkTextCellAccessiblePrivate GtkTextCellAccessiblePrivate;
-
-struct _GtkTextCellAccessible
-{
- GtkRendererCellAccessible parent;
-
- GtkTextCellAccessiblePrivate *priv;
-};
-
-struct _GtkTextCellAccessibleClass
-{
- GtkRendererCellAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_text_cell_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_TEXT_CELL_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c
deleted file mode 100644
index 9962c23607..0000000000
--- a/gtk/a11y/gtktextviewaccessible.c
+++ /dev/null
@@ -1,1819 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include "gtktextviewaccessibleprivate.h"
-#include "gtktextbufferprivate.h"
-#include "gtktextviewprivate.h"
-#include "gtk/gtkwidgetprivate.h"
-
-struct _GtkTextViewAccessiblePrivate
-{
- gint insert_offset;
- gint selection_bound;
-};
-
-static void insert_text_cb (GtkTextBuffer *buffer,
- GtkTextIter *arg1,
- gchar *arg2,
- gint arg3,
- gpointer user_data);
-static void delete_range_cb (GtkTextBuffer *buffer,
- GtkTextIter *arg1,
- GtkTextIter *arg2,
- gpointer user_data);
-static void delete_range_after_cb (GtkTextBuffer *buffer,
- GtkTextIter *arg1,
- GtkTextIter *arg2,
- gpointer user_data);
-static void mark_set_cb (GtkTextBuffer *buffer,
- GtkTextIter *arg1,
- GtkTextMark *arg2,
- gpointer user_data);
-
-
-static void atk_editable_text_interface_init (AtkEditableTextIface *iface);
-static void atk_text_interface_init (AtkTextIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkTextViewAccessible, gtk_text_view_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkTextViewAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init))
-
-
-static void
-on_editable_changed (GObject *gobject,
- GParamSpec *pspec,
- AtkObject *accessible)
-{
- GtkTextView *text_view = GTK_TEXT_VIEW (gobject);
-
- atk_object_notify_state_change (accessible,
- ATK_STATE_EDITABLE,
- gtk_text_view_get_editable (text_view));
-}
-
-static void
-gtk_text_view_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_text_view_accessible_parent_class)->initialize (obj, data);
-
- obj->role = ATK_ROLE_TEXT;
-
- g_signal_connect (data, "notify::editable",
- G_CALLBACK (on_editable_changed),
- obj);
-}
-
-static AtkStateSet*
-gtk_text_view_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gtk_text_view_accessible_parent_class)->ref_state_set (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- {
- atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
- return state_set;
- }
-
- if (gtk_text_view_get_editable (GTK_TEXT_VIEW (widget)))
- atk_state_set_add_state (state_set, ATK_STATE_EDITABLE);
- atk_state_set_add_state (state_set, ATK_STATE_MULTI_LINE);
-
- return state_set;
-}
-
-static void
-gtk_text_view_accessible_change_buffer (GtkTextViewAccessible *accessible,
- GtkTextBuffer *old_buffer,
- GtkTextBuffer *new_buffer)
-{
- if (old_buffer)
- {
- g_signal_handlers_disconnect_matched (old_buffer, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, accessible);
-
- g_signal_emit_by_name (accessible,
- "text-changed::delete",
- 0,
- gtk_text_buffer_get_char_count (old_buffer));
- }
-
- if (new_buffer)
- {
- g_signal_connect_after (new_buffer, "insert-text", G_CALLBACK (insert_text_cb), accessible);
- g_signal_connect (new_buffer, "delete-range", G_CALLBACK (delete_range_cb), accessible);
- g_signal_connect_after (new_buffer, "delete-range", G_CALLBACK (delete_range_after_cb), accessible);
- g_signal_connect_after (new_buffer, "mark-set", G_CALLBACK (mark_set_cb), accessible);
-
- g_signal_emit_by_name (accessible,
- "text-changed::insert",
- 0,
- gtk_text_buffer_get_char_count (new_buffer));
- }
-}
-
-static void
-gtk_text_view_accessible_widget_set (GtkAccessible *accessible)
-{
- gtk_text_view_accessible_change_buffer (GTK_TEXT_VIEW_ACCESSIBLE (accessible),
- NULL,
- gtk_text_view_get_buffer (GTK_TEXT_VIEW (gtk_accessible_get_widget (accessible))));
-}
-
-static void
-gtk_text_view_accessible_widget_unset (GtkAccessible *accessible)
-{
- gtk_text_view_accessible_change_buffer (GTK_TEXT_VIEW_ACCESSIBLE (accessible),
- gtk_text_view_get_buffer (GTK_TEXT_VIEW (gtk_accessible_get_widget (accessible))),
- NULL);
-}
-
-static void
-gtk_text_view_accessible_class_init (GtkTextViewAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
- GtkAccessibleClass *accessible_class = GTK_ACCESSIBLE_CLASS (klass);
-
- accessible_class->widget_set = gtk_text_view_accessible_widget_set;
- accessible_class->widget_unset = gtk_text_view_accessible_widget_unset;
-
- class->ref_state_set = gtk_text_view_accessible_ref_state_set;
- class->initialize = gtk_text_view_accessible_initialize;
-}
-
-static void
-gtk_text_view_accessible_init (GtkTextViewAccessible *accessible)
-{
- accessible->priv = gtk_text_view_accessible_get_instance_private (accessible);
-}
-
-static gchar *
-gtk_text_view_accessible_get_text (AtkText *text,
- gint start_offset,
- gint end_offset)
-{
- GtkTextView *view;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_get_iter_at_offset (buffer, &start, start_offset);
- gtk_text_buffer_get_iter_at_offset (buffer, &end, end_offset);
-
- return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
-}
-
-static gchar *
-gtk_text_view_accessible_get_text_after_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
- GtkTextView *view;
- GtkTextBuffer *buffer;
- GtkTextIter pos;
- GtkTextIter start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_get_iter_at_offset (buffer, &pos, offset);
- start = end = pos;
- if (boundary_type == ATK_TEXT_BOUNDARY_LINE_START)
- {
- gtk_text_view_forward_display_line (view, &end);
- start = end;
- gtk_text_view_forward_display_line (view, &end);
- }
- else if (boundary_type == ATK_TEXT_BOUNDARY_LINE_END)
- {
- gtk_text_view_forward_display_line_end (view, &end);
- start = end;
- gtk_text_view_forward_display_line (view, &end);
- gtk_text_view_forward_display_line_end (view, &end);
- }
- else
- _gtk_text_buffer_get_text_after (buffer, boundary_type, &pos, &start, &end);
-
- *start_offset = gtk_text_iter_get_offset (&start);
- *end_offset = gtk_text_iter_get_offset (&end);
-
- return gtk_text_buffer_get_slice (buffer, &start, &end, FALSE);
-}
-
-static gchar *
-gtk_text_view_accessible_get_text_at_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
- GtkTextView *view;
- GtkTextBuffer *buffer;
- GtkTextIter pos;
- GtkTextIter start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_get_iter_at_offset (buffer, &pos, offset);
- start = end = pos;
- if (boundary_type == ATK_TEXT_BOUNDARY_LINE_START)
- {
- gtk_text_view_backward_display_line_start (view, &start);
- gtk_text_view_forward_display_line (view, &end);
- }
- else if (boundary_type == ATK_TEXT_BOUNDARY_LINE_END)
- {
- gtk_text_view_backward_display_line_start (view, &start);
- if (!gtk_text_iter_is_start (&start))
- {
- gtk_text_view_backward_display_line (view, &start);
- gtk_text_view_forward_display_line_end (view, &start);
- }
- gtk_text_view_forward_display_line_end (view, &end);
- }
- else
- _gtk_text_buffer_get_text_at (buffer, boundary_type, &pos, &start, &end);
-
- *start_offset = gtk_text_iter_get_offset (&start);
- *end_offset = gtk_text_iter_get_offset (&end);
-
- return gtk_text_buffer_get_slice (buffer, &start, &end, FALSE);
-}
-
-static gchar *
-gtk_text_view_accessible_get_text_before_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- GtkWidget *widget;
- GtkTextView *view;
- GtkTextBuffer *buffer;
- GtkTextIter pos;
- GtkTextIter start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_get_iter_at_offset (buffer, &pos, offset);
- start = end = pos;
-
- if (boundary_type == ATK_TEXT_BOUNDARY_LINE_START)
- {
- gtk_text_view_backward_display_line_start (view, &start);
- end = start;
- gtk_text_view_backward_display_line (view, &start);
- gtk_text_view_backward_display_line_start (view, &start);
- }
- else if (boundary_type == ATK_TEXT_BOUNDARY_LINE_END)
- {
- gtk_text_view_backward_display_line_start (view, &start);
- if (!gtk_text_iter_is_start (&start))
- {
- gtk_text_view_backward_display_line (view, &start);
- end = start;
- gtk_text_view_forward_display_line_end (view, &end);
- if (!gtk_text_iter_is_start (&start))
- {
- if (gtk_text_view_backward_display_line (view, &start))
- gtk_text_view_forward_display_line_end (view, &start);
- else
- gtk_text_iter_set_offset (&start, 0);
- }
- }
- else
- end = start;
- }
- else
- _gtk_text_buffer_get_text_before (buffer, boundary_type, &pos, &start, &end);
-
- *start_offset = gtk_text_iter_get_offset (&start);
- *end_offset = gtk_text_iter_get_offset (&end);
-
- return gtk_text_buffer_get_slice (buffer, &start, &end, FALSE);
-}
-
-static gunichar
-gtk_text_view_accessible_get_character_at_offset (AtkText *text,
- gint offset)
-{
- GtkWidget *widget;
- GtkTextIter start, end;
- GtkTextBuffer *buffer;
- gchar *string;
- gunichar unichar;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return '\0';
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- if (offset >= gtk_text_buffer_get_char_count (buffer))
- return '\0';
-
- gtk_text_buffer_get_iter_at_offset (buffer, &start, offset);
- end = start;
- gtk_text_iter_forward_char (&end);
- string = gtk_text_buffer_get_slice (buffer, &start, &end, FALSE);
- unichar = g_utf8_get_char (string);
- g_free (string);
-
- return unichar;
-}
-
-static gint
-gtk_text_view_accessible_get_character_count (AtkText *text)
-{
- GtkWidget *widget;
- GtkTextBuffer *buffer;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return 0;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- return gtk_text_buffer_get_char_count (buffer);
-}
-
-static gint
-get_insert_offset (GtkTextBuffer *buffer)
-{
- GtkTextMark *insert;
- GtkTextIter iter;
-
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
- return gtk_text_iter_get_offset (&iter);
-}
-
-static gint
-gtk_text_view_accessible_get_caret_offset (AtkText *text)
-{
- GtkWidget *widget;
- GtkTextBuffer *buffer;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return -1;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- return get_insert_offset (buffer);
-}
-
-static gboolean
-gtk_text_view_accessible_set_caret_offset (AtkText *text,
- gint offset)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter iter;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
-
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
- gtk_text_buffer_place_cursor (buffer, &iter);
- gtk_text_view_scroll_to_iter (view, &iter, 0, FALSE, 0, 0);
-
- return TRUE;
-}
-
-static gint
-gtk_text_view_accessible_get_offset_at_point (AtkText *text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- GtkTextView *view;
- GtkTextIter iter;
- gint buff_x, buff_y;
- GtkWidget *widget;
- GdkRectangle rect;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return -1;
-
- if (coords != ATK_XY_WINDOW)
- return -1;
-
- view = GTK_TEXT_VIEW (widget);
-
- gtk_text_view_window_to_buffer_coords (view, GTK_TEXT_WINDOW_WIDGET,
- x, y, &buff_x, &buff_y);
- gtk_text_view_get_visible_rect (view, &rect);
-
- /* Clamp point to visible rectangle */
- buff_x = CLAMP (buff_x, rect.x, rect.x + rect.width - 1);
- buff_y = CLAMP (buff_y, rect.y, rect.y + rect.height - 1);
-
- gtk_text_view_get_iter_at_location (view, &iter, buff_x, buff_y);
-
- /* The iter at a location sometimes points to the next character.
- * See bug 111031. We work around that
- */
- gtk_text_view_get_iter_location (view, &iter, &rect);
- if (buff_x < rect.x)
- gtk_text_iter_backward_char (&iter);
- return gtk_text_iter_get_offset (&iter);
-}
-
-static void
-gtk_text_view_accessible_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- GtkTextView *view;
- GtkTextBuffer *buffer;
- GtkTextIter iter;
- GtkWidget *widget;
- GdkRectangle rectangle;
-
- *x = 0;
- *y = 0;
- *width = 0;
- *height = 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
- gtk_text_view_get_iter_location (view, &iter, &rectangle);
-
- *height = rectangle.height;
- *width = rectangle.width;
-
- gtk_text_view_buffer_to_window_coords (view, GTK_TEXT_WINDOW_WIDGET,
- rectangle.x, rectangle.y, x, y);
- if (coords != ATK_XY_WINDOW)
- {
- *x = 0;
- *y = 0;
- *height = 0;
- *width = 0;
- }
-}
-
-static AtkAttributeSet *
-add_text_attribute (AtkAttributeSet *attributes,
- AtkTextAttribute attr,
- gchar *value)
-{
- AtkAttribute *at;
-
- at = g_new (AtkAttribute, 1);
- at->name = g_strdup (atk_text_attribute_get_name (attr));
- at->value = value;
-
- return g_slist_prepend (attributes, at);
-}
-
-static AtkAttributeSet *
-add_text_int_attribute (AtkAttributeSet *attributes,
- AtkTextAttribute attr,
- gint i)
-
-{
- gchar *value;
-
- value = g_strdup (atk_text_attribute_get_value (attr, i));
-
- return add_text_attribute (attributes, attr, value);
-}
-
-static AtkAttributeSet *
-gtk_text_view_accessible_get_run_attributes (AtkText *text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- GtkTextView *view;
- GtkTextBuffer *buffer;
- GtkWidget *widget;
- GtkTextIter iter;
- AtkAttributeSet *attrib_set = NULL;
- GSList *tags, *temp_tags;
- gdouble scale = 1;
- gboolean val_set = FALSE;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
-
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
-
- gtk_text_iter_forward_to_tag_toggle (&iter, NULL);
- *end_offset = gtk_text_iter_get_offset (&iter);
-
- gtk_text_iter_backward_to_tag_toggle (&iter, NULL);
- *start_offset = gtk_text_iter_get_offset (&iter);
-
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
-
- tags = gtk_text_iter_get_tags (&iter);
- tags = g_slist_reverse (tags);
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "style-set", &val_set, NULL);
- if (val_set)
- {
- PangoStyle style;
- g_object_get (tag, "style", &style, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_STYLE, style);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "variant-set", &val_set, NULL);
- if (val_set)
- {
- PangoVariant variant;
- g_object_get (tag, "variant", &variant, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_VARIANT, variant);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "stretch-set", &val_set, NULL);
- if (val_set)
- {
- PangoStretch stretch;
- g_object_get (tag, "stretch", &stretch, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_STRETCH, stretch);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "justification-set", &val_set, NULL);
- if (val_set)
- {
- GtkJustification justification;
- g_object_get (tag, "justification", &justification, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_JUSTIFICATION, justification);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
- GtkTextDirection direction;
-
- g_object_get (tag, "direction", &direction, NULL);
-
- if (direction != GTK_TEXT_DIR_NONE)
- {
- val_set = TRUE;
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_DIRECTION, direction);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "wrap-mode-set", &val_set, NULL);
- if (val_set)
- {
- GtkWrapMode wrap_mode;
- g_object_get (tag, "wrap-mode", &wrap_mode, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_WRAP_MODE, wrap_mode);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "foreground-set", &val_set, NULL);
- if (val_set)
- {
- GdkRGBA *rgba;
- gchar *value;
-
- g_object_get (tag, "foreground-rgba", &rgba, NULL);
- value = g_strdup_printf ("%u,%u,%u",
- (guint) rgba->red * 65535,
- (guint) rgba->green * 65535,
- (guint) rgba->blue * 65535);
- gdk_rgba_free (rgba);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_FG_COLOR, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "background-set", &val_set, NULL);
- if (val_set)
- {
- GdkRGBA *rgba;
- gchar *value;
-
- g_object_get (tag, "background-rgba", &rgba, NULL);
- value = g_strdup_printf ("%u,%u,%u",
- (guint) rgba->red * 65535,
- (guint) rgba->green * 65535,
- (guint) rgba->blue * 65535);
- gdk_rgba_free (rgba);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_BG_COLOR, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "family-set", &val_set, NULL);
-
- if (val_set)
- {
- gchar *value;
- g_object_get (tag, "family", &value, NULL);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_FAMILY_NAME, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "language-set", &val_set, NULL);
-
- if (val_set)
- {
- gchar *value;
- g_object_get (tag, "language", &value, NULL);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_LANGUAGE, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "weight-set", &val_set, NULL);
-
- if (val_set)
- {
- gint weight;
- gchar *value;
- g_object_get (tag, "weight", &weight, NULL);
- value = g_strdup_printf ("%d", weight);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_WEIGHT, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- /* scale is special as the effective value is the product
- * of all specified values
- */
- temp_tags = tags;
- while (temp_tags)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
- gboolean scale_set;
-
- g_object_get (tag, "scale-set", &scale_set, NULL);
- if (scale_set)
- {
- gdouble font_scale;
- g_object_get (tag, "scale", &font_scale, NULL);
- val_set = TRUE;
- scale *= font_scale;
- }
- temp_tags = temp_tags->next;
- }
- if (val_set)
- {
- gchar *value;
- value = g_strdup_printf ("%g", scale);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_SCALE, value);
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "size-set", &val_set, NULL);
- if (val_set)
- {
- gint size;
- gchar *value;
- g_object_get (tag, "size", &size, NULL);
- value = g_strdup_printf ("%i", size);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_SIZE, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "strikethrough-set", &val_set, NULL);
- if (val_set)
- {
- gboolean strikethrough;
- g_object_get (tag, "strikethrough", &strikethrough, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_STRIKETHROUGH, strikethrough);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "underline-set", &val_set, NULL);
- if (val_set)
- {
- PangoUnderline underline;
- g_object_get (tag, "underline", &underline, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_UNDERLINE, underline);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "rise-set", &val_set, NULL);
- if (val_set)
- {
- gint rise;
- gchar *value;
- g_object_get (tag, "rise", &rise, NULL);
- value = g_strdup_printf ("%i", rise);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_RISE, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "background-full-height-set", &val_set, NULL);
- if (val_set)
- {
- gboolean bg_full_height;
- g_object_get (tag, "background-full-height", &bg_full_height, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_BG_FULL_HEIGHT, bg_full_height);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "pixels-inside-wrap-set", &val_set, NULL);
- if (val_set)
- {
- gint pixels;
- gchar *value;
- g_object_get (tag, "pixels-inside-wrap", &pixels, NULL);
- value = g_strdup_printf ("%i", pixels);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "pixels-below-lines-set", &val_set, NULL);
- if (val_set)
- {
- gint pixels;
- gchar *value;
- g_object_get (tag, "pixels-below-lines", &pixels, NULL);
- value = g_strdup_printf ("%i", pixels);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_PIXELS_BELOW_LINES, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "pixels-above-lines-set", &val_set, NULL);
- if (val_set)
- {
- gint pixels;
- gchar *value;
- g_object_get (tag, "pixels-above-lines", &pixels, NULL);
- value = g_strdup_printf ("%i", pixels);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_PIXELS_ABOVE_LINES, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "editable-set", &val_set, NULL);
- if (val_set)
- {
- gboolean editable;
- g_object_get (tag, "editable", &editable, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_EDITABLE, editable);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "invisible-set", &val_set, NULL);
- if (val_set)
- {
- gboolean invisible;
- g_object_get (tag, "invisible", &invisible, NULL);
- attrib_set = add_text_int_attribute (attrib_set, ATK_TEXT_ATTR_INVISIBLE, invisible);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "indent-set", &val_set, NULL);
- if (val_set)
- {
- gint indent;
- gchar *value;
- g_object_get (tag, "indent", &indent, NULL);
- value = g_strdup_printf ("%i", indent);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_INDENT, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "right-margin-set", &val_set, NULL);
- if (val_set)
- {
- gint margin;
- gchar *value;
- g_object_get (tag, "right-margin", &margin, NULL);
- value = g_strdup_printf ("%i", margin);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_RIGHT_MARGIN, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- temp_tags = tags;
- while (temp_tags && !val_set)
- {
- GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
-
- g_object_get (tag, "left-margin-set", &val_set, NULL);
- if (val_set)
- {
- gint margin;
- gchar *value;
- g_object_get (tag, "left-margin", &margin, NULL);
- value = g_strdup_printf ("%i", margin);
- attrib_set = add_text_attribute (attrib_set, ATK_TEXT_ATTR_LEFT_MARGIN, value);
- }
- temp_tags = temp_tags->next;
- }
- val_set = FALSE;
-
- g_slist_free (tags);
- return attrib_set;
-}
-
-static AtkAttributeSet *
-gtk_text_view_accessible_get_default_attributes (AtkText *text)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextAttributes *text_attrs;
- AtkAttributeSet *attributes;
- PangoFontDescription *font;
- gchar *value;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return NULL;
-
- view = GTK_TEXT_VIEW (widget);
- text_attrs = gtk_text_view_get_default_attributes (view);
-
- attributes = NULL;
-
- font = text_attrs->font;
-
- if (font)
- {
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_STYLE,
- pango_font_description_get_style (font));
-
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_VARIANT,
- pango_font_description_get_variant (font));
-
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_STRETCH,
- pango_font_description_get_stretch (font));
-
- value = g_strdup (pango_font_description_get_family (font));
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_FAMILY_NAME, value);
-
- value = g_strdup_printf ("%d", pango_font_description_get_weight (font));
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_WEIGHT, value);
-
- value = g_strdup_printf ("%i", pango_font_description_get_size (font) / PANGO_SCALE);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_SIZE, value);
- }
-
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_JUSTIFICATION, text_attrs->justification);
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_DIRECTION, text_attrs->direction);
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_WRAP_MODE, text_attrs->wrap_mode);
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_EDITABLE, text_attrs->editable);
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_INVISIBLE, text_attrs->invisible);
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_BG_FULL_HEIGHT, text_attrs->bg_full_height);
-
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_STRIKETHROUGH,
- text_attrs->appearance.strikethrough);
- attributes = add_text_int_attribute (attributes, ATK_TEXT_ATTR_UNDERLINE,
- text_attrs->appearance.underline);
-
- value = g_strdup_printf ("%u,%u,%u",
- (guint)(text_attrs->appearance.bg_rgba->red * 65535),
- (guint)(text_attrs->appearance.bg_rgba->green * 65535),
- (guint)(text_attrs->appearance.bg_rgba->blue * 65535));
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_BG_COLOR, value);
-
- value = g_strdup_printf ("%u,%u,%u",
- (guint)(text_attrs->appearance.fg_rgba->red),
- (guint)(text_attrs->appearance.fg_rgba->green),
- (guint)(text_attrs->appearance.fg_rgba->blue));
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_FG_COLOR, value);
-
- value = g_strdup_printf ("%g", text_attrs->font_scale);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_SCALE, value);
-
- value = g_strdup ((gchar *)(text_attrs->language));
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_LANGUAGE, value);
-
- value = g_strdup_printf ("%i", text_attrs->appearance.rise);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_RISE, value);
-
- value = g_strdup_printf ("%i", text_attrs->pixels_inside_wrap);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP, value);
-
- value = g_strdup_printf ("%i", text_attrs->pixels_below_lines);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_PIXELS_BELOW_LINES, value);
-
- value = g_strdup_printf ("%i", text_attrs->pixels_above_lines);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_PIXELS_ABOVE_LINES, value);
-
- value = g_strdup_printf ("%i", text_attrs->indent);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_INDENT, value);
-
- value = g_strdup_printf ("%i", text_attrs->left_margin);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_LEFT_MARGIN, value);
-
- value = g_strdup_printf ("%i", text_attrs->right_margin);
- attributes = add_text_attribute (attributes, ATK_TEXT_ATTR_RIGHT_MARGIN, value);
-
- gtk_text_attributes_unref (text_attrs);
- return attributes;
-}
-
-static gint
-gtk_text_view_accessible_get_n_selections (AtkText *text)
-{
- GtkWidget *widget;
- GtkTextBuffer *buffer;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return 0;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- if (gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL))
- return 1;
-
- return 0;
-}
-
-static gchar *
-gtk_text_view_accessible_get_selection (AtkText *atk_text,
- gint selection_num,
- gint *start_pos,
- gint *end_pos)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
- gchar *text;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
- if (widget == NULL)
- return NULL;
-
- if (selection_num != 0)
- return NULL;
-
- view = GTK_TEXT_VIEW (widget);
- buffer = gtk_text_view_get_buffer (view);
-
- if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
- text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
- else
- text = NULL;
-
- *start_pos = gtk_text_iter_get_offset (&start);
- *end_pos = gtk_text_iter_get_offset (&end);
-
- return text;
-}
-
-static gboolean
-gtk_text_view_accessible_add_selection (AtkText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
-
- if (!gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL))
- {
- gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
- gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
- gtk_text_buffer_select_range (buffer, &end, &start);
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_text_view_accessible_remove_selection (AtkText *text,
- gint selection_num)
-{
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextMark *insert;
- GtkTextIter iter;
- GtkTextIter start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
-
- if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
- {
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
- gtk_text_buffer_place_cursor (buffer, &iter);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-gtk_text_view_accessible_set_selection (AtkText *text,
- gint selection_num,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- if (selection_num != 0)
- return FALSE;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
-
- if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
- {
- gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
- gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
- gtk_text_buffer_select_range (buffer, &end, &start);
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static void
-atk_text_interface_init (AtkTextIface *iface)
-{
- iface->get_text = gtk_text_view_accessible_get_text;
- iface->get_text_after_offset = gtk_text_view_accessible_get_text_after_offset;
- iface->get_text_at_offset = gtk_text_view_accessible_get_text_at_offset;
- iface->get_text_before_offset = gtk_text_view_accessible_get_text_before_offset;
- iface->get_character_at_offset = gtk_text_view_accessible_get_character_at_offset;
- iface->get_character_count = gtk_text_view_accessible_get_character_count;
- iface->get_caret_offset = gtk_text_view_accessible_get_caret_offset;
- iface->set_caret_offset = gtk_text_view_accessible_set_caret_offset;
- iface->get_offset_at_point = gtk_text_view_accessible_get_offset_at_point;
- iface->get_character_extents = gtk_text_view_accessible_get_character_extents;
- iface->get_n_selections = gtk_text_view_accessible_get_n_selections;
- iface->get_selection = gtk_text_view_accessible_get_selection;
- iface->add_selection = gtk_text_view_accessible_add_selection;
- iface->remove_selection = gtk_text_view_accessible_remove_selection;
- iface->set_selection = gtk_text_view_accessible_set_selection;
- iface->get_run_attributes = gtk_text_view_accessible_get_run_attributes;
- iface->get_default_attributes = gtk_text_view_accessible_get_default_attributes;
-}
-
-/* atkeditabletext.h */
-
-static gboolean
-gtk_text_view_accessible_set_run_attributes (AtkEditableText *text,
- AtkAttributeSet *attributes,
- gint start_offset,
- gint end_offset)
-{
- GtkTextView *view;
- GtkTextBuffer *buffer;
- GtkWidget *widget;
- GtkTextTag *tag;
- GtkTextIter start;
- GtkTextIter end;
- gint j;
- GdkRGBA *color;
- gchar** RGB_vals;
- GSList *l;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return FALSE;
-
- view = GTK_TEXT_VIEW (widget);
- if (!gtk_text_view_get_editable (view))
- return FALSE;
-
- buffer = gtk_text_view_get_buffer (view);
-
- if (attributes == NULL)
- return FALSE;
-
- gtk_text_buffer_get_iter_at_offset (buffer, &start, start_offset);
- gtk_text_buffer_get_iter_at_offset (buffer, &end, end_offset);
-
- tag = gtk_text_buffer_create_tag (buffer, NULL, NULL);
-
- for (l = attributes; l; l = l->next)
- {
- gchar *name;
- gchar *value;
- AtkAttribute *at;
-
- at = l->data;
-
- name = at->name;
- value = at->value;
-
- if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_LEFT_MARGIN)))
- g_object_set (G_OBJECT (tag), "left-margin", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_RIGHT_MARGIN)))
- g_object_set (G_OBJECT (tag), "right-margin", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_INDENT)))
- g_object_set (G_OBJECT (tag), "indent", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_PIXELS_ABOVE_LINES)))
- g_object_set (G_OBJECT (tag), "pixels-above-lines", atoi (value), NULL);
-
- else if (!strcmp(name, atk_text_attribute_get_name (ATK_TEXT_ATTR_PIXELS_BELOW_LINES)))
- g_object_set (G_OBJECT (tag), "pixels-below-lines", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP)))
- g_object_set (G_OBJECT (tag), "pixels-inside-wrap", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_SIZE)))
- g_object_set (G_OBJECT (tag), "size", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_RISE)))
- g_object_set (G_OBJECT (tag), "rise", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_WEIGHT)))
- g_object_set (G_OBJECT (tag), "weight", atoi (value), NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_BG_FULL_HEIGHT)))
- {
- g_object_set (G_OBJECT (tag), "bg-full-height",
- (strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_BG_FULL_HEIGHT, 0))),
- NULL);
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_LANGUAGE)))
- g_object_set (G_OBJECT (tag), "language", value, NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_FAMILY_NAME)))
- g_object_set (G_OBJECT (tag), "family", value, NULL);
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_EDITABLE)))
- {
- g_object_set (G_OBJECT (tag), "editable",
- (strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_EDITABLE, 0))),
- NULL);
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_INVISIBLE)))
- {
- g_object_set (G_OBJECT (tag), "invisible",
- (strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_EDITABLE, 0))),
- NULL);
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_UNDERLINE)))
- {
- for (j = 0; j < 3; j++)
- {
- if (!strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_UNDERLINE, j)))
- {
- g_object_set (G_OBJECT (tag), "underline", j, NULL);
- break;
- }
- }
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_STRIKETHROUGH)))
- {
- g_object_set (G_OBJECT (tag), "strikethrough",
- (strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_STRIKETHROUGH, 0))),
- NULL);
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_BG_COLOR)))
- {
- RGB_vals = g_strsplit (value, ",", 3);
- color = g_malloc (sizeof (GdkRGBA));
- color->red = atoi (RGB_vals[0]) / 65535.0;
- color->green = atoi (RGB_vals[1]) / 65535.0;
- color->blue = atoi (RGB_vals[2]) / 65535.0;
- g_object_set (G_OBJECT (tag), "background-rgba", color, NULL);
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_FG_COLOR)))
- {
- RGB_vals = g_strsplit (value, ",", 3);
- color = g_malloc (sizeof (GdkRGBA));
- color->red = atoi (RGB_vals[0]) / 65535.0;
- color->green = atoi (RGB_vals[1]) / 65535.0;
- color->blue = atoi (RGB_vals[2]) / 65535.0;
- g_object_set (G_OBJECT (tag), "foreground-rgba", color, NULL);
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_STRETCH)))
- {
- for (j = 0; j < 9; j++)
- {
- if (!strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_STRETCH, j)))
- {
- g_object_set (G_OBJECT (tag), "stretch", j, NULL);
- break;
- }
- }
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_JUSTIFICATION)))
- {
- for (j = 0; j < 4; j++)
- {
- if (!strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_JUSTIFICATION, j)))
- {
- g_object_set (G_OBJECT (tag), "justification", j, NULL);
- break;
- }
- }
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_DIRECTION)))
- {
- for (j = 0; j < 3; j++)
- {
- if (!strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_DIRECTION, j)))
- {
- g_object_set (G_OBJECT (tag), "direction", j, NULL);
- break;
- }
- }
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_VARIANT)))
- {
- for (j = 0; j < 2; j++)
- {
- if (!strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_VARIANT, j)))
- {
- g_object_set (G_OBJECT (tag), "variant", j, NULL);
- break;
- }
- }
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_WRAP_MODE)))
- {
- for (j = 0; j < 3; j++)
- {
- if (!strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_WRAP_MODE, j)))
- {
- g_object_set (G_OBJECT (tag), "wrap-mode", j, NULL);
- break;
- }
- }
- }
-
- else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_STYLE)))
- {
- for (j = 0; j < 3; j++)
- {
- if (!strcmp (value, atk_text_attribute_get_value (ATK_TEXT_ATTR_STYLE, j)))
- {
- g_object_set (G_OBJECT (tag), "style", j, NULL);
- break;
- }
- }
- }
-
- else
- return FALSE;
- }
-
- gtk_text_buffer_apply_tag (buffer, tag, &start, &end);
-
- return TRUE;
-}
-
-static void
-gtk_text_view_accessible_set_text_contents (AtkEditableText *text,
- const gchar *string)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextBuffer *buffer;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- view = GTK_TEXT_VIEW (widget);
- if (!gtk_text_view_get_editable (view))
- return;
-
- buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_set_text (buffer, string, -1);
-}
-
-static void
-gtk_text_view_accessible_insert_text (AtkEditableText *text,
- const gchar *string,
- gint length,
- gint *position)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter iter;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- view = GTK_TEXT_VIEW (widget);
- if (!gtk_text_view_get_editable (view))
- return;
-
- buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, *position);
- gtk_text_buffer_insert (buffer, &iter, string, length);
-}
-
-static void
-gtk_text_view_accessible_copy_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
- gchar *str;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
-
- gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
- gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
- str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
-
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
-}
-
-static void
-gtk_text_view_accessible_cut_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
- gchar *str;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- view = GTK_TEXT_VIEW (widget);
- if (!gtk_text_view_get_editable (view))
- return;
- buffer = gtk_text_view_get_buffer (view);
-
- gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
- gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
- str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_set_text (clipboard, str);
- gtk_text_buffer_delete (buffer, &start, &end);
-}
-
-static void
-gtk_text_view_accessible_delete_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- GtkTextIter start_itr;
- GtkTextIter end_itr;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- view = GTK_TEXT_VIEW (widget);
- if (!gtk_text_view_get_editable (view))
- return;
- buffer = gtk_text_view_get_buffer (view);
-
- gtk_text_buffer_get_iter_at_offset (buffer, &start_itr, start_pos);
- gtk_text_buffer_get_iter_at_offset (buffer, &end_itr, end_pos);
- gtk_text_buffer_delete (buffer, &start_itr, &end_itr);
-}
-
-typedef struct
-{
- GtkTextBuffer* buffer;
- gint position;
-} PasteData;
-
-static void
-paste_received (GObject *clipboard,
- GAsyncResult *result,
- gpointer data)
-{
- PasteData* paste = data;
- GtkTextIter pos_itr;
- char *text;
-
- text = gdk_clipboard_read_text_finish (GDK_CLIPBOARD (clipboard), result, NULL);
- if (text)
- {
- gtk_text_buffer_get_iter_at_offset (paste->buffer, &pos_itr, paste->position);
- gtk_text_buffer_insert (paste->buffer, &pos_itr, text, -1);
- g_free (text);
- }
-
- g_object_unref (paste->buffer);
-}
-
-static void
-gtk_text_view_accessible_paste_text (AtkEditableText *text,
- gint position)
-{
- GtkTextView *view;
- GtkWidget *widget;
- GtkTextBuffer *buffer;
- PasteData paste;
- GdkClipboard *clipboard;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
- if (widget == NULL)
- return;
-
- view = GTK_TEXT_VIEW (widget);
- if (!gtk_text_view_get_editable (view))
- return;
- buffer = gtk_text_view_get_buffer (view);
-
- paste.buffer = buffer;
- paste.position = position;
-
- g_object_ref (paste.buffer);
- clipboard = gtk_widget_get_clipboard (widget);
- gdk_clipboard_read_text_async (clipboard, NULL, paste_received, &paste);
-}
-
-static void
-atk_editable_text_interface_init (AtkEditableTextIface *iface)
-{
- iface->set_text_contents = gtk_text_view_accessible_set_text_contents;
- iface->insert_text = gtk_text_view_accessible_insert_text;
- iface->copy_text = gtk_text_view_accessible_copy_text;
- iface->cut_text = gtk_text_view_accessible_cut_text;
- iface->delete_text = gtk_text_view_accessible_delete_text;
- iface->paste_text = gtk_text_view_accessible_paste_text;
- iface->set_run_attributes = gtk_text_view_accessible_set_run_attributes;
-}
-
-/* Callbacks */
-
-static void
-gtk_text_view_accessible_update_cursor (GtkTextViewAccessible *accessible,
- GtkTextBuffer * buffer)
-{
- int prev_insert_offset, prev_selection_bound;
- int insert_offset, selection_bound;
- GtkTextIter iter;
-
- prev_insert_offset = accessible->priv->insert_offset;
- prev_selection_bound = accessible->priv->selection_bound;
-
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, gtk_text_buffer_get_insert (buffer));
- insert_offset = gtk_text_iter_get_offset (&iter);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, gtk_text_buffer_get_selection_bound (buffer));
- selection_bound = gtk_text_iter_get_offset (&iter);
-
- if (prev_insert_offset == insert_offset && prev_selection_bound == selection_bound)
- return;
-
- accessible->priv->insert_offset = insert_offset;
- accessible->priv->selection_bound = selection_bound;
-
- if (prev_insert_offset != insert_offset)
- g_signal_emit_by_name (accessible, "text-caret-moved", insert_offset);
-
- if (prev_insert_offset != prev_selection_bound || insert_offset != selection_bound)
- g_signal_emit_by_name (accessible, "text-selection-changed");
-}
-
-static void
-insert_text_cb (GtkTextBuffer *buffer,
- GtkTextIter *iter,
- gchar *text,
- gint len,
- gpointer data)
-{
- GtkTextViewAccessible *accessible = data;
- gint position;
- gint length;
-
- position = gtk_text_iter_get_offset (iter);
- length = g_utf8_strlen (text, len);
-
- g_signal_emit_by_name (accessible, "text-changed::insert", position - length, length);
-
- gtk_text_view_accessible_update_cursor (accessible, buffer);
-}
-
-static void
-delete_range_cb (GtkTextBuffer *buffer,
- GtkTextIter *start,
- GtkTextIter *end,
- gpointer data)
-{
- GtkTextViewAccessible *accessible = data;
- gint offset, length;
-
- offset = gtk_text_iter_get_offset (start);
- length = gtk_text_iter_get_offset (end) - offset;
-
- g_signal_emit_by_name (accessible,
- "text-changed::delete",
- offset,
- length);
-}
-
-static void
-delete_range_after_cb (GtkTextBuffer *buffer,
- GtkTextIter *start,
- GtkTextIter *end,
- gpointer data)
-{
- GtkTextViewAccessible *accessible = data;
-
- gtk_text_view_accessible_update_cursor (accessible, buffer);
-}
-
-static void
-mark_set_cb (GtkTextBuffer *buffer,
- GtkTextIter *location,
- GtkTextMark *mark,
- gpointer data)
-{
- GtkTextViewAccessible *accessible = data;
-
- /*
- * Only generate the signal for the "insert" mark, which
- * represents the cursor.
- */
- if (mark == gtk_text_buffer_get_insert (buffer))
- {
- gtk_text_view_accessible_update_cursor (accessible, buffer);
- }
- else if (mark == gtk_text_buffer_get_selection_bound (buffer))
- {
- gtk_text_view_accessible_update_cursor (accessible, buffer);
- }
-}
-
-void
-_gtk_text_view_accessible_set_buffer (GtkTextView *textview,
- GtkTextBuffer *old_buffer)
-{
- GtkTextViewAccessible *accessible;
-
- g_return_if_fail (GTK_IS_TEXT_VIEW (textview));
- g_return_if_fail (old_buffer == NULL || GTK_IS_TEXT_BUFFER (old_buffer));
-
- accessible = GTK_TEXT_VIEW_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (textview)));
- if (accessible == NULL)
- return;
-
- gtk_text_view_accessible_change_buffer (accessible,
- old_buffer,
- gtk_text_view_get_buffer (textview));
-}
-
diff --git a/gtk/a11y/gtktextviewaccessible.h b/gtk/a11y/gtktextviewaccessible.h
deleted file mode 100644
index f8436e150e..0000000000
--- a/gtk/a11y/gtktextviewaccessible.h
+++ /dev/null
@@ -1,58 +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 .
- */
-
-#ifndef __GTK_TEXT_VIEW_ACCESSIBLE_H__
-#define __GTK_TEXT_VIEW_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_TEXT_VIEW_ACCESSIBLE (gtk_text_view_accessible_get_type ())
-#define GTK_TEXT_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_VIEW_ACCESSIBLE, GtkTextViewAccessible))
-#define GTK_TEXT_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_VIEW_ACCESSIBLE, GtkTextViewAccessibleClass))
-#define GTK_IS_TEXT_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_VIEW_ACCESSIBLE))
-#define GTK_IS_TEXT_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_VIEW_ACCESSIBLE))
-#define GTK_TEXT_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_VIEW_ACCESSIBLE, GtkTextViewAccessibleClass))
-
-typedef struct _GtkTextViewAccessible GtkTextViewAccessible;
-typedef struct _GtkTextViewAccessibleClass GtkTextViewAccessibleClass;
-typedef struct _GtkTextViewAccessiblePrivate GtkTextViewAccessiblePrivate;
-
-struct _GtkTextViewAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkTextViewAccessiblePrivate *priv;
-};
-
-struct _GtkTextViewAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_text_view_accessible_get_type (void);
-
-
-G_END_DECLS
-
-#endif /* __GTK_TEXT_VIEW_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtktextviewaccessibleprivate.h b/gtk/a11y/gtktextviewaccessibleprivate.h
deleted file mode 100644
index 9fe9b1b585..0000000000
--- a/gtk/a11y/gtktextviewaccessibleprivate.h
+++ /dev/null
@@ -1,30 +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 .
- */
-
-#ifndef __GTK_TEXT_VIEW_ACCESSIBLE_PRIVATE_H__
-#define __GTK_TEXT_VIEW_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_text_view_accessible_set_buffer (GtkTextView *textview,
- GtkTextBuffer *old_buffer);
-
-G_END_DECLS
-
-#endif /* __GTK_TEXT_VIEW_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtktogglebuttonaccessible.c b/gtk/a11y/gtktogglebuttonaccessible.c
deleted file mode 100644
index 53c8174f86..0000000000
--- a/gtk/a11y/gtktogglebuttonaccessible.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-#include "gtktogglebuttonaccessible.h"
-
-
-G_DEFINE_TYPE (GtkToggleButtonAccessible, gtk_toggle_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE)
-
-static void
-gtk_toggle_button_accessible_toggled (GtkWidget *widget)
-{
- AtkObject *accessible;
- GtkToggleButton *toggle_button;
-
- toggle_button = GTK_TOGGLE_BUTTON (widget);
-
- accessible = gtk_widget_get_accessible (widget);
- atk_object_notify_state_change (accessible, ATK_STATE_CHECKED,
- gtk_toggle_button_get_active (toggle_button));
-}
-
-static void
-gtk_toggle_button_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_toggle_button_accessible_parent_class)->initialize (obj, data);
-
- g_signal_connect (data, "toggled",
- G_CALLBACK (gtk_toggle_button_accessible_toggled), NULL);
-
- obj->role = ATK_ROLE_TOGGLE_BUTTON;
-}
-
-static AtkStateSet*
-gtk_toggle_button_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkToggleButton *toggle_button;
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- state_set = ATK_OBJECT_CLASS (gtk_toggle_button_accessible_parent_class)->ref_state_set (accessible);
- toggle_button = GTK_TOGGLE_BUTTON (widget);
-
- if (gtk_toggle_button_get_active (toggle_button))
- atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
-
- return state_set;
-}
-
-static void
-gtk_toggle_button_accessible_class_init (GtkToggleButtonAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->ref_state_set = gtk_toggle_button_accessible_ref_state_set;
- class->initialize = gtk_toggle_button_accessible_initialize;
-}
-
-static void
-gtk_toggle_button_accessible_init (GtkToggleButtonAccessible *button)
-{
-}
diff --git a/gtk/a11y/gtktogglebuttonaccessible.h b/gtk/a11y/gtktogglebuttonaccessible.h
deleted file mode 100644
index b45b518343..0000000000
--- a/gtk/a11y/gtktogglebuttonaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_TOGGLE_BUTTON_ACCESSIBLE_H__
-#define __GTK_TOGGLE_BUTTON_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE (gtk_toggle_button_accessible_get_type ())
-#define GTK_TOGGLE_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE, GtkToggleButtonAccessible))
-#define GTK_TOGGLE_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE, GtkToggleButtonAccessibleClass))
-#define GTK_IS_TOGGLE_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE))
-#define GTK_IS_TOGGLE_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE))
-#define GTK_TOGGLE_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE, GtkToggleButtonAccessibleClass))
-
-typedef struct _GtkToggleButtonAccessible GtkToggleButtonAccessible;
-typedef struct _GtkToggleButtonAccessibleClass GtkToggleButtonAccessibleClass;
-typedef struct _GtkToggleButtonAccessiblePrivate GtkToggleButtonAccessiblePrivate;
-
-struct _GtkToggleButtonAccessible
-{
- GtkButtonAccessible parent;
-
- GtkToggleButtonAccessiblePrivate *priv;
-};
-
-struct _GtkToggleButtonAccessibleClass
-{
- GtkButtonAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_toggle_button_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_TOGGLE_BUTTON_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtktoplevelaccessible.c b/gtk/a11y/gtktoplevelaccessible.c
deleted file mode 100644
index a7d07fec2f..0000000000
--- a/gtk/a11y/gtktoplevelaccessible.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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
-
-#include
-#include
-#include
-#include
-
-#include "gtktoplevelaccessible.h"
-
-struct _GtkToplevelAccessiblePrivate
-{
- GList *window_list;
-};
-
-G_DEFINE_TYPE_WITH_PRIVATE (GtkToplevelAccessible, gtk_toplevel_accessible, ATK_TYPE_OBJECT)
-
-static void
-gtk_toplevel_accessible_initialize (AtkObject *accessible,
- gpointer data)
-{
- ATK_OBJECT_CLASS (gtk_toplevel_accessible_parent_class)->initialize (accessible, data);
-
- accessible->role = ATK_ROLE_APPLICATION;
- accessible->accessible_parent = NULL;
-}
-
-static void
-gtk_toplevel_accessible_object_finalize (GObject *obj)
-{
- GtkToplevelAccessible *toplevel = GTK_TOPLEVEL_ACCESSIBLE (obj);
-
- if (toplevel->priv->window_list)
- g_list_free (toplevel->priv->window_list);
-
- G_OBJECT_CLASS (gtk_toplevel_accessible_parent_class)->finalize (obj);
-}
-
-static gint
-gtk_toplevel_accessible_get_n_children (AtkObject *obj)
-{
- GtkToplevelAccessible *toplevel = GTK_TOPLEVEL_ACCESSIBLE (obj);
-
- return g_list_length (toplevel->priv->window_list);
-}
-
-static AtkObject *
-gtk_toplevel_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- GtkToplevelAccessible *toplevel;
- GtkWidget *widget;
- AtkObject *atk_obj;
-
- toplevel = GTK_TOPLEVEL_ACCESSIBLE (obj);
- widget = g_list_nth_data (toplevel->priv->window_list, i);
- if (!widget)
- return NULL;
-
- atk_obj = gtk_widget_get_accessible (widget);
-
- g_object_ref (atk_obj);
-
- return atk_obj;
-}
-
-static const char *
-gtk_toplevel_accessible_get_name (AtkObject *obj)
-{
- return g_get_prgname ();
-}
-
-static void
-gtk_toplevel_accessible_class_init (GtkToplevelAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
- GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
-
- class->initialize = gtk_toplevel_accessible_initialize;
- class->get_n_children = gtk_toplevel_accessible_get_n_children;
- class->ref_child = gtk_toplevel_accessible_ref_child;
- class->get_parent = NULL;
- class->get_name = gtk_toplevel_accessible_get_name;
-
- g_object_class->finalize = gtk_toplevel_accessible_object_finalize;
-}
-
-static void
-remove_child (GtkToplevelAccessible *toplevel,
- GtkWindow *window)
-{
- AtkObject *atk_obj = ATK_OBJECT (toplevel);
- GList *l;
- guint window_count = 0;
- AtkObject *child;
-
- if (toplevel->priv->window_list)
- {
- GtkWindow *tmp_window;
-
- for (l = toplevel->priv->window_list; l; l = l->next)
- {
- tmp_window = GTK_WINDOW (l->data);
-
- if (window == tmp_window)
- {
- /* Remove the window from the window_list & emit the signal */
- toplevel->priv->window_list = g_list_delete_link (toplevel->priv->window_list, l);
- child = gtk_widget_get_accessible (GTK_WIDGET (window));
- g_signal_emit_by_name (atk_obj, "children-changed::remove",
- window_count, child, NULL);
- atk_object_set_parent (child, NULL);
- break;
- }
-
- window_count++;
- }
- }
-}
-
-static gboolean
-show_event_watcher (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GtkToplevelAccessible *toplevel = GTK_TOPLEVEL_ACCESSIBLE (data);
- AtkObject *atk_obj = ATK_OBJECT (toplevel);
- GObject *object;
- GtkWidget *widget;
- gint n_children;
- AtkObject *child;
-
- object = g_value_get_object (param_values + 0);
-
- if (!GTK_IS_WINDOW (object))
- return TRUE;
-
- widget = GTK_WIDGET (object);
- if (gtk_widget_get_parent (widget))
- return TRUE;
-
- child = gtk_widget_get_accessible (widget);
- if (atk_object_get_role (child) == ATK_ROLE_REDUNDANT_OBJECT ||
- atk_object_get_role (child) == ATK_ROLE_TOOL_TIP)
- return TRUE;
-
- /* Add the window to the list & emit the signal */
- toplevel->priv->window_list = g_list_append (toplevel->priv->window_list, widget);
- n_children = g_list_length (toplevel->priv->window_list);
-
- atk_object_set_parent (child, atk_obj);
- g_signal_emit_by_name (atk_obj, "children-changed::add",
- n_children - 1, child, NULL);
-
- g_signal_connect_swapped (G_OBJECT(object), "destroy",
- G_CALLBACK (remove_child), toplevel);
-
- return TRUE;
-}
-
-static gboolean
-hide_event_watcher (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GtkToplevelAccessible *toplevel = GTK_TOPLEVEL_ACCESSIBLE (data);
- GObject *object;
-
- object = g_value_get_object (param_values + 0);
-
- if (!GTK_IS_WINDOW (object))
- return TRUE;
-
- remove_child (toplevel, GTK_WINDOW (object));
- return TRUE;
-}
-
-static void
-gtk_toplevel_accessible_init (GtkToplevelAccessible *toplevel)
-{
- GtkWindow *window;
- GtkWidget *widget;
- GList *l;
- guint signal_id;
-
- toplevel->priv = gtk_toplevel_accessible_get_instance_private (toplevel);
-
- l = toplevel->priv->window_list = gtk_window_list_toplevels ();
-
- while (l)
- {
- window = GTK_WINDOW (l->data);
- widget = GTK_WIDGET (window);
- if (!window ||
- !gtk_widget_get_visible (widget) ||
- gtk_widget_get_parent (GTK_WIDGET (window)))
- {
- GList *temp_l = l->next;
-
- toplevel->priv->window_list = g_list_delete_link (toplevel->priv->window_list, l);
- l = temp_l;
- }
- else
- {
- g_signal_connect_swapped (G_OBJECT (window), "destroy",
- G_CALLBACK (remove_child), toplevel);
- l = l->next;
- }
- }
-
- g_type_class_ref (GTK_TYPE_WINDOW);
-
- signal_id = g_signal_lookup ("show", GTK_TYPE_WINDOW);
- g_signal_add_emission_hook (signal_id, 0,
- show_event_watcher, toplevel, (GDestroyNotify) NULL);
-
- signal_id = g_signal_lookup ("hide", GTK_TYPE_WINDOW);
- g_signal_add_emission_hook (signal_id, 0,
- hide_event_watcher, toplevel, (GDestroyNotify) NULL);
-}
-
-/**
- * gtk_toplevel_accessible_get_children:
- *
- * Returns: (transfer none) (element-type Gtk.Window): List of
- * children.
- */
-GList *
-gtk_toplevel_accessible_get_children (GtkToplevelAccessible *accessible)
-{
- return accessible->priv->window_list;
-}
diff --git a/gtk/a11y/gtktoplevelaccessible.h b/gtk/a11y/gtktoplevelaccessible.h
deleted file mode 100644
index 9c782b8a75..0000000000
--- a/gtk/a11y/gtktoplevelaccessible.h
+++ /dev/null
@@ -1,59 +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 .
- */
-
-#ifndef __GTK_TOPLEVEL_ACCESSIBLE_H__
-#define __GTK_TOPLEVEL_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_TOPLEVEL_ACCESSIBLE (gtk_toplevel_accessible_get_type ())
-#define GTK_TOPLEVEL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOPLEVEL_ACCESSIBLE, GtkToplevelAccessible))
-#define GTK_TOPLEVEL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOPLEVEL_ACCESSIBLE, GtkToplevelAccessibleClass))
-#define GTK_IS_TOPLEVEL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOPLEVEL_ACCESSIBLE))
-#define GTK_IS_TOPLEVEL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOPLEVEL_ACCESSIBLE))
-#define GTK_TOPLEVEL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOPLEVEL_ACCESSIBLE, GtkToplevelAccessibleClass))
-
-typedef struct _GtkToplevelAccessible GtkToplevelAccessible;
-typedef struct _GtkToplevelAccessibleClass GtkToplevelAccessibleClass;
-typedef struct _GtkToplevelAccessiblePrivate GtkToplevelAccessiblePrivate;
-
-struct _GtkToplevelAccessible
-{
- AtkObject parent;
-
- GtkToplevelAccessiblePrivate *priv;
-};
-
-struct _GtkToplevelAccessibleClass
-{
- AtkObjectClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_toplevel_accessible_get_type (void);
-GDK_AVAILABLE_IN_ALL
-GList *gtk_toplevel_accessible_get_children (GtkToplevelAccessible *accessible);
-
-G_END_DECLS
-
-#endif /* __GTK_TOPLEVEL_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
deleted file mode 100644
index 3ea1daca19..0000000000
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ /dev/null
@@ -1,2084 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 "gtktreeprivate.h"
-#include "gtkwidgetprivate.h"
-
-#include "gtktreeviewaccessibleprivate.h"
-
-#include "gtkrenderercellaccessible.h"
-#include "gtkbooleancellaccessible.h"
-#include "gtkimagecellaccessible.h"
-#include "gtkcontainercellaccessible.h"
-#include "gtktextcellaccessible.h"
-#include "gtkcellaccessibleparent.h"
-#include "gtkcellaccessibleprivate.h"
-
-typedef struct
-{
- GHashTable *cell_infos;
-} GtkTreeViewAccessiblePrivate;
-
-typedef struct _GtkTreeViewAccessibleCellInfo GtkTreeViewAccessibleCellInfo;
-struct _GtkTreeViewAccessibleCellInfo
-{
- GtkCellAccessible *cell;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
- GtkTreeViewColumn *cell_col_ref;
- GtkTreeViewAccessible *view;
-};
-
-/* Misc */
-
-static int cell_info_get_index (GtkTreeView *tree_view,
- GtkTreeViewAccessibleCellInfo *info);
-static gboolean is_cell_showing (GtkTreeView *tree_view,
- GdkRectangle *cell_rect);
-
-static void cell_info_new (GtkTreeViewAccessible *accessible,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkTreeViewColumn *tv_col,
- GtkCellAccessible *cell);
-static gint get_column_number (GtkTreeView *tree_view,
- GtkTreeViewColumn *column);
-
-static gboolean get_rbtree_column_from_index (GtkTreeView *tree_view,
- gint index,
- GtkTreeRBTree **tree,
- GtkTreeRBNode **node,
- GtkTreeViewColumn **column);
-
-static GtkTreeViewAccessibleCellInfo* find_cell_info (GtkTreeViewAccessible *view,
- GtkCellAccessible *cell);
-static AtkObject * get_header_from_column (GtkTreeViewColumn *tv_col);
-
-
-static void atk_table_interface_init (AtkTableIface *iface);
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkTreeViewAccessible, gtk_tree_view_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
- G_ADD_PRIVATE (GtkTreeViewAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE, atk_table_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_ACCESSIBLE_PARENT, gtk_cell_accessible_parent_interface_init))
-
-
-static GQuark
-gtk_tree_view_accessible_get_data_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("gtk-tree-view-accessible-data");
-
- return quark;
-}
-
-static void
-cell_info_free (GtkTreeViewAccessibleCellInfo *cell_info)
-{
- gtk_accessible_set_widget (GTK_ACCESSIBLE (cell_info->cell), NULL);
- g_object_unref (cell_info->cell);
-
- g_free (cell_info);
-}
-
-static GtkTreePath *
-cell_info_get_path (GtkTreeViewAccessibleCellInfo *cell_info)
-{
- return _gtk_tree_path_new_from_rbtree (cell_info->tree, cell_info->node);
-}
-
-static guint
-cell_info_hash (gconstpointer info)
-{
- const GtkTreeViewAccessibleCellInfo *cell_info = info;
- guint node, col;
-
- node = GPOINTER_TO_UINT (cell_info->node);
- col = GPOINTER_TO_UINT (cell_info->cell_col_ref);
-
- return ((node << sizeof (guint) / 2) | (node >> sizeof (guint) / 2)) ^ col;
-}
-
-static gboolean
-cell_info_equal (gconstpointer a, gconstpointer b)
-{
- const GtkTreeViewAccessibleCellInfo *cell_info_a = a;
- const GtkTreeViewAccessibleCellInfo *cell_info_b = b;
-
- return cell_info_a->node == cell_info_b->node &&
- cell_info_a->cell_col_ref == cell_info_b->cell_col_ref;
-}
-
-static void
-gtk_tree_view_accessible_initialize (AtkObject *obj,
- gpointer data)
-{
- GtkTreeViewAccessible *self = GTK_TREE_VIEW_ACCESSIBLE (obj);
- GtkTreeViewAccessiblePrivate *priv = gtk_tree_view_accessible_get_instance_private (self);
- GtkTreeView *tree_view = data;
- GtkTreeModel *tree_model;
-
- ATK_OBJECT_CLASS (gtk_tree_view_accessible_parent_class)->initialize (obj, data);
-
- priv->cell_infos = g_hash_table_new_full (cell_info_hash, cell_info_equal,
- NULL,
- (GDestroyNotify) cell_info_free);
-
- tree_model = gtk_tree_view_get_model (tree_view);
-
- if (tree_model != NULL)
- {
- AtkRole role;
-
- if ((gtk_tree_model_get_flags (tree_model) & GTK_TREE_MODEL_LIST_ONLY) != 0)
- role = ATK_ROLE_TABLE;
- else
- role = ATK_ROLE_TREE_TABLE;
-
- atk_object_set_role (obj, role);
- }
-}
-
-static void
-gtk_tree_view_accessible_finalize (GObject *object)
-{
- GtkTreeViewAccessible *self = GTK_TREE_VIEW_ACCESSIBLE (object);
- GtkTreeViewAccessiblePrivate *priv = gtk_tree_view_accessible_get_instance_private (self);
-
- g_clear_pointer (&priv->cell_infos, g_hash_table_unref);
-
- G_OBJECT_CLASS (gtk_tree_view_accessible_parent_class)->finalize (object);
-}
-
-void
-gtk_tree_view_accessible_update_model (GtkTreeViewAccessible *self,
- GtkTreeModel *model)
-{
- GtkTreeViewAccessiblePrivate *priv = gtk_tree_view_accessible_get_instance_private (self);
-
- g_return_if_fail (GTK_IS_TREE_VIEW_ACCESSIBLE (self));
- g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
-
- g_hash_table_remove_all (priv->cell_infos);
-
- if (model != NULL)
- {
- AtkObject *object = ATK_OBJECT (self);
- AtkRole role;
-
- if ((gtk_tree_model_get_flags (model) & GTK_TREE_MODEL_LIST_ONLY) != 0)
- role = ATK_ROLE_TABLE;
- else
- role = ATK_ROLE_TREE_TABLE;
-
- atk_object_set_role (object, role);
-
- g_object_freeze_notify (G_OBJECT (self));
- g_signal_emit_by_name (self, "model-changed");
- g_signal_emit_by_name (self, "visible-data-changed");
- g_object_thaw_notify (G_OBJECT (self));
- }
-}
-
-static void
-gtk_tree_view_accessible_widget_unset (GtkAccessible *gtkaccessible)
-{
- GtkTreeViewAccessible *self = GTK_TREE_VIEW_ACCESSIBLE (gtkaccessible);
- GtkTreeViewAccessiblePrivate *priv = gtk_tree_view_accessible_get_instance_private (self);
-
- g_hash_table_remove_all (priv->cell_infos);
-
- GTK_ACCESSIBLE_CLASS (gtk_tree_view_accessible_parent_class)->widget_unset (gtkaccessible);
-}
-
-static gint
-get_n_rows (GtkTreeView *tree_view)
-{
- GtkTreeRBTree *tree;
-
- tree = _gtk_tree_view_get_rbtree (tree_view);
-
- if (tree == NULL)
- return 0;
-
- return tree->root->total_count;
-}
-
-static gint
-get_n_columns (GtkTreeView *tree_view)
-{
- guint i, visible_columns;
-
- visible_columns = 0;
-
- for (i = 0; i < gtk_tree_view_get_n_columns (tree_view); i++)
- {
- GtkTreeViewColumn *column = gtk_tree_view_get_column (tree_view, i);
-
- if (gtk_tree_view_column_get_visible (column))
- visible_columns++;
- }
-
- return visible_columns;
-}
-
-static gint
-gtk_tree_view_accessible_get_n_children (AtkObject *obj)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return 0;
-
- tree_view = GTK_TREE_VIEW (widget);
- return (get_n_rows (tree_view) + 1) * get_n_columns (tree_view);
-}
-
-static GtkTreeViewColumn *
-get_visible_column (GtkTreeView *tree_view,
- guint id)
-{
- guint i;
-
- for (i = 0; i < gtk_tree_view_get_n_columns (tree_view); i++)
- {
- GtkTreeViewColumn *column = gtk_tree_view_get_column (tree_view, i);
-
- if (!gtk_tree_view_column_get_visible (column))
- continue;
-
- if (id == 0)
- return column;
-
- id--;
- }
-
- g_return_val_if_reached (NULL);
-}
-
-static void
-set_cell_data (GtkTreeView *treeview,
- GtkTreeViewAccessible *accessible,
- GtkCellAccessible *cell)
-{
- GtkTreeViewAccessibleCellInfo *cell_info;
- gboolean is_expander, is_expanded;
- GtkTreeModel *model;
- GtkTreeIter iter;
- GtkTreePath *path;
-
- cell_info = find_cell_info (accessible, cell);
- if (!cell_info)
- return;
-
- model = gtk_tree_view_get_model (treeview);
-
- if (GTK_TREE_RBNODE_FLAG_SET (cell_info->node, GTK_TREE_RBNODE_IS_PARENT) &&
- cell_info->cell_col_ref == gtk_tree_view_get_expander_column (treeview))
- {
- is_expander = TRUE;
- is_expanded = cell_info->node->children != NULL;
- }
- else
- {
- is_expander = FALSE;
- is_expanded = FALSE;
- }
-
- path = cell_info_get_path (cell_info);
- if (path == NULL ||
- !gtk_tree_model_get_iter (model, &iter, path))
- {
- /* We only track valid cells, this should never happen */
- g_return_if_reached ();
- }
- gtk_tree_path_free (path);
-
- gtk_tree_view_column_cell_set_cell_data (cell_info->cell_col_ref,
- model,
- &iter,
- is_expander,
- is_expanded);
-}
-
-static GtkCellAccessible *
-peek_cell (GtkTreeViewAccessible *self,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkTreeViewColumn *column)
-{
- GtkTreeViewAccessiblePrivate *priv = gtk_tree_view_accessible_get_instance_private (self);
- GtkTreeViewAccessibleCellInfo lookup, *cell_info;
-
- lookup.tree = tree;
- lookup.node = node;
- lookup.cell_col_ref = column;
-
- cell_info = g_hash_table_lookup (priv->cell_infos, &lookup);
- if (cell_info == NULL)
- return NULL;
-
- return cell_info->cell;
-}
-
-static GtkCellAccessible *
-create_cell_accessible_for_renderer (GtkCellRenderer *renderer,
- GtkWidget *widget,
- AtkObject *parent)
-{
- GtkCellAccessible *cell;
-
- cell = GTK_CELL_ACCESSIBLE (gtk_renderer_cell_accessible_new (renderer));
-
- _gtk_cell_accessible_initialize (cell, widget, parent);
-
- return cell;
-}
-
-static GtkCellAccessible *
-create_cell_accessible (GtkTreeView *treeview,
- GtkTreeViewAccessible *accessible,
- GtkTreeViewColumn *column)
-{
- GList *renderer_list;
- GList *l;
- GtkCellAccessible *cell;
-
- renderer_list = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
-
- /* If there is exactly one renderer in the list (which is a
- * common case), shortcut and don't make a container
- */
- if (g_list_length (renderer_list) == 1)
- {
- cell = create_cell_accessible_for_renderer (renderer_list->data, GTK_WIDGET (treeview), ATK_OBJECT (accessible));
- }
- else
- {
- GtkContainerCellAccessible *container;
-
- container = gtk_container_cell_accessible_new ();
- _gtk_cell_accessible_initialize (GTK_CELL_ACCESSIBLE (container), GTK_WIDGET (treeview), ATK_OBJECT (accessible));
-
- for (l = renderer_list; l; l = l->next)
- {
- cell = create_cell_accessible_for_renderer (l->data, GTK_WIDGET (treeview), ATK_OBJECT (container));
- gtk_container_cell_accessible_add_child (container, cell);
- }
-
- cell = GTK_CELL_ACCESSIBLE (container);
- }
-
- g_list_free (renderer_list);
-
- return cell;
-}
-
-static GtkCellAccessible *
-create_cell (GtkTreeView *treeview,
- GtkTreeViewAccessible *accessible,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkTreeViewColumn *column)
-{
- GtkCellAccessible *cell;
-
- cell = create_cell_accessible (treeview, accessible, column);
- cell_info_new (accessible, tree, node, column, cell);
-
- set_cell_data (treeview, accessible, cell);
- _gtk_cell_accessible_update_cache (cell, FALSE);
-
- return cell;
-}
-
-static AtkObject *
-gtk_tree_view_accessible_ref_child (AtkObject *obj,
- gint i)
-{
- GtkWidget *widget;
- GtkTreeViewAccessible *accessible;
- GtkCellAccessible *cell;
- GtkTreeView *tree_view;
- GtkTreeViewColumn *tv_col;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
- AtkObject *child;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- if (i >= gtk_tree_view_accessible_get_n_children (obj))
- return NULL;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
- tree_view = GTK_TREE_VIEW (widget);
- if (i < get_n_columns (tree_view))
- {
- tv_col = get_visible_column (tree_view, i);
- child = get_header_from_column (tv_col);
- if (child)
- g_object_ref (child);
- return child;
- }
-
- /* Find the RBTree and GtkTreeViewColumn for the index */
- if (!get_rbtree_column_from_index (tree_view, i, &tree, &node, &tv_col))
- return NULL;
-
- cell = peek_cell (accessible, tree, node, tv_col);
- if (cell == NULL)
- cell = create_cell (tree_view, accessible, tree, node, tv_col);
-
- return (AtkObject *) g_object_ref (cell);
-}
-
-static AtkStateSet*
-gtk_tree_view_accessible_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gtk_tree_view_accessible_parent_class)->ref_state_set (obj);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- if (widget != NULL)
- atk_state_set_add_state (state_set, ATK_STATE_MANAGES_DESCENDANTS);
-
- return state_set;
-}
-
-static void
-gtk_tree_view_accessible_class_init (GtkTreeViewAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkAccessibleClass *accessible_class = (GtkAccessibleClass*)klass;
-
- class->get_n_children = gtk_tree_view_accessible_get_n_children;
- class->ref_child = gtk_tree_view_accessible_ref_child;
- class->ref_state_set = gtk_tree_view_accessible_ref_state_set;
- class->initialize = gtk_tree_view_accessible_initialize;
-
- accessible_class->widget_unset = gtk_tree_view_accessible_widget_unset;
-
- gobject_class->finalize = gtk_tree_view_accessible_finalize;
-}
-
-static void
-gtk_tree_view_accessible_init (GtkTreeViewAccessible *view)
-{
-}
-
-/* atkcomponent.h */
-
-static AtkObject *
-gtk_tree_view_accessible_ref_accessible_at_point (AtkComponent *component,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreePath *path;
- GtkTreeViewColumn *column;
- gint x_pos, y_pos;
- gint bx, by;
- GtkCellAccessible *cell;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
- if (widget == NULL)
- return NULL;
-
- tree_view = GTK_TREE_VIEW (widget);
-
- atk_component_get_extents (component, &x_pos, &y_pos, NULL, NULL, coord_type);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &bx, &by);
- if (!gtk_tree_view_get_path_at_pos (tree_view,
- bx - x_pos, by - y_pos,
- &path, &column, NULL, NULL))
- return NULL;
-
- if (_gtk_tree_view_find_node (tree_view, path, &tree, &node))
- {
- gtk_tree_path_free (path);
- return NULL;
- }
-
- cell = peek_cell (GTK_TREE_VIEW_ACCESSIBLE (component), tree, node, column);
- if (cell == NULL)
- cell = create_cell (tree_view, GTK_TREE_VIEW_ACCESSIBLE (component), tree, node, column);
-
- return (AtkObject *) g_object_ref (cell);
-}
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- iface->ref_accessible_at_point = gtk_tree_view_accessible_ref_accessible_at_point;
-}
-
-/* atktable.h */
-
-static gint
-gtk_tree_view_accessible_get_index_at (AtkTable *table,
- gint row,
- gint column)
-{
- GtkWidget *widget;
- gint n_cols, n_rows;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return -1;
-
- n_cols = atk_table_get_n_columns (table);
- n_rows = atk_table_get_n_rows (table);
-
- if (row >= n_rows || column >= n_cols)
- return -1;
-
- return (row + 1) * n_cols + column;
-}
-
-static gint
-gtk_tree_view_accessible_get_column_at_index (AtkTable *table,
- gint index)
-{
- GtkWidget *widget;
- gint n_columns;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return -1;
-
- if (index >= gtk_tree_view_accessible_get_n_children (ATK_OBJECT (table)))
- return -1;
-
- n_columns = get_n_columns (GTK_TREE_VIEW (widget));
-
- /* checked by the n_children() check above */
- g_assert (n_columns > 0);
-
- return index % n_columns;
-}
-
-static gint
-gtk_tree_view_accessible_get_row_at_index (AtkTable *table,
- gint index)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return -1;
-
- tree_view = GTK_TREE_VIEW (widget);
-
- index /= get_n_columns (tree_view);
- index--;
- if (index >= get_n_rows (tree_view))
- return -1;
-
- return index;
-}
-
-static AtkObject *
-gtk_tree_view_accessible_table_ref_at (AtkTable *table,
- gint row,
- gint column)
-{
- gint index;
-
- index = gtk_tree_view_accessible_get_index_at (table, row, column);
- if (index == -1)
- return NULL;
-
- return gtk_tree_view_accessible_ref_child (ATK_OBJECT (table), index);
-}
-
-static gint
-gtk_tree_view_accessible_get_n_rows (AtkTable *table)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return 0;
-
- return get_n_rows (GTK_TREE_VIEW (widget));
-}
-
-static gint
-gtk_tree_view_accessible_get_n_columns (AtkTable *table)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return 0;
-
- return get_n_columns (GTK_TREE_VIEW (widget));
-}
-
-static gboolean
-gtk_tree_view_accessible_is_row_selected (AtkTable *table,
- gint row)
-{
- GtkWidget *widget;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
-
- if (row < 0)
- return FALSE;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return FALSE;
-
- if (!gtk_tree_rbtree_find_index (_gtk_tree_view_get_rbtree (GTK_TREE_VIEW (widget)),
- row,
- &tree,
- &node))
- return FALSE;
-
- return GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_SELECTED);
-}
-
-static gboolean
-gtk_tree_view_accessible_is_selected (AtkTable *table,
- gint row,
- gint column)
-{
- return gtk_tree_view_accessible_is_row_selected (table, row);
-}
-
-typedef struct {
- GArray *array;
- GtkTreeView *treeview;
-} SelectedRowsData;
-
-static void
-get_selected_rows (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer datap)
-{
- SelectedRowsData *data = datap;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
- int id;
-
- if (_gtk_tree_view_find_node (data->treeview,
- path,
- &tree, &node))
- {
- g_assert_not_reached ();
- }
-
- id = gtk_tree_rbtree_node_get_index (tree, node);
-
- g_array_append_val (data->array, id);
-}
-
-static gint
-gtk_tree_view_accessible_get_selected_rows (AtkTable *table,
- gint **rows_selected)
-{
- SelectedRowsData data;
- GtkWidget *widget;
- gint n_rows;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- {
- if (rows_selected != NULL)
- *rows_selected = NULL;
- return 0;
- }
-
- data.treeview = GTK_TREE_VIEW (widget);
- data.array = g_array_new (FALSE, FALSE, sizeof (gint));
-
- gtk_tree_selection_selected_foreach (gtk_tree_view_get_selection (data.treeview),
- get_selected_rows,
- &data);
-
- n_rows = data.array->len;
- if (rows_selected)
- *rows_selected = (gint *) g_array_free (data.array, FALSE);
- else
- g_array_free (data.array, TRUE);
-
- return n_rows;
-}
-
-static gboolean
-gtk_tree_view_accessible_add_row_selection (AtkTable *table,
- gint row)
-{
- GtkTreeView *treeview;
- GtkTreePath *path;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
-
- if (row < 0)
- return FALSE;
-
- treeview = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (table)));
- if (treeview == NULL)
- return FALSE;
-
- if (!gtk_tree_rbtree_find_index (_gtk_tree_view_get_rbtree (treeview),
- row,
- &tree,
- &node))
- return FALSE;
-
- if (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_SELECTED))
- return FALSE;
-
- path = _gtk_tree_path_new_from_rbtree (tree, node);
- gtk_tree_selection_select_path (gtk_tree_view_get_selection (treeview), path);
- gtk_tree_path_free (path);
-
- return TRUE;
-}
-
-static gboolean
-gtk_tree_view_accessible_remove_row_selection (AtkTable *table,
- gint row)
-{
- GtkTreeView *treeview;
- GtkTreePath *path;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
-
- if (row < 0)
- return FALSE;
-
- treeview = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (table)));
- if (treeview == NULL)
- return FALSE;
-
- if (!gtk_tree_rbtree_find_index (_gtk_tree_view_get_rbtree (treeview),
- row,
- &tree,
- &node))
- return FALSE;
-
- if (!GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_SELECTED))
- return FALSE;
-
- path = _gtk_tree_path_new_from_rbtree (tree, node);
- gtk_tree_selection_unselect_path (gtk_tree_view_get_selection (treeview), path);
- gtk_tree_path_free (path);
-
- return TRUE;
-}
-
-static AtkObject *
-gtk_tree_view_accessible_get_column_header (AtkTable *table,
- gint in_col)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreeViewColumn *tv_col;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return NULL;
-
- tree_view = GTK_TREE_VIEW (widget);
- if (in_col < 0 || in_col >= get_n_columns (tree_view))
- return NULL;
-
- tv_col = get_visible_column (tree_view, in_col);
- return get_header_from_column (tv_col);
-}
-
-static const gchar *
-gtk_tree_view_accessible_get_column_description (AtkTable *table,
- gint in_col)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreeViewColumn *tv_col;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
- if (widget == NULL)
- return NULL;
-
- tree_view = GTK_TREE_VIEW (widget);
- if (in_col < 0 || in_col >= get_n_columns (tree_view))
- return NULL;
-
- tv_col = get_visible_column (tree_view, in_col);
- return gtk_tree_view_column_get_title (tv_col);
-}
-
-static void
-atk_table_interface_init (AtkTableIface *iface)
-{
- iface->ref_at = gtk_tree_view_accessible_table_ref_at;
- iface->get_n_rows = gtk_tree_view_accessible_get_n_rows;
- iface->get_n_columns = gtk_tree_view_accessible_get_n_columns;
- iface->get_index_at = gtk_tree_view_accessible_get_index_at;
- iface->get_column_at_index = gtk_tree_view_accessible_get_column_at_index;
- iface->get_row_at_index = gtk_tree_view_accessible_get_row_at_index;
- iface->is_row_selected = gtk_tree_view_accessible_is_row_selected;
- iface->is_selected = gtk_tree_view_accessible_is_selected;
- iface->get_selected_rows = gtk_tree_view_accessible_get_selected_rows;
- iface->add_row_selection = gtk_tree_view_accessible_add_row_selection;
- iface->remove_row_selection = gtk_tree_view_accessible_remove_row_selection;
- iface->get_column_extent_at = NULL;
- iface->get_row_extent_at = NULL;
- iface->get_column_header = gtk_tree_view_accessible_get_column_header;
- iface->get_column_description = gtk_tree_view_accessible_get_column_description;
-}
-
-/* atkselection.h */
-
-static gboolean
-gtk_tree_view_accessible_add_selection (AtkSelection *selection,
- gint i)
-{
- AtkTable *table;
- gint n_columns;
- gint row;
-
- table = ATK_TABLE (selection);
- n_columns = gtk_tree_view_accessible_get_n_columns (table);
- if (n_columns != 1)
- return FALSE;
-
- row = gtk_tree_view_accessible_get_row_at_index (table, i);
- return gtk_tree_view_accessible_add_row_selection (table, row);
-}
-
-static gboolean
-gtk_tree_view_accessible_clear_selection (AtkSelection *selection)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreeSelection *tree_selection;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- tree_view = GTK_TREE_VIEW (widget);
- tree_selection = gtk_tree_view_get_selection (tree_view);
-
- gtk_tree_selection_unselect_all (tree_selection);
- return TRUE;
-}
-
-static AtkObject *
-gtk_tree_view_accessible_ref_selection (AtkSelection *selection,
- gint i)
-{
- AtkTable *table;
- gint row;
- gint n_selected;
- gint n_columns;
- gint *selected;
-
- table = ATK_TABLE (selection);
- n_columns = gtk_tree_view_accessible_get_n_columns (table);
- n_selected = gtk_tree_view_accessible_get_selected_rows (table, &selected);
- if (n_columns == 0 || i >= n_columns * n_selected)
- return NULL;
-
- row = selected[i / n_columns];
- g_free (selected);
-
- return gtk_tree_view_accessible_table_ref_at (table, row, i % n_columns);
-}
-
-static gint
-gtk_tree_view_accessible_get_selection_count (AtkSelection *selection)
-{
- AtkTable *table;
- gint n_selected;
-
- table = ATK_TABLE (selection);
- n_selected = gtk_tree_view_accessible_get_selected_rows (table, NULL);
- if (n_selected > 0)
- n_selected *= gtk_tree_view_accessible_get_n_columns (table);
- return n_selected;
-}
-
-static gboolean
-gtk_tree_view_accessible_is_child_selected (AtkSelection *selection,
- gint i)
-{
- GtkWidget *widget;
- gint row;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
- if (widget == NULL)
- return FALSE;
-
- row = gtk_tree_view_accessible_get_row_at_index (ATK_TABLE (selection), i);
-
- return gtk_tree_view_accessible_is_row_selected (ATK_TABLE (selection), row);
-}
-
-static void atk_selection_interface_init (AtkSelectionIface *iface)
-{
- iface->add_selection = gtk_tree_view_accessible_add_selection;
- iface->clear_selection = gtk_tree_view_accessible_clear_selection;
- iface->ref_selection = gtk_tree_view_accessible_ref_selection;
- iface->get_selection_count = gtk_tree_view_accessible_get_selection_count;
- iface->is_child_selected = gtk_tree_view_accessible_is_child_selected;
-}
-
-#define EXTRA_EXPANDER_PADDING 4
-
-static void
-gtk_tree_view_accessible_get_cell_area (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- GdkRectangle *cell_rect)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreeViewColumn *tv_col;
- GtkTreePath *path;
- AtkObject *parent_cell;
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkCellAccessible *top_cell;
-
- /* Default value. */
- cell_rect->x = 0;
- cell_rect->y = 0;
- cell_rect->width = 0;
- cell_rect->height = 0;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- if (widget == NULL)
- return;
-
- tree_view = GTK_TREE_VIEW (widget);
- parent_cell = atk_object_get_parent (ATK_OBJECT (cell));
- if (parent_cell != ATK_OBJECT (parent))
- top_cell = GTK_CELL_ACCESSIBLE (parent_cell);
- else
- top_cell = cell;
- cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), top_cell);
- if (!cell_info)
- return;
- path = cell_info_get_path (cell_info);
- tv_col = cell_info->cell_col_ref;
- if (path)
- {
- GtkTreeViewColumn *expander_column;
-
- gtk_tree_view_get_cell_area (tree_view, path, tv_col, cell_rect);
- expander_column = gtk_tree_view_get_expander_column (tree_view);
- if (expander_column == tv_col)
- {
- /* Values from gtktreeview.c ... */
-#define _TREE_VIEW_EXPANDER_SIZE 16
-#define _TREE_VIEW_HORIZONTAL_SEPARATOR 4
- gint expander_size = _TREE_VIEW_EXPANDER_SIZE + (_TREE_VIEW_HORIZONTAL_SEPARATOR / 2);
- cell_rect->x += expander_size + EXTRA_EXPANDER_PADDING;
- cell_rect->width -= expander_size + EXTRA_EXPANDER_PADDING;
- }
-
- gtk_tree_path_free (path);
-
- /* A column has more than one renderer so we find the position
- * and width of each
- */
- if (top_cell != cell)
- {
- gint cell_index;
- gboolean found;
- gint cell_start;
- gint cell_width;
- GList *renderers;
- GtkCellRenderer *renderer;
-
- cell_index = atk_object_get_index_in_parent (ATK_OBJECT (cell));
- renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tv_col));
- renderer = g_list_nth_data (renderers, cell_index);
-
- found = gtk_tree_view_column_cell_get_position (tv_col, renderer, &cell_start, &cell_width);
- if (found)
- {
- cell_rect->x += cell_start;
- cell_rect->width = cell_width;
- }
- g_list_free (renderers);
- }
-
- }
-}
-
-static void
-gtk_tree_view_accessible_get_cell_extents (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GdkRectangle cell_rect;
- gint w_x, w_y;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- if (widget == NULL)
- return;
-
- tree_view = GTK_TREE_VIEW (widget);
- gtk_tree_view_accessible_get_cell_area (parent, cell, &cell_rect);
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view,
- 0, 0,
- &w_x, &w_y);
-
- *width = cell_rect.width;
- *height = cell_rect.height;
- if (is_cell_showing (tree_view, &cell_rect))
- {
- *x = cell_rect.x + w_x;
- *y = cell_rect.y + w_y;
- }
- else
- {
- *x = G_MININT;
- *y = G_MININT;
- }
-}
-
-static gboolean
-gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreeViewColumn *tv_col;
- GtkTreePath *path;
- AtkObject *parent_cell;
- AtkObject *cell_object;
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkCellRenderer *renderer = NULL;
- GtkWidget *toplevel;
- gint index;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- if (widget == NULL)
- return FALSE;
-
- tree_view = GTK_TREE_VIEW (widget);
-
- cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), cell);
- if (!cell_info)
- return FALSE;
- cell_object = ATK_OBJECT (cell);
- parent_cell = atk_object_get_parent (cell_object);
- tv_col = cell_info->cell_col_ref;
- if (parent_cell != ATK_OBJECT (parent))
- {
- /* GtkCellAccessible is in a GtkContainerCellAccessible.
- * The GtkTreeViewColumn has multiple renderers;
- * find the corresponding one.
- */
- GList *renderers;
-
- renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tv_col));
- index = atk_object_get_index_in_parent (cell_object);
- renderer = g_list_nth_data (renderers, index);
- g_list_free (renderers);
- }
- path = cell_info_get_path (cell_info);
- if (path)
- {
- if (renderer)
- gtk_tree_view_set_cursor_on_cell (tree_view, path, tv_col, renderer, FALSE);
- else
- gtk_tree_view_set_cursor (tree_view, path, tv_col, FALSE);
-
- gtk_tree_path_free (path);
- gtk_widget_grab_focus (widget);
- toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
- if (GTK_IS_WINDOW (toplevel))
- {
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_window_present (GTK_WINDOW (toplevel));
- G_GNUC_END_IGNORE_DEPRECATIONS
- }
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static int
-gtk_tree_view_accessible_get_child_index (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkTreeView *tree_view;
-
- cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), cell);
- if (!cell_info)
- return -1;
-
- tree_view = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
-
- return cell_info_get_index (tree_view, cell_info);
-}
-
-static GtkCellRendererState
-gtk_tree_view_accessible_get_renderer_state (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkTreeView *treeview;
- GtkCellRendererState flags;
-
- cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), cell);
- if (!cell_info)
- return 0;
-
- flags = 0;
-
- if (GTK_TREE_RBNODE_FLAG_SET (cell_info->node, GTK_TREE_RBNODE_IS_SELECTED))
- flags |= GTK_CELL_RENDERER_SELECTED;
-
- if (GTK_TREE_RBNODE_FLAG_SET (cell_info->node, GTK_TREE_RBNODE_IS_PRELIT))
- flags |= GTK_CELL_RENDERER_PRELIT;
-
- if (gtk_tree_view_column_get_sort_indicator (cell_info->cell_col_ref))
- flags |= GTK_CELL_RENDERER_SORTED;
-
- treeview = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
-
- if (cell_info->cell_col_ref == gtk_tree_view_get_expander_column (treeview))
- {
- if (GTK_TREE_RBNODE_FLAG_SET (cell_info->node, GTK_TREE_RBNODE_IS_PARENT))
- flags |= GTK_CELL_RENDERER_EXPANDABLE;
-
- if (cell_info->node->children)
- flags |= GTK_CELL_RENDERER_EXPANDED;
- }
-
- if (gtk_widget_has_focus (GTK_WIDGET (treeview)))
- {
- GtkTreeViewColumn *column;
- GtkTreePath *path;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node = NULL;
-
- gtk_tree_view_get_cursor (treeview, &path, &column);
- if (path)
- {
- _gtk_tree_view_find_node (treeview, path, &tree, &node);
- gtk_tree_path_free (path);
- }
- else
- tree = NULL;
-
- if (cell_info->cell_col_ref == column
- && cell_info->tree == tree
- && cell_info->node == node)
- flags |= GTK_CELL_RENDERER_FOCUSED;
- }
-
- return flags;
-}
-
-static void
-gtk_tree_view_accessible_expand_collapse (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkTreeView *treeview;
- GtkTreePath *path;
-
- treeview = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
-
- cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), cell);
- if (!cell_info ||
- cell_info->cell_col_ref != gtk_tree_view_get_expander_column (treeview))
- return;
-
- path = cell_info_get_path (cell_info);
-
- if (cell_info->node->children)
- gtk_tree_view_collapse_row (treeview, path);
- else
- gtk_tree_view_expand_row (treeview, path, FALSE);
-
- gtk_tree_path_free (path);
-}
-
-static void
-gtk_tree_view_accessible_activate (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkTreeView *treeview;
- GtkTreePath *path;
-
- treeview = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
-
- cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), cell);
- if (!cell_info)
- return;
-
- path = cell_info_get_path (cell_info);
-
- gtk_tree_view_row_activated (treeview, path, cell_info->cell_col_ref);
-
- gtk_tree_path_free (path);
-}
-
-static void
-gtk_tree_view_accessible_edit (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkTreeView *treeview;
-
- if (!gtk_tree_view_accessible_grab_cell_focus (parent, cell))
- return;
-
- treeview = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
-
- g_signal_emit_by_name (treeview,
- "real-select-cursor-row",
- TRUE);
-}
-
-static void
-gtk_tree_view_accessible_update_relationset (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- AtkRelationSet *relationset)
-{
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkTreeViewAccessible *accessible;
- GtkTreeViewColumn *column;
- GtkTreeView *treeview;
- AtkRelation *relation;
- GtkTreeRBTree *tree;
- GtkTreeRBNode *node;
- AtkObject *object;
-
- /* Don't set relations on cells that aren't direct descendants of the treeview.
- * So only set it on the container, not on the renderer accessibles */
- if (atk_object_get_parent (ATK_OBJECT (cell)) != ATK_OBJECT (parent))
- return;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (parent);
- cell_info = find_cell_info (accessible, cell);
- if (!cell_info)
- return;
-
- /* only set parent/child rows on the expander column */
- treeview = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent)));
- column = gtk_tree_view_get_expander_column (treeview);
- if (column != cell_info->cell_col_ref)
- return;
-
- /* Update CHILD_OF relation to parent cell */
- relation = atk_relation_set_get_relation_by_type (relationset, ATK_RELATION_NODE_CHILD_OF);
- if (relation)
- atk_relation_set_remove (relationset, relation);
-
- if (cell_info->tree->parent_tree)
- {
- object = ATK_OBJECT (peek_cell (accessible, cell_info->tree->parent_tree, cell_info->tree->parent_node, column));
- if (object == NULL)
- object = ATK_OBJECT (create_cell (treeview, accessible, cell_info->tree->parent_tree, cell_info->tree->parent_node, column));
- }
- else
- object = ATK_OBJECT (accessible);
-
- atk_relation_set_add_relation_by_type (relationset, ATK_RELATION_NODE_CHILD_OF, object);
-
- /* Update PARENT_OF relation for all child cells */
- relation = atk_relation_set_get_relation_by_type (relationset, ATK_RELATION_NODE_PARENT_OF);
- if (relation)
- atk_relation_set_remove (relationset, relation);
-
- tree = cell_info->node->children;
- if (tree)
- {
- for (node = gtk_tree_rbtree_first (tree);
- node != NULL;
- node = gtk_tree_rbtree_next (tree, node))
- {
- object = ATK_OBJECT (peek_cell (accessible, tree, node, column));
- if (object == NULL)
- object = ATK_OBJECT (create_cell (treeview, accessible, tree, node, column));
-
- atk_relation_set_add_relation_by_type (relationset, ATK_RELATION_NODE_PARENT_OF, ATK_OBJECT (object));
- }
- }
-}
-
-static void
-gtk_tree_view_accessible_get_cell_position (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell,
- gint *row,
- gint *column)
-{
- GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkTreeViewAccessible *accessible;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- if (widget == NULL)
- return;
-
- tree_view = GTK_TREE_VIEW (widget);
- accessible = GTK_TREE_VIEW_ACCESSIBLE (parent);
- cell_info = find_cell_info (accessible, cell);
- if (!cell_info)
- return;
-
- if (row)
- (*row) = gtk_tree_rbtree_node_get_index (cell_info->tree, cell_info->node);
- if (column)
- (*column) = get_column_number (tree_view, cell_info->cell_col_ref);
-}
-
-static GPtrArray *
-gtk_tree_view_accessible_get_column_header_cells (GtkCellAccessibleParent *parent,
- GtkCellAccessible *cell)
-{
- GtkWidget *widget;
- GtkTreeViewAccessibleCellInfo *cell_info;
- GtkTreeViewAccessible *accessible;
- GPtrArray *array;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
- if (widget == NULL)
- return NULL;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (parent);
- cell_info = find_cell_info (accessible, cell);
- if (!cell_info)
- return NULL;
-
- array = g_ptr_array_new_full (1, g_object_unref);
- g_ptr_array_add (array, g_object_ref (get_header_from_column ( (cell_info->cell_col_ref))));
- return array;
-}
-
-static void
-gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface)
-{
- iface->get_cell_extents = gtk_tree_view_accessible_get_cell_extents;
- iface->get_cell_area = gtk_tree_view_accessible_get_cell_area;
- iface->grab_focus = gtk_tree_view_accessible_grab_cell_focus;
- iface->get_child_index = gtk_tree_view_accessible_get_child_index;
- iface->get_renderer_state = gtk_tree_view_accessible_get_renderer_state;
- iface->expand_collapse = gtk_tree_view_accessible_expand_collapse;
- iface->activate = gtk_tree_view_accessible_activate;
- iface->edit = gtk_tree_view_accessible_edit;
- iface->update_relationset = gtk_tree_view_accessible_update_relationset;
- iface->get_cell_position = gtk_tree_view_accessible_get_cell_position;
- iface->get_column_header_cells = gtk_tree_view_accessible_get_column_header_cells;
-}
-
-void
-_gtk_tree_view_accessible_reorder (GtkTreeView *treeview)
-{
- GtkTreeViewAccessible *accessible;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (treeview)));
- if (accessible == NULL)
- return;
-
- g_signal_emit_by_name (accessible, "row-reordered");
-}
-
-static gboolean
-is_cell_showing (GtkTreeView *tree_view,
- GdkRectangle *cell_rect)
-{
- GdkRectangle rect, *visible_rect;
- GdkRectangle rect1, *tree_cell_rect;
- gint bx, by;
- gboolean is_showing;
-
- /* A cell is considered "SHOWING" if any part of the cell is
- * in the visible area. Other ways we could do this is by a
- * cell's midpoint or if the cell is fully in the visible range.
- * Since we have the cell_rect x, y, width, height of the cell,
- * any of these is easy to compute.
- *
- * It is assumed that cell's rectangle is in widget coordinates
- * so we must transform to tree cordinates.
- */
- visible_rect = ▭
- tree_cell_rect = &rect1;
- tree_cell_rect->x = cell_rect->x;
- tree_cell_rect->y = cell_rect->y;
- tree_cell_rect->width = cell_rect->width;
- tree_cell_rect->height = cell_rect->height;
-
- gtk_tree_view_get_visible_rect (tree_view, visible_rect);
- gtk_tree_view_convert_tree_to_bin_window_coords (tree_view, visible_rect->x,
- visible_rect->y, &bx, &by);
-
- if (((tree_cell_rect->x + tree_cell_rect->width) < bx) ||
- ((tree_cell_rect->y + tree_cell_rect->height) < by) ||
- (tree_cell_rect->x > (bx + visible_rect->width)) ||
- (tree_cell_rect->y > (by + visible_rect->height)))
- is_showing = FALSE;
- else
- is_showing = TRUE;
-
- return is_showing;
-}
-
-/* Misc Private */
-
-static int
-cell_info_get_index (GtkTreeView *tree_view,
- GtkTreeViewAccessibleCellInfo *info)
-{
- int index;
-
- index = gtk_tree_rbtree_node_get_index (info->tree, info->node) + 1;
- index *= get_n_columns (tree_view);
- index += get_column_number (tree_view, info->cell_col_ref);
-
- return index;
-}
-
-static void
-cell_info_new (GtkTreeViewAccessible *self,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkTreeViewColumn *tv_col,
- GtkCellAccessible *cell)
-{
- GtkTreeViewAccessiblePrivate *priv = gtk_tree_view_accessible_get_instance_private (self);
- GtkTreeViewAccessibleCellInfo *cell_info;
-
- cell_info = g_new (GtkTreeViewAccessibleCellInfo, 1);
-
- cell_info->view = self;
- cell_info->tree = tree;
- cell_info->node = node;
- cell_info->cell_col_ref = tv_col;
- cell_info->cell = cell;
-
- g_object_set_qdata (G_OBJECT (cell),
- gtk_tree_view_accessible_get_data_quark (),
- cell_info);
-
- g_hash_table_replace (priv->cell_infos, cell_info, cell_info);
-}
-
-/* Returns the column number of the specified GtkTreeViewColumn
- * The column must be visible.
- */
-static gint
-get_column_number (GtkTreeView *treeview,
- GtkTreeViewColumn *column)
-{
- GtkTreeViewColumn *cur;
- guint i, number;
-
- number = 0;
-
- for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
- {
- cur = gtk_tree_view_get_column (treeview, i);
-
- if (!gtk_tree_view_column_get_visible (cur))
- continue;
-
- if (cur == column)
- break;
-
- number++;
- }
-
- g_return_val_if_fail (i < gtk_tree_view_get_n_columns (treeview), 0);
-
- return number;
-}
-
-static gboolean
-get_rbtree_column_from_index (GtkTreeView *tree_view,
- gint index,
- GtkTreeRBTree **tree,
- GtkTreeRBNode **node,
- GtkTreeViewColumn **column)
-{
- guint n_columns = get_n_columns (tree_view);
-
- if (n_columns == 0)
- return FALSE;
- /* First row is the column headers */
- index -= n_columns;
- if (index < 0)
- return FALSE;
-
- if (tree)
- {
- g_return_val_if_fail (node != NULL, FALSE);
-
- if (!gtk_tree_rbtree_find_index (_gtk_tree_view_get_rbtree (tree_view),
- index / n_columns,
- tree,
- node))
- return FALSE;
- }
-
- if (column)
- {
- *column = get_visible_column (tree_view, index % n_columns);
- if (*column == NULL)
- return FALSE;
- }
- return TRUE;
-}
-
-static GtkTreeViewAccessibleCellInfo *
-find_cell_info (GtkTreeViewAccessible *accessible,
- GtkCellAccessible *cell)
-{
- AtkObject *parent;
-
- parent = atk_object_get_parent (ATK_OBJECT (cell));
- while (parent != ATK_OBJECT (accessible))
- {
- cell = GTK_CELL_ACCESSIBLE (parent);
- parent = atk_object_get_parent (ATK_OBJECT (cell));
- }
-
- return g_object_get_qdata (G_OBJECT (cell),
- gtk_tree_view_accessible_get_data_quark ());
-}
-
-static AtkObject *
-get_header_from_column (GtkTreeViewColumn *tv_col)
-{
- AtkObject *rc;
- GtkWidget *header_widget;
-
- if (tv_col == NULL)
- return NULL;
-
- header_widget = gtk_tree_view_column_get_button (tv_col);
-
- if (header_widget)
- rc = gtk_widget_get_accessible (header_widget);
- else
- rc = NULL;
-
- return rc;
-}
-
-void
-_gtk_tree_view_accessible_add (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node)
-{
- GtkTreeViewAccessible *accessible;
- guint row, n_rows, n_cols, i;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (treeview)));
- if (accessible == NULL)
- return;
-
- if (node == NULL)
- {
- row = tree->parent_tree ? gtk_tree_rbtree_node_get_index (tree->parent_tree, tree->parent_node) : 0;
- n_rows = tree->root->total_count;
- }
- else
- {
- row = gtk_tree_rbtree_node_get_index (tree, node);
- n_rows = 1 + (node->children ? node->children->root->total_count : 0);
- }
-
- g_signal_emit_by_name (accessible, "row-inserted", row, n_rows);
-
- n_cols = get_n_columns (treeview);
- if (n_cols)
- {
- for (i = (row + 1) * n_cols; i < (row + n_rows + 1) * n_cols; i++)
- {
- /* Pass NULL as the child object, i.e. 4th argument */
- g_signal_emit_by_name (accessible, "children-changed::add", i, NULL, NULL);
- }
- }
-}
-
-void
-_gtk_tree_view_accessible_remove (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node)
-{
- GtkTreeViewAccessibleCellInfo *cell_info;
- GHashTableIter iter;
- GtkTreeViewAccessible *accessible;
- GtkTreeViewAccessiblePrivate *priv;
- guint row, n_rows, n_cols, i;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (treeview)));
- if (accessible == NULL)
- return;
-
- priv = gtk_tree_view_accessible_get_instance_private (accessible);
-
- /* if this shows up in profiles, special-case node->children == NULL */
-
- if (node == NULL)
- {
- row = tree->parent_tree ? gtk_tree_rbtree_node_get_index (tree->parent_tree, tree->parent_node) : 0;
- n_rows = tree->root->total_count + 1;
- }
- else
- {
- row = gtk_tree_rbtree_node_get_index (tree, node);
- n_rows = 1 + (node->children ? node->children->root->total_count : 0);
-
- tree = node->children;
- }
-
- g_signal_emit_by_name (accessible, "row-deleted", row, n_rows);
-
- n_cols = get_n_columns (treeview);
- if (n_cols)
- {
- for (i = (n_rows + row + 1) * n_cols - 1; i >= (row + 1) * n_cols; i--)
- {
- /* Pass NULL as the child object, i.e. 4th argument */
- g_signal_emit_by_name (accessible, "children-changed::remove", i, NULL, NULL);
- }
-
- g_hash_table_iter_init (&iter, priv->cell_infos);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&cell_info))
- {
- if (node == cell_info->node ||
- tree == cell_info->tree ||
- (tree && gtk_tree_rbtree_contains (tree, cell_info->tree)))
- g_hash_table_iter_remove (&iter);
- }
- }
-}
-
-void
-_gtk_tree_view_accessible_changed (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node)
-{
- GtkTreeViewAccessible *accessible;
- guint i;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (treeview)));
- if (accessible == NULL)
- return;
-
- for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
- {
- GtkCellAccessible *cell = peek_cell (accessible,
- tree, node,
- gtk_tree_view_get_column (treeview, i));
-
- if (cell == NULL)
- continue;
-
- set_cell_data (treeview, accessible, cell);
- _gtk_cell_accessible_update_cache (cell, TRUE);
- }
-
- g_signal_emit_by_name (accessible, "visible-data-changed");
-}
-
-/* NB: id is not checked, only columns < id are.
- * This is important so the function works for notification of removal of a column */
-static guint
-to_visible_column_id (GtkTreeView *treeview,
- guint id)
-{
- guint i;
- guint invisible;
-
- invisible = 0;
-
- for (i = 0; i < id; i++)
- {
- GtkTreeViewColumn *column = gtk_tree_view_get_column (treeview, i);
-
- if (!gtk_tree_view_column_get_visible (column))
- invisible++;
- }
-
- return id - invisible;
-}
-
-static void
-gtk_tree_view_accessible_do_add_column (GtkTreeViewAccessible *accessible,
- GtkTreeView *treeview,
- GtkTreeViewColumn *column,
- guint id)
-{
- guint row, n_rows, n_cols;
-
- /* Generate column-inserted signal */
- g_signal_emit_by_name (accessible, "column-inserted", id, 1);
-
- n_rows = get_n_rows (treeview);
- n_cols = get_n_columns (treeview);
-
- /* Generate children-changed signals */
- for (row = 0; row <= n_rows; row++)
- {
- /* Pass NULL as the child object, i.e. 4th argument */
- g_signal_emit_by_name (accessible, "children-changed::add",
- (row * n_cols) + id, NULL, NULL);
- }
-}
-
-void
-_gtk_tree_view_accessible_add_column (GtkTreeView *treeview,
- GtkTreeViewColumn *column,
- guint id)
-{
- AtkObject *obj;
-
- if (!gtk_tree_view_column_get_visible (column))
- return;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
- if (obj == NULL)
- return;
-
- gtk_tree_view_accessible_do_add_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
- treeview,
- column,
- to_visible_column_id (treeview, id));
-}
-
-static void
-gtk_tree_view_accessible_do_remove_column (GtkTreeViewAccessible *self,
- GtkTreeView *treeview,
- GtkTreeViewColumn *column,
- guint id)
-{
- GtkTreeViewAccessiblePrivate *priv = gtk_tree_view_accessible_get_instance_private (self);
- GtkTreeViewAccessibleCellInfo *cell_info;
- GHashTableIter iter;
- gpointer value;
- guint row, n_rows, n_cols;
-
- /* Clean column from cache */
- g_hash_table_iter_init (&iter, priv->cell_infos);
- while (g_hash_table_iter_next (&iter, NULL, &value))
- {
- cell_info = value;
- if (cell_info->cell_col_ref == column)
- g_hash_table_iter_remove (&iter);
- }
-
- /* Generate column-deleted signal */
- g_signal_emit_by_name (self, "column-deleted", id, 1);
-
- n_rows = get_n_rows (treeview);
- n_cols = get_n_columns (treeview);
-
- /* Generate children-changed signals */
- for (row = 0; row <= n_rows; row++)
- {
- /* Pass NULL as the child object, 4th argument */
- g_signal_emit_by_name (self, "children-changed::remove",
- (row * n_cols) + id, NULL, NULL);
- }
-}
-
-void
-_gtk_tree_view_accessible_remove_column (GtkTreeView *treeview,
- GtkTreeViewColumn *column,
- guint id)
-{
- AtkObject *obj;
-
- if (!gtk_tree_view_column_get_visible (column))
- return;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
- if (obj == NULL)
- return;
-
- gtk_tree_view_accessible_do_remove_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
- treeview,
- column,
- to_visible_column_id (treeview, id));
-}
-
-void
-_gtk_tree_view_accessible_reorder_column (GtkTreeView *treeview,
- GtkTreeViewColumn *column)
-{
- AtkObject *obj;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
- if (obj == NULL)
- return;
-
- g_signal_emit_by_name (obj, "column-reordered");
-}
-
-void
-_gtk_tree_view_accessible_toggle_visibility (GtkTreeView *treeview,
- GtkTreeViewColumn *column)
-{
- AtkObject *obj;
- guint i, id;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
- if (obj == NULL)
- return;
-
- if (gtk_tree_view_column_get_visible (column))
- {
- id = get_column_number (treeview, column);
-
- gtk_tree_view_accessible_do_add_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
- treeview,
- column,
- id);
- }
- else
- {
- id = 0;
-
- for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
- {
- GtkTreeViewColumn *cur = gtk_tree_view_get_column (treeview, i);
-
- if (gtk_tree_view_column_get_visible (cur))
- id++;
-
- if (cur == column)
- break;
- }
-
- gtk_tree_view_accessible_do_remove_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
- treeview,
- column,
- id);
- }
-}
-
-static GtkTreeViewColumn *
-get_effective_focus_column (GtkTreeView *treeview,
- GtkTreeViewColumn *column)
-{
- if (column == NULL && get_n_columns (treeview) > 0)
- column = get_visible_column (treeview, 0);
-
- return column;
-}
-
-void
-_gtk_tree_view_accessible_update_focus_column (GtkTreeView *treeview,
- GtkTreeViewColumn *old_focus,
- GtkTreeViewColumn *new_focus)
-{
- GtkTreeViewAccessible *accessible;
- AtkObject *obj;
- GtkTreeRBTree *cursor_tree;
- GtkTreeRBNode *cursor_node;
- GtkCellAccessible *cell;
-
- old_focus = get_effective_focus_column (treeview, old_focus);
- new_focus = get_effective_focus_column (treeview, new_focus);
- if (old_focus == new_focus)
- return;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
- if (obj == NULL)
- return;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
-
- if (!_gtk_tree_view_get_cursor_node (treeview, &cursor_tree, &cursor_node))
- return;
-
- if (old_focus)
- {
- cell = peek_cell (accessible, cursor_tree, cursor_node, old_focus);
- if (cell != NULL)
- _gtk_cell_accessible_state_changed (cell, GTK_CELL_RENDERER_FOCUSED, 0);
- }
-
- if (new_focus)
- {
- cell = peek_cell (accessible, cursor_tree, cursor_node, new_focus);
- if (cell != NULL)
- _gtk_cell_accessible_state_changed (cell, 0, GTK_CELL_RENDERER_FOCUSED);
- else
- cell = create_cell (treeview, accessible, cursor_tree, cursor_node, new_focus);
-
- g_signal_emit_by_name (accessible, "active-descendant-changed", cell);
- }
-}
-
-void
-_gtk_tree_view_accessible_add_state (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkCellRendererState state)
-{
- GtkTreeViewAccessible *accessible;
- GtkTreeViewColumn *single_column;
- AtkObject *obj;
- guint i;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
- if (obj == NULL)
- return;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
-
- if (state == GTK_CELL_RENDERER_FOCUSED)
- {
- single_column = get_effective_focus_column (treeview, _gtk_tree_view_get_focus_column (treeview));
- }
- else if (state == GTK_CELL_RENDERER_EXPANDED ||
- state == GTK_CELL_RENDERER_EXPANDABLE)
- {
- single_column = gtk_tree_view_get_expander_column (treeview);
- }
- else
- single_column = NULL;
-
- if (single_column)
- {
- GtkCellAccessible *cell = peek_cell (accessible,
- tree, node,
- single_column);
-
- if (cell != NULL)
- _gtk_cell_accessible_state_changed (cell, state, 0);
-
- if (state == GTK_CELL_RENDERER_FOCUSED)
- {
- if (cell == NULL)
- cell = create_cell (treeview, accessible, tree, node, single_column);
-
- g_signal_emit_by_name (accessible, "active-descendant-changed", cell);
- }
- }
- else
- {
- for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
- {
- GtkCellAccessible *cell = peek_cell (accessible,
- tree, node,
- gtk_tree_view_get_column (treeview, i));
-
- if (cell == NULL)
- continue;
-
- _gtk_cell_accessible_state_changed (cell, state, 0);
- }
- }
-
- if (state == GTK_CELL_RENDERER_SELECTED)
- g_signal_emit_by_name (accessible, "selection-changed");
-}
-
-void
-_gtk_tree_view_accessible_remove_state (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkCellRendererState state)
-{
- GtkTreeViewAccessible *accessible;
- GtkTreeViewColumn *single_column;
- AtkObject *obj;
- guint i;
-
- obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
- if (obj == NULL)
- return;
-
- accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
-
- if (state == GTK_CELL_RENDERER_FOCUSED)
- {
- single_column = get_effective_focus_column (treeview, _gtk_tree_view_get_focus_column (treeview));
- }
- else if (state == GTK_CELL_RENDERER_EXPANDED ||
- state == GTK_CELL_RENDERER_EXPANDABLE)
- {
- single_column = gtk_tree_view_get_expander_column (treeview);
- }
- else
- single_column = NULL;
-
- if (single_column)
- {
- GtkCellAccessible *cell = peek_cell (accessible,
- tree, node,
- single_column);
-
- if (cell != NULL)
- _gtk_cell_accessible_state_changed (cell, 0, state);
- }
- else
- {
- for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
- {
- GtkCellAccessible *cell = peek_cell (accessible,
- tree, node,
- gtk_tree_view_get_column (treeview, i));
-
- if (cell == NULL)
- continue;
-
- _gtk_cell_accessible_state_changed (cell, 0, state);
- }
- }
-
- if (state == GTK_CELL_RENDERER_SELECTED)
- g_signal_emit_by_name (accessible, "selection-changed");
-}
diff --git a/gtk/a11y/gtktreeviewaccessible.h b/gtk/a11y/gtktreeviewaccessible.h
deleted file mode 100644
index 46b331592e..0000000000
--- a/gtk/a11y/gtktreeviewaccessible.h
+++ /dev/null
@@ -1,54 +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 .
- */
-
-#ifndef __GTK_TREE_VIEW_ACCESSIBLE_H__
-#define __GTK_TREE_VIEW_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_TREE_VIEW_ACCESSIBLE (gtk_tree_view_accessible_get_type ())
-#define GTK_TREE_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_VIEW_ACCESSIBLE, GtkTreeViewAccessible))
-#define GTK_TREE_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW_ACCESSIBLE, GtkTreeViewAccessibleClass))
-#define GTK_IS_TREE_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_VIEW_ACCESSIBLE))
-#define GTK_IS_TREE_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW_ACCESSIBLE))
-#define GTK_TREE_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW_ACCESSIBLE, GtkTreeViewAccessibleClass))
-
-typedef struct _GtkTreeViewAccessible GtkTreeViewAccessible;
-typedef struct _GtkTreeViewAccessibleClass GtkTreeViewAccessibleClass;
-
-struct _GtkTreeViewAccessible
-{
- GtkWidgetAccessible parent;
-};
-
-struct _GtkTreeViewAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_tree_view_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_TREE_VIEW_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtktreeviewaccessibleprivate.h b/gtk/a11y/gtktreeviewaccessibleprivate.h
deleted file mode 100644
index 2b132d9dc8..0000000000
--- a/gtk/a11y/gtktreeviewaccessibleprivate.h
+++ /dev/null
@@ -1,68 +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 .
- */
-
-#ifndef __GTK_TREE_VIEW_ACCESSIBLE_PRIVATE_H__
-#define __GTK_TREE_VIEW_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-/* called by treeview code */
-void _gtk_tree_view_accessible_reorder (GtkTreeView *treeview);
-void _gtk_tree_view_accessible_add (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node);
-void _gtk_tree_view_accessible_remove (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node);
-void _gtk_tree_view_accessible_changed (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node);
-
-void _gtk_tree_view_accessible_add_column (GtkTreeView *treeview,
- GtkTreeViewColumn *column,
- guint id);
-void _gtk_tree_view_accessible_remove_column (GtkTreeView *treeview,
- GtkTreeViewColumn *column,
- guint id);
-void _gtk_tree_view_accessible_reorder_column
- (GtkTreeView *treeview,
- GtkTreeViewColumn *column);
-void _gtk_tree_view_accessible_toggle_visibility
- (GtkTreeView *treeview,
- GtkTreeViewColumn *column);
-void _gtk_tree_view_accessible_update_focus_column
- (GtkTreeView *treeview,
- GtkTreeViewColumn *old_focus,
- GtkTreeViewColumn *new_focus);
-
-void _gtk_tree_view_accessible_add_state (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkCellRendererState state);
-void _gtk_tree_view_accessible_remove_state (GtkTreeView *treeview,
- GtkTreeRBTree *tree,
- GtkTreeRBNode *node,
- GtkCellRendererState state);
-
-void gtk_tree_view_accessible_update_model (GtkTreeViewAccessible *self,
- GtkTreeModel *model);
-
-G_END_DECLS
-
-#endif /* __GTK_TREE_VIEW_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c
deleted file mode 100644
index fe334e3d8b..0000000000
--- a/gtk/a11y/gtkwidgetaccessible.c
+++ /dev/null
@@ -1,789 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2001, 2002, 2003 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 "gtkwidgetaccessibleprivate.h"
-
-#include "gtkaccellabel.h"
-#include "gtkadjustment.h"
-#include "gtkbox.h"
-#include "gtkbutton.h"
-#include "gtkcombobox.h"
-#include "gtkdragicon.h"
-#include "gtkdrawingarea.h"
-#include "gtkglarea.h"
-#include "gtkimage.h"
-#include "gtklevelbar.h"
-#include "gtkmediacontrols.h"
-#include "gtknotebookpageaccessible.h"
-#include "gtknotebook.h"
-#include "gtkorientable.h"
-#include "gtkpicture.h"
-#include "gtkprogressbar.h"
-#include "gtkscrollable.h"
-#include "gtkscrollbar.h"
-#include "gtkseparator.h"
-#include "gtkshortcutlabel.h"
-#include "gtkshortcutsshortcut.h"
-#include "gtkspinner.h"
-#include "gtkstacksidebar.h"
-#include "gtkstatusbar.h"
-#include "gtkvideo.h"
-#include "gtkviewport.h"
-#include "gtkwidgetprivate.h"
-
-typedef struct
-{
- AtkLayer layer;
-} GtkWidgetAccessiblePrivate;
-
-extern GtkWidget *_focus_widget;
-
-static gboolean gtk_widget_accessible_on_screen (GtkWidget *widget);
-static gboolean gtk_widget_accessible_all_parents_visible (GtkWidget *widget);
-
-static void atk_component_interface_init (AtkComponentIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkWidgetAccessible, gtk_widget_accessible, GTK_TYPE_ACCESSIBLE,
- G_ADD_PRIVATE (GtkWidgetAccessible)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
-
-/*< private >
- * gtk_widget_accessible_update_bounds:
- * @self: a #GtkWidgetAccessible
- *
- * Updates the bounds of the widget's accessible implementation using
- * the widget's allocation.
- */
-void
-gtk_widget_accessible_update_bounds (GtkWidgetAccessible *self)
-{
- GtkAllocation alloc;
- AtkRectangle rect;
-
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
- gtk_widget_get_allocation (widget, &alloc);
-
- rect.x = alloc.x;
- rect.y = alloc.y;
- rect.width = alloc.width;
- rect.height = alloc.height;
-
- g_signal_emit_by_name (self, "bounds-changed", &rect);
-}
-
-/*< private >
- * gtk_widget_accessible_notify_showing:
- * @self: a #GtkWidgetAccessible
- *
- * Translates the #GtkWidget mapped state into the #AtkObject
- * showing state.
- */
-void
-gtk_widget_accessible_notify_showing (GtkWidgetAccessible *self)
-{
- g_return_if_fail (GTK_IS_WIDGET_ACCESSIBLE (self));
-
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
-
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_SHOWING,
- gtk_widget_get_mapped (widget));
-}
-
-void
-gtk_widget_accessible_notify_tooltip (GtkWidgetAccessible *self)
-{
- g_return_if_fail (GTK_IS_WIDGET_ACCESSIBLE (self));
-
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
-
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_HAS_TOOLTIP,
- gtk_widget_get_has_tooltip (widget));
-}
-
-void
-gtk_widget_accessible_notify_visible (GtkWidgetAccessible *self)
-{
- g_return_if_fail (GTK_IS_WIDGET_ACCESSIBLE (self));
-
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
-
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_VISIBLE,
- gtk_widget_get_visible (widget));
-}
-
-void
-gtk_widget_accessible_notify_sensitive (GtkWidgetAccessible *self)
-{
- g_return_if_fail (GTK_IS_WIDGET_ACCESSIBLE (self));
-
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
- gboolean is_sensitive = gtk_widget_get_sensitive (widget);
-
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_SENSITIVE,
- is_sensitive);
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_ENABLED,
- is_sensitive);
-}
-
-void
-gtk_widget_accessible_notify_focus (GtkWidgetAccessible *self)
-{
- g_return_if_fail (GTK_IS_WIDGET_ACCESSIBLE (self));
-
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
-
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_FOCUSED,
- gtk_widget_has_focus (widget));
-}
-
-void
-gtk_widget_accessible_notify_orientation (GtkWidgetAccessible *self)
-{
- g_return_if_fail (GTK_IS_WIDGET_ACCESSIBLE (self));
-
- GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
-
- if (GTK_IS_ORIENTABLE (widget))
- {
- GtkOrientable *orientable = GTK_ORIENTABLE (widget);
- GtkOrientation orientation = gtk_orientable_get_orientation (orientable);
-
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_HORIZONTAL,
- orientation == GTK_ORIENTATION_HORIZONTAL);
- atk_object_notify_state_change (ATK_OBJECT (self),
- ATK_STATE_VERTICAL,
- orientation == GTK_ORIENTATION_VERTICAL);
- }
-}
-
-static void
-gtk_widget_accessible_initialize (AtkObject *object,
- gpointer data)
-{
- GtkWidgetAccessible *self = GTK_WIDGET_ACCESSIBLE (object);
- GtkWidgetAccessiblePrivate *priv = gtk_widget_accessible_get_instance_private (self);
-
- priv->layer = ATK_LAYER_WIDGET;
-
- atk_object_set_role (object, ATK_ROLE_UNKNOWN);
-}
-
-static const char *
-gtk_widget_accessible_get_description (AtkObject *accessible)
-{
- GtkWidget *widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- if (accessible->description != NULL)
- return accessible->description;
-
- return gtk_widget_get_tooltip_text (widget);
-}
-
-static AtkObject *
-gtk_widget_accessible_get_parent (AtkObject *accessible)
-{
- AtkObject *parent;
- GtkWidget *widget, *parent_widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- parent = accessible->accessible_parent;
- if (parent != NULL)
- return parent;
-
- parent_widget = gtk_widget_get_parent (widget);
- if (parent_widget == NULL)
- return NULL;
-
- /* For a widget whose parent is a GtkNoteBook, we return the
- * accessible object corresponding the GtkNotebookPage containing
- * the widget as the accessible parent.
- */
- if (GTK_IS_NOTEBOOK (parent_widget))
- {
- gint page_num;
- GtkWidget *child;
- GtkNotebook *notebook;
-
- page_num = 0;
- notebook = GTK_NOTEBOOK (parent_widget);
- while (TRUE)
- {
- child = gtk_notebook_get_nth_page (notebook, page_num);
- if (!child)
- break;
- if (child == widget)
- {
- parent = gtk_widget_get_accessible (parent_widget);
- parent = atk_object_ref_accessible_child (parent, page_num);
- g_object_unref (parent);
- return parent;
- }
- page_num++;
- }
- }
- parent = gtk_widget_get_accessible (parent_widget);
- return parent;
-}
-
-static GtkWidget *
-find_label (GtkWidget *widget)
-{
- GList *labels;
- GtkWidget *label;
- GtkWidget *temp_widget;
- GList *ptr;
-
- labels = gtk_widget_list_mnemonic_labels (widget);
- label = NULL;
- ptr = labels;
- while (ptr)
- {
- if (ptr->data)
- {
- label = ptr->data;
- break;
- }
- ptr = ptr->next;
- }
- g_list_free (labels);
-
- /* Ignore a label within a button; bug #136602 */
- if (label && GTK_IS_BUTTON (widget))
- {
- temp_widget = label;
- while (temp_widget)
- {
- if (temp_widget == widget)
- {
- label = NULL;
- break;
- }
- temp_widget = gtk_widget_get_parent (temp_widget);
- }
- }
- return label;
-}
-
-static AtkRelationSet *
-gtk_widget_accessible_ref_relation_set (AtkObject *obj)
-{
- GtkWidget *widget;
- AtkRelationSet *relation_set;
- GtkWidget *label;
- AtkObject *array[1];
- AtkRelation* relation;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- relation_set = ATK_OBJECT_CLASS (gtk_widget_accessible_parent_class)->ref_relation_set (obj);
-
- if (GTK_IS_BOX (widget))
- return relation_set;
-
- if (!atk_relation_set_contains (relation_set, ATK_RELATION_LABELLED_BY))
- {
- label = find_label (widget);
- if (label == NULL)
- {
- if (GTK_IS_BUTTON (widget) && gtk_widget_get_mapped (widget))
- /*
- * Handle the case where GnomeIconEntry is the mnemonic widget.
- * The GtkButton which is a grandchild of the GnomeIconEntry
- * should really be the mnemonic widget. See bug #133967.
- */
- {
- GtkWidget *temp_widget;
-
- temp_widget = gtk_widget_get_parent (widget);
- if (GTK_IS_BOX (temp_widget))
- {
- label = find_label (temp_widget);
- if (!label)
- label = find_label (gtk_widget_get_parent (temp_widget));
- }
- }
- else if (GTK_IS_COMBO_BOX (widget))
- /*
- * Handle the case when GtkFileChooserButton is the mnemonic
- * widget. The GtkComboBox which is a child of the
- * GtkFileChooserButton should be the mnemonic widget.
- * See bug #359843.
- */
- {
- GtkWidget *temp_widget;
-
- temp_widget = gtk_widget_get_parent (widget);
- if (GTK_IS_BOX (temp_widget))
- {
- label = find_label (temp_widget);
- }
- }
- }
-
- if (label)
- {
- array[0] = gtk_widget_get_accessible (label);
-
- relation = atk_relation_new (array, 1, ATK_RELATION_LABELLED_BY);
- atk_relation_set_add (relation_set, relation);
- g_object_unref (relation);
- }
- }
-
- return relation_set;
-}
-
-static gboolean
-takes_focus (GtkWidget *widget)
-{
- if (GTK_IS_NOTEBOOK (widget) ||
- GTK_IS_BUTTON (widget))
- return TRUE;
-
- if (GTK_IS_ACCEL_LABEL (widget) ||
- GTK_IS_DRAG_ICON (widget) ||
- GTK_IS_DRAWING_AREA (widget) ||
- GTK_IS_GL_AREA (widget) ||
- GTK_IS_IMAGE (widget) ||
- GTK_IS_LEVEL_BAR (widget) ||
- GTK_IS_MEDIA_CONTROLS (widget) ||
- GTK_IS_PICTURE (widget) ||
- GTK_IS_PROGRESS_BAR (widget) ||
- GTK_IS_SCROLLBAR (widget) ||
- GTK_IS_SEPARATOR (widget) ||
- GTK_IS_SHORTCUT_LABEL (widget) ||
- GTK_IS_SHORTCUTS_SHORTCUT (widget) ||
- GTK_IS_SPINNER (widget) ||
- GTK_IS_STACK_SIDEBAR (widget) ||
- GTK_IS_STATUSBAR (widget) ||
- GTK_IS_VIDEO (widget))
- return FALSE;
-
- return gtk_widget_get_can_focus (widget);
-}
-
-static AtkStateSet *
-gtk_widget_accessible_ref_state_set (AtkObject *accessible)
-{
- GtkWidget *widget;
- AtkStateSet *state_set;
-
- state_set = ATK_OBJECT_CLASS (gtk_widget_accessible_parent_class)->ref_state_set (accessible);
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
- else
- {
- if (gtk_widget_is_sensitive (widget))
- {
- atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
- atk_state_set_add_state (state_set, ATK_STATE_ENABLED);
- }
-
- if (takes_focus (widget))
- {
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
- }
- /*
- * We do not currently generate notifications when an ATK object
- * corresponding to a GtkWidget changes visibility by being scrolled
- * on or off the screen. The testcase for this is the main window
- * of the testgtk application in which a set of buttons in a GtkVBox
- * is in a scrolled window with a viewport.
- *
- * To generate the notifications we would need to do the following:
- * 1) Find the GtkViewport among the ancestors of the objects
- * 2) Create an accessible for the viewport
- * 3) Connect to the value-changed signal on the viewport
- * 4) When the signal is received we need to traverse the children
- * of the viewport and check whether the children are visible or not
- * visible; we may want to restrict this to the widgets for which
- * accessible objects have been created.
- * 5) We probably need to store a variable on_screen in the
- * GtkWidgetAccessible data structure so we can determine whether
- * the value has changed.
- */
- if (gtk_widget_get_visible (widget))
- {
- atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);
- if (gtk_widget_accessible_on_screen (widget) &&
- gtk_widget_get_mapped (widget) &&
- gtk_widget_accessible_all_parents_visible (widget))
- atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
- }
-
- if (gtk_widget_has_focus (widget))
- atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
-
- if (gtk_widget_has_default (widget))
- atk_state_set_add_state (state_set, ATK_STATE_DEFAULT);
-
- if (GTK_IS_ORIENTABLE (widget))
- {
- if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL)
- atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
- else
- atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
- }
-
- if (gtk_widget_get_has_tooltip (widget))
- atk_state_set_add_state (state_set, ATK_STATE_HAS_TOOLTIP);
- }
- return state_set;
-}
-
-static gint
-gtk_widget_accessible_get_index_in_parent (AtkObject *accessible)
-{
- GtkWidget *widget;
- GtkWidget *parent_widget;
- gint index;
- GtkWidget *ch;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
-
- if (widget == NULL)
- return -1;
-
- if (accessible->accessible_parent)
- {
- AtkObject *parent;
-
- parent = accessible->accessible_parent;
-
- if (GTK_IS_NOTEBOOK_PAGE_ACCESSIBLE (parent))
- return 0;
- else
- {
- gint n_children, i;
- gboolean found = FALSE;
-
- n_children = atk_object_get_n_accessible_children (parent);
- for (i = 0; i < n_children; i++)
- {
- AtkObject *child;
-
- child = atk_object_ref_accessible_child (parent, i);
- if (child == accessible)
- found = TRUE;
-
- g_object_unref (child);
- if (found)
- return i;
- }
- }
- }
-
- parent_widget = gtk_widget_get_parent (widget);
- for (ch = gtk_widget_get_first_child (parent_widget), index = 0;
- ch != NULL;
- ch = gtk_widget_get_next_sibling (ch), index++)
- {
- if (ch == widget)
- break;
- }
-
- return index;
-}
-
-static AtkAttributeSet *
-gtk_widget_accessible_get_attributes (AtkObject *obj)
-{
- AtkAttributeSet *attributes;
- AtkAttribute *toolkit;
-
- toolkit = g_new (AtkAttribute, 1);
- toolkit->name = g_strdup ("toolkit");
- toolkit->value = g_strdup ("gtk");
-
- attributes = g_slist_append (NULL, toolkit);
-
- return attributes;
-}
-
-static int
-gtk_widget_accessible_get_n_children (AtkObject *object)
-{
- GtkWidget *window;
- GtkWidget *child;
- int count = 0;
-
- window = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
- for (child = gtk_widget_get_first_child (GTK_WIDGET (window));
- child != NULL;
- child = gtk_widget_get_next_sibling (child))
- count++;
-
- return count;
-}
-
-static AtkObject *
-gtk_widget_accessible_ref_child (AtkObject *object,
- int i)
-{
- GtkWidget *window, *child;
- int pos;
-
- window = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
- for (child = gtk_widget_get_first_child (GTK_WIDGET (window)), pos = 0;
- child != NULL;
- child = gtk_widget_get_next_sibling (child), pos++)
- {
- if (pos == i)
- return g_object_ref (gtk_widget_get_accessible (child));
- }
-
- return NULL;
-}
-
-static void
-gtk_widget_accessible_class_init (GtkWidgetAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->get_description = gtk_widget_accessible_get_description;
- class->get_parent = gtk_widget_accessible_get_parent;
- class->ref_relation_set = gtk_widget_accessible_ref_relation_set;
- class->ref_state_set = gtk_widget_accessible_ref_state_set;
- class->get_index_in_parent = gtk_widget_accessible_get_index_in_parent;
- class->initialize = gtk_widget_accessible_initialize;
- class->get_attributes = gtk_widget_accessible_get_attributes;
- class->get_n_children = gtk_widget_accessible_get_n_children;
- class->ref_child = gtk_widget_accessible_ref_child;
-}
-
-static void
-gtk_widget_accessible_init (GtkWidgetAccessible *accessible)
-{
-}
-
-static void
-gtk_widget_accessible_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkWidget *widget;
- GtkAllocation allocation;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
- if (widget == NULL)
- return;
-
- gtk_widget_get_allocation (widget, &allocation);
- *width = allocation.width;
- *height = allocation.height;
- if (!gtk_widget_accessible_on_screen (widget) || (!gtk_widget_is_drawable (widget)))
- {
- *x = G_MININT;
- *y = G_MININT;
- return;
- }
-
- if (gtk_widget_get_parent (widget))
- {
- *x = allocation.x;
- *y = allocation.y;
- }
- else
- {
- *x = 0;
- *y = 0;
- }
-}
-
-static AtkLayer
-gtk_widget_accessible_get_layer (AtkComponent *component)
-{
- GtkWidgetAccessible *self = GTK_WIDGET_ACCESSIBLE (component);
- GtkWidgetAccessiblePrivate *priv = gtk_widget_accessible_get_instance_private (self);
-
- return priv->layer;
-}
-
-static gboolean
-gtk_widget_accessible_grab_focus (AtkComponent *component)
-{
- GtkWidget *widget;
- GtkWidget *toplevel;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
- if (!widget)
- return FALSE;
-
- if (!gtk_widget_get_can_focus (widget))
- return FALSE;
-
- gtk_widget_grab_focus (widget);
- toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
- if (GTK_IS_WINDOW (toplevel))
- {
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_window_present (GTK_WINDOW (toplevel));
- G_GNUC_END_IGNORE_DEPRECATIONS
- }
-
- return TRUE;
-}
-
-static gboolean
-gtk_widget_accessible_set_extents (AtkComponent *component,
- gint x,
- gint y,
- gint width,
- gint height,
- AtkCoordType coord_type)
-{
- return FALSE;
-}
-
-static gboolean
-gtk_widget_accessible_set_position (AtkComponent *component,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- return FALSE;
-}
-
-static gboolean
-gtk_widget_accessible_set_size (AtkComponent *component,
- gint width,
- gint height)
-{
- return FALSE;
-}
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- iface->get_extents = gtk_widget_accessible_get_extents;
- iface->get_layer = gtk_widget_accessible_get_layer;
- iface->grab_focus = gtk_widget_accessible_grab_focus;
- iface->set_extents = gtk_widget_accessible_set_extents;
- iface->set_position = gtk_widget_accessible_set_position;
- iface->set_size = gtk_widget_accessible_set_size;
-}
-
-/* This function checks whether the widget has an ancestor which is
- * a GtkViewport and, if so, whether any part of the widget intersects
- * the visible rectangle of the GtkViewport.
- */
-static gboolean
-gtk_widget_accessible_on_screen (GtkWidget *widget)
-{
- GtkAllocation allocation;
- GtkWidget *viewport;
- gboolean return_value;
-
- gtk_widget_get_allocation (widget, &allocation);
-
- if (!gtk_widget_get_mapped (widget))
- return FALSE;
-
- viewport = gtk_widget_get_ancestor (widget, GTK_TYPE_VIEWPORT);
- if (viewport)
- {
- GtkAllocation viewport_allocation;
- GtkAdjustment *adjustment;
- GdkRectangle visible_rect;
-
- gtk_widget_get_allocation (viewport, &viewport_allocation);
-
- adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (viewport));
- visible_rect.y = gtk_adjustment_get_value (adjustment);
- adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (viewport));
- visible_rect.x = gtk_adjustment_get_value (adjustment);
- visible_rect.width = viewport_allocation.width;
- visible_rect.height = viewport_allocation.height;
-
- if (((allocation.x + allocation.width) < visible_rect.x) ||
- ((allocation.y + allocation.height) < visible_rect.y) ||
- (allocation.x > (visible_rect.x + visible_rect.width)) ||
- (allocation.y > (visible_rect.y + visible_rect.height)))
- return_value = FALSE;
- else
- return_value = TRUE;
- }
- else
- {
- /* Check whether the widget has been placed of the screen.
- * The widget may be MAPPED as when toolbar items do not
- * fit on the toolbar.
- */
- if (allocation.x + allocation.width <= 0 &&
- allocation.y + allocation.height <= 0)
- return_value = FALSE;
- else
- return_value = TRUE;
- }
-
- return return_value;
-}
-
-/* Checks if all the predecessors (the parent widget, his parent, etc)
- * are visible Used to check properly the SHOWING state.
- */
-static gboolean
-gtk_widget_accessible_all_parents_visible (GtkWidget *widget)
-{
- GtkWidget *iter_parent = NULL;
- gboolean result = TRUE;
-
- for (iter_parent = _gtk_widget_get_parent (widget);
- iter_parent != NULL;
- iter_parent = _gtk_widget_get_parent (iter_parent))
- {
- if (!_gtk_widget_get_visible (iter_parent))
- {
- result = FALSE;
- break;
- }
- }
-
- return result;
-}
-
-void
-_gtk_widget_accessible_set_layer (GtkWidgetAccessible *self,
- AtkLayer layer)
-{
- GtkWidgetAccessiblePrivate *priv = gtk_widget_accessible_get_instance_private (self);
-
- priv->layer = layer;
-}
diff --git a/gtk/a11y/gtkwidgetaccessible.h b/gtk/a11y/gtkwidgetaccessible.h
deleted file mode 100644
index fd4e02654e..0000000000
--- a/gtk/a11y/gtkwidgetaccessible.h
+++ /dev/null
@@ -1,41 +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 .
- */
-
-#ifndef __GTK_WIDGET_ACCESSIBLE_H__
-#define __GTK_WIDGET_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_WIDGET_ACCESSIBLE (gtk_widget_accessible_get_type())
-
-GDK_AVAILABLE_IN_ALL
-G_DECLARE_DERIVABLE_TYPE (GtkWidgetAccessible, gtk_widget_accessible, GTK, WIDGET_ACCESSIBLE, GtkAccessible)
-
-struct _GtkWidgetAccessibleClass
-{
- GtkAccessibleClass parent_class;
-};
-
-G_END_DECLS
-
-#endif /* __GTK_WIDGET_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkwidgetaccessibleprivate.h b/gtk/a11y/gtkwidgetaccessibleprivate.h
deleted file mode 100644
index e60abcb337..0000000000
--- a/gtk/a11y/gtkwidgetaccessibleprivate.h
+++ /dev/null
@@ -1,44 +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 .
- */
-
-#ifndef __GTK_WIDGET_ACCESSIBLE_PRIVATE_H__
-#define __GTK_WIDGET_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_widget_accessible_set_layer (GtkWidgetAccessible *accessible,
- AtkLayer layer);
-
-void gtk_widget_accessible_update_bounds (GtkWidgetAccessible *self);
-
-void gtk_widget_accessible_notify_showing (GtkWidgetAccessible *self);
-
-void gtk_widget_accessible_notify_tooltip (GtkWidgetAccessible *self);
-
-void gtk_widget_accessible_notify_visible (GtkWidgetAccessible *self);
-
-void gtk_widget_accessible_notify_sensitive (GtkWidgetAccessible *self);
-
-void gtk_widget_accessible_notify_focus (GtkWidgetAccessible *self);
-
-void gtk_widget_accessible_notify_orientation (GtkWidgetAccessible *self);
-
-G_END_DECLS
-
-#endif /* __GTK_WIDGET_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/gtkwindowaccessible.c b/gtk/a11y/gtkwindowaccessible.c
deleted file mode 100644
index 6485cf8e69..0000000000
--- a/gtk/a11y/gtkwindowaccessible.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright 2011, F123 Consulting & Mais Diferenças
- * Copyright 2001, 2002, 2003 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 "gtkwindowaccessibleprivate.h"
-
-#include "gtkaccessibility.h"
-#include "gtktoplevelaccessible.h"
-#include "gtkwidgetaccessibleprivate.h"
-
-#include "gtklabel.h"
-#include "gtkwidgetprivate.h"
-#include "gtkwindowprivate.h"
-#include "gtknative.h"
-
-/* atkcomponent.h */
-
-static void gtk_window_accessible_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type);
-static void gtk_window_accessible_get_size (AtkComponent *component,
- gint *width,
- gint *height);
-
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void atk_window_interface_init (AtkWindowIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (GtkWindowAccessible,
- gtk_window_accessible,
- GTK_TYPE_WIDGET_ACCESSIBLE,
- G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT,
- atk_component_interface_init)
- G_IMPLEMENT_INTERFACE (ATK_TYPE_WINDOW,
- atk_window_interface_init));
-
-
-static void
-gtk_window_accessible_focus_event (AtkObject *obj,
- gboolean focus_in)
-{
- atk_object_notify_state_change (obj, ATK_STATE_ACTIVE, focus_in);
-}
-
-static void
-on_title_changed (GObject *gobject,
- GParamSpec *pspec,
- GtkWindowAccessible *self)
-{
- AtkObject *atk_obj = ATK_OBJECT (self);
-
- g_object_notify (G_OBJECT (atk_obj), "accessible-name");
- g_signal_emit_by_name (atk_obj, "visible-data-changed");
-}
-
-static const gchar *
-gtk_window_accessible_get_name (AtkObject *accessible)
-{
- const gchar* name;
- GtkWidget* widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- name = ATK_OBJECT_CLASS (gtk_window_accessible_parent_class)->get_name (accessible);
- if (name != NULL)
- return name;
-
- if (GTK_IS_WINDOW (widget))
- {
- GtkWindow *window = GTK_WINDOW (widget);
-
- name = gtk_window_get_title (window);
- }
- return name;
-}
-
-static gint
-gtk_window_accessible_get_index_in_parent (AtkObject *accessible)
-{
- GtkWidget* widget;
- AtkObject* atk_obj;
- gint index = -1;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return -1;
-
- index = ATK_OBJECT_CLASS (gtk_window_accessible_parent_class)->get_index_in_parent (accessible);
- if (index != -1)
- return index;
-
- atk_obj = atk_get_root ();
-
- if (GTK_IS_WINDOW (widget))
- {
- GtkWindow *window = GTK_WINDOW (widget);
- if (GTK_IS_TOPLEVEL_ACCESSIBLE (atk_obj))
- {
- GtkToplevelAccessible *toplevel = GTK_TOPLEVEL_ACCESSIBLE (atk_obj);
- index = g_list_index (gtk_toplevel_accessible_get_children (toplevel), window);
- }
- else
- {
- gint i, sibling_count;
-
- sibling_count = atk_object_get_n_accessible_children (atk_obj);
- for (i = 0; i < sibling_count && index == -1; ++i)
- {
- AtkObject *child = atk_object_ref_accessible_child (atk_obj, i);
- if (accessible == child)
- index = i;
- g_object_unref (G_OBJECT (child));
- }
- }
- }
- return index;
-}
-
-static AtkRelationSet *
-gtk_window_accessible_ref_relation_set (AtkObject *obj)
-{
- GtkWidget *widget;
- AtkRelationSet *relation_set;
- AtkObject *array[1];
- AtkRelation* relation;
- GtkWidget *current_widget;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
- if (widget == NULL)
- return NULL;
-
- relation_set = ATK_OBJECT_CLASS (gtk_window_accessible_parent_class)->ref_relation_set (obj);
-
- if (atk_object_get_role (obj) == ATK_ROLE_TOOL_TIP)
- {
- relation = atk_relation_set_get_relation_by_type (relation_set, ATK_RELATION_POPUP_FOR);
- if (relation)
- atk_relation_set_remove (relation_set, relation);
-
- if (0) /* FIXME need a way to go from tooltip window to widget */
- {
- array[0] = gtk_widget_get_accessible (current_widget);
- relation = atk_relation_new (array, 1, ATK_RELATION_POPUP_FOR);
- atk_relation_set_add (relation_set, relation);
- g_object_unref (relation);
- }
- }
- return relation_set;
-}
-
-static AtkStateSet *
-gtk_window_accessible_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
- GtkWindow *window;
- GdkSurface *gdk_surface;
- GdkSurfaceState state;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
- if (widget == NULL)
- return NULL;
-
- state_set = ATK_OBJECT_CLASS (gtk_window_accessible_parent_class)->ref_state_set (accessible);
-
- window = GTK_WINDOW (widget);
-
- if (gtk_window_is_active (window))
- atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
-
- gdk_surface = gtk_native_get_surface (GTK_NATIVE (window));
- if (GDK_IS_TOPLEVEL (gdk_surface))
- {
- state = gdk_toplevel_get_state (GDK_TOPLEVEL (gdk_surface));
- if (state & GDK_SURFACE_STATE_MINIMIZED)
- atk_state_set_add_state (state_set, ATK_STATE_ICONIFIED);
- }
- if (gtk_window_get_modal (window))
- atk_state_set_add_state (state_set, ATK_STATE_MODAL);
-
- if (gtk_window_get_resizable (window))
- atk_state_set_add_state (state_set, ATK_STATE_RESIZABLE);
-
- return state_set;
-}
-
-static gint
-gtk_window_accessible_get_n_children (AtkObject *object)
-{
- GtkWidget *window;
- GtkWidget *child;
- gint count = 0;
-
- window = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
- for (child = gtk_widget_get_first_child (GTK_WIDGET (window));
- child != NULL;
- child = gtk_widget_get_next_sibling (child))
- count++;
-
- return count;
-}
-
-static AtkObject *
-gtk_window_accessible_ref_child (AtkObject *object,
- gint i)
-{
- GtkWidget *window, *child;
- int pos;
-
- window = gtk_accessible_get_widget (GTK_ACCESSIBLE (object));
- for (child = gtk_widget_get_first_child (GTK_WIDGET (window)), pos = 0;
- child != NULL;
- child = gtk_widget_get_next_sibling (child), pos++)
- {
- if (pos == i)
- return g_object_ref (gtk_widget_get_accessible (child));
- }
-
- return NULL;
-}
-
-static void
-gtk_window_accessible_initialize (AtkObject *object,
- gpointer data)
-{
- GtkWidget *window = data;
-
- g_signal_connect (window, "notify::title", G_CALLBACK (on_title_changed), object);
-}
-
-static void
-gtk_window_accessible_class_init (GtkWindowAccessibleClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- class->initialize = gtk_window_accessible_initialize;
- class->get_name = gtk_window_accessible_get_name;
- class->get_index_in_parent = gtk_window_accessible_get_index_in_parent;
- class->ref_relation_set = gtk_window_accessible_ref_relation_set;
- class->ref_state_set = gtk_window_accessible_ref_state_set;
- class->focus_event = gtk_window_accessible_focus_event;
- class->get_n_children = gtk_window_accessible_get_n_children;
- class->ref_child = gtk_window_accessible_ref_child;
-}
-
-static void
-gtk_window_accessible_init (GtkWindowAccessible *accessible)
-{
-}
-
-static void
-gtk_window_accessible_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GtkWidget *widget;
- GdkSurface *surface;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
- if (widget == NULL)
- return;
-
- surface = gtk_native_get_surface (GTK_NATIVE (widget));
- if (surface == NULL)
- return;
-
- *x = 0;
- *y = 0;
- *width = gdk_surface_get_width (surface);
- *height = gdk_surface_get_height (surface);
- if (!gtk_widget_is_drawable (widget))
- {
- *x = G_MININT;
- *y = G_MININT;
- return;
- }
-}
-
-static void
-gtk_window_accessible_get_size (AtkComponent *component,
- gint *width,
- gint *height)
-{
- GtkWidget *widget;
- GdkSurface *surface;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
- if (widget == NULL)
- return;
-
- surface = gtk_native_get_surface (GTK_NATIVE (widget));
- if (surface == NULL)
- return;
-
- *width = gdk_surface_get_width (surface);
- *height = gdk_surface_get_height (surface);
-}
-
-void
-_gtk_window_accessible_set_is_active (GtkWindow *window,
- gboolean is_active)
-{
- AtkObject *accessible = _gtk_widget_peek_accessible (GTK_WIDGET (window));
-
- if (accessible == NULL)
- return;
-
- g_signal_emit_by_name (accessible, is_active ? "activate" : "deactivate");
-}
-
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- iface->get_extents = gtk_window_accessible_get_extents;
- iface->get_size = gtk_window_accessible_get_size;
-}
-
-static void
-atk_window_interface_init (AtkWindowIface *iface)
-{
- /* At this moment AtkWindow is just about signals */
-}
diff --git a/gtk/a11y/gtkwindowaccessible.h b/gtk/a11y/gtkwindowaccessible.h
deleted file mode 100644
index 39250190cb..0000000000
--- a/gtk/a11y/gtkwindowaccessible.h
+++ /dev/null
@@ -1,57 +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 .
- */
-
-#ifndef __GTK_WINDOW_ACCESSIBLE_H__
-#define __GTK_WINDOW_ACCESSIBLE_H__
-
-#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#include
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_WINDOW_ACCESSIBLE (gtk_window_accessible_get_type ())
-#define GTK_WINDOW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW_ACCESSIBLE, GtkWindowAccessible))
-#define GTK_WINDOW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WINDOW_ACCESSIBLE, GtkWindowAccessibleClass))
-#define GTK_IS_WINDOW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WINDOW_ACCESSIBLE))
-#define GTK_IS_WINDOW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WINDOW_ACCESSIBLE))
-#define GTK_WINDOW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WINDOW_ACCESSIBLE, GtkWindowAccessibleClass))
-
-typedef struct _GtkWindowAccessible GtkWindowAccessible;
-typedef struct _GtkWindowAccessibleClass GtkWindowAccessibleClass;
-typedef struct _GtkWindowAccessiblePrivate GtkWindowAccessiblePrivate;
-
-struct _GtkWindowAccessible
-{
- GtkWidgetAccessible parent;
-
- GtkWindowAccessiblePrivate *priv;
-};
-
-struct _GtkWindowAccessibleClass
-{
- GtkWidgetAccessibleClass parent_class;
-};
-
-GDK_AVAILABLE_IN_ALL
-GType gtk_window_accessible_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GTK_WINDOW_ACCESSIBLE_H__ */
diff --git a/gtk/a11y/gtkwindowaccessibleprivate.h b/gtk/a11y/gtkwindowaccessibleprivate.h
deleted file mode 100644
index ba2fbfb9e8..0000000000
--- a/gtk/a11y/gtkwindowaccessibleprivate.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* GTK+ - accessibility implementations
- * Copyright (C) 2018 Benjamin Otte
- *
- * 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 .
- */
-
-#ifndef __GTK_WINDOW_ACCESSIBLE_PRIVATE_H__
-#define __GTK_WINDOW_ACCESSIBLE_PRIVATE_H__
-
-#include
-
-G_BEGIN_DECLS
-
-void _gtk_window_accessible_set_is_active (GtkWindow *window,
- gboolean is_active);
-
-G_END_DECLS
-
-#endif /* __GTK_WINDOW_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/a11y/meson.build b/gtk/a11y/meson.build
deleted file mode 100644
index 10d74907f9..0000000000
--- a/gtk/a11y/meson.build
+++ /dev/null
@@ -1,109 +0,0 @@
-a11y_sources = files([
- 'gtkaccessibility.c',
- 'gtkaccessibilityutil.c',
- 'gtkbooleancellaccessible.c',
- 'gtkbuttonaccessible.c',
- 'gtkcellaccessible.c',
- 'gtkcellaccessibleparent.c',
- 'gtkcolorswatchaccessible.c',
- 'gtkcomboboxaccessible.c',
- 'gtkcompositeaccessible.c',
- 'gtkcontainercellaccessible.c',
- 'gtkentryaccessible.c',
- 'gtkexpanderaccessible.c',
- 'gtkflowboxaccessible.c',
- 'gtkflowboxchildaccessible.c',
- 'gtkframeaccessible.c',
- 'gtkiconviewaccessible.c',
- 'gtkimageaccessible.c',
- 'gtkimagecellaccessible.c',
- 'gtklabelaccessible.c',
- 'gtklevelbaraccessible.c',
- 'gtklinkbuttonaccessible.c',
- 'gtklistboxaccessible.c',
- 'gtklistboxrowaccessible.c',
- 'gtklockbuttonaccessible.c',
- 'gtkmenubuttonaccessible.c',
- 'gtknotebookaccessible.c',
- 'gtknotebookpageaccessible.c',
- 'gtkpanedaccessible.c',
- 'gtkpasswordentryaccessible.c',
- 'gtkpictureaccessible.c',
- 'gtkpopoveraccessible.c',
- 'gtkprogressbaraccessible.c',
- 'gtkradiobuttonaccessible.c',
- 'gtkrangeaccessible.c',
- 'gtkrenderercellaccessible.c',
- 'gtkscaleaccessible.c',
- 'gtkscalebuttonaccessible.c',
- 'gtkscrollbaraccessible.c',
- 'gtkscrolledwindowaccessible.c',
- 'gtksearchentryaccessible.c',
- 'gtkspinbuttonaccessible.c',
- 'gtkspinneraccessible.c',
- 'gtkstackaccessible.c',
- 'gtkstatusbaraccessible.c',
- 'gtkswitchaccessible.c',
- 'gtktextaccessible.c',
- 'gtktextcellaccessible.c',
- 'gtktextviewaccessible.c',
- 'gtktogglebuttonaccessible.c',
- 'gtktoplevelaccessible.c',
- 'gtktreeviewaccessible.c',
- 'gtkwidgetaccessible.c',
- 'gtkwindowaccessible.c',
-])
-
-a11y_headers = files([
- 'gtk-a11y-autocleanups.h',
- 'gtkbooleancellaccessible.h',
- 'gtkbuttonaccessible.h',
- 'gtkcellaccessible.h',
- 'gtkcellaccessibleparent.h',
- 'gtkcomboboxaccessible.h',
- 'gtkcompositeaccessible.h',
- 'gtkcontainercellaccessible.h',
- 'gtkentryaccessible.h',
- 'gtkexpanderaccessible.h',
- 'gtkflowboxaccessible.h',
- 'gtkflowboxchildaccessible.h',
- 'gtkframeaccessible.h',
- 'gtkiconviewaccessible.h',
- 'gtkimageaccessible.h',
- 'gtkimagecellaccessible.h',
- 'gtklabelaccessible.h',
- 'gtklevelbaraccessible.h',
- 'gtklinkbuttonaccessible.h',
- 'gtklistboxaccessible.h',
- 'gtklistboxrowaccessible.h',
- 'gtklockbuttonaccessible.h',
- 'gtkmenubuttonaccessible.h',
- 'gtknotebookaccessible.h',
- 'gtknotebookpageaccessible.h',
- 'gtkpanedaccessible.h',
- 'gtkpasswordentryaccessible.h',
- 'gtkpopoveraccessible.h',
- 'gtkprogressbaraccessible.h',
- 'gtkradiobuttonaccessible.h',
- 'gtkrangeaccessible.h',
- 'gtkrenderercellaccessible.h',
- 'gtkscaleaccessible.h',
- 'gtkscalebuttonaccessible.h',
- 'gtkscrollbaraccessible.h',
- 'gtkscrolledwindowaccessible.h',
- 'gtksearchentryaccessible.h',
- 'gtkspinbuttonaccessible.h',
- 'gtkspinneraccessible.h',
- 'gtkstackaccessible.h',
- 'gtkstatusbaraccessible.h',
- 'gtkswitchaccessible.h',
- 'gtktextaccessible.h',
- 'gtktextcellaccessible.h',
- 'gtktextviewaccessible.h',
- 'gtktogglebuttonaccessible.h',
- 'gtktoplevelaccessible.h',
- 'gtktreeviewaccessible.h',
- 'gtkwidgetaccessible.h',
- 'gtkwindowaccessible.h',
-])
-install_headers(a11y_headers, subdir : 'gtk-4.0/gtk/a11y')
diff --git a/gtk/gtk-a11y.h b/gtk/gtk-a11y.h
deleted file mode 100644
index 3199b23156..0000000000
--- a/gtk/gtk-a11y.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * 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 .
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#ifndef __GTK_A11Y_H__
-#define __GTK_A11Y_H__
-
-#define __GTK_A11Y_H_INSIDE__
-
-#include
-#include
-#include
-#include
-#include
-#include