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,
237 #ifdef HAVE_ELEMENTARY_X
238 static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd);
241 EAPI double _elm_startup_time = 0;
244 _elm_win_first_frame_do(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
246 double end = ecore_time_unix_get();
254 case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f' sec\n", end, _elm_startup_time, end - _elm_startup_time);
258 evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, data);
262 _elm_win_state_eval(void *data EINA_UNUSED)
266 int _elm_win_count_shown = 0;
267 int _elm_win_count_iconified = 0;
268 int _elm_win_count_withdrawn = 0;
270 _elm_win_state_eval_job = NULL;
272 if (_elm_config->auto_norender_withdrawn)
274 EINA_LIST_FOREACH(_elm_win_list, l, obj)
276 if ((elm_win_withdrawn_get(obj)) ||
277 ((elm_win_iconified_get(obj) &&
278 (_elm_config->auto_norender_iconified_same_as_withdrawn))))
280 if (!evas_object_data_get(obj, "__win_auto_norender"))
282 Evas *evas = evas_object_evas_get(obj);
284 elm_win_norender_push(obj);
285 evas_object_data_set(obj, "__win_auto_norender", obj);
287 if (_elm_config->auto_flush_withdrawn)
289 edje_file_cache_flush();
290 edje_collection_cache_flush();
291 evas_image_cache_flush(evas);
292 evas_font_cache_flush(evas);
294 if (_elm_config->auto_dump_withdrawn)
296 evas_render_dump(evas);
302 if (evas_object_data_get(obj, "__win_auto_norender"))
304 elm_win_norender_pop(obj);
305 evas_object_data_del(obj, "__win_auto_norender");
310 if (((_elm_config->auto_throttle) &&
311 (elm_policy_get(ELM_POLICY_THROTTLE) != ELM_POLICY_THROTTLE_NEVER)) ||
312 (elm_policy_get(ELM_POLICY_THROTTLE) == ELM_POLICY_THROTTLE_HIDDEN_ALWAYS))
314 if (_elm_win_count == 0)
316 if (_elm_win_auto_throttled)
318 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
319 _elm_win_auto_throttled = EINA_FALSE;
324 EINA_LIST_FOREACH(_elm_win_list, l, obj)
326 if (elm_win_withdrawn_get(obj))
327 _elm_win_count_withdrawn++;
328 else if (elm_win_iconified_get(obj))
329 _elm_win_count_iconified++;
330 else if (evas_object_visible_get(obj))
331 _elm_win_count_shown++;
333 if (_elm_win_count_shown <= 0)
335 if (!_elm_win_auto_throttled)
337 ecore_throttle_adjust(_elm_config->auto_throttle_amount);
338 _elm_win_auto_throttled = EINA_TRUE;
343 if (_elm_win_auto_throttled)
345 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
346 _elm_win_auto_throttled = EINA_FALSE;
354 _elm_win_state_eval_queue(void)
356 ecore_job_del(_elm_win_state_eval_job);
357 _elm_win_state_eval_job = ecore_job_add(_elm_win_state_eval, NULL);
360 // example shot spec (wait 0.1 sec then save as my-window.png):
361 // ELM_ENGINE="shot:delay=0.1:file=my-window.png"
364 _shot_delay_get(Elm_Win_Smart_Data *sd)
367 char *d = strdup(sd->shot.info);
370 for (p = (char *)sd->shot.info; *p; p++)
372 if (!strncmp(p, "delay=", 6))
376 for (pd = d, p += 6; (*p) && (*p != ':'); p++, pd++)
392 _shot_file_get(Elm_Win_Smart_Data *sd)
395 char *tmp = strdup(sd->shot.info);
396 char *repname = NULL;
398 if (!tmp) return NULL;
400 for (p = (char *)sd->shot.info; *p; p++)
402 if (!strncmp(p, "file=", 5))
405 if (!sd->shot.repeat_count) return tmp;
408 char *dotptr = strrchr(tmp, '.');
411 size_t size = sizeof(char) * (strlen(tmp) + 16);
412 repname = malloc(size);
413 strncpy(repname, tmp, dotptr - tmp);
414 snprintf(repname + (dotptr - tmp), size -
415 (dotptr - tmp), "%03i",
416 sd->shot.shot_counter + 1);
417 strcat(repname, dotptr);
425 if (!sd->shot.repeat_count) return strdup("out.png");
427 repname = malloc(sizeof(char) * 24);
428 snprintf(repname, sizeof(char) * 24, "out%03i.png",
429 sd->shot.shot_counter + 1);
435 _shot_repeat_count_get(Elm_Win_Smart_Data *sd)
438 char *d = strdup(sd->shot.info);
441 for (p = (char *)sd->shot.info; *p; p++)
443 if (!strncmp(p, "repeat=", 7))
447 for (pd = d, p += 7; (*p) && (*p != ':'); p++, pd++)
454 if (v > 1000) v = 999;
465 _shot_key_get(Elm_Win_Smart_Data *sd EINA_UNUSED)
471 _shot_flags_get(Elm_Win_Smart_Data *sd EINA_UNUSED)
477 _shot_do(Elm_Win_Smart_Data *sd)
481 unsigned int *pixels;
483 char *file, *key, *flags;
485 ecore_evas_manual_render(sd->ee);
486 pixels = (void *)ecore_evas_buffer_pixels_get(sd->ee);
489 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
490 if ((w < 1) || (h < 1)) return;
492 file = _shot_file_get(sd);
495 key = _shot_key_get(sd);
496 flags = _shot_flags_get(sd);
497 ee = ecore_evas_buffer_new(1, 1);
498 o = evas_object_image_add(ecore_evas_get(ee));
499 evas_object_image_alpha_set(o, ecore_evas_alpha_get(sd->ee));
500 evas_object_image_size_set(o, w, h);
501 evas_object_image_data_set(o, pixels);
502 if (!evas_object_image_save(o, file, key, flags))
504 ERR("Cannot save window to '%s' (key '%s', flags '%s')",
511 if (sd->shot.repeat_count) sd->shot.shot_counter++;
515 _shot_delay(void *data)
517 ELM_WIN_DATA_GET(data, sd);
520 if (sd->shot.repeat_count)
522 int remainshot = (sd->shot.repeat_count - sd->shot.shot_counter);
523 if (remainshot > 0) return EINA_TRUE;
525 sd->shot.timer = NULL;
532 _shot_init(Elm_Win_Smart_Data *sd)
534 if (!sd->shot.info) return;
536 sd->shot.repeat_count = _shot_repeat_count_get(sd);
537 sd->shot.shot_counter = 0;
541 _shot_handle(Elm_Win_Smart_Data *sd)
543 if (!sd->shot.info) return;
546 sd->shot.timer = ecore_timer_add(_shot_delay_get(sd), _shot_delay,
550 /* elm-win specific associate, does the trap while ecore_evas_object_associate()
553 static Elm_Win_Smart_Data *
554 _elm_win_associate_get(const Ecore_Evas *ee)
556 Evas_Object *obj = ecore_evas_data_get(ee, "elm_win");
557 if (!obj) return NULL;
558 ELM_WIN_DATA_GET(obj, sd);
562 /* Interceptors Callbacks */
564 _elm_win_obj_intercept_raise(void *data, Evas_Object *obj EINA_UNUSED)
566 ELM_WIN_DATA_GET(data, sd);
571 _elm_win_obj_intercept_lower(void *data, Evas_Object *obj EINA_UNUSED)
573 ELM_WIN_DATA_GET(data, sd);
578 _elm_win_obj_intercept_stack_above(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *above EINA_UNUSED)
580 INF("TODO: %s", __FUNCTION__);
584 _elm_win_obj_intercept_stack_below(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *below EINA_UNUSED)
586 INF("TODO: %s", __FUNCTION__);
590 _elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj EINA_UNUSED, int l)
592 ELM_WIN_DATA_GET(data, sd);
593 TRAP(sd, layer_set, l);
596 /* Event Callbacks */
599 _elm_win_obj_callback_changed_size_hints(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
601 ELM_WIN_DATA_GET(data, sd);
604 evas_object_size_hint_min_get(obj, &w, &h);
605 TRAP(sd, size_min_set, w, h);
607 evas_object_size_hint_max_get(obj, &w, &h);
610 TRAP(sd, size_max_set, w, h);
612 /* end of elm-win specific associate */
615 _elm_win_move(Ecore_Evas *ee)
617 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
622 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
625 evas_object_smart_callback_call(sd->obj, SIG_MOVED, NULL);
629 _elm_win_resize_job(void *data)
631 ELM_WIN_DATA_GET(data, sd);
634 sd->deferred_resize_job = NULL;
635 ecore_evas_request_geometry_get(sd->ee, NULL, NULL, &w, &h);
639 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
648 evas_output_framespace_get(sd->evas, &fx, &fy, &fw, &fh);
649 evas_object_move(sd->frame_obj, -fx, -fy);
650 evas_object_resize(sd->frame_obj, w + fw, h + fh);
653 evas_object_resize(sd->obj, w, h);
654 evas_object_resize(sd->layout, w, h);
658 _elm_win_resize(Ecore_Evas *ee)
660 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
663 ecore_job_del(sd->deferred_resize_job);
664 sd->deferred_resize_job = ecore_job_add(_elm_win_resize_job, sd->obj);
668 _elm_win_mouse_in(Ecore_Evas *ee)
670 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
673 if (sd->resizing) sd->resizing = EINA_FALSE;
677 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win_Smart_Data *sd)
679 ELM_SAFE_FREE(sd->focus_highlight.reconf_job, ecore_job_del);
683 _elm_win_focus_highlight_visible_set(Elm_Win_Smart_Data *sd,
686 Evas_Object *fobj = sd->focus_highlight.fobj;
691 evas_object_show(fobj);
692 edje_object_signal_emit(fobj, "elm,action,focus,show", "elm");
696 edje_object_signal_emit(fobj, "elm,action,focus,hide", "elm");
701 _elm_win_focus_highlight_anim_setup(Elm_Win_Smart_Data *sd,
704 Evas_Coord tx, ty, tw, th;
705 Evas_Coord w, h, px, py, pw, ph;
706 Edje_Message_Int_Set *m;
707 Evas_Object *previous = sd->focus_highlight.prev.target;
708 Evas_Object *target = sd->focus_highlight.cur.target;
710 evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
711 elm_widget_focus_highlight_geometry_get(target, &tx, &ty, &tw, &th);
712 elm_widget_focus_highlight_geometry_get(previous, &px, &py, &pw, &ph);
713 evas_object_move(obj, tx, ty);
714 evas_object_resize(obj, tw, th);
715 evas_object_clip_unset(obj);
717 m = alloca(sizeof(*m) + (sizeof(int) * 8));
727 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
731 _elm_win_focus_highlight_simple_setup(Elm_Win_Smart_Data *sd,
734 Evas_Object *clip, *target = sd->focus_highlight.cur.target;
735 Evas_Coord x, y, w, h;
737 clip = evas_object_clip_get(target);
738 elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h);
740 evas_object_move(obj, x, y);
741 evas_object_resize(obj, w, h);
742 if (clip) evas_object_clip_set(obj, clip);
746 _elm_win_focus_highlight_reconfigure(Elm_Win_Smart_Data *sd)
748 Evas_Object *target = sd->focus_highlight.cur.target;
749 Evas_Object *previous = sd->focus_highlight.prev.target;
750 Evas_Object *fobj = sd->focus_highlight.fobj;
751 Eina_Bool visible_changed;
752 Eina_Bool common_visible;
753 const char *sig = NULL;
754 const char *focus_style_target = NULL;
755 const char *focus_style_previous = NULL;
757 _elm_win_focus_highlight_reconfigure_job_stop(sd);
759 visible_changed = (sd->focus_highlight.cur.visible !=
760 sd->focus_highlight.prev.visible);
762 if ((target == previous) && (!visible_changed) &&
763 (!sd->focus_highlight.geometry_changed) &&
764 (!sd->focus_highlight.theme_changed))
767 if ((previous) && (sd->focus_highlight.prev.in_theme))
768 elm_widget_signal_emit
769 (previous, "elm,action,focus_highlight,hide", "elm");
772 common_visible = EINA_FALSE;
773 else if (sd->focus_highlight.cur.in_theme)
775 common_visible = EINA_FALSE;
776 if (sd->focus_highlight.cur.visible)
777 sig = "elm,action,focus_highlight,show";
779 sig = "elm,action,focus_highlight,hide";
782 common_visible = sd->focus_highlight.cur.visible;
785 elm_widget_signal_emit(target, sig, "elm");
787 if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
791 focus_style_previous = elm_widget_focus_highlight_style_get(previous);
792 focus_style_target = elm_widget_focus_highlight_style_get(target);
794 if (sd->focus_highlight.theme_changed ||
795 (focus_style_target != focus_style_previous))
799 if (focus_style_target)
800 str = focus_style_target;
801 else if (sd->focus_highlight.style)
802 str = sd->focus_highlight.style;
806 elm_widget_theme_object_set
807 (sd->obj, fobj, "focus_highlight", "top", str);
808 sd->focus_highlight.theme_changed = EINA_FALSE;
810 if (sd->focus_highlight.animate)
812 str = edje_object_data_get(sd->focus_highlight.fobj, "animate");
813 sd->focus_highlight.animate_supported = ((str) && (!strcmp(str, "on")));
816 sd->focus_highlight.animate_supported = EINA_FALSE;
819 if ((sd->focus_highlight.animate_supported) && (previous) &&
820 (!sd->focus_highlight.prev.in_theme))
821 _elm_win_focus_highlight_anim_setup(sd, fobj);
823 _elm_win_focus_highlight_simple_setup(sd, fobj);
824 evas_object_raise(fobj);
827 _elm_win_focus_highlight_visible_set(sd, common_visible);
828 sd->focus_highlight.geometry_changed = EINA_FALSE;
829 sd->focus_highlight.prev = sd->focus_highlight.cur;
833 _elm_win_focus_highlight_reconfigure_job(void *data)
835 ELM_WIN_DATA_GET(data, sd);
836 _elm_win_focus_highlight_reconfigure(sd);
840 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win_Smart_Data *sd)
842 ecore_job_del(sd->focus_highlight.reconf_job);
844 sd->focus_highlight.reconf_job = ecore_job_add(
845 _elm_win_focus_highlight_reconfigure_job, sd->obj);
849 _elm_win_focus_in(Ecore_Evas *ee)
851 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
853 unsigned int order = 0;
859 _elm_widget_top_win_focused_set(obj, EINA_TRUE);
860 if (!elm_widget_focus_order_get(obj)
861 || (obj == elm_widget_newest_focus_order_get(obj, &order, EINA_TRUE)))
863 elm_widget_focus_steal(obj);
866 elm_widget_focus_restore(obj);
867 evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
868 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
869 sd->focus_highlight.cur.visible = EINA_TRUE;
870 _elm_win_focus_highlight_reconfigure_job_start(sd);
873 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
877 /* else if (sd->img_obj) */
883 _elm_win_focus_out(Ecore_Evas *ee)
885 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
892 elm_object_focus_set(obj, EINA_FALSE);
893 _elm_widget_top_win_focused_set(obj, EINA_FALSE);
894 evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
895 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
896 sd->focus_highlight.cur.visible = EINA_FALSE;
897 _elm_win_focus_highlight_reconfigure_job_start(sd);
900 edje_object_signal_emit(sd->frame_obj, "elm,action,unfocus", "elm");
904 _elm_access_object_highlight_disable(evas_object_evas_get(obj));
907 /* if (sd->img_obj) */
913 _elm_win_available_profiles_del(Elm_Win_Smart_Data *sd)
915 if (!sd->profile.available_list) return;
918 for (i = 0; i < sd->profile.count; i++)
919 ELM_SAFE_FREE(sd->profile.available_list[i], eina_stringshare_del);
920 sd->profile.count = 0;
921 ELM_SAFE_FREE(sd->profile.available_list, free);
925 _elm_win_profile_del(Elm_Win_Smart_Data *sd)
927 ELM_SAFE_FREE(sd->profile.name, eina_stringshare_del);
931 _elm_win_profile_set(Elm_Win_Smart_Data *sd, const char *profile)
933 Eina_Bool changed = EINA_FALSE;
936 if (sd->profile.name)
938 if (strcmp(sd->profile.name, profile) != 0)
940 eina_stringshare_replace(&(sd->profile.name), profile);
946 sd->profile.name = eina_stringshare_add(profile);
951 _elm_win_profile_del(sd);
957 _elm_win_profile_update(Elm_Win_Smart_Data *sd)
959 if (sd->profile.available_list)
961 Eina_Bool found = EINA_FALSE;
962 if (sd->profile.name)
965 for (i = 0; i < sd->profile.count; i++)
967 if (!strcmp(sd->profile.name,
968 sd->profile.available_list[i]))
976 /* If current profile is not present in an available profiles,
977 * change current profile to the 1st element of an array.
980 _elm_win_profile_set(sd, sd->profile.available_list[0]);
983 _elm_config_profile_set(sd->profile.name);
987 Eina_List *sub, *l = NULL;
989 sub = ecore_evas_sub_ecore_evas_list_get(sd->ee);
990 EINA_LIST_FOREACH(sub, l, ee2)
991 ecore_evas_window_profile_set(ee2, sd->profile.name);
993 evas_object_smart_callback_call(sd->obj, SIG_PROFILE_CHANGED, NULL);
997 _elm_win_state_change(Ecore_Evas *ee)
999 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1001 Eina_Bool ch_withdrawn = EINA_FALSE;
1002 Eina_Bool ch_sticky = EINA_FALSE;
1003 Eina_Bool ch_iconified = EINA_FALSE;
1004 Eina_Bool ch_fullscreen = EINA_FALSE;
1005 Eina_Bool ch_maximized = EINA_FALSE;
1006 Eina_Bool ch_profile = EINA_FALSE;
1007 Eina_Bool ch_wm_rotation = EINA_FALSE;
1008 const char *profile;
1014 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
1016 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
1017 ch_withdrawn = EINA_TRUE;
1019 if (sd->sticky != ecore_evas_sticky_get(sd->ee))
1021 sd->sticky = ecore_evas_sticky_get(sd->ee);
1022 ch_sticky = EINA_TRUE;
1024 if (sd->iconified != ecore_evas_iconified_get(sd->ee))
1026 sd->iconified = ecore_evas_iconified_get(sd->ee);
1027 ch_iconified = EINA_TRUE;
1029 if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee))
1031 sd->fullscreen = ecore_evas_fullscreen_get(sd->ee);
1032 ch_fullscreen = EINA_TRUE;
1034 if (sd->maximized != ecore_evas_maximized_get(sd->ee))
1036 sd->maximized = ecore_evas_maximized_get(sd->ee);
1037 ch_maximized = EINA_TRUE;
1040 profile = ecore_evas_window_profile_get(sd->ee);
1041 ch_profile = _elm_win_profile_set(sd, profile);
1045 if (sd->rot != ecore_evas_rotation_get(sd->ee))
1047 sd->rot = ecore_evas_rotation_get(sd->ee);
1048 ch_wm_rotation = EINA_TRUE;
1052 _elm_win_state_eval_queue();
1054 if ((ch_withdrawn) || (ch_iconified))
1057 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL);
1058 else if (sd->iconified)
1059 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL);
1061 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL);
1066 evas_object_smart_callback_call(obj, SIG_STICK, NULL);
1068 evas_object_smart_callback_call(obj, SIG_UNSTICK, NULL);
1073 evas_object_smart_callback_call(obj, SIG_FULLSCREEN, NULL);
1075 evas_object_smart_callback_call(obj, SIG_UNFULLSCREEN, NULL);
1080 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL);
1082 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL);
1086 _elm_win_profile_update(sd);
1090 evas_object_size_hint_min_set(obj, -1, -1);
1091 evas_object_size_hint_max_set(obj, -1, -1);
1092 #ifdef HAVE_ELEMENTARY_X
1093 _elm_win_xwin_update(sd);
1095 elm_widget_orientation_set(obj, sd->rot);
1096 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
1097 evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
1102 _elm_win_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1104 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1109 _elm_win_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1111 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
1112 Evas_Object **next = va_arg(*list, Evas_Object **);
1113 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1114 if (ret) *ret = EINA_FALSE;
1116 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1118 const Eina_List *items;
1119 void *(*list_data_get)(const Eina_List *list);
1124 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1126 items = wd->subobjs;
1130 list_data_get = eina_list_data_get;
1132 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
1136 if (ret) *ret = EINA_TRUE;
1140 *next = (Evas_Object *)obj;
1145 _elm_win_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1147 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1152 _elm_win_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1154 const Evas_Object *base = va_arg(*list, Evas_Object *);
1155 double degree = va_arg(*list, double);
1156 Evas_Object **direction = va_arg(*list, Evas_Object **);
1157 double *weight = va_arg(*list, double *);
1158 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1159 if (ret) *ret = EINA_FALSE;
1160 Eina_Bool int_ret = EINA_FALSE;
1162 const Eina_List *items;
1163 void *(*list_data_get)(const Eina_List *list);
1165 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1170 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1171 items = wd->subobjs;
1173 list_data_get = eina_list_data_get;
1175 int_ret = elm_widget_focus_list_direction_get
1176 (obj, base, items, list_data_get, degree, direction, weight);
1177 if (ret) *ret = int_ret;
1182 _elm_win_smart_on_focus(Eo *obj, void *_pd, va_list *list)
1184 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1185 if (ret) *ret = EINA_TRUE;
1186 Elm_Win_Smart_Data *sd = _pd;
1187 Eina_Bool int_ret = EINA_FALSE;
1189 eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
1190 if (!int_ret) return;
1193 evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));
1195 evas_object_focus_set(obj, elm_widget_focus_get(obj));
1199 _elm_win_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1201 Evas_Object *src = va_arg(*list, Evas_Object *);
1202 Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
1203 Evas_Event_Key_Down *ev = va_arg(*list, void *);
1204 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1206 if (ret) *ret = EINA_FALSE;
1209 if (elm_widget_disabled_get(obj)) return;
1210 if (type != EVAS_CALLBACK_KEY_DOWN) return;
1212 if ((!strcmp(ev->key, "Tab")) ||
1213 (!strcmp(ev->key, "ISO_Left_Tab")))
1215 if (evas_key_modifier_is_set(ev->modifiers, "Control") ||
1216 evas_key_modifier_is_set(ev->modifiers, "Alt"))
1218 if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
1219 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1221 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1225 else if ((!strcmp(ev->key, "Left")) ||
1226 ((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
1228 elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
1232 else if ((!strcmp(ev->key, "Right")) ||
1233 ((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
1235 elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
1239 else if ((!strcmp(ev->key, "Up")) ||
1240 ((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
1242 elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
1246 else if ((!strcmp(ev->key, "Down")) ||
1247 ((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
1249 elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
1257 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1258 if (ret) *ret = EINA_TRUE;
1262 _deferred_ecore_evas_free(void *data)
1264 ecore_evas_free(data);
1265 _elm_win_deferred_free--;
1269 _elm_win_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1271 Elm_Win_Smart_Data *sd = _pd;
1273 if (!evas_object_visible_get(obj))
1274 _elm_win_state_eval_queue();
1275 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
1279 if (sd->shot.info) _shot_handle(sd);
1283 _elm_win_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1285 Elm_Win_Smart_Data *sd = _pd;
1287 if (evas_object_visible_get(obj))
1288 _elm_win_state_eval_queue();
1289 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
1295 evas_object_hide(sd->frame_obj);
1299 evas_object_hide(sd->img_obj);
1301 if (sd->pointer.obj)
1303 evas_object_hide(sd->pointer.obj);
1304 ecore_evas_hide(sd->pointer.ee);
1309 _elm_win_on_parent_del(void *data,
1310 Evas *e EINA_UNUSED,
1312 void *event_info EINA_UNUSED)
1314 ELM_WIN_DATA_GET(data, sd);
1316 if (obj == sd->parent) sd->parent = NULL;
1320 _elm_win_focus_target_move(void *data,
1321 Evas *e EINA_UNUSED,
1322 Evas_Object *obj EINA_UNUSED,
1323 void *event_info EINA_UNUSED)
1325 ELM_WIN_DATA_GET(data, sd);
1327 sd->focus_highlight.geometry_changed = EINA_TRUE;
1328 _elm_win_focus_highlight_reconfigure_job_start(sd);
1332 _elm_win_focus_target_resize(void *data,
1333 Evas *e EINA_UNUSED,
1334 Evas_Object *obj EINA_UNUSED,
1335 void *event_info EINA_UNUSED)
1337 ELM_WIN_DATA_GET(data, sd);
1339 sd->focus_highlight.geometry_changed = EINA_TRUE;
1340 _elm_win_focus_highlight_reconfigure_job_start(sd);
1344 _elm_win_focus_target_del(void *data,
1345 Evas *e EINA_UNUSED,
1346 Evas_Object *obj EINA_UNUSED,
1347 void *event_info EINA_UNUSED)
1349 ELM_WIN_DATA_GET(data, sd);
1351 sd->focus_highlight.cur.target = NULL;
1353 _elm_win_focus_highlight_reconfigure_job_start(sd);
1356 static Evas_Object *
1357 _elm_win_focus_target_get(Evas_Object *obj)
1359 Evas_Object *o = obj;
1363 if (elm_widget_is(o))
1365 if (!elm_widget_highlight_ignore_get(o))
1367 o = elm_widget_parent_get(o);
1369 o = evas_object_smart_parent_get(o);
1373 o = elm_widget_parent_widget_get(o);
1375 o = evas_object_smart_parent_get(o);
1384 _elm_win_focus_target_callbacks_add(Elm_Win_Smart_Data *sd)
1386 Evas_Object *obj = sd->focus_highlight.cur.target;
1389 evas_object_event_callback_add
1390 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1391 evas_object_event_callback_add
1392 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1393 evas_object_event_callback_add
1394 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1398 _elm_win_focus_target_callbacks_del(Elm_Win_Smart_Data *sd)
1400 Evas_Object *obj = sd->focus_highlight.cur.target;
1402 evas_object_event_callback_del_full
1403 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1404 evas_object_event_callback_del_full
1405 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1406 evas_object_event_callback_del_full
1407 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1411 _elm_win_object_focus_in(void *data,
1412 Evas *e EINA_UNUSED,
1415 Evas_Object *obj = event_info, *target;
1416 ELM_WIN_DATA_GET(data, sd);
1418 if (sd->focus_highlight.cur.target == obj)
1421 target = _elm_win_focus_target_get(obj);
1422 sd->focus_highlight.cur.target = target;
1423 if (target && elm_widget_highlight_in_theme_get(target))
1424 sd->focus_highlight.cur.in_theme = EINA_TRUE;
1426 _elm_win_focus_target_callbacks_add(sd);
1428 _elm_win_focus_highlight_reconfigure_job_start(sd);
1432 _elm_win_object_focus_out(void *data,
1433 Evas *e EINA_UNUSED,
1434 void *event_info EINA_UNUSED)
1436 ELM_WIN_DATA_GET(data, sd);
1438 if (!sd->focus_highlight.cur.target)
1441 if (!sd->focus_highlight.cur.in_theme)
1442 _elm_win_focus_target_callbacks_del(sd);
1444 sd->focus_highlight.cur.target = NULL;
1445 sd->focus_highlight.cur.in_theme = EINA_FALSE;
1447 _elm_win_focus_highlight_reconfigure_job_start(sd);
1451 _elm_win_focus_highlight_shutdown(Elm_Win_Smart_Data *sd)
1453 _elm_win_focus_highlight_reconfigure_job_stop(sd);
1454 if (sd->focus_highlight.cur.target)
1456 elm_widget_signal_emit(sd->focus_highlight.cur.target,
1457 "elm,action,focus_highlight,hide", "elm");
1458 _elm_win_focus_target_callbacks_del(sd);
1459 sd->focus_highlight.cur.target = NULL;
1461 ELM_SAFE_FREE(sd->focus_highlight.fobj, evas_object_del);
1463 evas_event_callback_del_full
1464 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1465 _elm_win_object_focus_in, sd->obj);
1466 evas_event_callback_del_full
1467 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1468 _elm_win_object_focus_out, sd->obj);
1472 _elm_win_on_img_obj_del(void *data,
1473 Evas *e EINA_UNUSED,
1474 Evas_Object *obj EINA_UNUSED,
1475 void *event_info EINA_UNUSED)
1477 ELM_WIN_DATA_GET(data, sd);
1482 _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1484 Elm_Win_Smart_Data *sd = _pd;
1486 evas_object_event_callback_del_full(sd->layout,
1487 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1488 _elm_win_on_resize_obj_changed_size_hints,
1490 evas_object_del(sd->box);
1491 evas_object_del(sd->layout);
1493 /* NB: child deletion handled by parent's smart del */
1495 if ((trap) && (trap->del))
1496 trap->del(sd->trap_data, obj);
1500 evas_object_event_callback_del_full
1501 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
1505 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1507 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1509 _elm_win_state_eval_queue();
1513 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1514 ecore_evas_callback_resize_set(sd->ee, NULL);
1517 ecore_job_del(sd->deferred_resize_job);
1518 ecore_job_del(sd->deferred_child_eval_job);
1519 eina_stringshare_del(sd->shot.info);
1520 ecore_timer_del(sd->shot.timer);
1522 #ifdef HAVE_ELEMENTARY_X
1523 ecore_event_handler_del(sd->x.client_message_handler);
1524 ecore_event_handler_del(sd->x.property_handler);
1529 evas_object_event_callback_del_full
1530 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1537 ecore_job_add(_deferred_ecore_evas_free, sd->ee);
1538 _elm_win_deferred_free++;
1542 _elm_win_focus_highlight_shutdown(sd);
1543 eina_stringshare_del(sd->focus_highlight.style);
1545 eina_stringshare_del(sd->title);
1546 eina_stringshare_del(sd->icon_name);
1547 eina_stringshare_del(sd->role);
1548 evas_object_del(sd->icon);
1549 evas_object_del(sd->main_menu);
1551 _elm_win_profile_del(sd);
1552 _elm_win_available_profiles_del(sd);
1554 /* Don't let callback in the air that point to sd */
1555 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1556 ecore_evas_callback_resize_set(sd->ee, NULL);
1557 ecore_evas_callback_mouse_in_set(sd->ee, NULL);
1558 ecore_evas_callback_focus_in_set(sd->ee, NULL);
1559 ecore_evas_callback_focus_out_set(sd->ee, NULL);
1560 ecore_evas_callback_move_set(sd->ee, NULL);
1561 ecore_evas_callback_state_change_set(sd->ee, NULL);
1563 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1565 if ((!_elm_win_list) &&
1566 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
1568 edje_file_cache_flush();
1569 edje_collection_cache_flush();
1570 evas_image_cache_flush(evas_object_evas_get(obj));
1571 evas_font_cache_flush(evas_object_evas_get(obj));
1577 _elm_win_obj_intercept_show(void *data,
1580 ELM_WIN_DATA_GET(data, sd);
1582 // this is called to make sure all smart containers have calculated their
1583 // sizes BEFORE we show the window to make sure it initially appears at
1584 // our desired size (ie min size is known first)
1585 evas_smart_objects_calculate(evas_object_evas_get(obj));
1588 evas_object_show(sd->frame_obj);
1592 evas_object_show(sd->img_obj);
1594 if (sd->pointer.obj)
1596 ecore_evas_show(sd->pointer.ee);
1597 evas_object_show(sd->pointer.obj);
1599 evas_object_show(obj);
1603 _elm_win_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1605 Evas_Coord x = va_arg(*list, Evas_Coord);
1606 Evas_Coord y = va_arg(*list, Evas_Coord);
1607 Elm_Win_Smart_Data *sd = _pd;
1611 if ((x != sd->screen.x) || (y != sd->screen.y))
1615 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1621 TRAP(sd, move, x, y);
1622 if (!ecore_evas_override_get(sd->ee)) return;
1625 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
1627 if (ecore_evas_override_get(sd->ee))
1631 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1635 /* FIXME: We should update ecore_wl_window_location here !! */
1647 _elm_win_smart_resize(Eo *obj, void *_pd, va_list *list)
1649 Evas_Coord w = va_arg(*list, Evas_Coord);
1650 Evas_Coord h = va_arg(*list, Evas_Coord);
1652 Elm_Win_Smart_Data *sd = _pd;
1654 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
1662 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
1669 evas_object_image_size_set(sd->img_obj, w, h);
1672 TRAP(sd, resize, w, h);
1676 _elm_win_delete_request(Ecore_Evas *ee)
1678 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1685 int autodel = sd->autodel;
1686 sd->autodel_clear = &autodel;
1687 evas_object_ref(obj);
1688 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL);
1689 // FIXME: if above callback deletes - then the below will be invalid
1690 if (autodel) evas_object_del(obj);
1691 else sd->autodel_clear = NULL;
1692 evas_object_unref(obj);
1696 _elm_ee_xwin_get(const Ecore_Evas *ee)
1698 #ifdef HAVE_ELEMENTARY_X
1699 const char *engine_name;
1702 engine_name = ecore_evas_engine_name_get(ee);
1703 if (EINA_UNLIKELY(!engine_name)) return 0;
1705 if (!strcmp(engine_name, ELM_SOFTWARE_X11))
1707 return ecore_evas_software_x11_window_get(ee);
1709 else if (!strcmp(engine_name, ELM_OPENGL_X11))
1711 return ecore_evas_gl_x11_window_get(ee);
1713 else if (!strcmp(engine_name, ELM_SOFTWARE_WIN32))
1715 return (long)ecore_evas_win32_window_get(ee);
1721 #ifdef HAVE_ELEMENTARY_X
1723 _elm_win_xwindow_get(Elm_Win_Smart_Data *sd)
1725 sd->x.xwin = _elm_ee_xwin_get(sd->ee);
1730 _elm_ee_wlwin_get(const Ecore_Evas *ee)
1732 #ifdef HAVE_ELEMENTARY_WAYLAND
1733 const char *engine_name;
1735 if (!ee) return NULL;
1737 engine_name = ecore_evas_engine_name_get(ee);
1738 if (EINA_UNLIKELY(!engine_name)) return NULL;
1740 if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
1741 (!strcmp(engine_name, ELM_WAYLAND_EGL)))
1743 return ecore_evas_wayland_window_get(ee);
1751 #ifdef HAVE_ELEMENTARY_WAYLAND
1753 _elm_win_wlwindow_get(Elm_Win_Smart_Data *sd)
1755 sd->wl.win = _elm_ee_wlwin_get(sd->ee);
1759 #ifdef HAVE_ELEMENTARY_X
1761 _elm_win_xwin_update(Elm_Win_Smart_Data *sd)
1765 _elm_win_xwindow_get(sd);
1768 ELM_WIN_DATA_GET(sd->parent, sdp);
1772 ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin);
1776 if (!sd->x.xwin) return; /* nothing more to do */
1779 if (!s) s = _elm_appname;
1781 if (sd->icon_name) s = sd->icon_name;
1782 ecore_x_icccm_icon_name_set(sd->x.xwin, s);
1783 ecore_x_netwm_icon_name_set(sd->x.xwin, s);
1786 if (s) ecore_x_icccm_window_role_set(sd->x.xwin, s);
1793 data = evas_object_image_data_get(sd->icon, EINA_FALSE);
1797 int w = 0, h = 0, stride, x, y;
1801 evas_object_image_size_get(sd->icon, &w, &h);
1802 stride = evas_object_image_stride_get(sd->icon);
1803 if ((w > 0) && (h > 0) &&
1804 (stride >= (int)(w * sizeof(unsigned int))))
1808 ic.data = malloc(w * h * sizeof(unsigned int));
1812 p = (unsigned char *)data;
1813 p2 = (unsigned int *)ic.data;
1814 for (y = 0; y < h; y++)
1816 for (x = 0; x < w; x++)
1818 *p2 = *((unsigned int *)p);
1819 p += sizeof(unsigned int);
1822 p += (stride - (w * sizeof(unsigned int)));
1824 ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
1828 evas_object_image_data_set(sd->icon, data);
1835 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_NORMAL);
1838 case ELM_WIN_DIALOG_BASIC:
1839 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DIALOG);
1842 case ELM_WIN_DESKTOP:
1843 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
1847 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DOCK);
1850 case ELM_WIN_TOOLBAR:
1851 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
1855 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_MENU);
1858 case ELM_WIN_UTILITY:
1859 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_UTILITY);
1862 case ELM_WIN_SPLASH:
1863 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_SPLASH);
1866 case ELM_WIN_DROPDOWN_MENU:
1867 ecore_x_netwm_window_type_set
1868 (sd->x.xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
1871 case ELM_WIN_POPUP_MENU:
1872 ecore_x_netwm_window_type_set
1873 (sd->x.xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
1876 case ELM_WIN_TOOLTIP:
1877 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
1880 case ELM_WIN_NOTIFICATION:
1881 ecore_x_netwm_window_type_set
1882 (sd->x.xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
1886 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_COMBO);
1890 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DND);
1896 ecore_x_e_virtual_keyboard_state_set
1897 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
1898 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
1899 ecore_x_e_illume_indicator_state_set
1900 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
1901 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
1902 ecore_x_e_illume_indicator_state_set
1903 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
1911 * Resize the window according to window layout's min and weight.
1912 * If the window layout's weight is 0.0, the window max is limited to layout's
1915 * This is called when the window layout's weight hint is changed or when the
1916 * window is rotated.
1918 * @param obj window object
1921 _elm_win_resize_objects_eval(Evas_Object *obj)
1923 ELM_WIN_DATA_GET(obj, sd);
1924 Evas_Coord w, h, minw, minh, maxw, maxh;
1927 evas_object_size_hint_min_get(sd->layout, &minw, &minh);
1928 if (minw < 1) minw = 1;
1929 if (minh < 1) minh = 1;
1931 evas_object_size_hint_weight_get(sd->layout, &wx, &wy);
1932 if (!wx) maxw = minw;
1934 if (!wy) maxh = minh;
1937 evas_object_size_hint_min_set(obj, minw, minh);
1938 evas_object_size_hint_max_set(obj, maxw, maxh);
1939 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1940 if (w < minw) w = minw;
1941 if (h < minh) h = minh;
1942 if (w > maxw) w = maxw;
1943 if (h > maxh) h = maxh;
1944 evas_object_move(obj, 0, 0);
1945 evas_object_resize(obj, w, h);
1949 _elm_win_on_resize_obj_changed_size_hints(void *data,
1950 Evas *e EINA_UNUSED,
1951 Evas_Object *obj EINA_UNUSED,
1952 void *event_info EINA_UNUSED)
1954 _elm_win_resize_objects_eval(data);
1958 _elm_win_shutdown(void)
1960 while (_elm_win_list) evas_object_del(_elm_win_list->data);
1961 ELM_SAFE_FREE(_elm_win_state_eval_job, ecore_job_del);
1965 _elm_win_rescale(Elm_Theme *th,
1966 Eina_Bool use_theme)
1973 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1974 elm_widget_theme(obj);
1978 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1979 elm_widget_theme_specific(obj, th, EINA_FALSE);
1984 _elm_win_access(Eina_Bool is_access)
1991 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1993 elm_widget_access(obj, is_access);
1995 /* floating orphan object. if there are A, B, C objects and user does
1996 as below, then there would be floating orphan objects.
1998 1. elm_object_content_set(layout, A);
1999 2. elm_object_content_set(layout, B);
2000 3. elm_object_content_set(layout, C);
2002 now, the object A and B are floating orphan objects */
2007 fobj = evas_object_below_get(fobj);
2010 if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
2012 elm_widget_access(fobj, is_access);
2018 evas = evas_object_evas_get(obj);
2019 if (evas) _elm_access_object_highlight_disable(evas);
2025 _elm_win_translate(void)
2030 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2031 elm_widget_translate(obj);
2034 #ifdef HAVE_ELEMENTARY_X
2036 _elm_win_client_message(void *data,
2037 int type EINA_UNUSED,
2040 ELM_WIN_DATA_GET(data, sd);
2041 Ecore_X_Event_Client_Message *e = event;
2043 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
2044 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
2046 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2048 Evas *evas = evas_object_evas_get(sd->obj);
2051 edje_file_cache_flush();
2052 edje_collection_cache_flush();
2053 evas_image_cache_flush(evas);
2054 evas_font_cache_flush(evas);
2058 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
2060 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2062 Evas *evas = evas_object_evas_get(sd->obj);
2065 edje_file_cache_flush();
2066 edje_collection_cache_flush();
2067 evas_image_cache_flush(evas);
2068 evas_font_cache_flush(evas);
2069 evas_render_dump(evas);
2073 else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
2075 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2077 if ((unsigned int)e->data.l[1] ==
2078 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
2080 // XXX: call right access func
2082 else if ((unsigned int)e->data.l[1] ==
2083 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV)
2085 // XXX: call right access func
2087 else if ((unsigned int)e->data.l[1] ==
2088 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
2090 _elm_access_highlight_object_activate
2091 (sd->obj, ELM_ACTIVATE_DEFAULT);
2093 else if ((unsigned int)e->data.l[1] ==
2094 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
2096 /* there would be better way to read highlight object */
2098 evas = evas_object_evas_get(sd->obj);
2099 if (!evas) return ECORE_CALLBACK_PASS_ON;
2101 _elm_access_mouse_event_enabled_set(EINA_TRUE);
2103 evas_event_feed_mouse_in(evas, 0, NULL);
2104 evas_event_feed_mouse_move
2105 (evas, e->data.l[2], e->data.l[3], 0, NULL);
2107 _elm_access_mouse_event_enabled_set(EINA_FALSE);
2109 else if ((unsigned int)e->data.l[1] ==
2110 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
2112 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
2114 else if ((unsigned int)e->data.l[1] ==
2115 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
2117 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
2119 else if ((unsigned int)e->data.l[1] ==
2120 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
2122 _elm_access_highlight_object_activate
2123 (sd->obj, ELM_ACTIVATE_UP);
2125 else if ((unsigned int)e->data.l[1] ==
2126 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
2128 _elm_access_highlight_object_activate
2129 (sd->obj, ELM_ACTIVATE_DOWN);
2133 return ECORE_CALLBACK_PASS_ON;
2137 _elm_win_property_change(void *data,
2138 int type EINA_UNUSED,
2141 ELM_WIN_DATA_GET(data, sd);
2142 Ecore_X_Event_Window_Property *e = event;
2144 if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE)
2146 if (e->win == sd->x.xwin)
2148 sd->indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win);
2149 evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
2152 return ECORE_CALLBACK_PASS_ON;
2157 _elm_win_focus_highlight_hide(void *data EINA_UNUSED,
2159 const char *emission EINA_UNUSED,
2160 const char *source EINA_UNUSED)
2162 evas_object_hide(obj);
2166 _elm_win_focus_highlight_anim_end(void *data,
2168 const char *emission EINA_UNUSED,
2169 const char *source EINA_UNUSED)
2171 ELM_WIN_DATA_GET(data, sd);
2173 _elm_win_focus_highlight_simple_setup(sd, obj);
2177 _elm_win_focus_highlight_init(Elm_Win_Smart_Data *sd)
2179 evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
2180 _elm_win_object_focus_in, sd->obj);
2181 evas_event_callback_add(sd->evas,
2182 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
2183 _elm_win_object_focus_out, sd->obj);
2185 sd->focus_highlight.cur.target = evas_focus_get(sd->evas);
2186 sd->focus_highlight.fobj = edje_object_add(sd->evas);
2187 sd->focus_highlight.theme_changed = EINA_TRUE;
2189 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2190 "elm,action,focus,hide,end", "*",
2191 _elm_win_focus_highlight_hide, NULL);
2192 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2193 "elm,action,focus,anim,end", "*",
2194 _elm_win_focus_highlight_anim_end, sd->obj);
2195 _elm_win_focus_highlight_reconfigure_job_start(sd);
2199 _elm_win_frame_cb_move_start(void *data,
2200 Evas_Object *obj EINA_UNUSED,
2201 const char *sig EINA_UNUSED,
2204 ELM_WIN_DATA_GET(data, sd);
2208 #ifdef HAVE_ELEMENTARY_WAYLAND
2209 if (!strcmp(source, "elm"))
2210 ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_HAND1);
2212 ecore_wl_window_cursor_default_restore(sd->wl.win);
2217 /* FIXME: Change mouse pointer */
2219 /* NB: Wayland handles moving surfaces by itself so we cannot
2220 * specify a specific x/y we want. Instead, we will pass in the
2221 * existing x/y values so they can be recorded as 'previous'
2222 * position. The new position will get updated automatically when
2223 * the move is finished */
2225 ecore_evas_wayland_move(sd->ee, sd->screen.x, sd->screen.y);
2229 _elm_win_frame_cb_move_stop(void *data,
2230 Evas_Object *obj EINA_UNUSED,
2231 const char *sig EINA_UNUSED,
2232 const char *source EINA_UNUSED)
2234 ELM_WIN_DATA_GET(data, sd);
2238 #ifdef HAVE_ELEMENTARY_WAYLAND
2239 ecore_wl_window_cursor_default_restore(sd->wl.win);
2243 #ifdef HAVE_ELEMENTARY_WAYLAND
2250 static struct _resize_info _border_side[4] =
2252 { ELM_CURSOR_TOP_SIDE, 1 },
2253 { ELM_CURSOR_LEFT_SIDE, 4 },
2254 { ELM_CURSOR_BOTTOM_SIDE, 2 },
2255 { ELM_CURSOR_RIGHT_SIDE, 8 },
2258 static struct _resize_info _border_corner[4] =
2260 { ELM_CURSOR_TOP_LEFT_CORNER, 5 },
2261 { ELM_CURSOR_BOTTOM_LEFT_CORNER, 6 },
2262 { ELM_CURSOR_BOTTOM_RIGHT_CORNER, 10 },
2263 { ELM_CURSOR_TOP_RIGHT_CORNER, 9 },
2268 _elm_win_frame_obj_update(Elm_Win_Smart_Data *sd)
2274 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
2275 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2276 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2278 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2280 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2281 (w != (fw - ow)) || (h != (fh - oh)))
2283 evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
2284 (fw - ow), (fh - oh));
2287 #ifdef HAVE_ELEMENTARY_WAYLAND
2288 ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
2293 _elm_win_frame_obj_move(void *data,
2294 Evas *e EINA_UNUSED,
2295 Evas_Object *obj EINA_UNUSED,
2296 void *event_info EINA_UNUSED)
2298 Elm_Win_Smart_Data *sd;
2300 if (!(sd = data)) return;
2301 if (!sd->client_obj) return;
2303 _elm_win_frame_obj_update(sd);
2307 _elm_win_frame_obj_resize(void *data,
2308 Evas *e EINA_UNUSED,
2309 Evas_Object *obj EINA_UNUSED,
2310 void *event_info EINA_UNUSED)
2312 Elm_Win_Smart_Data *sd;
2314 if (!(sd = data)) return;
2315 if (!sd->client_obj) return;
2317 _elm_win_frame_obj_update(sd);
2321 _elm_win_frame_cb_resize_show(void *data,
2322 Evas_Object *obj EINA_UNUSED,
2323 const char *sig EINA_UNUSED,
2326 ELM_WIN_DATA_GET(data, sd);
2329 if (sd->resizing) return;
2331 #ifdef HAVE_ELEMENTARY_WAYLAND
2334 if (!strcmp(source, "elm.event.resize.t"))
2335 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2336 _border_side[(0 + i) % 4].name);
2337 else if (!strcmp(source, "elm.event.resize.b"))
2338 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2339 _border_side[(2 + i) % 4].name);
2340 else if (!strcmp(source, "elm.event.resize.l"))
2341 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2342 _border_side[(1 + i) % 4].name);
2343 else if (!strcmp(source, "elm.event.resize.r"))
2344 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2345 _border_side[(3 + i) % 4].name);
2346 else if (!strcmp(source, "elm.event.resize.tl"))
2347 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2348 _border_corner[(0 + i) % 4].name);
2349 else if (!strcmp(source, "elm.event.resize.tr"))
2350 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2351 _border_corner[(3 + i) % 4].name);
2352 else if (!strcmp(source, "elm.event.resize.bl"))
2353 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2354 _border_corner[(1 + i) % 4].name);
2355 else if (!strcmp(source, "elm.event.resize.br"))
2356 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2357 _border_corner[(2 + i) % 4].name);
2359 ecore_wl_window_cursor_default_restore(sd->wl.win);
2366 _elm_win_frame_cb_resize_hide(void *data,
2367 Evas_Object *obj EINA_UNUSED,
2368 const char *sig EINA_UNUSED,
2369 const char *source EINA_UNUSED)
2371 ELM_WIN_DATA_GET(data, sd);
2374 if (sd->resizing) return;
2376 #ifdef HAVE_ELEMENTARY_WAYLAND
2377 ecore_wl_window_cursor_default_restore(sd->wl.win);
2382 _elm_win_frame_cb_resize_start(void *data,
2383 Evas_Object *obj EINA_UNUSED,
2384 const char *sig EINA_UNUSED,
2387 #ifdef HAVE_ELEMENTARY_WAYLAND
2388 ELM_WIN_DATA_GET(data, sd);
2392 if (sd->resizing) return;
2394 sd->resizing = EINA_TRUE;
2396 if (!strcmp(source, "elm.event.resize.t"))
2397 sd->resize_location = _border_side[(0 + i) % 4].location;
2398 else if (!strcmp(source, "elm.event.resize.b"))
2399 sd->resize_location = _border_side[(2 + i) % 4].location;
2400 else if (!strcmp(source, "elm.event.resize.l"))
2401 sd->resize_location = _border_side[(1 + i) % 4].location;
2402 else if (!strcmp(source, "elm.event.resize.r"))
2403 sd->resize_location = _border_side[(3 + i) % 4].location;
2404 else if (!strcmp(source, "elm.event.resize.tl"))
2405 sd->resize_location = _border_corner[(0 + i) % 4].location;
2406 else if (!strcmp(source, "elm.event.resize.tr"))
2407 sd->resize_location = _border_corner[(3 + i) % 4].location;
2408 else if (!strcmp(source, "elm.event.resize.bl"))
2409 sd->resize_location = _border_corner[(1 + i) % 4].location;
2410 else if (!strcmp(source, "elm.event.resize.br"))
2411 sd->resize_location = _border_corner[(2 + i) % 4].location;
2413 sd->resize_location = 0;
2415 if (sd->resize_location > 0)
2416 ecore_evas_wayland_resize(sd->ee, sd->resize_location);
2424 _elm_win_frame_cb_minimize(void *data,
2425 Evas_Object *obj EINA_UNUSED,
2426 const char *sig EINA_UNUSED,
2427 const char *source EINA_UNUSED)
2429 ELM_WIN_DATA_GET(data, sd);
2432 // sd->iconified = EINA_TRUE;
2433 TRAP(sd, iconified_set, EINA_TRUE);
2437 _elm_win_frame_maximized_state_update(Elm_Win_Smart_Data *sd, Eina_Bool maximized)
2439 const char *emission;
2442 emission = "elm,state,maximized";
2444 emission = "elm,state,unmaximized";
2446 edje_object_signal_emit(sd->frame_obj, emission, "elm");
2447 edje_object_message_signal_process(sd->frame_obj);
2448 evas_object_smart_calculate(sd->frame_obj);
2450 _elm_win_frame_obj_update(sd);
2454 _elm_win_frame_cb_maximize(void *data,
2455 Evas_Object *obj EINA_UNUSED,
2456 const char *sig EINA_UNUSED,
2457 const char *source EINA_UNUSED)
2460 ELM_WIN_DATA_GET(data, sd);
2463 if (sd->maximized) value = EINA_FALSE;
2464 else value = EINA_TRUE;
2466 _elm_win_frame_maximized_state_update(sd, value);
2468 TRAP(sd, maximized_set, value);
2472 _elm_win_frame_cb_close(void *data,
2473 Evas_Object *obj EINA_UNUSED,
2474 const char *sig EINA_UNUSED,
2475 const char *source EINA_UNUSED)
2477 ELM_WIN_DATA_GET(data, sd);
2480 /* FIXME: After the current freeze, this should be handled differently.
2482 * Ideally, we would want to mimic the X11 backend and use something
2483 * like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
2484 * inside of ecore_evas. That would be the 'proper' way, but since we are
2485 * in a freeze right now, I cannot add a new event value, or a new
2486 * event structure to ecore_wayland.
2488 * So yes, this is a temporary 'stop-gap' solution which will be fixed
2489 * when the freeze is over, but it does fix a trac bug for now, and in a
2490 * way which does not break API or the freeze. - dh
2497 int autodel = sd->autodel;
2498 sd->autodel_clear = &autodel;
2499 evas_object_ref(win);
2500 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
2501 // FIXME: if above callback deletes - then the below will be invalid
2502 if (autodel) evas_object_del(win);
2503 else sd->autodel_clear = NULL;
2504 evas_object_unref(win);
2508 _elm_win_frame_add(Elm_Win_Smart_Data *sd,
2511 Evas_Object *obj = sd->obj;
2515 sd->frame_obj = edje_object_add(sd->evas);
2516 layer = evas_object_layer_get(obj);
2517 evas_object_layer_set(sd->frame_obj, layer + 1);
2518 if (!elm_widget_theme_object_set
2519 (sd->obj, sd->frame_obj, "border", "base", style))
2521 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2525 sd->spacer_obj = evas_object_rectangle_add(sd->evas);
2526 evas_object_color_set(sd->spacer_obj, 0, 0, 0, 0);
2527 evas_object_repeat_events_set(sd->spacer_obj, EINA_TRUE);
2528 edje_object_part_swallow(sd->frame_obj, "elm.swallow.frame_spacer",
2531 sd->client_obj = evas_object_rectangle_add(sd->evas);
2532 evas_object_color_set(sd->client_obj, 0, 0, 0, 0);
2533 /* NB: Tried pass_events here, but that fails to send events */
2534 evas_object_repeat_events_set(sd->client_obj, EINA_TRUE);
2535 edje_object_part_swallow(sd->frame_obj, "elm.swallow.client",
2538 evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
2540 evas_object_event_callback_add
2541 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2542 evas_object_event_callback_add
2543 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2545 /* NB: Do NOT remove these calls !! Needed to calculate proper
2546 * framespace on inital show of the window */
2547 edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
2548 evas_object_move(sd->frame_obj, 0, 0);
2549 evas_object_resize(sd->frame_obj, mw, mh);
2550 evas_object_smart_calculate(sd->frame_obj);
2552 edje_object_signal_callback_add
2553 (sd->frame_obj, "elm,action,move,start", "elm",
2554 _elm_win_frame_cb_move_start, obj);
2555 edje_object_signal_callback_add
2556 (sd->frame_obj, "elm,action,move,stop", "elm",
2557 _elm_win_frame_cb_move_stop, obj);
2558 edje_object_signal_callback_add
2559 (sd->frame_obj, "elm,action,resize,show", "*",
2560 _elm_win_frame_cb_resize_show, obj);
2561 edje_object_signal_callback_add
2562 (sd->frame_obj, "elm,action,resize,hide", "*",
2563 _elm_win_frame_cb_resize_hide, obj);
2564 edje_object_signal_callback_add
2565 (sd->frame_obj, "elm,action,resize,start", "*",
2566 _elm_win_frame_cb_resize_start, obj);
2567 edje_object_signal_callback_add
2568 (sd->frame_obj, "elm,action,minimize", "elm",
2569 _elm_win_frame_cb_minimize, obj);
2570 edje_object_signal_callback_add
2571 (sd->frame_obj, "elm,action,maximize", "elm",
2572 _elm_win_frame_cb_maximize, obj);
2573 edje_object_signal_callback_add
2574 (sd->frame_obj, "elm,action,close", "elm", _elm_win_frame_cb_close, obj);
2578 edje_object_part_text_escaped_set
2579 (sd->frame_obj, "elm.text.title", sd->title);
2582 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2583 ecore_evas_resize(sd->ee, w, h);
2587 _elm_win_frame_del(Elm_Win_Smart_Data *sd)
2591 ELM_SAFE_FREE(sd->client_obj, evas_object_del);
2595 evas_object_event_callback_del_full
2596 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2597 evas_object_event_callback_del_full
2598 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2600 edje_object_signal_callback_del
2601 (sd->frame_obj, "elm,action,move,start", "elm",
2602 _elm_win_frame_cb_move_start);
2603 edje_object_signal_callback_del
2604 (sd->frame_obj, "elm,action,move,stop", "elm",
2605 _elm_win_frame_cb_move_stop);
2606 edje_object_signal_callback_del
2607 (sd->frame_obj, "elm,action,resize,show", "*",
2608 _elm_win_frame_cb_resize_show);
2609 edje_object_signal_callback_del
2610 (sd->frame_obj, "elm,action,resize,hide", "*",
2611 _elm_win_frame_cb_resize_hide);
2612 edje_object_signal_callback_del
2613 (sd->frame_obj, "elm,action,resize,start", "*",
2614 _elm_win_frame_cb_resize_start);
2615 edje_object_signal_callback_del
2616 (sd->frame_obj, "elm,action,minimize", "elm",
2617 _elm_win_frame_cb_minimize);
2618 edje_object_signal_callback_del
2619 (sd->frame_obj, "elm,action,maximize", "elm",
2620 _elm_win_frame_cb_maximize);
2621 edje_object_signal_callback_del
2622 (sd->frame_obj, "elm,action,close", "elm",
2623 _elm_win_frame_cb_close);
2625 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2628 evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
2629 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2630 ecore_evas_resize(sd->ee, w, h);
2635 _debug_key_down(void *data EINA_UNUSED,
2636 Evas *e EINA_UNUSED,
2640 Evas_Event_Key_Down *ev = event_info;
2642 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
2645 if ((strcmp(ev->key, "F12")) ||
2646 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
2649 INF("Tree graph generated.");
2650 elm_object_tree_dot_dump(obj, "./dump.dot");
2656 _win_img_hide(void *data,
2657 Evas *e EINA_UNUSED,
2658 Evas_Object *obj EINA_UNUSED,
2659 void *event_info EINA_UNUSED)
2661 elm_widget_focus_hide_handle(data);
2665 _win_img_mouse_up(void *data,
2666 Evas *e EINA_UNUSED,
2667 Evas_Object *obj EINA_UNUSED,
2670 Evas_Event_Mouse_Up *ev = event_info;
2671 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
2672 elm_widget_focus_mouse_up_handle(data);
2676 _win_img_focus_in(void *data,
2677 Evas *e EINA_UNUSED,
2678 Evas_Object *obj EINA_UNUSED,
2679 void *event_info EINA_UNUSED)
2681 elm_widget_focus_steal(data);
2685 _win_img_focus_out(void *data,
2686 Evas *e EINA_UNUSED,
2687 Evas_Object *obj EINA_UNUSED,
2688 void *event_info EINA_UNUSED)
2690 elm_widget_focused_object_clear(data);
2694 _win_inlined_image_set(Elm_Win_Smart_Data *sd)
2696 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);
2697 evas_object_image_filled_set(sd->img_obj, EINA_TRUE);
2699 evas_object_event_callback_add
2700 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, sd->obj);
2701 evas_object_event_callback_add
2702 (sd->img_obj, EVAS_CALLBACK_HIDE, _win_img_hide, sd->obj);
2703 evas_object_event_callback_add
2704 (sd->img_obj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, sd->obj);
2705 evas_object_event_callback_add
2706 (sd->img_obj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, sd->obj);
2707 evas_object_event_callback_add
2708 (sd->img_obj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, sd->obj);
2712 _elm_win_on_icon_del(void *data,
2713 Evas *e EINA_UNUSED,
2715 void *event_info EINA_UNUSED)
2717 ELM_WIN_DATA_GET(data, sd);
2719 if (sd->icon == obj) sd->icon = NULL;
2723 _elm_win_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
2725 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
2727 elm_widget_can_focus_set(obj, EINA_TRUE);
2729 elm_widget_highlight_ignore_set(obj, EINA_TRUE);
2732 #ifdef HAVE_ELEMENTARY_X
2734 _elm_x_io_err(void *data EINA_UNUSED)
2739 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2740 evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
2746 elm_win_add(Evas_Object *parent,
2750 Evas_Object *obj = eo_add_custom(MY_CLASS, parent, elm_obj_win_constructor(name, type));
2756 _elm_win_cb_hide(void *data EINA_UNUSED,
2757 Evas *e EINA_UNUSED,
2758 Evas_Object *obj EINA_UNUSED,
2759 void *event_info EINA_UNUSED)
2761 _elm_win_state_eval_queue();
2765 _elm_win_cb_show(void *data EINA_UNUSED,
2766 Evas *e EINA_UNUSED,
2767 Evas_Object *obj EINA_UNUSED,
2768 void *event_info EINA_UNUSED)
2770 _elm_win_state_eval_queue();
2776 * Recalculate the size of window considering its resize objects' weight and
2777 * min size. If any of its resize objects' weight equals to 0.0, window
2778 * layout's weight will be set to 0.0.
2780 * @param o box object
2781 * @param p box's private data
2782 * @param data window object
2785 _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
2789 Evas_Object_Box_Option *opt;
2790 Evas_Coord x, y, w, h;
2792 Evas_Coord minw = -1, minh = -1;
2793 double weight_x = EVAS_HINT_EXPAND;
2794 double weight_y = EVAS_HINT_EXPAND;
2796 EINA_LIST_FOREACH(p->children, l, opt)
2799 evas_object_size_hint_weight_get(child, &wx, &wy);
2800 if (wx == 0.0) weight_x = 0;
2801 if (wy == 0.0) weight_y = 0;
2803 evas_object_size_hint_min_get(child, &w, &h);
2804 if (w > minw) minw = w;
2805 if (h > minh) minh = h;
2808 evas_object_size_hint_min_set(o, minw, minh);
2809 evas_object_geometry_get(o, &x, &y, &w, &h);
2810 if (w < minw) w = minw;
2811 if (h < minh) h = minh;
2812 evas_object_resize(o, w, h);
2814 EINA_LIST_FOREACH(p->children, l, opt)
2817 evas_object_move(child, x, y);
2818 evas_object_resize(child, w, h);
2821 ELM_WIN_DATA_GET(data, sd);
2822 evas_object_size_hint_weight_set(sd->layout, weight_x, weight_y);
2823 evas_object_smart_changed(sd->layout);
2827 _win_constructor(Eo *obj, void *_pd, va_list *list)
2829 Elm_Win_Smart_Data *sd = _pd;
2830 sd->obj = obj; // in ctor
2832 const char *name = va_arg(*list, const char *);
2833 Elm_Win_Type type = va_arg(*list, Elm_Win_Type);
2834 Evas_Object *parent;
2837 const char *fontpath, *fallback = NULL;
2839 Elm_Win_Smart_Data tmp_sd;
2841 eo_do(obj, eo_parent_get(&parent));
2843 /* just to store some data while trying out to create a canvas */
2844 memset(&tmp_sd, 0, sizeof(Elm_Win_Smart_Data));
2846 #define FALLBACK_TRY(engine) \
2848 CRI(engine " engine creation failed. Trying default."); \
2850 #define FALLBACK_STORE(engine) \
2853 CRI(engine "Fallback to %s successful.", engine); \
2854 fallback = engine; \
2859 case ELM_WIN_INLINED_IMAGE:
2862 e = evas_object_evas_get(parent);
2867 ee = ecore_evas_ecore_evas_get(e);
2870 tmp_sd.img_obj = ecore_evas_object_image_new(ee);
2871 if (!tmp_sd.img_obj) break;
2873 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
2876 ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
2881 case ELM_WIN_SOCKET_IMAGE:
2882 tmp_sd.ee = ecore_evas_extn_socket_new(1, 1);
2886 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
2888 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2889 FALLBACK_TRY("Software X11");
2892 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2893 FALLBACK_STORE("Software FB");
2896 else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
2898 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2899 FALLBACK_TRY("Software FB");
2902 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2903 FALLBACK_STORE("Software X11");
2906 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
2911 if (_elm_config->vsync)
2913 opt[opt_i] = ECORE_EVAS_GL_X11_OPT_VSYNC;
2920 tmp_sd.ee = ecore_evas_gl_x11_options_new
2921 (NULL, 0, 0, 0, 1, 1, opt);
2923 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
2924 FALLBACK_TRY("OpenGL");
2927 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2928 FALLBACK_STORE("Software X11");
2931 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2932 FALLBACK_STORE("Software FB");
2936 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
2938 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
2939 FALLBACK_TRY("Software Win32");
2941 else if (ENGINE_COMPARE(ELM_SOFTWARE_PSL1GHT))
2943 tmp_sd.ee = ecore_evas_psl1ght_new(NULL, 1, 1);
2944 FALLBACK_TRY("PSL1GHT");
2946 else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
2948 tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
2949 FALLBACK_TRY("Software SDL");
2952 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2953 FALLBACK_STORE("Software X11");
2956 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2957 FALLBACK_STORE("Software FB");
2961 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
2963 tmp_sd.ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
2964 FALLBACK_TRY("Software-16-SDL");
2967 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2968 FALLBACK_STORE("Software X11");
2971 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2972 FALLBACK_STORE("Software FB");
2976 else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
2978 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
2979 FALLBACK_TRY("OpenGL SDL");
2982 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
2983 FALLBACK_STORE("Software X11");
2986 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
2987 FALLBACK_STORE("Software FB");
2991 else if (ENGINE_COMPARE(ELM_OPENGL_COCOA))
2993 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
2994 FALLBACK_TRY("OpenGL Cocoa");
2996 else if (ENGINE_COMPARE(ELM_BUFFER))
2998 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3000 else if (ENGINE_COMPARE(ELM_EWS))
3002 tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
3004 else if (ENGINE_COMPARE(ELM_WAYLAND_SHM))
3006 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
3008 else if (ENGINE_COMPARE(ELM_WAYLAND_EGL))
3010 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
3012 else if (!strncmp(ENGINE_GET(), "shot:", 5))
3014 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3015 ecore_evas_manual_render_set(tmp_sd.ee, EINA_TRUE);
3016 tmp_sd.shot.info = eina_stringshare_add
3025 ERR("Cannot create window.");
3030 eo_do(obj, eo_parent_set(ecore_evas_get(tmp_sd.ee)));
3031 eo_do_super(obj, MY_CLASS, eo_constructor());
3033 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
3034 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
3036 if (getenv("ELM_FIRST_FRAME"))
3037 evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
3038 _elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
3040 /* copying possibly altered fields back */
3041 #define SD_CPY(_field) \
3044 sd->_field = tmp_sd._field; \
3052 if ((trap) && (trap->add))
3053 sd->trap_data = trap->add(obj);
3055 /* complementary actions, which depend on final smart data
3057 if (type == ELM_WIN_INLINED_IMAGE)
3058 _win_inlined_image_set(sd);
3060 #ifdef HAVE_ELEMENTARY_X
3061 else if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
3062 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
3063 ENGINE_COMPARE(ELM_SOFTWARE_8_X11) ||
3064 ENGINE_COMPARE(ELM_OPENGL_X11))
3066 sd->x.client_message_handler = ecore_event_handler_add
3067 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, obj);
3068 sd->x.property_handler = ecore_event_handler_add
3069 (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
3073 else if (!strncmp(ENGINE_GET(), "shot:", 5))
3076 sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
3077 sd->indmode = ELM_WIN_INDICATOR_UNKNOWN;
3079 #ifdef HAVE_ELEMENTARY_X
3080 _elm_win_xwindow_get(sd);
3083 ecore_x_io_error_handler_set(_elm_x_io_err, NULL);
3087 #ifdef HAVE_ELEMENTARY_WAYLAND
3088 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3089 _elm_win_wlwindow_get(sd);
3092 if ((_elm_config->bgpixmap)
3093 #ifdef HAVE_ELEMENTARY_X
3095 (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
3100 TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
3101 // bg pixmap done by x - has other issues like can be redrawn by x before it
3102 // is filled/ready by app
3103 // TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
3106 sd->parent = parent;
3109 evas_object_event_callback_add
3110 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
3112 sd->evas = ecore_evas_get(sd->ee);
3114 evas_object_color_set(obj, 0, 0, 0, 0);
3115 evas_object_move(obj, 0, 0);
3116 evas_object_resize(obj, 1, 1);
3117 evas_object_layer_set(obj, 50);
3118 evas_object_pass_events_set(obj, EINA_TRUE);
3120 if (type == ELM_WIN_INLINED_IMAGE)
3121 elm_widget_parent2_set(obj, parent);
3123 /* use own version of ecore_evas_object_associate() that does TRAP() */
3124 ecore_evas_data_set(sd->ee, "elm_win", obj);
3126 evas_object_event_callback_add
3127 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3128 _elm_win_obj_callback_changed_size_hints, obj);
3130 evas_object_intercept_raise_callback_add
3131 (obj, _elm_win_obj_intercept_raise, obj);
3132 evas_object_intercept_lower_callback_add
3133 (obj, _elm_win_obj_intercept_lower, obj);
3134 evas_object_intercept_stack_above_callback_add
3135 (obj, _elm_win_obj_intercept_stack_above, obj);
3136 evas_object_intercept_stack_below_callback_add
3137 (obj, _elm_win_obj_intercept_stack_below, obj);
3138 evas_object_intercept_layer_set_callback_add
3139 (obj, _elm_win_obj_intercept_layer_set, obj);
3140 evas_object_intercept_show_callback_add
3141 (obj, _elm_win_obj_intercept_show, obj);
3143 TRAP(sd, name_class_set, name, _elm_appname);
3144 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
3145 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3146 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3147 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3148 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3149 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3150 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3151 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3152 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3154 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
3155 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
3157 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
3158 evas_font_path_append(sd->evas, fontpath);
3160 if (!_elm_config->font_hinting)
3161 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_NONE);
3162 else if (_elm_config->font_hinting == 1)
3163 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_AUTO);
3164 else if (_elm_config->font_hinting == 2)
3165 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_BYTECODE);
3167 #ifdef HAVE_ELEMENTARY_X
3168 _elm_win_xwin_update(sd);
3171 _elm_win_list = eina_list_append(_elm_win_list, obj);
3174 if (((fallback) && (!strcmp(fallback, "Software FB"))) ||
3175 ((!fallback) && (ENGINE_COMPARE(ELM_SOFTWARE_FB))))
3177 TRAP(sd, fullscreen_set, 1);
3179 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3180 (ENGINE_COMPARE(ELM_WAYLAND_SHM) ||
3181 ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3182 _elm_win_frame_add(sd, "default");
3184 if (_elm_config->focus_highlight_enable)
3185 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3186 if (_elm_config->focus_highlight_animate)
3187 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3190 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
3191 evas_object_event_callback_add
3192 (obj, EVAS_CALLBACK_KEY_DOWN, _debug_key_down, NULL);
3194 if (evas_object_key_grab(obj, "F12", mask, 0, EINA_TRUE))
3195 INF("Ctrl+F12 key combination exclusive for dot tree generation\n");
3197 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3200 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3201 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3202 (((fallback) && (!strcmp(fallback, "Software FB"))) ||
3203 ((!fallback) && (ENGINE_COMPARE(ELM_SOFTWARE_FB))))))
3206 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3208 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3209 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3210 edje_object_size_min_calc(o, &mw, &mh);
3211 evas_object_resize(o, mw, mh);
3212 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3213 &hx, &hy, NULL, NULL);
3214 sd->pointer.hot_x = hx;
3215 sd->pointer.hot_y = hy;
3216 evas_object_show(o);
3217 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3219 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3224 sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
3225 sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
3227 sd->layout = edje_object_add(sd->evas);
3228 _elm_theme_object_set(obj, sd->layout, "win", "base", "default");
3229 sd->box = evas_object_box_add(sd->evas);
3230 evas_object_box_layout_set(sd->box, _window_layout_stack, obj, NULL);
3231 edje_object_part_swallow(sd->layout, "elm.swallow.contents", sd->box);
3232 evas_object_move(sd->layout, 0, 0);
3233 evas_object_resize(sd->layout, 1, 1);
3234 edje_object_update_hints_set(sd->layout, EINA_TRUE);
3235 evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3236 _elm_win_on_resize_obj_changed_size_hints, obj);
3237 evas_object_show(sd->layout);
3241 _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
3244 ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
3248 elm_win_type_get(const Evas_Object *obj)
3250 ELM_WIN_CHECK(obj) ELM_WIN_UNKNOWN;
3251 Elm_Win_Type ret = ELM_WIN_UNKNOWN;
3252 eo_do((Eo *) obj, elm_obj_win_type_get(&ret));
3257 _type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3259 Elm_Win_Type *ret = va_arg(*list, Elm_Win_Type *);
3260 Elm_Win_Smart_Data *sd = _pd;
3265 elm_win_util_standard_add(const char *name,
3268 Evas_Object *win, *bg;
3270 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
3271 if (!win) return NULL;
3273 elm_win_title_set(win, title);
3274 bg = elm_bg_add(win);
3277 evas_object_del(win);
3280 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3281 elm_win_resize_object_add(win, bg);
3282 evas_object_show(bg);
3288 elm_win_resize_object_add(Evas_Object *obj,
3289 Evas_Object *subobj)
3292 eo_do(obj, elm_obj_win_resize_object_add(subobj));
3296 _resize_object_add(Eo *obj, void *_pd, va_list *list)
3298 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3300 Elm_Win_Smart_Data *sd = _pd;
3302 elm_widget_sub_object_add(obj, subobj);
3304 if (!evas_object_box_append(sd->box, subobj))
3305 ERR("could not append %p to box", subobj);
3309 elm_win_resize_object_del(Evas_Object *obj,
3310 Evas_Object *subobj)
3313 eo_do(obj, elm_obj_win_resize_object_del(subobj));
3317 _resize_object_del(Eo *obj, void *_pd, va_list *list)
3319 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3320 Elm_Win_Smart_Data *sd = _pd;
3322 if (!elm_widget_sub_object_del(obj, subobj))
3323 ERR("could not remove sub object %p from %p", subobj, obj);
3325 evas_object_box_remove(sd->box, subobj);
3329 elm_win_title_set(Evas_Object *obj,
3333 eo_do(obj, elm_obj_win_title_set(title));
3337 _title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3339 const char *title = va_arg(*list, const char *);
3340 Elm_Win_Smart_Data *sd = _pd;
3343 eina_stringshare_replace(&(sd->title), title);
3344 TRAP(sd, title_set, sd->title);
3346 edje_object_part_text_escaped_set
3347 (sd->frame_obj, "elm.text.title", sd->title);
3351 elm_win_title_get(const Evas_Object *obj)
3353 ELM_WIN_CHECK(obj) NULL;
3354 const char *ret = NULL;
3355 eo_do((Eo *) obj, elm_obj_win_title_get(&ret));
3360 _title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3362 const char **ret = va_arg(*list, const char **);
3363 Elm_Win_Smart_Data *sd = _pd;
3368 elm_win_icon_name_set(Evas_Object *obj,
3369 const char *icon_name)
3372 eo_do(obj, elm_obj_win_icon_name_set(icon_name));
3376 _icon_name_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3378 const char *icon_name = va_arg(*list, const char *);
3379 Elm_Win_Smart_Data *sd = _pd;
3381 if (!icon_name) return;
3382 eina_stringshare_replace(&(sd->icon_name), icon_name);
3383 #ifdef HAVE_ELEMENTARY_X
3384 _elm_win_xwin_update(sd);
3389 elm_win_icon_name_get(const Evas_Object *obj)
3391 ELM_WIN_CHECK(obj) NULL;
3392 const char *ret = NULL;
3393 eo_do((Eo *) obj, elm_obj_win_icon_name_get(&ret));
3398 _icon_name_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3400 const char **ret = va_arg(*list, const char **);
3401 Elm_Win_Smart_Data *sd = _pd;
3402 *ret = sd->icon_name;
3406 elm_win_role_set(Evas_Object *obj, const char *role)
3409 eo_do(obj, elm_obj_win_role_set(role));
3413 _role_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3415 const char *role = va_arg(*list, const char *);
3416 Elm_Win_Smart_Data *sd = _pd;
3419 eina_stringshare_replace(&(sd->role), role);
3420 #ifdef HAVE_ELEMENTARY_X
3421 _elm_win_xwin_update(sd);
3426 elm_win_role_get(const Evas_Object *obj)
3428 ELM_WIN_CHECK(obj) NULL;
3429 const char *ret = NULL;
3430 eo_do((Eo *) obj, elm_obj_win_role_get(&ret));
3435 _role_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3437 const char **ret = va_arg(*list, const char **);
3438 Elm_Win_Smart_Data *sd = _pd;
3443 elm_win_icon_object_set(Evas_Object *obj,
3447 eo_do(obj, elm_obj_win_icon_object_set(icon));
3451 _icon_object_set(Eo *obj, void *_pd, va_list *list)
3453 Evas_Object *icon = va_arg(*list, Evas_Object *);
3454 Elm_Win_Smart_Data *sd = _pd;
3457 evas_object_event_callback_del_full
3458 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3461 evas_object_event_callback_add
3462 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3463 #ifdef HAVE_ELEMENTARY_X
3464 _elm_win_xwin_update(sd);
3468 EAPI const Evas_Object *
3469 elm_win_icon_object_get(const Evas_Object *obj)
3471 ELM_WIN_CHECK(obj) NULL;
3472 const Evas_Object *ret = NULL;
3473 eo_do((Eo *) obj, elm_obj_win_icon_object_get(&ret));
3478 _icon_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3480 const Evas_Object **ret = va_arg(*list, const Evas_Object **);
3481 Elm_Win_Smart_Data *sd = _pd;
3486 elm_win_autodel_set(Evas_Object *obj,
3490 eo_do(obj, elm_obj_win_autodel_set(autodel));
3494 _autodel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3496 Eina_Bool autodel = va_arg(*list, int);
3497 Elm_Win_Smart_Data *sd = _pd;
3498 sd->autodel = autodel;
3502 elm_win_autodel_get(const Evas_Object *obj)
3504 ELM_WIN_CHECK(obj) EINA_FALSE;
3505 Eina_Bool ret = EINA_FALSE;
3506 eo_do((Eo *) obj, elm_obj_win_autodel_get(&ret));
3511 _autodel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3513 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3514 Elm_Win_Smart_Data *sd = _pd;
3519 elm_win_activate(Evas_Object *obj)
3522 eo_do(obj, elm_obj_win_activate());
3526 _activate(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3528 Elm_Win_Smart_Data *sd = _pd;
3533 elm_win_lower(Evas_Object *obj)
3536 eo_do(obj, elm_obj_win_lower());
3540 _lower(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3542 Elm_Win_Smart_Data *sd = _pd;
3547 elm_win_raise(Evas_Object *obj)
3550 eo_do(obj, elm_obj_win_raise());
3554 _raise(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3556 Elm_Win_Smart_Data *sd = _pd;
3561 elm_win_center(Evas_Object *obj,
3566 eo_do(obj, elm_obj_win_center(h, v));
3570 _center(Eo *obj, void *_pd, va_list *list)
3572 Eina_Bool h = va_arg(*list, int);
3573 Eina_Bool v = va_arg(*list, int);
3574 int win_w, win_h, screen_w, screen_h, nx, ny;
3576 Elm_Win_Smart_Data *sd = _pd;
3578 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
3581 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &screen_w, &screen_h);
3582 if ((!screen_w) || (!screen_h)) return;
3584 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
3585 if ((!win_w) || (!win_h)) return;
3587 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
3588 else nx = sd->screen.x;
3589 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
3590 else ny = sd->screen.y;
3594 evas_object_move(obj, nx, ny);
3598 elm_win_borderless_set(Evas_Object *obj,
3599 Eina_Bool borderless)
3602 eo_do(obj, elm_obj_win_borderless_set(borderless));
3606 _borderless_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3608 Eina_Bool borderless = va_arg(*list, int);
3609 Elm_Win_Smart_Data *sd = _pd;
3611 Eina_Bool need_frame = EINA_FALSE;
3613 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3614 need_frame = engine_name &&
3615 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3616 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3621 _elm_win_frame_del(sd);
3626 _elm_win_frame_add(sd, "default");
3629 evas_object_show(sd->frame_obj);
3632 TRAP(sd, borderless_set, borderless);
3633 #ifdef HAVE_ELEMENTARY_X
3634 _elm_win_xwin_update(sd);
3639 elm_win_borderless_get(const Evas_Object *obj)
3641 ELM_WIN_CHECK(obj) EINA_FALSE;
3642 Eina_Bool ret = EINA_FALSE;
3643 eo_do((Eo *) obj, elm_obj_win_borderless_get(&ret));
3648 _borderless_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3650 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3651 Elm_Win_Smart_Data *sd = _pd;
3652 *ret = ecore_evas_borderless_get(sd->ee);
3656 elm_win_shaped_set(Evas_Object *obj,
3660 eo_do(obj, elm_obj_win_shaped_set(shaped));
3664 _shaped_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3666 Eina_Bool shaped = va_arg(*list, int);
3667 Elm_Win_Smart_Data *sd = _pd;
3669 TRAP(sd, shaped_set, shaped);
3670 #ifdef HAVE_ELEMENTARY_X
3671 _elm_win_xwin_update(sd);
3676 elm_win_shaped_get(const Evas_Object *obj)
3678 ELM_WIN_CHECK(obj) EINA_FALSE;
3679 Eina_Bool ret = EINA_FALSE;
3680 eo_do((Eo *) obj, elm_obj_win_shaped_get(&ret));
3685 _shaped_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3687 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3688 Elm_Win_Smart_Data *sd = _pd;
3689 *ret = ecore_evas_shaped_get(sd->ee);
3693 elm_win_alpha_set(Evas_Object *obj,
3697 eo_do(obj, elm_obj_win_alpha_set(enabled));
3701 _alpha_set(Eo *obj, void *_pd, va_list *list)
3703 Eina_Bool enabled = va_arg(*list, int);
3704 Elm_Win_Smart_Data *sd = _pd;
3708 evas_object_image_alpha_set(sd->img_obj, enabled);
3709 ecore_evas_alpha_set(sd->ee, enabled);
3713 #ifdef HAVE_ELEMENTARY_X
3718 if (!ecore_x_screen_is_composited(0))
3719 elm_win_shaped_set(obj, enabled);
3721 TRAP(sd, alpha_set, enabled);
3724 TRAP(sd, alpha_set, enabled);
3725 _elm_win_xwin_update(sd);
3729 TRAP(sd, alpha_set, enabled);
3734 elm_win_alpha_get(const Evas_Object *obj)
3736 ELM_WIN_CHECK(obj) EINA_FALSE;
3737 Eina_Bool ret = EINA_FALSE;
3738 eo_do((Eo *) obj, elm_obj_win_alpha_get(&ret));
3743 _alpha_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3745 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3746 Elm_Win_Smart_Data *sd = _pd;
3750 *ret = evas_object_image_alpha_get(sd->img_obj);
3754 *ret = ecore_evas_alpha_get(sd->ee);
3759 elm_win_override_set(Evas_Object *obj,
3763 eo_do(obj, elm_obj_win_override_set(override));
3767 _override_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3769 Eina_Bool override = va_arg(*list, int);
3770 Elm_Win_Smart_Data *sd = _pd;
3772 TRAP(sd, override_set, override);
3773 #ifdef HAVE_ELEMENTARY_X
3774 _elm_win_xwin_update(sd);
3779 elm_win_override_get(const Evas_Object *obj)
3781 ELM_WIN_CHECK(obj) EINA_FALSE;
3782 Eina_Bool ret = EINA_FALSE;
3783 eo_do((Eo *) obj, elm_obj_win_override_get(&ret));
3788 _override_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3790 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3791 Elm_Win_Smart_Data *sd = _pd;
3792 *ret = ecore_evas_override_get(sd->ee);
3796 elm_win_fullscreen_set(Evas_Object *obj,
3797 Eina_Bool fullscreen)
3800 eo_do(obj, elm_obj_win_fullscreen_set(fullscreen));
3804 _fullscreen_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3806 Eina_Bool fullscreen = va_arg(*list, int);
3807 Elm_Win_Smart_Data *sd = _pd;
3808 // YYY: handle if sd->img_obj
3809 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
3810 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
3812 // these engines... can ONLY be fullscreen
3817 // sd->fullscreen = fullscreen;
3819 Eina_Bool need_frame = EINA_FALSE;
3821 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3822 need_frame = engine_name &&
3823 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3824 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3826 TRAP(sd, fullscreen_set, fullscreen);
3831 _elm_win_frame_del(sd);
3836 _elm_win_frame_add(sd, "default");
3839 evas_object_show(sd->frame_obj);
3841 #ifdef HAVE_ELEMENTARY_X
3842 _elm_win_xwin_update(sd);
3848 elm_win_fullscreen_get(const Evas_Object *obj)
3850 ELM_WIN_CHECK(obj) EINA_FALSE;
3851 Eina_Bool ret = EINA_FALSE;
3852 eo_do((Eo *) obj, elm_obj_win_fullscreen_get(&ret));
3857 _fullscreen_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3859 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3860 Elm_Win_Smart_Data *sd = _pd;
3864 const char* engine_name = ecore_evas_engine_name_get(sd->ee);
3867 ((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
3868 (!strcmp(engine_name, ELM_SOFTWARE_16_WINCE))))
3870 // these engines... can ONLY be fullscreen
3875 *ret = sd->fullscreen;
3880 elm_win_main_menu_get(const Evas_Object *obj)
3882 ELM_WIN_CHECK(obj) NULL;
3884 eo_do((Eo *) obj, elm_obj_win_main_menu_get(&ret));
3889 _dbus_menu_set(Eina_Bool dbus_connect, void *data)
3891 ELM_WIN_DATA_GET_OR_RETURN(data, sd);
3895 DBG("Setting menu to D-Bus");
3896 edje_object_part_unswallow(sd->layout, sd->main_menu);
3897 edje_object_signal_emit(sd->layout, "elm,action,hide_menu", "elm");
3898 _elm_menu_menu_bar_hide(sd->main_menu);
3902 DBG("Setting menu to local mode");
3903 edje_object_part_swallow(sd->layout, "elm.swallow.menu", sd->main_menu);
3904 edje_object_signal_emit(sd->layout, "elm,action,show_menu", "elm");
3905 evas_object_show(sd->main_menu);
3910 _main_menu_get(Eo *obj, void *_pd, va_list *list)
3912 Eo **ret = va_arg(*list, Eo **);
3913 Elm_Win_Smart_Data *sd = _pd;
3914 Eina_Bool use_dbus = EINA_FALSE;
3916 if (sd->main_menu) goto end;
3918 sd->main_menu = elm_menu_add(obj);
3919 _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
3921 #ifdef HAVE_ELEMENTARY_X
3922 if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
3925 #ifdef HAVE_ELEMENTARY_X
3926 if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
3928 _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
3929 _dbus_menu_set, obj);
3933 _dbus_menu_set(EINA_FALSE, obj);
3936 *ret = sd->main_menu;
3940 elm_win_maximized_set(Evas_Object *obj,
3941 Eina_Bool maximized)
3944 eo_do(obj, elm_obj_win_maximized_set(maximized));
3948 _maximized_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3950 Eina_Bool maximized = va_arg(*list, int);
3951 Elm_Win_Smart_Data *sd = _pd;
3953 _elm_win_frame_maximized_state_update(sd, maximized);
3954 // YYY: handle if sd->img_obj
3955 TRAP(sd, maximized_set, maximized);
3956 #ifdef HAVE_ELEMENTARY_X
3957 _elm_win_xwin_update(sd);
3962 elm_win_maximized_get(const Evas_Object *obj)
3964 ELM_WIN_CHECK(obj) EINA_FALSE;
3965 Eina_Bool ret = EINA_FALSE;
3966 eo_do((Eo *) obj, elm_obj_win_maximized_get(&ret));
3971 _maximized_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3973 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3974 Elm_Win_Smart_Data *sd = _pd;
3975 *ret = sd->maximized;
3979 elm_win_iconified_set(Evas_Object *obj,
3980 Eina_Bool iconified)
3983 eo_do(obj, elm_obj_win_iconified_set(iconified));
3987 _iconified_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3989 Eina_Bool iconified = va_arg(*list, int);
3990 Elm_Win_Smart_Data *sd = _pd;
3992 // sd->iconified = iconified;
3993 TRAP(sd, iconified_set, iconified);
3994 #ifdef HAVE_ELEMENTARY_X
3995 _elm_win_xwin_update(sd);
4000 elm_win_iconified_get(const Evas_Object *obj)
4002 ELM_WIN_CHECK(obj) EINA_FALSE;
4003 Eina_Bool ret = EINA_FALSE;
4004 eo_do((Eo *) obj, elm_obj_win_iconified_get(&ret));
4009 _iconified_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4011 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4012 Elm_Win_Smart_Data *sd = _pd;
4013 *ret = sd->iconified;
4017 elm_win_withdrawn_set(Evas_Object *obj,
4018 Eina_Bool withdrawn)
4021 eo_do(obj, elm_obj_win_withdrawn_set(withdrawn));
4025 _withdrawn_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4027 Eina_Bool withdrawn = va_arg(*list, int);
4028 Elm_Win_Smart_Data *sd = _pd;
4030 // sd->withdrawn = withdrawn;
4031 TRAP(sd, withdrawn_set, withdrawn);
4032 #ifdef HAVE_ELEMENTARY_X
4033 _elm_win_xwin_update(sd);
4038 elm_win_withdrawn_get(const Evas_Object *obj)
4040 ELM_WIN_CHECK(obj) EINA_FALSE;
4041 Eina_Bool ret = EINA_FALSE;
4042 eo_do((Eo *) obj, elm_obj_win_withdrawn_get(&ret));
4047 _withdrawn_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4049 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4050 Elm_Win_Smart_Data *sd = _pd;
4051 *ret = sd->withdrawn;
4055 elm_win_available_profiles_set(Evas_Object *obj,
4056 const char **profiles,
4060 eo_do((Eo *) obj, elm_obj_win_available_profiles_set(profiles, count));
4064 _available_profiles_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4066 const char **profiles = va_arg(*list, const char **);
4067 unsigned int count = va_arg(*list, unsigned int);
4068 Elm_Win_Smart_Data *sd = _pd;
4069 Eina_Bool found = EINA_FALSE;
4071 _elm_win_available_profiles_del(sd);
4072 if ((profiles) && (count >= 1))
4074 sd->profile.available_list = calloc(count, sizeof(char *));
4075 if (sd->profile.available_list)
4077 if (!sd->profile.name) found = EINA_TRUE;
4080 for (i = 0; i < count; i++)
4082 sd->profile.available_list[i] = eina_stringshare_add(profiles[i]);
4084 /* check to see if a given array has a current profile of elm_win */
4085 if ((sd->profile.name) &&
4086 (!strcmp(sd->profile.name, profiles[i])))
4091 sd->profile.count = count;
4095 if (ecore_evas_window_profile_supported_get(sd->ee))
4097 ecore_evas_window_available_profiles_set(sd->ee,
4098 sd->profile.available_list,
4101 /* current profile of elm_win is wrong, change profile */
4102 if ((sd->profile.available_list) && (!found))
4104 eina_stringshare_replace(&(sd->profile.name),
4105 sd->profile.available_list[0]);
4106 ecore_evas_window_profile_set(sd->ee, sd->profile.name);
4112 if (sd->profile.available_list)
4113 _elm_win_profile_update(sd);
4118 elm_win_available_profiles_get(Evas_Object *obj,
4120 unsigned int *count)
4122 ELM_WIN_CHECK(obj) EINA_FALSE;
4123 Eina_Bool ret = EINA_FALSE;
4124 eo_do((Eo *) obj, elm_obj_win_available_profiles_get(profiles, count, &ret));
4129 _available_profiles_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4131 char ***profiles = va_arg(*list, char ***);
4132 unsigned int *count = va_arg(*list, unsigned int *);
4133 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4134 Elm_Win_Smart_Data *sd = _pd;
4137 if (ecore_evas_window_profile_supported_get(sd->ee))
4139 res = ecore_evas_window_available_profiles_get(sd->ee,
4145 if (profiles) *profiles = (char **)sd->profile.available_list;
4146 if (count) *count = sd->profile.count;
4149 if (ret) *ret = res;
4153 elm_win_profile_set(Evas_Object *obj,
4154 const char *profile)
4157 eo_do((Eo *) obj, elm_obj_win_profile_set(profile));
4161 _profile_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4163 const char *profile = va_arg(*list, const char *);
4164 Elm_Win_Smart_Data *sd = _pd;
4166 /* check to see if a given profile is present in an available profiles */
4167 if ((profile) && (sd->profile.available_list))
4169 Eina_Bool found = EINA_FALSE;
4171 for (i = 0; i < sd->profile.count; i++)
4173 if (!strcmp(profile,
4174 sd->profile.available_list[i]))
4183 if (ecore_evas_window_profile_supported_get(sd->ee))
4185 if (!profile) _elm_win_profile_del(sd);
4186 ecore_evas_window_profile_set(sd->ee, profile);
4190 if (_elm_win_profile_set(sd, profile))
4191 _elm_win_profile_update(sd);
4196 elm_win_profile_get(const Evas_Object *obj)
4198 ELM_WIN_CHECK(obj) NULL;
4199 const char *ret = NULL;
4200 eo_do((Eo *) obj, elm_obj_win_profile_get(&ret));
4205 _profile_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4207 const char **ret = va_arg(*list, const char **);
4208 Elm_Win_Smart_Data *sd = _pd;
4209 *ret = sd->profile.name;
4213 elm_win_urgent_set(Evas_Object *obj,
4217 eo_do(obj, elm_obj_win_urgent_set(urgent));
4221 _urgent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4223 Eina_Bool urgent = va_arg(*list, int);
4224 Elm_Win_Smart_Data *sd = _pd;
4226 sd->urgent = urgent;
4227 TRAP(sd, urgent_set, urgent);
4228 #ifdef HAVE_ELEMENTARY_X
4229 _elm_win_xwin_update(sd);
4234 elm_win_urgent_get(const Evas_Object *obj)
4236 ELM_WIN_CHECK(obj) EINA_FALSE;
4237 Eina_Bool ret = EINA_FALSE;
4238 eo_do((Eo *) obj, elm_obj_win_urgent_get(&ret));
4243 _urgent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4245 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4246 Elm_Win_Smart_Data *sd = _pd;
4251 elm_win_demand_attention_set(Evas_Object *obj,
4252 Eina_Bool demand_attention)
4255 eo_do(obj, elm_obj_win_demand_attention_set(demand_attention));
4259 _demand_attention_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4261 Eina_Bool demand_attention = va_arg(*list, int);
4262 Elm_Win_Smart_Data *sd = _pd;
4264 sd->demand_attention = demand_attention;
4265 TRAP(sd, demand_attention_set, demand_attention);
4266 #ifdef HAVE_ELEMENTARY_X
4267 _elm_win_xwin_update(sd);
4272 elm_win_demand_attention_get(const Evas_Object *obj)
4274 ELM_WIN_CHECK(obj) EINA_FALSE;
4275 Eina_Bool ret = EINA_FALSE;
4276 eo_do((Eo *) obj, elm_obj_win_demand_attention_get(&ret));
4281 _demand_attention_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4283 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4284 Elm_Win_Smart_Data *sd = _pd;
4285 *ret = sd->demand_attention;
4289 elm_win_modal_set(Evas_Object *obj,
4293 eo_do(obj, elm_obj_win_modal_set(modal));
4297 _modal_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4299 Eina_Bool modal = va_arg(*list, int);
4300 Elm_Win_Smart_Data *sd = _pd;
4303 TRAP(sd, modal_set, modal);
4304 #ifdef HAVE_ELEMENTARY_X
4305 _elm_win_xwin_update(sd);
4310 elm_win_modal_get(const Evas_Object *obj)
4312 ELM_WIN_CHECK(obj) EINA_FALSE;
4313 Eina_Bool ret = EINA_FALSE;
4314 eo_do((Eo *) obj, elm_obj_win_modal_get(&ret));
4319 _modal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4321 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4322 Elm_Win_Smart_Data *sd = _pd;
4327 elm_win_aspect_set(Evas_Object *obj,
4331 eo_do(obj, elm_obj_win_aspect_set(aspect));
4335 _aspect_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4337 double aspect = va_arg(*list, double);
4338 Elm_Win_Smart_Data *sd = _pd;
4340 sd->aspect = aspect;
4341 TRAP(sd, aspect_set, aspect);
4342 #ifdef HAVE_ELEMENTARY_X
4343 _elm_win_xwin_update(sd);
4348 elm_win_aspect_get(const Evas_Object *obj)
4350 ELM_WIN_CHECK(obj) 0.0;
4352 eo_do((Eo *) obj, elm_obj_win_aspect_get(&ret));
4357 _aspect_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4359 double *ret = va_arg(*list, double *);
4360 Elm_Win_Smart_Data *sd = _pd;
4365 elm_win_size_base_set(Evas_Object *obj, int w, int h)
4368 eo_do(obj, elm_obj_win_size_base_set(w, h));
4372 _size_base_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4374 int w = va_arg(*list, int);
4375 int h = va_arg(*list, int);
4376 Elm_Win_Smart_Data *sd = _pd;
4377 sd->size_base_w = w;
4378 sd->size_base_h = h;
4379 TRAP(sd, size_base_set, w, h);
4380 #ifdef HAVE_ELEMENTARY_X
4381 _elm_win_xwin_update(sd);
4386 elm_win_size_base_get(Evas_Object *obj, int *w, int *h)
4389 eo_do(obj, elm_obj_win_size_base_get(w, h));
4393 _size_base_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4395 int *w = va_arg(*list, int *);
4396 int *h = va_arg(*list, int *);
4398 Elm_Win_Smart_Data *sd = _pd;
4399 if (w) *w = sd->size_base_w;
4400 if (w) *h = sd->size_base_h;
4404 elm_win_size_step_set(Evas_Object *obj, int w, int h)
4407 eo_do(obj, elm_obj_win_size_step_set(w, h));
4411 _size_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4413 int w = va_arg(*list, int);
4414 int h = va_arg(*list, int);
4415 Elm_Win_Smart_Data *sd = _pd;
4416 sd->size_step_w = w;
4417 sd->size_step_h = h;
4418 TRAP(sd, size_step_set, w, h);
4419 #ifdef HAVE_ELEMENTARY_X
4420 _elm_win_xwin_update(sd);
4425 elm_win_size_step_get(Evas_Object *obj, int *w, int *h)
4428 eo_do(obj, elm_obj_win_size_step_get(w, h));
4432 _size_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4434 int *w = va_arg(*list, int *);
4435 int *h = va_arg(*list, int *);
4436 Elm_Win_Smart_Data *sd = _pd;
4437 if (w) *w = sd->size_step_w;
4438 if (w) *h = sd->size_step_h;
4442 elm_win_layer_set(Evas_Object *obj,
4446 eo_do(obj, elm_obj_win_layer_set(layer));
4450 _layer_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4452 int layer = va_arg(*list, int);
4453 Elm_Win_Smart_Data *sd = _pd;
4455 TRAP(sd, layer_set, layer);
4456 #ifdef HAVE_ELEMENTARY_X
4457 _elm_win_xwin_update(sd);
4462 elm_win_layer_get(const Evas_Object *obj)
4464 ELM_WIN_CHECK(obj) - 1;
4466 eo_do((Eo *) obj, elm_obj_win_layer_get(&ret));
4471 _layer_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4473 int *ret = va_arg(*list, int *);
4474 Elm_Win_Smart_Data *sd = _pd;
4475 *ret = ecore_evas_layer_get(sd->ee);
4479 elm_win_norender_push(Evas_Object *obj)
4482 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4485 if (sd->norender == 1) ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
4489 elm_win_norender_pop(Evas_Object *obj)
4492 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4494 if (sd->norender <= 0) return;
4496 if (sd->norender == 0) ecore_evas_manual_render_set(sd->ee, EINA_FALSE);
4500 elm_win_norender_get(Evas_Object *obj)
4502 ELM_WIN_CHECK(obj) - 1;
4503 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
4504 return sd->norender;
4508 elm_win_render(Evas_Object *obj)
4511 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4512 ecore_evas_manual_render(sd->ee);
4516 _win_rotation_degree_check(int rotation)
4518 if ((rotation > 360) || (rotation < 0))
4520 WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
4522 if (rotation < 0) rotation += 360;
4528 * This API resizes the internal window(ex: X window) and evas_output.
4529 * But this does not resize the elm window object and its contents.
4532 elm_win_rotation_set(Evas_Object *obj,
4536 eo_do(obj, elm_obj_win_rotation_set(rotation));
4540 _win_rotate(Evas_Object *obj, Elm_Win_Smart_Data *sd, int rotation, Eina_Bool resize)
4542 rotation = _win_rotation_degree_check(rotation);
4543 if (sd->rot == rotation) return;
4545 if (resize) TRAP(sd, rotation_with_resize_set, rotation);
4546 else TRAP(sd, rotation_set, rotation);
4547 evas_object_size_hint_min_set(obj, -1, -1);
4548 evas_object_size_hint_max_set(obj, -1, -1);
4549 _elm_win_resize_objects_eval(obj);
4550 #ifdef HAVE_ELEMENTARY_X
4551 _elm_win_xwin_update(sd);
4553 _elm_win_frame_obj_update(sd);
4554 elm_widget_orientation_set(obj, rotation);
4555 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
4559 _rotation_set(Eo *obj, void *_pd, va_list *list)
4561 int rotation = va_arg(*list, int);
4562 Elm_Win_Smart_Data *sd = _pd;
4563 _win_rotate(obj, sd, rotation, EINA_FALSE);
4567 * This API does not resize the internal window (ex: X window).
4568 * But this resizes evas_output, elm window, and its contents.
4571 elm_win_rotation_with_resize_set(Evas_Object *obj,
4575 eo_do(obj, elm_obj_win_rotation_with_resize_set(rotation));
4579 _rotation_with_resize_set(Eo *obj, void *_pd, va_list *list)
4581 int rotation = va_arg(*list, int);
4582 Elm_Win_Smart_Data *sd = _pd;
4583 _win_rotate(obj, sd, rotation, EINA_TRUE);
4587 elm_win_rotation_get(const Evas_Object *obj)
4589 ELM_WIN_CHECK(obj) - 1;
4591 eo_do((Eo *) obj, elm_obj_win_rotation_get(&ret));
4596 _rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4598 int *ret = va_arg(*list, int *);
4599 Elm_Win_Smart_Data *sd = _pd;
4604 elm_win_wm_rotation_supported_get(const Evas_Object *obj)
4606 ELM_WIN_CHECK(obj) EINA_FALSE;
4607 Eina_Bool ret = EINA_FALSE;
4608 eo_do((Eo *) obj, elm_obj_win_wm_rotation_supported_get(&ret));
4613 _wm_rotation_supported_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4615 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4616 Elm_Win_Smart_Data *sd = _pd;
4617 *ret = sd->wm_rot.wm_supported;
4620 /* This will unset a preferred rotation, if given preferred rotation is '-1'.
4623 elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj,
4627 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_set(rotation));
4631 _wm_preferred_rotation_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4633 int rotation = va_arg(*list, int);
4635 Elm_Win_Smart_Data *sd = _pd;
4637 if (!sd->wm_rot.use)
4638 sd->wm_rot.use = EINA_TRUE;
4640 // '-1' means that elm_win doesn't use preferred rotation.
4644 rot = _win_rotation_degree_check(rotation);
4646 if (sd->wm_rot.preferred_rot == rot) return;
4647 sd->wm_rot.preferred_rot = rot;
4649 ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
4653 elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj)
4655 ELM_WIN_CHECK(obj) -1;
4657 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_get(&ret));
4662 _wm_preferred_rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4664 int *ret = va_arg(*list, int *);
4665 Elm_Win_Smart_Data *sd = _pd;
4666 *ret = sd->wm_rot.preferred_rot;
4670 elm_win_wm_rotation_available_rotations_set(Evas_Object *obj,
4671 const int *rotations,
4675 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_set(rotations, count));
4679 _wm_available_rotations_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4681 const int *rotations = va_arg(*list, const int *);
4682 unsigned int count = va_arg(*list, unsigned int);
4683 Elm_Win_Smart_Data *sd = _pd;
4687 if (!sd->wm_rot.use)
4688 sd->wm_rot.use = EINA_TRUE;
4690 ELM_SAFE_FREE(sd->wm_rot.rots, free);
4691 sd->wm_rot.count = 0;
4695 sd->wm_rot.rots = calloc(count, sizeof(int));
4696 if (!sd->wm_rot.rots) return;
4697 for (i = 0; i < count; i++)
4699 r = _win_rotation_degree_check(rotations[i]);
4700 sd->wm_rot.rots[i] = r;
4704 sd->wm_rot.count = count;
4706 ecore_evas_wm_rotation_available_rotations_set(sd->ee,
4712 elm_win_wm_rotation_available_rotations_get(const Evas_Object *obj,
4714 unsigned int *count)
4716 ELM_WIN_CHECK(obj) EINA_FALSE;
4717 Eina_Bool ret = EINA_FALSE;
4718 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_get(rotations, count, &ret));
4723 _wm_available_rotations_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4725 int **rotations = va_arg(*list, int **);
4726 unsigned int *count = va_arg(*list, unsigned int *);
4727 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4728 Elm_Win_Smart_Data *sd = _pd;
4730 if (!sd->wm_rot.use) return;
4732 if (sd->wm_rot.count > 0)
4736 *rotations = calloc(sd->wm_rot.count, sizeof(int));
4741 sizeof(int) * sd->wm_rot.count);
4746 if (count) *count = sd->wm_rot.count;
4751 elm_win_wm_rotation_manual_rotation_done_set(Evas_Object *obj,
4755 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_set(set));
4759 _wm_manual_rotation_done_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4761 int set = va_arg(*list, int);
4762 Elm_Win_Smart_Data *sd = _pd;
4763 if (!sd->wm_rot.use) return;
4764 ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
4768 elm_win_wm_rotation_manual_rotation_done_get(const Evas_Object *obj)
4770 ELM_WIN_CHECK(obj) EINA_FALSE;
4771 Eina_Bool ret = EINA_FALSE;
4772 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_get(&ret));
4777 _wm_manual_rotation_done_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4779 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4780 Elm_Win_Smart_Data *sd = _pd;
4781 if (!sd->wm_rot.use) return;
4782 *ret = ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
4786 elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj)
4789 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done());
4793 _wm_manual_rotation_done(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
4795 Elm_Win_Smart_Data *sd = _pd;
4796 if (!sd->wm_rot.use) return;
4797 ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
4801 elm_win_sticky_set(Evas_Object *obj,
4805 eo_do(obj, elm_obj_win_sticky_set(sticky));
4809 _sticky_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4811 Eina_Bool sticky = va_arg(*list, int);
4812 Elm_Win_Smart_Data *sd = _pd;
4814 // sd->sticky = sticky;
4815 TRAP(sd, sticky_set, sticky);
4816 #ifdef HAVE_ELEMENTARY_X
4817 _elm_win_xwin_update(sd);
4822 elm_win_sticky_get(const Evas_Object *obj)
4824 ELM_WIN_CHECK(obj) EINA_FALSE;
4825 Eina_Bool ret = EINA_FALSE;
4826 eo_do((Eo *) obj, elm_obj_win_sticky_get(&ret));
4831 _sticky_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4833 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4834 Elm_Win_Smart_Data *sd = _pd;
4839 elm_win_keyboard_mode_set(Evas_Object *obj,
4840 Elm_Win_Keyboard_Mode mode)
4843 eo_do(obj, elm_obj_win_keyboard_mode_set(mode));
4847 _keyboard_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4849 Elm_Win_Keyboard_Mode mode = va_arg(*list, Elm_Win_Keyboard_Mode);
4850 Elm_Win_Smart_Data *sd = _pd;
4852 if (mode == sd->kbdmode) return;
4853 #ifdef HAVE_ELEMENTARY_X
4854 _elm_win_xwindow_get(sd);
4857 #ifdef HAVE_ELEMENTARY_X
4859 ecore_x_e_virtual_keyboard_state_set
4860 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
4864 EAPI Elm_Win_Keyboard_Mode
4865 elm_win_keyboard_mode_get(const Evas_Object *obj)
4867 ELM_WIN_CHECK(obj) ELM_WIN_KEYBOARD_UNKNOWN;
4868 Elm_Win_Keyboard_Mode ret = ELM_WIN_KEYBOARD_UNKNOWN;
4869 eo_do((Eo *) obj, elm_obj_win_keyboard_mode_get(&ret));
4874 _keyboard_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4876 Elm_Win_Keyboard_Mode *ret = va_arg(*list, Elm_Win_Keyboard_Mode *);
4877 Elm_Win_Smart_Data *sd = _pd;
4882 elm_win_keyboard_win_set(Evas_Object *obj,
4883 Eina_Bool is_keyboard)
4886 eo_do(obj, elm_obj_win_keyboard_win_set(is_keyboard));
4890 _keyboard_win_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4892 Eina_Bool is_keyboard = va_arg(*list, int);
4893 Elm_Win_Smart_Data *sd = _pd;
4895 #ifdef HAVE_ELEMENTARY_X
4896 _elm_win_xwindow_get(sd);
4898 ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
4905 elm_win_keyboard_win_get(const Evas_Object *obj)
4907 ELM_WIN_CHECK(obj) EINA_FALSE;
4908 Eina_Bool ret = EINA_FALSE;
4909 eo_do((Eo *) obj, elm_obj_win_keyboard_win_get(&ret));
4914 _keyboard_win_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4916 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4917 Elm_Win_Smart_Data *sd = _pd;
4919 #ifdef HAVE_ELEMENTARY_X
4920 _elm_win_xwindow_get(sd);
4923 *ret = ecore_x_e_virtual_keyboard_get(sd->x.xwin);
4931 elm_win_indicator_mode_set(Evas_Object *obj,
4932 Elm_Win_Indicator_Mode mode)
4935 eo_do(obj, elm_obj_win_indicator_mode_set(mode));
4939 _indicator_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4941 Elm_Win_Indicator_Mode mode = va_arg(*list, Elm_Win_Indicator_Mode);
4942 Elm_Win_Smart_Data *sd = _pd;
4944 if (mode == sd->indmode) return;
4945 #ifdef HAVE_ELEMENTARY_X
4946 _elm_win_xwindow_get(sd);
4949 #ifdef HAVE_ELEMENTARY_X
4952 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
4953 ecore_x_e_illume_indicator_state_set
4954 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
4955 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
4956 ecore_x_e_illume_indicator_state_set
4957 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
4960 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
4963 EAPI Elm_Win_Indicator_Mode
4964 elm_win_indicator_mode_get(const Evas_Object *obj)
4966 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_UNKNOWN;
4967 Elm_Win_Indicator_Mode ret = ELM_WIN_INDICATOR_UNKNOWN;
4968 eo_do((Eo *) obj, elm_obj_win_indicator_mode_get(&ret));
4973 _indicator_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4975 Elm_Win_Indicator_Mode *ret = va_arg(*list, Elm_Win_Indicator_Mode *);
4976 Elm_Win_Smart_Data *sd = _pd;
4981 elm_win_indicator_opacity_set(Evas_Object *obj,
4982 Elm_Win_Indicator_Opacity_Mode mode)
4985 eo_do(obj, elm_obj_win_indicator_opacity_set(mode));
4989 _indicator_opacity_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4991 Elm_Win_Indicator_Opacity_Mode mode = va_arg(*list, Elm_Win_Indicator_Opacity_Mode);
4992 Elm_Win_Smart_Data *sd = _pd;
4994 if (mode == sd->ind_o_mode) return;
4995 sd->ind_o_mode = mode;
4996 #ifdef HAVE_ELEMENTARY_X
4997 _elm_win_xwindow_get(sd);
5000 if (sd->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
5001 ecore_x_e_illume_indicator_opacity_set
5002 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
5003 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
5004 ecore_x_e_illume_indicator_opacity_set
5005 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
5006 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
5007 ecore_x_e_illume_indicator_opacity_set
5008 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
5011 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
5014 EAPI Elm_Win_Indicator_Opacity_Mode
5015 elm_win_indicator_opacity_get(const Evas_Object *obj)
5017 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5018 Elm_Win_Indicator_Opacity_Mode ret = ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5019 eo_do((Eo *) obj, elm_obj_win_indicator_opacity_get(&ret));
5024 _indicator_opacity_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5026 Elm_Win_Indicator_Opacity_Mode *ret = va_arg(*list, Elm_Win_Indicator_Opacity_Mode *);
5027 Elm_Win_Smart_Data *sd = _pd;
5028 *ret = sd->ind_o_mode;
5032 elm_win_screen_position_get(const Evas_Object *obj,
5037 eo_do((Eo *) obj, elm_obj_win_screen_position_get(x, y));
5041 _screen_position_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5043 int *x = va_arg(*list, int *);
5044 int *y = va_arg(*list, int *);
5045 Elm_Win_Smart_Data *sd = _pd;
5047 if (x) *x = sd->screen.x;
5048 if (y) *y = sd->screen.y;
5052 elm_win_focus_get(const Evas_Object *obj)
5054 ELM_WIN_CHECK(obj) EINA_FALSE;
5055 Eina_Bool ret = EINA_FALSE;
5056 eo_do((Eo *) obj, elm_obj_win_focus_get(&ret));
5061 _focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5063 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5064 Elm_Win_Smart_Data *sd = _pd;
5065 *ret = ecore_evas_focus_get(sd->ee);
5069 elm_win_screen_constrain_set(Evas_Object *obj,
5070 Eina_Bool constrain)
5073 eo_do(obj, elm_obj_win_screen_constrain_set(constrain));
5077 _screen_constrain_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5079 Eina_Bool constrain = va_arg(*list, int);
5080 Elm_Win_Smart_Data *sd = _pd;
5081 sd->constrain = !!constrain;
5085 elm_win_screen_constrain_get(Evas_Object *obj)
5087 ELM_WIN_CHECK(obj) EINA_FALSE;
5088 Eina_Bool ret = EINA_FALSE;
5089 eo_do(obj, elm_obj_win_screen_constrain_get(&ret));
5094 _screen_constrain_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5096 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5097 Elm_Win_Smart_Data *sd = _pd;
5098 *ret = sd->constrain;
5102 elm_win_screen_size_get(const Evas_Object *obj,
5109 eo_do((Eo *) obj, elm_obj_win_screen_size_get(x, y, w, h));
5113 _screen_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5115 int *x = va_arg(*list, int *);
5116 int *y = va_arg(*list, int *);
5117 int *w = va_arg(*list, int *);
5118 int *h = va_arg(*list, int *);
5119 Elm_Win_Smart_Data *sd = _pd;
5121 ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
5125 elm_win_screen_dpi_get(const Evas_Object *obj,
5130 eo_do((Eo *) obj, elm_obj_win_screen_dpi_get(xdpi, ydpi));
5134 _screen_dpi_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5136 int *xdpi = va_arg(*list, int *);
5137 int *ydpi = va_arg(*list, int *);
5138 Elm_Win_Smart_Data *sd = _pd;
5140 ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
5144 elm_win_conformant_set(Evas_Object *obj,
5145 Eina_Bool conformant)
5148 eo_do(obj, elm_obj_win_conformant_set(conformant));
5152 _conformant_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5154 Eina_Bool conformant = va_arg(*list, int);
5155 Elm_Win_Smart_Data *sd = _pd;
5157 #ifdef HAVE_ELEMENTARY_X
5158 _elm_win_xwindow_get(sd);
5160 ecore_x_e_illume_conformant_set(sd->x.xwin, conformant);
5167 elm_win_conformant_get(const Evas_Object *obj)
5169 ELM_WIN_CHECK(obj) EINA_FALSE;
5170 Eina_Bool ret = EINA_FALSE;
5171 eo_do((Eo *) obj, elm_obj_win_conformant_get(&ret));
5176 _conformant_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5178 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5179 Elm_Win_Smart_Data *sd = _pd;
5182 #ifdef HAVE_ELEMENTARY_X
5183 _elm_win_xwindow_get(sd);
5185 *ret = ecore_x_e_illume_conformant_get(sd->x.xwin);
5190 elm_win_quickpanel_set(Evas_Object *obj,
5191 Eina_Bool quickpanel)
5194 eo_do(obj, elm_obj_win_quickpanel_set(quickpanel));
5198 _quickpanel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5200 Eina_Bool quickpanel = va_arg(*list, int);
5201 Elm_Win_Smart_Data *sd = _pd;
5202 #ifdef HAVE_ELEMENTARY_X
5203 _elm_win_xwindow_get(sd);
5206 ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel);
5209 Ecore_X_Window_State states[2];
5211 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
5212 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
5213 ecore_x_netwm_window_state_set(sd->x.xwin, states, 2);
5214 ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
5223 elm_win_quickpanel_get(const Evas_Object *obj)
5225 ELM_WIN_CHECK(obj) EINA_FALSE;
5226 Eina_Bool ret = EINA_FALSE;
5227 eo_do((Eo *) obj, elm_obj_win_quickpanel_get(&ret));
5232 _quickpanel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5234 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5235 Elm_Win_Smart_Data *sd = _pd;
5238 #ifdef HAVE_ELEMENTARY_X
5239 _elm_win_xwindow_get(sd);
5241 *ret = ecore_x_e_illume_quickpanel_get(sd->x.xwin);
5246 elm_win_quickpanel_priority_major_set(Evas_Object *obj,
5250 eo_do(obj, elm_obj_win_quickpanel_priority_major_set(priority));
5254 _quickpanel_priority_major_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5256 int priority = va_arg(*list, int);
5257 Elm_Win_Smart_Data *sd = _pd;
5259 #ifdef HAVE_ELEMENTARY_X
5260 _elm_win_xwindow_get(sd);
5262 ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
5269 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
5271 ELM_WIN_CHECK(obj) - 1;
5273 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_major_get(&ret));
5278 _quickpanel_priority_major_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5280 int *ret = va_arg(*list, int *);
5281 Elm_Win_Smart_Data *sd = _pd;
5284 #ifdef HAVE_ELEMENTARY_X
5285 _elm_win_xwindow_get(sd);
5287 *ret = ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
5292 elm_win_quickpanel_priority_minor_set(Evas_Object *obj,
5296 eo_do(obj, elm_obj_win_quickpanel_priority_minor_set(priority));
5300 _quickpanel_priority_minor_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5302 int priority = va_arg(*list, int);
5303 Elm_Win_Smart_Data *sd = _pd;
5305 #ifdef HAVE_ELEMENTARY_X
5306 _elm_win_xwindow_get(sd);
5308 ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
5315 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
5317 ELM_WIN_CHECK(obj) - 1;
5319 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_minor_get(&ret));
5324 _quickpanel_priority_minor_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5326 int *ret = va_arg(*list, int *);
5327 Elm_Win_Smart_Data *sd = _pd;
5330 #ifdef HAVE_ELEMENTARY_X
5331 _elm_win_xwindow_get(sd);
5333 *ret = ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
5338 elm_win_quickpanel_zone_set(Evas_Object *obj,
5342 eo_do(obj, elm_obj_win_quickpanel_zone_set(zone));
5346 _quickpanel_zone_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5348 int zone = va_arg(*list, int);
5349 Elm_Win_Smart_Data *sd = _pd;
5351 #ifdef HAVE_ELEMENTARY_X
5352 _elm_win_xwindow_get(sd);
5354 ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
5361 elm_win_quickpanel_zone_get(const Evas_Object *obj)
5363 ELM_WIN_CHECK(obj) 0;
5365 eo_do((Eo *) obj, elm_obj_win_quickpanel_zone_get(&ret));
5370 _quickpanel_zone_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5372 int *ret = va_arg(*list, int *);
5373 Elm_Win_Smart_Data *sd = _pd;
5376 #ifdef HAVE_ELEMENTARY_X
5377 _elm_win_xwindow_get(sd);
5379 *ret = ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
5384 elm_win_prop_focus_skip_set(Evas_Object *obj,
5388 eo_do(obj, elm_obj_win_prop_focus_skip_set(skip));
5392 _prop_focus_skip_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5394 Eina_Bool skip = va_arg(*list, int);
5395 Elm_Win_Smart_Data *sd = _pd;
5397 sd->skip_focus = skip;
5398 TRAP(sd, focus_skip_set, skip);
5402 elm_win_illume_command_send(Evas_Object *obj,
5403 Elm_Illume_Command command,
5407 eo_do(obj, elm_obj_win_illume_command_send(command, params));
5411 _illume_command_send(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5413 Elm_Illume_Command command = va_arg(*list, Elm_Illume_Command);
5414 void *params = va_arg(*list, void *);
5416 Elm_Win_Smart_Data *sd = _pd;
5418 #ifdef HAVE_ELEMENTARY_X
5419 _elm_win_xwindow_get(sd);
5424 case ELM_ILLUME_COMMAND_FOCUS_BACK:
5425 ecore_x_e_illume_focus_back_send(sd->x.xwin);
5428 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
5429 ecore_x_e_illume_focus_forward_send(sd->x.xwin);
5432 case ELM_ILLUME_COMMAND_FOCUS_HOME:
5433 ecore_x_e_illume_focus_home_send(sd->x.xwin);
5436 case ELM_ILLUME_COMMAND_CLOSE:
5437 ecore_x_e_illume_close_send(sd->x.xwin);
5450 elm_win_inlined_image_object_get(Evas_Object *obj)
5452 ELM_WIN_CHECK(obj) NULL;
5453 Evas_Object *ret = NULL;
5454 eo_do(obj, elm_obj_win_inlined_image_object_get(&ret));
5459 _inlined_image_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5461 Evas_Object **ret = va_arg(*list, Evas_Object **);
5462 Elm_Win_Smart_Data *sd = _pd;
5467 elm_win_focus_highlight_enabled_set(Evas_Object *obj,
5471 eo_do(obj, elm_obj_win_focus_highlight_enabled_set(enabled));
5475 _focus_highlight_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5477 Eina_Bool enabled = va_arg(*list, int);
5478 Elm_Win_Smart_Data *sd = _pd;
5480 enabled = !!enabled;
5481 if (sd->focus_highlight.enabled == enabled)
5484 sd->focus_highlight.enabled = enabled;
5486 if (sd->focus_highlight.enabled)
5487 _elm_win_focus_highlight_init(sd);
5489 _elm_win_focus_highlight_shutdown(sd);
5493 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
5495 ELM_WIN_CHECK(obj) EINA_FALSE;
5496 Eina_Bool ret = EINA_FALSE;
5497 eo_do((Eo *) obj, elm_obj_win_focus_highlight_enabled_get(&ret));
5502 _focus_highlight_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5504 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5505 Elm_Win_Smart_Data *sd = _pd;
5506 *ret = sd->focus_highlight.enabled;
5510 elm_win_focus_highlight_style_set(Evas_Object *obj,
5514 eo_do(obj, elm_obj_win_focus_highlight_style_set(style));
5518 _elm_win_smart_theme(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
5520 Elm_Win_Smart_Data *sd = _pd;
5521 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5522 Eina_Bool int_ret = EINA_FALSE;
5524 if (ret) *ret = EINA_TRUE;
5526 eo_do_super(obj, MY_CLASS, elm_wdg_theme_apply(&int_ret));
5527 if (!int_ret) return;
5529 sd->focus_highlight.theme_changed = EINA_TRUE;
5530 _elm_win_focus_highlight_reconfigure_job_start(sd);
5532 if (ret) *ret = EINA_TRUE;
5536 _focus_highlight_style_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5538 const char *style = va_arg(*list, const char *);
5539 Elm_Win_Smart_Data *sd = _pd;
5541 eina_stringshare_replace(&sd->focus_highlight.style, style);
5542 sd->focus_highlight.theme_changed = EINA_TRUE;
5543 _elm_win_focus_highlight_reconfigure_job_start(sd);
5547 elm_win_focus_highlight_style_get(const Evas_Object *obj)
5549 ELM_WIN_CHECK(obj) NULL;
5550 const char *ret = NULL;
5551 eo_do((Eo *) obj, elm_obj_win_focus_highlight_style_get(&ret));
5556 _focus_highlight_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5558 const char **ret = va_arg(*list, const char **);
5559 Elm_Win_Smart_Data *sd = _pd;
5560 *ret = sd->focus_highlight.style;
5564 elm_win_focus_highlight_animate_set(Evas_Object *obj,
5568 eo_do(obj, elm_obj_win_focus_highlight_animate_set(animate));
5572 _focus_highlight_animate_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5574 Eina_Bool animate = va_arg(*list, int);
5575 Elm_Win_Smart_Data *sd = _pd;
5577 animate = !!animate;
5578 if (sd->focus_highlight.animate == animate)
5581 sd->focus_highlight.animate = animate;
5582 sd->focus_highlight.theme_changed = EINA_TRUE;
5583 _elm_win_focus_highlight_reconfigure_job_start(sd);
5587 elm_win_focus_highlight_animate_get(const Evas_Object *obj)
5589 ELM_WIN_CHECK(obj) EINA_FALSE;
5590 Eina_Bool ret = EINA_FALSE;
5591 eo_do((Eo *) obj, elm_obj_win_focus_highlight_animate_get(&ret));
5596 _focus_highlight_animate_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5598 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5599 Elm_Win_Smart_Data *sd = _pd;
5600 *ret = sd->focus_highlight.animate;
5604 elm_win_socket_listen(Evas_Object *obj,
5605 const char *svcname,
5609 ELM_WIN_CHECK(obj) EINA_FALSE;
5610 Eina_Bool ret = EINA_FALSE;
5611 eo_do(obj, elm_obj_win_socket_listen(svcname, svcnum, svcsys, &ret));
5616 _socket_listen(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5618 const char *svcname = va_arg(*list, const char *);
5619 int svcnum = va_arg(*list, int);
5620 Eina_Bool svcsys = va_arg(*list, int);
5621 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5622 Elm_Win_Smart_Data *sd = _pd;
5625 if (!sd->ee) return;
5627 if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
5633 /* windowing specific calls - shall we do this differently? */
5636 elm_win_xwindow_get(const Evas_Object *obj)
5640 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5642 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5643 return _elm_ee_xwin_get(ee);
5646 ELM_WIN_CHECK(obj) 0;
5647 Ecore_X_Window ret = 0;
5648 eo_do((Eo *) obj, elm_obj_win_xwindow_get(&ret));
5653 _xwindow_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5655 Ecore_X_Window *ret = va_arg(*list, Ecore_X_Window *);
5656 Elm_Win_Smart_Data *sd = _pd;
5658 #ifdef HAVE_ELEMENTARY_X
5666 *ret = elm_win_xwindow_get(sd->parent);
5673 EAPI Ecore_Wl_Window *
5674 elm_win_wl_window_get(const Evas_Object *obj)
5676 if (!obj) return NULL;
5678 if ((!ENGINE_COMPARE(ELM_WAYLAND_SHM)) &&
5679 (!ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5682 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5684 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5685 return _elm_ee_wlwin_get(ee);
5688 ELM_WIN_CHECK(obj) NULL;
5689 Ecore_Wl_Window *ret = NULL;
5690 eo_do((Eo *) obj, elm_obj_win_wl_window_get(&ret));
5695 _wl_window_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5697 Ecore_Wl_Window **ret = va_arg(*list, Ecore_Wl_Window **);
5698 #if HAVE_ELEMENTARY_WAYLAND
5699 Elm_Win_Smart_Data *sd = _pd;
5707 *ret = elm_win_wl_window_get(sd->parent);
5717 elm_win_trap_set(const Elm_Win_Trap *t)
5719 DBG("old %p, new %p", trap, t);
5721 if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
5723 CRI("trying to set a trap version %lu while %lu was expected!",
5724 t->version, ELM_WIN_TRAP_VERSION);
5733 elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
5736 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
5738 floating = !!floating;
5739 if (floating == sd->floating) return;
5740 sd->floating = floating;
5741 #ifdef HAVE_ELEMENTARY_X
5742 _elm_win_xwindow_get(sd);
5746 ecore_x_e_illume_window_state_set
5747 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING);
5749 ecore_x_e_illume_window_state_set
5750 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL);
5756 elm_win_floating_mode_get(const Evas_Object *obj)
5758 ELM_WIN_CHECK(obj) EINA_FALSE;
5759 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
5761 return sd->floating;
5765 _window_id_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5767 Ecore_Window *ret = va_arg(*list, Ecore_Window *);
5768 Elm_Win_Smart_Data *sd = _pd;
5770 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5772 #if HAVE_ELEMENTARY_WAYLAND
5775 *ret = (Ecore_Window)ecore_wl_window_surface_id_get(sd->wl.win);
5780 Ecore_Wl_Window *parent;
5782 parent = elm_win_wl_window_get(sd->parent);
5783 if (parent) *ret = (Ecore_Window)ecore_wl_window_surface_id_get(parent);
5790 #ifdef HAVE_ELEMENTARY_X
5791 _elm_win_xwindow_get(sd);
5794 *ret = (Ecore_Window)sd->x.xwin;
5799 *ret = (Ecore_Window)elm_win_xwindow_get(sd->parent);
5809 elm_win_window_id_get(const Evas_Object *obj)
5813 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5815 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5816 return ecore_evas_window_get(ee);
5819 ELM_WIN_CHECK(obj) 0;
5820 Ecore_Window ret = 0;
5821 eo_do((Eo *) obj, elm_obj_win_window_id_get(&ret));
5826 _class_constructor(Eo_Class *klass)
5828 const Eo_Op_Func_Description func_desc[] = {
5829 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
5830 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_win_smart_add),
5831 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_win_smart_del),
5832 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_win_smart_resize),
5833 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_win_smart_move),
5834 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_win_smart_show),
5835 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_win_smart_hide),
5837 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_win_smart_on_focus),
5838 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_win_smart_event),
5839 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_win_smart_focus_next_manager_is),
5840 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_win_smart_focus_next),
5841 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_win_smart_focus_direction_manager_is),
5842 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_win_smart_focus_direction),
5843 EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_APPLY), _elm_win_smart_theme),
5845 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), _win_constructor),
5846 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD), _resize_object_add),
5847 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), _resize_object_del),
5848 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TYPE_GET), _type_get),
5849 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_SET), _title_set),
5850 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_GET), _title_get),
5851 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET), _icon_name_set),
5852 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET), _icon_name_get),
5853 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_SET), _role_set),
5854 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_GET), _role_get),
5855 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET), _icon_object_set),
5856 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET), _icon_object_get),
5857 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET), _autodel_set),
5858 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET), _autodel_get),
5859 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ACTIVATE), _activate),
5860 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LOWER), _lower),
5861 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RAISE), _raise),
5862 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CENTER), _center),
5863 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET), _borderless_set),
5864 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET), _borderless_get),
5865 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_SET), _shaped_set),
5866 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_GET), _shaped_get),
5867 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_SET), _alpha_set),
5868 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_GET), _alpha_get),
5869 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET), _override_set),
5870 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET), _override_get),
5871 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET), _fullscreen_set),
5872 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET), _fullscreen_get),
5873 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET), _main_menu_get),
5874 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET), _maximized_set),
5875 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET), _maximized_get),
5876 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET), _iconified_set),
5877 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET), _iconified_get),
5878 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET), _withdrawn_set),
5879 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET), _withdrawn_get),
5880 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET), _available_profiles_set),
5881 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET), _available_profiles_get),
5882 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_SET), _profile_set),
5883 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_GET), _profile_get),
5884 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_SET), _urgent_set),
5885 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_GET), _urgent_get),
5886 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET), _demand_attention_set),
5887 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET), _demand_attention_get),
5888 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_SET), _modal_set),
5889 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_GET), _modal_get),
5890 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_SET), _aspect_set),
5891 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_GET), _aspect_get),
5892 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET), _size_base_set),
5893 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET), _size_base_get),
5894 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET), _size_step_set),
5895 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET), _size_step_get),
5896 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_SET), _layer_set),
5897 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_GET), _layer_get),
5898 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_SET), _rotation_set),
5899 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET), _rotation_with_resize_set),
5900 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_GET), _rotation_get),
5901 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_SET), _sticky_set),
5902 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_GET), _sticky_get),
5903 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET), _keyboard_mode_set),
5904 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET), _keyboard_mode_get),
5905 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET), _keyboard_win_set),
5906 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET), _keyboard_win_get),
5907 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET), _indicator_mode_set),
5908 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET), _indicator_mode_get),
5909 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET), _indicator_opacity_set),
5910 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET), _indicator_opacity_get),
5911 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET), _screen_position_get),
5912 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_GET), _focus_get),
5913 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET), _screen_constrain_set),
5914 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET), _screen_constrain_get),
5915 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET), _screen_size_get),
5916 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET), _screen_dpi_get),
5917 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET), _conformant_set),
5918 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET), _conformant_get),
5919 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET), _quickpanel_set),
5920 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET), _quickpanel_get),
5921 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET), _quickpanel_priority_major_set),
5922 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET), _quickpanel_priority_major_get),
5923 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET), _quickpanel_priority_minor_set),
5924 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET), _quickpanel_priority_minor_get),
5925 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET), _quickpanel_zone_set),
5926 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET), _quickpanel_zone_get),
5927 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET), _prop_focus_skip_set),
5928 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND), _illume_command_send),
5929 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET), _inlined_image_object_get),
5930 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET), _focus_highlight_enabled_set),
5931 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET), _focus_highlight_enabled_get),
5932 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET), _focus_highlight_style_set),
5933 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET), _focus_highlight_style_get),
5934 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET), _focus_highlight_animate_set),
5935 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET), _focus_highlight_animate_get),
5936 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN), _socket_listen),
5937 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), _xwindow_get),
5938 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), _wl_window_get),
5939 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), _window_id_get),
5940 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET), _wm_rotation_supported_get),
5941 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET), _wm_preferred_rotation_set),
5942 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET), _wm_preferred_rotation_get),
5943 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET), _wm_available_rotations_set),
5944 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET), _wm_available_rotations_get),
5945 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET), _wm_manual_rotation_done_set),
5946 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET), _wm_manual_rotation_done_get),
5947 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE), _wm_manual_rotation_done),
5952 eo_class_funcs_set(klass, func_desc);
5954 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
5957 static const Eo_Op_Description op_desc[] = {
5958 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR, "Adds a window object."),
5959 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD, "Add subobj as a resize object of window obj."),
5960 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL, "Delete subobj as a resize object of window obj."),
5961 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TYPE_GET, "Get the type of the window."),
5962 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_SET, "Set the title of the window."),
5963 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_GET, "Get the title of the window."),
5964 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET, "Set the icon name of the window."),
5965 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET, "Get the icon name of the window."),
5966 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_SET, "Set the role of the window."),
5967 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_GET, "Get the role of the window."),
5968 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET, "Set a window object's icon."),
5969 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET, "Get the icon object used for the window."),
5970 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET, "Set the window's autodel state."),
5971 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET, "Get the window's autodel state."),
5972 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ACTIVATE, "Activate a window object."),
5973 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LOWER, "Lower a window object."),
5974 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RAISE, "Raise a window object."),
5975 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CENTER, "Center a window on its screen."),
5976 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET, "Set the borderless state of a window."),
5977 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET, "Get the borderless state of a window."),
5978 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_SET, "Set the shaped state of a window."),
5979 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_GET, "Get the shaped state of a window."),
5980 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_SET, "Set the alpha channel state of a window."),
5981 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_GET, "Get the alpha channel state of a window."),
5982 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET, "Set the override state of a window."),
5983 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET, "Get the override state of a window."),
5984 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET, "Set the fullscreen state of a window."),
5985 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET, "Get the fullscreen state of a window."),
5986 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET, "Get the Main Menu of a window."),
5987 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET, "Set the maximized state of a window."),
5988 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET, "Get the maximized state of a window."),
5989 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET, "Set the iconified state of a window."),
5990 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET, "Get the iconified state of a window."),
5991 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET, "Set the withdrawn state of a window."),
5992 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET, "Get the withdrawn state of a window."),
5993 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET, "Set the array of available profiles to a window."),
5994 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET, "Get the array of available profiles of a window."),
5995 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_SET, "Set the profile of a window."),
5996 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_GET, "Get the profile of a window."),
5997 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_SET, "Set the urgent state of a window."),
5998 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_GET, "Get the urgent state of a window."),
5999 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET, "Set the demand_attention state of a window."),
6000 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET, "Get the demand_attention state of a window."),
6001 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_SET, "Set the modal state of a window."),
6002 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_GET, "Get the modal state of a window."),
6003 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_SET, "Set the aspect ratio of a window."),
6004 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_GET, "Get the aspect ratio of a window."),
6005 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET, "Set the base window size used with stepping calculation."),
6006 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET, "Get the base size of a window."),
6007 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET, "Set the window stepping used with sizing calculation."),
6008 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET, "Get the stepping of a window."),
6009 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_SET, "Set the layer of the window."),
6010 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_GET, "Get the layer of the window."),
6011 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_SET, "Set the rotation of the window."),
6012 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET, "Rotates the window and resizes it."),
6013 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_GET, "Get the rotation of the window."),
6014 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_SET, "Set the sticky state of the window."),
6015 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_GET, "Get the sticky state of the window."),
6016 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET, "Sets the keyboard mode of the window."),
6017 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET, "Get the keyboard mode of the window."),
6018 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET, "Sets whether the window is a keyboard."),
6019 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET, "Get whether the window is a keyboard."),
6020 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET, "Sets the indicator mode of the window."),
6021 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET, "Get the indicator mode of the window."),
6022 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET, "Sets the indicator opacity mode of the window."),
6023 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET, "Get the indicator opacity mode of the window."),
6024 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET, "Get the screen position of a window."),
6025 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_GET, "Determine whether a window has focus."),
6026 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."),
6027 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."),
6028 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET, "Get screen geometry details for the screen that a window is on."),
6029 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET, "Get screen dpi for the screen that a window is on."),
6030 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET, "Set if this window is an illume conformant window."),
6031 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET, "Get if this window is an illume conformant window."),
6032 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET, "Set a window to be an illume quickpanel window."),
6033 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET, "Get if this window is a quickpanel or not."),
6034 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET, "Set the major priority of a quickpanel window."),
6035 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET, "Get the major priority of a quickpanel window."),
6036 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET, "Set the minor priority of a quickpanel window."),
6037 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET, "Get the minor priority of a quickpanel window."),
6038 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET, "Set which zone this quickpanel should appear in."),
6039 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET, "Get which zone this quickpanel should appear in."),
6040 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET, "Set the window to be skipped by keyboard focus."),
6041 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND, "Send a command to the windowing environment."),
6042 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET, "Get the inlined image object handle."),
6043 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET, "Set the enabled status for the focus highlight in a window."),
6044 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET, "Get the enabled value of the focus highlight for this window."),
6045 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET, "Set the style for the focus highlight on this window."),
6046 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET, "Get the style set for the focus highlight object."),
6047 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET, "Set the animate status for the focus highlight for this window."),
6048 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET, "Get the animate status for the focus highlight for this window."),
6049 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN, "Create a socket to provide the service for Plug widget."),
6050 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, "Get the Ecore_X_Window of an Evas_Object."),
6051 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, "Get the Ecore_Wl_Window of an Evas_Object."),
6052 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET, "Get the Ecore_Window of an Evas_Object."),
6053 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET, "Query if the underlying windowing system supports the window manager rotation.."),
6054 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET, "Set the preferred rotation hint."),
6055 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET, "Get the preferred rotation hint."),
6056 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET, "Set the array of available window rotations."),
6057 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET, "Get the array of available window rotations."),
6058 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET, "Set manual rotation done mode of obj window."),
6059 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET, "Get manual rotation done mode of obj window."),
6060 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE, "Set rotation finish manually"),
6061 EO_OP_DESCRIPTION_SENTINEL
6064 static const Eo_Class_Description class_desc = {
6067 EO_CLASS_TYPE_REGULAR,
6068 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WIN_BASE_ID, op_desc, ELM_OBJ_WIN_SUB_ID_LAST),
6070 sizeof(Elm_Win_Smart_Data),
6075 EO_DEFINE_CLASS(elm_obj_win_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);