After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678037 - Export adaptor_init() and adaptor_cleanup()
Export adaptor_init() and adaptor_cleanup()
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-atk
unspecified
Other All
: Normal normal
: ---
Assigned To: Li Yuan
At-spi maintainer(s)
Depends on: 678036
Blocks: 678051
 
 
Reported: 2012-06-13 16:21 UTC by Bastien Nocera
Modified: 2012-06-14 17:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Export adaptor_init() and adaptor_cleanup() (3.30 KB, patch)
2012-06-13 16:21 UTC, Bastien Nocera
committed Details | Review
Move GTK+ modules to their own source files (7.03 KB, patch)
2012-06-13 16:22 UTC, Bastien Nocera
committed Details | Review
Create an uninstalled library (1.62 KB, patch)
2012-06-13 16:24 UTC, Bastien Nocera
committed Details | Review
Link the GTK+ modules against the private library (2.91 KB, patch)
2012-06-13 16:24 UTC, Bastien Nocera
accepted-commit_now Details | Review
Move adaptor_*() functions into their own header (3.79 KB, patch)
2012-06-13 16:24 UTC, Bastien Nocera
committed Details | Review
Link the GTK+ modules against the private library (2.91 KB, patch)
2012-06-13 16:28 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2012-06-13 16:21:15 UTC
.
Comment 1 Bastien Nocera 2012-06-13 16:21:16 UTC
Created attachment 216302 [details] [review]
Export adaptor_init() and adaptor_cleanup()
Comment 2 Bastien Nocera 2012-06-13 16:22:29 UTC
Created attachment 216303 [details] [review]
Move GTK+ modules to their own source files
Comment 3 Bastien Nocera 2012-06-13 16:24:02 UTC
Created attachment 216305 [details] [review]
Create an uninstalled library
Comment 4 Bastien Nocera 2012-06-13 16:24:10 UTC
Created attachment 216306 [details] [review]
Link the GTK+ modules against the private library
Comment 5 Bastien Nocera 2012-06-13 16:24:17 UTC
Created attachment 216307 [details] [review]
Move adaptor_*() functions into their own header
Comment 6 Bastien Nocera 2012-06-13 16:28:37 UTC
Created attachment 216308 [details] [review]
Link the GTK+ modules against the private library
Comment 7 Mike Gorse 2012-06-13 18:20:15 UTC
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
Comment 8 Mike Gorse 2012-06-13 18:51:17 UTC
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.
Comment 9 Mike Gorse 2012-06-13 20:55:39 UTC
Going forward, Clutter could depend on libatk-bridge (bug 678051) and call atk_bridge_adaptor_init.
Comment 10 Bastien Nocera 2012-06-14 11:28:37 UTC
Attachment 216302 [details] pushed as 4ec12f8 - Export adaptor_init() and adaptor_cleanup()
Attachment 216305 [details] pushed as 6cb355e - Create an uninstalled library
Comment 11 Alejandro Piñeiro Iglesias (IRC: infapi00) 2012-06-14 11:37:19 UTC
(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.
Comment 12 Alejandro Piñeiro Iglesias (IRC: infapi00) 2012-06-14 11:44:10 UTC
> (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.
Comment 13 Alejandro Piñeiro Iglesias (IRC: infapi00) 2012-06-14 13:10:18 UTC
Added dependency to bug 678036, because if you don't apply patches at that bug, patches uploaded here doesn't apply fine.
Comment 14 Mike Gorse 2012-06-14 16:53:44 UTC
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.
Comment 15 Bastien Nocera 2012-06-14 16:58:43 UTC
(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.
Comment 16 Bastien Nocera 2012-06-14 17:00:44 UTC
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
Comment 17 Bastien Nocera 2012-06-14 17:14:25 UTC
Attachment 216308 [details] pushed as a80c880 - Link the GTK+ modules against the private library