summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--old/ChangeLog.ecore2
-rw-r--r--old/NEWS.ecore2
-rw-r--r--src/lib/ecore_wayland/ecore_wl.c106
3 files changed, 55 insertions, 55 deletions
diff --git a/old/ChangeLog.ecore b/old/ChangeLog.ecore
index f62b13b72f..db02901e01 100644
--- a/old/ChangeLog.ecore
+++ b/old/ChangeLog.ecore
@@ -998,7 +998,7 @@
998 * Wayland SHM now features a mechanism to synchronize rendering with 998 * Wayland SHM now features a mechanism to synchronize rendering with
999 the compositor, removing tearing effect in animations when using that 999 the compositor, removing tearing effect in animations when using that
1000 engine. 1000 engine.
1001 1001
10022012-10-10 Michal Pakula vel Rutka 10022012-10-10 Michal Pakula vel Rutka
1003 1003
1004 * Fix: Send ECORE_X_EVENT_SELECTION_NOTIFY even if there is no data. 1004 * Fix: Send ECORE_X_EVENT_SELECTION_NOTIFY even if there is no data.
diff --git a/old/NEWS.ecore b/old/NEWS.ecore
index 1747889146..4b78bfe2de 100644
--- a/old/NEWS.ecore
+++ b/old/NEWS.ecore
@@ -45,7 +45,7 @@ Fixes:
45Removal: 45Removal:
46 * 16bpp evas engine support removed (API still there, but inactive). 46 * 16bpp evas engine support removed (API still there, but inactive).
47 * 8bpp evas engine support removed (API still there, but inactive). 47 * 8bpp evas engine support removed (API still there, but inactive).
48 48
49Improvements: 49Improvements:
50 * Use Eina_Thread for Ecore_Thread. 50 * Use Eina_Thread for Ecore_Thread.
51 51
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index 481ba790b6..7f06a1d065 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -14,7 +14,7 @@ static Eina_Bool _ecore_wl_xkb_shutdown(Ecore_Wl_Display *ewd);
14 14
15/* local variables */ 15/* local variables */
16static int _ecore_wl_init_count = 0; 16static int _ecore_wl_init_count = 0;
17static const struct wl_registry_listener _ecore_wl_registry_listener = 17static const struct wl_registry_listener _ecore_wl_registry_listener =
18{ 18{
19 _ecore_wl_cb_handle_global, 19 _ecore_wl_cb_handle_global,
20 NULL // handle_global_remove 20 NULL // handle_global_remove
@@ -41,21 +41,21 @@ EAPI int ECORE_WL_EVENT_INTERFACES_BOUND = 0;
41 41
42/** 42/**
43 * @defgroup Ecore_Wl_Init_Group Wayland Library Init and Shutdown Functions 43 * @defgroup Ecore_Wl_Init_Group Wayland Library Init and Shutdown Functions
44 * 44 *
45 * Functions that start and shutdown the Ecore Wayland Library. 45 * Functions that start and shutdown the Ecore Wayland Library.
46 */ 46 */
47 47
48/** 48/**
49 * Initialize the Wayland display connection to the given display. 49 * Initialize the Wayland display connection to the given display.
50 * 50 *
51 * @param name Display target name. if @c NULL, the default display is 51 * @param name Display target name. if @c NULL, the default display is
52 * assumed. 52 * assumed.
53 * @return The number of times the library has been initialized without being 53 * @return The number of times the library has been initialized without being
54 * shut down. 0 is returned if an error occurs. 54 * shut down. 0 is returned if an error occurs.
55 * 55 *
56 * @ingroup Ecore_Wl_Init_Group 56 * @ingroup Ecore_Wl_Init_Group
57 */ 57 */
58EAPI int 58EAPI int
59ecore_wl_init(const char *name) 59ecore_wl_init(const char *name)
60{ 60{
61 LOGFN(__FILE__, __LINE__, __FUNCTION__); 61 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -64,7 +64,7 @@ ecore_wl_init(const char *name)
64 64
65 if (!eina_init()) return --_ecore_wl_init_count; 65 if (!eina_init()) return --_ecore_wl_init_count;
66 66
67 _ecore_wl_log_dom = 67 _ecore_wl_log_dom =
68 eina_log_domain_register("ecore_wl", ECORE_WL_DEFAULT_LOG_COLOR); 68 eina_log_domain_register("ecore_wl", ECORE_WL_DEFAULT_LOG_COLOR);
69 if (_ecore_wl_log_dom < 0) 69 if (_ecore_wl_log_dom < 0)
70 { 70 {
@@ -136,18 +136,18 @@ ecore_wl_init(const char *name)
136 136
137 _ecore_wl_disp->fd = wl_display_get_fd(_ecore_wl_disp->wl.display); 137 _ecore_wl_disp->fd = wl_display_get_fd(_ecore_wl_disp->wl.display);
138 138
139 _ecore_wl_disp->fd_hdl = 139 _ecore_wl_disp->fd_hdl =
140 ecore_main_fd_handler_add(_ecore_wl_disp->fd, 140 ecore_main_fd_handler_add(_ecore_wl_disp->fd,
141 ECORE_FD_READ | ECORE_FD_WRITE, 141 ECORE_FD_READ | ECORE_FD_WRITE,
142 _ecore_wl_cb_handle_data, _ecore_wl_disp, 142 _ecore_wl_cb_handle_data, _ecore_wl_disp,
143 NULL, NULL); 143 NULL, NULL);
144 144
145 wl_list_init(&_ecore_wl_disp->inputs); 145 wl_list_init(&_ecore_wl_disp->inputs);
146 wl_list_init(&_ecore_wl_disp->outputs); 146 wl_list_init(&_ecore_wl_disp->outputs);
147 147
148 _ecore_wl_disp->wl.registry = 148 _ecore_wl_disp->wl.registry =
149 wl_display_get_registry(_ecore_wl_disp->wl.display); 149 wl_display_get_registry(_ecore_wl_disp->wl.display);
150 wl_registry_add_listener(_ecore_wl_disp->wl.registry, 150 wl_registry_add_listener(_ecore_wl_disp->wl.registry,
151 &_ecore_wl_registry_listener, _ecore_wl_disp); 151 &_ecore_wl_registry_listener, _ecore_wl_disp);
152 152
153 wl_display_dispatch(_ecore_wl_disp->wl.display); 153 wl_display_dispatch(_ecore_wl_disp->wl.display);
@@ -171,16 +171,16 @@ ecore_wl_init(const char *name)
171 171
172/** 172/**
173 * Shuts down the Ecore Wayland Library 173 * Shuts down the Ecore Wayland Library
174 * 174 *
175 * In shutting down the library, the Wayland display connection is terminated 175 * In shutting down the library, the Wayland display connection is terminated
176 * and any event handlers for it are removed. 176 * and any event handlers for it are removed.
177 * 177 *
178 * @return The number of times the library has been initialized without 178 * @return The number of times the library has been initialized without
179 * being shut down. 179 * being shut down.
180 * 180 *
181 * @ingroup Ecore_Wl_Init_Group 181 * @ingroup Ecore_Wl_Init_Group
182 */ 182 */
183EAPI int 183EAPI int
184ecore_wl_shutdown(void) 184ecore_wl_shutdown(void)
185{ 185{
186 LOGFN(__FILE__, __LINE__, __FUNCTION__); 186 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -190,18 +190,18 @@ ecore_wl_shutdown(void)
190 190
191/** 191/**
192 * @defgroup Ecore_Wl_Flush_Group Wayland Synchronization Functions 192 * @defgroup Ecore_Wl_Flush_Group Wayland Synchronization Functions
193 * 193 *
194 * Functions that ensure that all commands which have been issued by the 194 * Functions that ensure that all commands which have been issued by the
195 * Ecore Wayland library have been sent to the server. 195 * Ecore Wayland library have been sent to the server.
196 */ 196 */
197 197
198/** 198/**
199 * Sends all Wayland commands to the Wayland Display. 199 * Sends all Wayland commands to the Wayland Display.
200 * 200 *
201 * @ingroup Ecore_Wl_Flush_Group 201 * @ingroup Ecore_Wl_Flush_Group
202 * @since 1.2 202 * @since 1.2
203 */ 203 */
204EAPI void 204EAPI void
205ecore_wl_flush(void) 205ecore_wl_flush(void)
206{ 206{
207// LOGFN(__FILE__, __LINE__, __FUNCTION__); 207// LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -210,13 +210,13 @@ ecore_wl_flush(void)
210} 210}
211 211
212/** 212/**
213 * Flushes the command buffer and waits until all requests have been 213 * Flushes the command buffer and waits until all requests have been
214 * processed by the server. 214 * processed by the server.
215 * 215 *
216 * @ingroup Ecore_Wl_Flush_Group 216 * @ingroup Ecore_Wl_Flush_Group
217 * @since 1.2 217 * @since 1.2
218 */ 218 */
219EAPI void 219EAPI void
220ecore_wl_sync(void) 220ecore_wl_sync(void)
221{ 221{
222// LOGFN(__FILE__, __LINE__, __FUNCTION__); 222// LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -226,15 +226,15 @@ ecore_wl_sync(void)
226 226
227/** 227/**
228 * @defgroup Ecore_Wl_Display_Group Wayland Display Functions 228 * @defgroup Ecore_Wl_Display_Group Wayland Display Functions
229 * 229 *
230 * Functions that set and retrieve various information about the Wayland Display. 230 * Functions that set and retrieve various information about the Wayland Display.
231 */ 231 */
232 232
233/** 233/**
234 * Retrieves the Wayland Shm Interface used for the current Wayland connection. 234 * Retrieves the Wayland Shm Interface used for the current Wayland connection.
235 * 235 *
236 * @return The current wayland shm interface 236 * @return The current wayland shm interface
237 * 237 *
238 * @ingroup Ecore_Wl_Display_Group 238 * @ingroup Ecore_Wl_Display_Group
239 * @since 1.2 239 * @since 1.2
240 */ 240 */
@@ -246,9 +246,9 @@ ecore_wl_shm_get(void)
246 246
247/** 247/**
248 * Retrieves the Wayland Display Interface used for the current Wayland connection. 248 * Retrieves the Wayland Display Interface used for the current Wayland connection.
249 * 249 *
250 * @return The current wayland display interface 250 * @return The current wayland display interface
251 * 251 *
252 * @ingroup Ecore_Wl_Display_Group 252 * @ingroup Ecore_Wl_Display_Group
253 * @since 1.2 253 * @since 1.2
254 */ 254 */
@@ -260,14 +260,14 @@ ecore_wl_display_get(void)
260 260
261/** 261/**
262 * Retrieves the size of the current screen. 262 * Retrieves the size of the current screen.
263 * 263 *
264 * @param w where to return the width. May be NULL. Returns 0 on error. 264 * @param w where to return the width. May be NULL. Returns 0 on error.
265 * @param h where to return the height. May be NULL. Returns 0 on error. 265 * @param h where to return the height. May be NULL. Returns 0 on error.
266 * 266 *
267 * @ingroup Ecore_Wl_Display_Group 267 * @ingroup Ecore_Wl_Display_Group
268 * @since 1.2 268 * @since 1.2
269 */ 269 */
270EAPI void 270EAPI void
271ecore_wl_screen_size_get(int *w, int *h) 271ecore_wl_screen_size_get(int *w, int *h)
272{ 272{
273 LOGFN(__FILE__, __LINE__, __FUNCTION__); 273 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -282,7 +282,7 @@ ecore_wl_screen_size_get(int *w, int *h)
282} 282}
283 283
284/* @since 1.2 */ 284/* @since 1.2 */
285EAPI void 285EAPI void
286ecore_wl_pointer_xy_get(int *x, int *y) 286ecore_wl_pointer_xy_get(int *x, int *y)
287{ 287{
288 LOGFN(__FILE__, __LINE__, __FUNCTION__); 288 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -298,10 +298,10 @@ ecore_wl_pointer_xy_get(int *x, int *y)
298 * xrandr where different parts of the screen may have different DPI etc. 298 * xrandr where different parts of the screen may have different DPI etc.
299 * 299 *
300 * @return the general screen DPI (dots/pixels per inch). 300 * @return the general screen DPI (dots/pixels per inch).
301 * 301 *
302 * @since 1.2 302 * @since 1.2
303 */ 303 */
304EAPI int 304EAPI int
305ecore_wl_dpi_get(void) 305ecore_wl_dpi_get(void)
306{ 306{
307 int w, mw; 307 int w, mw;
@@ -314,12 +314,12 @@ ecore_wl_dpi_get(void)
314 if (mw <= 0) return 75; 314 if (mw <= 0) return 75;
315 315
316 w = _ecore_wl_disp->output->allocation.w; 316 w = _ecore_wl_disp->output->allocation.w;
317 /* FIXME: NB: Hrrrmmm, need to verify this. xorg code is using a different 317 /* FIXME: NB: Hrrrmmm, need to verify this. xorg code is using a different
318 * formula to calc this */ 318 * formula to calc this */
319 return (((w * 254) / mw) + 5) / 10; 319 return (((w * 254) / mw) + 5) / 10;
320} 320}
321 321
322EAPI void 322EAPI void
323ecore_wl_display_iterate(void) 323ecore_wl_display_iterate(void)
324{ 324{
325 wl_display_dispatch(_ecore_wl_disp->wl.display); 325 wl_display_dispatch(_ecore_wl_disp->wl.display);
@@ -327,7 +327,7 @@ ecore_wl_display_iterate(void)
327 327
328/** 328/**
329 * Retrieves the requested cursor from the cursor theme 329 * Retrieves the requested cursor from the cursor theme
330 * 330 *
331 * @param cursor_name The desired cursor name to be looked up in the theme 331 * @param cursor_name The desired cursor name to be looked up in the theme
332 * @return the cursor or NULL if the cursor cannot be found 332 * @return the cursor or NULL if the cursor cannot be found
333 * 333 *
@@ -336,7 +336,7 @@ ecore_wl_display_iterate(void)
336EAPI struct wl_cursor * 336EAPI struct wl_cursor *
337ecore_wl_cursor_get(const char *cursor_name) 337ecore_wl_cursor_get(const char *cursor_name)
338{ 338{
339 if ((!_ecore_wl_disp) || (!_ecore_wl_disp->cursor_theme)) 339 if ((!_ecore_wl_disp) || (!_ecore_wl_disp->cursor_theme))
340 return NULL; 340 return NULL;
341 341
342 return wl_cursor_theme_get_cursor(_ecore_wl_disp->cursor_theme, 342 return wl_cursor_theme_get_cursor(_ecore_wl_disp->cursor_theme,
@@ -344,7 +344,7 @@ ecore_wl_cursor_get(const char *cursor_name)
344} 344}
345 345
346/* local functions */ 346/* local functions */
347static Eina_Bool 347static Eina_Bool
348_ecore_wl_shutdown(Eina_Bool close) 348_ecore_wl_shutdown(Eina_Bool close)
349{ 349{
350 LOGFN(__FILE__, __LINE__, __FUNCTION__); 350 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -354,10 +354,10 @@ _ecore_wl_shutdown(Eina_Bool close)
354 354
355 _ecore_wl_window_shutdown(); 355 _ecore_wl_window_shutdown();
356 356
357 if (_ecore_wl_disp->fd_hdl) 357 if (_ecore_wl_disp->fd_hdl)
358 ecore_main_fd_handler_del(_ecore_wl_disp->fd_hdl); 358 ecore_main_fd_handler_del(_ecore_wl_disp->fd_hdl);
359 359
360 if (close) 360 if (close)
361 { 361 {
362 Ecore_Wl_Output *out, *tout; 362 Ecore_Wl_Output *out, *tout;
363 Ecore_Wl_Input *in, *tin; 363 Ecore_Wl_Input *in, *tin;
@@ -370,7 +370,7 @@ _ecore_wl_shutdown(Eina_Bool close)
370 370
371 _ecore_wl_xkb_shutdown(_ecore_wl_disp); 371 _ecore_wl_xkb_shutdown(_ecore_wl_disp);
372 372
373 if (_ecore_wl_disp->wl.shell) 373 if (_ecore_wl_disp->wl.shell)
374 wl_shell_destroy(_ecore_wl_disp->wl.shell); 374 wl_shell_destroy(_ecore_wl_disp->wl.shell);
375 if (_ecore_wl_disp->wl.shm) wl_shm_destroy(_ecore_wl_disp->wl.shm); 375 if (_ecore_wl_disp->wl.shm) wl_shm_destroy(_ecore_wl_disp->wl.shm);
376 if (_ecore_wl_disp->wl.data_device_manager) 376 if (_ecore_wl_disp->wl.data_device_manager)
@@ -396,7 +396,7 @@ _ecore_wl_shutdown(Eina_Bool close)
396 return _ecore_wl_init_count; 396 return _ecore_wl_init_count;
397} 397}
398 398
399static Eina_Bool 399static Eina_Bool
400_ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl) 400_ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl)
401{ 401{
402 Ecore_Wl_Display *ewd; 402 Ecore_Wl_Display *ewd;
@@ -417,7 +417,7 @@ _ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl)
417 return ECORE_CALLBACK_RENEW; 417 return ECORE_CALLBACK_RENEW;
418} 418}
419 419
420static void 420static void
421_ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version EINA_UNUSED) 421_ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version EINA_UNUSED)
422{ 422{
423 Ecore_Wl_Display *ewd; 423 Ecore_Wl_Display *ewd;
@@ -428,7 +428,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
428 428
429 if (!strcmp(interface, "wl_compositor")) 429 if (!strcmp(interface, "wl_compositor"))
430 { 430 {
431 ewd->wl.compositor = 431 ewd->wl.compositor =
432 wl_registry_bind(registry, id, &wl_compositor_interface, 1); 432 wl_registry_bind(registry, id, &wl_compositor_interface, 1);
433 } 433 }
434 else if (!strcmp(interface, "wl_output")) 434 else if (!strcmp(interface, "wl_output"))
@@ -437,20 +437,20 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
437 _ecore_wl_input_add(ewd, id); 437 _ecore_wl_input_add(ewd, id);
438 else if (!strcmp(interface, "wl_shell")) 438 else if (!strcmp(interface, "wl_shell"))
439 { 439 {
440 ewd->wl.shell = 440 ewd->wl.shell =
441 wl_registry_bind(registry, id, &wl_shell_interface, 1); 441 wl_registry_bind(registry, id, &wl_shell_interface, 1);
442 } 442 }
443 else if (!strcmp(interface, "wl_shm")) 443 else if (!strcmp(interface, "wl_shm"))
444 { 444 {
445 ewd->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); 445 ewd->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
446 446
447 /* FIXME: We should not hard-code a cursor size here, and we should 447 /* FIXME: We should not hard-code a cursor size here, and we should
448 * also import the theme name from a config or env variable */ 448 * also import the theme name from a config or env variable */
449 ewd->cursor_theme = wl_cursor_theme_load(NULL, 32, ewd->wl.shm); 449 ewd->cursor_theme = wl_cursor_theme_load(NULL, 32, ewd->wl.shm);
450 } 450 }
451 else if (!strcmp(interface, "wl_data_device_manager")) 451 else if (!strcmp(interface, "wl_data_device_manager"))
452 { 452 {
453 ewd->wl.data_device_manager = 453 ewd->wl.data_device_manager =
454 wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1); 454 wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1);
455 } 455 }
456 456
@@ -469,7 +469,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
469 } 469 }
470} 470}
471 471
472static Eina_Bool 472static Eina_Bool
473_ecore_wl_xkb_init(Ecore_Wl_Display *ewd) 473_ecore_wl_xkb_init(Ecore_Wl_Display *ewd)
474{ 474{
475 LOGFN(__FILE__, __LINE__, __FUNCTION__); 475 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -480,7 +480,7 @@ _ecore_wl_xkb_init(Ecore_Wl_Display *ewd)
480 return EINA_TRUE; 480 return EINA_TRUE;
481} 481}
482 482
483static Eina_Bool 483static Eina_Bool
484_ecore_wl_xkb_shutdown(Ecore_Wl_Display *ewd) 484_ecore_wl_xkb_shutdown(Ecore_Wl_Display *ewd)
485{ 485{
486 LOGFN(__FILE__, __LINE__, __FUNCTION__); 486 LOGFN(__FILE__, __LINE__, __FUNCTION__);