GNOME Bugzilla – Bug 678037
Export adaptor_init() and adaptor_cleanup()
Last modified: 2012-06-14 17:14:29 UTC
.
Created attachment 216302 [details] [review] Export adaptor_init() and adaptor_cleanup()
Created attachment 216303 [details] [review] Move GTK+ modules to their own source files
Created attachment 216305 [details] [review] Create an uninstalled library
Created attachment 216306 [details] [review] Link the GTK+ modules against the private library
Created attachment 216307 [details] [review] Move adaptor_*() functions into their own header
Created attachment 216308 [details] [review] Link the GTK+ modules against the private library
Comment on attachment 216302 [details] [review] Export adaptor_init() and adaptor_cleanup() >From 7a19798701300518206e2ef8bed08e875501e87f Mon Sep 17 00:00:00 2001 >From: Bastien Nocera <hadess@hadess.net> >Date: Wed, 13 Jun 2012 16:15:45 +0100 >Subject: [PATCH] Export adaptor_init() and adaptor_cleanup() > >https://bugzilla.gnome.org/show_bug.cgi?id=678037 >--- > atk-adaptor/bridge.c | 86 +++++++++++++++++++++++++++----------------------- > atk-adaptor/bridge.h | 2 ++ > 2 files changed, 48 insertions(+), 40 deletions(-) > >diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c >index faec393..97a5f1d 100644 >--- a/atk-adaptor/bridge.c >+++ b/atk-adaptor/bridge.c >@@ -769,7 +769,7 @@ signal_filter (DBusConnection *bus, DBusMessage *message, void *user_data) > * - Application registration with the AT-SPI registry. > * > */ >-static int >+int > adaptor_init (gint * argc, gchar ** argv[]) > { > GOptionContext *opt; >@@ -911,46 +911,8 @@ adaptor_init (gint * argc, gchar ** argv[]) > return 0; > } > >-/*---------------------------------------------------------------------------*/ >- >-int >-gtk_module_init (gint * argc, gchar ** argv[]) >-{ >- const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE"); >- >- if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0) >- { >- return adaptor_init (argc, argv); >- } >- return 0; >-} >- >-gchar* >-g_module_check_init (GModule *module) >-{ >- g_module_make_resident (module); >- >- return NULL; >-} >- > void >-gnome_accessibility_module_init (void) >-{ >- const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE"); >- >- if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0) >- { >- adaptor_init (NULL, NULL); >- >- if (g_getenv ("AT_SPI_DEBUG")) >- { >- g_print ("Atk Accessibility bridge initialized\n"); >- } >- } >-} >- >-void >-gnome_accessibility_module_shutdown (void) >+adaptor_cleanup (void) > { > GList *l; > GSList *ls; >@@ -1002,6 +964,50 @@ gnome_accessibility_module_shutdown (void) > > /*---------------------------------------------------------------------------*/ > >+int >+gtk_module_init (gint * argc, gchar ** argv[]) >+{ >+ const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE"); >+ >+ if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0) >+ { >+ return adaptor_init (argc, argv); >+ } >+ return 0; >+} >+ >+gchar* >+g_module_check_init (GModule *module) >+{ >+ g_module_make_resident (module); >+ >+ return NULL; >+} >+ >+void >+gnome_accessibility_module_init (void) >+{ >+ const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE"); >+ >+ if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0) >+ { >+ adaptor_init (NULL, NULL); >+ >+ if (g_getenv ("AT_SPI_DEBUG")) >+ { >+ g_print ("Atk Accessibility bridge initialized\n"); >+ } >+ } >+} >+ >+void >+gnome_accessibility_module_shutdown (void) >+{ >+ adaptor_cleanup (); >+} >+ >+/*---------------------------------------------------------------------------*/ >+ > static gchar *name_match_tmpl = > "type='signal', interface='org.freedesktop.DBus', member='NameOwnerChanged', arg0='%s'"; > >diff --git a/atk-adaptor/bridge.h b/atk-adaptor/bridge.h >index c24183e..949af30 100644 >--- a/atk-adaptor/bridge.h >+++ b/atk-adaptor/bridge.h >@@ -66,6 +66,8 @@ char *app_bus_addr; > > extern SpiBridge *spi_global_app_data; > >+int adaptor_init (gint * argc, gchar ** argv[]); >+void adaptor_cleanup (void); > void spi_atk_add_client (const char *bus_name); > void spi_atk_remove_client (const char *bus_name); > >-- >1.7.10.2
It looks as though you removed gnome_accessibility_module_init from the gtk 3 module. Did you intend to do this? Alex, would doing this affect Clutter? I don't see anything useful if I grep atk-bridge in the clutter source, so I'm not sure how it ends up being loaded.
Going forward, Clutter could depend on libatk-bridge (bug 678051) and call atk_bridge_adaptor_init.
Attachment 216302 [details] pushed as 4ec12f8 - Export adaptor_init() and adaptor_cleanup() Attachment 216305 [details] pushed as 6cb355e - Create an uninstalled library
(In reply to comment #8) > It looks as though you removed gnome_accessibility_module_init from the gtk 3 > module. Did you intend to do this? > Alex, would doing this affect Clutter? I don't see anything useful if I grep > atk-bridge in the clutter source, so I'm not sure how it ends up being loaded. Because the atk-bridge loading was done on gnome-shell itself. This was required because gnome-shell is also a GTK+ application, so I needed to use NO_GAIL and NO_AT_BRIDGE to avoid the usual multi-toolkit problem. (In reply to comment #9) > Going forward, Clutter could depend on libatk-bridge (bug 678051) and call > atk_bridge_adaptor_init. As previous is still valid, I think that it would be GNOME-Shell the one requiring that dependency.
> (In reply to comment #9) > > > Going forward, Clutter could depend on libatk-bridge (bug 678051) and call > > atk_bridge_adaptor_init. > > As previous is still valid, I think that it would be GNOME-Shell the one > requiring that dependency. Anyway, as discussed on IRC with Bastien, I will test this directly on clutter, to see if it is possible there. Again, that would be easier with a sensible AtkUtil.
Added dependency to bug 678036, because if you don't apply patches at that bug, patches uploaded here doesn't apply fine.
Comment on attachment 216303 [details] [review] Move GTK+ modules to their own source files I just looked at the gnome-shell source, and it is calling gnome_accessibility_module_init, but we can just file a bug against gnome-shell to change that.
(In reply to comment #14) > (From update of attachment 216303 [details] [review]) > I just looked at the gnome-shell source, and it is calling > gnome_accessibility_module_init, but we can just file a bug against gnome-shell > to change that. We already have a patch in bug 678095. Reusing the libgnome from GNOME 2.x hooks was gross anyway.
Attachment 216303 [details] pushed as 870da4f - Move GTK+ modules to their own source files Attachment 216307 [details] pushed as ed83098 - Move adaptor_*() functions into their own header
Attachment 216308 [details] pushed as a80c880 - Link the GTK+ modules against the private library