2015-08-18 06:50:28 -07:00
|
|
|
#ifndef _ECORE_WL2_PRIVATE_H
|
|
|
|
# define _ECORE_WL2_PRIVATE_H
|
|
|
|
|
2015-10-23 09:03:08 -07:00
|
|
|
# include <unistd.h>
|
2015-08-18 06:50:28 -07:00
|
|
|
# include "Ecore_Wl2.h"
|
|
|
|
# include "Ecore_Input.h"
|
|
|
|
|
2015-10-01 08:28:54 -07:00
|
|
|
/* NB: Test if subsurface protocol is part of wayland code, if not then
|
|
|
|
* include our own copy */
|
|
|
|
# ifndef WL_SUBSURFACE_ERROR_ENUM
|
|
|
|
# include "subsurface-client-protocol.h"
|
|
|
|
# endif
|
|
|
|
|
2015-08-19 10:48:19 -07:00
|
|
|
# include "xdg-shell-client-protocol.h"
|
|
|
|
# define XDG_VERSION 5
|
|
|
|
|
2015-08-18 06:50:28 -07:00
|
|
|
extern int _ecore_wl2_log_dom;
|
|
|
|
|
|
|
|
# ifdef ECORE_WL2_DEFAULT_LOG_COLOR
|
|
|
|
# undef ECORE_WL2_DEFAULT_LOG_COLOR
|
|
|
|
# endif
|
|
|
|
# define ECORE_WL2_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
|
|
|
|
|
|
|
|
# ifdef ERR
|
|
|
|
# undef ERR
|
|
|
|
# endif
|
|
|
|
# define ERR(...) EINA_LOG_DOM_ERR(_ecore_wl2_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
# ifdef DBG
|
|
|
|
# undef DBG
|
|
|
|
# endif
|
|
|
|
# define DBG(...) EINA_LOG_DOM_DBG(_ecore_wl2_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
# ifdef INF
|
|
|
|
# undef INF
|
|
|
|
# endif
|
|
|
|
# define INF(...) EINA_LOG_DOM_INFO(_ecore_wl2_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
# ifdef WRN
|
|
|
|
# undef WRN
|
|
|
|
# endif
|
|
|
|
# define WRN(...) EINA_LOG_DOM_WARN(_ecore_wl2_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
# ifdef CRI
|
|
|
|
# undef CRI
|
|
|
|
# endif
|
|
|
|
# define CRI(...) EINA_LOG_DOM_CRIT(_ecore_wl2_log_dom, __VA_ARGS__)
|
|
|
|
|
2015-08-18 10:50:02 -07:00
|
|
|
struct _Ecore_Wl2_Display
|
|
|
|
{
|
2015-10-09 07:23:30 -07:00
|
|
|
int refs;
|
2015-10-08 12:24:56 -07:00
|
|
|
char *name;
|
2015-10-23 09:03:08 -07:00
|
|
|
pid_t pid;
|
2015-08-18 10:50:02 -07:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct wl_display *display;
|
2015-10-06 11:45:02 -07:00
|
|
|
struct wl_registry *registry;
|
2015-08-19 10:48:19 -07:00
|
|
|
struct wl_compositor *compositor;
|
|
|
|
struct wl_subcompositor *subcompositor;
|
|
|
|
struct wl_data_device_manager *data_device_manager;
|
|
|
|
struct wl_shm *shm;
|
|
|
|
struct wl_shell *wl_shell;
|
|
|
|
struct xdg_shell *xdg_shell;
|
2015-08-18 10:50:02 -07:00
|
|
|
} wl;
|
|
|
|
|
2015-09-23 08:07:00 -07:00
|
|
|
uint32_t serial;
|
|
|
|
|
2015-08-20 07:35:24 -07:00
|
|
|
struct xkb_context *xkb_context;
|
|
|
|
|
2015-10-06 08:44:09 -07:00
|
|
|
Ecore_Idle_Enterer *idle_enterer;
|
2015-08-18 10:50:02 -07:00
|
|
|
Ecore_Fd_Handler *fd_hdl;
|
2015-08-18 12:05:05 -07:00
|
|
|
|
|
|
|
Eina_Hash *globals;
|
2015-09-09 08:18:38 -07:00
|
|
|
|
2015-09-10 10:21:02 -07:00
|
|
|
Eina_Inlist *windows;
|
2015-09-10 07:37:40 -07:00
|
|
|
Eina_Inlist *outputs;
|
2015-09-10 08:03:23 -07:00
|
|
|
Eina_Inlist *inputs;
|
2015-11-22 13:13:36 -08:00
|
|
|
Eina_Inlist *seats;
|
2015-09-10 07:37:40 -07:00
|
|
|
|
2015-09-09 08:18:38 -07:00
|
|
|
Eina_Bool sync_done : 1;
|
2015-08-18 10:50:02 -07:00
|
|
|
};
|
|
|
|
|
2015-10-01 08:43:35 -07:00
|
|
|
struct _Ecore_Wl2_Subsurface
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
Ecore_Wl2_Window *parent;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct wl_surface *surface;
|
|
|
|
struct wl_subsurface *subsurface;
|
|
|
|
} wl;
|
|
|
|
|
|
|
|
Eina_Bool sync : 1;
|
|
|
|
};
|
|
|
|
|
2015-08-20 09:39:39 -07:00
|
|
|
struct _Ecore_Wl2_Window
|
|
|
|
{
|
2015-09-10 10:21:02 -07:00
|
|
|
EINA_INLIST;
|
|
|
|
|
2015-08-20 09:39:39 -07:00
|
|
|
Ecore_Wl2_Display *display;
|
2015-09-23 09:13:44 -07:00
|
|
|
Ecore_Wl2_Input *input;
|
2015-08-20 09:39:39 -07:00
|
|
|
|
|
|
|
Ecore_Wl2_Window *parent;
|
|
|
|
|
2015-09-29 08:00:32 -07:00
|
|
|
int id, rotation, surface_id;
|
2015-08-20 09:39:39 -07:00
|
|
|
const char *title;
|
|
|
|
const char *class;
|
2015-09-29 07:53:58 -07:00
|
|
|
const char *cursor;
|
2015-08-20 09:39:39 -07:00
|
|
|
|
|
|
|
struct wl_surface *surface;
|
2015-09-09 08:18:38 -07:00
|
|
|
struct wl_shell_surface *wl_shell_surface;
|
2015-08-20 09:39:39 -07:00
|
|
|
struct xdg_surface *xdg_surface;
|
|
|
|
struct xdg_popup *xdg_popup;
|
2015-10-09 08:56:56 -07:00
|
|
|
|
2015-11-09 08:57:42 -08:00
|
|
|
Eina_Rectangle saved;
|
2015-08-20 09:39:39 -07:00
|
|
|
Eina_Rectangle geometry;
|
2015-09-28 06:25:52 -07:00
|
|
|
Eina_Rectangle opaque;
|
2015-10-01 09:22:32 -07:00
|
|
|
Eina_Rectangle input_rect;
|
2015-08-20 09:54:27 -07:00
|
|
|
|
|
|
|
Ecore_Wl2_Window_Type type;
|
2015-09-09 08:18:38 -07:00
|
|
|
|
2015-10-01 08:43:35 -07:00
|
|
|
Eina_Inlist *subsurfs;
|
|
|
|
|
2015-11-09 12:49:18 -08:00
|
|
|
Eina_Bool moving : 1;
|
2015-09-09 08:18:38 -07:00
|
|
|
Eina_Bool minimized : 1;
|
|
|
|
Eina_Bool maximized : 1;
|
|
|
|
Eina_Bool fullscreen : 1;
|
|
|
|
Eina_Bool focused : 1;
|
|
|
|
Eina_Bool resizing : 1;
|
2015-09-28 06:15:49 -07:00
|
|
|
Eina_Bool alpha : 1;
|
2015-09-28 06:36:34 -07:00
|
|
|
Eina_Bool transparent : 1;
|
2015-08-20 09:39:39 -07:00
|
|
|
};
|
|
|
|
|
2015-09-10 07:37:40 -07:00
|
|
|
struct _Ecore_Wl2_Output
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
Ecore_Wl2_Display *display;
|
|
|
|
struct wl_output *wl_output;
|
|
|
|
|
|
|
|
int mw, mh, transform;
|
|
|
|
const char *make, *model;
|
|
|
|
Eina_Rectangle geometry;
|
|
|
|
};
|
|
|
|
|
2015-09-25 07:30:48 -07:00
|
|
|
typedef struct _Ecore_Wl2_Dnd_Source
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Input *input;
|
|
|
|
|
|
|
|
int refcount, fd, x, y;
|
|
|
|
|
|
|
|
struct wl_data_offer *offer;
|
|
|
|
struct wl_array types;
|
|
|
|
} Ecore_Wl2_Dnd_Source;
|
|
|
|
|
2015-11-22 13:13:36 -08:00
|
|
|
|
|
|
|
/** TODO: Refactor ALL Input code :(
|
|
|
|
*
|
|
|
|
* wl_seat is a GROUP of Input Devices (such as):
|
|
|
|
* keyboards, pointers, touch devices
|
|
|
|
*/
|
|
|
|
struct _Ecore_Wl2_Pointer
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
Ecore_Wl2_Seat *seat;
|
|
|
|
|
|
|
|
double sx, sy;
|
|
|
|
unsigned int button;
|
|
|
|
unsigned int enter_serial;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
const char *name, *theme_name;
|
|
|
|
unsigned int index, size;
|
|
|
|
struct wl_cursor *wl_cursor;
|
|
|
|
struct wl_cursor_theme *theme;
|
|
|
|
struct wl_surface *surface;
|
|
|
|
struct wl_callback *frame_cb;
|
|
|
|
Ecore_Timer *timer;
|
|
|
|
} cursor;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int button, count, timestamp;
|
|
|
|
Ecore_Wl2_Window *window;
|
|
|
|
} grab;
|
|
|
|
|
|
|
|
Ecore_Wl2_Window *focus;
|
|
|
|
|
|
|
|
Eina_List *resources;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Wl2_Keyboard
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
2015-11-30 07:31:22 -08:00
|
|
|
Ecore_Wl2_Seat *seat;
|
|
|
|
|
|
|
|
unsigned int modifiers;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
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_mod_mask_t win_mask;
|
|
|
|
xkb_mod_mask_t scroll_mask;
|
|
|
|
xkb_mod_mask_t num_mask;
|
|
|
|
xkb_mod_mask_t caps_mask;
|
|
|
|
xkb_mod_mask_t altgr_mask;
|
|
|
|
unsigned int mods_depressed;
|
|
|
|
unsigned int mods_latched;
|
|
|
|
unsigned int mods_locked;
|
|
|
|
unsigned int mods_group;
|
|
|
|
} xkb;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Ecore_Timer *tmr;
|
|
|
|
unsigned int sym, key, time;
|
|
|
|
double rate, delay;
|
|
|
|
Eina_Bool enabled : 1;
|
|
|
|
} repeat;
|
|
|
|
|
2015-11-22 13:13:36 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int button, count, timestamp;
|
|
|
|
Ecore_Wl2_Window *window;
|
|
|
|
} grab;
|
2015-11-30 07:31:22 -08:00
|
|
|
|
|
|
|
Ecore_Wl2_Window *focus;
|
|
|
|
|
|
|
|
Eina_List *resources;
|
2015-11-22 13:13:36 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Wl2_Touch
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int button, count, timestamp;
|
|
|
|
Ecore_Wl2_Window *window;
|
|
|
|
} grab;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Wl2_Seat
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
uint32_t id;
|
|
|
|
uint32_t version;
|
|
|
|
const char *name;
|
|
|
|
struct wl_global *global;
|
|
|
|
const struct wl_seat_interface *implementation;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct wl_global *global;
|
|
|
|
struct wl_resource *resource;
|
|
|
|
} im;
|
|
|
|
|
|
|
|
Ecore_Wl2_Bind_Cb bind_cb;
|
|
|
|
Ecore_Wl2_Unbind_Cb unbind_cb;
|
|
|
|
|
|
|
|
Ecore_Wl2_Pointer *pointer;
|
|
|
|
int pointer_count;
|
|
|
|
|
|
|
|
Ecore_Wl2_Keyboard *keyboard;
|
|
|
|
int keyboard_count;
|
|
|
|
|
|
|
|
Ecore_Wl2_Touch *touch;
|
|
|
|
int touch_count;
|
|
|
|
|
|
|
|
Eina_List *resources;
|
|
|
|
};
|
|
|
|
|
2015-09-10 08:03:23 -07:00
|
|
|
struct _Ecore_Wl2_Input
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
Ecore_Wl2_Display *display;
|
|
|
|
|
2015-09-23 08:07:00 -07:00
|
|
|
unsigned int timestamp;
|
|
|
|
|
2015-09-10 08:03:23 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct wl_seat *seat;
|
|
|
|
struct wl_pointer *pointer;
|
|
|
|
struct wl_keyboard *keyboard;
|
|
|
|
struct wl_touch *touch;
|
|
|
|
} wl;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct wl_data_device *device;
|
|
|
|
struct wl_data_source *source;
|
|
|
|
struct wl_array types;
|
|
|
|
} data;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
2015-09-10 09:09:14 -07:00
|
|
|
const char *name, *theme_name;
|
2015-09-10 08:03:23 -07:00
|
|
|
unsigned int index, size;
|
|
|
|
struct wl_cursor *wl_cursor;
|
2015-09-10 09:09:14 -07:00
|
|
|
struct wl_cursor_theme *theme;
|
2015-09-10 08:03:23 -07:00
|
|
|
struct wl_surface *surface;
|
|
|
|
struct wl_callback *frame_cb;
|
|
|
|
Ecore_Timer *timer;
|
|
|
|
} cursor;
|
|
|
|
|
2015-09-10 10:00:48 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
double sx, sy;
|
|
|
|
unsigned int button;
|
|
|
|
unsigned int enter_serial;
|
|
|
|
} pointer;
|
|
|
|
|
2015-09-20 12:45:55 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int modifiers;
|
|
|
|
} keyboard;
|
|
|
|
|
2015-09-10 08:03:23 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Window *pointer;
|
|
|
|
Ecore_Wl2_Window *keyboard;
|
|
|
|
Ecore_Wl2_Window *touch;
|
|
|
|
} focus;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int button, count, timestamp;
|
|
|
|
Ecore_Wl2_Window *window;
|
|
|
|
} grab;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
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_mod_mask_t win_mask;
|
|
|
|
xkb_mod_mask_t scroll_mask;
|
|
|
|
xkb_mod_mask_t num_mask;
|
|
|
|
xkb_mod_mask_t caps_mask;
|
|
|
|
xkb_mod_mask_t altgr_mask;
|
|
|
|
unsigned int mods_depressed;
|
|
|
|
unsigned int mods_latched;
|
|
|
|
unsigned int mods_locked;
|
|
|
|
unsigned int mods_group;
|
|
|
|
} xkb;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Ecore_Timer *timer;
|
|
|
|
unsigned int sym, key, time;
|
|
|
|
double rate, delay;
|
|
|
|
Eina_Bool enabled : 1;
|
|
|
|
} repeat;
|
2015-09-25 07:30:48 -07:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Dnd_Source *source;
|
|
|
|
} drag, selection;
|
2015-11-22 13:13:36 -08:00
|
|
|
|
|
|
|
unsigned int seat_version;
|
2015-09-10 08:03:23 -07:00
|
|
|
};
|
|
|
|
|
2015-09-10 10:21:02 -07:00
|
|
|
Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface);
|
|
|
|
|
2015-09-10 07:37:40 -07:00
|
|
|
void _ecore_wl2_output_add(Ecore_Wl2_Display *display, unsigned int id);
|
|
|
|
void _ecore_wl2_output_del(Ecore_Wl2_Output *output);
|
|
|
|
|
2015-11-22 13:13:36 -08:00
|
|
|
void _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int version);
|
2015-09-10 08:03:23 -07:00
|
|
|
void _ecore_wl2_input_del(Ecore_Wl2_Input *input);
|
|
|
|
|
2015-09-23 09:13:44 -07:00
|
|
|
void _ecore_wl2_input_ungrab(Ecore_Wl2_Input *input);
|
|
|
|
void _ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button);
|
|
|
|
|
2015-09-29 07:53:58 -07:00
|
|
|
void _ecore_wl2_input_cursor_set(Ecore_Wl2_Input *input, const char *cursor);
|
2015-09-30 09:41:50 -07:00
|
|
|
void _ecore_wl2_input_cursor_update_stop(Ecore_Wl2_Input *input);
|
2015-09-29 07:53:58 -07:00
|
|
|
|
2015-09-25 07:30:48 -07:00
|
|
|
void _ecore_wl2_dnd_add(Ecore_Wl2_Input *input, struct wl_data_offer *offer);
|
|
|
|
void _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct wl_surface *surface, int x, int y, unsigned int timestamp);
|
|
|
|
void _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input);
|
|
|
|
void _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, unsigned int timestamp);
|
|
|
|
void _ecore_wl2_dnd_drop(Ecore_Wl2_Input *input);
|
|
|
|
void _ecore_wl2_dnd_selection(Ecore_Wl2_Input *input, struct wl_data_offer *offer);
|
2015-09-30 10:01:23 -07:00
|
|
|
void _ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source);
|
2015-09-25 07:30:48 -07:00
|
|
|
|
2015-10-01 09:22:32 -07:00
|
|
|
void _ecore_wl2_subsurf_free(Ecore_Wl2_Subsurface *subsurf);
|
|
|
|
|
2015-08-18 06:50:28 -07:00
|
|
|
#endif
|