diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_composite.c | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_composite.c')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_composite.c | 289 |
1 files changed, 0 insertions, 289 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_composite.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_composite.c deleted file mode 100644 index f247b34..0000000 --- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_composite.c +++ /dev/null | |||
@@ -1,289 +0,0 @@ | |||
1 | #include "ecore_xcb_private.h" | ||
2 | #ifdef ECORE_XCB_COMPOSITE | ||
3 | # include <xcb/composite.h> | ||
4 | #endif | ||
5 | |||
6 | /* local variables */ | ||
7 | static Eina_Bool _composite_avail = EINA_FALSE; | ||
8 | |||
9 | void | ||
10 | _ecore_xcb_composite_init(void) | ||
11 | { | ||
12 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
13 | |||
14 | #ifdef ECORE_XCB_COMPOSITE | ||
15 | xcb_prefetch_extension_data(_ecore_xcb_conn, &xcb_composite_id); | ||
16 | #endif | ||
17 | } | ||
18 | |||
19 | void | ||
20 | _ecore_xcb_composite_finalize(void) | ||
21 | { | ||
22 | #ifdef ECORE_XCB_COMPOSITE | ||
23 | const xcb_query_extension_reply_t *ext_reply; | ||
24 | #endif | ||
25 | |||
26 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
27 | |||
28 | #ifdef ECORE_XCB_COMPOSITE | ||
29 | ext_reply = xcb_get_extension_data(_ecore_xcb_conn, &xcb_composite_id); | ||
30 | if ((ext_reply) && (ext_reply->present)) | ||
31 | { | ||
32 | xcb_composite_query_version_cookie_t cookie; | ||
33 | xcb_composite_query_version_reply_t *reply; | ||
34 | |||
35 | cookie = | ||
36 | xcb_composite_query_version_unchecked(_ecore_xcb_conn, | ||
37 | XCB_COMPOSITE_MAJOR_VERSION, | ||
38 | XCB_COMPOSITE_MINOR_VERSION); | ||
39 | reply = | ||
40 | xcb_composite_query_version_reply(_ecore_xcb_conn, cookie, NULL); | ||
41 | if (reply) | ||
42 | { | ||
43 | // if ((reply->major_version >= XCB_COMPOSITE_MAJOR_VERSION) && | ||
44 | if (reply->minor_version >= XCB_COMPOSITE_MINOR_VERSION) | ||
45 | { | ||
46 | # ifdef ECORE_XCB_RENDER | ||
47 | if (_ecore_xcb_render_avail_get()) | ||
48 | { | ||
49 | # ifdef ECORE_XCB_XFIXES | ||
50 | if (_ecore_xcb_xfixes_avail_get()) | ||
51 | _composite_avail = EINA_TRUE; | ||
52 | # endif | ||
53 | } | ||
54 | # endif | ||
55 | } | ||
56 | |||
57 | free(reply); | ||
58 | } | ||
59 | } | ||
60 | #endif | ||
61 | } | ||
62 | |||
63 | /** | ||
64 | * @defgroup Ecore_X_Composite_Group X Composite Extension Functions | ||
65 | * | ||
66 | * Functions related to the X Composite Extension | ||
67 | */ | ||
68 | |||
69 | /** | ||
70 | * Return whether the Composite Extension is available | ||
71 | * | ||
72 | * @return EINA_TRUE is the Composite Extension is available, EINA_FALSE if not | ||
73 | * | ||
74 | * @ingroup Ecore_X_Composite_Group | ||
75 | */ | ||
76 | EAPI Eina_Bool | ||
77 | ecore_x_composite_query(void) | ||
78 | { | ||
79 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
80 | return _composite_avail; | ||
81 | } | ||
82 | |||
83 | EAPI void | ||
84 | ecore_x_composite_redirect_window(Ecore_X_Window win, | ||
85 | Ecore_X_Composite_Update_Type type) | ||
86 | { | ||
87 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
88 | CHECK_XCB_CONN; | ||
89 | |||
90 | if (!_composite_avail) return; | ||
91 | |||
92 | #ifdef ECORE_XCB_COMPOSITE | ||
93 | uint8_t update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
94 | |||
95 | switch (type) | ||
96 | { | ||
97 | case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: | ||
98 | update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
99 | break; | ||
100 | |||
101 | case ECORE_X_COMPOSITE_UPDATE_MANUAL: | ||
102 | update = XCB_COMPOSITE_REDIRECT_MANUAL; | ||
103 | break; | ||
104 | } | ||
105 | xcb_composite_redirect_window(_ecore_xcb_conn, win, update); | ||
106 | // ecore_x_flush(); | ||
107 | #endif | ||
108 | } | ||
109 | |||
110 | EAPI void | ||
111 | ecore_x_composite_redirect_subwindows(Ecore_X_Window win, | ||
112 | Ecore_X_Composite_Update_Type type) | ||
113 | { | ||
114 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
115 | CHECK_XCB_CONN; | ||
116 | |||
117 | if (!_composite_avail) return; | ||
118 | |||
119 | #ifdef ECORE_XCB_COMPOSITE | ||
120 | uint8_t update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
121 | |||
122 | switch (type) | ||
123 | { | ||
124 | case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: | ||
125 | update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
126 | break; | ||
127 | |||
128 | case ECORE_X_COMPOSITE_UPDATE_MANUAL: | ||
129 | update = XCB_COMPOSITE_REDIRECT_MANUAL; | ||
130 | break; | ||
131 | } | ||
132 | xcb_composite_redirect_subwindows(_ecore_xcb_conn, win, update); | ||
133 | // ecore_x_flush(); | ||
134 | #endif | ||
135 | } | ||
136 | |||
137 | EAPI void | ||
138 | ecore_x_composite_unredirect_window(Ecore_X_Window win, | ||
139 | Ecore_X_Composite_Update_Type type) | ||
140 | { | ||
141 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
142 | CHECK_XCB_CONN; | ||
143 | |||
144 | if (!_composite_avail) return; | ||
145 | |||
146 | #ifdef ECORE_XCB_COMPOSITE | ||
147 | uint8_t update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
148 | |||
149 | switch (type) | ||
150 | { | ||
151 | case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: | ||
152 | update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
153 | break; | ||
154 | |||
155 | case ECORE_X_COMPOSITE_UPDATE_MANUAL: | ||
156 | update = XCB_COMPOSITE_REDIRECT_MANUAL; | ||
157 | break; | ||
158 | } | ||
159 | xcb_composite_unredirect_window(_ecore_xcb_conn, win, update); | ||
160 | // ecore_x_flush(); | ||
161 | #endif | ||
162 | } | ||
163 | |||
164 | EAPI void | ||
165 | ecore_x_composite_unredirect_subwindows(Ecore_X_Window win, | ||
166 | Ecore_X_Composite_Update_Type type) | ||
167 | { | ||
168 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
169 | CHECK_XCB_CONN; | ||
170 | |||
171 | if (!_composite_avail) return; | ||
172 | |||
173 | #ifdef ECORE_XCB_COMPOSITE | ||
174 | uint8_t update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
175 | |||
176 | switch (type) | ||
177 | { | ||
178 | case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC: | ||
179 | update = XCB_COMPOSITE_REDIRECT_AUTOMATIC; | ||
180 | break; | ||
181 | |||
182 | case ECORE_X_COMPOSITE_UPDATE_MANUAL: | ||
183 | update = XCB_COMPOSITE_REDIRECT_MANUAL; | ||
184 | break; | ||
185 | } | ||
186 | xcb_composite_unredirect_subwindows(_ecore_xcb_conn, win, update); | ||
187 | // ecore_x_flush(); | ||
188 | #endif | ||
189 | } | ||
190 | |||
191 | EAPI Ecore_X_Pixmap | ||
192 | ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win) | ||
193 | { | ||
194 | #ifdef ECORE_XCB_COMPOSITE | ||
195 | Ecore_X_Pixmap pmap = XCB_NONE; | ||
196 | #endif | ||
197 | |||
198 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
199 | CHECK_XCB_CONN; | ||
200 | |||
201 | if (!_composite_avail) return XCB_NONE; | ||
202 | |||
203 | #ifdef ECORE_XCB_COMPOSITE | ||
204 | pmap = xcb_generate_id(_ecore_xcb_conn); | ||
205 | xcb_composite_name_window_pixmap(_ecore_xcb_conn, win, pmap); | ||
206 | // ecore_x_flush(); | ||
207 | #endif | ||
208 | |||
209 | return pmap; | ||
210 | } | ||
211 | |||
212 | EAPI void | ||
213 | ecore_x_composite_window_events_disable(Ecore_X_Window win) | ||
214 | { | ||
215 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
216 | CHECK_XCB_CONN; | ||
217 | |||
218 | if (!_composite_avail) return; | ||
219 | |||
220 | #ifdef ECORE_XCB_SHAPE | ||
221 | ecore_x_window_shape_input_rectangle_set(win, -1, -1, 1, 1); | ||
222 | // ecore_x_flush(); | ||
223 | #else | ||
224 | return; | ||
225 | win = 0; | ||
226 | #endif | ||
227 | } | ||
228 | |||
229 | EAPI void | ||
230 | ecore_x_composite_window_events_enable(Ecore_X_Window win) | ||
231 | { | ||
232 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
233 | CHECK_XCB_CONN; | ||
234 | |||
235 | if (!_composite_avail) return; | ||
236 | |||
237 | #ifdef ECORE_XCB_SHAPE | ||
238 | ecore_x_window_shape_input_rectangle_set(win, 0, 0, 65535, 65535); | ||
239 | // ecore_x_flush(); | ||
240 | #else | ||
241 | return; | ||
242 | win = 0; | ||
243 | #endif | ||
244 | } | ||
245 | |||
246 | EAPI Ecore_X_Window | ||
247 | ecore_x_composite_render_window_enable(Ecore_X_Window root) | ||
248 | { | ||
249 | Ecore_X_Window win = 0; | ||
250 | #ifdef ECORE_XCB_COMPOSITE | ||
251 | xcb_composite_get_overlay_window_cookie_t cookie; | ||
252 | xcb_composite_get_overlay_window_reply_t *reply; | ||
253 | #endif | ||
254 | |||
255 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
256 | CHECK_XCB_CONN; | ||
257 | |||
258 | if (!_composite_avail) return 0; | ||
259 | |||
260 | #ifdef ECORE_XCB_COMPOSITE | ||
261 | cookie = xcb_composite_get_overlay_window_unchecked(_ecore_xcb_conn, root); | ||
262 | reply = | ||
263 | xcb_composite_get_overlay_window_reply(_ecore_xcb_conn, cookie, NULL); | ||
264 | if (!reply) return win; | ||
265 | |||
266 | win = reply->overlay_win; | ||
267 | free(reply); | ||
268 | |||
269 | ecore_x_composite_window_events_disable(win); | ||
270 | // ecore_x_flush(); | ||
271 | #endif | ||
272 | |||
273 | return win; | ||
274 | } | ||
275 | |||
276 | EAPI void | ||
277 | ecore_x_composite_render_window_disable(Ecore_X_Window win) | ||
278 | { | ||
279 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
280 | CHECK_XCB_CONN; | ||
281 | |||
282 | if (!_composite_avail) return; | ||
283 | |||
284 | #ifdef ECORE_XCB_COMPOSITE | ||
285 | xcb_composite_release_overlay_window(_ecore_xcb_conn, win); | ||
286 | // ecore_x_flush(); | ||
287 | #endif | ||
288 | } | ||
289 | |||