2011-11-04 Sanjeev BA <iamsanjeev@gmail.com>
* Exported e_dbus_connection_dbus_connection_get()
+
+2011-11-06 Mike Blumenkrantz
+
+ * Add e_notification_image_init for filling in values from an Evas_Object
extern "C" {
#endif
- EAPI int e_notification_init();
- EAPI int e_notification_shutdown();
+ EAPI int e_notification_init(void);
+ EAPI int e_notification_shutdown(void);
/* client */
EAPI void e_notification_send(E_Notification *n, E_DBus_Callback_Func func, void *data);
/* Notifications */
- EAPI E_Notification *e_notification_new();
+ EAPI E_Notification *e_notification_new(void);
EAPI void e_notification_ref(E_Notification *n);
EAPI void e_notification_unref(E_Notification *n);
EAPI void e_notification_free(E_Notification *n);
EAPI E_Notification_Image *e_notification_hint_icon_data_get(E_Notification *n);
/* image hint */
- EAPI E_Notification_Image *e_notification_image_new();
+ EAPI E_Notification_Image *e_notification_image_new(void);
EAPI void e_notification_image_free(E_Notification_Image *img);
+ EAPI Eina_Bool e_notification_image_init(E_Notification_Image *img, Evas_Object *obj);
EAPI Evas_Object *e_notification_image_evas_object_add(Evas *evas, E_Notification_Image *img);
#ifdef __cplusplus
E_Notification_Image *img;
img = calloc(1, sizeof(E_Notification_Image));
+ img->bits_per_sample = 8;
return img;
}
+EAPI Eina_Bool
+e_notification_image_init(E_Notification_Image *img, Evas_Object *obj)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(img, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+ evas_object_geometry_get(obj, NULL, NULL, &img->width, &img->height);
+ img->has_alpha = !!evas_object_image_alpha_get(obj);
+ img->channels = img->has_alpha ? 4 : 3;
+ img->rowstride = evas_object_image_stride_get(obj);
+ img->data = evas_object_image_data_get(obj, EINA_FALSE);
+ evas_object_image_data_set(obj, img->data);
+ return EINA_TRUE;
+}
+
EAPI void
e_notification_image_free(E_Notification_Image *img)
{