summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-26 13:24:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-26 13:52:22 +0100
commit093d7b8142d0cb224fcf23506f3b36f7a3a10d2c (patch)
treec3bfcf9668e683671a7f902c1fa6bbf62cb7fa94 /vcl
parent6d0a9ccffe57d0438f46ccd0f4e63c06a9e1c9eb (diff)
Resolves: tdf#92293 gtk3: get a11y working
Change-Id: I89cfde9b4c97852d36817b716ac08bd32096915b
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx1
-rw-r--r--vcl/unx/gtk/a11y/atkbridge.cxx4
-rw-r--r--vcl/unx/gtk/a11y/atkfactory.cxx5
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx15
4 files changed, 21 insertions, 4 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index f759bf6caae2..5086d14ff315 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -471,6 +471,7 @@ public:
extern "C" {
GType ooo_fixed_get_type();
+AtkObject* ooo_fixed_get_accessible(GtkWidget *obj);
} // extern "C"
diff --git a/vcl/unx/gtk/a11y/atkbridge.cxx b/vcl/unx/gtk/a11y/atkbridge.cxx
index 9f14e08a34af..4bfe5b2f3092 100644
--- a/vcl/unx/gtk/a11y/atkbridge.cxx
+++ b/vcl/unx/gtk/a11y/atkbridge.cxx
@@ -26,7 +26,6 @@
bool InitAtkBridge()
{
-#if !GTK_CHECK_VERSION(3,0,0)
const char* pVersion = atk_get_toolkit_version();
if( ! pVersion )
return false;
@@ -56,16 +55,13 @@ bool InitAtkBridge()
AtkRegistry * registry = atk_get_default_registry();
if( registry )
atk_registry_set_factory_type( registry, OOO_TYPE_FIXED, OOO_TYPE_WRAPPER_FACTORY );
-#endif
return true;
}
void DeInitAtkBridge()
{
-#if !GTK_CHECK_VERSION(3,0,0)
restore_gail_window_vtable();
-#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx
index 581f4d0091ac..b6beda5a29ad 100644
--- a/vcl/unx/gtk/a11y/atkfactory.cxx
+++ b/vcl/unx/gtk/a11y/atkfactory.cxx
@@ -140,6 +140,11 @@ wrapper_factory_create_accessible( GObject *obj )
return NULL;
}
+AtkObject* ooo_fixed_get_accessible(GtkWidget *obj)
+{
+ return wrapper_factory_create_accessible(G_OBJECT(obj));
+}
+
static void
wrapper_factory_class_init( AtkObjectFactoryClass *klass )
{
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 94bdbcea408e..d9d57afac124 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -970,6 +970,17 @@ void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
window_resize(nWidth, nHeight);
}
+#if GTK_CHECK_VERSION(3,2,0)
+
+static void
+ooo_fixed_class_init(GtkFixedClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ widget_class->get_accessible = ooo_fixed_get_accessible;
+}
+
+#endif
+
/*
* Always use a sub-class of GtkFixed we can tag for a11y. This allows us to
* utilize GAIL for the toplevel window and toolkit implementation incl.
@@ -987,7 +998,11 @@ ooo_fixed_get_type()
sizeof (GtkFixedClass),
nullptr, /* base init */
nullptr, /* base finalize */
+#if GTK_CHECK_VERSION(3,2,0)
+ reinterpret_cast<GClassInitFunc>(ooo_fixed_class_init), /* class init */
+#else
nullptr, /* class init */
+#endif
nullptr, /* class finalize */
NULL, /* class data */
sizeof (GtkFixed), /* instance size */