diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-03-23 13:28:49 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-03-23 13:31:22 +0900 |
commit | 1117cb938ab8bebdc6265fb05454ef90f0eab990 (patch) | |
tree | 5fddc1edd5e06fbc2c663a1ae125785012b76e8d /src | |
parent | 10fe8f29e387c72fddb6b0fcde5bad4c0243c23d (diff) |
update po's ... :/
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile_Ecore_Evas.am | 7 | ||||
-rw-r--r-- | src/modules/ecore_evas/engines/extn/ecore_evas_extn.c | 1095 | ||||
-rw-r--r-- | src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c | 175 | ||||
-rw-r--r-- | src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h | 220 |
4 files changed, 730 insertions, 767 deletions
diff --git a/src/Makefile_Ecore_Evas.am b/src/Makefile_Ecore_Evas.am index 6f7b8d7b43..a71064350a 100644 --- a/src/Makefile_Ecore_Evas.am +++ b/src/Makefile_Ecore_Evas.am | |||
@@ -35,14 +35,17 @@ lib_ecore_evas_libecore_evas_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ | |||
35 | 35 | ||
36 | if BUILD_ECORE_EVAS_EXTN | 36 | if BUILD_ECORE_EVAS_EXTN |
37 | EXTNSOURCES = \ | 37 | EXTNSOURCES = \ |
38 | modules/ecore_evas/engines/extn/ecore_evas_extn.c | 38 | modules/ecore_evas/engines/extn/ecore_evas_extn.c \ |
39 | modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h \ | ||
40 | modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c | ||
39 | ecoreevasengineextnpkgdir = $(libdir)/ecore_evas/engines/extn/$(MODULE_ARCH) | 41 | ecoreevasengineextnpkgdir = $(libdir)/ecore_evas/engines/extn/$(MODULE_ARCH) |
40 | ecoreevasengineextnpkg_LTLIBRARIES = modules/ecore_evas/engines/extn/module.la | 42 | ecoreevasengineextnpkg_LTLIBRARIES = modules/ecore_evas/engines/extn/module.la |
41 | modules_ecore_evas_engines_extn_module_la_SOURCES = $(EXTNSOURCES) | 43 | modules_ecore_evas_engines_extn_module_la_SOURCES = $(EXTNSOURCES) |
42 | modules_ecore_evas_engines_extn_module_la_CPPFLAGS = \ | 44 | modules_ecore_evas_engines_extn_module_la_CPPFLAGS = \ |
43 | @ECORE_EVAS_CFLAGS@ \ | 45 | @ECORE_EVAS_CFLAGS@ \ |
44 | @ECORE_IPC_CFLAGS@ \ | 46 | @ECORE_IPC_CFLAGS@ \ |
45 | -I$(top_srcdir)/src/modules/evas/engines/buffer | 47 | -I$(top_srcdir)/src/modules/evas/engines/buffer \ |
48 | -I$(top_srcdir)/src/modules/ecore_evas/engines/extn | ||
46 | modules_ecore_evas_engines_extn_module_la_LIBADD = \ | 49 | modules_ecore_evas_engines_extn_module_la_LIBADD = \ |
47 | @USE_ECORE_EVAS_LIBS@ \ | 50 | @USE_ECORE_EVAS_LIBS@ \ |
48 | @USE_ECORE_IPC_LIBS@ \ | 51 | @USE_ECORE_IPC_LIBS@ \ |
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c index 0a42c9e113..e509ff0fe4 100644 --- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c +++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c | |||
@@ -1,409 +1,43 @@ | |||
1 | #ifdef HAVE_CONFIG_H | 1 | #include "ecore_evas_extn_engine.h" |
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #ifdef STDC_HEADERS | ||
6 | # include <stdlib.h> | ||
7 | # include <stddef.h> | ||
8 | #else | ||
9 | # ifdef HAVE_STDLIB_H | ||
10 | # include <stdlib.h> | ||
11 | # endif | ||
12 | #endif | ||
13 | |||
14 | #include <stdio.h> | ||
15 | #include <sys/types.h> | ||
16 | #include <unistd.h> | ||
17 | #include <math.h> | ||
18 | #include <time.h> | ||
19 | #ifdef HAVE_SYS_MMAN_H | ||
20 | # include <sys/mman.h> | ||
21 | #endif | ||
22 | #include <sys/stat.h> | ||
23 | #include <fcntl.h> | ||
24 | #include <string.h> | ||
25 | #include <sys/file.h> | ||
26 | #include <unistd.h> | ||
27 | |||
28 | #include <Evas.h> | ||
29 | #include <Evas_Engine_Buffer.h> | ||
30 | #include <Ecore.h> | ||
31 | #include <Ecore_Evas.h> | ||
32 | #include <Ecore_Input.h> | ||
33 | |||
34 | #include <Ecore_Ipc.h> | ||
35 | |||
36 | #include "ecore_private.h" // FIXME: Because of ECORE_MAGIC | ||
37 | #include "ecore_evas_private.h" | ||
38 | #include "ecore_evas_buffer.h" | ||
39 | #include "ecore_evas_extn.h" | ||
40 | 2 | ||
41 | static const char *interface_extn_name = "extn"; | 3 | #define NBUF 2 |
42 | static const int interface_extn_version = 1; | ||
43 | |||
44 | typedef struct _Shmfile Shmfile; | ||
45 | |||
46 | struct _Shmfile | ||
47 | { | ||
48 | void *addr, *addr2; | ||
49 | const char *file, *file2; | ||
50 | int fd, fd2; | ||
51 | int size; | ||
52 | }; | ||
53 | 4 | ||
54 | static int blank = 0x00000000; | 5 | static int blank = 0x00000000; |
6 | static const char *interface_extn_name = "extn"; | ||
7 | static const int interface_extn_version = 1; | ||
55 | 8 | ||
56 | static Ecore_Evas_Interface_Extn *_ecore_evas_extn_interface_new(void); | 9 | static Ecore_Evas_Interface_Extn *_ecore_evas_extn_interface_new(void); |
57 | 10 | static void *_ecore_evas_socket_switch(void *data, void *dest_buf); | |
58 | static Shmfile * | ||
59 | shmfile_new(const char *base, int id, int size, Eina_Bool sys) | ||
60 | { | ||
61 | Shmfile *sf; | ||
62 | char file[PATH_MAX], file2[PATH_MAX]; | ||
63 | |||
64 | sf = calloc(1, sizeof(Shmfile)); | ||
65 | if (!sf) return NULL; | ||
66 | sf->fd = -1; | ||
67 | sf->fd2 = -1; | ||
68 | sf->addr = MAP_FAILED; | ||
69 | sf->addr = MAP_FAILED; | ||
70 | do | ||
71 | { | ||
72 | mode_t mode; | ||
73 | int v1, v2, v3; | ||
74 | |||
75 | v1 = (int)time(NULL); | ||
76 | v2 = (int)getpid(); | ||
77 | v3 = (int)rand(); | ||
78 | mode = S_IRUSR | S_IWUSR; | ||
79 | if (sys) mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; | ||
80 | snprintf(file, sizeof(file), "/%s-%i-%i.%i.%i", base, id, v1, v2, v3); | ||
81 | sf->fd = shm_open(file, O_RDWR | O_CREAT | O_EXCL, mode); | ||
82 | if (sf->fd >= 0) | ||
83 | { | ||
84 | snprintf(file2, sizeof(file2), "/%s-%i-%i.%i.%i-b", base, id, v1, v2, v3); | ||
85 | sf->fd2 = shm_open(file2, O_RDWR | O_CREAT | O_EXCL, mode); | ||
86 | if (sf->fd2 < 0) | ||
87 | { | ||
88 | close(sf->fd); | ||
89 | sf->fd = -1; | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | while (sf->fd < 0); | ||
94 | |||
95 | sf->file = eina_stringshare_add(file); | ||
96 | if (!sf->file) goto err; | ||
97 | sf->file2 = eina_stringshare_add(file2); | ||
98 | if (!sf->file2) goto err; | ||
99 | sf->size = size; | ||
100 | if (ftruncate(sf->fd, size) < 0) goto err; | ||
101 | if (ftruncate(sf->fd2, size) < 0) goto err; | ||
102 | sf->addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, sf->fd, 0); | ||
103 | if (sf->addr == MAP_FAILED) goto err; | ||
104 | sf->addr2 = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, sf->fd2, 0); | ||
105 | if (sf->addr2 == MAP_FAILED) goto err; | ||
106 | return sf; | ||
107 | err: | ||
108 | if (sf->addr != MAP_FAILED) munmap(sf->addr, sf->size); | ||
109 | if (sf->addr2 != MAP_FAILED) munmap(sf->addr2, sf->size); | ||
110 | if (sf->fd >= 0) | ||
111 | { | ||
112 | close(sf->fd); | ||
113 | shm_unlink(file); | ||
114 | } | ||
115 | if (sf->fd2 >= 0) | ||
116 | { | ||
117 | close(sf->fd2); | ||
118 | shm_unlink(file2); | ||
119 | } | ||
120 | if (sf->file) eina_stringshare_del(sf->file); | ||
121 | if (sf->file2) eina_stringshare_del(sf->file2); | ||
122 | free(sf); | ||
123 | return NULL; | ||
124 | } | ||
125 | |||
126 | void | ||
127 | shmfile_free(Shmfile *sf) | ||
128 | { | ||
129 | munmap(sf->addr, sf->size); | ||
130 | munmap(sf->addr2, sf->size); | ||
131 | close(sf->fd); | ||
132 | close(sf->fd2); | ||
133 | shm_unlink(sf->file); | ||
134 | shm_unlink(sf->file2); | ||
135 | eina_stringshare_del(sf->file); | ||
136 | eina_stringshare_del(sf->file2); | ||
137 | free(sf); | ||
138 | } | ||
139 | |||
140 | static Shmfile * | ||
141 | shmfile_open(const char *ref, int size, Eina_Bool sys) | ||
142 | { | ||
143 | Shmfile *sf; | ||
144 | mode_t mode; | ||
145 | char *s; | ||
146 | int l; | ||
147 | |||
148 | sf = calloc(1, sizeof(Shmfile)); | ||
149 | if (!sf) return NULL; | ||
150 | sf->fd = -1; | ||
151 | sf->fd2 = -1; | ||
152 | sf->addr = MAP_FAILED; | ||
153 | sf->addr = MAP_FAILED; | ||
154 | mode = S_IRUSR | S_IWUSR; | ||
155 | if (sys) mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; | ||
156 | l = strlen(ref); | ||
157 | s = alloca(l + 3); | ||
158 | strcpy(s, ref); | ||
159 | s[l] = '-'; | ||
160 | s[l + 1] = 'b'; | ||
161 | s[l + 2] = 0; | ||
162 | sf->file = eina_stringshare_add(ref); | ||
163 | if (!sf->file) goto err; | ||
164 | sf->file2 = eina_stringshare_add(s); | ||
165 | if (!sf->file2) goto err; | ||
166 | sf->fd = shm_open(sf->file, O_RDWR, mode); | ||
167 | if (sf->fd < 0) goto err; | ||
168 | sf->fd2 = shm_open(sf->file2, O_RDWR, mode); | ||
169 | if (sf->fd2 < 0) goto err; | ||
170 | sf->size = size; | ||
171 | sf->addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, sf->fd, 0); | ||
172 | if (sf->addr == MAP_FAILED) goto err; | ||
173 | sf->addr2 = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, sf->fd2, 0); | ||
174 | if (sf->addr2 == MAP_FAILED) goto err; | ||
175 | return sf; | ||
176 | err: | ||
177 | if (sf->addr != MAP_FAILED) munmap(sf->addr, sf->size); | ||
178 | if (sf->addr2 != MAP_FAILED) munmap(sf->addr2, sf->size); | ||
179 | if (sf->fd >= 0) close(sf->fd); | ||
180 | if (sf->fd2 >= 0) close(sf->fd2); | ||
181 | if (sf->file) eina_stringshare_del(sf->file); | ||
182 | if (sf->file2) eina_stringshare_del(sf->file2); | ||
183 | free(sf); | ||
184 | return NULL; | ||
185 | } | ||
186 | |||
187 | void | ||
188 | shmfile_close(Shmfile *sf) | ||
189 | { | ||
190 | munmap(sf->addr, sf->size); | ||
191 | munmap(sf->addr2, sf->size); | ||
192 | close(sf->fd); | ||
193 | close(sf->fd2); | ||
194 | eina_stringshare_del(sf->file); | ||
195 | eina_stringshare_del(sf->file2); | ||
196 | free(sf); | ||
197 | } | ||
198 | |||
199 | // procotol version - change this as needed | ||
200 | #define MAJOR 0x1011 | ||
201 | |||
202 | enum // opcodes | ||
203 | { | ||
204 | OP_RESIZE, | ||
205 | OP_SHOW, | ||
206 | OP_HIDE, | ||
207 | OP_FOCUS, | ||
208 | OP_UNFOCUS, | ||
209 | OP_UPDATE, | ||
210 | OP_UPDATE_DONE, | ||
211 | OP_LOCK_FILE, | ||
212 | OP_SHM_REF, | ||
213 | OP_PROFILE_CHANGE_REQUEST, | ||
214 | OP_PROFILE_CHANGE_DONE, | ||
215 | OP_EV_MOUSE_IN, | ||
216 | OP_EV_MOUSE_OUT, | ||
217 | OP_EV_MOUSE_UP, | ||
218 | OP_EV_MOUSE_DOWN, | ||
219 | OP_EV_MOUSE_MOVE, | ||
220 | OP_EV_MOUSE_WHEEL, | ||
221 | OP_EV_MULTI_UP, | ||
222 | OP_EV_MULTI_DOWN, | ||
223 | OP_EV_MULTI_MOVE, | ||
224 | OP_EV_KEY_UP, | ||
225 | OP_EV_KEY_DOWN, | ||
226 | OP_EV_HOLD, | ||
227 | OP_LOCK_FILE2, | ||
228 | OP_MSG_PARENT, | ||
229 | OP_MSG | ||
230 | }; | ||
231 | |||
232 | enum | ||
233 | { | ||
234 | MOD_SHIFT = (1 << 0), | ||
235 | MOD_CTRL = (1 << 1), | ||
236 | MOD_ALT = (1 << 2), | ||
237 | MOD_META = (1 << 3), | ||
238 | MOD_HYPER = (1 << 4), | ||
239 | MOD_SUPER = (1 << 5), | ||
240 | MOD_CAPS = (1 << 6), | ||
241 | MOD_NUM = (1 << 7), | ||
242 | MOD_SCROLL = (1 << 8), | ||
243 | }; | ||
244 | |||
245 | typedef struct _Ipc_Data_Resize Ipc_Data_Resize; | ||
246 | typedef struct _Ipc_Data_Update Ipc_Data_Update; | ||
247 | typedef struct _Ipc_Data_Profile Ipc_Data_Profile; | ||
248 | typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In; | ||
249 | typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out; | ||
250 | typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up; | ||
251 | typedef struct _Ipc_Data_Ev_Mouse_Down Ipc_Data_Ev_Mouse_Down; | ||
252 | typedef struct _Ipc_Data_Ev_Mouse_Move Ipc_Data_Ev_Mouse_Move; | ||
253 | typedef struct _Ipc_Data_Ev_Mouse_Wheel Ipc_Data_Ev_Mouse_Wheel; | ||
254 | typedef struct _Ipc_Data_Ev_Hold Ipc_Data_Ev_Hold; | ||
255 | typedef struct _Ipc_Data_Ev_Multi_Up Ipc_Data_Ev_Multi_Up; | ||
256 | typedef struct _Ipc_Data_Ev_Multi_Down Ipc_Data_Ev_Multi_Down; | ||
257 | typedef struct _Ipc_Data_Ev_Multi_Move Ipc_Data_Ev_Multi_Move; | ||
258 | typedef struct _Ipc_Data_Ev_Key_Up Ipc_Data_Ev_Key_Up; | ||
259 | typedef struct _Ipc_Data_Ev_Key_Down Ipc_Data_Ev_Key_Down; | ||
260 | |||
261 | struct _Ipc_Data_Resize | ||
262 | { | ||
263 | int w, h; | ||
264 | }; | ||
265 | |||
266 | struct _Ipc_Data_Update | ||
267 | { | ||
268 | int x, w, y, h; | ||
269 | }; | ||
270 | |||
271 | struct _Ipc_Data_Profile | ||
272 | { | ||
273 | const char *name; | ||
274 | }; | ||
275 | |||
276 | struct _Ipc_Data_Ev_Mouse_In | ||
277 | { | ||
278 | unsigned int timestamp; | ||
279 | int mask; | ||
280 | Evas_Event_Flags event_flags; | ||
281 | }; | ||
282 | |||
283 | struct _Ipc_Data_Ev_Mouse_Out | ||
284 | { | ||
285 | unsigned int timestamp; | ||
286 | int mask; | ||
287 | Evas_Event_Flags event_flags; | ||
288 | }; | ||
289 | |||
290 | struct _Ipc_Data_Ev_Mouse_Up | ||
291 | { | ||
292 | int b; | ||
293 | Evas_Button_Flags flags; | ||
294 | int mask; | ||
295 | unsigned int timestamp; | ||
296 | Evas_Event_Flags event_flags; | ||
297 | }; | ||
298 | |||
299 | struct _Ipc_Data_Ev_Mouse_Down | ||
300 | { | ||
301 | int b; | ||
302 | Evas_Button_Flags flags; | ||
303 | int mask; | ||
304 | unsigned int timestamp; | ||
305 | Evas_Event_Flags event_flags; | ||
306 | }; | ||
307 | |||
308 | struct _Ipc_Data_Ev_Mouse_Move | ||
309 | { | ||
310 | int x, y; | ||
311 | Evas_Button_Flags flags; | ||
312 | int mask; | ||
313 | unsigned int timestamp; | ||
314 | Evas_Event_Flags event_flags; | ||
315 | }; | ||
316 | |||
317 | struct _Ipc_Data_Ev_Mouse_Wheel | ||
318 | { | ||
319 | int direction, z; | ||
320 | Evas_Button_Flags flags; | ||
321 | int mask; | ||
322 | unsigned int timestamp; | ||
323 | Evas_Event_Flags event_flags; | ||
324 | }; | ||
325 | |||
326 | struct _Ipc_Data_Ev_Hold | ||
327 | { | ||
328 | int hold; | ||
329 | unsigned int timestamp; | ||
330 | Evas_Event_Flags event_flags; | ||
331 | }; | ||
332 | |||
333 | struct _Ipc_Data_Ev_Multi_Up | ||
334 | { | ||
335 | Evas_Button_Flags flags; | ||
336 | int d, x, y; | ||
337 | double rad, radx, rady, pres, ang, fx, fy; | ||
338 | int mask; | ||
339 | unsigned int timestamp; | ||
340 | Evas_Event_Flags event_flags; | ||
341 | }; | ||
342 | |||
343 | struct _Ipc_Data_Ev_Multi_Down | ||
344 | { | ||
345 | Evas_Button_Flags flags; | ||
346 | int d, x, y; | ||
347 | double rad, radx, rady, pres, ang, fx, fy; | ||
348 | int mask; | ||
349 | unsigned int timestamp; | ||
350 | Evas_Event_Flags event_flags; | ||
351 | }; | ||
352 | |||
353 | struct _Ipc_Data_Ev_Multi_Move | ||
354 | { | ||
355 | int d, x, y; | ||
356 | double rad, radx, rady, pres, ang, fx, fy; | ||
357 | int mask; | ||
358 | unsigned int timestamp; | ||
359 | Evas_Event_Flags event_flags; | ||
360 | }; | ||
361 | |||
362 | struct _Ipc_Data_Ev_Key_Up | ||
363 | { | ||
364 | const char *keyname, *key, *string, *compose; | ||
365 | int mask; | ||
366 | unsigned int timestamp; | ||
367 | Evas_Event_Flags event_flags; | ||
368 | }; | ||
369 | |||
370 | struct _Ipc_Data_Ev_Key_Down | ||
371 | { | ||
372 | const char *keyname, *key, *string, *compose; | ||
373 | int mask; | ||
374 | unsigned int timestamp; | ||
375 | Evas_Event_Flags event_flags; | ||
376 | }; | ||
377 | 11 | ||
378 | typedef struct _Extn Extn; | 12 | typedef struct _Extn Extn; |
379 | 13 | ||
380 | struct _Extn | 14 | struct _Extn |
381 | { | 15 | { |
382 | struct { | 16 | struct { |
383 | Ecore_Ipc_Server *server; | 17 | Ecore_Ipc_Server *server; |
384 | Eina_List *clients; | 18 | Eina_List *clients; |
385 | Eina_List *handlers; | 19 | Eina_List *handlers; |
386 | Eina_Bool am_server : 1; | 20 | Eina_Bool am_server : 1; |
387 | } ipc; | 21 | } ipc; |
388 | struct { | 22 | struct { |
389 | const char *name; | 23 | const char *name; |
390 | int num; | 24 | int num; |
391 | Eina_Bool sys : 1; | 25 | Eina_Bool sys : 1; |
392 | } svc; | 26 | } svc; |
393 | struct { | 27 | struct { |
394 | const char *lock, *lock2; | 28 | int w, h; |
395 | int lockfd, lockfd2; | 29 | Eina_List *updates; |
396 | const char *shm; | ||
397 | int w, h; | ||
398 | Shmfile *shmfile; | ||
399 | Eina_List *updates; | ||
400 | Eina_Bool have_lock : 1; | ||
401 | Eina_Bool have_real_lock : 1; | ||
402 | Eina_Bool have_lock2 : 1; | ||
403 | Eina_Bool have_real_lock2 : 1; | ||
404 | } file; | 30 | } file; |
405 | struct { | 31 | struct { |
406 | Eina_Bool done : 1; /* need to send change done event to the client(plug) */ | 32 | Extnbuf *buf, *obuf; // current buffer and if needed an "old" buffer |
33 | const char *base, *lock; | ||
34 | int id, num, w, h; | ||
35 | Eina_Bool sys : 1; | ||
36 | Eina_Bool alpha : 1; | ||
37 | } b[NBUF]; | ||
38 | int cur_b; // current buffer (b) being displayed or rendered to | ||
39 | struct { | ||
40 | Eina_Bool done : 1; /* need to send change done event to the client(plug) */ | ||
407 | } profile; | 41 | } profile; |
408 | }; | 42 | }; |
409 | 43 | ||
@@ -452,117 +86,34 @@ _ecore_evas_extn_event(Ecore_Evas *ee, int event) | |||
452 | _ecore_evas_extn_event_free, ee); | 86 | _ecore_evas_extn_event_free, ee); |
453 | } | 87 | } |
454 | 88 | ||
455 | static Eina_Bool | ||
456 | _ecore_evas_lock_other_have(Ecore_Evas *ee, int buf) | ||
457 | { | ||
458 | Eina_List *l; | ||
459 | Ecore_Evas *ee2; | ||
460 | Extn *extn, *extn2; | ||
461 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | ||
462 | Ecore_Evas_Engine_Buffer_Data *bdata2; | ||
463 | |||
464 | extn = bdata->data; | ||
465 | if (!extn) return EINA_FALSE; | ||
466 | // brute force - i know. i expect extn_ee_list to be fairly short. could | ||
467 | // be improved with a hash of lockfiles | ||
468 | EINA_LIST_FOREACH(extn_ee_list, l, ee2) | ||
469 | { | ||
470 | if (ee == ee2) continue; | ||
471 | bdata2 = ee2->engine.data; | ||
472 | extn2 = bdata2->data; | ||
473 | if (!extn2) continue; | ||
474 | if (buf == 0) | ||
475 | { | ||
476 | if ((extn->file.lock) && (extn2->file.lock) && | ||
477 | (!strcmp(extn->file.lock, extn2->file.lock)) && | ||
478 | (extn2->file.have_real_lock)) | ||
479 | return EINA_TRUE; | ||
480 | } | ||
481 | else if (buf == 1) | ||
482 | { | ||
483 | if ((extn->file.lock2) && (extn2->file.lock2) && | ||
484 | (!strcmp(extn->file.lock2, extn2->file.lock2)) && | ||
485 | (extn2->file.have_real_lock2)) | ||
486 | return EINA_TRUE; | ||
487 | } | ||
488 | } | ||
489 | return EINA_FALSE; | ||
490 | } | ||
491 | |||
492 | static void | 89 | static void |
493 | _ecore_evas_socket_lock(Ecore_Evas *ee, int buf) | 90 | _ecore_evas_extn_plug_render_pre(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) |
494 | { | 91 | { |
92 | Ecore_Evas *ee = data; | ||
93 | Ecore_Evas_Engine_Buffer_Data *bdata; | ||
495 | Extn *extn; | 94 | Extn *extn; |
496 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | 95 | |
497 | 96 | if (!ee) return; | |
97 | bdata = ee->engine.data; | ||
98 | if (!bdata) return; | ||
498 | extn = bdata->data; | 99 | extn = bdata->data; |
499 | if (!extn) return; | 100 | if (!extn) return; |
500 | if (buf == 0) | 101 | bdata->pixels = _extnbuf_lock(extn->b[extn->cur_b].buf, NULL, NULL, NULL); |
501 | { | ||
502 | if (extn->file.lockfd < 0) return; | ||
503 | if (extn->file.have_lock) return; | ||
504 | extn->file.have_lock = EINA_TRUE; | ||
505 | if (_ecore_evas_lock_other_have(ee, buf)) return; | ||
506 | if (lockf(extn->file.lockfd, F_ULOCK, 0) < 0) | ||
507 | { | ||
508 | extn->file.have_lock = EINA_FALSE; | ||
509 | return; | ||
510 | } | ||
511 | extn->file.have_real_lock = EINA_TRUE; | ||
512 | } | ||
513 | else if (buf == 1) | ||
514 | { | ||
515 | if (extn->file.lockfd2 < 0) return; | ||
516 | if (extn->file.have_lock2) return; | ||
517 | extn->file.have_lock2 = EINA_TRUE; | ||
518 | if (_ecore_evas_lock_other_have(ee, buf)) return; | ||
519 | if (lockf(extn->file.lockfd2, F_ULOCK, 0) < 0) | ||
520 | { | ||
521 | extn->file.have_lock2 = EINA_FALSE; | ||
522 | return; | ||
523 | } | ||
524 | extn->file.have_real_lock2 = EINA_TRUE; | ||
525 | } | ||
526 | } | 102 | } |
527 | 103 | ||
528 | static void | 104 | static void |
529 | _ecore_evas_socket_unlock(Ecore_Evas *ee, int buf) | 105 | _ecore_evas_extn_plug_render_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) |
530 | { | 106 | { |
107 | Ecore_Evas *ee = data; | ||
108 | Ecore_Evas_Engine_Buffer_Data *bdata; | ||
531 | Extn *extn; | 109 | Extn *extn; |
532 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | 110 | |
533 | 111 | if (!ee) return; | |
112 | bdata = ee->engine.data; | ||
113 | if (!bdata) return; | ||
534 | extn = bdata->data; | 114 | extn = bdata->data; |
535 | if (!extn) return; | 115 | if (!extn) return; |
536 | if (buf == 0) | 116 | _extnbuf_unlock(extn->b[extn->cur_b].buf); |
537 | { | ||
538 | if (extn->file.lockfd < 0) return; | ||
539 | if (!extn->file.have_lock) return; | ||
540 | extn->file.have_lock = EINA_FALSE; | ||
541 | if (!extn->file.have_real_lock) return; | ||
542 | if (lockf(extn->file.lockfd, F_ULOCK, 0) < 0) return; | ||
543 | } | ||
544 | else if (buf == 1) | ||
545 | { | ||
546 | if (extn->file.lockfd2 < 0) return; | ||
547 | if (!extn->file.have_lock2) return; | ||
548 | extn->file.have_lock2 = EINA_FALSE; | ||
549 | if (!extn->file.have_real_lock2) return; | ||
550 | if (lockf(extn->file.lockfd2, F_ULOCK, 0) < 0) return; | ||
551 | } | ||
552 | } | ||
553 | |||
554 | static void | ||
555 | _ecore_evas_extn_plug_targer_render_pre(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) | ||
556 | { | ||
557 | Ecore_Evas *ee = data; | ||
558 | if (ee) _ecore_evas_socket_lock(ee, 0); // XXX choose right buffer to lock | ||
559 | } | ||
560 | |||
561 | static void | ||
562 | _ecore_evas_extn_plug_targer_render_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) | ||
563 | { | ||
564 | Ecore_Evas *ee = data; | ||
565 | if (ee) _ecore_evas_socket_unlock(ee, 0); // XXX choose right buffer to lock | ||
566 | } | 117 | } |
567 | 118 | ||
568 | static void | 119 | static void |
@@ -624,24 +175,18 @@ _ecore_evas_extn_free(Ecore_Evas *ee) | |||
624 | { | 175 | { |
625 | Ecore_Event_Handler *hdl; | 176 | Ecore_Event_Handler *hdl; |
626 | Ipc_Data_Update *ipc; | 177 | Ipc_Data_Update *ipc; |
178 | int i; | ||
627 | 179 | ||
628 | if (extn->file.have_lock) _ecore_evas_socket_unlock(ee, 0); | 180 | for (i = 0; i < NBUF; i++) |
629 | if (extn->file.have_lock2) _ecore_evas_socket_unlock(ee, 1); | ||
630 | if (extn->file.lockfd >= 0) | ||
631 | { | 181 | { |
632 | close(extn->file.lockfd); | 182 | if (extn->b[i].buf) _extnbuf_free(extn->b[i].buf); |
633 | if (extn->ipc.am_server) | 183 | if (extn->b[i].obuf) _extnbuf_free(extn->b[i].obuf); |
634 | { | 184 | if (extn->b[i].base) eina_stringshare_del(extn->b[i].base); |
635 | if (extn->file.lock) unlink(extn->file.lock); | 185 | if (extn->b[i].lock) eina_stringshare_del(extn->b[i].lock); |
636 | } | 186 | extn->b[i].buf = NULL; |
637 | } | 187 | extn->b[i].obuf = NULL; |
638 | if (extn->file.lockfd2 >= 0) | 188 | extn->b[i].base = NULL; |
639 | { | 189 | extn->b[i].lock = NULL; |
640 | close(extn->file.lockfd2); | ||
641 | if (extn->ipc.am_server) | ||
642 | { | ||
643 | if (extn->file.lock2) unlink(extn->file.lock2); | ||
644 | } | ||
645 | } | 190 | } |
646 | if (extn->svc.name) eina_stringshare_del(extn->svc.name); | 191 | if (extn->svc.name) eina_stringshare_del(extn->svc.name); |
647 | if (extn->ipc.clients) | 192 | if (extn->ipc.clients) |
@@ -650,16 +195,6 @@ _ecore_evas_extn_free(Ecore_Evas *ee) | |||
650 | ecore_ipc_client_del(client); | 195 | ecore_ipc_client_del(client); |
651 | } | 196 | } |
652 | if (extn->ipc.server) ecore_ipc_server_del(extn->ipc.server); | 197 | if (extn->ipc.server) ecore_ipc_server_del(extn->ipc.server); |
653 | if (extn->file.lock) eina_stringshare_del(extn->file.lock); | ||
654 | if (extn->file.lock2) eina_stringshare_del(extn->file.lock2); | ||
655 | if (extn->file.shm) eina_stringshare_del(extn->file.shm); | ||
656 | if (extn->file.shmfile) | ||
657 | { | ||
658 | if (extn->ipc.am_server) | ||
659 | shmfile_free(extn->file.shmfile); | ||
660 | else | ||
661 | shmfile_close(extn->file.shmfile); | ||
662 | } | ||
663 | 198 | ||
664 | EINA_LIST_FREE(extn->file.updates, ipc) | 199 | EINA_LIST_FREE(extn->file.updates, ipc) |
665 | free(ipc); | 200 | free(ipc); |
@@ -680,11 +215,11 @@ _ecore_evas_extn_free(Ecore_Evas *ee) | |||
680 | ee); | 215 | ee); |
681 | evas_event_callback_del_full(evas_object_evas_get(bdata->image), | 216 | evas_event_callback_del_full(evas_object_evas_get(bdata->image), |
682 | EVAS_CALLBACK_RENDER_PRE, | 217 | EVAS_CALLBACK_RENDER_PRE, |
683 | _ecore_evas_extn_plug_targer_render_pre, | 218 | _ecore_evas_extn_plug_render_pre, |
684 | ee); | 219 | ee); |
685 | evas_event_callback_del_full(evas_object_evas_get(bdata->image), | 220 | evas_event_callback_del_full(evas_object_evas_get(bdata->image), |
686 | EVAS_CALLBACK_RENDER_POST, | 221 | EVAS_CALLBACK_RENDER_POST, |
687 | _ecore_evas_extn_plug_targer_render_post, | 222 | _ecore_evas_extn_plug_render_post, |
688 | ee); | 223 | ee); |
689 | ee2 = evas_object_data_get(bdata->image, "Ecore_Evas_Parent"); | 224 | ee2 = evas_object_data_get(bdata->image, "Ecore_Evas_Parent"); |
690 | if (ee2) | 225 | if (ee2) |
@@ -1267,31 +802,9 @@ _ecore_evas_extn_plug_profile_set(Ecore_Evas *ee, const char *profile) | |||
1267 | { | 802 | { |
1268 | ee->prop.profile.name = (char *)eina_stringshare_add(profile); | 803 | ee->prop.profile.name = (char *)eina_stringshare_add(profile); |
1269 | if (extn->ipc.server) | 804 | if (extn->ipc.server) |
1270 | { | 805 | ecore_ipc_server_send(extn->ipc.server, MAJOR, |
1271 | Ipc_Data_Profile *ipc; | 806 | OP_PROFILE_CHANGE_REQUEST, |
1272 | char *st, *p; | 807 | 0, 0, 0, profile, strlen(profile) + 1); |
1273 | int len = 0; | ||
1274 | |||
1275 | len += sizeof(Ipc_Data_Profile); | ||
1276 | len += strlen(ee->prop.profile.name) + 1; | ||
1277 | len += 1; | ||
1278 | |||
1279 | st = alloca(len); | ||
1280 | ipc = (Ipc_Data_Profile *)st; | ||
1281 | memset(st, 0, len); | ||
1282 | p = st + sizeof(Ipc_Data_Profile); | ||
1283 | |||
1284 | strcpy(p, ee->prop.profile.name); | ||
1285 | ipc->name = p - (long)st; | ||
1286 | p += strlen(p) + 1; | ||
1287 | |||
1288 | /* send window profile change request to the server(socket) | ||
1289 | * and wait for profile change done from the server | ||
1290 | */ | ||
1291 | ecore_ipc_server_send(extn->ipc.server, MAJOR, | ||
1292 | OP_PROFILE_CHANGE_REQUEST, | ||
1293 | 0, 0, 0, ipc, len); | ||
1294 | } | ||
1295 | } | 808 | } |
1296 | } | 809 | } |
1297 | 810 | ||
@@ -1399,23 +912,25 @@ _ipc_server_del(void *data, int type EINA_UNUSED, void *event) | |||
1399 | Ecore_Evas *ee = data; | 912 | Ecore_Evas *ee = data; |
1400 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | 913 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; |
1401 | Extn *extn; | 914 | Extn *extn; |
915 | int i; | ||
1402 | 916 | ||
1403 | extn = bdata->data; | 917 | extn = bdata->data; |
1404 | if (!extn) return ECORE_CALLBACK_PASS_ON; | 918 | if (!extn) return ECORE_CALLBACK_PASS_ON; |
1405 | if (extn->ipc.server != e->server) return ECORE_CALLBACK_PASS_ON; | 919 | if (extn->ipc.server != e->server) return ECORE_CALLBACK_PASS_ON; |
1406 | evas_object_image_data_set(bdata->image, NULL); | 920 | evas_object_image_data_set(bdata->image, NULL); |
1407 | bdata->pixels = NULL; | 921 | bdata->pixels = NULL; |
1408 | if (extn->file.shmfile) | 922 | |
1409 | { | 923 | for (i = 0; i < NBUF; i++) |
1410 | shmfile_close(extn->file.shmfile); | ||
1411 | extn->file.shmfile = NULL; | ||
1412 | } | ||
1413 | if (extn->file.shm) | ||
1414 | { | 924 | { |
1415 | eina_stringshare_del(extn->file.shm); | 925 | if (extn->b[i].buf) _extnbuf_free(extn->b[i].buf); |
1416 | extn->file.shm = NULL; | 926 | if (extn->b[i].obuf) _extnbuf_free(extn->b[i].obuf); |
927 | if (extn->b[i].base) eina_stringshare_del(extn->b[i].base); | ||
928 | if (extn->b[i].lock) eina_stringshare_del(extn->b[i].lock); | ||
929 | extn->b[i].buf = NULL; | ||
930 | extn->b[i].obuf = NULL; | ||
931 | extn->b[i].base = NULL; | ||
932 | extn->b[i].lock = NULL; | ||
1417 | } | 933 | } |
1418 | extn->ipc.server = NULL; | ||
1419 | if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee); | 934 | if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee); |
1420 | return ECORE_CALLBACK_PASS_ON; | 935 | return ECORE_CALLBACK_PASS_ON; |
1421 | } | 936 | } |
@@ -1446,15 +961,18 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event) | |||
1446 | if (ipc) | 961 | if (ipc) |
1447 | { | 962 | { |
1448 | memcpy(ipc, e->data, sizeof(Ipc_Data_Update)); | 963 | memcpy(ipc, e->data, sizeof(Ipc_Data_Update)); |
1449 | extn->file.updates = eina_list_append(extn->file.updates, ipc); | 964 | extn->file.updates = eina_list_append(extn->file.updates, |
965 | ipc); | ||
1450 | } | 966 | } |
1451 | } | 967 | } |
1452 | break; | 968 | break; |
1453 | case OP_UPDATE_DONE: | 969 | case OP_UPDATE_DONE: |
1454 | // updates finished being sent - done now. frame ready | 970 | // e->response == display buffer # |
971 | // updates finished being sent - done now. frame ready | ||
1455 | { | 972 | { |
1456 | Ipc_Data_Update *ipc; | 973 | Ipc_Data_Update *ipc; |
1457 | 974 | int n = e->response; | |
975 | |||
1458 | EINA_LIST_FREE(extn->file.updates, ipc) | 976 | EINA_LIST_FREE(extn->file.updates, ipc) |
1459 | { | 977 | { |
1460 | if (bdata->image) | 978 | if (bdata->image) |
@@ -1463,89 +981,110 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event) | |||
1463 | ipc->w, ipc->h); | 981 | ipc->w, ipc->h); |
1464 | free(ipc); | 982 | free(ipc); |
1465 | } | 983 | } |
984 | if ((n >= 0) && (n < NBUF)) | ||
985 | { | ||
986 | void *data; | ||
987 | int w = 0, h = 0, pn; | ||
988 | |||
989 | pn = extn->cur_b; | ||
990 | extn->cur_b = n; | ||
991 | |||
992 | if (extn->b[pn].buf) _extnbuf_unlock(extn->b[pn].buf); | ||
993 | if (extn->b[pn].obuf) | ||
994 | { | ||
995 | _extnbuf_unlock(extn->b[pn].obuf); | ||
996 | _extnbuf_free(extn->b[pn].obuf); | ||
997 | extn->b[pn].obuf = NULL; | ||
998 | } | ||
999 | if (extn->b[n].buf) | ||
1000 | { | ||
1001 | data = _extnbuf_data_get(extn->b[n].buf, &w, &h, NULL); | ||
1002 | bdata->pixels = data; | ||
1003 | evas_object_image_alpha_set(bdata->image, | ||
1004 | extn->b[n].alpha); | ||
1005 | evas_object_image_size_set(bdata->image, w, h); | ||
1006 | evas_object_image_data_set(bdata->image, data); | ||
1007 | } | ||
1008 | else | ||
1009 | { | ||
1010 | bdata->pixels = NULL; | ||
1011 | evas_object_image_alpha_set(bdata->image, EINA_TRUE); | ||
1012 | evas_object_image_size_set(bdata->image, 1, 1); | ||
1013 | evas_object_image_data_set(bdata->image, &blank); | ||
1014 | } | ||
1015 | } | ||
1466 | } | 1016 | } |
1467 | break; | 1017 | break; |
1468 | case OP_LOCK_FILE: | 1018 | case OP_SHM_REF0: |
1019 | // e->ref == shm id | ||
1020 | // e->ref_to == shm num | ||
1021 | // e->response == buffer num | ||
1022 | // e->data = shm ref string + nul byte | ||
1469 | if ((e->data) && (e->size > 0) && | 1023 | if ((e->data) && (e->size > 0) && |
1470 | (((unsigned char *)e->data)[e->size - 1] == 0)) | 1024 | (((unsigned char *)e->data)[e->size - 1] == 0)) |
1471 | { | 1025 | { |
1472 | if (extn->file.have_lock) _ecore_evas_socket_unlock(ee, 0); | 1026 | int n = e->response; |
1473 | if (extn->file.lockfd) close(extn->file.lockfd); | 1027 | |
1474 | if (extn->file.lock) eina_stringshare_del(extn->file.lock); | 1028 | if ((n >= 0) && (n < NBUF)) |
1475 | extn->file.lock = eina_stringshare_add(e->data); | 1029 | { |
1476 | extn->file.lockfd = open(extn->file.lock, O_RDONLY); | 1030 | extn->b[n].id = e->ref; |
1031 | extn->b[n].num = e->ref_to; | ||
1032 | if (extn->b[n].base) eina_stringshare_del(extn->b[n].base); | ||
1033 | extn->b[n].base = eina_stringshare_add(e->data); | ||
1034 | } | ||
1477 | } | 1035 | } |
1478 | break; | 1036 | break; |
1479 | case OP_LOCK_FILE2: | 1037 | case OP_SHM_REF1: |
1038 | // e->ref == w | ||
1039 | // e->ref_to == h | ||
1040 | // e->response == buffer num | ||
1041 | // e->data = lockfile + nul byte | ||
1480 | if ((e->data) && (e->size > 0) && | 1042 | if ((e->data) && (e->size > 0) && |
1481 | (((unsigned char *)e->data)[e->size - 1] == 0)) | 1043 | (((unsigned char *)e->data)[e->size - 1] == 0)) |
1482 | { | 1044 | { |
1483 | if (extn->file.have_lock2) _ecore_evas_socket_unlock(ee, 1); | 1045 | int n = e->response; |
1484 | if (extn->file.lockfd2 >= 0) close(extn->file.lockfd2); | 1046 | |
1485 | if (extn->file.lock2) eina_stringshare_del(extn->file.lock2); | 1047 | if ((n >= 0) && (n < NBUF)) |
1486 | extn->file.lock2 = eina_stringshare_add(e->data); | 1048 | { |
1487 | extn->file.lockfd2 = open(extn->file.lock2, O_RDONLY); | 1049 | extn->b[n].w = e->ref; |
1050 | extn->b[n].h = e->ref_to; | ||
1051 | if (extn->b[n].lock) eina_stringshare_del(extn->b[n].lock); | ||
1052 | extn->b[n].lock = eina_stringshare_add(e->data); | ||
1053 | } | ||
1488 | } | 1054 | } |
1489 | break; | 1055 | break; |
1490 | case OP_SHM_REF: | 1056 | case OP_SHM_REF2: |
1491 | // e->ref == w | 1057 | // e->ref == alpha |
1492 | // e->ref_to == h | 1058 | // e->ref_to == sys |
1493 | // e->response == alpha | 1059 | // e->response == buffer num |
1494 | // e->data = shm ref string + nul byte | ||
1495 | if ((e->data) && ((unsigned char *)e->data)[e->size - 1] == 0) | ||
1496 | { | 1060 | { |
1497 | bdata->pixels = NULL; | 1061 | int n = e->response; |
1498 | if (extn->file.shmfile) | 1062 | |
1499 | { | 1063 | if ((n >= 0) && (n < NBUF)) |
1500 | shmfile_close(extn->file.shmfile); | ||
1501 | extn->file.shmfile = NULL; | ||
1502 | } | ||
1503 | if (extn->file.shm) | ||
1504 | { | ||
1505 | eina_stringshare_del(extn->file.shm); | ||
1506 | extn->file.shm = NULL; | ||
1507 | } | ||
1508 | if ((e->ref > 0) && (e->ref_to > 0)) | ||
1509 | { | 1064 | { |
1510 | extn->file.w = e->ref; | 1065 | extn->b[n].alpha = e->ref; |
1511 | extn->file.h = e->ref_to; | 1066 | extn->b[n].sys = e->ref_to; |
1512 | extn->file.shm = eina_stringshare_add(e->data); | 1067 | if (extn->b[n].buf) |
1513 | extn->file.shmfile = shmfile_open(extn->file.shm, | ||
1514 | extn->file.w * | ||
1515 | extn->file.h * 4, | ||
1516 | EINA_TRUE); | ||
1517 | if (extn->file.shmfile) | ||
1518 | { | 1068 | { |
1519 | bdata->pixels = extn->file.shmfile->addr; | 1069 | if (_extnbuf_lock_get(extn->b[n].buf)) |
1520 | if (bdata->image) | ||
1521 | { | 1070 | { |
1522 | if (e->response) | 1071 | if (extn->b[n].obuf) ERR("obuf is non-null"); |
1523 | evas_object_image_alpha_set(bdata->image, | 1072 | extn->b[n].obuf = extn->b[n].buf; |
1524 | EINA_TRUE); | ||
1525 | else | ||
1526 | evas_object_image_alpha_set(bdata->image, | ||
1527 | EINA_FALSE); | ||
1528 | evas_object_image_size_set(bdata->image, | ||
1529 | extn->file.w, | ||
1530 | extn->file.h); | ||
1531 | evas_object_image_data_set(bdata->image, | ||
1532 | bdata->pixels); | ||
1533 | evas_object_image_data_update_add(bdata->image, | ||
1534 | 0, 0, | ||
1535 | extn->file.w, | ||
1536 | extn->file.h); | ||
1537 | _ecore_evas_resize(ee, | ||
1538 | extn->file.w, | ||
1539 | extn->file.h); | ||
1540 | } | 1073 | } |
1541 | else | 1074 | else |
1542 | evas_object_image_data_set(bdata->image, NULL); | 1075 | _extnbuf_free(extn->b[n].buf); |
1543 | } | 1076 | } |
1544 | else | 1077 | extn->b[n].buf = _extnbuf_new(extn->b[n].base, |
1545 | evas_object_image_data_set(bdata->image, NULL); | 1078 | extn->b[n].id, |
1079 | extn->b[n].sys, | ||
1080 | extn->b[n].num, | ||
1081 | extn->b[n].w, | ||
1082 | extn->b[n].h, | ||
1083 | EINA_FALSE); | ||
1084 | if ((extn->b[n].buf) && (extn->b[n].lock)) | ||
1085 | _extnbuf_lock_file_set(extn->b[n].buf, | ||
1086 | extn->b[n].lock); | ||
1546 | } | 1087 | } |
1547 | else | ||
1548 | evas_object_image_data_set(bdata->image, NULL); | ||
1549 | } | 1088 | } |
1550 | break; | 1089 | break; |
1551 | case OP_RESIZE: | 1090 | case OP_RESIZE: |
@@ -1596,7 +1135,6 @@ ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target) | |||
1596 | free(ee); | 1135 | free(ee); |
1597 | return NULL; | 1136 | return NULL; |
1598 | } | 1137 | } |
1599 | |||
1600 | ee->engine.data = bdata; | 1138 | ee->engine.data = bdata; |
1601 | o = evas_object_image_filled_add(ee_target->evas); | 1139 | o = evas_object_image_filled_add(ee_target->evas); |
1602 | /* this make problem in gl engine, so I'll block this until solve problem | 1140 | /* this make problem in gl engine, so I'll block this until solve problem |
@@ -1693,11 +1231,6 @@ ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target) | |||
1693 | 1231 | ||
1694 | extn_ee_list = eina_list_append(extn_ee_list, ee); | 1232 | extn_ee_list = eina_list_append(extn_ee_list, ee); |
1695 | ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee); | 1233 | ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee); |
1696 | |||
1697 | evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_PRE, | ||
1698 | _ecore_evas_extn_plug_targer_render_pre, ee); | ||
1699 | evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_POST, | ||
1700 | _ecore_evas_extn_plug_targer_render_post, ee); | ||
1701 | return o; | 1234 | return o; |
1702 | } | 1235 | } |
1703 | 1236 | ||
@@ -1756,20 +1289,6 @@ _ecore_evas_extn_plug_connect(Ecore_Evas *ee, const char *svcname, int svcnum, E | |||
1756 | } | 1289 | } |
1757 | 1290 | ||
1758 | static void | 1291 | static void |
1759 | _ecore_evas_extn_plug_object_data_lock(Ecore_Evas *ee) | ||
1760 | { | ||
1761 | if (!ee) return; | ||
1762 | _ecore_evas_socket_lock(ee, 0); // XXX lock correct buffer | ||
1763 | } | ||
1764 | |||
1765 | static void | ||
1766 | _ecore_evas_extn_plug_object_data_unlock(Ecore_Evas *ee) | ||
1767 | { | ||
1768 | if (!ee) return; | ||
1769 | _ecore_evas_socket_unlock(ee, 0); // XXX lock correct buffer | ||
1770 | } | ||
1771 | |||
1772 | static void | ||
1773 | _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h) | 1292 | _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h) |
1774 | { | 1293 | { |
1775 | Extn *extn; | 1294 | Extn *extn; |
@@ -1790,15 +1309,38 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h) | |||
1790 | extn = bdata->data; | 1309 | extn = bdata->data; |
1791 | if (extn) | 1310 | if (extn) |
1792 | { | 1311 | { |
1793 | if (extn->file.shmfile) | 1312 | int i, last_try = 0; |
1794 | shmfile_free(extn->file.shmfile); | 1313 | |
1314 | for (i = 0; i < NBUF; i++) | ||
1315 | { | ||
1316 | if (extn->b[i].buf) _extnbuf_free(extn->b[i].buf); | ||
1317 | if (extn->b[i].obuf) _extnbuf_free(extn->b[i].obuf); | ||
1318 | if (extn->b[i].base) eina_stringshare_del(extn->b[i].base); | ||
1319 | if (extn->b[i].lock) eina_stringshare_del(extn->b[i].lock); | ||
1320 | extn->b[i].buf = NULL; | ||
1321 | extn->b[i].obuf = NULL; | ||
1322 | extn->b[i].base = NULL; | ||
1323 | extn->b[i].lock = NULL; | ||
1324 | } | ||
1795 | bdata->pixels = NULL; | 1325 | bdata->pixels = NULL; |
1796 | extn->file.shmfile = shmfile_new(extn->svc.name, extn->svc.num, | 1326 | for (i = 0; i < NBUF; i++) |
1797 | ee->w * ee->h * 4, extn->svc.sys); | 1327 | { |
1798 | if (extn->file.shmfile) | 1328 | do |
1799 | bdata->pixels = extn->file.shmfile->addr; | 1329 | { |
1800 | 1330 | extn->b[i].buf = _extnbuf_new(extn->svc.name, extn->svc.num, | |
1801 | stride = ee->w * 4; | 1331 | extn->svc.sys, last_try, |
1332 | ee->w, ee->h, EINA_TRUE); | ||
1333 | if (extn->b[i].buf) extn->b[i].num = last_try; | ||
1334 | last_try++; | ||
1335 | if (last_try > 1024) break; | ||
1336 | } | ||
1337 | while (!extn->b[i].buf); | ||
1338 | |||
1339 | } | ||
1340 | |||
1341 | if (extn->b[extn->cur_b].buf) | ||
1342 | bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf, | ||
1343 | NULL, NULL, &stride); | ||
1802 | einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas); | 1344 | einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas); |
1803 | if (einfo) | 1345 | if (einfo) |
1804 | { | 1346 | { |
@@ -1812,28 +1354,43 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h) | |||
1812 | einfo->info.alpha_threshold = 0; | 1354 | einfo->info.alpha_threshold = 0; |
1813 | einfo->info.func.new_update_region = NULL; | 1355 | einfo->info.func.new_update_region = NULL; |
1814 | einfo->info.func.free_update_region = NULL; | 1356 | einfo->info.func.free_update_region = NULL; |
1357 | einfo->info.func.switch_buffer = _ecore_evas_socket_switch; | ||
1358 | einfo->info.switch_data = ee; | ||
1815 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | 1359 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) |
1816 | { | 1360 | { |
1817 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | 1361 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); |
1818 | } | 1362 | } |
1819 | } | 1363 | } |
1820 | 1364 | ||
1821 | if (extn->ipc.clients && extn->file.shmfile) | 1365 | if (extn->ipc.clients && extn->b[extn->cur_b].buf) |
1822 | { | 1366 | { |
1823 | Ipc_Data_Resize ipc; | 1367 | Ipc_Data_Resize ipc; |
1824 | Eina_List *l; | 1368 | Eina_List *l; |
1825 | Ecore_Ipc_Client *client; | 1369 | Ecore_Ipc_Client *client; |
1826 | 1370 | ||
1827 | EINA_LIST_FOREACH(extn->ipc.clients, l, client) | 1371 | EINA_LIST_FOREACH(extn->ipc.clients, l, client) |
1828 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF, | 1372 | { |
1829 | ee->w, ee->h, ee->alpha, | 1373 | for (i = 0; i < NBUF; i++) |
1830 | extn->file.shmfile->file, | 1374 | { |
1831 | strlen(extn->file.shmfile->file) + 1); | 1375 | const char *lock; |
1832 | ipc.w = ee->w; | 1376 | |
1833 | ipc.h = ee->h; | 1377 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF0, |
1834 | EINA_LIST_FOREACH(extn->ipc.clients, l, client) | 1378 | extn->svc.num, extn->b[i].num, i, |
1835 | ecore_ipc_client_send(client, MAJOR, OP_RESIZE, | 1379 | extn->svc.name, |
1836 | 0, 0, 0, &ipc, sizeof(ipc)); | 1380 | strlen(extn->svc.name) + 1); |
1381 | lock = _extnbuf_lock_file_get(extn->b[i].buf); | ||
1382 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF1, | ||
1383 | ee->w, ee->h, i, | ||
1384 | lock, strlen(lock) + 1); | ||
1385 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF2, | ||
1386 | ee->alpha, extn->svc.sys, i, | ||
1387 | NULL, 0); | ||
1388 | ipc.w = ee->w; | ||
1389 | ipc.h = ee->h; | ||
1390 | ecore_ipc_client_send(client, MAJOR, OP_RESIZE, | ||
1391 | 0, 0, 0, &ipc, sizeof(ipc)); | ||
1392 | } | ||
1393 | } | ||
1837 | } | 1394 | } |
1838 | } | 1395 | } |
1839 | if (ee->func.fn_resize) ee->func.fn_resize(ee); | 1396 | if (ee->func.fn_resize) ee->func.fn_resize(ee); |
@@ -1852,34 +1409,35 @@ _ecore_evas_extn_socket_window_profile_change_done_send(Ecore_Evas *ee) | |||
1852 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | 1409 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; |
1853 | Ecore_Ipc_Client *client; | 1410 | Ecore_Ipc_Client *client; |
1854 | Eina_List *l = NULL; | 1411 | Eina_List *l = NULL; |
1855 | Ipc_Data_Profile *ipc; | 1412 | char *s; |
1856 | char *st, *p; | ||
1857 | int len = 0; | 1413 | int len = 0; |
1858 | 1414 | ||
1859 | extn = bdata->data; | 1415 | extn = bdata->data; |
1860 | if (!extn) return; | 1416 | if (!extn) return; |
1861 | 1417 | s = ee->prop.profile.name; | |
1862 | len += sizeof(Ipc_Data_Profile); | 1418 | if (s) len = strlen(s); |
1863 | len += strlen(ee->prop.profile.name) + 1; | ||
1864 | len += 1; | ||
1865 | |||
1866 | st = alloca(len); | ||
1867 | ipc = (Ipc_Data_Profile *)st; | ||
1868 | memset(st, 0, len); | ||
1869 | p = st + sizeof(Ipc_Data_Profile); | ||
1870 | |||
1871 | strcpy(p, ee->prop.profile.name); | ||
1872 | ipc->name = p - (long)st; | ||
1873 | p += strlen(p) + 1; | ||
1874 | |||
1875 | EINA_LIST_FOREACH(extn->ipc.clients, l, client) | 1419 | EINA_LIST_FOREACH(extn->ipc.clients, l, client) |
1876 | { | 1420 | { |
1877 | ecore_ipc_client_send(client, MAJOR, | 1421 | ecore_ipc_client_send(client, MAJOR, |
1878 | OP_PROFILE_CHANGE_DONE, | 1422 | OP_PROFILE_CHANGE_DONE, |
1879 | 0, 0, 0, ipc, len); | 1423 | 0, 0, 0, s, len); |
1880 | } | 1424 | } |
1881 | } | 1425 | } |
1882 | 1426 | ||
1427 | static void * | ||
1428 | _ecore_evas_socket_switch(void *data, void *dest_buf) | ||
1429 | { | ||
1430 | Ecore_Evas *ee = data; | ||
1431 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | ||
1432 | Extn *extn = bdata->data; | ||
1433 | |||
1434 | extn->cur_b++; | ||
1435 | if (extn->cur_b >= NBUF) extn->cur_b = 0; | ||
1436 | bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf, | ||
1437 | NULL, NULL, NULL); | ||
1438 | return bdata->pixels; | ||
1439 | } | ||
1440 | |||
1883 | int | 1441 | int |
1884 | _ecore_evas_extn_socket_render(Ecore_Evas *ee) | 1442 | _ecore_evas_extn_socket_render(Ecore_Evas *ee) |
1885 | { | 1443 | { |
@@ -1890,7 +1448,8 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee) | |||
1890 | Extn *extn; | 1448 | Extn *extn; |
1891 | Ecore_Ipc_Client *client; | 1449 | Ecore_Ipc_Client *client; |
1892 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | 1450 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; |
1893 | 1451 | int cur_b; | |
1452 | |||
1894 | extn = bdata->data; | 1453 | extn = bdata->data; |
1895 | if (!extn) return rend; | 1454 | if (!extn) return rend; |
1896 | EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) | 1455 | EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) |
@@ -1902,30 +1461,33 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee) | |||
1902 | } | 1461 | } |
1903 | if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); | 1462 | if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); |
1904 | 1463 | ||
1464 | cur_b = extn->cur_b; | ||
1905 | if (bdata->pixels) | 1465 | if (bdata->pixels) |
1906 | { | 1466 | { |
1907 | _ecore_evas_socket_lock(ee, 0); // XXX lock correct buffer | 1467 | bdata->pixels = _extnbuf_lock(extn->b[cur_b].buf, NULL, NULL, NULL); |
1908 | updates = evas_render_updates(ee->evas); | 1468 | updates = evas_render_updates(ee->evas); |
1909 | _ecore_evas_socket_unlock(ee, 0); // XXX lock correct buffer | 1469 | _extnbuf_unlock(extn->b[cur_b].buf); |
1910 | } | ||
1911 | EINA_LIST_FOREACH(updates, l, r) | ||
1912 | { | ||
1913 | Ipc_Data_Update ipc; | ||
1914 | |||
1915 | |||
1916 | ipc.x = r->x; | ||
1917 | ipc.y = r->y; | ||
1918 | ipc.w = r->w; | ||
1919 | ipc.h = r->h; | ||
1920 | EINA_LIST_FOREACH(extn->ipc.clients, ll, client) | ||
1921 | ecore_ipc_client_send(client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc, sizeof(ipc)); | ||
1922 | } | 1470 | } |
1923 | if (updates) | 1471 | if (updates) |
1924 | { | 1472 | { |
1473 | EINA_LIST_FOREACH(updates, l, r) | ||
1474 | { | ||
1475 | Ipc_Data_Update ipc; | ||
1476 | |||
1477 | |||
1478 | ipc.x = r->x; | ||
1479 | ipc.y = r->y; | ||
1480 | ipc.w = r->w; | ||
1481 | ipc.h = r->h; | ||
1482 | EINA_LIST_FOREACH(extn->ipc.clients, ll, client) | ||
1483 | ecore_ipc_client_send(client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc, | ||
1484 | sizeof(ipc)); | ||
1485 | } | ||
1925 | evas_render_updates_free(updates); | 1486 | evas_render_updates_free(updates); |
1926 | _ecore_evas_idle_timeout_update(ee); | 1487 | _ecore_evas_idle_timeout_update(ee); |
1927 | EINA_LIST_FOREACH(extn->ipc.clients, ll, client) | 1488 | EINA_LIST_FOREACH(extn->ipc.clients, ll, client) |
1928 | ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 0, NULL, 0); | 1489 | ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, |
1490 | cur_b, NULL, 0); | ||
1929 | if (extn->profile.done) | 1491 | if (extn->profile.done) |
1930 | { | 1492 | { |
1931 | _ecore_evas_extn_socket_window_profile_change_done_send(ee); | 1493 | _ecore_evas_extn_socket_window_profile_change_done_send(ee); |
@@ -1944,6 +1506,7 @@ _ipc_client_add(void *data, int type EINA_UNUSED, void *event) | |||
1944 | Ecore_Evas *ee = data; | 1506 | Ecore_Evas *ee = data; |
1945 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; | 1507 | Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; |
1946 | Extn *extn; | 1508 | Extn *extn; |
1509 | int i; | ||
1947 | 1510 | ||
1948 | if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client))) | 1511 | if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client))) |
1949 | return ECORE_CALLBACK_PASS_ON; | 1512 | return ECORE_CALLBACK_PASS_ON; |
@@ -1953,22 +1516,32 @@ _ipc_client_add(void *data, int type EINA_UNUSED, void *event) | |||
1953 | if (!extn) return ECORE_CALLBACK_PASS_ON; | 1516 | if (!extn) return ECORE_CALLBACK_PASS_ON; |
1954 | 1517 | ||
1955 | extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client); | 1518 | extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client); |
1956 | ecore_ipc_client_send(e->client, MAJOR, OP_LOCK_FILE, 0, 0, 0, extn->file.lock, strlen(extn->file.lock) + 1); | 1519 | |
1957 | ecore_ipc_client_send(e->client, MAJOR, OP_LOCK_FILE2, 0, 0, 0, extn->file.lock2, strlen(extn->file.lock2) + 1); | 1520 | for (i = 0; i < NBUF; i++) |
1958 | |||
1959 | if (extn->file.shmfile) | ||
1960 | { | 1521 | { |
1522 | const char *lock; | ||
1961 | Ipc_Data_Resize ipc; | 1523 | Ipc_Data_Resize ipc; |
1962 | 1524 | Ipc_Data_Update ipc2; | |
1963 | ecore_ipc_client_send(e->client, MAJOR, OP_SHM_REF, | 1525 | |
1964 | ee->w, ee->h, ee->alpha, | 1526 | ecore_ipc_client_send(e->client, MAJOR, OP_SHM_REF0, |
1965 | extn->file.shmfile->file, | 1527 | extn->svc.num, extn->b[i].num, i, |
1966 | strlen(extn->file.shmfile->file) + 1); | 1528 | extn->svc.name, |
1967 | ipc.w = ee->w; | 1529 | strlen(extn->svc.name) + 1); |
1968 | ipc.h = ee->h; | 1530 | lock = _extnbuf_lock_file_get(extn->b[i].buf); |
1969 | 1531 | ecore_ipc_client_send(e->client, MAJOR, OP_SHM_REF1, | |
1532 | ee->w, ee->h, i, | ||
1533 | lock, strlen(lock) + 1); | ||
1534 | ecore_ipc_client_send(e->client, MAJOR, OP_SHM_REF2, | ||
1535 | ee->alpha, extn->svc.sys, i, | ||
1536 | NULL, 0); | ||
1537 | ipc.w = ee->w; ipc.h = ee->h; | ||
1970 | ecore_ipc_client_send(e->client, MAJOR, OP_RESIZE, | 1538 | ecore_ipc_client_send(e->client, MAJOR, OP_RESIZE, |
1971 | 0, 0, 0, &ipc, sizeof(ipc)); | 1539 | 0, 0, 0, &ipc, sizeof(ipc)); |
1540 | ipc2.x = 0; ipc2.y = 0; ipc2.w = ee->w; ipc2.h = ee->h; | ||
1541 | ecore_ipc_client_send(e->client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc2, | ||
1542 | sizeof(ipc2)); | ||
1543 | ecore_ipc_client_send(e->client, MAJOR, OP_UPDATE_DONE, 0, 0, | ||
1544 | extn->cur_b, NULL, 0); | ||
1972 | } | 1545 | } |
1973 | _ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_ADD); | 1546 | _ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_ADD); |
1974 | return ECORE_CALLBACK_PASS_ON; | 1547 | return ECORE_CALLBACK_PASS_ON; |
@@ -2229,24 +1802,16 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void *event) | |||
2229 | } | 1802 | } |
2230 | break; | 1803 | break; |
2231 | case OP_PROFILE_CHANGE_REQUEST: | 1804 | case OP_PROFILE_CHANGE_REQUEST: |
2232 | if (e->size >= (int)sizeof(Ipc_Data_Profile)) | 1805 | if ((e->data) && (e->size > 0) && |
2233 | { | 1806 | (((unsigned char *)e->data)[e->size - 1] == 0)) |
2234 | if ((e->data) && (e->size > 0) && | 1807 | { |
2235 | (((unsigned char *)e->data)[e->size - 1] == 0)) | 1808 | _ecore_evas_window_profile_free(ee); |
2236 | { | 1809 | ee->prop.profile.name = (char *)eina_stringshare_add(e->data); |
2237 | Ipc_Data_Profile *ipc = e->data; | 1810 | |
2238 | STRGET(name); | 1811 | if (ee->func.fn_state_change) |
2239 | if (ipc->name) | 1812 | ee->func.fn_state_change(ee); |
2240 | { | 1813 | |
2241 | _ecore_evas_window_profile_free(ee); | 1814 | extn->profile.done = EINA_TRUE; |
2242 | ee->prop.profile.name = (char *)eina_stringshare_add(ipc->name); | ||
2243 | |||
2244 | if (ee->func.fn_state_change) | ||
2245 | ee->func.fn_state_change(ee); | ||
2246 | |||
2247 | extn->profile.done = EINA_TRUE; | ||
2248 | } | ||
2249 | } | ||
2250 | } | 1815 | } |
2251 | break; | 1816 | break; |
2252 | case OP_MSG: | 1817 | case OP_MSG: |
@@ -2294,10 +1859,26 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha) | |||
2294 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); | 1859 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); |
2295 | } | 1860 | } |
2296 | EINA_LIST_FOREACH(extn->ipc.clients, l, client) | 1861 | EINA_LIST_FOREACH(extn->ipc.clients, l, client) |
2297 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF, | 1862 | { |
2298 | ee->w, ee->h, ee->alpha, | 1863 | int i; |
2299 | extn->file.shmfile->file, | 1864 | |
2300 | strlen(extn->file.shmfile->file) + 1); | 1865 | for (i = 0; i < NBUF; i++) |
1866 | { | ||
1867 | const char *lock; | ||
1868 | |||
1869 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF0, | ||
1870 | extn->svc.num, extn->b[i].num, i, | ||
1871 | extn->svc.name, | ||
1872 | strlen(extn->svc.name) + 1); | ||
1873 | lock = _extnbuf_lock_file_get(extn->b[i].buf); | ||
1874 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF1, | ||
1875 | ee->w, ee->h, i, | ||
1876 | lock, strlen(lock) + 1); | ||
1877 | ecore_ipc_client_send(client, MAJOR, OP_SHM_REF1, | ||
1878 | ee->alpha, extn->svc.sys, i, | ||
1879 | NULL, 0); | ||
1880 | } | ||
1881 | } | ||
2301 | } | 1882 | } |
2302 | } | 1883 | } |
2303 | 1884 | ||
@@ -2491,6 +2072,8 @@ ecore_evas_extn_socket_new_internal(int w, int h) | |||
2491 | einfo->info.alpha_threshold = 0; | 2072 | einfo->info.alpha_threshold = 0; |
2492 | einfo->info.func.new_update_region = NULL; | 2073 | einfo->info.func.new_update_region = NULL; |
2493 | einfo->info.func.free_update_region = NULL; | 2074 | einfo->info.func.free_update_region = NULL; |
2075 | einfo->info.func.switch_buffer = _ecore_evas_socket_switch; | ||
2076 | einfo->info.switch_data = ee; | ||
2494 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | 2077 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) |
2495 | { | 2078 | { |
2496 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | 2079 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); |
@@ -2535,50 +2118,35 @@ _ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, | |||
2535 | else | 2118 | else |
2536 | { | 2119 | { |
2537 | Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER; | 2120 | Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER; |
2538 | char buf[PATH_MAX]; | 2121 | int i; |
2122 | int last_try = 0; | ||
2539 | 2123 | ||
2540 | ecore_ipc_init(); | 2124 | ecore_ipc_init(); |
2541 | extn->svc.name = eina_stringshare_add(svcname); | 2125 | extn->svc.name = eina_stringshare_add(svcname); |
2542 | extn->svc.num = svcnum; | 2126 | extn->svc.num = svcnum; |
2543 | extn->svc.sys = svcsys; | 2127 | extn->svc.sys = svcsys; |
2544 | 2128 | ||
2545 | snprintf(buf, sizeof(buf), "/tmp/ee-lock-XXXXXX"); | 2129 | for (i = 0; i < NBUF; i++) |
2546 | extn->file.lockfd = mkstemp(buf); | ||
2547 | if (extn->file.lockfd >= 0) | ||
2548 | extn->file.lock = eina_stringshare_add(buf); | ||
2549 | if ((extn->file.lockfd < 0) || (!extn->file.lock)) | ||
2550 | { | 2130 | { |
2551 | if (extn->file.lockfd) | 2131 | do |
2552 | { | 2132 | { |
2553 | close(extn->file.lockfd >= 0); | 2133 | extn->b[i].buf = _extnbuf_new(extn->svc.name, extn->svc.num, |
2554 | unlink(buf); | 2134 | extn->svc.sys, last_try, |
2135 | ee->w, ee->h, EINA_TRUE); | ||
2136 | if (extn->b[i].buf) extn->b[i].num = last_try; | ||
2137 | last_try++; | ||
2138 | if (last_try > 1024) break; | ||
2555 | } | 2139 | } |
2556 | eina_stringshare_del(extn->svc.name); | 2140 | while (!extn->b[i].buf); |
2557 | if (extn->file.lock) eina_stringshare_del(extn->file.lock); | 2141 | |
2558 | free(extn); | ||
2559 | ecore_ipc_shutdown(); | ||
2560 | return EINA_FALSE; | ||
2561 | } | 2142 | } |
2562 | 2143 | ||
2563 | snprintf(buf, sizeof(buf), "/tmp/ee-lock-XXXXXX"); | 2144 | if (extn->b[extn->cur_b].buf) |
2564 | extn->file.lockfd2 = mkstemp(buf); | 2145 | bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf, |
2565 | if (extn->file.lockfd2 >= 0) | 2146 | NULL, NULL, NULL); |
2566 | extn->file.lock2 = eina_stringshare_add(buf); | 2147 | else |
2567 | if ((extn->file.lockfd2 < 0) || (!extn->file.lock2)) | ||
2568 | { | 2148 | { |
2569 | if (extn->file.lockfd >= 0) | ||
2570 | { | ||
2571 | close(extn->file.lockfd); | ||
2572 | if (extn->file.lock) unlink(extn->file.lock); | ||
2573 | } | ||
2574 | if (extn->file.lockfd2 >= 0) | ||
2575 | { | ||
2576 | close(extn->file.lockfd2); | ||
2577 | unlink(buf); | ||
2578 | } | ||
2579 | eina_stringshare_del(extn->svc.name); | 2149 | eina_stringshare_del(extn->svc.name); |
2580 | if (extn->file.lock) eina_stringshare_del(extn->file.lock); | ||
2581 | if (extn->file.lock2) eina_stringshare_del(extn->file.lock2); | ||
2582 | free(extn); | 2150 | free(extn); |
2583 | ecore_ipc_shutdown(); | 2151 | ecore_ipc_shutdown(); |
2584 | return EINA_FALSE; | 2152 | return EINA_FALSE; |
@@ -2591,19 +2159,18 @@ _ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, | |||
2591 | extn->svc.num, ee); | 2159 | extn->svc.num, ee); |
2592 | if (!extn->ipc.server) | 2160 | if (!extn->ipc.server) |
2593 | { | 2161 | { |
2594 | if (extn->file.lockfd >= 0) | 2162 | for (i = 0; i < NBUF; i++) |
2595 | { | ||
2596 | close(extn->file.lockfd); | ||
2597 | if (extn->file.lock) unlink(extn->file.lock); | ||
2598 | } | ||
2599 | if (extn->file.lockfd2 >= 0) | ||
2600 | { | 2163 | { |
2601 | close(extn->file.lockfd2); | 2164 | if (extn->b[i].buf) _extnbuf_free(extn->b[i].buf); |
2602 | if (extn->file.lock2) unlink(extn->file.lock2); | 2165 | if (extn->b[i].obuf) _extnbuf_free(extn->b[i].obuf); |
2166 | if (extn->b[i].base) eina_stringshare_del(extn->b[i].base); | ||
2167 | if (extn->b[i].lock) eina_stringshare_del(extn->b[i].lock); | ||
2168 | extn->b[i].buf = NULL; | ||
2169 | extn->b[i].obuf = NULL; | ||
2170 | extn->b[i].base = NULL; | ||
2171 | extn->b[i].lock = NULL; | ||
2603 | } | 2172 | } |
2604 | eina_stringshare_del(extn->svc.name); | 2173 | eina_stringshare_del(extn->svc.name); |
2605 | eina_stringshare_del(extn->file.lock); | ||
2606 | eina_stringshare_del(extn->file.lock2); | ||
2607 | free(extn); | 2174 | free(extn); |
2608 | ecore_ipc_shutdown(); | 2175 | ecore_ipc_shutdown(); |
2609 | return EINA_FALSE; | 2176 | return EINA_FALSE; |
@@ -2636,8 +2203,6 @@ _ecore_evas_extn_interface_new(void) | |||
2636 | iface->base.name = interface_extn_name; | 2203 | iface->base.name = interface_extn_name; |
2637 | iface->base.version = interface_extn_version; | 2204 | iface->base.version = interface_extn_version; |
2638 | 2205 | ||
2639 | iface->data_lock = _ecore_evas_extn_plug_object_data_lock; | ||
2640 | iface->data_unlock = _ecore_evas_extn_plug_object_data_unlock; | ||
2641 | iface->connect = _ecore_evas_extn_plug_connect; | 2206 | iface->connect = _ecore_evas_extn_plug_connect; |
2642 | iface->listen = _ecore_evas_extn_socket_listen; | 2207 | iface->listen = _ecore_evas_extn_socket_listen; |
2643 | 2208 | ||
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c new file mode 100644 index 0000000000..39135a3daa --- /dev/null +++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c | |||
@@ -0,0 +1,175 @@ | |||
1 | #include "ecore_evas_extn_engine.h" | ||
2 | |||
3 | struct _Extnbuf | ||
4 | { | ||
5 | const char *file, *lock; | ||
6 | void *addr; | ||
7 | int fd, lockfd; | ||
8 | int w, h, stride, size; | ||
9 | Eina_Bool have_lock : 1; | ||
10 | Eina_Bool am_owner : 1; | ||
11 | }; | ||
12 | |||
13 | // "owner" creates/frees the bufs, clients just open existing ones | ||
14 | Extnbuf * | ||
15 | _extnbuf_new(const char *base, int id, Eina_Bool sys, int num, | ||
16 | int w, int h, Eina_Bool owner) | ||
17 | { | ||
18 | Extnbuf *b; | ||
19 | char file[PATH_MAX]; | ||
20 | mode_t mode = S_IRUSR | S_IWUSR; | ||
21 | |||
22 | b = calloc(1, sizeof(Extnbuf)); | ||
23 | b->fd = -1; | ||
24 | b->lockfd = -1; | ||
25 | b->addr = MAP_FAILED; | ||
26 | b->w = w; | ||
27 | b->h = h; | ||
28 | b->stride = w * 4; | ||
29 | b->size = 4096 * (((b->stride * b->h) + (4096 - 1)) / 4096); | ||
30 | b->am_owner = owner; | ||
31 | |||
32 | snprintf(file, sizeof(file), "/%s-%i.%i", base, id, num); | ||
33 | b->file = eina_stringshare_add(file); | ||
34 | if (!b->file) goto err; | ||
35 | |||
36 | if (sys) mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; | ||
37 | |||
38 | if (b->am_owner) | ||
39 | { | ||
40 | const char *s; | ||
41 | |||
42 | s = getenv("XDG_RUNTIME_DIR"); | ||
43 | if (!s) s = getenv("TMPDIR"); | ||
44 | if (!s) s = "/tmp"; | ||
45 | snprintf(file, sizeof(file), "%s/ee-lock-XXXXXX", s); | ||
46 | b->lockfd = mkstemp(file); | ||
47 | if (b->lockfd < 0) goto err; | ||
48 | b->lock = eina_stringshare_add(file); | ||
49 | if (!b->lock) goto err; | ||
50 | b->fd = shm_open(b->file, O_RDWR | O_CREAT | O_EXCL, mode); | ||
51 | if (b->fd < 0) goto err; | ||
52 | if (ftruncate(b->fd, b->size) < 0) goto err; | ||
53 | } | ||
54 | else | ||
55 | { | ||
56 | b->fd = shm_open(b->file, O_RDWR, mode); | ||
57 | if (b->fd < 0) goto err; | ||
58 | } | ||
59 | b->addr = mmap(NULL, b->size, PROT_READ | PROT_WRITE, MAP_SHARED, | ||
60 | b->fd, 0); | ||
61 | if (b->addr == MAP_FAILED) goto err; | ||
62 | return b; | ||
63 | err: | ||
64 | _extnbuf_free(b); | ||
65 | return NULL; | ||
66 | } | ||
67 | |||
68 | void | ||
69 | _extnbuf_free(Extnbuf *b) | ||
70 | { | ||
71 | if (b->have_lock) _extnbuf_unlock(b); | ||
72 | |||
73 | if (b->am_owner) | ||
74 | { | ||
75 | if (b->file) shm_unlink(b->file); | ||
76 | if (b->lock) unlink(b->lock); | ||
77 | } | ||
78 | |||
79 | if (b->addr != MAP_FAILED) munmap(b->addr, b->size); | ||
80 | if (b->fd >= 0) close(b->fd); | ||
81 | if (b->lockfd >= 0) close(b->lockfd); | ||
82 | eina_stringshare_del(b->file); | ||
83 | eina_stringshare_del(b->lock); | ||
84 | b->file = NULL; | ||
85 | b->lock = NULL; | ||
86 | b->addr = MAP_FAILED; | ||
87 | b->fd = 1; | ||
88 | b->lockfd = 1; | ||
89 | b->am_owner = EINA_FALSE; | ||
90 | b->have_lock = EINA_FALSE; | ||
91 | b->w = 0; | ||
92 | b->h = 0; | ||
93 | b->stride = 0; | ||
94 | b->size = 0; | ||
95 | free(b); | ||
96 | } | ||
97 | |||
98 | // both ends can lock or unlock a buf | ||
99 | void * | ||
100 | _extnbuf_data_get(Extnbuf *b, int *w, int *h, int *stride) | ||
101 | { | ||
102 | if (w) *w = b->w; | ||
103 | if (h) *h = b->h; | ||
104 | if (stride) *stride = b->stride; | ||
105 | return b->addr; | ||
106 | } | ||
107 | |||
108 | void * | ||
109 | _extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride) | ||
110 | { | ||
111 | if (!b->have_lock) | ||
112 | { | ||
113 | if (b->lockfd >= 0) | ||
114 | { | ||
115 | if (lockf(b->lockfd, F_LOCK, 0) < 0) | ||
116 | { | ||
117 | ERR("lock take fail"); | ||
118 | return EINA_FALSE; | ||
119 | } | ||
120 | } | ||
121 | b->have_lock = EINA_TRUE; | ||
122 | } | ||
123 | return _extnbuf_data_get(b, w, h, stride); | ||
124 | } | ||
125 | |||
126 | void | ||
127 | _extnbuf_unlock(Extnbuf *b) | ||
128 | { | ||
129 | if (!b->have_lock) return; | ||
130 | if (b->lockfd >= 0) | ||
131 | { | ||
132 | if (lockf(b->lockfd, F_ULOCK, 0) < 0) | ||
133 | { | ||
134 | ERR("lock release fail"); | ||
135 | return; | ||
136 | } | ||
137 | } | ||
138 | b->have_lock = EINA_FALSE; | ||
139 | } | ||
140 | |||
141 | const char * | ||
142 | _extnbuf_lock_file_get(const Extnbuf *b) | ||
143 | { | ||
144 | return b->lock; | ||
145 | } | ||
146 | |||
147 | Eina_Bool | ||
148 | _extnbuf_lock_file_set(Extnbuf *b, const char *file) | ||
149 | { | ||
150 | if (b->am_owner) return EINA_FALSE; | ||
151 | if (b->lock) eina_stringshare_del(b->lock); | ||
152 | if (b->lockfd >= 0) close(b->lockfd); | ||
153 | if (!file) | ||
154 | { | ||
155 | b->lock = NULL; | ||
156 | b->lockfd = -1; | ||
157 | return EINA_TRUE; | ||
158 | } | ||
159 | b->lock = eina_stringshare_add(file); | ||
160 | if (!b->lock) goto err; | ||
161 | b->lockfd = open(b->lock, O_RDWR); | ||
162 | if (b->lockfd >= 0) return EINA_TRUE; | ||
163 | err: | ||
164 | if (b->lock) eina_stringshare_del(b->lock); | ||
165 | if (b->lockfd >= 0) close(b->lockfd); | ||
166 | b->lockfd = -1; | ||
167 | b->lock = NULL; | ||
168 | return EINA_FALSE; | ||
169 | } | ||
170 | |||
171 | Eina_Bool | ||
172 | _extnbuf_lock_get(const Extnbuf *b) | ||
173 | { | ||
174 | return b->have_lock; | ||
175 | } | ||
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h new file mode 100644 index 0000000000..511397dfdf --- /dev/null +++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h | |||
@@ -0,0 +1,220 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | #ifdef STDC_HEADERS | ||
5 | # include <stdlib.h> | ||
6 | # include <stddef.h> | ||
7 | #else | ||
8 | # ifdef HAVE_STDLIB_H | ||
9 | # include <stdlib.h> | ||
10 | # endif | ||
11 | #endif | ||
12 | #include <stdio.h> | ||
13 | #include <sys/types.h> | ||
14 | #include <unistd.h> | ||
15 | #include <math.h> | ||
16 | #include <time.h> | ||
17 | #ifdef HAVE_SYS_MMAN_H | ||
18 | # include <sys/mman.h> | ||
19 | #endif | ||
20 | #include <sys/stat.h> | ||
21 | #include <fcntl.h> | ||
22 | #include <string.h> | ||
23 | #include <sys/file.h> | ||
24 | #include <unistd.h> | ||
25 | #include <Evas.h> | ||
26 | #include <Evas_Engine_Buffer.h> | ||
27 | #include <Ecore.h> | ||
28 | #include <Ecore_Evas.h> | ||
29 | #include <Ecore_Input.h> | ||
30 | #include <Ecore_Ipc.h> | ||
31 | |||
32 | #include "ecore_private.h" // FIXME: Because of ECORE_MAGIC | ||
33 | #include "ecore_evas_private.h" | ||
34 | #include "ecore_evas_buffer.h" | ||
35 | #include "ecore_evas_extn.h" | ||
36 | |||
37 | typedef struct _Extnbuf Extnbuf; | ||
38 | |||
39 | Extnbuf *_extnbuf_new(const char *base, int id, Eina_Bool sys, int num, | ||
40 | int w, int h, Eina_Bool owner); | ||
41 | void _extnbuf_free(Extnbuf *b); | ||
42 | void *_extnbuf_data_get(Extnbuf *b, int *w, int *h, int *stride); | ||
43 | void *_extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride); | ||
44 | void _extnbuf_unlock(Extnbuf *b); | ||
45 | const char *_extnbuf_lock_file_get(const Extnbuf *b); | ||
46 | Eina_Bool _extnbuf_lock_file_set(Extnbuf *b, const char *file); | ||
47 | Eina_Bool _extnbuf_lock_get(const Extnbuf *b); | ||
48 | |||
49 | // procotol version - change this as needed | ||
50 | #define MAJOR 0x2011 | ||
51 | |||
52 | enum // opcodes | ||
53 | { | ||
54 | OP_RESIZE, | ||
55 | OP_SHOW, | ||
56 | OP_HIDE, | ||
57 | OP_FOCUS, | ||
58 | OP_UNFOCUS, | ||
59 | OP_UPDATE, | ||
60 | OP_UPDATE_DONE, | ||
61 | OP_SHM_REF0, | ||
62 | OP_SHM_REF1, | ||
63 | OP_SHM_REF2, | ||
64 | OP_PROFILE_CHANGE_REQUEST, | ||
65 | OP_PROFILE_CHANGE_DONE, | ||
66 | OP_EV_MOUSE_IN, | ||
67 | OP_EV_MOUSE_OUT, | ||
68 | OP_EV_MOUSE_UP, | ||
69 | OP_EV_MOUSE_DOWN, | ||
70 | OP_EV_MOUSE_MOVE, | ||
71 | OP_EV_MOUSE_WHEEL, | ||
72 | OP_EV_MULTI_UP, | ||
73 | OP_EV_MULTI_DOWN, | ||
74 | OP_EV_MULTI_MOVE, | ||
75 | OP_EV_KEY_UP, | ||
76 | OP_EV_KEY_DOWN, | ||
77 | OP_EV_HOLD, | ||
78 | OP_MSG_PARENT, | ||
79 | OP_MSG | ||
80 | }; | ||
81 | |||
82 | enum | ||
83 | { | ||
84 | MOD_SHIFT = (1 << 0), | ||
85 | MOD_CTRL = (1 << 1), | ||
86 | MOD_ALT = (1 << 2), | ||
87 | MOD_META = (1 << 3), | ||
88 | MOD_HYPER = (1 << 4), | ||
89 | MOD_SUPER = (1 << 5), | ||
90 | MOD_CAPS = (1 << 6), | ||
91 | MOD_NUM = (1 << 7), | ||
92 | MOD_SCROLL = (1 << 8), | ||
93 | }; | ||
94 | |||
95 | typedef struct _Ipc_Data_Resize Ipc_Data_Resize; | ||
96 | typedef struct _Ipc_Data_Update Ipc_Data_Update; | ||
97 | typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In; | ||
98 | typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out; | ||
99 | typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up; | ||
100 | typedef struct _Ipc_Data_Ev_Mouse_Down Ipc_Data_Ev_Mouse_Down; | ||
101 | typedef struct _Ipc_Data_Ev_Mouse_Move Ipc_Data_Ev_Mouse_Move; | ||
102 | typedef struct _Ipc_Data_Ev_Mouse_Wheel Ipc_Data_Ev_Mouse_Wheel; | ||
103 | typedef struct _Ipc_Data_Ev_Hold Ipc_Data_Ev_Hold; | ||
104 | typedef struct _Ipc_Data_Ev_Multi_Up Ipc_Data_Ev_Multi_Up; | ||
105 | typedef struct _Ipc_Data_Ev_Multi_Down Ipc_Data_Ev_Multi_Down; | ||
106 | typedef struct _Ipc_Data_Ev_Multi_Move Ipc_Data_Ev_Multi_Move; | ||
107 | typedef struct _Ipc_Data_Ev_Key_Up Ipc_Data_Ev_Key_Up; | ||
108 | typedef struct _Ipc_Data_Ev_Key_Down Ipc_Data_Ev_Key_Down; | ||
109 | |||
110 | struct _Ipc_Data_Resize | ||
111 | { | ||
112 | int w, h; | ||
113 | }; | ||
114 | |||
115 | struct _Ipc_Data_Update | ||
116 | { | ||
117 | int x, w, y, h; | ||
118 | }; | ||
119 | |||
120 | struct _Ipc_Data_Ev_Mouse_In | ||
121 | { | ||
122 | unsigned int timestamp; | ||
123 | int mask; | ||
124 | Evas_Event_Flags event_flags; | ||
125 | }; | ||
126 | |||
127 | struct _Ipc_Data_Ev_Mouse_Out | ||
128 | { | ||
129 | unsigned int timestamp; | ||
130 | int mask; | ||
131 | Evas_Event_Flags event_flags; | ||
132 | }; | ||
133 | |||
134 | struct _Ipc_Data_Ev_Mouse_Up | ||
135 | { | ||
136 | int b; | ||
137 | Evas_Button_Flags flags; | ||
138 | int mask; | ||
139 | unsigned int timestamp; | ||
140 | Evas_Event_Flags event_flags; | ||
141 | }; | ||
142 | |||
143 | struct _Ipc_Data_Ev_Mouse_Down | ||
144 | { | ||
145 | int b; | ||
146 | Evas_Button_Flags flags; | ||
147 | int mask; | ||
148 | unsigned int timestamp; | ||
149 | Evas_Event_Flags event_flags; | ||
150 | }; | ||
151 | |||
152 | struct _Ipc_Data_Ev_Mouse_Move | ||
153 | { | ||
154 | int x, y; | ||
155 | Evas_Button_Flags flags; | ||
156 | int mask; | ||
157 | unsigned int timestamp; | ||
158 | Evas_Event_Flags event_flags; | ||
159 | }; | ||
160 | |||
161 | struct _Ipc_Data_Ev_Mouse_Wheel | ||
162 | { | ||
163 | int direction, z; | ||
164 | Evas_Button_Flags flags; | ||
165 | int mask; | ||
166 | unsigned int timestamp; | ||
167 | Evas_Event_Flags event_flags; | ||
168 | }; | ||
169 | |||
170 | struct _Ipc_Data_Ev_Hold | ||
171 | { | ||
172 | int hold; | ||
173 | unsigned int timestamp; | ||
174 | Evas_Event_Flags event_flags; | ||
175 | }; | ||
176 | |||
177 | struct _Ipc_Data_Ev_Multi_Up | ||
178 | { | ||
179 | Evas_Button_Flags flags; | ||
180 | int d, x, y; | ||
181 | double rad, radx, rady, pres, ang, fx, fy; | ||
182 | int mask; | ||
183 | unsigned int timestamp; | ||
184 | Evas_Event_Flags event_flags; | ||
185 | }; | ||
186 | |||
187 | struct _Ipc_Data_Ev_Multi_Down | ||
188 | { | ||
189 | Evas_Button_Flags flags; | ||
190 | int d, x, y; | ||
191 | double rad, radx, rady, pres, ang, fx, fy; | ||
192 | int mask; | ||
193 | unsigned int timestamp; | ||
194 | Evas_Event_Flags event_flags; | ||
195 | }; | ||
196 | |||
197 | struct _Ipc_Data_Ev_Multi_Move | ||
198 | { | ||
199 | int d, x, y; | ||
200 | double rad, radx, rady, pres, ang, fx, fy; | ||
201 | int mask; | ||
202 | unsigned int timestamp; | ||
203 | Evas_Event_Flags event_flags; | ||
204 | }; | ||
205 | |||
206 | struct _Ipc_Data_Ev_Key_Up | ||
207 | { | ||
208 | const char *keyname, *key, *string, *compose; | ||
209 | int mask; | ||
210 | unsigned int timestamp; | ||
211 | Evas_Event_Flags event_flags; | ||
212 | }; | ||
213 | |||
214 | struct _Ipc_Data_Ev_Key_Down | ||
215 | { | ||
216 | const char *keyname, *key, *string, *compose; | ||
217 | int mask; | ||
218 | unsigned int timestamp; | ||
219 | Evas_Event_Flags event_flags; | ||
220 | }; | ||