4fa694735fe3d99ba7c6afc25a673f2ef13016aa
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / gtk-2.0 / module.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2008, 2009 Codethink Ltd.
6  * Copyright 2001, 2002, 2003 Sun Microsystems Inc.,
7  * Copyright 2001, 2002, 2003 Ximian, Inc.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #define _GNU_SOURCE
26 #include "config.h"
27
28 #include <gmodule.h>
29
30 #include "bridge.h"
31
32 /*---------------------------------------------------------------------------*/
33
34 int
35 gtk_module_init (gint * argc, gchar ** argv[])
36 {
37   const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE");
38
39   if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0)
40     {
41       return adaptor_init (argc, argv);
42     }
43   return 0;
44 }
45
46 gchar*
47 g_module_check_init (GModule *module)
48 {
49   g_module_make_resident (module);
50
51   return NULL;
52 }
53
54 void
55 gnome_accessibility_module_init (void)
56 {
57   const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE");
58
59   if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0)
60     {
61       adaptor_init (NULL, NULL);
62
63       if (g_getenv ("AT_SPI_DEBUG"))
64         {
65           g_print ("Atk Accessibility bridge initialized\n");
66         }
67     }
68 }
69
70 void
71 gnome_accessibility_module_shutdown (void)
72 {
73     adaptor_cleanup ();
74 }