summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2017-03-29 12:56:57 +0300
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2017-03-29 12:56:57 +0300
commitdd2aae3ded978223056f9eab7d538d612c934c70 (patch)
tree685aec996ebdff686b7d776d791ebba48c363b13
parent3ad8c1b5c27ca10a99a726f7b2621484c4a5c0ed (diff)
Clean Evas screenshot API
-rw-r--r--src/lib/Evas_Debug.h4
-rw-r--r--src/lib/evas_debug.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/Evas_Debug.h b/src/lib/Evas_Debug.h
index 1304ef5..c30e5dd 100644
--- a/src/lib/Evas_Debug.h
+++ b/src/lib/Evas_Debug.h
@@ -31,15 +31,15 @@
31 31
32typedef struct 32typedef struct
33{ 33{
34 uint64_t obj;
34 int w; 35 int w;
35 int h; 36 int h;
36 char *img; 37 char *img;
37 struct tm time; 38 struct tm time;
38 Eo *menu_item;
39} Evas_Debug_Screenshot; 39} Evas_Debug_Screenshot;
40 40
41EAPI Evas_Debug_Screenshot * 41EAPI Evas_Debug_Screenshot *
42evas_debug_screenshot_decode(char *buffer, unsigned int size, uint64_t *obj); 42evas_debug_screenshot_decode(char *buffer, unsigned int size);
43 43
44#endif 44#endif
45 45
diff --git a/src/lib/evas_debug.c b/src/lib/evas_debug.c
index 9543b93..a23153b 100644
--- a/src/lib/evas_debug.c
+++ b/src/lib/evas_debug.c
@@ -106,14 +106,15 @@ _obj_highlight_cb(Eina_Debug_Session *session EINA_UNUSED, int srcid EINA_UNUSED
106} 106}
107 107
108EAPI Evas_Debug_Screenshot * 108EAPI Evas_Debug_Screenshot *
109evas_debug_screenshot_decode(char *buffer, unsigned int size, uint64_t *obj) 109evas_debug_screenshot_decode(char *buffer, unsigned int size)
110{ 110{
111 Evas_Debug_Screenshot *s = NULL; 111 Evas_Debug_Screenshot *s = NULL;
112 struct tm *t = NULL; 112 struct tm *t = NULL;
113 uint64_t obj;
113 int w, h; 114 int w, h;
114 unsigned int hdr_size = sizeof(uint64_t) + sizeof(struct tm) + 2 * sizeof(int); 115 unsigned int hdr_size = sizeof(uint64_t) + sizeof(struct tm) + 2 * sizeof(int);
115 if (size < hdr_size) return NULL; 116 if (size < hdr_size) return NULL;
116 EXTRACT(buffer, obj, sizeof(uint64_t)); 117 EXTRACT(buffer, &obj, sizeof(uint64_t));
117 t = (struct tm *)buffer; 118 t = (struct tm *)buffer;
118 buffer += sizeof(struct tm); 119 buffer += sizeof(struct tm);
119 EXTRACT(buffer, &w, sizeof(int)); 120 EXTRACT(buffer, &w, sizeof(int));
@@ -122,6 +123,7 @@ evas_debug_screenshot_decode(char *buffer, unsigned int size, uint64_t *obj)
122 if (size != (w * h * sizeof(int))) return NULL; 123 if (size != (w * h * sizeof(int))) return NULL;
123 124
124 s = calloc(1, sizeof(*s)); 125 s = calloc(1, sizeof(*s));
126 s->obj = obj;
125 s->w = w; 127 s->w = w;
126 s->h = h; 128 s->h = h;
127 memcpy(&s->time, t, sizeof(struct tm)); 129 memcpy(&s->time, t, sizeof(struct tm));