Enlightenment CVS committal Author : rephorm Project : e17 Module : proto
Dir : e17/proto/e_dbus/src/lib/notification Modified Files: E_Notify.h Makefile.am e_notify_private.h marshal.c notification.c Added Files: E_Notification_Daemon.h daemon.c Log Message: more reorganization =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/E_Notify.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- E_Notify.h 11 Jul 2007 00:46:01 -0000 1.5 +++ E_Notify.h 11 Jul 2007 00:46:13 -0000 1.6 @@ -5,21 +5,12 @@ #include <Evas.h> #include <E_DBus.h> -#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_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; @@ -29,18 +20,11 @@ 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; - /* enums */ enum E_Notification_Urgency @@ -69,62 +53,6 @@ E_NOTIFICATION_HINT_IMAGE_DATA = 0x40 }; -struct E_Notification_Context -{ - E_DBus_Connection *conn; -}; - -struct E_Notification_Image -{ - int width; - int height; - int rowstride; - char has_alpha; - int bits_per_sample; - int channels; - int *data; -}; - -struct E_Notification -{ - int id; - char *app_name; - unsigned int replaces_id; - char *app_icon; - char *summary; - char *body; - int expire_timeout; - - Ecore_List *actions; - - struct - { - char urgency; - char *category; - char *desktop; - char *sound_file; - char suppress_sound; - int x, y; - E_Notification_Image *image_data; - } hints; - - int hint_flags; - - int refcount; -}; - -struct E_Notification_Action -{ - char *id; - char *name; -}; - -/* daemon event data */ -struct E_Notification_Event_Daemon -{ - E_Notification *notification; -}; - /* client method returns */ struct E_Notification_Return_Notify { @@ -157,34 +85,18 @@ char *action_id; }; -/* daemon events */ -extern int E_NOTIFICATION_EVENT_NOTIFY; -extern int E_NOTIFICATION_EVENT_CLOSE; - /* client events */ extern int E_NOTIFICATION_EVENT_CLOSED; extern int E_NOTIFICATION_EVENT_ACTION_INVOKED; -int e_notify_init(); -void e_notifications_shutdown(); - -/* daemon */ -E_Notification_Daemon *e_notification_daemon_add(DBusConnection *conn); -void e_notification_daemon_free(E_Notification_Daemon *d); -void e_notification_daemon_close(E_Notification_Daemon *d, - E_Notification *n, unsigned int reason); -void e_notification_daemon_action_invoke(E_Notification_Daemon *d, - E_Notification *n, const char *action_id); +int e_notification_init(); +int e_notification_shutdown(); /* client */ -/* -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); -*/ +void e_notification_send(E_Notification *n, E_DBus_Callback_Func func, void *data); +void e_notification_get_capabilities(E_DBus_Callback_Func func, void *data); +void e_notification_get_server_information(E_DBus_Callback_Func func, void *data); /* Notifications */ @@ -243,11 +155,6 @@ E_Notification_Image *e_notification_image_new(); void e_notification_image_free(E_Notification_Image *img); Evas_Object *e_notification_image_object_add(Evas *evas, E_Notification_Image *img); - -/***** gui *****/ -E_Notification_View *e_notification_view_add(E_Notification_Daemon *d, E_Notification *n); -void e_notification_view_close(E_Notification_View *nv); -Evas_Object * e_notification_view_icon_get(Evas *evas, E_Notification *n); void e_notification_send(E_Notification *n, E_DBus_Callback_Func func, void *data); =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- Makefile.am 11 Jul 2007 00:45:53 -0000 1.2 +++ Makefile.am 11 Jul 2007 00:46:13 -0000 1.3 @@ -9,7 +9,8 @@ E_Notify.h \ notification.c \ marshal.c \ -client.c +client.c \ +daemon.c libenotify_la_LIBADD = \ @EDBUS_LIBS@ \ =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/e_notify_private.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_notify_private.h 11 Jul 2007 00:45:53 -0000 1.1 +++ e_notify_private.h 11 Jul 2007 00:46:13 -0000 1.2 @@ -1,6 +1,10 @@ #ifndef E_NOTIFY_PRIVATE_H #define E_NOTIFY_PRIVATE_H +#define E_NOTIFICATION_INTERFACE "org.freedesktop.Notifications" +#define E_NOTIFICATION_DESTINATION "org.freedesktop.Notifications" +#define E_NOTIFICATION_PATH "/org/freedesktop/Notifications" + #define e_notification_call_new(member) dbus_message_new_method_call(E_NOTIFICATION_DESTINATION, E_NOTIFICATION_PATH, E_NOTIFICATION_INTERFACE, member) typedef void (*E_DBus_Variant_Marshaller) (DBusMessageIter *iter, void *data); @@ -33,5 +37,50 @@ Ecore_List * e_notify_unmarshal_notify_hints(E_Notification *n, DBusMessageIter *iter); void e_notify_marshal_hint_image(DBusMessageIter *iter, E_Notification_Image *img); E_Notification_Image * e_notify_unmarshal_hint_image(DBusMessageIter *iter); + +struct E_Notification_Image +{ + int width; + int height; + int rowstride; + char has_alpha; + int bits_per_sample; + int channels; + int *data; +}; + +struct E_Notification +{ + int id; + char *app_name; + unsigned int replaces_id; + char *app_icon; + char *summary; + char *body; + int expire_timeout; + + Ecore_List *actions; + + struct + { + char urgency; + char *category; + char *desktop; + char *sound_file; + char suppress_sound; + int x, y; + E_Notification_Image *image_data; + } hints; + + int hint_flags; + + int refcount; +}; + +struct E_Notification_Action +{ + char *id; + char *name; +}; #endif =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/marshal.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- marshal.c 11 Jul 2007 00:45:53 -0000 1.3 +++ marshal.c 11 Jul 2007 00:46:13 -0000 1.4 @@ -537,19 +537,3 @@ return img; } -/**** daemon api ****/ -void -e_notification_signal_notification_closed(E_Notification_Daemon *daemon, unsigned int id, E_Notification_Closed_Reason reason) -{ - e_dbus_message_send(daemon->conn, - e_notify_marshal_notification_closed_signal(id, reason), - NULL, -1, NULL); -} - -void -e_notification_signal_action_invoked(E_Notification_Daemon *daemon, unsigned int notification_id, const char *action_id) -{ - e_dbus_message_send(daemon->conn, - e_notify_marshal_action_invoked_signal(notification_id, action_id), - NULL, -1, NULL); -} =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/notification.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- notification.c 11 Jul 2007 00:45:03 -0000 1.3 +++ notification.c 11 Jul 2007 00:46:13 -0000 1.4 @@ -3,6 +3,7 @@ #include <stdlib.h> #include <stdio.h> #include <Ecore_Data.h> +#include "e_notify_private.h" /* private functions */ static Ecore_List * e_notification_action_list_new(); ------------------------------------------------------------------------- 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