20
20
* GegoGlobalNotify:
21
* @short_description: aoeu
25
26
////////////////////////////////////////////////////////////////////////////////
27
struct GegoGlobalNotifyPrivate {
28
/* <--- private ---> */
29
GHashTable * hash_table; /* GHashTable<gchar *><GLinkedList<GegoGlobalNotifyCallbackItem*>*>* */
29
* GegoGlobalNotifyPrivate: (skip)
32
* GHashTable<gchar *><GLinkedList<GegoGlobalNotifyCallbackItem*>*>*
34
struct _GegoGlobalNotifyPrivate {
36
GHashTable * hash_table;
33
struct GegoCallbackItem {
34
/* <--- private ---> */
42
* GegoCallbackItem: (skip)
44
* @subscription_id: The id of the subscriber.
45
* @key_id: The key id of the callback.
46
* @subscriber_data: The data provided by the subscriber_data.
47
* @callback: The callback to be run.
49
struct _GegoCallbackItem {
35
51
guint subscription_id;
37
53
gpointer subscriber_data;
41
57
G_DEFINE_TYPE_WITH_PRIVATE (GegoGlobalNotify, gego_global_notify, G_TYPE_OBJECT);
60
* gego_global_notify_new: (skip)
44
65
gego_global_notify_new (void) {
45
66
GegoGlobalNotify * self = g_object_new (GEGO_TYPE_GLOBEL_NOTIFY, NULL, NULL);
98
134
* @err: (allow-none): NULL'ed errer to be passed to function.
101
gego_global_notify_initalize (GError * err) {
137
gego_global_notify_initalize (GError ** err) {
102
138
if (_gego_global_notify_instance != NULL) {
103
err = g_error_new (GEGO_GLOBAL_NOTIFY_ERROR,
139
g_set_error (err, GEGO_GLOBAL_NOTIFY_ERROR,
104
140
GEGO_GLOBAL_NOTIFY_ERROR_ALREADY_INITALIZED,
105
141
"The Global Notify system is already initialized.");
117
153
* @err: (allow-none):NULL'ed errer to be passed to function.
120
gego_global_notify_uninitalize (GError * err) {
156
gego_global_notify_uninitalize (GError ** err) {
157
gego_global_notify_return_not_initialized(err);
121
158
g_object_unref (_gego_global_notify_instance);
132
169
* return: GUI for that callbacks. negative value on fail.
135
gego_global_notify_add_notification (gchar * name, GError * err) {
172
gego_global_notify_add_notification (gchar * name, GError ** err) {
173
gego_global_notify_return_not_initialized(err);
173
213
* returns: the subscription id of the signal.
176
gego_global_notify_subscribe (gchar * name, GCallback callback, gpointer subscriber_data, GError * err);
216
gego_global_notify_subscribe (gchar * name,
218
gpointer subscriber_data,
220
gego_global_notify_return_not_initialized(err);
179
225
* gego_global_notify_unsubscribe:
180
* @short_description: removes a callback from a
226
* @short_description: removes a callback from a notify.
228
* @name: The name of the notify to unsubscribed to.
229
* @subscription_id: The Subscription ID that was got when the subscription was.
231
* @err: (out)(allow-none): Error to be filled with an error if such has occured.
183
gego_global_notify_unsubscribe (gchar * name, gint subscription_id, GError * err);
234
gego_global_notify_unsubscribe (gchar * name,
235
gint subscription_id,
237
gego_global_notify_return_not_initialized(err);
242
* gego_global_notify_call:
243
* @short_description: Calls all subscribers to a notify.
245
* @name: The name of the notify to call.
246
* @caller_data: The data to be passed to the callback.
247
* @err: (out)(allow-none): Error to be filled with an error if such has occured.
186
gego_global_notify_call (gchar * name, gpointer caller_data, GError * err);
250
gego_global_notify_call (gchar * name,
251
gpointer caller_data,
253
gego_global_notify_return_not_initialized(err);
189
258
* gego_global_notify_is_initialized:
192
261
* return: #TRUE if Global Notify is initialized, otherwise #FALSE
195
gego_global_notify_is_initialized (void);
264
gego_global_notify_is_initialized () {
265
if (_gego_global_notify_instance == 0) {
198
273
* gego_global_notify_error_quark: (skip)
201
gego_global_notify_error_quark (void) {
276
gego_global_notify_error_quark () {
202
277
return g_quark_from_static_string ("gego-global-notify-error-quark");
281
* gego_global_notify_error_get_name:
282
* @short_description: Get the string name of the #GegoGlobalNotifyError.
284
* @k: The error to get the name of.
286
* Anagalius to GegoGlobalNotifyErrorName[k], but included for binding
289
* return: The string containing the name of the error. Or NULL on fail.
292
gego_global_notify_error_get_name (GegoGlobalNotifyError k) {
293
if (k > GEGO_GLOBAL_NOTIFY_ERROR_LAST) {
296
return GegoGlobalNotifyErrorName[k];