diff options
author | discomfitor <michael.blumenkrantz@gmail.com> | 2013-10-05 16:26:24 +0100 |
---|---|---|
committer | discomfitor <michael.blumenkrantz@gmail.com> | 2013-10-05 16:26:24 +0100 |
commit | 8f493ab6c5975b5346bbd6ee502e9888e4255b8a (patch) | |
tree | c929dc015f13d2b7bf61c2520330153c25c60400 /src | |
parent | f66eceed10bc7101eda31594a06af82777be53da (diff) |
Revert "ecore/wayland: Add subsurface handling APIs."
This reverts commit 65b960f4a60442edcd66082ccc1828b80a49885c.
Conflicts:
src/lib/ecore_wayland/ecore_wl.c
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile_Ecore_Wayland.am | 1 | ||||
-rw-r--r-- | src/lib/ecore_wayland/Ecore_Wayland.h | 92 | ||||
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl.c | 1 | ||||
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_private.h | 2 | ||||
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_subsurf.c | 191 | ||||
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_window.c | 2 |
6 files changed, 1 insertions, 288 deletions
diff --git a/src/Makefile_Ecore_Wayland.am b/src/Makefile_Ecore_Wayland.am index 41d2a6feed..aaf08f50f0 100644 --- a/src/Makefile_Ecore_Wayland.am +++ b/src/Makefile_Ecore_Wayland.am | |||
@@ -14,7 +14,6 @@ lib/ecore_wayland/ecore_wl_dnd.c \ | |||
14 | lib/ecore_wayland/ecore_wl_input.c \ | 14 | lib/ecore_wayland/ecore_wl_input.c \ |
15 | lib/ecore_wayland/ecore_wl_output.c \ | 15 | lib/ecore_wayland/ecore_wl_output.c \ |
16 | lib/ecore_wayland/ecore_wl_window.c \ | 16 | lib/ecore_wayland/ecore_wl_window.c \ |
17 | lib/ecore_wayland/ecore_wl_subsurf.c \ | ||
18 | lib/ecore_wayland/ecore_wl_private.h | 17 | lib/ecore_wayland/ecore_wl_private.h |
19 | 18 | ||
20 | lib_ecore_wayland_libecore_wayland_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WAYLAND_CFLAGS@ | 19 | lib_ecore_wayland_libecore_wayland_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WAYLAND_CFLAGS@ |
diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 6f50ba1eb5..3588341bcc 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h | |||
@@ -12,6 +12,7 @@ | |||
12 | # include <wayland-client.h> | 12 | # include <wayland-client.h> |
13 | # include <wayland-cursor.h> | 13 | # include <wayland-cursor.h> |
14 | # include <xkbcommon/xkbcommon.h> | 14 | # include <xkbcommon/xkbcommon.h> |
15 | # include <subsurface-client-protocol.h> | ||
15 | 16 | ||
16 | # ifdef EAPI | 17 | # ifdef EAPI |
17 | # undef EAPI | 18 | # undef EAPI |
@@ -35,7 +36,6 @@ typedef struct _Ecore_Wl_Display Ecore_Wl_Display; | |||
35 | typedef struct _Ecore_Wl_Output Ecore_Wl_Output; | 36 | typedef struct _Ecore_Wl_Output Ecore_Wl_Output; |
36 | typedef struct _Ecore_Wl_Input Ecore_Wl_Input; | 37 | typedef struct _Ecore_Wl_Input Ecore_Wl_Input; |
37 | typedef struct _Ecore_Wl_Global Ecore_Wl_Global; /** @since 1.7.6 */ | 38 | typedef struct _Ecore_Wl_Global Ecore_Wl_Global; /** @since 1.7.6 */ |
38 | typedef struct _Ecore_Wl_Subsurf Ecore_Wl_Subsurf; /** @since 1.8 */ | ||
39 | 39 | ||
40 | # ifndef _ECORE_WAYLAND_WINDOW_PREDEF | 40 | # ifndef _ECORE_WAYLAND_WINDOW_PREDEF |
41 | typedef struct _Ecore_Wl_Window Ecore_Wl_Window; | 41 | typedef struct _Ecore_Wl_Window Ecore_Wl_Window; |
@@ -252,8 +252,6 @@ struct _Ecore_Wl_Window | |||
252 | /* FIXME: Ideally we should record the cursor name for this window | 252 | /* FIXME: Ideally we should record the cursor name for this window |
253 | * so we can compare and avoid unnecessary cursor set calls to wayland */ | 253 | * so we can compare and avoid unnecessary cursor set calls to wayland */ |
254 | 254 | ||
255 | Ecore_Wl_Subsurf *subsurfs; | ||
256 | |||
257 | void *data; | 255 | void *data; |
258 | }; | 256 | }; |
259 | 257 | ||
@@ -384,7 +382,6 @@ struct _Ecore_Wl_Event_Interfaces_Bound | |||
384 | * @li @ref Ecore_Wl_Window_Group | 382 | * @li @ref Ecore_Wl_Window_Group |
385 | * @li @ref Ecore_Wl_Input_Group | 383 | * @li @ref Ecore_Wl_Input_Group |
386 | * @li @ref Ecore_Wl_Dnd_Group | 384 | * @li @ref Ecore_Wl_Dnd_Group |
387 | * @li @ref Ecore_Wl_Subsurf | ||
388 | */ | 385 | */ |
389 | 386 | ||
390 | EAPI extern int ECORE_WL_EVENT_MOUSE_IN; | 387 | EAPI extern int ECORE_WL_EVENT_MOUSE_IN; |
@@ -868,93 +865,6 @@ EAPI struct wl_array *ecore_wl_dnd_drag_types_get(Ecore_Wl_Input *input); | |||
868 | 865 | ||
869 | EAPI void ecore_wl_server_mode_set(Eina_Bool on); | 866 | EAPI void ecore_wl_server_mode_set(Eina_Bool on); |
870 | 867 | ||
871 | /** | ||
872 | * @defgroup Ecore_Wl_Subsurf Functions to manipulate subsurfaces. | ||
873 | * @ingroup Ecore_Wl_Group | ||
874 | * | ||
875 | * Functions to manipulate wayland subsurfaces, using Ecore_Wl_Subsurf. | ||
876 | * | ||
877 | * This API is intended to expose Wayland subsurface functionality, although it | ||
878 | * should not be necessary for most applications to use it, as soon as we have | ||
879 | * means to make Evas automatically switch Evas images to use subsurfaces. | ||
880 | * | ||
881 | * It can/should be used, for instance, when subsurfaces are needed to be not | ||
882 | * in sync with the main window surface. | ||
883 | */ | ||
884 | |||
885 | /** | ||
886 | * Create and return a new subsurface. | ||
887 | * | ||
888 | * Create a new surface (and subsurface interface), with the parent surface | ||
889 | * being the one associated with the given @param win. | ||
890 | * | ||
891 | * The @param win must be visible, otherwise there will be no surface created | ||
892 | * for it yet. | ||
893 | * | ||
894 | * @ingroup Ecore_Wl_Subsurf | ||
895 | * @since 1.8 | ||
896 | */ | ||
897 | EAPI Ecore_Wl_Subsurf *ecore_wl_subsurf_create(Ecore_Wl_Window *win); | ||
898 | |||
899 | /** | ||
900 | * Destroy the given subsurface, as well as the surface associated with it. | ||
901 | * | ||
902 | * @ingroup Ecore_Wl_Subsurf | ||
903 | * @since 1.8 | ||
904 | */ | ||
905 | EAPI void ecore_wl_subsurf_del(Ecore_Wl_Subsurf *ess); | ||
906 | |||
907 | /** | ||
908 | * Return the wl_surface associated with this subsurface. | ||
909 | * | ||
910 | * @ingroup Ecore_Wl_Subsurf | ||
911 | * @since 1.8 | ||
912 | */ | ||
913 | EAPI struct wl_surface *ecore_wl_subsurf_surface_get(Ecore_Wl_Subsurf *ess); | ||
914 | |||
915 | /** | ||
916 | * Set the position of this subsurface, relative to its parent surface. | ||
917 | * | ||
918 | * @ingroup Ecore_Wl_Subsurf | ||
919 | * @since 1.8 | ||
920 | */ | ||
921 | EAPI void ecore_wl_subsurf_position_set(Ecore_Wl_Subsurf *ess, int x, int y); | ||
922 | |||
923 | /** | ||
924 | * Get the position of this subsurface, relative to its parent surface. | ||
925 | * | ||
926 | * @ingroup Ecore_Wl_Subsurf | ||
927 | * @since 1.8 | ||
928 | */ | ||
929 | EAPI void ecore_wl_subsurf_position_get(Ecore_Wl_Subsurf *ess, int *x, int *y); | ||
930 | |||
931 | /** | ||
932 | * @ingroup Ecore_Wl_Subsurf | ||
933 | * @since 1.8 | ||
934 | */ | ||
935 | EAPI void ecore_wl_subsurf_place_above(Ecore_Wl_Subsurf *ess, struct wl_surface *surface); | ||
936 | |||
937 | /** | ||
938 | * @ingroup Ecore_Wl_Subsurf | ||
939 | * @since 1.8 | ||
940 | */ | ||
941 | EAPI void ecore_wl_subsurf_place_below(Ecore_Wl_Subsurf *ess, struct wl_surface *surface); | ||
942 | |||
943 | /** | ||
944 | * @ingroup Ecore_Wl_Subsurf | ||
945 | * @since 1.8 | ||
946 | */ | ||
947 | EAPI void ecore_wl_subsurf_sync_set(Ecore_Wl_Subsurf *ess, Eina_Bool val); | ||
948 | |||
949 | /** | ||
950 | * Set an opaque region for the given subsurface. | ||
951 | * | ||
952 | * Use a 0x0 region size to unset the opaque region. | ||
953 | * | ||
954 | * @ingroup Ecore_Wl_Subsurf | ||
955 | * @since 1.8 | ||
956 | */ | ||
957 | EAPI void ecore_wl_subsurf_opaque_region_set(Ecore_Wl_Subsurf *ess, int x, int y, int w, int h); | ||
958 | #ifdef __cplusplus | 868 | #ifdef __cplusplus |
959 | } | 869 | } |
960 | #endif | 870 | #endif |
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c index d2565b8ff1..acce7282fb 100644 --- a/src/lib/ecore_wayland/ecore_wl.c +++ b/src/lib/ecore_wayland/ecore_wl.c | |||
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | #include <fcntl.h> | 5 | #include <fcntl.h> |
6 | #include "ecore_wl_private.h" | 6 | #include "ecore_wl_private.h" |
7 | #include <subsurface-client-protocol.h> | ||
8 | 7 | ||
9 | /* local function prototypes */ | 8 | /* local function prototypes */ |
10 | static Eina_Bool _ecore_wl_shutdown(Eina_Bool close); | 9 | static Eina_Bool _ecore_wl_shutdown(Eina_Bool close); |
diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h index b83aae38eb..dc034af8d8 100644 --- a/src/lib/ecore_wayland/ecore_wl_private.h +++ b/src/lib/ecore_wayland/ecore_wl_private.h | |||
@@ -95,6 +95,4 @@ void _ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source); | |||
95 | void _ecore_wl_events_init(void); | 95 | void _ecore_wl_events_init(void); |
96 | void _ecore_wl_events_shutdown(void); | 96 | void _ecore_wl_events_shutdown(void); |
97 | 97 | ||
98 | void _ecore_wl_subsurfs_del_all(Ecore_Wl_Window *win); | ||
99 | |||
100 | #endif | 98 | #endif |
diff --git a/src/lib/ecore_wayland/ecore_wl_subsurf.c b/src/lib/ecore_wayland/ecore_wl_subsurf.c deleted file mode 100644 index 4e144fa084..0000000000 --- a/src/lib/ecore_wayland/ecore_wl_subsurf.c +++ /dev/null | |||
@@ -1,191 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include "ecore_wl_private.h" | ||
6 | #include <subsurface-client-protocol.h> | ||
7 | |||
8 | struct _Ecore_Wl_Subsurf | ||
9 | { | ||
10 | EINA_INLIST; | ||
11 | Ecore_Wl_Window *parent_win; | ||
12 | struct wl_surface *surface; | ||
13 | struct wl_subsurface *subsurface; | ||
14 | |||
15 | int x, y; | ||
16 | |||
17 | Eina_Bool sync : 1; | ||
18 | }; | ||
19 | |||
20 | EAPI Ecore_Wl_Subsurf * | ||
21 | ecore_wl_subsurf_create(Ecore_Wl_Window *win) | ||
22 | { | ||
23 | struct wl_subsurface *subsurface; | ||
24 | struct wl_surface *surface; | ||
25 | Ecore_Wl_Subsurf *ess; | ||
26 | |||
27 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
28 | |||
29 | if (!win) return NULL; | ||
30 | if (!win->surface) return NULL; | ||
31 | if (!_ecore_wl_disp->wl.subcompositor) return NULL; | ||
32 | |||
33 | surface = wl_compositor_create_surface(_ecore_wl_disp->wl.compositor); | ||
34 | if (!surface) | ||
35 | return NULL; | ||
36 | |||
37 | subsurface = wl_subcompositor_get_subsurface | ||
38 | (_ecore_wl_disp->wl.subcompositor, surface, win->surface); | ||
39 | if (!subsurface) | ||
40 | { | ||
41 | wl_surface_destroy(surface); | ||
42 | return NULL; | ||
43 | } | ||
44 | |||
45 | ess = calloc(1, sizeof(*ess)); | ||
46 | ess->surface = surface; | ||
47 | ess->subsurface = subsurface; | ||
48 | ess->parent_win = win; | ||
49 | |||
50 | win->subsurfs = (Ecore_Wl_Subsurf *)eina_inlist_append | ||
51 | (EINA_INLIST_GET(win->subsurfs), EINA_INLIST_GET(ess)); | ||
52 | |||
53 | return ess; | ||
54 | } | ||
55 | |||
56 | static void | ||
57 | _ecore_wl_subsurf_destroy(Ecore_Wl_Subsurf *ess) | ||
58 | { | ||
59 | Ecore_Wl_Window *parent; | ||
60 | |||
61 | wl_subsurface_destroy(ess->subsurface); | ||
62 | wl_surface_destroy(ess->surface); | ||
63 | |||
64 | parent = ess->parent_win; | ||
65 | parent->subsurfs = (Ecore_Wl_Subsurf *)eina_inlist_remove | ||
66 | (EINA_INLIST_GET(parent->subsurfs), EINA_INLIST_GET(ess)); | ||
67 | |||
68 | free(ess); | ||
69 | } | ||
70 | |||
71 | EAPI void | ||
72 | ecore_wl_subsurf_del(Ecore_Wl_Subsurf *ess) | ||
73 | { | ||
74 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
75 | |||
76 | if (!ess) return; | ||
77 | |||
78 | _ecore_wl_subsurf_destroy(ess); | ||
79 | } | ||
80 | |||
81 | void | ||
82 | _ecore_wl_subsurfs_del_all(Ecore_Wl_Window *win) | ||
83 | { | ||
84 | Ecore_Wl_Subsurf *ess; | ||
85 | |||
86 | if (!win) return; | ||
87 | |||
88 | EINA_INLIST_FREE(win->subsurfs, ess) | ||
89 | { | ||
90 | _ecore_wl_subsurf_destroy(ess); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | EAPI struct wl_surface * | ||
95 | ecore_wl_subsurf_surface_get(Ecore_Wl_Subsurf *ess) | ||
96 | { | ||
97 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
98 | |||
99 | if (!ess) return NULL; | ||
100 | |||
101 | return ess->surface; | ||
102 | } | ||
103 | |||
104 | EAPI void | ||
105 | ecore_wl_subsurf_position_set(Ecore_Wl_Subsurf *ess, int x, int y) | ||
106 | { | ||
107 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
108 | |||
109 | if (!ess) return; | ||
110 | |||
111 | if ((x == ess->x) && (y == ess->y)) | ||
112 | return; | ||
113 | |||
114 | ess->x = x; | ||
115 | ess->y = y; | ||
116 | |||
117 | wl_subsurface_set_position(ess->subsurface, x, y); | ||
118 | } | ||
119 | |||
120 | EAPI void | ||
121 | ecore_wl_subsurf_position_get(Ecore_Wl_Subsurf *ess, int *x, int *y) | ||
122 | { | ||
123 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
124 | |||
125 | if (!ess) return; | ||
126 | |||
127 | if (x) *x = ess->x; | ||
128 | if (y) *y = ess->y; | ||
129 | } | ||
130 | |||
131 | EAPI void | ||
132 | ecore_wl_subsurf_place_above(Ecore_Wl_Subsurf *ess, struct wl_surface *surface) | ||
133 | { | ||
134 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
135 | |||
136 | if (!ess) return; | ||
137 | if (!surface) return; | ||
138 | |||
139 | wl_subsurface_place_above(ess->subsurface, surface); | ||
140 | } | ||
141 | |||
142 | EAPI void | ||
143 | ecore_wl_subsurf_place_below(Ecore_Wl_Subsurf *ess, struct wl_surface *surface) | ||
144 | { | ||
145 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
146 | |||
147 | if (!ess) return; | ||
148 | if (!surface) return; | ||
149 | |||
150 | wl_subsurface_place_below(ess->subsurface, surface); | ||
151 | } | ||
152 | |||
153 | EAPI void | ||
154 | ecore_wl_subsurf_sync_set(Ecore_Wl_Subsurf *ess, Eina_Bool val) | ||
155 | { | ||
156 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
157 | |||
158 | if (!ess) return; | ||
159 | |||
160 | val = !!val; | ||
161 | if (val == ess->sync) return; | ||
162 | |||
163 | ess->sync = val; | ||
164 | |||
165 | if (ess->sync) | ||
166 | wl_subsurface_set_sync(ess->subsurface); | ||
167 | else | ||
168 | wl_subsurface_set_desync(ess->subsurface); | ||
169 | } | ||
170 | |||
171 | EAPI void | ||
172 | ecore_wl_subsurf_opaque_region_set(Ecore_Wl_Subsurf *ess, int x, int y, int w, int h) | ||
173 | { | ||
174 | Ecore_Wl_Window *parent; | ||
175 | struct wl_region *region = NULL; | ||
176 | |||
177 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
178 | |||
179 | if (!ess) return; | ||
180 | |||
181 | if ((w > 0) && (h > 0)) | ||
182 | { | ||
183 | parent = ess->parent_win; | ||
184 | region = wl_compositor_create_region(parent->display->wl.compositor); | ||
185 | wl_region_add(region, x, y, w, h); | ||
186 | wl_surface_set_opaque_region(ess->surface, region); | ||
187 | wl_region_destroy(region); | ||
188 | } | ||
189 | else | ||
190 | wl_surface_set_opaque_region(ess->surface, NULL); | ||
191 | } | ||
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 4ec78c8460..cd5aabe7ad 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c | |||
@@ -114,8 +114,6 @@ ecore_wl_window_free(Ecore_Wl_Window *win) | |||
114 | if (win->anim_callback) wl_callback_destroy(win->anim_callback); | 114 | if (win->anim_callback) wl_callback_destroy(win->anim_callback); |
115 | win->anim_callback = NULL; | 115 | win->anim_callback = NULL; |
116 | 116 | ||
117 | if (win->subsurfs) _ecore_wl_subsurfs_del_all(win); | ||
118 | |||
119 | if (win->shell_surface) wl_shell_surface_destroy(win->shell_surface); | 117 | if (win->shell_surface) wl_shell_surface_destroy(win->shell_surface); |
120 | win->shell_surface = NULL; | 118 | win->shell_surface = NULL; |
121 | if (win->surface) wl_surface_destroy(win->surface); | 119 | if (win->surface) wl_surface_destroy(win->surface); |