Kaydet (Commit) cfcae648 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#92293 gtk3: get a11y working

(cherry picked from commit 093d7b81)

Change-Id: I89cfde9b4c97852d36817b716ac08bd32096915b
üst 7f939c3e
......@@ -471,6 +471,7 @@ public:
extern "C" {
GType ooo_fixed_get_type();
AtkObject* ooo_fixed_get_accessible(GtkWidget *obj);
} // extern "C"
......
......@@ -27,7 +27,6 @@
bool InitAtkBridge()
{
#if !GTK_CHECK_VERSION(3,0,0)
const char* pVersion = atk_get_toolkit_version();
if( ! pVersion )
return false;
......@@ -57,16 +56,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: */
......@@ -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 )
{
......
......@@ -971,6 +971,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.
......@@ -986,10 +997,14 @@ ooo_fixed_get_type()
static const GTypeInfo tinfo =
{
sizeof (GtkFixedClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) NULL, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
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 */
0, /* nb preallocs */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment