diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/ecore/src/lib/ecore_evas | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to '')
18 files changed, 1626 insertions, 1225 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h b/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h index 8d9abc4..a78824e 100644 --- a/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h +++ b/libraries/ecore/src/lib/ecore_evas/Ecore_Evas.h | |||
@@ -39,6 +39,9 @@ | |||
39 | * @li @ref ecore_evas_callbacks_example_c | 39 | * @li @ref ecore_evas_callbacks_example_c |
40 | * @li @ref ecore_evas_object_example_c | 40 | * @li @ref ecore_evas_object_example_c |
41 | * @li @ref ecore_evas_basics_example_c | 41 | * @li @ref ecore_evas_basics_example_c |
42 | * @li @ref Ecore_Evas_Window_Sizes_Example_c | ||
43 | * @li @ref Ecore_Evas_Buffer_Example_01_c | ||
44 | * @li @ref Ecore_Evas_Buffer_Example_02_c | ||
42 | */ | 45 | */ |
43 | 46 | ||
44 | /* FIXME: | 47 | /* FIXME: |
@@ -60,10 +63,26 @@ extern "C" { | |||
60 | /** | 63 | /** |
61 | * @defgroup Ecore_Evas_Group Ecore_Evas wrapper/helper set of functions | 64 | * @defgroup Ecore_Evas_Group Ecore_Evas wrapper/helper set of functions |
62 | * | 65 | * |
66 | * Ecore evas is a set of functions that makes it easy to tie together ecore's | ||
67 | * main loop and input handling to evas. As such it's a natural base for EFL | ||
68 | * applications. While this combination makes it easy to create the basic | ||
69 | * aspects all applications need, for normal applications(ones with buttons, | ||
70 | * checkboxes and layouts) one should consider using Elementary. | ||
71 | * | ||
72 | * Ecore evas is extremely well suited for applications that are not based on | ||
73 | * widgets. It has a main loop that delivers events, does basic window handling | ||
74 | * and leaves all of the drawing up to the user. This works very well if used | ||
75 | * in conjunction with Edje or if doing custom drawing as, for example, is done | ||
76 | * in games. | ||
77 | * | ||
63 | * This is a list of examples of these functions: | 78 | * This is a list of examples of these functions: |
64 | * - @ref Ecore_Evas_Window_Sizes_Example_c | 79 | * @li @ref ecore_evas_basics_example_c |
65 | * - @ref Ecore_Evas_Buffer_Example_01_c | 80 | * @li @ref ecore_evas_object_example_c |
66 | * - @ref Ecore_Evas_Buffer_Example_02_c | 81 | * @li @ref ecore_evas_callbacks_example_c |
82 | * @li @ref Ecore_Evas_Window_Sizes_Example_c | ||
83 | * @li @ref Ecore_Evas_Buffer_Example_01_c | ||
84 | * @li @ref Ecore_Evas_Buffer_Example_02_c | ||
85 | * | ||
67 | * @{ | 86 | * @{ |
68 | */ | 87 | */ |
69 | 88 | ||
@@ -151,6 +170,12 @@ typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window; | |||
151 | #ifndef _ECORE_EVAS_PRIVATE_H | 170 | #ifndef _ECORE_EVAS_PRIVATE_H |
152 | /* basic data types */ | 171 | /* basic data types */ |
153 | typedef struct _Ecore_Evas Ecore_Evas; | 172 | typedef struct _Ecore_Evas Ecore_Evas; |
173 | typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */ | ||
174 | #endif | ||
175 | |||
176 | #ifndef _ECORE_WAYLAND_H_ | ||
177 | #define _ECORE_WAYLAND_WINDOW_PREDEF | ||
178 | typedef struct _Ecore_Wl_Window Ecore_Wl_Window; | ||
154 | #endif | 179 | #endif |
155 | 180 | ||
156 | /* module setup/shutdown calls */ | 181 | /* module setup/shutdown calls */ |
@@ -222,7 +247,7 @@ EAPI Ecore_Evas *ecore_evas_new(const char *engine_name, int x, int y, int w, in | |||
222 | * This function allows you to make an Ecore_Evas translucent using an | 247 | * This function allows you to make an Ecore_Evas translucent using an |
223 | * alpha channel. See ecore_evas_shaped_set() for details. The difference | 248 | * alpha channel. See ecore_evas_shaped_set() for details. The difference |
224 | * between a shaped window and a window with an alpha channel is that an | 249 | * between a shaped window and a window with an alpha channel is that an |
225 | * alpha channel supports multiple levels of transpararency, as opposed to | 250 | * alpha channel supports multiple levels of transparency, as opposed to |
226 | * the 1 bit transparency of a shaped window (a pixel is either opaque, or | 251 | * the 1 bit transparency of a shaped window (a pixel is either opaque, or |
227 | * it's transparent). | 252 | * it's transparent). |
228 | * | 253 | * |
@@ -300,7 +325,7 @@ EAPI void ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, i | |||
300 | * This function takes four pointers to (already allocated) ints, and places | 325 | * This function takes four pointers to (already allocated) ints, and places |
301 | * the geometry which @p ee was latest recently requested . If any of the parameters is not desired you | 326 | * the geometry which @p ee was latest recently requested . If any of the parameters is not desired you |
302 | * may pass NULL on them. | 327 | * may pass NULL on them. |
303 | * This function can represent recently requested geomety. | 328 | * This function can represent recently requested geometry. |
304 | * ecore_evas_geometry_get function returns the value is updated after engine finished request. | 329 | * ecore_evas_geometry_get function returns the value is updated after engine finished request. |
305 | * By comparison, ecore_evas_request_geometry_get returns recently requested value. | 330 | * By comparison, ecore_evas_request_geometry_get returns recently requested value. |
306 | * | 331 | * |
@@ -342,7 +367,7 @@ EAPI Eina_Bool ecore_evas_focus_get(const Ecore_Evas *ee); | |||
342 | * This function iconifies @p ee if @p on is EINA_TRUE, or uniconifies @p ee if | 367 | * This function iconifies @p ee if @p on is EINA_TRUE, or uniconifies @p ee if |
343 | * @p on is EINA_FALSE. | 368 | * @p on is EINA_FALSE. |
344 | * | 369 | * |
345 | * @note Iconify and minize are synonims. | 370 | * @note Iconify and minimize are synonyms. |
346 | * | 371 | * |
347 | * @warning Support for this depends on the underlying windowing system. | 372 | * @warning Support for this depends on the underlying windowing system. |
348 | */ | 373 | */ |
@@ -353,7 +378,7 @@ EAPI void ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on); | |||
353 | * @param ee The Ecore_Evas to set | 378 | * @param ee The Ecore_Evas to set |
354 | * @return EINA_TRUE if @p ee is iconified, EINA_FALSE if not. | 379 | * @return EINA_TRUE if @p ee is iconified, EINA_FALSE if not. |
355 | * | 380 | * |
356 | * @note Iconify and minize are synonims. | 381 | * @note Iconify and minimize are synonyms. |
357 | * | 382 | * |
358 | * @see ecore_evas_iconified_set() | 383 | * @see ecore_evas_iconified_set() |
359 | */ | 384 | */ |
@@ -401,6 +426,161 @@ EAPI void ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on); | |||
401 | */ | 426 | */ |
402 | EAPI Eina_Bool ecore_evas_fullscreen_get(const Ecore_Evas *ee); | 427 | EAPI Eina_Bool ecore_evas_fullscreen_get(const Ecore_Evas *ee); |
403 | /** | 428 | /** |
429 | * @brief Set another window that this window is a group member of | ||
430 | * | ||
431 | * @param ee The Ecore_Evas | ||
432 | * @param ee_group The other group member | ||
433 | * | ||
434 | * If @p ee_group is NULL, @p ee is removed from the group, otherwise it is | ||
435 | * added. Note that if you free the @p ee_group canvas before @p ee, then | ||
436 | * getting the group canvas with ecore_evas_window_group_get() will return | ||
437 | * an invalid handle. | ||
438 | * | ||
439 | * @warning Support for this depends on the underlying windowing system. | ||
440 | * @since 1.2 | ||
441 | */ | ||
442 | EAPI void ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group); | ||
443 | /** | ||
444 | * @brief Get the canvas group set. | ||
445 | * | ||
446 | * This returns the handle set by ecore_evas_window_group_set(). | ||
447 | * | ||
448 | * @param ee The Ecore_Evas to set | ||
449 | * @return The Canvas group handle | ||
450 | * | ||
451 | * @see ecore_evas_window_group_set() | ||
452 | * @since 1.2 | ||
453 | */ | ||
454 | EAPI const Ecore_Evas *ecore_evas_window_group_get(const Ecore_Evas *ee); | ||
455 | /** | ||
456 | * @brief Set the aspect ratio of a canvas window | ||
457 | * | ||
458 | * @param ee The Ecore_Evas | ||
459 | * @param aspect The aspect ratio (width divided by height), or 0 to disable | ||
460 | * | ||
461 | * This sets the desired aspect ratio of a canvas window | ||
462 | * | ||
463 | * @warning Support for this depends on the underlying windowing system. | ||
464 | * @since 1.2 | ||
465 | */ | ||
466 | EAPI void ecore_evas_aspect_set(Ecore_Evas *ee, double aspect); | ||
467 | /** | ||
468 | * @brief Get the aspect ratio of a canvas window | ||
469 | * | ||
470 | * This returns the value set by ecore_evas_aspect_set(). | ||
471 | * | ||
472 | * @param ee The Ecore_Evas to set | ||
473 | * @return The aspect ratio | ||
474 | * | ||
475 | * @see ecore_evas_aspect_set() | ||
476 | * @since 1.2 | ||
477 | */ | ||
478 | EAPI double ecore_evas_aspect_get(const Ecore_Evas *ee); | ||
479 | /** | ||
480 | * @brief Set The urgent hint flag | ||
481 | * | ||
482 | * @param ee The Ecore_Evas | ||
483 | * @param urgent The urgent state flag | ||
484 | * | ||
485 | * This sets the "urgent" state hint on a window so the desktop environment | ||
486 | * can highlight it somehow. | ||
487 | * | ||
488 | * @warning Support for this depends on the underlying windowing system. | ||
489 | * @since 1.2 | ||
490 | */ | ||
491 | EAPI void ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent); | ||
492 | /** | ||
493 | * @brief Get the urgent state on the cavas window | ||
494 | * | ||
495 | * This returns the value set by ecore_evas_urgent_set() | ||
496 | * | ||
497 | * @param ee The Ecore_Evas to set | ||
498 | * @return The urgent state set | ||
499 | * | ||
500 | * @see ecore_evas_urgent_set() | ||
501 | * @since 1.2 | ||
502 | */ | ||
503 | EAPI Eina_Bool ecore_evas_urgent_get(const Ecore_Evas *ee); | ||
504 | /** | ||
505 | * @brief Set the modal state flag on the canvas window | ||
506 | * | ||
507 | * @param ee The Ecore_Evas | ||
508 | * @param modal The modal hint flag | ||
509 | * | ||
510 | * This hints if the window should be modal (eg if it is also transient | ||
511 | * for another window, the other window will maybe be denied focus by | ||
512 | * the desktop window manager). | ||
513 | * | ||
514 | * @warning Support for this depends on the underlying windowing system. | ||
515 | * @since 1.2 | ||
516 | */ | ||
517 | EAPI void ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal); | ||
518 | /** | ||
519 | * @brief Get The modal flag | ||
520 | * | ||
521 | * This returns the value set by ecore_evas_modal_set(). | ||
522 | * | ||
523 | * @param ee The Ecore_Evas to set | ||
524 | * @return The modal flag | ||
525 | * | ||
526 | * @see ecore_evas_modal_set() | ||
527 | * @since 1.2 | ||
528 | */ | ||
529 | EAPI Eina_Bool ecore_evas_modal_get(const Ecore_Evas *ee); | ||
530 | /** | ||
531 | * @brief Set the "i demand attention" flag on a canvas window | ||
532 | * | ||
533 | * @param ee The Ecore_Evas | ||
534 | * @param demand_attention The flag state to set | ||
535 | * | ||
536 | * A window may demand attention now (eg you must enter a password before | ||
537 | * continuing), and so it may flag a window with this. | ||
538 | * | ||
539 | * @warning Support for this depends on the underlying windowing system. | ||
540 | * @since 1.2 | ||
541 | */ | ||
542 | EAPI void ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand); | ||
543 | /** | ||
544 | * @brief Get the "i demand attention" flag | ||
545 | * | ||
546 | * This returns the value set by ecore_evas_demand_attention_set(). | ||
547 | * | ||
548 | * @param ee The Ecore_Evas to set | ||
549 | * @return The "i demand attention" flag. | ||
550 | * | ||
551 | * @see ecore_evas_demand_attention_set() | ||
552 | * @since 1.2 | ||
553 | */ | ||
554 | EAPI Eina_Bool ecore_evas_demand_attention_get(const Ecore_Evas *ee); | ||
555 | /** | ||
556 | * @brief Set the "focus skip" flag | ||
557 | * | ||
558 | * @param ee The Ecore_Evas | ||
559 | * @param skip The "focus skip" state to set. | ||
560 | * | ||
561 | * A window may not want to accept focus, be in the taskbar, pager etc. | ||
562 | * sometimes (example for a small notification window that hovers around | ||
563 | * a taskbar or panel, or hovers around a window until some activity | ||
564 | * dismisses it). | ||
565 | * | ||
566 | * @warning Support for this depends on the underlying windowing system. | ||
567 | * @since 1.2 | ||
568 | */ | ||
569 | EAPI void ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip); | ||
570 | /** | ||
571 | * @brief Get the "focus skip" flag | ||
572 | * | ||
573 | * This returns the value set by ecore_evas_focus_skip_set(). | ||
574 | * | ||
575 | * @param ee The Ecore_Evas to set | ||
576 | * @return The "focus skip" flag. | ||
577 | * | ||
578 | * @see ecore_evas_focus_skip_set() | ||
579 | * @since 1.2 | ||
580 | */ | ||
581 | EAPI Eina_Bool ecore_evas_focus_skip_get(const Ecore_Evas *ee); | ||
582 | |||
583 | /** | ||
404 | * @brief Set if this evas should ignore @b all events. | 584 | * @brief Set if this evas should ignore @b all events. |
405 | * | 585 | * |
406 | * @param ee The Ecore_Evas whose window's to ignore events. | 586 | * @param ee The Ecore_Evas whose window's to ignore events. |
@@ -693,10 +873,13 @@ EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int | |||
693 | EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h); | 873 | EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h); |
694 | EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee); | 874 | EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee); |
695 | 875 | ||
696 | EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame); | 876 | |
697 | EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame); | 877 | EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame); |
878 | EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame); | ||
698 | EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location); | 879 | EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location); |
699 | EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); | 880 | /* EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); */ |
881 | /* EAPI void ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y); */ | ||
882 | /* EAPI void ecore_evas_wayland_type_set(Ecore_Evas *ee, int type); */ | ||
700 | 883 | ||
701 | /** | 884 | /** |
702 | * @brief Create a new @c Ecore_Evas canvas bound to the Evas | 885 | * @brief Create a new @c Ecore_Evas canvas bound to the Evas |
@@ -1038,7 +1221,7 @@ EAPI void ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void | |||
1038 | * @warning If and when this function is called depends on the underlying | 1221 | * @warning If and when this function is called depends on the underlying |
1039 | * windowing system. | 1222 | * windowing system. |
1040 | */ | 1223 | */ |
1041 | EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1224 | EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1042 | /** | 1225 | /** |
1043 | * Set a callback for Ecore_Evas move events. | 1226 | * Set a callback for Ecore_Evas move events. |
1044 | * @param ee The Ecore_Evas to set callbacks on | 1227 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1050,7 +1233,7 @@ EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ec | |||
1050 | * @warning If and when this function is called depends on the underlying | 1233 | * @warning If and when this function is called depends on the underlying |
1051 | * windowing system. | 1234 | * windowing system. |
1052 | */ | 1235 | */ |
1053 | EAPI void ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1236 | EAPI void ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1054 | /** | 1237 | /** |
1055 | * Set a callback for Ecore_Evas show events. | 1238 | * Set a callback for Ecore_Evas show events. |
1056 | * @param ee The Ecore_Evas to set callbacks on | 1239 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1062,7 +1245,7 @@ EAPI void ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecor | |||
1062 | * @warning If and when this function is called depends on the underlying | 1245 | * @warning If and when this function is called depends on the underlying |
1063 | * windowing system. | 1246 | * windowing system. |
1064 | */ | 1247 | */ |
1065 | EAPI void ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1248 | EAPI void ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1066 | /** | 1249 | /** |
1067 | * Set a callback for Ecore_Evas hide events. | 1250 | * Set a callback for Ecore_Evas hide events. |
1068 | * @param ee The Ecore_Evas to set callbacks on | 1251 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1074,7 +1257,7 @@ EAPI void ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecor | |||
1074 | * @warning If and when this function is called depends on the underlying | 1257 | * @warning If and when this function is called depends on the underlying |
1075 | * windowing system. | 1258 | * windowing system. |
1076 | */ | 1259 | */ |
1077 | EAPI void ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1260 | EAPI void ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1078 | /** | 1261 | /** |
1079 | * Set a callback for Ecore_Evas delete request events. | 1262 | * Set a callback for Ecore_Evas delete request events. |
1080 | * @param ee The Ecore_Evas to set callbacks on | 1263 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1086,7 +1269,7 @@ EAPI void ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecor | |||
1086 | * @warning If and when this function is called depends on the underlying | 1269 | * @warning If and when this function is called depends on the underlying |
1087 | * windowing system. | 1270 | * windowing system. |
1088 | */ | 1271 | */ |
1089 | EAPI void ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1272 | EAPI void ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1090 | /** | 1273 | /** |
1091 | * Set a callback for Ecore_Evas destroy events. | 1274 | * Set a callback for Ecore_Evas destroy events. |
1092 | * @param ee The Ecore_Evas to set callbacks on | 1275 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1098,7 +1281,7 @@ EAPI void ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*f | |||
1098 | * @warning If and when this function is called depends on the underlying | 1281 | * @warning If and when this function is called depends on the underlying |
1099 | * windowing system. | 1282 | * windowing system. |
1100 | */ | 1283 | */ |
1101 | EAPI void ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1284 | EAPI void ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1102 | /** | 1285 | /** |
1103 | * Set a callback for Ecore_Evas focus in events. | 1286 | * Set a callback for Ecore_Evas focus in events. |
1104 | * @param ee The Ecore_Evas to set callbacks on | 1287 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1110,7 +1293,7 @@ EAPI void ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (E | |||
1110 | * @warning If and when this function is called depends on the underlying | 1293 | * @warning If and when this function is called depends on the underlying |
1111 | * windowing system. | 1294 | * windowing system. |
1112 | */ | 1295 | */ |
1113 | EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1296 | EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1114 | /** | 1297 | /** |
1115 | * Set a callback for Ecore_Evas focus out events. | 1298 | * Set a callback for Ecore_Evas focus out events. |
1116 | * @param ee The Ecore_Evas to set callbacks on | 1299 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1122,7 +1305,7 @@ EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) ( | |||
1122 | * @warning If and when this function is called depends on the underlying | 1305 | * @warning If and when this function is called depends on the underlying |
1123 | * windowing system. | 1306 | * windowing system. |
1124 | */ | 1307 | */ |
1125 | EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1308 | EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1126 | /** | 1309 | /** |
1127 | * Set a callback for Ecore_Evas sticky events. | 1310 | * Set a callback for Ecore_Evas sticky events. |
1128 | * @param ee The Ecore_Evas to set callbacks on | 1311 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1134,7 +1317,7 @@ EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) | |||
1134 | * @warning If and when this function is called depends on the underlying | 1317 | * @warning If and when this function is called depends on the underlying |
1135 | * windowing system. | 1318 | * windowing system. |
1136 | */ | 1319 | */ |
1137 | EAPI void ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1320 | EAPI void ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1138 | /** | 1321 | /** |
1139 | * Set a callback for Ecore_Evas un-sticky events. | 1322 | * Set a callback for Ecore_Evas un-sticky events. |
1140 | * @param ee The Ecore_Evas to set callbacks on | 1323 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1146,7 +1329,7 @@ EAPI void ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ec | |||
1146 | * @warning If and when this function is called depends on the underlying | 1329 | * @warning If and when this function is called depends on the underlying |
1147 | * windowing system. | 1330 | * windowing system. |
1148 | */ | 1331 | */ |
1149 | EAPI void ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1332 | EAPI void ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1150 | /** | 1333 | /** |
1151 | * Set a callback for Ecore_Evas mouse in events. | 1334 | * Set a callback for Ecore_Evas mouse in events. |
1152 | * @param ee The Ecore_Evas to set callbacks on | 1335 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1158,7 +1341,7 @@ EAPI void ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) ( | |||
1158 | * @warning If and when this function is called depends on the underlying | 1341 | * @warning If and when this function is called depends on the underlying |
1159 | * windowing system. | 1342 | * windowing system. |
1160 | */ | 1343 | */ |
1161 | EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1344 | EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1162 | /** | 1345 | /** |
1163 | * Set a callback for Ecore_Evas mouse out events. | 1346 | * Set a callback for Ecore_Evas mouse out events. |
1164 | * @param ee The Ecore_Evas to set callbacks on | 1347 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1170,7 +1353,7 @@ EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) ( | |||
1170 | * @warning If and when this function is called depends on the underlying | 1353 | * @warning If and when this function is called depends on the underlying |
1171 | * windowing system. | 1354 | * windowing system. |
1172 | */ | 1355 | */ |
1173 | EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1356 | EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1174 | /** | 1357 | /** |
1175 | * Set a callback for Ecore_Evas pre render events. | 1358 | * Set a callback for Ecore_Evas pre render events. |
1176 | * @param ee The Ecore_Evas to set callbacks on | 1359 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1182,7 +1365,7 @@ EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) | |||
1182 | * @warning If and when this function is called depends on the underlying | 1365 | * @warning If and when this function is called depends on the underlying |
1183 | * windowing system. | 1366 | * windowing system. |
1184 | */ | 1367 | */ |
1185 | EAPI void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1368 | EAPI void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1186 | /** | 1369 | /** |
1187 | * Set a callback for Ecore_Evas mouse post render events. | 1370 | * Set a callback for Ecore_Evas mouse post render events. |
1188 | * @param ee The Ecore_Evas to set callbacks on | 1371 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1194,7 +1377,7 @@ EAPI void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) | |||
1194 | * @warning If and when this function is called depends on the underlying | 1377 | * @warning If and when this function is called depends on the underlying |
1195 | * windowing system. | 1378 | * windowing system. |
1196 | */ | 1379 | */ |
1197 | EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1380 | EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1198 | /** | 1381 | /** |
1199 | * Set a callback for Ecore_Evas pre-free event. | 1382 | * Set a callback for Ecore_Evas pre-free event. |
1200 | * @param ee The Ecore_Evas to set callbacks on | 1383 | * @param ee The Ecore_Evas to set callbacks on |
@@ -1206,7 +1389,21 @@ EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func | |||
1206 | * @warning If and when this function is called depends on the underlying | 1389 | * @warning If and when this function is called depends on the underlying |
1207 | * windowing system. | 1390 | * windowing system. |
1208 | */ | 1391 | */ |
1209 | EAPI void ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 1392 | EAPI void ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
1393 | /** | ||
1394 | * Set a callback for Ecore_Evas state changes. | ||
1395 | * @param ee The Ecore_Evas to set callbacks on | ||
1396 | * @param func The function to call | ||
1397 | |||
1398 | * A call to this function will set a callback on an Ecore_Evas, causing | ||
1399 | * @p func to be called whenever @p ee changes state. | ||
1400 | * | ||
1401 | * @since 1.2 | ||
1402 | * @warning If and when this function is called depends on the underlying | ||
1403 | * windowing system. | ||
1404 | */ | ||
1405 | EAPI void ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); | ||
1406 | |||
1210 | EAPI Evas *ecore_evas_get(const Ecore_Evas *ee); | 1407 | EAPI Evas *ecore_evas_get(const Ecore_Evas *ee); |
1211 | EAPI void ecore_evas_managed_move(Ecore_Evas *ee, int x, int y); | 1408 | EAPI void ecore_evas_managed_move(Ecore_Evas *ee, int x, int y); |
1212 | EAPI void ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped); | 1409 | EAPI void ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped); |
@@ -1572,7 +1769,7 @@ EAPI Eina_Bool ecore_evas_ews_setup(int x, int y, int w, int h); | |||
1572 | /** | 1769 | /** |
1573 | * Return the internal backing store in use. | 1770 | * Return the internal backing store in use. |
1574 | * | 1771 | * |
1575 | * @note this will foced it to be created, making future calls to | 1772 | * @note this will forced it to be created, making future calls to |
1576 | * ecore_evas_ews_engine_set() void. | 1773 | * ecore_evas_ews_engine_set() void. |
1577 | * | 1774 | * |
1578 | * @see ecore_evas_ews_evas_get() | 1775 | * @see ecore_evas_ews_evas_get() |
@@ -1583,7 +1780,7 @@ EAPI Ecore_Evas *ecore_evas_ews_ecore_evas_get(void); | |||
1583 | /** | 1780 | /** |
1584 | * Return the internal backing store in use. | 1781 | * Return the internal backing store in use. |
1585 | * | 1782 | * |
1586 | * @note this will foced it to be created, making future calls to | 1783 | * @note this will forced it to be created, making future calls to |
1587 | * ecore_evas_ews_engine_set() void. | 1784 | * ecore_evas_ews_engine_set() void. |
1588 | * | 1785 | * |
1589 | * @see ecore_evas_ews_ecore_evas_get() | 1786 | * @see ecore_evas_ews_ecore_evas_get() |
@@ -1762,6 +1959,7 @@ EAPI Ecore_Evas *ecore_evas_extn_socket_new(int w, int h); | |||
1762 | /** | 1959 | /** |
1763 | * @brief Create a socket to provide the service for external ecore evas socket. | 1960 | * @brief Create a socket to provide the service for external ecore evas socket. |
1764 | * | 1961 | * |
1962 | * @param ee The Ecore_Evas | ||
1765 | * @param svcname The name of the service to be advertised. ensure that it is unique (when combined with @p svcnum) otherwise creation may fail. | 1963 | * @param svcname The name of the service to be advertised. ensure that it is unique (when combined with @p svcnum) otherwise creation may fail. |
1766 | * @param svcnum A number (any value, 0 beig the common default) to differentiate multiple instances of services with the same name. | 1964 | * @param svcnum A number (any value, 0 beig the common default) to differentiate multiple instances of services with the same name. |
1767 | * @param svcsys A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user ide that created the service. | 1965 | * @param svcsys A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user ide that created the service. |
@@ -1791,7 +1989,7 @@ EAPI Eina_Bool ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname | |||
1791 | * image data so the external plug process will not render to it or alter it. | 1989 | * image data so the external plug process will not render to it or alter it. |
1792 | * | 1990 | * |
1793 | * You should only hold the lock for just as long as you need to read out the | 1991 | * You should only hold the lock for just as long as you need to read out the |
1794 | * image data or otherwise deal with it, and then unlokc it with | 1992 | * image data or otherwise deal with it, and then unlock it with |
1795 | * ecore_evas_extn_plug_object_data_unlock(). Keeping a lock over more than | 1993 | * ecore_evas_extn_plug_object_data_unlock(). Keeping a lock over more than |
1796 | * 1 iteration of the main ecore loop will be problematic, so avoid it. Also | 1994 | * 1 iteration of the main ecore loop will be problematic, so avoid it. Also |
1797 | * forgetting to unlock may cause the socket process to freeze and thus create | 1995 | * forgetting to unlock may cause the socket process to freeze and thus create |
@@ -1831,7 +2029,7 @@ EAPI void ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj); | |||
1831 | * in the canvas of the plug process in place of the image object. The image | 2029 | * in the canvas of the plug process in place of the image object. The image |
1832 | * object by default is created to be filled (equivalent of | 2030 | * object by default is created to be filled (equivalent of |
1833 | * evas_object_image_filled_add() on creation) so image content will scale | 2031 | * evas_object_image_filled_add() on creation) so image content will scale |
1834 | * toi fill the image unless otherwise reconfigured. The Ecore_Evas size | 2032 | * to fill the image unless otherwise reconfigured. The Ecore_Evas size |
1835 | * of the plug is the master size and determines size in pixels of the | 2033 | * of the plug is the master size and determines size in pixels of the |
1836 | * plug canvas. You can change the size with something like: | 2034 | * plug canvas. You can change the size with something like: |
1837 | * | 2035 | * |
diff --git a/libraries/ecore/src/lib/ecore_evas/Makefile.am b/libraries/ecore/src/lib/ecore_evas/Makefile.am index a1d9215..c85af09 100644 --- a/libraries/ecore/src/lib/ecore_evas/Makefile.am +++ b/libraries/ecore/src/lib/ecore_evas/Makefile.am | |||
@@ -151,6 +151,7 @@ $(top_builddir)/src/lib/ecore/libecore.la \ | |||
151 | @EVAS_LIBS@ \ | 151 | @EVAS_LIBS@ \ |
152 | @EINA_LIBS@ \ | 152 | @EINA_LIBS@ \ |
153 | @EVIL_LIBS@ \ | 153 | @EVIL_LIBS@ \ |
154 | @SHM_OPEN_LIBS@ \ | ||
154 | @WAYLAND_EGL_LIBS@ | 155 | @WAYLAND_EGL_LIBS@ |
155 | 156 | ||
156 | libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ | 157 | libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ |
diff --git a/libraries/ecore/src/lib/ecore_evas/Makefile.in b/libraries/ecore/src/lib/ecore_evas/Makefile.in index a269b75..b48f26f 100644 --- a/libraries/ecore/src/lib/ecore_evas/Makefile.in +++ b/libraries/ecore/src/lib/ecore_evas/Makefile.in | |||
@@ -50,16 +50,15 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \ | |||
50 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | 50 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ |
51 | $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \ | 51 | $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \ |
52 | $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ | 52 | $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ |
53 | $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ | 53 | $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ |
54 | $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ | 54 | $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ |
55 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | 55 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ |
56 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | 56 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ |
57 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ | 57 | $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ |
58 | $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ | 58 | $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac |
59 | $(top_srcdir)/configure.ac | ||
60 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | 59 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
61 | $(ACLOCAL_M4) | 60 | $(ACLOCAL_M4) |
62 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | 61 | mkinstalldirs = $(install_sh) -d |
63 | CONFIG_HEADER = $(top_builddir)/config.h | 62 | CONFIG_HEADER = $(top_builddir)/config.h |
64 | CONFIG_CLEAN_FILES = | 63 | CONFIG_CLEAN_FILES = |
65 | CONFIG_CLEAN_VPATH_FILES = | 64 | CONFIG_CLEAN_VPATH_FILES = |
@@ -216,6 +215,8 @@ EVAS_LIBS = @EVAS_LIBS@ | |||
216 | EVIL_CFLAGS = @EVIL_CFLAGS@ | 215 | EVIL_CFLAGS = @EVIL_CFLAGS@ |
217 | EVIL_LIBS = @EVIL_LIBS@ | 216 | EVIL_LIBS = @EVIL_LIBS@ |
218 | EXEEXT = @EXEEXT@ | 217 | EXEEXT = @EXEEXT@ |
218 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
219 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
219 | FGREP = @FGREP@ | 220 | FGREP = @FGREP@ |
220 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ | 221 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ |
221 | GLIB_CFLAGS = @GLIB_CFLAGS@ | 222 | GLIB_CFLAGS = @GLIB_CFLAGS@ |
@@ -271,6 +272,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
271 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 272 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
272 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 273 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
273 | PKG_CONFIG = @PKG_CONFIG@ | 274 | PKG_CONFIG = @PKG_CONFIG@ |
275 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
276 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
274 | POSUB = @POSUB@ | 277 | POSUB = @POSUB@ |
275 | RANLIB = @RANLIB@ | 278 | RANLIB = @RANLIB@ |
276 | SCIM_CFLAGS = @SCIM_CFLAGS@ | 279 | SCIM_CFLAGS = @SCIM_CFLAGS@ |
@@ -281,6 +284,7 @@ SDL_LIBS = @SDL_LIBS@ | |||
281 | SED = @SED@ | 284 | SED = @SED@ |
282 | SET_MAKE = @SET_MAKE@ | 285 | SET_MAKE = @SET_MAKE@ |
283 | SHELL = @SHELL@ | 286 | SHELL = @SHELL@ |
287 | SHM_OPEN_LIBS = @SHM_OPEN_LIBS@ | ||
284 | SSL_CFLAGS = @SSL_CFLAGS@ | 288 | SSL_CFLAGS = @SSL_CFLAGS@ |
285 | SSL_LIBS = @SSL_LIBS@ | 289 | SSL_LIBS = @SSL_LIBS@ |
286 | STRIP = @STRIP@ | 290 | STRIP = @STRIP@ |
@@ -605,6 +609,7 @@ $(top_builddir)/src/lib/ecore/libecore.la \ | |||
605 | @EVAS_LIBS@ \ | 609 | @EVAS_LIBS@ \ |
606 | @EINA_LIBS@ \ | 610 | @EINA_LIBS@ \ |
607 | @EVIL_LIBS@ \ | 611 | @EVIL_LIBS@ \ |
612 | @SHM_OPEN_LIBS@ \ | ||
608 | @WAYLAND_EGL_LIBS@ | 613 | @WAYLAND_EGL_LIBS@ |
609 | 614 | ||
610 | libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ | 615 | libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c index 2b04488..6ecd609 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c | |||
@@ -509,24 +509,6 @@ _ecore_evas_constructor_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, co | |||
509 | 509 | ||
510 | return ee; | 510 | return ee; |
511 | } | 511 | } |
512 | |||
513 | static Ecore_Evas * | ||
514 | _ecore_evas_constructor_sdl16(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options) | ||
515 | { | ||
516 | Ecore_Evas *ee; | ||
517 | unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0; | ||
518 | char *name = NULL; | ||
519 | |||
520 | _ecore_evas_parse_extra_options_str(extra_options, "name=", &name); | ||
521 | _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen); | ||
522 | _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface); | ||
523 | _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha); | ||
524 | |||
525 | ee = ecore_evas_sdl16_new(name, w, h, fullscreen, hwsurface, noframe, alpha); | ||
526 | free(name); | ||
527 | |||
528 | return ee; | ||
529 | } | ||
530 | #endif | 512 | #endif |
531 | 513 | ||
532 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL | 514 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL |
@@ -606,12 +588,13 @@ static Ecore_Evas * | |||
606 | _ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options) | 588 | _ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options) |
607 | { | 589 | { |
608 | char *disp_name = NULL; | 590 | char *disp_name = NULL; |
609 | unsigned int frame = 0; | 591 | unsigned int frame = 0, parent = 0; |
610 | Ecore_Evas *ee; | 592 | Ecore_Evas *ee; |
611 | 593 | ||
612 | _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); | 594 | _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); |
613 | _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); | 595 | _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); |
614 | ee = ecore_evas_wayland_shm_new(disp_name, x, y, w, h, frame); | 596 | _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent); |
597 | ee = ecore_evas_wayland_shm_new(disp_name, parent, x, y, w, h, frame); | ||
615 | free(disp_name); | 598 | free(disp_name); |
616 | 599 | ||
617 | return ee; | 600 | return ee; |
@@ -623,12 +606,13 @@ static Ecore_Evas * | |||
623 | _ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options) | 606 | _ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options) |
624 | { | 607 | { |
625 | char *disp_name = NULL; | 608 | char *disp_name = NULL; |
626 | unsigned int frame = 0; | 609 | unsigned int frame = 0, parent = 0; |
627 | Ecore_Evas *ee; | 610 | Ecore_Evas *ee; |
628 | 611 | ||
629 | _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); | 612 | _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); |
630 | _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); | 613 | _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); |
631 | ee = ecore_evas_wayland_egl_new(disp_name, x, y, w, h, frame); | 614 | _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent); |
615 | ee = ecore_evas_wayland_egl_new(disp_name, parent, x, y, w, h, frame); | ||
632 | free(disp_name); | 616 | free(disp_name); |
633 | 617 | ||
634 | return ee; | 618 | return ee; |
@@ -788,7 +772,6 @@ static const struct ecore_evas_engine _engines[] = { | |||
788 | 772 | ||
789 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL | 773 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL |
790 | {"sdl", _ecore_evas_constructor_sdl}, | 774 | {"sdl", _ecore_evas_constructor_sdl}, |
791 | {"software_16_sdl", _ecore_evas_constructor_sdl16}, | ||
792 | #endif | 775 | #endif |
793 | 776 | ||
794 | /* independent */ | 777 | /* independent */ |
@@ -944,7 +927,7 @@ ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data) | |||
944 | #define IFE return;} | 927 | #define IFE return;} |
945 | 928 | ||
946 | EAPI void | 929 | EAPI void |
947 | ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 930 | ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
948 | { | 931 | { |
949 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 932 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
950 | { | 933 | { |
@@ -958,7 +941,7 @@ ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
958 | } | 941 | } |
959 | 942 | ||
960 | EAPI void | 943 | EAPI void |
961 | ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 944 | ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
962 | { | 945 | { |
963 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 946 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
964 | { | 947 | { |
@@ -972,7 +955,7 @@ ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
972 | } | 955 | } |
973 | 956 | ||
974 | EAPI void | 957 | EAPI void |
975 | ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 958 | ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
976 | { | 959 | { |
977 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 960 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
978 | { | 961 | { |
@@ -986,7 +969,7 @@ ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
986 | } | 969 | } |
987 | 970 | ||
988 | EAPI void | 971 | EAPI void |
989 | ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 972 | ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
990 | { | 973 | { |
991 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 974 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
992 | { | 975 | { |
@@ -1000,7 +983,7 @@ ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1000 | } | 983 | } |
1001 | 984 | ||
1002 | EAPI void | 985 | EAPI void |
1003 | ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 986 | ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1004 | { | 987 | { |
1005 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 988 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1006 | { | 989 | { |
@@ -1014,7 +997,7 @@ ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas | |||
1014 | } | 997 | } |
1015 | 998 | ||
1016 | EAPI void | 999 | EAPI void |
1017 | ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1000 | ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1018 | { | 1001 | { |
1019 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1002 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1020 | { | 1003 | { |
@@ -1028,7 +1011,7 @@ ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1028 | } | 1011 | } |
1029 | 1012 | ||
1030 | EAPI void | 1013 | EAPI void |
1031 | ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1014 | ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1032 | { | 1015 | { |
1033 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1016 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1034 | { | 1017 | { |
@@ -1042,7 +1025,7 @@ ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1042 | } | 1025 | } |
1043 | 1026 | ||
1044 | EAPI void | 1027 | EAPI void |
1045 | ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1028 | ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1046 | { | 1029 | { |
1047 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1030 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1048 | { | 1031 | { |
@@ -1056,7 +1039,7 @@ ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1056 | } | 1039 | } |
1057 | 1040 | ||
1058 | EAPI void | 1041 | EAPI void |
1059 | ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1042 | ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1060 | { | 1043 | { |
1061 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1044 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1062 | { | 1045 | { |
@@ -1070,7 +1053,7 @@ ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1070 | } | 1053 | } |
1071 | 1054 | ||
1072 | EAPI void | 1055 | EAPI void |
1073 | ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1056 | ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1074 | { | 1057 | { |
1075 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1058 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1076 | { | 1059 | { |
@@ -1084,7 +1067,7 @@ ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1084 | } | 1067 | } |
1085 | 1068 | ||
1086 | EAPI void | 1069 | EAPI void |
1087 | ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1070 | ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1088 | { | 1071 | { |
1089 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1072 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1090 | { | 1073 | { |
@@ -1098,7 +1081,7 @@ ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1098 | } | 1081 | } |
1099 | 1082 | ||
1100 | EAPI void | 1083 | EAPI void |
1101 | ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1084 | ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1102 | { | 1085 | { |
1103 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1086 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1104 | { | 1087 | { |
@@ -1112,7 +1095,7 @@ ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1112 | } | 1095 | } |
1113 | 1096 | ||
1114 | EAPI void | 1097 | EAPI void |
1115 | ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1098 | ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1116 | { | 1099 | { |
1117 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1100 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1118 | { | 1101 | { |
@@ -1126,7 +1109,7 @@ ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee) | |||
1126 | } | 1109 | } |
1127 | 1110 | ||
1128 | EAPI void | 1111 | EAPI void |
1129 | ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1112 | ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1130 | { | 1113 | { |
1131 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1114 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1132 | { | 1115 | { |
@@ -1140,7 +1123,7 @@ ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee | |||
1140 | } | 1123 | } |
1141 | 1124 | ||
1142 | EAPI void | 1125 | EAPI void |
1143 | ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1126 | ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1144 | { | 1127 | { |
1145 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 1128 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
1146 | { | 1129 | { |
@@ -1151,6 +1134,18 @@ ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | |||
1151 | ee->func.fn_pre_free = func; | 1134 | ee->func.fn_pre_free = func; |
1152 | } | 1135 | } |
1153 | 1136 | ||
1137 | EAPI void | ||
1138 | ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) | ||
1139 | { | ||
1140 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
1141 | { | ||
1142 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
1143 | "ecore_evas_callback_state_change_set"); | ||
1144 | return; | ||
1145 | } | ||
1146 | ee->func.fn_state_change = func; | ||
1147 | } | ||
1148 | |||
1154 | /** | 1149 | /** |
1155 | * Get an Ecore_Evas's Evas | 1150 | * Get an Ecore_Evas's Evas |
1156 | * @param ee The Ecore_Evas whose Evas you wish to get | 1151 | * @param ee The Ecore_Evas whose Evas you wish to get |
@@ -2120,6 +2115,162 @@ ecore_evas_sticky_get(const Ecore_Evas *ee) | |||
2120 | } | 2115 | } |
2121 | 2116 | ||
2122 | EAPI void | 2117 | EAPI void |
2118 | ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group) | ||
2119 | { | ||
2120 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2121 | { | ||
2122 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2123 | "XXX"); | ||
2124 | return; | ||
2125 | } | ||
2126 | |||
2127 | IFC(ee, fn_window_group_set) (ee, ee_group); | ||
2128 | IFE; | ||
2129 | } | ||
2130 | |||
2131 | EAPI const Ecore_Evas * | ||
2132 | ecore_evas_window_group_get(const Ecore_Evas *ee) | ||
2133 | { | ||
2134 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2135 | { | ||
2136 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2137 | "XXX"); | ||
2138 | return EINA_FALSE; | ||
2139 | } | ||
2140 | return ee->prop.group_ee; | ||
2141 | } | ||
2142 | |||
2143 | EAPI void | ||
2144 | ecore_evas_aspect_set(Ecore_Evas *ee, double aspect) | ||
2145 | { | ||
2146 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2147 | { | ||
2148 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2149 | "XXX"); | ||
2150 | return; | ||
2151 | } | ||
2152 | |||
2153 | IFC(ee, fn_aspect_set) (ee, aspect); | ||
2154 | IFE; | ||
2155 | } | ||
2156 | |||
2157 | EAPI double | ||
2158 | ecore_evas_aspect_get(const Ecore_Evas *ee) | ||
2159 | { | ||
2160 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2161 | { | ||
2162 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2163 | "XXX"); | ||
2164 | return EINA_FALSE; | ||
2165 | } | ||
2166 | return ee->prop.aspect; | ||
2167 | } | ||
2168 | |||
2169 | EAPI void | ||
2170 | ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent) | ||
2171 | { | ||
2172 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2173 | { | ||
2174 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2175 | "XXX"); | ||
2176 | return; | ||
2177 | } | ||
2178 | |||
2179 | IFC(ee, fn_urgent_set) (ee, urgent); | ||
2180 | IFE; | ||
2181 | } | ||
2182 | |||
2183 | EAPI Eina_Bool | ||
2184 | ecore_evas_urgent_get(const Ecore_Evas *ee) | ||
2185 | { | ||
2186 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2187 | { | ||
2188 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2189 | "XXX"); | ||
2190 | return EINA_FALSE; | ||
2191 | } | ||
2192 | return ee->prop.urgent ? EINA_TRUE : EINA_FALSE; | ||
2193 | } | ||
2194 | |||
2195 | EAPI void | ||
2196 | ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal) | ||
2197 | { | ||
2198 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2199 | { | ||
2200 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2201 | "XXX"); | ||
2202 | return; | ||
2203 | } | ||
2204 | |||
2205 | IFC(ee, fn_modal_set) (ee, modal); | ||
2206 | IFE; | ||
2207 | } | ||
2208 | |||
2209 | EAPI Eina_Bool | ||
2210 | ecore_evas_modal_get(const Ecore_Evas *ee) | ||
2211 | { | ||
2212 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2213 | { | ||
2214 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2215 | "XXX"); | ||
2216 | return EINA_FALSE; | ||
2217 | } | ||
2218 | return ee->prop.modal ? EINA_TRUE : EINA_FALSE; | ||
2219 | } | ||
2220 | |||
2221 | EAPI void | ||
2222 | ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand) | ||
2223 | { | ||
2224 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2225 | { | ||
2226 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2227 | "XXX"); | ||
2228 | return; | ||
2229 | } | ||
2230 | |||
2231 | IFC(ee, fn_demands_attention_set) (ee, demand); | ||
2232 | IFE; | ||
2233 | } | ||
2234 | |||
2235 | EAPI Eina_Bool | ||
2236 | ecore_evas_demand_attention_get(const Ecore_Evas *ee) | ||
2237 | { | ||
2238 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2239 | { | ||
2240 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2241 | "XXX"); | ||
2242 | return EINA_FALSE; | ||
2243 | } | ||
2244 | return ee->prop.demand_attention ? EINA_TRUE : EINA_FALSE; | ||
2245 | } | ||
2246 | |||
2247 | EAPI void | ||
2248 | ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip) | ||
2249 | { | ||
2250 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2251 | { | ||
2252 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2253 | "XXX"); | ||
2254 | return; | ||
2255 | } | ||
2256 | |||
2257 | IFC(ee, fn_focus_skip_set) (ee, skip); | ||
2258 | IFE; | ||
2259 | } | ||
2260 | |||
2261 | EAPI Eina_Bool | ||
2262 | ecore_evas_focus_skip_get(const Ecore_Evas *ee) | ||
2263 | { | ||
2264 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | ||
2265 | { | ||
2266 | ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, | ||
2267 | "XXX"); | ||
2268 | return EINA_FALSE; | ||
2269 | } | ||
2270 | return ee->prop.focus_skip ? EINA_TRUE : EINA_FALSE; | ||
2271 | } | ||
2272 | |||
2273 | EAPI void | ||
2123 | ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore) | 2274 | ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore) |
2124 | { | 2275 | { |
2125 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) | 2276 | if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) |
@@ -2695,35 +2846,10 @@ ecore_evas_wayland_resize(Ecore_Evas *ee, int location) | |||
2695 | } | 2846 | } |
2696 | } | 2847 | } |
2697 | 2848 | ||
2698 | EAPI void | ||
2699 | ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) | ||
2700 | { | ||
2701 | if ((!ee) || (!source)) return; | ||
2702 | if (!ee->engine.wl.surface) return; | ||
2703 | |||
2704 | if (!strcmp(ee->driver, "wayland_shm")) | ||
2705 | { | ||
2706 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | ||
2707 | _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source); | ||
2708 | #endif | ||
2709 | } | ||
2710 | else if (!strcmp(ee->driver, "wayland_egl")) | ||
2711 | { | ||
2712 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | ||
2713 | _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source); | ||
2714 | #endif | ||
2715 | } | ||
2716 | } | ||
2717 | #else | 2849 | #else |
2718 | EAPI void | 2850 | EAPI void |
2719 | ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__) | 2851 | ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__) |
2720 | { | 2852 | { |
2721 | 2853 | ||
2722 | } | 2854 | } |
2723 | |||
2724 | EAPI void | ||
2725 | ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __UNUSED__, void *source __UNUSED__) | ||
2726 | { | ||
2727 | |||
2728 | } | ||
2729 | #endif | 2855 | #endif |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c index 3f82efb..4c81db7 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_buffer.c | |||
@@ -513,6 +513,13 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func = | |||
513 | _ecore_evas_buffer_alpha_set, | 513 | _ecore_evas_buffer_alpha_set, |
514 | NULL, //transparent | 514 | NULL, //transparent |
515 | 515 | ||
516 | NULL, | ||
517 | NULL, | ||
518 | NULL, | ||
519 | NULL, | ||
520 | NULL, | ||
521 | NULL, | ||
522 | |||
516 | _ecore_evas_buffer_render, | 523 | _ecore_evas_buffer_render, |
517 | NULL // screen_geometry_get | 524 | NULL // screen_geometry_get |
518 | }; | 525 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c index 36d41f8..0947b11 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA | 10 | #ifdef BUILD_ECORE_EVAS_OPENGL_COCOA |
11 | #include <Ecore_Cocoa.h> | 11 | #include <Ecore_Cocoa.h> |
12 | #include <Evas_Engine_Gl_Cocoa.h> | 12 | #include <Evas_Engine_GL_Cocoa.h> |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #include "ecore_evas_private.h" | 15 | #include "ecore_evas_private.h" |
@@ -463,6 +463,14 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func = | |||
463 | NULL, | 463 | NULL, |
464 | NULL, | 464 | NULL, |
465 | NULL, //transparent | 465 | NULL, //transparent |
466 | |||
467 | NULL, | ||
468 | NULL, | ||
469 | NULL, | ||
470 | NULL, | ||
471 | NULL, | ||
472 | NULL, | ||
473 | |||
466 | NULL, // render | 474 | NULL, // render |
467 | NULL | 475 | NULL |
468 | }; | 476 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_directfb.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_directfb.c index 457f9e9..ed24355 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_directfb.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_directfb.c | |||
@@ -490,6 +490,13 @@ static Ecore_Evas_Engine_Func _ecore_directfb_engine_func = | |||
490 | NULL, /* alpha */ | 490 | NULL, /* alpha */ |
491 | NULL, //transparent | 491 | NULL, //transparent |
492 | 492 | ||
493 | NULL, | ||
494 | NULL, | ||
495 | NULL, | ||
496 | NULL, | ||
497 | NULL, | ||
498 | NULL, | ||
499 | |||
493 | NULL, // render | 500 | NULL, // render |
494 | NULL // screen_geometry_get | 501 | NULL // screen_geometry_get |
495 | }; | 502 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c index eccf98b..ec02472 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_ews.c | |||
@@ -683,6 +683,14 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func = | |||
683 | _ecore_evas_ews_ignore_events_set, | 683 | _ecore_evas_ews_ignore_events_set, |
684 | _ecore_evas_ews_alpha_set, | 684 | _ecore_evas_ews_alpha_set, |
685 | _ecore_evas_ews_transparent_set, | 685 | _ecore_evas_ews_transparent_set, |
686 | |||
687 | NULL, | ||
688 | NULL, | ||
689 | NULL, | ||
690 | NULL, | ||
691 | NULL, | ||
692 | NULL, | ||
693 | |||
686 | _ecore_evas_ews_render, | 694 | _ecore_evas_ews_render, |
687 | _ecore_evas_ews_screen_geometry_get | 695 | _ecore_evas_ews_screen_geometry_get |
688 | }; | 696 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c index e46ab4a..a7ea4c3 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_extn.c | |||
@@ -2,35 +2,37 @@ | |||
2 | # include <config.h> | 2 | # include <config.h> |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #include <stdio.h> | ||
5 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | #include <sys/types.h> | ||
8 | #include <unistd.h> | ||
9 | #include <math.h> | ||
10 | #include <time.h> | ||
11 | #ifdef HAVE_SYS_MMAN_H | ||
12 | # include <sys/mman.h> | ||
13 | #endif | ||
14 | #include <sys/stat.h> | ||
15 | #include <fcntl.h> | ||
16 | #include <string.h> | ||
17 | #include <sys/file.h> | ||
6 | #include <unistd.h> | 18 | #include <unistd.h> |
7 | 19 | ||
8 | #include <Ecore.h> | 20 | #include <Ecore.h> |
9 | #include "ecore_private.h" | 21 | #include "ecore_private.h" |
10 | #include <Ecore_Input.h> | 22 | #include <Ecore_Input.h> |
11 | 23 | ||
12 | #ifdef BUILD_ECORE_IPC | 24 | #ifdef BUILD_ECORE_EVAS_EXTN |
13 | # ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER | 25 | |
14 | # define EXTN_ENABLED 1 | 26 | #include <Ecore_Ipc.h> |
15 | # endif | 27 | |
16 | #endif | 28 | #endif |
17 | 29 | ||
18 | #include "ecore_evas_private.h" | 30 | #include "ecore_evas_private.h" |
19 | #include "Ecore_Evas.h" | 31 | #include "Ecore_Evas.h" |
20 | #ifdef EXTN_ENABLED | ||
21 | #include "Ecore_Ipc.h" | ||
22 | 32 | ||
23 | #include <stdio.h> | 33 | |
24 | #include <stdlib.h> | 34 | #ifdef BUILD_ECORE_EVAS_EXTN |
25 | #include <sys/types.h> | 35 | |
26 | #include <unistd.h> | ||
27 | #include <math.h> | ||
28 | #include <time.h> | ||
29 | #include <sys/mman.h> | ||
30 | #include <sys/stat.h> | ||
31 | #include <fcntl.h> | ||
32 | #include <string.h> | ||
33 | #include <sys/file.h> | ||
34 | 36 | ||
35 | typedef struct _Shmfile Shmfile; | 37 | typedef struct _Shmfile Shmfile; |
36 | 38 | ||
@@ -1102,6 +1104,13 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func = | |||
1102 | NULL, | 1104 | NULL, |
1103 | NULL, //transparent | 1105 | NULL, //transparent |
1104 | 1106 | ||
1107 | NULL, | ||
1108 | NULL, | ||
1109 | NULL, | ||
1110 | NULL, | ||
1111 | NULL, | ||
1112 | NULL, | ||
1113 | |||
1105 | NULL, // render | 1114 | NULL, // render |
1106 | NULL // screen_geometry_get | 1115 | NULL // screen_geometry_get |
1107 | }; | 1116 | }; |
@@ -1286,12 +1295,13 @@ void | |||
1286 | _ecore_evas_extn_shutdown(void) | 1295 | _ecore_evas_extn_shutdown(void) |
1287 | { | 1296 | { |
1288 | } | 1297 | } |
1289 | #endif | 1298 | |
1299 | #endif /* BUILD_ECORE_EVAS_EXTN */ | ||
1290 | 1300 | ||
1291 | EAPI Evas_Object * | 1301 | EAPI Evas_Object * |
1292 | ecore_evas_extn_plug_new(Ecore_Evas *ee_target) | 1302 | ecore_evas_extn_plug_new(Ecore_Evas *ee_target) |
1293 | { | 1303 | { |
1294 | #ifdef EXTN_ENABLED | 1304 | #ifdef BUILD_ECORE_EVAS_EXTN |
1295 | Evas_Object *o; | 1305 | Evas_Object *o; |
1296 | Ecore_Evas *ee; | 1306 | Ecore_Evas *ee; |
1297 | int w = 1, h = 1; | 1307 | int w = 1, h = 1; |
@@ -1408,7 +1418,7 @@ ecore_evas_extn_plug_new(Ecore_Evas *ee_target) | |||
1408 | EAPI Eina_Bool | 1418 | EAPI Eina_Bool |
1409 | ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys) | 1419 | ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys) |
1410 | { | 1420 | { |
1411 | #ifdef EXTN_ENABLED | 1421 | #ifdef BUILD_ECORE_EVAS_EXTN |
1412 | Extn *extn; | 1422 | Extn *extn; |
1413 | Ecore_Evas *ee = NULL; | 1423 | Ecore_Evas *ee = NULL; |
1414 | 1424 | ||
@@ -1459,7 +1469,7 @@ ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, | |||
1459 | EAPI void | 1469 | EAPI void |
1460 | ecore_evas_extn_plug_object_data_lock(Evas_Object *obj) | 1470 | ecore_evas_extn_plug_object_data_lock(Evas_Object *obj) |
1461 | { | 1471 | { |
1462 | #ifdef EXTN_ENABLED | 1472 | #ifdef BUILD_ECORE_EVAS_EXTN |
1463 | Ecore_Evas *ee; | 1473 | Ecore_Evas *ee; |
1464 | 1474 | ||
1465 | ee = ecore_evas_object_ecore_evas_get(obj); | 1475 | ee = ecore_evas_object_ecore_evas_get(obj); |
@@ -1471,7 +1481,7 @@ ecore_evas_extn_plug_object_data_lock(Evas_Object *obj) | |||
1471 | EAPI void | 1481 | EAPI void |
1472 | ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj) | 1482 | ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj) |
1473 | { | 1483 | { |
1474 | #ifdef EXTN_ENABLED | 1484 | #ifdef BUILD_ECORE_EVAS_EXTN |
1475 | Ecore_Evas *ee; | 1485 | Ecore_Evas *ee; |
1476 | 1486 | ||
1477 | ee = ecore_evas_object_ecore_evas_get(obj); | 1487 | ee = ecore_evas_object_ecore_evas_get(obj); |
@@ -1480,7 +1490,7 @@ ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj) | |||
1480 | #endif | 1490 | #endif |
1481 | } | 1491 | } |
1482 | 1492 | ||
1483 | #ifdef EXTN_ENABLED | 1493 | #ifdef BUILD_ECORE_EVAS_EXTN |
1484 | static void | 1494 | static void |
1485 | _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h) | 1495 | _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h) |
1486 | { | 1496 | { |
@@ -1830,7 +1840,7 @@ _ipc_client_data(void *data, int type __UNUSED__, void *event) | |||
1830 | 1840 | ||
1831 | #define STRGET(val) \ | 1841 | #define STRGET(val) \ |
1832 | do { \ | 1842 | do { \ |
1833 | if ((ipc->val) && (ipc->val < (char *)(e->size - 1))) \ | 1843 | if ((ipc->val) && (ipc->val < (char *)(long)(e->size - 1))) \ |
1834 | ipc->val = ((char *)ipc) + (long)ipc->val; \ | 1844 | ipc->val = ((char *)ipc) + (long)ipc->val; \ |
1835 | else \ | 1845 | else \ |
1836 | ipc->val = NULL; \ | 1846 | ipc->val = NULL; \ |
@@ -1978,6 +1988,13 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func = | |||
1978 | _ecore_evas_extn_socket_alpha_set, | 1988 | _ecore_evas_extn_socket_alpha_set, |
1979 | NULL, //transparent | 1989 | NULL, //transparent |
1980 | 1990 | ||
1991 | NULL, | ||
1992 | NULL, | ||
1993 | NULL, | ||
1994 | NULL, | ||
1995 | NULL, | ||
1996 | NULL, | ||
1997 | |||
1981 | _ecore_evas_extn_socket_render, // render | 1998 | _ecore_evas_extn_socket_render, // render |
1982 | NULL // screen_geometry_get | 1999 | NULL // screen_geometry_get |
1983 | }; | 2000 | }; |
@@ -1987,7 +2004,7 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func = | |||
1987 | EAPI Ecore_Evas * | 2004 | EAPI Ecore_Evas * |
1988 | ecore_evas_extn_socket_new(int w, int h) | 2005 | ecore_evas_extn_socket_new(int w, int h) |
1989 | { | 2006 | { |
1990 | #ifdef EXTN_ENABLED | 2007 | #ifdef BUILD_ECORE_EVAS_EXTN |
1991 | Evas_Engine_Info_Buffer *einfo; | 2008 | Evas_Engine_Info_Buffer *einfo; |
1992 | Ecore_Evas *ee; | 2009 | Ecore_Evas *ee; |
1993 | int rmethod; | 2010 | int rmethod; |
@@ -2077,7 +2094,7 @@ ecore_evas_extn_socket_new(int w, int h) | |||
2077 | EAPI Eina_Bool | 2094 | EAPI Eina_Bool |
2078 | ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys) | 2095 | ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys) |
2079 | { | 2096 | { |
2080 | #ifdef EXTN_ENABLED | 2097 | #ifdef BUILD_ECORE_EVAS_EXTN |
2081 | Extn *extn; | 2098 | Extn *extn; |
2082 | 2099 | ||
2083 | extn = calloc(1, sizeof(Extn)); | 2100 | extn = calloc(1, sizeof(Extn)); |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c index 74caada..11e2ffd 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c | |||
@@ -541,6 +541,13 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func = | |||
541 | NULL, | 541 | NULL, |
542 | NULL, //transparent | 542 | NULL, //transparent |
543 | 543 | ||
544 | NULL, | ||
545 | NULL, | ||
546 | NULL, | ||
547 | NULL, | ||
548 | NULL, | ||
549 | NULL, | ||
550 | |||
544 | NULL, // render | 551 | NULL, // render |
545 | NULL // screen_geometry_get | 552 | NULL // screen_geometry_get |
546 | }; | 553 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h b/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h index 9a88a7a..e31653a 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_private.h | |||
@@ -123,6 +123,7 @@ extern int _ecore_evas_log_dom; | |||
123 | #define IDLE_FLUSH_TIME 0.5 | 123 | #define IDLE_FLUSH_TIME 0.5 |
124 | #ifndef _ECORE_EVAS_H | 124 | #ifndef _ECORE_EVAS_H |
125 | typedef struct _Ecore_Evas Ecore_Evas; | 125 | typedef struct _Ecore_Evas Ecore_Evas; |
126 | typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); | ||
126 | #endif | 127 | #endif |
127 | 128 | ||
128 | typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine; | 129 | typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine; |
@@ -131,20 +132,20 @@ typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func; | |||
131 | struct _Ecore_Evas_Engine_Func | 132 | struct _Ecore_Evas_Engine_Func |
132 | { | 133 | { |
133 | void (*fn_free) (Ecore_Evas *ee); | 134 | void (*fn_free) (Ecore_Evas *ee); |
134 | void (*fn_callback_resize_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 135 | void (*fn_callback_resize_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
135 | void (*fn_callback_move_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 136 | void (*fn_callback_move_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
136 | void (*fn_callback_show_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 137 | void (*fn_callback_show_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
137 | void (*fn_callback_hide_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 138 | void (*fn_callback_hide_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
138 | void (*fn_callback_delete_request_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 139 | void (*fn_callback_delete_request_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
139 | void (*fn_callback_destroy_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 140 | void (*fn_callback_destroy_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
140 | void (*fn_callback_focus_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 141 | void (*fn_callback_focus_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
141 | void (*fn_callback_focus_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 142 | void (*fn_callback_focus_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
142 | void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 143 | void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
143 | void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 144 | void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
144 | void (*fn_callback_sticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 145 | void (*fn_callback_sticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
145 | void (*fn_callback_unsticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 146 | void (*fn_callback_unsticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
146 | void (*fn_callback_pre_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 147 | void (*fn_callback_pre_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
147 | void (*fn_callback_post_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); | 148 | void (*fn_callback_post_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func); |
148 | void (*fn_move) (Ecore_Evas *ee, int x, int y); | 149 | void (*fn_move) (Ecore_Evas *ee, int x, int y); |
149 | void (*fn_managed_move) (Ecore_Evas *ee, int x, int y); | 150 | void (*fn_managed_move) (Ecore_Evas *ee, int x, int y); |
150 | void (*fn_resize) (Ecore_Evas *ee, int w, int h); | 151 | void (*fn_resize) (Ecore_Evas *ee, int w, int h); |
@@ -177,6 +178,13 @@ struct _Ecore_Evas_Engine_Func | |||
177 | void (*fn_alpha_set) (Ecore_Evas *ee, int alpha); | 178 | void (*fn_alpha_set) (Ecore_Evas *ee, int alpha); |
178 | void (*fn_transparent_set) (Ecore_Evas *ee, int transparent); | 179 | void (*fn_transparent_set) (Ecore_Evas *ee, int transparent); |
179 | 180 | ||
181 | void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group); | ||
182 | void (*fn_aspect_set) (Ecore_Evas *ee, double aspect); | ||
183 | void (*fn_urgent_set) (Ecore_Evas *ee, int urgent); | ||
184 | void (*fn_modal_set) (Ecore_Evas *ee, int modal); | ||
185 | void (*fn_demands_attention_set) (Ecore_Evas *ee, int demand); | ||
186 | void (*fn_focus_skip_set) (Ecore_Evas *ee, int skip); | ||
187 | |||
180 | int (*fn_render) (Ecore_Evas *ee); | 188 | int (*fn_render) (Ecore_Evas *ee); |
181 | void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h); | 189 | void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h); |
182 | }; | 190 | }; |
@@ -271,11 +279,13 @@ struct _Ecore_Evas_Engine | |||
271 | #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL) | 279 | #if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL) |
272 | struct | 280 | struct |
273 | { | 281 | { |
282 | Ecore_Wl_Window *parent, *win; | ||
274 | Evas_Object *frame; | 283 | Evas_Object *frame; |
275 | 284 | ||
276 | struct wl_shell_surface *shell_surface; | 285 | # if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) |
277 | struct wl_surface *surface; | ||
278 | struct wl_buffer *buffer; | 286 | struct wl_buffer *buffer; |
287 | # endif | ||
288 | |||
279 | } wl; | 289 | } wl; |
280 | #endif | 290 | #endif |
281 | 291 | ||
@@ -333,6 +343,9 @@ struct _Ecore_Evas | |||
333 | int layer; | 343 | int layer; |
334 | Ecore_Window window; | 344 | Ecore_Window window; |
335 | unsigned char avoid_damage; | 345 | unsigned char avoid_damage; |
346 | Ecore_Evas *group_ee; | ||
347 | Ecore_Window group_ee_win; | ||
348 | double aspect; | ||
336 | char focused : 1; | 349 | char focused : 1; |
337 | char iconified : 1; | 350 | char iconified : 1; |
338 | char borderless : 1; | 351 | char borderless : 1; |
@@ -343,7 +356,12 @@ struct _Ecore_Evas | |||
343 | char sticky : 1; | 356 | char sticky : 1; |
344 | char request_pos : 1; | 357 | char request_pos : 1; |
345 | char draw_frame : 1; | 358 | char draw_frame : 1; |
346 | } prop; | 359 | char hwsurface : 1; |
360 | char urgent : 1; | ||
361 | char modal : 1; | ||
362 | char demand_attention : 1; | ||
363 | char focus_skip : 1; | ||
364 | } prop; | ||
347 | 365 | ||
348 | struct { | 366 | struct { |
349 | void (*fn_resize) (Ecore_Evas *ee); | 367 | void (*fn_resize) (Ecore_Evas *ee); |
@@ -361,6 +379,7 @@ struct _Ecore_Evas | |||
361 | void (*fn_pre_render) (Ecore_Evas *ee); | 379 | void (*fn_pre_render) (Ecore_Evas *ee); |
362 | void (*fn_post_render) (Ecore_Evas *ee); | 380 | void (*fn_post_render) (Ecore_Evas *ee); |
363 | void (*fn_pre_free) (Ecore_Evas *ee); | 381 | void (*fn_pre_free) (Ecore_Evas *ee); |
382 | void (*fn_state_change) (Ecore_Evas *ee); | ||
364 | } func; | 383 | } func; |
365 | 384 | ||
366 | Ecore_Evas_Engine engine; | 385 | Ecore_Evas_Engine engine; |
@@ -406,11 +425,15 @@ int _ecore_evas_ews_shutdown(void); | |||
406 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | 425 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM |
407 | void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location); | 426 | void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location); |
408 | void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); | 427 | void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); |
428 | void _ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y); | ||
429 | void _ecore_evas_wayland_shm_type_set(Ecore_Evas *ee, int type); | ||
409 | #endif | 430 | #endif |
410 | 431 | ||
411 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | 432 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL |
412 | void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location); | 433 | void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location); |
413 | void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); | 434 | void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); |
435 | void _ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y); | ||
436 | void _ecore_evas_wayland_egl_type_set(Ecore_Evas *ee, int type); | ||
414 | #endif | 437 | #endif |
415 | 438 | ||
416 | void _ecore_evas_fps_debug_init(void); | 439 | void _ecore_evas_fps_debug_init(void); |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c index be130ad..038654a 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c | |||
@@ -233,7 +233,7 @@ _ecore_evas_psl1ght_free(Ecore_Evas *ee) | |||
233 | } | 233 | } |
234 | 234 | ||
235 | static void | 235 | static void |
236 | _ecore_evas_psl1ght_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 236 | _ecore_evas_psl1ght_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
237 | { | 237 | { |
238 | ee->func.fn_delete_request = func; | 238 | ee->func.fn_delete_request = func; |
239 | } | 239 | } |
@@ -396,6 +396,13 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func = | |||
396 | NULL, | 396 | NULL, |
397 | NULL, //transparent | 397 | NULL, //transparent |
398 | 398 | ||
399 | NULL, | ||
400 | NULL, | ||
401 | NULL, | ||
402 | NULL, | ||
403 | NULL, | ||
404 | NULL, | ||
405 | |||
399 | NULL, // render | 406 | NULL, // render |
400 | _ecore_evas_screen_geometry_get // screen_geometry_get | 407 | _ecore_evas_screen_geometry_get // screen_geometry_get |
401 | }; | 408 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c index a3be2c7..b246a26 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_sdl.c | |||
@@ -7,9 +7,6 @@ | |||
7 | #include <Ecore_Input_Evas.h> | 7 | #include <Ecore_Input_Evas.h> |
8 | #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL) | 8 | #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL) |
9 | # include <Ecore_Sdl.h> | 9 | # include <Ecore_Sdl.h> |
10 | # ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL | ||
11 | # include <Evas_Engine_SDL.h> | ||
12 | # endif | ||
13 | # ifdef BUILD_ECORE_EVAS_OPENGL_SDL | 10 | # ifdef BUILD_ECORE_EVAS_OPENGL_SDL |
14 | # include <Evas_Engine_GL_SDL.h> | 11 | # include <Evas_Engine_GL_SDL.h> |
15 | # endif | 12 | # endif |
@@ -18,10 +15,17 @@ | |||
18 | #include <stdlib.h> | 15 | #include <stdlib.h> |
19 | #include <string.h> | 16 | #include <string.h> |
20 | 17 | ||
18 | #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL) | ||
19 | #include <SDL/SDL.h> | ||
20 | #endif | ||
21 | |||
21 | #include "ecore_evas_private.h" | 22 | #include "ecore_evas_private.h" |
22 | #include "Ecore_Evas.h" | 23 | #include "Ecore_Evas.h" |
23 | 24 | ||
24 | // fixme: 1 sdl window only at a time? seems wrong | 25 | /** |
26 | ** SDL only handle one window at a time. That's by definition, there is nothing wrong here. | ||
27 | ** | ||
28 | **/ | ||
25 | 29 | ||
26 | #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL) | 30 | #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL) |
27 | 31 | ||
@@ -45,6 +49,13 @@ _ecore_evas_sdl_match(void) | |||
45 | return sdl_ee; | 49 | return sdl_ee; |
46 | } | 50 | } |
47 | 51 | ||
52 | static void * | ||
53 | _ecore_evas_sdl_switch_buffer(void *data, void *dest __UNUSED__) | ||
54 | { | ||
55 | SDL_Flip(data); | ||
56 | return ((SDL_Surface*)data)->pixels; | ||
57 | } | ||
58 | |||
48 | static Eina_Bool | 59 | static Eina_Bool |
49 | _ecore_evas_sdl_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) | 60 | _ecore_evas_sdl_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) |
50 | { | 61 | { |
@@ -80,12 +91,54 @@ _ecore_evas_sdl_event_video_resize(void *data __UNUSED__, int type __UNUSED__, v | |||
80 | { | 91 | { |
81 | Ecore_Sdl_Event_Video_Resize *e; | 92 | Ecore_Sdl_Event_Video_Resize *e; |
82 | Ecore_Evas *ee; | 93 | Ecore_Evas *ee; |
94 | int rmethod; | ||
83 | 95 | ||
84 | e = event; | 96 | e = event; |
85 | ee = _ecore_evas_sdl_match(); | 97 | ee = _ecore_evas_sdl_match(); |
86 | 98 | ||
87 | if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */ | 99 | if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */ |
100 | |||
101 | rmethod = evas_output_method_get(ee->evas); | ||
102 | if (rmethod == evas_render_method_lookup("buffer")) | ||
103 | { | ||
104 | Evas_Engine_Info_Buffer *einfo; | ||
105 | |||
106 | einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas); | ||
107 | if (einfo) | ||
108 | { | ||
109 | einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32; | ||
110 | einfo->info.switch_data = SDL_SetVideoMode(e->w, e->h, 32, | ||
111 | (ee->prop.hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE) | ||
112 | | (ee->prop.fullscreen ? SDL_FULLSCREEN : 0) | ||
113 | | (ee->alpha ? SDL_SRCALPHA : 0) | ||
114 | | SDL_DOUBLEBUF); | ||
115 | if (!einfo->info.switch_data) | ||
116 | { | ||
117 | return EINA_FALSE; | ||
118 | } | ||
119 | |||
120 | SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0); | ||
121 | SDL_FillRect(einfo->info.switch_data, NULL, 0); | ||
122 | |||
123 | einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels; | ||
124 | einfo->info.dest_buffer_row_bytes = e->w * sizeof (int); | ||
125 | einfo->info.use_color_key = 0; | ||
126 | einfo->info.alpha_threshold = 0; | ||
127 | einfo->info.func.new_update_region = NULL; | ||
128 | einfo->info.func.free_update_region = NULL; | ||
129 | einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer; | ||
130 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo)) | ||
131 | { | ||
132 | return EINA_FALSE; | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 | |||
137 | ee->w = e->w; | ||
138 | ee->h = e->h; | ||
139 | |||
88 | evas_output_size_set(ee->evas, e->w, e->h); | 140 | evas_output_size_set(ee->evas, e->w, e->h); |
141 | evas_output_viewport_set(ee->evas, 0, 0, e->w, e->h); | ||
89 | 142 | ||
90 | return ECORE_CALLBACK_PASS_ON; | 143 | return ECORE_CALLBACK_PASS_ON; |
91 | } | 144 | } |
@@ -191,7 +244,7 @@ _ecore_evas_sdl_shutdown(void) | |||
191 | _ecore_evas_init_count--; | 244 | _ecore_evas_init_count--; |
192 | if (_ecore_evas_init_count == 0) | 245 | if (_ecore_evas_init_count == 0) |
193 | { | 246 | { |
194 | int i; | 247 | unsigned int i; |
195 | 248 | ||
196 | for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler*); i++) | 249 | for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler*); i++) |
197 | ecore_event_handler_del(ecore_evas_event_handlers[i]); | 250 | ecore_event_handler_del(ecore_evas_event_handlers[i]); |
@@ -219,10 +272,48 @@ _ecore_evas_sdl_free(Ecore_Evas *ee) | |||
219 | static void | 272 | static void |
220 | _ecore_evas_resize(Ecore_Evas *ee, int w, int h) | 273 | _ecore_evas_resize(Ecore_Evas *ee, int w, int h) |
221 | { | 274 | { |
275 | int rmethod; | ||
276 | |||
222 | if ((w == ee->w) && (h == ee->h)) return; | 277 | if ((w == ee->w) && (h == ee->h)) return; |
223 | ee->w = w; | 278 | ee->w = w; |
224 | ee->h = h; | 279 | ee->h = h; |
225 | 280 | ||
281 | rmethod = evas_output_method_get(ee->evas); | ||
282 | if (rmethod == evas_render_method_lookup("buffer")) | ||
283 | { | ||
284 | Evas_Engine_Info_Buffer *einfo; | ||
285 | |||
286 | einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas); | ||
287 | if (einfo) | ||
288 | { | ||
289 | einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32; | ||
290 | einfo->info.switch_data = SDL_SetVideoMode(w, h, 32, | ||
291 | (ee->prop.hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE) | ||
292 | | (ee->prop.fullscreen ? SDL_FULLSCREEN : 0) | ||
293 | | (ee->alpha ? SDL_SRCALPHA : 0) | ||
294 | | SDL_DOUBLEBUF); | ||
295 | if (!einfo->info.switch_data) | ||
296 | { | ||
297 | return ; | ||
298 | } | ||
299 | |||
300 | SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0); | ||
301 | SDL_FillRect(einfo->info.switch_data, NULL, 0); | ||
302 | |||
303 | einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels; | ||
304 | einfo->info.dest_buffer_row_bytes = w * sizeof (int); | ||
305 | einfo->info.use_color_key = 0; | ||
306 | einfo->info.alpha_threshold = 0; | ||
307 | einfo->info.func.new_update_region = NULL; | ||
308 | einfo->info.func.free_update_region = NULL; | ||
309 | einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer; | ||
310 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo)) | ||
311 | { | ||
312 | return ; | ||
313 | } | ||
314 | } | ||
315 | } | ||
316 | |||
226 | evas_output_size_set(ee->evas, ee->w, ee->h); | 317 | evas_output_size_set(ee->evas, ee->w, ee->h); |
227 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); | 318 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); |
228 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); | 319 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); |
@@ -342,6 +433,13 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func = | |||
342 | NULL, | 433 | NULL, |
343 | NULL, //transparent | 434 | NULL, //transparent |
344 | 435 | ||
436 | NULL, | ||
437 | NULL, | ||
438 | NULL, | ||
439 | NULL, | ||
440 | NULL, | ||
441 | NULL, | ||
442 | |||
345 | NULL, // render | 443 | NULL, // render |
346 | NULL // screen_geometry_get | 444 | NULL // screen_geometry_get |
347 | }; | 445 | }; |
@@ -349,7 +447,6 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func = | |||
349 | static Ecore_Evas* | 447 | static Ecore_Evas* |
350 | _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha) | 448 | _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha) |
351 | { | 449 | { |
352 | void *einfo; | ||
353 | Ecore_Evas *ee; | 450 | Ecore_Evas *ee; |
354 | 451 | ||
355 | if (!name) | 452 | if (!name) |
@@ -382,6 +479,8 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu | |||
382 | ee->prop.withdrawn = 0; | 479 | ee->prop.withdrawn = 0; |
383 | ee->prop.sticky = 0; | 480 | ee->prop.sticky = 0; |
384 | ee->prop.window = 0; | 481 | ee->prop.window = 0; |
482 | ee->alpha = alpha; | ||
483 | ee->prop.hwsurface = hwsurface; | ||
385 | 484 | ||
386 | /* init evas here */ | 485 | /* init evas here */ |
387 | ee->evas = evas_new(); | 486 | ee->evas = evas_new(); |
@@ -391,19 +490,47 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu | |||
391 | evas_output_size_set(ee->evas, w, h); | 490 | evas_output_size_set(ee->evas, w, h); |
392 | evas_output_viewport_set(ee->evas, 0, 0, w, h); | 491 | evas_output_viewport_set(ee->evas, 0, 0, w, h); |
393 | 492 | ||
394 | if (rmethod == evas_render_method_lookup("software_sdl") || | 493 | if (rmethod == evas_render_method_lookup("buffer")) |
395 | rmethod == evas_render_method_lookup("software_16_sdl") ) | ||
396 | { | 494 | { |
397 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL | 495 | Evas_Engine_Info_Buffer *einfo; |
398 | einfo = evas_engine_info_get(ee->evas); | 496 | |
497 | einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas); | ||
399 | if (einfo) | 498 | if (einfo) |
400 | { | 499 | { |
401 | ((Evas_Engine_Info_SDL *)einfo)->info.rotation = 0; | 500 | SDL_Init(SDL_INIT_NOPARACHUTE); |
402 | ((Evas_Engine_Info_SDL *)einfo)->info.fullscreen = fullscreen; | 501 | |
403 | ((Evas_Engine_Info_SDL *)einfo)->info.hwsurface = hwsurface; | 502 | if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) |
404 | ((Evas_Engine_Info_SDL *)einfo)->info.noframe = noframe; | 503 | { |
405 | ((Evas_Engine_Info_SDL *)einfo)->info.alpha = alpha; | 504 | ERR("SDL_Init failed with %s", SDL_GetError()); |
406 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | 505 | SDL_Quit(); |
506 | return NULL; | ||
507 | } | ||
508 | |||
509 | einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32; | ||
510 | einfo->info.switch_data = SDL_SetVideoMode(w, h, 32, | ||
511 | (hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE) | ||
512 | | (fullscreen ? SDL_FULLSCREEN : 0) | ||
513 | | (noframe ? SDL_NOFRAME : 0) | ||
514 | | (alpha ? SDL_SRCALPHA : 0) | ||
515 | | SDL_DOUBLEBUF); | ||
516 | if (!einfo->info.switch_data) | ||
517 | { | ||
518 | ERR("SDL_SetVideoMode failed !"); | ||
519 | ecore_evas_free(ee); | ||
520 | return NULL; | ||
521 | } | ||
522 | |||
523 | SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0); | ||
524 | SDL_FillRect(einfo->info.switch_data, NULL, 0); | ||
525 | |||
526 | einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels; | ||
527 | einfo->info.dest_buffer_row_bytes = w * sizeof (int); | ||
528 | einfo->info.use_color_key = 0; | ||
529 | einfo->info.alpha_threshold = 0; | ||
530 | einfo->info.func.new_update_region = NULL; | ||
531 | einfo->info.func.free_update_region = NULL; | ||
532 | einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer; | ||
533 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo)) | ||
407 | { | 534 | { |
408 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | 535 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); |
409 | ecore_evas_free(ee); | 536 | ecore_evas_free(ee); |
@@ -416,16 +543,17 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu | |||
416 | ecore_evas_free(ee); | 543 | ecore_evas_free(ee); |
417 | return NULL; | 544 | return NULL; |
418 | } | 545 | } |
419 | #endif | ||
420 | } | 546 | } |
421 | else if (rmethod == evas_render_method_lookup("gl_sdl")) | 547 | else if (rmethod == evas_render_method_lookup("gl_sdl")) |
422 | { | 548 | { |
423 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL | 549 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL |
424 | einfo = evas_engine_info_get(ee->evas); | 550 | Evas_Engine_Info_GL_SDL *einfo; |
551 | |||
552 | einfo = (Evas_Engine_Info_GL_SDL *) evas_engine_info_get(ee->evas); | ||
425 | if (einfo) | 553 | if (einfo) |
426 | { | 554 | { |
427 | ((Evas_Engine_Info_GL_SDL *)einfo)->flags.fullscreen = fullscreen; | 555 | einfo->flags.fullscreen = fullscreen; |
428 | ((Evas_Engine_Info_GL_SDL *)einfo)->flags.noframe = noframe; | 556 | einfo->flags.noframe = noframe; |
429 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | 557 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) |
430 | { | 558 | { |
431 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | 559 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); |
@@ -464,7 +592,7 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu | |||
464 | (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, | 592 | (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, |
465 | (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); | 593 | (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); |
466 | 594 | ||
467 | SDL_ShowCursor(SDL_DISABLE); | 595 | SDL_ShowCursor(SDL_ENABLE); |
468 | 596 | ||
469 | ee->engine.func->fn_render = _ecore_evas_sdl_render; | 597 | ee->engine.func->fn_render = _ecore_evas_sdl_render; |
470 | _ecore_evas_register(ee); | 598 | _ecore_evas_register(ee); |
@@ -481,11 +609,10 @@ ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface | |||
481 | Ecore_Evas *ee; | 609 | Ecore_Evas *ee; |
482 | int rmethod; | 610 | int rmethod; |
483 | 611 | ||
484 | rmethod = evas_render_method_lookup("software_sdl"); | 612 | rmethod = evas_render_method_lookup("buffer"); |
485 | if (!rmethod) return NULL; | 613 | if (!rmethod) return NULL; |
486 | 614 | ||
487 | ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha); | 615 | ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha); |
488 | ee->driver = "sdl"; | ||
489 | return ee; | 616 | return ee; |
490 | } | 617 | } |
491 | #else | 618 | #else |
@@ -497,28 +624,12 @@ ecore_evas_sdl_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED | |||
497 | } | 624 | } |
498 | #endif | 625 | #endif |
499 | 626 | ||
500 | #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL | ||
501 | EAPI Ecore_Evas* | ||
502 | ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha) | ||
503 | { | ||
504 | Ecore_Evas *ee; | ||
505 | int rmethod; | ||
506 | |||
507 | rmethod = evas_render_method_lookup("software_16_sdl"); | ||
508 | if (!rmethod) return NULL; | ||
509 | |||
510 | ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha); | ||
511 | ee->driver = "software_16_sdl"; | ||
512 | return ee; | ||
513 | } | ||
514 | #else | ||
515 | EAPI Ecore_Evas* | 627 | EAPI Ecore_Evas* |
516 | ecore_evas_sdl16_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int hwsurface __UNUSED__, int noframe __UNUSED__, int alpha __UNUSED__) | 628 | ecore_evas_sdl16_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int hwsurface __UNUSED__, int noframe __UNUSED__, int alpha __UNUSED__) |
517 | { | 629 | { |
518 | ERR("OUTCH !"); | 630 | ERR("OUTCH !"); |
519 | return NULL; | 631 | return NULL; |
520 | } | 632 | } |
521 | #endif | ||
522 | 633 | ||
523 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL | 634 | #ifdef BUILD_ECORE_EVAS_OPENGL_SDL |
524 | EAPI Ecore_Evas* | 635 | EAPI Ecore_Evas* |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c index 72e8555..e88fc35 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifdef HAVE_CONFIG_H | 1 | #ifdef HAVE_CONFIG_H |
2 | # include <config.h> | 2 | # include "config.h" |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #define LOGFNS 1 | 5 | //#define LOGFNS 1 |
6 | 6 | ||
7 | #ifdef LOGFNS | 7 | #ifdef LOGFNS |
8 | # include <stdio.h> | 8 | # include <stdio.h> |
@@ -28,15 +28,15 @@ | |||
28 | #include "Ecore_Evas.h" | 28 | #include "Ecore_Evas.h" |
29 | 29 | ||
30 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | 30 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL |
31 | # include <wayland-egl.h> | ||
32 | # include <Evas_Engine_Wayland_Egl.h> | 31 | # include <Evas_Engine_Wayland_Egl.h> |
33 | # include <Ecore_Wayland.h> | 32 | # include <Ecore_Wayland.h> |
34 | 33 | ||
35 | /* local structures */ | 34 | /* local structures */ |
36 | typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data; | 35 | typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data; |
37 | struct _EE_Wl_Smart_Data | 36 | struct _EE_Wl_Smart_Data |
38 | { | 37 | { |
39 | Evas_Object *frame, *text; | 38 | Evas_Object *frame; |
39 | Evas_Object *text; | ||
40 | Evas_Coord x, y, w, h; | 40 | Evas_Coord x, y, w, h; |
41 | }; | 41 | }; |
42 | 42 | ||
@@ -51,40 +51,33 @@ static void _ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*fu | |||
51 | static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | 51 | static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); |
52 | static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | 52 | static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); |
53 | static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | 53 | static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); |
54 | static void _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | ||
54 | static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y); | 55 | static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y); |
55 | static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h); | 56 | static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h); |
56 | static void _ecore_evas_wl_show(Ecore_Evas *ee); | 57 | static void _ecore_evas_wl_show(Ecore_Evas *ee); |
57 | static void _ecore_evas_wl_hide(Ecore_Evas *ee); | 58 | static void _ecore_evas_wl_hide(Ecore_Evas *ee); |
58 | static void _ecore_evas_wl_raise(Ecore_Evas *ee); | 59 | static void _ecore_evas_wl_raise(Ecore_Evas *ee); |
59 | static void _ecore_evas_wl_lower(Ecore_Evas *ee); | 60 | static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title); |
60 | static void _ecore_evas_wl_activate(Ecore_Evas *ee); | ||
61 | static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t); | ||
62 | static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c); | 61 | static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c); |
63 | static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h); | 62 | static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h); |
64 | static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h); | 63 | static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h); |
65 | static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h); | 64 | static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h); |
66 | static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h); | 65 | static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h); |
67 | static void _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y); | ||
68 | static void _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__); | ||
69 | static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer); | 66 | static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer); |
70 | static void _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__); | ||
71 | static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify); | 67 | static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify); |
72 | static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max); | 68 | static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max); |
73 | static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__); | 69 | static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full); |
70 | static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore); | ||
71 | static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha); | ||
72 | static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent); | ||
74 | static int _ecore_evas_wl_render(Ecore_Evas *ee); | 73 | static int _ecore_evas_wl_render(Ecore_Evas *ee); |
75 | static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h); | 74 | static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h); |
76 | 75 | ||
77 | static Eina_Bool _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event); | 76 | static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); |
78 | static Eina_Bool _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event); | 77 | static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event); |
79 | static Eina_Bool _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event); | 78 | static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event); |
80 | static Eina_Bool _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event); | 79 | static Eina_Bool _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event); |
81 | static Eina_Bool _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); | 80 | static Eina_Bool _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event); |
82 | static Eina_Bool _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event); | ||
83 | static Eina_Bool _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event); | ||
84 | static Eina_Bool _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event); | ||
85 | |||
86 | static void _ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface __UNUSED__, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height); | ||
87 | static void _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__); | ||
88 | 81 | ||
89 | /* SMART stuff for frame */ | 82 | /* SMART stuff for frame */ |
90 | static Evas_Smart *_ecore_evas_wl_smart = NULL; | 83 | static Evas_Smart *_ecore_evas_wl_smart = NULL; |
@@ -100,94 +93,94 @@ static Evas_Object *_ecore_evas_wl_frame_add(Evas *evas); | |||
100 | 93 | ||
101 | /* local variables */ | 94 | /* local variables */ |
102 | static int _ecore_evas_wl_init_count = 0; | 95 | static int _ecore_evas_wl_init_count = 0; |
103 | static Ecore_Event_Handler *_ecore_evas_wl_event_handlers[8]; | 96 | static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5]; |
104 | static uint32_t _ecore_evas_wl_btn_timestamp; | ||
105 | static const struct wl_shell_surface_listener _ecore_evas_wl_shell_surface_listener = | ||
106 | { | ||
107 | _ecore_evas_wl_handle_configure, | ||
108 | _ecore_evas_wl_handle_popup_done | ||
109 | }; | ||
110 | 97 | ||
111 | static Ecore_Evas_Engine_Func _ecore_wl_engine_func = | 98 | static Ecore_Evas_Engine_Func _ecore_wl_engine_func = |
112 | { | 99 | { |
113 | _ecore_evas_wl_free, | 100 | _ecore_evas_wl_free, |
114 | _ecore_evas_wl_callback_resize_set, | 101 | _ecore_evas_wl_callback_resize_set, |
115 | _ecore_evas_wl_callback_move_set, | 102 | _ecore_evas_wl_callback_move_set, |
116 | NULL, // callback show set | 103 | NULL, |
117 | NULL, // callback hide set | 104 | NULL, |
118 | _ecore_evas_wl_callback_delete_request_set, | 105 | _ecore_evas_wl_callback_delete_request_set, |
119 | NULL, // callback destroy set | 106 | NULL, |
120 | _ecore_evas_wl_callback_focus_in_set, | 107 | _ecore_evas_wl_callback_focus_in_set, |
121 | _ecore_evas_wl_callback_focus_out_set, | 108 | _ecore_evas_wl_callback_focus_out_set, |
122 | _ecore_evas_wl_callback_mouse_in_set, | 109 | _ecore_evas_wl_callback_mouse_in_set, |
123 | NULL, // callback mouse out set | 110 | _ecore_evas_wl_callback_mouse_out_set, |
124 | NULL, // callback sticky set | 111 | NULL, // sticky_set |
125 | NULL, // callback unsticky set | 112 | NULL, // unsticky_set |
126 | NULL, // callback pre render set | 113 | NULL, // pre_render_set |
127 | NULL, // callback post render set | 114 | NULL, // post_render_set |
128 | _ecore_evas_wl_move, | 115 | _ecore_evas_wl_move, |
129 | NULL, // func managed move | 116 | NULL, // managed_move |
130 | _ecore_evas_wl_resize, | 117 | _ecore_evas_wl_resize, |
131 | NULL, // _ecore_evas_wl_move_resize, | 118 | NULL, // move_resize |
132 | NULL, // func rotation set | 119 | NULL, // rotation_set |
133 | NULL, // func shaped set | 120 | NULL, // shaped_set |
134 | _ecore_evas_wl_show, | 121 | _ecore_evas_wl_show, |
135 | _ecore_evas_wl_hide, | 122 | _ecore_evas_wl_hide, |
136 | _ecore_evas_wl_raise, | 123 | _ecore_evas_wl_raise, |
137 | _ecore_evas_wl_lower, | 124 | NULL, // lower |
138 | _ecore_evas_wl_activate, | 125 | NULL, // activate |
139 | _ecore_evas_wl_title_set, | 126 | _ecore_evas_wl_title_set, |
140 | _ecore_evas_wl_name_class_set, | 127 | _ecore_evas_wl_name_class_set, |
141 | _ecore_evas_wl_size_min_set, | 128 | _ecore_evas_wl_size_min_set, |
142 | _ecore_evas_wl_size_max_set, | 129 | _ecore_evas_wl_size_max_set, |
143 | _ecore_evas_wl_size_base_set, | 130 | _ecore_evas_wl_size_base_set, |
144 | _ecore_evas_wl_size_step_set, | 131 | _ecore_evas_wl_size_step_set, |
145 | _ecore_evas_wl_object_cursor_set, | 132 | NULL, // object_cursor_set |
146 | _ecore_evas_wl_layer_set, | 133 | _ecore_evas_wl_layer_set, |
147 | _ecore_evas_wl_focus_set, | 134 | NULL, // focus set |
148 | _ecore_evas_wl_iconified_set, | 135 | _ecore_evas_wl_iconified_set, |
149 | NULL, // func borderless set | 136 | NULL, // borderless set |
150 | NULL, // func override set | 137 | NULL, // override set |
151 | _ecore_evas_wl_maximized_set, | 138 | _ecore_evas_wl_maximized_set, |
152 | _ecore_evas_wl_fullscreen_set, | 139 | _ecore_evas_wl_fullscreen_set, |
153 | NULL, // _ecore_evas_wl_avoid_damage_set, | 140 | NULL, // func avoid_damage set |
154 | NULL, // func withdrawn set | 141 | NULL, // func withdrawn set |
155 | NULL, // func sticky set | 142 | NULL, // func sticky set |
156 | NULL, // func ignore events set | 143 | _ecore_evas_wl_ignore_events_set, |
157 | NULL, // func alpha set | 144 | _ecore_evas_wl_alpha_set, |
158 | NULL, // func transparent set | 145 | _ecore_evas_wl_transparent_set, |
146 | NULL, | ||
147 | NULL, | ||
148 | NULL, | ||
149 | NULL, | ||
150 | NULL, | ||
151 | NULL, | ||
159 | _ecore_evas_wl_render, | 152 | _ecore_evas_wl_render, |
160 | _ecore_evas_wl_screen_geometry_get | 153 | _ecore_evas_wl_screen_geometry_get |
161 | }; | 154 | }; |
162 | 155 | ||
163 | #endif | 156 | /* external variables */ |
164 | 157 | ||
165 | #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL | 158 | /* external functions */ |
166 | EAPI Ecore_Evas * | 159 | EAPI Ecore_Evas * |
167 | ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame) | 160 | ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame) |
168 | { | 161 | { |
162 | Ecore_Wl_Window *p = NULL; | ||
169 | Evas_Engine_Info_Wayland_Egl *einfo; | 163 | Evas_Engine_Info_Wayland_Egl *einfo; |
170 | Ecore_Evas *ee; | 164 | Ecore_Evas *ee; |
171 | int method = 0; | 165 | int method = 0; |
172 | static int _win_id = 1; | ||
173 | 166 | ||
174 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 167 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
175 | 168 | ||
176 | if (!(method = evas_render_method_lookup("wayland_egl"))) | 169 | if (!(method = evas_render_method_lookup("wayland_egl"))) |
177 | { | 170 | { |
178 | printf("Render method lookup failed for Wayland Egl"); | 171 | ERR("Render method lookup failed for Wayland_Egl"); |
179 | return NULL; | 172 | return NULL; |
180 | } | 173 | } |
181 | 174 | ||
182 | if (!ecore_wl_init(disp_name)) | 175 | if (!ecore_wl_init(disp_name)) |
183 | { | 176 | { |
184 | printf("Failed to initialize Ecore Wayland"); | 177 | ERR("Failed to initialize Ecore_Wayland"); |
185 | return NULL; | 178 | return NULL; |
186 | } | 179 | } |
187 | 180 | ||
188 | if (!(ee = calloc(1, sizeof(Ecore_Evas)))) | 181 | if (!(ee = calloc(1, sizeof(Ecore_Evas)))) |
189 | { | 182 | { |
190 | printf("Failed to allocate Ecore_Evas."); | 183 | ERR("Failed to allocate Ecore_Evas"); |
191 | ecore_wl_shutdown(); | 184 | ecore_wl_shutdown(); |
192 | return NULL; | 185 | return NULL; |
193 | } | 186 | } |
@@ -204,17 +197,22 @@ ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, in | |||
204 | if (w < 1) w = 1; | 197 | if (w < 1) w = 1; |
205 | if (h < 1) h = 1; | 198 | if (h < 1) h = 1; |
206 | 199 | ||
207 | ee->req.x = ee->x = x; | 200 | ee->x = x; |
208 | ee->req.y = ee->y = y; | 201 | ee->y = y; |
209 | ee->req.w = ee->w = w; | 202 | ee->w = w; |
210 | ee->req.h = ee->h = h; | 203 | ee->h = h; |
204 | ee->req.x = ee->x; | ||
205 | ee->req.y = ee->y; | ||
206 | ee->req.w = ee->w; | ||
207 | ee->req.h = ee->h; | ||
211 | ee->rotation = 0; | 208 | ee->rotation = 0; |
212 | ee->prop.max.w = ee->prop.max.h = 32767; | 209 | ee->prop.max.w = 32767; |
210 | ee->prop.max.h = 32767; | ||
213 | ee->prop.layer = 4; | 211 | ee->prop.layer = 4; |
214 | ee->prop.request_pos = 0; | 212 | ee->prop.request_pos = 0; |
215 | ee->prop.sticky = 0; | 213 | ee->prop.sticky = 0; |
216 | ee->prop.draw_frame = frame; | 214 | ee->prop.draw_frame = frame; |
217 | ee->prop.window = _win_id++; | 215 | ee->alpha = EINA_FALSE; |
218 | 216 | ||
219 | ee->evas = evas_new(); | 217 | ee->evas = evas_new(); |
220 | evas_data_attach_set(ee->evas, ee); | 218 | evas_data_attach_set(ee->evas, ee); |
@@ -222,29 +220,43 @@ ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, in | |||
222 | evas_output_size_set(ee->evas, ee->w, ee->h); | 220 | evas_output_size_set(ee->evas, ee->w, ee->h); |
223 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); | 221 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); |
224 | 222 | ||
225 | if (ee->prop.draw_frame) | 223 | /* FIXME: This needs to be set based on theme & scale */ |
224 | if (ee->prop.draw_frame) | ||
226 | evas_output_framespace_set(ee->evas, 4, 18, 8, 22); | 225 | evas_output_framespace_set(ee->evas, 4, 18, 8, 22); |
227 | 226 | ||
228 | if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas))) | 227 | if (parent) |
228 | p = ecore_wl_window_find(parent); | ||
229 | |||
230 | /* FIXME: Get if parent is alpha, and set */ | ||
231 | |||
232 | ee->engine.wl.parent = p; | ||
233 | ee->engine.wl.win = | ||
234 | ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW); | ||
235 | ee->prop.window = ee->engine.wl.win->id; | ||
236 | |||
237 | if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas))) | ||
229 | { | 238 | { |
230 | einfo->info.display = ecore_wl_display_get(); | 239 | einfo->info.display = ecore_wl_display_get(); |
240 | einfo->info.destination_alpha = EINA_FALSE; | ||
231 | einfo->info.rotation = ee->rotation; | 241 | einfo->info.rotation = ee->rotation; |
232 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | 242 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) |
233 | { | 243 | { |
234 | printf("Failed to set Evas Engine Info for '%s'.", ee->driver); | 244 | ERR("Failed to set Evas Engine Info for '%s'", ee->driver); |
235 | ecore_evas_free(ee); | 245 | ecore_evas_free(ee); |
246 | _ecore_evas_wl_shutdown(); | ||
247 | ecore_wl_shutdown(); | ||
236 | return NULL; | 248 | return NULL; |
237 | } | 249 | } |
238 | } | 250 | } |
239 | else | 251 | else |
240 | { | 252 | { |
241 | printf("Failed to get Evas Engine Info for '%s'.", ee->driver); | 253 | ERR("Failed to get Evas Engine Info for '%s'", ee->driver); |
242 | ecore_evas_free(ee); | 254 | ecore_evas_free(ee); |
255 | _ecore_evas_wl_shutdown(); | ||
256 | ecore_wl_shutdown(); | ||
243 | return NULL; | 257 | return NULL; |
244 | } | 258 | } |
245 | 259 | ||
246 | /* NB: we need to be notified before 'free' so we can munmap the evas | ||
247 | * engine destination */ | ||
248 | ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free); | 260 | ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free); |
249 | 261 | ||
250 | if (ee->prop.draw_frame) | 262 | if (ee->prop.draw_frame) |
@@ -270,37 +282,28 @@ ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, in | |||
270 | 282 | ||
271 | /* local functions */ | 283 | /* local functions */ |
272 | static int | 284 | static int |
273 | _ecore_evas_wl_init(void) | 285 | _ecore_evas_wl_init(void) |
274 | { | 286 | { |
275 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 287 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
276 | 288 | ||
277 | if (++_ecore_evas_wl_init_count != 1) | 289 | if (++_ecore_evas_wl_init_count != 1) |
278 | return _ecore_evas_wl_init_count; | 290 | return _ecore_evas_wl_init_count; |
279 | 291 | ||
280 | _ecore_evas_wl_event_handlers[0] = | 292 | _ecore_evas_wl_event_hdls[0] = |
281 | ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, | ||
282 | _ecore_evas_wl_event_mouse_down, NULL); | ||
283 | _ecore_evas_wl_event_handlers[1] = | ||
284 | ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, | ||
285 | _ecore_evas_wl_event_mouse_up, NULL); | ||
286 | _ecore_evas_wl_event_handlers[2] = | ||
287 | ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, | ||
288 | _ecore_evas_wl_event_mouse_move, NULL); | ||
289 | _ecore_evas_wl_event_handlers[3] = | ||
290 | ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, | ||
291 | _ecore_evas_wl_event_mouse_wheel, NULL); | ||
292 | _ecore_evas_wl_event_handlers[4] = | ||
293 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN, | 293 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN, |
294 | _ecore_evas_wl_event_mouse_in, NULL); | 294 | _ecore_evas_wl_cb_mouse_in, NULL); |
295 | _ecore_evas_wl_event_handlers[5] = | 295 | _ecore_evas_wl_event_hdls[1] = |
296 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT, | 296 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT, |
297 | _ecore_evas_wl_event_mouse_out, NULL); | 297 | _ecore_evas_wl_cb_mouse_out, NULL); |
298 | _ecore_evas_wl_event_handlers[6] = | 298 | _ecore_evas_wl_event_hdls[2] = |
299 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN, | 299 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN, |
300 | _ecore_evas_wl_event_focus_in, NULL); | 300 | _ecore_evas_wl_cb_focus_in, NULL); |
301 | _ecore_evas_wl_event_handlers[7] = | 301 | _ecore_evas_wl_event_hdls[3] = |
302 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, | 302 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, |
303 | _ecore_evas_wl_event_focus_out, NULL); | 303 | _ecore_evas_wl_cb_focus_out, NULL); |
304 | _ecore_evas_wl_event_hdls[4] = | ||
305 | ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, | ||
306 | _ecore_evas_wl_cb_window_configure, NULL); | ||
304 | 307 | ||
305 | ecore_event_evas_init(); | 308 | ecore_event_evas_init(); |
306 | 309 | ||
@@ -308,7 +311,7 @@ _ecore_evas_wl_init(void) | |||
308 | } | 311 | } |
309 | 312 | ||
310 | static int | 313 | static int |
311 | _ecore_evas_wl_shutdown(void) | 314 | _ecore_evas_wl_shutdown(void) |
312 | { | 315 | { |
313 | unsigned int i = 0; | 316 | unsigned int i = 0; |
314 | 317 | ||
@@ -317,10 +320,10 @@ _ecore_evas_wl_shutdown(void) | |||
317 | if (--_ecore_evas_wl_init_count != 0) | 320 | if (--_ecore_evas_wl_init_count != 0) |
318 | return _ecore_evas_wl_init_count; | 321 | return _ecore_evas_wl_init_count; |
319 | 322 | ||
320 | for (i = 0; i < sizeof(_ecore_evas_wl_event_handlers) / sizeof(Ecore_Event_Handler *); i++) | 323 | for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++) |
321 | { | 324 | { |
322 | if (_ecore_evas_wl_event_handlers[i]) | 325 | if (_ecore_evas_wl_event_hdls[i]) |
323 | ecore_event_handler_del(_ecore_evas_wl_event_handlers[i]); | 326 | ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]); |
324 | } | 327 | } |
325 | 328 | ||
326 | ecore_event_evas_shutdown(); | 329 | ecore_event_evas_shutdown(); |
@@ -338,24 +341,16 @@ _ecore_evas_wl_pre_free(Ecore_Evas *ee) | |||
338 | } | 341 | } |
339 | 342 | ||
340 | static void | 343 | static void |
341 | _ecore_evas_wl_free(Ecore_Evas *ee) | 344 | _ecore_evas_wl_free(Ecore_Evas *ee) |
342 | { | 345 | { |
343 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 346 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
344 | 347 | ||
345 | if (ee) | 348 | if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win); |
346 | { | 349 | ee->engine.wl.win = NULL; |
347 | /* destroy shell surface */ | ||
348 | if (ee->engine.wl.shell_surface) | ||
349 | wl_shell_surface_destroy(ee->engine.wl.shell_surface); | ||
350 | ee->engine.wl.shell_surface = NULL; | ||
351 | 350 | ||
352 | /* destroy surface */ | 351 | ecore_event_window_unregister(ee->prop.window); |
353 | if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface); | 352 | ecore_evas_input_event_unregister(ee); |
354 | ee->engine.wl.surface = NULL; | ||
355 | 353 | ||
356 | ecore_event_window_unregister(ee->prop.window); | ||
357 | ecore_evas_input_event_unregister(ee); | ||
358 | } | ||
359 | _ecore_evas_wl_shutdown(); | 354 | _ecore_evas_wl_shutdown(); |
360 | ecore_wl_shutdown(); | 355 | ecore_wl_shutdown(); |
361 | } | 356 | } |
@@ -415,138 +410,131 @@ _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee | |||
415 | } | 410 | } |
416 | 411 | ||
417 | static void | 412 | static void |
418 | _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y) | 413 | _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)) |
414 | { | ||
415 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
416 | |||
417 | if (!ee) return; | ||
418 | ee->func.fn_mouse_out = func; | ||
419 | } | ||
420 | |||
421 | static void | ||
422 | _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y) | ||
419 | { | 423 | { |
420 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 424 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
421 | 425 | ||
422 | if (!ee) return; | 426 | if (!ee) return; |
423 | // if ((ee->x == x) && (ee->y == y)) return; | ||
424 | ee->req.x = x; | 427 | ee->req.x = x; |
425 | ee->req.y = y; | 428 | ee->req.y = y; |
426 | |||
427 | ee->x = x; | 429 | ee->x = x; |
428 | ee->y = y; | 430 | ee->y = y; |
429 | if (ee->engine.wl.shell_surface) | 431 | if (ee->engine.wl.win) ecore_wl_window_move(ee->engine.wl.win, x, y); |
430 | { | ||
431 | wl_shell_surface_move(ee->engine.wl.shell_surface, | ||
432 | ecore_wl_input_device_get(), | ||
433 | _ecore_evas_wl_btn_timestamp); | ||
434 | } | ||
435 | if (ee->func.fn_move) ee->func.fn_move(ee); | 432 | if (ee->func.fn_move) ee->func.fn_move(ee); |
436 | } | 433 | } |
437 | 434 | ||
438 | static void | 435 | static void |
439 | _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h) | 436 | _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h) |
440 | { | 437 | { |
441 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 438 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
442 | 439 | ||
443 | if (!ee) return; | 440 | if (!ee) return; |
444 | if (w < 1) w = 1; | 441 | if (w < 1) w = 1; |
445 | if (h < 1) h = 1; | 442 | if (h < 1) h = 1; |
446 | if ((ee->w == w) && (ee->h == h)) return; | 443 | // if ((ee->w == w) && (ee->h == h)) return; |
444 | |||
445 | if (ee->prop.min.w > w) w = ee->prop.min.w; | ||
446 | else if (w > ee->prop.max.w) w = ee->prop.max.w; | ||
447 | if (ee->prop.min.h > h) h = ee->prop.min.h; | ||
448 | else if (h > ee->prop.max.h) h = ee->prop.max.h; | ||
447 | 449 | ||
448 | ee->req.w = w; | 450 | ee->req.w = w; |
449 | ee->req.h = h; | 451 | ee->req.h = h; |
450 | 452 | ||
451 | /* if (ee->visible) */ | 453 | // ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); |
452 | /* { */ | ||
453 | /* damage old surface, if it exists */ | ||
454 | |||
455 | /* NB: This removes any lingering screen artifacts in the compositor. | ||
456 | * This may be a 'HACK' if the issue is actually in the wayland | ||
457 | * compositor, but for now lets implement this so we don't have screen | ||
458 | * artifacts laying around during a resize */ | ||
459 | /* if (ee->engine.wl.surface) */ | ||
460 | /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */ | ||
461 | /* } */ | ||
462 | 454 | ||
463 | ee->w = w; | 455 | ee->w = w; |
464 | ee->h = h; | 456 | ee->h = h; |
465 | 457 | ||
466 | // ecore_wl_flush(); | 458 | /* change evas output & viewport sizes */ |
467 | |||
468 | evas_output_size_set(ee->evas, ee->w, ee->h); | 459 | evas_output_size_set(ee->evas, ee->w, ee->h); |
469 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); | 460 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); |
470 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); | 461 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); |
471 | if (ee->engine.wl.frame) | 462 | if (ee->engine.wl.frame) |
472 | evas_object_resize(ee->engine.wl.frame, ee->w, ee->h); | 463 | evas_object_resize(ee->engine.wl.frame, ee->w, ee->h); |
473 | 464 | ||
474 | /* if ((ee->visible) && (ee->engine.wl.surface)) */ | 465 | /* set new engine destination */ |
475 | /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */ | 466 | /* evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); */ |
467 | |||
468 | /* ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); */ | ||
469 | ecore_wl_flush(); | ||
470 | |||
471 | ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h); | ||
476 | 472 | ||
477 | if (ee->func.fn_resize) ee->func.fn_resize(ee); | 473 | if (ee->func.fn_resize) ee->func.fn_resize(ee); |
478 | } | 474 | } |
479 | 475 | ||
480 | static void | 476 | static void |
481 | _ecore_evas_wl_show(Ecore_Evas *ee) | 477 | _ecore_evas_wl_show(Ecore_Evas *ee) |
482 | { | 478 | { |
483 | Evas_Engine_Info_Wayland_Egl *einfo; | 479 | Evas_Engine_Info_Wayland_Egl *einfo; |
484 | 480 | ||
485 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 481 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
486 | 482 | ||
487 | if (!ee) return; | 483 | if ((!ee) || (ee->visible)) return; |
488 | if (ee->visible) return; | ||
489 | |||
490 | einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas); | ||
491 | 484 | ||
492 | /* create new surface */ | 485 | if (ee->engine.wl.win) |
493 | ee->engine.wl.surface = | 486 | { |
494 | wl_compositor_create_surface(ecore_wl_compositor_get()); | 487 | ecore_wl_window_show(ee->engine.wl.win); |
495 | wl_surface_set_user_data(ee->engine.wl.surface, (void *)ee->prop.window); | 488 | ecore_wl_flush(); |
489 | } | ||
496 | 490 | ||
497 | /* create new shell surface */ | 491 | einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas); |
498 | ee->engine.wl.shell_surface = | 492 | if (!einfo) |
499 | wl_shell_get_shell_surface(ecore_wl_shell_get(), ee->engine.wl.surface); | 493 | { |
494 | ERR("Failed to get Evas Engine Info for '%s'", ee->driver); | ||
495 | return; | ||
496 | } | ||
500 | 497 | ||
501 | /* set the engine surface here. This should trigger an egl window create */ | 498 | einfo->info.surface = ecore_wl_window_surface_get(ee->engine.wl.win); |
502 | einfo->info.surface = ee->engine.wl.surface; | ||
503 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); | 499 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); |
504 | 500 | ||
505 | /* add listener for configure events (happen on shell surface resize) */ | ||
506 | wl_shell_surface_add_listener(ee->engine.wl.shell_surface, | ||
507 | &_ecore_evas_wl_shell_surface_listener, ee); | ||
508 | |||
509 | /* Raise this surface to the top */ | ||
510 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | ||
511 | |||
512 | if (ee->engine.wl.frame) | 501 | if (ee->engine.wl.frame) |
513 | { | 502 | { |
514 | evas_object_show(ee->engine.wl.frame); | 503 | evas_object_show(ee->engine.wl.frame); |
515 | evas_object_resize(ee->engine.wl.frame, ee->w, ee->h); | 504 | evas_object_resize(ee->engine.wl.frame, ee->w, ee->h); |
516 | } | 505 | } |
517 | 506 | ||
518 | ecore_wl_flush(); | 507 | /* ecore_wl_window_buffer_attach(ee->engine.wl.win, ee->engine.wl.buffer, 0, 0); */ |
519 | 508 | ||
520 | ee->visible = 1; | 509 | ee->visible = 1; |
521 | if (ee->func.fn_show) ee->func.fn_show(ee); | 510 | if (ee->func.fn_show) ee->func.fn_show(ee); |
522 | } | 511 | } |
523 | 512 | ||
524 | static void | 513 | static void |
525 | _ecore_evas_wl_hide(Ecore_Evas *ee) | 514 | _ecore_evas_wl_hide(Ecore_Evas *ee) |
526 | { | 515 | { |
527 | Evas_Engine_Info_Wayland_Egl *einfo; | 516 | Evas_Engine_Info_Wayland_Egl *einfo; |
528 | 517 | ||
529 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 518 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
530 | 519 | ||
531 | if (!ee) return; | 520 | if ((!ee) || (!ee->visible)) return; |
532 | if (!ee->visible) return; | ||
533 | |||
534 | /* get engine info */ | ||
535 | einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas); | ||
536 | einfo->info.surface = NULL; | ||
537 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); | ||
538 | 521 | ||
539 | /* destroy shell surface */ | 522 | if (ee->engine.wl.win) |
540 | if (ee->engine.wl.shell_surface) | 523 | { |
541 | wl_shell_surface_destroy(ee->engine.wl.shell_surface); | 524 | ecore_wl_window_hide(ee->engine.wl.win); |
542 | ee->engine.wl.shell_surface = NULL; | 525 | ecore_wl_flush(); |
526 | } | ||
543 | 527 | ||
544 | /* destroy surface */ | 528 | einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas); |
545 | if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface); | 529 | if (einfo) |
546 | ee->engine.wl.surface = NULL; | 530 | { |
531 | einfo->info.surface = NULL; | ||
532 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); | ||
533 | } | ||
547 | 534 | ||
548 | ee->visible = 0; | 535 | ee->visible = 0; |
549 | ee->should_be_visible = 0; | 536 | ee->should_be_visible = 0; |
537 | |||
550 | if (ee->func.fn_hide) ee->func.fn_hide(ee); | 538 | if (ee->func.fn_hide) ee->func.fn_hide(ee); |
551 | } | 539 | } |
552 | 540 | ||
@@ -556,39 +544,18 @@ _ecore_evas_wl_raise(Ecore_Evas *ee) | |||
556 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 544 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
557 | 545 | ||
558 | if ((!ee) || (!ee->visible)) return; | 546 | if ((!ee) || (!ee->visible)) return; |
559 | if (!ee->engine.wl.shell_surface) return; | 547 | ecore_wl_window_raise(ee->engine.wl.win); |
560 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | ||
561 | } | ||
562 | |||
563 | static void | ||
564 | _ecore_evas_wl_lower(Ecore_Evas *ee) | ||
565 | { | ||
566 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
567 | |||
568 | if ((!ee) || (!ee->visible)) return; | ||
569 | /* FIXME: Need a way to tell Wayland to lower */ | ||
570 | } | ||
571 | |||
572 | static void | ||
573 | _ecore_evas_wl_activate(Ecore_Evas *ee) | ||
574 | { | ||
575 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
576 | |||
577 | if ((!ee) || (!ee->visible)) return; | ||
578 | if (!ee->engine.wl.shell_surface) return; | ||
579 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | ||
580 | } | 548 | } |
581 | 549 | ||
582 | static void | 550 | static void |
583 | _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t) | 551 | _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title) |
584 | { | 552 | { |
585 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 553 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
586 | 554 | ||
587 | if (!ee) return; | 555 | if (!ee) return; |
588 | if (ee->prop.title) free(ee->prop.title); | 556 | if (ee->prop.title) free(ee->prop.title); |
589 | ee->prop.title = NULL; | 557 | ee->prop.title = NULL; |
590 | if (t) ee->prop.title = strdup(t); | 558 | if (title) ee->prop.title = strdup(title); |
591 | |||
592 | if ((ee->prop.draw_frame) && (ee->engine.wl.frame)) | 559 | if ((ee->prop.draw_frame) && (ee->engine.wl.frame)) |
593 | { | 560 | { |
594 | EE_Wl_Smart_Data *sd; | 561 | EE_Wl_Smart_Data *sd; |
@@ -666,106 +633,101 @@ _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h) | |||
666 | } | 633 | } |
667 | 634 | ||
668 | static void | 635 | static void |
669 | _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y) | 636 | _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer) |
670 | { | 637 | { |
671 | int x = 0, y = 0; | ||
672 | |||
673 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 638 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
674 | 639 | ||
675 | if (!ee) return; | 640 | if (!ee) return; |
676 | if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object); | 641 | if (ee->prop.layer == layer) return; |
677 | ee->prop.cursor.object = NULL; | 642 | if (layer < 1) layer = 1; |
678 | 643 | else if (layer > 255) layer = 255; | |
679 | if (!obj) | 644 | ee->prop.layer = layer; |
680 | { | ||
681 | ee->prop.cursor.layer = 0; | ||
682 | ee->prop.cursor.hot.x = 0; | ||
683 | ee->prop.cursor.hot.y = 0; | ||
684 | return; | ||
685 | } | ||
686 | |||
687 | ee->prop.cursor.object = obj; | ||
688 | ee->prop.cursor.layer = layer; | ||
689 | ee->prop.cursor.hot.x = hot_x; | ||
690 | ee->prop.cursor.hot.y = hot_y; | ||
691 | |||
692 | evas_pointer_output_xy_get(ee->evas, &x, &y); | ||
693 | evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer); | ||
694 | evas_object_move(ee->prop.cursor.object, | ||
695 | x - ee->prop.cursor.hot.x, y - ee->prop.cursor.hot.y); | ||
696 | evas_object_pass_events_set(ee->prop.cursor.object, 1); | ||
697 | if (evas_pointer_inside_get(ee->evas)) | ||
698 | evas_object_show(ee->prop.cursor.object); | ||
699 | |||
700 | evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, | ||
701 | _ecore_evas_wl_object_cursor_del, ee); | ||
702 | } | 645 | } |
703 | 646 | ||
704 | static void | 647 | static void |
705 | _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) | 648 | _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify) |
706 | { | 649 | { |
707 | Ecore_Evas *ee; | 650 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
708 | 651 | ||
709 | if (!(ee = data)) return; | 652 | if (!ee) return; |
710 | ee->prop.cursor.object = NULL; | 653 | if (ee->prop.iconified == iconify) return; |
654 | ee->prop.iconified = iconify; | ||
655 | /* FIXME: Implement this in Wayland someshow */ | ||
711 | } | 656 | } |
712 | 657 | ||
713 | static void | 658 | static void |
714 | _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer) | 659 | _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max) |
715 | { | 660 | { |
716 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 661 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
717 | 662 | ||
718 | if (!ee) return; | 663 | if (!ee) return; |
719 | if (ee->prop.layer == layer) return; | 664 | if (ee->prop.maximized == max) return; |
720 | if (layer < 1) layer = 1; | 665 | ee->prop.maximized = max; |
721 | else if (layer > 255) layer = 255; | 666 | ecore_wl_window_maximized_set(ee->engine.wl.win, max); |
722 | ee->prop.layer = layer; | ||
723 | } | 667 | } |
724 | 668 | ||
725 | static void | 669 | static void |
726 | _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__) | 670 | _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full) |
727 | { | 671 | { |
728 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 672 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
729 | 673 | ||
730 | if ((!ee) || (!ee->visible)) return; | 674 | if ((!ee) || (!ee->visible)) return; |
731 | if (!ee->engine.wl.shell_surface) return; | 675 | if (ee->prop.fullscreen == full) return; |
732 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | 676 | ee->prop.fullscreen = full; |
677 | ecore_wl_window_fullscreen_set(ee->engine.wl.win, full); | ||
733 | } | 678 | } |
734 | 679 | ||
735 | static void | 680 | static void |
736 | _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify) | 681 | _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore) |
737 | { | 682 | { |
738 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 683 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
739 | 684 | ||
740 | if (!ee) return; | 685 | if (!ee) return; |
741 | if (ee->prop.iconified == iconify) return; | 686 | ee->ignore_events = ignore; |
742 | ee->prop.iconified = iconify; | 687 | /* NB: Hmmm, may need to pass this to ecore_wl_window in the future */ |
743 | /* FIXME: Implement this in Wayland someshow */ | ||
744 | } | 688 | } |
745 | 689 | ||
746 | static void | 690 | static void |
747 | _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max) | 691 | _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha) |
748 | { | 692 | { |
693 | Evas_Engine_Info_Wayland_Egl *einfo; | ||
694 | |||
749 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 695 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
750 | 696 | ||
751 | if (!ee) return; | 697 | if (!ee) return; |
752 | if (ee->prop.maximized == max) return; | 698 | if ((ee->alpha == alpha)) return; |
753 | ee->prop.maximized = max; | 699 | ee->alpha = alpha; |
754 | /* FIXME: Implement this in Wayland someshow */ | 700 | if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas))) |
701 | { | ||
702 | einfo->info.destination_alpha = alpha; | ||
703 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | ||
704 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | ||
705 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); | ||
706 | } | ||
755 | } | 707 | } |
756 | 708 | ||
757 | static void | 709 | static void |
758 | _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__) | 710 | _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent) |
759 | { | 711 | { |
712 | Evas_Engine_Info_Wayland_Egl *einfo; | ||
713 | |||
760 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 714 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
761 | 715 | ||
762 | if ((!ee) || (!ee->visible)) return; | 716 | if (!ee) return; |
763 | if (!ee->engine.wl.shell_surface) return; | 717 | if ((ee->transparent == transparent)) return; |
764 | wl_shell_surface_set_fullscreen(ee->engine.wl.shell_surface); | 718 | ee->transparent = transparent; |
719 | if (!ee->visible) return; | ||
720 | if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas))) | ||
721 | { | ||
722 | einfo->info.destination_alpha = transparent; | ||
723 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | ||
724 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | ||
725 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); | ||
726 | } | ||
765 | } | 727 | } |
766 | 728 | ||
767 | static int | 729 | static int |
768 | _ecore_evas_wl_render(Ecore_Evas *ee) | 730 | _ecore_evas_wl_render(Ecore_Evas *ee) |
769 | { | 731 | { |
770 | int rend = 0; | 732 | int rend = 0; |
771 | 733 | ||
@@ -789,26 +751,24 @@ _ecore_evas_wl_render(Ecore_Evas *ee) | |||
789 | 751 | ||
790 | if ((updates = evas_render_updates(ee->evas))) | 752 | if ((updates = evas_render_updates(ee->evas))) |
791 | { | 753 | { |
792 | /* if (ee->engine.wl.surface) */ | 754 | Eina_List *l = NULL; |
793 | /* { */ | 755 | Eina_Rectangle *r; |
794 | /* Eina_List *l = NULL; */ | 756 | |
795 | /* Eina_Rectangle *r; */ | 757 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
796 | 758 | ||
797 | /* EINA_LIST_FOREACH(updates, l, r) */ | 759 | EINA_LIST_FOREACH(updates, l, r) |
798 | /* wl_surface_damage(ee->engine.wl.surface, */ | 760 | ecore_wl_window_damage(ee->engine.wl.win, |
799 | /* r->x, r->y, r->w, r->h); */ | 761 | r->x, r->y, r->w, r->h); |
800 | /* } */ | 762 | |
763 | ecore_wl_flush(); | ||
801 | 764 | ||
802 | evas_render_updates_free(updates); | 765 | evas_render_updates_free(updates); |
803 | _ecore_evas_idle_timeout_update(ee); | 766 | _ecore_evas_idle_timeout_update(ee); |
804 | rend = 1; | 767 | rend = 1; |
805 | |||
806 | ecore_wl_flush(); | ||
807 | } | 768 | } |
808 | 769 | ||
809 | if (ee->func.fn_post_render) ee->func.fn_post_render(ee); | 770 | if (ee->func.fn_post_render) ee->func.fn_post_render(ee); |
810 | } | 771 | } |
811 | |||
812 | return rend; | 772 | return rend; |
813 | } | 773 | } |
814 | 774 | ||
@@ -822,77 +782,18 @@ _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int | |||
822 | ecore_wl_screen_size_get(w, h); | 782 | ecore_wl_screen_size_get(w, h); |
823 | } | 783 | } |
824 | 784 | ||
825 | static Eina_Bool | 785 | void |
826 | _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event) | 786 | _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location) |
827 | { | ||
828 | Ecore_Evas *ee; | ||
829 | Ecore_Event_Mouse_Button *ev; | ||
830 | |||
831 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
832 | |||
833 | ev = event; | ||
834 | _ecore_evas_wl_btn_timestamp = ev->timestamp; | ||
835 | ee = ecore_event_window_match(ev->window); | ||
836 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | ||
837 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
838 | evas_event_feed_mouse_down(ee->evas, ev->buttons, ev->modifiers, | ||
839 | ev->timestamp, NULL); | ||
840 | return ECORE_CALLBACK_PASS_ON; | ||
841 | } | ||
842 | |||
843 | static Eina_Bool | ||
844 | _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event) | ||
845 | { | ||
846 | Ecore_Evas *ee; | ||
847 | Ecore_Event_Mouse_Button *ev; | ||
848 | |||
849 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
850 | |||
851 | ev = event; | ||
852 | ee = ecore_event_window_match(ev->window); | ||
853 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | ||
854 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
855 | evas_event_feed_mouse_up(ee->evas, ev->buttons, ev->modifiers, | ||
856 | ev->timestamp, NULL); | ||
857 | return ECORE_CALLBACK_PASS_ON; | ||
858 | } | ||
859 | |||
860 | static Eina_Bool | ||
861 | _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event) | ||
862 | { | ||
863 | Ecore_Evas *ee; | ||
864 | Ecore_Event_Mouse_Move *ev; | ||
865 | |||
866 | ev = event; | ||
867 | ee = ecore_event_window_match(ev->window); | ||
868 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | ||
869 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
870 | ee->mouse.x = ev->x; | ||
871 | ee->mouse.y = ev->y; | ||
872 | evas_event_feed_mouse_move(ee->evas, ev->x, ev->y, ev->timestamp, NULL); | ||
873 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); | ||
874 | return ECORE_CALLBACK_PASS_ON; | ||
875 | } | ||
876 | |||
877 | static Eina_Bool | ||
878 | _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event) | ||
879 | { | 787 | { |
880 | Ecore_Evas *ee; | ||
881 | Ecore_Event_Mouse_Wheel *ev; | ||
882 | |||
883 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 788 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
884 | 789 | ||
885 | ev = event; | 790 | if (!ee) return; |
886 | ee = ecore_event_window_match(ev->window); | 791 | if (ee->engine.wl.win) |
887 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 792 | ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location); |
888 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
889 | evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z, | ||
890 | ev->timestamp, NULL); | ||
891 | return ECORE_CALLBACK_PASS_ON; | ||
892 | } | 793 | } |
893 | 794 | ||
894 | static Eina_Bool | 795 | static Eina_Bool |
895 | _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event) | 796 | _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event) |
896 | { | 797 | { |
897 | Ecore_Evas *ee; | 798 | Ecore_Evas *ee; |
898 | Ecore_Wl_Event_Mouse_In *ev; | 799 | Ecore_Wl_Event_Mouse_In *ev; |
@@ -900,18 +801,18 @@ _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void * | |||
900 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 801 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
901 | 802 | ||
902 | ev = event; | 803 | ev = event; |
903 | ee = ecore_event_window_match(ev->window); | 804 | ee = ecore_event_window_match(ev->win); |
904 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 805 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
905 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 806 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
906 | if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); | 807 | if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); |
907 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); | 808 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); |
908 | evas_event_feed_mouse_in(ee->evas, ev->time, NULL); | 809 | evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL); |
909 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time); | 810 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); |
910 | return ECORE_CALLBACK_PASS_ON; | 811 | return ECORE_CALLBACK_PASS_ON; |
911 | } | 812 | } |
912 | 813 | ||
913 | static Eina_Bool | 814 | static Eina_Bool |
914 | _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event) | 815 | _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event) |
915 | { | 816 | { |
916 | Ecore_Evas *ee; | 817 | Ecore_Evas *ee; |
917 | Ecore_Wl_Event_Mouse_Out *ev; | 818 | Ecore_Wl_Event_Mouse_Out *ev; |
@@ -919,19 +820,19 @@ _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void | |||
919 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 820 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
920 | 821 | ||
921 | ev = event; | 822 | ev = event; |
922 | ee = ecore_event_window_match(ev->window); | 823 | ee = ecore_event_window_match(ev->win); |
923 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 824 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
924 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 825 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
925 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); | 826 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); |
926 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time); | 827 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); |
927 | evas_event_feed_mouse_out(ee->evas, ev->time, NULL); | 828 | evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); |
928 | if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); | 829 | if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); |
929 | if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); | 830 | if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); |
930 | return ECORE_CALLBACK_PASS_ON; | 831 | return ECORE_CALLBACK_PASS_ON; |
931 | } | 832 | } |
932 | 833 | ||
933 | static Eina_Bool | 834 | static Eina_Bool |
934 | _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event) | 835 | _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event) |
935 | { | 836 | { |
936 | Ecore_Evas *ee; | 837 | Ecore_Evas *ee; |
937 | Ecore_Wl_Event_Focus_In *ev; | 838 | Ecore_Wl_Event_Focus_In *ev; |
@@ -939,9 +840,9 @@ _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void * | |||
939 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 840 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
940 | 841 | ||
941 | ev = event; | 842 | ev = event; |
942 | ee = ecore_event_window_match(ev->window); | 843 | ee = ecore_event_window_match(ev->win); |
943 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 844 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
944 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 845 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
945 | ee->prop.focused = 1; | 846 | ee->prop.focused = 1; |
946 | evas_focus_in(ee->evas); | 847 | evas_focus_in(ee->evas); |
947 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); | 848 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); |
@@ -949,45 +850,51 @@ _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void * | |||
949 | } | 850 | } |
950 | 851 | ||
951 | static Eina_Bool | 852 | static Eina_Bool |
952 | _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event) | 853 | _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event) |
953 | { | 854 | { |
954 | Ecore_Evas *ee; | 855 | Ecore_Evas *ee; |
955 | Ecore_Wl_Event_Focus_Out *ev; | 856 | Ecore_Wl_Event_Focus_In *ev; |
956 | 857 | ||
957 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 858 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
958 | 859 | ||
959 | ev = event; | 860 | ev = event; |
960 | ee = ecore_event_window_match(ev->window); | 861 | ee = ecore_event_window_match(ev->win); |
961 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 862 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
962 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 863 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
963 | evas_focus_out(ee->evas); | 864 | evas_focus_out(ee->evas); |
964 | ee->prop.focused = 0; | 865 | ee->prop.focused = 0; |
965 | if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); | 866 | if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); |
966 | return ECORE_CALLBACK_PASS_ON; | 867 | return ECORE_CALLBACK_PASS_ON; |
967 | } | 868 | } |
968 | 869 | ||
969 | static void | 870 | static Eina_Bool |
970 | _ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height) | 871 | _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event) |
971 | { | 872 | { |
972 | Ecore_Evas *ee; | 873 | Ecore_Evas *ee; |
874 | Ecore_Wl_Event_Window_Configure *ev; | ||
973 | 875 | ||
974 | /* NB: Trap to prevent compositor from crashing */ | 876 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
975 | if ((width <= 0) || (height <= 0)) return; | ||
976 | |||
977 | if (!(ee = data)) return; | ||
978 | 877 | ||
979 | printf("EGL Handle Configure Message\n"); | 878 | ev = event; |
980 | if ((shell_surface) && (ee->engine.wl.shell_surface)) | 879 | ee = ecore_event_window_match(ev->win); |
880 | if (!ee) return ECORE_CALLBACK_PASS_ON; | ||
881 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
882 | if ((ee->x != ev->x) || (ee->y != ev->y)) | ||
981 | { | 883 | { |
982 | if (ee->engine.wl.shell_surface != shell_surface) return; | 884 | ee->x = ev->x; |
983 | ecore_evas_resize(ee, width, height); | 885 | ee->y = ev->y; |
886 | ee->req.x = ee->x; | ||
887 | ee->req.y = ee->y; | ||
888 | if (ee->func.fn_move) ee->func.fn_move(ee); | ||
889 | } | ||
890 | if ((ee->req.w != ev->w) || (ee->req.h != ev->h)) | ||
891 | { | ||
892 | ee->req.w = ev->w; | ||
893 | ee->req.h = ev->h; | ||
894 | if (ee->func.fn_resize) ee->func.fn_resize(ee); | ||
984 | } | 895 | } |
985 | } | ||
986 | |||
987 | static void | ||
988 | _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__) | ||
989 | { | ||
990 | 896 | ||
897 | return ECORE_CALLBACK_PASS_ON; | ||
991 | } | 898 | } |
992 | 899 | ||
993 | static void | 900 | static void |
@@ -1101,30 +1008,9 @@ _ecore_evas_wl_frame_add(Evas *evas) | |||
1101 | return evas_object_smart_add(evas, _ecore_evas_wl_smart); | 1008 | return evas_object_smart_add(evas, _ecore_evas_wl_smart); |
1102 | } | 1009 | } |
1103 | 1010 | ||
1104 | void | ||
1105 | _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location) | ||
1106 | { | ||
1107 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
1108 | |||
1109 | if ((!ee) || (!ee->engine.wl.shell_surface)) return; | ||
1110 | wl_shell_surface_resize(ee->engine.wl.shell_surface, | ||
1111 | ecore_wl_input_device_get(), | ||
1112 | _ecore_evas_wl_btn_timestamp, location); | ||
1113 | } | ||
1114 | |||
1115 | void | ||
1116 | _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) | ||
1117 | { | ||
1118 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
1119 | |||
1120 | if ((!ee) || (!ee->engine.wl.surface)) return; | ||
1121 | if ((!source) || (!drag_ee)) return; | ||
1122 | ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer); | ||
1123 | } | ||
1124 | |||
1125 | #else | 1011 | #else |
1126 | EAPI Ecore_Evas * | 1012 | EAPI Ecore_Evas * |
1127 | ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__) | 1013 | ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__) |
1128 | { | 1014 | { |
1129 | return NULL; | 1015 | return NULL; |
1130 | } | 1016 | } |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c index e3b15c8..4c7ee2d 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c | |||
@@ -2,7 +2,7 @@ | |||
2 | # include "config.h" | 2 | # include "config.h" |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | //#define LOGFNS 1 | 5 | #define LOGFNS 1 |
6 | 6 | ||
7 | #ifdef LOGFNS | 7 | #ifdef LOGFNS |
8 | # include <stdio.h> | 8 | # include <stdio.h> |
@@ -20,12 +20,12 @@ | |||
20 | # include <sys/mman.h> | 20 | # include <sys/mman.h> |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | # include <Eina.h> | 23 | #include <Eina.h> |
24 | # include <Evas.h> | 24 | #include <Evas.h> |
25 | # include <Ecore.h> | 25 | #include <Ecore.h> |
26 | 26 | ||
27 | # include "ecore_evas_private.h" | 27 | #include "ecore_evas_private.h" |
28 | # include "Ecore_Evas.h" | 28 | #include "Ecore_Evas.h" |
29 | 29 | ||
30 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | 30 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM |
31 | # include <Evas_Engine_Wayland_Shm.h> | 31 | # include <Evas_Engine_Wayland_Shm.h> |
@@ -51,41 +51,34 @@ static void _ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*fu | |||
51 | static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | 51 | static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); |
52 | static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | 52 | static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); |
53 | static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | 53 | static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); |
54 | static void _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)); | ||
54 | static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y); | 55 | static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y); |
55 | static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h); | 56 | static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h); |
56 | static void _ecore_evas_wl_show(Ecore_Evas *ee); | 57 | static void _ecore_evas_wl_show(Ecore_Evas *ee); |
57 | static void _ecore_evas_wl_hide(Ecore_Evas *ee); | 58 | static void _ecore_evas_wl_hide(Ecore_Evas *ee); |
58 | static void _ecore_evas_wl_raise(Ecore_Evas *ee); | 59 | static void _ecore_evas_wl_raise(Ecore_Evas *ee); |
59 | static void _ecore_evas_wl_lower(Ecore_Evas *ee); | 60 | static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title); |
60 | static void _ecore_evas_wl_activate(Ecore_Evas *ee); | ||
61 | static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t); | ||
62 | static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c); | 61 | static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c); |
63 | static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h); | 62 | static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h); |
64 | static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h); | 63 | static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h); |
65 | static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h); | 64 | static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h); |
66 | static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h); | 65 | static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h); |
67 | static void _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y); | ||
68 | static void _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__); | ||
69 | static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer); | 66 | static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer); |
70 | static void _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__); | ||
71 | static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify); | 67 | static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify); |
72 | static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max); | 68 | static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max); |
73 | static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__); | 69 | static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full); |
70 | static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore); | ||
71 | static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha); | ||
72 | static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent); | ||
74 | static int _ecore_evas_wl_render(Ecore_Evas *ee); | 73 | static int _ecore_evas_wl_render(Ecore_Evas *ee); |
75 | static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h); | 74 | static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h); |
76 | static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest); | 75 | static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest); |
77 | 76 | ||
78 | static Eina_Bool _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event); | 77 | static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); |
79 | static Eina_Bool _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event); | 78 | static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event); |
80 | static Eina_Bool _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event); | 79 | static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event); |
81 | static Eina_Bool _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event); | 80 | static Eina_Bool _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event); |
82 | static Eina_Bool _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); | 81 | static Eina_Bool _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event); |
83 | static Eina_Bool _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event); | ||
84 | static Eina_Bool _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event); | ||
85 | static Eina_Bool _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event); | ||
86 | |||
87 | static void _ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface __UNUSED__, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height); | ||
88 | static void _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__); | ||
89 | 82 | ||
90 | /* SMART stuff for frame */ | 83 | /* SMART stuff for frame */ |
91 | static Evas_Smart *_ecore_evas_wl_smart = NULL; | 84 | static Evas_Smart *_ecore_evas_wl_smart = NULL; |
@@ -101,95 +94,94 @@ static Evas_Object *_ecore_evas_wl_frame_add(Evas *evas); | |||
101 | 94 | ||
102 | /* local variables */ | 95 | /* local variables */ |
103 | static int _ecore_evas_wl_init_count = 0; | 96 | static int _ecore_evas_wl_init_count = 0; |
104 | static Ecore_Event_Handler *_ecore_evas_wl_event_handlers[8]; | 97 | static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5]; |
105 | static uint32_t _ecore_evas_wl_btn_timestamp; | ||
106 | static const struct wl_shell_surface_listener _ecore_evas_wl_shell_surface_listener = | ||
107 | { | ||
108 | _ecore_evas_wl_handle_configure, | ||
109 | _ecore_evas_wl_handle_popup_done | ||
110 | }; | ||
111 | 98 | ||
112 | static Ecore_Evas_Engine_Func _ecore_wl_engine_func = | 99 | static Ecore_Evas_Engine_Func _ecore_wl_engine_func = |
113 | { | 100 | { |
114 | _ecore_evas_wl_free, | 101 | _ecore_evas_wl_free, |
115 | _ecore_evas_wl_callback_resize_set, | 102 | _ecore_evas_wl_callback_resize_set, |
116 | _ecore_evas_wl_callback_move_set, | 103 | _ecore_evas_wl_callback_move_set, |
117 | NULL, // callback show set | 104 | NULL, |
118 | NULL, // callback hide set | 105 | NULL, |
119 | _ecore_evas_wl_callback_delete_request_set, | 106 | _ecore_evas_wl_callback_delete_request_set, |
120 | NULL, // callback destroy set | 107 | NULL, |
121 | _ecore_evas_wl_callback_focus_in_set, | 108 | _ecore_evas_wl_callback_focus_in_set, |
122 | _ecore_evas_wl_callback_focus_out_set, | 109 | _ecore_evas_wl_callback_focus_out_set, |
123 | _ecore_evas_wl_callback_mouse_in_set, | 110 | _ecore_evas_wl_callback_mouse_in_set, |
124 | NULL, // callback mouse out set | 111 | _ecore_evas_wl_callback_mouse_out_set, |
125 | NULL, // callback sticky set | 112 | NULL, // sticky_set |
126 | NULL, // callback unsticky set | 113 | NULL, // unsticky_set |
127 | NULL, // callback pre render set | 114 | NULL, // pre_render_set |
128 | NULL, // callback post render set | 115 | NULL, // post_render_set |
129 | _ecore_evas_wl_move, | 116 | _ecore_evas_wl_move, |
130 | NULL, // func managed move | 117 | NULL, // managed_move |
131 | _ecore_evas_wl_resize, | 118 | _ecore_evas_wl_resize, |
132 | NULL, // func move_resize | 119 | NULL, // move_resize |
133 | NULL, // func rotation set | 120 | NULL, // rotation_set |
134 | NULL, // func shaped set | 121 | NULL, // shaped_set |
135 | _ecore_evas_wl_show, | 122 | _ecore_evas_wl_show, |
136 | _ecore_evas_wl_hide, | 123 | _ecore_evas_wl_hide, |
137 | _ecore_evas_wl_raise, | 124 | _ecore_evas_wl_raise, |
138 | _ecore_evas_wl_lower, | 125 | NULL, // lower |
139 | _ecore_evas_wl_activate, | 126 | NULL, // activate |
140 | _ecore_evas_wl_title_set, | 127 | _ecore_evas_wl_title_set, |
141 | _ecore_evas_wl_name_class_set, | 128 | _ecore_evas_wl_name_class_set, |
142 | _ecore_evas_wl_size_min_set, | 129 | _ecore_evas_wl_size_min_set, |
143 | _ecore_evas_wl_size_max_set, | 130 | _ecore_evas_wl_size_max_set, |
144 | _ecore_evas_wl_size_base_set, | 131 | _ecore_evas_wl_size_base_set, |
145 | _ecore_evas_wl_size_step_set, | 132 | _ecore_evas_wl_size_step_set, |
146 | _ecore_evas_wl_object_cursor_set, | 133 | NULL, // object_cursor_set |
147 | _ecore_evas_wl_layer_set, | 134 | _ecore_evas_wl_layer_set, |
148 | _ecore_evas_wl_focus_set, | 135 | NULL, // focus set |
149 | _ecore_evas_wl_iconified_set, | 136 | _ecore_evas_wl_iconified_set, |
150 | NULL, // func borderless set | 137 | NULL, // borderless set |
151 | NULL, // func override set | 138 | NULL, // override set |
152 | _ecore_evas_wl_maximized_set, | 139 | _ecore_evas_wl_maximized_set, |
153 | _ecore_evas_wl_fullscreen_set, | 140 | _ecore_evas_wl_fullscreen_set, |
154 | NULL, // func avoid_damage set | 141 | NULL, // func avoid_damage set |
155 | NULL, // func withdrawn set | 142 | NULL, // func withdrawn set |
156 | NULL, // func sticky set | 143 | NULL, // func sticky set |
157 | NULL, // func ignore_events set | 144 | _ecore_evas_wl_ignore_events_set, |
158 | NULL, // func alpha set | 145 | _ecore_evas_wl_alpha_set, |
159 | NULL, // func transparent set | 146 | _ecore_evas_wl_transparent_set, |
147 | NULL, | ||
148 | NULL, | ||
149 | NULL, | ||
150 | NULL, | ||
151 | NULL, | ||
152 | NULL, | ||
160 | _ecore_evas_wl_render, | 153 | _ecore_evas_wl_render, |
161 | _ecore_evas_wl_screen_geometry_get | 154 | _ecore_evas_wl_screen_geometry_get |
162 | }; | 155 | }; |
163 | 156 | ||
164 | /* external variables */ | 157 | /* external variables */ |
165 | #endif | ||
166 | 158 | ||
167 | #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM | 159 | /* external functions */ |
168 | EAPI Ecore_Evas * | 160 | EAPI Ecore_Evas * |
169 | ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame) | 161 | ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame) |
170 | { | 162 | { |
163 | Ecore_Wl_Window *p = NULL; | ||
171 | Evas_Engine_Info_Wayland_Shm *einfo; | 164 | Evas_Engine_Info_Wayland_Shm *einfo; |
172 | Ecore_Evas *ee; | 165 | Ecore_Evas *ee; |
173 | int method = 0; | 166 | int method = 0; |
174 | static int _win_id = 1; | ||
175 | 167 | ||
176 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 168 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
177 | 169 | ||
178 | if (!(method = evas_render_method_lookup("wayland_shm"))) | 170 | if (!(method = evas_render_method_lookup("wayland_shm"))) |
179 | { | 171 | { |
180 | ERR("Render method lookup failed."); | 172 | ERR("Render method lookup failed for Wayland_Shm"); |
181 | return NULL; | 173 | return NULL; |
182 | } | 174 | } |
183 | 175 | ||
184 | if (!(ecore_wl_init(disp_name))) | 176 | if (!ecore_wl_init(disp_name)) |
185 | { | 177 | { |
186 | ERR("Failed to initialize Ecore Wayland."); | 178 | ERR("Failed to initialize Ecore_Wayland"); |
187 | return NULL; | 179 | return NULL; |
188 | } | 180 | } |
189 | 181 | ||
190 | if (!(ee = calloc(1, sizeof(Ecore_Evas)))) | 182 | if (!(ee = calloc(1, sizeof(Ecore_Evas)))) |
191 | { | 183 | { |
192 | ERR("Failed to allocate Ecore_Evas."); | 184 | ERR("Failed to allocate Ecore_Evas"); |
193 | ecore_wl_shutdown(); | 185 | ecore_wl_shutdown(); |
194 | return NULL; | 186 | return NULL; |
195 | } | 187 | } |
@@ -206,17 +198,21 @@ ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, in | |||
206 | if (w < 1) w = 1; | 198 | if (w < 1) w = 1; |
207 | if (h < 1) h = 1; | 199 | if (h < 1) h = 1; |
208 | 200 | ||
209 | ee->req.x = ee->x = x; | 201 | ee->x = x; |
210 | ee->req.y = ee->y = y; | 202 | ee->y = y; |
211 | ee->req.w = ee->w = w; | 203 | ee->w = w; |
212 | ee->req.h = ee->h = h; | 204 | ee->h = h; |
205 | ee->req.x = ee->x; | ||
206 | ee->req.y = ee->y; | ||
207 | ee->req.w = ee->w; | ||
208 | ee->req.h = ee->h; | ||
213 | ee->rotation = 0; | 209 | ee->rotation = 0; |
214 | ee->prop.max.w = ee->prop.max.h = 32767; | 210 | ee->prop.max.w = 32767; |
211 | ee->prop.max.h = 32767; | ||
215 | ee->prop.layer = 4; | 212 | ee->prop.layer = 4; |
216 | ee->prop.request_pos = 0; | 213 | ee->prop.request_pos = 0; |
217 | ee->prop.sticky = 0; | 214 | ee->prop.sticky = 0; |
218 | ee->prop.draw_frame = frame; | 215 | ee->prop.draw_frame = frame; |
219 | ee->prop.window = _win_id++; | ||
220 | 216 | ||
221 | ee->evas = evas_new(); | 217 | ee->evas = evas_new(); |
222 | evas_data_attach_set(ee->evas, ee); | 218 | evas_data_attach_set(ee->evas, ee); |
@@ -224,29 +220,42 @@ ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, in | |||
224 | evas_output_size_set(ee->evas, ee->w, ee->h); | 220 | evas_output_size_set(ee->evas, ee->w, ee->h); |
225 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); | 221 | evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h); |
226 | 222 | ||
227 | if (ee->prop.draw_frame) | 223 | /* FIXME: This needs to be set based on theme & scale */ |
224 | if (ee->prop.draw_frame) | ||
228 | evas_output_framespace_set(ee->evas, 4, 18, 8, 22); | 225 | evas_output_framespace_set(ee->evas, 4, 18, 8, 22); |
229 | 226 | ||
230 | if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas))) | 227 | if (parent) |
228 | p = ecore_wl_window_find(parent); | ||
229 | |||
230 | /* FIXME: Get if parent is alpha, and set */ | ||
231 | |||
232 | ee->engine.wl.parent = p; | ||
233 | ee->engine.wl.win = | ||
234 | ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_SHM); | ||
235 | ee->prop.window = ee->engine.wl.win->id; | ||
236 | |||
237 | if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas))) | ||
231 | { | 238 | { |
232 | einfo->info.rotation = ee->rotation; | 239 | einfo->info.rotation = ee->rotation; |
233 | einfo->info.debug = EINA_FALSE; | 240 | einfo->info.debug = EINA_FALSE; |
234 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | 241 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) |
235 | { | 242 | { |
236 | ERR("Failed to set Evas Engine Info for '%s'.", ee->driver); | 243 | ERR("Failed to set Evas Engine Info for '%s'", ee->driver); |
237 | ecore_evas_free(ee); | 244 | ecore_evas_free(ee); |
245 | _ecore_evas_wl_shutdown(); | ||
246 | ecore_wl_shutdown(); | ||
238 | return NULL; | 247 | return NULL; |
239 | } | 248 | } |
240 | } | 249 | } |
241 | else | 250 | else |
242 | { | 251 | { |
243 | ERR("Failed to get Evas Engine Info for '%s'.", ee->driver); | 252 | ERR("Failed to get Evas Engine Info for '%s'", ee->driver); |
244 | ecore_evas_free(ee); | 253 | ecore_evas_free(ee); |
254 | _ecore_evas_wl_shutdown(); | ||
255 | ecore_wl_shutdown(); | ||
245 | return NULL; | 256 | return NULL; |
246 | } | 257 | } |
247 | 258 | ||
248 | /* NB: we need to be notified before 'free' so we can munmap the evas | ||
249 | * engine destination */ | ||
250 | ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free); | 259 | ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free); |
251 | 260 | ||
252 | if (ee->prop.draw_frame) | 261 | if (ee->prop.draw_frame) |
@@ -279,30 +288,21 @@ _ecore_evas_wl_init(void) | |||
279 | if (++_ecore_evas_wl_init_count != 1) | 288 | if (++_ecore_evas_wl_init_count != 1) |
280 | return _ecore_evas_wl_init_count; | 289 | return _ecore_evas_wl_init_count; |
281 | 290 | ||
282 | _ecore_evas_wl_event_handlers[0] = | 291 | _ecore_evas_wl_event_hdls[0] = |
283 | ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, | ||
284 | _ecore_evas_wl_event_mouse_down, NULL); | ||
285 | _ecore_evas_wl_event_handlers[1] = | ||
286 | ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, | ||
287 | _ecore_evas_wl_event_mouse_up, NULL); | ||
288 | _ecore_evas_wl_event_handlers[2] = | ||
289 | ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, | ||
290 | _ecore_evas_wl_event_mouse_move, NULL); | ||
291 | _ecore_evas_wl_event_handlers[3] = | ||
292 | ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, | ||
293 | _ecore_evas_wl_event_mouse_wheel, NULL); | ||
294 | _ecore_evas_wl_event_handlers[4] = | ||
295 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN, | 292 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN, |
296 | _ecore_evas_wl_event_mouse_in, NULL); | 293 | _ecore_evas_wl_cb_mouse_in, NULL); |
297 | _ecore_evas_wl_event_handlers[5] = | 294 | _ecore_evas_wl_event_hdls[1] = |
298 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT, | 295 | ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT, |
299 | _ecore_evas_wl_event_mouse_out, NULL); | 296 | _ecore_evas_wl_cb_mouse_out, NULL); |
300 | _ecore_evas_wl_event_handlers[6] = | 297 | _ecore_evas_wl_event_hdls[2] = |
301 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN, | 298 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN, |
302 | _ecore_evas_wl_event_focus_in, NULL); | 299 | _ecore_evas_wl_cb_focus_in, NULL); |
303 | _ecore_evas_wl_event_handlers[7] = | 300 | _ecore_evas_wl_event_hdls[3] = |
304 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, | 301 | ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, |
305 | _ecore_evas_wl_event_focus_out, NULL); | 302 | _ecore_evas_wl_cb_focus_out, NULL); |
303 | _ecore_evas_wl_event_hdls[4] = | ||
304 | ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, | ||
305 | _ecore_evas_wl_cb_window_configure, NULL); | ||
306 | 306 | ||
307 | ecore_event_evas_init(); | 307 | ecore_event_evas_init(); |
308 | 308 | ||
@@ -319,10 +319,10 @@ _ecore_evas_wl_shutdown(void) | |||
319 | if (--_ecore_evas_wl_init_count != 0) | 319 | if (--_ecore_evas_wl_init_count != 0) |
320 | return _ecore_evas_wl_init_count; | 320 | return _ecore_evas_wl_init_count; |
321 | 321 | ||
322 | for (i = 0; i < sizeof(_ecore_evas_wl_event_handlers) / sizeof(Ecore_Event_Handler *); i++) | 322 | for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++) |
323 | { | 323 | { |
324 | if (_ecore_evas_wl_event_handlers[i]) | 324 | if (_ecore_evas_wl_event_hdls[i]) |
325 | ecore_event_handler_del(_ecore_evas_wl_event_handlers[i]); | 325 | ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]); |
326 | } | 326 | } |
327 | 327 | ||
328 | ecore_event_evas_shutdown(); | 328 | ecore_event_evas_shutdown(); |
@@ -337,17 +337,15 @@ _ecore_evas_wl_pre_free(Ecore_Evas *ee) | |||
337 | 337 | ||
338 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 338 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
339 | 339 | ||
340 | /* destroy frame */ | ||
341 | if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame); | 340 | if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame); |
342 | 341 | ||
343 | /* get engine info */ | ||
344 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); | 342 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); |
345 | if ((einfo) && (einfo->info.dest)) | 343 | if ((einfo) && (einfo->info.dest)) |
346 | { | 344 | { |
347 | int ret = 0; | 345 | int ret = 0; |
348 | 346 | ||
349 | /* munmap previous engine destination */ | ||
350 | ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h)); | 347 | ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h)); |
348 | if (!ret) ERR("Failed to unmap engine destination: %m"); | ||
351 | } | 349 | } |
352 | } | 350 | } |
353 | 351 | ||
@@ -356,18 +354,11 @@ _ecore_evas_wl_free(Ecore_Evas *ee) | |||
356 | { | 354 | { |
357 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 355 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
358 | 356 | ||
359 | /* destroy buffer */ | ||
360 | if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer); | 357 | if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer); |
361 | ee->engine.wl.buffer = NULL; | 358 | ee->engine.wl.buffer = NULL; |
362 | 359 | ||
363 | /* destroy shell surface */ | 360 | if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win); |
364 | if (ee->engine.wl.shell_surface) | 361 | ee->engine.wl.win = NULL; |
365 | wl_shell_surface_destroy(ee->engine.wl.shell_surface); | ||
366 | ee->engine.wl.shell_surface = NULL; | ||
367 | |||
368 | /* destroy surface */ | ||
369 | if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface); | ||
370 | ee->engine.wl.surface = NULL; | ||
371 | 362 | ||
372 | ecore_event_window_unregister(ee->prop.window); | 363 | ecore_event_window_unregister(ee->prop.window); |
373 | ecore_evas_input_event_unregister(ee); | 364 | ecore_evas_input_event_unregister(ee); |
@@ -431,25 +422,25 @@ _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee | |||
431 | } | 422 | } |
432 | 423 | ||
433 | static void | 424 | static void |
434 | _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y) | 425 | _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee)) |
426 | { | ||
427 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
428 | |||
429 | if (!ee) return; | ||
430 | ee->func.fn_mouse_out = func; | ||
431 | } | ||
432 | |||
433 | static void | ||
434 | _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y) | ||
435 | { | 435 | { |
436 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 436 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
437 | 437 | ||
438 | if (!ee) return; | 438 | if (!ee) return; |
439 | // if ((ee->x == x) && (ee->y == y)) return; | ||
440 | ee->req.x = x; | 439 | ee->req.x = x; |
441 | ee->req.y = y; | 440 | ee->req.y = y; |
442 | |||
443 | ee->x = x; | 441 | ee->x = x; |
444 | ee->y = y; | 442 | ee->y = y; |
445 | 443 | if (ee->engine.wl.win) ecore_wl_window_move(ee->engine.wl.win, x, y); | |
446 | if (ee->engine.wl.shell_surface) | ||
447 | { | ||
448 | wl_shell_surface_move(ee->engine.wl.shell_surface, | ||
449 | ecore_wl_input_device_get(), | ||
450 | _ecore_evas_wl_btn_timestamp); | ||
451 | } | ||
452 | |||
453 | if (ee->func.fn_move) ee->func.fn_move(ee); | 444 | if (ee->func.fn_move) ee->func.fn_move(ee); |
454 | } | 445 | } |
455 | 446 | ||
@@ -458,49 +449,44 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h) | |||
458 | { | 449 | { |
459 | Evas_Engine_Info_Wayland_Shm *einfo; | 450 | Evas_Engine_Info_Wayland_Shm *einfo; |
460 | 451 | ||
461 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
462 | |||
463 | if (!ee) return; | 452 | if (!ee) return; |
464 | if (w < 1) w = 1; | 453 | if (w < 1) w = 1; |
465 | if (h < 1) h = 1; | 454 | if (h < 1) h = 1; |
466 | if ((ee->w == w) && (ee->h == h)) return; | 455 | // if ((ee->w == w) && (ee->h == h)) return; |
456 | |||
457 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
458 | |||
459 | if (ee->prop.min.w > w) w = ee->prop.min.w; | ||
460 | else if (w > ee->prop.max.w) w = ee->prop.max.w; | ||
461 | if (ee->prop.min.h > h) h = ee->prop.min.h; | ||
462 | else if (h > ee->prop.max.h) h = ee->prop.max.h; | ||
467 | 463 | ||
468 | ee->req.w = w; | 464 | ee->req.w = w; |
469 | ee->req.h = h; | 465 | ee->req.h = h; |
470 | 466 | ||
471 | if (ee->visible) | 467 | // ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); |
472 | { | ||
473 | /* damage old surface, if it exists */ | ||
474 | |||
475 | /* NB: This removes any lingering screen artifacts in the compositor. | ||
476 | * This may be a 'HACK' if the issue is actually in the wayland | ||
477 | * compositor, but for now lets implement this so we don't have screen | ||
478 | * artifacts laying around during a resize */ | ||
479 | if (ee->engine.wl.surface) | ||
480 | wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); | ||
481 | } | ||
482 | 468 | ||
483 | /* get engine info */ | ||
484 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); | 469 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); |
485 | if (einfo->info.dest) | 470 | if ((einfo) && (einfo->info.dest)) |
486 | { | 471 | { |
487 | int ret = 0; | 472 | int ret = 0; |
488 | 473 | ||
489 | /* munmap previous engine destination */ | ||
490 | ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h)); | 474 | ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h)); |
475 | if (!ret) ERR("Failed to unmap engine destination: %m"); | ||
476 | } | ||
477 | else if (!einfo) | ||
478 | { | ||
479 | ERR("Failed to get Evas Engine Info for '%s'", ee->driver); | ||
480 | return; | ||
491 | } | 481 | } |
492 | 482 | ||
493 | /* free old buffer */ | ||
494 | if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer); | 483 | if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer); |
495 | ee->engine.wl.buffer = NULL; | 484 | ee->engine.wl.buffer = NULL; |
496 | 485 | ||
497 | ee->w = w; | 486 | ee->w = w; |
498 | ee->h = h; | 487 | ee->h = h; |
499 | 488 | ||
500 | /* create buffer @ new size (also mmaps the new destination) */ | ||
501 | _ecore_evas_wl_buffer_new(ee, &einfo->info.dest); | 489 | _ecore_evas_wl_buffer_new(ee, &einfo->info.dest); |
502 | |||
503 | /* flush new buffer fd */ | ||
504 | ecore_wl_flush(); | 490 | ecore_wl_flush(); |
505 | 491 | ||
506 | /* change evas output & viewport sizes */ | 492 | /* change evas output & viewport sizes */ |
@@ -514,16 +500,13 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h) | |||
514 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); | 500 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); |
515 | 501 | ||
516 | /* damage buffer */ | 502 | /* damage buffer */ |
517 | wl_buffer_damage(ee->engine.wl.buffer, 0, 0, ee->w, ee->h); | 503 | // wl_buffer_damage(ee->engine.wl.buffer, 0, 0, ee->w, ee->h); |
518 | 504 | ||
519 | if (ee->visible) | 505 | ecore_wl_window_buffer_attach(ee->engine.wl.win, ee->engine.wl.buffer, 0, 0); |
520 | { | 506 | /* ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); */ |
521 | /* damage surface */ | 507 | /* ecore_wl_flush(); */ |
522 | wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); | ||
523 | 508 | ||
524 | /* if visible, attach to surface */ | 509 | ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h); |
525 | wl_surface_attach(ee->engine.wl.surface, ee->engine.wl.buffer, 0, 0); | ||
526 | } | ||
527 | 510 | ||
528 | if (ee->func.fn_resize) ee->func.fn_resize(ee); | 511 | if (ee->func.fn_resize) ee->func.fn_resize(ee); |
529 | } | 512 | } |
@@ -535,93 +518,64 @@ _ecore_evas_wl_show(Ecore_Evas *ee) | |||
535 | 518 | ||
536 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 519 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
537 | 520 | ||
538 | if (!ee) return; | 521 | if ((!ee) || (ee->visible)) return; |
539 | if (ee->visible) return; | ||
540 | 522 | ||
541 | /* get engine info */ | 523 | if (ee->engine.wl.win) |
542 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); | 524 | ecore_wl_window_show(ee->engine.wl.win); |
543 | |||
544 | /* create new surface */ | ||
545 | ee->engine.wl.surface = | ||
546 | wl_compositor_create_surface(ecore_wl_compositor_get()); | ||
547 | wl_surface_set_user_data(ee->engine.wl.surface, (void *)ee->prop.window); | ||
548 | 525 | ||
549 | /* get new shell surface */ | 526 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); |
550 | ee->engine.wl.shell_surface = | 527 | if (!einfo) |
551 | wl_shell_get_shell_surface(ecore_wl_shell_get(), ee->engine.wl.surface); | 528 | { |
552 | 529 | ERR("Failed to get Evas Engine Info for '%s'", ee->driver); | |
553 | /* set toplevel */ | 530 | return; |
554 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | 531 | } |
555 | 532 | ||
556 | /* create buffer @ new size (also mmaps the new destination) */ | ||
557 | _ecore_evas_wl_buffer_new(ee, &einfo->info.dest); | 533 | _ecore_evas_wl_buffer_new(ee, &einfo->info.dest); |
534 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); | ||
558 | 535 | ||
559 | if (ee->engine.wl.frame) | 536 | if (ee->engine.wl.frame) |
560 | { | 537 | { |
561 | evas_object_show(ee->engine.wl.frame); | 538 | evas_object_show(ee->engine.wl.frame); |
562 | evas_object_resize(ee->engine.wl.frame, ee->w, ee->h); | 539 | evas_object_resize(ee->engine.wl.frame, ee->w, ee->h); |
563 | } | 540 | } |
564 | 541 | ||
565 | /* set new engine destination */ | ||
566 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); | ||
567 | |||
568 | /* add configure listener for wayland resize events */ | ||
569 | wl_shell_surface_add_listener(ee->engine.wl.shell_surface, | ||
570 | &_ecore_evas_wl_shell_surface_listener, ee); | ||
571 | |||
572 | /* flush new buffer fd */ | ||
573 | ecore_wl_flush(); | 542 | ecore_wl_flush(); |
574 | 543 | ||
575 | /* attach buffer to surface */ | 544 | if (ee->engine.wl.win) |
576 | wl_surface_attach(ee->engine.wl.surface, ee->engine.wl.buffer, 0, 0); | 545 | ecore_wl_window_buffer_attach(ee->engine.wl.win, ee->engine.wl.buffer, 0, 0); |
577 | |||
578 | /* NB: No need to do a damage here. If we do, we end up w/ screen | ||
579 | * artifacts in the compositor */ | ||
580 | /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */ | ||
581 | 546 | ||
582 | ee->visible = 1; | 547 | ee->visible = 1; |
583 | if (ee->func.fn_show) ee->func.fn_show(ee); | 548 | if (ee->func.fn_show) ee->func.fn_show(ee); |
584 | } | 549 | } |
585 | 550 | ||
586 | static void | 551 | static void |
587 | _ecore_evas_wl_hide(Ecore_Evas *ee) | 552 | _ecore_evas_wl_hide(Ecore_Evas *ee) |
588 | { | 553 | { |
589 | Evas_Engine_Info_Wayland_Shm *einfo; | 554 | Evas_Engine_Info_Wayland_Shm *einfo; |
590 | 555 | ||
591 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 556 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
592 | 557 | ||
593 | if (!ee) return; | 558 | if ((!ee) || (!ee->visible)) return; |
594 | if (!ee->visible) return; | ||
595 | 559 | ||
596 | /* get engine info */ | ||
597 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); | 560 | einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); |
598 | if (einfo->info.dest) | 561 | if ((einfo) && (einfo->info.dest)) |
599 | { | 562 | { |
600 | int ret = 0; | 563 | int ret = 0; |
601 | 564 | ||
602 | /* munmap previous engine destination */ | ||
603 | ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h)); | 565 | ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h)); |
604 | einfo->info.dest = NULL; | 566 | if (!ret) ERR("Failed to unmap engine destination: %m"); |
605 | } | 567 | } |
606 | 568 | ||
607 | /* free old buffer */ | ||
608 | if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer); | 569 | if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer); |
609 | ee->engine.wl.buffer = NULL; | 570 | ee->engine.wl.buffer = NULL; |
610 | 571 | ||
611 | /* set new engine destination */ | ||
612 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); | 572 | evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); |
613 | 573 | ||
614 | /* destroy shell surface */ | 574 | ecore_wl_window_hide(ee->engine.wl.win); |
615 | if (ee->engine.wl.shell_surface) | ||
616 | wl_shell_surface_destroy(ee->engine.wl.shell_surface); | ||
617 | ee->engine.wl.shell_surface = NULL; | ||
618 | |||
619 | /* destroy surface */ | ||
620 | if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface); | ||
621 | ee->engine.wl.surface = NULL; | ||
622 | 575 | ||
623 | ee->visible = 0; | 576 | ee->visible = 0; |
624 | ee->should_be_visible = 0; | 577 | ee->should_be_visible = 0; |
578 | |||
625 | if (ee->func.fn_hide) ee->func.fn_hide(ee); | 579 | if (ee->func.fn_hide) ee->func.fn_hide(ee); |
626 | } | 580 | } |
627 | 581 | ||
@@ -631,39 +585,18 @@ _ecore_evas_wl_raise(Ecore_Evas *ee) | |||
631 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 585 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
632 | 586 | ||
633 | if ((!ee) || (!ee->visible)) return; | 587 | if ((!ee) || (!ee->visible)) return; |
634 | if (!ee->engine.wl.shell_surface) return; | 588 | ecore_wl_window_raise(ee->engine.wl.win); |
635 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | ||
636 | } | 589 | } |
637 | 590 | ||
638 | static void | 591 | static void |
639 | _ecore_evas_wl_lower(Ecore_Evas *ee) | 592 | _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title) |
640 | { | ||
641 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
642 | |||
643 | if ((!ee) || (!ee->visible)) return; | ||
644 | /* FIXME: Need a way to tell Wayland to lower */ | ||
645 | } | ||
646 | |||
647 | static void | ||
648 | _ecore_evas_wl_activate(Ecore_Evas *ee) | ||
649 | { | ||
650 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
651 | |||
652 | if ((!ee) || (!ee->visible)) return; | ||
653 | if (!ee->engine.wl.shell_surface) return; | ||
654 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | ||
655 | } | ||
656 | |||
657 | static void | ||
658 | _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t) | ||
659 | { | 593 | { |
660 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 594 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
661 | 595 | ||
662 | if (!ee) return; | 596 | if (!ee) return; |
663 | if (ee->prop.title) free(ee->prop.title); | 597 | if (ee->prop.title) free(ee->prop.title); |
664 | ee->prop.title = NULL; | 598 | ee->prop.title = NULL; |
665 | if (t) ee->prop.title = strdup(t); | 599 | if (title) ee->prop.title = strdup(title); |
666 | |||
667 | if ((ee->prop.draw_frame) && (ee->engine.wl.frame)) | 600 | if ((ee->prop.draw_frame) && (ee->engine.wl.frame)) |
668 | { | 601 | { |
669 | EE_Wl_Smart_Data *sd; | 602 | EE_Wl_Smart_Data *sd; |
@@ -741,102 +674,96 @@ _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h) | |||
741 | } | 674 | } |
742 | 675 | ||
743 | static void | 676 | static void |
744 | _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y) | 677 | _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer) |
745 | { | 678 | { |
746 | int x = 0, y = 0; | ||
747 | |||
748 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 679 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
749 | 680 | ||
750 | if (!ee) return; | 681 | if (!ee) return; |
751 | if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object); | 682 | if (ee->prop.layer == layer) return; |
752 | ee->prop.cursor.object = NULL; | 683 | if (layer < 1) layer = 1; |
753 | 684 | else if (layer > 255) layer = 255; | |
754 | if (!obj) | 685 | ee->prop.layer = layer; |
755 | { | ||
756 | ee->prop.cursor.layer = 0; | ||
757 | ee->prop.cursor.hot.x = 0; | ||
758 | ee->prop.cursor.hot.y = 0; | ||
759 | return; | ||
760 | } | ||
761 | |||
762 | ee->prop.cursor.object = obj; | ||
763 | ee->prop.cursor.layer = layer; | ||
764 | ee->prop.cursor.hot.x = hot_x; | ||
765 | ee->prop.cursor.hot.y = hot_y; | ||
766 | |||
767 | evas_pointer_output_xy_get(ee->evas, &x, &y); | ||
768 | evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer); | ||
769 | evas_object_move(ee->prop.cursor.object, | ||
770 | x - ee->prop.cursor.hot.x, y - ee->prop.cursor.hot.y); | ||
771 | evas_object_pass_events_set(ee->prop.cursor.object, 1); | ||
772 | if (evas_pointer_inside_get(ee->evas)) | ||
773 | evas_object_show(ee->prop.cursor.object); | ||
774 | |||
775 | evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, | ||
776 | _ecore_evas_wl_object_cursor_del, ee); | ||
777 | } | 686 | } |
778 | 687 | ||
779 | static void | 688 | static void |
780 | _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) | 689 | _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify) |
781 | { | 690 | { |
782 | Ecore_Evas *ee; | 691 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
783 | 692 | ||
784 | if (!(ee = data)) return; | 693 | if (!ee) return; |
785 | ee->prop.cursor.object = NULL; | 694 | if (ee->prop.iconified == iconify) return; |
695 | ee->prop.iconified = iconify; | ||
696 | /* FIXME: Implement this in Wayland someshow */ | ||
786 | } | 697 | } |
787 | 698 | ||
788 | static void | 699 | static void |
789 | _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer) | 700 | _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max) |
790 | { | 701 | { |
791 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 702 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
792 | 703 | ||
793 | if (!ee) return; | 704 | if (!ee) return; |
794 | if (ee->prop.layer == layer) return; | 705 | if (ee->prop.maximized == max) return; |
795 | if (layer < 1) layer = 1; | 706 | ee->prop.maximized = max; |
796 | else if (layer > 255) layer = 255; | 707 | ecore_wl_window_maximized_set(ee->engine.wl.win, max); |
797 | ee->prop.layer = layer; | ||
798 | } | 708 | } |
799 | 709 | ||
800 | static void | 710 | static void |
801 | _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__) | 711 | _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full) |
802 | { | 712 | { |
803 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 713 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
804 | 714 | ||
805 | if ((!ee) || (!ee->visible)) return; | 715 | if ((!ee) || (!ee->visible)) return; |
806 | if (!ee->engine.wl.shell_surface) return; | 716 | if (ee->prop.fullscreen == full) return; |
807 | wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface); | 717 | ee->prop.fullscreen = full; |
718 | ecore_wl_window_fullscreen_set(ee->engine.wl.win, full); | ||
808 | } | 719 | } |
809 | 720 | ||
810 | static void | 721 | static void |
811 | _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify) | 722 | _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore) |
812 | { | 723 | { |
813 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 724 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
814 | 725 | ||
815 | if (!ee) return; | 726 | if (!ee) return; |
816 | if (ee->prop.iconified == iconify) return; | 727 | ee->ignore_events = ignore; |
817 | ee->prop.iconified = iconify; | 728 | /* NB: Hmmm, may need to pass this to ecore_wl_window in the future */ |
818 | /* FIXME: Implement this in Wayland someshow */ | ||
819 | } | 729 | } |
820 | 730 | ||
821 | static void | 731 | static void |
822 | _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max) | 732 | _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha) |
823 | { | 733 | { |
734 | Evas_Engine_Info_Wayland_Shm *einfo; | ||
735 | |||
824 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 736 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
825 | 737 | ||
826 | if (!ee) return; | 738 | if (!ee) return; |
827 | if (ee->prop.maximized == max) return; | 739 | if ((ee->alpha == alpha)) return; |
828 | ee->prop.maximized = max; | 740 | ee->alpha = alpha; |
829 | /* FIXME: Implement this in Wayland someshow */ | 741 | if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas))) |
742 | { | ||
743 | einfo->info.destination_alpha = alpha; | ||
744 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | ||
745 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | ||
746 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); | ||
747 | } | ||
830 | } | 748 | } |
831 | 749 | ||
832 | static void | 750 | static void |
833 | _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__) | 751 | _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent) |
834 | { | 752 | { |
753 | Evas_Engine_Info_Wayland_Shm *einfo; | ||
754 | |||
835 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 755 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
836 | 756 | ||
837 | if ((!ee) || (!ee->visible)) return; | 757 | if (!ee) return; |
838 | if (!ee->engine.wl.shell_surface) return; | 758 | if ((ee->transparent == transparent)) return; |
839 | wl_shell_surface_set_fullscreen(ee->engine.wl.shell_surface); | 759 | ee->transparent = transparent; |
760 | if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas))) | ||
761 | { | ||
762 | einfo->info.destination_alpha = transparent; | ||
763 | if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) | ||
764 | ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); | ||
765 | evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); | ||
766 | } | ||
840 | } | 767 | } |
841 | 768 | ||
842 | static int | 769 | static int |
@@ -845,9 +772,9 @@ _ecore_evas_wl_render(Ecore_Evas *ee) | |||
845 | int rend = 0; | 772 | int rend = 0; |
846 | 773 | ||
847 | if (!ee) return 0; | 774 | if (!ee) return 0; |
848 | if (!ee->visible) | 775 | if (!ee->visible) |
849 | evas_norender(ee->evas); | 776 | evas_norender(ee->evas); |
850 | else | 777 | else |
851 | { | 778 | { |
852 | Eina_List *ll = NULL, *updates = NULL; | 779 | Eina_List *ll = NULL, *updates = NULL; |
853 | Ecore_Evas *ee2 = NULL; | 780 | Ecore_Evas *ee2 = NULL; |
@@ -867,27 +794,27 @@ _ecore_evas_wl_render(Ecore_Evas *ee) | |||
867 | Eina_List *l = NULL; | 794 | Eina_List *l = NULL; |
868 | Eina_Rectangle *r; | 795 | Eina_Rectangle *r; |
869 | 796 | ||
797 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
798 | |||
870 | EINA_LIST_FOREACH(updates, l, r) | 799 | EINA_LIST_FOREACH(updates, l, r) |
871 | { | 800 | { |
872 | if (ee->engine.wl.buffer) | 801 | if (ee->engine.wl.buffer) |
873 | wl_buffer_damage(ee->engine.wl.buffer, | 802 | wl_buffer_damage(ee->engine.wl.buffer, |
874 | r->x, r->y, r->w, r->h); | 803 | r->x, r->y, r->w, r->h); |
875 | 804 | ||
876 | if (ee->engine.wl.surface) | 805 | ecore_wl_window_damage(ee->engine.wl.win, |
877 | wl_surface_damage(ee->engine.wl.surface, | 806 | r->x, r->y, r->w, r->h); |
878 | r->x, r->y, r->w, r->h); | ||
879 | } | 807 | } |
880 | 808 | ||
809 | ecore_wl_flush(); | ||
810 | |||
881 | evas_render_updates_free(updates); | 811 | evas_render_updates_free(updates); |
882 | _ecore_evas_idle_timeout_update(ee); | 812 | _ecore_evas_idle_timeout_update(ee); |
883 | rend = 1; | 813 | rend = 1; |
884 | |||
885 | ecore_wl_flush(); | ||
886 | } | 814 | } |
887 | 815 | ||
888 | if (ee->func.fn_post_render) ee->func.fn_post_render(ee); | 816 | if (ee->func.fn_post_render) ee->func.fn_post_render(ee); |
889 | } | 817 | } |
890 | |||
891 | return rend; | 818 | return rend; |
892 | } | 819 | } |
893 | 820 | ||
@@ -901,77 +828,67 @@ _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int | |||
901 | ecore_wl_screen_size_get(w, h); | 828 | ecore_wl_screen_size_get(w, h); |
902 | } | 829 | } |
903 | 830 | ||
904 | static Eina_Bool | 831 | static void |
905 | _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event) | 832 | _ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest) |
906 | { | 833 | { |
907 | Ecore_Evas *ee; | 834 | struct wl_shm *shm; |
908 | Ecore_Event_Mouse_Button *ev; | 835 | static unsigned int format; |
836 | char tmp[PATH_MAX]; | ||
837 | int fd = -1, stride = 0, size = 0; | ||
838 | void *ret; | ||
909 | 839 | ||
910 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 840 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
911 | 841 | ||
912 | ev = event; | 842 | if (dest) *dest = NULL; |
913 | _ecore_evas_wl_btn_timestamp = ev->timestamp; | 843 | if (!(shm = ecore_wl_shm_get())) return; |
914 | ee = ecore_event_window_match(ev->window); | 844 | if (!format) format = WL_SHM_FORMAT_ARGB8888; //ecore_wl_format_get(); |
915 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | ||
916 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
917 | evas_event_feed_mouse_down(ee->evas, ev->buttons, ev->modifiers, | ||
918 | ev->timestamp, NULL); | ||
919 | return ECORE_CALLBACK_PASS_ON; | ||
920 | } | ||
921 | 845 | ||
922 | static Eina_Bool | 846 | strcpy(tmp, "/tmp/ecore-wayland_shm-XXXXXX"); |
923 | _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event) | 847 | if ((fd = mkstemp(tmp)) < 0) |
924 | { | 848 | { |
925 | Ecore_Evas *ee; | 849 | ERR("Could not create temporary file."); |
926 | Ecore_Event_Mouse_Button *ev; | 850 | return; |
851 | } | ||
927 | 852 | ||
928 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 853 | stride = (ee->w * sizeof(int)); |
854 | size = (stride * ee->h); | ||
855 | if (ftruncate(fd, size) < 0) | ||
856 | { | ||
857 | ERR("Could not truncate temporary file."); | ||
858 | close(fd); | ||
859 | return; | ||
860 | } | ||
929 | 861 | ||
930 | ev = event; | 862 | ret = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0); |
931 | ee = ecore_event_window_match(ev->window); | 863 | unlink(tmp); |
932 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | ||
933 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
934 | evas_event_feed_mouse_up(ee->evas, ev->buttons, ev->modifiers, | ||
935 | ev->timestamp, NULL); | ||
936 | return ECORE_CALLBACK_PASS_ON; | ||
937 | } | ||
938 | 864 | ||
939 | static Eina_Bool | 865 | if (ret == MAP_FAILED) |
940 | _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event) | 866 | { |
941 | { | 867 | ERR("mmap of temporary file failed."); |
942 | Ecore_Evas *ee; | 868 | close(fd); |
943 | Ecore_Event_Mouse_Move *ev; | 869 | return; |
870 | } | ||
944 | 871 | ||
945 | ev = event; | 872 | if (dest) *dest = ret; |
946 | ee = ecore_event_window_match(ev->window); | 873 | |
947 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 874 | ee->engine.wl.buffer = |
948 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 875 | wl_shm_create_buffer(ecore_wl_shm_get(), fd, ee->w, ee->h, stride, format); |
949 | ee->mouse.x = ev->x; | 876 | |
950 | ee->mouse.y = ev->y; | 877 | close(fd); |
951 | evas_event_feed_mouse_move(ee->evas, ev->x, ev->y, ev->timestamp, NULL); | ||
952 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); | ||
953 | return ECORE_CALLBACK_PASS_ON; | ||
954 | } | 878 | } |
955 | 879 | ||
956 | static Eina_Bool | 880 | void |
957 | _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event) | 881 | _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location) |
958 | { | 882 | { |
959 | Ecore_Evas *ee; | ||
960 | Ecore_Event_Mouse_Wheel *ev; | ||
961 | |||
962 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 883 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
963 | 884 | ||
964 | ev = event; | 885 | if (!ee) return; |
965 | ee = ecore_event_window_match(ev->window); | 886 | if (ee->engine.wl.win) |
966 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 887 | ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location); |
967 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | ||
968 | evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z, | ||
969 | ev->timestamp, NULL); | ||
970 | return ECORE_CALLBACK_PASS_ON; | ||
971 | } | 888 | } |
972 | 889 | ||
973 | static Eina_Bool | 890 | static Eina_Bool |
974 | _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event) | 891 | _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event) |
975 | { | 892 | { |
976 | Ecore_Evas *ee; | 893 | Ecore_Evas *ee; |
977 | Ecore_Wl_Event_Mouse_In *ev; | 894 | Ecore_Wl_Event_Mouse_In *ev; |
@@ -979,18 +896,18 @@ _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void * | |||
979 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 896 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
980 | 897 | ||
981 | ev = event; | 898 | ev = event; |
982 | ee = ecore_event_window_match(ev->window); | 899 | ee = ecore_event_window_match(ev->win); |
983 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 900 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
984 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 901 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
985 | if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); | 902 | if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee); |
986 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); | 903 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); |
987 | evas_event_feed_mouse_in(ee->evas, ev->time, NULL); | 904 | evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL); |
988 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time); | 905 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); |
989 | return ECORE_CALLBACK_PASS_ON; | 906 | return ECORE_CALLBACK_PASS_ON; |
990 | } | 907 | } |
991 | 908 | ||
992 | static Eina_Bool | 909 | static Eina_Bool |
993 | _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event) | 910 | _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event) |
994 | { | 911 | { |
995 | Ecore_Evas *ee; | 912 | Ecore_Evas *ee; |
996 | Ecore_Wl_Event_Mouse_Out *ev; | 913 | Ecore_Wl_Event_Mouse_Out *ev; |
@@ -998,19 +915,19 @@ _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void | |||
998 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 915 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
999 | 916 | ||
1000 | ev = event; | 917 | ev = event; |
1001 | ee = ecore_event_window_match(ev->window); | 918 | ee = ecore_event_window_match(ev->win); |
1002 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 919 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
1003 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 920 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
1004 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); | 921 | ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers); |
1005 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time); | 922 | _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); |
1006 | evas_event_feed_mouse_out(ee->evas, ev->time, NULL); | 923 | evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); |
1007 | if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); | 924 | if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); |
1008 | if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); | 925 | if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); |
1009 | return ECORE_CALLBACK_PASS_ON; | 926 | return ECORE_CALLBACK_PASS_ON; |
1010 | } | 927 | } |
1011 | 928 | ||
1012 | static Eina_Bool | 929 | static Eina_Bool |
1013 | _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event) | 930 | _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event) |
1014 | { | 931 | { |
1015 | Ecore_Evas *ee; | 932 | Ecore_Evas *ee; |
1016 | Ecore_Wl_Event_Focus_In *ev; | 933 | Ecore_Wl_Event_Focus_In *ev; |
@@ -1018,9 +935,9 @@ _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void * | |||
1018 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 935 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1019 | 936 | ||
1020 | ev = event; | 937 | ev = event; |
1021 | ee = ecore_event_window_match(ev->window); | 938 | ee = ecore_event_window_match(ev->win); |
1022 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 939 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
1023 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 940 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
1024 | ee->prop.focused = 1; | 941 | ee->prop.focused = 1; |
1025 | evas_focus_in(ee->evas); | 942 | evas_focus_in(ee->evas); |
1026 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); | 943 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); |
@@ -1028,92 +945,53 @@ _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void * | |||
1028 | } | 945 | } |
1029 | 946 | ||
1030 | static Eina_Bool | 947 | static Eina_Bool |
1031 | _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event) | 948 | _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event) |
1032 | { | 949 | { |
1033 | Ecore_Evas *ee; | 950 | Ecore_Evas *ee; |
1034 | Ecore_Wl_Event_Focus_Out *ev; | 951 | Ecore_Wl_Event_Focus_In *ev; |
1035 | 952 | ||
1036 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 953 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1037 | 954 | ||
1038 | ev = event; | 955 | ev = event; |
1039 | ee = ecore_event_window_match(ev->window); | 956 | ee = ecore_event_window_match(ev->win); |
1040 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; | 957 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; |
1041 | if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 958 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
1042 | evas_focus_out(ee->evas); | 959 | evas_focus_out(ee->evas); |
1043 | ee->prop.focused = 0; | 960 | ee->prop.focused = 0; |
1044 | if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); | 961 | if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); |
1045 | return ECORE_CALLBACK_PASS_ON; | 962 | return ECORE_CALLBACK_PASS_ON; |
1046 | } | 963 | } |
1047 | 964 | ||
1048 | static void | 965 | static Eina_Bool |
1049 | _ecore_evas_wl_handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t timestamp __UNUSED__, uint32_t edges __UNUSED__, int32_t width, int32_t height) | 966 | _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event) |
1050 | { | 967 | { |
1051 | Ecore_Evas *ee; | 968 | Ecore_Evas *ee; |
1052 | 969 | Ecore_Wl_Event_Window_Configure *ev; | |
1053 | /* NB: Trap to prevent compositor from crashing */ | ||
1054 | if ((width <= 0) || (height <= 0)) return; | ||
1055 | |||
1056 | if (!(ee = data)) return; | ||
1057 | |||
1058 | if ((shell_surface) && (ee->engine.wl.shell_surface)) | ||
1059 | { | ||
1060 | if (ee->engine.wl.shell_surface != shell_surface) return; | ||
1061 | ecore_evas_resize(ee, width, height); | ||
1062 | } | ||
1063 | } | ||
1064 | |||
1065 | static void | ||
1066 | _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__) | ||
1067 | { | ||
1068 | |||
1069 | } | ||
1070 | |||
1071 | static void | ||
1072 | _ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest) | ||
1073 | { | ||
1074 | static unsigned int format; | ||
1075 | char tmp[PATH_MAX]; | ||
1076 | int fd = -1, stride = 0, size = 0; | ||
1077 | void *ret; | ||
1078 | 970 | ||
1079 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 971 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1080 | 972 | ||
1081 | if (dest) *dest = NULL; | 973 | ev = event; |
1082 | 974 | ee = ecore_event_window_match(ev->win); | |
1083 | if (!format) format = ecore_wl_format_get(); | 975 | if (!ee) return ECORE_CALLBACK_PASS_ON; |
1084 | 976 | if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | |
1085 | strcpy(tmp, "/tmp/ecore-wayland_shm-XXXXXX"); | 977 | if ((ee->x != ev->x) || (ee->y != ev->y)) |
1086 | if ((fd = mkstemp(tmp)) < 0) | ||
1087 | { | ||
1088 | ERR("Could not create temporary file."); | ||
1089 | return; | ||
1090 | } | ||
1091 | |||
1092 | stride = (ee->w * sizeof(int)); | ||
1093 | size = (stride * ee->h); | ||
1094 | if (ftruncate(fd, size) < 0) | ||
1095 | { | 978 | { |
1096 | ERR("Could not truncate temporary file."); | 979 | ee->x = ev->x; |
1097 | close(fd); | 980 | ee->y = ev->y; |
1098 | return; | 981 | ee->req.x = ee->x; |
982 | ee->req.y = ee->y; | ||
983 | if (ee->func.fn_move) ee->func.fn_move(ee); | ||
1099 | } | 984 | } |
1100 | 985 | if ((ee->req.w != ev->w) || (ee->req.h != ev->h)) | |
1101 | ret = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0); | ||
1102 | unlink(tmp); | ||
1103 | |||
1104 | if (ret == MAP_FAILED) | ||
1105 | { | 986 | { |
1106 | ERR("mmap of temporary file failed."); | 987 | /* ee->w = ev->w; */ |
1107 | close(fd); | 988 | /* ee->h = ev->h; */ |
1108 | return; | 989 | ee->req.w = ev->w; |
990 | ee->req.h = ev->h; | ||
991 | if (ee->func.fn_resize) ee->func.fn_resize(ee); | ||
1109 | } | 992 | } |
1110 | 993 | ||
1111 | if (dest) *dest = ret; | 994 | return ECORE_CALLBACK_PASS_ON; |
1112 | |||
1113 | ee->engine.wl.buffer = | ||
1114 | wl_shm_create_buffer(ecore_wl_shm_get(), fd, ee->w, ee->h, stride, format); | ||
1115 | |||
1116 | close(fd); | ||
1117 | } | 995 | } |
1118 | 996 | ||
1119 | static void | 997 | static void |
@@ -1227,30 +1105,9 @@ _ecore_evas_wl_frame_add(Evas *evas) | |||
1227 | return evas_object_smart_add(evas, _ecore_evas_wl_smart); | 1105 | return evas_object_smart_add(evas, _ecore_evas_wl_smart); |
1228 | } | 1106 | } |
1229 | 1107 | ||
1230 | void | ||
1231 | _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location) | ||
1232 | { | ||
1233 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
1234 | |||
1235 | if ((!ee) || (!ee->engine.wl.shell_surface)) return; | ||
1236 | wl_shell_surface_resize(ee->engine.wl.shell_surface, | ||
1237 | ecore_wl_input_device_get(), | ||
1238 | _ecore_evas_wl_btn_timestamp, location); | ||
1239 | } | ||
1240 | |||
1241 | void | ||
1242 | _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) | ||
1243 | { | ||
1244 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
1245 | |||
1246 | if ((!ee) || (!ee->engine.wl.surface)) return; | ||
1247 | if ((!source) || (!drag_ee)) return; | ||
1248 | ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer); | ||
1249 | } | ||
1250 | |||
1251 | #else | 1108 | #else |
1252 | EAPI Ecore_Evas * | 1109 | EAPI Ecore_Evas * |
1253 | ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__) | 1110 | ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__) |
1254 | { | 1111 | { |
1255 | return NULL; | 1112 | return NULL; |
1256 | } | 1113 | } |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c index cfec528..32132b3 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_win32.c | |||
@@ -420,7 +420,7 @@ _ecore_evas_win32_free(Ecore_Evas *ee) | |||
420 | 420 | ||
421 | static void | 421 | static void |
422 | _ecore_evas_win32_callback_delete_request_set(Ecore_Evas *ee, | 422 | _ecore_evas_win32_callback_delete_request_set(Ecore_Evas *ee, |
423 | void (*func) (Ecore_Evas *ee)) | 423 | Ecore_Evas_Event_Cb func) |
424 | { | 424 | { |
425 | ee->func.fn_delete_request = func; | 425 | ee->func.fn_delete_request = func; |
426 | } | 426 | } |
@@ -717,7 +717,7 @@ _ecore_evas_win32_activate(Ecore_Evas *ee) | |||
717 | { | 717 | { |
718 | INF("ecore evas activate"); | 718 | INF("ecore evas activate"); |
719 | 719 | ||
720 | ecore_win32_window_focus_set((struct _Ecore_Win32_Window *)ee->prop.window); | 720 | ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window); |
721 | } | 721 | } |
722 | 722 | ||
723 | static void | 723 | static void |
@@ -819,7 +819,7 @@ _ecore_evas_win32_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int ho | |||
819 | static void | 819 | static void |
820 | _ecore_evas_win32_focus_set(Ecore_Evas *ee, int on __UNUSED__) | 820 | _ecore_evas_win32_focus_set(Ecore_Evas *ee, int on __UNUSED__) |
821 | { | 821 | { |
822 | ecore_win32_window_focus_set((struct _Ecore_Win32_Window *)ee->prop.window); | 822 | ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window); |
823 | } | 823 | } |
824 | 824 | ||
825 | static void | 825 | static void |
@@ -879,18 +879,12 @@ _ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, int on) | |||
879 | 879 | ||
880 | if (on != 0) | 880 | if (on != 0) |
881 | { | 881 | { |
882 | ecore_win32_window_shape_set((struct _Ecore_Win32_Window *)ee->prop.window, | ||
883 | 0, 0, NULL); | ||
884 | ecore_win32_window_fullscreen_set((struct _Ecore_Win32_Window *)ee->prop.window, | 882 | ecore_win32_window_fullscreen_set((struct _Ecore_Win32_Window *)ee->prop.window, |
885 | on); | 883 | on); |
886 | } | 884 | } |
887 | else | 885 | else |
888 | { | 886 | { |
889 | ecore_win32_window_fullscreen_set(window, on); | 887 | ecore_win32_window_fullscreen_set(window, on); |
890 | ecore_win32_window_shape_set(window, | ||
891 | window->shape.width, | ||
892 | window->shape.height, | ||
893 | window->shape.mask); | ||
894 | } | 888 | } |
895 | 889 | ||
896 | /* Nothing to be done for the GDI backend at the evas level */ | 890 | /* Nothing to be done for the GDI backend at the evas level */ |
@@ -982,6 +976,13 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func = | |||
982 | NULL, /* _ecore_evas_x_alpha_set */ | 976 | NULL, /* _ecore_evas_x_alpha_set */ |
983 | NULL, //transparent | 977 | NULL, //transparent |
984 | 978 | ||
979 | NULL, | ||
980 | NULL, | ||
981 | NULL, | ||
982 | NULL, | ||
983 | NULL, | ||
984 | NULL, | ||
985 | |||
985 | NULL, // render | 986 | NULL, // render |
986 | NULL //screen_geometry_get | 987 | NULL //screen_geometry_get |
987 | }; | 988 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wince.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wince.c index e102cb7..fecf26b 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_wince.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_wince.c | |||
@@ -345,7 +345,7 @@ _ecore_evas_wince_free(Ecore_Evas *ee) | |||
345 | 345 | ||
346 | static void | 346 | static void |
347 | _ecore_evas_wince_callback_delete_request_set(Ecore_Evas *ee, | 347 | _ecore_evas_wince_callback_delete_request_set(Ecore_Evas *ee, |
348 | void (*func) (Ecore_Evas *ee)) | 348 | Ecore_Evas_Event_Cb func) |
349 | { | 349 | { |
350 | ee->func.fn_delete_request = func; | 350 | ee->func.fn_delete_request = func; |
351 | } | 351 | } |
@@ -641,11 +641,11 @@ _ecore_evas_wince_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int ho | |||
641 | #endif | 641 | #endif |
642 | } | 642 | } |
643 | 643 | ||
644 | /* static void */ | 644 | static void |
645 | /* _ecore_evas_wince_focus_set(Ecore_Evas *ee, int on __UNUSED__) */ | 645 | _ecore_evas_wince_focus_set(Ecore_Evas *ee, int on __UNUSED__) |
646 | /* { */ | 646 | { |
647 | /* ecore_wince_window_focus_set(ee->prop.window); */ | 647 | ecore_wince_window_focus(ee->prop.window); |
648 | /* } */ | 648 | } |
649 | 649 | ||
650 | /* static void */ | 650 | /* static void */ |
651 | /* _ecore_evas_wince_iconified_set(Ecore_Evas *ee, int on) */ | 651 | /* _ecore_evas_wince_iconified_set(Ecore_Evas *ee, int on) */ |
@@ -760,7 +760,7 @@ static Ecore_Evas_Engine_Func _ecore_wince_engine_func = | |||
760 | NULL, //_ecore_evas_wince_size_step_set, | 760 | NULL, //_ecore_evas_wince_size_step_set, |
761 | _ecore_evas_wince_cursor_set, | 761 | _ecore_evas_wince_cursor_set, |
762 | NULL, /* _ecore_evas_x_layer_set */ | 762 | NULL, /* _ecore_evas_x_layer_set */ |
763 | NULL, //_ecore_evas_wince_focus_set, | 763 | _ecore_evas_wince_focus_set, |
764 | NULL, //_ecore_evas_wince_iconified_set, | 764 | NULL, //_ecore_evas_wince_iconified_set, |
765 | NULL, //_ecore_evas_wince_borderless_set, | 765 | NULL, //_ecore_evas_wince_borderless_set, |
766 | NULL, /* _ecore_evas_x_override_set */ | 766 | NULL, /* _ecore_evas_x_override_set */ |
@@ -773,6 +773,13 @@ static Ecore_Evas_Engine_Func _ecore_wince_engine_func = | |||
773 | NULL, /* _ecore_evas_x_alpha_set */ | 773 | NULL, /* _ecore_evas_x_alpha_set */ |
774 | NULL, //transparent | 774 | NULL, //transparent |
775 | 775 | ||
776 | NULL, | ||
777 | NULL, | ||
778 | NULL, | ||
779 | NULL, | ||
780 | NULL, | ||
781 | NULL, | ||
782 | |||
776 | NULL, // render | 783 | NULL, // render |
777 | NULL // screen_geometry_get | 784 | NULL // screen_geometry_get |
778 | }; | 785 | }; |
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c index 7d3af12..6dd13de 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c | |||
@@ -20,6 +20,22 @@ static int leader_ref = 0; | |||
20 | static Ecore_X_Window leader_win = 0; | 20 | static Ecore_X_Window leader_win = 0; |
21 | 21 | ||
22 | static void | 22 | static void |
23 | _ecore_evas_x_hints_update(Ecore_Evas *ee) | ||
24 | { | ||
25 | ecore_x_icccm_hints_set | ||
26 | (ee->prop.window, | ||
27 | !ee->prop.focus_skip /* accepts_focus */, | ||
28 | ee->prop.iconified ? ECORE_X_WINDOW_STATE_HINT_ICONIC : | ||
29 | ee->prop.withdrawn ? ECORE_X_WINDOW_STATE_HINT_WITHDRAWN : | ||
30 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
31 | 0 /* icon_pixmap */, | ||
32 | 0 /* icon_mask */, | ||
33 | 0 /* icon_window */, | ||
34 | ee->prop.group_ee_win /* window_group */, | ||
35 | ee->prop.urgent /* is_urgent */); | ||
36 | } | ||
37 | |||
38 | static void | ||
23 | _ecore_evas_x_group_leader_set(Ecore_Evas *ee) | 39 | _ecore_evas_x_group_leader_set(Ecore_Evas *ee) |
24 | { | 40 | { |
25 | leader_ref++; | 41 | leader_ref++; |
@@ -537,6 +553,7 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__, | |||
537 | { | 553 | { |
538 | Ecore_Evas *ee; | 554 | Ecore_Evas *ee; |
539 | Ecore_X_Event_Window_Property *e; | 555 | Ecore_X_Event_Window_Property *e; |
556 | int state_change = 0; | ||
540 | 557 | ||
541 | e = event; | 558 | e = event; |
542 | ee = ecore_event_window_match(e->win); | 559 | ee = ecore_event_window_match(e->win); |
@@ -546,20 +563,62 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__, | |||
546 | { | 563 | { |
547 | unsigned int i, num; | 564 | unsigned int i, num; |
548 | Ecore_X_Window_State *state; | 565 | Ecore_X_Window_State *state; |
549 | int sticky = 0; | 566 | struct { |
550 | 567 | struct { | |
551 | /* TODO: we need to move those to the end, with if statements */ | 568 | unsigned char modal : 1; |
552 | ee->engine.x.state.modal = 0; | 569 | unsigned char sticky : 1; |
553 | ee->engine.x.state.maximized_v = 0; | 570 | unsigned char maximized_v : 1; |
554 | ee->engine.x.state.maximized_h = 0; | 571 | unsigned char maximized_h : 1; |
555 | ee->engine.x.state.shaded = 0; | 572 | unsigned char shaded : 1; |
573 | unsigned char skip_taskbar : 1; | ||
574 | unsigned char skip_pager : 1; | ||
575 | unsigned char fullscreen : 1; | ||
576 | unsigned char above : 1; | ||
577 | unsigned char below : 1; | ||
578 | } x; | ||
579 | struct { | ||
580 | char modal : 1; | ||
581 | char maximized : 1; | ||
582 | char sticky : 1; | ||
583 | char fullscreen : 1; | ||
584 | char focus_skip : 1; | ||
585 | } prop; | ||
586 | } prev; | ||
587 | |||
588 | prev.x.modal = ee->engine.x.state.modal; | ||
589 | prev.x.sticky = ee->engine.x.state.sticky; | ||
590 | prev.x.maximized_v = ee->engine.x.state.maximized_v; | ||
591 | prev.x.maximized_h = ee->engine.x.state.maximized_h; | ||
592 | prev.x.shaded = ee->engine.x.state.shaded; | ||
593 | prev.x.skip_taskbar = ee->engine.x.state.skip_taskbar; | ||
594 | prev.x.skip_pager = ee->engine.x.state.skip_pager; | ||
595 | prev.x.fullscreen = ee->engine.x.state.fullscreen; | ||
596 | prev.x.above = ee->engine.x.state.above; | ||
597 | prev.x.below = ee->engine.x.state.below; | ||
598 | |||
599 | prev.prop.modal = ee->prop.modal; | ||
600 | prev.prop.maximized = ee->prop.maximized; | ||
601 | prev.prop.sticky = ee->prop.sticky; | ||
602 | prev.prop.fullscreen = ee->prop.fullscreen; | ||
603 | prev.prop.focus_skip = ee->prop.focus_skip; | ||
604 | |||
605 | ee->engine.x.state.modal = 0; | ||
606 | ee->engine.x.state.sticky = 0; | ||
607 | ee->engine.x.state.maximized_v = 0; | ||
608 | ee->engine.x.state.maximized_h = 0; | ||
609 | ee->engine.x.state.shaded = 0; | ||
556 | ee->engine.x.state.skip_taskbar = 0; | 610 | ee->engine.x.state.skip_taskbar = 0; |
557 | ee->engine.x.state.skip_pager = 0; | 611 | ee->engine.x.state.skip_pager = 0; |
612 | ee->engine.x.state.fullscreen = 0; | ||
613 | ee->engine.x.state.above = 0; | ||
614 | ee->engine.x.state.below = 0; | ||
615 | |||
616 | ee->prop.modal = 0; | ||
617 | ee->prop.maximized = 0; | ||
618 | ee->prop.sticky = 0; | ||
558 | ee->prop.fullscreen = 0; | 619 | ee->prop.fullscreen = 0; |
559 | ee->engine.x.state.fullscreen = 0; | 620 | ee->prop.focus_skip = 0; |
560 | ee->engine.x.state.above = 0; | 621 | |
561 | ee->engine.x.state.below = 0; | ||
562 | |||
563 | ecore_x_netwm_window_state_get(e->win, &state, &num); | 622 | ecore_x_netwm_window_state_get(e->win, &state, &num); |
564 | if (state) | 623 | if (state) |
565 | { | 624 | { |
@@ -568,56 +627,106 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__, | |||
568 | switch (state[i]) | 627 | switch (state[i]) |
569 | { | 628 | { |
570 | case ECORE_X_WINDOW_STATE_MODAL: | 629 | case ECORE_X_WINDOW_STATE_MODAL: |
571 | ee->engine.x.state.modal = 1; | 630 | ee->engine.x.state.modal = 1; |
572 | break; | 631 | ee->prop.modal = 1; |
632 | break; | ||
573 | case ECORE_X_WINDOW_STATE_STICKY: | 633 | case ECORE_X_WINDOW_STATE_STICKY: |
574 | if (ee->prop.sticky && ee->engine.x.state.sticky) | 634 | ee->prop.sticky = 1; |
575 | break; | 635 | ee->engine.x.state.sticky = 1; |
576 | 636 | break; | |
577 | sticky = 1; | ||
578 | ee->prop.sticky = 1; | ||
579 | ee->engine.x.state.sticky = 1; | ||
580 | if (ee->func.fn_sticky) ee->func.fn_sticky(ee); | ||
581 | break; | ||
582 | case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT: | 637 | case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT: |
583 | ee->engine.x.state.maximized_v = 1; | 638 | ee->engine.x.state.maximized_v = 1; |
584 | break; | 639 | ee->prop.maximized = 1; |
640 | break; | ||
585 | case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ: | 641 | case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ: |
586 | ee->engine.x.state.maximized_h = 1; | 642 | ee->engine.x.state.maximized_h = 1; |
587 | break; | 643 | ee->prop.maximized = 1; |
644 | break; | ||
588 | case ECORE_X_WINDOW_STATE_SHADED: | 645 | case ECORE_X_WINDOW_STATE_SHADED: |
589 | ee->engine.x.state.shaded = 1; | 646 | ee->engine.x.state.shaded = 1; |
590 | break; | 647 | break; |
591 | case ECORE_X_WINDOW_STATE_SKIP_TASKBAR: | 648 | case ECORE_X_WINDOW_STATE_SKIP_TASKBAR: |
592 | ee->engine.x.state.skip_taskbar = 1; | 649 | ee->engine.x.state.skip_taskbar = 1; |
593 | break; | 650 | ee->prop.focus_skip = 1; |
651 | break; | ||
594 | case ECORE_X_WINDOW_STATE_SKIP_PAGER: | 652 | case ECORE_X_WINDOW_STATE_SKIP_PAGER: |
595 | ee->engine.x.state.skip_pager = 1; | 653 | ee->engine.x.state.skip_pager = 1; |
596 | break; | 654 | ee->prop.focus_skip = 1; |
655 | break; | ||
597 | case ECORE_X_WINDOW_STATE_FULLSCREEN: | 656 | case ECORE_X_WINDOW_STATE_FULLSCREEN: |
598 | ee->prop.fullscreen = 1; | 657 | ee->prop.fullscreen = 1; |
599 | ee->engine.x.state.fullscreen = 1; | 658 | ee->engine.x.state.fullscreen = 1; |
600 | break; | 659 | break; |
601 | case ECORE_X_WINDOW_STATE_ABOVE: | 660 | case ECORE_X_WINDOW_STATE_ABOVE: |
602 | ee->engine.x.state.above = 1; | 661 | ee->engine.x.state.above = 1; |
603 | break; | 662 | break; |
604 | case ECORE_X_WINDOW_STATE_BELOW: | 663 | case ECORE_X_WINDOW_STATE_BELOW: |
605 | ee->engine.x.state.below = 1; | 664 | ee->engine.x.state.below = 1; |
606 | break; | 665 | break; |
607 | default: | 666 | default: |
608 | break; | 667 | break; |
609 | } | 668 | } |
610 | } | 669 | } |
611 | free(state); | 670 | free(state); |
612 | } | 671 | } |
613 | 672 | if ( | |
614 | if ((ee->prop.sticky) && (!sticky)) | 673 | // (prev.x.modal != ee->engine.x.state.modal) || |
674 | (prev.x.sticky != ee->engine.x.state.sticky) || | ||
675 | (prev.x.maximized_v != ee->engine.x.state.maximized_v) || | ||
676 | (prev.x.maximized_h != ee->engine.x.state.maximized_h) || | ||
677 | // (prev.x.shaded != ee->engine.x.state.shaded) || | ||
678 | // (prev.x.skip_taskbar != ee->engine.x.state.skip_taskbar) || | ||
679 | // (prev.x.skip_pager != ee->engine.x.state.skip_pager) || | ||
680 | (prev.x.fullscreen != ee->engine.x.state.fullscreen) || | ||
681 | // (prev.x.above != ee->engine.x.state.above) || | ||
682 | // (prev.x.below != ee->engine.x.state.below) || | ||
683 | // (prev.prop.modal != ee->prop.modal) || | ||
684 | (prev.prop.maximized != ee->prop.maximized) || | ||
685 | (prev.prop.sticky != ee->prop.sticky) || | ||
686 | (prev.prop.fullscreen != ee->prop.fullscreen) || | ||
687 | (prev.prop.focus_skip != ee->prop.focus_skip)) | ||
688 | state_change = 1; | ||
689 | } | ||
690 | else if (e->atom == ECORE_X_ATOM_WM_STATE) | ||
691 | { | ||
692 | Ecore_X_Window_State_Hint state; | ||
693 | |||
694 | // handle WM_STATE changes | ||
695 | state = ecore_x_icccm_state_get(e->win); | ||
696 | switch (state) | ||
615 | { | 697 | { |
616 | ee->prop.sticky = 0; | 698 | case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN: |
617 | ee->engine.x.state.sticky = 0; | 699 | if ((!ee->prop.withdrawn) || (ee->prop.iconified)) |
618 | if (ee->func.fn_unsticky) ee->func.fn_unsticky(ee); | 700 | { |
701 | state_change = 1; | ||
702 | ee->prop.withdrawn = 1; | ||
703 | ee->prop.iconified = 0; | ||
704 | } | ||
705 | break; | ||
706 | case ECORE_X_WINDOW_STATE_HINT_ICONIC: | ||
707 | if ((!ee->prop.iconified) || (ee->prop.withdrawn)) | ||
708 | { | ||
709 | state_change = 1; | ||
710 | ee->prop.iconified = 1; | ||
711 | ee->prop.withdrawn = 0; | ||
712 | } | ||
713 | break; | ||
714 | case ECORE_X_WINDOW_STATE_HINT_NORMAL: | ||
715 | if ((ee->prop.iconified) || (ee->prop.withdrawn)) | ||
716 | { | ||
717 | state_change = 1; | ||
718 | ee->prop.iconified = 0; | ||
719 | ee->prop.withdrawn = 0; | ||
720 | } | ||
721 | break; | ||
722 | default: | ||
723 | break; | ||
619 | } | 724 | } |
620 | } | 725 | } |
726 | if (state_change) | ||
727 | { | ||
728 | if (ee->func.fn_state_change) ee->func.fn_state_change(ee); | ||
729 | } | ||
621 | 730 | ||
622 | return ECORE_CALLBACK_PASS_ON; | 731 | return ECORE_CALLBACK_PASS_ON; |
623 | } | 732 | } |
@@ -826,7 +935,8 @@ _ecore_evas_x_event_window_focus_in(void *data __UNUSED__, int type __UNUSED__, | |||
826 | ee = ecore_event_window_match(e->win); | 935 | ee = ecore_event_window_match(e->win); |
827 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ | 936 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ |
828 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 937 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
829 | if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON; | 938 | //xx// filtering with these doesnt help |
939 | //xx// if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON; | ||
830 | ee->prop.focused = 1; | 940 | ee->prop.focused = 1; |
831 | evas_focus_in(ee->evas); | 941 | evas_focus_in(ee->evas); |
832 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); | 942 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); |
@@ -843,7 +953,9 @@ _ecore_evas_x_event_window_focus_out(void *data __UNUSED__, int type __UNUSED__, | |||
843 | ee = ecore_event_window_match(e->win); | 953 | ee = ecore_event_window_match(e->win); |
844 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ | 954 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ |
845 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 955 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
846 | if (e->mode == ECORE_X_EVENT_MODE_GRAB) return ECORE_CALLBACK_PASS_ON; | 956 | //xx// filtering with these doesnt help |
957 | //xx// if (e->mode == ECORE_X_EVENT_MODE_GRAB) return ECORE_CALLBACK_PASS_ON; | ||
958 | |||
847 | // if (ee->prop.fullscreen) | 959 | // if (ee->prop.fullscreen) |
848 | // ecore_x_window_focus(ee->prop.window); | 960 | // ecore_x_window_focus(ee->prop.window); |
849 | evas_focus_out(ee->evas); | 961 | evas_focus_out(ee->evas); |
@@ -1078,8 +1190,8 @@ _ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee) | |||
1078 | ee->prop.base.h /* base_h */, | 1190 | ee->prop.base.h /* base_h */, |
1079 | ee->prop.step.w /* step_x */, | 1191 | ee->prop.step.w /* step_x */, |
1080 | ee->prop.step.h /* step_y */, | 1192 | ee->prop.step.h /* step_y */, |
1081 | 0 /* min_aspect */, | 1193 | ee->prop.aspect /* min_aspect */, |
1082 | 0 /* max_aspect */); | 1194 | ee->prop.aspect /* max_aspect */); |
1083 | } | 1195 | } |
1084 | 1196 | ||
1085 | /* FIXME, should be in idler */ | 1197 | /* FIXME, should be in idler */ |
@@ -1089,32 +1201,30 @@ _ecore_evas_x_state_update(Ecore_Evas *ee) | |||
1089 | Ecore_X_Window_State state[10]; | 1201 | Ecore_X_Window_State state[10]; |
1090 | int num = 0; | 1202 | int num = 0; |
1091 | 1203 | ||
1092 | /* | 1204 | if (ee->prop.modal) |
1093 | if (bd->client.netwm.state.modal) | ||
1094 | state[num++] = ECORE_X_WINDOW_STATE_MODAL; | 1205 | state[num++] = ECORE_X_WINDOW_STATE_MODAL; |
1095 | */ | 1206 | if (ee->prop.sticky) |
1096 | if (ee->engine.x.state.sticky) | ||
1097 | state[num++] = ECORE_X_WINDOW_STATE_STICKY; | 1207 | state[num++] = ECORE_X_WINDOW_STATE_STICKY; |
1098 | /* | 1208 | if (ee->prop.maximized) |
1099 | if (bd->client.netwm.state.maximized_v) | ||
1100 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_VERT; | 1209 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_VERT; |
1101 | if (bd->client.netwm.state.maximized_h) | 1210 | if (ee->prop.maximized) |
1102 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ; | 1211 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ; |
1103 | if (bd->client.netwm.state.shaded) | 1212 | // if (bd->client.netwm.state.shaded) |
1104 | state[num++] = ECORE_X_WINDOW_STATE_SHADED; | 1213 | // state[num++] = ECORE_X_WINDOW_STATE_SHADED; |
1105 | if (bd->client.netwm.state.skip_taskbar) | 1214 | if (ee->prop.focus_skip) |
1106 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; | 1215 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; |
1107 | if (bd->client.netwm.state.skip_pager) | 1216 | if (ee->prop.focus_skip) |
1108 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER; | 1217 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER; |
1109 | if (bd->client.netwm.state.hidden) | 1218 | // if (bd->client.netwm.state.hidden) |
1110 | state[num++] = ECORE_X_WINDOW_STATE_HIDDEN; | 1219 | // state[num++] = ECORE_X_WINDOW_STATE_HIDDEN; |
1111 | */ | ||
1112 | if (ee->engine.x.state.fullscreen) | 1220 | if (ee->engine.x.state.fullscreen) |
1113 | state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN; | 1221 | state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN; |
1114 | if (ee->engine.x.state.above) | 1222 | if (ee->engine.x.state.above) |
1115 | state[num++] = ECORE_X_WINDOW_STATE_ABOVE; | 1223 | state[num++] = ECORE_X_WINDOW_STATE_ABOVE; |
1116 | if (ee->engine.x.state.below) | 1224 | if (ee->engine.x.state.below) |
1117 | state[num++] = ECORE_X_WINDOW_STATE_BELOW; | 1225 | state[num++] = ECORE_X_WINDOW_STATE_BELOW; |
1226 | if (ee->prop.demand_attention) | ||
1227 | state[num++] = ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION; | ||
1118 | 1228 | ||
1119 | ecore_x_netwm_window_state_set(ee->prop.window, state, num); | 1229 | ecore_x_netwm_window_state_set(ee->prop.window, state, num); |
1120 | } | 1230 | } |
@@ -1292,7 +1402,7 @@ _ecore_evas_x_free(Ecore_Evas *ee) | |||
1292 | } | 1402 | } |
1293 | 1403 | ||
1294 | static void | 1404 | static void |
1295 | _ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1405 | _ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1296 | { | 1406 | { |
1297 | ee->func.fn_delete_request = func; | 1407 | ee->func.fn_delete_request = func; |
1298 | _ecore_evas_x_protocols_set(ee); | 1408 | _ecore_evas_x_protocols_set(ee); |
@@ -1578,6 +1688,10 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation, int resize, | |||
1578 | static void | 1688 | static void |
1579 | _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | 1689 | _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) |
1580 | { | 1690 | { |
1691 | int angles[2]; | ||
1692 | angles[0] = rotation; | ||
1693 | angles[1] = ee->rotation; | ||
1694 | |||
1581 | if (ee->rotation == rotation) return; | 1695 | if (ee->rotation == rotation) return; |
1582 | if (!strcmp(ee->driver, "opengl_x11")) | 1696 | if (!strcmp(ee->driver, "opengl_x11")) |
1583 | { | 1697 | { |
@@ -1589,6 +1703,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1589 | einfo->info.rotation = rotation; | 1703 | einfo->info.rotation = rotation; |
1590 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1704 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1591 | (Evas_Engine_Info *)einfo); | 1705 | (Evas_Engine_Info *)einfo); |
1706 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1707 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1708 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1592 | #endif /* BUILD_ECORE_EVAS_OPENGL_X11 */ | 1709 | #endif /* BUILD_ECORE_EVAS_OPENGL_X11 */ |
1593 | } | 1710 | } |
1594 | else if (!strcmp(ee->driver, "software_x11")) | 1711 | else if (!strcmp(ee->driver, "software_x11")) |
@@ -1601,6 +1718,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1601 | einfo->info.rotation = rotation; | 1718 | einfo->info.rotation = rotation; |
1602 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1719 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1603 | (Evas_Engine_Info *)einfo); | 1720 | (Evas_Engine_Info *)einfo); |
1721 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1722 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1723 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1604 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ | 1724 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ |
1605 | } | 1725 | } |
1606 | else if (!strcmp(ee->driver, "software_16_x11")) | 1726 | else if (!strcmp(ee->driver, "software_16_x11")) |
@@ -1613,6 +1733,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1613 | einfo->info.rotation = rotation; | 1733 | einfo->info.rotation = rotation; |
1614 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1734 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1615 | (Evas_Engine_Info *)einfo); | 1735 | (Evas_Engine_Info *)einfo); |
1736 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1737 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1738 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1616 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */ | 1739 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */ |
1617 | } | 1740 | } |
1618 | else if (!strcmp(ee->driver, "software_8_x11")) | 1741 | else if (!strcmp(ee->driver, "software_8_x11")) |
@@ -1625,6 +1748,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1625 | einfo->info.rotation = rotation; | 1748 | einfo->info.rotation = rotation; |
1626 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1749 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1627 | (Evas_Engine_Info *)einfo); | 1750 | (Evas_Engine_Info *)einfo); |
1751 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1752 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1753 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1628 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */ | 1754 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */ |
1629 | } | 1755 | } |
1630 | } | 1756 | } |
@@ -1839,14 +1965,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
1839 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 1965 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
1840 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 1966 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
1841 | } | 1967 | } |
1842 | ecore_x_icccm_hints_set(ee->prop.window, | 1968 | _ecore_evas_x_hints_update(ee); |
1843 | 1 /* accepts_focus */, | ||
1844 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
1845 | 0 /* icon_pixmap */, | ||
1846 | 0 /* icon_mask */, | ||
1847 | 0 /* icon_window */, | ||
1848 | 0 /* window_group */, | ||
1849 | 0 /* is_urgent */); | ||
1850 | _ecore_evas_x_group_leader_update(ee); | 1969 | _ecore_evas_x_group_leader_update(ee); |
1851 | ecore_x_window_defaults_set(ee->prop.window); | 1970 | ecore_x_window_defaults_set(ee->prop.window); |
1852 | _ecore_evas_x_protocols_set(ee); | 1971 | _ecore_evas_x_protocols_set(ee); |
@@ -1962,14 +2081,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
1962 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 2081 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
1963 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 2082 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
1964 | } | 2083 | } |
1965 | ecore_x_icccm_hints_set(ee->prop.window, | 2084 | _ecore_evas_x_hints_update(ee); |
1966 | 1 /* accepts_focus */, | ||
1967 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
1968 | 0 /* icon_pixmap */, | ||
1969 | 0 /* icon_mask */, | ||
1970 | 0 /* icon_window */, | ||
1971 | 0 /* window_group */, | ||
1972 | 0 /* is_urgent */); | ||
1973 | _ecore_evas_x_group_leader_update(ee); | 2085 | _ecore_evas_x_group_leader_update(ee); |
1974 | ecore_x_window_defaults_set(ee->prop.window); | 2086 | ecore_x_window_defaults_set(ee->prop.window); |
1975 | _ecore_evas_x_protocols_set(ee); | 2087 | _ecore_evas_x_protocols_set(ee); |
@@ -2048,14 +2160,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
2048 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 2160 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
2049 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 2161 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
2050 | } | 2162 | } |
2051 | ecore_x_icccm_hints_set(ee->prop.window, | 2163 | _ecore_evas_x_hints_update(ee); |
2052 | 1 /* accepts_focus */, | ||
2053 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
2054 | 0 /* icon_pixmap */, | ||
2055 | 0 /* icon_mask */, | ||
2056 | 0 /* icon_window */, | ||
2057 | 0 /* window_group */, | ||
2058 | 0 /* is_urgent */); | ||
2059 | _ecore_evas_x_group_leader_update(ee); | 2164 | _ecore_evas_x_group_leader_update(ee); |
2060 | ecore_x_window_defaults_set(ee->prop.window); | 2165 | ecore_x_window_defaults_set(ee->prop.window); |
2061 | _ecore_evas_x_protocols_set(ee); | 2166 | _ecore_evas_x_protocols_set(ee); |
@@ -2134,14 +2239,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
2134 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 2239 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
2135 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 2240 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
2136 | } | 2241 | } |
2137 | ecore_x_icccm_hints_set(ee->prop.window, | 2242 | _ecore_evas_x_hints_update(ee); |
2138 | 1 /* accepts_focus */, | ||
2139 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
2140 | 0 /* icon_pixmap */, | ||
2141 | 0 /* icon_mask */, | ||
2142 | 0 /* icon_window */, | ||
2143 | 0 /* window_group */, | ||
2144 | 0 /* is_urgent */); | ||
2145 | _ecore_evas_x_group_leader_update(ee); | 2243 | _ecore_evas_x_group_leader_update(ee); |
2146 | ecore_x_window_defaults_set(ee->prop.window); | 2244 | ecore_x_window_defaults_set(ee->prop.window); |
2147 | _ecore_evas_x_protocols_set(ee); | 2245 | _ecore_evas_x_protocols_set(ee); |
@@ -2182,6 +2280,88 @@ _ecore_evas_x_transparent_set(Ecore_Evas *ee, int transparent) | |||
2182 | #endif | 2280 | #endif |
2183 | } | 2281 | } |
2184 | } | 2282 | } |
2283 | |||
2284 | static void | ||
2285 | _ecore_evas_x_window_group_set(Ecore_Evas *ee, const Ecore_Evas *group_ee) | ||
2286 | { | ||
2287 | if (ee->prop.group_ee == group_ee) return; | ||
2288 | |||
2289 | ee->prop.group_ee = (Ecore_Evas *)group_ee; | ||
2290 | if (ee->prop.group_ee) | ||
2291 | ee->prop.group_ee_win = group_ee->prop.window; | ||
2292 | else | ||
2293 | ee->prop.group_ee_win = 0; | ||
2294 | _ecore_evas_x_hints_update(ee); | ||
2295 | } | ||
2296 | |||
2297 | static void | ||
2298 | _ecore_evas_x_aspect_set(Ecore_Evas *ee, double aspect) | ||
2299 | { | ||
2300 | if (ee->prop.aspect == aspect) return; | ||
2301 | |||
2302 | ee->prop.aspect = aspect; | ||
2303 | _ecore_evas_x_size_pos_hints_update(ee); | ||
2304 | // netwm state | ||
2305 | // if (ee->should_be_visible) | ||
2306 | // ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2307 | // ECORE_X_WINDOW_STATE_STICKY, -1, sticky); | ||
2308 | // else | ||
2309 | // _ecore_evas_x_state_update(ee); | ||
2310 | } | ||
2311 | |||
2312 | static void | ||
2313 | _ecore_evas_x_urgent_set(Ecore_Evas *ee, int urgent) | ||
2314 | { | ||
2315 | if (ee->prop.urgent == urgent) return; | ||
2316 | |||
2317 | ee->prop.urgent = urgent; | ||
2318 | _ecore_evas_x_hints_update(ee); | ||
2319 | } | ||
2320 | |||
2321 | static void | ||
2322 | _ecore_evas_x_modal_set(Ecore_Evas *ee, int modal) | ||
2323 | { | ||
2324 | if (ee->prop.modal == modal) return; | ||
2325 | |||
2326 | ee->prop.modal = modal; | ||
2327 | if (ee->should_be_visible) | ||
2328 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2329 | ECORE_X_WINDOW_STATE_MODAL, -1, modal); | ||
2330 | else | ||
2331 | _ecore_evas_x_state_update(ee); | ||
2332 | } | ||
2333 | |||
2334 | static void | ||
2335 | _ecore_evas_x_demand_attention_set(Ecore_Evas *ee, int demand) | ||
2336 | { | ||
2337 | if (ee->prop.demand_attention == demand) return; | ||
2338 | |||
2339 | ee->prop.demand_attention = demand; | ||
2340 | if (ee->should_be_visible) | ||
2341 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2342 | ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION, -1, demand); | ||
2343 | else | ||
2344 | _ecore_evas_x_state_update(ee); | ||
2345 | } | ||
2346 | |||
2347 | static void | ||
2348 | _ecore_evas_x_focus_skip_set(Ecore_Evas *ee, int skip) | ||
2349 | { | ||
2350 | if (ee->prop.focus_skip == skip) return; | ||
2351 | |||
2352 | ee->prop.focus_skip = skip; | ||
2353 | if (ee->should_be_visible) | ||
2354 | { | ||
2355 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2356 | ECORE_X_WINDOW_STATE_SKIP_TASKBAR, -1, skip); | ||
2357 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2358 | ECORE_X_WINDOW_STATE_SKIP_PAGER, -1, skip); | ||
2359 | } | ||
2360 | else | ||
2361 | _ecore_evas_x_state_update(ee); | ||
2362 | _ecore_evas_x_hints_update(ee); | ||
2363 | } | ||
2364 | |||
2185 | #endif /* BUILD_ECORE_EVAS_X11 */ | 2365 | #endif /* BUILD_ECORE_EVAS_X11 */ |
2186 | 2366 | ||
2187 | #ifdef BUILD_ECORE_EVAS_X11 | 2367 | #ifdef BUILD_ECORE_EVAS_X11 |
@@ -2369,30 +2549,11 @@ _ecore_evas_x_iconified_set(Ecore_Evas *ee, int on) | |||
2369 | { | 2549 | { |
2370 | if (ee->prop.iconified == on) return; | 2550 | if (ee->prop.iconified == on) return; |
2371 | ee->prop.iconified = on; | 2551 | ee->prop.iconified = on; |
2552 | _ecore_evas_x_hints_update(ee); | ||
2372 | if (on) | 2553 | if (on) |
2373 | { | 2554 | ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root); |
2374 | ecore_x_icccm_hints_set(ee->prop.window, | ||
2375 | 1 /* accepts_focus */, | ||
2376 | ECORE_X_WINDOW_STATE_HINT_ICONIC /* initial_state */, | ||
2377 | 0 /* icon_pixmap */, | ||
2378 | 0 /* icon_mask */, | ||
2379 | 0 /* icon_window */, | ||
2380 | 0 /* window_group */, | ||
2381 | 0 /* is_urgent */); | ||
2382 | ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root); | ||
2383 | } | ||
2384 | else | 2555 | else |
2385 | { | 2556 | ecore_evas_show(ee); |
2386 | ecore_x_icccm_hints_set(ee->prop.window, | ||
2387 | 1 /* accepts_focus */, | ||
2388 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
2389 | 0 /* icon_pixmap */, | ||
2390 | 0 /* icon_mask */, | ||
2391 | 0 /* icon_window */, | ||
2392 | 0 /* window_group */, | ||
2393 | 0 /* is_urgent */); | ||
2394 | ecore_evas_show(ee); | ||
2395 | } | ||
2396 | } | 2557 | } |
2397 | 2558 | ||
2398 | static void | 2559 | static void |
@@ -2408,24 +2569,9 @@ _ecore_evas_x_borderless_set(Ecore_Evas *ee, int on) | |||
2408 | static void | 2569 | static void |
2409 | _ecore_evas_x_withdrawn_set(Ecore_Evas *ee, int withdrawn) | 2570 | _ecore_evas_x_withdrawn_set(Ecore_Evas *ee, int withdrawn) |
2410 | { | 2571 | { |
2411 | Ecore_X_Window_State_Hint hint; | ||
2412 | |||
2413 | if (ee->prop.withdrawn == withdrawn) return; | 2572 | if (ee->prop.withdrawn == withdrawn) return; |
2414 | |||
2415 | ee->prop.withdrawn = withdrawn; | 2573 | ee->prop.withdrawn = withdrawn; |
2416 | if (withdrawn) | 2574 | _ecore_evas_x_hints_update(ee); |
2417 | hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN; | ||
2418 | else | ||
2419 | hint = ECORE_X_WINDOW_STATE_HINT_NORMAL; | ||
2420 | |||
2421 | ecore_x_icccm_hints_set(ee->prop.window, | ||
2422 | 1 /* accepts_focus */, | ||
2423 | hint /* initial_state */, | ||
2424 | 0 /* icon_pixmap */, | ||
2425 | 0 /* icon_mask */, | ||
2426 | 0 /* icon_window */, | ||
2427 | 0 /* window_group */, | ||
2428 | 0 /* is_urgent */); | ||
2429 | } | 2575 | } |
2430 | 2576 | ||
2431 | static void | 2577 | static void |
@@ -2762,6 +2908,13 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func = | |||
2762 | _ecore_evas_x_ignore_events_set, | 2908 | _ecore_evas_x_ignore_events_set, |
2763 | _ecore_evas_x_alpha_set, | 2909 | _ecore_evas_x_alpha_set, |
2764 | _ecore_evas_x_transparent_set, | 2910 | _ecore_evas_x_transparent_set, |
2911 | |||
2912 | _ecore_evas_x_window_group_set, | ||
2913 | _ecore_evas_x_aspect_set, | ||
2914 | _ecore_evas_x_urgent_set, | ||
2915 | _ecore_evas_x_modal_set, | ||
2916 | _ecore_evas_x_demand_attention_set, | ||
2917 | _ecore_evas_x_focus_skip_set, | ||
2765 | 2918 | ||
2766 | NULL, // render | 2919 | NULL, // render |
2767 | _ecore_evas_x_screen_geometry_get | 2920 | _ecore_evas_x_screen_geometry_get |
@@ -3003,14 +3156,7 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, | |||
3003 | } | 3156 | } |
3004 | } | 3157 | } |
3005 | 3158 | ||
3006 | ecore_x_icccm_hints_set(ee->prop.window, | 3159 | _ecore_evas_x_hints_update(ee); |
3007 | 1 /* accepts_focus */, | ||
3008 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3009 | 0 /* icon_pixmap */, | ||
3010 | 0 /* icon_mask */, | ||
3011 | 0 /* icon_window */, | ||
3012 | 0 /* window_group */, | ||
3013 | 0 /* is_urgent */); | ||
3014 | _ecore_evas_x_group_leader_set(ee); | 3160 | _ecore_evas_x_group_leader_set(ee); |
3015 | ecore_x_window_defaults_set(ee->prop.window); | 3161 | ecore_x_window_defaults_set(ee->prop.window); |
3016 | _ecore_evas_x_protocols_set(ee); | 3162 | _ecore_evas_x_protocols_set(ee); |
@@ -3240,14 +3386,7 @@ ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, | |||
3240 | // putenv((char*)"DESKTOP_STARTUP_ID="); | 3386 | // putenv((char*)"DESKTOP_STARTUP_ID="); |
3241 | } | 3387 | } |
3242 | 3388 | ||
3243 | ecore_x_icccm_hints_set(ee->prop.window, | 3389 | _ecore_evas_x_hints_update(ee); |
3244 | 1 /* accepts_focus */, | ||
3245 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3246 | 0 /* icon_pixmap */, | ||
3247 | 0 /* icon_mask */, | ||
3248 | 0 /* icon_window */, | ||
3249 | 0 /* window_group */, | ||
3250 | 0 /* is_urgent */); | ||
3251 | _ecore_evas_x_group_leader_set(ee); | 3390 | _ecore_evas_x_group_leader_set(ee); |
3252 | ecore_x_window_defaults_set(ee->prop.window); | 3391 | ecore_x_window_defaults_set(ee->prop.window); |
3253 | _ecore_evas_x_protocols_set(ee); | 3392 | _ecore_evas_x_protocols_set(ee); |
@@ -3571,14 +3710,7 @@ ecore_evas_software_x11_16_new(const char *disp_name, Ecore_X_Window parent, | |||
3571 | return NULL; | 3710 | return NULL; |
3572 | } | 3711 | } |
3573 | 3712 | ||
3574 | ecore_x_icccm_hints_set(ee->prop.window, | 3713 | _ecore_evas_x_hints_update(ee); |
3575 | 1 /* accepts_focus */, | ||
3576 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3577 | 0 /* icon_pixmap */, | ||
3578 | 0 /* icon_mask */, | ||
3579 | 0 /* icon_window */, | ||
3580 | 0 /* window_group */, | ||
3581 | 0 /* is_urgent */); | ||
3582 | _ecore_evas_x_group_leader_set(ee); | 3714 | _ecore_evas_x_group_leader_set(ee); |
3583 | ecore_x_window_defaults_set(ee->prop.window); | 3715 | ecore_x_window_defaults_set(ee->prop.window); |
3584 | _ecore_evas_x_protocols_set(ee); | 3716 | _ecore_evas_x_protocols_set(ee); |
@@ -3895,14 +4027,7 @@ ecore_evas_software_x11_8_new(const char *disp_name, Ecore_X_Window parent, | |||
3895 | return NULL; | 4027 | return NULL; |
3896 | } | 4028 | } |
3897 | 4029 | ||
3898 | ecore_x_icccm_hints_set(ee->prop.window, | 4030 | _ecore_evas_x_hints_update(ee); |
3899 | 1 /* accepts_focus */, | ||
3900 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3901 | 0 /* icon_pixmap */, | ||
3902 | 0 /* icon_mask */, | ||
3903 | 0 /* icon_window */, | ||
3904 | 0 /* window_group */, | ||
3905 | 0 /* is_urgent */); | ||
3906 | _ecore_evas_x_group_leader_set(ee); | 4031 | _ecore_evas_x_group_leader_set(ee); |
3907 | ecore_x_window_defaults_set(ee->prop.window); | 4032 | ecore_x_window_defaults_set(ee->prop.window); |
3908 | _ecore_evas_x_protocols_set(ee); | 4033 | _ecore_evas_x_protocols_set(ee); |