summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2017-03-31 23:25:35 +0300
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2017-03-31 23:25:35 +0300
commit0fe8da41c90d9844ec5a34b57d0a84cdbf7d02ec (patch)
tree21944d2657de3a09d184ae4cbc20ee11f37a3540
parentdd2aae3ded978223056f9eab7d538d612c934c70 (diff)
Evas: adapt structure to EET needs
-rw-r--r--src/lib/Evas_Debug.h5
-rw-r--r--src/lib/evas_debug.c21
2 files changed, 17 insertions, 9 deletions
diff --git a/src/lib/Evas_Debug.h b/src/lib/Evas_Debug.h
index c30e5dd..e26225b 100644
--- a/src/lib/Evas_Debug.h
+++ b/src/lib/Evas_Debug.h
@@ -35,7 +35,10 @@ typedef struct
35 int w; 35 int w;
36 int h; 36 int h;
37 char *img; 37 char *img;
38 struct tm time; 38 int img_size;
39 int tm_sec;
40 int tm_min;
41 int tm_hour;
39} Evas_Debug_Screenshot; 42} Evas_Debug_Screenshot;
40 43
41EAPI Evas_Debug_Screenshot * 44EAPI Evas_Debug_Screenshot *
diff --git a/src/lib/evas_debug.c b/src/lib/evas_debug.c
index a23153b..df5e5d1 100644
--- a/src/lib/evas_debug.c
+++ b/src/lib/evas_debug.c
@@ -109,14 +109,14 @@ EAPI Evas_Debug_Screenshot *
109evas_debug_screenshot_decode(char *buffer, unsigned int size) 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;
113 uint64_t obj; 112 uint64_t obj;
114 int w, h; 113 int tm_sec, tm_min, tm_hour, w, h;
115 unsigned int hdr_size = sizeof(uint64_t) + sizeof(struct tm) + 2 * sizeof(int); 114 unsigned int hdr_size = sizeof(uint64_t) + 5 * sizeof(int);
116 if (size < hdr_size) return NULL; 115 if (size < hdr_size) return NULL;
117 EXTRACT(buffer, &obj, sizeof(uint64_t)); 116 EXTRACT(buffer, &obj, sizeof(uint64_t));
118 t = (struct tm *)buffer; 117 EXTRACT(buffer, &tm_sec, sizeof(int));
119 buffer += sizeof(struct tm); 118 EXTRACT(buffer, &tm_min, sizeof(int));
119 EXTRACT(buffer, &tm_hour, sizeof(int));
120 EXTRACT(buffer, &w, sizeof(int)); 120 EXTRACT(buffer, &w, sizeof(int));
121 EXTRACT(buffer, &h, sizeof(int)); 121 EXTRACT(buffer, &h, sizeof(int));
122 size -= hdr_size; 122 size -= hdr_size;
@@ -126,8 +126,11 @@ evas_debug_screenshot_decode(char *buffer, unsigned int size)
126 s->obj = obj; 126 s->obj = obj;
127 s->w = w; 127 s->w = w;
128 s->h = h; 128 s->h = h;
129 memcpy(&s->time, t, sizeof(struct tm)); 129 s->tm_sec = tm_sec;
130 s->tm_min = tm_min;
131 s->tm_hour = tm_hour;
130 s->img = malloc(size); 132 s->img = malloc(size);
133 s->img_size = size;
131 memcpy(s->img, buffer, size); 134 memcpy(s->img, buffer, size);
132 return s; 135 return s;
133} 136}
@@ -145,7 +148,7 @@ _win_screenshot_cb(Eina_Debug_Session *session, int srcid, void *buffer, int siz
145 unsigned char *resp = NULL, *tmp; 148 unsigned char *resp = NULL, *tmp;
146 int bpl = 0, rows = 0, bpp = 0; 149 int bpl = 0, rows = 0, bpp = 0;
147 int w, h; 150 int w, h;
148 unsigned int hdr_size = sizeof(uint64_t) + sizeof(struct tm) + 2 * sizeof(int); 151 unsigned int hdr_size = sizeof(uint64_t) + 5 * sizeof(int);
149 152
150 if (size <= 0) return EINA_DEBUG_ERROR; 153 if (size <= 0) return EINA_DEBUG_ERROR;
151 memcpy(&ptr64, buffer, sizeof(ptr64)); 154 memcpy(&ptr64, buffer, sizeof(ptr64));
@@ -175,7 +178,9 @@ _win_screenshot_cb(Eina_Debug_Session *session, int srcid, void *buffer, int siz
175 img_src = ecore_x_image_data_get(img, &bpl, &rows, &bpp); 178 img_src = ecore_x_image_data_get(img, &bpl, &rows, &bpp);
176 resp = tmp = malloc(hdr_size + (w * h * sizeof(int))); 179 resp = tmp = malloc(hdr_size + (w * h * sizeof(int)));
177 STORE(tmp, &ptr64, sizeof(ptr64)); 180 STORE(tmp, &ptr64, sizeof(ptr64));
178 STORE(tmp, t, sizeof(struct tm)); 181 STORE(tmp, &t->tm_sec, sizeof(int));
182 STORE(tmp, &t->tm_min, sizeof(int));
183 STORE(tmp, &t->tm_hour, sizeof(int));
179 STORE(tmp, &w, sizeof(int)); 184 STORE(tmp, &w, sizeof(int));
180 STORE(tmp, &h, sizeof(int)); 185 STORE(tmp, &h, sizeof(int));
181 if (!ecore_x_image_is_argb32_get(img)) 186 if (!ecore_x_image_is_argb32_get(img))