Plug
This feature is supported in wearable applications only.
The plug component shows an Evas_Object created by an other process. It can be used anywhere the same way as any other elementary UI component.
Figure: Plug hierarchy
Adding a Plug Component
The following example shows how to create a plug.
Evas_Object *plug, *parent; plug = elm_plug_add(parent);
Using the Plug
The socket image provides the service where to connect the plug object with the elm_plug_connect() function. In this process, use the service name and number set by the socket you want to connect to.
As an example, connect to a service named plug_test on the number 0.
elm_plug_connect(plug, "plug_test", 0, EINA_FALSE);
The Evas_Object corresponding to the distant image is retrieved with the elm_plug_image_object_get() function.
Evas_Object *plug_img = elm_plug_image_object_get(plug);
Note |
---|
The socket to connect to must be started with the elm_win_socket_listen() function in the other process on the remote window object (it is called remote_win here). |
// Create a remote window in the other process Elm_Win *remote_win = elm_win_add(NULL, "Window Socket", ELM_WIN_SOCKET_IMAGE); // Create a socket named "plug_test" and listen to it elm_win_socket_listen(remote_win, "plug_test", 0, EINA_FALSE);