2011-12-26 15:27:20 -08:00
|
|
|
#ifndef _ECORE_WAYLAND_H_
|
|
|
|
# define _ECORE_WAYLAND_H_
|
|
|
|
|
2012-04-25 20:42:41 -07:00
|
|
|
/*
|
|
|
|
* Wayland supoprt is considered experimental as wayland itself is still
|
|
|
|
* unstable and liable to change core protocol. If you use this api, it is
|
|
|
|
* possible it will break in future, until this notice is removed.
|
|
|
|
*/
|
|
|
|
|
2011-12-26 15:27:20 -08:00
|
|
|
# include <Eina.h>
|
|
|
|
# include <wayland-client.h>
|
2012-06-06 01:18:58 -07:00
|
|
|
# include <wayland-cursor.h>
|
2012-05-15 04:58:21 -07:00
|
|
|
# include <xkbcommon/xkbcommon.h>
|
2011-12-26 15:27:20 -08:00
|
|
|
|
|
|
|
# ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type;
|
|
|
|
typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type;
|
|
|
|
|
|
|
|
typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
|
|
|
|
typedef struct _Ecore_Wl_Output Ecore_Wl_Output;
|
|
|
|
typedef struct _Ecore_Wl_Input Ecore_Wl_Input;
|
|
|
|
# ifndef _ECORE_WAYLAND_WINDOW_PREDEF
|
|
|
|
typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
|
|
|
|
# endif
|
|
|
|
typedef struct _Ecore_Wl_Dnd_Source Ecore_Wl_Dnd_Source;
|
|
|
|
typedef struct _Ecore_Wl_Dnd_Target Ecore_Wl_Dnd_Target;
|
|
|
|
|
2011-12-26 15:27:20 -08:00
|
|
|
typedef struct _Ecore_Wl_Event_Mouse_In Ecore_Wl_Event_Mouse_In;
|
|
|
|
typedef struct _Ecore_Wl_Event_Mouse_Out Ecore_Wl_Event_Mouse_Out;
|
|
|
|
typedef struct _Ecore_Wl_Event_Focus_In Ecore_Wl_Event_Focus_In;
|
|
|
|
typedef struct _Ecore_Wl_Event_Focus_Out Ecore_Wl_Event_Focus_Out;
|
2012-02-28 13:55:51 -08:00
|
|
|
typedef struct _Ecore_Wl_Event_Window_Configure Ecore_Wl_Event_Window_Configure;
|
|
|
|
typedef struct _Ecore_Wl_Event_Dnd_Enter Ecore_Wl_Event_Dnd_Enter;
|
|
|
|
typedef struct _Ecore_Wl_Event_Dnd_Position Ecore_Wl_Event_Dnd_Position;
|
|
|
|
typedef struct _Ecore_Wl_Event_Dnd_Leave Ecore_Wl_Event_Dnd_Leave;
|
|
|
|
typedef struct _Ecore_Wl_Event_Dnd_Drop Ecore_Wl_Event_Dnd_Drop;
|
2012-03-07 13:46:52 -08:00
|
|
|
typedef struct _Ecore_Wl_Event_Interfaces_Bound Ecore_Wl_Event_Interfaces_Bound;
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
enum _Ecore_Wl_Window_Type
|
|
|
|
{
|
2012-05-15 04:58:21 -07:00
|
|
|
ECORE_WL_WINDOW_TYPE_NONE,
|
2012-02-28 13:55:51 -08:00
|
|
|
ECORE_WL_WINDOW_TYPE_TOPLEVEL,
|
|
|
|
ECORE_WL_WINDOW_TYPE_FULLSCREEN,
|
|
|
|
ECORE_WL_WINDOW_TYPE_MAXIMIZED,
|
|
|
|
ECORE_WL_WINDOW_TYPE_TRANSIENT,
|
|
|
|
ECORE_WL_WINDOW_TYPE_MENU,
|
|
|
|
ECORE_WL_WINDOW_TYPE_CUSTOM
|
|
|
|
};
|
2012-01-13 01:33:33 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
enum _Ecore_Wl_Window_Buffer_Type
|
|
|
|
{
|
|
|
|
ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW,
|
|
|
|
ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE,
|
|
|
|
ECORE_WL_WINDOW_BUFFER_TYPE_SHM
|
|
|
|
};
|
2012-01-12 23:46:22 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Display
|
2011-12-26 15:27:20 -08:00
|
|
|
{
|
2012-02-28 13:55:51 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct wl_display *display;
|
|
|
|
struct wl_compositor *compositor;
|
|
|
|
struct wl_shell *shell;
|
2012-04-10 10:00:56 -07:00
|
|
|
struct wl_shell *desktop_shell;
|
2012-02-28 13:55:51 -08:00
|
|
|
struct wl_shm *shm;
|
|
|
|
struct wl_data_device_manager *data_device_manager;
|
|
|
|
} wl;
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
int fd;
|
|
|
|
unsigned int mask;
|
2012-04-17 12:06:23 -07:00
|
|
|
unsigned int serial;
|
2012-02-28 13:55:51 -08:00
|
|
|
Ecore_Fd_Handler *fd_hdl;
|
|
|
|
|
|
|
|
struct wl_list inputs;
|
|
|
|
struct wl_list outputs;
|
|
|
|
|
2012-05-15 04:58:21 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct xkb_rule_names names;
|
|
|
|
struct xkb_context *context;
|
|
|
|
struct xkb_keymap *keymap;
|
|
|
|
struct xkb_state *state;
|
|
|
|
xkb_mod_mask_t control_mask;
|
|
|
|
xkb_mod_mask_t alt_mask;
|
|
|
|
xkb_mod_mask_t shift_mask;
|
|
|
|
} xkb;
|
2012-02-28 13:55:51 -08:00
|
|
|
|
2012-06-06 01:18:58 -07:00
|
|
|
struct wl_cursor_theme *cursor_theme;
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
Ecore_Wl_Output *output;
|
2012-03-26 19:13:34 -07:00
|
|
|
Ecore_Wl_Input *input;
|
2012-02-28 13:55:51 -08:00
|
|
|
|
|
|
|
void (*output_configure)(Ecore_Wl_Output *output, void *data);
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Wl_Output
|
|
|
|
{
|
|
|
|
Ecore_Wl_Display *display;
|
|
|
|
struct wl_output *output;
|
|
|
|
Eina_Rectangle allocation;
|
2012-03-26 19:13:34 -07:00
|
|
|
int mw, mh;
|
2012-02-28 13:55:51 -08:00
|
|
|
struct wl_list link;
|
|
|
|
|
|
|
|
void (*destroy) (Ecore_Wl_Output *output, void *data);
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Wl_Input
|
|
|
|
{
|
|
|
|
Ecore_Wl_Display *display;
|
2012-05-22 01:17:30 -07:00
|
|
|
struct wl_seat *seat;
|
|
|
|
struct wl_pointer *pointer;
|
|
|
|
struct wl_keyboard *keyboard;
|
|
|
|
struct wl_touch *touch;
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct wl_data_device *data_device;
|
|
|
|
|
|
|
|
Ecore_Wl_Window *pointer_focus;
|
|
|
|
Ecore_Wl_Window *keyboard_focus;
|
|
|
|
|
|
|
|
unsigned int button;
|
|
|
|
unsigned int timestamp;
|
|
|
|
unsigned int modifiers;
|
2012-04-17 12:06:23 -07:00
|
|
|
unsigned int pointer_enter_serial;
|
2012-02-28 13:55:51 -08:00
|
|
|
int sx, sy;
|
|
|
|
|
|
|
|
struct wl_list link;
|
|
|
|
|
2012-03-26 19:13:34 -07:00
|
|
|
Ecore_Wl_Window *grab;
|
2012-02-28 13:55:51 -08:00
|
|
|
unsigned int grab_button;
|
|
|
|
|
|
|
|
Ecore_Wl_Dnd_Source *drag_source;
|
|
|
|
Ecore_Wl_Dnd_Source *selection_source;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Wl_Window
|
|
|
|
{
|
|
|
|
Ecore_Wl_Display *display;
|
|
|
|
Ecore_Wl_Window *parent;
|
|
|
|
|
|
|
|
struct wl_surface *surface;
|
|
|
|
struct wl_shell_surface *shell_surface;
|
|
|
|
|
2012-03-26 19:13:34 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct wl_region *input, *opaque;
|
|
|
|
} region;
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
int id;
|
|
|
|
int x, y;
|
|
|
|
int edges;
|
|
|
|
|
|
|
|
Eina_Rectangle allocation, pending_allocation;
|
|
|
|
Eina_Rectangle saved_allocation, server_allocation;
|
|
|
|
|
2012-03-01 05:43:41 -08:00
|
|
|
/* Eina_Bool redraw_scheduled : 1; */
|
|
|
|
/* Eina_Bool resize_scheduled : 1; */
|
2012-02-28 13:55:51 -08:00
|
|
|
Eina_Bool transparent : 1;
|
2012-04-24 09:59:35 -07:00
|
|
|
Eina_Bool moving : 1;
|
|
|
|
Eina_Bool resizing : 1;
|
2012-02-28 13:55:51 -08:00
|
|
|
|
|
|
|
Ecore_Wl_Window_Type type;
|
|
|
|
Ecore_Wl_Window_Buffer_Type buffer_type;
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
Ecore_Wl_Input *pointer_device;
|
|
|
|
Ecore_Wl_Input *keyboard_device;
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
void *data;
|
2011-12-26 15:27:20 -08:00
|
|
|
};
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Mouse_In
|
2011-12-26 15:27:20 -08:00
|
|
|
{
|
|
|
|
int modifiers;
|
|
|
|
int x, y;
|
2012-02-28 13:55:51 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
} root;
|
2012-04-10 10:00:56 -07:00
|
|
|
unsigned int window;
|
|
|
|
unsigned int event_window;
|
|
|
|
unsigned int root_window;
|
2012-02-28 13:55:51 -08:00
|
|
|
unsigned int timestamp;
|
|
|
|
};
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Mouse_Out
|
|
|
|
{
|
|
|
|
int modifiers;
|
|
|
|
int x, y;
|
2011-12-26 15:27:20 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
} root;
|
2012-04-10 10:00:56 -07:00
|
|
|
unsigned int window;
|
|
|
|
unsigned int event_window;
|
|
|
|
unsigned int root_window;
|
2012-02-28 13:55:51 -08:00
|
|
|
unsigned int timestamp;
|
|
|
|
};
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Focus_In
|
|
|
|
{
|
|
|
|
unsigned int win;
|
|
|
|
unsigned int timestamp;
|
|
|
|
};
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Focus_Out
|
|
|
|
{
|
|
|
|
unsigned int win;
|
|
|
|
unsigned int timestamp;
|
2011-12-26 15:27:20 -08:00
|
|
|
};
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Window_Configure
|
2011-12-26 15:27:20 -08:00
|
|
|
{
|
2012-02-28 13:55:51 -08:00
|
|
|
unsigned int win;
|
|
|
|
unsigned int event_win;
|
|
|
|
int x, y, w, h;
|
|
|
|
unsigned int timestamp;
|
2011-12-26 15:27:20 -08:00
|
|
|
};
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Dnd_Enter
|
2011-12-26 15:27:20 -08:00
|
|
|
{
|
2012-02-28 13:55:51 -08:00
|
|
|
unsigned int win, source;
|
|
|
|
char **types;
|
|
|
|
int num_types;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
} position;
|
2011-12-26 15:27:20 -08:00
|
|
|
};
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Dnd_Position
|
2012-01-12 23:46:22 -08:00
|
|
|
{
|
2012-02-28 13:55:51 -08:00
|
|
|
unsigned int win, source;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
} position;
|
2012-01-12 23:46:22 -08:00
|
|
|
};
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Dnd_Leave
|
2012-01-12 23:46:22 -08:00
|
|
|
{
|
2012-02-28 13:55:51 -08:00
|
|
|
unsigned int win, source;
|
|
|
|
};
|
2012-01-12 23:46:22 -08:00
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
struct _Ecore_Wl_Event_Dnd_Drop
|
|
|
|
{
|
|
|
|
unsigned int win, source;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
} position;
|
2012-01-12 23:46:22 -08:00
|
|
|
};
|
|
|
|
|
2012-03-07 13:46:52 -08:00
|
|
|
struct _Ecore_Wl_Event_Interfaces_Bound
|
|
|
|
{
|
|
|
|
Eina_Bool compositor : 1;
|
|
|
|
Eina_Bool shm : 1;
|
|
|
|
Eina_Bool shell : 1;
|
|
|
|
};
|
|
|
|
|
2011-12-26 15:27:20 -08:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Ecore functions for dealing with the Wayland window system
|
|
|
|
*
|
|
|
|
* Ecore_Wl provides a wrapper and convenience functions for using the
|
|
|
|
* Wayland window system. Function groups for this part of the library
|
|
|
|
* include the following:
|
2012-02-28 14:31:27 -08:00
|
|
|
*
|
2011-12-26 15:27:20 -08:00
|
|
|
* @li @ref Ecore_Wl_Init_Group
|
2012-02-28 14:31:27 -08:00
|
|
|
* @li @ref Ecore_Wl_Display_Group
|
|
|
|
* @li @ref Ecore_Wl_Flush_Group
|
|
|
|
* @li @ref Ecore_Wl_Window_Group
|
2011-12-26 15:27:20 -08:00
|
|
|
*/
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
EAPI extern int ECORE_WL_EVENT_MOUSE_IN;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_MOUSE_OUT;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_FOCUS_IN;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_FOCUS_OUT;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_WINDOW_CONFIGURE;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_DND_ENTER;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_DND_POSITION;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_DND_LEAVE;
|
|
|
|
EAPI extern int ECORE_WL_EVENT_DND_DROP;
|
2012-03-07 13:46:52 -08:00
|
|
|
EAPI extern int ECORE_WL_EVENT_INTERFACES_BOUND;
|
2012-02-28 13:55:51 -08:00
|
|
|
|
2011-12-26 15:27:20 -08:00
|
|
|
EAPI int ecore_wl_init(const char *name);
|
|
|
|
EAPI int ecore_wl_shutdown(void);
|
|
|
|
EAPI void ecore_wl_flush(void);
|
2012-01-03 12:37:30 -08:00
|
|
|
EAPI void ecore_wl_sync(void);
|
2012-02-28 13:55:51 -08:00
|
|
|
EAPI struct wl_shm *ecore_wl_shm_get(void);
|
|
|
|
EAPI struct wl_display *ecore_wl_display_get(void);
|
|
|
|
EAPI void ecore_wl_screen_size_get(int *w, int *h);
|
2012-03-05 08:50:20 -08:00
|
|
|
EAPI void ecore_wl_pointer_xy_get(int *x, int *y);
|
2012-03-26 19:13:34 -07:00
|
|
|
EAPI int ecore_wl_dpi_get(void);
|
2012-03-28 18:26:30 -07:00
|
|
|
EAPI void ecore_wl_display_iterate(void);
|
2012-06-06 01:18:58 -07:00
|
|
|
EAPI struct wl_cursor *ecore_wl_cursor_get(const char *cursor_name);
|
2012-03-26 19:13:34 -07:00
|
|
|
|
|
|
|
EAPI void ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button);
|
2012-04-24 09:59:35 -07:00
|
|
|
EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input);
|
2012-06-06 01:18:58 -07:00
|
|
|
EAPI void ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_buffer *buffer, int hot_x, int hot_y);
|
|
|
|
EAPI void ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char *cursor_name);
|
|
|
|
EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input);
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2012-04-10 10:00:56 -07:00
|
|
|
EAPI struct wl_list ecore_wl_outputs_get(void);
|
|
|
|
|
2012-02-28 13:55:51 -08:00
|
|
|
EAPI Ecore_Wl_Window *ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buffer_type);
|
|
|
|
EAPI void ecore_wl_window_free(Ecore_Wl_Window *win);
|
|
|
|
EAPI void ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y);
|
|
|
|
EAPI void ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location);
|
|
|
|
EAPI void ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h);
|
|
|
|
EAPI void ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y);
|
|
|
|
EAPI void ecore_wl_window_show(Ecore_Wl_Window *win);
|
|
|
|
EAPI void ecore_wl_window_hide(Ecore_Wl_Window *win);
|
|
|
|
EAPI void ecore_wl_window_raise(Ecore_Wl_Window *win);
|
|
|
|
EAPI void ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized);
|
|
|
|
EAPI void ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen);
|
2012-03-26 19:13:34 -07:00
|
|
|
EAPI void ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent);
|
2012-02-28 13:55:51 -08:00
|
|
|
EAPI void ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h);
|
2012-04-24 09:59:35 -07:00
|
|
|
EAPI void ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y);
|
2012-02-28 13:55:51 -08:00
|
|
|
EAPI struct wl_surface *ecore_wl_window_surface_get(Ecore_Wl_Window *win);
|
2012-04-10 10:00:56 -07:00
|
|
|
EAPI struct wl_shell_surface *ecore_wl_window_shell_surface_get(Ecore_Wl_Window *win);
|
2012-02-28 13:55:51 -08:00
|
|
|
EAPI Ecore_Wl_Window *ecore_wl_window_find(unsigned int id);
|
2012-03-26 19:13:34 -07:00
|
|
|
EAPI void ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type);
|
2012-06-06 01:18:58 -07:00
|
|
|
EAPI void ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_buffer *buffer, int hot_x, int hot_y);
|
|
|
|
EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_name);
|
|
|
|
EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win);
|
2012-04-10 10:00:56 -07:00
|
|
|
EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent);
|
2011-12-26 15:27:20 -08:00
|
|
|
|
|
|
|
#endif
|