/+junk/libgego

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/libgego

« back to all changes in this revision

Viewing changes to src/gego_global_notify.c

  • Committer: Gustav Hartvigsson
  • Date: 2015-07-08 14:20:47 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150708142047-rmgvbdul1sff2p42
* Annotate everything!

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
static GegoGlobalNotify * _gego_global_notify_instance = NULL;
4
4
 
5
 
 
6
5
#define GEGO_GLOBAL_NOTIFY_GET_PRIVATE(o)\
7
6
  G_TYPE_INSTANCE_GET_PRIVATE (o, GEGO_TYPE_GLOBEL_NOTIFY, GegoGlobalNotifyPrivate)
8
7
 
30
29
 * GegoGlobalNotifyPrivate: (skip)
31
30
 *
32
31
 * @hash_table:
33
 
 * GHashTable<gchar *><GLinkedList<GegoCallbackItem*>*>*
 
32
 * GHashTable<gchar *><GLinkedList<GegoGlobalNotifyCallbackItem*>*>*
34
33
 */
35
 
struct
36
 
_GegoGlobalNotifyPrivate {
 
34
struct _GegoGlobalNotifyPrivate {
37
35
  /* < private > */
38
36
  GHashTable * hash_table;
 
37
  
39
38
};
40
39
 
41
40
 
47
46
 * @subscriber_data: The data provided by the subscriber_data.
48
47
 * @callback: The callback to be run.
49
48
 */
50
 
struct
51
 
_GegoCallbackItem {
 
49
struct _GegoCallbackItem {
52
50
  /* < private > */
53
51
  guint subscription_id;
54
52
  GQuark key_id;
56
54
  GCallback callback;
57
55
};
58
56
 
59
 
G_DEFINE_TYPE_WITH_PRIVATE (GegoGlobalNotify, gego_global_notify, G_TYPE_OBJECT)
 
57
G_DEFINE_TYPE_WITH_PRIVATE (GegoGlobalNotify, gego_global_notify, G_TYPE_OBJECT);
60
58
 
61
59
/**
62
60
 * gego_global_notify_new: (skip)
141
139
    g_set_error (err, GEGO_GLOBAL_NOTIFY_ERROR,
142
140
                 GEGO_GLOBAL_NOTIFY_ERROR_ALREADY_INITALIZED,
143
141
                 "The Global Notify system is already initialized.");
144
 
    return FALSE;
 
142
    return;
145
143
  }
146
144
  _gego_global_notify_instance = gego_global_notify_new ();
147
 
  return TRUE;
148
145
}
149
146
 
150
147
/**
264
261
 * return: #TRUE if Global Notify is initialized, otherwise #FALSE
265
262
 */
266
263
gboolean
267
 
gego_global_notify_is_initialized (void) {
 
264
gego_global_notify_is_initialized () {
268
265
  if (_gego_global_notify_instance == 0) {
269
266
    return TRUE;
270
267
  } else {
276
273
 * gego_global_notify_error_quark: (skip)
277
274
 */
278
275
GQuark
279
 
gego_global_notify_error_quark (void) {
 
276
gego_global_notify_error_quark () {
280
277
  return g_quark_from_static_string ("gego-global-notify-error-quark");
281
278
}
282
279