summaryrefslogtreecommitdiff
path: root/gtk/a11y/gtkrangeaccessible.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-01-21 17:55:50 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2020-01-21 18:21:25 +0000
commit2d158da7a4b0939cad1ffb22f1114371975d304e (patch)
tree7eb2f8da156cc611da0ba7d7fe5ae00b6e8b4c98 /gtk/a11y/gtkrangeaccessible.c
parent975f6529b17ed0c9aa5e7bf478143530cf91bd46 (diff)
downloadgtk+-wip/ebassi/a11y.tar.gz
Move ATK inside GTKwip/ebassi/a11y
This is a temporary move that aims to make GTK's accessibility support independent of external components. ATK has lived outside of GTK since its inception, as it was meant to be a generic API implemented by different toolkits; that mostly failed, and we're now stuck with an abstraction layer that doesn't really abstract anything of value. What it did bring, on the other hand, was maintenance burden, with changes being propagated across different projects—ATK, GTK, and whatever accessibility layer implemented the bridge to ATSPI on Linux. This complexity is completely unwarranted for the benefits it gives us. Ideally, we'd get rid of ATK entirely, and expose the accessility API as part of the GTK namespace, but that is a fairly sizeable work, so we can start from this step. The ATK namespace is maintained, similarly to how we maintain the GDK, GSK, and GTK namespaces. The API is still public, so that GTK and out of tree widgets can consume it. The inclusion of ATK comes with the removal of the deprecated entry points and types, as that's a good chance to begin the cleanup of this mess of an API. Sadly, this also means we have to disable the a11y tests for the time being, as they depend on rando API from 2002. Another side effect of moving ATK in tree is that we cannot link to atk-bridge on X11, as that will link to the out of tree ATK; this means that accessibility is disabled on X11.
Diffstat (limited to 'gtk/a11y/gtkrangeaccessible.c')
-rw-r--r--gtk/a11y/gtkrangeaccessible.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/gtk/a11y/gtkrangeaccessible.c b/gtk/a11y/gtkrangeaccessible.c
index 93cfb62a7e..40b5cd9015 100644
--- a/gtk/a11y/gtkrangeaccessible.c
+++ b/gtk/a11y/gtkrangeaccessible.c
@@ -121,98 +121,6 @@ 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)
@@ -283,12 +191,6 @@ gtk_range_accessible_get_increment (AtkValue *obj)
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;