Imported Upstream version 1.7.1
[platform/upstream/ecore.git] / src / lib / ecore_wayland / ecore_wl_private.h
1 #ifndef _ECORE_WAYLAND_PRIVATE_H
2 # define _ECORE_WAYLAND_PRIVATE_H
3
4 # include <limits.h>
5 # include <unistd.h>
6
7 # include "Ecore.h"
8 # include "Ecore_Input.h"
9 # include "Ecore_Wayland.h"
10
11 //# define LOGFNS 1
12
13 # ifdef LOGFNS
14 #  include <stdio.h>
15 #  define LOGFN(fl, ln, fn) printf("-ECORE-WL: %25s: %5i - %s\n", fl, ln, fn);
16 # else
17 #  define LOGFN(fl, ln, fn)
18 # endif
19
20 extern int _ecore_wl_log_dom;
21 extern Ecore_Wl_Display *_ecore_wl_disp;
22
23 # ifdef ECORE_WL_DEFAULT_LOG_COLOR
24 #  undef ECORE_WL_DEFAULT_LOG_COLOR
25 # endif
26 # define ECORE_WL_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
27
28 # ifdef ERR
29 #  undef ERR
30 # endif
31 # define ERR(...) EINA_LOG_DOM_ERR(_ecore_wl_log_dom, __VA_ARGS__)
32
33 # ifdef DBG
34 #  undef DBG
35 # endif
36 # define DBG(...) EINA_LOG_DOM_DBG(_ecore_wl_log_dom, __VA_ARGS__)
37
38 # ifdef INF
39 #  undef INF
40 # endif
41 # define INF(...) EINA_LOG_DOM_INFO(_ecore_wl_log_dom, __VA_ARGS__)
42
43 # ifdef WRN
44 #  undef WRN
45 # endif
46 # define WRN(...) EINA_LOG_DOM_WARN(_ecore_wl_log_dom, __VA_ARGS__)
47
48 # ifdef CRIT
49 #  undef CRIT
50 # endif
51 # define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_wl_log_dom, __VA_ARGS__)
52
53 struct _Ecore_Wl_Dnd
54 {
55    Ecore_Wl_Display *ewd;
56    Ecore_Wl_Input *input;
57
58    /* As provider */
59    struct wl_data_source *data_source;
60    struct wl_array types_offered;
61
62    /* TODO: dnd specific fields */
63 };
64
65 struct _Ecore_Wl_Dnd_Source
66 {
67    struct wl_data_offer *offer;
68    Ecore_Wl_Input *input;
69    struct wl_array types;
70    int refcount;
71    int fd;
72    int x, y;
73
74    /* TODO: task & data_func */
75    void *data;
76 };
77
78 struct _Ecore_Wl_Dnd_Target
79 {
80    Ecore_Wl_Dnd_Source *source;
81 };
82
83 void _ecore_wl_window_init(void);
84 void _ecore_wl_window_shutdown(void);
85
86 void _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id);
87 void _ecore_wl_output_del(Ecore_Wl_Output *output);
88
89 void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id);
90 void _ecore_wl_input_del(Ecore_Wl_Input *input);
91 void _ecore_wl_input_pointer_xy_get(int *x, int *y);
92 void _ecore_wl_input_set_selection(Ecore_Wl_Input *input, struct wl_data_source *source);
93
94 void _ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device, struct wl_data_offer *offer);
95 void _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device __UNUSED__, unsigned int timestamp __UNUSED__, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer);
96 void _ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device __UNUSED__);
97 void _ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device __UNUSED__, unsigned int timestamp __UNUSED__, int x, int y);
98 void _ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device __UNUSED__);
99 void _ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device __UNUSED__, struct wl_data_offer *offer);
100 void _ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source);
101
102 struct wl_data_source *_ecore_wl_create_data_source(Ecore_Wl_Display *ewd);
103 #endif