summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/extn
diff options
context:
space:
mode:
authorwonguk.jeong <wonguk.jeong@samsung.com>2014-04-03 20:55:38 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-04-03 20:55:38 +0900
commit8208454781e556a0ea31fabacb2b9a02ed6aad2c (patch)
tree2dfa0c27d2d26ed8a62f75a0b69079b192f637d9 /src/modules/ecore_evas/engines/extn
parent662fbe5ede6e32199903f712ae198a2c5f76ce31 (diff)
ecore_evas_extn: give proper event data to callbacks
Summary: extn send ecore event when plug is connected/disconnect (ECORE_EVAS_EXTN_CLIENT_ADD/ECORE_EVAS_EXTN_CLIENT_ADD) By the way, the event data is currently "Ecore_Evas_Engine_Buffer_Data" which should be hidden Moreover, when I make multiple sockets, I need a event data to distinguish which socket is connected by client. Therefore, I recommend to use Ecore_Evas as event data. @fix Reviewers: raster, Hermet, woohyun, cedric, seoz Reviewed By: raster CC: seoz, cedric Differential Revision: https://phab.enlightenment.org/D690
Diffstat (limited to 'src/modules/ecore_evas/engines/extn')
-rw-r--r--src/modules/ecore_evas/engines/extn/ecore_evas_extn.c56
1 files changed, 28 insertions, 28 deletions
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 4b2aaeb0e1..97fcc217d1 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -71,7 +71,7 @@ _ecore_evas_extn_event(Ecore_Evas *ee, int event)
71 71
72 if (bdata->image) 72 if (bdata->image)
73 evas_object_ref(bdata->image); 73 evas_object_ref(bdata->image);
74 ecore_event_add(event, bdata->image, 74 ecore_event_add(event, ee,
75 _ecore_evas_extn_event_free, ee); 75 _ecore_evas_extn_event_free, ee);
76} 76}
77 77
@@ -81,7 +81,7 @@ _ecore_evas_extn_plug_render_pre(void *data, Evas *e EINA_UNUSED, void *event_in
81 Ecore_Evas *ee = data; 81 Ecore_Evas *ee = data;
82 Ecore_Evas_Engine_Buffer_Data *bdata; 82 Ecore_Evas_Engine_Buffer_Data *bdata;
83 Extn *extn; 83 Extn *extn;
84 84
85 if (!ee) return; 85 if (!ee) return;
86 bdata = ee->engine.data; 86 bdata = ee->engine.data;
87 if (!bdata) return; 87 if (!bdata) return;
@@ -96,7 +96,7 @@ _ecore_evas_extn_plug_render_post(void *data, Evas *e EINA_UNUSED, void *event_i
96 Ecore_Evas *ee = data; 96 Ecore_Evas *ee = data;
97 Ecore_Evas_Engine_Buffer_Data *bdata; 97 Ecore_Evas_Engine_Buffer_Data *bdata;
98 Extn *extn; 98 Extn *extn;
99 99
100 if (!ee) return; 100 if (!ee) return;
101 bdata = ee->engine.data; 101 bdata = ee->engine.data;
102 if (!bdata) return; 102 if (!bdata) return;
@@ -972,7 +972,7 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
972 { 972 {
973 Ipc_Data_Update *ipc; 973 Ipc_Data_Update *ipc;
974 int n = e->response; 974 int n = e->response;
975 975
976 EINA_LIST_FREE(extn->file.updates, ipc) 976 EINA_LIST_FREE(extn->file.updates, ipc)
977 { 977 {
978 if (bdata->image) 978 if (bdata->image)
@@ -988,7 +988,7 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
988 988
989 pn = extn->cur_b; 989 pn = extn->cur_b;
990 extn->cur_b = n; 990 extn->cur_b = n;
991 991
992 if (extn->b[pn].buf) _extnbuf_unlock(extn->b[pn].buf); 992 if (extn->b[pn].buf) _extnbuf_unlock(extn->b[pn].buf);
993 if (extn->b[pn].obuf) 993 if (extn->b[pn].obuf)
994 { 994 {
@@ -1024,7 +1024,7 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
1024 (((unsigned char *)e->data)[e->size - 1] == 0)) 1024 (((unsigned char *)e->data)[e->size - 1] == 0))
1025 { 1025 {
1026 int n = e->response; 1026 int n = e->response;
1027 1027
1028 if ((n >= 0) && (n < NBUF)) 1028 if ((n >= 0) && (n < NBUF))
1029 { 1029 {
1030 extn->b[n].id = e->ref; 1030 extn->b[n].id = e->ref;
@@ -1043,7 +1043,7 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
1043 (((unsigned char *)e->data)[e->size - 1] == 0)) 1043 (((unsigned char *)e->data)[e->size - 1] == 0))
1044 { 1044 {
1045 int n = e->response; 1045 int n = e->response;
1046 1046
1047 if ((n >= 0) && (n < NBUF)) 1047 if ((n >= 0) && (n < NBUF))
1048 { 1048 {
1049 extn->b[n].w = e->ref; 1049 extn->b[n].w = e->ref;
@@ -1137,7 +1137,7 @@ ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target)
1137 } 1137 }
1138 ee->engine.data = bdata; 1138 ee->engine.data = bdata;
1139 o = evas_object_image_filled_add(ee_target->evas); 1139 o = evas_object_image_filled_add(ee_target->evas);
1140 /* 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
1141 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);*/ 1141 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);*/
1142 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); 1142 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
1143 evas_object_image_alpha_set(o, 1); 1143 evas_object_image_alpha_set(o, 1);
@@ -1310,7 +1310,7 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
1310 if (extn) 1310 if (extn)
1311 { 1311 {
1312 int i, last_try = 0; 1312 int i, last_try = 0;
1313 1313
1314 for (i = 0; i < NBUF; i++) 1314 for (i = 0; i < NBUF; i++)
1315 { 1315 {
1316 if (extn->b[i].buf) _extnbuf_free(extn->b[i].buf); 1316 if (extn->b[i].buf) _extnbuf_free(extn->b[i].buf);
@@ -1335,9 +1335,9 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
1335 if (last_try > 1024) break; 1335 if (last_try > 1024) break;
1336 } 1336 }
1337 while (!extn->b[i].buf); 1337 while (!extn->b[i].buf);
1338 1338
1339 } 1339 }
1340 1340
1341 if (extn->b[extn->cur_b].buf) 1341 if (extn->b[extn->cur_b].buf)
1342 bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf, 1342 bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf,
1343 NULL, NULL, &stride); 1343 NULL, NULL, &stride);
@@ -1373,7 +1373,7 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
1373 for (i = 0; i < NBUF; i++) 1373 for (i = 0; i < NBUF; i++)
1374 { 1374 {
1375 const char *lock; 1375 const char *lock;
1376 1376
1377 ecore_ipc_client_send(client, MAJOR, OP_SHM_REF0, 1377 ecore_ipc_client_send(client, MAJOR, OP_SHM_REF0,
1378 extn->svc.num, extn->b[i].num, i, 1378 extn->svc.num, extn->b[i].num, i,
1379 extn->svc.name, 1379 extn->svc.name,
@@ -1430,7 +1430,7 @@ _ecore_evas_socket_switch(void *data, void *dest_buf EINA_UNUSED)
1430 Ecore_Evas *ee = data; 1430 Ecore_Evas *ee = data;
1431 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; 1431 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
1432 Extn *extn = bdata->data; 1432 Extn *extn = bdata->data;
1433 1433
1434 extn->cur_b++; 1434 extn->cur_b++;
1435 if (extn->cur_b >= NBUF) extn->cur_b = 0; 1435 if (extn->cur_b >= NBUF) extn->cur_b = 0;
1436 bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf, 1436 bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf,
@@ -1449,7 +1449,7 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
1449 Ecore_Ipc_Client *client; 1449 Ecore_Ipc_Client *client;
1450 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; 1450 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
1451 int cur_b; 1451 int cur_b;
1452 1452
1453 extn = bdata->data; 1453 extn = bdata->data;
1454 if (!extn) return rend; 1454 if (!extn) return rend;
1455 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) 1455 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
@@ -1473,8 +1473,8 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
1473 EINA_LIST_FOREACH(updates, l, r) 1473 EINA_LIST_FOREACH(updates, l, r)
1474 { 1474 {
1475 Ipc_Data_Update ipc; 1475 Ipc_Data_Update ipc;
1476 1476
1477 1477
1478 ipc.x = r->x; 1478 ipc.x = r->x;
1479 ipc.y = r->y; 1479 ipc.y = r->y;
1480 ipc.w = r->w; 1480 ipc.w = r->w;
@@ -1486,7 +1486,7 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
1486 evas_render_updates_free(updates); 1486 evas_render_updates_free(updates);
1487 _ecore_evas_idle_timeout_update(ee); 1487 _ecore_evas_idle_timeout_update(ee);
1488 EINA_LIST_FOREACH(extn->ipc.clients, ll, client) 1488 EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
1489 ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 1489 ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0,
1490 cur_b, NULL, 0); 1490 cur_b, NULL, 0);
1491 if (extn->profile.done) 1491 if (extn->profile.done)
1492 { 1492 {
@@ -1516,13 +1516,13 @@ _ipc_client_add(void *data, int type EINA_UNUSED, void *event)
1516 if (!extn) return ECORE_CALLBACK_PASS_ON; 1516 if (!extn) return ECORE_CALLBACK_PASS_ON;
1517 1517
1518 extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client); 1518 extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client);
1519 1519
1520 for (i = 0; i < NBUF; i++) 1520 for (i = 0; i < NBUF; i++)
1521 { 1521 {
1522 const char *lock; 1522 const char *lock;
1523 Ipc_Data_Resize ipc; 1523 Ipc_Data_Resize ipc;
1524 Ipc_Data_Update ipc2; 1524 Ipc_Data_Update ipc2;
1525 1525
1526 ecore_ipc_client_send(e->client, MAJOR, OP_SHM_REF0, 1526 ecore_ipc_client_send(e->client, MAJOR, OP_SHM_REF0,
1527 extn->svc.num, extn->b[i].num, i, 1527 extn->svc.num, extn->b[i].num, i,
1528 extn->svc.name, 1528 extn->svc.name,
@@ -1540,7 +1540,7 @@ _ipc_client_add(void *data, int type EINA_UNUSED, void *event)
1540 ipc2.x = 0; ipc2.y = 0; ipc2.w = ee->w; ipc2.h = ee->h; 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, 1541 ecore_ipc_client_send(e->client, MAJOR, OP_UPDATE, 0, 0, 0, &ipc2,
1542 sizeof(ipc2)); 1542 sizeof(ipc2));
1543 ecore_ipc_client_send(e->client, MAJOR, OP_UPDATE_DONE, 0, 0, 1543 ecore_ipc_client_send(e->client, MAJOR, OP_UPDATE_DONE, 0, 0,
1544 extn->cur_b, NULL, 0); 1544 extn->cur_b, NULL, 0);
1545 } 1545 }
1546 _ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_ADD); 1546 _ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_ADD);
@@ -1807,10 +1807,10 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void *event)
1807 { 1807 {
1808 _ecore_evas_window_profile_free(ee); 1808 _ecore_evas_window_profile_free(ee);
1809 ee->prop.profile.name = (char *)eina_stringshare_add(e->data); 1809 ee->prop.profile.name = (char *)eina_stringshare_add(e->data);
1810 1810
1811 if (ee->func.fn_state_change) 1811 if (ee->func.fn_state_change)
1812 ee->func.fn_state_change(ee); 1812 ee->func.fn_state_change(ee);
1813 1813
1814 extn->profile.done = EINA_TRUE; 1814 extn->profile.done = EINA_TRUE;
1815 } 1815 }
1816 break; 1816 break;
@@ -1861,11 +1861,11 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
1861 EINA_LIST_FOREACH(extn->ipc.clients, l, client) 1861 EINA_LIST_FOREACH(extn->ipc.clients, l, client)
1862 { 1862 {
1863 int i; 1863 int i;
1864 1864
1865 for (i = 0; i < NBUF; i++) 1865 for (i = 0; i < NBUF; i++)
1866 { 1866 {
1867 const char *lock; 1867 const char *lock;
1868 1868
1869 ecore_ipc_client_send(client, MAJOR, OP_SHM_REF0, 1869 ecore_ipc_client_send(client, MAJOR, OP_SHM_REF0,
1870 extn->svc.num, extn->b[i].num, i, 1870 extn->svc.num, extn->b[i].num, i,
1871 extn->svc.name, 1871 extn->svc.name,
@@ -1995,7 +1995,7 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
1995 NULL, 1995 NULL,
1996 NULL, 1996 NULL,
1997 NULL, 1997 NULL,
1998 1998
1999 _ecore_evas_extn_socket_render, // render 1999 _ecore_evas_extn_socket_render, // render
2000 NULL, // screen_geometry_get 2000 NULL, // screen_geometry_get
2001 NULL, // screen_dpi_get 2001 NULL, // screen_dpi_get
@@ -2149,9 +2149,9 @@ _ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum,
2149 if (last_try > 1024) break; 2149 if (last_try > 1024) break;
2150 } 2150 }
2151 while (!extn->b[i].buf); 2151 while (!extn->b[i].buf);
2152 2152
2153 } 2153 }
2154 2154
2155 if (extn->b[extn->cur_b].buf) 2155 if (extn->b[extn->cur_b].buf)
2156 bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf, 2156 bdata->pixels = _extnbuf_data_get(extn->b[extn->cur_b].buf,
2157 NULL, NULL, NULL); 2157 NULL, NULL, NULL);
@@ -2162,7 +2162,7 @@ _ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum,
2162 ecore_ipc_shutdown(); 2162 ecore_ipc_shutdown();
2163 return EINA_FALSE; 2163 return EINA_FALSE;
2164 } 2164 }
2165 2165
2166 if (extn->svc.sys) ipctype = ECORE_IPC_LOCAL_SYSTEM; 2166 if (extn->svc.sys) ipctype = ECORE_IPC_LOCAL_SYSTEM;
2167 extn->ipc.server = ecore_ipc_server_add(ipctype, 2167 extn->ipc.server = ecore_ipc_server_add(ipctype,
2168 (char *)extn->svc.name, 2168 (char *)extn->svc.name,