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 px, py, pw, ph;
709 Edje_Message_Int_Set *m;
710 Evas_Object *target = sd->focus_highlight.cur.target;
712 evas_object_geometry_get(obj, &px, &py, &pw, &ph);
713 elm_widget_focus_highlight_geometry_get(target, &tx, &ty, &tw, &th, EINA_TRUE);
714 evas_object_move(obj, tx, ty);
715 evas_object_resize(obj, tw, th);
717 if (!_elm_config->focus_highlight_clip_disable)
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 elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE);
742 evas_object_move(obj, x, y);
743 evas_object_resize(obj, w, h);
745 if (!_elm_config->focus_highlight_clip_disable)
747 clip = evas_object_clip_get(target);
748 if (clip) evas_object_clip_set(obj, clip);
753 _elm_win_focus_highlight_reconfigure_job(void *data)
755 ELM_WIN_DATA_GET(data, sd);
756 Evas_Object *target = sd->focus_highlight.cur.target;
757 Evas_Object *previous = sd->focus_highlight.prev.target;
758 Evas_Object *fobj = sd->focus_highlight.fobj;
759 Eina_Bool visible_changed;
760 Eina_Bool common_visible;
761 const char *sig = NULL;
762 const char *focus_style_target = NULL;
763 const char *focus_style_previous = NULL;
765 _elm_win_focus_highlight_reconfigure_job_stop(sd);
767 visible_changed = (sd->focus_highlight.cur.visible !=
768 sd->focus_highlight.prev.visible);
770 if ((target == previous) && (!visible_changed) &&
771 (!sd->focus_highlight.geometry_changed) &&
772 (!sd->focus_highlight.theme_changed))
775 if ((previous) && (sd->focus_highlight.prev.in_theme))
776 elm_widget_signal_emit
777 (previous, "elm,action,focus_highlight,hide", "elm");
780 common_visible = EINA_FALSE;
781 else if (sd->focus_highlight.cur.in_theme)
783 common_visible = EINA_FALSE;
784 if (sd->focus_highlight.cur.visible)
785 sig = "elm,action,focus_highlight,show";
787 sig = "elm,action,focus_highlight,hide";
790 common_visible = sd->focus_highlight.cur.visible;
793 elm_widget_signal_emit(target, sig, "elm");
795 if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
799 focus_style_previous = elm_widget_focus_highlight_style_get(previous);
800 focus_style_target = elm_widget_focus_highlight_style_get(target);
802 if (sd->focus_highlight.theme_changed ||
803 (focus_style_target != focus_style_previous))
807 if (focus_style_target)
808 str = focus_style_target;
809 else if (sd->focus_highlight.style)
810 str = sd->focus_highlight.style;
814 elm_widget_theme_object_set
815 (sd->obj, fobj, "focus_highlight", "top", str);
816 sd->focus_highlight.theme_changed = EINA_FALSE;
818 if (sd->focus_highlight.animate)
820 str = edje_object_data_get(sd->focus_highlight.fobj, "animate");
821 sd->focus_highlight.animate_supported = ((str) && (!strcmp(str, "on")));
824 sd->focus_highlight.animate_supported = EINA_FALSE;
827 if ((sd->focus_highlight.animate_supported) && (previous) &&
828 (!sd->focus_highlight.prev.in_theme))
829 _elm_win_focus_highlight_anim_setup(sd, fobj);
831 _elm_win_focus_highlight_simple_setup(sd, fobj);
832 evas_object_raise(fobj);
835 _elm_win_focus_highlight_visible_set(sd, common_visible);
836 sd->focus_highlight.geometry_changed = EINA_FALSE;
837 sd->focus_highlight.prev = sd->focus_highlight.cur;
841 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win_Smart_Data *sd)
843 ecore_job_del(sd->focus_highlight.reconf_job);
845 sd->focus_highlight.reconf_job = ecore_job_add(
846 _elm_win_focus_highlight_reconfigure_job, sd->obj);
850 _elm_win_focus_in(Ecore_Evas *ee)
852 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
854 unsigned int order = 0;
860 _elm_widget_top_win_focused_set(obj, EINA_TRUE);
861 if (!elm_widget_focus_order_get(obj)
862 || (obj == elm_widget_newest_focus_order_get(obj, &order, EINA_TRUE)))
864 elm_widget_focus_steal(obj);
867 elm_widget_focus_restore(obj);
868 evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
869 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
870 sd->focus_highlight.cur.visible = EINA_TRUE;
871 _elm_win_focus_highlight_reconfigure_job_start(sd);
874 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
878 /* else if (sd->img_obj) */
884 _elm_win_focus_out(Ecore_Evas *ee)
886 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
893 elm_object_focus_set(obj, EINA_FALSE);
894 _elm_widget_top_win_focused_set(obj, EINA_FALSE);
895 evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
896 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
897 sd->focus_highlight.cur.visible = EINA_FALSE;
898 _elm_win_focus_highlight_reconfigure_job_start(sd);
901 edje_object_signal_emit(sd->frame_obj, "elm,action,unfocus", "elm");
905 _elm_access_object_highlight_disable(evas_object_evas_get(obj));
908 /* if (sd->img_obj) */
914 _elm_win_available_profiles_del(Elm_Win_Smart_Data *sd)
916 if (!sd->profile.available_list) return;
919 for (i = 0; i < sd->profile.count; i++)
920 ELM_SAFE_FREE(sd->profile.available_list[i], eina_stringshare_del);
921 sd->profile.count = 0;
922 ELM_SAFE_FREE(sd->profile.available_list, free);
926 _elm_win_profile_del(Elm_Win_Smart_Data *sd)
928 ELM_SAFE_FREE(sd->profile.name, eina_stringshare_del);
932 _elm_win_profile_set(Elm_Win_Smart_Data *sd, const char *profile)
934 Eina_Bool changed = EINA_FALSE;
937 if (sd->profile.name)
939 if (strcmp(sd->profile.name, profile) != 0)
941 eina_stringshare_replace(&(sd->profile.name), profile);
947 sd->profile.name = eina_stringshare_add(profile);
952 _elm_win_profile_del(sd);
958 _elm_win_profile_update(Elm_Win_Smart_Data *sd)
960 if (sd->profile.available_list)
962 Eina_Bool found = EINA_FALSE;
963 if (sd->profile.name)
966 for (i = 0; i < sd->profile.count; i++)
968 if (!strcmp(sd->profile.name,
969 sd->profile.available_list[i]))
977 /* If current profile is not present in an available profiles,
978 * change current profile to the 1st element of an array.
981 _elm_win_profile_set(sd, sd->profile.available_list[0]);
984 _elm_config_profile_set(sd->profile.name);
988 Eina_List *sub, *l = NULL;
990 sub = ecore_evas_sub_ecore_evas_list_get(sd->ee);
991 EINA_LIST_FOREACH(sub, l, ee2)
992 ecore_evas_window_profile_set(ee2, sd->profile.name);
994 evas_object_smart_callback_call(sd->obj, SIG_PROFILE_CHANGED, NULL);
998 _elm_win_state_change(Ecore_Evas *ee)
1000 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1002 Eina_Bool ch_withdrawn = EINA_FALSE;
1003 Eina_Bool ch_sticky = EINA_FALSE;
1004 Eina_Bool ch_iconified = EINA_FALSE;
1005 Eina_Bool ch_fullscreen = EINA_FALSE;
1006 Eina_Bool ch_maximized = EINA_FALSE;
1007 Eina_Bool ch_profile = EINA_FALSE;
1008 Eina_Bool ch_wm_rotation = EINA_FALSE;
1009 const char *profile;
1015 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
1017 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
1018 ch_withdrawn = EINA_TRUE;
1020 if (sd->sticky != ecore_evas_sticky_get(sd->ee))
1022 sd->sticky = ecore_evas_sticky_get(sd->ee);
1023 ch_sticky = EINA_TRUE;
1025 if (sd->iconified != ecore_evas_iconified_get(sd->ee))
1027 sd->iconified = ecore_evas_iconified_get(sd->ee);
1028 ch_iconified = EINA_TRUE;
1030 if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee))
1032 sd->fullscreen = ecore_evas_fullscreen_get(sd->ee);
1033 ch_fullscreen = EINA_TRUE;
1035 if (sd->maximized != ecore_evas_maximized_get(sd->ee))
1037 sd->maximized = ecore_evas_maximized_get(sd->ee);
1038 ch_maximized = EINA_TRUE;
1041 profile = ecore_evas_window_profile_get(sd->ee);
1042 ch_profile = _elm_win_profile_set(sd, profile);
1046 if (sd->rot != ecore_evas_rotation_get(sd->ee))
1048 sd->rot = ecore_evas_rotation_get(sd->ee);
1049 ch_wm_rotation = EINA_TRUE;
1053 _elm_win_state_eval_queue();
1055 if ((ch_withdrawn) || (ch_iconified))
1058 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL);
1059 else if (sd->iconified)
1060 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL);
1062 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL);
1067 evas_object_smart_callback_call(obj, SIG_STICK, NULL);
1069 evas_object_smart_callback_call(obj, SIG_UNSTICK, NULL);
1074 evas_object_smart_callback_call(obj, SIG_FULLSCREEN, NULL);
1076 evas_object_smart_callback_call(obj, SIG_UNFULLSCREEN, NULL);
1081 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL);
1083 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL);
1087 _elm_win_profile_update(sd);
1091 evas_object_size_hint_min_set(obj, -1, -1);
1092 evas_object_size_hint_max_set(obj, -1, -1);
1093 #ifdef HAVE_ELEMENTARY_X
1094 _elm_win_xwin_update(sd);
1096 elm_widget_orientation_set(obj, sd->rot);
1097 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
1098 evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
1103 _elm_win_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1105 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1110 _elm_win_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1112 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
1113 Evas_Object **next = va_arg(*list, Evas_Object **);
1114 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1115 if (ret) *ret = EINA_FALSE;
1117 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1119 const Eina_List *items;
1120 void *(*list_data_get)(const Eina_List *list);
1125 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1127 items = wd->subobjs;
1131 list_data_get = eina_list_data_get;
1133 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
1137 if (ret) *ret = EINA_TRUE;
1141 *next = (Evas_Object *)obj;
1146 _elm_win_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1148 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1153 _elm_win_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1155 const Evas_Object *base = va_arg(*list, Evas_Object *);
1156 double degree = va_arg(*list, double);
1157 Evas_Object **direction = va_arg(*list, Evas_Object **);
1158 double *weight = va_arg(*list, double *);
1159 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1160 if (ret) *ret = EINA_FALSE;
1161 Eina_Bool int_ret = EINA_FALSE;
1163 const Eina_List *items;
1164 void *(*list_data_get)(const Eina_List *list);
1166 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1171 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1172 items = wd->subobjs;
1174 list_data_get = eina_list_data_get;
1176 int_ret = elm_widget_focus_list_direction_get
1177 (obj, base, items, list_data_get, degree, direction, weight);
1178 if (ret) *ret = int_ret;
1183 _elm_win_smart_on_focus(Eo *obj, void *_pd, va_list *list)
1185 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1186 if (ret) *ret = EINA_TRUE;
1187 Elm_Win_Smart_Data *sd = _pd;
1188 Eina_Bool int_ret = EINA_FALSE;
1190 eo_do_super(obj, MY_CLASS, elm_obj_widget_on_focus(&int_ret));
1191 if (!int_ret) return;
1194 evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));
1196 evas_object_focus_set(obj, elm_widget_focus_get(obj));
1200 _elm_win_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1202 Evas_Object *src = va_arg(*list, Evas_Object *);
1203 Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
1204 Evas_Event_Key_Down *ev = va_arg(*list, void *);
1205 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1207 if (ret) *ret = EINA_FALSE;
1210 if (elm_widget_disabled_get(obj)) return;
1211 if (type != EVAS_CALLBACK_KEY_DOWN) return;
1213 if ((!strcmp(ev->key, "Tab")) ||
1214 (!strcmp(ev->key, "ISO_Left_Tab")))
1216 if (evas_key_modifier_is_set(ev->modifiers, "Control") ||
1217 evas_key_modifier_is_set(ev->modifiers, "Alt"))
1219 if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
1220 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1222 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1226 else if ((!strcmp(ev->key, "Left")) ||
1227 ((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
1229 elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
1233 else if ((!strcmp(ev->key, "Right")) ||
1234 ((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
1236 elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
1240 else if ((!strcmp(ev->key, "Up")) ||
1241 ((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
1243 elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
1247 else if ((!strcmp(ev->key, "Down")) ||
1248 ((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
1250 elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
1258 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1259 if (ret) *ret = EINA_TRUE;
1263 _deferred_ecore_evas_free(void *data)
1265 ecore_evas_free(data);
1266 _elm_win_deferred_free--;
1270 _elm_win_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1272 Elm_Win_Smart_Data *sd = _pd;
1274 if (!evas_object_visible_get(obj))
1275 _elm_win_state_eval_queue();
1276 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
1280 if (sd->shot.info) _shot_handle(sd);
1284 _elm_win_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1286 Elm_Win_Smart_Data *sd = _pd;
1288 if (evas_object_visible_get(obj))
1289 _elm_win_state_eval_queue();
1290 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
1296 evas_object_hide(sd->frame_obj);
1300 evas_object_hide(sd->img_obj);
1302 if (sd->pointer.obj)
1304 evas_object_hide(sd->pointer.obj);
1305 ecore_evas_hide(sd->pointer.ee);
1310 _elm_win_on_parent_del(void *data,
1311 Evas *e EINA_UNUSED,
1313 void *event_info EINA_UNUSED)
1315 ELM_WIN_DATA_GET(data, sd);
1317 if (obj == sd->parent) sd->parent = NULL;
1321 _elm_win_focus_target_move(void *data,
1322 Evas *e EINA_UNUSED,
1323 Evas_Object *obj EINA_UNUSED,
1324 void *event_info EINA_UNUSED)
1326 ELM_WIN_DATA_GET(data, sd);
1328 sd->focus_highlight.geometry_changed = EINA_TRUE;
1329 _elm_win_focus_highlight_reconfigure_job_start(sd);
1333 _elm_win_focus_target_resize(void *data,
1334 Evas *e EINA_UNUSED,
1335 Evas_Object *obj EINA_UNUSED,
1336 void *event_info EINA_UNUSED)
1338 ELM_WIN_DATA_GET(data, sd);
1340 sd->focus_highlight.geometry_changed = EINA_TRUE;
1341 _elm_win_focus_highlight_reconfigure_job_start(sd);
1345 _elm_win_focus_target_del(void *data,
1346 Evas *e EINA_UNUSED,
1347 Evas_Object *obj EINA_UNUSED,
1348 void *event_info EINA_UNUSED)
1350 ELM_WIN_DATA_GET(data, sd);
1352 sd->focus_highlight.cur.target = NULL;
1354 _elm_win_focus_highlight_reconfigure_job_start(sd);
1357 static Evas_Object *
1358 _elm_win_focus_target_get(Evas_Object *obj)
1360 Evas_Object *o = obj;
1364 if (elm_widget_is(o))
1366 if (!elm_widget_highlight_ignore_get(o))
1368 o = elm_widget_parent_get(o);
1370 o = evas_object_smart_parent_get(o);
1374 o = elm_widget_parent_widget_get(o);
1376 o = evas_object_smart_parent_get(o);
1385 _elm_win_focus_target_callbacks_add(Elm_Win_Smart_Data *sd)
1387 Evas_Object *obj = sd->focus_highlight.cur.target;
1390 evas_object_event_callback_add
1391 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1392 evas_object_event_callback_add
1393 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1394 evas_object_event_callback_add
1395 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1399 _elm_win_focus_target_callbacks_del(Elm_Win_Smart_Data *sd)
1401 Evas_Object *obj = sd->focus_highlight.cur.target;
1403 evas_object_event_callback_del_full
1404 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1405 evas_object_event_callback_del_full
1406 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1407 evas_object_event_callback_del_full
1408 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1412 _elm_win_object_focus_in(void *data,
1413 Evas *e EINA_UNUSED,
1416 Evas_Object *obj = event_info, *target;
1417 ELM_WIN_DATA_GET(data, sd);
1419 if (sd->focus_highlight.cur.target == obj)
1422 target = _elm_win_focus_target_get(obj);
1423 sd->focus_highlight.cur.target = target;
1424 if (target && elm_widget_highlight_in_theme_get(target))
1425 sd->focus_highlight.cur.in_theme = EINA_TRUE;
1427 _elm_win_focus_target_callbacks_add(sd);
1429 _elm_win_focus_highlight_reconfigure_job_start(sd);
1433 _elm_win_object_focus_out(void *data,
1434 Evas *e EINA_UNUSED,
1435 void *event_info EINA_UNUSED)
1437 ELM_WIN_DATA_GET(data, sd);
1439 if (!sd->focus_highlight.cur.target)
1442 if (!sd->focus_highlight.cur.in_theme)
1443 _elm_win_focus_target_callbacks_del(sd);
1445 sd->focus_highlight.cur.target = NULL;
1446 sd->focus_highlight.cur.in_theme = EINA_FALSE;
1448 _elm_win_focus_highlight_reconfigure_job_start(sd);
1452 _elm_win_focus_highlight_shutdown(Elm_Win_Smart_Data *sd)
1454 _elm_win_focus_highlight_reconfigure_job_stop(sd);
1455 if (sd->focus_highlight.cur.target)
1457 elm_widget_signal_emit(sd->focus_highlight.cur.target,
1458 "elm,action,focus_highlight,hide", "elm");
1459 _elm_win_focus_target_callbacks_del(sd);
1460 sd->focus_highlight.cur.target = NULL;
1462 ELM_SAFE_FREE(sd->focus_highlight.fobj, evas_object_del);
1464 evas_event_callback_del_full
1465 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1466 _elm_win_object_focus_in, sd->obj);
1467 evas_event_callback_del_full
1468 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1469 _elm_win_object_focus_out, sd->obj);
1473 _win_img_hide(void *data,
1474 Evas *e EINA_UNUSED,
1475 Evas_Object *obj EINA_UNUSED,
1476 void *event_info EINA_UNUSED)
1478 elm_widget_focus_hide_handle(data);
1482 _win_img_mouse_up(void *data,
1483 Evas *e EINA_UNUSED,
1484 Evas_Object *obj EINA_UNUSED,
1487 Evas_Event_Mouse_Up *ev = event_info;
1488 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1489 elm_widget_focus_mouse_up_handle(data);
1493 _win_img_focus_in(void *data,
1494 Evas *e EINA_UNUSED,
1495 Evas_Object *obj EINA_UNUSED,
1496 void *event_info EINA_UNUSED)
1498 elm_widget_focus_steal(data);
1502 _win_img_focus_out(void *data,
1503 Evas *e EINA_UNUSED,
1504 Evas_Object *obj EINA_UNUSED,
1505 void *event_info EINA_UNUSED)
1507 elm_widget_focused_object_clear(data);
1511 _elm_win_on_img_obj_del(void *data,
1512 Evas *e EINA_UNUSED,
1513 Evas_Object *obj EINA_UNUSED,
1514 void *event_info EINA_UNUSED)
1516 ELM_WIN_DATA_GET(data, sd);
1517 _elm_win_img_callbacks_del(sd->obj, sd->img_obj);
1522 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
1524 evas_object_event_callback_del_full
1525 (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1526 evas_object_event_callback_del_full
1527 (imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
1528 evas_object_event_callback_del_full
1529 (imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
1530 evas_object_event_callback_del_full
1531 (imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
1532 evas_object_event_callback_del_full
1533 (imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
1537 _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1539 Elm_Win_Smart_Data *sd = _pd;
1541 evas_object_event_callback_del_full(sd->layout,
1542 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1543 _elm_win_on_resize_obj_changed_size_hints,
1545 evas_object_del(sd->box);
1546 evas_object_del(sd->layout);
1548 /* NB: child deletion handled by parent's smart del */
1550 if ((trap) && (trap->del))
1551 trap->del(sd->trap_data, obj);
1555 evas_object_event_callback_del_full
1556 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
1560 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1562 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1564 _elm_win_state_eval_queue();
1568 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1569 ecore_evas_callback_resize_set(sd->ee, NULL);
1572 ecore_job_del(sd->deferred_resize_job);
1573 ecore_job_del(sd->deferred_child_eval_job);
1574 eina_stringshare_del(sd->shot.info);
1575 ecore_timer_del(sd->shot.timer);
1577 #ifdef HAVE_ELEMENTARY_X
1578 ecore_event_handler_del(sd->x.client_message_handler);
1579 ecore_event_handler_del(sd->x.property_handler);
1584 _elm_win_img_callbacks_del(obj, sd->img_obj);
1591 ecore_job_add(_deferred_ecore_evas_free, sd->ee);
1592 _elm_win_deferred_free++;
1596 _elm_win_focus_highlight_shutdown(sd);
1597 eina_stringshare_del(sd->focus_highlight.style);
1599 eina_stringshare_del(sd->title);
1600 eina_stringshare_del(sd->icon_name);
1601 eina_stringshare_del(sd->role);
1602 evas_object_del(sd->icon);
1603 evas_object_del(sd->main_menu);
1605 _elm_win_profile_del(sd);
1606 _elm_win_available_profiles_del(sd);
1608 /* Don't let callback in the air that point to sd */
1609 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1610 ecore_evas_callback_resize_set(sd->ee, NULL);
1611 ecore_evas_callback_mouse_in_set(sd->ee, NULL);
1612 ecore_evas_callback_focus_in_set(sd->ee, NULL);
1613 ecore_evas_callback_focus_out_set(sd->ee, NULL);
1614 ecore_evas_callback_move_set(sd->ee, NULL);
1615 ecore_evas_callback_state_change_set(sd->ee, NULL);
1617 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1619 if ((!_elm_win_list) &&
1620 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
1622 edje_file_cache_flush();
1623 edje_collection_cache_flush();
1624 evas_image_cache_flush(evas_object_evas_get(obj));
1625 evas_font_cache_flush(evas_object_evas_get(obj));
1631 _elm_win_obj_intercept_show(void *data,
1634 ELM_WIN_DATA_GET(data, sd);
1636 // this is called to make sure all smart containers have calculated their
1637 // sizes BEFORE we show the window to make sure it initially appears at
1638 // our desired size (ie min size is known first)
1639 evas_smart_objects_calculate(evas_object_evas_get(obj));
1642 evas_object_show(sd->frame_obj);
1646 evas_object_show(sd->img_obj);
1648 if (sd->pointer.obj)
1650 ecore_evas_show(sd->pointer.ee);
1651 evas_object_show(sd->pointer.obj);
1653 evas_object_show(obj);
1657 _elm_win_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1659 Evas_Coord x = va_arg(*list, Evas_Coord);
1660 Evas_Coord y = va_arg(*list, Evas_Coord);
1661 Elm_Win_Smart_Data *sd = _pd;
1665 if ((x != sd->screen.x) || (y != sd->screen.y))
1669 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1675 TRAP(sd, move, x, y);
1676 if (!ecore_evas_override_get(sd->ee)) return;
1679 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
1681 if (ecore_evas_override_get(sd->ee))
1685 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1689 /* FIXME: We should update ecore_wl_window_location here !! */
1701 _elm_win_smart_resize(Eo *obj, void *_pd, va_list *list)
1703 Evas_Coord w = va_arg(*list, Evas_Coord);
1704 Evas_Coord h = va_arg(*list, Evas_Coord);
1706 Elm_Win_Smart_Data *sd = _pd;
1708 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
1716 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
1723 evas_object_image_size_set(sd->img_obj, w, h);
1726 TRAP(sd, resize, w, h);
1730 _elm_win_delete_request(Ecore_Evas *ee)
1732 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1739 int autodel = sd->autodel;
1740 sd->autodel_clear = &autodel;
1741 evas_object_ref(obj);
1742 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL);
1743 // FIXME: if above callback deletes - then the below will be invalid
1744 if (autodel) evas_object_del(obj);
1745 else sd->autodel_clear = NULL;
1746 evas_object_unref(obj);
1750 _elm_ee_xwin_get(const Ecore_Evas *ee)
1752 #ifdef HAVE_ELEMENTARY_X
1753 const char *engine_name;
1756 engine_name = ecore_evas_engine_name_get(ee);
1757 if (EINA_UNLIKELY(!engine_name)) return 0;
1759 if (!strcmp(engine_name, ELM_SOFTWARE_X11))
1761 return ecore_evas_software_x11_window_get(ee);
1763 else if (!strcmp(engine_name, ELM_OPENGL_X11))
1765 return ecore_evas_gl_x11_window_get(ee);
1773 #ifdef HAVE_ELEMENTARY_X
1775 _elm_win_xwindow_get(Elm_Win_Smart_Data *sd)
1777 sd->x.xwin = _elm_ee_xwin_get(sd->ee);
1782 _elm_ee_wlwin_get(const Ecore_Evas *ee)
1784 #ifdef HAVE_ELEMENTARY_WAYLAND
1785 const char *engine_name;
1787 if (!ee) return NULL;
1789 engine_name = ecore_evas_engine_name_get(ee);
1790 if (EINA_UNLIKELY(!engine_name)) return NULL;
1792 if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
1793 (!strcmp(engine_name, ELM_WAYLAND_EGL)))
1795 return ecore_evas_wayland_window_get(ee);
1803 #ifdef HAVE_ELEMENTARY_WAYLAND
1805 _elm_win_wlwindow_get(Elm_Win_Smart_Data *sd)
1807 sd->wl.win = _elm_ee_wlwin_get(sd->ee);
1811 #ifdef HAVE_ELEMENTARY_X
1813 _elm_win_xwin_update(Elm_Win_Smart_Data *sd)
1817 _elm_win_xwindow_get(sd);
1820 ELM_WIN_DATA_GET(sd->parent, sdp);
1824 ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin);
1828 if (!sd->x.xwin) return; /* nothing more to do */
1831 if (!s) s = _elm_appname;
1833 if (sd->icon_name) s = sd->icon_name;
1834 ecore_x_icccm_icon_name_set(sd->x.xwin, s);
1835 ecore_x_netwm_icon_name_set(sd->x.xwin, s);
1838 if (s) ecore_x_icccm_window_role_set(sd->x.xwin, s);
1845 data = evas_object_image_data_get(sd->icon, EINA_FALSE);
1849 int w = 0, h = 0, stride, x, y;
1853 evas_object_image_size_get(sd->icon, &w, &h);
1854 stride = evas_object_image_stride_get(sd->icon);
1855 if ((w > 0) && (h > 0) &&
1856 (stride >= (int)(w * sizeof(unsigned int))))
1860 ic.data = malloc(w * h * sizeof(unsigned int));
1864 p = (unsigned char *)data;
1865 p2 = (unsigned int *)ic.data;
1866 for (y = 0; y < h; y++)
1868 for (x = 0; x < w; x++)
1870 *p2 = *((unsigned int *)p);
1871 p += sizeof(unsigned int);
1874 p += (stride - (w * sizeof(unsigned int)));
1876 ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
1880 evas_object_image_data_set(sd->icon, data);
1887 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_NORMAL);
1890 case ELM_WIN_DIALOG_BASIC:
1891 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DIALOG);
1894 case ELM_WIN_DESKTOP:
1895 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
1899 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DOCK);
1902 case ELM_WIN_TOOLBAR:
1903 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
1907 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_MENU);
1910 case ELM_WIN_UTILITY:
1911 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_UTILITY);
1914 case ELM_WIN_SPLASH:
1915 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_SPLASH);
1918 case ELM_WIN_DROPDOWN_MENU:
1919 ecore_x_netwm_window_type_set
1920 (sd->x.xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
1923 case ELM_WIN_POPUP_MENU:
1924 ecore_x_netwm_window_type_set
1925 (sd->x.xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
1928 case ELM_WIN_TOOLTIP:
1929 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
1932 case ELM_WIN_NOTIFICATION:
1933 ecore_x_netwm_window_type_set
1934 (sd->x.xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
1938 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_COMBO);
1942 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DND);
1948 ecore_x_e_virtual_keyboard_state_set
1949 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
1950 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
1951 ecore_x_e_illume_indicator_state_set
1952 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
1953 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
1954 ecore_x_e_illume_indicator_state_set
1955 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
1963 * Resize the window according to window layout's min and weight.
1964 * If the window layout's weight is 0.0, the window max is limited to layout's
1967 * This is called when the window layout's weight hint is changed or when the
1968 * window is rotated.
1970 * @param obj window object
1973 _elm_win_resize_objects_eval(Evas_Object *obj)
1975 ELM_WIN_DATA_GET(obj, sd);
1976 Evas_Coord w, h, minw, minh, maxw, maxh;
1979 evas_object_size_hint_min_get(sd->layout, &minw, &minh);
1980 if (minw < 1) minw = 1;
1981 if (minh < 1) minh = 1;
1983 evas_object_size_hint_weight_get(sd->layout, &wx, &wy);
1984 if (!wx) maxw = minw;
1986 if (!wy) maxh = minh;
1989 evas_object_size_hint_min_set(obj, minw, minh);
1990 evas_object_size_hint_max_set(obj, maxw, maxh);
1991 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1992 if (w < minw) w = minw;
1993 if (h < minh) h = minh;
1994 if (w > maxw) w = maxw;
1995 if (h > maxh) h = maxh;
1996 evas_object_move(obj, 0, 0);
1997 evas_object_resize(obj, w, h);
2001 _elm_win_on_resize_obj_changed_size_hints(void *data,
2002 Evas *e EINA_UNUSED,
2003 Evas_Object *obj EINA_UNUSED,
2004 void *event_info EINA_UNUSED)
2006 _elm_win_resize_objects_eval(data);
2010 _elm_win_shutdown(void)
2012 while (_elm_win_list) evas_object_del(_elm_win_list->data);
2013 ELM_SAFE_FREE(_elm_win_state_eval_job, ecore_job_del);
2017 _elm_win_rescale(Elm_Theme *th,
2018 Eina_Bool use_theme)
2025 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2026 elm_widget_theme(obj);
2030 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2031 elm_widget_theme_specific(obj, th, EINA_FALSE);
2036 _elm_win_access(Eina_Bool is_access)
2043 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2045 elm_widget_access(obj, is_access);
2047 /* floating orphan object. if there are A, B, C objects and user does
2048 as below, then there would be floating orphan objects.
2050 1. elm_object_content_set(layout, A);
2051 2. elm_object_content_set(layout, B);
2052 3. elm_object_content_set(layout, C);
2054 now, the object A and B are floating orphan objects */
2059 fobj = evas_object_below_get(fobj);
2062 if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
2064 elm_widget_access(fobj, is_access);
2070 evas = evas_object_evas_get(obj);
2071 if (evas) _elm_access_object_highlight_disable(evas);
2077 _elm_win_translate(void)
2082 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2083 elm_widget_translate(obj);
2086 #ifdef HAVE_ELEMENTARY_X
2088 _elm_win_client_message(void *data,
2089 int type EINA_UNUSED,
2092 ELM_WIN_DATA_GET(data, sd);
2093 Ecore_X_Event_Client_Message *e = event;
2095 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
2096 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
2098 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2100 Evas *evas = evas_object_evas_get(sd->obj);
2103 edje_file_cache_flush();
2104 edje_collection_cache_flush();
2105 evas_image_cache_flush(evas);
2106 evas_font_cache_flush(evas);
2110 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
2112 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2114 Evas *evas = evas_object_evas_get(sd->obj);
2117 edje_file_cache_flush();
2118 edje_collection_cache_flush();
2119 evas_image_cache_flush(evas);
2120 evas_font_cache_flush(evas);
2121 evas_render_dump(evas);
2125 else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
2127 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2129 if ((unsigned int)e->data.l[1] ==
2130 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
2132 // XXX: call right access func
2134 else if ((unsigned int)e->data.l[1] ==
2135 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV)
2137 // XXX: call right access func
2139 else if ((unsigned int)e->data.l[1] ==
2140 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
2142 _elm_access_highlight_object_activate
2143 (sd->obj, ELM_ACTIVATE_DEFAULT);
2145 else if ((unsigned int)e->data.l[1] ==
2146 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
2148 /* there would be better way to read highlight object */
2150 evas = evas_object_evas_get(sd->obj);
2151 if (!evas) return ECORE_CALLBACK_PASS_ON;
2153 _elm_access_mouse_event_enabled_set(EINA_TRUE);
2155 evas_event_feed_mouse_in(evas, 0, NULL);
2156 evas_event_feed_mouse_move
2157 (evas, e->data.l[2], e->data.l[3], 0, NULL);
2159 _elm_access_mouse_event_enabled_set(EINA_FALSE);
2161 else if ((unsigned int)e->data.l[1] ==
2162 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
2164 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
2166 else if ((unsigned int)e->data.l[1] ==
2167 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
2169 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
2171 else if ((unsigned int)e->data.l[1] ==
2172 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
2174 _elm_access_highlight_object_activate
2175 (sd->obj, ELM_ACTIVATE_UP);
2177 else if ((unsigned int)e->data.l[1] ==
2178 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
2180 _elm_access_highlight_object_activate
2181 (sd->obj, ELM_ACTIVATE_DOWN);
2185 return ECORE_CALLBACK_PASS_ON;
2189 _elm_win_property_change(void *data,
2190 int type EINA_UNUSED,
2193 ELM_WIN_DATA_GET(data, sd);
2194 Ecore_X_Event_Window_Property *e = event;
2196 if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE)
2198 if (e->win == sd->x.xwin)
2200 sd->indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win);
2201 evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
2204 return ECORE_CALLBACK_PASS_ON;
2209 _elm_win_focus_highlight_hide(void *data EINA_UNUSED,
2211 const char *emission EINA_UNUSED,
2212 const char *source EINA_UNUSED)
2214 evas_object_hide(obj);
2218 _elm_win_focus_highlight_anim_end(void *data,
2220 const char *emission EINA_UNUSED,
2221 const char *source EINA_UNUSED)
2223 ELM_WIN_DATA_GET(data, sd);
2225 _elm_win_focus_highlight_simple_setup(sd, obj);
2229 _elm_win_focus_highlight_init(Elm_Win_Smart_Data *sd)
2231 evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
2232 _elm_win_object_focus_in, sd->obj);
2233 evas_event_callback_add(sd->evas,
2234 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
2235 _elm_win_object_focus_out, sd->obj);
2237 sd->focus_highlight.cur.target = NULL;
2238 sd->focus_highlight.fobj = edje_object_add(sd->evas);
2239 sd->focus_highlight.theme_changed = EINA_TRUE;
2241 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2242 "elm,action,focus,hide,end", "*",
2243 _elm_win_focus_highlight_hide, NULL);
2244 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2245 "elm,action,focus,anim,end", "*",
2246 _elm_win_focus_highlight_anim_end, sd->obj);
2247 _elm_win_focus_highlight_reconfigure_job_start(sd);
2251 _elm_win_frame_cb_move_start(void *data,
2252 Evas_Object *obj EINA_UNUSED,
2253 const char *sig EINA_UNUSED,
2256 ELM_WIN_DATA_GET(data, sd);
2260 #ifdef HAVE_ELEMENTARY_WAYLAND
2261 if (!strcmp(source, "elm"))
2262 ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_HAND1);
2264 ecore_wl_window_cursor_default_restore(sd->wl.win);
2269 /* FIXME: Change mouse pointer */
2271 /* NB: Wayland handles moving surfaces by itself so we cannot
2272 * specify a specific x/y we want. Instead, we will pass in the
2273 * existing x/y values so they can be recorded as 'previous'
2274 * position. The new position will get updated automatically when
2275 * the move is finished */
2277 ecore_evas_wayland_move(sd->ee, sd->screen.x, sd->screen.y);
2281 _elm_win_frame_cb_move_stop(void *data,
2282 Evas_Object *obj EINA_UNUSED,
2283 const char *sig EINA_UNUSED,
2284 const char *source EINA_UNUSED)
2286 ELM_WIN_DATA_GET(data, sd);
2290 #ifdef HAVE_ELEMENTARY_WAYLAND
2291 ecore_wl_window_cursor_default_restore(sd->wl.win);
2295 #ifdef HAVE_ELEMENTARY_WAYLAND
2302 static struct _resize_info _border_side[4] =
2304 { ELM_CURSOR_TOP_SIDE, 1 },
2305 { ELM_CURSOR_LEFT_SIDE, 4 },
2306 { ELM_CURSOR_BOTTOM_SIDE, 2 },
2307 { ELM_CURSOR_RIGHT_SIDE, 8 },
2310 static struct _resize_info _border_corner[4] =
2312 { ELM_CURSOR_TOP_LEFT_CORNER, 5 },
2313 { ELM_CURSOR_BOTTOM_LEFT_CORNER, 6 },
2314 { ELM_CURSOR_BOTTOM_RIGHT_CORNER, 10 },
2315 { ELM_CURSOR_TOP_RIGHT_CORNER, 9 },
2320 _elm_win_frame_obj_update(Elm_Win_Smart_Data *sd)
2326 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
2327 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2328 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2330 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2332 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2333 (w != (fw - ow)) || (h != (fh - oh)))
2335 evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
2336 (fw - ow), (fh - oh));
2339 #ifdef HAVE_ELEMENTARY_WAYLAND
2340 ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
2345 _elm_win_frame_obj_move(void *data,
2346 Evas *e EINA_UNUSED,
2347 Evas_Object *obj EINA_UNUSED,
2348 void *event_info EINA_UNUSED)
2350 Elm_Win_Smart_Data *sd;
2352 if (!(sd = data)) return;
2353 if (!sd->client_obj) return;
2355 _elm_win_frame_obj_update(sd);
2359 _elm_win_frame_obj_resize(void *data,
2360 Evas *e EINA_UNUSED,
2361 Evas_Object *obj EINA_UNUSED,
2362 void *event_info EINA_UNUSED)
2364 Elm_Win_Smart_Data *sd;
2366 if (!(sd = data)) return;
2367 if (!sd->client_obj) return;
2369 _elm_win_frame_obj_update(sd);
2373 _elm_win_frame_cb_resize_show(void *data,
2374 Evas_Object *obj EINA_UNUSED,
2375 const char *sig EINA_UNUSED,
2378 ELM_WIN_DATA_GET(data, sd);
2381 if (sd->resizing) return;
2383 #ifdef HAVE_ELEMENTARY_WAYLAND
2386 if (!strcmp(source, "elm.event.resize.t"))
2387 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2388 _border_side[(0 + i) % 4].name);
2389 else if (!strcmp(source, "elm.event.resize.b"))
2390 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2391 _border_side[(2 + i) % 4].name);
2392 else if (!strcmp(source, "elm.event.resize.l"))
2393 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2394 _border_side[(1 + i) % 4].name);
2395 else if (!strcmp(source, "elm.event.resize.r"))
2396 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2397 _border_side[(3 + i) % 4].name);
2398 else if (!strcmp(source, "elm.event.resize.tl"))
2399 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2400 _border_corner[(0 + i) % 4].name);
2401 else if (!strcmp(source, "elm.event.resize.tr"))
2402 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2403 _border_corner[(3 + i) % 4].name);
2404 else if (!strcmp(source, "elm.event.resize.bl"))
2405 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2406 _border_corner[(1 + i) % 4].name);
2407 else if (!strcmp(source, "elm.event.resize.br"))
2408 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2409 _border_corner[(2 + i) % 4].name);
2411 ecore_wl_window_cursor_default_restore(sd->wl.win);
2418 _elm_win_frame_cb_resize_hide(void *data,
2419 Evas_Object *obj EINA_UNUSED,
2420 const char *sig EINA_UNUSED,
2421 const char *source EINA_UNUSED)
2423 ELM_WIN_DATA_GET(data, sd);
2426 if (sd->resizing) return;
2428 #ifdef HAVE_ELEMENTARY_WAYLAND
2429 ecore_wl_window_cursor_default_restore(sd->wl.win);
2434 _elm_win_frame_cb_resize_start(void *data,
2435 Evas_Object *obj EINA_UNUSED,
2436 const char *sig EINA_UNUSED,
2439 #ifdef HAVE_ELEMENTARY_WAYLAND
2440 ELM_WIN_DATA_GET(data, sd);
2444 if (sd->resizing) return;
2446 sd->resizing = EINA_TRUE;
2448 if (!strcmp(source, "elm.event.resize.t"))
2449 sd->resize_location = _border_side[(0 + i) % 4].location;
2450 else if (!strcmp(source, "elm.event.resize.b"))
2451 sd->resize_location = _border_side[(2 + i) % 4].location;
2452 else if (!strcmp(source, "elm.event.resize.l"))
2453 sd->resize_location = _border_side[(1 + i) % 4].location;
2454 else if (!strcmp(source, "elm.event.resize.r"))
2455 sd->resize_location = _border_side[(3 + i) % 4].location;
2456 else if (!strcmp(source, "elm.event.resize.tl"))
2457 sd->resize_location = _border_corner[(0 + i) % 4].location;
2458 else if (!strcmp(source, "elm.event.resize.tr"))
2459 sd->resize_location = _border_corner[(3 + i) % 4].location;
2460 else if (!strcmp(source, "elm.event.resize.bl"))
2461 sd->resize_location = _border_corner[(1 + i) % 4].location;
2462 else if (!strcmp(source, "elm.event.resize.br"))
2463 sd->resize_location = _border_corner[(2 + i) % 4].location;
2465 sd->resize_location = 0;
2467 if (sd->resize_location > 0)
2468 ecore_evas_wayland_resize(sd->ee, sd->resize_location);
2476 _elm_win_frame_cb_minimize(void *data,
2477 Evas_Object *obj EINA_UNUSED,
2478 const char *sig EINA_UNUSED,
2479 const char *source EINA_UNUSED)
2481 ELM_WIN_DATA_GET(data, sd);
2484 // sd->iconified = EINA_TRUE;
2485 TRAP(sd, iconified_set, EINA_TRUE);
2489 _elm_win_frame_maximized_state_update(Elm_Win_Smart_Data *sd, Eina_Bool maximized)
2491 const char *emission;
2494 emission = "elm,state,maximized";
2496 emission = "elm,state,unmaximized";
2498 edje_object_signal_emit(sd->frame_obj, emission, "elm");
2499 edje_object_message_signal_process(sd->frame_obj);
2500 evas_object_smart_calculate(sd->frame_obj);
2502 _elm_win_frame_obj_update(sd);
2506 _elm_win_frame_cb_maximize(void *data,
2507 Evas_Object *obj EINA_UNUSED,
2508 const char *sig EINA_UNUSED,
2509 const char *source EINA_UNUSED)
2512 ELM_WIN_DATA_GET(data, sd);
2515 if (sd->maximized) value = EINA_FALSE;
2516 else value = EINA_TRUE;
2518 _elm_win_frame_maximized_state_update(sd, value);
2520 TRAP(sd, maximized_set, value);
2524 _elm_win_frame_cb_close(void *data,
2525 Evas_Object *obj EINA_UNUSED,
2526 const char *sig EINA_UNUSED,
2527 const char *source EINA_UNUSED)
2529 ELM_WIN_DATA_GET(data, sd);
2532 /* FIXME: After the current freeze, this should be handled differently.
2534 * Ideally, we would want to mimic the X11 backend and use something
2535 * like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
2536 * inside of ecore_evas. That would be the 'proper' way, but since we are
2537 * in a freeze right now, I cannot add a new event value, or a new
2538 * event structure to ecore_wayland.
2540 * So yes, this is a temporary 'stop-gap' solution which will be fixed
2541 * when the freeze is over, but it does fix a trac bug for now, and in a
2542 * way which does not break API or the freeze. - dh
2549 int autodel = sd->autodel;
2550 sd->autodel_clear = &autodel;
2551 evas_object_ref(win);
2552 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
2553 // FIXME: if above callback deletes - then the below will be invalid
2554 if (autodel) evas_object_del(win);
2555 else sd->autodel_clear = NULL;
2556 evas_object_unref(win);
2560 _elm_win_frame_add(Elm_Win_Smart_Data *sd,
2563 Evas_Object *obj = sd->obj;
2567 sd->frame_obj = edje_object_add(sd->evas);
2568 layer = evas_object_layer_get(obj);
2569 evas_object_layer_set(sd->frame_obj, layer + 1);
2570 if (!elm_widget_theme_object_set
2571 (sd->obj, sd->frame_obj, "border", "base", style))
2573 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2577 sd->spacer_obj = evas_object_rectangle_add(sd->evas);
2578 evas_object_color_set(sd->spacer_obj, 0, 0, 0, 0);
2579 evas_object_repeat_events_set(sd->spacer_obj, EINA_TRUE);
2580 edje_object_part_swallow(sd->frame_obj, "elm.swallow.frame_spacer",
2583 sd->client_obj = evas_object_rectangle_add(sd->evas);
2584 evas_object_color_set(sd->client_obj, 0, 0, 0, 0);
2585 /* NB: Tried pass_events here, but that fails to send events */
2586 evas_object_repeat_events_set(sd->client_obj, EINA_TRUE);
2587 edje_object_part_swallow(sd->frame_obj, "elm.swallow.client",
2590 evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
2592 evas_object_event_callback_add
2593 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2594 evas_object_event_callback_add
2595 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2597 /* NB: Do NOT remove these calls !! Needed to calculate proper
2598 * framespace on inital show of the window */
2599 edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
2600 evas_object_move(sd->frame_obj, 0, 0);
2601 evas_object_resize(sd->frame_obj, mw, mh);
2602 evas_object_smart_calculate(sd->frame_obj);
2604 edje_object_signal_callback_add
2605 (sd->frame_obj, "elm,action,move,start", "elm",
2606 _elm_win_frame_cb_move_start, obj);
2607 edje_object_signal_callback_add
2608 (sd->frame_obj, "elm,action,move,stop", "elm",
2609 _elm_win_frame_cb_move_stop, obj);
2610 edje_object_signal_callback_add
2611 (sd->frame_obj, "elm,action,resize,show", "*",
2612 _elm_win_frame_cb_resize_show, obj);
2613 edje_object_signal_callback_add
2614 (sd->frame_obj, "elm,action,resize,hide", "*",
2615 _elm_win_frame_cb_resize_hide, obj);
2616 edje_object_signal_callback_add
2617 (sd->frame_obj, "elm,action,resize,start", "*",
2618 _elm_win_frame_cb_resize_start, obj);
2619 edje_object_signal_callback_add
2620 (sd->frame_obj, "elm,action,minimize", "elm",
2621 _elm_win_frame_cb_minimize, obj);
2622 edje_object_signal_callback_add
2623 (sd->frame_obj, "elm,action,maximize", "elm",
2624 _elm_win_frame_cb_maximize, obj);
2625 edje_object_signal_callback_add
2626 (sd->frame_obj, "elm,action,close", "elm", _elm_win_frame_cb_close, obj);
2630 edje_object_part_text_escaped_set
2631 (sd->frame_obj, "elm.text.title", sd->title);
2634 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2635 ecore_evas_resize(sd->ee, w, h);
2639 _elm_win_frame_del(Elm_Win_Smart_Data *sd)
2643 ELM_SAFE_FREE(sd->client_obj, evas_object_del);
2647 evas_object_event_callback_del_full
2648 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2649 evas_object_event_callback_del_full
2650 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2652 edje_object_signal_callback_del
2653 (sd->frame_obj, "elm,action,move,start", "elm",
2654 _elm_win_frame_cb_move_start);
2655 edje_object_signal_callback_del
2656 (sd->frame_obj, "elm,action,move,stop", "elm",
2657 _elm_win_frame_cb_move_stop);
2658 edje_object_signal_callback_del
2659 (sd->frame_obj, "elm,action,resize,show", "*",
2660 _elm_win_frame_cb_resize_show);
2661 edje_object_signal_callback_del
2662 (sd->frame_obj, "elm,action,resize,hide", "*",
2663 _elm_win_frame_cb_resize_hide);
2664 edje_object_signal_callback_del
2665 (sd->frame_obj, "elm,action,resize,start", "*",
2666 _elm_win_frame_cb_resize_start);
2667 edje_object_signal_callback_del
2668 (sd->frame_obj, "elm,action,minimize", "elm",
2669 _elm_win_frame_cb_minimize);
2670 edje_object_signal_callback_del
2671 (sd->frame_obj, "elm,action,maximize", "elm",
2672 _elm_win_frame_cb_maximize);
2673 edje_object_signal_callback_del
2674 (sd->frame_obj, "elm,action,close", "elm",
2675 _elm_win_frame_cb_close);
2677 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2680 evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
2681 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2682 ecore_evas_resize(sd->ee, w, h);
2687 _debug_key_down(void *data EINA_UNUSED,
2688 Evas *e EINA_UNUSED,
2692 Evas_Event_Key_Down *ev = event_info;
2694 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
2697 if ((strcmp(ev->key, "F12")) ||
2698 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
2701 INF("Tree graph generated.");
2702 elm_object_tree_dot_dump(obj, "./dump.dot");
2708 _win_inlined_image_set(Elm_Win_Smart_Data *sd)
2710 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);
2711 evas_object_image_filled_set(sd->img_obj, EINA_TRUE);
2713 evas_object_event_callback_add
2714 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, sd->obj);
2715 evas_object_event_callback_add
2716 (sd->img_obj, EVAS_CALLBACK_HIDE, _win_img_hide, sd->obj);
2717 evas_object_event_callback_add
2718 (sd->img_obj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, sd->obj);
2719 evas_object_event_callback_add
2720 (sd->img_obj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, sd->obj);
2721 evas_object_event_callback_add
2722 (sd->img_obj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, sd->obj);
2726 _elm_win_on_icon_del(void *data,
2727 Evas *e EINA_UNUSED,
2729 void *event_info EINA_UNUSED)
2731 ELM_WIN_DATA_GET(data, sd);
2733 if (sd->icon == obj) sd->icon = NULL;
2737 _elm_win_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
2739 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
2741 elm_widget_can_focus_set(obj, EINA_TRUE);
2743 elm_widget_highlight_ignore_set(obj, EINA_TRUE);
2746 #ifdef HAVE_ELEMENTARY_X
2748 _elm_x_io_err(void *data EINA_UNUSED)
2753 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2754 evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
2760 elm_win_add(Evas_Object *parent,
2764 Evas_Object *obj = eo_add_custom(MY_CLASS, parent, elm_obj_win_constructor(name, type));
2770 _elm_win_cb_hide(void *data EINA_UNUSED,
2771 Evas *e EINA_UNUSED,
2772 Evas_Object *obj EINA_UNUSED,
2773 void *event_info EINA_UNUSED)
2775 _elm_win_state_eval_queue();
2779 _elm_win_cb_show(void *data EINA_UNUSED,
2780 Evas *e EINA_UNUSED,
2781 Evas_Object *obj EINA_UNUSED,
2782 void *event_info EINA_UNUSED)
2784 _elm_win_state_eval_queue();
2790 * Recalculate the size of window considering its resize objects' weight and
2791 * min size. If any of its resize objects' weight equals to 0.0, window
2792 * layout's weight will be set to 0.0.
2794 * @param o box object
2795 * @param p box's private data
2796 * @param data window object
2799 _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
2803 Evas_Object_Box_Option *opt;
2804 Evas_Coord x, y, w, h;
2806 Evas_Coord minw = -1, minh = -1;
2807 double weight_x = EVAS_HINT_EXPAND;
2808 double weight_y = EVAS_HINT_EXPAND;
2810 EINA_LIST_FOREACH(p->children, l, opt)
2813 evas_object_size_hint_weight_get(child, &wx, &wy);
2814 if (wx == 0.0) weight_x = 0;
2815 if (wy == 0.0) weight_y = 0;
2817 evas_object_size_hint_min_get(child, &w, &h);
2818 if (w > minw) minw = w;
2819 if (h > minh) minh = h;
2822 evas_object_size_hint_min_set(o, minw, minh);
2823 evas_object_geometry_get(o, &x, &y, &w, &h);
2824 if (w < minw) w = minw;
2825 if (h < minh) h = minh;
2826 evas_object_resize(o, w, h);
2828 EINA_LIST_FOREACH(p->children, l, opt)
2831 evas_object_move(child, x, y);
2832 evas_object_resize(child, w, h);
2835 ELM_WIN_DATA_GET(data, sd);
2836 evas_object_size_hint_weight_set(sd->layout, weight_x, weight_y);
2837 evas_object_smart_changed(sd->layout);
2841 _win_constructor(Eo *obj, void *_pd, va_list *list)
2843 Elm_Win_Smart_Data *sd = _pd;
2844 sd->obj = obj; // in ctor
2846 const char *name = va_arg(*list, const char *);
2847 Elm_Win_Type type = va_arg(*list, Elm_Win_Type);
2848 Evas_Object *parent;
2851 const char *fontpath, *engine = NULL, *enginelist[32], *disp;
2854 Elm_Win_Smart_Data tmp_sd;
2856 eo_do(obj, eo_parent_get(&parent));
2858 /* just to store some data while trying out to create a canvas */
2859 memset(&tmp_sd, 0, sizeof(Elm_Win_Smart_Data));
2863 case ELM_WIN_INLINED_IMAGE:
2866 e = evas_object_evas_get(parent);
2871 ee = ecore_evas_ecore_evas_get(e);
2874 tmp_sd.img_obj = ecore_evas_object_image_new(ee);
2875 if (!tmp_sd.img_obj) break;
2877 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
2880 ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
2885 case ELM_WIN_SOCKET_IMAGE:
2886 tmp_sd.ee = ecore_evas_extn_socket_new(1, 1);
2890 disp = getenv("ELM_DISPLAY");
2891 if ((disp) && (!strcmp(disp, "x11")))
2893 if ((_elm_accel_preference) &&
2894 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2895 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2896 (!strcasecmp(_elm_accel_preference, "3d")) ||
2897 (!strcasecmp(_elm_accel_preference, "hw")) ||
2898 (!strcasecmp(_elm_accel_preference, "accel")) ||
2899 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2900 (!strcasecmp(_elm_accel_preference, "accel"))
2903 enginelist[0] = ELM_OPENGL_X11;
2904 enginelist[1] = ELM_SOFTWARE_X11;
2905 enginelist[2] = NULL;
2909 enginelist[0] = ENGINE_GET();
2910 enginelist[1] = ELM_SOFTWARE_X11;
2911 enginelist[2] = ELM_OPENGL_X11;
2912 enginelist[3] = NULL;
2915 else if ((disp) && (!strcmp(disp, "wl")))
2917 if ((_elm_accel_preference) &&
2918 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2919 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2920 (!strcasecmp(_elm_accel_preference, "3d")) ||
2921 (!strcasecmp(_elm_accel_preference, "hw")) ||
2922 (!strcasecmp(_elm_accel_preference, "accel")) ||
2923 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2924 (!strcasecmp(_elm_accel_preference, "accel"))
2927 enginelist[0] = ELM_WAYLAND_EGL;
2928 enginelist[1] = ELM_WAYLAND_SHM;
2929 enginelist[2] = NULL;
2933 enginelist[0] = ENGINE_GET();
2934 enginelist[1] = ELM_WAYLAND_SHM;
2935 enginelist[2] = ELM_WAYLAND_EGL;
2936 enginelist[3] = NULL;
2939 else if ((disp) && (!strcmp(disp, "win")))
2941 enginelist[0] = ENGINE_GET();
2942 enginelist[1] = ELM_SOFTWARE_WIN32;
2943 enginelist[2] = NULL;
2945 else if ((disp) && (!strcmp(disp, "sdl")))
2947 if ((_elm_accel_preference) &&
2948 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2949 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2950 (!strcasecmp(_elm_accel_preference, "3d")) ||
2951 (!strcasecmp(_elm_accel_preference, "hw")) ||
2952 (!strcasecmp(_elm_accel_preference, "accel")) ||
2953 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2954 (!strcasecmp(_elm_accel_preference, "accel"))
2957 enginelist[0] = ELM_OPENGL_SDL;
2958 enginelist[1] = ELM_SOFTWARE_SDL;
2959 enginelist[2] = NULL;
2963 enginelist[0] = ENGINE_GET();
2964 enginelist[1] = ELM_SOFTWARE_SDL;
2965 enginelist[2] = ELM_OPENGL_SDL;
2966 enginelist[3] = NULL;
2969 else if ((disp) && (!strcmp(disp, "mac")))
2971 enginelist[0] = ENGINE_GET();
2972 enginelist[1] = ELM_OPENGL_COCOA;
2973 enginelist[2] = NULL;
2975 else if ((disp) && (!strcmp(disp, "ews")))
2977 enginelist[0] = ENGINE_GET();
2978 enginelist[1] = ELM_EWS;
2979 enginelist[2] = NULL;
2981 else if ((disp) && (!strcmp(disp, "fb")))
2983 enginelist[0] = ENGINE_GET();
2984 enginelist[1] = ELM_SOFTWARE_FB;
2985 enginelist[2] = NULL;
2987 else if ((disp) && (!strcmp(disp, "buffer")))
2989 enginelist[0] = ENGINE_GET();
2990 enginelist[1] = ELM_BUFFER;
2991 enginelist[2] = NULL;
2993 else if ((disp) && (!strcmp(disp, "ps3")))
2995 enginelist[0] = ENGINE_GET();
2996 enginelist[1] = ELM_SOFTWARE_PSL1GHT;
2997 enginelist[2] = NULL;
2999 else if ((disp) && (!strcmp(disp, "shot")))
3001 enginelist[0] = ENGINE_GET();
3002 enginelist[1] = NULL;
3006 if ((_elm_accel_preference) &&
3007 ((!strcasecmp(_elm_accel_preference, "gl")) ||
3008 (!strcasecmp(_elm_accel_preference, "opengl")) ||
3009 (!strcasecmp(_elm_accel_preference, "3d")) ||
3010 (!strcasecmp(_elm_accel_preference, "hw")) ||
3011 (!strcasecmp(_elm_accel_preference, "accel")) ||
3012 (!strcasecmp(_elm_accel_preference, "hardware")) ||
3013 (!strcasecmp(_elm_accel_preference, "accel"))
3016 enginelist[0] = ELM_OPENGL_X11;
3017 enginelist[1] = ELM_WAYLAND_EGL;
3018 enginelist[2] = ELM_SOFTWARE_FB;
3019 enginelist[3] = ELM_OPENGL_COCOA;
3020 enginelist[4] = ELM_OPENGL_SDL;
3021 enginelist[5] = NULL;
3025 enginelist[0] = ENGINE_GET();
3026 enginelist[1] = ELM_SOFTWARE_X11;
3027 enginelist[2] = ELM_WAYLAND_SHM;
3028 enginelist[3] = ELM_SOFTWARE_FB;
3029 enginelist[4] = ELM_OPENGL_COCOA;
3030 enginelist[5] = ELM_SOFTWARE_SDL;
3031 enginelist[6] = NULL;
3034 for (i = 0; i < 30; i++)
3036 if ((i > 0) && (!enginelist[i])) break;
3037 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
3038 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
3039 else if (!strcmp(enginelist[i], ELM_OPENGL_X11))
3041 int opt[10], opt_i = 0;
3043 if (_elm_config->vsync)
3045 opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_VSYNC;
3050 tmp_sd.ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt);
3052 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
3054 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
3055 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
3056 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
3057 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
3058 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
3059 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
3060 else if (!strcmp(enginelist[i], ELM_SOFTWARE_SDL))
3061 tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
3062 else if (!strcmp(enginelist[i], ELM_OPENGL_SDL))
3063 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
3064 else if (!strcmp(enginelist[i], ELM_OPENGL_COCOA))
3065 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
3066 else if (!strcmp(enginelist[i], ELM_EWS))
3067 tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
3068 else if (!strcmp(enginelist[i], ELM_SOFTWARE_FB))
3069 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
3070 else if (!strcmp(enginelist[i], ELM_BUFFER))
3071 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3072 else if (!strcmp(enginelist[i], ELM_SOFTWARE_PSL1GHT))
3073 tmp_sd.ee = ecore_evas_psl1ght_new(NULL, 1, 1);
3074 else if (!strncmp(enginelist[i], "shot:", 5))
3076 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3077 ecore_evas_manual_render_set(tmp_sd.ee, EINA_TRUE);
3078 tmp_sd.shot.info = eina_stringshare_add(ENGINE_GET() + 5);
3080 engine = enginelist[i];
3081 if (tmp_sd.ee) break;
3088 ERR("Cannot create window.");
3093 eo_do(obj, eo_parent_set(ecore_evas_get(tmp_sd.ee)));
3094 eo_do_super(obj, MY_CLASS, eo_constructor());
3096 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
3097 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
3099 if (getenv("ELM_FIRST_FRAME"))
3100 evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
3101 _elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
3103 /* copying possibly altered fields back */
3104 #define SD_CPY(_field) \
3107 sd->_field = tmp_sd._field; \
3115 if ((trap) && (trap->add))
3116 sd->trap_data = trap->add(obj);
3118 /* complementary actions, which depend on final smart data
3120 if (type == ELM_WIN_INLINED_IMAGE)
3121 _win_inlined_image_set(sd);
3122 #ifdef HAVE_ELEMENTARY_X
3123 else if ((engine) &&
3124 ((!strcmp(engine, ELM_SOFTWARE_X11)) ||
3125 (!strcmp(engine, ELM_OPENGL_X11))))
3127 sd->x.client_message_handler = ecore_event_handler_add
3128 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, obj);
3129 sd->x.property_handler = ecore_event_handler_add
3130 (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
3133 else if ((engine) && (!strncmp(engine, "shot:", 5)))
3136 sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
3137 sd->indmode = ELM_WIN_INDICATOR_UNKNOWN;
3139 #ifdef HAVE_ELEMENTARY_X
3140 _elm_win_xwindow_get(sd);
3143 ecore_x_io_error_handler_set(_elm_x_io_err, NULL);
3147 #ifdef HAVE_ELEMENTARY_WAYLAND
3148 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3149 _elm_win_wlwindow_get(sd);
3152 if ((_elm_config->bgpixmap)
3153 #ifdef HAVE_ELEMENTARY_X
3155 (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
3160 TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
3161 // bg pixmap done by x - has other issues like can be redrawn by x before it
3162 // is filled/ready by app
3163 // TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
3166 sd->parent = parent;
3169 evas_object_event_callback_add
3170 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
3172 sd->evas = ecore_evas_get(sd->ee);
3174 evas_object_color_set(obj, 0, 0, 0, 0);
3175 evas_object_move(obj, 0, 0);
3176 evas_object_resize(obj, 1, 1);
3177 evas_object_layer_set(obj, 50);
3178 evas_object_pass_events_set(obj, EINA_TRUE);
3180 if (type == ELM_WIN_INLINED_IMAGE)
3181 elm_widget_parent2_set(obj, parent);
3183 /* use own version of ecore_evas_object_associate() that does TRAP() */
3184 ecore_evas_data_set(sd->ee, "elm_win", obj);
3186 evas_object_event_callback_add
3187 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3188 _elm_win_obj_callback_changed_size_hints, obj);
3190 evas_object_intercept_raise_callback_add
3191 (obj, _elm_win_obj_intercept_raise, obj);
3192 evas_object_intercept_lower_callback_add
3193 (obj, _elm_win_obj_intercept_lower, obj);
3194 evas_object_intercept_stack_above_callback_add
3195 (obj, _elm_win_obj_intercept_stack_above, obj);
3196 evas_object_intercept_stack_below_callback_add
3197 (obj, _elm_win_obj_intercept_stack_below, obj);
3198 evas_object_intercept_layer_set_callback_add
3199 (obj, _elm_win_obj_intercept_layer_set, obj);
3200 evas_object_intercept_show_callback_add
3201 (obj, _elm_win_obj_intercept_show, obj);
3203 TRAP(sd, name_class_set, name, _elm_appname);
3204 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
3205 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3206 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3207 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3208 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3209 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3210 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3211 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3212 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3214 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
3215 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
3217 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
3218 evas_font_path_append(sd->evas, fontpath);
3220 if (!_elm_config->font_hinting)
3221 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_NONE);
3222 else if (_elm_config->font_hinting == 1)
3223 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_AUTO);
3224 else if (_elm_config->font_hinting == 2)
3225 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_BYTECODE);
3227 #ifdef HAVE_ELEMENTARY_X
3228 _elm_win_xwin_update(sd);
3231 _elm_win_list = eina_list_append(_elm_win_list, obj);
3234 if ((engine) && (!strcmp(engine, ELM_SOFTWARE_FB)))
3236 TRAP(sd, fullscreen_set, 1);
3238 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3240 ((!strcmp(engine, ELM_WAYLAND_SHM) ||
3241 (!strcmp(engine, ELM_WAYLAND_EGL))))))
3242 _elm_win_frame_add(sd, "default");
3244 if (_elm_config->focus_highlight_enable)
3245 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3246 if (_elm_config->focus_highlight_animate)
3247 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3250 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
3251 evas_object_event_callback_add
3252 (obj, EVAS_CALLBACK_KEY_DOWN, _debug_key_down, NULL);
3254 if (evas_object_key_grab(obj, "F12", mask, 0, EINA_TRUE))
3255 INF("Ctrl+F12 key combination exclusive for dot tree generation\n");
3257 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3260 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3261 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3262 ((engine) && (!strcmp(engine, ELM_SOFTWARE_FB)))))
3265 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3267 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3268 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3269 edje_object_size_min_calc(o, &mw, &mh);
3270 evas_object_resize(o, mw, mh);
3271 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3272 &hx, &hy, NULL, NULL);
3273 sd->pointer.hot_x = hx;
3274 sd->pointer.hot_y = hy;
3275 evas_object_show(o);
3276 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3278 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3283 sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
3284 sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
3286 sd->layout = edje_object_add(sd->evas);
3287 _elm_theme_object_set(obj, sd->layout, "win", "base", "default");
3288 sd->box = evas_object_box_add(sd->evas);
3289 evas_object_box_layout_set(sd->box, _window_layout_stack, obj, NULL);
3290 edje_object_part_swallow(sd->layout, "elm.swallow.contents", sd->box);
3291 evas_object_move(sd->layout, 0, 0);
3292 evas_object_resize(sd->layout, 1, 1);
3293 edje_object_update_hints_set(sd->layout, EINA_TRUE);
3294 evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3295 _elm_win_on_resize_obj_changed_size_hints, obj);
3296 evas_object_show(sd->layout);
3300 _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
3303 ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
3307 elm_win_type_get(const Evas_Object *obj)
3309 ELM_WIN_CHECK(obj) ELM_WIN_UNKNOWN;
3310 Elm_Win_Type ret = ELM_WIN_UNKNOWN;
3311 eo_do((Eo *) obj, elm_obj_win_type_get(&ret));
3316 _type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3318 Elm_Win_Type *ret = va_arg(*list, Elm_Win_Type *);
3319 Elm_Win_Smart_Data *sd = _pd;
3324 elm_win_util_standard_add(const char *name,
3327 Evas_Object *win, *bg;
3329 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
3330 if (!win) return NULL;
3332 elm_win_title_set(win, title);
3333 bg = elm_bg_add(win);
3336 evas_object_del(win);
3339 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3340 elm_win_resize_object_add(win, bg);
3341 evas_object_show(bg);
3347 elm_win_resize_object_add(Evas_Object *obj,
3348 Evas_Object *subobj)
3351 eo_do(obj, elm_obj_win_resize_object_add(subobj));
3355 _resize_object_add(Eo *obj, void *_pd, va_list *list)
3357 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3359 Elm_Win_Smart_Data *sd = _pd;
3361 elm_widget_sub_object_add(obj, subobj);
3363 if (!evas_object_box_append(sd->box, subobj))
3364 ERR("could not append %p to box", subobj);
3368 elm_win_resize_object_del(Evas_Object *obj,
3369 Evas_Object *subobj)
3372 eo_do(obj, elm_obj_win_resize_object_del(subobj));
3376 _resize_object_del(Eo *obj, void *_pd, va_list *list)
3378 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3379 Elm_Win_Smart_Data *sd = _pd;
3381 if (!elm_widget_sub_object_del(obj, subobj))
3382 ERR("could not remove sub object %p from %p", subobj, obj);
3384 evas_object_box_remove(sd->box, subobj);
3388 elm_win_title_set(Evas_Object *obj,
3392 eo_do(obj, elm_obj_win_title_set(title));
3396 _title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3398 const char *title = va_arg(*list, const char *);
3399 Elm_Win_Smart_Data *sd = _pd;
3402 eina_stringshare_replace(&(sd->title), title);
3403 TRAP(sd, title_set, sd->title);
3405 edje_object_part_text_escaped_set
3406 (sd->frame_obj, "elm.text.title", sd->title);
3410 elm_win_title_get(const Evas_Object *obj)
3412 ELM_WIN_CHECK(obj) NULL;
3413 const char *ret = NULL;
3414 eo_do((Eo *) obj, elm_obj_win_title_get(&ret));
3419 _title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3421 const char **ret = va_arg(*list, const char **);
3422 Elm_Win_Smart_Data *sd = _pd;
3427 elm_win_icon_name_set(Evas_Object *obj,
3428 const char *icon_name)
3431 eo_do(obj, elm_obj_win_icon_name_set(icon_name));
3435 _icon_name_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3437 const char *icon_name = va_arg(*list, const char *);
3438 Elm_Win_Smart_Data *sd = _pd;
3440 if (!icon_name) return;
3441 eina_stringshare_replace(&(sd->icon_name), icon_name);
3442 #ifdef HAVE_ELEMENTARY_X
3443 _elm_win_xwin_update(sd);
3448 elm_win_icon_name_get(const Evas_Object *obj)
3450 ELM_WIN_CHECK(obj) NULL;
3451 const char *ret = NULL;
3452 eo_do((Eo *) obj, elm_obj_win_icon_name_get(&ret));
3457 _icon_name_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3459 const char **ret = va_arg(*list, const char **);
3460 Elm_Win_Smart_Data *sd = _pd;
3461 *ret = sd->icon_name;
3465 elm_win_role_set(Evas_Object *obj, const char *role)
3468 eo_do(obj, elm_obj_win_role_set(role));
3472 _role_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3474 const char *role = va_arg(*list, const char *);
3475 Elm_Win_Smart_Data *sd = _pd;
3478 eina_stringshare_replace(&(sd->role), role);
3479 #ifdef HAVE_ELEMENTARY_X
3480 _elm_win_xwin_update(sd);
3485 elm_win_role_get(const Evas_Object *obj)
3487 ELM_WIN_CHECK(obj) NULL;
3488 const char *ret = NULL;
3489 eo_do((Eo *) obj, elm_obj_win_role_get(&ret));
3494 _role_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3496 const char **ret = va_arg(*list, const char **);
3497 Elm_Win_Smart_Data *sd = _pd;
3502 elm_win_icon_object_set(Evas_Object *obj,
3506 eo_do(obj, elm_obj_win_icon_object_set(icon));
3510 _icon_object_set(Eo *obj, void *_pd, va_list *list)
3512 Evas_Object *icon = va_arg(*list, Evas_Object *);
3513 Elm_Win_Smart_Data *sd = _pd;
3516 evas_object_event_callback_del_full
3517 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3520 evas_object_event_callback_add
3521 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3522 #ifdef HAVE_ELEMENTARY_X
3523 _elm_win_xwin_update(sd);
3527 EAPI const Evas_Object *
3528 elm_win_icon_object_get(const Evas_Object *obj)
3530 ELM_WIN_CHECK(obj) NULL;
3531 const Evas_Object *ret = NULL;
3532 eo_do((Eo *) obj, elm_obj_win_icon_object_get(&ret));
3537 _icon_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3539 const Evas_Object **ret = va_arg(*list, const Evas_Object **);
3540 Elm_Win_Smart_Data *sd = _pd;
3545 elm_win_autodel_set(Evas_Object *obj,
3549 eo_do(obj, elm_obj_win_autodel_set(autodel));
3553 _autodel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3555 Eina_Bool autodel = va_arg(*list, int);
3556 Elm_Win_Smart_Data *sd = _pd;
3557 sd->autodel = autodel;
3561 elm_win_autodel_get(const Evas_Object *obj)
3563 ELM_WIN_CHECK(obj) EINA_FALSE;
3564 Eina_Bool ret = EINA_FALSE;
3565 eo_do((Eo *) obj, elm_obj_win_autodel_get(&ret));
3570 _autodel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3572 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3573 Elm_Win_Smart_Data *sd = _pd;
3578 elm_win_activate(Evas_Object *obj)
3581 eo_do(obj, elm_obj_win_activate());
3585 _activate(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3587 Elm_Win_Smart_Data *sd = _pd;
3592 elm_win_lower(Evas_Object *obj)
3595 eo_do(obj, elm_obj_win_lower());
3599 _lower(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3601 Elm_Win_Smart_Data *sd = _pd;
3606 elm_win_raise(Evas_Object *obj)
3609 eo_do(obj, elm_obj_win_raise());
3613 _raise(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3615 Elm_Win_Smart_Data *sd = _pd;
3620 elm_win_center(Evas_Object *obj,
3625 eo_do(obj, elm_obj_win_center(h, v));
3629 _center(Eo *obj, void *_pd, va_list *list)
3631 Eina_Bool h = va_arg(*list, int);
3632 Eina_Bool v = va_arg(*list, int);
3633 int win_w, win_h, screen_w, screen_h, nx, ny;
3635 Elm_Win_Smart_Data *sd = _pd;
3637 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
3640 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &screen_w, &screen_h);
3641 if ((!screen_w) || (!screen_h)) return;
3643 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
3644 if ((!win_w) || (!win_h)) return;
3646 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
3647 else nx = sd->screen.x;
3648 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
3649 else ny = sd->screen.y;
3653 evas_object_move(obj, nx, ny);
3657 elm_win_borderless_set(Evas_Object *obj,
3658 Eina_Bool borderless)
3661 eo_do(obj, elm_obj_win_borderless_set(borderless));
3665 _borderless_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3667 Eina_Bool borderless = va_arg(*list, int);
3668 Elm_Win_Smart_Data *sd = _pd;
3670 Eina_Bool need_frame = EINA_FALSE;
3672 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3673 need_frame = engine_name &&
3674 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3675 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3680 _elm_win_frame_del(sd);
3685 _elm_win_frame_add(sd, "default");
3688 evas_object_show(sd->frame_obj);
3691 TRAP(sd, borderless_set, borderless);
3692 #ifdef HAVE_ELEMENTARY_X
3693 _elm_win_xwin_update(sd);
3698 elm_win_borderless_get(const Evas_Object *obj)
3700 ELM_WIN_CHECK(obj) EINA_FALSE;
3701 Eina_Bool ret = EINA_FALSE;
3702 eo_do((Eo *) obj, elm_obj_win_borderless_get(&ret));
3707 _borderless_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3709 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3710 Elm_Win_Smart_Data *sd = _pd;
3711 *ret = ecore_evas_borderless_get(sd->ee);
3715 elm_win_shaped_set(Evas_Object *obj,
3719 eo_do(obj, elm_obj_win_shaped_set(shaped));
3723 _shaped_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3725 Eina_Bool shaped = va_arg(*list, int);
3726 Elm_Win_Smart_Data *sd = _pd;
3728 TRAP(sd, shaped_set, shaped);
3729 #ifdef HAVE_ELEMENTARY_X
3730 _elm_win_xwin_update(sd);
3735 elm_win_shaped_get(const Evas_Object *obj)
3737 ELM_WIN_CHECK(obj) EINA_FALSE;
3738 Eina_Bool ret = EINA_FALSE;
3739 eo_do((Eo *) obj, elm_obj_win_shaped_get(&ret));
3744 _shaped_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3746 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3747 Elm_Win_Smart_Data *sd = _pd;
3748 *ret = ecore_evas_shaped_get(sd->ee);
3752 elm_win_alpha_set(Evas_Object *obj,
3756 eo_do(obj, elm_obj_win_alpha_set(enabled));
3760 _alpha_set(Eo *obj, void *_pd, va_list *list)
3762 Eina_Bool enabled = va_arg(*list, int);
3763 Elm_Win_Smart_Data *sd = _pd;
3767 evas_object_image_alpha_set(sd->img_obj, enabled);
3768 ecore_evas_alpha_set(sd->ee, enabled);
3772 #ifdef HAVE_ELEMENTARY_X
3777 if (!ecore_x_screen_is_composited(0))
3778 elm_win_shaped_set(obj, enabled);
3780 TRAP(sd, alpha_set, enabled);
3783 TRAP(sd, alpha_set, enabled);
3784 _elm_win_xwin_update(sd);
3788 TRAP(sd, alpha_set, enabled);
3793 elm_win_alpha_get(const Evas_Object *obj)
3795 ELM_WIN_CHECK(obj) EINA_FALSE;
3796 Eina_Bool ret = EINA_FALSE;
3797 eo_do((Eo *) obj, elm_obj_win_alpha_get(&ret));
3802 _alpha_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3804 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3805 Elm_Win_Smart_Data *sd = _pd;
3809 *ret = evas_object_image_alpha_get(sd->img_obj);
3813 *ret = ecore_evas_alpha_get(sd->ee);
3818 elm_win_override_set(Evas_Object *obj,
3822 eo_do(obj, elm_obj_win_override_set(override));
3826 _override_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3828 Eina_Bool override = va_arg(*list, int);
3829 Elm_Win_Smart_Data *sd = _pd;
3831 TRAP(sd, override_set, override);
3832 #ifdef HAVE_ELEMENTARY_X
3833 _elm_win_xwin_update(sd);
3838 elm_win_override_get(const Evas_Object *obj)
3840 ELM_WIN_CHECK(obj) EINA_FALSE;
3841 Eina_Bool ret = EINA_FALSE;
3842 eo_do((Eo *) obj, elm_obj_win_override_get(&ret));
3847 _override_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3849 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3850 Elm_Win_Smart_Data *sd = _pd;
3851 *ret = ecore_evas_override_get(sd->ee);
3855 elm_win_fullscreen_set(Evas_Object *obj,
3856 Eina_Bool fullscreen)
3859 eo_do(obj, elm_obj_win_fullscreen_set(fullscreen));
3863 _fullscreen_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3865 Eina_Bool fullscreen = va_arg(*list, int);
3866 Elm_Win_Smart_Data *sd = _pd;
3867 // YYY: handle if sd->img_obj
3868 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
3869 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
3871 // these engines... can ONLY be fullscreen
3876 // sd->fullscreen = fullscreen;
3878 Eina_Bool need_frame = EINA_FALSE;
3880 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3881 need_frame = engine_name &&
3882 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3883 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3885 TRAP(sd, fullscreen_set, fullscreen);
3890 _elm_win_frame_del(sd);
3895 _elm_win_frame_add(sd, "default");
3898 evas_object_show(sd->frame_obj);
3900 #ifdef HAVE_ELEMENTARY_X
3901 _elm_win_xwin_update(sd);
3907 elm_win_fullscreen_get(const Evas_Object *obj)
3909 ELM_WIN_CHECK(obj) EINA_FALSE;
3910 Eina_Bool ret = EINA_FALSE;
3911 eo_do((Eo *) obj, elm_obj_win_fullscreen_get(&ret));
3916 _fullscreen_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3918 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3919 Elm_Win_Smart_Data *sd = _pd;
3923 const char* engine_name = ecore_evas_engine_name_get(sd->ee);
3926 ((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
3927 (!strcmp(engine_name, ELM_SOFTWARE_16_WINCE))))
3929 // these engines... can ONLY be fullscreen
3934 *ret = sd->fullscreen;
3939 elm_win_main_menu_get(const Evas_Object *obj)
3941 ELM_WIN_CHECK(obj) NULL;
3943 eo_do((Eo *) obj, elm_obj_win_main_menu_get(&ret));
3948 _dbus_menu_set(Eina_Bool dbus_connect, void *data)
3950 ELM_WIN_DATA_GET_OR_RETURN(data, sd);
3954 DBG("Setting menu to D-Bus");
3955 edje_object_part_unswallow(sd->layout, sd->main_menu);
3956 edje_object_signal_emit(sd->layout, "elm,action,hide_menu", "elm");
3957 _elm_menu_menu_bar_hide(sd->main_menu);
3961 DBG("Setting menu to local mode");
3962 edje_object_part_swallow(sd->layout, "elm.swallow.menu", sd->main_menu);
3963 edje_object_signal_emit(sd->layout, "elm,action,show_menu", "elm");
3964 evas_object_show(sd->main_menu);
3969 _main_menu_get(Eo *obj, void *_pd, va_list *list)
3971 Eo **ret = va_arg(*list, Eo **);
3972 Elm_Win_Smart_Data *sd = _pd;
3973 Eina_Bool use_dbus = EINA_FALSE;
3975 if (sd->main_menu) goto end;
3977 sd->main_menu = elm_menu_add(obj);
3978 _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
3980 #ifdef HAVE_ELEMENTARY_X
3981 if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
3984 #ifdef HAVE_ELEMENTARY_X
3985 if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
3987 _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
3988 _dbus_menu_set, obj);
3992 _dbus_menu_set(EINA_FALSE, obj);
3995 *ret = sd->main_menu;
3999 elm_win_maximized_set(Evas_Object *obj,
4000 Eina_Bool maximized)
4003 eo_do(obj, elm_obj_win_maximized_set(maximized));
4007 _maximized_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4009 Eina_Bool maximized = va_arg(*list, int);
4010 Elm_Win_Smart_Data *sd = _pd;
4012 _elm_win_frame_maximized_state_update(sd, maximized);
4013 // YYY: handle if sd->img_obj
4014 TRAP(sd, maximized_set, maximized);
4015 #ifdef HAVE_ELEMENTARY_X
4016 _elm_win_xwin_update(sd);
4021 elm_win_maximized_get(const Evas_Object *obj)
4023 ELM_WIN_CHECK(obj) EINA_FALSE;
4024 Eina_Bool ret = EINA_FALSE;
4025 eo_do((Eo *) obj, elm_obj_win_maximized_get(&ret));
4030 _maximized_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4032 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4033 Elm_Win_Smart_Data *sd = _pd;
4034 *ret = sd->maximized;
4038 elm_win_iconified_set(Evas_Object *obj,
4039 Eina_Bool iconified)
4042 eo_do(obj, elm_obj_win_iconified_set(iconified));
4046 _iconified_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4048 Eina_Bool iconified = va_arg(*list, int);
4049 Elm_Win_Smart_Data *sd = _pd;
4051 // sd->iconified = iconified;
4052 TRAP(sd, iconified_set, iconified);
4053 #ifdef HAVE_ELEMENTARY_X
4054 _elm_win_xwin_update(sd);
4059 elm_win_iconified_get(const Evas_Object *obj)
4061 ELM_WIN_CHECK(obj) EINA_FALSE;
4062 Eina_Bool ret = EINA_FALSE;
4063 eo_do((Eo *) obj, elm_obj_win_iconified_get(&ret));
4068 _iconified_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4070 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4071 Elm_Win_Smart_Data *sd = _pd;
4072 *ret = sd->iconified;
4076 elm_win_withdrawn_set(Evas_Object *obj,
4077 Eina_Bool withdrawn)
4080 eo_do(obj, elm_obj_win_withdrawn_set(withdrawn));
4084 _withdrawn_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4086 Eina_Bool withdrawn = va_arg(*list, int);
4087 Elm_Win_Smart_Data *sd = _pd;
4089 // sd->withdrawn = withdrawn;
4090 TRAP(sd, withdrawn_set, withdrawn);
4091 #ifdef HAVE_ELEMENTARY_X
4092 _elm_win_xwin_update(sd);
4097 elm_win_withdrawn_get(const Evas_Object *obj)
4099 ELM_WIN_CHECK(obj) EINA_FALSE;
4100 Eina_Bool ret = EINA_FALSE;
4101 eo_do((Eo *) obj, elm_obj_win_withdrawn_get(&ret));
4106 _withdrawn_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4108 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4109 Elm_Win_Smart_Data *sd = _pd;
4110 *ret = sd->withdrawn;
4114 elm_win_available_profiles_set(Evas_Object *obj,
4115 const char **profiles,
4119 eo_do((Eo *) obj, elm_obj_win_available_profiles_set(profiles, count));
4123 _available_profiles_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4125 const char **profiles = va_arg(*list, const char **);
4126 unsigned int count = va_arg(*list, unsigned int);
4127 Elm_Win_Smart_Data *sd = _pd;
4128 Eina_Bool found = EINA_FALSE;
4130 _elm_win_available_profiles_del(sd);
4131 if ((profiles) && (count >= 1))
4133 sd->profile.available_list = calloc(count, sizeof(char *));
4134 if (sd->profile.available_list)
4136 if (!sd->profile.name) found = EINA_TRUE;
4139 for (i = 0; i < count; i++)
4141 sd->profile.available_list[i] = eina_stringshare_add(profiles[i]);
4143 /* check to see if a given array has a current profile of elm_win */
4144 if ((sd->profile.name) &&
4145 (!strcmp(sd->profile.name, profiles[i])))
4150 sd->profile.count = count;
4154 if (ecore_evas_window_profile_supported_get(sd->ee))
4156 ecore_evas_window_available_profiles_set(sd->ee,
4157 sd->profile.available_list,
4160 /* current profile of elm_win is wrong, change profile */
4161 if ((sd->profile.available_list) && (!found))
4163 eina_stringshare_replace(&(sd->profile.name),
4164 sd->profile.available_list[0]);
4165 ecore_evas_window_profile_set(sd->ee, sd->profile.name);
4171 if (sd->profile.available_list)
4172 _elm_win_profile_update(sd);
4177 elm_win_available_profiles_get(Evas_Object *obj,
4179 unsigned int *count)
4181 ELM_WIN_CHECK(obj) EINA_FALSE;
4182 Eina_Bool ret = EINA_FALSE;
4183 eo_do((Eo *) obj, elm_obj_win_available_profiles_get(profiles, count, &ret));
4188 _available_profiles_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4190 char ***profiles = va_arg(*list, char ***);
4191 unsigned int *count = va_arg(*list, unsigned int *);
4192 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4193 Elm_Win_Smart_Data *sd = _pd;
4196 if (ecore_evas_window_profile_supported_get(sd->ee))
4198 res = ecore_evas_window_available_profiles_get(sd->ee,
4204 if (profiles) *profiles = (char **)sd->profile.available_list;
4205 if (count) *count = sd->profile.count;
4208 if (ret) *ret = res;
4212 elm_win_profile_set(Evas_Object *obj,
4213 const char *profile)
4216 eo_do((Eo *) obj, elm_obj_win_profile_set(profile));
4220 _profile_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4222 const char *profile = va_arg(*list, const char *);
4223 Elm_Win_Smart_Data *sd = _pd;
4225 /* check to see if a given profile is present in an available profiles */
4226 if ((profile) && (sd->profile.available_list))
4228 Eina_Bool found = EINA_FALSE;
4230 for (i = 0; i < sd->profile.count; i++)
4232 if (!strcmp(profile,
4233 sd->profile.available_list[i]))
4242 if (ecore_evas_window_profile_supported_get(sd->ee))
4244 if (!profile) _elm_win_profile_del(sd);
4245 ecore_evas_window_profile_set(sd->ee, profile);
4249 if (_elm_win_profile_set(sd, profile))
4250 _elm_win_profile_update(sd);
4255 elm_win_profile_get(const Evas_Object *obj)
4257 ELM_WIN_CHECK(obj) NULL;
4258 const char *ret = NULL;
4259 eo_do((Eo *) obj, elm_obj_win_profile_get(&ret));
4264 _profile_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4266 const char **ret = va_arg(*list, const char **);
4267 Elm_Win_Smart_Data *sd = _pd;
4268 *ret = sd->profile.name;
4272 elm_win_urgent_set(Evas_Object *obj,
4276 eo_do(obj, elm_obj_win_urgent_set(urgent));
4280 _urgent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4282 Eina_Bool urgent = va_arg(*list, int);
4283 Elm_Win_Smart_Data *sd = _pd;
4285 sd->urgent = urgent;
4286 TRAP(sd, urgent_set, urgent);
4287 #ifdef HAVE_ELEMENTARY_X
4288 _elm_win_xwin_update(sd);
4293 elm_win_urgent_get(const Evas_Object *obj)
4295 ELM_WIN_CHECK(obj) EINA_FALSE;
4296 Eina_Bool ret = EINA_FALSE;
4297 eo_do((Eo *) obj, elm_obj_win_urgent_get(&ret));
4302 _urgent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4304 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4305 Elm_Win_Smart_Data *sd = _pd;
4310 elm_win_demand_attention_set(Evas_Object *obj,
4311 Eina_Bool demand_attention)
4314 eo_do(obj, elm_obj_win_demand_attention_set(demand_attention));
4318 _demand_attention_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4320 Eina_Bool demand_attention = va_arg(*list, int);
4321 Elm_Win_Smart_Data *sd = _pd;
4323 sd->demand_attention = demand_attention;
4324 TRAP(sd, demand_attention_set, demand_attention);
4325 #ifdef HAVE_ELEMENTARY_X
4326 _elm_win_xwin_update(sd);
4331 elm_win_demand_attention_get(const Evas_Object *obj)
4333 ELM_WIN_CHECK(obj) EINA_FALSE;
4334 Eina_Bool ret = EINA_FALSE;
4335 eo_do((Eo *) obj, elm_obj_win_demand_attention_get(&ret));
4340 _demand_attention_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4342 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4343 Elm_Win_Smart_Data *sd = _pd;
4344 *ret = sd->demand_attention;
4348 elm_win_modal_set(Evas_Object *obj,
4352 eo_do(obj, elm_obj_win_modal_set(modal));
4356 _modal_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4358 Eina_Bool modal = va_arg(*list, int);
4359 Elm_Win_Smart_Data *sd = _pd;
4362 TRAP(sd, modal_set, modal);
4363 #ifdef HAVE_ELEMENTARY_X
4364 _elm_win_xwin_update(sd);
4369 elm_win_modal_get(const Evas_Object *obj)
4371 ELM_WIN_CHECK(obj) EINA_FALSE;
4372 Eina_Bool ret = EINA_FALSE;
4373 eo_do((Eo *) obj, elm_obj_win_modal_get(&ret));
4378 _modal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4380 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4381 Elm_Win_Smart_Data *sd = _pd;
4386 elm_win_aspect_set(Evas_Object *obj,
4390 eo_do(obj, elm_obj_win_aspect_set(aspect));
4394 _aspect_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4396 double aspect = va_arg(*list, double);
4397 Elm_Win_Smart_Data *sd = _pd;
4399 sd->aspect = aspect;
4400 TRAP(sd, aspect_set, aspect);
4401 #ifdef HAVE_ELEMENTARY_X
4402 _elm_win_xwin_update(sd);
4407 elm_win_aspect_get(const Evas_Object *obj)
4409 ELM_WIN_CHECK(obj) 0.0;
4411 eo_do((Eo *) obj, elm_obj_win_aspect_get(&ret));
4416 _aspect_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4418 double *ret = va_arg(*list, double *);
4419 Elm_Win_Smart_Data *sd = _pd;
4424 elm_win_size_base_set(Evas_Object *obj, int w, int h)
4427 eo_do(obj, elm_obj_win_size_base_set(w, h));
4431 _size_base_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4433 int w = va_arg(*list, int);
4434 int h = va_arg(*list, int);
4435 Elm_Win_Smart_Data *sd = _pd;
4436 sd->size_base_w = w;
4437 sd->size_base_h = h;
4438 TRAP(sd, size_base_set, w, h);
4439 #ifdef HAVE_ELEMENTARY_X
4440 _elm_win_xwin_update(sd);
4445 elm_win_size_base_get(Evas_Object *obj, int *w, int *h)
4448 eo_do(obj, elm_obj_win_size_base_get(w, h));
4452 _size_base_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4454 int *w = va_arg(*list, int *);
4455 int *h = va_arg(*list, int *);
4457 Elm_Win_Smart_Data *sd = _pd;
4458 if (w) *w = sd->size_base_w;
4459 if (w) *h = sd->size_base_h;
4463 elm_win_size_step_set(Evas_Object *obj, int w, int h)
4466 eo_do(obj, elm_obj_win_size_step_set(w, h));
4470 _size_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4472 int w = va_arg(*list, int);
4473 int h = va_arg(*list, int);
4474 Elm_Win_Smart_Data *sd = _pd;
4475 sd->size_step_w = w;
4476 sd->size_step_h = h;
4477 TRAP(sd, size_step_set, w, h);
4478 #ifdef HAVE_ELEMENTARY_X
4479 _elm_win_xwin_update(sd);
4484 elm_win_size_step_get(Evas_Object *obj, int *w, int *h)
4487 eo_do(obj, elm_obj_win_size_step_get(w, h));
4491 _size_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4493 int *w = va_arg(*list, int *);
4494 int *h = va_arg(*list, int *);
4495 Elm_Win_Smart_Data *sd = _pd;
4496 if (w) *w = sd->size_step_w;
4497 if (w) *h = sd->size_step_h;
4501 elm_win_layer_set(Evas_Object *obj,
4505 eo_do(obj, elm_obj_win_layer_set(layer));
4509 _layer_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4511 int layer = va_arg(*list, int);
4512 Elm_Win_Smart_Data *sd = _pd;
4514 TRAP(sd, layer_set, layer);
4515 #ifdef HAVE_ELEMENTARY_X
4516 _elm_win_xwin_update(sd);
4521 elm_win_layer_get(const Evas_Object *obj)
4523 ELM_WIN_CHECK(obj) - 1;
4525 eo_do((Eo *) obj, elm_obj_win_layer_get(&ret));
4530 _layer_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4532 int *ret = va_arg(*list, int *);
4533 Elm_Win_Smart_Data *sd = _pd;
4534 *ret = ecore_evas_layer_get(sd->ee);
4538 elm_win_norender_push(Evas_Object *obj)
4541 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4544 if (sd->norender == 1) ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
4548 elm_win_norender_pop(Evas_Object *obj)
4551 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4553 if (sd->norender <= 0) return;
4555 if (sd->norender == 0) ecore_evas_manual_render_set(sd->ee, EINA_FALSE);
4559 elm_win_norender_get(Evas_Object *obj)
4561 ELM_WIN_CHECK(obj) - 1;
4562 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
4563 return sd->norender;
4567 elm_win_render(Evas_Object *obj)
4570 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4571 ecore_evas_manual_render(sd->ee);
4575 _win_rotation_degree_check(int rotation)
4577 if ((rotation > 360) || (rotation < 0))
4579 WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
4581 if (rotation < 0) rotation += 360;
4587 * This API resizes the internal window(ex: X window) and evas_output.
4588 * But this does not resize the elm window object and its contents.
4591 elm_win_rotation_set(Evas_Object *obj,
4595 eo_do(obj, elm_obj_win_rotation_set(rotation));
4599 _win_rotate(Evas_Object *obj, Elm_Win_Smart_Data *sd, int rotation, Eina_Bool resize)
4601 rotation = _win_rotation_degree_check(rotation);
4602 if (sd->rot == rotation) return;
4604 if (resize) TRAP(sd, rotation_with_resize_set, rotation);
4605 else TRAP(sd, rotation_set, rotation);
4606 evas_object_size_hint_min_set(obj, -1, -1);
4607 evas_object_size_hint_max_set(obj, -1, -1);
4608 _elm_win_resize_objects_eval(obj);
4609 #ifdef HAVE_ELEMENTARY_X
4610 _elm_win_xwin_update(sd);
4612 _elm_win_frame_obj_update(sd);
4613 elm_widget_orientation_set(obj, rotation);
4614 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
4618 _rotation_set(Eo *obj, void *_pd, va_list *list)
4620 int rotation = va_arg(*list, int);
4621 Elm_Win_Smart_Data *sd = _pd;
4622 _win_rotate(obj, sd, rotation, EINA_FALSE);
4626 * This API does not resize the internal window (ex: X window).
4627 * But this resizes evas_output, elm window, and its contents.
4630 elm_win_rotation_with_resize_set(Evas_Object *obj,
4634 eo_do(obj, elm_obj_win_rotation_with_resize_set(rotation));
4638 _rotation_with_resize_set(Eo *obj, void *_pd, va_list *list)
4640 int rotation = va_arg(*list, int);
4641 Elm_Win_Smart_Data *sd = _pd;
4642 _win_rotate(obj, sd, rotation, EINA_TRUE);
4646 elm_win_rotation_get(const Evas_Object *obj)
4648 ELM_WIN_CHECK(obj) - 1;
4650 eo_do((Eo *) obj, elm_obj_win_rotation_get(&ret));
4655 _rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4657 int *ret = va_arg(*list, int *);
4658 Elm_Win_Smart_Data *sd = _pd;
4663 elm_win_wm_rotation_supported_get(const Evas_Object *obj)
4665 ELM_WIN_CHECK(obj) EINA_FALSE;
4666 Eina_Bool ret = EINA_FALSE;
4667 eo_do((Eo *) obj, elm_obj_win_wm_rotation_supported_get(&ret));
4672 _wm_rotation_supported_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4674 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4675 Elm_Win_Smart_Data *sd = _pd;
4676 *ret = sd->wm_rot.wm_supported;
4679 /* This will unset a preferred rotation, if given preferred rotation is '-1'.
4682 elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj,
4686 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_set(rotation));
4690 _wm_preferred_rotation_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4692 int rotation = va_arg(*list, int);
4694 Elm_Win_Smart_Data *sd = _pd;
4696 if (!sd->wm_rot.use)
4697 sd->wm_rot.use = EINA_TRUE;
4699 // '-1' means that elm_win doesn't use preferred rotation.
4703 rot = _win_rotation_degree_check(rotation);
4705 if (sd->wm_rot.preferred_rot == rot) return;
4706 sd->wm_rot.preferred_rot = rot;
4708 ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
4712 elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj)
4714 ELM_WIN_CHECK(obj) -1;
4716 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_get(&ret));
4721 _wm_preferred_rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4723 int *ret = va_arg(*list, int *);
4724 Elm_Win_Smart_Data *sd = _pd;
4725 *ret = sd->wm_rot.preferred_rot;
4729 elm_win_wm_rotation_available_rotations_set(Evas_Object *obj,
4730 const int *rotations,
4734 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_set(rotations, count));
4738 _wm_available_rotations_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4740 const int *rotations = va_arg(*list, const int *);
4741 unsigned int count = va_arg(*list, unsigned int);
4742 Elm_Win_Smart_Data *sd = _pd;
4746 if (!sd->wm_rot.use)
4747 sd->wm_rot.use = EINA_TRUE;
4749 ELM_SAFE_FREE(sd->wm_rot.rots, free);
4750 sd->wm_rot.count = 0;
4754 sd->wm_rot.rots = calloc(count, sizeof(int));
4755 if (!sd->wm_rot.rots) return;
4756 for (i = 0; i < count; i++)
4758 r = _win_rotation_degree_check(rotations[i]);
4759 sd->wm_rot.rots[i] = r;
4763 sd->wm_rot.count = count;
4765 ecore_evas_wm_rotation_available_rotations_set(sd->ee,
4771 elm_win_wm_rotation_available_rotations_get(const Evas_Object *obj,
4773 unsigned int *count)
4775 ELM_WIN_CHECK(obj) EINA_FALSE;
4776 Eina_Bool ret = EINA_FALSE;
4777 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_get(rotations, count, &ret));
4782 _wm_available_rotations_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4784 int **rotations = va_arg(*list, int **);
4785 unsigned int *count = va_arg(*list, unsigned int *);
4786 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4787 Elm_Win_Smart_Data *sd = _pd;
4789 if (!sd->wm_rot.use) return;
4791 if (sd->wm_rot.count > 0)
4795 *rotations = calloc(sd->wm_rot.count, sizeof(int));
4800 sizeof(int) * sd->wm_rot.count);
4805 if (count) *count = sd->wm_rot.count;
4810 elm_win_wm_rotation_manual_rotation_done_set(Evas_Object *obj,
4814 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_set(set));
4818 _wm_manual_rotation_done_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4820 int set = va_arg(*list, int);
4821 Elm_Win_Smart_Data *sd = _pd;
4822 if (!sd->wm_rot.use) return;
4823 ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
4827 elm_win_wm_rotation_manual_rotation_done_get(const Evas_Object *obj)
4829 ELM_WIN_CHECK(obj) EINA_FALSE;
4830 Eina_Bool ret = EINA_FALSE;
4831 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_get(&ret));
4836 _wm_manual_rotation_done_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4838 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4839 Elm_Win_Smart_Data *sd = _pd;
4840 if (!sd->wm_rot.use) return;
4841 *ret = ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
4845 elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj)
4848 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done());
4852 _wm_manual_rotation_done(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
4854 Elm_Win_Smart_Data *sd = _pd;
4855 if (!sd->wm_rot.use) return;
4856 ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
4860 elm_win_sticky_set(Evas_Object *obj,
4864 eo_do(obj, elm_obj_win_sticky_set(sticky));
4868 _sticky_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4870 Eina_Bool sticky = va_arg(*list, int);
4871 Elm_Win_Smart_Data *sd = _pd;
4873 // sd->sticky = sticky;
4874 TRAP(sd, sticky_set, sticky);
4875 #ifdef HAVE_ELEMENTARY_X
4876 _elm_win_xwin_update(sd);
4881 elm_win_sticky_get(const Evas_Object *obj)
4883 ELM_WIN_CHECK(obj) EINA_FALSE;
4884 Eina_Bool ret = EINA_FALSE;
4885 eo_do((Eo *) obj, elm_obj_win_sticky_get(&ret));
4890 _sticky_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4892 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4893 Elm_Win_Smart_Data *sd = _pd;
4898 elm_win_keyboard_mode_set(Evas_Object *obj,
4899 Elm_Win_Keyboard_Mode mode)
4902 eo_do(obj, elm_obj_win_keyboard_mode_set(mode));
4906 _keyboard_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4908 Elm_Win_Keyboard_Mode mode = va_arg(*list, Elm_Win_Keyboard_Mode);
4909 Elm_Win_Smart_Data *sd = _pd;
4911 if (mode == sd->kbdmode) return;
4912 #ifdef HAVE_ELEMENTARY_X
4913 _elm_win_xwindow_get(sd);
4916 #ifdef HAVE_ELEMENTARY_X
4918 ecore_x_e_virtual_keyboard_state_set
4919 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
4923 EAPI Elm_Win_Keyboard_Mode
4924 elm_win_keyboard_mode_get(const Evas_Object *obj)
4926 ELM_WIN_CHECK(obj) ELM_WIN_KEYBOARD_UNKNOWN;
4927 Elm_Win_Keyboard_Mode ret = ELM_WIN_KEYBOARD_UNKNOWN;
4928 eo_do((Eo *) obj, elm_obj_win_keyboard_mode_get(&ret));
4933 _keyboard_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4935 Elm_Win_Keyboard_Mode *ret = va_arg(*list, Elm_Win_Keyboard_Mode *);
4936 Elm_Win_Smart_Data *sd = _pd;
4941 elm_win_keyboard_win_set(Evas_Object *obj,
4942 Eina_Bool is_keyboard)
4945 eo_do(obj, elm_obj_win_keyboard_win_set(is_keyboard));
4949 _keyboard_win_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4951 Eina_Bool is_keyboard = va_arg(*list, int);
4952 Elm_Win_Smart_Data *sd = _pd;
4954 #ifdef HAVE_ELEMENTARY_X
4955 _elm_win_xwindow_get(sd);
4957 ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
4964 elm_win_keyboard_win_get(const Evas_Object *obj)
4966 ELM_WIN_CHECK(obj) EINA_FALSE;
4967 Eina_Bool ret = EINA_FALSE;
4968 eo_do((Eo *) obj, elm_obj_win_keyboard_win_get(&ret));
4973 _keyboard_win_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4975 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4976 Elm_Win_Smart_Data *sd = _pd;
4978 #ifdef HAVE_ELEMENTARY_X
4979 _elm_win_xwindow_get(sd);
4982 *ret = ecore_x_e_virtual_keyboard_get(sd->x.xwin);
4990 elm_win_indicator_mode_set(Evas_Object *obj,
4991 Elm_Win_Indicator_Mode mode)
4994 eo_do(obj, elm_obj_win_indicator_mode_set(mode));
4998 _indicator_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5000 Elm_Win_Indicator_Mode mode = va_arg(*list, Elm_Win_Indicator_Mode);
5001 Elm_Win_Smart_Data *sd = _pd;
5003 if (mode == sd->indmode) return;
5004 #ifdef HAVE_ELEMENTARY_X
5005 _elm_win_xwindow_get(sd);
5008 #ifdef HAVE_ELEMENTARY_X
5011 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
5012 ecore_x_e_illume_indicator_state_set
5013 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
5014 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
5015 ecore_x_e_illume_indicator_state_set
5016 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
5019 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
5022 EAPI Elm_Win_Indicator_Mode
5023 elm_win_indicator_mode_get(const Evas_Object *obj)
5025 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_UNKNOWN;
5026 Elm_Win_Indicator_Mode ret = ELM_WIN_INDICATOR_UNKNOWN;
5027 eo_do((Eo *) obj, elm_obj_win_indicator_mode_get(&ret));
5032 _indicator_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5034 Elm_Win_Indicator_Mode *ret = va_arg(*list, Elm_Win_Indicator_Mode *);
5035 Elm_Win_Smart_Data *sd = _pd;
5040 elm_win_indicator_opacity_set(Evas_Object *obj,
5041 Elm_Win_Indicator_Opacity_Mode mode)
5044 eo_do(obj, elm_obj_win_indicator_opacity_set(mode));
5048 _indicator_opacity_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5050 Elm_Win_Indicator_Opacity_Mode mode = va_arg(*list, Elm_Win_Indicator_Opacity_Mode);
5051 Elm_Win_Smart_Data *sd = _pd;
5053 if (mode == sd->ind_o_mode) return;
5054 sd->ind_o_mode = mode;
5055 #ifdef HAVE_ELEMENTARY_X
5056 _elm_win_xwindow_get(sd);
5059 if (sd->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
5060 ecore_x_e_illume_indicator_opacity_set
5061 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
5062 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
5063 ecore_x_e_illume_indicator_opacity_set
5064 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
5065 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
5066 ecore_x_e_illume_indicator_opacity_set
5067 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
5070 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
5073 EAPI Elm_Win_Indicator_Opacity_Mode
5074 elm_win_indicator_opacity_get(const Evas_Object *obj)
5076 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5077 Elm_Win_Indicator_Opacity_Mode ret = ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5078 eo_do((Eo *) obj, elm_obj_win_indicator_opacity_get(&ret));
5083 _indicator_opacity_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5085 Elm_Win_Indicator_Opacity_Mode *ret = va_arg(*list, Elm_Win_Indicator_Opacity_Mode *);
5086 Elm_Win_Smart_Data *sd = _pd;
5087 *ret = sd->ind_o_mode;
5091 elm_win_screen_position_get(const Evas_Object *obj,
5096 eo_do((Eo *) obj, elm_obj_win_screen_position_get(x, y));
5100 _screen_position_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5102 int *x = va_arg(*list, int *);
5103 int *y = va_arg(*list, int *);
5104 Elm_Win_Smart_Data *sd = _pd;
5106 if (x) *x = sd->screen.x;
5107 if (y) *y = sd->screen.y;
5111 elm_win_focus_get(const Evas_Object *obj)
5113 ELM_WIN_CHECK(obj) EINA_FALSE;
5114 Eina_Bool ret = EINA_FALSE;
5115 eo_do((Eo *) obj, elm_obj_win_focus_get(&ret));
5120 _focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5122 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5123 Elm_Win_Smart_Data *sd = _pd;
5124 *ret = ecore_evas_focus_get(sd->ee);
5128 elm_win_screen_constrain_set(Evas_Object *obj,
5129 Eina_Bool constrain)
5132 eo_do(obj, elm_obj_win_screen_constrain_set(constrain));
5136 _screen_constrain_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5138 Eina_Bool constrain = va_arg(*list, int);
5139 Elm_Win_Smart_Data *sd = _pd;
5140 sd->constrain = !!constrain;
5144 elm_win_screen_constrain_get(Evas_Object *obj)
5146 ELM_WIN_CHECK(obj) EINA_FALSE;
5147 Eina_Bool ret = EINA_FALSE;
5148 eo_do(obj, elm_obj_win_screen_constrain_get(&ret));
5153 _screen_constrain_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5155 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5156 Elm_Win_Smart_Data *sd = _pd;
5157 *ret = sd->constrain;
5161 elm_win_screen_size_get(const Evas_Object *obj,
5168 eo_do((Eo *) obj, elm_obj_win_screen_size_get(x, y, w, h));
5172 _screen_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5174 int *x = va_arg(*list, int *);
5175 int *y = va_arg(*list, int *);
5176 int *w = va_arg(*list, int *);
5177 int *h = va_arg(*list, int *);
5178 Elm_Win_Smart_Data *sd = _pd;
5180 ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
5184 elm_win_screen_dpi_get(const Evas_Object *obj,
5189 eo_do((Eo *) obj, elm_obj_win_screen_dpi_get(xdpi, ydpi));
5193 _screen_dpi_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5195 int *xdpi = va_arg(*list, int *);
5196 int *ydpi = va_arg(*list, int *);
5197 Elm_Win_Smart_Data *sd = _pd;
5199 ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
5203 elm_win_conformant_set(Evas_Object *obj,
5204 Eina_Bool conformant)
5207 eo_do(obj, elm_obj_win_conformant_set(conformant));
5211 _conformant_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5213 Eina_Bool conformant = va_arg(*list, int);
5214 Elm_Win_Smart_Data *sd = _pd;
5216 #ifdef HAVE_ELEMENTARY_X
5217 _elm_win_xwindow_get(sd);
5219 ecore_x_e_illume_conformant_set(sd->x.xwin, conformant);
5226 elm_win_conformant_get(const Evas_Object *obj)
5228 ELM_WIN_CHECK(obj) EINA_FALSE;
5229 Eina_Bool ret = EINA_FALSE;
5230 eo_do((Eo *) obj, elm_obj_win_conformant_get(&ret));
5235 _conformant_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5237 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5238 Elm_Win_Smart_Data *sd = _pd;
5241 #ifdef HAVE_ELEMENTARY_X
5242 _elm_win_xwindow_get(sd);
5244 *ret = ecore_x_e_illume_conformant_get(sd->x.xwin);
5249 elm_win_quickpanel_set(Evas_Object *obj,
5250 Eina_Bool quickpanel)
5253 eo_do(obj, elm_obj_win_quickpanel_set(quickpanel));
5257 _quickpanel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5259 Eina_Bool quickpanel = va_arg(*list, int);
5260 Elm_Win_Smart_Data *sd = _pd;
5261 #ifdef HAVE_ELEMENTARY_X
5262 _elm_win_xwindow_get(sd);
5265 ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel);
5268 Ecore_X_Window_State states[2];
5270 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
5271 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
5272 ecore_x_netwm_window_state_set(sd->x.xwin, states, 2);
5273 ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
5282 elm_win_quickpanel_get(const Evas_Object *obj)
5284 ELM_WIN_CHECK(obj) EINA_FALSE;
5285 Eina_Bool ret = EINA_FALSE;
5286 eo_do((Eo *) obj, elm_obj_win_quickpanel_get(&ret));
5291 _quickpanel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5293 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5294 Elm_Win_Smart_Data *sd = _pd;
5297 #ifdef HAVE_ELEMENTARY_X
5298 _elm_win_xwindow_get(sd);
5300 *ret = ecore_x_e_illume_quickpanel_get(sd->x.xwin);
5305 elm_win_quickpanel_priority_major_set(Evas_Object *obj,
5309 eo_do(obj, elm_obj_win_quickpanel_priority_major_set(priority));
5313 _quickpanel_priority_major_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5315 int priority = va_arg(*list, int);
5316 Elm_Win_Smart_Data *sd = _pd;
5318 #ifdef HAVE_ELEMENTARY_X
5319 _elm_win_xwindow_get(sd);
5321 ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
5328 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
5330 ELM_WIN_CHECK(obj) - 1;
5332 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_major_get(&ret));
5337 _quickpanel_priority_major_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5339 int *ret = va_arg(*list, int *);
5340 Elm_Win_Smart_Data *sd = _pd;
5343 #ifdef HAVE_ELEMENTARY_X
5344 _elm_win_xwindow_get(sd);
5346 *ret = ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
5351 elm_win_quickpanel_priority_minor_set(Evas_Object *obj,
5355 eo_do(obj, elm_obj_win_quickpanel_priority_minor_set(priority));
5359 _quickpanel_priority_minor_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5361 int priority = va_arg(*list, int);
5362 Elm_Win_Smart_Data *sd = _pd;
5364 #ifdef HAVE_ELEMENTARY_X
5365 _elm_win_xwindow_get(sd);
5367 ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
5374 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
5376 ELM_WIN_CHECK(obj) - 1;
5378 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_minor_get(&ret));
5383 _quickpanel_priority_minor_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5385 int *ret = va_arg(*list, int *);
5386 Elm_Win_Smart_Data *sd = _pd;
5389 #ifdef HAVE_ELEMENTARY_X
5390 _elm_win_xwindow_get(sd);
5392 *ret = ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
5397 elm_win_quickpanel_zone_set(Evas_Object *obj,
5401 eo_do(obj, elm_obj_win_quickpanel_zone_set(zone));
5405 _quickpanel_zone_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5407 int zone = va_arg(*list, int);
5408 Elm_Win_Smart_Data *sd = _pd;
5410 #ifdef HAVE_ELEMENTARY_X
5411 _elm_win_xwindow_get(sd);
5413 ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
5420 elm_win_quickpanel_zone_get(const Evas_Object *obj)
5422 ELM_WIN_CHECK(obj) 0;
5424 eo_do((Eo *) obj, elm_obj_win_quickpanel_zone_get(&ret));
5429 _quickpanel_zone_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5431 int *ret = va_arg(*list, int *);
5432 Elm_Win_Smart_Data *sd = _pd;
5435 #ifdef HAVE_ELEMENTARY_X
5436 _elm_win_xwindow_get(sd);
5438 *ret = ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
5443 elm_win_prop_focus_skip_set(Evas_Object *obj,
5447 eo_do(obj, elm_obj_win_prop_focus_skip_set(skip));
5451 _prop_focus_skip_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5453 Eina_Bool skip = va_arg(*list, int);
5454 Elm_Win_Smart_Data *sd = _pd;
5456 sd->skip_focus = skip;
5457 TRAP(sd, focus_skip_set, skip);
5461 elm_win_illume_command_send(Evas_Object *obj,
5462 Elm_Illume_Command command,
5466 eo_do(obj, elm_obj_win_illume_command_send(command, params));
5470 _illume_command_send(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5472 Elm_Illume_Command command = va_arg(*list, Elm_Illume_Command);
5473 void *params = va_arg(*list, void *);
5475 Elm_Win_Smart_Data *sd = _pd;
5477 #ifdef HAVE_ELEMENTARY_X
5478 _elm_win_xwindow_get(sd);
5483 case ELM_ILLUME_COMMAND_FOCUS_BACK:
5484 ecore_x_e_illume_focus_back_send(sd->x.xwin);
5487 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
5488 ecore_x_e_illume_focus_forward_send(sd->x.xwin);
5491 case ELM_ILLUME_COMMAND_FOCUS_HOME:
5492 ecore_x_e_illume_focus_home_send(sd->x.xwin);
5495 case ELM_ILLUME_COMMAND_CLOSE:
5496 ecore_x_e_illume_close_send(sd->x.xwin);
5509 elm_win_inlined_image_object_get(Evas_Object *obj)
5511 ELM_WIN_CHECK(obj) NULL;
5512 Evas_Object *ret = NULL;
5513 eo_do(obj, elm_obj_win_inlined_image_object_get(&ret));
5518 _inlined_image_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5520 Evas_Object **ret = va_arg(*list, Evas_Object **);
5521 Elm_Win_Smart_Data *sd = _pd;
5526 elm_win_focus_highlight_enabled_set(Evas_Object *obj,
5530 eo_do(obj, elm_obj_win_focus_highlight_enabled_set(enabled));
5534 _focus_highlight_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5536 Eina_Bool enabled = va_arg(*list, int);
5537 Elm_Win_Smart_Data *sd = _pd;
5539 enabled = !!enabled;
5540 if (sd->focus_highlight.enabled == enabled)
5543 sd->focus_highlight.enabled = enabled;
5545 if (sd->focus_highlight.enabled)
5546 _elm_win_focus_highlight_init(sd);
5548 _elm_win_focus_highlight_shutdown(sd);
5552 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
5554 ELM_WIN_CHECK(obj) EINA_FALSE;
5555 Eina_Bool ret = EINA_FALSE;
5556 eo_do((Eo *) obj, elm_obj_win_focus_highlight_enabled_get(&ret));
5561 _focus_highlight_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5563 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5564 Elm_Win_Smart_Data *sd = _pd;
5565 *ret = sd->focus_highlight.enabled;
5569 elm_win_focus_highlight_style_set(Evas_Object *obj,
5573 eo_do(obj, elm_obj_win_focus_highlight_style_set(style));
5577 _elm_win_smart_theme(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
5579 Elm_Win_Smart_Data *sd = _pd;
5580 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5581 Eina_Bool int_ret = EINA_FALSE;
5583 if (ret) *ret = EINA_TRUE;
5585 eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret));
5586 if (!int_ret) return;
5588 sd->focus_highlight.theme_changed = EINA_TRUE;
5589 _elm_win_focus_highlight_reconfigure_job_start(sd);
5591 if (ret) *ret = EINA_TRUE;
5595 _focus_highlight_style_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5597 const char *style = va_arg(*list, const char *);
5598 Elm_Win_Smart_Data *sd = _pd;
5600 eina_stringshare_replace(&sd->focus_highlight.style, style);
5601 sd->focus_highlight.theme_changed = EINA_TRUE;
5602 _elm_win_focus_highlight_reconfigure_job_start(sd);
5606 elm_win_focus_highlight_style_get(const Evas_Object *obj)
5608 ELM_WIN_CHECK(obj) NULL;
5609 const char *ret = NULL;
5610 eo_do((Eo *) obj, elm_obj_win_focus_highlight_style_get(&ret));
5615 _focus_highlight_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5617 const char **ret = va_arg(*list, const char **);
5618 Elm_Win_Smart_Data *sd = _pd;
5619 *ret = sd->focus_highlight.style;
5623 elm_win_focus_highlight_animate_set(Evas_Object *obj,
5627 eo_do(obj, elm_obj_win_focus_highlight_animate_set(animate));
5631 _focus_highlight_animate_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5633 Eina_Bool animate = va_arg(*list, int);
5634 Elm_Win_Smart_Data *sd = _pd;
5636 animate = !!animate;
5637 if (sd->focus_highlight.animate == animate)
5640 sd->focus_highlight.animate = animate;
5641 sd->focus_highlight.theme_changed = EINA_TRUE;
5642 _elm_win_focus_highlight_reconfigure_job_start(sd);
5646 elm_win_focus_highlight_animate_get(const Evas_Object *obj)
5648 ELM_WIN_CHECK(obj) EINA_FALSE;
5649 Eina_Bool ret = EINA_FALSE;
5650 eo_do((Eo *) obj, elm_obj_win_focus_highlight_animate_get(&ret));
5655 _focus_highlight_animate_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5657 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5658 Elm_Win_Smart_Data *sd = _pd;
5659 *ret = sd->focus_highlight.animate;
5663 elm_win_socket_listen(Evas_Object *obj,
5664 const char *svcname,
5668 ELM_WIN_CHECK(obj) EINA_FALSE;
5669 Eina_Bool ret = EINA_FALSE;
5670 eo_do(obj, elm_obj_win_socket_listen(svcname, svcnum, svcsys, &ret));
5675 _socket_listen(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5677 const char *svcname = va_arg(*list, const char *);
5678 int svcnum = va_arg(*list, int);
5679 Eina_Bool svcsys = va_arg(*list, int);
5680 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5681 Elm_Win_Smart_Data *sd = _pd;
5684 if (!sd->ee) return;
5686 if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
5692 /* windowing specific calls - shall we do this differently? */
5695 elm_win_xwindow_get(const Evas_Object *obj)
5699 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5701 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5702 return _elm_ee_xwin_get(ee);
5705 ELM_WIN_CHECK(obj) 0;
5706 Ecore_X_Window ret = 0;
5707 eo_do((Eo *) obj, elm_obj_win_xwindow_get(&ret));
5712 _xwindow_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5714 Ecore_X_Window *ret = va_arg(*list, Ecore_X_Window *);
5715 Elm_Win_Smart_Data *sd = _pd;
5717 #ifdef HAVE_ELEMENTARY_X
5725 *ret = elm_win_xwindow_get(sd->parent);
5732 EAPI Ecore_Wl_Window *
5733 elm_win_wl_window_get(const Evas_Object *obj)
5735 if (!obj) return NULL;
5737 if ((!ENGINE_COMPARE(ELM_WAYLAND_SHM)) &&
5738 (!ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5741 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5743 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5744 return _elm_ee_wlwin_get(ee);
5747 ELM_WIN_CHECK(obj) NULL;
5748 Ecore_Wl_Window *ret = NULL;
5749 eo_do((Eo *) obj, elm_obj_win_wl_window_get(&ret));
5754 _wl_window_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5756 Ecore_Wl_Window **ret = va_arg(*list, Ecore_Wl_Window **);
5757 #if HAVE_ELEMENTARY_WAYLAND
5758 Elm_Win_Smart_Data *sd = _pd;
5766 *ret = elm_win_wl_window_get(sd->parent);
5776 elm_win_trap_set(const Elm_Win_Trap *t)
5778 DBG("old %p, new %p", trap, t);
5780 if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
5782 CRI("trying to set a trap version %lu while %lu was expected!",
5783 t->version, ELM_WIN_TRAP_VERSION);
5792 elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
5795 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
5797 floating = !!floating;
5798 if (floating == sd->floating) return;
5799 sd->floating = floating;
5800 #ifdef HAVE_ELEMENTARY_X
5801 _elm_win_xwindow_get(sd);
5805 ecore_x_e_illume_window_state_set
5806 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING);
5808 ecore_x_e_illume_window_state_set
5809 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL);
5815 elm_win_floating_mode_get(const Evas_Object *obj)
5817 ELM_WIN_CHECK(obj) EINA_FALSE;
5818 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
5820 return sd->floating;
5824 _window_id_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5826 Ecore_Window *ret = va_arg(*list, Ecore_Window *);
5827 Elm_Win_Smart_Data *sd = _pd;
5829 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5831 #if HAVE_ELEMENTARY_WAYLAND
5834 *ret = (Ecore_Window)ecore_wl_window_surface_id_get(sd->wl.win);
5839 Ecore_Wl_Window *parent;
5841 parent = elm_win_wl_window_get(sd->parent);
5842 if (parent) *ret = (Ecore_Window)ecore_wl_window_surface_id_get(parent);
5849 #ifdef HAVE_ELEMENTARY_X
5850 _elm_win_xwindow_get(sd);
5853 *ret = (Ecore_Window)sd->x.xwin;
5858 *ret = (Ecore_Window)elm_win_xwindow_get(sd->parent);
5868 _elm_win_focus_highlight_start(Evas_Object *obj)
5870 ELM_WIN_DATA_GET(obj, sd);
5872 if (!elm_win_focus_highlight_enabled_get(obj)) return;
5873 sd->focus_highlight.cur.visible = EINA_TRUE;
5874 sd->focus_highlight.geometry_changed = EINA_TRUE;
5875 _elm_win_focus_highlight_reconfigure_job(obj);
5879 elm_win_window_id_get(const Evas_Object *obj)
5883 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5885 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5886 return ecore_evas_window_get(ee);
5889 ELM_WIN_CHECK(obj) 0;
5890 Ecore_Window ret = 0;
5891 eo_do((Eo *) obj, elm_obj_win_window_id_get(&ret));
5896 _class_constructor(Eo_Class *klass)
5898 const Eo_Op_Func_Description func_desc[] = {
5899 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
5900 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_win_smart_add),
5901 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_win_smart_del),
5902 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_win_smart_resize),
5903 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_win_smart_move),
5904 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_win_smart_show),
5905 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_win_smart_hide),
5907 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_ON_FOCUS), _elm_win_smart_on_focus),
5908 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_EVENT), _elm_win_smart_event),
5909 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_win_smart_focus_next_manager_is),
5910 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT), _elm_win_smart_focus_next),
5911 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_win_smart_focus_direction_manager_is),
5912 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_win_smart_focus_direction),
5913 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_THEME_APPLY), _elm_win_smart_theme),
5915 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), _win_constructor),
5916 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD), _resize_object_add),
5917 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), _resize_object_del),
5918 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TYPE_GET), _type_get),
5919 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_SET), _title_set),
5920 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_GET), _title_get),
5921 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET), _icon_name_set),
5922 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET), _icon_name_get),
5923 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_SET), _role_set),
5924 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_GET), _role_get),
5925 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET), _icon_object_set),
5926 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET), _icon_object_get),
5927 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET), _autodel_set),
5928 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET), _autodel_get),
5929 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ACTIVATE), _activate),
5930 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LOWER), _lower),
5931 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RAISE), _raise),
5932 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CENTER), _center),
5933 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET), _borderless_set),
5934 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET), _borderless_get),
5935 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_SET), _shaped_set),
5936 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_GET), _shaped_get),
5937 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_SET), _alpha_set),
5938 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_GET), _alpha_get),
5939 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET), _override_set),
5940 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET), _override_get),
5941 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET), _fullscreen_set),
5942 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET), _fullscreen_get),
5943 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET), _main_menu_get),
5944 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET), _maximized_set),
5945 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET), _maximized_get),
5946 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET), _iconified_set),
5947 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET), _iconified_get),
5948 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET), _withdrawn_set),
5949 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET), _withdrawn_get),
5950 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET), _available_profiles_set),
5951 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET), _available_profiles_get),
5952 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_SET), _profile_set),
5953 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_GET), _profile_get),
5954 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_SET), _urgent_set),
5955 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_GET), _urgent_get),
5956 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET), _demand_attention_set),
5957 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET), _demand_attention_get),
5958 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_SET), _modal_set),
5959 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_GET), _modal_get),
5960 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_SET), _aspect_set),
5961 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_GET), _aspect_get),
5962 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET), _size_base_set),
5963 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET), _size_base_get),
5964 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET), _size_step_set),
5965 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET), _size_step_get),
5966 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_SET), _layer_set),
5967 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_GET), _layer_get),
5968 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_SET), _rotation_set),
5969 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET), _rotation_with_resize_set),
5970 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_GET), _rotation_get),
5971 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_SET), _sticky_set),
5972 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_GET), _sticky_get),
5973 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET), _keyboard_mode_set),
5974 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET), _keyboard_mode_get),
5975 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET), _keyboard_win_set),
5976 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET), _keyboard_win_get),
5977 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET), _indicator_mode_set),
5978 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET), _indicator_mode_get),
5979 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET), _indicator_opacity_set),
5980 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET), _indicator_opacity_get),
5981 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET), _screen_position_get),
5982 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_GET), _focus_get),
5983 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET), _screen_constrain_set),
5984 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET), _screen_constrain_get),
5985 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET), _screen_size_get),
5986 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET), _screen_dpi_get),
5987 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET), _conformant_set),
5988 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET), _conformant_get),
5989 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET), _quickpanel_set),
5990 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET), _quickpanel_get),
5991 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET), _quickpanel_priority_major_set),
5992 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET), _quickpanel_priority_major_get),
5993 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET), _quickpanel_priority_minor_set),
5994 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET), _quickpanel_priority_minor_get),
5995 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET), _quickpanel_zone_set),
5996 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET), _quickpanel_zone_get),
5997 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET), _prop_focus_skip_set),
5998 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND), _illume_command_send),
5999 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET), _inlined_image_object_get),
6000 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET), _focus_highlight_enabled_set),
6001 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET), _focus_highlight_enabled_get),
6002 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET), _focus_highlight_style_set),
6003 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET), _focus_highlight_style_get),
6004 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET), _focus_highlight_animate_set),
6005 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET), _focus_highlight_animate_get),
6006 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN), _socket_listen),
6007 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), _xwindow_get),
6008 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), _wl_window_get),
6009 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), _window_id_get),
6010 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET), _wm_rotation_supported_get),
6011 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET), _wm_preferred_rotation_set),
6012 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET), _wm_preferred_rotation_get),
6013 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET), _wm_available_rotations_set),
6014 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET), _wm_available_rotations_get),
6015 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET), _wm_manual_rotation_done_set),
6016 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET), _wm_manual_rotation_done_get),
6017 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE), _wm_manual_rotation_done),
6021 eo_class_funcs_set(klass, func_desc);
6023 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
6026 static const Eo_Op_Description op_desc[] = {
6027 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR, "Adds a window object."),
6028 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD, "Add subobj as a resize object of window obj."),
6029 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL, "Delete subobj as a resize object of window obj."),
6030 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TYPE_GET, "Get the type of the window."),
6031 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_SET, "Set the title of the window."),
6032 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_GET, "Get the title of the window."),
6033 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET, "Set the icon name of the window."),
6034 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET, "Get the icon name of the window."),
6035 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_SET, "Set the role of the window."),
6036 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_GET, "Get the role of the window."),
6037 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET, "Set a window object's icon."),
6038 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET, "Get the icon object used for the window."),
6039 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET, "Set the window's autodel state."),
6040 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET, "Get the window's autodel state."),
6041 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ACTIVATE, "Activate a window object."),
6042 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LOWER, "Lower a window object."),
6043 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RAISE, "Raise a window object."),
6044 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CENTER, "Center a window on its screen."),
6045 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET, "Set the borderless state of a window."),
6046 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET, "Get the borderless state of a window."),
6047 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_SET, "Set the shaped state of a window."),
6048 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_GET, "Get the shaped state of a window."),
6049 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_SET, "Set the alpha channel state of a window."),
6050 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_GET, "Get the alpha channel state of a window."),
6051 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET, "Set the override state of a window."),
6052 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET, "Get the override state of a window."),
6053 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET, "Set the fullscreen state of a window."),
6054 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET, "Get the fullscreen state of a window."),
6055 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET, "Get the Main Menu of a window."),
6056 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET, "Set the maximized state of a window."),
6057 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET, "Get the maximized state of a window."),
6058 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET, "Set the iconified state of a window."),
6059 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET, "Get the iconified state of a window."),
6060 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET, "Set the withdrawn state of a window."),
6061 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET, "Get the withdrawn state of a window."),
6062 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET, "Set the array of available profiles to a window."),
6063 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET, "Get the array of available profiles of a window."),
6064 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_SET, "Set the profile of a window."),
6065 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_GET, "Get the profile of a window."),
6066 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_SET, "Set the urgent state of a window."),
6067 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_GET, "Get the urgent state of a window."),
6068 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET, "Set the demand_attention state of a window."),
6069 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET, "Get the demand_attention state of a window."),
6070 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_SET, "Set the modal state of a window."),
6071 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_GET, "Get the modal state of a window."),
6072 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_SET, "Set the aspect ratio of a window."),
6073 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_GET, "Get the aspect ratio of a window."),
6074 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET, "Set the base window size used with stepping calculation."),
6075 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET, "Get the base size of a window."),
6076 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET, "Set the window stepping used with sizing calculation."),
6077 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET, "Get the stepping of a window."),
6078 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_SET, "Set the layer of the window."),
6079 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_GET, "Get the layer of the window."),
6080 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_SET, "Set the rotation of the window."),
6081 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET, "Rotates the window and resizes it."),
6082 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_GET, "Get the rotation of the window."),
6083 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_SET, "Set the sticky state of the window."),
6084 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_GET, "Get the sticky state of the window."),
6085 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET, "Sets the keyboard mode of the window."),
6086 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET, "Get the keyboard mode of the window."),
6087 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET, "Sets whether the window is a keyboard."),
6088 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET, "Get whether the window is a keyboard."),
6089 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET, "Sets the indicator mode of the window."),
6090 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET, "Get the indicator mode of the window."),
6091 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET, "Sets the indicator opacity mode of the window."),
6092 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET, "Get the indicator opacity mode of the window."),
6093 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET, "Get the screen position of a window."),
6094 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_GET, "Determine whether a window has focus."),
6095 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."),
6096 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."),
6097 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET, "Get screen geometry details for the screen that a window is on."),
6098 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET, "Get screen dpi for the screen that a window is on."),
6099 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET, "Set if this window is an illume conformant window."),
6100 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET, "Get if this window is an illume conformant window."),
6101 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET, "Set a window to be an illume quickpanel window."),
6102 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET, "Get if this window is a quickpanel or not."),
6103 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET, "Set the major priority of a quickpanel window."),
6104 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET, "Get the major priority of a quickpanel window."),
6105 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET, "Set the minor priority of a quickpanel window."),
6106 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET, "Get the minor priority of a quickpanel window."),
6107 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET, "Set which zone this quickpanel should appear in."),
6108 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET, "Get which zone this quickpanel should appear in."),
6109 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET, "Set the window to be skipped by keyboard focus."),
6110 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND, "Send a command to the windowing environment."),
6111 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET, "Get the inlined image object handle."),
6112 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET, "Set the enabled status for the focus highlight in a window."),
6113 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET, "Get the enabled value of the focus highlight for this window."),
6114 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET, "Set the style for the focus highlight on this window."),
6115 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET, "Get the style set for the focus highlight object."),
6116 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET, "Set the animate status for the focus highlight for this window."),
6117 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET, "Get the animate status for the focus highlight for this window."),
6118 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN, "Create a socket to provide the service for Plug widget."),
6119 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, "Get the Ecore_X_Window of an Evas_Object."),
6120 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, "Get the Ecore_Wl_Window of an Evas_Object."),
6121 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET, "Get the Ecore_Window of an Evas_Object."),
6122 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET, "Query if the underlying windowing system supports the window manager rotation.."),
6123 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET, "Set the preferred rotation hint."),
6124 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET, "Get the preferred rotation hint."),
6125 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET, "Set the array of available window rotations."),
6126 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET, "Get the array of available window rotations."),
6127 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET, "Set manual rotation done mode of obj window."),
6128 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET, "Get manual rotation done mode of obj window."),
6129 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE, "Set rotation finish manually"),
6130 EO_OP_DESCRIPTION_SENTINEL
6133 static const Eo_Class_Description class_desc = {
6136 EO_CLASS_TYPE_REGULAR,
6137 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WIN_BASE_ID, op_desc, ELM_OBJ_WIN_SUB_ID_LAST),
6139 sizeof(Elm_Win_Smart_Data),
6144 EO_DEFINE_CLASS(elm_obj_win_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);