]> Pileus Git - ~andy/gtk/blob - gtk/gactionobservable.h
ae6ac314cb24232164886d831a80ddf62852dbd4
[~andy/gtk] / gtk / gactionobservable.h
1 /*
2  * Copyright © 2011 Canonical Limited
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * licence or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
17  * USA.
18  *
19  * Authors: Ryan Lortie <desrt@desrt.ca>
20  */
21
22 #ifndef __G_ACTION_OBSERVABLE_H__
23 #define __G_ACTION_OBSERVABLE_H__
24
25 #include <gtk/gactionobserver.h>
26
27 G_BEGIN_DECLS
28
29 #define G_TYPE_ACTION_OBSERVABLE                            (g_action_observable_get_type ())
30 #define G_ACTION_OBSERVABLE(inst)                           (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
31                                                              G_TYPE_ACTION_OBSERVABLE, GActionObservable))
32 #define G_IS_ACTION_OBSERVABLE(inst)                        (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
33                                                              G_TYPE_ACTION_OBSERVABLE))
34 #define G_ACTION_OBSERVABLE_GET_IFACE(inst)                 (G_TYPE_INSTANCE_GET_INTERFACE ((inst),                  \
35                                                              G_TYPE_ACTION_OBSERVABLE, GActionObservableInterface))
36
37 typedef struct _GActionObservableInterface                  GActionObservableInterface;
38
39 struct _GActionObservableInterface
40 {
41   GTypeInterface g_iface;
42
43   void (* register_observer)   (GActionObservable *observable,
44                                 const gchar       *action_name,
45                                 GActionObserver   *observer);
46   void (* unregister_observer) (GActionObservable *observable,
47                                 const gchar       *action_name,
48                                 GActionObserver   *observer);
49 };
50
51 G_GNUC_INTERNAL
52 GType                   g_action_observable_get_type                    (void);
53 G_GNUC_INTERNAL
54 void                    g_action_observable_register_observer           (GActionObservable  *observable,
55                                                                          const gchar        *action_name,
56                                                                          GActionObserver    *observer);
57 G_GNUC_INTERNAL
58 void                    g_action_observable_unregister_observer         (GActionObservable  *observable,
59                                                                          const gchar        *action_name,
60                                                                          GActionObserver    *observer);
61
62 G_END_DECLS
63
64 #endif /* __G_ACTION_OBSERVABLE_H__ */