aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h')
-rw-r--r--libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h263
1 files changed, 242 insertions, 21 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h b/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h
index 256e57c..8d9abc4 100644
--- a/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h
+++ b/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h
@@ -81,6 +81,8 @@ extern "C" {
81#define HAVE_ECORE_EVAS_WINCE 1 81#define HAVE_ECORE_EVAS_WINCE 1
82#define HAVE_ECORE_EVAS_EWS 1 82#define HAVE_ECORE_EVAS_EWS 1
83#define HAVE_ECORE_EVAS_PSL1GHT 1 83#define HAVE_ECORE_EVAS_PSL1GHT 1
84#define HAVE_ECORE_EVAS_WAYLAND_SHM 1
85#define HAVE_ECORE_EVAS_WAYLAND_EGL 1
84 86
85typedef enum _Ecore_Evas_Engine_Type 87typedef enum _Ecore_Evas_Engine_Type
86{ 88{
@@ -104,7 +106,9 @@ typedef enum _Ecore_Evas_Engine_Type
104 ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE, 106 ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
105 ECORE_EVAS_ENGINE_OPENGL_SDL, 107 ECORE_EVAS_ENGINE_OPENGL_SDL,
106 ECORE_EVAS_ENGINE_EWS, 108 ECORE_EVAS_ENGINE_EWS,
107 ECORE_EVAS_ENGINE_PSL1GHT 109 ECORE_EVAS_ENGINE_PSL1GHT,
110 ECORE_EVAS_ENGINE_WAYLAND_SHM,
111 ECORE_EVAS_ENGINE_WAYLAND_EGL
108} Ecore_Evas_Engine_Type; 112} Ecore_Evas_Engine_Type;
109 113
110typedef enum _Ecore_Evas_Avoid_Damage_Type 114typedef enum _Ecore_Evas_Avoid_Damage_Type
@@ -689,6 +693,11 @@ EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int
689EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h); 693EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
690EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee); 694EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
691 695
696EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame);
697EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame);
698EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
699EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
700
692/** 701/**
693 * @brief Create a new @c Ecore_Evas canvas bound to the Evas 702 * @brief Create a new @c Ecore_Evas canvas bound to the Evas
694 * @b buffer engine 703 * @b buffer engine
@@ -818,7 +827,7 @@ EAPI void ecore_evas_ews_delete_request(Ecore_Evas *ee);
818 827
819/** 828/**
820 * @brief Create an Evas image object with image data <b>bound to an 829 * @brief Create an Evas image object with image data <b>bound to an
821 * own, internal @c Ecore_Evas canvas wrapper<b> 830 * own, internal @c Ecore_Evas canvas wrapper</b>
822 * 831 *
823 * @param ee_target @c Ecore_Evas to have the canvas receiving the new 832 * @param ee_target @c Ecore_Evas to have the canvas receiving the new
824 * image object 833 * image object
@@ -1320,7 +1329,7 @@ EAPI void ecore_evas_size_base_get(const Ecore_Evas *ee, int *w, int *h);
1320 * @param h The step height 1329 * @param h The step height
1321 * 1330 *
1322 * This function sets the size steps of @p ee to be @p w x @p h. This 1331 * This function sets the size steps of @p ee to be @p w x @p h. This
1323 * limits the size of this @cEcore_Evas window to be @b always an 1332 * limits the size of this @c Ecore_Evas window to be @b always an
1324 * integer multiple of the step size, for each axis. 1333 * integer multiple of the step size, for each axis.
1325 */ 1334 */
1326EAPI void ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h); 1335EAPI void ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h);
@@ -1450,6 +1459,9 @@ EAPI Eina_Bool ecore_evas_comp_sync_get(const Ecore_Evas *ee);
1450 */ 1459 */
1451EAPI void ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h); 1460EAPI void ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
1452 1461
1462EAPI void ecore_evas_draw_frame_set(Ecore_Evas *ee, Eina_Bool draw_frame);
1463EAPI Eina_Bool ecore_evas_draw_frame_get(const Ecore_Evas *ee);
1464
1453/** 1465/**
1454 * @brief Associate the given object to this ecore evas. 1466 * @brief Associate the given object to this ecore evas.
1455 * 1467 *
@@ -1625,29 +1637,238 @@ EAPI void ecore_evas_ews_manager_set(const void *manager);
1625 */ 1637 */
1626EAPI const void *ecore_evas_ews_manager_get(void); 1638EAPI const void *ecore_evas_ews_manager_get(void);
1627 1639
1628EAPI extern int ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE; /**< manager was changed */ 1640EAPI extern int ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE; /**< manager was changed @since 1.1 */
1629EAPI extern int ECORE_EVAS_EWS_EVENT_ADD; /**< window was created */ 1641EAPI extern int ECORE_EVAS_EWS_EVENT_ADD; /**< window was created @since 1.1 */
1630EAPI extern int ECORE_EVAS_EWS_EVENT_DEL; /**< window was deleted, pointer is already invalid but may be used as reference for further cleanup work. */ 1642EAPI extern int ECORE_EVAS_EWS_EVENT_DEL; /**< window was deleted, pointer is already invalid but may be used as reference for further cleanup work. @since 1.1 */
1631EAPI extern int ECORE_EVAS_EWS_EVENT_RESIZE; /**< window was resized */ 1643EAPI extern int ECORE_EVAS_EWS_EVENT_RESIZE; /**< window was resized @since 1.1 */
1632EAPI extern int ECORE_EVAS_EWS_EVENT_MOVE; /**< window was moved */ 1644EAPI extern int ECORE_EVAS_EWS_EVENT_MOVE; /**< window was moved @since 1.1 */
1633EAPI extern int ECORE_EVAS_EWS_EVENT_SHOW; /**< window become visible */ 1645EAPI extern int ECORE_EVAS_EWS_EVENT_SHOW; /**< window become visible @since 1.1 */
1634EAPI extern int ECORE_EVAS_EWS_EVENT_HIDE; /**< window become hidden */ 1646EAPI extern int ECORE_EVAS_EWS_EVENT_HIDE; /**< window become hidden @since 1.1 */
1635EAPI extern int ECORE_EVAS_EWS_EVENT_FOCUS; /**< window was focused */ 1647EAPI extern int ECORE_EVAS_EWS_EVENT_FOCUS; /**< window was focused @since 1.1 */
1636EAPI extern int ECORE_EVAS_EWS_EVENT_UNFOCUS; /**< window lost focus */ 1648EAPI extern int ECORE_EVAS_EWS_EVENT_UNFOCUS; /**< window lost focus @since 1.1 */
1637EAPI extern int ECORE_EVAS_EWS_EVENT_RAISE; /**< window was raised */ 1649EAPI extern int ECORE_EVAS_EWS_EVENT_RAISE; /**< window was raised @since 1.1 */
1638EAPI extern int ECORE_EVAS_EWS_EVENT_LOWER; /**< window was lowered */ 1650EAPI extern int ECORE_EVAS_EWS_EVENT_LOWER; /**< window was lowered @since 1.1 */
1639EAPI extern int ECORE_EVAS_EWS_EVENT_ACTIVATE; /**< window was activated */ 1651EAPI extern int ECORE_EVAS_EWS_EVENT_ACTIVATE; /**< window was activated @since 1.1 */
1640 1652
1641EAPI extern int ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE; /**< window minimized/iconified changed */ 1653EAPI extern int ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE; /**< window minimized/iconified changed @since 1.1 */
1642EAPI extern int ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE; /**< window maximized changed */ 1654EAPI extern int ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE; /**< window maximized changed @since 1.1 */
1643EAPI extern int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE; /**< window layer changed */ 1655EAPI extern int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE; /**< window layer changed @since 1.1 */
1644EAPI extern int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE; /**< window fullscreen changed */ 1656EAPI extern int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE; /**< window fullscreen changed @since 1.1 */
1645EAPI extern int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE; /**< some other window property changed (title, name, class, alpha, transparent, shaped...) */ 1657EAPI extern int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE; /**< some other window property changed (title, name, class, alpha, transparent, shaped...) @since 1.1 */
1646 1658
1647/** 1659/**
1648 * @} 1660 * @}
1649 */ 1661 */
1650 1662
1663/**
1664 * @defgroup Ecore_Evas_Extn External plug/socket infrastructure to remote canvases
1665 *
1666 * These functions allow 1 process to create a "socket" was pluged into which another
1667 * process can create a "plug" remotely to plug into.
1668 * Socket can provides content for several plugs.
1669 * This is best for small sized objects (about the size range
1670 * of a small icon up to a few large icons). Sine the plug is actually an
1671 * image object, you can fetch the pixel data
1672 *
1673 * @since 1.2
1674 * @{
1675 */
1676
1677EAPI extern int ECORE_EVAS_EXTN_CLIENT_ADD; /**< this event is received when a plug has connected to an extn socket @since 1.2 */
1678EAPI extern int ECORE_EVAS_EXTN_CLIENT_DEL; /**< this event is received when a plug has disconnected from an extn socket @since 1.2 */
1679
1680/**
1681 * @brief Create a new Ecore_Evas canvas for the new external ecore evas socket
1682 *
1683 * @param w The width of the canvas, in pixels
1684 * @param h The height of the canvas, in pixels
1685 * @return A new @c Ecore_Evas instance or @c NULL, on failure
1686 *
1687 * This creates a new extn_socket canvas wrapper, with image data array
1688 * @b bound to the ARGB format, 8 bits per pixel.
1689 *
1690 * If creation is successful, an Ecore_Evas handle is returned or NULL if creation
1691 * fails. Also focus, show, hide etc. callbacks
1692 * will also be called if the plug object is shown, or already visible on
1693 * connect, or if it is hidden later, focused or unfocused.
1694 *
1695 * This function has to be flowed by ecore_evas_extn_socket_listen(),
1696 * for starting ecore ipc service.
1697 *
1698 * @code
1699 * Eina_Bool res = EINA_FALSE;
1700 * Ecore_Evas *ee = ecore_evas_extn_socket_new(1, 1);
1701 *
1702 * res = ecore_evas_extn_socket_listen("svcname", 1, EINA_FALSE);
1703 * if (!res) return;
1704 * ecore_evas_resize(ee, 240, 400);
1705 * @endcode
1706 *
1707 * or
1708 *
1709 * @code
1710 * Eina_Bool res = EINA_FALSE;
1711 * Ecore_Evas *ee = ecore_evas_extn_socket_new(240, 400);
1712 *
1713 * res = ecore_evas_extn_socket_listen("svcname", 1, EINA_FALSE);
1714 * if (!res) return;
1715 * @endcode
1716 *
1717 * When a client(plug) connects, you will get the ECORE_EVAS_EXTN_CLIENT_ADD event
1718 * in the ecore event queue, with event_info being the image object pointer
1719 * passed as a void pointer. When a client disconnects you will get the
1720 * ECORE_EVAS_EXTN_CLIENT_DEL event.
1721 *
1722 * You can set up event handles for these events as follows:
1723 *
1724 * @code
1725 * static void client_add_cb(void *data, int event, void *event_info)
1726 * {
1727 * Evas_Object *obj = event_info;
1728 * printf("client added to image object %p\n", obj);
1729 * evas_object_show(obj);
1730 * }
1731 *
1732 * static void client_del_cb(void *data, int event, void *event_info)
1733 * {
1734 * Evas_Object *obj = event_info;
1735 * printf("client deleted from image object %p\n", obj);
1736 * evas_object_hide(obj);
1737 * }
1738 *
1739 * void setup(void)
1740 * {
1741 * ecore_event_handler_add(ECORE_EVAS_EXTN_CLIENT_ADD,
1742 * client_add_cb, NULL);
1743 * ecore_event_handler_add(ECORE_EVAS_EXTN_CLIENT_DEL,
1744 * client_del_cb, NULL);
1745 * }
1746 * @endcode
1747 *
1748 * Note that events come in later after the event happened. You may want to be
1749 * careful as data structures you had associated with the image object
1750 * may have been freed after deleting, but the object may still be around
1751 * awating cleanup and thus still be valid.You can change the size with something like:
1752 *
1753 * @see ecore_evas_extn_socket_listen()
1754 * @see ecore_evas_extn_plug_new()
1755 * @see ecore_evas_extn_plug_object_data_lock()
1756 * @see ecore_evas_extn_plug_object_data_unlock()
1757 *
1758 * @since 1.2
1759 */
1760EAPI Ecore_Evas *ecore_evas_extn_socket_new(int w, int h);
1761
1762/**
1763 * @brief Create a socket to provide the service for external ecore evas socket.
1764 *
1765 * @param svcname The name of the service to be advertised. ensure that it is unique (when combined with @p svcnum) otherwise creation may fail.
1766 * @param svcnum A number (any value, 0 beig the common default) to differentiate multiple instances of services with the same name.
1767 * @param 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.
1768 * @return EINA_TRUE if creation is successful, EINA_FALSE if it does not.
1769 *
1770 * This creates socket specified by @p svcname, @p svcnum and @p svcsys. If creation
1771 * is successful, EINA_TRUE is returned or EINA_FALSE if creation
1772 * fails.
1773 *
1774 * @see ecore_evas_extn_socket_new()
1775 * @see ecore_evas_extn_plug_new()
1776 * @see ecore_evas_extn_plug_object_data_lock()
1777 * @see ecore_evas_extn_plug_object_data_unlock()
1778 *
1779 * @since 1.2
1780 */
1781EAPI Eina_Bool ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys);
1782
1783/**
1784 * @brief Lock the pixel data so the socket cannot change it
1785 *
1786 * @param obj The image object returned by ecore_evas_extn_plug_new() to lock
1787 *
1788 * You may need to get the image pixel data with evas_object_image_data_get()
1789 * from the image object, but need to ensure that it does not change while
1790 * you are using the data. This function lets you set an advisory lock on the
1791 * image data so the external plug process will not render to it or alter it.
1792 *
1793 * You should only hold the lock for just as long as you need to read out the
1794 * image data or otherwise deal with it, and then unlokc it with
1795 * ecore_evas_extn_plug_object_data_unlock(). Keeping a lock over more than
1796 * 1 iteration of the main ecore loop will be problematic, so avoid it. Also
1797 * forgetting to unlock may cause the socket process to freeze and thus create
1798 * odd behavior.
1799 *
1800 * @see ecore_evas_extn_plug_new()
1801 * @see ecore_evas_extn_plug_object_data_unlock()
1802 *
1803 * @since 1.2
1804 */
1805EAPI void ecore_evas_extn_plug_object_data_lock(Evas_Object *obj);
1806
1807/**
1808 * @brief Unlock the pixel data so the socket can change it again.
1809 *
1810 * @param obj The image object returned by ecore_evas_extn_plug_new() to unlock
1811 *
1812 * This unlocks after an advisor lock has been taken by
1813 * ecore_evas_extn_plug_object_data_lock().
1814 *
1815 * @see ecore_evas_extn_plug_new()
1816 * @see ecore_evas_extn_plug_object_data_lock()
1817 *
1818 * @since 1.2
1819 */
1820EAPI void ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj);
1821
1822/**
1823 * @brief Create a new external ecore evas plug
1824 *
1825 * @param ee_target The Ecore_Evas containing the canvas in which the new image object will live.
1826 * @return An evas image object that will contain the image output of a socket.
1827 *
1828 * This creates an image object that will contain the output of another
1829 * processes socket canvas when it connects. All input will be sent back to
1830 * this process as well, effectively swallowing or placing the socket process
1831 * in the canvas of the plug process in place of the image object. The image
1832 * object by default is created to be filled (equivalent of
1833 * evas_object_image_filled_add() on creation) so image content will scale
1834 * toi fill the image unless otherwise reconfigured. The Ecore_Evas size
1835 * of the plug is the master size and determines size in pixels of the
1836 * plug canvas. You can change the size with something like:
1837 *
1838 * @code
1839 * Eina_Bool res = EINA_FALSE;
1840 * Evas_Object *obj = ecore_evas_extn_plug_new(ee);
1841 *
1842 * res = ecore_evas_extn_plug_connect("svcname", 1, EINA_FALSE);
1843 * if (!res) return;
1844 * ecore_evas_resize(ee, 240, 400);
1845 * @endcode
1846 *
1847 * @see ecore_evas_extn_socket_new()
1848 * @see ecore_evas_extn_plug_connect()
1849 * @since 1.2
1850 */
1851EAPI Evas_Object *ecore_evas_extn_plug_new(Ecore_Evas *ee_target);
1852
1853/**
1854 * @brief Connect a external ecore evas plug to service provided by external ecore evas socket
1855 *
1856 * @param obj The Ecore_Evas containing the canvas in which the new image object will live.
1857 * @param svcname The service name to connect to set up by the socket.
1858 * @param svcnum The service number to connect to (set up by socket).
1859 * @param svcsys Booleain to set if the service is a system one or not (set up by socket).
1860 * @return EINA_TRUE if creation is successful, EINA_FALSE if it does not.
1861 *
1862 *
1863 * @see ecore_evas_extn_plug_new()
1864 *
1865 * @since 1.2
1866 */
1867EAPI Eina_Bool ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys);
1868
1869/**
1870 * @}
1871 */
1651 1872
1652/** 1873/**
1653 * @} 1874 * @}