forked from enlightenment/efl
Ecore Evas VNC: Add support for ecore_evas_pointer_device_xy_get().
This commit adds the support to fetch the mouse position of a VNC client.
This commit is contained in:
parent
133b4fa65b
commit
2e527851cf
|
@ -2393,7 +2393,19 @@ ecore_evas_pointer_device_xy_get(const Ecore_Evas *ee,
|
||||||
if (x) *x = 0;
|
if (x) *x = 0;
|
||||||
if (y) *y = 0;
|
if (y) *y = 0;
|
||||||
ECORE_EVAS_CHECK(ee);
|
ECORE_EVAS_CHECK(ee);
|
||||||
if (ee->engine.func->fn_pointer_device_xy_get)
|
if (ee->vnc_server)
|
||||||
|
{
|
||||||
|
Eina_Module *mod;
|
||||||
|
void (*pointer_xy_get)(const void *, const Efl_Input_Device *, Evas_Coord *, Evas_Coord *y);
|
||||||
|
|
||||||
|
mod = _ecore_evas_vnc_server_module_load();
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(mod);
|
||||||
|
|
||||||
|
pointer_xy_get = eina_module_symbol_get(mod, "ecore_evas_vnc_server_pointer_xy_get");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(pointer_xy_get);
|
||||||
|
pointer_xy_get(ee->vnc_server, pointer, x, y);
|
||||||
|
}
|
||||||
|
else if (ee->engine.func->fn_pointer_device_xy_get)
|
||||||
ee->engine.func->fn_pointer_device_xy_get(ee, pointer, x, y);
|
ee->engine.func->fn_pointer_device_xy_get(ee, pointer, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -893,5 +893,38 @@ ecore_evas_vnc_server_del(Ecore_Evas_Vnc_Server *server)
|
||||||
free(server);
|
free(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_vnc_server_pointer_xy_get(const Ecore_Evas_Vnc_Server *server,
|
||||||
|
const Evas_Device *pointer,
|
||||||
|
Evas_Coord *x, Evas_Coord *y)
|
||||||
|
{
|
||||||
|
Evas_Coord sx, sy;
|
||||||
|
rfbClientIteratorPtr itr;
|
||||||
|
rfbClientRec *client;
|
||||||
|
Ecore_Evas_Vnc_Server_Client_Data *cdata;
|
||||||
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(server);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(pointer);
|
||||||
|
|
||||||
|
sx = sy = 0;
|
||||||
|
itr = rfbGetClientIterator(server->vnc_screen);
|
||||||
|
|
||||||
|
while ((client = rfbClientIteratorNext(itr)))
|
||||||
|
{
|
||||||
|
cdata = client->clientData;
|
||||||
|
|
||||||
|
if (cdata->mouse == pointer)
|
||||||
|
{
|
||||||
|
sx = client->lastPtrX;
|
||||||
|
sy = client->lastPtrY;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rfbReleaseClientIterator(itr);
|
||||||
|
if (x) *x = sx;
|
||||||
|
if (y) *y = sy;
|
||||||
|
}
|
||||||
|
|
||||||
EINA_MODULE_INIT(_ecore_evas_vnc_server_init);
|
EINA_MODULE_INIT(_ecore_evas_vnc_server_init);
|
||||||
EINA_MODULE_SHUTDOWN(_ecore_evas_vnc_server_shutdown);
|
EINA_MODULE_SHUTDOWN(_ecore_evas_vnc_server_shutdown);
|
||||||
|
|
Loading…
Reference in New Issue