2 # include "elementary_config.h"
5 #include <Elementary.h>
6 #include <Elementary_Cursor.h>
9 #include "elm_widget_menu.h"
11 EAPI Eo_Op ELM_OBJ_WIN_BASE_ID = EO_NOOP;
13 #define MY_CLASS ELM_OBJ_WIN_CLASS
15 #define MY_CLASS_NAME "Elm_Win"
16 #define MY_CLASS_NAME_LEGACY "elm_win"
18 static const Elm_Win_Trap *trap = NULL;
20 #define TRAP(sd, name, ...) \
23 if ((!trap) || (!trap->name) || \
25 (trap->name(sd->trap_data, sd->obj, ## __VA_ARGS__)))) \
26 ecore_evas_##name(sd->ee, ##__VA_ARGS__); \
30 #define ELM_WIN_DATA_GET(o, sd) \
31 Elm_Win_Smart_Data * sd = eo_data_scope_get(o, MY_CLASS)
33 #define ELM_WIN_DATA_GET_OR_RETURN(o, ptr) \
34 ELM_WIN_DATA_GET(o, ptr); \
37 CRI("No widget data for object %p (%s)", \
38 o, evas_object_type_get(o)); \
42 #define ELM_WIN_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
43 ELM_WIN_DATA_GET(o, ptr); \
46 CRI("No widget data for object %p (%s)", \
47 o, evas_object_type_get(o)); \
51 #define ELM_WIN_CHECK(obj) \
52 if (!obj || !eo_isa(obj, MY_CLASS)) \
55 #define ENGINE_GET() (_elm_preferred_engine ? _elm_preferred_engine : (_elm_config->engine ? _elm_config->engine : ""))
56 #define ENGINE_COMPARE(name) (!strcmp(ENGINE_GET(), name))
58 typedef struct _Elm_Win_Smart_Data Elm_Win_Smart_Data;
60 struct _Elm_Win_Smart_Data
64 Evas_Object *parent; /* parent *window* object*/
65 Evas_Object *img_obj, *frame_obj;
66 Evas_Object *client_obj; /* rect representing the client */
67 Evas_Object *spacer_obj;
70 Evas_Object *obj; /* The object itself */
71 #ifdef HAVE_ELEMENTARY_X
75 Ecore_Event_Handler *client_message_handler;
76 Ecore_Event_Handler *property_handler;
79 #ifdef HAVE_ELEMENTARY_WAYLAND
86 Ecore_Job *deferred_resize_job;
87 Ecore_Job *deferred_child_eval_job;
90 Elm_Win_Keyboard_Mode kbdmode;
91 Elm_Win_Indicator_Mode indmode;
92 Elm_Win_Indicator_Opacity_Mode ind_o_mode;
101 int *autodel_clear, rot;
110 Evas_Object *obj, *hot_obj;
115 Evas_Object *fobj; /* focus highlight edje object */
120 Eina_Bool visible : 1;
121 Eina_Bool in_theme: 1; /**< focus highlight is handled by theme.
122 this is set true if edc data item "focus_highlight" is set to "on" during focus in callback. */
126 Ecore_Job *reconf_job;
128 Eina_Bool enabled : 1;
129 Eina_Bool theme_changed : 1; /* set true when the focus theme is changed */
130 Eina_Bool animate : 1; /* set true when the focus highlight animate is enabled */
131 Eina_Bool animate_supported : 1; /* set true when the focus highlight animate is supported by theme */
132 Eina_Bool geometry_changed : 1;
137 const char *icon_name;
140 Evas_Object *main_menu;
145 const char **available_list;
150 int preferred_rot; /* indicates preferred rotation value, -1 means invalid. */
151 int *rots; /* indicates available rotations */
152 unsigned int count; /* number of elements in available rotations */
153 Eina_Bool wm_supported : 1; /* set true when the window manager support window rotation */
154 Eina_Bool use : 1; /* set ture when application use window manager rotation. */
160 int size_base_w, size_base_h;
161 int size_step_w, size_step_h;
163 Eina_Bool urgent : 1;
165 Eina_Bool demand_attention : 1;
166 Eina_Bool autodel : 1;
167 Eina_Bool constrain : 1;
168 Eina_Bool resizing : 1;
169 Eina_Bool iconified : 1;
170 Eina_Bool withdrawn : 1;
171 Eina_Bool sticky : 1;
172 Eina_Bool fullscreen : 1;
173 Eina_Bool maximized : 1;
174 Eina_Bool skip_focus : 1;
175 Eina_Bool floating : 1;
178 static const char SIG_DELETE_REQUEST[] = "delete,request";
179 static const char SIG_FOCUS_OUT[] = "focus,out"; // deprecated. use "focused" instead.
180 static const char SIG_FOCUS_IN[] = "focus,in"; // deprecated. use "unfocused" instead.
181 static const char SIG_MOVED[] = "moved";
182 static const char SIG_WITHDRAWN[] = "withdrawn";
183 static const char SIG_ICONIFIED[] = "iconified";
184 static const char SIG_NORMAL[] = "normal";
185 static const char SIG_STICK[] = "stick";
186 static const char SIG_UNSTICK[] = "unstick";
187 static const char SIG_FULLSCREEN[] = "fullscreen";
188 static const char SIG_UNFULLSCREEN[] = "unfullscreen";
189 static const char SIG_MAXIMIZED[] = "maximized";
190 static const char SIG_UNMAXIMIZED[] = "unmaximized";
191 static const char SIG_IOERR[] = "ioerr";
192 static const char SIG_INDICATOR_PROP_CHANGED[] = "indicator,prop,changed";
193 static const char SIG_ROTATION_CHANGED[] = "rotation,changed";
194 static const char SIG_PROFILE_CHANGED[] = "profile,changed";
195 static const char SIG_FOCUSED[] = "focused";
196 static const char SIG_UNFOCUSED[] = "unfocused";
197 static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed";
199 static const Evas_Smart_Cb_Description _smart_callbacks[] = {
200 {SIG_DELETE_REQUEST, ""},
209 {SIG_FULLSCREEN, ""},
210 {SIG_UNFULLSCREEN, ""},
212 {SIG_UNMAXIMIZED, ""},
214 {SIG_INDICATOR_PROP_CHANGED, ""},
215 {SIG_ROTATION_CHANGED, ""},
216 {SIG_PROFILE_CHANGED, ""},
219 {SIG_WM_ROTATION_CHANGED, ""},
223 Eina_List *_elm_win_list = NULL;
224 int _elm_win_deferred_free = 0;
226 static int _elm_win_count = 0;
228 static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
230 static Ecore_Job *_elm_win_state_eval_job = NULL;
233 _elm_win_on_resize_obj_changed_size_hints(void *data,
238 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj);
240 #ifdef HAVE_ELEMENTARY_X
241 static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd);
244 EAPI double _elm_startup_time = 0;
247 _elm_win_first_frame_do(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
249 double end = ecore_time_unix_get();
257 case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f' sec\n", end, _elm_startup_time, end - _elm_startup_time);
261 evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, data);
265 _elm_win_state_eval(void *data EINA_UNUSED)
269 int _elm_win_count_shown = 0;
270 int _elm_win_count_iconified = 0;
271 int _elm_win_count_withdrawn = 0;
273 _elm_win_state_eval_job = NULL;
275 if (_elm_config->auto_norender_withdrawn)
277 EINA_LIST_FOREACH(_elm_win_list, l, obj)
279 if ((elm_win_withdrawn_get(obj)) ||
280 ((elm_win_iconified_get(obj) &&
281 (_elm_config->auto_norender_iconified_same_as_withdrawn))))
283 if (!evas_object_data_get(obj, "__win_auto_norender"))
285 Evas *evas = evas_object_evas_get(obj);
287 elm_win_norender_push(obj);
288 evas_object_data_set(obj, "__win_auto_norender", obj);
290 if (_elm_config->auto_flush_withdrawn)
292 edje_file_cache_flush();
293 edje_collection_cache_flush();
294 evas_image_cache_flush(evas);
295 evas_font_cache_flush(evas);
297 if (_elm_config->auto_dump_withdrawn)
299 evas_render_dump(evas);
305 if (evas_object_data_get(obj, "__win_auto_norender"))
307 elm_win_norender_pop(obj);
308 evas_object_data_del(obj, "__win_auto_norender");
313 if (((_elm_config->auto_throttle) &&
314 (elm_policy_get(ELM_POLICY_THROTTLE) != ELM_POLICY_THROTTLE_NEVER)) ||
315 (elm_policy_get(ELM_POLICY_THROTTLE) == ELM_POLICY_THROTTLE_HIDDEN_ALWAYS))
317 if (_elm_win_count == 0)
319 if (_elm_win_auto_throttled)
321 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
322 _elm_win_auto_throttled = EINA_FALSE;
327 EINA_LIST_FOREACH(_elm_win_list, l, obj)
329 if (elm_win_withdrawn_get(obj))
330 _elm_win_count_withdrawn++;
331 else if (elm_win_iconified_get(obj))
332 _elm_win_count_iconified++;
333 else if (evas_object_visible_get(obj))
334 _elm_win_count_shown++;
336 if (_elm_win_count_shown <= 0)
338 if (!_elm_win_auto_throttled)
340 ecore_throttle_adjust(_elm_config->auto_throttle_amount);
341 _elm_win_auto_throttled = EINA_TRUE;
346 if (_elm_win_auto_throttled)
348 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
349 _elm_win_auto_throttled = EINA_FALSE;
357 _elm_win_state_eval_queue(void)
359 ecore_job_del(_elm_win_state_eval_job);
360 _elm_win_state_eval_job = ecore_job_add(_elm_win_state_eval, NULL);
363 // example shot spec (wait 0.1 sec then save as my-window.png):
364 // ELM_ENGINE="shot:delay=0.1:file=my-window.png"
367 _shot_delay_get(Elm_Win_Smart_Data *sd)
370 char *d = strdup(sd->shot.info);
373 for (p = (char *)sd->shot.info; *p; p++)
375 if (!strncmp(p, "delay=", 6))
379 for (pd = d, p += 6; (*p) && (*p != ':'); p++, pd++)
395 _shot_file_get(Elm_Win_Smart_Data *sd)
398 char *tmp = strdup(sd->shot.info);
399 char *repname = NULL;
401 if (!tmp) return NULL;
403 for (p = (char *)sd->shot.info; *p; p++)
405 if (!strncmp(p, "file=", 5))
408 if (!sd->shot.repeat_count) return tmp;
411 char *dotptr = strrchr(tmp, '.');
414 size_t size = sizeof(char) * (strlen(tmp) + 16);
415 repname = malloc(size);
416 strncpy(repname, tmp, dotptr - tmp);
417 snprintf(repname + (dotptr - tmp), size -
418 (dotptr - tmp), "%03i",
419 sd->shot.shot_counter + 1);
420 strcat(repname, dotptr);
428 if (!sd->shot.repeat_count) return strdup("out.png");
430 repname = malloc(sizeof(char) * 24);
431 snprintf(repname, sizeof(char) * 24, "out%03i.png",
432 sd->shot.shot_counter + 1);
438 _shot_repeat_count_get(Elm_Win_Smart_Data *sd)
441 char *d = strdup(sd->shot.info);
444 for (p = (char *)sd->shot.info; *p; p++)
446 if (!strncmp(p, "repeat=", 7))
450 for (pd = d, p += 7; (*p) && (*p != ':'); p++, pd++)
457 if (v > 1000) v = 999;
468 _shot_key_get(Elm_Win_Smart_Data *sd EINA_UNUSED)
474 _shot_flags_get(Elm_Win_Smart_Data *sd EINA_UNUSED)
480 _shot_do(Elm_Win_Smart_Data *sd)
484 unsigned int *pixels;
486 char *file, *key, *flags;
488 ecore_evas_manual_render(sd->ee);
489 pixels = (void *)ecore_evas_buffer_pixels_get(sd->ee);
492 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
493 if ((w < 1) || (h < 1)) return;
495 file = _shot_file_get(sd);
498 key = _shot_key_get(sd);
499 flags = _shot_flags_get(sd);
500 ee = ecore_evas_buffer_new(1, 1);
501 o = evas_object_image_add(ecore_evas_get(ee));
502 evas_object_image_alpha_set(o, ecore_evas_alpha_get(sd->ee));
503 evas_object_image_size_set(o, w, h);
504 evas_object_image_data_set(o, pixels);
505 if (!evas_object_image_save(o, file, key, flags))
507 ERR("Cannot save window to '%s' (key '%s', flags '%s')",
514 if (sd->shot.repeat_count) sd->shot.shot_counter++;
518 _shot_delay(void *data)
520 ELM_WIN_DATA_GET(data, sd);
523 if (sd->shot.repeat_count)
525 int remainshot = (sd->shot.repeat_count - sd->shot.shot_counter);
526 if (remainshot > 0) return EINA_TRUE;
528 sd->shot.timer = NULL;
535 _shot_init(Elm_Win_Smart_Data *sd)
537 if (!sd->shot.info) return;
539 sd->shot.repeat_count = _shot_repeat_count_get(sd);
540 sd->shot.shot_counter = 0;
544 _shot_handle(Elm_Win_Smart_Data *sd)
546 if (!sd->shot.info) return;
549 sd->shot.timer = ecore_timer_add(_shot_delay_get(sd), _shot_delay,
553 /* elm-win specific associate, does the trap while ecore_evas_object_associate()
556 static Elm_Win_Smart_Data *
557 _elm_win_associate_get(const Ecore_Evas *ee)
559 Evas_Object *obj = ecore_evas_data_get(ee, "elm_win");
560 if (!obj) return NULL;
561 ELM_WIN_DATA_GET(obj, sd);
565 /* Interceptors Callbacks */
567 _elm_win_obj_intercept_raise(void *data, Evas_Object *obj EINA_UNUSED)
569 ELM_WIN_DATA_GET(data, sd);
574 _elm_win_obj_intercept_lower(void *data, Evas_Object *obj EINA_UNUSED)
576 ELM_WIN_DATA_GET(data, sd);
581 _elm_win_obj_intercept_stack_above(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *above EINA_UNUSED)
583 INF("TODO: %s", __FUNCTION__);
587 _elm_win_obj_intercept_stack_below(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *below EINA_UNUSED)
589 INF("TODO: %s", __FUNCTION__);
593 _elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj EINA_UNUSED, int l)
595 ELM_WIN_DATA_GET(data, sd);
596 TRAP(sd, layer_set, l);
599 /* Event Callbacks */
602 _elm_win_obj_callback_changed_size_hints(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
604 ELM_WIN_DATA_GET(data, sd);
607 evas_object_size_hint_min_get(obj, &w, &h);
608 TRAP(sd, size_min_set, w, h);
610 evas_object_size_hint_max_get(obj, &w, &h);
613 TRAP(sd, size_max_set, w, h);
615 /* end of elm-win specific associate */
618 _elm_win_move(Ecore_Evas *ee)
620 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
625 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
628 evas_object_smart_callback_call(sd->obj, SIG_MOVED, NULL);
632 _elm_win_resize_job(void *data)
634 ELM_WIN_DATA_GET(data, sd);
637 sd->deferred_resize_job = NULL;
638 ecore_evas_request_geometry_get(sd->ee, NULL, NULL, &w, &h);
642 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
651 evas_output_framespace_get(sd->evas, &fx, &fy, &fw, &fh);
652 evas_object_move(sd->frame_obj, -fx, -fy);
653 evas_object_resize(sd->frame_obj, w + fw, h + fh);
656 evas_object_resize(sd->obj, w, h);
657 evas_object_resize(sd->layout, w, h);
661 _elm_win_resize(Ecore_Evas *ee)
663 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
666 ecore_job_del(sd->deferred_resize_job);
667 sd->deferred_resize_job = ecore_job_add(_elm_win_resize_job, sd->obj);
671 _elm_win_mouse_in(Ecore_Evas *ee)
673 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
676 if (sd->resizing) sd->resizing = EINA_FALSE;
680 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win_Smart_Data *sd)
682 ELM_SAFE_FREE(sd->focus_highlight.reconf_job, ecore_job_del);
686 _elm_win_focus_highlight_visible_set(Elm_Win_Smart_Data *sd,
689 Evas_Object *fobj = sd->focus_highlight.fobj;
694 evas_object_show(fobj);
695 edje_object_signal_emit(fobj, "elm,action,focus,show", "elm");
699 edje_object_signal_emit(fobj, "elm,action,focus,hide", "elm");
704 _elm_win_focus_highlight_anim_setup(Elm_Win_Smart_Data *sd,
707 Evas_Coord tx, ty, tw, th;
708 Evas_Coord w, h, px, py, pw, ph;
709 Edje_Message_Int_Set *m;
710 Evas_Object *previous = sd->focus_highlight.prev.target;
711 Evas_Object *target = sd->focus_highlight.cur.target;
713 evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
714 elm_widget_focus_highlight_geometry_get(target, &tx, &ty, &tw, &th, EINA_TRUE);
715 elm_widget_focus_highlight_geometry_get(previous, &px, &py, &pw, &ph, EINA_FALSE);
716 evas_object_move(obj, tx, ty);
717 evas_object_resize(obj, tw, th);
718 evas_object_clip_unset(obj);
720 m = alloca(sizeof(*m) + (sizeof(int) * 8));
730 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
734 _elm_win_focus_highlight_simple_setup(Elm_Win_Smart_Data *sd,
737 Evas_Object *clip, *target = sd->focus_highlight.cur.target;
738 Evas_Coord x, y, w, h;
740 clip = evas_object_clip_get(target);
741 elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE);
743 evas_object_move(obj, x, y);
744 evas_object_resize(obj, w, h);
745 if (clip) evas_object_clip_set(obj, clip);
749 _elm_win_focus_highlight_reconfigure(Elm_Win_Smart_Data *sd)
751 Evas_Object *target = sd->focus_highlight.cur.target;
752 Evas_Object *previous = sd->focus_highlight.prev.target;
753 Evas_Object *fobj = sd->focus_highlight.fobj;
754 Eina_Bool visible_changed;
755 Eina_Bool common_visible;
756 const char *sig = NULL;
757 const char *focus_style_target = NULL;
758 const char *focus_style_previous = NULL;
760 _elm_win_focus_highlight_reconfigure_job_stop(sd);
762 visible_changed = (sd->focus_highlight.cur.visible !=
763 sd->focus_highlight.prev.visible);
765 if ((target == previous) && (!visible_changed) &&
766 (!sd->focus_highlight.geometry_changed) &&
767 (!sd->focus_highlight.theme_changed))
770 if ((previous) && (sd->focus_highlight.prev.in_theme))
771 elm_widget_signal_emit
772 (previous, "elm,action,focus_highlight,hide", "elm");
775 common_visible = EINA_FALSE;
776 else if (sd->focus_highlight.cur.in_theme)
778 common_visible = EINA_FALSE;
779 if (sd->focus_highlight.cur.visible)
780 sig = "elm,action,focus_highlight,show";
782 sig = "elm,action,focus_highlight,hide";
785 common_visible = sd->focus_highlight.cur.visible;
788 elm_widget_signal_emit(target, sig, "elm");
790 if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
794 focus_style_previous = elm_widget_focus_highlight_style_get(previous);
795 focus_style_target = elm_widget_focus_highlight_style_get(target);
797 if (sd->focus_highlight.theme_changed ||
798 (focus_style_target != focus_style_previous))
802 if (focus_style_target)
803 str = focus_style_target;
804 else if (sd->focus_highlight.style)
805 str = sd->focus_highlight.style;
809 elm_widget_theme_object_set
810 (sd->obj, fobj, "focus_highlight", "top", str);
811 sd->focus_highlight.theme_changed = EINA_FALSE;
813 if (sd->focus_highlight.animate)
815 str = edje_object_data_get(sd->focus_highlight.fobj, "animate");
816 sd->focus_highlight.animate_supported = ((str) && (!strcmp(str, "on")));
819 sd->focus_highlight.animate_supported = EINA_FALSE;
822 if ((sd->focus_highlight.animate_supported) && (previous) &&
823 (!sd->focus_highlight.prev.in_theme))
824 _elm_win_focus_highlight_anim_setup(sd, fobj);
826 _elm_win_focus_highlight_simple_setup(sd, fobj);
827 evas_object_raise(fobj);
830 _elm_win_focus_highlight_visible_set(sd, common_visible);
831 sd->focus_highlight.geometry_changed = EINA_FALSE;
832 sd->focus_highlight.prev = sd->focus_highlight.cur;
836 _elm_win_focus_highlight_reconfigure_job(void *data)
838 ELM_WIN_DATA_GET(data, sd);
839 _elm_win_focus_highlight_reconfigure(sd);
843 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win_Smart_Data *sd)
845 ecore_job_del(sd->focus_highlight.reconf_job);
847 sd->focus_highlight.reconf_job = ecore_job_add(
848 _elm_win_focus_highlight_reconfigure_job, sd->obj);
852 _elm_win_focus_in(Ecore_Evas *ee)
854 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
856 unsigned int order = 0;
862 _elm_widget_top_win_focused_set(obj, EINA_TRUE);
863 if (!elm_widget_focus_order_get(obj)
864 || (obj == elm_widget_newest_focus_order_get(obj, &order, EINA_TRUE)))
866 elm_widget_focus_steal(obj);
869 elm_widget_focus_restore(obj);
870 evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
871 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
872 sd->focus_highlight.cur.visible = EINA_TRUE;
873 _elm_win_focus_highlight_reconfigure_job_start(sd);
876 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
880 /* else if (sd->img_obj) */
886 _elm_win_focus_out(Ecore_Evas *ee)
888 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
895 elm_object_focus_set(obj, EINA_FALSE);
896 _elm_widget_top_win_focused_set(obj, EINA_FALSE);
897 evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
898 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
899 sd->focus_highlight.cur.visible = EINA_FALSE;
900 _elm_win_focus_highlight_reconfigure_job_start(sd);
903 edje_object_signal_emit(sd->frame_obj, "elm,action,unfocus", "elm");
907 _elm_access_object_highlight_disable(evas_object_evas_get(obj));
910 /* if (sd->img_obj) */
916 _elm_win_available_profiles_del(Elm_Win_Smart_Data *sd)
918 if (!sd->profile.available_list) return;
921 for (i = 0; i < sd->profile.count; i++)
922 ELM_SAFE_FREE(sd->profile.available_list[i], eina_stringshare_del);
923 sd->profile.count = 0;
924 ELM_SAFE_FREE(sd->profile.available_list, free);
928 _elm_win_profile_del(Elm_Win_Smart_Data *sd)
930 ELM_SAFE_FREE(sd->profile.name, eina_stringshare_del);
934 _elm_win_profile_set(Elm_Win_Smart_Data *sd, const char *profile)
936 Eina_Bool changed = EINA_FALSE;
939 if (sd->profile.name)
941 if (strcmp(sd->profile.name, profile) != 0)
943 eina_stringshare_replace(&(sd->profile.name), profile);
949 sd->profile.name = eina_stringshare_add(profile);
954 _elm_win_profile_del(sd);
960 _elm_win_profile_update(Elm_Win_Smart_Data *sd)
962 if (sd->profile.available_list)
964 Eina_Bool found = EINA_FALSE;
965 if (sd->profile.name)
968 for (i = 0; i < sd->profile.count; i++)
970 if (!strcmp(sd->profile.name,
971 sd->profile.available_list[i]))
979 /* If current profile is not present in an available profiles,
980 * change current profile to the 1st element of an array.
983 _elm_win_profile_set(sd, sd->profile.available_list[0]);
986 _elm_config_profile_set(sd->profile.name);
990 Eina_List *sub, *l = NULL;
992 sub = ecore_evas_sub_ecore_evas_list_get(sd->ee);
993 EINA_LIST_FOREACH(sub, l, ee2)
994 ecore_evas_window_profile_set(ee2, sd->profile.name);
996 evas_object_smart_callback_call(sd->obj, SIG_PROFILE_CHANGED, NULL);
1000 _elm_win_state_change(Ecore_Evas *ee)
1002 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1004 Eina_Bool ch_withdrawn = EINA_FALSE;
1005 Eina_Bool ch_sticky = EINA_FALSE;
1006 Eina_Bool ch_iconified = EINA_FALSE;
1007 Eina_Bool ch_fullscreen = EINA_FALSE;
1008 Eina_Bool ch_maximized = EINA_FALSE;
1009 Eina_Bool ch_profile = EINA_FALSE;
1010 Eina_Bool ch_wm_rotation = EINA_FALSE;
1011 const char *profile;
1017 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
1019 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
1020 ch_withdrawn = EINA_TRUE;
1022 if (sd->sticky != ecore_evas_sticky_get(sd->ee))
1024 sd->sticky = ecore_evas_sticky_get(sd->ee);
1025 ch_sticky = EINA_TRUE;
1027 if (sd->iconified != ecore_evas_iconified_get(sd->ee))
1029 sd->iconified = ecore_evas_iconified_get(sd->ee);
1030 ch_iconified = EINA_TRUE;
1032 if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee))
1034 sd->fullscreen = ecore_evas_fullscreen_get(sd->ee);
1035 ch_fullscreen = EINA_TRUE;
1037 if (sd->maximized != ecore_evas_maximized_get(sd->ee))
1039 sd->maximized = ecore_evas_maximized_get(sd->ee);
1040 ch_maximized = EINA_TRUE;
1043 profile = ecore_evas_window_profile_get(sd->ee);
1044 ch_profile = _elm_win_profile_set(sd, profile);
1048 if (sd->rot != ecore_evas_rotation_get(sd->ee))
1050 sd->rot = ecore_evas_rotation_get(sd->ee);
1051 ch_wm_rotation = EINA_TRUE;
1055 _elm_win_state_eval_queue();
1057 if ((ch_withdrawn) || (ch_iconified))
1060 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL);
1061 else if (sd->iconified)
1062 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL);
1064 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL);
1069 evas_object_smart_callback_call(obj, SIG_STICK, NULL);
1071 evas_object_smart_callback_call(obj, SIG_UNSTICK, NULL);
1076 evas_object_smart_callback_call(obj, SIG_FULLSCREEN, NULL);
1078 evas_object_smart_callback_call(obj, SIG_UNFULLSCREEN, NULL);
1083 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL);
1085 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL);
1089 _elm_win_profile_update(sd);
1093 evas_object_size_hint_min_set(obj, -1, -1);
1094 evas_object_size_hint_max_set(obj, -1, -1);
1095 #ifdef HAVE_ELEMENTARY_X
1096 _elm_win_xwin_update(sd);
1098 elm_widget_orientation_set(obj, sd->rot);
1099 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
1100 evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
1105 _elm_win_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1107 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1112 _elm_win_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1114 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
1115 Evas_Object **next = va_arg(*list, Evas_Object **);
1116 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1117 if (ret) *ret = EINA_FALSE;
1119 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1121 const Eina_List *items;
1122 void *(*list_data_get)(const Eina_List *list);
1127 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1129 items = wd->subobjs;
1133 list_data_get = eina_list_data_get;
1135 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
1139 if (ret) *ret = EINA_TRUE;
1143 *next = (Evas_Object *)obj;
1148 _elm_win_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1150 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1155 _elm_win_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1157 const Evas_Object *base = va_arg(*list, Evas_Object *);
1158 double degree = va_arg(*list, double);
1159 Evas_Object **direction = va_arg(*list, Evas_Object **);
1160 double *weight = va_arg(*list, double *);
1161 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1162 if (ret) *ret = EINA_FALSE;
1163 Eina_Bool int_ret = EINA_FALSE;
1165 const Eina_List *items;
1166 void *(*list_data_get)(const Eina_List *list);
1168 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1173 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1174 items = wd->subobjs;
1176 list_data_get = eina_list_data_get;
1178 int_ret = elm_widget_focus_list_direction_get
1179 (obj, base, items, list_data_get, degree, direction, weight);
1180 if (ret) *ret = int_ret;
1185 _elm_win_smart_on_focus(Eo *obj, void *_pd, va_list *list)
1187 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1188 if (ret) *ret = EINA_TRUE;
1189 Elm_Win_Smart_Data *sd = _pd;
1190 Eina_Bool int_ret = EINA_FALSE;
1192 eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
1193 if (!int_ret) return;
1196 evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));
1198 evas_object_focus_set(obj, elm_widget_focus_get(obj));
1202 _elm_win_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1204 Evas_Object *src = va_arg(*list, Evas_Object *);
1205 Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
1206 Evas_Event_Key_Down *ev = va_arg(*list, void *);
1207 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1209 if (ret) *ret = EINA_FALSE;
1212 if (elm_widget_disabled_get(obj)) return;
1213 if (type != EVAS_CALLBACK_KEY_DOWN) return;
1215 if ((!strcmp(ev->key, "Tab")) ||
1216 (!strcmp(ev->key, "ISO_Left_Tab")))
1218 if (evas_key_modifier_is_set(ev->modifiers, "Control") ||
1219 evas_key_modifier_is_set(ev->modifiers, "Alt"))
1221 if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
1222 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1224 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1228 else if ((!strcmp(ev->key, "Left")) ||
1229 ((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
1231 elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
1235 else if ((!strcmp(ev->key, "Right")) ||
1236 ((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
1238 elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
1242 else if ((!strcmp(ev->key, "Up")) ||
1243 ((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
1245 elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
1249 else if ((!strcmp(ev->key, "Down")) ||
1250 ((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
1252 elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
1260 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1261 if (ret) *ret = EINA_TRUE;
1265 _deferred_ecore_evas_free(void *data)
1267 ecore_evas_free(data);
1268 _elm_win_deferred_free--;
1272 _elm_win_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1274 Elm_Win_Smart_Data *sd = _pd;
1276 if (!evas_object_visible_get(obj))
1277 _elm_win_state_eval_queue();
1278 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
1282 if (sd->shot.info) _shot_handle(sd);
1286 _elm_win_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1288 Elm_Win_Smart_Data *sd = _pd;
1290 if (evas_object_visible_get(obj))
1291 _elm_win_state_eval_queue();
1292 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
1298 evas_object_hide(sd->frame_obj);
1302 evas_object_hide(sd->img_obj);
1304 if (sd->pointer.obj)
1306 evas_object_hide(sd->pointer.obj);
1307 ecore_evas_hide(sd->pointer.ee);
1312 _elm_win_on_parent_del(void *data,
1313 Evas *e EINA_UNUSED,
1315 void *event_info EINA_UNUSED)
1317 ELM_WIN_DATA_GET(data, sd);
1319 if (obj == sd->parent) sd->parent = NULL;
1323 _elm_win_focus_target_move(void *data,
1324 Evas *e EINA_UNUSED,
1325 Evas_Object *obj EINA_UNUSED,
1326 void *event_info EINA_UNUSED)
1328 ELM_WIN_DATA_GET(data, sd);
1330 sd->focus_highlight.geometry_changed = EINA_TRUE;
1331 _elm_win_focus_highlight_reconfigure_job_start(sd);
1335 _elm_win_focus_target_resize(void *data,
1336 Evas *e EINA_UNUSED,
1337 Evas_Object *obj EINA_UNUSED,
1338 void *event_info EINA_UNUSED)
1340 ELM_WIN_DATA_GET(data, sd);
1342 sd->focus_highlight.geometry_changed = EINA_TRUE;
1343 _elm_win_focus_highlight_reconfigure_job_start(sd);
1347 _elm_win_focus_target_del(void *data,
1348 Evas *e EINA_UNUSED,
1349 Evas_Object *obj EINA_UNUSED,
1350 void *event_info EINA_UNUSED)
1352 ELM_WIN_DATA_GET(data, sd);
1354 sd->focus_highlight.cur.target = NULL;
1356 _elm_win_focus_highlight_reconfigure_job_start(sd);
1359 static Evas_Object *
1360 _elm_win_focus_target_get(Evas_Object *obj)
1362 Evas_Object *o = obj;
1366 if (elm_widget_is(o))
1368 if (!elm_widget_highlight_ignore_get(o))
1370 o = elm_widget_parent_get(o);
1372 o = evas_object_smart_parent_get(o);
1376 o = elm_widget_parent_widget_get(o);
1378 o = evas_object_smart_parent_get(o);
1387 _elm_win_focus_target_callbacks_add(Elm_Win_Smart_Data *sd)
1389 Evas_Object *obj = sd->focus_highlight.cur.target;
1392 evas_object_event_callback_add
1393 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1394 evas_object_event_callback_add
1395 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1396 evas_object_event_callback_add
1397 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1401 _elm_win_focus_target_callbacks_del(Elm_Win_Smart_Data *sd)
1403 Evas_Object *obj = sd->focus_highlight.cur.target;
1405 evas_object_event_callback_del_full
1406 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1407 evas_object_event_callback_del_full
1408 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1409 evas_object_event_callback_del_full
1410 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1414 _elm_win_object_focus_in(void *data,
1415 Evas *e EINA_UNUSED,
1418 Evas_Object *obj = event_info, *target;
1419 ELM_WIN_DATA_GET(data, sd);
1421 if (sd->focus_highlight.cur.target == obj)
1424 target = _elm_win_focus_target_get(obj);
1425 sd->focus_highlight.cur.target = target;
1426 if (target && elm_widget_highlight_in_theme_get(target))
1427 sd->focus_highlight.cur.in_theme = EINA_TRUE;
1429 _elm_win_focus_target_callbacks_add(sd);
1431 _elm_win_focus_highlight_reconfigure_job_start(sd);
1435 _elm_win_object_focus_out(void *data,
1436 Evas *e EINA_UNUSED,
1437 void *event_info EINA_UNUSED)
1439 ELM_WIN_DATA_GET(data, sd);
1441 if (!sd->focus_highlight.cur.target)
1444 if (!sd->focus_highlight.cur.in_theme)
1445 _elm_win_focus_target_callbacks_del(sd);
1447 sd->focus_highlight.cur.target = NULL;
1448 sd->focus_highlight.cur.in_theme = EINA_FALSE;
1450 _elm_win_focus_highlight_reconfigure_job_start(sd);
1454 _elm_win_focus_highlight_shutdown(Elm_Win_Smart_Data *sd)
1456 _elm_win_focus_highlight_reconfigure_job_stop(sd);
1457 if (sd->focus_highlight.cur.target)
1459 elm_widget_signal_emit(sd->focus_highlight.cur.target,
1460 "elm,action,focus_highlight,hide", "elm");
1461 _elm_win_focus_target_callbacks_del(sd);
1462 sd->focus_highlight.cur.target = NULL;
1464 ELM_SAFE_FREE(sd->focus_highlight.fobj, evas_object_del);
1466 evas_event_callback_del_full
1467 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1468 _elm_win_object_focus_in, sd->obj);
1469 evas_event_callback_del_full
1470 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1471 _elm_win_object_focus_out, sd->obj);
1475 _win_img_hide(void *data,
1476 Evas *e EINA_UNUSED,
1477 Evas_Object *obj EINA_UNUSED,
1478 void *event_info EINA_UNUSED)
1480 elm_widget_focus_hide_handle(data);
1484 _win_img_mouse_up(void *data,
1485 Evas *e EINA_UNUSED,
1486 Evas_Object *obj EINA_UNUSED,
1489 Evas_Event_Mouse_Up *ev = event_info;
1490 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1491 elm_widget_focus_mouse_up_handle(data);
1495 _win_img_focus_in(void *data,
1496 Evas *e EINA_UNUSED,
1497 Evas_Object *obj EINA_UNUSED,
1498 void *event_info EINA_UNUSED)
1500 elm_widget_focus_steal(data);
1504 _win_img_focus_out(void *data,
1505 Evas *e EINA_UNUSED,
1506 Evas_Object *obj EINA_UNUSED,
1507 void *event_info EINA_UNUSED)
1509 elm_widget_focused_object_clear(data);
1513 _elm_win_on_img_obj_del(void *data,
1514 Evas *e EINA_UNUSED,
1515 Evas_Object *obj EINA_UNUSED,
1516 void *event_info EINA_UNUSED)
1518 ELM_WIN_DATA_GET(data, sd);
1519 _elm_win_img_callbacks_del(sd->obj, sd->img_obj);
1524 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
1526 evas_object_event_callback_del_full
1527 (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1528 evas_object_event_callback_del_full
1529 (imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
1530 evas_object_event_callback_del_full
1531 (imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
1532 evas_object_event_callback_del_full
1533 (imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
1534 evas_object_event_callback_del_full
1535 (imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
1539 _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1541 Elm_Win_Smart_Data *sd = _pd;
1543 evas_object_event_callback_del_full(sd->layout,
1544 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1545 _elm_win_on_resize_obj_changed_size_hints,
1547 evas_object_del(sd->box);
1548 evas_object_del(sd->layout);
1550 /* NB: child deletion handled by parent's smart del */
1552 if ((trap) && (trap->del))
1553 trap->del(sd->trap_data, obj);
1557 evas_object_event_callback_del_full
1558 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
1562 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1564 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1566 _elm_win_state_eval_queue();
1570 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1571 ecore_evas_callback_resize_set(sd->ee, NULL);
1574 ecore_job_del(sd->deferred_resize_job);
1575 ecore_job_del(sd->deferred_child_eval_job);
1576 eina_stringshare_del(sd->shot.info);
1577 ecore_timer_del(sd->shot.timer);
1579 #ifdef HAVE_ELEMENTARY_X
1580 ecore_event_handler_del(sd->x.client_message_handler);
1581 ecore_event_handler_del(sd->x.property_handler);
1586 _elm_win_img_callbacks_del(obj, sd->img_obj);
1593 ecore_job_add(_deferred_ecore_evas_free, sd->ee);
1594 _elm_win_deferred_free++;
1598 _elm_win_focus_highlight_shutdown(sd);
1599 eina_stringshare_del(sd->focus_highlight.style);
1601 eina_stringshare_del(sd->title);
1602 eina_stringshare_del(sd->icon_name);
1603 eina_stringshare_del(sd->role);
1604 evas_object_del(sd->icon);
1605 evas_object_del(sd->main_menu);
1607 _elm_win_profile_del(sd);
1608 _elm_win_available_profiles_del(sd);
1610 /* Don't let callback in the air that point to sd */
1611 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1612 ecore_evas_callback_resize_set(sd->ee, NULL);
1613 ecore_evas_callback_mouse_in_set(sd->ee, NULL);
1614 ecore_evas_callback_focus_in_set(sd->ee, NULL);
1615 ecore_evas_callback_focus_out_set(sd->ee, NULL);
1616 ecore_evas_callback_move_set(sd->ee, NULL);
1617 ecore_evas_callback_state_change_set(sd->ee, NULL);
1619 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1621 if ((!_elm_win_list) &&
1622 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
1624 edje_file_cache_flush();
1625 edje_collection_cache_flush();
1626 evas_image_cache_flush(evas_object_evas_get(obj));
1627 evas_font_cache_flush(evas_object_evas_get(obj));
1633 _elm_win_obj_intercept_show(void *data,
1636 ELM_WIN_DATA_GET(data, sd);
1638 // this is called to make sure all smart containers have calculated their
1639 // sizes BEFORE we show the window to make sure it initially appears at
1640 // our desired size (ie min size is known first)
1641 evas_smart_objects_calculate(evas_object_evas_get(obj));
1644 evas_object_show(sd->frame_obj);
1648 evas_object_show(sd->img_obj);
1650 if (sd->pointer.obj)
1652 ecore_evas_show(sd->pointer.ee);
1653 evas_object_show(sd->pointer.obj);
1655 evas_object_show(obj);
1659 _elm_win_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1661 Evas_Coord x = va_arg(*list, Evas_Coord);
1662 Evas_Coord y = va_arg(*list, Evas_Coord);
1663 Elm_Win_Smart_Data *sd = _pd;
1667 if ((x != sd->screen.x) || (y != sd->screen.y))
1671 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1677 TRAP(sd, move, x, y);
1678 if (!ecore_evas_override_get(sd->ee)) return;
1681 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
1683 if (ecore_evas_override_get(sd->ee))
1687 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1691 /* FIXME: We should update ecore_wl_window_location here !! */
1703 _elm_win_smart_resize(Eo *obj, void *_pd, va_list *list)
1705 Evas_Coord w = va_arg(*list, Evas_Coord);
1706 Evas_Coord h = va_arg(*list, Evas_Coord);
1708 Elm_Win_Smart_Data *sd = _pd;
1710 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
1718 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
1725 evas_object_image_size_set(sd->img_obj, w, h);
1728 TRAP(sd, resize, w, h);
1732 _elm_win_delete_request(Ecore_Evas *ee)
1734 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1741 int autodel = sd->autodel;
1742 sd->autodel_clear = &autodel;
1743 evas_object_ref(obj);
1744 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL);
1745 // FIXME: if above callback deletes - then the below will be invalid
1746 if (autodel) evas_object_del(obj);
1747 else sd->autodel_clear = NULL;
1748 evas_object_unref(obj);
1752 _elm_ee_xwin_get(const Ecore_Evas *ee)
1754 #ifdef HAVE_ELEMENTARY_X
1755 const char *engine_name;
1758 engine_name = ecore_evas_engine_name_get(ee);
1759 if (EINA_UNLIKELY(!engine_name)) return 0;
1761 if (!strcmp(engine_name, ELM_SOFTWARE_X11))
1763 return ecore_evas_software_x11_window_get(ee);
1765 else if (!strcmp(engine_name, ELM_OPENGL_X11))
1767 return ecore_evas_gl_x11_window_get(ee);
1769 else if (!strcmp(engine_name, ELM_SOFTWARE_WIN32))
1771 return (long)ecore_evas_win32_window_get(ee);
1777 #ifdef HAVE_ELEMENTARY_X
1779 _elm_win_xwindow_get(Elm_Win_Smart_Data *sd)
1781 sd->x.xwin = _elm_ee_xwin_get(sd->ee);
1786 _elm_ee_wlwin_get(const Ecore_Evas *ee)
1788 #ifdef HAVE_ELEMENTARY_WAYLAND
1789 const char *engine_name;
1791 if (!ee) return NULL;
1793 engine_name = ecore_evas_engine_name_get(ee);
1794 if (EINA_UNLIKELY(!engine_name)) return NULL;
1796 if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
1797 (!strcmp(engine_name, ELM_WAYLAND_EGL)))
1799 return ecore_evas_wayland_window_get(ee);
1807 #ifdef HAVE_ELEMENTARY_WAYLAND
1809 _elm_win_wlwindow_get(Elm_Win_Smart_Data *sd)
1811 sd->wl.win = _elm_ee_wlwin_get(sd->ee);
1815 #ifdef HAVE_ELEMENTARY_X
1817 _elm_win_xwin_update(Elm_Win_Smart_Data *sd)
1821 _elm_win_xwindow_get(sd);
1824 ELM_WIN_DATA_GET(sd->parent, sdp);
1828 ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin);
1832 if (!sd->x.xwin) return; /* nothing more to do */
1835 if (!s) s = _elm_appname;
1837 if (sd->icon_name) s = sd->icon_name;
1838 ecore_x_icccm_icon_name_set(sd->x.xwin, s);
1839 ecore_x_netwm_icon_name_set(sd->x.xwin, s);
1842 if (s) ecore_x_icccm_window_role_set(sd->x.xwin, s);
1849 data = evas_object_image_data_get(sd->icon, EINA_FALSE);
1853 int w = 0, h = 0, stride, x, y;
1857 evas_object_image_size_get(sd->icon, &w, &h);
1858 stride = evas_object_image_stride_get(sd->icon);
1859 if ((w > 0) && (h > 0) &&
1860 (stride >= (int)(w * sizeof(unsigned int))))
1864 ic.data = malloc(w * h * sizeof(unsigned int));
1868 p = (unsigned char *)data;
1869 p2 = (unsigned int *)ic.data;
1870 for (y = 0; y < h; y++)
1872 for (x = 0; x < w; x++)
1874 *p2 = *((unsigned int *)p);
1875 p += sizeof(unsigned int);
1878 p += (stride - (w * sizeof(unsigned int)));
1880 ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
1884 evas_object_image_data_set(sd->icon, data);
1891 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_NORMAL);
1894 case ELM_WIN_DIALOG_BASIC:
1895 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DIALOG);
1898 case ELM_WIN_DESKTOP:
1899 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
1903 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DOCK);
1906 case ELM_WIN_TOOLBAR:
1907 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
1911 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_MENU);
1914 case ELM_WIN_UTILITY:
1915 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_UTILITY);
1918 case ELM_WIN_SPLASH:
1919 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_SPLASH);
1922 case ELM_WIN_DROPDOWN_MENU:
1923 ecore_x_netwm_window_type_set
1924 (sd->x.xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
1927 case ELM_WIN_POPUP_MENU:
1928 ecore_x_netwm_window_type_set
1929 (sd->x.xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
1932 case ELM_WIN_TOOLTIP:
1933 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
1936 case ELM_WIN_NOTIFICATION:
1937 ecore_x_netwm_window_type_set
1938 (sd->x.xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
1942 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_COMBO);
1946 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DND);
1952 ecore_x_e_virtual_keyboard_state_set
1953 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
1954 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
1955 ecore_x_e_illume_indicator_state_set
1956 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
1957 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
1958 ecore_x_e_illume_indicator_state_set
1959 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
1967 * Resize the window according to window layout's min and weight.
1968 * If the window layout's weight is 0.0, the window max is limited to layout's
1971 * This is called when the window layout's weight hint is changed or when the
1972 * window is rotated.
1974 * @param obj window object
1977 _elm_win_resize_objects_eval(Evas_Object *obj)
1979 ELM_WIN_DATA_GET(obj, sd);
1980 Evas_Coord w, h, minw, minh, maxw, maxh;
1983 evas_object_size_hint_min_get(sd->layout, &minw, &minh);
1984 if (minw < 1) minw = 1;
1985 if (minh < 1) minh = 1;
1987 evas_object_size_hint_weight_get(sd->layout, &wx, &wy);
1988 if (!wx) maxw = minw;
1990 if (!wy) maxh = minh;
1993 evas_object_size_hint_min_set(obj, minw, minh);
1994 evas_object_size_hint_max_set(obj, maxw, maxh);
1995 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1996 if (w < minw) w = minw;
1997 if (h < minh) h = minh;
1998 if (w > maxw) w = maxw;
1999 if (h > maxh) h = maxh;
2000 evas_object_move(obj, 0, 0);
2001 evas_object_resize(obj, w, h);
2005 _elm_win_on_resize_obj_changed_size_hints(void *data,
2006 Evas *e EINA_UNUSED,
2007 Evas_Object *obj EINA_UNUSED,
2008 void *event_info EINA_UNUSED)
2010 _elm_win_resize_objects_eval(data);
2014 _elm_win_shutdown(void)
2016 while (_elm_win_list) evas_object_del(_elm_win_list->data);
2017 ELM_SAFE_FREE(_elm_win_state_eval_job, ecore_job_del);
2021 _elm_win_rescale(Elm_Theme *th,
2022 Eina_Bool use_theme)
2029 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2030 elm_widget_theme(obj);
2034 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2035 elm_widget_theme_specific(obj, th, EINA_FALSE);
2040 _elm_win_access(Eina_Bool is_access)
2047 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2049 elm_widget_access(obj, is_access);
2051 /* floating orphan object. if there are A, B, C objects and user does
2052 as below, then there would be floating orphan objects.
2054 1. elm_object_content_set(layout, A);
2055 2. elm_object_content_set(layout, B);
2056 3. elm_object_content_set(layout, C);
2058 now, the object A and B are floating orphan objects */
2063 fobj = evas_object_below_get(fobj);
2066 if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
2068 elm_widget_access(fobj, is_access);
2074 evas = evas_object_evas_get(obj);
2075 if (evas) _elm_access_object_highlight_disable(evas);
2081 _elm_win_translate(void)
2086 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2087 elm_widget_translate(obj);
2090 #ifdef HAVE_ELEMENTARY_X
2092 _elm_win_client_message(void *data,
2093 int type EINA_UNUSED,
2096 ELM_WIN_DATA_GET(data, sd);
2097 Ecore_X_Event_Client_Message *e = event;
2099 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
2100 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
2102 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2104 Evas *evas = evas_object_evas_get(sd->obj);
2107 edje_file_cache_flush();
2108 edje_collection_cache_flush();
2109 evas_image_cache_flush(evas);
2110 evas_font_cache_flush(evas);
2114 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
2116 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2118 Evas *evas = evas_object_evas_get(sd->obj);
2121 edje_file_cache_flush();
2122 edje_collection_cache_flush();
2123 evas_image_cache_flush(evas);
2124 evas_font_cache_flush(evas);
2125 evas_render_dump(evas);
2129 else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
2131 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2133 if ((unsigned int)e->data.l[1] ==
2134 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
2136 // XXX: call right access func
2138 else if ((unsigned int)e->data.l[1] ==
2139 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV)
2141 // XXX: call right access func
2143 else if ((unsigned int)e->data.l[1] ==
2144 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
2146 _elm_access_highlight_object_activate
2147 (sd->obj, ELM_ACTIVATE_DEFAULT);
2149 else if ((unsigned int)e->data.l[1] ==
2150 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
2152 /* there would be better way to read highlight object */
2154 evas = evas_object_evas_get(sd->obj);
2155 if (!evas) return ECORE_CALLBACK_PASS_ON;
2157 _elm_access_mouse_event_enabled_set(EINA_TRUE);
2159 evas_event_feed_mouse_in(evas, 0, NULL);
2160 evas_event_feed_mouse_move
2161 (evas, e->data.l[2], e->data.l[3], 0, NULL);
2163 _elm_access_mouse_event_enabled_set(EINA_FALSE);
2165 else if ((unsigned int)e->data.l[1] ==
2166 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
2168 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
2170 else if ((unsigned int)e->data.l[1] ==
2171 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
2173 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
2175 else if ((unsigned int)e->data.l[1] ==
2176 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
2178 _elm_access_highlight_object_activate
2179 (sd->obj, ELM_ACTIVATE_UP);
2181 else if ((unsigned int)e->data.l[1] ==
2182 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
2184 _elm_access_highlight_object_activate
2185 (sd->obj, ELM_ACTIVATE_DOWN);
2189 return ECORE_CALLBACK_PASS_ON;
2193 _elm_win_property_change(void *data,
2194 int type EINA_UNUSED,
2197 ELM_WIN_DATA_GET(data, sd);
2198 Ecore_X_Event_Window_Property *e = event;
2200 if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE)
2202 if (e->win == sd->x.xwin)
2204 sd->indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win);
2205 evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
2208 return ECORE_CALLBACK_PASS_ON;
2213 _elm_win_focus_highlight_hide(void *data EINA_UNUSED,
2215 const char *emission EINA_UNUSED,
2216 const char *source EINA_UNUSED)
2218 evas_object_hide(obj);
2222 _elm_win_focus_highlight_anim_end(void *data,
2224 const char *emission EINA_UNUSED,
2225 const char *source EINA_UNUSED)
2227 ELM_WIN_DATA_GET(data, sd);
2229 _elm_win_focus_highlight_simple_setup(sd, obj);
2233 _elm_win_focus_highlight_init(Elm_Win_Smart_Data *sd)
2235 evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
2236 _elm_win_object_focus_in, sd->obj);
2237 evas_event_callback_add(sd->evas,
2238 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
2239 _elm_win_object_focus_out, sd->obj);
2241 sd->focus_highlight.cur.target = evas_focus_get(sd->evas);
2242 sd->focus_highlight.fobj = edje_object_add(sd->evas);
2243 sd->focus_highlight.theme_changed = EINA_TRUE;
2245 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2246 "elm,action,focus,hide,end", "*",
2247 _elm_win_focus_highlight_hide, NULL);
2248 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2249 "elm,action,focus,anim,end", "*",
2250 _elm_win_focus_highlight_anim_end, sd->obj);
2251 _elm_win_focus_highlight_reconfigure_job_start(sd);
2255 _elm_win_frame_cb_move_start(void *data,
2256 Evas_Object *obj EINA_UNUSED,
2257 const char *sig EINA_UNUSED,
2260 ELM_WIN_DATA_GET(data, sd);
2264 #ifdef HAVE_ELEMENTARY_WAYLAND
2265 if (!strcmp(source, "elm"))
2266 ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_HAND1);
2268 ecore_wl_window_cursor_default_restore(sd->wl.win);
2273 /* FIXME: Change mouse pointer */
2275 /* NB: Wayland handles moving surfaces by itself so we cannot
2276 * specify a specific x/y we want. Instead, we will pass in the
2277 * existing x/y values so they can be recorded as 'previous'
2278 * position. The new position will get updated automatically when
2279 * the move is finished */
2281 ecore_evas_wayland_move(sd->ee, sd->screen.x, sd->screen.y);
2285 _elm_win_frame_cb_move_stop(void *data,
2286 Evas_Object *obj EINA_UNUSED,
2287 const char *sig EINA_UNUSED,
2288 const char *source EINA_UNUSED)
2290 ELM_WIN_DATA_GET(data, sd);
2294 #ifdef HAVE_ELEMENTARY_WAYLAND
2295 ecore_wl_window_cursor_default_restore(sd->wl.win);
2299 #ifdef HAVE_ELEMENTARY_WAYLAND
2306 static struct _resize_info _border_side[4] =
2308 { ELM_CURSOR_TOP_SIDE, 1 },
2309 { ELM_CURSOR_LEFT_SIDE, 4 },
2310 { ELM_CURSOR_BOTTOM_SIDE, 2 },
2311 { ELM_CURSOR_RIGHT_SIDE, 8 },
2314 static struct _resize_info _border_corner[4] =
2316 { ELM_CURSOR_TOP_LEFT_CORNER, 5 },
2317 { ELM_CURSOR_BOTTOM_LEFT_CORNER, 6 },
2318 { ELM_CURSOR_BOTTOM_RIGHT_CORNER, 10 },
2319 { ELM_CURSOR_TOP_RIGHT_CORNER, 9 },
2324 _elm_win_frame_obj_update(Elm_Win_Smart_Data *sd)
2330 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
2331 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2332 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2334 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2336 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2337 (w != (fw - ow)) || (h != (fh - oh)))
2339 evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
2340 (fw - ow), (fh - oh));
2343 #ifdef HAVE_ELEMENTARY_WAYLAND
2344 ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
2349 _elm_win_frame_obj_move(void *data,
2350 Evas *e EINA_UNUSED,
2351 Evas_Object *obj EINA_UNUSED,
2352 void *event_info EINA_UNUSED)
2354 Elm_Win_Smart_Data *sd;
2356 if (!(sd = data)) return;
2357 if (!sd->client_obj) return;
2359 _elm_win_frame_obj_update(sd);
2363 _elm_win_frame_obj_resize(void *data,
2364 Evas *e EINA_UNUSED,
2365 Evas_Object *obj EINA_UNUSED,
2366 void *event_info EINA_UNUSED)
2368 Elm_Win_Smart_Data *sd;
2370 if (!(sd = data)) return;
2371 if (!sd->client_obj) return;
2373 _elm_win_frame_obj_update(sd);
2377 _elm_win_frame_cb_resize_show(void *data,
2378 Evas_Object *obj EINA_UNUSED,
2379 const char *sig EINA_UNUSED,
2382 ELM_WIN_DATA_GET(data, sd);
2385 if (sd->resizing) return;
2387 #ifdef HAVE_ELEMENTARY_WAYLAND
2390 if (!strcmp(source, "elm.event.resize.t"))
2391 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2392 _border_side[(0 + i) % 4].name);
2393 else if (!strcmp(source, "elm.event.resize.b"))
2394 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2395 _border_side[(2 + i) % 4].name);
2396 else if (!strcmp(source, "elm.event.resize.l"))
2397 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2398 _border_side[(1 + i) % 4].name);
2399 else if (!strcmp(source, "elm.event.resize.r"))
2400 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2401 _border_side[(3 + i) % 4].name);
2402 else if (!strcmp(source, "elm.event.resize.tl"))
2403 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2404 _border_corner[(0 + i) % 4].name);
2405 else if (!strcmp(source, "elm.event.resize.tr"))
2406 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2407 _border_corner[(3 + i) % 4].name);
2408 else if (!strcmp(source, "elm.event.resize.bl"))
2409 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2410 _border_corner[(1 + i) % 4].name);
2411 else if (!strcmp(source, "elm.event.resize.br"))
2412 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2413 _border_corner[(2 + i) % 4].name);
2415 ecore_wl_window_cursor_default_restore(sd->wl.win);
2422 _elm_win_frame_cb_resize_hide(void *data,
2423 Evas_Object *obj EINA_UNUSED,
2424 const char *sig EINA_UNUSED,
2425 const char *source EINA_UNUSED)
2427 ELM_WIN_DATA_GET(data, sd);
2430 if (sd->resizing) return;
2432 #ifdef HAVE_ELEMENTARY_WAYLAND
2433 ecore_wl_window_cursor_default_restore(sd->wl.win);
2438 _elm_win_frame_cb_resize_start(void *data,
2439 Evas_Object *obj EINA_UNUSED,
2440 const char *sig EINA_UNUSED,
2443 #ifdef HAVE_ELEMENTARY_WAYLAND
2444 ELM_WIN_DATA_GET(data, sd);
2448 if (sd->resizing) return;
2450 sd->resizing = EINA_TRUE;
2452 if (!strcmp(source, "elm.event.resize.t"))
2453 sd->resize_location = _border_side[(0 + i) % 4].location;
2454 else if (!strcmp(source, "elm.event.resize.b"))
2455 sd->resize_location = _border_side[(2 + i) % 4].location;
2456 else if (!strcmp(source, "elm.event.resize.l"))
2457 sd->resize_location = _border_side[(1 + i) % 4].location;
2458 else if (!strcmp(source, "elm.event.resize.r"))
2459 sd->resize_location = _border_side[(3 + i) % 4].location;
2460 else if (!strcmp(source, "elm.event.resize.tl"))
2461 sd->resize_location = _border_corner[(0 + i) % 4].location;
2462 else if (!strcmp(source, "elm.event.resize.tr"))
2463 sd->resize_location = _border_corner[(3 + i) % 4].location;
2464 else if (!strcmp(source, "elm.event.resize.bl"))
2465 sd->resize_location = _border_corner[(1 + i) % 4].location;
2466 else if (!strcmp(source, "elm.event.resize.br"))
2467 sd->resize_location = _border_corner[(2 + i) % 4].location;
2469 sd->resize_location = 0;
2471 if (sd->resize_location > 0)
2472 ecore_evas_wayland_resize(sd->ee, sd->resize_location);
2480 _elm_win_frame_cb_minimize(void *data,
2481 Evas_Object *obj EINA_UNUSED,
2482 const char *sig EINA_UNUSED,
2483 const char *source EINA_UNUSED)
2485 ELM_WIN_DATA_GET(data, sd);
2488 // sd->iconified = EINA_TRUE;
2489 TRAP(sd, iconified_set, EINA_TRUE);
2493 _elm_win_frame_maximized_state_update(Elm_Win_Smart_Data *sd, Eina_Bool maximized)
2495 const char *emission;
2498 emission = "elm,state,maximized";
2500 emission = "elm,state,unmaximized";
2502 edje_object_signal_emit(sd->frame_obj, emission, "elm");
2503 edje_object_message_signal_process(sd->frame_obj);
2504 evas_object_smart_calculate(sd->frame_obj);
2506 _elm_win_frame_obj_update(sd);
2510 _elm_win_frame_cb_maximize(void *data,
2511 Evas_Object *obj EINA_UNUSED,
2512 const char *sig EINA_UNUSED,
2513 const char *source EINA_UNUSED)
2516 ELM_WIN_DATA_GET(data, sd);
2519 if (sd->maximized) value = EINA_FALSE;
2520 else value = EINA_TRUE;
2522 _elm_win_frame_maximized_state_update(sd, value);
2524 TRAP(sd, maximized_set, value);
2528 _elm_win_frame_cb_close(void *data,
2529 Evas_Object *obj EINA_UNUSED,
2530 const char *sig EINA_UNUSED,
2531 const char *source EINA_UNUSED)
2533 ELM_WIN_DATA_GET(data, sd);
2536 /* FIXME: After the current freeze, this should be handled differently.
2538 * Ideally, we would want to mimic the X11 backend and use something
2539 * like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
2540 * inside of ecore_evas. That would be the 'proper' way, but since we are
2541 * in a freeze right now, I cannot add a new event value, or a new
2542 * event structure to ecore_wayland.
2544 * So yes, this is a temporary 'stop-gap' solution which will be fixed
2545 * when the freeze is over, but it does fix a trac bug for now, and in a
2546 * way which does not break API or the freeze. - dh
2553 int autodel = sd->autodel;
2554 sd->autodel_clear = &autodel;
2555 evas_object_ref(win);
2556 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
2557 // FIXME: if above callback deletes - then the below will be invalid
2558 if (autodel) evas_object_del(win);
2559 else sd->autodel_clear = NULL;
2560 evas_object_unref(win);
2564 _elm_win_frame_add(Elm_Win_Smart_Data *sd,
2567 Evas_Object *obj = sd->obj;
2571 sd->frame_obj = edje_object_add(sd->evas);
2572 layer = evas_object_layer_get(obj);
2573 evas_object_layer_set(sd->frame_obj, layer + 1);
2574 if (!elm_widget_theme_object_set
2575 (sd->obj, sd->frame_obj, "border", "base", style))
2577 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2581 sd->spacer_obj = evas_object_rectangle_add(sd->evas);
2582 evas_object_color_set(sd->spacer_obj, 0, 0, 0, 0);
2583 evas_object_repeat_events_set(sd->spacer_obj, EINA_TRUE);
2584 edje_object_part_swallow(sd->frame_obj, "elm.swallow.frame_spacer",
2587 sd->client_obj = evas_object_rectangle_add(sd->evas);
2588 evas_object_color_set(sd->client_obj, 0, 0, 0, 0);
2589 /* NB: Tried pass_events here, but that fails to send events */
2590 evas_object_repeat_events_set(sd->client_obj, EINA_TRUE);
2591 edje_object_part_swallow(sd->frame_obj, "elm.swallow.client",
2594 evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
2596 evas_object_event_callback_add
2597 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2598 evas_object_event_callback_add
2599 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2601 /* NB: Do NOT remove these calls !! Needed to calculate proper
2602 * framespace on inital show of the window */
2603 edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
2604 evas_object_move(sd->frame_obj, 0, 0);
2605 evas_object_resize(sd->frame_obj, mw, mh);
2606 evas_object_smart_calculate(sd->frame_obj);
2608 edje_object_signal_callback_add
2609 (sd->frame_obj, "elm,action,move,start", "elm",
2610 _elm_win_frame_cb_move_start, obj);
2611 edje_object_signal_callback_add
2612 (sd->frame_obj, "elm,action,move,stop", "elm",
2613 _elm_win_frame_cb_move_stop, obj);
2614 edje_object_signal_callback_add
2615 (sd->frame_obj, "elm,action,resize,show", "*",
2616 _elm_win_frame_cb_resize_show, obj);
2617 edje_object_signal_callback_add
2618 (sd->frame_obj, "elm,action,resize,hide", "*",
2619 _elm_win_frame_cb_resize_hide, obj);
2620 edje_object_signal_callback_add
2621 (sd->frame_obj, "elm,action,resize,start", "*",
2622 _elm_win_frame_cb_resize_start, obj);
2623 edje_object_signal_callback_add
2624 (sd->frame_obj, "elm,action,minimize", "elm",
2625 _elm_win_frame_cb_minimize, obj);
2626 edje_object_signal_callback_add
2627 (sd->frame_obj, "elm,action,maximize", "elm",
2628 _elm_win_frame_cb_maximize, obj);
2629 edje_object_signal_callback_add
2630 (sd->frame_obj, "elm,action,close", "elm", _elm_win_frame_cb_close, obj);
2634 edje_object_part_text_escaped_set
2635 (sd->frame_obj, "elm.text.title", sd->title);
2638 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2639 ecore_evas_resize(sd->ee, w, h);
2643 _elm_win_frame_del(Elm_Win_Smart_Data *sd)
2647 ELM_SAFE_FREE(sd->client_obj, evas_object_del);
2651 evas_object_event_callback_del_full
2652 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2653 evas_object_event_callback_del_full
2654 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2656 edje_object_signal_callback_del
2657 (sd->frame_obj, "elm,action,move,start", "elm",
2658 _elm_win_frame_cb_move_start);
2659 edje_object_signal_callback_del
2660 (sd->frame_obj, "elm,action,move,stop", "elm",
2661 _elm_win_frame_cb_move_stop);
2662 edje_object_signal_callback_del
2663 (sd->frame_obj, "elm,action,resize,show", "*",
2664 _elm_win_frame_cb_resize_show);
2665 edje_object_signal_callback_del
2666 (sd->frame_obj, "elm,action,resize,hide", "*",
2667 _elm_win_frame_cb_resize_hide);
2668 edje_object_signal_callback_del
2669 (sd->frame_obj, "elm,action,resize,start", "*",
2670 _elm_win_frame_cb_resize_start);
2671 edje_object_signal_callback_del
2672 (sd->frame_obj, "elm,action,minimize", "elm",
2673 _elm_win_frame_cb_minimize);
2674 edje_object_signal_callback_del
2675 (sd->frame_obj, "elm,action,maximize", "elm",
2676 _elm_win_frame_cb_maximize);
2677 edje_object_signal_callback_del
2678 (sd->frame_obj, "elm,action,close", "elm",
2679 _elm_win_frame_cb_close);
2681 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2684 evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
2685 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2686 ecore_evas_resize(sd->ee, w, h);
2691 _debug_key_down(void *data EINA_UNUSED,
2692 Evas *e EINA_UNUSED,
2696 Evas_Event_Key_Down *ev = event_info;
2698 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
2701 if ((strcmp(ev->key, "F12")) ||
2702 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
2705 INF("Tree graph generated.");
2706 elm_object_tree_dot_dump(obj, "./dump.dot");
2712 _win_inlined_image_set(Elm_Win_Smart_Data *sd)
2714 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);
2715 evas_object_image_filled_set(sd->img_obj, EINA_TRUE);
2717 evas_object_event_callback_add
2718 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, sd->obj);
2719 evas_object_event_callback_add
2720 (sd->img_obj, EVAS_CALLBACK_HIDE, _win_img_hide, sd->obj);
2721 evas_object_event_callback_add
2722 (sd->img_obj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, sd->obj);
2723 evas_object_event_callback_add
2724 (sd->img_obj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, sd->obj);
2725 evas_object_event_callback_add
2726 (sd->img_obj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, sd->obj);
2730 _elm_win_on_icon_del(void *data,
2731 Evas *e EINA_UNUSED,
2733 void *event_info EINA_UNUSED)
2735 ELM_WIN_DATA_GET(data, sd);
2737 if (sd->icon == obj) sd->icon = NULL;
2741 _elm_win_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
2743 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
2745 elm_widget_can_focus_set(obj, EINA_TRUE);
2747 elm_widget_highlight_ignore_set(obj, EINA_TRUE);
2750 #ifdef HAVE_ELEMENTARY_X
2752 _elm_x_io_err(void *data EINA_UNUSED)
2757 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2758 evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
2764 elm_win_add(Evas_Object *parent,
2768 Evas_Object *obj = eo_add_custom(MY_CLASS, parent, elm_obj_win_constructor(name, type));
2774 _elm_win_cb_hide(void *data EINA_UNUSED,
2775 Evas *e EINA_UNUSED,
2776 Evas_Object *obj EINA_UNUSED,
2777 void *event_info EINA_UNUSED)
2779 _elm_win_state_eval_queue();
2783 _elm_win_cb_show(void *data EINA_UNUSED,
2784 Evas *e EINA_UNUSED,
2785 Evas_Object *obj EINA_UNUSED,
2786 void *event_info EINA_UNUSED)
2788 _elm_win_state_eval_queue();
2794 * Recalculate the size of window considering its resize objects' weight and
2795 * min size. If any of its resize objects' weight equals to 0.0, window
2796 * layout's weight will be set to 0.0.
2798 * @param o box object
2799 * @param p box's private data
2800 * @param data window object
2803 _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
2807 Evas_Object_Box_Option *opt;
2808 Evas_Coord x, y, w, h;
2810 Evas_Coord minw = -1, minh = -1;
2811 double weight_x = EVAS_HINT_EXPAND;
2812 double weight_y = EVAS_HINT_EXPAND;
2814 EINA_LIST_FOREACH(p->children, l, opt)
2817 evas_object_size_hint_weight_get(child, &wx, &wy);
2818 if (wx == 0.0) weight_x = 0;
2819 if (wy == 0.0) weight_y = 0;
2821 evas_object_size_hint_min_get(child, &w, &h);
2822 if (w > minw) minw = w;
2823 if (h > minh) minh = h;
2826 evas_object_size_hint_min_set(o, minw, minh);
2827 evas_object_geometry_get(o, &x, &y, &w, &h);
2828 if (w < minw) w = minw;
2829 if (h < minh) h = minh;
2830 evas_object_resize(o, w, h);
2832 EINA_LIST_FOREACH(p->children, l, opt)
2835 evas_object_move(child, x, y);
2836 evas_object_resize(child, w, h);
2839 ELM_WIN_DATA_GET(data, sd);
2840 evas_object_size_hint_weight_set(sd->layout, weight_x, weight_y);
2841 evas_object_smart_changed(sd->layout);
2845 _win_constructor(Eo *obj, void *_pd, va_list *list)
2847 Elm_Win_Smart_Data *sd = _pd;
2848 sd->obj = obj; // in ctor
2850 const char *name = va_arg(*list, const char *);
2851 Elm_Win_Type type = va_arg(*list, Elm_Win_Type);
2852 Evas_Object *parent;
2855 const char *fontpath, *fallback = NULL;
2857 Elm_Win_Smart_Data tmp_sd;
2859 eo_do(obj, eo_parent_get(&parent));
2861 /* just to store some data while trying out to create a canvas */
2862 memset(&tmp_sd, 0, sizeof(Elm_Win_Smart_Data));
2864 #define FALLBACK_TRY(engine) \
2866 CRI(engine " engine creation failed. Trying default."); \
2868 #define FALLBACK_STORE(engine) \
2871 CRI(engine "Fallback to %s successful.", engine); \
2872 fallback = engine; \
2877 case ELM_WIN_INLINED_IMAGE:
2880 e = evas_object_evas_get(parent);
2885 ee = ecore_evas_ecore_evas_get(e);
2888 tmp_sd.img_obj = ecore_evas_object_image_new(ee);
2889 if (!tmp_sd.img_obj) break;
2891 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
2894 ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
2899 case ELM_WIN_SOCKET_IMAGE:
2900 tmp_sd.ee = ecore_evas_extn_socket_new(1, 1);
2904 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
2906 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2907 FALLBACK_TRY("Software X11");
2910 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2911 FALLBACK_STORE("Software FB");
2914 else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
2916 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2917 FALLBACK_TRY("Software FB");
2920 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2921 FALLBACK_STORE("Software X11");
2924 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
2929 if (_elm_config->vsync)
2931 opt[opt_i] = ECORE_EVAS_GL_X11_OPT_VSYNC;
2938 tmp_sd.ee = ecore_evas_gl_x11_options_new
2939 (NULL, 0, 0, 0, 1, 1, opt);
2941 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
2942 FALLBACK_TRY("OpenGL");
2945 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2946 FALLBACK_STORE("Software X11");
2949 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2950 FALLBACK_STORE("Software FB");
2954 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
2956 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
2957 FALLBACK_TRY("Software Win32");
2959 else if (ENGINE_COMPARE(ELM_SOFTWARE_PSL1GHT))
2961 tmp_sd.ee = ecore_evas_psl1ght_new(NULL, 1, 1);
2962 FALLBACK_TRY("PSL1GHT");
2964 else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
2966 tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
2967 FALLBACK_TRY("Software SDL");
2970 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2971 FALLBACK_STORE("Software X11");
2974 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2975 FALLBACK_STORE("Software FB");
2979 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
2981 tmp_sd.ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
2982 FALLBACK_TRY("Software-16-SDL");
2985 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2986 FALLBACK_STORE("Software X11");
2989 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2990 FALLBACK_STORE("Software FB");
2994 else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
2996 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
2997 FALLBACK_TRY("OpenGL SDL");
3000 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
3001 FALLBACK_STORE("Software X11");
3004 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
3005 FALLBACK_STORE("Software FB");
3009 else if (ENGINE_COMPARE(ELM_OPENGL_COCOA))
3011 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
3012 FALLBACK_TRY("OpenGL Cocoa");
3014 else if (ENGINE_COMPARE(ELM_BUFFER))
3016 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3018 else if (ENGINE_COMPARE(ELM_EWS))
3020 tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
3022 else if (ENGINE_COMPARE(ELM_WAYLAND_SHM))
3024 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
3026 else if (ENGINE_COMPARE(ELM_WAYLAND_EGL))
3028 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
3030 else if (!strncmp(ENGINE_GET(), "shot:", 5))
3032 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3033 ecore_evas_manual_render_set(tmp_sd.ee, EINA_TRUE);
3034 tmp_sd.shot.info = eina_stringshare_add
3043 ERR("Cannot create window.");
3048 eo_do(obj, eo_parent_set(ecore_evas_get(tmp_sd.ee)));
3049 eo_do_super(obj, MY_CLASS, eo_constructor());
3051 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
3052 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
3054 if (getenv("ELM_FIRST_FRAME"))
3055 evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
3056 _elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
3058 /* copying possibly altered fields back */
3059 #define SD_CPY(_field) \
3062 sd->_field = tmp_sd._field; \
3070 if ((trap) && (trap->add))
3071 sd->trap_data = trap->add(obj);
3073 /* complementary actions, which depend on final smart data
3075 if (type == ELM_WIN_INLINED_IMAGE)
3076 _win_inlined_image_set(sd);
3078 #ifdef HAVE_ELEMENTARY_X
3079 else if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
3080 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
3081 ENGINE_COMPARE(ELM_SOFTWARE_8_X11) ||
3082 ENGINE_COMPARE(ELM_OPENGL_X11))
3084 sd->x.client_message_handler = ecore_event_handler_add
3085 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, obj);
3086 sd->x.property_handler = ecore_event_handler_add
3087 (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
3091 else if (!strncmp(ENGINE_GET(), "shot:", 5))
3094 sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
3095 sd->indmode = ELM_WIN_INDICATOR_UNKNOWN;
3097 #ifdef HAVE_ELEMENTARY_X
3098 _elm_win_xwindow_get(sd);
3101 ecore_x_io_error_handler_set(_elm_x_io_err, NULL);
3105 #ifdef HAVE_ELEMENTARY_WAYLAND
3106 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3107 _elm_win_wlwindow_get(sd);
3110 if ((_elm_config->bgpixmap)
3111 #ifdef HAVE_ELEMENTARY_X
3113 (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
3118 TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
3119 // bg pixmap done by x - has other issues like can be redrawn by x before it
3120 // is filled/ready by app
3121 // TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
3124 sd->parent = parent;
3127 evas_object_event_callback_add
3128 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
3130 sd->evas = ecore_evas_get(sd->ee);
3132 evas_object_color_set(obj, 0, 0, 0, 0);
3133 evas_object_move(obj, 0, 0);
3134 evas_object_resize(obj, 1, 1);
3135 evas_object_layer_set(obj, 50);
3136 evas_object_pass_events_set(obj, EINA_TRUE);
3138 if (type == ELM_WIN_INLINED_IMAGE)
3139 elm_widget_parent2_set(obj, parent);
3141 /* use own version of ecore_evas_object_associate() that does TRAP() */
3142 ecore_evas_data_set(sd->ee, "elm_win", obj);
3144 evas_object_event_callback_add
3145 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3146 _elm_win_obj_callback_changed_size_hints, obj);
3148 evas_object_intercept_raise_callback_add
3149 (obj, _elm_win_obj_intercept_raise, obj);
3150 evas_object_intercept_lower_callback_add
3151 (obj, _elm_win_obj_intercept_lower, obj);
3152 evas_object_intercept_stack_above_callback_add
3153 (obj, _elm_win_obj_intercept_stack_above, obj);
3154 evas_object_intercept_stack_below_callback_add
3155 (obj, _elm_win_obj_intercept_stack_below, obj);
3156 evas_object_intercept_layer_set_callback_add
3157 (obj, _elm_win_obj_intercept_layer_set, obj);
3158 evas_object_intercept_show_callback_add
3159 (obj, _elm_win_obj_intercept_show, obj);
3161 TRAP(sd, name_class_set, name, _elm_appname);
3162 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
3163 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3164 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3165 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3166 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3167 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3168 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3169 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3170 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3172 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
3173 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
3175 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
3176 evas_font_path_append(sd->evas, fontpath);
3178 if (!_elm_config->font_hinting)
3179 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_NONE);
3180 else if (_elm_config->font_hinting == 1)
3181 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_AUTO);
3182 else if (_elm_config->font_hinting == 2)
3183 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_BYTECODE);
3185 #ifdef HAVE_ELEMENTARY_X
3186 _elm_win_xwin_update(sd);
3189 _elm_win_list = eina_list_append(_elm_win_list, obj);
3192 if (((fallback) && (!strcmp(fallback, "Software FB"))) ||
3193 ((!fallback) && (ENGINE_COMPARE(ELM_SOFTWARE_FB))))
3195 TRAP(sd, fullscreen_set, 1);
3197 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3198 (ENGINE_COMPARE(ELM_WAYLAND_SHM) ||
3199 ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3200 _elm_win_frame_add(sd, "default");
3202 if (_elm_config->focus_highlight_enable)
3203 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3204 if (_elm_config->focus_highlight_animate)
3205 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3208 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
3209 evas_object_event_callback_add
3210 (obj, EVAS_CALLBACK_KEY_DOWN, _debug_key_down, NULL);
3212 if (evas_object_key_grab(obj, "F12", mask, 0, EINA_TRUE))
3213 INF("Ctrl+F12 key combination exclusive for dot tree generation\n");
3215 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3218 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3219 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3220 (((fallback) && (!strcmp(fallback, "Software FB"))) ||
3221 ((!fallback) && (ENGINE_COMPARE(ELM_SOFTWARE_FB))))))
3224 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3226 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3227 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3228 edje_object_size_min_calc(o, &mw, &mh);
3229 evas_object_resize(o, mw, mh);
3230 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3231 &hx, &hy, NULL, NULL);
3232 sd->pointer.hot_x = hx;
3233 sd->pointer.hot_y = hy;
3234 evas_object_show(o);
3235 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3237 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3242 sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
3243 sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
3245 sd->layout = edje_object_add(sd->evas);
3246 _elm_theme_object_set(obj, sd->layout, "win", "base", "default");
3247 sd->box = evas_object_box_add(sd->evas);
3248 evas_object_box_layout_set(sd->box, _window_layout_stack, obj, NULL);
3249 edje_object_part_swallow(sd->layout, "elm.swallow.contents", sd->box);
3250 evas_object_move(sd->layout, 0, 0);
3251 evas_object_resize(sd->layout, 1, 1);
3252 edje_object_update_hints_set(sd->layout, EINA_TRUE);
3253 evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3254 _elm_win_on_resize_obj_changed_size_hints, obj);
3255 evas_object_show(sd->layout);
3259 _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
3262 ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
3266 elm_win_type_get(const Evas_Object *obj)
3268 ELM_WIN_CHECK(obj) ELM_WIN_UNKNOWN;
3269 Elm_Win_Type ret = ELM_WIN_UNKNOWN;
3270 eo_do((Eo *) obj, elm_obj_win_type_get(&ret));
3275 _type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3277 Elm_Win_Type *ret = va_arg(*list, Elm_Win_Type *);
3278 Elm_Win_Smart_Data *sd = _pd;
3283 elm_win_util_standard_add(const char *name,
3286 Evas_Object *win, *bg;
3288 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
3289 if (!win) return NULL;
3291 elm_win_title_set(win, title);
3292 bg = elm_bg_add(win);
3295 evas_object_del(win);
3298 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3299 elm_win_resize_object_add(win, bg);
3300 evas_object_show(bg);
3306 elm_win_resize_object_add(Evas_Object *obj,
3307 Evas_Object *subobj)
3310 eo_do(obj, elm_obj_win_resize_object_add(subobj));
3314 _resize_object_add(Eo *obj, void *_pd, va_list *list)
3316 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3318 Elm_Win_Smart_Data *sd = _pd;
3320 elm_widget_sub_object_add(obj, subobj);
3322 if (!evas_object_box_append(sd->box, subobj))
3323 ERR("could not append %p to box", subobj);
3327 elm_win_resize_object_del(Evas_Object *obj,
3328 Evas_Object *subobj)
3331 eo_do(obj, elm_obj_win_resize_object_del(subobj));
3335 _resize_object_del(Eo *obj, void *_pd, va_list *list)
3337 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3338 Elm_Win_Smart_Data *sd = _pd;
3340 if (!elm_widget_sub_object_del(obj, subobj))
3341 ERR("could not remove sub object %p from %p", subobj, obj);
3343 evas_object_box_remove(sd->box, subobj);
3347 elm_win_title_set(Evas_Object *obj,
3351 eo_do(obj, elm_obj_win_title_set(title));
3355 _title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3357 const char *title = va_arg(*list, const char *);
3358 Elm_Win_Smart_Data *sd = _pd;
3361 eina_stringshare_replace(&(sd->title), title);
3362 TRAP(sd, title_set, sd->title);
3364 edje_object_part_text_escaped_set
3365 (sd->frame_obj, "elm.text.title", sd->title);
3369 elm_win_title_get(const Evas_Object *obj)
3371 ELM_WIN_CHECK(obj) NULL;
3372 const char *ret = NULL;
3373 eo_do((Eo *) obj, elm_obj_win_title_get(&ret));
3378 _title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3380 const char **ret = va_arg(*list, const char **);
3381 Elm_Win_Smart_Data *sd = _pd;
3386 elm_win_icon_name_set(Evas_Object *obj,
3387 const char *icon_name)
3390 eo_do(obj, elm_obj_win_icon_name_set(icon_name));
3394 _icon_name_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3396 const char *icon_name = va_arg(*list, const char *);
3397 Elm_Win_Smart_Data *sd = _pd;
3399 if (!icon_name) return;
3400 eina_stringshare_replace(&(sd->icon_name), icon_name);
3401 #ifdef HAVE_ELEMENTARY_X
3402 _elm_win_xwin_update(sd);
3407 elm_win_icon_name_get(const Evas_Object *obj)
3409 ELM_WIN_CHECK(obj) NULL;
3410 const char *ret = NULL;
3411 eo_do((Eo *) obj, elm_obj_win_icon_name_get(&ret));
3416 _icon_name_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3418 const char **ret = va_arg(*list, const char **);
3419 Elm_Win_Smart_Data *sd = _pd;
3420 *ret = sd->icon_name;
3424 elm_win_role_set(Evas_Object *obj, const char *role)
3427 eo_do(obj, elm_obj_win_role_set(role));
3431 _role_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3433 const char *role = va_arg(*list, const char *);
3434 Elm_Win_Smart_Data *sd = _pd;
3437 eina_stringshare_replace(&(sd->role), role);
3438 #ifdef HAVE_ELEMENTARY_X
3439 _elm_win_xwin_update(sd);
3444 elm_win_role_get(const Evas_Object *obj)
3446 ELM_WIN_CHECK(obj) NULL;
3447 const char *ret = NULL;
3448 eo_do((Eo *) obj, elm_obj_win_role_get(&ret));
3453 _role_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3455 const char **ret = va_arg(*list, const char **);
3456 Elm_Win_Smart_Data *sd = _pd;
3461 elm_win_icon_object_set(Evas_Object *obj,
3465 eo_do(obj, elm_obj_win_icon_object_set(icon));
3469 _icon_object_set(Eo *obj, void *_pd, va_list *list)
3471 Evas_Object *icon = va_arg(*list, Evas_Object *);
3472 Elm_Win_Smart_Data *sd = _pd;
3475 evas_object_event_callback_del_full
3476 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3479 evas_object_event_callback_add
3480 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3481 #ifdef HAVE_ELEMENTARY_X
3482 _elm_win_xwin_update(sd);
3486 EAPI const Evas_Object *
3487 elm_win_icon_object_get(const Evas_Object *obj)
3489 ELM_WIN_CHECK(obj) NULL;
3490 const Evas_Object *ret = NULL;
3491 eo_do((Eo *) obj, elm_obj_win_icon_object_get(&ret));
3496 _icon_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3498 const Evas_Object **ret = va_arg(*list, const Evas_Object **);
3499 Elm_Win_Smart_Data *sd = _pd;
3504 elm_win_autodel_set(Evas_Object *obj,
3508 eo_do(obj, elm_obj_win_autodel_set(autodel));
3512 _autodel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3514 Eina_Bool autodel = va_arg(*list, int);
3515 Elm_Win_Smart_Data *sd = _pd;
3516 sd->autodel = autodel;
3520 elm_win_autodel_get(const Evas_Object *obj)
3522 ELM_WIN_CHECK(obj) EINA_FALSE;
3523 Eina_Bool ret = EINA_FALSE;
3524 eo_do((Eo *) obj, elm_obj_win_autodel_get(&ret));
3529 _autodel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3531 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3532 Elm_Win_Smart_Data *sd = _pd;
3537 elm_win_activate(Evas_Object *obj)
3540 eo_do(obj, elm_obj_win_activate());
3544 _activate(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3546 Elm_Win_Smart_Data *sd = _pd;
3551 elm_win_lower(Evas_Object *obj)
3554 eo_do(obj, elm_obj_win_lower());
3558 _lower(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3560 Elm_Win_Smart_Data *sd = _pd;
3565 elm_win_raise(Evas_Object *obj)
3568 eo_do(obj, elm_obj_win_raise());
3572 _raise(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3574 Elm_Win_Smart_Data *sd = _pd;
3579 elm_win_center(Evas_Object *obj,
3584 eo_do(obj, elm_obj_win_center(h, v));
3588 _center(Eo *obj, void *_pd, va_list *list)
3590 Eina_Bool h = va_arg(*list, int);
3591 Eina_Bool v = va_arg(*list, int);
3592 int win_w, win_h, screen_w, screen_h, nx, ny;
3594 Elm_Win_Smart_Data *sd = _pd;
3596 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
3599 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &screen_w, &screen_h);
3600 if ((!screen_w) || (!screen_h)) return;
3602 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
3603 if ((!win_w) || (!win_h)) return;
3605 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
3606 else nx = sd->screen.x;
3607 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
3608 else ny = sd->screen.y;
3612 evas_object_move(obj, nx, ny);
3616 elm_win_borderless_set(Evas_Object *obj,
3617 Eina_Bool borderless)
3620 eo_do(obj, elm_obj_win_borderless_set(borderless));
3624 _borderless_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3626 Eina_Bool borderless = va_arg(*list, int);
3627 Elm_Win_Smart_Data *sd = _pd;
3629 Eina_Bool need_frame = EINA_FALSE;
3631 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3632 need_frame = engine_name &&
3633 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3634 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3639 _elm_win_frame_del(sd);
3644 _elm_win_frame_add(sd, "default");
3647 evas_object_show(sd->frame_obj);
3650 TRAP(sd, borderless_set, borderless);
3651 #ifdef HAVE_ELEMENTARY_X
3652 _elm_win_xwin_update(sd);
3657 elm_win_borderless_get(const Evas_Object *obj)
3659 ELM_WIN_CHECK(obj) EINA_FALSE;
3660 Eina_Bool ret = EINA_FALSE;
3661 eo_do((Eo *) obj, elm_obj_win_borderless_get(&ret));
3666 _borderless_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3668 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3669 Elm_Win_Smart_Data *sd = _pd;
3670 *ret = ecore_evas_borderless_get(sd->ee);
3674 elm_win_shaped_set(Evas_Object *obj,
3678 eo_do(obj, elm_obj_win_shaped_set(shaped));
3682 _shaped_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3684 Eina_Bool shaped = va_arg(*list, int);
3685 Elm_Win_Smart_Data *sd = _pd;
3687 TRAP(sd, shaped_set, shaped);
3688 #ifdef HAVE_ELEMENTARY_X
3689 _elm_win_xwin_update(sd);
3694 elm_win_shaped_get(const Evas_Object *obj)
3696 ELM_WIN_CHECK(obj) EINA_FALSE;
3697 Eina_Bool ret = EINA_FALSE;
3698 eo_do((Eo *) obj, elm_obj_win_shaped_get(&ret));
3703 _shaped_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3705 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3706 Elm_Win_Smart_Data *sd = _pd;
3707 *ret = ecore_evas_shaped_get(sd->ee);
3711 elm_win_alpha_set(Evas_Object *obj,
3715 eo_do(obj, elm_obj_win_alpha_set(enabled));
3719 _alpha_set(Eo *obj, void *_pd, va_list *list)
3721 Eina_Bool enabled = va_arg(*list, int);
3722 Elm_Win_Smart_Data *sd = _pd;
3726 evas_object_image_alpha_set(sd->img_obj, enabled);
3727 ecore_evas_alpha_set(sd->ee, enabled);
3731 #ifdef HAVE_ELEMENTARY_X
3736 if (!ecore_x_screen_is_composited(0))
3737 elm_win_shaped_set(obj, enabled);
3739 TRAP(sd, alpha_set, enabled);
3742 TRAP(sd, alpha_set, enabled);
3743 _elm_win_xwin_update(sd);
3747 TRAP(sd, alpha_set, enabled);
3752 elm_win_alpha_get(const Evas_Object *obj)
3754 ELM_WIN_CHECK(obj) EINA_FALSE;
3755 Eina_Bool ret = EINA_FALSE;
3756 eo_do((Eo *) obj, elm_obj_win_alpha_get(&ret));
3761 _alpha_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3763 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3764 Elm_Win_Smart_Data *sd = _pd;
3768 *ret = evas_object_image_alpha_get(sd->img_obj);
3772 *ret = ecore_evas_alpha_get(sd->ee);
3777 elm_win_override_set(Evas_Object *obj,
3781 eo_do(obj, elm_obj_win_override_set(override));
3785 _override_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3787 Eina_Bool override = va_arg(*list, int);
3788 Elm_Win_Smart_Data *sd = _pd;
3790 TRAP(sd, override_set, override);
3791 #ifdef HAVE_ELEMENTARY_X
3792 _elm_win_xwin_update(sd);
3797 elm_win_override_get(const Evas_Object *obj)
3799 ELM_WIN_CHECK(obj) EINA_FALSE;
3800 Eina_Bool ret = EINA_FALSE;
3801 eo_do((Eo *) obj, elm_obj_win_override_get(&ret));
3806 _override_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3808 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3809 Elm_Win_Smart_Data *sd = _pd;
3810 *ret = ecore_evas_override_get(sd->ee);
3814 elm_win_fullscreen_set(Evas_Object *obj,
3815 Eina_Bool fullscreen)
3818 eo_do(obj, elm_obj_win_fullscreen_set(fullscreen));
3822 _fullscreen_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3824 Eina_Bool fullscreen = va_arg(*list, int);
3825 Elm_Win_Smart_Data *sd = _pd;
3826 // YYY: handle if sd->img_obj
3827 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
3828 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
3830 // these engines... can ONLY be fullscreen
3835 // sd->fullscreen = fullscreen;
3837 Eina_Bool need_frame = EINA_FALSE;
3839 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3840 need_frame = engine_name &&
3841 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3842 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3844 TRAP(sd, fullscreen_set, fullscreen);
3849 _elm_win_frame_del(sd);
3854 _elm_win_frame_add(sd, "default");
3857 evas_object_show(sd->frame_obj);
3859 #ifdef HAVE_ELEMENTARY_X
3860 _elm_win_xwin_update(sd);
3866 elm_win_fullscreen_get(const Evas_Object *obj)
3868 ELM_WIN_CHECK(obj) EINA_FALSE;
3869 Eina_Bool ret = EINA_FALSE;
3870 eo_do((Eo *) obj, elm_obj_win_fullscreen_get(&ret));
3875 _fullscreen_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3877 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3878 Elm_Win_Smart_Data *sd = _pd;
3882 const char* engine_name = ecore_evas_engine_name_get(sd->ee);
3885 ((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
3886 (!strcmp(engine_name, ELM_SOFTWARE_16_WINCE))))
3888 // these engines... can ONLY be fullscreen
3893 *ret = sd->fullscreen;
3898 elm_win_main_menu_get(const Evas_Object *obj)
3900 ELM_WIN_CHECK(obj) NULL;
3902 eo_do((Eo *) obj, elm_obj_win_main_menu_get(&ret));
3907 _dbus_menu_set(Eina_Bool dbus_connect, void *data)
3909 ELM_WIN_DATA_GET_OR_RETURN(data, sd);
3913 DBG("Setting menu to D-Bus");
3914 edje_object_part_unswallow(sd->layout, sd->main_menu);
3915 edje_object_signal_emit(sd->layout, "elm,action,hide_menu", "elm");
3916 _elm_menu_menu_bar_hide(sd->main_menu);
3920 DBG("Setting menu to local mode");
3921 edje_object_part_swallow(sd->layout, "elm.swallow.menu", sd->main_menu);
3922 edje_object_signal_emit(sd->layout, "elm,action,show_menu", "elm");
3923 evas_object_show(sd->main_menu);
3928 _main_menu_get(Eo *obj, void *_pd, va_list *list)
3930 Eo **ret = va_arg(*list, Eo **);
3931 Elm_Win_Smart_Data *sd = _pd;
3932 Eina_Bool use_dbus = EINA_FALSE;
3934 if (sd->main_menu) goto end;
3936 sd->main_menu = elm_menu_add(obj);
3937 _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
3939 #ifdef HAVE_ELEMENTARY_X
3940 if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
3943 #ifdef HAVE_ELEMENTARY_X
3944 if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
3946 _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
3947 _dbus_menu_set, obj);
3951 _dbus_menu_set(EINA_FALSE, obj);
3954 *ret = sd->main_menu;
3958 elm_win_maximized_set(Evas_Object *obj,
3959 Eina_Bool maximized)
3962 eo_do(obj, elm_obj_win_maximized_set(maximized));
3966 _maximized_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3968 Eina_Bool maximized = va_arg(*list, int);
3969 Elm_Win_Smart_Data *sd = _pd;
3971 _elm_win_frame_maximized_state_update(sd, maximized);
3972 // YYY: handle if sd->img_obj
3973 TRAP(sd, maximized_set, maximized);
3974 #ifdef HAVE_ELEMENTARY_X
3975 _elm_win_xwin_update(sd);
3980 elm_win_maximized_get(const Evas_Object *obj)
3982 ELM_WIN_CHECK(obj) EINA_FALSE;
3983 Eina_Bool ret = EINA_FALSE;
3984 eo_do((Eo *) obj, elm_obj_win_maximized_get(&ret));
3989 _maximized_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3991 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3992 Elm_Win_Smart_Data *sd = _pd;
3993 *ret = sd->maximized;
3997 elm_win_iconified_set(Evas_Object *obj,
3998 Eina_Bool iconified)
4001 eo_do(obj, elm_obj_win_iconified_set(iconified));
4005 _iconified_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4007 Eina_Bool iconified = va_arg(*list, int);
4008 Elm_Win_Smart_Data *sd = _pd;
4010 // sd->iconified = iconified;
4011 TRAP(sd, iconified_set, iconified);
4012 #ifdef HAVE_ELEMENTARY_X
4013 _elm_win_xwin_update(sd);
4018 elm_win_iconified_get(const Evas_Object *obj)
4020 ELM_WIN_CHECK(obj) EINA_FALSE;
4021 Eina_Bool ret = EINA_FALSE;
4022 eo_do((Eo *) obj, elm_obj_win_iconified_get(&ret));
4027 _iconified_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4029 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4030 Elm_Win_Smart_Data *sd = _pd;
4031 *ret = sd->iconified;
4035 elm_win_withdrawn_set(Evas_Object *obj,
4036 Eina_Bool withdrawn)
4039 eo_do(obj, elm_obj_win_withdrawn_set(withdrawn));
4043 _withdrawn_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4045 Eina_Bool withdrawn = va_arg(*list, int);
4046 Elm_Win_Smart_Data *sd = _pd;
4048 // sd->withdrawn = withdrawn;
4049 TRAP(sd, withdrawn_set, withdrawn);
4050 #ifdef HAVE_ELEMENTARY_X
4051 _elm_win_xwin_update(sd);
4056 elm_win_withdrawn_get(const Evas_Object *obj)
4058 ELM_WIN_CHECK(obj) EINA_FALSE;
4059 Eina_Bool ret = EINA_FALSE;
4060 eo_do((Eo *) obj, elm_obj_win_withdrawn_get(&ret));
4065 _withdrawn_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4067 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4068 Elm_Win_Smart_Data *sd = _pd;
4069 *ret = sd->withdrawn;
4073 elm_win_available_profiles_set(Evas_Object *obj,
4074 const char **profiles,
4078 eo_do((Eo *) obj, elm_obj_win_available_profiles_set(profiles, count));
4082 _available_profiles_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4084 const char **profiles = va_arg(*list, const char **);
4085 unsigned int count = va_arg(*list, unsigned int);
4086 Elm_Win_Smart_Data *sd = _pd;
4087 Eina_Bool found = EINA_FALSE;
4089 _elm_win_available_profiles_del(sd);
4090 if ((profiles) && (count >= 1))
4092 sd->profile.available_list = calloc(count, sizeof(char *));
4093 if (sd->profile.available_list)
4095 if (!sd->profile.name) found = EINA_TRUE;
4098 for (i = 0; i < count; i++)
4100 sd->profile.available_list[i] = eina_stringshare_add(profiles[i]);
4102 /* check to see if a given array has a current profile of elm_win */
4103 if ((sd->profile.name) &&
4104 (!strcmp(sd->profile.name, profiles[i])))
4109 sd->profile.count = count;
4113 if (ecore_evas_window_profile_supported_get(sd->ee))
4115 ecore_evas_window_available_profiles_set(sd->ee,
4116 sd->profile.available_list,
4119 /* current profile of elm_win is wrong, change profile */
4120 if ((sd->profile.available_list) && (!found))
4122 eina_stringshare_replace(&(sd->profile.name),
4123 sd->profile.available_list[0]);
4124 ecore_evas_window_profile_set(sd->ee, sd->profile.name);
4130 if (sd->profile.available_list)
4131 _elm_win_profile_update(sd);
4136 elm_win_available_profiles_get(Evas_Object *obj,
4138 unsigned int *count)
4140 ELM_WIN_CHECK(obj) EINA_FALSE;
4141 Eina_Bool ret = EINA_FALSE;
4142 eo_do((Eo *) obj, elm_obj_win_available_profiles_get(profiles, count, &ret));
4147 _available_profiles_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4149 char ***profiles = va_arg(*list, char ***);
4150 unsigned int *count = va_arg(*list, unsigned int *);
4151 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4152 Elm_Win_Smart_Data *sd = _pd;
4155 if (ecore_evas_window_profile_supported_get(sd->ee))
4157 res = ecore_evas_window_available_profiles_get(sd->ee,
4163 if (profiles) *profiles = (char **)sd->profile.available_list;
4164 if (count) *count = sd->profile.count;
4167 if (ret) *ret = res;
4171 elm_win_profile_set(Evas_Object *obj,
4172 const char *profile)
4175 eo_do((Eo *) obj, elm_obj_win_profile_set(profile));
4179 _profile_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4181 const char *profile = va_arg(*list, const char *);
4182 Elm_Win_Smart_Data *sd = _pd;
4184 /* check to see if a given profile is present in an available profiles */
4185 if ((profile) && (sd->profile.available_list))
4187 Eina_Bool found = EINA_FALSE;
4189 for (i = 0; i < sd->profile.count; i++)
4191 if (!strcmp(profile,
4192 sd->profile.available_list[i]))
4201 if (ecore_evas_window_profile_supported_get(sd->ee))
4203 if (!profile) _elm_win_profile_del(sd);
4204 ecore_evas_window_profile_set(sd->ee, profile);
4208 if (_elm_win_profile_set(sd, profile))
4209 _elm_win_profile_update(sd);
4214 elm_win_profile_get(const Evas_Object *obj)
4216 ELM_WIN_CHECK(obj) NULL;
4217 const char *ret = NULL;
4218 eo_do((Eo *) obj, elm_obj_win_profile_get(&ret));
4223 _profile_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4225 const char **ret = va_arg(*list, const char **);
4226 Elm_Win_Smart_Data *sd = _pd;
4227 *ret = sd->profile.name;
4231 elm_win_urgent_set(Evas_Object *obj,
4235 eo_do(obj, elm_obj_win_urgent_set(urgent));
4239 _urgent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4241 Eina_Bool urgent = va_arg(*list, int);
4242 Elm_Win_Smart_Data *sd = _pd;
4244 sd->urgent = urgent;
4245 TRAP(sd, urgent_set, urgent);
4246 #ifdef HAVE_ELEMENTARY_X
4247 _elm_win_xwin_update(sd);
4252 elm_win_urgent_get(const Evas_Object *obj)
4254 ELM_WIN_CHECK(obj) EINA_FALSE;
4255 Eina_Bool ret = EINA_FALSE;
4256 eo_do((Eo *) obj, elm_obj_win_urgent_get(&ret));
4261 _urgent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4263 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4264 Elm_Win_Smart_Data *sd = _pd;
4269 elm_win_demand_attention_set(Evas_Object *obj,
4270 Eina_Bool demand_attention)
4273 eo_do(obj, elm_obj_win_demand_attention_set(demand_attention));
4277 _demand_attention_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4279 Eina_Bool demand_attention = va_arg(*list, int);
4280 Elm_Win_Smart_Data *sd = _pd;
4282 sd->demand_attention = demand_attention;
4283 TRAP(sd, demand_attention_set, demand_attention);
4284 #ifdef HAVE_ELEMENTARY_X
4285 _elm_win_xwin_update(sd);
4290 elm_win_demand_attention_get(const Evas_Object *obj)
4292 ELM_WIN_CHECK(obj) EINA_FALSE;
4293 Eina_Bool ret = EINA_FALSE;
4294 eo_do((Eo *) obj, elm_obj_win_demand_attention_get(&ret));
4299 _demand_attention_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4301 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4302 Elm_Win_Smart_Data *sd = _pd;
4303 *ret = sd->demand_attention;
4307 elm_win_modal_set(Evas_Object *obj,
4311 eo_do(obj, elm_obj_win_modal_set(modal));
4315 _modal_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4317 Eina_Bool modal = va_arg(*list, int);
4318 Elm_Win_Smart_Data *sd = _pd;
4321 TRAP(sd, modal_set, modal);
4322 #ifdef HAVE_ELEMENTARY_X
4323 _elm_win_xwin_update(sd);
4328 elm_win_modal_get(const Evas_Object *obj)
4330 ELM_WIN_CHECK(obj) EINA_FALSE;
4331 Eina_Bool ret = EINA_FALSE;
4332 eo_do((Eo *) obj, elm_obj_win_modal_get(&ret));
4337 _modal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4339 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4340 Elm_Win_Smart_Data *sd = _pd;
4345 elm_win_aspect_set(Evas_Object *obj,
4349 eo_do(obj, elm_obj_win_aspect_set(aspect));
4353 _aspect_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4355 double aspect = va_arg(*list, double);
4356 Elm_Win_Smart_Data *sd = _pd;
4358 sd->aspect = aspect;
4359 TRAP(sd, aspect_set, aspect);
4360 #ifdef HAVE_ELEMENTARY_X
4361 _elm_win_xwin_update(sd);
4366 elm_win_aspect_get(const Evas_Object *obj)
4368 ELM_WIN_CHECK(obj) 0.0;
4370 eo_do((Eo *) obj, elm_obj_win_aspect_get(&ret));
4375 _aspect_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4377 double *ret = va_arg(*list, double *);
4378 Elm_Win_Smart_Data *sd = _pd;
4383 elm_win_size_base_set(Evas_Object *obj, int w, int h)
4386 eo_do(obj, elm_obj_win_size_base_set(w, h));
4390 _size_base_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4392 int w = va_arg(*list, int);
4393 int h = va_arg(*list, int);
4394 Elm_Win_Smart_Data *sd = _pd;
4395 sd->size_base_w = w;
4396 sd->size_base_h = h;
4397 TRAP(sd, size_base_set, w, h);
4398 #ifdef HAVE_ELEMENTARY_X
4399 _elm_win_xwin_update(sd);
4404 elm_win_size_base_get(Evas_Object *obj, int *w, int *h)
4407 eo_do(obj, elm_obj_win_size_base_get(w, h));
4411 _size_base_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4413 int *w = va_arg(*list, int *);
4414 int *h = va_arg(*list, int *);
4416 Elm_Win_Smart_Data *sd = _pd;
4417 if (w) *w = sd->size_base_w;
4418 if (w) *h = sd->size_base_h;
4422 elm_win_size_step_set(Evas_Object *obj, int w, int h)
4425 eo_do(obj, elm_obj_win_size_step_set(w, h));
4429 _size_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4431 int w = va_arg(*list, int);
4432 int h = va_arg(*list, int);
4433 Elm_Win_Smart_Data *sd = _pd;
4434 sd->size_step_w = w;
4435 sd->size_step_h = h;
4436 TRAP(sd, size_step_set, w, h);
4437 #ifdef HAVE_ELEMENTARY_X
4438 _elm_win_xwin_update(sd);
4443 elm_win_size_step_get(Evas_Object *obj, int *w, int *h)
4446 eo_do(obj, elm_obj_win_size_step_get(w, h));
4450 _size_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4452 int *w = va_arg(*list, int *);
4453 int *h = va_arg(*list, int *);
4454 Elm_Win_Smart_Data *sd = _pd;
4455 if (w) *w = sd->size_step_w;
4456 if (w) *h = sd->size_step_h;
4460 elm_win_layer_set(Evas_Object *obj,
4464 eo_do(obj, elm_obj_win_layer_set(layer));
4468 _layer_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4470 int layer = va_arg(*list, int);
4471 Elm_Win_Smart_Data *sd = _pd;
4473 TRAP(sd, layer_set, layer);
4474 #ifdef HAVE_ELEMENTARY_X
4475 _elm_win_xwin_update(sd);
4480 elm_win_layer_get(const Evas_Object *obj)
4482 ELM_WIN_CHECK(obj) - 1;
4484 eo_do((Eo *) obj, elm_obj_win_layer_get(&ret));
4489 _layer_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4491 int *ret = va_arg(*list, int *);
4492 Elm_Win_Smart_Data *sd = _pd;
4493 *ret = ecore_evas_layer_get(sd->ee);
4497 elm_win_norender_push(Evas_Object *obj)
4500 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4503 if (sd->norender == 1) ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
4507 elm_win_norender_pop(Evas_Object *obj)
4510 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4512 if (sd->norender <= 0) return;
4514 if (sd->norender == 0) ecore_evas_manual_render_set(sd->ee, EINA_FALSE);
4518 elm_win_norender_get(Evas_Object *obj)
4520 ELM_WIN_CHECK(obj) - 1;
4521 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
4522 return sd->norender;
4526 elm_win_render(Evas_Object *obj)
4529 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4530 ecore_evas_manual_render(sd->ee);
4534 _win_rotation_degree_check(int rotation)
4536 if ((rotation > 360) || (rotation < 0))
4538 WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
4540 if (rotation < 0) rotation += 360;
4546 * This API resizes the internal window(ex: X window) and evas_output.
4547 * But this does not resize the elm window object and its contents.
4550 elm_win_rotation_set(Evas_Object *obj,
4554 eo_do(obj, elm_obj_win_rotation_set(rotation));
4558 _win_rotate(Evas_Object *obj, Elm_Win_Smart_Data *sd, int rotation, Eina_Bool resize)
4560 rotation = _win_rotation_degree_check(rotation);
4561 if (sd->rot == rotation) return;
4563 if (resize) TRAP(sd, rotation_with_resize_set, rotation);
4564 else TRAP(sd, rotation_set, rotation);
4565 evas_object_size_hint_min_set(obj, -1, -1);
4566 evas_object_size_hint_max_set(obj, -1, -1);
4567 _elm_win_resize_objects_eval(obj);
4568 #ifdef HAVE_ELEMENTARY_X
4569 _elm_win_xwin_update(sd);
4571 _elm_win_frame_obj_update(sd);
4572 elm_widget_orientation_set(obj, rotation);
4573 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
4577 _rotation_set(Eo *obj, void *_pd, va_list *list)
4579 int rotation = va_arg(*list, int);
4580 Elm_Win_Smart_Data *sd = _pd;
4581 _win_rotate(obj, sd, rotation, EINA_FALSE);
4585 * This API does not resize the internal window (ex: X window).
4586 * But this resizes evas_output, elm window, and its contents.
4589 elm_win_rotation_with_resize_set(Evas_Object *obj,
4593 eo_do(obj, elm_obj_win_rotation_with_resize_set(rotation));
4597 _rotation_with_resize_set(Eo *obj, void *_pd, va_list *list)
4599 int rotation = va_arg(*list, int);
4600 Elm_Win_Smart_Data *sd = _pd;
4601 _win_rotate(obj, sd, rotation, EINA_TRUE);
4605 elm_win_rotation_get(const Evas_Object *obj)
4607 ELM_WIN_CHECK(obj) - 1;
4609 eo_do((Eo *) obj, elm_obj_win_rotation_get(&ret));
4614 _rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4616 int *ret = va_arg(*list, int *);
4617 Elm_Win_Smart_Data *sd = _pd;
4622 elm_win_wm_rotation_supported_get(const Evas_Object *obj)
4624 ELM_WIN_CHECK(obj) EINA_FALSE;
4625 Eina_Bool ret = EINA_FALSE;
4626 eo_do((Eo *) obj, elm_obj_win_wm_rotation_supported_get(&ret));
4631 _wm_rotation_supported_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4633 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4634 Elm_Win_Smart_Data *sd = _pd;
4635 *ret = sd->wm_rot.wm_supported;
4638 /* This will unset a preferred rotation, if given preferred rotation is '-1'.
4641 elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj,
4645 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_set(rotation));
4649 _wm_preferred_rotation_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4651 int rotation = va_arg(*list, int);
4653 Elm_Win_Smart_Data *sd = _pd;
4655 if (!sd->wm_rot.use)
4656 sd->wm_rot.use = EINA_TRUE;
4658 // '-1' means that elm_win doesn't use preferred rotation.
4662 rot = _win_rotation_degree_check(rotation);
4664 if (sd->wm_rot.preferred_rot == rot) return;
4665 sd->wm_rot.preferred_rot = rot;
4667 ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
4671 elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj)
4673 ELM_WIN_CHECK(obj) -1;
4675 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_get(&ret));
4680 _wm_preferred_rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4682 int *ret = va_arg(*list, int *);
4683 Elm_Win_Smart_Data *sd = _pd;
4684 *ret = sd->wm_rot.preferred_rot;
4688 elm_win_wm_rotation_available_rotations_set(Evas_Object *obj,
4689 const int *rotations,
4693 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_set(rotations, count));
4697 _wm_available_rotations_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4699 const int *rotations = va_arg(*list, const int *);
4700 unsigned int count = va_arg(*list, unsigned int);
4701 Elm_Win_Smart_Data *sd = _pd;
4705 if (!sd->wm_rot.use)
4706 sd->wm_rot.use = EINA_TRUE;
4708 ELM_SAFE_FREE(sd->wm_rot.rots, free);
4709 sd->wm_rot.count = 0;
4713 sd->wm_rot.rots = calloc(count, sizeof(int));
4714 if (!sd->wm_rot.rots) return;
4715 for (i = 0; i < count; i++)
4717 r = _win_rotation_degree_check(rotations[i]);
4718 sd->wm_rot.rots[i] = r;
4722 sd->wm_rot.count = count;
4724 ecore_evas_wm_rotation_available_rotations_set(sd->ee,
4730 elm_win_wm_rotation_available_rotations_get(const Evas_Object *obj,
4732 unsigned int *count)
4734 ELM_WIN_CHECK(obj) EINA_FALSE;
4735 Eina_Bool ret = EINA_FALSE;
4736 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_get(rotations, count, &ret));
4741 _wm_available_rotations_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4743 int **rotations = va_arg(*list, int **);
4744 unsigned int *count = va_arg(*list, unsigned int *);
4745 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4746 Elm_Win_Smart_Data *sd = _pd;
4748 if (!sd->wm_rot.use) return;
4750 if (sd->wm_rot.count > 0)
4754 *rotations = calloc(sd->wm_rot.count, sizeof(int));
4759 sizeof(int) * sd->wm_rot.count);
4764 if (count) *count = sd->wm_rot.count;
4769 elm_win_wm_rotation_manual_rotation_done_set(Evas_Object *obj,
4773 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_set(set));
4777 _wm_manual_rotation_done_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4779 int set = va_arg(*list, int);
4780 Elm_Win_Smart_Data *sd = _pd;
4781 if (!sd->wm_rot.use) return;
4782 ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
4786 elm_win_wm_rotation_manual_rotation_done_get(const Evas_Object *obj)
4788 ELM_WIN_CHECK(obj) EINA_FALSE;
4789 Eina_Bool ret = EINA_FALSE;
4790 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_get(&ret));
4795 _wm_manual_rotation_done_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4797 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4798 Elm_Win_Smart_Data *sd = _pd;
4799 if (!sd->wm_rot.use) return;
4800 *ret = ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
4804 elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj)
4807 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done());
4811 _wm_manual_rotation_done(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
4813 Elm_Win_Smart_Data *sd = _pd;
4814 if (!sd->wm_rot.use) return;
4815 ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
4819 elm_win_sticky_set(Evas_Object *obj,
4823 eo_do(obj, elm_obj_win_sticky_set(sticky));
4827 _sticky_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4829 Eina_Bool sticky = va_arg(*list, int);
4830 Elm_Win_Smart_Data *sd = _pd;
4832 // sd->sticky = sticky;
4833 TRAP(sd, sticky_set, sticky);
4834 #ifdef HAVE_ELEMENTARY_X
4835 _elm_win_xwin_update(sd);
4840 elm_win_sticky_get(const Evas_Object *obj)
4842 ELM_WIN_CHECK(obj) EINA_FALSE;
4843 Eina_Bool ret = EINA_FALSE;
4844 eo_do((Eo *) obj, elm_obj_win_sticky_get(&ret));
4849 _sticky_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4851 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4852 Elm_Win_Smart_Data *sd = _pd;
4857 elm_win_keyboard_mode_set(Evas_Object *obj,
4858 Elm_Win_Keyboard_Mode mode)
4861 eo_do(obj, elm_obj_win_keyboard_mode_set(mode));
4865 _keyboard_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4867 Elm_Win_Keyboard_Mode mode = va_arg(*list, Elm_Win_Keyboard_Mode);
4868 Elm_Win_Smart_Data *sd = _pd;
4870 if (mode == sd->kbdmode) return;
4871 #ifdef HAVE_ELEMENTARY_X
4872 _elm_win_xwindow_get(sd);
4875 #ifdef HAVE_ELEMENTARY_X
4877 ecore_x_e_virtual_keyboard_state_set
4878 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
4882 EAPI Elm_Win_Keyboard_Mode
4883 elm_win_keyboard_mode_get(const Evas_Object *obj)
4885 ELM_WIN_CHECK(obj) ELM_WIN_KEYBOARD_UNKNOWN;
4886 Elm_Win_Keyboard_Mode ret = ELM_WIN_KEYBOARD_UNKNOWN;
4887 eo_do((Eo *) obj, elm_obj_win_keyboard_mode_get(&ret));
4892 _keyboard_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4894 Elm_Win_Keyboard_Mode *ret = va_arg(*list, Elm_Win_Keyboard_Mode *);
4895 Elm_Win_Smart_Data *sd = _pd;
4900 elm_win_keyboard_win_set(Evas_Object *obj,
4901 Eina_Bool is_keyboard)
4904 eo_do(obj, elm_obj_win_keyboard_win_set(is_keyboard));
4908 _keyboard_win_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4910 Eina_Bool is_keyboard = va_arg(*list, int);
4911 Elm_Win_Smart_Data *sd = _pd;
4913 #ifdef HAVE_ELEMENTARY_X
4914 _elm_win_xwindow_get(sd);
4916 ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
4923 elm_win_keyboard_win_get(const Evas_Object *obj)
4925 ELM_WIN_CHECK(obj) EINA_FALSE;
4926 Eina_Bool ret = EINA_FALSE;
4927 eo_do((Eo *) obj, elm_obj_win_keyboard_win_get(&ret));
4932 _keyboard_win_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4934 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4935 Elm_Win_Smart_Data *sd = _pd;
4937 #ifdef HAVE_ELEMENTARY_X
4938 _elm_win_xwindow_get(sd);
4941 *ret = ecore_x_e_virtual_keyboard_get(sd->x.xwin);
4949 elm_win_indicator_mode_set(Evas_Object *obj,
4950 Elm_Win_Indicator_Mode mode)
4953 eo_do(obj, elm_obj_win_indicator_mode_set(mode));
4957 _indicator_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4959 Elm_Win_Indicator_Mode mode = va_arg(*list, Elm_Win_Indicator_Mode);
4960 Elm_Win_Smart_Data *sd = _pd;
4962 if (mode == sd->indmode) return;
4963 #ifdef HAVE_ELEMENTARY_X
4964 _elm_win_xwindow_get(sd);
4967 #ifdef HAVE_ELEMENTARY_X
4970 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
4971 ecore_x_e_illume_indicator_state_set
4972 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
4973 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
4974 ecore_x_e_illume_indicator_state_set
4975 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
4978 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
4981 EAPI Elm_Win_Indicator_Mode
4982 elm_win_indicator_mode_get(const Evas_Object *obj)
4984 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_UNKNOWN;
4985 Elm_Win_Indicator_Mode ret = ELM_WIN_INDICATOR_UNKNOWN;
4986 eo_do((Eo *) obj, elm_obj_win_indicator_mode_get(&ret));
4991 _indicator_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4993 Elm_Win_Indicator_Mode *ret = va_arg(*list, Elm_Win_Indicator_Mode *);
4994 Elm_Win_Smart_Data *sd = _pd;
4999 elm_win_indicator_opacity_set(Evas_Object *obj,
5000 Elm_Win_Indicator_Opacity_Mode mode)
5003 eo_do(obj, elm_obj_win_indicator_opacity_set(mode));
5007 _indicator_opacity_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5009 Elm_Win_Indicator_Opacity_Mode mode = va_arg(*list, Elm_Win_Indicator_Opacity_Mode);
5010 Elm_Win_Smart_Data *sd = _pd;
5012 if (mode == sd->ind_o_mode) return;
5013 sd->ind_o_mode = mode;
5014 #ifdef HAVE_ELEMENTARY_X
5015 _elm_win_xwindow_get(sd);
5018 if (sd->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
5019 ecore_x_e_illume_indicator_opacity_set
5020 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
5021 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
5022 ecore_x_e_illume_indicator_opacity_set
5023 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
5024 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
5025 ecore_x_e_illume_indicator_opacity_set
5026 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
5029 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
5032 EAPI Elm_Win_Indicator_Opacity_Mode
5033 elm_win_indicator_opacity_get(const Evas_Object *obj)
5035 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5036 Elm_Win_Indicator_Opacity_Mode ret = ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5037 eo_do((Eo *) obj, elm_obj_win_indicator_opacity_get(&ret));
5042 _indicator_opacity_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5044 Elm_Win_Indicator_Opacity_Mode *ret = va_arg(*list, Elm_Win_Indicator_Opacity_Mode *);
5045 Elm_Win_Smart_Data *sd = _pd;
5046 *ret = sd->ind_o_mode;
5050 elm_win_screen_position_get(const Evas_Object *obj,
5055 eo_do((Eo *) obj, elm_obj_win_screen_position_get(x, y));
5059 _screen_position_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5061 int *x = va_arg(*list, int *);
5062 int *y = va_arg(*list, int *);
5063 Elm_Win_Smart_Data *sd = _pd;
5065 if (x) *x = sd->screen.x;
5066 if (y) *y = sd->screen.y;
5070 elm_win_focus_get(const Evas_Object *obj)
5072 ELM_WIN_CHECK(obj) EINA_FALSE;
5073 Eina_Bool ret = EINA_FALSE;
5074 eo_do((Eo *) obj, elm_obj_win_focus_get(&ret));
5079 _focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5081 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5082 Elm_Win_Smart_Data *sd = _pd;
5083 *ret = ecore_evas_focus_get(sd->ee);
5087 elm_win_screen_constrain_set(Evas_Object *obj,
5088 Eina_Bool constrain)
5091 eo_do(obj, elm_obj_win_screen_constrain_set(constrain));
5095 _screen_constrain_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5097 Eina_Bool constrain = va_arg(*list, int);
5098 Elm_Win_Smart_Data *sd = _pd;
5099 sd->constrain = !!constrain;
5103 elm_win_screen_constrain_get(Evas_Object *obj)
5105 ELM_WIN_CHECK(obj) EINA_FALSE;
5106 Eina_Bool ret = EINA_FALSE;
5107 eo_do(obj, elm_obj_win_screen_constrain_get(&ret));
5112 _screen_constrain_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5114 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5115 Elm_Win_Smart_Data *sd = _pd;
5116 *ret = sd->constrain;
5120 elm_win_screen_size_get(const Evas_Object *obj,
5127 eo_do((Eo *) obj, elm_obj_win_screen_size_get(x, y, w, h));
5131 _screen_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5133 int *x = va_arg(*list, int *);
5134 int *y = va_arg(*list, int *);
5135 int *w = va_arg(*list, int *);
5136 int *h = va_arg(*list, int *);
5137 Elm_Win_Smart_Data *sd = _pd;
5139 ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
5143 elm_win_screen_dpi_get(const Evas_Object *obj,
5148 eo_do((Eo *) obj, elm_obj_win_screen_dpi_get(xdpi, ydpi));
5152 _screen_dpi_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5154 int *xdpi = va_arg(*list, int *);
5155 int *ydpi = va_arg(*list, int *);
5156 Elm_Win_Smart_Data *sd = _pd;
5158 ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
5162 elm_win_conformant_set(Evas_Object *obj,
5163 Eina_Bool conformant)
5166 eo_do(obj, elm_obj_win_conformant_set(conformant));
5170 _conformant_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5172 Eina_Bool conformant = va_arg(*list, int);
5173 Elm_Win_Smart_Data *sd = _pd;
5175 #ifdef HAVE_ELEMENTARY_X
5176 _elm_win_xwindow_get(sd);
5178 ecore_x_e_illume_conformant_set(sd->x.xwin, conformant);
5185 elm_win_conformant_get(const Evas_Object *obj)
5187 ELM_WIN_CHECK(obj) EINA_FALSE;
5188 Eina_Bool ret = EINA_FALSE;
5189 eo_do((Eo *) obj, elm_obj_win_conformant_get(&ret));
5194 _conformant_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5196 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5197 Elm_Win_Smart_Data *sd = _pd;
5200 #ifdef HAVE_ELEMENTARY_X
5201 _elm_win_xwindow_get(sd);
5203 *ret = ecore_x_e_illume_conformant_get(sd->x.xwin);
5208 elm_win_quickpanel_set(Evas_Object *obj,
5209 Eina_Bool quickpanel)
5212 eo_do(obj, elm_obj_win_quickpanel_set(quickpanel));
5216 _quickpanel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5218 Eina_Bool quickpanel = va_arg(*list, int);
5219 Elm_Win_Smart_Data *sd = _pd;
5220 #ifdef HAVE_ELEMENTARY_X
5221 _elm_win_xwindow_get(sd);
5224 ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel);
5227 Ecore_X_Window_State states[2];
5229 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
5230 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
5231 ecore_x_netwm_window_state_set(sd->x.xwin, states, 2);
5232 ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
5241 elm_win_quickpanel_get(const Evas_Object *obj)
5243 ELM_WIN_CHECK(obj) EINA_FALSE;
5244 Eina_Bool ret = EINA_FALSE;
5245 eo_do((Eo *) obj, elm_obj_win_quickpanel_get(&ret));
5250 _quickpanel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5252 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5253 Elm_Win_Smart_Data *sd = _pd;
5256 #ifdef HAVE_ELEMENTARY_X
5257 _elm_win_xwindow_get(sd);
5259 *ret = ecore_x_e_illume_quickpanel_get(sd->x.xwin);
5264 elm_win_quickpanel_priority_major_set(Evas_Object *obj,
5268 eo_do(obj, elm_obj_win_quickpanel_priority_major_set(priority));
5272 _quickpanel_priority_major_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5274 int priority = va_arg(*list, int);
5275 Elm_Win_Smart_Data *sd = _pd;
5277 #ifdef HAVE_ELEMENTARY_X
5278 _elm_win_xwindow_get(sd);
5280 ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
5287 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
5289 ELM_WIN_CHECK(obj) - 1;
5291 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_major_get(&ret));
5296 _quickpanel_priority_major_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5298 int *ret = va_arg(*list, int *);
5299 Elm_Win_Smart_Data *sd = _pd;
5302 #ifdef HAVE_ELEMENTARY_X
5303 _elm_win_xwindow_get(sd);
5305 *ret = ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
5310 elm_win_quickpanel_priority_minor_set(Evas_Object *obj,
5314 eo_do(obj, elm_obj_win_quickpanel_priority_minor_set(priority));
5318 _quickpanel_priority_minor_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5320 int priority = va_arg(*list, int);
5321 Elm_Win_Smart_Data *sd = _pd;
5323 #ifdef HAVE_ELEMENTARY_X
5324 _elm_win_xwindow_get(sd);
5326 ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
5333 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
5335 ELM_WIN_CHECK(obj) - 1;
5337 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_minor_get(&ret));
5342 _quickpanel_priority_minor_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5344 int *ret = va_arg(*list, int *);
5345 Elm_Win_Smart_Data *sd = _pd;
5348 #ifdef HAVE_ELEMENTARY_X
5349 _elm_win_xwindow_get(sd);
5351 *ret = ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
5356 elm_win_quickpanel_zone_set(Evas_Object *obj,
5360 eo_do(obj, elm_obj_win_quickpanel_zone_set(zone));
5364 _quickpanel_zone_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5366 int zone = va_arg(*list, int);
5367 Elm_Win_Smart_Data *sd = _pd;
5369 #ifdef HAVE_ELEMENTARY_X
5370 _elm_win_xwindow_get(sd);
5372 ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
5379 elm_win_quickpanel_zone_get(const Evas_Object *obj)
5381 ELM_WIN_CHECK(obj) 0;
5383 eo_do((Eo *) obj, elm_obj_win_quickpanel_zone_get(&ret));
5388 _quickpanel_zone_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5390 int *ret = va_arg(*list, int *);
5391 Elm_Win_Smart_Data *sd = _pd;
5394 #ifdef HAVE_ELEMENTARY_X
5395 _elm_win_xwindow_get(sd);
5397 *ret = ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
5402 elm_win_prop_focus_skip_set(Evas_Object *obj,
5406 eo_do(obj, elm_obj_win_prop_focus_skip_set(skip));
5410 _prop_focus_skip_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5412 Eina_Bool skip = va_arg(*list, int);
5413 Elm_Win_Smart_Data *sd = _pd;
5415 sd->skip_focus = skip;
5416 TRAP(sd, focus_skip_set, skip);
5420 elm_win_illume_command_send(Evas_Object *obj,
5421 Elm_Illume_Command command,
5425 eo_do(obj, elm_obj_win_illume_command_send(command, params));
5429 _illume_command_send(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5431 Elm_Illume_Command command = va_arg(*list, Elm_Illume_Command);
5432 void *params = va_arg(*list, void *);
5434 Elm_Win_Smart_Data *sd = _pd;
5436 #ifdef HAVE_ELEMENTARY_X
5437 _elm_win_xwindow_get(sd);
5442 case ELM_ILLUME_COMMAND_FOCUS_BACK:
5443 ecore_x_e_illume_focus_back_send(sd->x.xwin);
5446 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
5447 ecore_x_e_illume_focus_forward_send(sd->x.xwin);
5450 case ELM_ILLUME_COMMAND_FOCUS_HOME:
5451 ecore_x_e_illume_focus_home_send(sd->x.xwin);
5454 case ELM_ILLUME_COMMAND_CLOSE:
5455 ecore_x_e_illume_close_send(sd->x.xwin);
5468 elm_win_inlined_image_object_get(Evas_Object *obj)
5470 ELM_WIN_CHECK(obj) NULL;
5471 Evas_Object *ret = NULL;
5472 eo_do(obj, elm_obj_win_inlined_image_object_get(&ret));
5477 _inlined_image_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5479 Evas_Object **ret = va_arg(*list, Evas_Object **);
5480 Elm_Win_Smart_Data *sd = _pd;
5485 elm_win_focus_highlight_enabled_set(Evas_Object *obj,
5489 eo_do(obj, elm_obj_win_focus_highlight_enabled_set(enabled));
5493 _focus_highlight_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5495 Eina_Bool enabled = va_arg(*list, int);
5496 Elm_Win_Smart_Data *sd = _pd;
5498 enabled = !!enabled;
5499 if (sd->focus_highlight.enabled == enabled)
5502 sd->focus_highlight.enabled = enabled;
5504 if (sd->focus_highlight.enabled)
5505 _elm_win_focus_highlight_init(sd);
5507 _elm_win_focus_highlight_shutdown(sd);
5511 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
5513 ELM_WIN_CHECK(obj) EINA_FALSE;
5514 Eina_Bool ret = EINA_FALSE;
5515 eo_do((Eo *) obj, elm_obj_win_focus_highlight_enabled_get(&ret));
5520 _focus_highlight_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5522 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5523 Elm_Win_Smart_Data *sd = _pd;
5524 *ret = sd->focus_highlight.enabled;
5528 elm_win_focus_highlight_style_set(Evas_Object *obj,
5532 eo_do(obj, elm_obj_win_focus_highlight_style_set(style));
5536 _elm_win_smart_theme(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
5538 Elm_Win_Smart_Data *sd = _pd;
5539 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5540 Eina_Bool int_ret = EINA_FALSE;
5542 if (ret) *ret = EINA_TRUE;
5544 eo_do_super(obj, MY_CLASS, elm_wdg_theme_apply(&int_ret));
5545 if (!int_ret) return;
5547 sd->focus_highlight.theme_changed = EINA_TRUE;
5548 _elm_win_focus_highlight_reconfigure_job_start(sd);
5550 if (ret) *ret = EINA_TRUE;
5554 _focus_highlight_style_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5556 const char *style = va_arg(*list, const char *);
5557 Elm_Win_Smart_Data *sd = _pd;
5559 eina_stringshare_replace(&sd->focus_highlight.style, style);
5560 sd->focus_highlight.theme_changed = EINA_TRUE;
5561 _elm_win_focus_highlight_reconfigure_job_start(sd);
5565 elm_win_focus_highlight_style_get(const Evas_Object *obj)
5567 ELM_WIN_CHECK(obj) NULL;
5568 const char *ret = NULL;
5569 eo_do((Eo *) obj, elm_obj_win_focus_highlight_style_get(&ret));
5574 _focus_highlight_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5576 const char **ret = va_arg(*list, const char **);
5577 Elm_Win_Smart_Data *sd = _pd;
5578 *ret = sd->focus_highlight.style;
5582 elm_win_focus_highlight_animate_set(Evas_Object *obj,
5586 eo_do(obj, elm_obj_win_focus_highlight_animate_set(animate));
5590 _focus_highlight_animate_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5592 Eina_Bool animate = va_arg(*list, int);
5593 Elm_Win_Smart_Data *sd = _pd;
5595 animate = !!animate;
5596 if (sd->focus_highlight.animate == animate)
5599 sd->focus_highlight.animate = animate;
5600 sd->focus_highlight.theme_changed = EINA_TRUE;
5601 _elm_win_focus_highlight_reconfigure_job_start(sd);
5605 elm_win_focus_highlight_animate_get(const Evas_Object *obj)
5607 ELM_WIN_CHECK(obj) EINA_FALSE;
5608 Eina_Bool ret = EINA_FALSE;
5609 eo_do((Eo *) obj, elm_obj_win_focus_highlight_animate_get(&ret));
5614 _focus_highlight_animate_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5616 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5617 Elm_Win_Smart_Data *sd = _pd;
5618 *ret = sd->focus_highlight.animate;
5622 elm_win_socket_listen(Evas_Object *obj,
5623 const char *svcname,
5627 ELM_WIN_CHECK(obj) EINA_FALSE;
5628 Eina_Bool ret = EINA_FALSE;
5629 eo_do(obj, elm_obj_win_socket_listen(svcname, svcnum, svcsys, &ret));
5634 _socket_listen(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5636 const char *svcname = va_arg(*list, const char *);
5637 int svcnum = va_arg(*list, int);
5638 Eina_Bool svcsys = va_arg(*list, int);
5639 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5640 Elm_Win_Smart_Data *sd = _pd;
5643 if (!sd->ee) return;
5645 if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
5651 /* windowing specific calls - shall we do this differently? */
5654 elm_win_xwindow_get(const Evas_Object *obj)
5658 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5660 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5661 return _elm_ee_xwin_get(ee);
5664 ELM_WIN_CHECK(obj) 0;
5665 Ecore_X_Window ret = 0;
5666 eo_do((Eo *) obj, elm_obj_win_xwindow_get(&ret));
5671 _xwindow_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5673 Ecore_X_Window *ret = va_arg(*list, Ecore_X_Window *);
5674 Elm_Win_Smart_Data *sd = _pd;
5676 #ifdef HAVE_ELEMENTARY_X
5684 *ret = elm_win_xwindow_get(sd->parent);
5691 EAPI Ecore_Wl_Window *
5692 elm_win_wl_window_get(const Evas_Object *obj)
5694 if (!obj) return NULL;
5696 if ((!ENGINE_COMPARE(ELM_WAYLAND_SHM)) &&
5697 (!ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5700 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5702 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5703 return _elm_ee_wlwin_get(ee);
5706 ELM_WIN_CHECK(obj) NULL;
5707 Ecore_Wl_Window *ret = NULL;
5708 eo_do((Eo *) obj, elm_obj_win_wl_window_get(&ret));
5713 _wl_window_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5715 Ecore_Wl_Window **ret = va_arg(*list, Ecore_Wl_Window **);
5716 #if HAVE_ELEMENTARY_WAYLAND
5717 Elm_Win_Smart_Data *sd = _pd;
5725 *ret = elm_win_wl_window_get(sd->parent);
5735 elm_win_trap_set(const Elm_Win_Trap *t)
5737 DBG("old %p, new %p", trap, t);
5739 if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
5741 CRI("trying to set a trap version %lu while %lu was expected!",
5742 t->version, ELM_WIN_TRAP_VERSION);
5751 elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
5754 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
5756 floating = !!floating;
5757 if (floating == sd->floating) return;
5758 sd->floating = floating;
5759 #ifdef HAVE_ELEMENTARY_X
5760 _elm_win_xwindow_get(sd);
5764 ecore_x_e_illume_window_state_set
5765 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING);
5767 ecore_x_e_illume_window_state_set
5768 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL);
5774 elm_win_floating_mode_get(const Evas_Object *obj)
5776 ELM_WIN_CHECK(obj) EINA_FALSE;
5777 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
5779 return sd->floating;
5783 _window_id_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5785 Ecore_Window *ret = va_arg(*list, Ecore_Window *);
5786 Elm_Win_Smart_Data *sd = _pd;
5788 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5790 #if HAVE_ELEMENTARY_WAYLAND
5793 *ret = (Ecore_Window)ecore_wl_window_surface_id_get(sd->wl.win);
5798 Ecore_Wl_Window *parent;
5800 parent = elm_win_wl_window_get(sd->parent);
5801 if (parent) *ret = (Ecore_Window)ecore_wl_window_surface_id_get(parent);
5808 #ifdef HAVE_ELEMENTARY_X
5809 _elm_win_xwindow_get(sd);
5812 *ret = (Ecore_Window)sd->x.xwin;
5817 *ret = (Ecore_Window)elm_win_xwindow_get(sd->parent);
5827 _elm_win_focus_highlight_start(Evas_Object *obj)
5829 ELM_WIN_DATA_GET(obj, sd);
5831 if (!elm_win_focus_highlight_enabled_get(obj)) return;
5832 sd->focus_highlight.cur.visible = EINA_TRUE;
5833 sd->focus_highlight.geometry_changed = EINA_TRUE;
5834 _elm_win_focus_highlight_reconfigure(sd);
5838 elm_win_window_id_get(const Evas_Object *obj)
5842 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5844 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5845 return ecore_evas_window_get(ee);
5848 ELM_WIN_CHECK(obj) 0;
5849 Ecore_Window ret = 0;
5850 eo_do((Eo *) obj, elm_obj_win_window_id_get(&ret));
5855 _class_constructor(Eo_Class *klass)
5857 const Eo_Op_Func_Description func_desc[] = {
5858 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
5859 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_win_smart_add),
5860 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_win_smart_del),
5861 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_win_smart_resize),
5862 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_win_smart_move),
5863 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_win_smart_show),
5864 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_win_smart_hide),
5866 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_win_smart_on_focus),
5867 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_win_smart_event),
5868 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_win_smart_focus_next_manager_is),
5869 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_win_smart_focus_next),
5870 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_win_smart_focus_direction_manager_is),
5871 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_win_smart_focus_direction),
5872 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_APPLY), _elm_win_smart_theme),
5874 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), _win_constructor),
5875 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD), _resize_object_add),
5876 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), _resize_object_del),
5877 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TYPE_GET), _type_get),
5878 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_SET), _title_set),
5879 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_GET), _title_get),
5880 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET), _icon_name_set),
5881 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET), _icon_name_get),
5882 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_SET), _role_set),
5883 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_GET), _role_get),
5884 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET), _icon_object_set),
5885 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET), _icon_object_get),
5886 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET), _autodel_set),
5887 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET), _autodel_get),
5888 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ACTIVATE), _activate),
5889 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LOWER), _lower),
5890 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RAISE), _raise),
5891 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CENTER), _center),
5892 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET), _borderless_set),
5893 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET), _borderless_get),
5894 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_SET), _shaped_set),
5895 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_GET), _shaped_get),
5896 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_SET), _alpha_set),
5897 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_GET), _alpha_get),
5898 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET), _override_set),
5899 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET), _override_get),
5900 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET), _fullscreen_set),
5901 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET), _fullscreen_get),
5902 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET), _main_menu_get),
5903 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET), _maximized_set),
5904 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET), _maximized_get),
5905 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET), _iconified_set),
5906 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET), _iconified_get),
5907 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET), _withdrawn_set),
5908 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET), _withdrawn_get),
5909 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET), _available_profiles_set),
5910 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET), _available_profiles_get),
5911 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_SET), _profile_set),
5912 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_GET), _profile_get),
5913 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_SET), _urgent_set),
5914 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_GET), _urgent_get),
5915 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET), _demand_attention_set),
5916 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET), _demand_attention_get),
5917 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_SET), _modal_set),
5918 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_GET), _modal_get),
5919 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_SET), _aspect_set),
5920 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_GET), _aspect_get),
5921 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET), _size_base_set),
5922 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET), _size_base_get),
5923 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET), _size_step_set),
5924 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET), _size_step_get),
5925 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_SET), _layer_set),
5926 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_GET), _layer_get),
5927 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_SET), _rotation_set),
5928 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET), _rotation_with_resize_set),
5929 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_GET), _rotation_get),
5930 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_SET), _sticky_set),
5931 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_GET), _sticky_get),
5932 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET), _keyboard_mode_set),
5933 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET), _keyboard_mode_get),
5934 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET), _keyboard_win_set),
5935 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET), _keyboard_win_get),
5936 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET), _indicator_mode_set),
5937 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET), _indicator_mode_get),
5938 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET), _indicator_opacity_set),
5939 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET), _indicator_opacity_get),
5940 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET), _screen_position_get),
5941 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_GET), _focus_get),
5942 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET), _screen_constrain_set),
5943 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET), _screen_constrain_get),
5944 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET), _screen_size_get),
5945 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET), _screen_dpi_get),
5946 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET), _conformant_set),
5947 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET), _conformant_get),
5948 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET), _quickpanel_set),
5949 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET), _quickpanel_get),
5950 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET), _quickpanel_priority_major_set),
5951 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET), _quickpanel_priority_major_get),
5952 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET), _quickpanel_priority_minor_set),
5953 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET), _quickpanel_priority_minor_get),
5954 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET), _quickpanel_zone_set),
5955 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET), _quickpanel_zone_get),
5956 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET), _prop_focus_skip_set),
5957 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND), _illume_command_send),
5958 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET), _inlined_image_object_get),
5959 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET), _focus_highlight_enabled_set),
5960 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET), _focus_highlight_enabled_get),
5961 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET), _focus_highlight_style_set),
5962 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET), _focus_highlight_style_get),
5963 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET), _focus_highlight_animate_set),
5964 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET), _focus_highlight_animate_get),
5965 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN), _socket_listen),
5966 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), _xwindow_get),
5967 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), _wl_window_get),
5968 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), _window_id_get),
5969 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET), _wm_rotation_supported_get),
5970 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET), _wm_preferred_rotation_set),
5971 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET), _wm_preferred_rotation_get),
5972 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET), _wm_available_rotations_set),
5973 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET), _wm_available_rotations_get),
5974 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET), _wm_manual_rotation_done_set),
5975 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET), _wm_manual_rotation_done_get),
5976 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE), _wm_manual_rotation_done),
5980 eo_class_funcs_set(klass, func_desc);
5982 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
5985 static const Eo_Op_Description op_desc[] = {
5986 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR, "Adds a window object."),
5987 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD, "Add subobj as a resize object of window obj."),
5988 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL, "Delete subobj as a resize object of window obj."),
5989 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TYPE_GET, "Get the type of the window."),
5990 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_SET, "Set the title of the window."),
5991 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_GET, "Get the title of the window."),
5992 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET, "Set the icon name of the window."),
5993 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET, "Get the icon name of the window."),
5994 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_SET, "Set the role of the window."),
5995 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_GET, "Get the role of the window."),
5996 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET, "Set a window object's icon."),
5997 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET, "Get the icon object used for the window."),
5998 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET, "Set the window's autodel state."),
5999 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET, "Get the window's autodel state."),
6000 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ACTIVATE, "Activate a window object."),
6001 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LOWER, "Lower a window object."),
6002 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RAISE, "Raise a window object."),
6003 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CENTER, "Center a window on its screen."),
6004 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET, "Set the borderless state of a window."),
6005 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET, "Get the borderless state of a window."),
6006 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_SET, "Set the shaped state of a window."),
6007 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_GET, "Get the shaped state of a window."),
6008 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_SET, "Set the alpha channel state of a window."),
6009 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_GET, "Get the alpha channel state of a window."),
6010 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET, "Set the override state of a window."),
6011 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET, "Get the override state of a window."),
6012 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET, "Set the fullscreen state of a window."),
6013 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET, "Get the fullscreen state of a window."),
6014 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET, "Get the Main Menu of a window."),
6015 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET, "Set the maximized state of a window."),
6016 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET, "Get the maximized state of a window."),
6017 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET, "Set the iconified state of a window."),
6018 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET, "Get the iconified state of a window."),
6019 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET, "Set the withdrawn state of a window."),
6020 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET, "Get the withdrawn state of a window."),
6021 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET, "Set the array of available profiles to a window."),
6022 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET, "Get the array of available profiles of a window."),
6023 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_SET, "Set the profile of a window."),
6024 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_GET, "Get the profile of a window."),
6025 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_SET, "Set the urgent state of a window."),
6026 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_GET, "Get the urgent state of a window."),
6027 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET, "Set the demand_attention state of a window."),
6028 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET, "Get the demand_attention state of a window."),
6029 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_SET, "Set the modal state of a window."),
6030 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_GET, "Get the modal state of a window."),
6031 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_SET, "Set the aspect ratio of a window."),
6032 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_GET, "Get the aspect ratio of a window."),
6033 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET, "Set the base window size used with stepping calculation."),
6034 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET, "Get the base size of a window."),
6035 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET, "Set the window stepping used with sizing calculation."),
6036 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET, "Get the stepping of a window."),
6037 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_SET, "Set the layer of the window."),
6038 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_GET, "Get the layer of the window."),
6039 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_SET, "Set the rotation of the window."),
6040 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET, "Rotates the window and resizes it."),
6041 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_GET, "Get the rotation of the window."),
6042 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_SET, "Set the sticky state of the window."),
6043 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_GET, "Get the sticky state of the window."),
6044 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET, "Sets the keyboard mode of the window."),
6045 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET, "Get the keyboard mode of the window."),
6046 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET, "Sets whether the window is a keyboard."),
6047 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET, "Get whether the window is a keyboard."),
6048 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET, "Sets the indicator mode of the window."),
6049 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET, "Get the indicator mode of the window."),
6050 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET, "Sets the indicator opacity mode of the window."),
6051 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET, "Get the indicator opacity mode of the window."),
6052 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET, "Get the screen position of a window."),
6053 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_GET, "Determine whether a window has focus."),
6054 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET, "Constrain the maximum width and height of a window to the width and height of its screen."),
6055 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET, "Retrieve the constraints on the maximum width and height of a window relative to the width and height of its screen."),
6056 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET, "Get screen geometry details for the screen that a window is on."),
6057 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET, "Get screen dpi for the screen that a window is on."),
6058 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET, "Set if this window is an illume conformant window."),
6059 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET, "Get if this window is an illume conformant window."),
6060 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET, "Set a window to be an illume quickpanel window."),
6061 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET, "Get if this window is a quickpanel or not."),
6062 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET, "Set the major priority of a quickpanel window."),
6063 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET, "Get the major priority of a quickpanel window."),
6064 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET, "Set the minor priority of a quickpanel window."),
6065 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET, "Get the minor priority of a quickpanel window."),
6066 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET, "Set which zone this quickpanel should appear in."),
6067 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET, "Get which zone this quickpanel should appear in."),
6068 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET, "Set the window to be skipped by keyboard focus."),
6069 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND, "Send a command to the windowing environment."),
6070 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET, "Get the inlined image object handle."),
6071 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET, "Set the enabled status for the focus highlight in a window."),
6072 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET, "Get the enabled value of the focus highlight for this window."),
6073 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET, "Set the style for the focus highlight on this window."),
6074 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET, "Get the style set for the focus highlight object."),
6075 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET, "Set the animate status for the focus highlight for this window."),
6076 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET, "Get the animate status for the focus highlight for this window."),
6077 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN, "Create a socket to provide the service for Plug widget."),
6078 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, "Get the Ecore_X_Window of an Evas_Object."),
6079 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, "Get the Ecore_Wl_Window of an Evas_Object."),
6080 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET, "Get the Ecore_Window of an Evas_Object."),
6081 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET, "Query if the underlying windowing system supports the window manager rotation.."),
6082 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET, "Set the preferred rotation hint."),
6083 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET, "Get the preferred rotation hint."),
6084 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET, "Set the array of available window rotations."),
6085 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET, "Get the array of available window rotations."),
6086 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET, "Set manual rotation done mode of obj window."),
6087 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET, "Get manual rotation done mode of obj window."),
6088 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE, "Set rotation finish manually"),
6089 EO_OP_DESCRIPTION_SENTINEL
6092 static const Eo_Class_Description class_desc = {
6095 EO_CLASS_TYPE_REGULAR,
6096 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WIN_BASE_ID, op_desc, ELM_OBJ_WIN_SUB_ID_LAST),
6098 sizeof(Elm_Win_Smart_Data),
6103 EO_DEFINE_CLASS(elm_obj_win_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);