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_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);
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);
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_prev_target_del(void *data,
811 Evas_Object *obj EINA_UNUSED,
812 void *event_info EINA_UNUSED)
814 ELM_WIN_DATA_GET(data, sd);
815 sd->focus_highlight.prev.target = NULL;
819 _elm_win_focus_highlight_reconfigure_job(void *data)
821 ELM_WIN_DATA_GET(data, sd);
822 Evas_Object *target = sd->focus_highlight.cur.target;
823 Evas_Object *previous = sd->focus_highlight.prev.target;
824 Evas_Object *fobj = sd->focus_highlight.fobj;
825 Eina_Bool visible_changed;
826 Eina_Bool common_visible;
827 const char *sig = NULL;
828 const char *focus_style_target = NULL;
829 const char *focus_style_previous = NULL;
831 _elm_win_focus_highlight_reconfigure_job_stop(sd);
833 visible_changed = (sd->focus_highlight.cur.visible !=
834 sd->focus_highlight.prev.visible);
836 if ((target == previous) && (!visible_changed) &&
837 (!sd->focus_highlight.geometry_changed) &&
838 (!sd->focus_highlight.theme_changed))
841 if ((previous) && (sd->focus_highlight.prev.in_theme))
843 evas_object_event_callback_del_full
844 (previous, EVAS_CALLBACK_DEL, _elm_win_focus_prev_target_del, data);
845 elm_widget_signal_emit
846 (previous, "elm,action,focus_highlight,hide", "elm");
850 common_visible = EINA_FALSE;
851 else if (sd->focus_highlight.cur.in_theme)
853 common_visible = EINA_FALSE;
854 if (sd->focus_highlight.cur.visible)
855 sig = "elm,action,focus_highlight,show";
857 sig = "elm,action,focus_highlight,hide";
860 common_visible = sd->focus_highlight.cur.visible;
863 elm_widget_signal_emit(target, sig, "elm");
865 if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
869 focus_style_previous = elm_widget_focus_highlight_style_get(previous);
870 focus_style_target = elm_widget_focus_highlight_style_get(target);
872 if (sd->focus_highlight.theme_changed ||
873 (focus_style_target != focus_style_previous))
877 if (focus_style_target)
878 str = focus_style_target;
879 else if (sd->focus_highlight.style)
880 str = sd->focus_highlight.style;
884 elm_widget_theme_object_set
885 (sd->obj, fobj, "focus_highlight", "top", str);
886 sd->focus_highlight.theme_changed = EINA_FALSE;
888 if (sd->focus_highlight.animate)
890 str = edje_object_data_get(sd->focus_highlight.fobj, "animate");
891 sd->focus_highlight.animate_supported = ((str) && (!strcmp(str, "on")));
894 sd->focus_highlight.animate_supported = EINA_FALSE;
897 if ((sd->focus_highlight.animate_supported) && (previous) &&
898 (!sd->focus_highlight.prev.in_theme))
899 _elm_win_focus_highlight_anim_setup(sd, fobj);
901 _elm_win_focus_highlight_simple_setup(sd, fobj);
902 evas_object_raise(fobj);
905 _elm_win_focus_highlight_visible_set(sd, common_visible);
906 sd->focus_highlight.geometry_changed = EINA_FALSE;
907 sd->focus_highlight.prev = sd->focus_highlight.cur;
908 evas_object_event_callback_add
909 (sd->focus_highlight.prev.target,
910 EVAS_CALLBACK_DEL, _elm_win_focus_prev_target_del, data);
914 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win_Data *sd)
916 ecore_job_del(sd->focus_highlight.reconf_job);
918 sd->focus_highlight.reconf_job = ecore_job_add(
919 _elm_win_focus_highlight_reconfigure_job, sd->obj);
923 _elm_win_focus_in(Ecore_Evas *ee)
925 Elm_Win_Data *sd = _elm_win_associate_get(ee);
927 unsigned int order = 0;
929 if ((!sd) || (sd->modal_count)) return;
933 _elm_widget_top_win_focused_set(obj, EINA_TRUE);
934 if (!elm_widget_focus_order_get(obj)
935 || (obj == elm_widget_newest_focus_order_get(obj, &order, EINA_TRUE)))
937 elm_widget_focus_steal(obj);
940 elm_widget_focus_restore(obj);
941 evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
942 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
943 sd->focus_highlight.cur.visible = EINA_TRUE;
944 _elm_win_focus_highlight_reconfigure_job_start(sd);
947 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
951 /* else if (sd->img_obj) */
957 _elm_win_focus_out(Ecore_Evas *ee)
959 Elm_Win_Data *sd = _elm_win_associate_get(ee);
966 elm_object_focus_set(obj, EINA_FALSE);
967 _elm_widget_top_win_focused_set(obj, EINA_FALSE);
968 evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
969 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
970 sd->focus_highlight.cur.visible = EINA_FALSE;
971 _elm_win_focus_highlight_reconfigure_job_start(sd);
974 edje_object_signal_emit(sd->frame_obj, "elm,action,unfocus", "elm");
978 _elm_access_object_highlight_disable(evas_object_evas_get(obj));
981 /* if (sd->img_obj) */
987 _elm_win_available_profiles_del(Elm_Win_Data *sd)
989 if (!sd->profile.available_list) return;
992 for (i = 0; i < sd->profile.count; i++)
993 ELM_SAFE_FREE(sd->profile.available_list[i], eina_stringshare_del);
994 sd->profile.count = 0;
995 ELM_SAFE_FREE(sd->profile.available_list, free);
999 _elm_win_profile_del(Elm_Win_Data *sd)
1001 ELM_SAFE_FREE(sd->profile.name, eina_stringshare_del);
1005 _internal_elm_win_profile_set(Elm_Win_Data *sd, const char *profile)
1007 Eina_Bool changed = EINA_FALSE;
1010 if (sd->profile.name)
1012 if (strcmp(sd->profile.name, profile) != 0)
1014 eina_stringshare_replace(&(sd->profile.name), profile);
1015 changed = EINA_TRUE;
1020 sd->profile.name = eina_stringshare_add(profile);
1021 changed = EINA_TRUE;
1025 _elm_win_profile_del(sd);
1031 _elm_win_profile_update(Elm_Win_Data *sd)
1033 if (sd->profile.available_list)
1035 Eina_Bool found = EINA_FALSE;
1036 if (sd->profile.name)
1039 for (i = 0; i < sd->profile.count; i++)
1041 if (!strcmp(sd->profile.name,
1042 sd->profile.available_list[i]))
1050 /* If current profile is not present in an available profiles,
1051 * change current profile to the 1st element of an array.
1054 _internal_elm_win_profile_set(sd, sd->profile.available_list[0]);
1057 _elm_config_profile_set(sd->profile.name);
1061 Eina_List *sub, *l = NULL;
1063 sub = ecore_evas_sub_ecore_evas_list_get(sd->ee);
1064 EINA_LIST_FOREACH(sub, l, ee2)
1065 ecore_evas_window_profile_set(ee2, sd->profile.name);
1067 evas_object_smart_callback_call(sd->obj, SIG_PROFILE_CHANGED, NULL);
1071 _elm_win_state_change(Ecore_Evas *ee)
1073 Elm_Win_Data *sd = _elm_win_associate_get(ee);
1075 Eina_Bool ch_withdrawn = EINA_FALSE;
1076 Eina_Bool ch_sticky = EINA_FALSE;
1077 Eina_Bool ch_iconified = EINA_FALSE;
1078 Eina_Bool ch_fullscreen = EINA_FALSE;
1079 Eina_Bool ch_maximized = EINA_FALSE;
1080 Eina_Bool ch_profile = EINA_FALSE;
1081 Eina_Bool ch_wm_rotation = EINA_FALSE;
1082 const char *profile;
1088 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
1090 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
1091 ch_withdrawn = EINA_TRUE;
1093 if (sd->sticky != ecore_evas_sticky_get(sd->ee))
1095 sd->sticky = ecore_evas_sticky_get(sd->ee);
1096 ch_sticky = EINA_TRUE;
1098 if (sd->iconified != ecore_evas_iconified_get(sd->ee))
1100 sd->iconified = ecore_evas_iconified_get(sd->ee);
1101 ch_iconified = EINA_TRUE;
1103 if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee))
1105 sd->fullscreen = ecore_evas_fullscreen_get(sd->ee);
1106 ch_fullscreen = EINA_TRUE;
1108 if (sd->maximized != ecore_evas_maximized_get(sd->ee))
1110 sd->maximized = ecore_evas_maximized_get(sd->ee);
1111 ch_maximized = EINA_TRUE;
1114 profile = ecore_evas_window_profile_get(sd->ee);
1115 ch_profile = _internal_elm_win_profile_set(sd, profile);
1119 if (sd->rot != ecore_evas_rotation_get(sd->ee))
1121 sd->rot = ecore_evas_rotation_get(sd->ee);
1122 ch_wm_rotation = EINA_TRUE;
1126 _elm_win_state_eval_queue();
1128 if ((ch_withdrawn) || (ch_iconified))
1131 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL);
1132 else if (sd->iconified)
1133 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL);
1135 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL);
1140 evas_object_smart_callback_call(obj, SIG_STICK, NULL);
1142 evas_object_smart_callback_call(obj, SIG_UNSTICK, NULL);
1147 evas_object_smart_callback_call(obj, SIG_FULLSCREEN, NULL);
1149 evas_object_smart_callback_call(obj, SIG_UNFULLSCREEN, NULL);
1154 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL);
1156 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL);
1160 _elm_win_profile_update(sd);
1164 evas_object_size_hint_min_set(obj, -1, -1);
1165 evas_object_size_hint_max_set(obj, -1, -1);
1166 #ifdef HAVE_ELEMENTARY_X
1167 _elm_win_xwin_update(sd);
1169 elm_widget_orientation_set(obj, sd->rot);
1170 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
1171 evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
1175 EOLIAN static Eina_Bool
1176 _elm_win_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Win_Data *_pd EINA_UNUSED)
1181 EOLIAN static Eina_Bool
1182 _elm_win_elm_widget_focus_next(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED, Elm_Focus_Direction dir, Evas_Object **next)
1184 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1186 const Eina_List *items;
1187 void *(*list_data_get)(const Eina_List *list);
1192 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1194 items = wd->subobjs;
1198 list_data_get = eina_list_data_get;
1200 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
1202 if (*next) return EINA_TRUE;
1204 *next = (Evas_Object *)obj;
1208 EOLIAN static Eina_Bool
1209 _elm_win_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Win_Data *_pd EINA_UNUSED)
1214 EOLIAN static Eina_Bool
1215 _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)
1217 const Eina_List *items;
1218 void *(*list_data_get)(const Eina_List *list);
1220 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1225 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1226 items = wd->subobjs;
1228 list_data_get = eina_list_data_get;
1230 return elm_widget_focus_list_direction_get
1231 (obj, base, items, list_data_get, degree, direction, weight);
1237 EOLIAN static Eina_Bool
1238 _elm_win_elm_widget_on_focus(Eo *obj, Elm_Win_Data *sd)
1240 Eina_Bool int_ret = EINA_FALSE;
1241 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus());
1242 if (!int_ret) return EINA_TRUE;
1245 evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));
1247 evas_object_focus_set(obj, elm_widget_focus_get(obj));
1253 _key_action_return(Evas_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
1259 _key_action_move(Evas_Object *obj, const char *params)
1261 const char *dir = params;
1263 if (!strcmp(dir, "previous"))
1264 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1265 else if (!strcmp(dir, "next"))
1266 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1267 else if (!strcmp(dir, "left"))
1268 elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
1269 else if (!strcmp(dir, "right"))
1270 elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
1271 else if (!strcmp(dir, "up"))
1272 elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
1273 else if (!strcmp(dir, "down"))
1274 elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
1275 else return EINA_FALSE;
1280 EOLIAN static Eina_Bool
1281 _elm_win_elm_widget_event(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
1284 Evas_Event_Key_Down *ev = event_info;
1286 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
1287 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
1289 if (!_elm_config_key_binding_call(obj, ev, key_actions))
1292 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1297 _deferred_ecore_evas_free(void *data)
1299 ecore_evas_free(data);
1300 _elm_win_deferred_free--;
1304 _elm_win_evas_object_smart_show(Eo *obj, Elm_Win_Data *sd)
1306 if (sd->modal_count) return;
1308 Evas_Object *current;
1310 if (!evas_object_visible_get(obj))
1311 _elm_win_state_eval_queue();
1312 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
1314 if ((sd->modal) && (!evas_object_visible_get(obj)))
1316 INCREMENT_MODALITY()
1321 if (sd->shot.info) _shot_handle(sd);
1325 _elm_win_evas_object_smart_hide(Eo *obj, Elm_Win_Data *sd)
1327 if (sd->modal_count) return;
1329 Evas_Object *current;
1331 if (evas_object_visible_get(obj))
1332 _elm_win_state_eval_queue();
1333 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
1335 if ((sd->modal) && (evas_object_visible_get(obj)))
1337 DECREMENT_MODALITY()
1344 evas_object_hide(sd->frame_obj);
1348 evas_object_hide(sd->img_obj);
1350 if (sd->pointer.obj)
1352 evas_object_hide(sd->pointer.obj);
1353 ecore_evas_hide(sd->pointer.ee);
1358 _elm_win_on_parent_del(void *data,
1359 Evas *e EINA_UNUSED,
1361 void *event_info EINA_UNUSED)
1363 ELM_WIN_DATA_GET(data, sd);
1365 if (obj == sd->parent) sd->parent = NULL;
1369 _elm_win_focus_target_move(void *data,
1370 Evas *e EINA_UNUSED,
1371 Evas_Object *obj EINA_UNUSED,
1372 void *event_info EINA_UNUSED)
1374 ELM_WIN_DATA_GET(data, sd);
1376 sd->focus_highlight.geometry_changed = EINA_TRUE;
1377 _elm_win_focus_highlight_reconfigure_job_start(sd);
1381 _elm_win_focus_target_resize(void *data,
1382 Evas *e EINA_UNUSED,
1383 Evas_Object *obj EINA_UNUSED,
1384 void *event_info EINA_UNUSED)
1386 ELM_WIN_DATA_GET(data, sd);
1388 sd->focus_highlight.geometry_changed = EINA_TRUE;
1389 _elm_win_focus_highlight_reconfigure_job_start(sd);
1393 _elm_win_focus_target_del(void *data,
1394 Evas *e EINA_UNUSED,
1395 Evas_Object *obj EINA_UNUSED,
1396 void *event_info EINA_UNUSED)
1398 ELM_WIN_DATA_GET(data, sd);
1400 sd->focus_highlight.cur.target = NULL;
1402 _elm_win_focus_highlight_reconfigure_job_start(sd);
1405 static Evas_Object *
1406 _elm_win_focus_target_get(Evas_Object *obj)
1408 Evas_Object *o = obj;
1412 if (elm_widget_is(o))
1414 if (!elm_widget_highlight_ignore_get(o))
1416 o = elm_widget_parent_get(o);
1418 o = evas_object_smart_parent_get(o);
1422 o = elm_widget_parent_widget_get(o);
1424 o = evas_object_smart_parent_get(o);
1433 _elm_win_focus_target_callbacks_add(Elm_Win_Data *sd)
1435 Evas_Object *obj = sd->focus_highlight.cur.target;
1438 evas_object_event_callback_add
1439 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1440 evas_object_event_callback_add
1441 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1442 evas_object_event_callback_add
1443 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1447 _elm_win_focus_target_callbacks_del(Elm_Win_Data *sd)
1449 Evas_Object *obj = sd->focus_highlight.cur.target;
1451 evas_object_event_callback_del_full
1452 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1453 evas_object_event_callback_del_full
1454 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1455 evas_object_event_callback_del_full
1456 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1460 _elm_win_object_focus_in(void *data,
1461 Evas *e EINA_UNUSED,
1464 Evas_Object *obj = event_info, *target;
1465 ELM_WIN_DATA_GET(data, sd);
1467 if (sd->focus_highlight.cur.target == obj)
1470 target = _elm_win_focus_target_get(obj);
1471 sd->focus_highlight.cur.target = target;
1472 if (target && elm_widget_highlight_in_theme_get(target))
1473 sd->focus_highlight.cur.in_theme = EINA_TRUE;
1475 _elm_win_focus_target_callbacks_add(sd);
1477 _elm_win_focus_highlight_reconfigure_job_start(sd);
1481 _elm_win_object_focus_out(void *data,
1482 Evas *e EINA_UNUSED,
1483 void *event_info EINA_UNUSED)
1485 ELM_WIN_DATA_GET(data, sd);
1487 if (!sd->focus_highlight.cur.target)
1490 if (!sd->focus_highlight.cur.in_theme)
1491 _elm_win_focus_target_callbacks_del(sd);
1493 sd->focus_highlight.cur.target = NULL;
1494 sd->focus_highlight.cur.in_theme = EINA_FALSE;
1496 _elm_win_focus_highlight_reconfigure_job_start(sd);
1500 _elm_win_focus_highlight_shutdown(Elm_Win_Data *sd)
1502 _elm_win_focus_highlight_reconfigure_job_stop(sd);
1503 if (sd->focus_highlight.cur.target)
1505 elm_widget_signal_emit(sd->focus_highlight.cur.target,
1506 "elm,action,focus_highlight,hide", "elm");
1507 _elm_win_focus_target_callbacks_del(sd);
1508 sd->focus_highlight.cur.target = NULL;
1510 ELM_SAFE_FREE(sd->focus_highlight.fobj, evas_object_del);
1512 evas_event_callback_del_full
1513 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1514 _elm_win_object_focus_in, sd->obj);
1515 evas_event_callback_del_full
1516 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1517 _elm_win_object_focus_out, sd->obj);
1521 _win_img_hide(void *data,
1522 Evas *e EINA_UNUSED,
1523 Evas_Object *obj EINA_UNUSED,
1524 void *event_info EINA_UNUSED)
1526 elm_widget_focus_hide_handle(data);
1530 _win_img_mouse_up(void *data,
1531 Evas *e EINA_UNUSED,
1532 Evas_Object *obj EINA_UNUSED,
1535 Evas_Event_Mouse_Up *ev = event_info;
1536 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1537 elm_widget_focus_mouse_up_handle(data);
1541 _win_img_focus_in(void *data,
1542 Evas *e EINA_UNUSED,
1543 Evas_Object *obj EINA_UNUSED,
1544 void *event_info EINA_UNUSED)
1546 elm_widget_focus_steal(data);
1550 _win_img_focus_out(void *data,
1551 Evas *e EINA_UNUSED,
1552 Evas_Object *obj EINA_UNUSED,
1553 void *event_info EINA_UNUSED)
1555 elm_widget_focused_object_clear(data);
1559 _elm_win_on_img_obj_del(void *data,
1560 Evas *e EINA_UNUSED,
1561 Evas_Object *obj EINA_UNUSED,
1562 void *event_info EINA_UNUSED)
1564 ELM_WIN_DATA_GET(data, sd);
1565 _elm_win_img_callbacks_del(sd->obj, sd->img_obj);
1570 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
1572 evas_object_event_callback_del_full
1573 (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1574 evas_object_event_callback_del_full
1575 (imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
1576 evas_object_event_callback_del_full
1577 (imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
1578 evas_object_event_callback_del_full
1579 (imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
1580 evas_object_event_callback_del_full
1581 (imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
1585 _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
1588 Evas_Object *current;
1590 if ((sd->modal) && (evas_object_visible_get(obj)))
1592 DECREMENT_MODALITY()
1595 if ((sd->modal) && (sd->modal_count > 0))
1596 ERR("Deleted modal win was blocked by another modal win which was created after creation of that win.");
1598 evas_object_event_callback_del_full(sd->layout,
1599 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1600 _elm_win_on_resize_obj_changed_size_hints,
1602 evas_object_del(sd->box);
1603 evas_object_del(sd->layout);
1605 /* NB: child deletion handled by parent's smart del */
1607 if ((trap) && (trap->del))
1608 trap->del(sd->trap_data, obj);
1612 evas_object_event_callback_del_full
1613 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
1617 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1619 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1621 _elm_win_state_eval_queue();
1625 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1626 ecore_evas_callback_resize_set(sd->ee, NULL);
1629 ecore_job_del(sd->deferred_resize_job);
1630 ecore_job_del(sd->deferred_child_eval_job);
1631 eina_stringshare_del(sd->shot.info);
1632 ecore_timer_del(sd->shot.timer);
1634 #ifdef HAVE_ELEMENTARY_X
1635 ecore_event_handler_del(sd->x.client_message_handler);
1636 ecore_event_handler_del(sd->x.property_handler);
1641 _elm_win_img_callbacks_del(obj, sd->img_obj);
1648 ecore_job_add(_deferred_ecore_evas_free, sd->ee);
1649 _elm_win_deferred_free++;
1653 _elm_win_focus_highlight_shutdown(sd);
1654 eina_stringshare_del(sd->focus_highlight.style);
1656 eina_stringshare_del(sd->title);
1657 eina_stringshare_del(sd->icon_name);
1658 eina_stringshare_del(sd->role);
1659 evas_object_del(sd->icon);
1660 evas_object_del(sd->main_menu);
1662 _elm_win_profile_del(sd);
1663 _elm_win_available_profiles_del(sd);
1665 /* Don't let callback in the air that point to sd */
1666 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1667 ecore_evas_callback_resize_set(sd->ee, NULL);
1668 ecore_evas_callback_mouse_in_set(sd->ee, NULL);
1669 ecore_evas_callback_focus_in_set(sd->ee, NULL);
1670 ecore_evas_callback_focus_out_set(sd->ee, NULL);
1671 ecore_evas_callback_move_set(sd->ee, NULL);
1672 ecore_evas_callback_state_change_set(sd->ee, NULL);
1674 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1676 if ((!_elm_win_list) &&
1677 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
1679 edje_file_cache_flush();
1680 edje_collection_cache_flush();
1681 evas_image_cache_flush(evas_object_evas_get(obj));
1682 evas_font_cache_flush(evas_object_evas_get(obj));
1688 _elm_win_obj_intercept_show(void *data,
1691 ELM_WIN_DATA_GET(data, sd);
1693 // this is called to make sure all smart containers have calculated their
1694 // sizes BEFORE we show the window to make sure it initially appears at
1695 // our desired size (ie min size is known first)
1696 evas_smart_objects_calculate(evas_object_evas_get(obj));
1699 evas_object_show(sd->frame_obj);
1703 evas_object_show(sd->img_obj);
1705 if (sd->pointer.obj)
1707 ecore_evas_show(sd->pointer.ee);
1708 evas_object_show(sd->pointer.obj);
1710 evas_object_show(obj);
1714 _elm_win_evas_object_smart_move(Eo *obj, Elm_Win_Data *sd, Evas_Coord x, Evas_Coord y)
1718 if ((x != sd->screen.x) || (y != sd->screen.y))
1722 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1728 TRAP(sd, move, x, y);
1729 if (!ecore_evas_override_get(sd->ee)) return;
1732 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
1734 if (ecore_evas_override_get(sd->ee))
1738 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1742 /* FIXME: We should update ecore_wl_window_location here !! */
1754 _elm_win_evas_object_smart_resize(Eo *obj, Elm_Win_Data *sd, Evas_Coord w, Evas_Coord h)
1756 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
1764 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
1771 evas_object_image_size_set(sd->img_obj, w, h);
1774 TRAP(sd, resize, w, h);
1778 _elm_win_delete_request(Ecore_Evas *ee)
1780 Elm_Win_Data *sd = _elm_win_associate_get(ee);
1787 int autodel = sd->autodel;
1788 sd->autodel_clear = &autodel;
1789 evas_object_ref(obj);
1790 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL);
1791 // FIXME: if above callback deletes - then the below will be invalid
1792 if (autodel) evas_object_del(obj);
1793 else sd->autodel_clear = NULL;
1794 evas_object_unref(obj);
1798 _elm_ee_xwin_get(const Ecore_Evas *ee)
1800 #ifdef HAVE_ELEMENTARY_X
1801 const char *engine_name;
1804 engine_name = ecore_evas_engine_name_get(ee);
1805 if (EINA_UNLIKELY(!engine_name)) return 0;
1807 if (!strcmp(engine_name, ELM_SOFTWARE_X11))
1809 return ecore_evas_software_x11_window_get(ee);
1811 else if (!strcmp(engine_name, ELM_OPENGL_X11))
1813 return ecore_evas_gl_x11_window_get(ee);
1821 #ifdef HAVE_ELEMENTARY_X
1823 _internal_elm_win_xwindow_get(Elm_Win_Data *sd)
1825 sd->x.xwin = _elm_ee_xwin_get(sd->ee);
1830 _elm_ee_wlwin_get(const Ecore_Evas *ee)
1832 #ifdef HAVE_ELEMENTARY_WAYLAND
1833 const char *engine_name;
1835 if (!ee) return NULL;
1837 engine_name = ecore_evas_engine_name_get(ee);
1838 if (EINA_UNLIKELY(!engine_name)) return NULL;
1840 if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
1841 (!strcmp(engine_name, ELM_WAYLAND_EGL)))
1843 return ecore_evas_wayland_window_get(ee);
1851 #ifdef HAVE_ELEMENTARY_WAYLAND
1853 _elm_win_wlwindow_get(Elm_Win_Data *sd)
1855 sd->wl.win = _elm_ee_wlwin_get(sd->ee);
1859 #ifdef HAVE_ELEMENTARY_X
1861 _elm_win_xwin_update(Elm_Win_Data *sd)
1865 _internal_elm_win_xwindow_get(sd);
1868 ELM_WIN_DATA_GET(sd->parent, sdp);
1872 ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin);
1876 if (!sd->x.xwin) return; /* nothing more to do */
1879 if (!s) s = _elm_appname;
1881 if (sd->icon_name) s = sd->icon_name;
1882 ecore_x_icccm_icon_name_set(sd->x.xwin, s);
1883 ecore_x_netwm_icon_name_set(sd->x.xwin, s);
1886 if (s) ecore_x_icccm_window_role_set(sd->x.xwin, s);
1893 data = evas_object_image_data_get(sd->icon, EINA_FALSE);
1897 int w = 0, h = 0, stride, x, y;
1901 evas_object_image_size_get(sd->icon, &w, &h);
1902 stride = evas_object_image_stride_get(sd->icon);
1903 if ((w > 0) && (h > 0) &&
1904 (stride >= (int)(w * sizeof(unsigned int))))
1908 ic.data = malloc(w * h * sizeof(unsigned int));
1912 p = (unsigned char *)data;
1913 p2 = (unsigned int *)ic.data;
1914 for (y = 0; y < h; y++)
1916 for (x = 0; x < w; x++)
1918 *p2 = *((unsigned int *)p);
1919 p += sizeof(unsigned int);
1922 p += (stride - (w * sizeof(unsigned int)));
1924 ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
1928 evas_object_image_data_set(sd->icon, data);
1935 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_NORMAL);
1938 case ELM_WIN_DIALOG_BASIC:
1939 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DIALOG);
1942 case ELM_WIN_DESKTOP:
1943 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
1947 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DOCK);
1950 case ELM_WIN_TOOLBAR:
1951 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
1955 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_MENU);
1958 case ELM_WIN_UTILITY:
1959 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_UTILITY);
1962 case ELM_WIN_SPLASH:
1963 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_SPLASH);
1966 case ELM_WIN_DROPDOWN_MENU:
1967 ecore_x_netwm_window_type_set
1968 (sd->x.xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
1971 case ELM_WIN_POPUP_MENU:
1972 ecore_x_netwm_window_type_set
1973 (sd->x.xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
1976 case ELM_WIN_TOOLTIP:
1977 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
1980 case ELM_WIN_NOTIFICATION:
1981 ecore_x_netwm_window_type_set
1982 (sd->x.xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
1986 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_COMBO);
1990 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DND);
1996 ecore_x_e_virtual_keyboard_state_set
1997 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
1998 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
1999 ecore_x_e_illume_indicator_state_set
2000 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
2001 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
2002 ecore_x_e_illume_indicator_state_set
2003 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
2011 * Resize the window according to window layout's min and weight.
2012 * If the window layout's weight is 0.0, the window max is limited to layout's
2015 * This is called when the window layout's weight hint is changed or when the
2016 * window is rotated.
2018 * @param obj window object
2021 _elm_win_resize_objects_eval(Evas_Object *obj)
2023 ELM_WIN_DATA_GET(obj, sd);
2024 Evas_Coord w, h, minw, minh, maxw, maxh;
2027 evas_object_size_hint_min_get(sd->layout, &minw, &minh);
2028 if (minw < 1) minw = 1;
2029 if (minh < 1) minh = 1;
2031 evas_object_size_hint_weight_get(sd->layout, &wx, &wy);
2032 if (!wx) maxw = minw;
2034 if (!wy) maxh = minh;
2037 evas_object_size_hint_min_set(obj, minw, minh);
2038 evas_object_size_hint_max_set(obj, maxw, maxh);
2039 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
2040 if (w < minw) w = minw;
2041 if (h < minh) h = minh;
2042 if (w > maxw) w = maxw;
2043 if (h > maxh) h = maxh;
2044 evas_object_resize(obj, w, h);
2048 _elm_win_on_resize_obj_changed_size_hints(void *data,
2049 Evas *e EINA_UNUSED,
2050 Evas_Object *obj EINA_UNUSED,
2051 void *event_info EINA_UNUSED)
2053 _elm_win_resize_objects_eval(data);
2057 _elm_win_shutdown(void)
2059 while (_elm_win_list) evas_object_del(_elm_win_list->data);
2060 ELM_SAFE_FREE(_elm_win_state_eval_job, ecore_job_del);
2064 _elm_win_rescale(Elm_Theme *th,
2065 Eina_Bool use_theme)
2072 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2073 elm_widget_theme(obj);
2077 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2078 elm_widget_theme_specific(obj, th, EINA_FALSE);
2083 _elm_win_access(Eina_Bool is_access)
2090 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2092 elm_widget_access(obj, is_access);
2094 /* floating orphan object. if there are A, B, C objects and user does
2095 as below, then there would be floating orphan objects.
2097 1. elm_object_content_set(layout, A);
2098 2. elm_object_content_set(layout, B);
2099 3. elm_object_content_set(layout, C);
2101 now, the object A and B are floating orphan objects */
2106 fobj = evas_object_below_get(fobj);
2109 if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
2111 elm_widget_access(fobj, is_access);
2117 evas = evas_object_evas_get(obj);
2118 if (evas) _elm_access_object_highlight_disable(evas);
2124 _elm_win_translate(void)
2129 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2130 elm_widget_translate(obj);
2133 #ifdef HAVE_ELEMENTARY_X
2135 _elm_win_client_message(void *data,
2136 int type EINA_UNUSED,
2139 ELM_WIN_DATA_GET(data, sd);
2140 Ecore_X_Event_Client_Message *e = event;
2142 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
2143 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
2145 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2147 Evas *evas = evas_object_evas_get(sd->obj);
2150 edje_file_cache_flush();
2151 edje_collection_cache_flush();
2152 evas_image_cache_flush(evas);
2153 evas_font_cache_flush(evas);
2157 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
2159 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2161 Evas *evas = evas_object_evas_get(sd->obj);
2164 edje_file_cache_flush();
2165 edje_collection_cache_flush();
2166 evas_image_cache_flush(evas);
2167 evas_font_cache_flush(evas);
2168 evas_render_dump(evas);
2172 else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
2174 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2176 if ((unsigned int)e->data.l[1] ==
2177 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
2179 // XXX: call right access func
2181 else if ((unsigned int)e->data.l[1] ==
2182 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV)
2184 // XXX: call right access func
2186 else if ((unsigned int)e->data.l[1] ==
2187 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
2189 _elm_access_highlight_object_activate
2190 (sd->obj, ELM_ACTIVATE_DEFAULT);
2192 else if ((unsigned int)e->data.l[1] ==
2193 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
2195 /* there would be better way to read highlight object */
2197 evas = evas_object_evas_get(sd->obj);
2198 if (!evas) return ECORE_CALLBACK_PASS_ON;
2200 _elm_access_mouse_event_enabled_set(EINA_TRUE);
2202 evas_event_feed_mouse_in(evas, 0, NULL);
2203 evas_event_feed_mouse_move
2204 (evas, e->data.l[2], e->data.l[3], 0, NULL);
2206 _elm_access_mouse_event_enabled_set(EINA_FALSE);
2208 else if ((unsigned int)e->data.l[1] ==
2209 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
2211 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
2213 else if ((unsigned int)e->data.l[1] ==
2214 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
2216 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
2218 else if ((unsigned int)e->data.l[1] ==
2219 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
2221 _elm_access_highlight_object_activate
2222 (sd->obj, ELM_ACTIVATE_UP);
2224 else if ((unsigned int)e->data.l[1] ==
2225 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
2227 _elm_access_highlight_object_activate
2228 (sd->obj, ELM_ACTIVATE_DOWN);
2232 return ECORE_CALLBACK_PASS_ON;
2236 _elm_win_property_change(void *data,
2237 int type EINA_UNUSED,
2240 ELM_WIN_DATA_GET(data, sd);
2241 Ecore_X_Event_Window_Property *e = event;
2243 if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE)
2245 if (e->win == sd->x.xwin)
2247 sd->indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win);
2248 evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
2251 return ECORE_CALLBACK_PASS_ON;
2256 _elm_win_focus_highlight_hide(void *data EINA_UNUSED,
2258 const char *emission EINA_UNUSED,
2259 const char *source EINA_UNUSED)
2261 evas_object_hide(obj);
2265 _elm_win_focus_highlight_anim_end(void *data,
2267 const char *emission EINA_UNUSED,
2268 const char *source EINA_UNUSED)
2270 ELM_WIN_DATA_GET(data, sd);
2272 _elm_win_focus_highlight_simple_setup(sd, obj);
2276 _elm_win_focus_highlight_init(Elm_Win_Data *sd)
2278 evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
2279 _elm_win_object_focus_in, sd->obj);
2280 evas_event_callback_add(sd->evas,
2281 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
2282 _elm_win_object_focus_out, sd->obj);
2284 sd->focus_highlight.cur.target = NULL;
2285 sd->focus_highlight.fobj = edje_object_add(sd->evas);
2286 sd->focus_highlight.theme_changed = EINA_TRUE;
2288 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2289 "elm,action,focus,hide,end", "*",
2290 _elm_win_focus_highlight_hide, NULL);
2291 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2292 "elm,action,focus,anim,end", "*",
2293 _elm_win_focus_highlight_anim_end, sd->obj);
2294 _elm_win_focus_highlight_reconfigure_job_start(sd);
2298 _elm_win_frame_cb_move_start(void *data,
2299 Evas_Object *obj EINA_UNUSED,
2300 const char *sig EINA_UNUSED,
2303 ELM_WIN_DATA_GET(data, sd);
2307 #ifdef HAVE_ELEMENTARY_WAYLAND
2308 if (!strcmp(source, "elm"))
2309 ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_HAND1);
2311 ecore_wl_window_cursor_default_restore(sd->wl.win);
2316 /* NB: Wayland handles moving surfaces by itself so we cannot
2317 * specify a specific x/y we want. Instead, we will pass in the
2318 * existing x/y values so they can be recorded as 'previous'
2319 * position. The new position will get updated automatically when
2320 * the move is finished */
2322 ecore_evas_wayland_move(sd->ee, sd->screen.x, sd->screen.y);
2326 _elm_win_frame_cb_move_stop(void *data,
2327 Evas_Object *obj EINA_UNUSED,
2328 const char *sig EINA_UNUSED,
2329 const char *source EINA_UNUSED)
2331 ELM_WIN_DATA_GET(data, sd);
2335 #ifdef HAVE_ELEMENTARY_WAYLAND
2336 ecore_wl_window_cursor_default_restore(sd->wl.win);
2340 #ifdef HAVE_ELEMENTARY_WAYLAND
2347 static struct _resize_info _border_side[4] =
2349 { ELM_CURSOR_TOP_SIDE, 1 },
2350 { ELM_CURSOR_LEFT_SIDE, 4 },
2351 { ELM_CURSOR_BOTTOM_SIDE, 2 },
2352 { ELM_CURSOR_RIGHT_SIDE, 8 },
2355 static struct _resize_info _border_corner[4] =
2357 { ELM_CURSOR_TOP_LEFT_CORNER, 5 },
2358 { ELM_CURSOR_BOTTOM_LEFT_CORNER, 6 },
2359 { ELM_CURSOR_BOTTOM_RIGHT_CORNER, 10 },
2360 { ELM_CURSOR_TOP_RIGHT_CORNER, 9 },
2365 _elm_win_frame_obj_update(Elm_Win_Data *sd)
2371 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
2372 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2373 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2375 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2377 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2378 (w != (fw - ow)) || (h != (fh - oh)))
2380 evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
2381 (fw - ow), (fh - oh));
2384 #ifdef HAVE_ELEMENTARY_WAYLAND
2385 ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
2390 _elm_win_frame_obj_move(void *data,
2391 Evas *e EINA_UNUSED,
2392 Evas_Object *obj EINA_UNUSED,
2393 void *event_info EINA_UNUSED)
2397 if (!(sd = data)) return;
2398 if (!sd->client_obj) return;
2400 _elm_win_frame_obj_update(sd);
2404 _elm_win_frame_obj_resize(void *data,
2405 Evas *e EINA_UNUSED,
2406 Evas_Object *obj EINA_UNUSED,
2407 void *event_info EINA_UNUSED)
2411 if (!(sd = data)) return;
2412 if (!sd->client_obj) return;
2414 _elm_win_frame_obj_update(sd);
2418 _elm_win_frame_cb_resize_show(void *data,
2419 Evas_Object *obj EINA_UNUSED,
2420 const char *sig EINA_UNUSED,
2423 ELM_WIN_DATA_GET(data, sd);
2426 if (sd->resizing) return;
2428 #ifdef HAVE_ELEMENTARY_WAYLAND
2431 if (!strcmp(source, "elm.event.resize.t"))
2432 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2433 _border_side[(0 + i) % 4].name);
2434 else if (!strcmp(source, "elm.event.resize.b"))
2435 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2436 _border_side[(2 + i) % 4].name);
2437 else if (!strcmp(source, "elm.event.resize.l"))
2438 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2439 _border_side[(1 + i) % 4].name);
2440 else if (!strcmp(source, "elm.event.resize.r"))
2441 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2442 _border_side[(3 + i) % 4].name);
2443 else if (!strcmp(source, "elm.event.resize.tl"))
2444 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2445 _border_corner[(0 + i) % 4].name);
2446 else if (!strcmp(source, "elm.event.resize.tr"))
2447 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2448 _border_corner[(3 + i) % 4].name);
2449 else if (!strcmp(source, "elm.event.resize.bl"))
2450 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2451 _border_corner[(1 + i) % 4].name);
2452 else if (!strcmp(source, "elm.event.resize.br"))
2453 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2454 _border_corner[(2 + i) % 4].name);
2456 ecore_wl_window_cursor_default_restore(sd->wl.win);
2463 _elm_win_frame_cb_resize_hide(void *data,
2464 Evas_Object *obj EINA_UNUSED,
2465 const char *sig EINA_UNUSED,
2466 const char *source EINA_UNUSED)
2468 ELM_WIN_DATA_GET(data, sd);
2471 if (sd->resizing) return;
2473 #ifdef HAVE_ELEMENTARY_WAYLAND
2474 ecore_wl_window_cursor_default_restore(sd->wl.win);
2479 _elm_win_frame_cb_resize_start(void *data,
2480 Evas_Object *obj EINA_UNUSED,
2481 const char *sig EINA_UNUSED,
2484 #ifdef HAVE_ELEMENTARY_WAYLAND
2485 ELM_WIN_DATA_GET(data, sd);
2489 if (sd->resizing) return;
2491 sd->resizing = EINA_TRUE;
2493 if (!strcmp(source, "elm.event.resize.t"))
2494 sd->resize_location = _border_side[(0 + i) % 4].location;
2495 else if (!strcmp(source, "elm.event.resize.b"))
2496 sd->resize_location = _border_side[(2 + i) % 4].location;
2497 else if (!strcmp(source, "elm.event.resize.l"))
2498 sd->resize_location = _border_side[(1 + i) % 4].location;
2499 else if (!strcmp(source, "elm.event.resize.r"))
2500 sd->resize_location = _border_side[(3 + i) % 4].location;
2501 else if (!strcmp(source, "elm.event.resize.tl"))
2502 sd->resize_location = _border_corner[(0 + i) % 4].location;
2503 else if (!strcmp(source, "elm.event.resize.tr"))
2504 sd->resize_location = _border_corner[(3 + i) % 4].location;
2505 else if (!strcmp(source, "elm.event.resize.bl"))
2506 sd->resize_location = _border_corner[(1 + i) % 4].location;
2507 else if (!strcmp(source, "elm.event.resize.br"))
2508 sd->resize_location = _border_corner[(2 + i) % 4].location;
2510 sd->resize_location = 0;
2512 if (sd->resize_location > 0)
2513 ecore_evas_wayland_resize(sd->ee, sd->resize_location);
2521 _elm_win_frame_cb_minimize(void *data,
2522 Evas_Object *obj EINA_UNUSED,
2523 const char *sig EINA_UNUSED,
2524 const char *source EINA_UNUSED)
2526 ELM_WIN_DATA_GET(data, sd);
2529 // sd->iconified = EINA_TRUE;
2530 TRAP(sd, iconified_set, EINA_TRUE);
2534 _elm_win_frame_maximized_state_update(Elm_Win_Data *sd, Eina_Bool maximized)
2536 const char *emission;
2539 emission = "elm,state,maximized";
2541 emission = "elm,state,unmaximized";
2543 edje_object_signal_emit(sd->frame_obj, emission, "elm");
2544 edje_object_message_signal_process(sd->frame_obj);
2545 evas_object_smart_calculate(sd->frame_obj);
2547 _elm_win_frame_obj_update(sd);
2551 _elm_win_frame_cb_maximize(void *data,
2552 Evas_Object *obj EINA_UNUSED,
2553 const char *sig EINA_UNUSED,
2554 const char *source EINA_UNUSED)
2557 ELM_WIN_DATA_GET(data, sd);
2560 if (sd->maximized) value = EINA_FALSE;
2561 else value = EINA_TRUE;
2563 _elm_win_frame_maximized_state_update(sd, value);
2565 TRAP(sd, maximized_set, value);
2569 _elm_win_frame_cb_close(void *data,
2570 Evas_Object *obj EINA_UNUSED,
2571 const char *sig EINA_UNUSED,
2572 const char *source EINA_UNUSED)
2574 ELM_WIN_DATA_GET(data, sd);
2577 /* FIXME: After the current freeze, this should be handled differently.
2579 * Ideally, we would want to mimic the X11 backend and use something
2580 * like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
2581 * inside of ecore_evas. That would be the 'proper' way, but since we are
2582 * in a freeze right now, I cannot add a new event value, or a new
2583 * event structure to ecore_wayland.
2585 * So yes, this is a temporary 'stop-gap' solution which will be fixed
2586 * when the freeze is over, but it does fix a trac bug for now, and in a
2587 * way which does not break API or the freeze. - dh
2594 int autodel = sd->autodel;
2595 sd->autodel_clear = &autodel;
2596 evas_object_ref(win);
2597 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
2598 // FIXME: if above callback deletes - then the below will be invalid
2599 if (autodel) evas_object_del(win);
2600 else sd->autodel_clear = NULL;
2601 evas_object_unref(win);
2605 _elm_win_frame_add(Elm_Win_Data *sd,
2608 Evas_Object *obj = sd->obj;
2612 sd->frame_obj = edje_object_add(sd->evas);
2613 layer = evas_object_layer_get(obj);
2614 evas_object_layer_set(sd->frame_obj, layer + 1);
2615 if (!elm_widget_theme_object_set
2616 (sd->obj, sd->frame_obj, "border", "base", style))
2618 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2622 sd->spacer_obj = evas_object_rectangle_add(sd->evas);
2623 evas_object_color_set(sd->spacer_obj, 0, 0, 0, 0);
2624 evas_object_repeat_events_set(sd->spacer_obj, EINA_TRUE);
2625 edje_object_part_swallow(sd->frame_obj, "elm.swallow.frame_spacer",
2628 sd->client_obj = evas_object_rectangle_add(sd->evas);
2629 evas_object_color_set(sd->client_obj, 0, 0, 0, 0);
2630 /* NB: Tried pass_events here, but that fails to send events */
2631 evas_object_repeat_events_set(sd->client_obj, EINA_TRUE);
2632 edje_object_part_swallow(sd->frame_obj, "elm.swallow.client",
2635 evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
2637 evas_object_event_callback_add
2638 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2639 evas_object_event_callback_add
2640 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2642 /* NB: Do NOT remove these calls !! Needed to calculate proper
2643 * framespace on inital show of the window */
2644 edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
2645 evas_object_move(sd->frame_obj, 0, 0);
2646 evas_object_resize(sd->frame_obj, mw, mh);
2647 evas_object_smart_calculate(sd->frame_obj);
2649 edje_object_signal_callback_add
2650 (sd->frame_obj, "elm,action,move,start", "elm",
2651 _elm_win_frame_cb_move_start, obj);
2652 edje_object_signal_callback_add
2653 (sd->frame_obj, "elm,action,move,stop", "elm",
2654 _elm_win_frame_cb_move_stop, obj);
2655 edje_object_signal_callback_add
2656 (sd->frame_obj, "elm,action,resize,show", "*",
2657 _elm_win_frame_cb_resize_show, obj);
2658 edje_object_signal_callback_add
2659 (sd->frame_obj, "elm,action,resize,hide", "*",
2660 _elm_win_frame_cb_resize_hide, obj);
2661 edje_object_signal_callback_add
2662 (sd->frame_obj, "elm,action,resize,start", "*",
2663 _elm_win_frame_cb_resize_start, obj);
2664 edje_object_signal_callback_add
2665 (sd->frame_obj, "elm,action,minimize", "elm",
2666 _elm_win_frame_cb_minimize, obj);
2667 edje_object_signal_callback_add
2668 (sd->frame_obj, "elm,action,maximize", "elm",
2669 _elm_win_frame_cb_maximize, obj);
2670 edje_object_signal_callback_add
2671 (sd->frame_obj, "elm,action,close", "elm", _elm_win_frame_cb_close, obj);
2675 edje_object_part_text_escaped_set
2676 (sd->frame_obj, "elm.text.title", sd->title);
2679 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2680 ecore_evas_resize(sd->ee, w, h);
2684 _elm_win_frame_del(Elm_Win_Data *sd)
2688 ELM_SAFE_FREE(sd->client_obj, evas_object_del);
2692 evas_object_event_callback_del_full
2693 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2694 evas_object_event_callback_del_full
2695 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2697 edje_object_signal_callback_del
2698 (sd->frame_obj, "elm,action,move,start", "elm",
2699 _elm_win_frame_cb_move_start);
2700 edje_object_signal_callback_del
2701 (sd->frame_obj, "elm,action,move,stop", "elm",
2702 _elm_win_frame_cb_move_stop);
2703 edje_object_signal_callback_del
2704 (sd->frame_obj, "elm,action,resize,show", "*",
2705 _elm_win_frame_cb_resize_show);
2706 edje_object_signal_callback_del
2707 (sd->frame_obj, "elm,action,resize,hide", "*",
2708 _elm_win_frame_cb_resize_hide);
2709 edje_object_signal_callback_del
2710 (sd->frame_obj, "elm,action,resize,start", "*",
2711 _elm_win_frame_cb_resize_start);
2712 edje_object_signal_callback_del
2713 (sd->frame_obj, "elm,action,minimize", "elm",
2714 _elm_win_frame_cb_minimize);
2715 edje_object_signal_callback_del
2716 (sd->frame_obj, "elm,action,maximize", "elm",
2717 _elm_win_frame_cb_maximize);
2718 edje_object_signal_callback_del
2719 (sd->frame_obj, "elm,action,close", "elm",
2720 _elm_win_frame_cb_close);
2722 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2725 evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
2726 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2727 ecore_evas_resize(sd->ee, w, h);
2732 _debug_key_down(void *data EINA_UNUSED,
2733 Evas *e EINA_UNUSED,
2737 Evas_Event_Key_Down *ev = event_info;
2739 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
2742 if ((strcmp(ev->key, "F12")) ||
2743 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
2746 INF("Tree graph generated.");
2747 elm_object_tree_dot_dump(obj, "./dump.dot");
2753 _win_inlined_image_set(Elm_Win_Data *sd)
2755 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);
2756 evas_object_image_filled_set(sd->img_obj, EINA_TRUE);
2758 evas_object_event_callback_add
2759 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, sd->obj);
2760 evas_object_event_callback_add
2761 (sd->img_obj, EVAS_CALLBACK_HIDE, _win_img_hide, sd->obj);
2762 evas_object_event_callback_add
2763 (sd->img_obj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, sd->obj);
2764 evas_object_event_callback_add
2765 (sd->img_obj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, sd->obj);
2766 evas_object_event_callback_add
2767 (sd->img_obj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, sd->obj);
2771 _elm_win_on_icon_del(void *data,
2772 Evas *e EINA_UNUSED,
2774 void *event_info EINA_UNUSED)
2776 ELM_WIN_DATA_GET(data, sd);
2778 if (sd->icon == obj) sd->icon = NULL;
2782 _elm_win_evas_object_smart_add(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED)
2784 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
2786 elm_widget_can_focus_set(obj, EINA_TRUE);
2788 elm_widget_highlight_ignore_set(obj, EINA_TRUE);
2791 #ifdef HAVE_ELEMENTARY_X
2793 _elm_x_io_err(void *data EINA_UNUSED)
2798 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2799 evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
2805 elm_win_add(Evas_Object *parent,
2809 Evas_Object *obj = eo_add_custom(MY_CLASS, parent, elm_obj_win_constructor(name, type));
2815 _elm_win_cb_hide(void *data EINA_UNUSED,
2816 Evas *e EINA_UNUSED,
2817 Evas_Object *obj EINA_UNUSED,
2818 void *event_info EINA_UNUSED)
2820 _elm_win_state_eval_queue();
2824 _elm_win_cb_show(void *data EINA_UNUSED,
2825 Evas *e EINA_UNUSED,
2826 Evas_Object *obj EINA_UNUSED,
2827 void *event_info EINA_UNUSED)
2829 _elm_win_state_eval_queue();
2835 * Recalculate the size of window considering its resize objects' weight and
2836 * min size. If any of its resize objects' weight equals to 0.0, window
2837 * layout's weight will be set to 0.0.
2839 * @param o box object
2840 * @param p box's private data
2841 * @param data window object
2844 _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
2848 Evas_Object_Box_Option *opt;
2849 Evas_Coord x, y, w, h;
2851 Evas_Coord minw = -1, minh = -1;
2852 double weight_x = EVAS_HINT_EXPAND;
2853 double weight_y = EVAS_HINT_EXPAND;
2855 EINA_LIST_FOREACH(p->children, l, opt)
2858 evas_object_size_hint_weight_get(child, &wx, &wy);
2859 if (wx == 0.0) weight_x = 0;
2860 if (wy == 0.0) weight_y = 0;
2862 evas_object_size_hint_min_get(child, &w, &h);
2863 if (w > minw) minw = w;
2864 if (h > minh) minh = h;
2867 evas_object_size_hint_min_set(o, minw, minh);
2868 evas_object_geometry_get(o, &x, &y, &w, &h);
2869 if (w < minw) w = minw;
2870 if (h < minh) h = minh;
2871 evas_object_resize(o, w, h);
2873 EINA_LIST_FOREACH(p->children, l, opt)
2876 evas_object_move(child, x, y);
2877 evas_object_resize(child, w, h);
2880 ELM_WIN_DATA_GET(data, sd);
2881 evas_object_size_hint_weight_set(sd->layout, weight_x, weight_y);
2882 evas_object_smart_changed(sd->layout);
2888 const char *env = NULL;
2891 str = _elm_accel_preference;
2892 env = getenv("ELM_ACCEL");
2895 ((!strcasecmp(str, "gl")) ||
2896 (!strcasecmp(str, "opengl")) ||
2897 (!strcasecmp(str, "3d")) ||
2898 (!strcasecmp(str, "hw")) ||
2899 (!strcasecmp(str, "accel")) ||
2900 (!strcasecmp(str, "hardware"))
2907 _elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type)
2909 sd->obj = obj; // in ctor
2911 Evas_Object *parent = NULL;
2914 const char *fontpath, *engine = NULL, *enginelist[32], *disp;
2917 Elm_Win_Data tmp_sd;
2919 eo_do(obj, parent = eo_parent_get());
2921 /* just to store some data while trying out to create a canvas */
2922 memset(&tmp_sd, 0, sizeof(Elm_Win_Data));
2926 case ELM_WIN_INLINED_IMAGE:
2929 e = evas_object_evas_get(parent);
2934 ee = ecore_evas_ecore_evas_get(e);
2937 tmp_sd.img_obj = ecore_evas_object_image_new(ee);
2938 if (!tmp_sd.img_obj) break;
2940 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
2943 ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
2948 case ELM_WIN_SOCKET_IMAGE:
2949 tmp_sd.ee = ecore_evas_extn_socket_new(1, 1);
2953 disp = getenv("ELM_DISPLAY");
2954 if ((disp) && (!strcmp(disp, "x11")))
2958 enginelist[0] = ELM_OPENGL_X11;
2959 enginelist[1] = ELM_SOFTWARE_X11;
2960 enginelist[2] = NULL;
2964 enginelist[0] = ELM_SOFTWARE_X11;
2965 enginelist[1] = ELM_OPENGL_X11;
2966 enginelist[2] = NULL;
2969 else if ((disp) && (!strcmp(disp, "wl")))
2973 enginelist[0] = ELM_WAYLAND_EGL;
2974 enginelist[1] = ELM_WAYLAND_SHM;
2975 enginelist[2] = NULL;
2979 enginelist[0] = ELM_WAYLAND_SHM;
2980 enginelist[1] = ELM_WAYLAND_EGL;
2981 enginelist[2] = NULL;
2984 else if ((disp) && (!strcmp(disp, "win")))
2986 enginelist[1] = ELM_SOFTWARE_WIN32;
2987 enginelist[2] = NULL;
2989 else if ((disp) && (!strcmp(disp, "sdl")))
2993 enginelist[0] = ELM_OPENGL_SDL;
2994 enginelist[1] = ELM_SOFTWARE_SDL;
2995 enginelist[2] = NULL;
2999 enginelist[0] = ELM_SOFTWARE_SDL;
3000 enginelist[1] = ELM_OPENGL_SDL;
3001 enginelist[2] = NULL;
3004 else if ((disp) && (!strcmp(disp, "mac")))
3006 enginelist[0] = ELM_OPENGL_COCOA;
3007 enginelist[1] = NULL;
3009 else if ((disp) && (!strcmp(disp, "ews")))
3011 enginelist[0] = ELM_EWS;
3012 enginelist[1] = NULL;
3014 else if ((disp) && (!strcmp(disp, "fb")))
3016 enginelist[0] = ELM_DRM;
3017 enginelist[1] = ELM_SOFTWARE_FB;
3018 enginelist[2] = NULL;
3020 else if ((disp) && (!strcmp(disp, "buffer")))
3022 enginelist[0] = ELM_BUFFER;
3023 enginelist[1] = NULL;
3025 else if ((disp) && (!strcmp(disp, "ps3")))
3027 enginelist[0] = ELM_SOFTWARE_PSL1GHT;
3028 enginelist[1] = NULL;
3030 else if ((disp) && (!strcmp(disp, "shot")))
3032 enginelist[0] = ENGINE_GET();
3033 enginelist[1] = NULL;
3039 enginelist[ 0] = ELM_OPENGL_X11;
3040 enginelist[ 1] = ELM_WAYLAND_EGL;
3041 enginelist[ 2] = ELM_DRM;
3042 enginelist[ 3] = ELM_SOFTWARE_FB;
3043 enginelist[ 4] = ELM_OPENGL_COCOA;
3044 enginelist[ 5] = ELM_OPENGL_SDL;
3045 enginelist[ 6] = ELM_SOFTWARE_X11;
3046 enginelist[ 7] = ELM_WAYLAND_SHM;
3047 enginelist[ 8] = ELM_SOFTWARE_SDL;
3048 enginelist[ 9] = ELM_SOFTWARE_PSL1GHT;
3049 enginelist[10] = NULL;
3053 enginelist[ 0] = ENGINE_GET();
3054 enginelist[ 1] = ELM_SOFTWARE_X11;
3055 enginelist[ 2] = ELM_WAYLAND_SHM;
3056 enginelist[ 3] = ELM_DRM;
3057 enginelist[ 4] = ELM_SOFTWARE_FB;
3058 enginelist[ 5] = ELM_OPENGL_COCOA;
3059 enginelist[ 6] = ELM_SOFTWARE_SDL;
3060 enginelist[ 7] = ELM_OPENGL_X11;
3061 enginelist[ 8] = ELM_WAYLAND_EGL;
3062 enginelist[ 9] = ELM_DRM;
3063 enginelist[10] = ELM_OPENGL_SDL;
3064 enginelist[11] = NULL;
3067 for (i = 0; i < 30; i++)
3069 if ((i > 0) && (!enginelist[i])) break;
3070 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
3071 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
3072 else if (!strcmp(enginelist[i], ELM_OPENGL_X11))
3074 int opt[10], opt_i = 0;
3076 if (_elm_config->vsync)
3078 opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_VSYNC;
3083 tmp_sd.ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt);
3085 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
3087 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
3088 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
3089 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
3090 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
3091 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
3092 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
3093 else if (!strcmp(enginelist[i], ELM_SOFTWARE_SDL))
3094 tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
3095 else if (!strcmp(enginelist[i], ELM_OPENGL_SDL))
3096 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
3097 else if (!strcmp(enginelist[i], ELM_OPENGL_COCOA))
3098 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
3099 else if (!strcmp(enginelist[i], ELM_EWS))
3100 tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
3101 else if (!strcmp(enginelist[i], ELM_SOFTWARE_FB))
3102 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
3103 else if (!strcmp(enginelist[i], ELM_BUFFER))
3104 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3105 else if (!strcmp(enginelist[i], ELM_SOFTWARE_PSL1GHT))
3106 tmp_sd.ee = ecore_evas_psl1ght_new(NULL, 1, 1);
3107 else if (!strcmp(enginelist[i], ELM_DRM))
3108 tmp_sd.ee = ecore_evas_drm_new(NULL, 0, 0, 0, 1, 1);
3109 else if (!strncmp(enginelist[i], "shot:", 5))
3111 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3112 ecore_evas_manual_render_set(tmp_sd.ee, EINA_TRUE);
3113 tmp_sd.shot.info = eina_stringshare_add(ENGINE_GET() + 5);
3115 engine = enginelist[i];
3116 if (tmp_sd.ee) break;
3123 ERR("Cannot create window.");
3128 eo_do(obj, eo_parent_set(ecore_evas_get(tmp_sd.ee)));
3129 eo_do_super(obj, MY_CLASS, eo_constructor());
3131 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
3132 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks));
3134 if (getenv("ELM_FIRST_FRAME"))
3135 evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
3136 _elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
3138 /* copying possibly altered fields back */
3139 #define SD_CPY(_field) \
3142 sd->_field = tmp_sd._field; \
3150 if ((trap) && (trap->add))
3151 sd->trap_data = trap->add(obj);
3153 /* complementary actions, which depend on final smart data
3155 if (type == ELM_WIN_INLINED_IMAGE)
3156 _win_inlined_image_set(sd);
3157 #ifdef HAVE_ELEMENTARY_X
3158 else if ((engine) &&
3159 ((!strcmp(engine, ELM_SOFTWARE_X11)) ||
3160 (!strcmp(engine, ELM_OPENGL_X11))))
3162 sd->x.client_message_handler = ecore_event_handler_add
3163 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, obj);
3164 sd->x.property_handler = ecore_event_handler_add
3165 (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
3168 else if ((engine) && (!strncmp(engine, "shot:", 5)))
3171 sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
3172 sd->indmode = ELM_WIN_INDICATOR_UNKNOWN;
3174 #ifdef HAVE_ELEMENTARY_X
3175 _internal_elm_win_xwindow_get(sd);
3178 ecore_x_io_error_handler_set(_elm_x_io_err, NULL);
3182 #ifdef HAVE_ELEMENTARY_WAYLAND
3183 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3184 _elm_win_wlwindow_get(sd);
3187 if ((_elm_config->bgpixmap)
3188 #ifdef HAVE_ELEMENTARY_X
3190 (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
3195 TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
3196 // bg pixmap done by x - has other issues like can be redrawn by x before it
3197 // is filled/ready by app
3198 // TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
3201 sd->parent = parent;
3202 sd->modal_count = 0;
3205 evas_object_event_callback_add
3206 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
3208 sd->evas = ecore_evas_get(sd->ee);
3210 evas_object_color_set(obj, 0, 0, 0, 0);
3211 evas_object_move(obj, 0, 0);
3212 evas_object_resize(obj, 1, 1);
3213 evas_object_layer_set(obj, 50);
3214 evas_object_pass_events_set(obj, EINA_TRUE);
3216 if (type == ELM_WIN_INLINED_IMAGE)
3217 elm_widget_parent2_set(obj, parent);
3219 /* use own version of ecore_evas_object_associate() that does TRAP() */
3220 ecore_evas_data_set(sd->ee, "elm_win", obj);
3222 evas_object_event_callback_add
3223 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3224 _elm_win_obj_callback_changed_size_hints, obj);
3226 evas_object_intercept_raise_callback_add
3227 (obj, _elm_win_obj_intercept_raise, obj);
3228 evas_object_intercept_lower_callback_add
3229 (obj, _elm_win_obj_intercept_lower, obj);
3230 evas_object_intercept_stack_above_callback_add
3231 (obj, _elm_win_obj_intercept_stack_above, obj);
3232 evas_object_intercept_stack_below_callback_add
3233 (obj, _elm_win_obj_intercept_stack_below, obj);
3234 evas_object_intercept_layer_set_callback_add
3235 (obj, _elm_win_obj_intercept_layer_set, obj);
3236 evas_object_intercept_show_callback_add
3237 (obj, _elm_win_obj_intercept_show, obj);
3239 TRAP(sd, name_class_set, name, _elm_appname);
3240 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
3241 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3242 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3243 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3244 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3245 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3246 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3247 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3248 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3250 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
3251 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
3253 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
3254 evas_font_path_append(sd->evas, fontpath);
3256 if (!_elm_config->font_hinting)
3257 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_NONE);
3258 else if (_elm_config->font_hinting == 1)
3259 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_AUTO);
3260 else if (_elm_config->font_hinting == 2)
3261 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_BYTECODE);
3263 #ifdef HAVE_ELEMENTARY_X
3264 _elm_win_xwin_update(sd);
3267 _elm_win_list = eina_list_append(_elm_win_list, obj);
3270 if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
3272 TRAP(sd, fullscreen_set, 1);
3274 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3276 ((!strcmp(engine, ELM_WAYLAND_SHM) ||
3277 (!strcmp(engine, ELM_WAYLAND_EGL))))))
3278 _elm_win_frame_add(sd, "default");
3280 if (_elm_config->focus_highlight_enable)
3281 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3282 if (_elm_config->focus_highlight_animate)
3283 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3286 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
3287 evas_object_event_callback_add
3288 (obj, EVAS_CALLBACK_KEY_DOWN, _debug_key_down, NULL);
3290 if (evas_object_key_grab(obj, "F12", mask, 0, EINA_TRUE))
3291 INF("Ctrl+F12 key combination exclusive for dot tree generation\n");
3293 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3296 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3297 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3299 ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
3302 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3304 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3305 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3306 edje_object_size_min_calc(o, &mw, &mh);
3307 evas_object_resize(o, mw, mh);
3308 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3309 &hx, &hy, NULL, NULL);
3310 sd->pointer.hot_x = hx;
3311 sd->pointer.hot_y = hy;
3312 evas_object_show(o);
3313 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3315 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3320 sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
3321 sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
3323 sd->layout = edje_object_add(sd->evas);
3324 _elm_theme_object_set(obj, sd->layout, "win", "base", "default");
3325 sd->box = evas_object_box_add(sd->evas);
3326 evas_object_box_layout_set(sd->box, _window_layout_stack, obj, NULL);
3327 edje_object_part_swallow(sd->layout, "elm.swallow.contents", sd->box);
3328 evas_object_move(sd->layout, 0, 0);
3329 evas_object_resize(sd->layout, 1, 1);
3330 edje_object_update_hints_set(sd->layout, EINA_TRUE);
3331 evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3332 _elm_win_on_resize_obj_changed_size_hints, obj);
3334 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
3336 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3337 elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_root_get(), obj);
3338 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL));
3341 evas_object_show(sd->layout);
3345 _elm_win_eo_base_constructor(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED)
3348 ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
3351 EOLIAN static Elm_Win_Type
3352 _elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3358 elm_win_util_standard_add(const char *name,
3361 Evas_Object *win, *bg;
3363 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
3364 if (!win) return NULL;
3366 elm_win_title_set(win, title);
3367 bg = elm_bg_add(win);
3370 evas_object_del(win);
3373 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3374 elm_win_resize_object_add(win, bg);
3375 evas_object_show(bg);
3381 _elm_win_resize_object_add(Eo *obj, Elm_Win_Data *sd, Evas_Object *subobj)
3383 elm_widget_sub_object_add(obj, subobj);
3385 if (!evas_object_box_append(sd->box, subobj))
3386 ERR("could not append %p to box", subobj);
3390 _elm_win_resize_object_del(Eo *obj, Elm_Win_Data *sd, Evas_Object *subobj)
3392 if (!elm_widget_sub_object_del(obj, subobj))
3393 ERR("could not remove sub object %p from %p", subobj, obj);
3395 evas_object_box_remove(sd->box, subobj);
3399 _elm_win_title_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *title)
3402 eina_stringshare_replace(&(sd->title), title);
3403 TRAP(sd, title_set, sd->title);
3405 edje_object_part_text_escaped_set
3406 (sd->frame_obj, "elm.text.title", sd->title);
3409 EOLIAN static const char*
3410 _elm_win_title_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3416 _elm_win_icon_name_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *icon_name)
3418 if (!icon_name) return;
3419 eina_stringshare_replace(&(sd->icon_name), icon_name);
3420 #ifdef HAVE_ELEMENTARY_X
3421 _elm_win_xwin_update(sd);
3425 EOLIAN static const char*
3426 _elm_win_icon_name_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3428 return sd->icon_name;
3432 _elm_win_role_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *role)
3435 eina_stringshare_replace(&(sd->role), role);
3436 #ifdef HAVE_ELEMENTARY_X
3437 _elm_win_xwin_update(sd);
3441 EOLIAN static const char*
3442 _elm_win_role_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3448 _elm_win_icon_object_set(Eo *obj, Elm_Win_Data *sd, Evas_Object *icon)
3451 evas_object_event_callback_del_full
3452 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3455 evas_object_event_callback_add
3456 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3457 #ifdef HAVE_ELEMENTARY_X
3458 _elm_win_xwin_update(sd);
3462 EOLIAN static const Evas_Object*
3463 _elm_win_icon_object_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3469 _elm_win_autodel_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool autodel)
3471 sd->autodel = autodel;
3474 EOLIAN static Eina_Bool
3475 _elm_win_autodel_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3481 _elm_win_activate(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3487 _elm_win_lower(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3493 _elm_win_raise(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3499 _elm_win_center(Eo *obj, Elm_Win_Data *sd, Eina_Bool h, Eina_Bool v)
3501 int win_w, win_h, screen_w, screen_h, nx, ny;
3503 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
3506 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &screen_w, &screen_h);
3507 if ((!screen_w) || (!screen_h)) return;
3509 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
3510 if ((!win_w) || (!win_h)) return;
3512 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
3513 else nx = sd->screen.x;
3514 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
3515 else ny = sd->screen.y;
3519 evas_object_move(obj, nx, ny);
3523 _elm_win_borderless_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool borderless)
3525 Eina_Bool need_frame = EINA_FALSE;
3527 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3528 need_frame = engine_name &&
3529 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3530 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3533 need_frame = !sd->fullscreen;
3538 _elm_win_frame_del(sd);
3543 _elm_win_frame_add(sd, "default");
3546 evas_object_show(sd->frame_obj);
3549 TRAP(sd, borderless_set, borderless);
3550 #ifdef HAVE_ELEMENTARY_X
3551 _elm_win_xwin_update(sd);
3555 EOLIAN static Eina_Bool
3556 _elm_win_borderless_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3558 return ecore_evas_borderless_get(sd->ee);
3562 _elm_win_shaped_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool shaped)
3564 TRAP(sd, shaped_set, shaped);
3565 #ifdef HAVE_ELEMENTARY_X
3566 _elm_win_xwin_update(sd);
3570 EOLIAN static Eina_Bool
3571 _elm_win_shaped_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3573 return ecore_evas_shaped_get(sd->ee);
3577 _elm_win_alpha_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool enabled)
3581 evas_object_image_alpha_set(sd->img_obj, enabled);
3582 ecore_evas_alpha_set(sd->ee, enabled);
3586 #ifdef HAVE_ELEMENTARY_X
3591 if (!ecore_x_screen_is_composited(0))
3592 elm_win_shaped_set(obj, enabled);
3594 TRAP(sd, alpha_set, enabled);
3597 TRAP(sd, alpha_set, enabled);
3598 _elm_win_xwin_update(sd);
3602 TRAP(sd, alpha_set, enabled);
3606 EOLIAN static Eina_Bool
3607 _elm_win_alpha_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3611 return evas_object_image_alpha_get(sd->img_obj);
3615 return ecore_evas_alpha_get(sd->ee);
3622 _elm_win_override_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool override)
3624 TRAP(sd, override_set, override);
3625 #ifdef HAVE_ELEMENTARY_X
3626 _elm_win_xwin_update(sd);
3630 EOLIAN static Eina_Bool
3631 _elm_win_override_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3633 return ecore_evas_override_get(sd->ee);
3637 _elm_win_fullscreen_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool fullscreen)
3639 // YYY: handle if sd->img_obj
3640 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
3641 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
3642 ENGINE_COMPARE(ELM_DRM))
3644 // these engines... can ONLY be fullscreen
3649 // sd->fullscreen = fullscreen;
3651 Eina_Bool need_frame = EINA_FALSE;
3653 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3654 need_frame = engine_name &&
3655 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3656 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3659 need_frame = !ecore_evas_borderless_get(sd->ee);
3661 TRAP(sd, fullscreen_set, fullscreen);
3666 _elm_win_frame_del(sd);
3671 _elm_win_frame_add(sd, "default");
3674 evas_object_show(sd->frame_obj);
3676 #ifdef HAVE_ELEMENTARY_X
3677 _elm_win_xwin_update(sd);
3682 EOLIAN static Eina_Bool
3683 _elm_win_fullscreen_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3685 const char* engine_name = ecore_evas_engine_name_get(sd->ee);
3688 ((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
3689 (!strcmp(engine_name, ELM_SOFTWARE_16_WINCE)) ||
3690 (!strcmp(engine_name, ELM_DRM))))
3692 // these engines... can ONLY be fullscreen
3697 return sd->fullscreen;
3704 _dbus_menu_set(Eina_Bool dbus_connect, void *data)
3706 ELM_WIN_DATA_GET_OR_RETURN(data, sd);
3710 DBG("Setting menu to D-Bus");
3711 edje_object_part_unswallow(sd->layout, sd->main_menu);
3712 edje_object_signal_emit(sd->layout, "elm,action,hide_menu", "elm");
3713 _elm_menu_menu_bar_hide(sd->main_menu);
3717 DBG("Setting menu to local mode");
3718 edje_object_part_swallow(sd->layout, "elm.swallow.menu", sd->main_menu);
3719 edje_object_signal_emit(sd->layout, "elm,action,show_menu", "elm");
3720 evas_object_show(sd->main_menu);
3724 EOLIAN static Evas_Object *
3725 _elm_win_main_menu_get(Eo *obj, Elm_Win_Data *sd)
3727 Eina_Bool use_dbus = EINA_FALSE;
3729 if (sd->main_menu) goto end;
3731 sd->main_menu = elm_menu_add(obj);
3732 _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
3734 #ifdef HAVE_ELEMENTARY_X
3735 if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
3738 #ifdef HAVE_ELEMENTARY_X
3739 if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
3741 _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
3742 _dbus_menu_set, obj);
3746 _dbus_menu_set(EINA_FALSE, obj);
3749 return sd->main_menu;
3753 _elm_win_maximized_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool maximized)
3755 _elm_win_frame_maximized_state_update(sd, maximized);
3756 // YYY: handle if sd->img_obj
3757 TRAP(sd, maximized_set, maximized);
3758 #ifdef HAVE_ELEMENTARY_X
3759 _elm_win_xwin_update(sd);
3763 EOLIAN static Eina_Bool
3764 _elm_win_maximized_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3766 return sd->maximized;
3770 _elm_win_iconified_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool iconified)
3772 // sd->iconified = iconified;
3773 TRAP(sd, iconified_set, iconified);
3774 #ifdef HAVE_ELEMENTARY_X
3775 _elm_win_xwin_update(sd);
3779 EOLIAN static Eina_Bool
3780 _elm_win_iconified_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3782 return sd->iconified;
3786 _elm_win_withdrawn_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool withdrawn)
3788 // sd->withdrawn = withdrawn;
3789 TRAP(sd, withdrawn_set, withdrawn);
3790 #ifdef HAVE_ELEMENTARY_X
3791 _elm_win_xwin_update(sd);
3795 EOLIAN static Eina_Bool
3796 _elm_win_withdrawn_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3798 return sd->withdrawn;
3802 _elm_win_available_profiles_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char **profiles, unsigned int count)
3804 Eina_Bool found = EINA_FALSE;
3806 _elm_win_available_profiles_del(sd);
3807 if ((profiles) && (count >= 1))
3809 sd->profile.available_list = calloc(count, sizeof(char *));
3810 if (sd->profile.available_list)
3812 if (!sd->profile.name) found = EINA_TRUE;
3815 for (i = 0; i < count; i++)
3817 sd->profile.available_list[i] = eina_stringshare_add(profiles[i]);
3819 /* check to see if a given array has a current profile of elm_win */
3820 if ((sd->profile.name) &&
3821 (!strcmp(sd->profile.name, profiles[i])))
3826 sd->profile.count = count;
3830 if (ecore_evas_window_profile_supported_get(sd->ee))
3832 ecore_evas_window_available_profiles_set(sd->ee,
3833 sd->profile.available_list,
3836 /* current profile of elm_win is wrong, change profile */
3837 if ((sd->profile.available_list) && (!found))
3839 eina_stringshare_replace(&(sd->profile.name),
3840 sd->profile.available_list[0]);
3841 ecore_evas_window_profile_set(sd->ee, sd->profile.name);
3847 if (sd->profile.available_list)
3848 _elm_win_profile_update(sd);
3852 EOLIAN static Eina_Bool
3853 _elm_win_available_profiles_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, char ***profiles, unsigned int *count)
3855 if (ecore_evas_window_profile_supported_get(sd->ee))
3857 return ecore_evas_window_available_profiles_get(sd->ee,
3863 if (profiles) *profiles = (char **)sd->profile.available_list;
3864 if (count) *count = sd->profile.count;
3870 _elm_win_profile_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *profile)
3872 /* check to see if a given profile is present in an available profiles */
3873 if ((profile) && (sd->profile.available_list))
3875 Eina_Bool found = EINA_FALSE;
3877 for (i = 0; i < sd->profile.count; i++)
3879 if (!strcmp(profile,
3880 sd->profile.available_list[i]))
3889 if (ecore_evas_window_profile_supported_get(sd->ee))
3891 if (!profile) _elm_win_profile_del(sd);
3892 ecore_evas_window_profile_set(sd->ee, profile);
3896 if (_internal_elm_win_profile_set(sd, profile))
3897 _elm_win_profile_update(sd);
3901 EOLIAN static const char*
3902 _elm_win_profile_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3904 return sd->profile.name;
3908 _elm_win_urgent_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool urgent)
3910 sd->urgent = urgent;
3911 TRAP(sd, urgent_set, urgent);
3912 #ifdef HAVE_ELEMENTARY_X
3913 _elm_win_xwin_update(sd);
3917 EOLIAN static Eina_Bool
3918 _elm_win_urgent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3924 _elm_win_demand_attention_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool demand_attention)
3926 sd->demand_attention = demand_attention;
3927 TRAP(sd, demand_attention_set, demand_attention);
3928 #ifdef HAVE_ELEMENTARY_X
3929 _elm_win_xwin_update(sd);
3933 EOLIAN static Eina_Bool
3934 _elm_win_demand_attention_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3936 return sd->demand_attention;
3940 _elm_win_modal_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool modal)
3942 if (sd->modal_count) return;
3945 Evas_Object *current;
3947 if ((modal) && (!sd->modal) && (evas_object_visible_get(obj)))
3949 INCREMENT_MODALITY()
3951 else if ((!modal) && (sd->modal) && (evas_object_visible_get(obj)))
3953 DECREMENT_MODALITY()
3957 TRAP(sd, modal_set, modal);
3958 #ifdef HAVE_ELEMENTARY_X
3959 _elm_win_xwin_update(sd);
3963 EOLIAN static Eina_Bool
3964 _elm_win_modal_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3970 _elm_win_aspect_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, double aspect)
3972 sd->aspect = aspect;
3973 TRAP(sd, aspect_set, aspect);
3974 #ifdef HAVE_ELEMENTARY_X
3975 _elm_win_xwin_update(sd);
3979 EOLIAN static double
3980 _elm_win_aspect_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3986 _elm_win_size_base_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h)
3988 sd->size_base_w = w;
3989 sd->size_base_h = h;
3990 TRAP(sd, size_base_set, w, h);
3991 #ifdef HAVE_ELEMENTARY_X
3992 _elm_win_xwin_update(sd);
3997 _elm_win_size_base_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h)
3999 if (w) *w = sd->size_base_w;
4000 if (w) *h = sd->size_base_h;
4004 _elm_win_size_step_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h)
4006 sd->size_step_w = w;
4007 sd->size_step_h = h;
4008 TRAP(sd, size_step_set, w, h);
4009 #ifdef HAVE_ELEMENTARY_X
4010 _elm_win_xwin_update(sd);
4015 _elm_win_size_step_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h)
4017 if (w) *w = sd->size_step_w;
4018 if (w) *h = sd->size_step_h;
4022 _elm_win_layer_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int layer)
4024 TRAP(sd, layer_set, layer);
4025 #ifdef HAVE_ELEMENTARY_X
4026 _elm_win_xwin_update(sd);
4031 _elm_win_layer_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4033 return ecore_evas_layer_get(sd->ee);
4037 elm_win_norender_push(Evas_Object *obj)
4040 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4043 if (sd->norender == 1) ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
4047 elm_win_norender_pop(Evas_Object *obj)
4050 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4052 if (sd->norender <= 0) return;
4054 if (sd->norender == 0) ecore_evas_manual_render_set(sd->ee, EINA_FALSE);
4058 elm_win_norender_get(Evas_Object *obj)
4060 ELM_WIN_CHECK(obj) - 1;
4061 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
4062 return sd->norender;
4066 elm_win_render(Evas_Object *obj)
4069 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4070 ecore_evas_manual_render(sd->ee);
4074 _win_rotation_degree_check(int rotation)
4076 if ((rotation > 360) || (rotation < 0))
4078 WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
4080 if (rotation < 0) rotation += 360;
4086 * This API resizes the internal window(ex: X window) and evas_output.
4087 * But this does not resize the elm window object and its contents.
4090 _win_rotate(Evas_Object *obj, Elm_Win_Data *sd, int rotation, Eina_Bool resize)
4092 rotation = _win_rotation_degree_check(rotation);
4093 if (sd->rot == rotation) return;
4095 if (resize) TRAP(sd, rotation_with_resize_set, rotation);
4096 else TRAP(sd, rotation_set, rotation);
4097 evas_object_size_hint_min_set(obj, -1, -1);
4098 evas_object_size_hint_max_set(obj, -1, -1);
4099 _elm_win_resize_objects_eval(obj);
4100 #ifdef HAVE_ELEMENTARY_X
4101 _elm_win_xwin_update(sd);
4103 _elm_win_frame_obj_update(sd);
4104 elm_widget_orientation_set(obj, rotation);
4105 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
4109 _elm_win_rotation_set(Eo *obj, Elm_Win_Data *sd, int rotation)
4111 _win_rotate(obj, sd, rotation, EINA_FALSE);
4115 * This API does not resize the internal window (ex: X window).
4116 * But this resizes evas_output, elm window, and its contents.
4119 _elm_win_rotation_with_resize_set(Eo *obj, Elm_Win_Data *sd, int rotation)
4121 _win_rotate(obj, sd, rotation, EINA_TRUE);
4125 _elm_win_rotation_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4130 EOLIAN static Eina_Bool
4131 _elm_win_wm_rotation_supported_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4133 return sd->wm_rot.wm_supported;
4136 /* This will unset a preferred rotation, if given preferred rotation is '-1'.
4139 elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj,
4143 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_set(rotation));
4147 _elm_win_wm_preferred_rotation_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int rotation)
4151 if (!sd->wm_rot.use)
4152 sd->wm_rot.use = EINA_TRUE;
4154 // '-1' means that elm_win doesn't use preferred rotation.
4158 rot = _win_rotation_degree_check(rotation);
4160 if (sd->wm_rot.preferred_rot == rot) return;
4161 sd->wm_rot.preferred_rot = rot;
4163 ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
4167 _elm_win_wm_preferred_rotation_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4169 return sd->wm_rot.preferred_rot;
4173 _elm_win_wm_available_rotations_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const int *rotations, unsigned int count)
4178 if (!sd->wm_rot.use)
4179 sd->wm_rot.use = EINA_TRUE;
4181 ELM_SAFE_FREE(sd->wm_rot.rots, free);
4182 sd->wm_rot.count = 0;
4186 sd->wm_rot.rots = calloc(count, sizeof(int));
4187 if (!sd->wm_rot.rots) return;
4188 for (i = 0; i < count; i++)
4190 r = _win_rotation_degree_check(rotations[i]);
4191 sd->wm_rot.rots[i] = r;
4195 sd->wm_rot.count = count;
4197 ecore_evas_wm_rotation_available_rotations_set(sd->ee,
4202 EOLIAN static Eina_Bool
4203 _elm_win_wm_available_rotations_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int **rotations, unsigned int *count)
4205 if (!sd->wm_rot.use) return EINA_FALSE;
4207 if (sd->wm_rot.count > 0)
4211 *rotations = calloc(sd->wm_rot.count, sizeof(int));
4216 sizeof(int) * sd->wm_rot.count);
4221 if (count) *count = sd->wm_rot.count;
4226 _elm_win_wm_manual_rotation_done_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool set)
4228 if (!sd->wm_rot.use) return;
4229 ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
4232 EOLIAN static Eina_Bool
4233 _elm_win_wm_manual_rotation_done_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4235 if (!sd->wm_rot.use) return EINA_FALSE;
4236 return ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
4240 _elm_win_wm_manual_rotation_done(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4242 if (!sd->wm_rot.use) return;
4243 ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
4247 _elm_win_sticky_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool sticky)
4249 // sd->sticky = sticky;
4250 TRAP(sd, sticky_set, sticky);
4251 #ifdef HAVE_ELEMENTARY_X
4252 _elm_win_xwin_update(sd);
4256 EOLIAN static Eina_Bool
4257 _elm_win_sticky_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4263 _elm_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Keyboard_Mode mode)
4265 if (mode == sd->kbdmode) return;
4266 #ifdef HAVE_ELEMENTARY_X
4267 _internal_elm_win_xwindow_get(sd);
4270 #ifdef HAVE_ELEMENTARY_X
4272 ecore_x_e_virtual_keyboard_state_set
4273 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
4277 EOLIAN static Elm_Win_Keyboard_Mode
4278 _elm_win_keyboard_mode_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4284 _elm_win_keyboard_win_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool is_keyboard)
4286 #ifdef HAVE_ELEMENTARY_X
4287 _internal_elm_win_xwindow_get(sd);
4289 ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
4295 EOLIAN static Eina_Bool
4296 _elm_win_keyboard_win_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4298 #ifdef HAVE_ELEMENTARY_X
4299 _internal_elm_win_xwindow_get(sd);
4300 if (sd->x.xwin) return ecore_x_e_virtual_keyboard_get(sd->x.xwin);
4306 _elm_win_indicator_mode_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Indicator_Mode mode)
4308 if (mode == sd->indmode) return;
4309 #ifdef HAVE_ELEMENTARY_X
4310 _internal_elm_win_xwindow_get(sd);
4313 #ifdef HAVE_ELEMENTARY_X
4316 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
4317 ecore_x_e_illume_indicator_state_set
4318 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
4319 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
4320 ecore_x_e_illume_indicator_state_set
4321 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
4324 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
4327 EOLIAN static Elm_Win_Indicator_Mode
4328 _elm_win_indicator_mode_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4334 _elm_win_indicator_opacity_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Indicator_Opacity_Mode mode)
4336 if (mode == sd->ind_o_mode) return;
4337 sd->ind_o_mode = mode;
4338 #ifdef HAVE_ELEMENTARY_X
4339 _internal_elm_win_xwindow_get(sd);
4342 if (sd->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
4343 ecore_x_e_illume_indicator_opacity_set
4344 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
4345 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
4346 ecore_x_e_illume_indicator_opacity_set
4347 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
4348 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
4349 ecore_x_e_illume_indicator_opacity_set
4350 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
4353 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
4356 EOLIAN static Elm_Win_Indicator_Opacity_Mode
4357 _elm_win_indicator_opacity_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4359 return sd->ind_o_mode;
4363 _elm_win_screen_position_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *x, int *y)
4365 if (x) *x = sd->screen.x;
4366 if (y) *y = sd->screen.y;
4369 EOLIAN static Eina_Bool
4370 _elm_win_focus_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4372 return ecore_evas_focus_get(sd->ee);
4376 _elm_win_screen_constrain_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool constrain)
4378 sd->constrain = !!constrain;
4381 EOLIAN static Eina_Bool
4382 _elm_win_screen_constrain_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4384 return sd->constrain;
4388 _elm_win_screen_size_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *x, int *y, int *w, int *h)
4390 ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
4394 _elm_win_screen_dpi_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *xdpi, int *ydpi)
4396 ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
4400 _elm_win_conformant_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool conformant)
4402 #ifdef HAVE_ELEMENTARY_X
4403 _internal_elm_win_xwindow_get(sd);
4405 ecore_x_e_illume_conformant_set(sd->x.xwin, conformant);
4411 EOLIAN static Eina_Bool
4412 _elm_win_conformant_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4414 #ifdef HAVE_ELEMENTARY_X
4415 _internal_elm_win_xwindow_get(sd);
4417 return ecore_x_e_illume_conformant_get(sd->x.xwin);
4424 _elm_win_quickpanel_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool quickpanel)
4426 #ifdef HAVE_ELEMENTARY_X
4427 _internal_elm_win_xwindow_get(sd);
4430 ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel);
4433 Ecore_X_Window_State states[2];
4435 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
4436 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
4437 ecore_x_netwm_window_state_set(sd->x.xwin, states, 2);
4438 ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
4446 EOLIAN static Eina_Bool
4447 _elm_win_quickpanel_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4449 #ifdef HAVE_ELEMENTARY_X
4450 _internal_elm_win_xwindow_get(sd);
4452 return ecore_x_e_illume_quickpanel_get(sd->x.xwin);
4459 _elm_win_quickpanel_priority_major_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int priority)
4461 #ifdef HAVE_ELEMENTARY_X
4462 _internal_elm_win_xwindow_get(sd);
4464 ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
4471 _elm_win_quickpanel_priority_major_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4473 #ifdef HAVE_ELEMENTARY_X
4474 _internal_elm_win_xwindow_get(sd);
4476 return ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
4483 _elm_win_quickpanel_priority_minor_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int priority)
4485 #ifdef HAVE_ELEMENTARY_X
4486 _internal_elm_win_xwindow_get(sd);
4488 ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
4495 _elm_win_quickpanel_priority_minor_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4497 #ifdef HAVE_ELEMENTARY_X
4498 _internal_elm_win_xwindow_get(sd);
4500 return ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
4507 _elm_win_quickpanel_zone_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int zone)
4509 #ifdef HAVE_ELEMENTARY_X
4510 _internal_elm_win_xwindow_get(sd);
4512 ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
4519 _elm_win_quickpanel_zone_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4521 #ifdef HAVE_ELEMENTARY_X
4522 _internal_elm_win_xwindow_get(sd);
4524 return ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
4531 _elm_win_prop_focus_skip_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool skip)
4533 sd->skip_focus = skip;
4534 TRAP(sd, focus_skip_set, skip);
4538 _elm_win_illume_command_send(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Illume_Command command, void *params)
4542 #ifdef HAVE_ELEMENTARY_X
4543 _internal_elm_win_xwindow_get(sd);
4548 case ELM_ILLUME_COMMAND_FOCUS_BACK:
4549 ecore_x_e_illume_focus_back_send(sd->x.xwin);
4552 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
4553 ecore_x_e_illume_focus_forward_send(sd->x.xwin);
4556 case ELM_ILLUME_COMMAND_FOCUS_HOME:
4557 ecore_x_e_illume_focus_home_send(sd->x.xwin);
4560 case ELM_ILLUME_COMMAND_CLOSE:
4561 ecore_x_e_illume_close_send(sd->x.xwin);
4573 EOLIAN static Evas_Object*
4574 _elm_win_inlined_image_object_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4580 _elm_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool enabled)
4582 enabled = !!enabled;
4583 if (sd->focus_highlight.enabled == enabled)
4586 sd->focus_highlight.enabled = enabled;
4588 if (sd->focus_highlight.enabled)
4589 _elm_win_focus_highlight_init(sd);
4591 _elm_win_focus_highlight_shutdown(sd);
4594 EOLIAN static Eina_Bool
4595 _elm_win_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4597 return sd->focus_highlight.enabled;
4600 EOLIAN static Eina_Bool
4601 _elm_win_elm_widget_theme_apply(Eo *obj, Elm_Win_Data *sd)
4603 Eina_Bool int_ret = EINA_FALSE;
4604 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
4605 if (!int_ret) return EINA_TRUE;
4607 sd->focus_highlight.theme_changed = EINA_TRUE;
4608 _elm_win_focus_highlight_reconfigure_job_start(sd);
4614 _elm_win_focus_highlight_style_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *style)
4616 eina_stringshare_replace(&sd->focus_highlight.style, style);
4617 sd->focus_highlight.theme_changed = EINA_TRUE;
4618 _elm_win_focus_highlight_reconfigure_job_start(sd);
4621 EOLIAN static const char*
4622 _elm_win_focus_highlight_style_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4624 return sd->focus_highlight.style;
4628 _elm_win_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool animate)
4630 animate = !!animate;
4631 if (sd->focus_highlight.animate == animate)
4634 sd->focus_highlight.animate = animate;
4635 sd->focus_highlight.theme_changed = EINA_TRUE;
4636 _elm_win_focus_highlight_reconfigure_job_start(sd);
4639 EOLIAN static Eina_Bool
4640 _elm_win_focus_highlight_animate_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4642 return sd->focus_highlight.animate;
4645 EOLIAN static Eina_Bool
4646 _elm_win_socket_listen(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *svcname, int svcnum, Eina_Bool svcsys)
4648 if (!sd->ee) return EINA_FALSE;
4650 if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
4656 /* windowing specific calls - shall we do this differently? */
4658 EOLIAN static Ecore_X_Window
4659 _elm_win_xwindow_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4661 #ifdef HAVE_ELEMENTARY_X
4662 if (sd->x.xwin) return sd->x.xwin;
4663 if (sd->parent) return elm_win_xwindow_get(sd->parent);
4668 EAPI Ecore_Wl_Window *
4669 elm_win_wl_window_get(const Evas_Object *obj)
4671 if (!obj) return NULL;
4673 if ((!ENGINE_COMPARE(ELM_WAYLAND_SHM)) &&
4674 (!ENGINE_COMPARE(ELM_WAYLAND_EGL)))
4677 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
4679 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
4680 return _elm_ee_wlwin_get(ee);
4683 ELM_WIN_CHECK(obj) NULL;
4684 Ecore_Wl_Window *ret = NULL;
4685 eo_do((Eo *) obj, ret = elm_obj_win_wl_window_get());
4689 EOLIAN static Ecore_Wl_Window*
4690 _elm_win_wl_window_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4692 #if HAVE_ELEMENTARY_WAYLAND
4693 if (sd->wl.win) return sd->wl.win;
4694 if (sd->parent) return elm_win_wl_window_get(sd->parent);
4702 elm_win_trap_set(const Elm_Win_Trap *t)
4704 DBG("old %p, new %p", trap, t);
4706 if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
4708 CRI("trying to set a trap version %lu while %lu was expected!",
4709 t->version, ELM_WIN_TRAP_VERSION);
4718 elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
4721 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4723 floating = !!floating;
4724 if (floating == sd->floating) return;
4725 sd->floating = floating;
4726 #ifdef HAVE_ELEMENTARY_X
4727 _internal_elm_win_xwindow_get(sd);
4731 ecore_x_e_illume_window_state_set
4732 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING);
4734 ecore_x_e_illume_window_state_set
4735 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL);
4741 elm_win_floating_mode_get(const Evas_Object *obj)
4743 ELM_WIN_CHECK(obj) EINA_FALSE;
4744 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
4746 return sd->floating;
4749 EOLIAN static Ecore_Window
4750 _elm_win_window_id_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
4752 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
4754 #if HAVE_ELEMENTARY_WAYLAND
4755 if (sd->wl.win) return (Ecore_Window)ecore_wl_window_surface_id_get(sd->wl.win);
4758 Ecore_Wl_Window *parent;
4760 parent = elm_win_wl_window_get(sd->parent);
4761 if (parent) return (Ecore_Window)ecore_wl_window_surface_id_get(parent);
4768 #ifdef HAVE_ELEMENTARY_X
4769 _internal_elm_win_xwindow_get(sd);
4770 if (sd->x.xwin) return (Ecore_Window)sd->x.xwin;
4771 if (sd->parent) return (Ecore_Window)elm_win_xwindow_get(sd->parent);
4779 _elm_win_focus_highlight_in_theme_update(Evas_Object *obj, Eina_Bool in_theme)
4781 ELM_WIN_DATA_GET(obj, sd);
4782 sd->focus_highlight.cur.in_theme = !!in_theme;
4786 _elm_win_focus_highlight_start(Evas_Object *obj)
4788 ELM_WIN_DATA_GET(obj, sd);
4790 if (!elm_win_focus_highlight_enabled_get(obj)) return;
4791 sd->focus_highlight.cur.visible = EINA_TRUE;
4792 sd->focus_highlight.geometry_changed = EINA_TRUE;
4793 _elm_win_focus_highlight_reconfigure_job(obj);
4797 elm_win_window_id_get(const Evas_Object *obj)
4801 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
4803 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
4804 return ecore_evas_window_get(ee);
4807 ELM_WIN_CHECK(obj) 0;
4808 Ecore_Window ret = 0;
4809 eo_do((Eo *) obj, ret = elm_obj_win_window_id_get());
4814 _elm_win_class_constructor(Eo_Class *klass)
4816 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
4820 _elm_win_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd EINA_UNUSED)
4822 // attach all kinds of windows directly to ATSPI application root object
4823 return _elm_atspi_root_get();
4826 #include "elm_win.eo.c"