Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : proto

Dir     : e17/proto/e_dbus/src/lib/notification


Modified Files:
        E_Notify.h notification.c 
Added Files:
        Makefile.am marshal.c notification-spec-0.9.txt 


Log Message:
add notification wrappers (untested)

===================================================================
RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/E_Notify.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- E_Notify.h  11 Jul 2007 00:43:30 -0000      1.1
+++ E_Notify.h  11 Jul 2007 00:44:21 -0000      1.2
@@ -5,43 +5,52 @@
 #include <Evas.h>
 #include <E_DBus.h>
 
-typedef struct _E_Notification_Daemon E_Notification_Daemon;
+#define E_NOTIFICATION_INTERFACE "org.freedesktop.Notifications"
+#define E_NOTIFICATION_DESTINATION "org.freedesktop.Notifications"
+#define E_NOTIFICATION_PATH "/org/freedesktop/Notifications"
+
+typedef struct E_Notification_Context E_Notification_Daemon;
 
 /* notifications */
 
-typedef struct _E_Notification_Client E_Notification_Client;
+typedef struct E_Notification_Context E_Notification_Context;
 
 typedef struct E_Notification_Image E_Notification_Image;
 typedef struct E_Notification E_Notification;
 typedef struct E_Notification_Action E_Notification_Action;
 
 
-typedef enum _E_Notification_Urgency E_Notification_Urgency;
-typedef enum _E_Notification_Hint_Type E_Notification_Hint_Type;
-typedef enum _E_Notification_Closed_Reason E_Notification_Closed_Reason;
-
-/* event structs */
-typedef struct _E_Notification_Event_Daemon E_Notification_Event_Daemon;
-typedef struct _E_Notification_Event_Daemon E_Notification_Event_Notify;
-typedef struct _E_Notification_Event_Daemon E_Notification_Event_Close;
-typedef struct _E_Notification_Event_Action_Invoked 
E_Notification_Event_Action_Invoked;
-typedef struct _E_Notification_Event_Server_Capabilities 
E_Notification_Event_Server_Capabilities;
-typedef struct _E_Notification_Event_Sent E_Notification_Event_Sent;
-typedef struct _E_Notification_Event_Closed E_Notification_Event_Closed;
+typedef enum E_Notification_Urgency E_Notification_Urgency;
+typedef enum E_Notification_Hint_Type E_Notification_Hint_Type;
+typedef enum E_Notification_Closed_Reason E_Notification_Closed_Reason;
+
+/* method returns */
+typedef struct E_Notification_Return_Notify E_Notification_Return_Notify;
+typedef struct E_Notification_Return_Get_Capabilities 
E_Notification_Return_Get_Capabilities;
+typedef struct E_Notification_Return_Get_Server_Information 
E_Notification_Return_Get_Server_Information;
+
+/* daemon events */
+typedef struct E_Notification_Event_Daemon E_Notification_Event_Daemon;
+typedef struct E_Notification_Event_Daemon E_Notification_Event_Notify;
+typedef struct E_Notification_Event_Daemon E_Notification_Event_Close;
+
+/* signal events */
+typedef struct E_Notification_Event_Action_Invoked 
E_Notification_Event_Action_Invoked;
+typedef struct E_Notification_Event_Notification_Closed 
E_Notification_Event_Notification_Closed;
 
 /* gui */
-typedef struct _E_Notification_View E_Notification_View;
+typedef struct E_Notification_View E_Notification_View;
 
 /* enums */
 
-enum _E_Notification_Urgency
+enum E_Notification_Urgency
 {
   E_NOTIFICATION_URGENCY_LOW,
   E_NOTIFICATION_URGENCY_NORMAL,
   E_NOTIFICATION_URGENCY_CRITICAL
 };
 
-enum _E_Notification_Closed_Reason
+enum E_Notification_Closed_Reason
 {
   E_NOTIFICATION_CLOSED_EXPIRED,
   E_NOTIFICATION_CLOSED_DISMISSED,
@@ -49,7 +58,7 @@
   E_NOTIFICATION_CLOSED_UNDEFINED
 };
 
-enum _E_Notification_Hint_Type
+enum E_Notification_Hint_Type
 {
   E_NOTIFICATION_HINT_URGENCY        = 0x1,
   E_NOTIFICATION_HINT_CATEGORY       = 0x2,
@@ -60,8 +69,9 @@
   E_NOTIFICATION_HINT_IMAGE_DATA     = 0x40
 };
 
-struct _E_Notification_Client
+struct E_Notification_Context
 {
+  E_DBus_Connection *conn;
 };
 
 struct E_Notification_Image
@@ -110,19 +120,32 @@
 };
 
 /* daemon event data */
-struct _E_Notification_Event_Daemon
+struct E_Notification_Event_Daemon
 {
   E_Notification *notification;
 };
 
-/* client event data */
-struct E_Notification_Event_Sent
+/* client method returns */
+struct E_Notification_Return_Notify
 {
-  int notification_id;
+  unsigned int notification_id;
   E_Notification *notification;
 };
 
-struct E_Notification_Event_Closed
+struct E_Notification_Return_Get_Capabilities
+{
+  Ecore_List *capabilities;
+};
+
+struct E_Notification_Return_Get_Server_Information
+{
+  const char *name;
+  const char *vendor;
+  const char *version;
+};
+
+/* signals */
+struct E_Notification_Event_Notification_Closed
 {
   int notification_id;
   E_Notification_Closed_Reason reason;
@@ -134,10 +157,6 @@
   char *action_id;
 };
 
-struct E_Notification_Event_Server_Capabilities
-{
-  Ecore_List *capabilities; /* list of char* */
-};
 
 
 /* daemon events */
@@ -145,10 +164,8 @@
 extern int E_NOTIFICATION_EVENT_CLOSE;
 
 /* client events */
-extern int E_NOTIFICATION_EVENT_SENT;
 extern int E_NOTIFICATION_EVENT_CLOSED;
 extern int E_NOTIFICATION_EVENT_ACTION_INVOKED;
-extern int E_NOTIFICATION_EVENT_SERVER_CAPABILITIES;
 
 
 int e_notify_init();
@@ -164,11 +181,11 @@
 
 /* client */
 /*
-E_Notification_Client *e_notification_client_add();
-void e_notification_client_shutdown(E_Notification_Client *t);
-void e_notifications_get_capabilities(E_Notification_Client *nc);
-void e_notifications_get_server_info(E_Notification_Client *nc);
-void e_notifications_close_notification(E_Notification_Client *nc, int id);
+E_Notification_Context *e_notification_client_add();
+void e_notification_client_shutdown(E_Notification_Context *t);
+void e_notifications_get_capabilities(E_Notification_Context *nc);
+void e_notifications_get_server_info(E_Notification_Context *nc);
+void e_notifications_close_notification(E_Notification_Context *nc, int id);
 */
 
 
===================================================================
RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/notification.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- notification.c      11 Jul 2007 00:43:30 -0000      1.1
+++ notification.c      11 Jul 2007 00:44:21 -0000      1.2
@@ -5,10 +5,9 @@
 #include <Ecore_Data.h>
 
 /* private functions */
-Ecore_List *e_notification_action_list_new();
-E_Notification_Action *e_notification_action_new(const char *id, const char 
*name);
-void e_notification_action_free(E_Notification_Action *act);
-
+static Ecore_List * e_notification_action_list_new();
+static E_Notification_Action *e_notification_action_new(const char *id, const 
char *name);
+static void e_notification_action_free(E_Notification_Action *act);
 
 /* (con|de)structor */
 
@@ -36,7 +35,6 @@
   E_Notification *n;
   n = calloc(1, sizeof(E_Notification));
   if (!n) return NULL;
-  n->actions = e_notification_action_list_new();
   n->refcount = 1;
 
   return n;
@@ -108,6 +106,9 @@
 {
   E_Notification_Action *a;
 
+  if (!n->actions) 
+    n->actions = e_notification_action_list_new();
+
   a = e_notification_action_new(action_id, action_name);
   ecore_list_append(n->actions, a);
 }
@@ -172,7 +173,7 @@
 
 /***** actions *****/
 
-Ecore_List *
+static Ecore_List *
 e_notification_action_list_new()
 {
   Ecore_List *alist;
@@ -181,9 +182,7 @@
   return alist;
 }
 
-/* actions */
-
-E_Notification_Action *
+static E_Notification_Action *
 e_notification_action_new(const char *id, const char *name)
 {
   E_Notification_Action *act;
@@ -194,7 +193,7 @@
 }
 
 
-void
+static void
 e_notification_action_free(E_Notification_Action *act)
 {
   if (!act) return;



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to