These functions allow 1 process to create a "socket" was pluged into which another process can create a "plug" remotely to plug into. More...
Functions | |
EAPI Ecore_Evas * | ecore_evas_extn_socket_new (int w, int h) |
Create a new Ecore_Evas canvas for the new external ecore evas socket. More... | |
EAPI Eina_Bool | ecore_evas_extn_socket_listen (Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys) |
Create a socket to provide the service for external ecore evas socket. More... | |
EAPI void | ecore_evas_extn_plug_object_data_lock (Evas_Object *obj) |
Lock the pixel data so the socket cannot change it. More... | |
EAPI void | ecore_evas_extn_plug_object_data_unlock (Evas_Object *obj) |
Unlock the pixel data so the socket can change it again. More... | |
EAPI Evas_Object * | ecore_evas_extn_plug_new (Ecore_Evas *ee_target) |
Create a new external ecore evas plug. More... | |
EAPI Eina_Bool | ecore_evas_extn_plug_connect (Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys) |
Connect an external ecore evas plug to service provided by external ecore evas socket. More... | |
EAPI void | ecore_evas_pointer_xy_get (const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y) |
Retrieve the coordinates of the mouse pointer. More... | |
EAPI Eina_Bool | ecore_evas_pointer_warp (const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y) |
Retrieve the coordinates of the mouse pointer. More... | |
EAPI void * | ecore_evas_pixmap_visual_get (const Ecore_Evas *ee) |
Retrieve the Visual used for pixmap creation. More... | |
EAPI unsigned long | ecore_evas_pixmap_colormap_get (const Ecore_Evas *ee) |
Retrieve the Colormap used for pixmap creation. More... | |
EAPI int | ecore_evas_pixmap_depth_get (const Ecore_Evas *ee) |
Retrieve the depth used for pixmap creation. More... | |
Variables | |
EAPI int | ECORE_EVAS_EXTN_CLIENT_ADD |
this event is received when a plug has connected to an extn socket More... | |
EAPI int | ECORE_EVAS_EXTN_CLIENT_DEL |
this event is received when a plug has disconnected from an extn socket More... | |
These functions allow 1 process to create a "socket" was pluged into which another process can create a "plug" remotely to plug into.
Socket can provides content for several plugs. This is best for small sized objects (about the size range of a small icon up to a few large icons). Sine the plug is actually an image object, you can fetch the pixel data
EAPI Ecore_Evas* ecore_evas_extn_socket_new | ( | int | w, |
int | h | ||
) |
Create a new Ecore_Evas canvas for the new external ecore evas socket.
w | The width of the canvas, in pixels |
h | The height of the canvas, in pixels |
Ecore_Evas
instance or NULL
, on failureThis creates a new extn_socket canvas wrapper, with image data array bound to the ARGB format, 8 bits per pixel.
If creation is successful, an Ecore_Evas handle is returned or NULL
if creation fails. Also focus, show, hide etc. callbacks will also be called if the plug object is shown, or already visible on connect, or if it is hidden later, focused or unfocused.
This function has to be flowed by ecore_evas_extn_socket_listen(), for starting ecore ipc service.
or
When a client(plug) connects, you will get the ECORE_EVAS_EXTN_CLIENT_ADD event in the ecore event queue, with event_info being the image object pointer passed as a void pointer. When a client disconnects you will get the ECORE_EVAS_EXTN_CLIENT_DEL event.
You can set up event handles for these events as follows:
Note that events come in later after the event happened. You may want to be careful as data structures you had associated with the image object may have been freed after deleting, but the object may still be around awating cleanup and thus still be valid.You can change the size with something like:
EAPI Eina_Bool ecore_evas_extn_socket_listen | ( | Ecore_Evas * | ee, |
const char * | svcname, | ||
int | svcnum, | ||
Eina_Bool | svcsys | ||
) |
Create a socket to provide the service for external ecore evas socket.
ee | The Ecore_Evas. |
svcname | The name of the service to be advertised. ensure that it is unique (when combined with svcnum ) otherwise creation may fail. |
svcnum | A number (any value, 0 being the common default) to differentiate multiple instances of services with the same name. |
svcsys | A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user ide that created the service. |
EINA_TRUE
if creation is successful, EINA_FALSE
if it does not.This creates socket specified by svcname
, svcnum
and svcsys
. If creation is successful, EINA_TRUE
is returned or EINA_FALSE
if creation fails.
EAPI void ecore_evas_extn_plug_object_data_lock | ( | Evas_Object * | obj | ) |
Lock the pixel data so the socket cannot change it.
obj | The image object returned by ecore_evas_extn_plug_new() to lock |
You may need to get the image pixel data with evas_object_image_data_get() from the image object, but need to ensure that it does not change while you are using the data. This function lets you set an advisory lock on the image data so the external plug process will not render to it or alter it.
You should only hold the lock for just as long as you need to read out the image data or otherwise deal with it, and then unlock it with ecore_evas_extn_plug_object_data_unlock(). Keeping a lock over more than 1 iteration of the main ecore loop will be problematic, so avoid it. Also forgetting to unlock may cause the socket process to freeze and thus create odd behavior.
References ecore_evas_object_ecore_evas_get().
EAPI void ecore_evas_extn_plug_object_data_unlock | ( | Evas_Object * | obj | ) |
Unlock the pixel data so the socket can change it again.
obj | The image object returned by ecore_evas_extn_plug_new() to unlock |
This unlocks after an advisor lock has been taken by ecore_evas_extn_plug_object_data_lock().
References ecore_evas_object_ecore_evas_get().
EAPI Evas_Object* ecore_evas_extn_plug_new | ( | Ecore_Evas * | ee_target | ) |
Create a new external ecore evas plug.
ee_target | The Ecore_Evas containing the canvas in which the new image object will live. |
This creates an image object that will contain the output of another processes socket canvas when it connects. All input will be sent back to this process as well, effectively swallowing or placing the socket process in the canvas of the plug process in place of the image object. The image object by default is created to be filled (equivalent of evas_object_image_filled_add() on creation) so image content will scale to fill the image unless otherwise reconfigured. The Ecore_Evas size of the plug is the master size and determines size in pixels of the plug canvas. You can change the size with something like:
EAPI Eina_Bool ecore_evas_extn_plug_connect | ( | Evas_Object * | obj, |
const char * | svcname, | ||
int | svcnum, | ||
Eina_Bool | svcsys | ||
) |
Connect an external ecore evas plug to service provided by external ecore evas socket.
obj | The Ecore_Evas containing the canvas in which the new image object will live. |
svcname | The service name to connect to set up by the socket. |
svcnum | The service number to connect to (set up by socket). |
svcsys | Boolean to set if the service is a system one or not (set up by socket). |
EINA_TRUE
if creation is successful, EINA_FALSE
if it does not.References ecore_evas_object_ecore_evas_get().
EAPI void ecore_evas_pointer_xy_get | ( | const Ecore_Evas * | ee, |
Evas_Coord * | x, | ||
Evas_Coord * | y | ||
) |
Retrieve the coordinates of the mouse pointer.
ee | The Ecore_Evas containing the pointer |
x | Pointer to integer to store horizontal coordinate. May be NULL . |
y | Pointer to integer to store vertical coordinate. May be NULL . |
References EAPI.
Retrieve the coordinates of the mouse pointer.
ee | The Ecore_Evas containing the pointer |
x | The horizontal coordinate to move the pointer to |
y | The vertical coordinate to move the pointer to |
EINA_TRUE
on success, EINA_FALSE on failure.References EAPI, and EINA_FALSE.
EAPI void* ecore_evas_pixmap_visual_get | ( | const Ecore_Evas * | ee | ) |
Retrieve the Visual used for pixmap creation.
ee | The Ecore_Evas containing the pixmap |
ecore_evas_software_x11_pixmap_new
or ecore_evas_gl_x11_pixmap_new
EAPI unsigned long ecore_evas_pixmap_colormap_get | ( | const Ecore_Evas * | ee | ) |
Retrieve the Colormap used for pixmap creation.
ee | The Ecore_Evas containing the pixmap |
ecore_evas_software_x11_pixmap_new
or ecore_evas_gl_x11_pixmap_new
EAPI int ecore_evas_pixmap_depth_get | ( | const Ecore_Evas * | ee | ) |
Retrieve the depth used for pixmap creation.
ee | The Ecore_Evas containing the pixmap |
ecore_evas_software_x11_pixmap_new
or ecore_evas_gl_x11_pixmap_new
EAPI int ECORE_EVAS_EXTN_CLIENT_ADD |
this event is received when a plug has connected to an extn socket
EAPI int ECORE_EVAS_EXTN_CLIENT_DEL |
this event is received when a plug has disconnected from an extn socket