示例#1
0
int 
e_mod_notify_init(void) 
{
   /* init notification subsystem */
   if (!e_notification_daemon_init()) return 0;

   _notify_daemon = 
     e_notification_daemon_add("illume-indicator", "Enlightenment");

   e_notification_daemon_callback_notify_set(_notify_daemon, 
                                             _e_mod_notify_cb_add);
   e_notification_daemon_callback_close_notification_set(_notify_daemon, 
                                                         _e_mod_notify_cb_del);

   return 1;
}
示例#2
0
int
main()
{
  E_Notification_Daemon *d;
  E_Notification *n;
  Daemon_Data *dd;


  ecore_init();

  dd = calloc(1, sizeof(Daemon_Data));
  dd->open_notes = NULL;
  dd->history = NULL;
  dd->next_id = dd->history_start = 1;
  dd->max_history_length = 5;
  dd->default_timeout = 5;

  /* set up the daemon */
  d = e_notification_daemon_add("e_notification_module", "Enlightenment");
  e_notification_daemon_data_set(d, dd);
  dd->daemon = d;
  e_notification_daemon_callback_notify_set(d, cb_notify);
  e_notification_daemon_callback_close_notification_set(d, cb_close_notification);

  ecore_main_loop_begin();
  while (dd->open_notes)
    {
       n = eina_list_data_get(dd->open_notes);
       e_notification_unref(n);
       dd->open_notes = eina_list_remove_list(dd->open_notes, dd->open_notes);
    }
  while (dd->history)
    {
       n = eina_list_data_get(dd->history);
       e_notification_unref(n);
       dd->history = eina_list_remove_list(dd->history, dd->history);
    }
  free(dd);
  e_notification_daemon_free(d);
  ecore_shutdown();

  return 0;
}