220
223
#define CAIRO_DOCK_LET_PASS_NOTIFICATION FALSE
223
GSList *cairo_dock_get_notifications_list (CairoDockNotificationType iNotifType);
225
/** Register an action to be called when a given notification is broadcasted.
226
*@param iNotifType type of the notification.
227
*@param pFunction callback.
228
*@param bRunFirst CAIRO_DOCK_RUN_FIRST to be called before Cairo-Dock, CAIRO_DOCK_RUN_AFTER to be called after.
229
*@param pUserData data to be passed as the first parameter of the callback.
231
void cairo_dock_register_notification (CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gboolean bRunFirst, gpointer pUserData);
233
/** Register an action to be called when a given notification is broadcasted from a given icon.
234
*@param pIcon the icon.
235
*@param iNotifType type of the notification.
236
*@param pFunction callback.
237
*@param bRunFirst CAIRO_DOCK_RUN_FIRST to be called before Cairo-Dock, CAIRO_DOCK_RUN_AFTER to be called after.
238
*@param pUserData data to be passed as the first parameter of the callback.
240
void cairo_dock_register_notification_on_icon (Icon *pIcon, CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gboolean bRunFirst, gpointer pUserData);
242
/** Register an action to be called when a given notification is broadcasted from a given container.
243
*@param pContainer the container.
244
*@param iNotifType type of the notification.
245
*@param pFunction callback.
246
*@param bRunFirst CAIRO_DOCK_RUN_FIRST to be called before Cairo-Dock, CAIRO_DOCK_RUN_AFTER to be called after.
247
*@param pUserData data to be passed as the first parameter of the callback.
249
void cairo_dock_register_notification_on_container (CairoContainer *pContainer, CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gboolean bRunFirst, gpointer pUserData);
251
/** Remove a callback from the list of callbacks for a given notification and a given data.
252
*@param iNotifType type of the notification.
253
*@param pFunction callback.
254
*@param pUserData data that was registerd with the callback.
256
void cairo_dock_remove_notification_func (CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gpointer pUserData);
258
/** Remove a callback from the list of callbacks of a given icon for a given notification and a given data.
259
*@param pIcon the icon for which the action has been registered.
260
*@param iNotifType type of the notification.
261
*@param pFunction callback.
262
*@param pUserData data that was registerd with the callback.
264
void cairo_dock_remove_notification_func_on_icon (Icon *pIcon, CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gpointer pUserData);
266
/** Remove a callback from the list of callbacks of a given container for a given notification and a given data.
267
*@param pContainer the container for which the action has been registered.
268
*@param iNotifType type of the notification.
269
*@param pFunction callback.
270
*@param pUserData data that was registerd with the callback.
272
void cairo_dock_remove_notification_func_on_container (CairoContainer *pContainer, CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gpointer pUserData);
226
//GSList *cairo_dock_get_notifications_list (CairoDockNotificationType iNotifType);
228
/* Register an action to be called when a given notification is broadcasted.
229
*@param iNotifType type of the notification.
230
*@param pFunction callback.
231
*@param bRunFirst CAIRO_DOCK_RUN_FIRST to be called before Cairo-Dock, CAIRO_DOCK_RUN_AFTER to be called after.
232
*@param pUserData data to be passed as the first parameter of the callback.
234
//void cairo_dock_register_notification (CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gboolean bRunFirst, gpointer pUserData);
236
/* Remove a callback from the list of callbacks for a given notification and a given data.
237
*@param iNotifType type of the notification.
238
*@param pFunction callback.
239
*@param pUserData data that was registerd with the callback.
241
//void cairo_dock_remove_notification_func (CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gpointer pUserData);
275
244
#define _cairo_dock_notify(pNotificationRecordList, bStop, ...) do {\
283
252
pElement = pNextElement; } }\
286
/** Broadcast a notification.
255
/* Broadcast a notification.
287
256
*@param iNotifType type of the notification.
288
257
*@param ... parameters to be passed to the callbacks that has registerd to this notification.
290
#define cairo_dock_notify(iNotifType, ...) do {\
259
/*#define cairo_dock_notify(iNotifType, ...) do {\
291
260
gboolean bStop = FALSE;\
292
261
GSList *pNotificationRecordList = cairo_dock_get_notifications_list (iNotifType);\
293
262
_cairo_dock_notify(pNotificationRecordList, bStop, ##__VA_ARGS__);\
296
/** Broadcast a notification from a given icon.
265
/* Broadcast a notification from a given icon.
297
266
*@param pIcon the icon.
298
267
*@param iNotifType type of the notification.
299
268
*@param ... parameters to be passed to the callbacks that has registerd to this notification.
301
#define cairo_dock_notify_on_icon(pIcon, iNotifType, ...) do {\
270
/*#define cairo_dock_notify_on_icon(pIcon, iNotifType, ...) do {\
302
271
gboolean bStop = FALSE;\
303
272
GSList *pNotificationRecordList = cairo_dock_get_notifications_list (iNotifType);\
304
273
_cairo_dock_notify(pNotificationRecordList, bStop, ##__VA_ARGS__);\
305
if (pIcon && pIcon->pNotificationsTab) {\
306
GSList *pNotificationRecordList = g_ptr_array_index (pIcon->pNotificationsTab, iNotifType);\
307
_cairo_dock_notify(pNotificationRecordList, bStop, ##__VA_ARGS__);}\
274
if (! bStop && pIcon) {\
275
cairo_dock_notify_on_object (pIcon, iNotifType, ##__VA_ARGS__); }\
310
/** Broadcast a notification from a given container.
278
/* Broadcast a notification from a given container.
311
279
*@param pContainer the container.
312
280
*@param iNotifType type of the notification.
313
281
*@param ... parameters to be passed to the callbacks that has registerd to this notification.
315
#define cairo_dock_notify_on_container(pContainer, iNotifType, ...) do {\
283
/*#define cairo_dock_notify_on_container(pContainer, iNotifType, ...) do {\
316
284
gboolean bStop = FALSE;\
317
285
GSList *pNotificationRecordList = cairo_dock_get_notifications_list (iNotifType);\
318
286
_cairo_dock_notify(pNotificationRecordList, bStop, ##__VA_ARGS__);\
319
if (pContainer && pContainer->pNotificationsTab) {\
320
GSList *pNotificationRecordList = g_ptr_array_index (pContainer->pNotificationsTab, iNotifType);\
321
_cairo_dock_notify(pNotificationRecordList, bStop, ##__VA_ARGS__);}\
287
if (! bStop && pContainer) {\
288
cairo_dock_notify_on_object (pContainer, iNotifType, ##__VA_ARGS__); }\
325
292
void cairo_dock_free_notification_table (GPtrArray *pNotificationsTab);
295
#define cairo_dock_install_notifications_on_object(pObject, iNbNotifs) do {\
296
GPtrArray **pNotificationsTabPtr = (GPtrArray**) pObject;\
297
GPtrArray *pNotificationsTab = g_ptr_array_new ();\
298
g_ptr_array_set_size (pNotificationsTab, iNbNotifs);\
299
*pNotificationsTabPtr = pNotificationsTab; } while (0)
301
#define cairo_dock_clear_notifications_on_object(pObject) do {\
302
GPtrArray **pNotificationsTabPtr = (GPtrArray**) pObject;\
303
GPtrArray *pNotificationsTab = *pNotificationsTabPtr;\
304
cairo_dock_free_notification_table (pNotificationsTab); } while (0)
306
/** Register an action to be called when a given notification is broadcasted from a given object.
307
*@param pObject the object (Icon, Container, Manager).
308
*@param iNotifType type of the notification.
309
*@param pFunction callback.
310
*@param bRunFirst CAIRO_DOCK_RUN_FIRST to be called before Cairo-Dock, CAIRO_DOCK_RUN_AFTER to be called after.
311
*@param pUserData data to be passed as the first parameter of the callback.
313
void cairo_dock_register_notification_on_object (gpointer pObject, CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gboolean bRunFirst, gpointer pUserData);
315
/** Remove a callback from the list of callbacks of a given object for a given notification and a given data.
316
*@param pObject the object (Icon, Container, Manager) for which the action has been registered.
317
*@param iNotifType type of the notification.
318
*@param pFunction callback.
319
*@param pUserData data that was registerd with the callback.
321
void cairo_dock_remove_notification_func_on_object (gpointer pObject, CairoDockNotificationType iNotifType, CairoDockNotificationFunc pFunction, gpointer pUserData);
323
/** Broadcast a notification on a given object.
324
*@param pObject the object (Icon, Container, Manager).
325
*@param iNotifType type of the notification.
326
*@param ... parameters to be passed to the callbacks that has registerd to this notification.
327
*@return whether the notification has been intercepted or not.
329
#define cairo_dock_notify_on_object(pObject, iNotifType, ...) \
331
gboolean _bStop = FALSE;\
332
if (pObject != NULL) {\
333
GPtrArray **pNotificationsTabPtr = (GPtrArray**) pObject;\
334
GPtrArray *pNotificationsTab = *pNotificationsTabPtr;\
335
if (pNotificationsTab && iNotifType < pNotificationsTab->len) {\
336
GSList *pNotificationRecordList = g_ptr_array_index (pNotificationsTab, iNotifType);\
337
_cairo_dock_notify (pNotificationRecordList, _bStop, ##__VA_ARGS__);} }\