aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h
blob: fdf63146e2e47b8cfab3a37ac88e9f2d066f1714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef _ECORE_WAYLAND_H_
# define _ECORE_WAYLAND_H_

# include <Eina.h>
# include <wayland-client.h>

# ifdef EAPI
#  undef EAPI
# endif

# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif

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;

typedef struct _Ecore_Wl_Drag_Source Ecore_Wl_Drag_Source;

typedef struct _Ecore_Wl_Event_Drag_Start Ecore_Wl_Event_Drag_Start;
typedef struct _Ecore_Wl_Event_Drag_Stop Ecore_Wl_Event_Drag_Stop;

struct _Ecore_Wl_Event_Mouse_In 
{
   int modifiers;
   int x, y;

   struct 
     {
        int x, y;
     } root;

   unsigned int window;

   unsigned int time;
};

struct _Ecore_Wl_Event_Mouse_Out 
{
   int modifiers;
   int x, y;

   struct 
     {
        int x, y;
     } root;

   unsigned int window;

   unsigned int time;
};

struct _Ecore_Wl_Event_Focus_In 
{
   unsigned int window;
   /* TODO: mode & detail */
   unsigned int time;
};

struct _Ecore_Wl_Event_Focus_Out 
{
   unsigned int window;
   /* TODO: mode & detail */
   unsigned int time;
};

struct _Ecore_Wl_Event_Drag_Start
{
   struct wl_data_device *device;
   struct wl_surface *surface;
   const char *mime_type;
   uint32_t timestamp;
};

struct _Ecore_Wl_Event_Drag_Stop
{

};

/**
 * @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:
 * @li @ref Ecore_Wl_Init_Group
 */

EAPI int ecore_wl_init(const char *name);
EAPI int ecore_wl_shutdown(void);

EAPI struct wl_display *ecore_wl_display_get(void);
EAPI struct wl_shm *ecore_wl_shm_get(void);
EAPI struct wl_compositor *ecore_wl_compositor_get(void);
EAPI struct wl_shell *ecore_wl_shell_get(void);
EAPI struct wl_input_device *ecore_wl_input_device_get(void);
EAPI void ecore_wl_screen_size_get(int *w, int *h);
EAPI unsigned int ecore_wl_format_get(void);
EAPI void ecore_wl_flush(void);
EAPI void ecore_wl_sync(void);
EAPI void ecore_wl_pointer_xy_get(int *x, int *y);

EAPI Ecore_Wl_Drag_Source *ecore_wl_drag_source_create(int hotspot_x, int hotspot_y, int offset_x, int offset_y, const char *mimetype, unsigned int timestamp, void *data);
EAPI void ecore_wl_drag_start(Ecore_Wl_Drag_Source *source, struct wl_surface *surface, struct wl_buffer *buffer);
EAPI void ecore_wl_drag_stop(void);

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_DRAG_START;
EAPI extern int ECORE_WL_EVENT_DRAG_STOP;

#endif