[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#840568: caja: Impossible to have speech feedback when items are set in icons



Package: caja
Version: 1.16.0-1
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

Switch from 1.12 to 1.14. Just fixed in 1.16. I use Orca 3.20, 3.22 as well.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

1. Enable accessibility in Preferences.
2. Enable Orca in Universal Access
3. `est if it works: alt-f1, arrow keys should speak "Accessories" and other
items.
4. alt-ctrl-d
5. Press arrow keys.
The focus moves, but no feedback.
6. Open Home folder.
7. Try browsing files with icon view. No feedback.
8. Try browsing with list or compact view, Orca speaks.

   * What was the outcome of this action?

No sound on desktop or in file manager if icon view is active.

   * What outcome did you expect instead?

Should speak. Otherwise, MATE desktop is not accessible for disabled users with
assistive techno.

*** End of the template - remove these template lines ***

Here's a patch, accepted upstream, but I fixed a typo (inherritance) in Debian's
patch.

See bug 590 upstream for detailed explanation by Luke about how he fixed the
issue.

Thanks


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages caja depends on:
ii  caja-common               1.16.0-1
ii  desktop-file-utils        0.23-1
ii  gvfs                      1.30.0-1
ii  libatk1.0-0               2.22.0-1
ii  libc6                     2.24-3
ii  libcairo-gobject2         1.14.6-1+b1
ii  libcairo2                 1.14.6-1+b1
ii  libcaja-extension1        1.16.0-1
ii  libexempi3                2.3.0-2
ii  libexif12                 0.6.21-2
ii  libgail-3-0               3.22.1-1
ii  libgdk-pixbuf2.0-0        2.36.0-1
ii  libglib2.0-0              2.50.0-2
ii  libglib2.0-data           2.50.0-2
ii  libgtk-3-0                3.22.1-1
ii  libice6                   2:1.0.9-1+b1
ii  libmate-desktop-2-17      1.16.0-1
ii  libpango-1.0-0            1.40.3-2
ii  libpangocairo-1.0-0       1.40.3-2
ii  libselinux1               2.5-3
ii  libsm6                    2:1.2.2-1+b1
ii  libstartup-notification0  0.12-4
ii  libunique-3.0-0           3.0.2-2
ii  libx11-6                  2:1.6.3-1
ii  libxext6                  2:1.3.3-1
ii  libxml2                   2.9.4+dfsg1-2
ii  libxrender1               1:0.9.9-2
ii  mate-desktop              1.16.0-1
ii  shared-mime-info          1.7-1

Versions of packages caja recommends:
ii  gvfs-backends  1.30.0-1

Versions of packages caja suggests:
ii  engrampa            1.16.0-1
pn  gstreamer1.0-tools  <none>
pn  meld                <none>

-- no debconf information
>From 076b8582e4c834db60070fe441d7977716637721 Mon Sep 17 00:00:00 2001
From: Luke Yelavich <themuso@ubuntu.com>
Date: Sat, 8 Oct 2016 12:22:45 +1100
Subject: [PATCH] Fix accessible object inheritance when used with GTK >= 3.2

Also disable eel accessibility code that is not needed.

Fixes https://github.com/mate-desktop/caja/issues/590
---
 eel/eel-accessibility.c               |  5 ++-
 eel/eel-accessibility.h               |  2 +
 eel/eel-canvas.c                      | 84 +++++++++++++++++++++++++++++++++--
 eel/eel-canvas.h                      | 20 +++++++++
 eel/eel-editable-label.c              | 55 ++++++++++++++++++++++-
 eel/eel-labeled-image.c               | 77 ++++++++++++++++++++++++++++++++
 libcaja-private/caja-icon-container.c | 57 ++++++++++++++++++++++++
 src/caja-zoom-control.c               | 48 ++++++++++++++++++++
 8 files changed, 343 insertions(+), 5 deletions(-)

diff --git a/eel/eel-accessibility.c b/eel/eel-accessibility.c
index 707756d..a344bd8 100644
--- a/eel/eel-accessibility.c
+++ b/eel/eel-accessibility.c
@@ -63,6 +63,7 @@ eel_accessibility_set_up_label_widget_relation (GtkWidget *label, GtkWidget *wid
  *
  * Return value: the registered type, or 0 on failure.
  **/
+#if !GTK_CHECK_VERSION(3, 2, 0)
 GType
 eel_accessibility_create_derived_type (const char *type_name,
                                        GType existing_gobject_with_proxy,
@@ -113,7 +114,7 @@ eel_accessibility_create_derived_type (const char *type_name,
 
     return type;
 }
-
+#endif
 
 static GQuark
 get_quark_accessible (void)
@@ -207,6 +208,7 @@ eel_accessibility_destroy (gpointer data,
  *
  * Return value: @atk_object.
  **/
+#if !GTK_CHECK_VERSION(3, 2, 0)
 AtkObject *
 eel_accessibility_set_atk_object_return (gpointer   object,
         AtkObject *atk_object)
@@ -224,6 +226,7 @@ eel_accessibility_set_atk_object_return (gpointer   object,
 
     return atk_object;
 }
+#endif
 
 static GailTextUtil *
 get_simple_text (gpointer object)
diff --git a/eel/eel-accessibility.h b/eel/eel-accessibility.h
index 45514c9..b4ca8cb 100644
--- a/eel/eel-accessibility.h
+++ b/eel/eel-accessibility.h
@@ -38,11 +38,13 @@ typedef void     (*EelAccessibilityClassInitFn)    (AtkObjectClass *klass);
 AtkObject    *eel_accessibility_get_atk_object        (gpointer              object);
 AtkObject    *eel_accessibility_for_object            (gpointer              object);
 gpointer      eel_accessibility_get_gobject           (AtkObject            *object);
+#if !GTK_CHECK_VERSION(3, 2, 0)
 AtkObject    *eel_accessibility_set_atk_object_return (gpointer              object,
         AtkObject            *atk_object);
 GType         eel_accessibility_create_derived_type   (const char           *type_name,
         GType                 existing_gobject_with_proxy,
         EelAccessibilityClassInitFn class_init);
+#endif
 void          eel_accessibility_set_name              (gpointer              object,
         const char           *name);
 void          eel_accessibility_set_description       (gpointer              object,
diff --git a/eel/eel-canvas.c b/eel/eel-canvas.c
index 1e45224..7d41c6d 100644
--- a/eel/eel-canvas.c
+++ b/eel/eel-canvas.c
@@ -68,6 +68,9 @@
 #include <stdio.h>
 #include <gdk/gdkprivate.h>
 #include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(3,2,0)
+#include <gtk/gtk-a11y.h>
+#endif
 #include <glib/gi18n-lib.h>
 #if GTK_CHECK_VERSION(3,0,0)
 # include <cairo/cairo-gobject.h>
@@ -2066,6 +2069,25 @@ eel_canvas_accessible_ref_child (AtkObject *obj,
     return atk_object;
 }
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+G_DEFINE_TYPE (EelCanvasAccessible, eel_canvas_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
+
+static void
+eel_canvas_accessible_class_init (EelCanvasAccessibleClass *klass)
+{
+    AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+    accessible_parent_class = g_type_class_peek_parent (atk_class);
+
+    atk_class->initialize = eel_canvas_accessible_initialize;
+    atk_class->get_n_children = eel_canvas_accessible_get_n_children;
+    atk_class->ref_child = eel_canvas_accessible_ref_child;
+}
+
+static void
+eel_canvas_accessible_init (EelCanvasAccessible *accessible)
+{
+}
+#else
 static void
 eel_canvas_accessible_class_init (AtkObjectClass *klass)
 {
@@ -2183,7 +2205,7 @@ eel_canvas_accessible_factory_get_type (void)
 
     return type;
 }
-
+#endif
 
 /* Class initialization function for EelCanvasClass */
 static void
@@ -2244,9 +2266,13 @@ eel_canvas_class_init (EelCanvasClass *klass)
                       G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
 #endif
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+    gtk_widget_class_set_accessible_type (widget_class, eel_canvas_accessible_get_type ());
+#else
     atk_registry_set_factory_type (atk_get_default_registry (),
                                    EEL_TYPE_CANVAS,
                                    eel_canvas_accessible_factory_get_type ());
+#endif
 }
 
 /* Callback used when the root item of a canvas is destroyed.  The user should
@@ -3323,7 +3349,7 @@ idle_handler (gpointer data)
 {
     EelCanvas *canvas;
 
-#if !GTK_CHECK_VERSION (3, 0, 0)
+#if !GTK_CHECK_VERSION(3, 0, 0)
     GDK_THREADS_ENTER ();
 #endif
 
@@ -4169,6 +4195,43 @@ eel_canvas_item_accessible_ref_state_set (AtkObject *accessible)
     return state_set;
 }
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+static GType eel_canvas_item_accessible_get_type (void);
+
+typedef struct _EelCanvasItemAccessible EelCanvasItemAccessible;
+typedef struct _EelCanvasItemAccessibleClass EelCanvasItemAccessibleClass;
+
+struct _EelCanvasItemAccessible
+{
+    GtkAccessible parent;
+};
+
+struct _EelCanvasItemAccessibleClass
+{
+    GtkAccessibleClass parent_class;
+};
+
+G_DEFINE_TYPE_WITH_CODE (EelCanvasItemAccessible,
+                         eel_canvas_item_accessible,
+                         ATK_TYPE_GOBJECT_ACCESSIBLE,
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT,
+                                                eel_canvas_item_accessible_component_interface_init));
+
+static void
+eel_canvas_item_accessible_class_init (EelCanvasItemAccessibleClass *klass)
+{
+    AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+    accessible_item_parent_class = g_type_class_peek_parent (atk_class);
+
+    atk_class->initialize = eel_canvas_item_accessible_initialize;
+    atk_class->ref_state_set = eel_canvas_item_accessible_ref_state_set;
+}
+
+static void
+eel_canvas_item_accessible_init (EelCanvasItemAccessible *accessible)
+{
+}
+#else
 static void
 eel_canvas_item_accessible_class_init (AtkObjectClass *klass)
 {
@@ -4222,7 +4285,7 @@ eel_canvas_item_accessible_get_type (void)
 
     return type;
 }
-
+#endif
 static AtkObject *
 eel_canvas_item_accessible_create (GObject *for_object)
 {
@@ -4269,6 +4332,20 @@ eel_canvas_item_accessible_factory_class_init (AtkObjectFactoryClass *klass)
     klass->get_accessible_type = eel_canvas_item_accessible_factory_get_accessible_type;
 }
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+static GType eel_canvas_item_accessible_factory_get_type (void);
+
+typedef AtkObjectFactory EelCanvasItemAccessibleFactory;
+typedef AtkObjectFactoryClass EelCanvasItemAccessibleFactoryClass;
+G_DEFINE_TYPE (EelCanvasItemAccessibleFactory, eel_canvas_item_accessible_factory,
+               ATK_TYPE_OBJECT_FACTORY)
+
+static void
+eel_canvas_item_accessible_factory_init (EelCanvasItemAccessibleFactory *accessible)
+{
+}
+
+#else
 static GType
 eel_canvas_item_accessible_factory_get_type (void)
 {
@@ -4295,6 +4372,7 @@ eel_canvas_item_accessible_factory_get_type (void)
 
     return type;
 }
+#endif
 
 /* Class initialization function for EelCanvasItemClass */
 static void
diff --git a/eel/eel-canvas.h b/eel/eel-canvas.h
index f641087..6491185 100644
--- a/eel/eel-canvas.h
+++ b/eel/eel-canvas.h
@@ -38,6 +38,9 @@
 #define EEL_CANVAS_H
 
 #include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(3, 2, 0)
+#include <gtk/gtk-a11y.h>
+#endif
 #include <gdk/gdk.h>
 #include <stdarg.h>
 
@@ -537,6 +540,23 @@ extern "C" {
     void eel_canvas_world_to_window (EelCanvas *canvas,
                                      double worldx, double worldy, double *winx, double *winy);
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+    GType eel_canvas_accessible_get_type (void);
+
+    typedef struct _EelCanvasAccessible EelCanvasAccessible;
+    typedef struct _EelCanvasAccessibleClass EelCanvasAccessibleClass;
+
+    struct _EelCanvasAccessible
+    {
+        GtkContainerAccessible parent;
+    };
+
+    struct _EelCanvasAccessibleClass
+    {
+        GtkContainerAccessibleClass parent_class;
+    };
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index f957fb9..ca3d87d 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -35,6 +35,9 @@
 #include <glib/gi18n-lib.h>
 #include <pango/pango.h>
 #include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(3, 2, 0)
+#include <gtk/gtk-a11y.h>
+#endif
 #include <gdk/gdkkeysyms.h>
 
 /* Some compatibility defines to let us build on both Gtk2 and Gtk3 */
@@ -137,7 +140,11 @@ static gint     eel_editable_label_focus_in                (GtkWidget
         GdkEventFocus         *event);
 static gint     eel_editable_label_focus_out               (GtkWidget             *widget,
         GdkEventFocus         *event);
+#if GTK_CHECK_VERSION(3, 2, 0)
+static GType      eel_editable_label_accessible_get_type   (void);
+#else
 static AtkObject *eel_editable_label_get_accessible        (GtkWidget             *widget);
+#endif
 static void     eel_editable_label_commit_cb               (GtkIMContext          *context,
         const gchar           *str,
         EelEditableLabel      *label);
@@ -278,7 +285,11 @@ eel_editable_label_class_init (EelEditableLabelClass *class)
     widget_class->key_release_event = eel_editable_label_key_release;
     widget_class->focus_in_event = eel_editable_label_focus_in;
     widget_class->focus_out_event = eel_editable_label_focus_out;
+#if GTK_CHECK_VERSION(3, 2, 0)
+    gtk_widget_class_set_accessible_type (widget_class, eel_editable_label_accessible_get_type ());
+#else
     widget_class->get_accessible = eel_editable_label_get_accessible;
+#endif
 
     class->move_cursor = eel_editable_label_move_cursor;
     class->delete_from_cursor = eel_editable_label_delete_from_cursor;
@@ -3701,6 +3712,20 @@ typedef struct
     gint position;
 } EelEditableLabelAccessiblePaste;
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+typedef struct _EelEditableLabelAccessible EelEditableLabelAccessible;
+typedef struct _EelEditableLabelAccessibleClass EelEditableLabelAccessibleClass;
+
+struct _EelEditableLabelAccessible
+{
+    GtkWidgetAccessible parent;
+};
+
+struct _EelEditableLabelAccessibleClass
+{
+    GtkWidgetAccessibleClass parent_class;
+};
+#endif
 
 static gchar*
 eel_editable_label_accessible_get_text (AtkText *text,
@@ -4555,6 +4580,34 @@ eel_editable_label_accessible_finalize (GObject *object)
     G_OBJECT_CLASS (a11y_parent_class)->finalize (object);
 }
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+static void
+eel_editable_label_accessible_class_init (EelEditableLabelAccessibleClass *klass)
+{
+    AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+    a11y_parent_class = g_type_class_peek_parent (klass);
+
+    atk_class->initialize = eel_editable_label_accessible_initialize;
+    atk_class->get_name = eel_editable_label_accessible_get_name;
+    atk_class->ref_state_set = eel_editable_label_accessible_ref_state_set;
+    gobject_class->finalize = eel_editable_label_accessible_finalize;
+}
+
+static void
+eel_editable_label_accessible_init (EelEditableLabelAccessible *accessible)
+{
+}
+
+G_DEFINE_TYPE_WITH_CODE (EelEditableLabelAccessible,
+                         eel_editable_label_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));
+#else
 static void
 eel_editable_label_accessible_class_init (AtkObjectClass *klass)
 {
@@ -4607,4 +4660,4 @@ eel_editable_label_get_accessible (GtkWidget *widget)
 
     return eel_accessibility_set_atk_object_return (widget, accessible);
 }
-
+#endif
diff --git a/eel/eel-labeled-image.c b/eel/eel-labeled-image.c
index d9ff49c..ad0127b 100644
--- a/eel/eel-labeled-image.c
+++ b/eel/eel-labeled-image.c
@@ -31,6 +31,9 @@
 #include "eel-gtk-extensions.h"
 #include "eel-accessibility.h"
 #include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(3, 2, 0)
+#include <gtk/gtk-a11y.h>
+#endif
 #include <gdk/gdkkeysyms.h>
 #include <atk/atkimage.h>
 
@@ -92,7 +95,11 @@ static GType         eel_labeled_image_radio_button_get_type  (void);
 static GType         eel_labeled_image_toggle_button_get_type (void);
 
 /* GtkWidgetClass methods */
+#if GTK_CHECK_VERSION(3, 2, 0)
+static GType eel_labeled_image_accessible_get_type (void);
+#else
 static AtkObject    *eel_labeled_image_get_accessible     (GtkWidget             *widget);
+#endif
 
 /* Private EelLabeledImage methods */
 static EelDimensions labeled_image_get_image_dimensions   (const EelLabeledImage *labeled_image);
@@ -593,7 +600,11 @@ eel_labeled_image_class_init (EelLabeledImageClass *labeled_image_class)
 #endif
     widget_class->map = eel_labeled_image_map;
     widget_class->unmap = eel_labeled_image_unmap;
+#if GTK_CHECK_VERSION(3, 2, 0)
+    gtk_widget_class_set_accessible_type (widget_class, eel_labeled_image_accessible_get_type ());
+#else
     widget_class->get_accessible = eel_labeled_image_get_accessible;
+#endif
 
     /* GtkContainerClass */
     container_class->add = eel_labeled_image_add;
@@ -2259,7 +2270,32 @@ static void
 eel_labeled_image_accessible_initialize (AtkObject *accessible,
         gpointer   widget)
 {
+#if GTK_CHECK_VERSION(3, 2, 0)
+    a11y_parent_class->initialize (accessible, widget);
+
+    if (GTK_IS_CHECK_BUTTON (widget))
+    {
+        atk_object_set_role (accessible, ATK_ROLE_CHECK_BOX);
+    }
+    else if (GTK_IS_RADIO_BUTTON (widget))
+    {
+        atk_object_set_role (accessible, ATK_ROLE_RADIO_BUTTON);
+    }
+    else if (GTK_IS_TOGGLE_BUTTON (widget))
+    {
+        atk_object_set_role (accessible, ATK_ROLE_TOGGLE_BUTTON);
+    }
+    else if (GTK_IS_BUTTON (widget))
+    {
+        atk_object_set_role (accessible, ATK_ROLE_PUSH_BUTTON);
+    }
+    else
+    {
+        atk_object_set_role (accessible, ATK_ROLE_IMAGE);
+    }
+#else
     a11y_parent_class->initialize (accessible, widget);
+#endif
 }
 
 static EelLabeledImage *
@@ -2321,6 +2357,40 @@ eel_labeled_image_accessible_image_interface_init (AtkImageIface *iface)
     iface->get_image_size = eel_labeled_image_accessible_image_get_size;
 }
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+typedef struct _EelLabeledImageAccessible EelLabeledImageAccessible;
+typedef struct _EelLabeledImageAccessibleClass EelLabeledImageAccessibleClass;
+
+struct _EelLabeledImageAccessible
+{
+    GtkContainerAccessible parent;
+};
+
+struct _EelLabeledImageAccessibleClass
+{
+    GtkContainerAccessibleClass parent_class;
+};
+
+G_DEFINE_TYPE_WITH_CODE (EelLabeledImageAccessible,
+                         eel_labeled_image_accessible,
+                         GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE,
+                                                eel_labeled_image_accessible_image_interface_init));
+static void
+eel_labeled_image_accessible_class_init (EelLabeledImageAccessibleClass *klass)
+{
+    AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+    a11y_parent_class = g_type_class_peek_parent (klass);
+
+    atk_class->get_name = eel_labeled_image_accessible_get_name;
+    atk_class->initialize = eel_labeled_image_accessible_initialize;
+}
+
+static void
+eel_labeled_image_accessible_init (EelLabeledImageAccessible *accessible)
+{
+}
+#else
 static void
 eel_labeled_image_accessible_class_init (AtkObjectClass *klass)
 {
@@ -2412,11 +2482,18 @@ eel_labeled_image_get_accessible (GtkWidget *widget)
 
     return eel_accessibility_set_atk_object_return (widget, accessible);
 }
+#endif
 
 static void
 eel_labeled_image_button_class_init (GtkWidgetClass *klass)
 {
+#if GTK_CHECK_VERSION(3, 2, 0)
+    gtk_widget_class_set_accessible_type (GTK_WIDGET_CLASS (klass),
+                                          eel_labeled_image_accessible_get_type ());
+
+#else
     klass->get_accessible = eel_labeled_image_get_accessible;
+#endif
 }
 
 static GType
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index 914cfb5..9fabebd 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -44,6 +44,9 @@
 #include <eel/eel-art-extensions.h>
 #include <eel/eel-editable-label.h>
 #include <eel/eel-string.h>
+#if GTK_CHECK_VERSION(3, 2, 0)
+#include <eel/eel-canvas.h>
+#endif
 #include <eel/eel-canvas-rect-ellipse.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
@@ -182,6 +185,21 @@ typedef struct
 
 static GType         caja_icon_container_accessible_get_type (void);
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+typedef struct _CajaIconContainerAccessible CajaIconContainerAccessible;
+typedef struct _CajaIconContainerAccessibleClass CajaIconContainerAccessibleClass;
+
+struct _CajaIconContainerAccessible
+{
+    EelCanvasAccessible parent;
+};
+
+struct _CajaIconContainerAccessibleClass
+{
+    EelCanvasAccessibleClass parent_class;
+};
+#endif
+
 static void          activate_selected_items                        (CajaIconContainer *container);
 static void          activate_selected_items_alternate              (CajaIconContainer *container,
         CajaIcon          *icon);
@@ -6234,6 +6252,7 @@ expose_event (GtkWidget      *widget,
 }
 #endif
 
+#if !GTK_CHECK_VERSION(3, 2, 0)
 static AtkObject *
 get_accessible (GtkWidget *widget)
 {
@@ -6249,6 +6268,7 @@ get_accessible (GtkWidget *widget)
 
     return eel_accessibility_set_atk_object_return (widget, accessible);
 }
+#endif
 
 static void
 grab_notify_cb  (GtkWidget        *widget,
@@ -6688,7 +6708,11 @@ caja_icon_container_class_init (CajaIconContainerClass *class)
     widget_class->motion_notify_event = motion_notify_event;
     widget_class->key_press_event = key_press_event;
     widget_class->popup_menu = popup_menu;
+#if GTK_CHECK_VERSION(3,2,0)
+    gtk_widget_class_set_accessible_type (widget_class, caja_icon_container_accessible_get_type ());
+#else
     widget_class->get_accessible = get_accessible;
+#endif
 #if GTK_CHECK_VERSION(3,0,0)
     widget_class->style_updated = style_updated;
 #else
@@ -10507,6 +10531,38 @@ caja_icon_container_accessible_finalize (GObject *object)
     G_OBJECT_CLASS (accessible_parent_class)->finalize (object);
 }
 
+#if GTK_CHECK_VERSION(3,2,0)
+static void
+caja_icon_container_accessible_init (CajaIconContainerAccessible *accessible)
+{
+}
+
+static void
+caja_icon_container_accessible_class_init (CajaIconContainerAccessibleClass *klass)
+{
+    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+    AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+
+    accessible_parent_class = g_type_class_peek_parent (klass);
+
+    gobject_class->finalize = caja_icon_container_accessible_finalize;
+
+    atk_class->get_n_children = caja_icon_container_accessible_get_n_children;
+    atk_class->ref_child = caja_icon_container_accessible_ref_child;
+    atk_class->initialize = caja_icon_container_accessible_initialize;
+
+    accessible_private_data_quark = g_quark_from_static_string ("icon-container-accessible-private-data");
+}
+
+G_DEFINE_TYPE_WITH_CODE (CajaIconContainerAccessible,
+                         caja_icon_container_accessible,
+                         eel_canvas_accessible_get_type (),
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION,
+                                                caja_icon_container_accessible_action_interface_init)
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION,
+                                                caja_icon_container_accessible_selection_interface_init));
+
+#else
 static void
 caja_icon_container_accessible_class_init (AtkObjectClass *klass)
 {
@@ -10557,6 +10613,7 @@ caja_icon_container_accessible_get_type (void)
 
     return type;
 }
+#endif
 
 #if ! defined (CAJA_OMIT_SELF_CHECK)
 
diff --git a/src/caja-zoom-control.c b/src/caja-zoom-control.c
index 4542430..4dbf205 100644
--- a/src/caja-zoom-control.c
+++ b/src/caja-zoom-control.c
@@ -37,6 +37,9 @@
 #include <eel/eel-graphic-effects.h>
 #include <eel/eel-gtk-extensions.h>
 #include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(3, 2, 0)
+#include <gtk/gtk-a11y.h>
+#endif
 #include <gdk/gdkkeysyms.h>
 #include <libcaja-private/caja-file-utilities.h>
 #include <libcaja-private/caja-global-preferences.h>
@@ -513,6 +516,7 @@ create_zoom_menu (CajaZoomControl *zoom_control)
     return menu;
 }
 
+#if !GTK_CHECK_VERSION(3, 2, 0)
 static AtkObject *
 caja_zoom_control_get_accessible (GtkWidget *widget)
 {
@@ -530,6 +534,7 @@ caja_zoom_control_get_accessible (GtkWidget *widget)
 
     return eel_accessibility_set_atk_object_return (widget, accessible);
 }
+#endif
 
 static void
 caja_zoom_control_change_value (CajaZoomControl *zoom_control,
@@ -673,7 +678,12 @@ caja_zoom_control_class_init (CajaZoomControlClass *class)
 
     widget_class = GTK_WIDGET_CLASS (class);
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+    gtk_widget_class_set_accessible_type (widget_class,
+                                          caja_zoom_control_accessible_get_type ());
+#else
     widget_class->get_accessible = caja_zoom_control_get_accessible;
+#endif
     widget_class->scroll_event = caja_zoom_control_scroll_event;
 
     class->change_value = caja_zoom_control_change_value;
@@ -952,6 +962,43 @@ caja_zoom_control_accessible_initialize (AtkObject *accessible,
     atk_object_set_role (accessible, ATK_ROLE_DIAL);
 }
 
+#if GTK_CHECK_VERSION(3, 2, 0)
+typedef struct _CajaZoomControlAccessible CajaZoomControlAccessible;
+typedef struct _CajaZoomControlAccessibleClass CajaZoomControlAccessibleClass;
+
+struct _CajaZoomControlAccessible
+{
+    GtkContainerAccessible parent;
+};
+
+struct _CajaZoomControlAccessibleClass
+{
+    GtkContainerAccessibleClass parent_class;
+};
+
+G_DEFINE_TYPE_WITH_CODE (CajaZoomControlAccessible,
+                         caja_zoom_control_accessible,
+                         GTK_TYPE_CONTAINER_ACCESSIBLE,
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION,
+                                                caja_zoom_control_accessible_action_interface_init)
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE,
+                                                caja_zoom_control_accessible_value_interface_init));
+static void
+caja_zoom_control_accessible_class_init (CajaZoomControlAccessibleClass *klass)
+{
+    AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+    accessible_parent_class = g_type_class_peek_parent (klass);
+
+    atk_class->get_name = caja_zoom_control_accessible_get_name;
+    atk_class->get_description = caja_zoom_control_accessible_get_description;
+    atk_class->initialize = caja_zoom_control_accessible_initialize;
+}
+
+static void
+caja_zoom_control_accessible_init (CajaZoomControlAccessible *accessible)
+{
+}
+#else
 static void
 caja_zoom_control_accessible_class_init (AtkObjectClass *klass)
 {
@@ -1000,6 +1047,7 @@ caja_zoom_control_accessible_get_type (void)
 
     return type;
 }
+#endif
 
 void
 caja_zoom_control_set_active_appearance (CajaZoomControl *zoom_control, gboolean is_active)
-- 
2.7.4


Reply to: