lib/notification/e_notify_private.h
Go to the documentation of this file.
00001 #ifndef E_NOTIFY_PRIVATE_H
00002 #define E_NOTIFY_PRIVATE_H
00003 
00004 #define E_NOTIFICATION_BUS_NAME "org.freedesktop.Notifications"
00005 #define E_NOTIFICATION_INTERFACE "org.freedesktop.Notifications"
00006 #define E_NOTIFICATION_PATH "/org/freedesktop/Notifications"
00007 
00008 #define e_notification_call_new(member) dbus_message_new_method_call(E_NOTIFICATION_BUS_NAME, E_NOTIFICATION_PATH, E_NOTIFICATION_INTERFACE, member)
00009 
00010 typedef void (*E_DBus_Variant_Marshaller) (DBusMessageIter *iter, void *data);
00011 #define E_DBUS_VARIANT_MARSHALLER(x) ((E_DBus_Variant_Marshaller)(x))
00012 
00013 void e_notify_marshal_dict_variant(DBusMessageIter *iter, const char *key, char *type_str, E_DBus_Variant_Marshaller func, void *data);
00014 void e_notify_marshal_dict_string(DBusMessageIter *iter, const char *key, const char *value);
00015 void e_notify_marshal_dict_byte(DBusMessageIter *iter, const char *key, char value);
00016 void e_notify_marshal_dict_int(DBusMessageIter *iter, const char *key, int value);
00017 
00018 void e_notify_marshal_string_array(DBusMessageIter *iter, const char **strings);
00019 void e_notify_marshal_string_list_as_array(DBusMessageIter *iter, Eina_List *strings);
00020 Eina_List * e_notify_unmarshal_string_array_as_list(DBusMessageIter *iter, DBusError *err);
00021 DBusMessage * e_notify_marshal_get_capabilities();
00022 DBusMessage * e_notify_marshal_get_capabilities_return(DBusMessage *method_call, const char **capabilities);
00023 void * e_notify_unmarshal_get_capabilities_return(DBusMessage *msg, DBusError *err);
00024 void   e_notify_free_get_capabilities_return(void *data);
00025 DBusMessage * e_notify_marshal_get_server_information();
00026 DBusMessage * e_notify_marshal_get_server_information_return(DBusMessage *method_call, const char *name, const char *vendor, const char *version, const char *spec_version);
00027 void * e_notify_unmarshal_get_server_information_return(DBusMessage *msg, DBusError *err);
00028 void   e_notify_free_get_server_information_return(void *data);
00029 DBusMessage * e_notify_marshal_close_notification(dbus_uint32_t id);
00030 dbus_uint32_t e_notify_unmarshal_close_notification(DBusMessage *msg, DBusError *err);
00031 DBusMessage * e_notify_marshal_notification_closed_signal(dbus_uint32_t id, dbus_uint32_t reason);
00032 E_Notification_Event_Notification_Closed * e_notify_unmarshal_notification_closed_signal(DBusMessage *msg, DBusError *err);
00033 DBusMessage * e_notify_marshal_action_invoked_signal(dbus_uint32_t id, const char *action_id);
00034 E_Notification_Event_Action_Invoked * e_notify_unmarshal_action_invoked_signal(DBusMessage *msg, DBusError *err);
00035 DBusMessage * e_notify_marshal_notify(E_Notification *n);
00036 E_Notification * e_notify_unmarshal_notify(DBusMessage *msg, DBusError *err);
00037 DBusMessage * e_notify_marshal_notify_return(DBusMessage *method_call, dbus_uint32_t notification_id);
00038 void * e_notify_unmarshal_notify_return(DBusMessage *msg, DBusError *err);
00039 void   e_notify_free_notify_return(void *data);
00040 void e_notify_unmarshal_notify_actions(E_Notification *n, DBusMessageIter *iter);
00041 void e_notify_unmarshal_notify_hints(E_Notification *n, DBusMessageIter *iter);
00042 void e_notify_marshal_hint_image(DBusMessageIter *iter, E_Notification_Image *img);
00043 E_Notification_Image * e_notify_unmarshal_hint_image(DBusMessageIter *iter);
00044 void loginit(void);
00045 extern int _e_dbus_notify_log_dom;
00046 
00047 #ifndef E_DBUS_COLOR_DEFAULT
00048 #define E_DBUS_COLOR_DEFAULT EINA_COLOR_CYAN
00049 #endif
00050 
00051 #undef DBG
00052 #undef INF
00053 #undef WRN
00054 #undef ERR
00055 
00056 #define DBG(...) EINA_LOG_DOM_DBG(_e_dbus_notify_log_dom, __VA_ARGS__)
00057 #define INF(...) EINA_LOG_DOM_INFO(_e_dbus_notify_log_dom, __VA_ARGS__)
00058 #define WRN(...) EINA_LOG_DOM_WARN(_e_dbus_notify_log_dom, __VA_ARGS__)
00059 #define ERR(...) EINA_LOG_DOM_ERR(_e_dbus_notify_log_dom, __VA_ARGS__)
00060 
00061 struct E_Notification_Image
00062 {
00063   int   width;
00064   int   height;
00065   int   rowstride;
00066   char  has_alpha;
00067   int   bits_per_sample;
00068   int   channels;
00069   unsigned char *data;
00070 };
00071 
00072 struct E_Notification
00073 {
00074   int id;
00075   const char *app_name;
00076   unsigned int replaces_id;
00077   const char *app_icon;
00078   const char *summary;
00079   const char *body;
00080   int expire_timeout;
00081 
00082   Eina_List *actions;
00083 
00084   struct
00085   {
00086     char urgency;
00087     const char *category;
00088     const char *desktop;
00089     const char *sound_file;
00090     const char *image_path;
00091     char suppress_sound;
00092     int x, y;
00093     E_Notification_Image *image_data;
00094     E_Notification_Image *icon_data;
00095   } hints;
00096 
00097   int hint_flags;
00098   unsigned char closed;
00099 
00100   int refcount;
00101 };
00102 
00103 struct E_Notification_Action 
00104 {
00105   const char *id;
00106   const char *name;
00107 };
00108 
00109 #endif