2015-08-18 06:50:28 -07:00
|
|
|
#ifndef _ECORE_WL2_H_
|
|
|
|
# define _ECORE_WL2_H_
|
|
|
|
|
|
|
|
# include <Eina.h>
|
|
|
|
# include <Ecore.h>
|
|
|
|
# include <wayland-client.h>
|
|
|
|
# include <wayland-cursor.h>
|
|
|
|
# include <xkbcommon/xkbcommon.h>
|
|
|
|
|
2015-08-18 08:56:07 -07:00
|
|
|
# define WL_HIDE_DEPRECATED
|
|
|
|
# include <wayland-server.h>
|
|
|
|
|
2015-08-18 06:50:28 -07:00
|
|
|
# ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
|
|
|
|
/* # ifdef __cplusplus */
|
|
|
|
/* extern "C" { */
|
|
|
|
/* # endif */
|
|
|
|
|
2015-08-20 09:39:39 -07:00
|
|
|
# ifndef _ECORE_WL2_WINDOW_PREDEF
|
|
|
|
typedef struct _Ecore_Wl2_Window Ecore_Wl2_Window;
|
2015-08-18 06:50:28 -07:00
|
|
|
# endif
|
|
|
|
|
2015-08-18 10:50:02 -07:00
|
|
|
typedef struct _Ecore_Wl2_Display Ecore_Wl2_Display;
|
2015-09-10 07:37:40 -07:00
|
|
|
typedef struct _Ecore_Wl2_Output Ecore_Wl2_Output;
|
2015-09-10 08:03:23 -07:00
|
|
|
typedef struct _Ecore_Wl2_Input Ecore_Wl2_Input;
|
2015-08-18 10:50:02 -07:00
|
|
|
|
2015-09-25 07:30:06 -07:00
|
|
|
typedef struct _Ecore_Wl2_Global
|
|
|
|
{
|
|
|
|
Eina_Stringshare *interface;
|
|
|
|
unsigned int id, version;
|
|
|
|
} Ecore_Wl2_Global;
|
|
|
|
|
|
|
|
typedef struct _Ecore_Wl2_Event_Global
|
|
|
|
{
|
|
|
|
Eina_Stringshare *interface;
|
|
|
|
unsigned int id, version;
|
|
|
|
} Ecore_Wl2_Event_Global;
|
|
|
|
|
2015-09-23 09:39:18 -07:00
|
|
|
typedef struct _Ecore_Wl2_Event_Focus_In
|
|
|
|
{
|
|
|
|
unsigned int window;
|
|
|
|
unsigned int timestamp;
|
|
|
|
} Ecore_Wl2_Event_Focus_In;
|
|
|
|
|
|
|
|
typedef struct _Ecore_Wl2_Event_Focus_Out
|
|
|
|
{
|
|
|
|
unsigned int window;
|
|
|
|
unsigned int timestamp;
|
|
|
|
} Ecore_Wl2_Event_Focus_Out;
|
|
|
|
|
2015-09-25 07:30:06 -07:00
|
|
|
typedef struct _Ecore_Wl2_Event_Dnd_Enter
|
2015-08-18 12:05:05 -07:00
|
|
|
{
|
2015-09-25 07:30:06 -07:00
|
|
|
unsigned int win, source, serial;
|
|
|
|
char **types;
|
|
|
|
int num_types, x, y;
|
|
|
|
struct wl_data_offer *offer;
|
|
|
|
} Ecore_Wl2_Event_Dnd_Enter;
|
2015-08-18 12:05:05 -07:00
|
|
|
|
2015-09-25 07:37:06 -07:00
|
|
|
typedef struct _Ecore_Wl2_Event_Dnd_Leave
|
|
|
|
{
|
|
|
|
unsigned int win, source;
|
|
|
|
} Ecore_Wl2_Event_Dnd_Leave;
|
|
|
|
|
2015-09-25 07:41:08 -07:00
|
|
|
typedef struct _Ecore_Wl2_Event_Dnd_Motion
|
|
|
|
{
|
|
|
|
unsigned int win, source, serial;
|
|
|
|
int x, y;
|
|
|
|
} Ecore_Wl2_Event_Dnd_Motion;
|
|
|
|
|
2015-09-25 07:47:46 -07:00
|
|
|
typedef struct _Ecore_Wl2_Event_Dnd_Drop
|
|
|
|
{
|
|
|
|
unsigned int win, source;
|
|
|
|
int x, y;
|
|
|
|
} Ecore_Wl2_Event_Dnd_Drop;
|
|
|
|
|
2015-08-20 09:54:27 -07:00
|
|
|
typedef enum _Ecore_Wl2_Window_Type
|
|
|
|
{
|
|
|
|
ECORE_WL2_WINDOW_TYPE_NONE,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_TOPLEVEL,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_FULLSCREEN,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_MAXIMIZED,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_TRANSIENT,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_MENU,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_DND,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_CUSTOM
|
|
|
|
} Ecore_Wl2_Window_Type;
|
|
|
|
|
2015-08-18 07:06:40 -07:00
|
|
|
EAPI extern int ECORE_WL2_EVENT_GLOBAL_ADDED;
|
|
|
|
EAPI extern int ECORE_WL2_EVENT_GLOBAL_REMOVED;
|
2015-09-23 09:39:18 -07:00
|
|
|
EAPI extern int ECORE_WL2_EVENT_FOCUS_IN;
|
|
|
|
EAPI extern int ECORE_WL2_EVENT_FOCUS_OUT;
|
2015-09-25 07:30:06 -07:00
|
|
|
EAPI extern int ECORE_WL2_EVENT_DND_ENTER;
|
2015-09-25 07:37:06 -07:00
|
|
|
EAPI extern int ECORE_WL2_EVENT_DND_LEAVE;
|
2015-09-25 07:41:08 -07:00
|
|
|
EAPI extern int ECORE_WL2_EVENT_DND_MOTION;
|
2015-09-25 07:47:46 -07:00
|
|
|
EAPI extern int ECORE_WL2_EVENT_DND_DROP;
|
2015-09-25 07:30:06 -07:00
|
|
|
|
2015-08-18 07:57:32 -07:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Ecore functions for dealing with the Wayland display protocol
|
|
|
|
*
|
|
|
|
* @defgroup Ecore_Wl2_Group Ecore_Wl2 - Wayland integration
|
|
|
|
* @ingroup Ecore
|
|
|
|
*
|
|
|
|
* Ecore_Wl2 provides a wrapper and convenience functions for using the
|
|
|
|
* Wayland protocol in implementing a window system. Function groups for
|
|
|
|
* this part of the library include the following:
|
|
|
|
*
|
|
|
|
* @li @ref Ecore_Wl2_Init_Group
|
|
|
|
* @li @ref Ecore_Wl2_Display_Group
|
2015-08-20 09:39:39 -07:00
|
|
|
* @li @ref Ecore_Wl2_Window_Group
|
2015-08-18 07:57:32 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup Ecore_Wl2_Init_Group Wayland Library Init and Shutdown Functions
|
|
|
|
* @ingroup Ecore_Wl2_Group
|
|
|
|
*
|
|
|
|
* Functions that start and shutdown the Ecore Wl2 Library.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the Ecore_Wl2 library
|
|
|
|
*
|
|
|
|
* @return The number of times the library has been initialized without being
|
|
|
|
* shutdown. 0 is returned if an error occurs.
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Init_Group
|
|
|
|
*/
|
2015-08-18 07:06:40 -07:00
|
|
|
EAPI int ecore_wl2_init(void);
|
2015-08-18 07:57:32 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Shutdown the Ecore_Wl2 Library
|
|
|
|
*
|
|
|
|
* @return The number of times the library has been initialized without
|
|
|
|
* being shutdown.
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Init_Group
|
|
|
|
*/
|
2015-08-18 07:06:40 -07:00
|
|
|
EAPI int ecore_wl2_shutdown(void);
|
|
|
|
|
2015-08-18 08:56:07 -07:00
|
|
|
/**
|
|
|
|
* @defgroup Ecore_Wl2_Display_Group Wayland Library Display Functions
|
|
|
|
* @ingroup Ecore_Wl2_Group
|
|
|
|
*
|
|
|
|
* Functions that deal with creating, connecting, or interacting with
|
|
|
|
* Wayland displays
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new Wayland display
|
|
|
|
*
|
|
|
|
* @brief This function is typically used to create a new display for
|
|
|
|
* use with compositors, or to create a new display for use in nested
|
|
|
|
* compositors.
|
|
|
|
*
|
2015-08-18 12:55:24 -07:00
|
|
|
* @param name The display target name to create. If @c NULL, a default
|
|
|
|
* display name will be assigned.
|
2015-08-18 10:50:02 -07:00
|
|
|
* @return The newly created Ecore_Wl2_Display
|
2015-08-18 08:56:07 -07:00
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
2015-08-18 12:55:24 -07:00
|
|
|
EAPI Ecore_Wl2_Display *ecore_wl2_display_create(const char *name);
|
2015-08-18 08:56:07 -07:00
|
|
|
|
2015-08-20 07:22:03 -07:00
|
|
|
/**
|
|
|
|
* Destroy an existing Wayland display
|
|
|
|
*
|
|
|
|
* @brief This function is typically used by servers to terminate an
|
|
|
|
* existing Wayland display.
|
|
|
|
*
|
|
|
|
* @param display The display to terminate
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_display_destroy(Ecore_Wl2_Display *display);
|
|
|
|
|
2015-08-18 08:56:07 -07:00
|
|
|
/**
|
|
|
|
* Connect to an existing Wayland display
|
|
|
|
*
|
|
|
|
* @brief This function is typically used by clients to connect to an
|
2015-08-18 10:50:02 -07:00
|
|
|
* existing Wayland display.
|
2015-08-18 08:56:07 -07:00
|
|
|
*
|
|
|
|
* @param name The display target name to connect to. If @c NULL, the default
|
|
|
|
* display is assumed.
|
|
|
|
*
|
2015-08-18 10:50:02 -07:00
|
|
|
* @return The Ecore_Wl2_Display which was connected to
|
2015-08-18 08:56:07 -07:00
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
2015-08-18 10:50:02 -07:00
|
|
|
EAPI Ecore_Wl2_Display *ecore_wl2_display_connect(const char *name);
|
2015-08-18 08:56:07 -07:00
|
|
|
|
2015-08-20 07:15:07 -07:00
|
|
|
/**
|
|
|
|
* Disconnect an existing Wayland display
|
|
|
|
*
|
|
|
|
* @brief This function is typically used by clients to disconnect from an
|
|
|
|
* existing Wayland display.
|
|
|
|
*
|
|
|
|
* @param display The display to disconnect from
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_display_disconnect(Ecore_Wl2_Display *display);
|
|
|
|
|
2015-08-20 07:57:07 -07:00
|
|
|
/**
|
|
|
|
* Terminate a Wayland display's main loop
|
|
|
|
*
|
|
|
|
* @brief This function is typically used by servers to terminate the
|
|
|
|
* Wayland display main loop. This is usually only called when a server
|
|
|
|
* encounters an error.
|
|
|
|
*
|
|
|
|
* @param display The Ecore_Wl2_Display to terminate
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_display_terminate(Ecore_Wl2_Display *display);
|
|
|
|
|
2015-08-19 10:41:01 -07:00
|
|
|
/**
|
|
|
|
* Retrieve the existing Wayland display
|
|
|
|
*
|
|
|
|
* @param display The Ecore_Wl2_Display for which to retrieve the existing
|
|
|
|
* Wayland display from
|
|
|
|
*
|
|
|
|
* @return The wl_display which this Ecore_Wl2_Display is using
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
|
|
|
EAPI struct wl_display *ecore_wl2_display_get(Ecore_Wl2_Display *display);
|
|
|
|
|
2015-08-20 06:56:18 -07:00
|
|
|
/**
|
|
|
|
* Retrieve the wl_shm from a given Ecore_Wl2_Display
|
|
|
|
*
|
|
|
|
* @param display The Ecore_Wl2_Display for which to retrieve the existing
|
|
|
|
* Wayland shm interface from
|
|
|
|
*
|
|
|
|
* @return The wl_shm which this Ecore_Wl2_Display is using
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
|
|
|
EAPI struct wl_shm *ecore_wl2_display_shm_get(Ecore_Wl2_Display *display);
|
|
|
|
|
2015-08-20 09:18:52 -07:00
|
|
|
/**
|
|
|
|
* Return an Eina_Iterator that can be used to iterate through globals
|
|
|
|
*
|
|
|
|
* @param display The Ecore_Wl2_Display for which to return a global iterator
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Display_Group
|
|
|
|
*/
|
|
|
|
EAPI Eina_Iterator *ecore_wl2_display_globals_get(Ecore_Wl2_Display *display);
|
|
|
|
|
2015-09-25 11:31:30 -07:00
|
|
|
|
|
|
|
EAPI Eina_Bool ecore_wl2_display_animator_source_set(Ecore_Wl2_Display *display, Ecore_Animator_Source source);
|
|
|
|
|
2015-08-20 09:39:39 -07:00
|
|
|
/**
|
|
|
|
* @defgroup Ecore_Wl2_Window_Group Wayland Library Window Functions
|
|
|
|
* @ingroup Ecore_Wl2_Group
|
|
|
|
*
|
2015-09-10 08:02:53 -07:00
|
|
|
* Functions that deal with creating, destroying, or interacting with
|
2015-08-20 09:39:39 -07:00
|
|
|
* Wayland windows
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new Ecore_Wl2_Window
|
|
|
|
*
|
|
|
|
* @param display The Ecore_Wl2_Display on which to create this new window
|
|
|
|
* @param parent The Ecore_Wl2_Window which is the parent of this window
|
|
|
|
* @param x Initial x position of window
|
|
|
|
* @param y Initial y position of window
|
|
|
|
* @param w Initial width of window
|
|
|
|
* @param h Initial height of window
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI Ecore_Wl2_Window *ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x, int y, int w, int h);
|
|
|
|
|
2015-08-20 09:44:17 -07:00
|
|
|
/**
|
|
|
|
* Get the window id associated with an Ecore_Wl2_Window
|
|
|
|
*
|
|
|
|
* @param window The Ecore_Wl2_Window of which to retrieve the window id
|
|
|
|
*
|
|
|
|
* @return The id associated with this window
|
2015-08-20 11:12:18 -07:00
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
2015-08-20 09:44:17 -07:00
|
|
|
*/
|
|
|
|
EAPI int ecore_wl2_window_id_get(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-08-20 11:12:18 -07:00
|
|
|
/**
|
|
|
|
* Get the wl_surface which belongs to this window
|
|
|
|
*
|
|
|
|
* @param window The Ecore_Wl2_Window to get the surface of
|
|
|
|
*
|
|
|
|
* @return The wl_surface associated with this window.
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI struct wl_surface *ecore_wl2_window_surface_get(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-09 08:19:24 -07:00
|
|
|
/**
|
|
|
|
* Show a given Ecore_Wl2_Window
|
|
|
|
*
|
|
|
|
* @param window The Ecore_Wl2_Window to show
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_window_show(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-09 09:08:26 -07:00
|
|
|
/**
|
|
|
|
* Hide a given Ecore_Wl2_Window
|
|
|
|
*
|
|
|
|
* @param window The Ecore_Wl2_Window to hide
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_window_hide(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-09 09:12:53 -07:00
|
|
|
/**
|
|
|
|
* Free a given Ecore_Wl2_Window
|
|
|
|
*
|
|
|
|
* @param window The Ecore_Wl2_Window to free
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_window_free(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-09 09:24:30 -07:00
|
|
|
/**
|
|
|
|
* Move a given Ecore_Wl2_Window
|
|
|
|
*
|
2015-09-09 09:50:35 -07:00
|
|
|
* @brief The position requested (@p x, @p y) is not honored by Wayland because
|
|
|
|
* Wayland does not allow specific window placement to be set.
|
|
|
|
*
|
2015-09-09 09:24:30 -07:00
|
|
|
* @param window The Ecore_Wl2_Window which to move
|
|
|
|
* @param x Desired x position of window
|
|
|
|
* @param y Desired y position of window
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_window_move(Ecore_Wl2_Window *window, int x, int y);
|
|
|
|
|
2015-09-09 09:27:23 -07:00
|
|
|
/**
|
|
|
|
* Resize a given Ecore_Wl2_Window
|
|
|
|
*
|
2015-09-09 09:50:35 -07:00
|
|
|
* @brief The size requested (@p w, @p h) is not honored by Wayland because
|
|
|
|
* Wayland does not allow specific window sizes to be set.
|
|
|
|
*
|
2015-09-09 09:27:23 -07:00
|
|
|
* @param window The Ecore_Wl2_Window which to resize
|
|
|
|
* @param w Desired width of window
|
|
|
|
* @param h Desired height of window
|
|
|
|
* @param location The edge of the window from where the resize should start
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_window_resize(Ecore_Wl2_Window *window, int w, int h, int location);
|
|
|
|
|
2015-09-09 10:06:54 -07:00
|
|
|
/**
|
|
|
|
* Raise a given Ecore_Wl2_Window
|
|
|
|
*
|
|
|
|
* @param window The Ecore_Wl2_Window which to raise
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_window_raise(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-28 06:12:36 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI Ecore_Wl2_Window *ecore_wl2_window_find(Ecore_Wl2_Display *display, int id);
|
|
|
|
|
2015-09-28 06:15:49 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI Eina_Bool ecore_wl2_window_alpha_get(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-28 06:19:21 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI void ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha);
|
|
|
|
|
2015-09-28 06:25:52 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI void ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the opaque region of the Ecore_Wl2_Window
|
|
|
|
*
|
|
|
|
* @param win The window
|
|
|
|
* @param x The left point of the region.
|
|
|
|
* @param y The top point of the region.
|
|
|
|
* @param w The width of the region.
|
|
|
|
* @param h The height of the region.
|
|
|
|
*
|
|
|
|
* @ingroup Ecore_Wl2_Window_Group
|
|
|
|
*/
|
|
|
|
EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h);
|
|
|
|
|
2015-09-28 06:39:07 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI Eina_Bool ecore_wl2_window_maximized_get(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-28 06:40:39 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI Eina_Bool ecore_wl2_window_fullscreen_get(Ecore_Wl2_Window *window);
|
|
|
|
|
2015-09-28 06:42:21 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI void ecore_wl2_window_rotation_set(Ecore_Wl2_Window *window, int rotation);
|
|
|
|
|
2015-09-28 06:47:59 -07:00
|
|
|
/* TODO: doxy */
|
|
|
|
EAPI void ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title);
|
|
|
|
|
2015-08-18 06:50:28 -07:00
|
|
|
/* # ifdef __cplusplus */
|
|
|
|
/* } */
|
|
|
|
/* # endif */
|
|
|
|
|
|
|
|
# undef EAPI
|
|
|
|
# define EAPI
|
|
|
|
|
|
|
|
#endif
|