Fixed some problems when shutting down and restarting the module
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / accessible-cache.h
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2010 Codethink Ltd.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef ACCESSIBLE_CACHE_H
24 #define ACCESSIBLE_CACHE_H
25
26 #include <glib.h>
27 #include <glib-object.h>
28
29 typedef struct _SpiCache SpiCache;
30 typedef struct _SpiCacheClass SpiCacheClass;
31
32 G_BEGIN_DECLS
33
34 #define SPI_CACHE_TYPE        (spi_cache_get_type ())
35 #define SPI_CACHE(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_CACHE_TYPE, SpiCache))
36 #define SPI_CACHE_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_CACHE_TYPE, SpiCacheClass))
37 #define SPI_IS_CACHE(o)       (G_TYPE_CHECK__INSTANCE_TYPE ((o), SPI_CACHE_TYPE))
38 #define SPI_IS_CACHE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SPI_CACHE_TYPE))
39
40 struct _SpiCache
41 {
42   GObject parent;
43
44   GHashTable * objects;
45   GQueue *add_traversal;
46   gint add_pending_idle;
47
48   guint child_added_listener;
49 };
50
51 struct _SpiCacheClass
52 {
53   GObjectClass parent_class;
54 };
55
56 GType spi_cache_get_type (void);
57
58 extern SpiCache *spi_global_cache;
59
60 void
61 spi_cache_foreach (SpiCache * cache, GHFunc func, gpointer data);
62
63 gboolean
64 spi_cache_in (SpiCache * cache, GObject * object);
65
66 G_END_DECLS
67 #endif /* ACCESSIBLE_CACHE_H */