2 # include "elementary_config.h"
5 #include <Elementary.h>
6 #include <Elementary_Cursor.h>
9 #include "elm_widget_menu.h"
11 #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
13 #include "elm_interface_atspi_accessible.h"
14 #include "elm_interface_atspi_accessible.eo.h"
15 #include "elm_interface_atspi_window.eo.h"
16 #include "elm_interface_atspi_widget.eo.h"
18 #define MY_CLASS ELM_OBJ_WIN_CLASS
20 #define MY_CLASS_NAME "Elm_Win"
21 #define MY_CLASS_NAME_LEGACY "elm_win"
23 static const Elm_Win_Trap *trap = NULL;
25 #define TRAP(sd, name, ...) \
28 if ((!trap) || (!trap->name) || \
30 (trap->name(sd->trap_data, sd->obj, ## __VA_ARGS__)))) \
31 ecore_evas_##name(sd->ee, ##__VA_ARGS__); \
35 #define ELM_WIN_DATA_GET(o, sd) \
36 Elm_Win_Data * sd = eo_data_scope_get(o, MY_CLASS)
38 #define ELM_WIN_DATA_GET_OR_RETURN(o, ptr) \
39 ELM_WIN_DATA_GET(o, ptr); \
42 CRI("No widget data for object %p (%s)", \
43 o, evas_object_type_get(o)); \
47 #define ELM_WIN_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
48 ELM_WIN_DATA_GET(o, ptr); \
51 CRI("No widget data for object %p (%s)", \
52 o, evas_object_type_get(o)); \
56 #define ELM_WIN_CHECK(obj) \
57 if (!obj || !eo_isa(obj, MY_CLASS)) \
60 #define DECREMENT_MODALITY() \
61 EINA_LIST_FOREACH(_elm_win_list, l, current) \
63 ELM_WIN_DATA_GET_OR_RETURN(current, cursd); \
64 if ((obj != current) && (cursd->modal_count > 0)) \
66 cursd->modal_count--; \
68 if (cursd->modal_count == 0) \
70 edje_object_signal_emit(cursd->layout, \
71 "elm,action,hide_blocker", "elm"); \
72 evas_object_smart_callback_call(cursd->main_menu, \
73 "elm,action,unblock_menu", NULL); \
77 #define INCREMENT_MODALITY() \
78 EINA_LIST_FOREACH(_elm_win_list, l, current) \
80 ELM_WIN_DATA_GET_OR_RETURN(current, cursd); \
83 cursd->modal_count++; \
85 if (cursd->modal_count > 0) \
87 edje_object_signal_emit(cursd->layout, \
88 "elm,action,show_blocker", "elm"); \
89 evas_object_smart_callback_call(cursd->main_menu, \
90 "elm,action,block_menu", NULL); \
94 #define ENGINE_GET() (_elm_preferred_engine ? _elm_preferred_engine : (_elm_config->engine ? _elm_config->engine : ""))
95 #define ENGINE_COMPARE(name) (!strcmp(ENGINE_GET(), name))
97 typedef struct _Elm_Win_Data Elm_Win_Data;
103 Evas_Object *parent; /* parent *window* object*/
104 Evas_Object *img_obj, *frame_obj;
105 Evas_Object *client_obj; /* rect representing the client */
106 Evas_Object *spacer_obj;
109 Evas_Object *obj; /* The object itself */
110 #ifdef HAVE_ELEMENTARY_X
114 Ecore_Event_Handler *client_message_handler;
115 Ecore_Event_Handler *property_handler;
118 #ifdef HAVE_ELEMENTARY_WAYLAND
121 Ecore_Wl_Window *win;
125 Ecore_Job *deferred_resize_job;
126 Ecore_Job *deferred_child_eval_job;
129 Elm_Win_Keyboard_Mode kbdmode;
130 Elm_Win_Indicator_Mode indmode;
131 Elm_Win_Indicator_Opacity_Mode ind_o_mode;
140 int *autodel_clear, rot;
149 Evas_Object *obj, *hot_obj;
154 Evas_Object *fobj; /* focus highlight edje object */
159 Eina_Bool visible : 1;
160 Eina_Bool in_theme: 1; /**< focus highlight is handled by theme.
161 this is set true if edc data item "focus_highlight" is set to "on" during focus in callback. */
165 Ecore_Job *reconf_job;
167 Eina_Bool enabled : 1;
168 Eina_Bool theme_changed : 1; /* set true when the focus theme is changed */
169 Eina_Bool animate : 1; /* set true when the focus highlight animate is enabled */
170 Eina_Bool animate_supported : 1; /* set true when the focus highlight animate is supported by theme */
171 Eina_Bool geometry_changed : 1;
176 const char *icon_name;
179 Evas_Object *main_menu;
184 const char **available_list;
189 int preferred_rot; /* indicates preferred rotation value, -1 means invalid. */
190 int *rots; /* indicates available rotations */
191 unsigned int count; /* number of elements in available rotations */
192 Eina_Bool wm_supported : 1; /* set true when the window manager support window rotation */
193 Eina_Bool use : 1; /* set ture when application use window manager rotation. */
199 int size_base_w, size_base_h;
200 int size_step_w, size_step_h;
203 Eina_Bool urgent : 1;
205 Eina_Bool demand_attention : 1;
206 Eina_Bool autodel : 1;
207 Eina_Bool constrain : 1;
208 Eina_Bool resizing : 1;
209 Eina_Bool iconified : 1;
210 Eina_Bool withdrawn : 1;
211 Eina_Bool sticky : 1;
212 Eina_Bool fullscreen : 1;
213 Eina_Bool maximized : 1;
214 Eina_Bool skip_focus : 1;
215 Eina_Bool floating : 1;
218 static const char SIG_DELETE_REQUEST[] = "delete,request";
219 static const char SIG_FOCUS_OUT[] = "focus,out"; // deprecated. use "focused" instead.
220 static const char SIG_FOCUS_IN[] = "focus,in"; // deprecated. use "unfocused" instead.
221 static const char SIG_MOVED[] = "moved";
222 static const char SIG_WITHDRAWN[] = "withdrawn";
223 static const char SIG_ICONIFIED[] = "iconified";
224 static const char SIG_NORMAL[] = "normal";
225 static const char SIG_STICK[] = "stick";
226 static const char SIG_UNSTICK[] = "unstick";
227 static const char SIG_FULLSCREEN[] = "fullscreen";
228 static const char SIG_UNFULLSCREEN[] = "unfullscreen";
229 static const char SIG_MAXIMIZED[] = "maximized";
230 static const char SIG_UNMAXIMIZED[] = "unmaximized";
231 static const char SIG_IOERR[] = "ioerr";
232 static const char SIG_INDICATOR_PROP_CHANGED[] = "indicator,prop,changed";
233 static const char SIG_ROTATION_CHANGED[] = "rotation,changed";
234 static const char SIG_PROFILE_CHANGED[] = "profile,changed";
235 static const char SIG_FOCUSED[] = "focused";
236 static const char SIG_UNFOCUSED[] = "unfocused";
237 static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed";
239 static const Evas_Smart_Cb_Description _smart_callbacks[] = {
240 {SIG_DELETE_REQUEST, ""},
249 {SIG_FULLSCREEN, ""},
250 {SIG_UNFULLSCREEN, ""},
252 {SIG_UNMAXIMIZED, ""},
254 {SIG_INDICATOR_PROP_CHANGED, ""},
255 {SIG_ROTATION_CHANGED, ""},
256 {SIG_PROFILE_CHANGED, ""},
259 {SIG_WM_ROTATION_CHANGED, ""},
263 static Eina_Bool _key_action_return(Evas_Object *obj, const char *params);
264 static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
266 static const Elm_Action key_actions[] = {
267 {"return", _key_action_return},
268 {"move", _key_action_move},
272 Eina_List *_elm_win_list = NULL;
273 int _elm_win_deferred_free = 0;
275 static int _elm_win_count = 0;
277 static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
279 static Ecore_Job *_elm_win_state_eval_job = NULL;
282 _elm_win_on_resize_obj_changed_size_hints(void *data,
287 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj);
289 #ifdef HAVE_ELEMENTARY_X
290 static void _elm_win_xwin_update(Elm_Win_Data *sd);
293 EAPI double _elm_startup_time = 0;
296 _elm_win_first_frame_do(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
298 double end = ecore_time_unix_get();
306 case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f' sec\n", end, _elm_startup_time, end - _elm_startup_time);
310 evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, data);
314 _elm_win_state_eval(void *data EINA_UNUSED)
318 int _elm_win_count_shown = 0;
319 int _elm_win_count_iconified = 0;
320 int _elm_win_count_withdrawn = 0;
322 _elm_win_state_eval_job = NULL;
324 if (_elm_config->auto_norender_withdrawn)
326 EINA_LIST_FOREACH(_elm_win_list, l, obj)
328 if ((elm_win_withdrawn_get(obj)) ||
329 ((elm_win_iconified_get(obj) &&
330 (_elm_config->auto_norender_iconified_same_as_withdrawn))))
332 if (!evas_object_data_get(obj, "__win_auto_norender"))
334 Evas *evas = evas_object_evas_get(obj);
336 elm_win_norender_push(obj);
337 evas_object_data_set(obj, "__win_auto_norender", obj);
339 if (_elm_config->auto_flush_withdrawn)
341 edje_file_cache_flush();
342 edje_collection_cache_flush();
343 evas_image_cache_flush(evas);
344 evas_font_cache_flush(evas);
346 if (_elm_config->auto_dump_withdrawn)
348 evas_render_dump(evas);
354 if (evas_object_data_get(obj, "__win_auto_norender"))
356 elm_win_norender_pop(obj);
357 evas_object_data_del(obj, "__win_auto_norender");
362 if (((_elm_config->auto_throttle) &&
363 (elm_policy_get(ELM_POLICY_THROTTLE) != ELM_POLICY_THROTTLE_NEVER)) ||
364 (elm_policy_get(ELM_POLICY_THROTTLE) == ELM_POLICY_THROTTLE_HIDDEN_ALWAYS))
366 if (_elm_win_count == 0)
368 if (_elm_win_auto_throttled)
370 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
371 _elm_win_auto_throttled = EINA_FALSE;
376 EINA_LIST_FOREACH(_elm_win_list, l, obj)
378 if (elm_win_withdrawn_get(obj))
379 _elm_win_count_withdrawn++;
380 else if (elm_win_iconified_get(obj))
381 _elm_win_count_iconified++;
382 else if (evas_object_visible_get(obj))
383 _elm_win_count_shown++;
385 if (_elm_win_count_shown <= 0)
387 if (!_elm_win_auto_throttled)
389 ecore_throttle_adjust(_elm_config->auto_throttle_amount);
390 _elm_win_auto_throttled = EINA_TRUE;
395 if (_elm_win_auto_throttled)
397 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
398 _elm_win_auto_throttled = EINA_FALSE;
406 _elm_win_state_eval_queue(void)
408 ecore_job_del(_elm_win_state_eval_job);
409 _elm_win_state_eval_job = ecore_job_add(_elm_win_state_eval, NULL);
412 // example shot spec (wait 0.1 sec then save as my-window.png):
413 // ELM_ENGINE="shot:delay=0.1:file=my-window.png"
416 _shot_delay_get(Elm_Win_Data *sd)
419 char *d = strdup(sd->shot.info);
422 for (p = (char *)sd->shot.info; *p; p++)
424 if (!strncmp(p, "delay=", 6))
428 for (pd = d, p += 6; (*p) && (*p != ':'); p++, pd++)
444 _shot_file_get(Elm_Win_Data *sd)
447 char *tmp = strdup(sd->shot.info);
448 char *repname = NULL;
450 if (!tmp) return NULL;
452 for (p = (char *)sd->shot.info; *p; p++)
454 if (!strncmp(p, "file=", 5))
457 if (!sd->shot.repeat_count) return tmp;
460 char *dotptr = strrchr(tmp, '.');
463 size_t size = sizeof(char) * (strlen(tmp) + 16);
464 repname = malloc(size);
465 strncpy(repname, tmp, dotptr - tmp);
466 snprintf(repname + (dotptr - tmp), size -
467 (dotptr - tmp), "%03i",
468 sd->shot.shot_counter + 1);
469 strcat(repname, dotptr);
477 if (!sd->shot.repeat_count) return strdup("out.png");
479 repname = malloc(sizeof(char) * 24);
480 snprintf(repname, sizeof(char) * 24, "out%03i.png",
481 sd->shot.shot_counter + 1);
487 _shot_repeat_count_get(Elm_Win_Data *sd)
490 char *d = strdup(sd->shot.info);
493 for (p = (char *)sd->shot.info; *p; p++)
495 if (!strncmp(p, "repeat=", 7))
499 for (pd = d, p += 7; (*p) && (*p != ':'); p++, pd++)
506 if (v > 1000) v = 999;
517 _shot_key_get(Elm_Win_Data *sd EINA_UNUSED)
523 _shot_flags_get(Elm_Win_Data *sd EINA_UNUSED)
529 _shot_do(Elm_Win_Data *sd)
533 unsigned int *pixels;
535 char *file, *key, *flags;
537 ecore_evas_manual_render(sd->ee);
538 pixels = (void *)ecore_evas_buffer_pixels_get(sd->ee);
541 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
542 if ((w < 1) || (h < 1)) return;
544 file = _shot_file_get(sd);
547 key = _shot_key_get(sd);
548 flags = _shot_flags_get(sd);
549 ee = ecore_evas_buffer_new(1, 1);
550 o = evas_object_image_add(ecore_evas_get(ee));
551 evas_object_image_alpha_set(o, ecore_evas_alpha_get(sd->ee));
552 evas_object_image_size_set(o, w, h);
553 evas_object_image_data_set(o, pixels);
554 if (!evas_object_image_save(o, file, key, flags))
556 ERR("Cannot save window to '%s' (key '%s', flags '%s')",
563 if (sd->shot.repeat_count) sd->shot.shot_counter++;
567 _shot_delay(void *data)
569 ELM_WIN_DATA_GET(data, sd);
572 if (sd->shot.repeat_count)
574 int remainshot = (sd->shot.repeat_count - sd->shot.shot_counter);
575 if (remainshot > 0) return EINA_TRUE;
577 sd->shot.timer = NULL;
584 _shot_init(Elm_Win_Data *sd)
586 if (!sd->shot.info) return;
588 sd->shot.repeat_count = _shot_repeat_count_get(sd);
589 sd->shot.shot_counter = 0;
593 _shot_handle(Elm_Win_Data *sd)
595 if (!sd->shot.info) return;
598 sd->shot.timer = ecore_timer_add(_shot_delay_get(sd), _shot_delay,
602 /* elm-win specific associate, does the trap while ecore_evas_object_associate()
605 static Elm_Win_Data *
606 _elm_win_associate_get(const Ecore_Evas *ee)
608 Evas_Object *obj = ecore_evas_data_get(ee, "elm_win");
609 if (!obj) return NULL;
610 ELM_WIN_DATA_GET(obj, sd);
614 /* Interceptors Callbacks */
616 _elm_win_obj_intercept_raise(void *data, Evas_Object *obj EINA_UNUSED)
618 ELM_WIN_DATA_GET(data, sd);
623 _elm_win_obj_intercept_lower(void *data, Evas_Object *obj EINA_UNUSED)
625 ELM_WIN_DATA_GET(data, sd);
630 _elm_win_obj_intercept_stack_above(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *above EINA_UNUSED)
632 INF("TODO: %s", __FUNCTION__);
636 _elm_win_obj_intercept_stack_below(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *below EINA_UNUSED)
638 INF("TODO: %s", __FUNCTION__);
642 _elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj EINA_UNUSED, int l)
644 ELM_WIN_DATA_GET(data, sd);
645 TRAP(sd, layer_set, l);
648 /* Event Callbacks */
651 _elm_win_obj_callback_changed_size_hints(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
653 ELM_WIN_DATA_GET(data, sd);
656 evas_object_size_hint_min_get(obj, &w, &h);
657 TRAP(sd, size_min_set, w, h);
659 evas_object_size_hint_max_get(obj, &w, &h);
662 TRAP(sd, size_max_set, w, h);
664 /* end of elm-win specific associate */
667 _elm_win_move(Ecore_Evas *ee)
669 Elm_Win_Data *sd = _elm_win_associate_get(ee);
674 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
677 evas_object_smart_callback_call(sd->obj, SIG_MOVED, NULL);
678 evas_nochange_push(evas_object_evas_get(sd->obj));
679 evas_object_move(sd->obj, x, y);
680 evas_nochange_pop(evas_object_evas_get(sd->obj));
684 _elm_win_resize_job(void *data)
686 ELM_WIN_DATA_GET(data, sd);
689 sd->deferred_resize_job = NULL;
690 ecore_evas_request_geometry_get(sd->ee, NULL, NULL, &w, &h);
694 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
703 evas_output_framespace_get(sd->evas, &fx, &fy, &fw, &fh);
704 evas_object_move(sd->frame_obj, -fx, -fy);
705 evas_object_resize(sd->frame_obj, w + fw, h + fh);
708 evas_object_resize(sd->obj, w, h);
709 evas_object_resize(sd->layout, w, h);
713 _elm_win_resize(Ecore_Evas *ee)
715 Elm_Win_Data *sd = _elm_win_associate_get(ee);
718 ecore_job_del(sd->deferred_resize_job);
719 sd->deferred_resize_job = ecore_job_add(_elm_win_resize_job, sd->obj);
723 _elm_win_mouse_in(Ecore_Evas *ee)
725 Elm_Win_Data *sd = _elm_win_associate_get(ee);
728 if (sd->resizing) sd->resizing = EINA_FALSE;
732 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win_Data *sd)
734 ELM_SAFE_FREE(sd->focus_highlight.reconf_job, ecore_job_del);
738 _elm_win_focus_highlight_visible_set(Elm_Win_Data *sd,
741 Evas_Object *fobj = sd->focus_highlight.fobj;
746 evas_object_show(fobj);
747 edje_object_signal_emit(fobj, "elm,action,focus,show", "elm");
751 edje_object_signal_emit(fobj, "elm,action,focus,hide", "elm");
756 _elm_win_focus_highlight_anim_setup(Elm_Win_Data *sd,
759 Evas_Coord tx, ty, tw, th;
760 Evas_Coord px, py, pw, ph;
761 Edje_Message_Int_Set *m;
762 Evas_Object *target = sd->focus_highlight.cur.target;
764 evas_object_geometry_get(obj, &px, &py, &pw, &ph);
765 elm_widget_focus_highlight_geometry_get(target, &tx, &ty, &tw, &th, EINA_TRUE);
766 evas_object_move(obj, tx, ty);
767 evas_object_resize(obj, tw, th);
769 if ((px == tx) && (py == ty) && (pw == tw) && (ph == th)) return;
771 if (!_elm_config->focus_highlight_clip_disable)
772 evas_object_clip_unset(obj);
774 m = alloca(sizeof(*m) + (sizeof(int) * 8));
784 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
788 _elm_win_focus_highlight_simple_setup(Elm_Win_Data *sd,
791 Evas_Object *clip, *target = sd->focus_highlight.cur.target;
792 Evas_Coord x, y, w, h;
794 elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE);
796 evas_object_move(obj, x, y);
797 evas_object_resize(obj, w, h);
799 if (!_elm_config->focus_highlight_clip_disable)
801 clip = evas_object_clip_get(target);
802 if (clip) evas_object_clip_set(obj, clip);
805 edje_object_signal_emit(obj, "elm,state,anim,stop", "elm");
809 _elm_win_focus_highlight_reconfigure_job(void *data)
811 ELM_WIN_DATA_GET(data, sd);
812 Evas_Object *target = sd->focus_highlight.cur.target;
813 Evas_Object *previous = sd->focus_highlight.prev.target;
814 Evas_Object *fobj = sd->focus_highlight.fobj;
815 Eina_Bool visible_changed;
816 Eina_Bool common_visible;
817 const char *sig = NULL;
818 const char *focus_style_target = NULL;
819 const char *focus_style_previous = NULL;
821 _elm_win_focus_highlight_reconfigure_job_stop(sd);
823 visible_changed = (sd->focus_highlight.cur.visible !=
824 sd->focus_highlight.prev.visible);
826 if ((target == previous) && (!visible_changed) &&
827 (!sd->focus_highlight.geometry_changed) &&
828 (!sd->focus_highlight.theme_changed))
831 if ((previous) && (sd->focus_highlight.prev.in_theme))
832 elm_widget_signal_emit
833 (previous, "elm,action,focus_highlight,hide", "elm");
836 common_visible = EINA_FALSE;
837 else if (sd->focus_highlight.cur.in_theme)
839 common_visible = EINA_FALSE;
840 if (sd->focus_highlight.cur.visible)
841 sig = "elm,action,focus_highlight,show";
843 sig = "elm,action,focus_highlight,hide";
846 common_visible = sd->focus_highlight.cur.visible;
849 elm_widget_signal_emit(target, sig, "elm");
851 if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
855 focus_style_previous = elm_widget_focus_highlight_style_get(previous);
856 focus_style_target = elm_widget_focus_highlight_style_get(target);
858 if (sd->focus_highlight.theme_changed ||
859 (focus_style_target != focus_style_previous))
863 if (focus_style_target)
864 str = focus_style_target;
865 else if (sd->focus_highlight.style)
866 str = sd->focus_highlight.style;
870 elm_widget_theme_object_set
871 (sd->obj, fobj, "focus_highlight", "top", str);
872 sd->focus_highlight.theme_changed = EINA_FALSE;
874 if (sd->focus_highlight.animate)
876 str = edje_object_data_get(sd->focus_highlight.fobj, "animate");
877 sd->focus_highlight.animate_supported = ((str) && (!strcmp(str, "on")));
880 sd->focus_highlight.animate_supported = EINA_FALSE;
883 if ((sd->focus_highlight.animate_supported) && (previous) &&
884 (!sd->focus_highlight.prev.in_theme))
885 _elm_win_focus_highlight_anim_setup(sd, fobj);
887 _elm_win_focus_highlight_simple_setup(sd, fobj);
888 evas_object_raise(fobj);
891 _elm_win_focus_highlight_visible_set(sd, common_visible);
892 sd->focus_highlight.geometry_changed = EINA_FALSE;
893 sd->focus_highlight.prev = sd->focus_highlight.cur;
897 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win_Data *sd)
899 ecore_job_del(sd->focus_highlight.reconf_job);
901 sd->focus_highlight.reconf_job = ecore_job_add(
902 _elm_win_focus_highlight_reconfigure_job, sd->obj);
906 _elm_win_focus_in(Ecore_Evas *ee)
908 Elm_Win_Data *sd = _elm_win_associate_get(ee);
910 unsigned int order = 0;
912 if ((!sd) || (sd->modal_count)) return;
916 _elm_widget_top_win_focused_set(obj, EINA_TRUE);
917 if (!elm_widget_focus_order_get(obj)
918 || (obj == elm_widget_newest_focus_order_get(obj, &order, EINA_TRUE)))
920 elm_widget_focus_steal(obj);
923 elm_widget_focus_restore(obj);
924 evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
925 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
926 sd->focus_highlight.cur.visible = EINA_TRUE;
927 _elm_win_focus_highlight_reconfigure_job_start(sd);
930 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
934 /* else if (sd->img_obj) */
940 _elm_win_focus_out(Ecore_Evas *ee)
942 Elm_Win_Data *sd = _elm_win_associate_get(ee);
949 elm_object_focus_set(obj, EINA_FALSE);
950 _elm_widget_top_win_focused_set(obj, EINA_FALSE);
951 evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
952 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
953 sd->focus_highlight.cur.visible = EINA_FALSE;
954 _elm_win_focus_highlight_reconfigure_job_start(sd);
957 edje_object_signal_emit(sd->frame_obj, "elm,action,unfocus", "elm");
961 _elm_access_object_highlight_disable(evas_object_evas_get(obj));
964 /* if (sd->img_obj) */
970 _elm_win_available_profiles_del(Elm_Win_Data *sd)
972 if (!sd->profile.available_list) return;
975 for (i = 0; i < sd->profile.count; i++)
976 ELM_SAFE_FREE(sd->profile.available_list[i], eina_stringshare_del);
977 sd->profile.count = 0;
978 ELM_SAFE_FREE(sd->profile.available_list, free);
982 _elm_win_profile_del(Elm_Win_Data *sd)
984 ELM_SAFE_FREE(sd->profile.name, eina_stringshare_del);
988 _internal_elm_win_profile_set(Elm_Win_Data *sd, const char *profile)
990 Eina_Bool changed = EINA_FALSE;
993 if (sd->profile.name)
995 if (strcmp(sd->profile.name, profile) != 0)
997 eina_stringshare_replace(&(sd->profile.name), profile);
1003 sd->profile.name = eina_stringshare_add(profile);
1004 changed = EINA_TRUE;
1008 _elm_win_profile_del(sd);
1014 _elm_win_profile_update(Elm_Win_Data *sd)
1016 if (sd->profile.available_list)
1018 Eina_Bool found = EINA_FALSE;
1019 if (sd->profile.name)
1022 for (i = 0; i < sd->profile.count; i++)
1024 if (!strcmp(sd->profile.name,
1025 sd->profile.available_list[i]))
1033 /* If current profile is not present in an available profiles,
1034 * change current profile to the 1st element of an array.
1037 _internal_elm_win_profile_set(sd, sd->profile.available_list[0]);
1040 _elm_config_profile_set(sd->profile.name);
1044 Eina_List *sub, *l = NULL;
1046 sub = ecore_evas_sub_ecore_evas_list_get(sd->ee);
1047 EINA_LIST_FOREACH(sub, l, ee2)
1048 ecore_evas_window_profile_set(ee2, sd->profile.name);
1050 evas_object_smart_callback_call(sd->obj, SIG_PROFILE_CHANGED, NULL);
1054 _elm_win_state_change(Ecore_Evas *ee)
1056 Elm_Win_Data *sd = _elm_win_associate_get(ee);
1058 Eina_Bool ch_withdrawn = EINA_FALSE;
1059 Eina_Bool ch_sticky = EINA_FALSE;
1060 Eina_Bool ch_iconified = EINA_FALSE;
1061 Eina_Bool ch_fullscreen = EINA_FALSE;
1062 Eina_Bool ch_maximized = EINA_FALSE;
1063 Eina_Bool ch_profile = EINA_FALSE;
1064 Eina_Bool ch_wm_rotation = EINA_FALSE;
1065 const char *profile;
1071 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
1073 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
1074 ch_withdrawn = EINA_TRUE;
1076 if (sd->sticky != ecore_evas_sticky_get(sd->ee))
1078 sd->sticky = ecore_evas_sticky_get(sd->ee);
1079 ch_sticky = EINA_TRUE;
1081 if (sd->iconified != ecore_evas_iconified_get(sd->ee))
1083 sd->iconified = ecore_evas_iconified_get(sd->ee);
1084 ch_iconified = EINA_TRUE;
1086 if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee))
1088 sd->fullscreen = ecore_evas_fullscreen_get(sd->ee);
1089 ch_fullscreen = EINA_TRUE;
1091 if (sd->maximized != ecore_evas_maximized_get(sd->ee))
1093 sd->maximized = ecore_evas_maximized_get(sd->ee);
1094 ch_maximized = EINA_TRUE;
1097 profile = ecore_evas_window_profile_get(sd->ee);
1098 ch_profile = _internal_elm_win_profile_set(sd, profile);
1102 if (sd->rot != ecore_evas_rotation_get(sd->ee))
1104 sd->rot = ecore_evas_rotation_get(sd->ee);
1105 ch_wm_rotation = EINA_TRUE;
1109 _elm_win_state_eval_queue();
1111 if ((ch_withdrawn) || (ch_iconified))
1114 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL);
1115 else if (sd->iconified)
1116 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL);
1118 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL);
1123 evas_object_smart_callback_call(obj, SIG_STICK, NULL);
1125 evas_object_smart_callback_call(obj, SIG_UNSTICK, NULL);
1130 evas_object_smart_callback_call(obj, SIG_FULLSCREEN, NULL);
1132 evas_object_smart_callback_call(obj, SIG_UNFULLSCREEN, NULL);
1137 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL);
1139 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL);
1143 _elm_win_profile_update(sd);
1147 evas_object_size_hint_min_set(obj, -1, -1);
1148 evas_object_size_hint_max_set(obj, -1, -1);
1149 #ifdef HAVE_ELEMENTARY_X
1150 _elm_win_xwin_update(sd);
1152 elm_widget_orientation_set(obj, sd->rot);
1153 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
1154 evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
1158 EOLIAN static Eina_Bool
1159 _elm_win_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Win_Data *_pd EINA_UNUSED)
1164 EOLIAN static Eina_Bool
1165 _elm_win_elm_widget_focus_next(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED, Elm_Focus_Direction dir, Evas_Object **next)
1167 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1169 const Eina_List *items;
1170 void *(*list_data_get)(const Eina_List *list);
1175 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1177 items = wd->subobjs;
1181 list_data_get = eina_list_data_get;
1183 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
1185 if (*next) return EINA_TRUE;
1187 *next = (Evas_Object *)obj;
1191 EOLIAN static Eina_Bool
1192 _elm_win_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Win_Data *_pd EINA_UNUSED)
1197 EOLIAN static Eina_Bool
1198 _elm_win_elm_widget_focus_direction(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED, const Evas_Object *base, double degree, Evas_Object **direction, double *weight)
1200 const Eina_List *items;
1201 void *(*list_data_get)(const Eina_List *list);
1203 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1208 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1209 items = wd->subobjs;
1211 list_data_get = eina_list_data_get;
1213 return elm_widget_focus_list_direction_get
1214 (obj, base, items, list_data_get, degree, direction, weight);
1220 EOLIAN static Eina_Bool
1221 _elm_win_elm_widget_on_focus(Eo *obj, Elm_Win_Data *sd)
1223 Eina_Bool int_ret = EINA_FALSE;
1224 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus());
1225 if (!int_ret) return EINA_TRUE;
1228 evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));
1230 evas_object_focus_set(obj, elm_widget_focus_get(obj));
1236 _key_action_return(Evas_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
1242 _key_action_move(Evas_Object *obj, const char *params)
1244 const char *dir = params;
1246 if (!strcmp(dir, "previous"))
1247 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1248 else if (!strcmp(dir, "next"))
1249 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1250 else if (!strcmp(dir, "left"))
1251 elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
1252 else if (!strcmp(dir, "right"))
1253 elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
1254 else if (!strcmp(dir, "up"))
1255 elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
1256 else if (!strcmp(dir, "down"))
1257 elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
1258 else return EINA_FALSE;
1263 EOLIAN static Eina_Bool
1264 _elm_win_elm_widget_event(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
1267 Evas_Event_Key_Down *ev = event_info;
1269 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
1270 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
1272 if (!_elm_config_key_binding_call(obj, ev, key_actions))
1275 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1280 _deferred_ecore_evas_free(void *data)
1282 ecore_evas_free(data);
1283 _elm_win_deferred_free--;
1287 _elm_win_evas_smart_show(Eo *obj, Elm_Win_Data *sd)
1289 if (sd->modal_count) return;
1291 Evas_Object *current;
1293 if (!evas_object_visible_get(obj))
1294 _elm_win_state_eval_queue();
1295 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
1297 if ((sd->modal) && (!evas_object_visible_get(obj)))
1299 INCREMENT_MODALITY()
1304 if (sd->shot.info) _shot_handle(sd);
1308 _elm_win_evas_smart_hide(Eo *obj, Elm_Win_Data *sd)
1310 if (sd->modal_count) return;
1312 Evas_Object *current;
1314 if (evas_object_visible_get(obj))
1315 _elm_win_state_eval_queue();
1316 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
1318 if ((sd->modal) && (evas_object_visible_get(obj)))
1320 DECREMENT_MODALITY()
1327 evas_object_hide(sd->frame_obj);
1331 evas_object_hide(sd->img_obj);
1333 if (sd->pointer.obj)
1335 evas_object_hide(sd->pointer.obj);
1336 ecore_evas_hide(sd->pointer.ee);
1341 _elm_win_on_parent_del(void *data,
1342 Evas *e EINA_UNUSED,
1344 void *event_info EINA_UNUSED)
1346 ELM_WIN_DATA_GET(data, sd);
1348 if (obj == sd->parent) sd->parent = NULL;
1352 _elm_win_focus_target_move(void *data,
1353 Evas *e EINA_UNUSED,
1354 Evas_Object *obj EINA_UNUSED,
1355 void *event_info EINA_UNUSED)
1357 ELM_WIN_DATA_GET(data, sd);
1359 sd->focus_highlight.geometry_changed = EINA_TRUE;
1360 _elm_win_focus_highlight_reconfigure_job_start(sd);
1364 _elm_win_focus_target_resize(void *data,
1365 Evas *e EINA_UNUSED,
1366 Evas_Object *obj EINA_UNUSED,
1367 void *event_info EINA_UNUSED)
1369 ELM_WIN_DATA_GET(data, sd);
1371 sd->focus_highlight.geometry_changed = EINA_TRUE;
1372 _elm_win_focus_highlight_reconfigure_job_start(sd);
1376 _elm_win_focus_target_del(void *data,
1377 Evas *e EINA_UNUSED,
1378 Evas_Object *obj EINA_UNUSED,
1379 void *event_info EINA_UNUSED)
1381 ELM_WIN_DATA_GET(data, sd);
1383 sd->focus_highlight.cur.target = NULL;
1385 _elm_win_focus_highlight_reconfigure_job_start(sd);
1388 static Evas_Object *
1389 _elm_win_focus_target_get(Evas_Object *obj)
1391 Evas_Object *o = obj;
1395 if (elm_widget_is(o))
1397 if (!elm_widget_highlight_ignore_get(o))
1399 o = elm_widget_parent_get(o);
1401 o = evas_object_smart_parent_get(o);
1405 o = elm_widget_parent_widget_get(o);
1407 o = evas_object_smart_parent_get(o);
1416 _elm_win_focus_target_callbacks_add(Elm_Win_Data *sd)
1418 Evas_Object *obj = sd->focus_highlight.cur.target;
1421 evas_object_event_callback_add
1422 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1423 evas_object_event_callback_add
1424 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1425 evas_object_event_callback_add
1426 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1430 _elm_win_focus_target_callbacks_del(Elm_Win_Data *sd)
1432 Evas_Object *obj = sd->focus_highlight.cur.target;
1434 evas_object_event_callback_del_full
1435 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1436 evas_object_event_callback_del_full
1437 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1438 evas_object_event_callback_del_full
1439 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1443 _elm_win_object_focus_in(void *data,
1444 Evas *e EINA_UNUSED,
1447 Evas_Object *obj = event_info, *target;
1448 ELM_WIN_DATA_GET(data, sd);
1450 if (sd->focus_highlight.cur.target == obj)
1453 target = _elm_win_focus_target_get(obj);
1454 sd->focus_highlight.cur.target = target;
1455 if (target && elm_widget_highlight_in_theme_get(target))
1456 sd->focus_highlight.cur.in_theme = EINA_TRUE;
1458 _elm_win_focus_target_callbacks_add(sd);
1460 _elm_win_focus_highlight_reconfigure_job_start(sd);
1464 _elm_win_object_focus_out(void *data,
1465 Evas *e EINA_UNUSED,
1466 void *event_info EINA_UNUSED)
1468 ELM_WIN_DATA_GET(data, sd);
1470 if (!sd->focus_highlight.cur.target)
1473 if (!sd->focus_highlight.cur.in_theme)
1474 _elm_win_focus_target_callbacks_del(sd);
1476 sd->focus_highlight.cur.target = NULL;
1477 sd->focus_highlight.cur.in_theme = EINA_FALSE;
1479 _elm_win_focus_highlight_reconfigure_job_start(sd);
1483 _elm_win_focus_highlight_shutdown(Elm_Win_Data *sd)
1485 _elm_win_focus_highlight_reconfigure_job_stop(sd);
1486 if (sd->focus_highlight.cur.target)
1488 elm_widget_signal_emit(sd->focus_highlight.cur.target,
1489 "elm,action,focus_highlight,hide", "elm");
1490 _elm_win_focus_target_callbacks_del(sd);
1491 sd->focus_highlight.cur.target = NULL;
1493 ELM_SAFE_FREE(sd->focus_highlight.fobj, evas_object_del);
1495 evas_event_callback_del_full
1496 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1497 _elm_win_object_focus_in, sd->obj);
1498 evas_event_callback_del_full
1499 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1500 _elm_win_object_focus_out, sd->obj);
1504 _win_img_hide(void *data,
1505 Evas *e EINA_UNUSED,
1506 Evas_Object *obj EINA_UNUSED,
1507 void *event_info EINA_UNUSED)
1509 elm_widget_focus_hide_handle(data);
1513 _win_img_mouse_up(void *data,
1514 Evas *e EINA_UNUSED,
1515 Evas_Object *obj EINA_UNUSED,
1518 Evas_Event_Mouse_Up *ev = event_info;
1519 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1520 elm_widget_focus_mouse_up_handle(data);
1524 _win_img_focus_in(void *data,
1525 Evas *e EINA_UNUSED,
1526 Evas_Object *obj EINA_UNUSED,
1527 void *event_info EINA_UNUSED)
1529 elm_widget_focus_steal(data);
1533 _win_img_focus_out(void *data,
1534 Evas *e EINA_UNUSED,
1535 Evas_Object *obj EINA_UNUSED,
1536 void *event_info EINA_UNUSED)
1538 elm_widget_focused_object_clear(data);
1542 _elm_win_on_img_obj_del(void *data,
1543 Evas *e EINA_UNUSED,
1544 Evas_Object *obj EINA_UNUSED,
1545 void *event_info EINA_UNUSED)
1547 ELM_WIN_DATA_GET(data, sd);
1548 _elm_win_img_callbacks_del(sd->obj, sd->img_obj);
1553 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
1555 evas_object_event_callback_del_full
1556 (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1557 evas_object_event_callback_del_full
1558 (imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
1559 evas_object_event_callback_del_full
1560 (imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
1561 evas_object_event_callback_del_full
1562 (imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
1563 evas_object_event_callback_del_full
1564 (imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
1568 _elm_win_evas_smart_del(Eo *obj, Elm_Win_Data *sd)
1571 Evas_Object *current;
1573 if ((sd->modal) && (evas_object_visible_get(obj)))
1575 DECREMENT_MODALITY()
1578 if ((sd->modal) && (sd->modal_count > 0))
1579 ERR("Deleted modal win was blocked by another modal win which was created after creation of that win.");
1581 evas_object_event_callback_del_full(sd->layout,
1582 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1583 _elm_win_on_resize_obj_changed_size_hints,
1585 evas_object_del(sd->box);
1586 evas_object_del(sd->layout);
1588 /* NB: child deletion handled by parent's smart del */
1590 if ((trap) && (trap->del))
1591 trap->del(sd->trap_data, obj);
1595 evas_object_event_callback_del_full
1596 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
1600 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1602 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1604 _elm_win_state_eval_queue();
1608 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1609 ecore_evas_callback_resize_set(sd->ee, NULL);
1612 ecore_job_del(sd->deferred_resize_job);
1613 ecore_job_del(sd->deferred_child_eval_job);
1614 eina_stringshare_del(sd->shot.info);
1615 ecore_timer_del(sd->shot.timer);
1617 #ifdef HAVE_ELEMENTARY_X
1618 ecore_event_handler_del(sd->x.client_message_handler);
1619 ecore_event_handler_del(sd->x.property_handler);
1624 _elm_win_img_callbacks_del(obj, sd->img_obj);
1631 ecore_job_add(_deferred_ecore_evas_free, sd->ee);
1632 _elm_win_deferred_free++;
1636 _elm_win_focus_highlight_shutdown(sd);
1637 eina_stringshare_del(sd->focus_highlight.style);
1639 eina_stringshare_del(sd->title);
1640 eina_stringshare_del(sd->icon_name);
1641 eina_stringshare_del(sd->role);
1642 evas_object_del(sd->icon);
1643 evas_object_del(sd->main_menu);
1645 _elm_win_profile_del(sd);
1646 _elm_win_available_profiles_del(sd);
1648 /* Don't let callback in the air that point to sd */
1649 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1650 ecore_evas_callback_resize_set(sd->ee, NULL);
1651 ecore_evas_callback_mouse_in_set(sd->ee, NULL);
1652 ecore_evas_callback_focus_in_set(sd->ee, NULL);
1653 ecore_evas_callback_focus_out_set(sd->ee, NULL);
1654 ecore_evas_callback_move_set(sd->ee, NULL);
1655 ecore_evas_callback_state_change_set(sd->ee, NULL);
1657 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1659 if ((!_elm_win_list) &&
1660 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
1662 edje_file_cache_flush();
1663 edje_collection_cache_flush();
1664 evas_image_cache_flush(evas_object_evas_get(obj));
1665 evas_font_cache_flush(evas_object_evas_get(obj));
1671 _elm_win_obj_intercept_show(void *data,
1674 ELM_WIN_DATA_GET(data, sd);
1676 // this is called to make sure all smart containers have calculated their
1677 // sizes BEFORE we show the window to make sure it initially appears at
1678 // our desired size (ie min size is known first)
1679 evas_smart_objects_calculate(evas_object_evas_get(obj));
1682 evas_object_show(sd->frame_obj);
1686 evas_object_show(sd->img_obj);
1688 if (sd->pointer.obj)
1690 ecore_evas_show(sd->pointer.ee);
1691 evas_object_show(sd->pointer.obj);
1693 evas_object_show(obj);
1697 _elm_win_evas_smart_move(Eo *obj, Elm_Win_Data *sd, Evas_Coord x, Evas_Coord y)
1701 if ((x != sd->screen.x) || (y != sd->screen.y))
1705 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1711 TRAP(sd, move, x, y);
1712 if (!ecore_evas_override_get(sd->ee)) return;
1715 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
1717 if (ecore_evas_override_get(sd->ee))
1721 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1725 /* FIXME: We should update ecore_wl_window_location here !! */
1737 _elm_win_evas_smart_resize(Eo *obj, Elm_Win_Data *sd, Evas_Coord w, Evas_Coord h)
1739 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
1747 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
1754 evas_object_image_size_set(sd->img_obj, w, h);
1757 TRAP(sd, resize, w, h);
1761 _elm_win_delete_request(Ecore_Evas *ee)
1763 Elm_Win_Data *sd = _elm_win_associate_get(ee);
1770 int autodel = sd->autodel;
1771 sd->autodel_clear = &autodel;
1772 evas_object_ref(obj);
1773 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL);
1774 // FIXME: if above callback deletes - then the below will be invalid
1775 if (autodel) evas_object_del(obj);
1776 else sd->autodel_clear = NULL;
1777 evas_object_unref(obj);
1781 _elm_ee_xwin_get(const Ecore_Evas *ee)
1783 #ifdef HAVE_ELEMENTARY_X
1784 const char *engine_name;
1787 engine_name = ecore_evas_engine_name_get(ee);
1788 if (EINA_UNLIKELY(!engine_name)) return 0;
1790 if (!strcmp(engine_name, ELM_SOFTWARE_X11))
1792 return ecore_evas_software_x11_window_get(ee);
1794 else if (!strcmp(engine_name, ELM_OPENGL_X11))
1796 return ecore_evas_gl_x11_window_get(ee);
1804 #ifdef HAVE_ELEMENTARY_X
1806 _internal_elm_win_xwindow_get(Elm_Win_Data *sd)
1808 sd->x.xwin = _elm_ee_xwin_get(sd->ee);
1813 _elm_ee_wlwin_get(const Ecore_Evas *ee)
1815 #ifdef HAVE_ELEMENTARY_WAYLAND
1816 const char *engine_name;
1818 if (!ee) return NULL;
1820 engine_name = ecore_evas_engine_name_get(ee);
1821 if (EINA_UNLIKELY(!engine_name)) return NULL;
1823 if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
1824 (!strcmp(engine_name, ELM_WAYLAND_EGL)))
1826 return ecore_evas_wayland_window_get(ee);
1834 #ifdef HAVE_ELEMENTARY_WAYLAND
1836 _elm_win_wlwindow_get(Elm_Win_Data *sd)
1838 sd->wl.win = _elm_ee_wlwin_get(sd->ee);
1842 #ifdef HAVE_ELEMENTARY_X
1844 _elm_win_xwin_update(Elm_Win_Data *sd)
1848 _internal_elm_win_xwindow_get(sd);
1851 ELM_WIN_DATA_GET(sd->parent, sdp);
1855 ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin);
1859 if (!sd->x.xwin) return; /* nothing more to do */
1862 if (!s) s = _elm_appname;
1864 if (sd->icon_name) s = sd->icon_name;
1865 ecore_x_icccm_icon_name_set(sd->x.xwin, s);
1866 ecore_x_netwm_icon_name_set(sd->x.xwin, s);
1869 if (s) ecore_x_icccm_window_role_set(sd->x.xwin, s);
1876 data = evas_object_image_data_get(sd->icon, EINA_FALSE);
1880 int w = 0, h = 0, stride, x, y;
1884 evas_object_image_size_get(sd->icon, &w, &h);
1885 stride = evas_object_image_stride_get(sd->icon);
1886 if ((w > 0) && (h > 0) &&
1887 (stride >= (int)(w * sizeof(unsigned int))))
1891 ic.data = malloc(w * h * sizeof(unsigned int));
1895 p = (unsigned char *)data;
1896 p2 = (unsigned int *)ic.data;
1897 for (y = 0; y < h; y++)
1899 for (x = 0; x < w; x++)
1901 *p2 = *((unsigned int *)p);
1902 p += sizeof(unsigned int);
1905 p += (stride - (w * sizeof(unsigned int)));
1907 ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
1911 evas_object_image_data_set(sd->icon, data);
1918 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_NORMAL);
1921 case ELM_WIN_DIALOG_BASIC:
1922 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DIALOG);
1925 case ELM_WIN_DESKTOP:
1926 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
1930 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DOCK);
1933 case ELM_WIN_TOOLBAR:
1934 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
1938 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_MENU);
1941 case ELM_WIN_UTILITY:
1942 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_UTILITY);
1945 case ELM_WIN_SPLASH:
1946 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_SPLASH);
1949 case ELM_WIN_DROPDOWN_MENU:
1950 ecore_x_netwm_window_type_set
1951 (sd->x.xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
1954 case ELM_WIN_POPUP_MENU:
1955 ecore_x_netwm_window_type_set
1956 (sd->x.xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
1959 case ELM_WIN_TOOLTIP:
1960 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
1963 case ELM_WIN_NOTIFICATION:
1964 ecore_x_netwm_window_type_set
1965 (sd->x.xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
1969 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_COMBO);
1973 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DND);
1979 ecore_x_e_virtual_keyboard_state_set
1980 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
1981 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
1982 ecore_x_e_illume_indicator_state_set
1983 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
1984 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
1985 ecore_x_e_illume_indicator_state_set
1986 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
1994 * Resize the window according to window layout's min and weight.
1995 * If the window layout's weight is 0.0, the window max is limited to layout's
1998 * This is called when the window layout's weight hint is changed or when the
1999 * window is rotated.
2001 * @param obj window object
2004 _elm_win_resize_objects_eval(Evas_Object *obj)
2006 ELM_WIN_DATA_GET(obj, sd);
2007 Evas_Coord w, h, minw, minh, maxw, maxh;
2010 evas_object_size_hint_min_get(sd->layout, &minw, &minh);
2011 if (minw < 1) minw = 1;
2012 if (minh < 1) minh = 1;
2014 evas_object_size_hint_weight_get(sd->layout, &wx, &wy);
2015 if (!wx) maxw = minw;
2017 if (!wy) maxh = minh;
2020 evas_object_size_hint_min_set(obj, minw, minh);
2021 evas_object_size_hint_max_set(obj, maxw, maxh);
2022 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
2023 if (w < minw) w = minw;
2024 if (h < minh) h = minh;
2025 if (w > maxw) w = maxw;
2026 if (h > maxh) h = maxh;
2027 evas_object_resize(obj, w, h);
2031 _elm_win_on_resize_obj_changed_size_hints(void *data,
2032 Evas *e EINA_UNUSED,
2033 Evas_Object *obj EINA_UNUSED,
2034 void *event_info EINA_UNUSED)
2036 _elm_win_resize_objects_eval(data);
2040 _elm_win_shutdown(void)
2042 while (_elm_win_list) evas_object_del(_elm_win_list->data);
2043 ELM_SAFE_FREE(_elm_win_state_eval_job, ecore_job_del);
2047 _elm_win_rescale(Elm_Theme *th,
2048 Eina_Bool use_theme)
2055 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2056 elm_widget_theme(obj);
2060 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2061 elm_widget_theme_specific(obj, th, EINA_FALSE);
2066 _elm_win_access(Eina_Bool is_access)
2073 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2075 elm_widget_access(obj, is_access);
2077 /* floating orphan object. if there are A, B, C objects and user does
2078 as below, then there would be floating orphan objects.
2080 1. elm_object_content_set(layout, A);
2081 2. elm_object_content_set(layout, B);
2082 3. elm_object_content_set(layout, C);
2084 now, the object A and B are floating orphan objects */
2089 fobj = evas_object_below_get(fobj);
2092 if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
2094 elm_widget_access(fobj, is_access);
2100 evas = evas_object_evas_get(obj);
2101 if (evas) _elm_access_object_highlight_disable(evas);
2107 _elm_win_translate(void)
2112 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2113 elm_widget_translate(obj);
2116 #ifdef HAVE_ELEMENTARY_X
2118 _elm_win_client_message(void *data,
2119 int type EINA_UNUSED,
2122 ELM_WIN_DATA_GET(data, sd);
2123 Ecore_X_Event_Client_Message *e = event;
2125 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
2126 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
2128 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2130 Evas *evas = evas_object_evas_get(sd->obj);
2133 edje_file_cache_flush();
2134 edje_collection_cache_flush();
2135 evas_image_cache_flush(evas);
2136 evas_font_cache_flush(evas);
2140 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
2142 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2144 Evas *evas = evas_object_evas_get(sd->obj);
2147 edje_file_cache_flush();
2148 edje_collection_cache_flush();
2149 evas_image_cache_flush(evas);
2150 evas_font_cache_flush(evas);
2151 evas_render_dump(evas);
2155 else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
2157 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2159 if ((unsigned int)e->data.l[1] ==
2160 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
2162 // XXX: call right access func
2164 else if ((unsigned int)e->data.l[1] ==
2165 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV)
2167 // XXX: call right access func
2169 else if ((unsigned int)e->data.l[1] ==
2170 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
2172 _elm_access_highlight_object_activate
2173 (sd->obj, ELM_ACTIVATE_DEFAULT);
2175 else if ((unsigned int)e->data.l[1] ==
2176 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
2178 /* there would be better way to read highlight object */
2180 evas = evas_object_evas_get(sd->obj);
2181 if (!evas) return ECORE_CALLBACK_PASS_ON;
2183 _elm_access_mouse_event_enabled_set(EINA_TRUE);
2185 evas_event_feed_mouse_in(evas, 0, NULL);
2186 evas_event_feed_mouse_move
2187 (evas, e->data.l[2], e->data.l[3], 0, NULL);
2189 _elm_access_mouse_event_enabled_set(EINA_FALSE);
2191 else if ((unsigned int)e->data.l[1] ==
2192 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
2194 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
2196 else if ((unsigned int)e->data.l[1] ==
2197 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
2199 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
2201 else if ((unsigned int)e->data.l[1] ==
2202 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
2204 _elm_access_highlight_object_activate
2205 (sd->obj, ELM_ACTIVATE_UP);
2207 else if ((unsigned int)e->data.l[1] ==
2208 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
2210 _elm_access_highlight_object_activate
2211 (sd->obj, ELM_ACTIVATE_DOWN);
2215 return ECORE_CALLBACK_PASS_ON;
2219 _elm_win_property_change(void *data,
2220 int type EINA_UNUSED,
2223 ELM_WIN_DATA_GET(data, sd);
2224 Ecore_X_Event_Window_Property *e = event;
2226 if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE)
2228 if (e->win == sd->x.xwin)
2230 sd->indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win);
2231 evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
2234 return ECORE_CALLBACK_PASS_ON;
2239 _elm_win_focus_highlight_hide(void *data EINA_UNUSED,
2241 const char *emission EINA_UNUSED,
2242 const char *source EINA_UNUSED)
2244 evas_object_hide(obj);
2248 _elm_win_focus_highlight_anim_end(void *data,
2250 const char *emission EINA_UNUSED,
2251 const char *source EINA_UNUSED)
2253 ELM_WIN_DATA_GET(data, sd);
2255 _elm_win_focus_highlight_simple_setup(sd, obj);
2259 _elm_win_focus_highlight_init(Elm_Win_Data *sd)
2261 evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
2262 _elm_win_object_focus_in, sd->obj);
2263 evas_event_callback_add(sd->evas,
2264 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
2265 _elm_win_object_focus_out, sd->obj);
2267 sd->focus_highlight.cur.target = NULL;
2268 sd->focus_highlight.fobj = edje_object_add(sd->evas);
2269 sd->focus_highlight.theme_changed = EINA_TRUE;
2271 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2272 "elm,action,focus,hide,end", "*",
2273 _elm_win_focus_highlight_hide, NULL);
2274 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2275 "elm,action,focus,anim,end", "*",
2276 _elm_win_focus_highlight_anim_end, sd->obj);
2277 _elm_win_focus_highlight_reconfigure_job_start(sd);
2281 _elm_win_frame_cb_move_start(void *data,
2282 Evas_Object *obj EINA_UNUSED,
2283 const char *sig EINA_UNUSED,
2286 ELM_WIN_DATA_GET(data, sd);
2290 #ifdef HAVE_ELEMENTARY_WAYLAND
2291 if (!strcmp(source, "elm"))
2292 ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_HAND1);
2294 ecore_wl_window_cursor_default_restore(sd->wl.win);
2299 /* NB: Wayland handles moving surfaces by itself so we cannot
2300 * specify a specific x/y we want. Instead, we will pass in the
2301 * existing x/y values so they can be recorded as 'previous'
2302 * position. The new position will get updated automatically when
2303 * the move is finished */
2305 ecore_evas_wayland_move(sd->ee, sd->screen.x, sd->screen.y);
2309 _elm_win_frame_cb_move_stop(void *data,
2310 Evas_Object *obj EINA_UNUSED,
2311 const char *sig EINA_UNUSED,
2312 const char *source EINA_UNUSED)
2314 ELM_WIN_DATA_GET(data, sd);
2318 #ifdef HAVE_ELEMENTARY_WAYLAND
2319 ecore_wl_window_cursor_default_restore(sd->wl.win);
2323 #ifdef HAVE_ELEMENTARY_WAYLAND
2330 static struct _resize_info _border_side[4] =
2332 { ELM_CURSOR_TOP_SIDE, 1 },
2333 { ELM_CURSOR_LEFT_SIDE, 4 },
2334 { ELM_CURSOR_BOTTOM_SIDE, 2 },
2335 { ELM_CURSOR_RIGHT_SIDE, 8 },
2338 static struct _resize_info _border_corner[4] =
2340 { ELM_CURSOR_TOP_LEFT_CORNER, 5 },
2341 { ELM_CURSOR_BOTTOM_LEFT_CORNER, 6 },
2342 { ELM_CURSOR_BOTTOM_RIGHT_CORNER, 10 },
2343 { ELM_CURSOR_TOP_RIGHT_CORNER, 9 },
2348 _elm_win_frame_obj_update(Elm_Win_Data *sd)
2354 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
2355 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2356 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2358 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2360 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2361 (w != (fw - ow)) || (h != (fh - oh)))
2363 evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
2364 (fw - ow), (fh - oh));
2367 #ifdef HAVE_ELEMENTARY_WAYLAND
2368 ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
2373 _elm_win_frame_obj_move(void *data,
2374 Evas *e EINA_UNUSED,
2375 Evas_Object *obj EINA_UNUSED,
2376 void *event_info EINA_UNUSED)
2380 if (!(sd = data)) return;
2381 if (!sd->client_obj) return;
2383 _elm_win_frame_obj_update(sd);
2387 _elm_win_frame_obj_resize(void *data,
2388 Evas *e EINA_UNUSED,
2389 Evas_Object *obj EINA_UNUSED,
2390 void *event_info EINA_UNUSED)
2394 if (!(sd = data)) return;
2395 if (!sd->client_obj) return;
2397 _elm_win_frame_obj_update(sd);
2401 _elm_win_frame_cb_resize_show(void *data,
2402 Evas_Object *obj EINA_UNUSED,
2403 const char *sig EINA_UNUSED,
2406 ELM_WIN_DATA_GET(data, sd);
2409 if (sd->resizing) return;
2411 #ifdef HAVE_ELEMENTARY_WAYLAND
2414 if (!strcmp(source, "elm.event.resize.t"))
2415 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2416 _border_side[(0 + i) % 4].name);
2417 else if (!strcmp(source, "elm.event.resize.b"))
2418 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2419 _border_side[(2 + i) % 4].name);
2420 else if (!strcmp(source, "elm.event.resize.l"))
2421 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2422 _border_side[(1 + i) % 4].name);
2423 else if (!strcmp(source, "elm.event.resize.r"))
2424 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2425 _border_side[(3 + i) % 4].name);
2426 else if (!strcmp(source, "elm.event.resize.tl"))
2427 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2428 _border_corner[(0 + i) % 4].name);
2429 else if (!strcmp(source, "elm.event.resize.tr"))
2430 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2431 _border_corner[(3 + i) % 4].name);
2432 else if (!strcmp(source, "elm.event.resize.bl"))
2433 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2434 _border_corner[(1 + i) % 4].name);
2435 else if (!strcmp(source, "elm.event.resize.br"))
2436 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2437 _border_corner[(2 + i) % 4].name);
2439 ecore_wl_window_cursor_default_restore(sd->wl.win);
2446 _elm_win_frame_cb_resize_hide(void *data,
2447 Evas_Object *obj EINA_UNUSED,
2448 const char *sig EINA_UNUSED,
2449 const char *source EINA_UNUSED)
2451 ELM_WIN_DATA_GET(data, sd);
2454 if (sd->resizing) return;
2456 #ifdef HAVE_ELEMENTARY_WAYLAND
2457 ecore_wl_window_cursor_default_restore(sd->wl.win);
2462 _elm_win_frame_cb_resize_start(void *data,
2463 Evas_Object *obj EINA_UNUSED,
2464 const char *sig EINA_UNUSED,
2467 #ifdef HAVE_ELEMENTARY_WAYLAND
2468 ELM_WIN_DATA_GET(data, sd);
2472 if (sd->resizing) return;
2474 sd->resizing = EINA_TRUE;
2476 if (!strcmp(source, "elm.event.resize.t"))
2477 sd->resize_location = _border_side[(0 + i) % 4].location;
2478 else if (!strcmp(source, "elm.event.resize.b"))
2479 sd->resize_location = _border_side[(2 + i) % 4].location;
2480 else if (!strcmp(source, "elm.event.resize.l"))
2481 sd->resize_location = _border_side[(1 + i) % 4].location;
2482 else if (!strcmp(source, "elm.event.resize.r"))
2483 sd->resize_location = _border_side[(3 + i) % 4].location;
2484 else if (!strcmp(source, "elm.event.resize.tl"))
2485 sd->resize_location = _border_corner[(0 + i) % 4].location;
2486 else if (!strcmp(source, "elm.event.resize.tr"))
2487 sd->resize_location = _border_corner[(3 + i) % 4].location;
2488 else if (!strcmp(source, "elm.event.resize.bl"))
2489 sd->resize_location = _border_corner[(1 + i) % 4].location;
2490 else if (!strcmp(source, "elm.event.resize.br"))
2491 sd->resize_location = _border_corner[(2 + i) % 4].location;
2493 sd->resize_location = 0;
2495 if (sd->resize_location > 0)
2496 ecore_evas_wayland_resize(sd->ee, sd->resize_location);
2504 _elm_win_frame_cb_minimize(void *data,
2505 Evas_Object *obj EINA_UNUSED,
2506 const char *sig EINA_UNUSED,
2507 const char *source EINA_UNUSED)
2509 ELM_WIN_DATA_GET(data, sd);
2512 // sd->iconified = EINA_TRUE;
2513 TRAP(sd, iconified_set, EINA_TRUE);
2517 _elm_win_frame_maximized_state_update(Elm_Win_Data *sd, Eina_Bool maximized)
2519 const char *emission;
2522 emission = "elm,state,maximized";
2524 emission = "elm,state,unmaximized";
2526 edje_object_signal_emit(sd->frame_obj, emission, "elm");
2527 edje_object_message_signal_process(sd->frame_obj);
2528 evas_object_smart_calculate(sd->frame_obj);
2530 _elm_win_frame_obj_update(sd);
2534 _elm_win_frame_cb_maximize(void *data,
2535 Evas_Object *obj EINA_UNUSED,
2536 const char *sig EINA_UNUSED,
2537 const char *source EINA_UNUSED)
2540 ELM_WIN_DATA_GET(data, sd);
2543 if (sd->maximized) value = EINA_FALSE;
2544 else value = EINA_TRUE;
2546 _elm_win_frame_maximized_state_update(sd, value);
2548 TRAP(sd, maximized_set, value);
2552 _elm_win_frame_cb_close(void *data,
2553 Evas_Object *obj EINA_UNUSED,
2554 const char *sig EINA_UNUSED,
2555 const char *source EINA_UNUSED)
2557 ELM_WIN_DATA_GET(data, sd);
2560 /* FIXME: After the current freeze, this should be handled differently.
2562 * Ideally, we would want to mimic the X11 backend and use something
2563 * like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
2564 * inside of ecore_evas. That would be the 'proper' way, but since we are
2565 * in a freeze right now, I cannot add a new event value, or a new
2566 * event structure to ecore_wayland.
2568 * So yes, this is a temporary 'stop-gap' solution which will be fixed
2569 * when the freeze is over, but it does fix a trac bug for now, and in a
2570 * way which does not break API or the freeze. - dh
2577 int autodel = sd->autodel;
2578 sd->autodel_clear = &autodel;
2579 evas_object_ref(win);
2580 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
2581 // FIXME: if above callback deletes - then the below will be invalid
2582 if (autodel) evas_object_del(win);
2583 else sd->autodel_clear = NULL;
2584 evas_object_unref(win);
2588 _elm_win_frame_add(Elm_Win_Data *sd,
2591 Evas_Object *obj = sd->obj;
2595 sd->frame_obj = edje_object_add(sd->evas);
2596 layer = evas_object_layer_get(obj);
2597 evas_object_layer_set(sd->frame_obj, layer + 1);
2598 if (!elm_widget_theme_object_set
2599 (sd->obj, sd->frame_obj, "border", "base", style))
2601 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2605 sd->spacer_obj = evas_object_rectangle_add(sd->evas);
2606 evas_object_color_set(sd->spacer_obj, 0, 0, 0, 0);
2607 evas_object_repeat_events_set(sd->spacer_obj, EINA_TRUE);
2608 edje_object_part_swallow(sd->frame_obj, "elm.swallow.frame_spacer",
2611 sd->client_obj = evas_object_rectangle_add(sd->evas);
2612 evas_object_color_set(sd->client_obj, 0, 0, 0, 0);
2613 /* NB: Tried pass_events here, but that fails to send events */
2614 evas_object_repeat_events_set(sd->client_obj, EINA_TRUE);
2615 edje_object_part_swallow(sd->frame_obj, "elm.swallow.client",
2618 evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
2620 evas_object_event_callback_add
2621 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2622 evas_object_event_callback_add
2623 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2625 /* NB: Do NOT remove these calls !! Needed to calculate proper
2626 * framespace on inital show of the window */
2627 edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
2628 evas_object_move(sd->frame_obj, 0, 0);
2629 evas_object_resize(sd->frame_obj, mw, mh);
2630 evas_object_smart_calculate(sd->frame_obj);
2632 edje_object_signal_callback_add
2633 (sd->frame_obj, "elm,action,move,start", "elm",
2634 _elm_win_frame_cb_move_start, obj);
2635 edje_object_signal_callback_add
2636 (sd->frame_obj, "elm,action,move,stop", "elm",
2637 _elm_win_frame_cb_move_stop, obj);
2638 edje_object_signal_callback_add
2639 (sd->frame_obj, "elm,action,resize,show", "*",
2640 _elm_win_frame_cb_resize_show, obj);
2641 edje_object_signal_callback_add
2642 (sd->frame_obj, "elm,action,resize,hide", "*",
2643 _elm_win_frame_cb_resize_hide, obj);
2644 edje_object_signal_callback_add
2645 (sd->frame_obj, "elm,action,resize,start", "*",
2646 _elm_win_frame_cb_resize_start, obj);
2647 edje_object_signal_callback_add
2648 (sd->frame_obj, "elm,action,minimize", "elm",
2649 _elm_win_frame_cb_minimize, obj);
2650 edje_object_signal_callback_add
2651 (sd->frame_obj, "elm,action,maximize", "elm",
2652 _elm_win_frame_cb_maximize, obj);
2653 edje_object_signal_callback_add
2654 (sd->frame_obj, "elm,action,close", "elm", _elm_win_frame_cb_close, obj);
2658 edje_object_part_text_escaped_set
2659 (sd->frame_obj, "elm.text.title", sd->title);
2662 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2663 ecore_evas_resize(sd->ee, w, h);
2667 _elm_win_frame_del(Elm_Win_Data *sd)
2671 ELM_SAFE_FREE(sd->client_obj, evas_object_del);
2675 evas_object_event_callback_del_full
2676 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2677 evas_object_event_callback_del_full
2678 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2680 edje_object_signal_callback_del
2681 (sd->frame_obj, "elm,action,move,start", "elm",
2682 _elm_win_frame_cb_move_start);
2683 edje_object_signal_callback_del
2684 (sd->frame_obj, "elm,action,move,stop", "elm",
2685 _elm_win_frame_cb_move_stop);
2686 edje_object_signal_callback_del
2687 (sd->frame_obj, "elm,action,resize,show", "*",
2688 _elm_win_frame_cb_resize_show);
2689 edje_object_signal_callback_del
2690 (sd->frame_obj, "elm,action,resize,hide", "*",
2691 _elm_win_frame_cb_resize_hide);
2692 edje_object_signal_callback_del
2693 (sd->frame_obj, "elm,action,resize,start", "*",
2694 _elm_win_frame_cb_resize_start);
2695 edje_object_signal_callback_del
2696 (sd->frame_obj, "elm,action,minimize", "elm",
2697 _elm_win_frame_cb_minimize);
2698 edje_object_signal_callback_del
2699 (sd->frame_obj, "elm,action,maximize", "elm",
2700 _elm_win_frame_cb_maximize);
2701 edje_object_signal_callback_del
2702 (sd->frame_obj, "elm,action,close", "elm",
2703 _elm_win_frame_cb_close);
2705 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2708 evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
2709 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2710 ecore_evas_resize(sd->ee, w, h);
2715 _debug_key_down(void *data EINA_UNUSED,
2716 Evas *e EINA_UNUSED,
2720 Evas_Event_Key_Down *ev = event_info;
2722 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
2725 if ((strcmp(ev->key, "F12")) ||
2726 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
2729 INF("Tree graph generated.");
2730 elm_object_tree_dot_dump(obj, "./dump.dot");
2736 _win_inlined_image_set(Elm_Win_Data *sd)
2738 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);
2739 evas_object_image_filled_set(sd->img_obj, EINA_TRUE);
2741 evas_object_event_callback_add
2742 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, sd->obj);
2743 evas_object_event_callback_add
2744 (sd->img_obj, EVAS_CALLBACK_HIDE, _win_img_hide, sd->obj);
2745 evas_object_event_callback_add
2746 (sd->img_obj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, sd->obj);
2747 evas_object_event_callback_add
2748 (sd->img_obj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, sd->obj);
2749 evas_object_event_callback_add
2750 (sd->img_obj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, sd->obj);
2754 _elm_win_on_icon_del(void *data,
2755 Evas *e EINA_UNUSED,
2757 void *event_info EINA_UNUSED)
2759 ELM_WIN_DATA_GET(data, sd);
2761 if (sd->icon == obj) sd->icon = NULL;
2765 _elm_win_evas_smart_add(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED)
2767 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
2769 elm_widget_can_focus_set(obj, EINA_TRUE);
2771 elm_widget_highlight_ignore_set(obj, EINA_TRUE);
2774 #ifdef HAVE_ELEMENTARY_X
2776 _elm_x_io_err(void *data EINA_UNUSED)
2781 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2782 evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
2788 elm_win_add(Evas_Object *parent,
2792 Evas_Object *obj = eo_add_custom(MY_CLASS, parent, elm_obj_win_constructor(name, type));
2798 _elm_win_cb_hide(void *data EINA_UNUSED,
2799 Evas *e EINA_UNUSED,
2800 Evas_Object *obj EINA_UNUSED,
2801 void *event_info EINA_UNUSED)
2803 _elm_win_state_eval_queue();
2807 _elm_win_cb_show(void *data EINA_UNUSED,
2808 Evas *e EINA_UNUSED,
2809 Evas_Object *obj EINA_UNUSED,
2810 void *event_info EINA_UNUSED)
2812 _elm_win_state_eval_queue();
2818 * Recalculate the size of window considering its resize objects' weight and
2819 * min size. If any of its resize objects' weight equals to 0.0, window
2820 * layout's weight will be set to 0.0.
2822 * @param o box object
2823 * @param p box's private data
2824 * @param data window object
2827 _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
2831 Evas_Object_Box_Option *opt;
2832 Evas_Coord x, y, w, h;
2834 Evas_Coord minw = -1, minh = -1;
2835 double weight_x = EVAS_HINT_EXPAND;
2836 double weight_y = EVAS_HINT_EXPAND;
2838 EINA_LIST_FOREACH(p->children, l, opt)
2841 evas_object_size_hint_weight_get(child, &wx, &wy);
2842 if (wx == 0.0) weight_x = 0;
2843 if (wy == 0.0) weight_y = 0;
2845 evas_object_size_hint_min_get(child, &w, &h);
2846 if (w > minw) minw = w;
2847 if (h > minh) minh = h;
2850 evas_object_size_hint_min_set(o, minw, minh);
2851 evas_object_geometry_get(o, &x, &y, &w, &h);
2852 if (w < minw) w = minw;
2853 if (h < minh) h = minh;
2854 evas_object_resize(o, w, h);
2856 EINA_LIST_FOREACH(p->children, l, opt)
2859 evas_object_move(child, x, y);
2860 evas_object_resize(child, w, h);
2863 ELM_WIN_DATA_GET(data, sd);
2864 evas_object_size_hint_weight_set(sd->layout, weight_x, weight_y);
2865 evas_object_smart_changed(sd->layout);
2871 const char *env = NULL;
2874 str = _elm_accel_preference;
2875 env = getenv("ELM_ACCEL");
2878 ((!strcasecmp(str, "gl")) ||
2879 (!strcasecmp(str, "opengl")) ||
2880 (!strcasecmp(str, "3d")) ||
2881 (!strcasecmp(str, "hw")) ||
2882 (!strcasecmp(str, "accel")) ||
2883 (!strcasecmp(str, "hardware"))
2890 _elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type)
2892 sd->obj = obj; // in ctor
2894 Evas_Object *parent = NULL;
2897 const char *fontpath, *engine = NULL, *enginelist[32], *disp;
2900 Elm_Win_Data tmp_sd;
2902 eo_do(obj, parent = eo_parent_get());
2904 /* just to store some data while trying out to create a canvas */
2905 memset(&tmp_sd, 0, sizeof(Elm_Win_Data));
2909 case ELM_WIN_INLINED_IMAGE:
2912 e = evas_object_evas_get(parent);
2917 ee = ecore_evas_ecore_evas_get(e);
2920 tmp_sd.img_obj = ecore_evas_object_image_new(ee);
2921 if (!tmp_sd.img_obj) break;
2923 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
2926 ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
2931 case ELM_WIN_SOCKET_IMAGE:
2932 tmp_sd.ee = ecore_evas_extn_socket_new(1, 1);
2936 disp = getenv("ELM_DISPLAY");
2937 if ((disp) && (!strcmp(disp, "x11")))
2941 enginelist[0] = ELM_OPENGL_X11;
2942 enginelist[1] = ELM_SOFTWARE_X11;
2943 enginelist[2] = NULL;
2947 enginelist[0] = ENGINE_GET();
2948 enginelist[1] = ELM_SOFTWARE_X11;
2949 enginelist[2] = ELM_OPENGL_X11;
2950 enginelist[3] = NULL;
2953 else if ((disp) && (!strcmp(disp, "wl")))
2957 enginelist[0] = ELM_WAYLAND_EGL;
2958 enginelist[1] = ELM_WAYLAND_SHM;
2959 enginelist[2] = NULL;
2963 enginelist[0] = ENGINE_GET();
2964 enginelist[1] = ELM_WAYLAND_SHM;
2965 enginelist[2] = ELM_WAYLAND_EGL;
2966 enginelist[3] = NULL;
2969 else if ((disp) && (!strcmp(disp, "win")))
2971 enginelist[0] = ENGINE_GET();
2972 enginelist[1] = ELM_SOFTWARE_WIN32;
2973 enginelist[2] = NULL;
2975 else if ((disp) && (!strcmp(disp, "sdl")))
2979 enginelist[0] = ELM_OPENGL_SDL;
2980 enginelist[1] = ELM_SOFTWARE_SDL;
2981 enginelist[2] = NULL;
2985 enginelist[0] = ENGINE_GET();
2986 enginelist[1] = ELM_SOFTWARE_SDL;
2987 enginelist[2] = ELM_OPENGL_SDL;
2988 enginelist[3] = NULL;
2991 else if ((disp) && (!strcmp(disp, "mac")))
2993 enginelist[0] = ENGINE_GET();
2994 enginelist[1] = ELM_OPENGL_COCOA;
2995 enginelist[2] = NULL;
2997 else if ((disp) && (!strcmp(disp, "ews")))
2999 enginelist[0] = ENGINE_GET();
3000 enginelist[1] = ELM_EWS;
3001 enginelist[2] = NULL;
3003 else if ((disp) && (!strcmp(disp, "fb")))
3005 enginelist[0] = ENGINE_GET();
3006 enginelist[1] = ELM_DRM;
3007 enginelist[2] = ELM_SOFTWARE_FB;
3008 enginelist[3] = NULL;
3010 else if ((disp) && (!strcmp(disp, "buffer")))
3012 enginelist[0] = ENGINE_GET();
3013 enginelist[1] = ELM_BUFFER;
3014 enginelist[2] = NULL;
3016 else if ((disp) && (!strcmp(disp, "ps3")))
3018 enginelist[0] = ENGINE_GET();
3019 enginelist[1] = ELM_SOFTWARE_PSL1GHT;
3020 enginelist[2] = NULL;
3022 else if ((disp) && (!strcmp(disp, "shot")))
3024 enginelist[0] = ENGINE_GET();
3025 enginelist[1] = NULL;
3031 enginelist[0] = ELM_OPENGL_X11;
3032 enginelist[1] = ELM_WAYLAND_EGL;
3033 enginelist[2] = ELM_DRM;
3034 enginelist[3] = ELM_SOFTWARE_FB;
3035 enginelist[4] = ELM_OPENGL_COCOA;
3036 enginelist[5] = ELM_OPENGL_SDL;
3037 enginelist[6] = NULL;
3041 enginelist[0] = ENGINE_GET();
3042 enginelist[1] = ELM_SOFTWARE_X11;
3043 enginelist[2] = ELM_WAYLAND_SHM;
3044 enginelist[3] = ELM_DRM;
3045 enginelist[4] = ELM_SOFTWARE_FB;
3046 enginelist[5] = ELM_OPENGL_COCOA;
3047 enginelist[6] = ELM_SOFTWARE_SDL;
3048 enginelist[7] = NULL;
3051 for (i = 0; i < 30; i++)
3053 if ((i > 0) && (!enginelist[i])) break;
3054 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
3055 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
3056 else if (!strcmp(enginelist[i], ELM_OPENGL_X11))
3058 int opt[10], opt_i = 0;
3060 if (_elm_config->vsync)
3062 opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_VSYNC;
3067 tmp_sd.ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt);
3069 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
3071 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
3072 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
3073 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
3074 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
3075 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
3076 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
3077 else if (!strcmp(enginelist[i], ELM_SOFTWARE_SDL))
3078 tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
3079 else if (!strcmp(enginelist[i], ELM_OPENGL_SDL))
3080 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
3081 else if (!strcmp(enginelist[i], ELM_OPENGL_COCOA))
3082 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
3083 else if (!strcmp(enginelist[i], ELM_EWS))
3084 tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
3085 else if (!strcmp(enginelist[i], ELM_SOFTWARE_FB))
3086 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
3087 else if (!strcmp(enginelist[i], ELM_BUFFER))
3088 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3089 else if (!strcmp(enginelist[i], ELM_SOFTWARE_PSL1GHT))
3090 tmp_sd.ee = ecore_evas_psl1ght_new(NULL, 1, 1);
3091 else if (!strcmp(enginelist[i], ELM_DRM))
3092 tmp_sd.ee = ecore_evas_drm_new(NULL, 0, 0, 0, 1, 1);
3093 else if (!strncmp(enginelist[i], "shot:", 5))
3095 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3096 ecore_evas_manual_render_set(tmp_sd.ee, EINA_TRUE);
3097 tmp_sd.shot.info = eina_stringshare_add(ENGINE_GET() + 5);
3099 engine = enginelist[i];
3100 if (tmp_sd.ee) break;
3107 ERR("Cannot create window.");
3112 eo_do(obj, eo_parent_set(ecore_evas_get(tmp_sd.ee)));
3113 eo_do_super(obj, MY_CLASS, eo_constructor());
3115 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
3116 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks));
3118 if (getenv("ELM_FIRST_FRAME"))
3119 evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
3120 _elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
3122 /* copying possibly altered fields back */
3123 #define SD_CPY(_field) \
3126 sd->_field = tmp_sd._field; \
3134 if ((trap) && (trap->add))
3135 sd->trap_data = trap->add(obj);
3137 /* complementary actions, which depend on final smart data
3139 if (type == ELM_WIN_INLINED_IMAGE)
3140 _win_inlined_image_set(sd);
3141 #ifdef HAVE_ELEMENTARY_X
3142 else if ((engine) &&
3143 ((!strcmp(engine, ELM_SOFTWARE_X11)) ||
3144 (!strcmp(engine, ELM_OPENGL_X11))))
3146 sd->x.client_message_handler = ecore_event_handler_add
3147 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, obj);
3148 sd->x.property_handler = ecore_event_handler_add
3149 (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
3152 else if ((engine) && (!strncmp(engine, "shot:", 5)))
3155 sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
3156 sd->indmode = ELM_WIN_INDICATOR_UNKNOWN;
3158 #ifdef HAVE_ELEMENTARY_X
3159 _internal_elm_win_xwindow_get(sd);
3162 ecore_x_io_error_handler_set(_elm_x_io_err, NULL);
3166 #ifdef HAVE_ELEMENTARY_WAYLAND
3167 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3168 _elm_win_wlwindow_get(sd);
3171 if ((_elm_config->bgpixmap)
3172 #ifdef HAVE_ELEMENTARY_X
3174 (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
3179 TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
3180 // bg pixmap done by x - has other issues like can be redrawn by x before it
3181 // is filled/ready by app
3182 // TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
3185 sd->parent = parent;
3186 sd->modal_count = 0;
3189 evas_object_event_callback_add
3190 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
3192 sd->evas = ecore_evas_get(sd->ee);
3194 evas_object_color_set(obj, 0, 0, 0, 0);
3195 evas_object_move(obj, 0, 0);
3196 evas_object_resize(obj, 1, 1);
3197 evas_object_layer_set(obj, 50);
3198 evas_object_pass_events_set(obj, EINA_TRUE);
3200 if (type == ELM_WIN_INLINED_IMAGE)
3201 elm_widget_parent2_set(obj, parent);
3203 /* use own version of ecore_evas_object_associate() that does TRAP() */
3204 ecore_evas_data_set(sd->ee, "elm_win", obj);
3206 evas_object_event_callback_add
3207 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3208 _elm_win_obj_callback_changed_size_hints, obj);
3210 evas_object_intercept_raise_callback_add
3211 (obj, _elm_win_obj_intercept_raise, obj);
3212 evas_object_intercept_lower_callback_add
3213 (obj, _elm_win_obj_intercept_lower, obj);
3214 evas_object_intercept_stack_above_callback_add
3215 (obj, _elm_win_obj_intercept_stack_above, obj);
3216 evas_object_intercept_stack_below_callback_add
3217 (obj, _elm_win_obj_intercept_stack_below, obj);
3218 evas_object_intercept_layer_set_callback_add
3219 (obj, _elm_win_obj_intercept_layer_set, obj);
3220 evas_object_intercept_show_callback_add
3221 (obj, _elm_win_obj_intercept_show, obj);
3223 TRAP(sd, name_class_set, name, _elm_appname);
3224 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
3225 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3226 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3227 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3228 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3229 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3230 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3231 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3232 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3234 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
3235 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
3237 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
3238 evas_font_path_append(sd->evas, fontpath);
3240 if (!_elm_config->font_hinting)
3241 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_NONE);
3242 else if (_elm_config->font_hinting == 1)
3243 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_AUTO);
3244 else if (_elm_config->font_hinting == 2)
3245 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_BYTECODE);
3247 #ifdef HAVE_ELEMENTARY_X
3248 _elm_win_xwin_update(sd);
3251 _elm_win_list = eina_list_append(_elm_win_list, obj);
3254 if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
3256 TRAP(sd, fullscreen_set, 1);
3258 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3260 ((!strcmp(engine, ELM_WAYLAND_SHM) ||
3261 (!strcmp(engine, ELM_WAYLAND_EGL))))))
3262 _elm_win_frame_add(sd, "default");
3264 if (_elm_config->focus_highlight_enable)
3265 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3266 if (_elm_config->focus_highlight_animate)
3267 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3270 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
3271 evas_object_event_callback_add
3272 (obj, EVAS_CALLBACK_KEY_DOWN, _debug_key_down, NULL);
3274 if (evas_object_key_grab(obj, "F12", mask, 0, EINA_TRUE))
3275 INF("Ctrl+F12 key combination exclusive for dot tree generation\n");
3277 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3280 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3281 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3283 ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
3286 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3288 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3289 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3290 edje_object_size_min_calc(o, &mw, &mh);
3291 evas_object_resize(o, mw, mh);
3292 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3293 &hx, &hy, NULL, NULL);
3294 sd->pointer.hot_x = hx;
3295 sd->pointer.hot_y = hy;
3296 evas_object_show(o);
3297 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3299 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3304 sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
3305 sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
3307 sd->layout = edje_object_add(sd->evas);
3308 _elm_theme_object_set(obj, sd->layout, "win", "base", "default");
3309 sd->box = evas_object_box_add(sd->evas);
3310 evas_object_box_layout_set(sd->box, _window_layout_stack, obj, NULL);
3311 edje_object_part_swallow(sd->layout, "elm.swallow.contents", sd->box);
3312 evas_object_move(sd->layout, 0, 0);
3313 evas_object_resize(sd->layout, 1, 1);
3314 edje_object_update_hints_set(sd->layout, EINA_TRUE);
3315 evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3316 _elm_win_on_resize_obj_changed_size_hints, obj);
3318 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
3320 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3321 elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_root_get(), obj);
3322 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL));
3325 evas_object_show(sd->layout);
3329 _elm_win_eo_base_constructor(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED)
3332 ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
3335 EOLIAN static Elm_Win_Type
3336 _elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3342 elm_win_util_standard_add(const char *name,
3345 Evas_Object *win, *bg;
3347 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
3348 if (!win) return NULL;
3350 elm_win_title_set(win, title);
3351 bg = elm_bg_add(win);
3354 evas_object_del(win);
3357 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3358 elm_win_resize_object_add(win, bg);
3359 evas_object_show(bg);
3365 _elm_win_resize_object_add(Eo *obj, Elm_Win_Data *sd, Evas_Object *subobj)
3367 elm_widget_sub_object_add(obj, subobj);
3369 if (!evas_object_box_append(sd->box, subobj))
3370 ERR("could not append %p to box", subobj);
3374 _elm_win_resize_object_del(Eo *obj, Elm_Win_Data *sd, Evas_Object *subobj)
3376 if (!elm_widget_sub_object_del(obj, subobj))
3377 ERR("could not remove sub object %p from %p", subobj, obj);
3379 evas_object_box_remove(sd->box, subobj);
3383 _elm_win_title_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *title)
3386 eina_stringshare_replace(&(sd->title), title);
3387 TRAP(sd, title_set, sd->title);
3389 edje_object_part_text_escaped_set
3390 (sd->frame_obj, "elm.text.title", sd->title);
3393 EOLIAN static const char*
3394 _elm_win_title_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3400 _elm_win_icon_name_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *icon_name)
3402 if (!icon_name) return;
3403 eina_stringshare_replace(&(sd->icon_name), icon_name);
3404 #ifdef HAVE_ELEMENTARY_X
3405 _elm_win_xwin_update(sd);
3409 EOLIAN static const char*
3410 _elm_win_icon_name_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3412 return sd->icon_name;
3416 _elm_win_role_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *role)
3419 eina_stringshare_replace(&(sd->role), role);
3420 #ifdef HAVE_ELEMENTARY_X
3421 _elm_win_xwin_update(sd);
3425 EOLIAN static const char*
3426 _elm_win_role_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3432 _elm_win_icon_object_set(Eo *obj, Elm_Win_Data *sd, Evas_Object *icon)
3435 evas_object_event_callback_del_full
3436 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3439 evas_object_event_callback_add
3440 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3441 #ifdef HAVE_ELEMENTARY_X
3442 _elm_win_xwin_update(sd);
3446 EOLIAN static const Evas_Object*
3447 _elm_win_icon_object_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3453 _elm_win_autodel_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool autodel)
3455 sd->autodel = autodel;
3458 EOLIAN static Eina_Bool
3459 _elm_win_autodel_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3465 _elm_win_activate(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3471 _elm_win_lower(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3477 _elm_win_raise(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3483 _elm_win_center(Eo *obj, Elm_Win_Data *sd, Eina_Bool h, Eina_Bool v)
3485 int win_w, win_h, screen_w, screen_h, nx, ny;
3487 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
3490 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &screen_w, &screen_h);
3491 if ((!screen_w) || (!screen_h)) return;
3493 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
3494 if ((!win_w) || (!win_h)) return;
3496 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
3497 else nx = sd->screen.x;
3498 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
3499 else ny = sd->screen.y;
3503 evas_object_move(obj, nx, ny);
3507 _elm_win_borderless_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool borderless)
3509 Eina_Bool need_frame = EINA_FALSE;
3511 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3512 need_frame = engine_name &&
3513 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3514 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3519 _elm_win_frame_del(sd);
3524 _elm_win_frame_add(sd, "default");
3527 evas_object_show(sd->frame_obj);
3530 TRAP(sd, borderless_set, borderless);
3531 #ifdef HAVE_ELEMENTARY_X
3532 _elm_win_xwin_update(sd);
3536 EOLIAN static Eina_Bool
3537 _elm_win_borderless_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3539 return ecore_evas_borderless_get(sd->ee);
3543 _elm_win_shaped_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool shaped)
3545 TRAP(sd, shaped_set, shaped);
3546 #ifdef HAVE_ELEMENTARY_X
3547 _elm_win_xwin_update(sd);
3551 EOLIAN static Eina_Bool
3552 _elm_win_shaped_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3554 return ecore_evas_shaped_get(sd->ee);
3558 _elm_win_alpha_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool enabled)
3562 evas_object_image_alpha_set(sd->img_obj, enabled);
3563 ecore_evas_alpha_set(sd->ee, enabled);
3567 #ifdef HAVE_ELEMENTARY_X
3572 if (!ecore_x_screen_is_composited(0))
3573 elm_win_shaped_set(obj, enabled);
3575 TRAP(sd, alpha_set, enabled);
3578 TRAP(sd, alpha_set, enabled);
3579 _elm_win_xwin_update(sd);
3583 TRAP(sd, alpha_set, enabled);
3587 EOLIAN static Eina_Bool
3588 _elm_win_alpha_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3592 return evas_object_image_alpha_get(sd->img_obj);
3596 return ecore_evas_alpha_get(sd->ee);
3603 _elm_win_override_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool override)
3605 TRAP(sd, override_set, override);
3606 #ifdef HAVE_ELEMENTARY_X
3607 _elm_win_xwin_update(sd);
3611 EOLIAN static Eina_Bool
3612 _elm_win_override_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3614 return ecore_evas_override_get(sd->ee);
3618 _elm_win_fullscreen_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool fullscreen)
3620 // YYY: handle if sd->img_obj
3621 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
3622 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
3623 ENGINE_COMPARE(ELM_DRM))
3625 // these engines... can ONLY be fullscreen
3630 // sd->fullscreen = fullscreen;
3632 Eina_Bool need_frame = EINA_FALSE;
3634 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3635 need_frame = engine_name &&
3636 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3637 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3639 TRAP(sd, fullscreen_set, fullscreen);
3644 _elm_win_frame_del(sd);
3649 _elm_win_frame_add(sd, "default");
3652 evas_object_show(sd->frame_obj);
3654 #ifdef HAVE_ELEMENTARY_X
3655 _elm_win_xwin_update(sd);
3660 EOLIAN static Eina_Bool
3661 _elm_win_fullscreen_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3663 const char* engine_name = ecore_evas_engine_name_get(sd->ee);
3666 ((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
3667 (!strcmp(engine_name, ELM_SOFTWARE_16_WINCE)) ||
3668 (!strcmp(engine_name, ELM_DRM))))
3670 // these engines... can ONLY be fullscreen
3675 return sd->fullscreen;
3682 _dbus_menu_set(Eina_Bool dbus_connect, void *data)
3684 ELM_WIN_DATA_GET_OR_RETURN(data, sd);
3688 DBG("Setting menu to D-Bus");
3689 edje_object_part_unswallow(sd->layout, sd->main_menu);
3690 edje_object_signal_emit(sd->layout, "elm,action,hide_menu", "elm");
3691 _elm_menu_menu_bar_hide(sd->main_menu);
3695 DBG("Setting menu to local mode");
3696 edje_object_part_swallow(sd->layout, "elm.swallow.menu", sd->main_menu);
3697 edje_object_signal_emit(sd->layout, "elm,action,show_menu", "elm");
3698 evas_object_show(sd->main_menu);
3702 EOLIAN static Evas_Object *
3703 _elm_win_main_menu_get(Eo *obj, Elm_Win_Data *sd)
3705 Eina_Bool use_dbus = EINA_FALSE;
3707 if (sd->main_menu) goto end;
3709 sd->main_menu = elm_menu_add(obj);
3710 _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
3712 #ifdef HAVE_ELEMENTARY_X
3713 if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
3716 #ifdef HAVE_ELEMENTARY_X
3717 if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
3719 _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
3720 _dbus_menu_set, obj);
3724 _dbus_menu_set(EINA_FALSE, obj);
3727 return sd->main_menu;
3731 _elm_win_maximized_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool maximized)
3733 _elm_win_frame_maximized_state_update(sd, maximized);
3734 // YYY: handle if sd->img_obj
3735 TRAP(sd, maximized_set, maximized);
3736 #ifdef HAVE_ELEMENTARY_X
3737 _elm_win_xwin_update(sd);
3741 EOLIAN static Eina_Bool
3742 _elm_win_maximized_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3744 return sd->maximized;
3748 _elm_win_iconified_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool iconified)
3750 // sd->iconified = iconified;
3751 TRAP(sd, iconified_set, iconified);
3752 #ifdef HAVE_ELEMENTARY_X
3753 _elm_win_xwin_update(sd);
3757 EOLIAN static Eina_Bool
3758 _elm_win_iconified_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3760 return sd->iconified;
3764 _elm_win_withdrawn_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool withdrawn)
3766 // sd->withdrawn = withdrawn;
3767 TRAP(sd, withdrawn_set, withdrawn);
3768 #ifdef HAVE_ELEMENTARY_X
3769 _elm_win_xwin_update(sd);
3773 EOLIAN static Eina_Bool
3774 _elm_win_withdrawn_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3776 return sd->withdrawn;
3780 _elm_win_available_profiles_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char **profiles, unsigned int count)
3782 Eina_Bool found = EINA_FALSE;
3784 _elm_win_available_profiles_del(sd);
3785 if ((profiles) && (count >= 1))
3787 sd->profile.available_list = calloc(count, sizeof(char *));
3788 if (sd->profile.available_list)
3790 if (!sd->profile.name) found = EINA_TRUE;
3793 for (i = 0; i < count; i++)
3795 sd->profile.available_list[i] = eina_stringshare_add(profiles[i]);
3797 /* check to see if a given array has a current profile of elm_win */
3798 if ((sd->profile.name) &&
3799 (!strcmp(sd->profile.name, profiles[i])))
3804 sd->profile.count = count;
3808 if (ecore_evas_window_profile_supported_get(sd->ee))
3810 ecore_evas_window_available_profiles_set(sd->ee,
3811 sd->profile.available_list,
3814 /* current profile of elm_win is wrong, change profile */
3815 if ((sd->profile.available_list) && (!found))
3817 eina_stringshare_replace(&(sd->profile.name),
3818 sd->profile.available_list[0]);
3819 ecore_evas_window_profile_set(sd->ee, sd->profile.name);
3825 if (sd->profile.available_list)
3826 _elm_win_profile_update(sd);
3830 EOLIAN static Eina_Bool
3831 _elm_win_available_profiles_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, char ***profiles, unsigned int *count)
3833 if (ecore_evas_window_profile_supported_get(sd->ee))
3835 return ecore_evas_window_available_profiles_get(sd->ee,
3841 if (profiles) *profiles = (char **)sd->profile.available_list;
3842 if (count) *count = sd->profile.count;
3848 _elm_win_profile_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *profile)
3850 /* check to see if a given profile is present in an available profiles */
3851 if ((profile) && (sd->profile.available_list))
3853 Eina_Bool found = EINA_FALSE;
3855 for (i = 0; i < sd->profile.count; i++)
3857 if (!strcmp(profile,
3858 sd->profile.available_list[i]))
3867 if (ecore_evas_window_profile_supported_get(sd->ee))
3869 if (!profile) _elm_win_profile_del(sd);
3870 ecore_evas_window_profile_set(sd->ee, profile);
3874 if (_internal_elm_win_profile_set(sd, profile))
3875 _elm_win_profile_update(sd);
3879 EOLIAN static const char*
3880 _elm_win_profile_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3882 return sd->profile.name;
3886 _elm_win_urgent_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool urgent)
3888 sd->urgent = urgent;
3889 TRAP(sd, urgent_set, urgent);
3890 #ifdef HAVE_ELEMENTARY_X
3891 _elm_win_xwin_update(sd);
3895 EOLIAN static Eina_Bool
3896 _elm_win_urgent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3902 _elm_win_demand_attention_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool demand_attention)
3904 sd->demand_attention = demand_attention;
3905 TRAP(sd, demand_attention_set, demand_attention);
3906 #ifdef HAVE_ELEMENTARY_X
3907 _elm_win_xwin_update(sd);
3911 EOLIAN static Eina_Bool
3912 _elm_win_demand_attention_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3914 return sd->demand_attention;
3918 _elm_win_modal_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool modal)
3920 if (sd->modal_count) return;
3923 Evas_Object *current;
3925 if ((modal) && (!sd->modal) && (evas_object_visible_get(obj)))
3927 INCREMENT_MODALITY()
3929 else if ((!modal) && (sd->modal) && (evas_object_visible_get(obj)))
3931 DECREMENT_MODALITY()
3935 TRAP(sd, modal_set, modal);
3936 #ifdef HAVE_ELEMENTARY_X
3937 _elm_win_xwin_update(sd);
3941 EOLIAN static Eina_Bool
3942 _elm_win_modal_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3948 _elm_win_aspect_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, double aspect)
3950 sd->aspect = aspect;
3951 TRAP(sd, aspect_set, aspect);
3952 #ifdef HAVE_ELEMENTARY_X
3953 _elm_win_xwin_update(sd);
3957 EOLIAN static double
3958 _elm_win_aspect_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3964 _elm_win_size_base_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h)
3966 sd->size_base_w = w;
3967 sd->size_base_h = h;
3968 TRAP(sd, size_base_set, w, h);
3969 #ifdef HAVE_ELEMENTARY_X
3970 _elm_win_xwin_update(sd);
3975 _elm_win_size_base_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h)
3977 if (w) *w = sd->size_base_w;
3978 if (w) *h = sd->size_base_h;
3982 _elm_win_size_step_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h)
3984 sd->size_step_w = w;
3985 sd->size_step_h = h;
3986 TRAP(sd, size_step_set, w, h);
3987 #ifdef HAVE_ELEMENTARY_X
3988 _elm_win_xwin_update(sd);
3993 _elm_win_size_step_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h)
3995 if (w) *w = sd->size_step_w;
3996 if (w) *h = sd->size_step_h;
4000 _elm_win_layer_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int layer)
4002 TRAP(sd, layer_set, layer);
4003 #ifdef HAVE_ELEMENTARY_X
4004 _elm_win_xwin_update(sd);
4009 _elm_win_layer_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4011 return ecore_evas_layer_get(sd->ee);
4015 elm_win_norender_push(Evas_Object *obj)
4018 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4021 if (sd->norender == 1) ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
4025 elm_win_norender_pop(Evas_Object *obj)
4028 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4030 if (sd->norender <= 0) return;
4032 if (sd->norender == 0) ecore_evas_manual_render_set(sd->ee, EINA_FALSE);
4036 elm_win_norender_get(Evas_Object *obj)
4038 ELM_WIN_CHECK(obj) - 1;
4039 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
4040 return sd->norender;
4044 elm_win_render(Evas_Object *obj)
4047 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4048 ecore_evas_manual_render(sd->ee);
4052 _win_rotation_degree_check(int rotation)
4054 if ((rotation > 360) || (rotation < 0))
4056 WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
4058 if (rotation < 0) rotation += 360;
4064 * This API resizes the internal window(ex: X window) and evas_output.
4065 * But this does not resize the elm window object and its contents.
4068 _win_rotate(Evas_Object *obj, Elm_Win_Data *sd, int rotation, Eina_Bool resize)
4070 rotation = _win_rotation_degree_check(rotation);
4071 if (sd->rot == rotation) return;
4073 if (resize) TRAP(sd, rotation_with_resize_set, rotation);
4074 else TRAP(sd, rotation_set, rotation);
4075 evas_object_size_hint_min_set(obj, -1, -1);
4076 evas_object_size_hint_max_set(obj, -1, -1);
4077 _elm_win_resize_objects_eval(obj);
4078 #ifdef HAVE_ELEMENTARY_X
4079 _elm_win_xwin_update(sd);
4081 _elm_win_frame_obj_update(sd);
4082 elm_widget_orientation_set(obj, rotation);
4083 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
4087 _elm_win_rotation_set(Eo *obj, Elm_Win_Data *sd, int rotation)
4089 _win_rotate(obj, sd, rotation, EINA_FALSE);
4093 * This API does not resize the internal window (ex: X window).
4094 * But this resizes evas_output, elm window, and its contents.
4097 _elm_win_rotation_with_resize_set(Eo *obj, Elm_Win_Data *sd, int rotation)
4099 _win_rotate(obj, sd, rotation, EINA_TRUE);
4103 _elm_win_rotation_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4108 EOLIAN static Eina_Bool
4109 _elm_win_wm_rotation_supported_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4111 return sd->wm_rot.wm_supported;
4114 /* This will unset a preferred rotation, if given preferred rotation is '-1'.
4117 elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj,
4121 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_set(rotation));
4125 _elm_win_wm_preferred_rotation_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int rotation)
4129 if (!sd->wm_rot.use)
4130 sd->wm_rot.use = EINA_TRUE;
4132 // '-1' means that elm_win doesn't use preferred rotation.
4136 rot = _win_rotation_degree_check(rotation);
4138 if (sd->wm_rot.preferred_rot == rot) return;
4139 sd->wm_rot.preferred_rot = rot;
4141 ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
4145 _elm_win_wm_preferred_rotation_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4147 return sd->wm_rot.preferred_rot;
4151 _elm_win_wm_available_rotations_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const int *rotations, unsigned int count)
4156 if (!sd->wm_rot.use)
4157 sd->wm_rot.use = EINA_TRUE;
4159 ELM_SAFE_FREE(sd->wm_rot.rots, free);
4160 sd->wm_rot.count = 0;
4164 sd->wm_rot.rots = calloc(count, sizeof(int));
4165 if (!sd->wm_rot.rots) return;
4166 for (i = 0; i < count; i++)
4168 r = _win_rotation_degree_check(rotations[i]);
4169 sd->wm_rot.rots[i] = r;
4173 sd->wm_rot.count = count;
4175 ecore_evas_wm_rotation_available_rotations_set(sd->ee,
4180 EOLIAN static Eina_Bool
4181 _elm_win_wm_available_rotations_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int **rotations, unsigned int *count)
4183 if (!sd->wm_rot.use) return EINA_FALSE;
4185 if (sd->wm_rot.count > 0)
4189 *rotations = calloc(sd->wm_rot.count, sizeof(int));
4194 sizeof(int) * sd->wm_rot.count);
4199 if (count) *count = sd->wm_rot.count;
4204 _elm_win_wm_manual_rotation_done_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool set)
4206 if (!sd->wm_rot.use) return;
4207 ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
4210 EOLIAN static Eina_Bool
4211 _elm_win_wm_manual_rotation_done_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4213 if (!sd->wm_rot.use) return EINA_FALSE;
4214 return ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
4218 _elm_win_wm_manual_rotation_done(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4220 if (!sd->wm_rot.use) return;
4221 ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
4225 _elm_win_sticky_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool sticky)
4227 // sd->sticky = sticky;
4228 TRAP(sd, sticky_set, sticky);
4229 #ifdef HAVE_ELEMENTARY_X
4230 _elm_win_xwin_update(sd);
4234 EOLIAN static Eina_Bool
4235 _elm_win_sticky_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4241 _elm_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Keyboard_Mode mode)
4243 if (mode == sd->kbdmode) return;
4244 #ifdef HAVE_ELEMENTARY_X
4245 _internal_elm_win_xwindow_get(sd);
4248 #ifdef HAVE_ELEMENTARY_X
4250 ecore_x_e_virtual_keyboard_state_set
4251 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
4255 EOLIAN static Elm_Win_Keyboard_Mode
4256 _elm_win_keyboard_mode_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4262 _elm_win_keyboard_win_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool is_keyboard)
4264 #ifdef HAVE_ELEMENTARY_X
4265 _internal_elm_win_xwindow_get(sd);
4267 ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
4273 EOLIAN static Eina_Bool
4274 _elm_win_keyboard_win_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4276 #ifdef HAVE_ELEMENTARY_X
4277 _internal_elm_win_xwindow_get(sd);
4278 if (sd->x.xwin) return ecore_x_e_virtual_keyboard_get(sd->x.xwin);
4284 _elm_win_indicator_mode_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Indicator_Mode mode)
4286 if (mode == sd->indmode) return;
4287 #ifdef HAVE_ELEMENTARY_X
4288 _internal_elm_win_xwindow_get(sd);
4291 #ifdef HAVE_ELEMENTARY_X
4294 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
4295 ecore_x_e_illume_indicator_state_set
4296 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
4297 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
4298 ecore_x_e_illume_indicator_state_set
4299 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
4302 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
4305 EOLIAN static Elm_Win_Indicator_Mode
4306 _elm_win_indicator_mode_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4312 _elm_win_indicator_opacity_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Indicator_Opacity_Mode mode)
4314 if (mode == sd->ind_o_mode) return;
4315 sd->ind_o_mode = mode;
4316 #ifdef HAVE_ELEMENTARY_X
4317 _internal_elm_win_xwindow_get(sd);
4320 if (sd->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
4321 ecore_x_e_illume_indicator_opacity_set
4322 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
4323 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
4324 ecore_x_e_illume_indicator_opacity_set
4325 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
4326 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
4327 ecore_x_e_illume_indicator_opacity_set
4328 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
4331 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
4334 EOLIAN static Elm_Win_Indicator_Opacity_Mode
4335 _elm_win_indicator_opacity_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4337 return sd->ind_o_mode;
4341 _elm_win_screen_position_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *x, int *y)
4343 if (x) *x = sd->screen.x;
4344 if (y) *y = sd->screen.y;
4347 EOLIAN static Eina_Bool
4348 _elm_win_focus_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4350 return ecore_evas_focus_get(sd->ee);
4354 _elm_win_screen_constrain_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool constrain)
4356 sd->constrain = !!constrain;
4359 EOLIAN static Eina_Bool
4360 _elm_win_screen_constrain_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4362 return sd->constrain;
4366 _elm_win_screen_size_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *x, int *y, int *w, int *h)
4368 ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
4372 _elm_win_screen_dpi_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *xdpi, int *ydpi)
4374 ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
4378 _elm_win_conformant_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool conformant)
4380 #ifdef HAVE_ELEMENTARY_X
4381 _internal_elm_win_xwindow_get(sd);
4383 ecore_x_e_illume_conformant_set(sd->x.xwin, conformant);
4389 EOLIAN static Eina_Bool
4390 _elm_win_conformant_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4392 #ifdef HAVE_ELEMENTARY_X
4393 _internal_elm_win_xwindow_get(sd);
4395 return ecore_x_e_illume_conformant_get(sd->x.xwin);
4402 _elm_win_quickpanel_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool quickpanel)
4404 #ifdef HAVE_ELEMENTARY_X
4405 _internal_elm_win_xwindow_get(sd);
4408 ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel);
4411 Ecore_X_Window_State states[2];
4413 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
4414 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
4415 ecore_x_netwm_window_state_set(sd->x.xwin, states, 2);
4416 ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
4424 EOLIAN static Eina_Bool
4425 _elm_win_quickpanel_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4427 #ifdef HAVE_ELEMENTARY_X
4428 _internal_elm_win_xwindow_get(sd);
4430 return ecore_x_e_illume_quickpanel_get(sd->x.xwin);
4437 _elm_win_quickpanel_priority_major_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int priority)
4439 #ifdef HAVE_ELEMENTARY_X
4440 _internal_elm_win_xwindow_get(sd);
4442 ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
4449 _elm_win_quickpanel_priority_major_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4451 #ifdef HAVE_ELEMENTARY_X
4452 _internal_elm_win_xwindow_get(sd);
4454 return ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
4461 _elm_win_quickpanel_priority_minor_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int priority)
4463 #ifdef HAVE_ELEMENTARY_X
4464 _internal_elm_win_xwindow_get(sd);
4466 ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
4473 _elm_win_quickpanel_priority_minor_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4475 #ifdef HAVE_ELEMENTARY_X
4476 _internal_elm_win_xwindow_get(sd);
4478 return ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
4485 _elm_win_quickpanel_zone_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int zone)
4487 #ifdef HAVE_ELEMENTARY_X
4488 _internal_elm_win_xwindow_get(sd);
4490 ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
4497 _elm_win_quickpanel_zone_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4499 #ifdef HAVE_ELEMENTARY_X
4500 _internal_elm_win_xwindow_get(sd);
4502 return ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
4509 _elm_win_prop_focus_skip_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool skip)
4511 sd->skip_focus = skip;
4512 TRAP(sd, focus_skip_set, skip);
4516 _elm_win_illume_command_send(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Illume_Command command, void *params)
4520 #ifdef HAVE_ELEMENTARY_X
4521 _internal_elm_win_xwindow_get(sd);
4526 case ELM_ILLUME_COMMAND_FOCUS_BACK:
4527 ecore_x_e_illume_focus_back_send(sd->x.xwin);
4530 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
4531 ecore_x_e_illume_focus_forward_send(sd->x.xwin);
4534 case ELM_ILLUME_COMMAND_FOCUS_HOME:
4535 ecore_x_e_illume_focus_home_send(sd->x.xwin);
4538 case ELM_ILLUME_COMMAND_CLOSE:
4539 ecore_x_e_illume_close_send(sd->x.xwin);
4551 EOLIAN static Evas_Object*
4552 _elm_win_inlined_image_object_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4558 _elm_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool enabled)
4560 enabled = !!enabled;
4561 if (sd->focus_highlight.enabled == enabled)
4564 sd->focus_highlight.enabled = enabled;
4566 if (sd->focus_highlight.enabled)
4567 _elm_win_focus_highlight_init(sd);
4569 _elm_win_focus_highlight_shutdown(sd);
4572 EOLIAN static Eina_Bool
4573 _elm_win_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4575 return sd->focus_highlight.enabled;
4578 EOLIAN static Eina_Bool
4579 _elm_win_elm_widget_theme_apply(Eo *obj, Elm_Win_Data *sd)
4581 Eina_Bool int_ret = EINA_FALSE;
4582 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
4583 if (!int_ret) return EINA_TRUE;
4585 sd->focus_highlight.theme_changed = EINA_TRUE;
4586 _elm_win_focus_highlight_reconfigure_job_start(sd);
4592 _elm_win_focus_highlight_style_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *style)
4594 eina_stringshare_replace(&sd->focus_highlight.style, style);
4595 sd->focus_highlight.theme_changed = EINA_TRUE;
4596 _elm_win_focus_highlight_reconfigure_job_start(sd);
4599 EOLIAN static const char*
4600 _elm_win_focus_highlight_style_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4602 return sd->focus_highlight.style;
4606 _elm_win_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool animate)
4608 animate = !!animate;
4609 if (sd->focus_highlight.animate == animate)
4612 sd->focus_highlight.animate = animate;
4613 sd->focus_highlight.theme_changed = EINA_TRUE;
4614 _elm_win_focus_highlight_reconfigure_job_start(sd);
4617 EOLIAN static Eina_Bool
4618 _elm_win_focus_highlight_animate_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4620 return sd->focus_highlight.animate;
4623 EOLIAN static Eina_Bool
4624 _elm_win_socket_listen(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *svcname, int svcnum, Eina_Bool svcsys)
4626 if (!sd->ee) return EINA_FALSE;
4628 if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
4634 /* windowing specific calls - shall we do this differently? */
4636 EOLIAN static Ecore_X_Window
4637 _elm_win_xwindow_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4639 #ifdef HAVE_ELEMENTARY_X
4640 if (sd->x.xwin) return sd->x.xwin;
4641 if (sd->parent) return elm_win_xwindow_get(sd->parent);
4646 EAPI Ecore_Wl_Window *
4647 elm_win_wl_window_get(const Evas_Object *obj)
4649 if (!obj) return NULL;
4651 if ((!ENGINE_COMPARE(ELM_WAYLAND_SHM)) &&
4652 (!ENGINE_COMPARE(ELM_WAYLAND_EGL)))
4655 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
4657 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
4658 return _elm_ee_wlwin_get(ee);
4661 ELM_WIN_CHECK(obj) NULL;
4662 Ecore_Wl_Window *ret = NULL;
4663 eo_do((Eo *) obj, ret = elm_obj_win_wl_window_get());
4667 EOLIAN static Ecore_Wl_Window*
4668 _elm_win_wl_window_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4670 #if HAVE_ELEMENTARY_WAYLAND
4671 if (sd->wl.win) return sd->wl.win;
4672 if (sd->parent) return elm_win_wl_window_get(sd->parent);
4680 elm_win_trap_set(const Elm_Win_Trap *t)
4682 DBG("old %p, new %p", trap, t);
4684 if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
4686 CRI("trying to set a trap version %lu while %lu was expected!",
4687 t->version, ELM_WIN_TRAP_VERSION);
4696 elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
4699 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4701 floating = !!floating;
4702 if (floating == sd->floating) return;
4703 sd->floating = floating;
4704 #ifdef HAVE_ELEMENTARY_X
4705 _internal_elm_win_xwindow_get(sd);
4709 ecore_x_e_illume_window_state_set
4710 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING);
4712 ecore_x_e_illume_window_state_set
4713 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL);
4719 elm_win_floating_mode_get(const Evas_Object *obj)
4721 ELM_WIN_CHECK(obj) EINA_FALSE;
4722 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
4724 return sd->floating;
4727 EOLIAN static Ecore_Window
4728 _elm_win_window_id_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4730 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
4732 #if HAVE_ELEMENTARY_WAYLAND
4733 if (sd->wl.win) return (Ecore_Window)ecore_wl_window_surface_id_get(sd->wl.win);
4736 Ecore_Wl_Window *parent;
4738 parent = elm_win_wl_window_get(sd->parent);
4739 if (parent) return (Ecore_Window)ecore_wl_window_surface_id_get(parent);
4746 #ifdef HAVE_ELEMENTARY_X
4747 _internal_elm_win_xwindow_get(sd);
4748 if (sd->x.xwin) return (Ecore_Window)sd->x.xwin;
4749 if (sd->parent) return (Ecore_Window)elm_win_xwindow_get(sd->parent);
4757 _elm_win_focus_highlight_start(Evas_Object *obj)
4759 ELM_WIN_DATA_GET(obj, sd);
4761 if (!elm_win_focus_highlight_enabled_get(obj)) return;
4762 sd->focus_highlight.cur.visible = EINA_TRUE;
4763 sd->focus_highlight.geometry_changed = EINA_TRUE;
4764 _elm_win_focus_highlight_reconfigure_job(obj);
4768 elm_win_window_id_get(const Evas_Object *obj)
4772 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
4774 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
4775 return ecore_evas_window_get(ee);
4778 ELM_WIN_CHECK(obj) 0;
4779 Ecore_Window ret = 0;
4780 eo_do((Eo *) obj, ret = elm_obj_win_window_id_get());
4785 _elm_win_class_constructor(Eo_Class *klass)
4787 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
4791 _elm_win_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd EINA_UNUSED)
4793 // attach all kinds of windows directly to ATSPI application root object
4794 return _elm_atspi_root_get();
4797 #include "elm_win.eo.c"