2 # include "elementary_config.h"
5 #include <Elementary.h>
6 #include <Elementary_Cursor.h>
9 #include "elm_widget_menu.h"
11 EAPI Eo_Op ELM_OBJ_WIN_BASE_ID = EO_NOOP;
13 #define MY_CLASS ELM_OBJ_WIN_CLASS
15 #define MY_CLASS_NAME "Elm_Win"
16 #define MY_CLASS_NAME_LEGACY "elm_win"
18 static const Elm_Win_Trap *trap = NULL;
20 #define TRAP(sd, name, ...) \
23 if ((!trap) || (!trap->name) || \
25 (trap->name(sd->trap_data, sd->obj, ## __VA_ARGS__)))) \
26 ecore_evas_##name(sd->ee, ##__VA_ARGS__); \
30 #define ELM_WIN_DATA_GET(o, sd) \
31 Elm_Win_Smart_Data * sd = eo_data_scope_get(o, MY_CLASS)
33 #define ELM_WIN_DATA_GET_OR_RETURN(o, ptr) \
34 ELM_WIN_DATA_GET(o, ptr); \
37 CRI("No widget data for object %p (%s)", \
38 o, evas_object_type_get(o)); \
42 #define ELM_WIN_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
43 ELM_WIN_DATA_GET(o, ptr); \
46 CRI("No widget data for object %p (%s)", \
47 o, evas_object_type_get(o)); \
51 #define ELM_WIN_CHECK(obj) \
52 if (!obj || !eo_isa(obj, MY_CLASS)) \
55 #define ENGINE_GET() (_elm_preferred_engine ? _elm_preferred_engine : (_elm_config->engine ? _elm_config->engine : ""))
56 #define ENGINE_COMPARE(name) (!strcmp(ENGINE_GET(), name))
58 typedef struct _Elm_Win_Smart_Data Elm_Win_Smart_Data;
60 struct _Elm_Win_Smart_Data
64 Evas_Object *parent; /* parent *window* object*/
65 Evas_Object *img_obj, *frame_obj;
66 Evas_Object *client_obj; /* rect representing the client */
67 Evas_Object *spacer_obj;
70 Evas_Object *obj; /* The object itself */
71 #ifdef HAVE_ELEMENTARY_X
75 Ecore_Event_Handler *client_message_handler;
76 Ecore_Event_Handler *property_handler;
79 #ifdef HAVE_ELEMENTARY_WAYLAND
86 Ecore_Job *deferred_resize_job;
87 Ecore_Job *deferred_child_eval_job;
90 Elm_Win_Keyboard_Mode kbdmode;
91 Elm_Win_Indicator_Mode indmode;
92 Elm_Win_Indicator_Opacity_Mode ind_o_mode;
101 int *autodel_clear, rot;
110 Evas_Object *obj, *hot_obj;
115 Evas_Object *fobj; /* focus highlight edje object */
120 Eina_Bool visible : 1;
121 Eina_Bool in_theme: 1; /**< focus highlight is handled by theme.
122 this is set true if edc data item "focus_highlight" is set to "on" during focus in callback. */
126 Ecore_Job *reconf_job;
128 Eina_Bool enabled : 1;
129 Eina_Bool theme_changed : 1; /* set true when the focus theme is changed */
130 Eina_Bool animate : 1; /* set true when the focus highlight animate is enabled */
131 Eina_Bool animate_supported : 1; /* set true when the focus highlight animate is supported by theme */
132 Eina_Bool geometry_changed : 1;
137 const char *icon_name;
140 Evas_Object *main_menu;
145 const char **available_list;
150 int preferred_rot; /* indicates preferred rotation value, -1 means invalid. */
151 int *rots; /* indicates available rotations */
152 unsigned int count; /* number of elements in available rotations */
153 Eina_Bool wm_supported : 1; /* set true when the window manager support window rotation */
154 Eina_Bool use : 1; /* set ture when application use window manager rotation. */
160 int size_base_w, size_base_h;
161 int size_step_w, size_step_h;
163 Eina_Bool urgent : 1;
165 Eina_Bool demand_attention : 1;
166 Eina_Bool autodel : 1;
167 Eina_Bool constrain : 1;
168 Eina_Bool resizing : 1;
169 Eina_Bool iconified : 1;
170 Eina_Bool withdrawn : 1;
171 Eina_Bool sticky : 1;
172 Eina_Bool fullscreen : 1;
173 Eina_Bool maximized : 1;
174 Eina_Bool skip_focus : 1;
175 Eina_Bool floating : 1;
178 static const char SIG_DELETE_REQUEST[] = "delete,request";
179 static const char SIG_FOCUS_OUT[] = "focus,out"; // deprecated. use "focused" instead.
180 static const char SIG_FOCUS_IN[] = "focus,in"; // deprecated. use "unfocused" instead.
181 static const char SIG_MOVED[] = "moved";
182 static const char SIG_WITHDRAWN[] = "withdrawn";
183 static const char SIG_ICONIFIED[] = "iconified";
184 static const char SIG_NORMAL[] = "normal";
185 static const char SIG_STICK[] = "stick";
186 static const char SIG_UNSTICK[] = "unstick";
187 static const char SIG_FULLSCREEN[] = "fullscreen";
188 static const char SIG_UNFULLSCREEN[] = "unfullscreen";
189 static const char SIG_MAXIMIZED[] = "maximized";
190 static const char SIG_UNMAXIMIZED[] = "unmaximized";
191 static const char SIG_IOERR[] = "ioerr";
192 static const char SIG_INDICATOR_PROP_CHANGED[] = "indicator,prop,changed";
193 static const char SIG_ROTATION_CHANGED[] = "rotation,changed";
194 static const char SIG_PROFILE_CHANGED[] = "profile,changed";
195 static const char SIG_FOCUSED[] = "focused";
196 static const char SIG_UNFOCUSED[] = "unfocused";
197 static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed";
199 static const Evas_Smart_Cb_Description _smart_callbacks[] = {
200 {SIG_DELETE_REQUEST, ""},
209 {SIG_FULLSCREEN, ""},
210 {SIG_UNFULLSCREEN, ""},
212 {SIG_UNMAXIMIZED, ""},
214 {SIG_INDICATOR_PROP_CHANGED, ""},
215 {SIG_ROTATION_CHANGED, ""},
216 {SIG_PROFILE_CHANGED, ""},
219 {SIG_WM_ROTATION_CHANGED, ""},
223 Eina_List *_elm_win_list = NULL;
224 int _elm_win_deferred_free = 0;
226 static int _elm_win_count = 0;
228 static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
230 static Ecore_Job *_elm_win_state_eval_job = NULL;
233 _elm_win_on_resize_obj_changed_size_hints(void *data,
238 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj);
240 #ifdef HAVE_ELEMENTARY_X
241 static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd);
244 EAPI double _elm_startup_time = 0;
247 _elm_win_first_frame_do(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
249 double end = ecore_time_unix_get();
257 case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f' sec\n", end, _elm_startup_time, end - _elm_startup_time);
261 evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, data);
265 _elm_win_state_eval(void *data EINA_UNUSED)
269 int _elm_win_count_shown = 0;
270 int _elm_win_count_iconified = 0;
271 int _elm_win_count_withdrawn = 0;
273 _elm_win_state_eval_job = NULL;
275 if (_elm_config->auto_norender_withdrawn)
277 EINA_LIST_FOREACH(_elm_win_list, l, obj)
279 if ((elm_win_withdrawn_get(obj)) ||
280 ((elm_win_iconified_get(obj) &&
281 (_elm_config->auto_norender_iconified_same_as_withdrawn))))
283 if (!evas_object_data_get(obj, "__win_auto_norender"))
285 Evas *evas = evas_object_evas_get(obj);
287 elm_win_norender_push(obj);
288 evas_object_data_set(obj, "__win_auto_norender", obj);
290 if (_elm_config->auto_flush_withdrawn)
292 edje_file_cache_flush();
293 edje_collection_cache_flush();
294 evas_image_cache_flush(evas);
295 evas_font_cache_flush(evas);
297 if (_elm_config->auto_dump_withdrawn)
299 evas_render_dump(evas);
305 if (evas_object_data_get(obj, "__win_auto_norender"))
307 elm_win_norender_pop(obj);
308 evas_object_data_del(obj, "__win_auto_norender");
313 if (((_elm_config->auto_throttle) &&
314 (elm_policy_get(ELM_POLICY_THROTTLE) != ELM_POLICY_THROTTLE_NEVER)) ||
315 (elm_policy_get(ELM_POLICY_THROTTLE) == ELM_POLICY_THROTTLE_HIDDEN_ALWAYS))
317 if (_elm_win_count == 0)
319 if (_elm_win_auto_throttled)
321 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
322 _elm_win_auto_throttled = EINA_FALSE;
327 EINA_LIST_FOREACH(_elm_win_list, l, obj)
329 if (elm_win_withdrawn_get(obj))
330 _elm_win_count_withdrawn++;
331 else if (elm_win_iconified_get(obj))
332 _elm_win_count_iconified++;
333 else if (evas_object_visible_get(obj))
334 _elm_win_count_shown++;
336 if (_elm_win_count_shown <= 0)
338 if (!_elm_win_auto_throttled)
340 ecore_throttle_adjust(_elm_config->auto_throttle_amount);
341 _elm_win_auto_throttled = EINA_TRUE;
346 if (_elm_win_auto_throttled)
348 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
349 _elm_win_auto_throttled = EINA_FALSE;
357 _elm_win_state_eval_queue(void)
359 ecore_job_del(_elm_win_state_eval_job);
360 _elm_win_state_eval_job = ecore_job_add(_elm_win_state_eval, NULL);
363 // example shot spec (wait 0.1 sec then save as my-window.png):
364 // ELM_ENGINE="shot:delay=0.1:file=my-window.png"
367 _shot_delay_get(Elm_Win_Smart_Data *sd)
370 char *d = strdup(sd->shot.info);
373 for (p = (char *)sd->shot.info; *p; p++)
375 if (!strncmp(p, "delay=", 6))
379 for (pd = d, p += 6; (*p) && (*p != ':'); p++, pd++)
395 _shot_file_get(Elm_Win_Smart_Data *sd)
398 char *tmp = strdup(sd->shot.info);
399 char *repname = NULL;
401 if (!tmp) return NULL;
403 for (p = (char *)sd->shot.info; *p; p++)
405 if (!strncmp(p, "file=", 5))
408 if (!sd->shot.repeat_count) return tmp;
411 char *dotptr = strrchr(tmp, '.');
414 size_t size = sizeof(char) * (strlen(tmp) + 16);
415 repname = malloc(size);
416 strncpy(repname, tmp, dotptr - tmp);
417 snprintf(repname + (dotptr - tmp), size -
418 (dotptr - tmp), "%03i",
419 sd->shot.shot_counter + 1);
420 strcat(repname, dotptr);
428 if (!sd->shot.repeat_count) return strdup("out.png");
430 repname = malloc(sizeof(char) * 24);
431 snprintf(repname, sizeof(char) * 24, "out%03i.png",
432 sd->shot.shot_counter + 1);
438 _shot_repeat_count_get(Elm_Win_Smart_Data *sd)
441 char *d = strdup(sd->shot.info);
444 for (p = (char *)sd->shot.info; *p; p++)
446 if (!strncmp(p, "repeat=", 7))
450 for (pd = d, p += 7; (*p) && (*p != ':'); p++, pd++)
457 if (v > 1000) v = 999;
468 _shot_key_get(Elm_Win_Smart_Data *sd EINA_UNUSED)
474 _shot_flags_get(Elm_Win_Smart_Data *sd EINA_UNUSED)
480 _shot_do(Elm_Win_Smart_Data *sd)
484 unsigned int *pixels;
486 char *file, *key, *flags;
488 ecore_evas_manual_render(sd->ee);
489 pixels = (void *)ecore_evas_buffer_pixels_get(sd->ee);
492 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
493 if ((w < 1) || (h < 1)) return;
495 file = _shot_file_get(sd);
498 key = _shot_key_get(sd);
499 flags = _shot_flags_get(sd);
500 ee = ecore_evas_buffer_new(1, 1);
501 o = evas_object_image_add(ecore_evas_get(ee));
502 evas_object_image_alpha_set(o, ecore_evas_alpha_get(sd->ee));
503 evas_object_image_size_set(o, w, h);
504 evas_object_image_data_set(o, pixels);
505 if (!evas_object_image_save(o, file, key, flags))
507 ERR("Cannot save window to '%s' (key '%s', flags '%s')",
514 if (sd->shot.repeat_count) sd->shot.shot_counter++;
518 _shot_delay(void *data)
520 ELM_WIN_DATA_GET(data, sd);
523 if (sd->shot.repeat_count)
525 int remainshot = (sd->shot.repeat_count - sd->shot.shot_counter);
526 if (remainshot > 0) return EINA_TRUE;
528 sd->shot.timer = NULL;
535 _shot_init(Elm_Win_Smart_Data *sd)
537 if (!sd->shot.info) return;
539 sd->shot.repeat_count = _shot_repeat_count_get(sd);
540 sd->shot.shot_counter = 0;
544 _shot_handle(Elm_Win_Smart_Data *sd)
546 if (!sd->shot.info) return;
549 sd->shot.timer = ecore_timer_add(_shot_delay_get(sd), _shot_delay,
553 /* elm-win specific associate, does the trap while ecore_evas_object_associate()
556 static Elm_Win_Smart_Data *
557 _elm_win_associate_get(const Ecore_Evas *ee)
559 Evas_Object *obj = ecore_evas_data_get(ee, "elm_win");
560 if (!obj) return NULL;
561 ELM_WIN_DATA_GET(obj, sd);
565 /* Interceptors Callbacks */
567 _elm_win_obj_intercept_raise(void *data, Evas_Object *obj EINA_UNUSED)
569 ELM_WIN_DATA_GET(data, sd);
574 _elm_win_obj_intercept_lower(void *data, Evas_Object *obj EINA_UNUSED)
576 ELM_WIN_DATA_GET(data, sd);
581 _elm_win_obj_intercept_stack_above(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *above EINA_UNUSED)
583 INF("TODO: %s", __FUNCTION__);
587 _elm_win_obj_intercept_stack_below(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *below EINA_UNUSED)
589 INF("TODO: %s", __FUNCTION__);
593 _elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj EINA_UNUSED, int l)
595 ELM_WIN_DATA_GET(data, sd);
596 TRAP(sd, layer_set, l);
599 /* Event Callbacks */
602 _elm_win_obj_callback_changed_size_hints(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
604 ELM_WIN_DATA_GET(data, sd);
607 evas_object_size_hint_min_get(obj, &w, &h);
608 TRAP(sd, size_min_set, w, h);
610 evas_object_size_hint_max_get(obj, &w, &h);
613 TRAP(sd, size_max_set, w, h);
615 /* end of elm-win specific associate */
618 _elm_win_move(Ecore_Evas *ee)
620 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
625 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
628 evas_object_smart_callback_call(sd->obj, SIG_MOVED, NULL);
632 _elm_win_resize_job(void *data)
634 ELM_WIN_DATA_GET(data, sd);
637 sd->deferred_resize_job = NULL;
638 ecore_evas_request_geometry_get(sd->ee, NULL, NULL, &w, &h);
642 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
651 evas_output_framespace_get(sd->evas, &fx, &fy, &fw, &fh);
652 evas_object_move(sd->frame_obj, -fx, -fy);
653 evas_object_resize(sd->frame_obj, w + fw, h + fh);
656 evas_object_resize(sd->obj, w, h);
657 evas_object_resize(sd->layout, w, h);
661 _elm_win_resize(Ecore_Evas *ee)
663 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
666 ecore_job_del(sd->deferred_resize_job);
667 sd->deferred_resize_job = ecore_job_add(_elm_win_resize_job, sd->obj);
671 _elm_win_mouse_in(Ecore_Evas *ee)
673 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
676 if (sd->resizing) sd->resizing = EINA_FALSE;
680 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win_Smart_Data *sd)
682 ELM_SAFE_FREE(sd->focus_highlight.reconf_job, ecore_job_del);
686 _elm_win_focus_highlight_visible_set(Elm_Win_Smart_Data *sd,
689 Evas_Object *fobj = sd->focus_highlight.fobj;
694 evas_object_show(fobj);
695 edje_object_signal_emit(fobj, "elm,action,focus,show", "elm");
699 edje_object_signal_emit(fobj, "elm,action,focus,hide", "elm");
704 _elm_win_focus_highlight_anim_setup(Elm_Win_Smart_Data *sd,
707 Evas_Coord tx, ty, tw, th;
708 Evas_Coord w, h, px, py, pw, ph;
709 Edje_Message_Int_Set *m;
710 Evas_Object *previous = sd->focus_highlight.prev.target;
711 Evas_Object *target = sd->focus_highlight.cur.target;
713 evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
714 elm_widget_focus_highlight_geometry_get(target, &tx, &ty, &tw, &th, EINA_TRUE);
715 elm_widget_focus_highlight_geometry_get(previous, &px, &py, &pw, &ph, EINA_FALSE);
716 evas_object_move(obj, tx, ty);
717 evas_object_resize(obj, tw, th);
719 if (!_elm_config->focus_highlight_clip_disable)
720 evas_object_clip_unset(obj);
722 m = alloca(sizeof(*m) + (sizeof(int) * 8));
732 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
736 _elm_win_focus_highlight_simple_setup(Elm_Win_Smart_Data *sd,
739 Evas_Object *clip, *target = sd->focus_highlight.cur.target;
740 Evas_Coord x, y, w, h;
742 elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE);
744 evas_object_move(obj, x, y);
745 evas_object_resize(obj, w, h);
747 if (!_elm_config->focus_highlight_clip_disable)
749 clip = evas_object_clip_get(target);
750 if (clip) evas_object_clip_set(obj, clip);
755 _elm_win_focus_highlight_reconfigure_job(void *data)
757 ELM_WIN_DATA_GET(data, sd);
758 Evas_Object *target = sd->focus_highlight.cur.target;
759 Evas_Object *previous = sd->focus_highlight.prev.target;
760 Evas_Object *fobj = sd->focus_highlight.fobj;
761 Eina_Bool visible_changed;
762 Eina_Bool common_visible;
763 const char *sig = NULL;
764 const char *focus_style_target = NULL;
765 const char *focus_style_previous = NULL;
767 _elm_win_focus_highlight_reconfigure_job_stop(sd);
769 visible_changed = (sd->focus_highlight.cur.visible !=
770 sd->focus_highlight.prev.visible);
772 if ((target == previous) && (!visible_changed) &&
773 (!sd->focus_highlight.geometry_changed) &&
774 (!sd->focus_highlight.theme_changed))
777 if ((previous) && (sd->focus_highlight.prev.in_theme))
778 elm_widget_signal_emit
779 (previous, "elm,action,focus_highlight,hide", "elm");
782 common_visible = EINA_FALSE;
783 else if (sd->focus_highlight.cur.in_theme)
785 common_visible = EINA_FALSE;
786 if (sd->focus_highlight.cur.visible)
787 sig = "elm,action,focus_highlight,show";
789 sig = "elm,action,focus_highlight,hide";
792 common_visible = sd->focus_highlight.cur.visible;
795 elm_widget_signal_emit(target, sig, "elm");
797 if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
801 focus_style_previous = elm_widget_focus_highlight_style_get(previous);
802 focus_style_target = elm_widget_focus_highlight_style_get(target);
804 if (sd->focus_highlight.theme_changed ||
805 (focus_style_target != focus_style_previous))
809 if (focus_style_target)
810 str = focus_style_target;
811 else if (sd->focus_highlight.style)
812 str = sd->focus_highlight.style;
816 elm_widget_theme_object_set
817 (sd->obj, fobj, "focus_highlight", "top", str);
818 sd->focus_highlight.theme_changed = EINA_FALSE;
820 if (sd->focus_highlight.animate)
822 str = edje_object_data_get(sd->focus_highlight.fobj, "animate");
823 sd->focus_highlight.animate_supported = ((str) && (!strcmp(str, "on")));
826 sd->focus_highlight.animate_supported = EINA_FALSE;
829 if ((sd->focus_highlight.animate_supported) && (previous) &&
830 (!sd->focus_highlight.prev.in_theme))
831 _elm_win_focus_highlight_anim_setup(sd, fobj);
833 _elm_win_focus_highlight_simple_setup(sd, fobj);
834 evas_object_raise(fobj);
837 _elm_win_focus_highlight_visible_set(sd, common_visible);
838 sd->focus_highlight.geometry_changed = EINA_FALSE;
839 sd->focus_highlight.prev = sd->focus_highlight.cur;
843 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win_Smart_Data *sd)
845 ecore_job_del(sd->focus_highlight.reconf_job);
847 sd->focus_highlight.reconf_job = ecore_job_add(
848 _elm_win_focus_highlight_reconfigure_job, sd->obj);
852 _elm_win_focus_in(Ecore_Evas *ee)
854 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
856 unsigned int order = 0;
862 _elm_widget_top_win_focused_set(obj, EINA_TRUE);
863 if (!elm_widget_focus_order_get(obj)
864 || (obj == elm_widget_newest_focus_order_get(obj, &order, EINA_TRUE)))
866 elm_widget_focus_steal(obj);
869 elm_widget_focus_restore(obj);
870 evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
871 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
872 sd->focus_highlight.cur.visible = EINA_TRUE;
873 _elm_win_focus_highlight_reconfigure_job_start(sd);
876 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
880 /* else if (sd->img_obj) */
886 _elm_win_focus_out(Ecore_Evas *ee)
888 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
895 elm_object_focus_set(obj, EINA_FALSE);
896 _elm_widget_top_win_focused_set(obj, EINA_FALSE);
897 evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
898 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
899 sd->focus_highlight.cur.visible = EINA_FALSE;
900 _elm_win_focus_highlight_reconfigure_job_start(sd);
903 edje_object_signal_emit(sd->frame_obj, "elm,action,unfocus", "elm");
907 _elm_access_object_highlight_disable(evas_object_evas_get(obj));
910 /* if (sd->img_obj) */
916 _elm_win_available_profiles_del(Elm_Win_Smart_Data *sd)
918 if (!sd->profile.available_list) return;
921 for (i = 0; i < sd->profile.count; i++)
922 ELM_SAFE_FREE(sd->profile.available_list[i], eina_stringshare_del);
923 sd->profile.count = 0;
924 ELM_SAFE_FREE(sd->profile.available_list, free);
928 _elm_win_profile_del(Elm_Win_Smart_Data *sd)
930 ELM_SAFE_FREE(sd->profile.name, eina_stringshare_del);
934 _elm_win_profile_set(Elm_Win_Smart_Data *sd, const char *profile)
936 Eina_Bool changed = EINA_FALSE;
939 if (sd->profile.name)
941 if (strcmp(sd->profile.name, profile) != 0)
943 eina_stringshare_replace(&(sd->profile.name), profile);
949 sd->profile.name = eina_stringshare_add(profile);
954 _elm_win_profile_del(sd);
960 _elm_win_profile_update(Elm_Win_Smart_Data *sd)
962 if (sd->profile.available_list)
964 Eina_Bool found = EINA_FALSE;
965 if (sd->profile.name)
968 for (i = 0; i < sd->profile.count; i++)
970 if (!strcmp(sd->profile.name,
971 sd->profile.available_list[i]))
979 /* If current profile is not present in an available profiles,
980 * change current profile to the 1st element of an array.
983 _elm_win_profile_set(sd, sd->profile.available_list[0]);
986 _elm_config_profile_set(sd->profile.name);
990 Eina_List *sub, *l = NULL;
992 sub = ecore_evas_sub_ecore_evas_list_get(sd->ee);
993 EINA_LIST_FOREACH(sub, l, ee2)
994 ecore_evas_window_profile_set(ee2, sd->profile.name);
996 evas_object_smart_callback_call(sd->obj, SIG_PROFILE_CHANGED, NULL);
1000 _elm_win_state_change(Ecore_Evas *ee)
1002 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1004 Eina_Bool ch_withdrawn = EINA_FALSE;
1005 Eina_Bool ch_sticky = EINA_FALSE;
1006 Eina_Bool ch_iconified = EINA_FALSE;
1007 Eina_Bool ch_fullscreen = EINA_FALSE;
1008 Eina_Bool ch_maximized = EINA_FALSE;
1009 Eina_Bool ch_profile = EINA_FALSE;
1010 Eina_Bool ch_wm_rotation = EINA_FALSE;
1011 const char *profile;
1017 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
1019 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
1020 ch_withdrawn = EINA_TRUE;
1022 if (sd->sticky != ecore_evas_sticky_get(sd->ee))
1024 sd->sticky = ecore_evas_sticky_get(sd->ee);
1025 ch_sticky = EINA_TRUE;
1027 if (sd->iconified != ecore_evas_iconified_get(sd->ee))
1029 sd->iconified = ecore_evas_iconified_get(sd->ee);
1030 ch_iconified = EINA_TRUE;
1032 if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee))
1034 sd->fullscreen = ecore_evas_fullscreen_get(sd->ee);
1035 ch_fullscreen = EINA_TRUE;
1037 if (sd->maximized != ecore_evas_maximized_get(sd->ee))
1039 sd->maximized = ecore_evas_maximized_get(sd->ee);
1040 ch_maximized = EINA_TRUE;
1043 profile = ecore_evas_window_profile_get(sd->ee);
1044 ch_profile = _elm_win_profile_set(sd, profile);
1048 if (sd->rot != ecore_evas_rotation_get(sd->ee))
1050 sd->rot = ecore_evas_rotation_get(sd->ee);
1051 ch_wm_rotation = EINA_TRUE;
1055 _elm_win_state_eval_queue();
1057 if ((ch_withdrawn) || (ch_iconified))
1060 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL);
1061 else if (sd->iconified)
1062 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL);
1064 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL);
1069 evas_object_smart_callback_call(obj, SIG_STICK, NULL);
1071 evas_object_smart_callback_call(obj, SIG_UNSTICK, NULL);
1076 evas_object_smart_callback_call(obj, SIG_FULLSCREEN, NULL);
1078 evas_object_smart_callback_call(obj, SIG_UNFULLSCREEN, NULL);
1083 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL);
1085 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL);
1089 _elm_win_profile_update(sd);
1093 evas_object_size_hint_min_set(obj, -1, -1);
1094 evas_object_size_hint_max_set(obj, -1, -1);
1095 #ifdef HAVE_ELEMENTARY_X
1096 _elm_win_xwin_update(sd);
1098 elm_widget_orientation_set(obj, sd->rot);
1099 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
1100 evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
1105 _elm_win_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1107 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1112 _elm_win_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1114 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
1115 Evas_Object **next = va_arg(*list, Evas_Object **);
1116 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1117 if (ret) *ret = EINA_FALSE;
1119 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1121 const Eina_List *items;
1122 void *(*list_data_get)(const Eina_List *list);
1127 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1129 items = wd->subobjs;
1133 list_data_get = eina_list_data_get;
1135 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
1139 if (ret) *ret = EINA_TRUE;
1143 *next = (Evas_Object *)obj;
1148 _elm_win_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
1150 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1155 _elm_win_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1157 const Evas_Object *base = va_arg(*list, Evas_Object *);
1158 double degree = va_arg(*list, double);
1159 Evas_Object **direction = va_arg(*list, Evas_Object **);
1160 double *weight = va_arg(*list, double *);
1161 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1162 if (ret) *ret = EINA_FALSE;
1163 Eina_Bool int_ret = EINA_FALSE;
1165 const Eina_List *items;
1166 void *(*list_data_get)(const Eina_List *list);
1168 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1173 if (!(items = elm_widget_focus_custom_chain_get(obj)))
1174 items = wd->subobjs;
1176 list_data_get = eina_list_data_get;
1178 int_ret = elm_widget_focus_list_direction_get
1179 (obj, base, items, list_data_get, degree, direction, weight);
1180 if (ret) *ret = int_ret;
1185 _elm_win_smart_on_focus(Eo *obj, void *_pd, va_list *list)
1187 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1188 if (ret) *ret = EINA_TRUE;
1189 Elm_Win_Smart_Data *sd = _pd;
1190 Eina_Bool int_ret = EINA_FALSE;
1192 eo_do_super(obj, MY_CLASS, elm_obj_widget_on_focus(&int_ret));
1193 if (!int_ret) return;
1196 evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));
1198 evas_object_focus_set(obj, elm_widget_focus_get(obj));
1202 _elm_win_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1204 Evas_Object *src = va_arg(*list, Evas_Object *);
1205 Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
1206 Evas_Event_Key_Down *ev = va_arg(*list, void *);
1207 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1209 if (ret) *ret = EINA_FALSE;
1212 if (elm_widget_disabled_get(obj)) return;
1213 if (type != EVAS_CALLBACK_KEY_DOWN) return;
1215 if ((!strcmp(ev->key, "Tab")) ||
1216 (!strcmp(ev->key, "ISO_Left_Tab")))
1218 if (evas_key_modifier_is_set(ev->modifiers, "Control") ||
1219 evas_key_modifier_is_set(ev->modifiers, "Alt"))
1221 if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
1222 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1224 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1228 else if ((!strcmp(ev->key, "Left")) ||
1229 ((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
1231 elm_widget_focus_cycle(obj, ELM_FOCUS_LEFT);
1235 else if ((!strcmp(ev->key, "Right")) ||
1236 ((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
1238 elm_widget_focus_cycle(obj, ELM_FOCUS_RIGHT);
1242 else if ((!strcmp(ev->key, "Up")) ||
1243 ((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
1245 elm_widget_focus_cycle(obj, ELM_FOCUS_UP);
1249 else if ((!strcmp(ev->key, "Down")) ||
1250 ((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
1252 elm_widget_focus_cycle(obj, ELM_FOCUS_DOWN);
1260 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1261 if (ret) *ret = EINA_TRUE;
1265 _deferred_ecore_evas_free(void *data)
1267 ecore_evas_free(data);
1268 _elm_win_deferred_free--;
1272 _elm_win_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1274 Elm_Win_Smart_Data *sd = _pd;
1276 if (!evas_object_visible_get(obj))
1277 _elm_win_state_eval_queue();
1278 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
1282 if (sd->shot.info) _shot_handle(sd);
1286 _elm_win_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1288 Elm_Win_Smart_Data *sd = _pd;
1290 if (evas_object_visible_get(obj))
1291 _elm_win_state_eval_queue();
1292 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
1298 evas_object_hide(sd->frame_obj);
1302 evas_object_hide(sd->img_obj);
1304 if (sd->pointer.obj)
1306 evas_object_hide(sd->pointer.obj);
1307 ecore_evas_hide(sd->pointer.ee);
1312 _elm_win_on_parent_del(void *data,
1313 Evas *e EINA_UNUSED,
1315 void *event_info EINA_UNUSED)
1317 ELM_WIN_DATA_GET(data, sd);
1319 if (obj == sd->parent) sd->parent = NULL;
1323 _elm_win_focus_target_move(void *data,
1324 Evas *e EINA_UNUSED,
1325 Evas_Object *obj EINA_UNUSED,
1326 void *event_info EINA_UNUSED)
1328 ELM_WIN_DATA_GET(data, sd);
1330 sd->focus_highlight.geometry_changed = EINA_TRUE;
1331 _elm_win_focus_highlight_reconfigure_job_start(sd);
1335 _elm_win_focus_target_resize(void *data,
1336 Evas *e EINA_UNUSED,
1337 Evas_Object *obj EINA_UNUSED,
1338 void *event_info EINA_UNUSED)
1340 ELM_WIN_DATA_GET(data, sd);
1342 sd->focus_highlight.geometry_changed = EINA_TRUE;
1343 _elm_win_focus_highlight_reconfigure_job_start(sd);
1347 _elm_win_focus_target_del(void *data,
1348 Evas *e EINA_UNUSED,
1349 Evas_Object *obj EINA_UNUSED,
1350 void *event_info EINA_UNUSED)
1352 ELM_WIN_DATA_GET(data, sd);
1354 sd->focus_highlight.cur.target = NULL;
1356 _elm_win_focus_highlight_reconfigure_job_start(sd);
1359 static Evas_Object *
1360 _elm_win_focus_target_get(Evas_Object *obj)
1362 Evas_Object *o = obj;
1366 if (elm_widget_is(o))
1368 if (!elm_widget_highlight_ignore_get(o))
1370 o = elm_widget_parent_get(o);
1372 o = evas_object_smart_parent_get(o);
1376 o = elm_widget_parent_widget_get(o);
1378 o = evas_object_smart_parent_get(o);
1387 _elm_win_focus_target_callbacks_add(Elm_Win_Smart_Data *sd)
1389 Evas_Object *obj = sd->focus_highlight.cur.target;
1392 evas_object_event_callback_add
1393 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1394 evas_object_event_callback_add
1395 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1396 evas_object_event_callback_add
1397 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1401 _elm_win_focus_target_callbacks_del(Elm_Win_Smart_Data *sd)
1403 Evas_Object *obj = sd->focus_highlight.cur.target;
1405 evas_object_event_callback_del_full
1406 (obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
1407 evas_object_event_callback_del_full
1408 (obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
1409 evas_object_event_callback_del_full
1410 (obj, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
1414 _elm_win_object_focus_in(void *data,
1415 Evas *e EINA_UNUSED,
1418 Evas_Object *obj = event_info, *target;
1419 ELM_WIN_DATA_GET(data, sd);
1421 if (sd->focus_highlight.cur.target == obj)
1424 target = _elm_win_focus_target_get(obj);
1425 sd->focus_highlight.cur.target = target;
1426 if (target && elm_widget_highlight_in_theme_get(target))
1427 sd->focus_highlight.cur.in_theme = EINA_TRUE;
1429 _elm_win_focus_target_callbacks_add(sd);
1431 _elm_win_focus_highlight_reconfigure_job_start(sd);
1435 _elm_win_object_focus_out(void *data,
1436 Evas *e EINA_UNUSED,
1437 void *event_info EINA_UNUSED)
1439 ELM_WIN_DATA_GET(data, sd);
1441 if (!sd->focus_highlight.cur.target)
1444 if (!sd->focus_highlight.cur.in_theme)
1445 _elm_win_focus_target_callbacks_del(sd);
1447 sd->focus_highlight.cur.target = NULL;
1448 sd->focus_highlight.cur.in_theme = EINA_FALSE;
1450 _elm_win_focus_highlight_reconfigure_job_start(sd);
1454 _elm_win_focus_highlight_shutdown(Elm_Win_Smart_Data *sd)
1456 _elm_win_focus_highlight_reconfigure_job_stop(sd);
1457 if (sd->focus_highlight.cur.target)
1459 elm_widget_signal_emit(sd->focus_highlight.cur.target,
1460 "elm,action,focus_highlight,hide", "elm");
1461 _elm_win_focus_target_callbacks_del(sd);
1462 sd->focus_highlight.cur.target = NULL;
1464 ELM_SAFE_FREE(sd->focus_highlight.fobj, evas_object_del);
1466 evas_event_callback_del_full
1467 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1468 _elm_win_object_focus_in, sd->obj);
1469 evas_event_callback_del_full
1470 (sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1471 _elm_win_object_focus_out, sd->obj);
1475 _win_img_hide(void *data,
1476 Evas *e EINA_UNUSED,
1477 Evas_Object *obj EINA_UNUSED,
1478 void *event_info EINA_UNUSED)
1480 elm_widget_focus_hide_handle(data);
1484 _win_img_mouse_up(void *data,
1485 Evas *e EINA_UNUSED,
1486 Evas_Object *obj EINA_UNUSED,
1489 Evas_Event_Mouse_Up *ev = event_info;
1490 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1491 elm_widget_focus_mouse_up_handle(data);
1495 _win_img_focus_in(void *data,
1496 Evas *e EINA_UNUSED,
1497 Evas_Object *obj EINA_UNUSED,
1498 void *event_info EINA_UNUSED)
1500 elm_widget_focus_steal(data);
1504 _win_img_focus_out(void *data,
1505 Evas *e EINA_UNUSED,
1506 Evas_Object *obj EINA_UNUSED,
1507 void *event_info EINA_UNUSED)
1509 elm_widget_focused_object_clear(data);
1513 _elm_win_on_img_obj_del(void *data,
1514 Evas *e EINA_UNUSED,
1515 Evas_Object *obj EINA_UNUSED,
1516 void *event_info EINA_UNUSED)
1518 ELM_WIN_DATA_GET(data, sd);
1519 _elm_win_img_callbacks_del(sd->obj, sd->img_obj);
1524 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
1526 evas_object_event_callback_del_full
1527 (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1528 evas_object_event_callback_del_full
1529 (imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
1530 evas_object_event_callback_del_full
1531 (imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
1532 evas_object_event_callback_del_full
1533 (imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
1534 evas_object_event_callback_del_full
1535 (imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
1539 _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1541 Elm_Win_Smart_Data *sd = _pd;
1543 evas_object_event_callback_del_full(sd->layout,
1544 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1545 _elm_win_on_resize_obj_changed_size_hints,
1547 evas_object_del(sd->box);
1548 evas_object_del(sd->layout);
1550 /* NB: child deletion handled by parent's smart del */
1552 if ((trap) && (trap->del))
1553 trap->del(sd->trap_data, obj);
1557 evas_object_event_callback_del_full
1558 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
1562 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1564 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1566 _elm_win_state_eval_queue();
1570 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1571 ecore_evas_callback_resize_set(sd->ee, NULL);
1574 ecore_job_del(sd->deferred_resize_job);
1575 ecore_job_del(sd->deferred_child_eval_job);
1576 eina_stringshare_del(sd->shot.info);
1577 ecore_timer_del(sd->shot.timer);
1579 #ifdef HAVE_ELEMENTARY_X
1580 ecore_event_handler_del(sd->x.client_message_handler);
1581 ecore_event_handler_del(sd->x.property_handler);
1586 _elm_win_img_callbacks_del(obj, sd->img_obj);
1593 ecore_job_add(_deferred_ecore_evas_free, sd->ee);
1594 _elm_win_deferred_free++;
1598 _elm_win_focus_highlight_shutdown(sd);
1599 eina_stringshare_del(sd->focus_highlight.style);
1601 eina_stringshare_del(sd->title);
1602 eina_stringshare_del(sd->icon_name);
1603 eina_stringshare_del(sd->role);
1604 evas_object_del(sd->icon);
1605 evas_object_del(sd->main_menu);
1607 _elm_win_profile_del(sd);
1608 _elm_win_available_profiles_del(sd);
1610 /* Don't let callback in the air that point to sd */
1611 ecore_evas_callback_delete_request_set(sd->ee, NULL);
1612 ecore_evas_callback_resize_set(sd->ee, NULL);
1613 ecore_evas_callback_mouse_in_set(sd->ee, NULL);
1614 ecore_evas_callback_focus_in_set(sd->ee, NULL);
1615 ecore_evas_callback_focus_out_set(sd->ee, NULL);
1616 ecore_evas_callback_move_set(sd->ee, NULL);
1617 ecore_evas_callback_state_change_set(sd->ee, NULL);
1619 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1621 if ((!_elm_win_list) &&
1622 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
1624 edje_file_cache_flush();
1625 edje_collection_cache_flush();
1626 evas_image_cache_flush(evas_object_evas_get(obj));
1627 evas_font_cache_flush(evas_object_evas_get(obj));
1633 _elm_win_obj_intercept_show(void *data,
1636 ELM_WIN_DATA_GET(data, sd);
1638 // this is called to make sure all smart containers have calculated their
1639 // sizes BEFORE we show the window to make sure it initially appears at
1640 // our desired size (ie min size is known first)
1641 evas_smart_objects_calculate(evas_object_evas_get(obj));
1644 evas_object_show(sd->frame_obj);
1648 evas_object_show(sd->img_obj);
1650 if (sd->pointer.obj)
1652 ecore_evas_show(sd->pointer.ee);
1653 evas_object_show(sd->pointer.obj);
1655 evas_object_show(obj);
1659 _elm_win_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1661 Evas_Coord x = va_arg(*list, Evas_Coord);
1662 Evas_Coord y = va_arg(*list, Evas_Coord);
1663 Elm_Win_Smart_Data *sd = _pd;
1667 if ((x != sd->screen.x) || (y != sd->screen.y))
1671 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1677 TRAP(sd, move, x, y);
1678 if (!ecore_evas_override_get(sd->ee)) return;
1681 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
1683 if (ecore_evas_override_get(sd->ee))
1687 evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
1691 /* FIXME: We should update ecore_wl_window_location here !! */
1703 _elm_win_smart_resize(Eo *obj, void *_pd, va_list *list)
1705 Evas_Coord w = va_arg(*list, Evas_Coord);
1706 Evas_Coord h = va_arg(*list, Evas_Coord);
1708 Elm_Win_Smart_Data *sd = _pd;
1710 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
1718 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
1725 evas_object_image_size_set(sd->img_obj, w, h);
1728 TRAP(sd, resize, w, h);
1732 _elm_win_delete_request(Ecore_Evas *ee)
1734 Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
1741 int autodel = sd->autodel;
1742 sd->autodel_clear = &autodel;
1743 evas_object_ref(obj);
1744 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL);
1745 // FIXME: if above callback deletes - then the below will be invalid
1746 if (autodel) evas_object_del(obj);
1747 else sd->autodel_clear = NULL;
1748 evas_object_unref(obj);
1752 _elm_ee_xwin_get(const Ecore_Evas *ee)
1754 #ifdef HAVE_ELEMENTARY_X
1755 const char *engine_name;
1758 engine_name = ecore_evas_engine_name_get(ee);
1759 if (EINA_UNLIKELY(!engine_name)) return 0;
1761 if (!strcmp(engine_name, ELM_SOFTWARE_X11))
1763 return ecore_evas_software_x11_window_get(ee);
1765 else if (!strcmp(engine_name, ELM_OPENGL_X11))
1767 return ecore_evas_gl_x11_window_get(ee);
1775 #ifdef HAVE_ELEMENTARY_X
1777 _elm_win_xwindow_get(Elm_Win_Smart_Data *sd)
1779 sd->x.xwin = _elm_ee_xwin_get(sd->ee);
1784 _elm_ee_wlwin_get(const Ecore_Evas *ee)
1786 #ifdef HAVE_ELEMENTARY_WAYLAND
1787 const char *engine_name;
1789 if (!ee) return NULL;
1791 engine_name = ecore_evas_engine_name_get(ee);
1792 if (EINA_UNLIKELY(!engine_name)) return NULL;
1794 if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
1795 (!strcmp(engine_name, ELM_WAYLAND_EGL)))
1797 return ecore_evas_wayland_window_get(ee);
1805 #ifdef HAVE_ELEMENTARY_WAYLAND
1807 _elm_win_wlwindow_get(Elm_Win_Smart_Data *sd)
1809 sd->wl.win = _elm_ee_wlwin_get(sd->ee);
1813 #ifdef HAVE_ELEMENTARY_X
1815 _elm_win_xwin_update(Elm_Win_Smart_Data *sd)
1819 _elm_win_xwindow_get(sd);
1822 ELM_WIN_DATA_GET(sd->parent, sdp);
1826 ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin);
1830 if (!sd->x.xwin) return; /* nothing more to do */
1833 if (!s) s = _elm_appname;
1835 if (sd->icon_name) s = sd->icon_name;
1836 ecore_x_icccm_icon_name_set(sd->x.xwin, s);
1837 ecore_x_netwm_icon_name_set(sd->x.xwin, s);
1840 if (s) ecore_x_icccm_window_role_set(sd->x.xwin, s);
1847 data = evas_object_image_data_get(sd->icon, EINA_FALSE);
1851 int w = 0, h = 0, stride, x, y;
1855 evas_object_image_size_get(sd->icon, &w, &h);
1856 stride = evas_object_image_stride_get(sd->icon);
1857 if ((w > 0) && (h > 0) &&
1858 (stride >= (int)(w * sizeof(unsigned int))))
1862 ic.data = malloc(w * h * sizeof(unsigned int));
1866 p = (unsigned char *)data;
1867 p2 = (unsigned int *)ic.data;
1868 for (y = 0; y < h; y++)
1870 for (x = 0; x < w; x++)
1872 *p2 = *((unsigned int *)p);
1873 p += sizeof(unsigned int);
1876 p += (stride - (w * sizeof(unsigned int)));
1878 ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
1882 evas_object_image_data_set(sd->icon, data);
1889 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_NORMAL);
1892 case ELM_WIN_DIALOG_BASIC:
1893 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DIALOG);
1896 case ELM_WIN_DESKTOP:
1897 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
1901 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DOCK);
1904 case ELM_WIN_TOOLBAR:
1905 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
1909 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_MENU);
1912 case ELM_WIN_UTILITY:
1913 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_UTILITY);
1916 case ELM_WIN_SPLASH:
1917 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_SPLASH);
1920 case ELM_WIN_DROPDOWN_MENU:
1921 ecore_x_netwm_window_type_set
1922 (sd->x.xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
1925 case ELM_WIN_POPUP_MENU:
1926 ecore_x_netwm_window_type_set
1927 (sd->x.xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
1930 case ELM_WIN_TOOLTIP:
1931 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
1934 case ELM_WIN_NOTIFICATION:
1935 ecore_x_netwm_window_type_set
1936 (sd->x.xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
1940 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_COMBO);
1944 ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DND);
1950 ecore_x_e_virtual_keyboard_state_set
1951 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
1952 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
1953 ecore_x_e_illume_indicator_state_set
1954 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
1955 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
1956 ecore_x_e_illume_indicator_state_set
1957 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
1965 * Resize the window according to window layout's min and weight.
1966 * If the window layout's weight is 0.0, the window max is limited to layout's
1969 * This is called when the window layout's weight hint is changed or when the
1970 * window is rotated.
1972 * @param obj window object
1975 _elm_win_resize_objects_eval(Evas_Object *obj)
1977 ELM_WIN_DATA_GET(obj, sd);
1978 Evas_Coord w, h, minw, minh, maxw, maxh;
1981 evas_object_size_hint_min_get(sd->layout, &minw, &minh);
1982 if (minw < 1) minw = 1;
1983 if (minh < 1) minh = 1;
1985 evas_object_size_hint_weight_get(sd->layout, &wx, &wy);
1986 if (!wx) maxw = minw;
1988 if (!wy) maxh = minh;
1991 evas_object_size_hint_min_set(obj, minw, minh);
1992 evas_object_size_hint_max_set(obj, maxw, maxh);
1993 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1994 if (w < minw) w = minw;
1995 if (h < minh) h = minh;
1996 if (w > maxw) w = maxw;
1997 if (h > maxh) h = maxh;
1998 evas_object_move(obj, 0, 0);
1999 evas_object_resize(obj, w, h);
2003 _elm_win_on_resize_obj_changed_size_hints(void *data,
2004 Evas *e EINA_UNUSED,
2005 Evas_Object *obj EINA_UNUSED,
2006 void *event_info EINA_UNUSED)
2008 _elm_win_resize_objects_eval(data);
2012 _elm_win_shutdown(void)
2014 while (_elm_win_list) evas_object_del(_elm_win_list->data);
2015 ELM_SAFE_FREE(_elm_win_state_eval_job, ecore_job_del);
2019 _elm_win_rescale(Elm_Theme *th,
2020 Eina_Bool use_theme)
2027 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2028 elm_widget_theme(obj);
2032 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2033 elm_widget_theme_specific(obj, th, EINA_FALSE);
2038 _elm_win_access(Eina_Bool is_access)
2045 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2047 elm_widget_access(obj, is_access);
2049 /* floating orphan object. if there are A, B, C objects and user does
2050 as below, then there would be floating orphan objects.
2052 1. elm_object_content_set(layout, A);
2053 2. elm_object_content_set(layout, B);
2054 3. elm_object_content_set(layout, C);
2056 now, the object A and B are floating orphan objects */
2061 fobj = evas_object_below_get(fobj);
2064 if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
2066 elm_widget_access(fobj, is_access);
2072 evas = evas_object_evas_get(obj);
2073 if (evas) _elm_access_object_highlight_disable(evas);
2079 _elm_win_translate(void)
2084 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2085 elm_widget_translate(obj);
2088 #ifdef HAVE_ELEMENTARY_X
2090 _elm_win_client_message(void *data,
2091 int type EINA_UNUSED,
2094 ELM_WIN_DATA_GET(data, sd);
2095 Ecore_X_Event_Client_Message *e = event;
2097 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
2098 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
2100 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2102 Evas *evas = evas_object_evas_get(sd->obj);
2105 edje_file_cache_flush();
2106 edje_collection_cache_flush();
2107 evas_image_cache_flush(evas);
2108 evas_font_cache_flush(evas);
2112 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
2114 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2116 Evas *evas = evas_object_evas_get(sd->obj);
2119 edje_file_cache_flush();
2120 edje_collection_cache_flush();
2121 evas_image_cache_flush(evas);
2122 evas_font_cache_flush(evas);
2123 evas_render_dump(evas);
2127 else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
2129 if ((unsigned int)e->data.l[0] == sd->x.xwin)
2131 if ((unsigned int)e->data.l[1] ==
2132 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
2134 // XXX: call right access func
2136 else if ((unsigned int)e->data.l[1] ==
2137 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV)
2139 // XXX: call right access func
2141 else if ((unsigned int)e->data.l[1] ==
2142 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
2144 _elm_access_highlight_object_activate
2145 (sd->obj, ELM_ACTIVATE_DEFAULT);
2147 else if ((unsigned int)e->data.l[1] ==
2148 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
2150 /* there would be better way to read highlight object */
2152 evas = evas_object_evas_get(sd->obj);
2153 if (!evas) return ECORE_CALLBACK_PASS_ON;
2155 _elm_access_mouse_event_enabled_set(EINA_TRUE);
2157 evas_event_feed_mouse_in(evas, 0, NULL);
2158 evas_event_feed_mouse_move
2159 (evas, e->data.l[2], e->data.l[3], 0, NULL);
2161 _elm_access_mouse_event_enabled_set(EINA_FALSE);
2163 else if ((unsigned int)e->data.l[1] ==
2164 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
2166 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
2168 else if ((unsigned int)e->data.l[1] ==
2169 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
2171 _elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
2173 else if ((unsigned int)e->data.l[1] ==
2174 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
2176 _elm_access_highlight_object_activate
2177 (sd->obj, ELM_ACTIVATE_UP);
2179 else if ((unsigned int)e->data.l[1] ==
2180 ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
2182 _elm_access_highlight_object_activate
2183 (sd->obj, ELM_ACTIVATE_DOWN);
2187 return ECORE_CALLBACK_PASS_ON;
2191 _elm_win_property_change(void *data,
2192 int type EINA_UNUSED,
2195 ELM_WIN_DATA_GET(data, sd);
2196 Ecore_X_Event_Window_Property *e = event;
2198 if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE)
2200 if (e->win == sd->x.xwin)
2202 sd->indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win);
2203 evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
2206 return ECORE_CALLBACK_PASS_ON;
2211 _elm_win_focus_highlight_hide(void *data EINA_UNUSED,
2213 const char *emission EINA_UNUSED,
2214 const char *source EINA_UNUSED)
2216 evas_object_hide(obj);
2220 _elm_win_focus_highlight_anim_end(void *data,
2222 const char *emission EINA_UNUSED,
2223 const char *source EINA_UNUSED)
2225 ELM_WIN_DATA_GET(data, sd);
2227 _elm_win_focus_highlight_simple_setup(sd, obj);
2231 _elm_win_focus_highlight_init(Elm_Win_Smart_Data *sd)
2233 evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
2234 _elm_win_object_focus_in, sd->obj);
2235 evas_event_callback_add(sd->evas,
2236 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
2237 _elm_win_object_focus_out, sd->obj);
2239 sd->focus_highlight.cur.target = evas_focus_get(sd->evas);
2240 sd->focus_highlight.fobj = edje_object_add(sd->evas);
2241 sd->focus_highlight.theme_changed = EINA_TRUE;
2243 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2244 "elm,action,focus,hide,end", "*",
2245 _elm_win_focus_highlight_hide, NULL);
2246 edje_object_signal_callback_add(sd->focus_highlight.fobj,
2247 "elm,action,focus,anim,end", "*",
2248 _elm_win_focus_highlight_anim_end, sd->obj);
2249 _elm_win_focus_highlight_reconfigure_job_start(sd);
2253 _elm_win_frame_cb_move_start(void *data,
2254 Evas_Object *obj EINA_UNUSED,
2255 const char *sig EINA_UNUSED,
2258 ELM_WIN_DATA_GET(data, sd);
2262 #ifdef HAVE_ELEMENTARY_WAYLAND
2263 if (!strcmp(source, "elm"))
2264 ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_HAND1);
2266 ecore_wl_window_cursor_default_restore(sd->wl.win);
2271 /* FIXME: Change mouse pointer */
2273 /* NB: Wayland handles moving surfaces by itself so we cannot
2274 * specify a specific x/y we want. Instead, we will pass in the
2275 * existing x/y values so they can be recorded as 'previous'
2276 * position. The new position will get updated automatically when
2277 * the move is finished */
2279 ecore_evas_wayland_move(sd->ee, sd->screen.x, sd->screen.y);
2283 _elm_win_frame_cb_move_stop(void *data,
2284 Evas_Object *obj EINA_UNUSED,
2285 const char *sig EINA_UNUSED,
2286 const char *source EINA_UNUSED)
2288 ELM_WIN_DATA_GET(data, sd);
2292 #ifdef HAVE_ELEMENTARY_WAYLAND
2293 ecore_wl_window_cursor_default_restore(sd->wl.win);
2297 #ifdef HAVE_ELEMENTARY_WAYLAND
2304 static struct _resize_info _border_side[4] =
2306 { ELM_CURSOR_TOP_SIDE, 1 },
2307 { ELM_CURSOR_LEFT_SIDE, 4 },
2308 { ELM_CURSOR_BOTTOM_SIDE, 2 },
2309 { ELM_CURSOR_RIGHT_SIDE, 8 },
2312 static struct _resize_info _border_corner[4] =
2314 { ELM_CURSOR_TOP_LEFT_CORNER, 5 },
2315 { ELM_CURSOR_BOTTOM_LEFT_CORNER, 6 },
2316 { ELM_CURSOR_BOTTOM_RIGHT_CORNER, 10 },
2317 { ELM_CURSOR_TOP_RIGHT_CORNER, 9 },
2322 _elm_win_frame_obj_update(Elm_Win_Smart_Data *sd)
2328 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
2329 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2330 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2332 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2334 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2335 (w != (fw - ow)) || (h != (fh - oh)))
2337 evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
2338 (fw - ow), (fh - oh));
2341 #ifdef HAVE_ELEMENTARY_WAYLAND
2342 ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
2347 _elm_win_frame_obj_move(void *data,
2348 Evas *e EINA_UNUSED,
2349 Evas_Object *obj EINA_UNUSED,
2350 void *event_info EINA_UNUSED)
2352 Elm_Win_Smart_Data *sd;
2354 if (!(sd = data)) return;
2355 if (!sd->client_obj) return;
2357 _elm_win_frame_obj_update(sd);
2361 _elm_win_frame_obj_resize(void *data,
2362 Evas *e EINA_UNUSED,
2363 Evas_Object *obj EINA_UNUSED,
2364 void *event_info EINA_UNUSED)
2366 Elm_Win_Smart_Data *sd;
2368 if (!(sd = data)) return;
2369 if (!sd->client_obj) return;
2371 _elm_win_frame_obj_update(sd);
2375 _elm_win_frame_cb_resize_show(void *data,
2376 Evas_Object *obj EINA_UNUSED,
2377 const char *sig EINA_UNUSED,
2380 ELM_WIN_DATA_GET(data, sd);
2383 if (sd->resizing) return;
2385 #ifdef HAVE_ELEMENTARY_WAYLAND
2388 if (!strcmp(source, "elm.event.resize.t"))
2389 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2390 _border_side[(0 + i) % 4].name);
2391 else if (!strcmp(source, "elm.event.resize.b"))
2392 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2393 _border_side[(2 + i) % 4].name);
2394 else if (!strcmp(source, "elm.event.resize.l"))
2395 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2396 _border_side[(1 + i) % 4].name);
2397 else if (!strcmp(source, "elm.event.resize.r"))
2398 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2399 _border_side[(3 + i) % 4].name);
2400 else if (!strcmp(source, "elm.event.resize.tl"))
2401 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2402 _border_corner[(0 + i) % 4].name);
2403 else if (!strcmp(source, "elm.event.resize.tr"))
2404 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2405 _border_corner[(3 + i) % 4].name);
2406 else if (!strcmp(source, "elm.event.resize.bl"))
2407 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2408 _border_corner[(1 + i) % 4].name);
2409 else if (!strcmp(source, "elm.event.resize.br"))
2410 ecore_wl_window_cursor_from_name_set(sd->wl.win,
2411 _border_corner[(2 + i) % 4].name);
2413 ecore_wl_window_cursor_default_restore(sd->wl.win);
2420 _elm_win_frame_cb_resize_hide(void *data,
2421 Evas_Object *obj EINA_UNUSED,
2422 const char *sig EINA_UNUSED,
2423 const char *source EINA_UNUSED)
2425 ELM_WIN_DATA_GET(data, sd);
2428 if (sd->resizing) return;
2430 #ifdef HAVE_ELEMENTARY_WAYLAND
2431 ecore_wl_window_cursor_default_restore(sd->wl.win);
2436 _elm_win_frame_cb_resize_start(void *data,
2437 Evas_Object *obj EINA_UNUSED,
2438 const char *sig EINA_UNUSED,
2441 #ifdef HAVE_ELEMENTARY_WAYLAND
2442 ELM_WIN_DATA_GET(data, sd);
2446 if (sd->resizing) return;
2448 sd->resizing = EINA_TRUE;
2450 if (!strcmp(source, "elm.event.resize.t"))
2451 sd->resize_location = _border_side[(0 + i) % 4].location;
2452 else if (!strcmp(source, "elm.event.resize.b"))
2453 sd->resize_location = _border_side[(2 + i) % 4].location;
2454 else if (!strcmp(source, "elm.event.resize.l"))
2455 sd->resize_location = _border_side[(1 + i) % 4].location;
2456 else if (!strcmp(source, "elm.event.resize.r"))
2457 sd->resize_location = _border_side[(3 + i) % 4].location;
2458 else if (!strcmp(source, "elm.event.resize.tl"))
2459 sd->resize_location = _border_corner[(0 + i) % 4].location;
2460 else if (!strcmp(source, "elm.event.resize.tr"))
2461 sd->resize_location = _border_corner[(3 + i) % 4].location;
2462 else if (!strcmp(source, "elm.event.resize.bl"))
2463 sd->resize_location = _border_corner[(1 + i) % 4].location;
2464 else if (!strcmp(source, "elm.event.resize.br"))
2465 sd->resize_location = _border_corner[(2 + i) % 4].location;
2467 sd->resize_location = 0;
2469 if (sd->resize_location > 0)
2470 ecore_evas_wayland_resize(sd->ee, sd->resize_location);
2478 _elm_win_frame_cb_minimize(void *data,
2479 Evas_Object *obj EINA_UNUSED,
2480 const char *sig EINA_UNUSED,
2481 const char *source EINA_UNUSED)
2483 ELM_WIN_DATA_GET(data, sd);
2486 // sd->iconified = EINA_TRUE;
2487 TRAP(sd, iconified_set, EINA_TRUE);
2491 _elm_win_frame_maximized_state_update(Elm_Win_Smart_Data *sd, Eina_Bool maximized)
2493 const char *emission;
2496 emission = "elm,state,maximized";
2498 emission = "elm,state,unmaximized";
2500 edje_object_signal_emit(sd->frame_obj, emission, "elm");
2501 edje_object_message_signal_process(sd->frame_obj);
2502 evas_object_smart_calculate(sd->frame_obj);
2504 _elm_win_frame_obj_update(sd);
2508 _elm_win_frame_cb_maximize(void *data,
2509 Evas_Object *obj EINA_UNUSED,
2510 const char *sig EINA_UNUSED,
2511 const char *source EINA_UNUSED)
2514 ELM_WIN_DATA_GET(data, sd);
2517 if (sd->maximized) value = EINA_FALSE;
2518 else value = EINA_TRUE;
2520 _elm_win_frame_maximized_state_update(sd, value);
2522 TRAP(sd, maximized_set, value);
2526 _elm_win_frame_cb_close(void *data,
2527 Evas_Object *obj EINA_UNUSED,
2528 const char *sig EINA_UNUSED,
2529 const char *source EINA_UNUSED)
2531 ELM_WIN_DATA_GET(data, sd);
2534 /* FIXME: After the current freeze, this should be handled differently.
2536 * Ideally, we would want to mimic the X11 backend and use something
2537 * like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
2538 * inside of ecore_evas. That would be the 'proper' way, but since we are
2539 * in a freeze right now, I cannot add a new event value, or a new
2540 * event structure to ecore_wayland.
2542 * So yes, this is a temporary 'stop-gap' solution which will be fixed
2543 * when the freeze is over, but it does fix a trac bug for now, and in a
2544 * way which does not break API or the freeze. - dh
2551 int autodel = sd->autodel;
2552 sd->autodel_clear = &autodel;
2553 evas_object_ref(win);
2554 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
2555 // FIXME: if above callback deletes - then the below will be invalid
2556 if (autodel) evas_object_del(win);
2557 else sd->autodel_clear = NULL;
2558 evas_object_unref(win);
2562 _elm_win_frame_add(Elm_Win_Smart_Data *sd,
2565 Evas_Object *obj = sd->obj;
2569 sd->frame_obj = edje_object_add(sd->evas);
2570 layer = evas_object_layer_get(obj);
2571 evas_object_layer_set(sd->frame_obj, layer + 1);
2572 if (!elm_widget_theme_object_set
2573 (sd->obj, sd->frame_obj, "border", "base", style))
2575 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2579 sd->spacer_obj = evas_object_rectangle_add(sd->evas);
2580 evas_object_color_set(sd->spacer_obj, 0, 0, 0, 0);
2581 evas_object_repeat_events_set(sd->spacer_obj, EINA_TRUE);
2582 edje_object_part_swallow(sd->frame_obj, "elm.swallow.frame_spacer",
2585 sd->client_obj = evas_object_rectangle_add(sd->evas);
2586 evas_object_color_set(sd->client_obj, 0, 0, 0, 0);
2587 /* NB: Tried pass_events here, but that fails to send events */
2588 evas_object_repeat_events_set(sd->client_obj, EINA_TRUE);
2589 edje_object_part_swallow(sd->frame_obj, "elm.swallow.client",
2592 evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
2594 evas_object_event_callback_add
2595 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2596 evas_object_event_callback_add
2597 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2599 /* NB: Do NOT remove these calls !! Needed to calculate proper
2600 * framespace on inital show of the window */
2601 edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
2602 evas_object_move(sd->frame_obj, 0, 0);
2603 evas_object_resize(sd->frame_obj, mw, mh);
2604 evas_object_smart_calculate(sd->frame_obj);
2606 edje_object_signal_callback_add
2607 (sd->frame_obj, "elm,action,move,start", "elm",
2608 _elm_win_frame_cb_move_start, obj);
2609 edje_object_signal_callback_add
2610 (sd->frame_obj, "elm,action,move,stop", "elm",
2611 _elm_win_frame_cb_move_stop, obj);
2612 edje_object_signal_callback_add
2613 (sd->frame_obj, "elm,action,resize,show", "*",
2614 _elm_win_frame_cb_resize_show, obj);
2615 edje_object_signal_callback_add
2616 (sd->frame_obj, "elm,action,resize,hide", "*",
2617 _elm_win_frame_cb_resize_hide, obj);
2618 edje_object_signal_callback_add
2619 (sd->frame_obj, "elm,action,resize,start", "*",
2620 _elm_win_frame_cb_resize_start, obj);
2621 edje_object_signal_callback_add
2622 (sd->frame_obj, "elm,action,minimize", "elm",
2623 _elm_win_frame_cb_minimize, obj);
2624 edje_object_signal_callback_add
2625 (sd->frame_obj, "elm,action,maximize", "elm",
2626 _elm_win_frame_cb_maximize, obj);
2627 edje_object_signal_callback_add
2628 (sd->frame_obj, "elm,action,close", "elm", _elm_win_frame_cb_close, obj);
2632 edje_object_part_text_escaped_set
2633 (sd->frame_obj, "elm.text.title", sd->title);
2636 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2637 ecore_evas_resize(sd->ee, w, h);
2641 _elm_win_frame_del(Elm_Win_Smart_Data *sd)
2645 ELM_SAFE_FREE(sd->client_obj, evas_object_del);
2649 evas_object_event_callback_del_full
2650 (sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
2651 evas_object_event_callback_del_full
2652 (sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
2654 edje_object_signal_callback_del
2655 (sd->frame_obj, "elm,action,move,start", "elm",
2656 _elm_win_frame_cb_move_start);
2657 edje_object_signal_callback_del
2658 (sd->frame_obj, "elm,action,move,stop", "elm",
2659 _elm_win_frame_cb_move_stop);
2660 edje_object_signal_callback_del
2661 (sd->frame_obj, "elm,action,resize,show", "*",
2662 _elm_win_frame_cb_resize_show);
2663 edje_object_signal_callback_del
2664 (sd->frame_obj, "elm,action,resize,hide", "*",
2665 _elm_win_frame_cb_resize_hide);
2666 edje_object_signal_callback_del
2667 (sd->frame_obj, "elm,action,resize,start", "*",
2668 _elm_win_frame_cb_resize_start);
2669 edje_object_signal_callback_del
2670 (sd->frame_obj, "elm,action,minimize", "elm",
2671 _elm_win_frame_cb_minimize);
2672 edje_object_signal_callback_del
2673 (sd->frame_obj, "elm,action,maximize", "elm",
2674 _elm_win_frame_cb_maximize);
2675 edje_object_signal_callback_del
2676 (sd->frame_obj, "elm,action,close", "elm",
2677 _elm_win_frame_cb_close);
2679 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2682 evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
2683 ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
2684 ecore_evas_resize(sd->ee, w, h);
2689 _debug_key_down(void *data EINA_UNUSED,
2690 Evas *e EINA_UNUSED,
2694 Evas_Event_Key_Down *ev = event_info;
2696 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
2699 if ((strcmp(ev->key, "F12")) ||
2700 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
2703 INF("Tree graph generated.");
2704 elm_object_tree_dot_dump(obj, "./dump.dot");
2710 _win_inlined_image_set(Elm_Win_Smart_Data *sd)
2712 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);
2713 evas_object_image_filled_set(sd->img_obj, EINA_TRUE);
2715 evas_object_event_callback_add
2716 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, sd->obj);
2717 evas_object_event_callback_add
2718 (sd->img_obj, EVAS_CALLBACK_HIDE, _win_img_hide, sd->obj);
2719 evas_object_event_callback_add
2720 (sd->img_obj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, sd->obj);
2721 evas_object_event_callback_add
2722 (sd->img_obj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, sd->obj);
2723 evas_object_event_callback_add
2724 (sd->img_obj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, sd->obj);
2728 _elm_win_on_icon_del(void *data,
2729 Evas *e EINA_UNUSED,
2731 void *event_info EINA_UNUSED)
2733 ELM_WIN_DATA_GET(data, sd);
2735 if (sd->icon == obj) sd->icon = NULL;
2739 _elm_win_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
2741 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
2743 elm_widget_can_focus_set(obj, EINA_TRUE);
2745 elm_widget_highlight_ignore_set(obj, EINA_TRUE);
2748 #ifdef HAVE_ELEMENTARY_X
2750 _elm_x_io_err(void *data EINA_UNUSED)
2755 EINA_LIST_FOREACH(_elm_win_list, l, obj)
2756 evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
2762 elm_win_add(Evas_Object *parent,
2766 Evas_Object *obj = eo_add_custom(MY_CLASS, parent, elm_obj_win_constructor(name, type));
2772 _elm_win_cb_hide(void *data EINA_UNUSED,
2773 Evas *e EINA_UNUSED,
2774 Evas_Object *obj EINA_UNUSED,
2775 void *event_info EINA_UNUSED)
2777 _elm_win_state_eval_queue();
2781 _elm_win_cb_show(void *data EINA_UNUSED,
2782 Evas *e EINA_UNUSED,
2783 Evas_Object *obj EINA_UNUSED,
2784 void *event_info EINA_UNUSED)
2786 _elm_win_state_eval_queue();
2792 * Recalculate the size of window considering its resize objects' weight and
2793 * min size. If any of its resize objects' weight equals to 0.0, window
2794 * layout's weight will be set to 0.0.
2796 * @param o box object
2797 * @param p box's private data
2798 * @param data window object
2801 _window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
2805 Evas_Object_Box_Option *opt;
2806 Evas_Coord x, y, w, h;
2808 Evas_Coord minw = -1, minh = -1;
2809 double weight_x = EVAS_HINT_EXPAND;
2810 double weight_y = EVAS_HINT_EXPAND;
2812 EINA_LIST_FOREACH(p->children, l, opt)
2815 evas_object_size_hint_weight_get(child, &wx, &wy);
2816 if (wx == 0.0) weight_x = 0;
2817 if (wy == 0.0) weight_y = 0;
2819 evas_object_size_hint_min_get(child, &w, &h);
2820 if (w > minw) minw = w;
2821 if (h > minh) minh = h;
2824 evas_object_size_hint_min_set(o, minw, minh);
2825 evas_object_geometry_get(o, &x, &y, &w, &h);
2826 if (w < minw) w = minw;
2827 if (h < minh) h = minh;
2828 evas_object_resize(o, w, h);
2830 EINA_LIST_FOREACH(p->children, l, opt)
2833 evas_object_move(child, x, y);
2834 evas_object_resize(child, w, h);
2837 ELM_WIN_DATA_GET(data, sd);
2838 evas_object_size_hint_weight_set(sd->layout, weight_x, weight_y);
2839 evas_object_smart_changed(sd->layout);
2843 _win_constructor(Eo *obj, void *_pd, va_list *list)
2845 Elm_Win_Smart_Data *sd = _pd;
2846 sd->obj = obj; // in ctor
2848 const char *name = va_arg(*list, const char *);
2849 Elm_Win_Type type = va_arg(*list, Elm_Win_Type);
2850 Evas_Object *parent;
2853 const char *fontpath, *engine = NULL, *enginelist[32], *disp;
2856 Elm_Win_Smart_Data tmp_sd;
2858 eo_do(obj, eo_parent_get(&parent));
2860 /* just to store some data while trying out to create a canvas */
2861 memset(&tmp_sd, 0, sizeof(Elm_Win_Smart_Data));
2865 case ELM_WIN_INLINED_IMAGE:
2868 e = evas_object_evas_get(parent);
2873 ee = ecore_evas_ecore_evas_get(e);
2876 tmp_sd.img_obj = ecore_evas_object_image_new(ee);
2877 if (!tmp_sd.img_obj) break;
2879 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
2882 ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
2887 case ELM_WIN_SOCKET_IMAGE:
2888 tmp_sd.ee = ecore_evas_extn_socket_new(1, 1);
2892 disp = getenv("ELM_DISPLAY");
2893 if ((disp) && (!strcmp(disp, "x11")))
2895 if ((_elm_accel_preference) &&
2896 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2897 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2898 (!strcasecmp(_elm_accel_preference, "3d")) ||
2899 (!strcasecmp(_elm_accel_preference, "hw")) ||
2900 (!strcasecmp(_elm_accel_preference, "accel")) ||
2901 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2902 (!strcasecmp(_elm_accel_preference, "accel"))
2905 enginelist[0] = ELM_OPENGL_X11;
2906 enginelist[1] = ELM_SOFTWARE_X11;
2907 enginelist[2] = NULL;
2911 enginelist[0] = ENGINE_GET();
2912 enginelist[1] = ELM_SOFTWARE_X11;
2913 enginelist[2] = ELM_OPENGL_X11;
2914 enginelist[3] = NULL;
2917 else if ((disp) && (!strcmp(disp, "wl")))
2919 if ((_elm_accel_preference) &&
2920 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2921 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2922 (!strcasecmp(_elm_accel_preference, "3d")) ||
2923 (!strcasecmp(_elm_accel_preference, "hw")) ||
2924 (!strcasecmp(_elm_accel_preference, "accel")) ||
2925 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2926 (!strcasecmp(_elm_accel_preference, "accel"))
2929 enginelist[0] = ELM_WAYLAND_EGL;
2930 enginelist[1] = ELM_WAYLAND_SHM;
2931 enginelist[2] = NULL;
2935 enginelist[0] = ENGINE_GET();
2936 enginelist[1] = ELM_WAYLAND_SHM;
2937 enginelist[2] = ELM_WAYLAND_EGL;
2938 enginelist[3] = NULL;
2941 else if ((disp) && (!strcmp(disp, "win")))
2943 enginelist[0] = ENGINE_GET();
2944 enginelist[1] = ELM_SOFTWARE_WIN32;
2945 enginelist[2] = NULL;
2947 else if ((disp) && (!strcmp(disp, "sdl")))
2949 if ((_elm_accel_preference) &&
2950 ((!strcasecmp(_elm_accel_preference, "gl")) ||
2951 (!strcasecmp(_elm_accel_preference, "opengl")) ||
2952 (!strcasecmp(_elm_accel_preference, "3d")) ||
2953 (!strcasecmp(_elm_accel_preference, "hw")) ||
2954 (!strcasecmp(_elm_accel_preference, "accel")) ||
2955 (!strcasecmp(_elm_accel_preference, "hardware")) ||
2956 (!strcasecmp(_elm_accel_preference, "accel"))
2959 enginelist[0] = ELM_OPENGL_SDL;
2960 enginelist[1] = ELM_SOFTWARE_SDL;
2961 enginelist[2] = NULL;
2965 enginelist[0] = ENGINE_GET();
2966 enginelist[1] = ELM_SOFTWARE_SDL;
2967 enginelist[2] = ELM_OPENGL_SDL;
2968 enginelist[3] = NULL;
2971 else if ((disp) && (!strcmp(disp, "mac")))
2973 enginelist[0] = ENGINE_GET();
2974 enginelist[1] = ELM_OPENGL_COCOA;
2975 enginelist[2] = NULL;
2977 else if ((disp) && (!strcmp(disp, "ews")))
2979 enginelist[0] = ENGINE_GET();
2980 enginelist[1] = ELM_EWS;
2981 enginelist[2] = NULL;
2983 else if ((disp) && (!strcmp(disp, "fb")))
2985 enginelist[0] = ENGINE_GET();
2986 enginelist[1] = ELM_SOFTWARE_FB;
2987 enginelist[2] = NULL;
2989 else if ((disp) && (!strcmp(disp, "buffer")))
2991 enginelist[0] = ENGINE_GET();
2992 enginelist[1] = ELM_BUFFER;
2993 enginelist[2] = NULL;
2995 else if ((disp) && (!strcmp(disp, "ps3")))
2997 enginelist[0] = ENGINE_GET();
2998 enginelist[1] = ELM_SOFTWARE_PSL1GHT;
2999 enginelist[2] = NULL;
3001 else if ((disp) && (!strcmp(disp, "shot")))
3003 enginelist[0] = ENGINE_GET();
3004 enginelist[1] = NULL;
3008 if ((_elm_accel_preference) &&
3009 ((!strcasecmp(_elm_accel_preference, "gl")) ||
3010 (!strcasecmp(_elm_accel_preference, "opengl")) ||
3011 (!strcasecmp(_elm_accel_preference, "3d")) ||
3012 (!strcasecmp(_elm_accel_preference, "hw")) ||
3013 (!strcasecmp(_elm_accel_preference, "accel")) ||
3014 (!strcasecmp(_elm_accel_preference, "hardware")) ||
3015 (!strcasecmp(_elm_accel_preference, "accel"))
3018 enginelist[0] = ELM_OPENGL_X11;
3019 enginelist[1] = ELM_WAYLAND_EGL;
3020 enginelist[2] = ELM_SOFTWARE_FB;
3021 enginelist[3] = ELM_OPENGL_COCOA;
3022 enginelist[4] = ELM_OPENGL_SDL;
3023 enginelist[5] = NULL;
3027 enginelist[0] = ENGINE_GET();
3028 enginelist[1] = ELM_SOFTWARE_X11;
3029 enginelist[2] = ELM_WAYLAND_SHM;
3030 enginelist[3] = ELM_SOFTWARE_FB;
3031 enginelist[4] = ELM_OPENGL_COCOA;
3032 enginelist[5] = ELM_SOFTWARE_SDL;
3033 enginelist[6] = NULL;
3036 for (i = 0; i < 30; i++)
3038 if ((i > 0) && (!enginelist[i])) break;
3039 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
3040 tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
3041 else if (!strcmp(enginelist[i], ELM_OPENGL_X11))
3043 int opt[10], opt_i = 0;
3045 if (_elm_config->vsync)
3047 opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_VSYNC;
3052 tmp_sd.ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt);
3054 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
3056 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
3057 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
3058 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
3059 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
3060 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
3061 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
3062 else if (!strcmp(enginelist[i], ELM_SOFTWARE_SDL))
3063 tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
3064 else if (!strcmp(enginelist[i], ELM_OPENGL_SDL))
3065 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
3066 else if (!strcmp(enginelist[i], ELM_OPENGL_COCOA))
3067 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
3068 else if (!strcmp(enginelist[i], ELM_EWS))
3069 tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
3070 else if (!strcmp(enginelist[i], ELM_SOFTWARE_FB))
3071 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
3072 else if (!strcmp(enginelist[i], ELM_BUFFER))
3073 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3074 else if (!strcmp(enginelist[i], ELM_SOFTWARE_PSL1GHT))
3075 tmp_sd.ee = ecore_evas_psl1ght_new(NULL, 1, 1);
3076 else if (!strncmp(enginelist[i], "shot:", 5))
3078 tmp_sd.ee = ecore_evas_buffer_new(1, 1);
3079 ecore_evas_manual_render_set(tmp_sd.ee, EINA_TRUE);
3080 tmp_sd.shot.info = eina_stringshare_add(ENGINE_GET() + 5);
3082 engine = enginelist[i];
3083 if (tmp_sd.ee) break;
3090 ERR("Cannot create window.");
3095 eo_do(obj, eo_parent_set(ecore_evas_get(tmp_sd.ee)));
3096 eo_do_super(obj, MY_CLASS, eo_constructor());
3098 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
3099 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
3101 if (getenv("ELM_FIRST_FRAME"))
3102 evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
3103 _elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
3105 /* copying possibly altered fields back */
3106 #define SD_CPY(_field) \
3109 sd->_field = tmp_sd._field; \
3117 if ((trap) && (trap->add))
3118 sd->trap_data = trap->add(obj);
3120 /* complementary actions, which depend on final smart data
3122 if (type == ELM_WIN_INLINED_IMAGE)
3123 _win_inlined_image_set(sd);
3124 #ifdef HAVE_ELEMENTARY_X
3125 else if ((engine) &&
3126 ((!strcmp(engine, ELM_SOFTWARE_X11)) ||
3127 (!strcmp(engine, ELM_OPENGL_X11))))
3129 sd->x.client_message_handler = ecore_event_handler_add
3130 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, obj);
3131 sd->x.property_handler = ecore_event_handler_add
3132 (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
3135 else if ((engine) && (!strncmp(engine, "shot:", 5)))
3138 sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
3139 sd->indmode = ELM_WIN_INDICATOR_UNKNOWN;
3141 #ifdef HAVE_ELEMENTARY_X
3142 _elm_win_xwindow_get(sd);
3145 ecore_x_io_error_handler_set(_elm_x_io_err, NULL);
3149 #ifdef HAVE_ELEMENTARY_WAYLAND
3150 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
3151 _elm_win_wlwindow_get(sd);
3154 if ((_elm_config->bgpixmap)
3155 #ifdef HAVE_ELEMENTARY_X
3157 (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
3162 TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
3163 // bg pixmap done by x - has other issues like can be redrawn by x before it
3164 // is filled/ready by app
3165 // TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
3168 sd->parent = parent;
3171 evas_object_event_callback_add
3172 (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
3174 sd->evas = ecore_evas_get(sd->ee);
3176 evas_object_color_set(obj, 0, 0, 0, 0);
3177 evas_object_move(obj, 0, 0);
3178 evas_object_resize(obj, 1, 1);
3179 evas_object_layer_set(obj, 50);
3180 evas_object_pass_events_set(obj, EINA_TRUE);
3182 if (type == ELM_WIN_INLINED_IMAGE)
3183 elm_widget_parent2_set(obj, parent);
3185 /* use own version of ecore_evas_object_associate() that does TRAP() */
3186 ecore_evas_data_set(sd->ee, "elm_win", obj);
3188 evas_object_event_callback_add
3189 (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3190 _elm_win_obj_callback_changed_size_hints, obj);
3192 evas_object_intercept_raise_callback_add
3193 (obj, _elm_win_obj_intercept_raise, obj);
3194 evas_object_intercept_lower_callback_add
3195 (obj, _elm_win_obj_intercept_lower, obj);
3196 evas_object_intercept_stack_above_callback_add
3197 (obj, _elm_win_obj_intercept_stack_above, obj);
3198 evas_object_intercept_stack_below_callback_add
3199 (obj, _elm_win_obj_intercept_stack_below, obj);
3200 evas_object_intercept_layer_set_callback_add
3201 (obj, _elm_win_obj_intercept_layer_set, obj);
3202 evas_object_intercept_show_callback_add
3203 (obj, _elm_win_obj_intercept_show, obj);
3205 TRAP(sd, name_class_set, name, _elm_appname);
3206 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
3207 ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
3208 ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
3209 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
3210 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
3211 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
3212 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3213 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
3214 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
3216 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
3217 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
3219 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
3220 evas_font_path_append(sd->evas, fontpath);
3222 if (!_elm_config->font_hinting)
3223 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_NONE);
3224 else if (_elm_config->font_hinting == 1)
3225 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_AUTO);
3226 else if (_elm_config->font_hinting == 2)
3227 evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_BYTECODE);
3229 #ifdef HAVE_ELEMENTARY_X
3230 _elm_win_xwin_update(sd);
3233 _elm_win_list = eina_list_append(_elm_win_list, obj);
3236 if ((engine) && (!strcmp(engine, ELM_SOFTWARE_FB)))
3238 TRAP(sd, fullscreen_set, 1);
3240 else if ((type != ELM_WIN_INLINED_IMAGE) &&
3242 ((!strcmp(engine, ELM_WAYLAND_SHM) ||
3243 (!strcmp(engine, ELM_WAYLAND_EGL))))))
3244 _elm_win_frame_add(sd, "default");
3246 if (_elm_config->focus_highlight_enable)
3247 elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
3248 if (_elm_config->focus_highlight_animate)
3249 elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
3252 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
3253 evas_object_event_callback_add
3254 (obj, EVAS_CALLBACK_KEY_DOWN, _debug_key_down, NULL);
3256 if (evas_object_key_grab(obj, "F12", mask, 0, EINA_TRUE))
3257 INF("Ctrl+F12 key combination exclusive for dot tree generation\n");
3259 ERR("failed to grab F12 key to elm widgets (dot) tree generation");
3262 if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
3263 ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
3264 ((engine) && (!strcmp(engine, ELM_SOFTWARE_FB)))))
3267 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
3269 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
3270 _elm_theme_object_set(obj, o, "pointer", "base", "default");
3271 edje_object_size_min_calc(o, &mw, &mh);
3272 evas_object_resize(o, mw, mh);
3273 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
3274 &hx, &hy, NULL, NULL);
3275 sd->pointer.hot_x = hx;
3276 sd->pointer.hot_y = hy;
3277 evas_object_show(o);
3278 ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
3280 else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
3285 sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
3286 sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
3288 sd->layout = edje_object_add(sd->evas);
3289 _elm_theme_object_set(obj, sd->layout, "win", "base", "default");
3290 sd->box = evas_object_box_add(sd->evas);
3291 evas_object_box_layout_set(sd->box, _window_layout_stack, obj, NULL);
3292 edje_object_part_swallow(sd->layout, "elm.swallow.contents", sd->box);
3293 evas_object_move(sd->layout, 0, 0);
3294 evas_object_resize(sd->layout, 1, 1);
3295 edje_object_update_hints_set(sd->layout, EINA_TRUE);
3296 evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3297 _elm_win_on_resize_obj_changed_size_hints, obj);
3298 evas_object_show(sd->layout);
3302 _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
3305 ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
3309 elm_win_type_get(const Evas_Object *obj)
3311 ELM_WIN_CHECK(obj) ELM_WIN_UNKNOWN;
3312 Elm_Win_Type ret = ELM_WIN_UNKNOWN;
3313 eo_do((Eo *) obj, elm_obj_win_type_get(&ret));
3318 _type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3320 Elm_Win_Type *ret = va_arg(*list, Elm_Win_Type *);
3321 Elm_Win_Smart_Data *sd = _pd;
3326 elm_win_util_standard_add(const char *name,
3329 Evas_Object *win, *bg;
3331 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
3332 if (!win) return NULL;
3334 elm_win_title_set(win, title);
3335 bg = elm_bg_add(win);
3338 evas_object_del(win);
3341 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3342 elm_win_resize_object_add(win, bg);
3343 evas_object_show(bg);
3349 elm_win_resize_object_add(Evas_Object *obj,
3350 Evas_Object *subobj)
3353 eo_do(obj, elm_obj_win_resize_object_add(subobj));
3357 _resize_object_add(Eo *obj, void *_pd, va_list *list)
3359 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3361 Elm_Win_Smart_Data *sd = _pd;
3363 elm_widget_sub_object_add(obj, subobj);
3365 if (!evas_object_box_append(sd->box, subobj))
3366 ERR("could not append %p to box", subobj);
3370 elm_win_resize_object_del(Evas_Object *obj,
3371 Evas_Object *subobj)
3374 eo_do(obj, elm_obj_win_resize_object_del(subobj));
3378 _resize_object_del(Eo *obj, void *_pd, va_list *list)
3380 Evas_Object *subobj = va_arg(*list, Evas_Object *);
3381 Elm_Win_Smart_Data *sd = _pd;
3383 if (!elm_widget_sub_object_del(obj, subobj))
3384 ERR("could not remove sub object %p from %p", subobj, obj);
3386 evas_object_box_remove(sd->box, subobj);
3390 elm_win_title_set(Evas_Object *obj,
3394 eo_do(obj, elm_obj_win_title_set(title));
3398 _title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3400 const char *title = va_arg(*list, const char *);
3401 Elm_Win_Smart_Data *sd = _pd;
3404 eina_stringshare_replace(&(sd->title), title);
3405 TRAP(sd, title_set, sd->title);
3407 edje_object_part_text_escaped_set
3408 (sd->frame_obj, "elm.text.title", sd->title);
3412 elm_win_title_get(const Evas_Object *obj)
3414 ELM_WIN_CHECK(obj) NULL;
3415 const char *ret = NULL;
3416 eo_do((Eo *) obj, elm_obj_win_title_get(&ret));
3421 _title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3423 const char **ret = va_arg(*list, const char **);
3424 Elm_Win_Smart_Data *sd = _pd;
3429 elm_win_icon_name_set(Evas_Object *obj,
3430 const char *icon_name)
3433 eo_do(obj, elm_obj_win_icon_name_set(icon_name));
3437 _icon_name_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3439 const char *icon_name = va_arg(*list, const char *);
3440 Elm_Win_Smart_Data *sd = _pd;
3442 if (!icon_name) return;
3443 eina_stringshare_replace(&(sd->icon_name), icon_name);
3444 #ifdef HAVE_ELEMENTARY_X
3445 _elm_win_xwin_update(sd);
3450 elm_win_icon_name_get(const Evas_Object *obj)
3452 ELM_WIN_CHECK(obj) NULL;
3453 const char *ret = NULL;
3454 eo_do((Eo *) obj, elm_obj_win_icon_name_get(&ret));
3459 _icon_name_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3461 const char **ret = va_arg(*list, const char **);
3462 Elm_Win_Smart_Data *sd = _pd;
3463 *ret = sd->icon_name;
3467 elm_win_role_set(Evas_Object *obj, const char *role)
3470 eo_do(obj, elm_obj_win_role_set(role));
3474 _role_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3476 const char *role = va_arg(*list, const char *);
3477 Elm_Win_Smart_Data *sd = _pd;
3480 eina_stringshare_replace(&(sd->role), role);
3481 #ifdef HAVE_ELEMENTARY_X
3482 _elm_win_xwin_update(sd);
3487 elm_win_role_get(const Evas_Object *obj)
3489 ELM_WIN_CHECK(obj) NULL;
3490 const char *ret = NULL;
3491 eo_do((Eo *) obj, elm_obj_win_role_get(&ret));
3496 _role_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3498 const char **ret = va_arg(*list, const char **);
3499 Elm_Win_Smart_Data *sd = _pd;
3504 elm_win_icon_object_set(Evas_Object *obj,
3508 eo_do(obj, elm_obj_win_icon_object_set(icon));
3512 _icon_object_set(Eo *obj, void *_pd, va_list *list)
3514 Evas_Object *icon = va_arg(*list, Evas_Object *);
3515 Elm_Win_Smart_Data *sd = _pd;
3518 evas_object_event_callback_del_full
3519 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3522 evas_object_event_callback_add
3523 (sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
3524 #ifdef HAVE_ELEMENTARY_X
3525 _elm_win_xwin_update(sd);
3529 EAPI const Evas_Object *
3530 elm_win_icon_object_get(const Evas_Object *obj)
3532 ELM_WIN_CHECK(obj) NULL;
3533 const Evas_Object *ret = NULL;
3534 eo_do((Eo *) obj, elm_obj_win_icon_object_get(&ret));
3539 _icon_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3541 const Evas_Object **ret = va_arg(*list, const Evas_Object **);
3542 Elm_Win_Smart_Data *sd = _pd;
3547 elm_win_autodel_set(Evas_Object *obj,
3551 eo_do(obj, elm_obj_win_autodel_set(autodel));
3555 _autodel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3557 Eina_Bool autodel = va_arg(*list, int);
3558 Elm_Win_Smart_Data *sd = _pd;
3559 sd->autodel = autodel;
3563 elm_win_autodel_get(const Evas_Object *obj)
3565 ELM_WIN_CHECK(obj) EINA_FALSE;
3566 Eina_Bool ret = EINA_FALSE;
3567 eo_do((Eo *) obj, elm_obj_win_autodel_get(&ret));
3572 _autodel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3574 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3575 Elm_Win_Smart_Data *sd = _pd;
3580 elm_win_activate(Evas_Object *obj)
3583 eo_do(obj, elm_obj_win_activate());
3587 _activate(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3589 Elm_Win_Smart_Data *sd = _pd;
3594 elm_win_lower(Evas_Object *obj)
3597 eo_do(obj, elm_obj_win_lower());
3601 _lower(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3603 Elm_Win_Smart_Data *sd = _pd;
3608 elm_win_raise(Evas_Object *obj)
3611 eo_do(obj, elm_obj_win_raise());
3615 _raise(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
3617 Elm_Win_Smart_Data *sd = _pd;
3622 elm_win_center(Evas_Object *obj,
3627 eo_do(obj, elm_obj_win_center(h, v));
3631 _center(Eo *obj, void *_pd, va_list *list)
3633 Eina_Bool h = va_arg(*list, int);
3634 Eina_Bool v = va_arg(*list, int);
3635 int win_w, win_h, screen_w, screen_h, nx, ny;
3637 Elm_Win_Smart_Data *sd = _pd;
3639 if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
3642 ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &screen_w, &screen_h);
3643 if ((!screen_w) || (!screen_h)) return;
3645 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
3646 if ((!win_w) || (!win_h)) return;
3648 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
3649 else nx = sd->screen.x;
3650 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
3651 else ny = sd->screen.y;
3655 evas_object_move(obj, nx, ny);
3659 elm_win_borderless_set(Evas_Object *obj,
3660 Eina_Bool borderless)
3663 eo_do(obj, elm_obj_win_borderless_set(borderless));
3667 _borderless_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3669 Eina_Bool borderless = va_arg(*list, int);
3670 Elm_Win_Smart_Data *sd = _pd;
3672 Eina_Bool need_frame = EINA_FALSE;
3674 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3675 need_frame = engine_name &&
3676 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3677 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3682 _elm_win_frame_del(sd);
3687 _elm_win_frame_add(sd, "default");
3690 evas_object_show(sd->frame_obj);
3693 TRAP(sd, borderless_set, borderless);
3694 #ifdef HAVE_ELEMENTARY_X
3695 _elm_win_xwin_update(sd);
3700 elm_win_borderless_get(const Evas_Object *obj)
3702 ELM_WIN_CHECK(obj) EINA_FALSE;
3703 Eina_Bool ret = EINA_FALSE;
3704 eo_do((Eo *) obj, elm_obj_win_borderless_get(&ret));
3709 _borderless_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3711 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3712 Elm_Win_Smart_Data *sd = _pd;
3713 *ret = ecore_evas_borderless_get(sd->ee);
3717 elm_win_shaped_set(Evas_Object *obj,
3721 eo_do(obj, elm_obj_win_shaped_set(shaped));
3725 _shaped_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3727 Eina_Bool shaped = va_arg(*list, int);
3728 Elm_Win_Smart_Data *sd = _pd;
3730 TRAP(sd, shaped_set, shaped);
3731 #ifdef HAVE_ELEMENTARY_X
3732 _elm_win_xwin_update(sd);
3737 elm_win_shaped_get(const Evas_Object *obj)
3739 ELM_WIN_CHECK(obj) EINA_FALSE;
3740 Eina_Bool ret = EINA_FALSE;
3741 eo_do((Eo *) obj, elm_obj_win_shaped_get(&ret));
3746 _shaped_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3748 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3749 Elm_Win_Smart_Data *sd = _pd;
3750 *ret = ecore_evas_shaped_get(sd->ee);
3754 elm_win_alpha_set(Evas_Object *obj,
3758 eo_do(obj, elm_obj_win_alpha_set(enabled));
3762 _alpha_set(Eo *obj, void *_pd, va_list *list)
3764 Eina_Bool enabled = va_arg(*list, int);
3765 Elm_Win_Smart_Data *sd = _pd;
3769 evas_object_image_alpha_set(sd->img_obj, enabled);
3770 ecore_evas_alpha_set(sd->ee, enabled);
3774 #ifdef HAVE_ELEMENTARY_X
3779 if (!ecore_x_screen_is_composited(0))
3780 elm_win_shaped_set(obj, enabled);
3782 TRAP(sd, alpha_set, enabled);
3785 TRAP(sd, alpha_set, enabled);
3786 _elm_win_xwin_update(sd);
3790 TRAP(sd, alpha_set, enabled);
3795 elm_win_alpha_get(const Evas_Object *obj)
3797 ELM_WIN_CHECK(obj) EINA_FALSE;
3798 Eina_Bool ret = EINA_FALSE;
3799 eo_do((Eo *) obj, elm_obj_win_alpha_get(&ret));
3804 _alpha_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3806 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3807 Elm_Win_Smart_Data *sd = _pd;
3811 *ret = evas_object_image_alpha_get(sd->img_obj);
3815 *ret = ecore_evas_alpha_get(sd->ee);
3820 elm_win_override_set(Evas_Object *obj,
3824 eo_do(obj, elm_obj_win_override_set(override));
3828 _override_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3830 Eina_Bool override = va_arg(*list, int);
3831 Elm_Win_Smart_Data *sd = _pd;
3833 TRAP(sd, override_set, override);
3834 #ifdef HAVE_ELEMENTARY_X
3835 _elm_win_xwin_update(sd);
3840 elm_win_override_get(const Evas_Object *obj)
3842 ELM_WIN_CHECK(obj) EINA_FALSE;
3843 Eina_Bool ret = EINA_FALSE;
3844 eo_do((Eo *) obj, elm_obj_win_override_get(&ret));
3849 _override_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3851 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3852 Elm_Win_Smart_Data *sd = _pd;
3853 *ret = ecore_evas_override_get(sd->ee);
3857 elm_win_fullscreen_set(Evas_Object *obj,
3858 Eina_Bool fullscreen)
3861 eo_do(obj, elm_obj_win_fullscreen_set(fullscreen));
3865 _fullscreen_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3867 Eina_Bool fullscreen = va_arg(*list, int);
3868 Elm_Win_Smart_Data *sd = _pd;
3869 // YYY: handle if sd->img_obj
3870 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
3871 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
3873 // these engines... can ONLY be fullscreen
3878 // sd->fullscreen = fullscreen;
3880 Eina_Bool need_frame = EINA_FALSE;
3882 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
3883 need_frame = engine_name &&
3884 ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
3885 (!strcmp(engine_name, ELM_WAYLAND_EGL)));
3887 TRAP(sd, fullscreen_set, fullscreen);
3892 _elm_win_frame_del(sd);
3897 _elm_win_frame_add(sd, "default");
3900 evas_object_show(sd->frame_obj);
3902 #ifdef HAVE_ELEMENTARY_X
3903 _elm_win_xwin_update(sd);
3909 elm_win_fullscreen_get(const Evas_Object *obj)
3911 ELM_WIN_CHECK(obj) EINA_FALSE;
3912 Eina_Bool ret = EINA_FALSE;
3913 eo_do((Eo *) obj, elm_obj_win_fullscreen_get(&ret));
3918 _fullscreen_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3920 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3921 Elm_Win_Smart_Data *sd = _pd;
3925 const char* engine_name = ecore_evas_engine_name_get(sd->ee);
3928 ((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
3929 (!strcmp(engine_name, ELM_SOFTWARE_16_WINCE))))
3931 // these engines... can ONLY be fullscreen
3936 *ret = sd->fullscreen;
3941 elm_win_main_menu_get(const Evas_Object *obj)
3943 ELM_WIN_CHECK(obj) NULL;
3945 eo_do((Eo *) obj, elm_obj_win_main_menu_get(&ret));
3950 _dbus_menu_set(Eina_Bool dbus_connect, void *data)
3952 ELM_WIN_DATA_GET_OR_RETURN(data, sd);
3956 DBG("Setting menu to D-Bus");
3957 edje_object_part_unswallow(sd->layout, sd->main_menu);
3958 edje_object_signal_emit(sd->layout, "elm,action,hide_menu", "elm");
3959 _elm_menu_menu_bar_hide(sd->main_menu);
3963 DBG("Setting menu to local mode");
3964 edje_object_part_swallow(sd->layout, "elm.swallow.menu", sd->main_menu);
3965 edje_object_signal_emit(sd->layout, "elm,action,show_menu", "elm");
3966 evas_object_show(sd->main_menu);
3971 _main_menu_get(Eo *obj, void *_pd, va_list *list)
3973 Eo **ret = va_arg(*list, Eo **);
3974 Elm_Win_Smart_Data *sd = _pd;
3975 Eina_Bool use_dbus = EINA_FALSE;
3977 if (sd->main_menu) goto end;
3979 sd->main_menu = elm_menu_add(obj);
3980 _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
3982 #ifdef HAVE_ELEMENTARY_X
3983 if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
3986 #ifdef HAVE_ELEMENTARY_X
3987 if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
3989 _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
3990 _dbus_menu_set, obj);
3994 _dbus_menu_set(EINA_FALSE, obj);
3997 *ret = sd->main_menu;
4001 elm_win_maximized_set(Evas_Object *obj,
4002 Eina_Bool maximized)
4005 eo_do(obj, elm_obj_win_maximized_set(maximized));
4009 _maximized_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4011 Eina_Bool maximized = va_arg(*list, int);
4012 Elm_Win_Smart_Data *sd = _pd;
4014 _elm_win_frame_maximized_state_update(sd, maximized);
4015 // YYY: handle if sd->img_obj
4016 TRAP(sd, maximized_set, maximized);
4017 #ifdef HAVE_ELEMENTARY_X
4018 _elm_win_xwin_update(sd);
4023 elm_win_maximized_get(const Evas_Object *obj)
4025 ELM_WIN_CHECK(obj) EINA_FALSE;
4026 Eina_Bool ret = EINA_FALSE;
4027 eo_do((Eo *) obj, elm_obj_win_maximized_get(&ret));
4032 _maximized_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4034 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4035 Elm_Win_Smart_Data *sd = _pd;
4036 *ret = sd->maximized;
4040 elm_win_iconified_set(Evas_Object *obj,
4041 Eina_Bool iconified)
4044 eo_do(obj, elm_obj_win_iconified_set(iconified));
4048 _iconified_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4050 Eina_Bool iconified = va_arg(*list, int);
4051 Elm_Win_Smart_Data *sd = _pd;
4053 // sd->iconified = iconified;
4054 TRAP(sd, iconified_set, iconified);
4055 #ifdef HAVE_ELEMENTARY_X
4056 _elm_win_xwin_update(sd);
4061 elm_win_iconified_get(const Evas_Object *obj)
4063 ELM_WIN_CHECK(obj) EINA_FALSE;
4064 Eina_Bool ret = EINA_FALSE;
4065 eo_do((Eo *) obj, elm_obj_win_iconified_get(&ret));
4070 _iconified_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4072 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4073 Elm_Win_Smart_Data *sd = _pd;
4074 *ret = sd->iconified;
4078 elm_win_withdrawn_set(Evas_Object *obj,
4079 Eina_Bool withdrawn)
4082 eo_do(obj, elm_obj_win_withdrawn_set(withdrawn));
4086 _withdrawn_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4088 Eina_Bool withdrawn = va_arg(*list, int);
4089 Elm_Win_Smart_Data *sd = _pd;
4091 // sd->withdrawn = withdrawn;
4092 TRAP(sd, withdrawn_set, withdrawn);
4093 #ifdef HAVE_ELEMENTARY_X
4094 _elm_win_xwin_update(sd);
4099 elm_win_withdrawn_get(const Evas_Object *obj)
4101 ELM_WIN_CHECK(obj) EINA_FALSE;
4102 Eina_Bool ret = EINA_FALSE;
4103 eo_do((Eo *) obj, elm_obj_win_withdrawn_get(&ret));
4108 _withdrawn_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4110 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4111 Elm_Win_Smart_Data *sd = _pd;
4112 *ret = sd->withdrawn;
4116 elm_win_available_profiles_set(Evas_Object *obj,
4117 const char **profiles,
4121 eo_do((Eo *) obj, elm_obj_win_available_profiles_set(profiles, count));
4125 _available_profiles_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4127 const char **profiles = va_arg(*list, const char **);
4128 unsigned int count = va_arg(*list, unsigned int);
4129 Elm_Win_Smart_Data *sd = _pd;
4130 Eina_Bool found = EINA_FALSE;
4132 _elm_win_available_profiles_del(sd);
4133 if ((profiles) && (count >= 1))
4135 sd->profile.available_list = calloc(count, sizeof(char *));
4136 if (sd->profile.available_list)
4138 if (!sd->profile.name) found = EINA_TRUE;
4141 for (i = 0; i < count; i++)
4143 sd->profile.available_list[i] = eina_stringshare_add(profiles[i]);
4145 /* check to see if a given array has a current profile of elm_win */
4146 if ((sd->profile.name) &&
4147 (!strcmp(sd->profile.name, profiles[i])))
4152 sd->profile.count = count;
4156 if (ecore_evas_window_profile_supported_get(sd->ee))
4158 ecore_evas_window_available_profiles_set(sd->ee,
4159 sd->profile.available_list,
4162 /* current profile of elm_win is wrong, change profile */
4163 if ((sd->profile.available_list) && (!found))
4165 eina_stringshare_replace(&(sd->profile.name),
4166 sd->profile.available_list[0]);
4167 ecore_evas_window_profile_set(sd->ee, sd->profile.name);
4173 if (sd->profile.available_list)
4174 _elm_win_profile_update(sd);
4179 elm_win_available_profiles_get(Evas_Object *obj,
4181 unsigned int *count)
4183 ELM_WIN_CHECK(obj) EINA_FALSE;
4184 Eina_Bool ret = EINA_FALSE;
4185 eo_do((Eo *) obj, elm_obj_win_available_profiles_get(profiles, count, &ret));
4190 _available_profiles_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4192 char ***profiles = va_arg(*list, char ***);
4193 unsigned int *count = va_arg(*list, unsigned int *);
4194 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4195 Elm_Win_Smart_Data *sd = _pd;
4198 if (ecore_evas_window_profile_supported_get(sd->ee))
4200 res = ecore_evas_window_available_profiles_get(sd->ee,
4206 if (profiles) *profiles = (char **)sd->profile.available_list;
4207 if (count) *count = sd->profile.count;
4210 if (ret) *ret = res;
4214 elm_win_profile_set(Evas_Object *obj,
4215 const char *profile)
4218 eo_do((Eo *) obj, elm_obj_win_profile_set(profile));
4222 _profile_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4224 const char *profile = va_arg(*list, const char *);
4225 Elm_Win_Smart_Data *sd = _pd;
4227 /* check to see if a given profile is present in an available profiles */
4228 if ((profile) && (sd->profile.available_list))
4230 Eina_Bool found = EINA_FALSE;
4232 for (i = 0; i < sd->profile.count; i++)
4234 if (!strcmp(profile,
4235 sd->profile.available_list[i]))
4244 if (ecore_evas_window_profile_supported_get(sd->ee))
4246 if (!profile) _elm_win_profile_del(sd);
4247 ecore_evas_window_profile_set(sd->ee, profile);
4251 if (_elm_win_profile_set(sd, profile))
4252 _elm_win_profile_update(sd);
4257 elm_win_profile_get(const Evas_Object *obj)
4259 ELM_WIN_CHECK(obj) NULL;
4260 const char *ret = NULL;
4261 eo_do((Eo *) obj, elm_obj_win_profile_get(&ret));
4266 _profile_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4268 const char **ret = va_arg(*list, const char **);
4269 Elm_Win_Smart_Data *sd = _pd;
4270 *ret = sd->profile.name;
4274 elm_win_urgent_set(Evas_Object *obj,
4278 eo_do(obj, elm_obj_win_urgent_set(urgent));
4282 _urgent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4284 Eina_Bool urgent = va_arg(*list, int);
4285 Elm_Win_Smart_Data *sd = _pd;
4287 sd->urgent = urgent;
4288 TRAP(sd, urgent_set, urgent);
4289 #ifdef HAVE_ELEMENTARY_X
4290 _elm_win_xwin_update(sd);
4295 elm_win_urgent_get(const Evas_Object *obj)
4297 ELM_WIN_CHECK(obj) EINA_FALSE;
4298 Eina_Bool ret = EINA_FALSE;
4299 eo_do((Eo *) obj, elm_obj_win_urgent_get(&ret));
4304 _urgent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4306 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4307 Elm_Win_Smart_Data *sd = _pd;
4312 elm_win_demand_attention_set(Evas_Object *obj,
4313 Eina_Bool demand_attention)
4316 eo_do(obj, elm_obj_win_demand_attention_set(demand_attention));
4320 _demand_attention_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4322 Eina_Bool demand_attention = va_arg(*list, int);
4323 Elm_Win_Smart_Data *sd = _pd;
4325 sd->demand_attention = demand_attention;
4326 TRAP(sd, demand_attention_set, demand_attention);
4327 #ifdef HAVE_ELEMENTARY_X
4328 _elm_win_xwin_update(sd);
4333 elm_win_demand_attention_get(const Evas_Object *obj)
4335 ELM_WIN_CHECK(obj) EINA_FALSE;
4336 Eina_Bool ret = EINA_FALSE;
4337 eo_do((Eo *) obj, elm_obj_win_demand_attention_get(&ret));
4342 _demand_attention_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4344 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4345 Elm_Win_Smart_Data *sd = _pd;
4346 *ret = sd->demand_attention;
4350 elm_win_modal_set(Evas_Object *obj,
4354 eo_do(obj, elm_obj_win_modal_set(modal));
4358 _modal_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4360 Eina_Bool modal = va_arg(*list, int);
4361 Elm_Win_Smart_Data *sd = _pd;
4364 TRAP(sd, modal_set, modal);
4365 #ifdef HAVE_ELEMENTARY_X
4366 _elm_win_xwin_update(sd);
4371 elm_win_modal_get(const Evas_Object *obj)
4373 ELM_WIN_CHECK(obj) EINA_FALSE;
4374 Eina_Bool ret = EINA_FALSE;
4375 eo_do((Eo *) obj, elm_obj_win_modal_get(&ret));
4380 _modal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4382 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4383 Elm_Win_Smart_Data *sd = _pd;
4388 elm_win_aspect_set(Evas_Object *obj,
4392 eo_do(obj, elm_obj_win_aspect_set(aspect));
4396 _aspect_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4398 double aspect = va_arg(*list, double);
4399 Elm_Win_Smart_Data *sd = _pd;
4401 sd->aspect = aspect;
4402 TRAP(sd, aspect_set, aspect);
4403 #ifdef HAVE_ELEMENTARY_X
4404 _elm_win_xwin_update(sd);
4409 elm_win_aspect_get(const Evas_Object *obj)
4411 ELM_WIN_CHECK(obj) 0.0;
4413 eo_do((Eo *) obj, elm_obj_win_aspect_get(&ret));
4418 _aspect_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4420 double *ret = va_arg(*list, double *);
4421 Elm_Win_Smart_Data *sd = _pd;
4426 elm_win_size_base_set(Evas_Object *obj, int w, int h)
4429 eo_do(obj, elm_obj_win_size_base_set(w, h));
4433 _size_base_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4435 int w = va_arg(*list, int);
4436 int h = va_arg(*list, int);
4437 Elm_Win_Smart_Data *sd = _pd;
4438 sd->size_base_w = w;
4439 sd->size_base_h = h;
4440 TRAP(sd, size_base_set, w, h);
4441 #ifdef HAVE_ELEMENTARY_X
4442 _elm_win_xwin_update(sd);
4447 elm_win_size_base_get(Evas_Object *obj, int *w, int *h)
4450 eo_do(obj, elm_obj_win_size_base_get(w, h));
4454 _size_base_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4456 int *w = va_arg(*list, int *);
4457 int *h = va_arg(*list, int *);
4459 Elm_Win_Smart_Data *sd = _pd;
4460 if (w) *w = sd->size_base_w;
4461 if (w) *h = sd->size_base_h;
4465 elm_win_size_step_set(Evas_Object *obj, int w, int h)
4468 eo_do(obj, elm_obj_win_size_step_set(w, h));
4472 _size_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4474 int w = va_arg(*list, int);
4475 int h = va_arg(*list, int);
4476 Elm_Win_Smart_Data *sd = _pd;
4477 sd->size_step_w = w;
4478 sd->size_step_h = h;
4479 TRAP(sd, size_step_set, w, h);
4480 #ifdef HAVE_ELEMENTARY_X
4481 _elm_win_xwin_update(sd);
4486 elm_win_size_step_get(Evas_Object *obj, int *w, int *h)
4489 eo_do(obj, elm_obj_win_size_step_get(w, h));
4493 _size_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4495 int *w = va_arg(*list, int *);
4496 int *h = va_arg(*list, int *);
4497 Elm_Win_Smart_Data *sd = _pd;
4498 if (w) *w = sd->size_step_w;
4499 if (w) *h = sd->size_step_h;
4503 elm_win_layer_set(Evas_Object *obj,
4507 eo_do(obj, elm_obj_win_layer_set(layer));
4511 _layer_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4513 int layer = va_arg(*list, int);
4514 Elm_Win_Smart_Data *sd = _pd;
4516 TRAP(sd, layer_set, layer);
4517 #ifdef HAVE_ELEMENTARY_X
4518 _elm_win_xwin_update(sd);
4523 elm_win_layer_get(const Evas_Object *obj)
4525 ELM_WIN_CHECK(obj) - 1;
4527 eo_do((Eo *) obj, elm_obj_win_layer_get(&ret));
4532 _layer_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4534 int *ret = va_arg(*list, int *);
4535 Elm_Win_Smart_Data *sd = _pd;
4536 *ret = ecore_evas_layer_get(sd->ee);
4540 elm_win_norender_push(Evas_Object *obj)
4543 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4546 if (sd->norender == 1) ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
4550 elm_win_norender_pop(Evas_Object *obj)
4553 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4555 if (sd->norender <= 0) return;
4557 if (sd->norender == 0) ecore_evas_manual_render_set(sd->ee, EINA_FALSE);
4561 elm_win_norender_get(Evas_Object *obj)
4563 ELM_WIN_CHECK(obj) - 1;
4564 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
4565 return sd->norender;
4569 elm_win_render(Evas_Object *obj)
4572 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
4573 ecore_evas_manual_render(sd->ee);
4577 _win_rotation_degree_check(int rotation)
4579 if ((rotation > 360) || (rotation < 0))
4581 WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
4583 if (rotation < 0) rotation += 360;
4589 * This API resizes the internal window(ex: X window) and evas_output.
4590 * But this does not resize the elm window object and its contents.
4593 elm_win_rotation_set(Evas_Object *obj,
4597 eo_do(obj, elm_obj_win_rotation_set(rotation));
4601 _win_rotate(Evas_Object *obj, Elm_Win_Smart_Data *sd, int rotation, Eina_Bool resize)
4603 rotation = _win_rotation_degree_check(rotation);
4604 if (sd->rot == rotation) return;
4606 if (resize) TRAP(sd, rotation_with_resize_set, rotation);
4607 else TRAP(sd, rotation_set, rotation);
4608 evas_object_size_hint_min_set(obj, -1, -1);
4609 evas_object_size_hint_max_set(obj, -1, -1);
4610 _elm_win_resize_objects_eval(obj);
4611 #ifdef HAVE_ELEMENTARY_X
4612 _elm_win_xwin_update(sd);
4614 _elm_win_frame_obj_update(sd);
4615 elm_widget_orientation_set(obj, rotation);
4616 evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
4620 _rotation_set(Eo *obj, void *_pd, va_list *list)
4622 int rotation = va_arg(*list, int);
4623 Elm_Win_Smart_Data *sd = _pd;
4624 _win_rotate(obj, sd, rotation, EINA_FALSE);
4628 * This API does not resize the internal window (ex: X window).
4629 * But this resizes evas_output, elm window, and its contents.
4632 elm_win_rotation_with_resize_set(Evas_Object *obj,
4636 eo_do(obj, elm_obj_win_rotation_with_resize_set(rotation));
4640 _rotation_with_resize_set(Eo *obj, void *_pd, va_list *list)
4642 int rotation = va_arg(*list, int);
4643 Elm_Win_Smart_Data *sd = _pd;
4644 _win_rotate(obj, sd, rotation, EINA_TRUE);
4648 elm_win_rotation_get(const Evas_Object *obj)
4650 ELM_WIN_CHECK(obj) - 1;
4652 eo_do((Eo *) obj, elm_obj_win_rotation_get(&ret));
4657 _rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4659 int *ret = va_arg(*list, int *);
4660 Elm_Win_Smart_Data *sd = _pd;
4665 elm_win_wm_rotation_supported_get(const Evas_Object *obj)
4667 ELM_WIN_CHECK(obj) EINA_FALSE;
4668 Eina_Bool ret = EINA_FALSE;
4669 eo_do((Eo *) obj, elm_obj_win_wm_rotation_supported_get(&ret));
4674 _wm_rotation_supported_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4676 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4677 Elm_Win_Smart_Data *sd = _pd;
4678 *ret = sd->wm_rot.wm_supported;
4681 /* This will unset a preferred rotation, if given preferred rotation is '-1'.
4684 elm_win_wm_rotation_preferred_rotation_set(const Evas_Object *obj,
4688 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_set(rotation));
4692 _wm_preferred_rotation_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4694 int rotation = va_arg(*list, int);
4696 Elm_Win_Smart_Data *sd = _pd;
4698 if (!sd->wm_rot.use)
4699 sd->wm_rot.use = EINA_TRUE;
4701 // '-1' means that elm_win doesn't use preferred rotation.
4705 rot = _win_rotation_degree_check(rotation);
4707 if (sd->wm_rot.preferred_rot == rot) return;
4708 sd->wm_rot.preferred_rot = rot;
4710 ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
4714 elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj)
4716 ELM_WIN_CHECK(obj) -1;
4718 eo_do((Eo *) obj, elm_obj_win_wm_preferred_rotation_get(&ret));
4723 _wm_preferred_rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4725 int *ret = va_arg(*list, int *);
4726 Elm_Win_Smart_Data *sd = _pd;
4727 *ret = sd->wm_rot.preferred_rot;
4731 elm_win_wm_rotation_available_rotations_set(Evas_Object *obj,
4732 const int *rotations,
4736 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_set(rotations, count));
4740 _wm_available_rotations_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4742 const int *rotations = va_arg(*list, const int *);
4743 unsigned int count = va_arg(*list, unsigned int);
4744 Elm_Win_Smart_Data *sd = _pd;
4748 if (!sd->wm_rot.use)
4749 sd->wm_rot.use = EINA_TRUE;
4751 ELM_SAFE_FREE(sd->wm_rot.rots, free);
4752 sd->wm_rot.count = 0;
4756 sd->wm_rot.rots = calloc(count, sizeof(int));
4757 if (!sd->wm_rot.rots) return;
4758 for (i = 0; i < count; i++)
4760 r = _win_rotation_degree_check(rotations[i]);
4761 sd->wm_rot.rots[i] = r;
4765 sd->wm_rot.count = count;
4767 ecore_evas_wm_rotation_available_rotations_set(sd->ee,
4773 elm_win_wm_rotation_available_rotations_get(const Evas_Object *obj,
4775 unsigned int *count)
4777 ELM_WIN_CHECK(obj) EINA_FALSE;
4778 Eina_Bool ret = EINA_FALSE;
4779 eo_do((Eo *) obj, elm_obj_win_wm_available_rotations_get(rotations, count, &ret));
4784 _wm_available_rotations_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4786 int **rotations = va_arg(*list, int **);
4787 unsigned int *count = va_arg(*list, unsigned int *);
4788 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4789 Elm_Win_Smart_Data *sd = _pd;
4791 if (!sd->wm_rot.use) return;
4793 if (sd->wm_rot.count > 0)
4797 *rotations = calloc(sd->wm_rot.count, sizeof(int));
4802 sizeof(int) * sd->wm_rot.count);
4807 if (count) *count = sd->wm_rot.count;
4812 elm_win_wm_rotation_manual_rotation_done_set(Evas_Object *obj,
4816 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_set(set));
4820 _wm_manual_rotation_done_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4822 int set = va_arg(*list, int);
4823 Elm_Win_Smart_Data *sd = _pd;
4824 if (!sd->wm_rot.use) return;
4825 ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
4829 elm_win_wm_rotation_manual_rotation_done_get(const Evas_Object *obj)
4831 ELM_WIN_CHECK(obj) EINA_FALSE;
4832 Eina_Bool ret = EINA_FALSE;
4833 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done_get(&ret));
4838 _wm_manual_rotation_done_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4840 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4841 Elm_Win_Smart_Data *sd = _pd;
4842 if (!sd->wm_rot.use) return;
4843 *ret = ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
4847 elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj)
4850 eo_do((Eo *) obj, elm_obj_win_wm_manual_rotation_done());
4854 _wm_manual_rotation_done(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
4856 Elm_Win_Smart_Data *sd = _pd;
4857 if (!sd->wm_rot.use) return;
4858 ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
4862 elm_win_sticky_set(Evas_Object *obj,
4866 eo_do(obj, elm_obj_win_sticky_set(sticky));
4870 _sticky_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4872 Eina_Bool sticky = va_arg(*list, int);
4873 Elm_Win_Smart_Data *sd = _pd;
4875 // sd->sticky = sticky;
4876 TRAP(sd, sticky_set, sticky);
4877 #ifdef HAVE_ELEMENTARY_X
4878 _elm_win_xwin_update(sd);
4883 elm_win_sticky_get(const Evas_Object *obj)
4885 ELM_WIN_CHECK(obj) EINA_FALSE;
4886 Eina_Bool ret = EINA_FALSE;
4887 eo_do((Eo *) obj, elm_obj_win_sticky_get(&ret));
4892 _sticky_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4894 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4895 Elm_Win_Smart_Data *sd = _pd;
4900 elm_win_keyboard_mode_set(Evas_Object *obj,
4901 Elm_Win_Keyboard_Mode mode)
4904 eo_do(obj, elm_obj_win_keyboard_mode_set(mode));
4908 _keyboard_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4910 Elm_Win_Keyboard_Mode mode = va_arg(*list, Elm_Win_Keyboard_Mode);
4911 Elm_Win_Smart_Data *sd = _pd;
4913 if (mode == sd->kbdmode) return;
4914 #ifdef HAVE_ELEMENTARY_X
4915 _elm_win_xwindow_get(sd);
4918 #ifdef HAVE_ELEMENTARY_X
4920 ecore_x_e_virtual_keyboard_state_set
4921 (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
4925 EAPI Elm_Win_Keyboard_Mode
4926 elm_win_keyboard_mode_get(const Evas_Object *obj)
4928 ELM_WIN_CHECK(obj) ELM_WIN_KEYBOARD_UNKNOWN;
4929 Elm_Win_Keyboard_Mode ret = ELM_WIN_KEYBOARD_UNKNOWN;
4930 eo_do((Eo *) obj, elm_obj_win_keyboard_mode_get(&ret));
4935 _keyboard_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4937 Elm_Win_Keyboard_Mode *ret = va_arg(*list, Elm_Win_Keyboard_Mode *);
4938 Elm_Win_Smart_Data *sd = _pd;
4943 elm_win_keyboard_win_set(Evas_Object *obj,
4944 Eina_Bool is_keyboard)
4947 eo_do(obj, elm_obj_win_keyboard_win_set(is_keyboard));
4951 _keyboard_win_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4953 Eina_Bool is_keyboard = va_arg(*list, int);
4954 Elm_Win_Smart_Data *sd = _pd;
4956 #ifdef HAVE_ELEMENTARY_X
4957 _elm_win_xwindow_get(sd);
4959 ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
4966 elm_win_keyboard_win_get(const Evas_Object *obj)
4968 ELM_WIN_CHECK(obj) EINA_FALSE;
4969 Eina_Bool ret = EINA_FALSE;
4970 eo_do((Eo *) obj, elm_obj_win_keyboard_win_get(&ret));
4975 _keyboard_win_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4977 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
4978 Elm_Win_Smart_Data *sd = _pd;
4980 #ifdef HAVE_ELEMENTARY_X
4981 _elm_win_xwindow_get(sd);
4984 *ret = ecore_x_e_virtual_keyboard_get(sd->x.xwin);
4992 elm_win_indicator_mode_set(Evas_Object *obj,
4993 Elm_Win_Indicator_Mode mode)
4996 eo_do(obj, elm_obj_win_indicator_mode_set(mode));
5000 _indicator_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5002 Elm_Win_Indicator_Mode mode = va_arg(*list, Elm_Win_Indicator_Mode);
5003 Elm_Win_Smart_Data *sd = _pd;
5005 if (mode == sd->indmode) return;
5006 #ifdef HAVE_ELEMENTARY_X
5007 _elm_win_xwindow_get(sd);
5010 #ifdef HAVE_ELEMENTARY_X
5013 if (sd->indmode == ELM_WIN_INDICATOR_SHOW)
5014 ecore_x_e_illume_indicator_state_set
5015 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
5016 else if (sd->indmode == ELM_WIN_INDICATOR_HIDE)
5017 ecore_x_e_illume_indicator_state_set
5018 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
5021 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
5024 EAPI Elm_Win_Indicator_Mode
5025 elm_win_indicator_mode_get(const Evas_Object *obj)
5027 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_UNKNOWN;
5028 Elm_Win_Indicator_Mode ret = ELM_WIN_INDICATOR_UNKNOWN;
5029 eo_do((Eo *) obj, elm_obj_win_indicator_mode_get(&ret));
5034 _indicator_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5036 Elm_Win_Indicator_Mode *ret = va_arg(*list, Elm_Win_Indicator_Mode *);
5037 Elm_Win_Smart_Data *sd = _pd;
5042 elm_win_indicator_opacity_set(Evas_Object *obj,
5043 Elm_Win_Indicator_Opacity_Mode mode)
5046 eo_do(obj, elm_obj_win_indicator_opacity_set(mode));
5050 _indicator_opacity_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5052 Elm_Win_Indicator_Opacity_Mode mode = va_arg(*list, Elm_Win_Indicator_Opacity_Mode);
5053 Elm_Win_Smart_Data *sd = _pd;
5055 if (mode == sd->ind_o_mode) return;
5056 sd->ind_o_mode = mode;
5057 #ifdef HAVE_ELEMENTARY_X
5058 _elm_win_xwindow_get(sd);
5061 if (sd->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
5062 ecore_x_e_illume_indicator_opacity_set
5063 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
5064 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
5065 ecore_x_e_illume_indicator_opacity_set
5066 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
5067 else if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
5068 ecore_x_e_illume_indicator_opacity_set
5069 (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
5072 evas_object_smart_callback_call(obj, SIG_INDICATOR_PROP_CHANGED, NULL);
5075 EAPI Elm_Win_Indicator_Opacity_Mode
5076 elm_win_indicator_opacity_get(const Evas_Object *obj)
5078 ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5079 Elm_Win_Indicator_Opacity_Mode ret = ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
5080 eo_do((Eo *) obj, elm_obj_win_indicator_opacity_get(&ret));
5085 _indicator_opacity_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5087 Elm_Win_Indicator_Opacity_Mode *ret = va_arg(*list, Elm_Win_Indicator_Opacity_Mode *);
5088 Elm_Win_Smart_Data *sd = _pd;
5089 *ret = sd->ind_o_mode;
5093 elm_win_screen_position_get(const Evas_Object *obj,
5098 eo_do((Eo *) obj, elm_obj_win_screen_position_get(x, y));
5102 _screen_position_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5104 int *x = va_arg(*list, int *);
5105 int *y = va_arg(*list, int *);
5106 Elm_Win_Smart_Data *sd = _pd;
5108 if (x) *x = sd->screen.x;
5109 if (y) *y = sd->screen.y;
5113 elm_win_focus_get(const Evas_Object *obj)
5115 ELM_WIN_CHECK(obj) EINA_FALSE;
5116 Eina_Bool ret = EINA_FALSE;
5117 eo_do((Eo *) obj, elm_obj_win_focus_get(&ret));
5122 _focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5124 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5125 Elm_Win_Smart_Data *sd = _pd;
5126 *ret = ecore_evas_focus_get(sd->ee);
5130 elm_win_screen_constrain_set(Evas_Object *obj,
5131 Eina_Bool constrain)
5134 eo_do(obj, elm_obj_win_screen_constrain_set(constrain));
5138 _screen_constrain_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5140 Eina_Bool constrain = va_arg(*list, int);
5141 Elm_Win_Smart_Data *sd = _pd;
5142 sd->constrain = !!constrain;
5146 elm_win_screen_constrain_get(Evas_Object *obj)
5148 ELM_WIN_CHECK(obj) EINA_FALSE;
5149 Eina_Bool ret = EINA_FALSE;
5150 eo_do(obj, elm_obj_win_screen_constrain_get(&ret));
5155 _screen_constrain_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5157 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5158 Elm_Win_Smart_Data *sd = _pd;
5159 *ret = sd->constrain;
5163 elm_win_screen_size_get(const Evas_Object *obj,
5170 eo_do((Eo *) obj, elm_obj_win_screen_size_get(x, y, w, h));
5174 _screen_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5176 int *x = va_arg(*list, int *);
5177 int *y = va_arg(*list, int *);
5178 int *w = va_arg(*list, int *);
5179 int *h = va_arg(*list, int *);
5180 Elm_Win_Smart_Data *sd = _pd;
5182 ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
5186 elm_win_screen_dpi_get(const Evas_Object *obj,
5191 eo_do((Eo *) obj, elm_obj_win_screen_dpi_get(xdpi, ydpi));
5195 _screen_dpi_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5197 int *xdpi = va_arg(*list, int *);
5198 int *ydpi = va_arg(*list, int *);
5199 Elm_Win_Smart_Data *sd = _pd;
5201 ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
5205 elm_win_conformant_set(Evas_Object *obj,
5206 Eina_Bool conformant)
5209 eo_do(obj, elm_obj_win_conformant_set(conformant));
5213 _conformant_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5215 Eina_Bool conformant = va_arg(*list, int);
5216 Elm_Win_Smart_Data *sd = _pd;
5218 #ifdef HAVE_ELEMENTARY_X
5219 _elm_win_xwindow_get(sd);
5221 ecore_x_e_illume_conformant_set(sd->x.xwin, conformant);
5228 elm_win_conformant_get(const Evas_Object *obj)
5230 ELM_WIN_CHECK(obj) EINA_FALSE;
5231 Eina_Bool ret = EINA_FALSE;
5232 eo_do((Eo *) obj, elm_obj_win_conformant_get(&ret));
5237 _conformant_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5239 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5240 Elm_Win_Smart_Data *sd = _pd;
5243 #ifdef HAVE_ELEMENTARY_X
5244 _elm_win_xwindow_get(sd);
5246 *ret = ecore_x_e_illume_conformant_get(sd->x.xwin);
5251 elm_win_quickpanel_set(Evas_Object *obj,
5252 Eina_Bool quickpanel)
5255 eo_do(obj, elm_obj_win_quickpanel_set(quickpanel));
5259 _quickpanel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5261 Eina_Bool quickpanel = va_arg(*list, int);
5262 Elm_Win_Smart_Data *sd = _pd;
5263 #ifdef HAVE_ELEMENTARY_X
5264 _elm_win_xwindow_get(sd);
5267 ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel);
5270 Ecore_X_Window_State states[2];
5272 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
5273 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
5274 ecore_x_netwm_window_state_set(sd->x.xwin, states, 2);
5275 ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
5284 elm_win_quickpanel_get(const Evas_Object *obj)
5286 ELM_WIN_CHECK(obj) EINA_FALSE;
5287 Eina_Bool ret = EINA_FALSE;
5288 eo_do((Eo *) obj, elm_obj_win_quickpanel_get(&ret));
5293 _quickpanel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5295 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5296 Elm_Win_Smart_Data *sd = _pd;
5299 #ifdef HAVE_ELEMENTARY_X
5300 _elm_win_xwindow_get(sd);
5302 *ret = ecore_x_e_illume_quickpanel_get(sd->x.xwin);
5307 elm_win_quickpanel_priority_major_set(Evas_Object *obj,
5311 eo_do(obj, elm_obj_win_quickpanel_priority_major_set(priority));
5315 _quickpanel_priority_major_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5317 int priority = va_arg(*list, int);
5318 Elm_Win_Smart_Data *sd = _pd;
5320 #ifdef HAVE_ELEMENTARY_X
5321 _elm_win_xwindow_get(sd);
5323 ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
5330 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
5332 ELM_WIN_CHECK(obj) - 1;
5334 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_major_get(&ret));
5339 _quickpanel_priority_major_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5341 int *ret = va_arg(*list, int *);
5342 Elm_Win_Smart_Data *sd = _pd;
5345 #ifdef HAVE_ELEMENTARY_X
5346 _elm_win_xwindow_get(sd);
5348 *ret = ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
5353 elm_win_quickpanel_priority_minor_set(Evas_Object *obj,
5357 eo_do(obj, elm_obj_win_quickpanel_priority_minor_set(priority));
5361 _quickpanel_priority_minor_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5363 int priority = va_arg(*list, int);
5364 Elm_Win_Smart_Data *sd = _pd;
5366 #ifdef HAVE_ELEMENTARY_X
5367 _elm_win_xwindow_get(sd);
5369 ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
5376 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
5378 ELM_WIN_CHECK(obj) - 1;
5380 eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_minor_get(&ret));
5385 _quickpanel_priority_minor_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5387 int *ret = va_arg(*list, int *);
5388 Elm_Win_Smart_Data *sd = _pd;
5391 #ifdef HAVE_ELEMENTARY_X
5392 _elm_win_xwindow_get(sd);
5394 *ret = ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
5399 elm_win_quickpanel_zone_set(Evas_Object *obj,
5403 eo_do(obj, elm_obj_win_quickpanel_zone_set(zone));
5407 _quickpanel_zone_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5409 int zone = va_arg(*list, int);
5410 Elm_Win_Smart_Data *sd = _pd;
5412 #ifdef HAVE_ELEMENTARY_X
5413 _elm_win_xwindow_get(sd);
5415 ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
5422 elm_win_quickpanel_zone_get(const Evas_Object *obj)
5424 ELM_WIN_CHECK(obj) 0;
5426 eo_do((Eo *) obj, elm_obj_win_quickpanel_zone_get(&ret));
5431 _quickpanel_zone_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5433 int *ret = va_arg(*list, int *);
5434 Elm_Win_Smart_Data *sd = _pd;
5437 #ifdef HAVE_ELEMENTARY_X
5438 _elm_win_xwindow_get(sd);
5440 *ret = ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
5445 elm_win_prop_focus_skip_set(Evas_Object *obj,
5449 eo_do(obj, elm_obj_win_prop_focus_skip_set(skip));
5453 _prop_focus_skip_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5455 Eina_Bool skip = va_arg(*list, int);
5456 Elm_Win_Smart_Data *sd = _pd;
5458 sd->skip_focus = skip;
5459 TRAP(sd, focus_skip_set, skip);
5463 elm_win_illume_command_send(Evas_Object *obj,
5464 Elm_Illume_Command command,
5468 eo_do(obj, elm_obj_win_illume_command_send(command, params));
5472 _illume_command_send(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5474 Elm_Illume_Command command = va_arg(*list, Elm_Illume_Command);
5475 void *params = va_arg(*list, void *);
5477 Elm_Win_Smart_Data *sd = _pd;
5479 #ifdef HAVE_ELEMENTARY_X
5480 _elm_win_xwindow_get(sd);
5485 case ELM_ILLUME_COMMAND_FOCUS_BACK:
5486 ecore_x_e_illume_focus_back_send(sd->x.xwin);
5489 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
5490 ecore_x_e_illume_focus_forward_send(sd->x.xwin);
5493 case ELM_ILLUME_COMMAND_FOCUS_HOME:
5494 ecore_x_e_illume_focus_home_send(sd->x.xwin);
5497 case ELM_ILLUME_COMMAND_CLOSE:
5498 ecore_x_e_illume_close_send(sd->x.xwin);
5511 elm_win_inlined_image_object_get(Evas_Object *obj)
5513 ELM_WIN_CHECK(obj) NULL;
5514 Evas_Object *ret = NULL;
5515 eo_do(obj, elm_obj_win_inlined_image_object_get(&ret));
5520 _inlined_image_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5522 Evas_Object **ret = va_arg(*list, Evas_Object **);
5523 Elm_Win_Smart_Data *sd = _pd;
5528 elm_win_focus_highlight_enabled_set(Evas_Object *obj,
5532 eo_do(obj, elm_obj_win_focus_highlight_enabled_set(enabled));
5536 _focus_highlight_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5538 Eina_Bool enabled = va_arg(*list, int);
5539 Elm_Win_Smart_Data *sd = _pd;
5541 enabled = !!enabled;
5542 if (sd->focus_highlight.enabled == enabled)
5545 sd->focus_highlight.enabled = enabled;
5547 if (sd->focus_highlight.enabled)
5548 _elm_win_focus_highlight_init(sd);
5550 _elm_win_focus_highlight_shutdown(sd);
5554 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
5556 ELM_WIN_CHECK(obj) EINA_FALSE;
5557 Eina_Bool ret = EINA_FALSE;
5558 eo_do((Eo *) obj, elm_obj_win_focus_highlight_enabled_get(&ret));
5563 _focus_highlight_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5565 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5566 Elm_Win_Smart_Data *sd = _pd;
5567 *ret = sd->focus_highlight.enabled;
5571 elm_win_focus_highlight_style_set(Evas_Object *obj,
5575 eo_do(obj, elm_obj_win_focus_highlight_style_set(style));
5579 _elm_win_smart_theme(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
5581 Elm_Win_Smart_Data *sd = _pd;
5582 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5583 Eina_Bool int_ret = EINA_FALSE;
5585 if (ret) *ret = EINA_TRUE;
5587 eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret));
5588 if (!int_ret) return;
5590 sd->focus_highlight.theme_changed = EINA_TRUE;
5591 _elm_win_focus_highlight_reconfigure_job_start(sd);
5593 if (ret) *ret = EINA_TRUE;
5597 _focus_highlight_style_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5599 const char *style = va_arg(*list, const char *);
5600 Elm_Win_Smart_Data *sd = _pd;
5602 eina_stringshare_replace(&sd->focus_highlight.style, style);
5603 sd->focus_highlight.theme_changed = EINA_TRUE;
5604 _elm_win_focus_highlight_reconfigure_job_start(sd);
5608 elm_win_focus_highlight_style_get(const Evas_Object *obj)
5610 ELM_WIN_CHECK(obj) NULL;
5611 const char *ret = NULL;
5612 eo_do((Eo *) obj, elm_obj_win_focus_highlight_style_get(&ret));
5617 _focus_highlight_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5619 const char **ret = va_arg(*list, const char **);
5620 Elm_Win_Smart_Data *sd = _pd;
5621 *ret = sd->focus_highlight.style;
5625 elm_win_focus_highlight_animate_set(Evas_Object *obj,
5629 eo_do(obj, elm_obj_win_focus_highlight_animate_set(animate));
5633 _focus_highlight_animate_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5635 Eina_Bool animate = va_arg(*list, int);
5636 Elm_Win_Smart_Data *sd = _pd;
5638 animate = !!animate;
5639 if (sd->focus_highlight.animate == animate)
5642 sd->focus_highlight.animate = animate;
5643 sd->focus_highlight.theme_changed = EINA_TRUE;
5644 _elm_win_focus_highlight_reconfigure_job_start(sd);
5648 elm_win_focus_highlight_animate_get(const Evas_Object *obj)
5650 ELM_WIN_CHECK(obj) EINA_FALSE;
5651 Eina_Bool ret = EINA_FALSE;
5652 eo_do((Eo *) obj, elm_obj_win_focus_highlight_animate_get(&ret));
5657 _focus_highlight_animate_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5659 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5660 Elm_Win_Smart_Data *sd = _pd;
5661 *ret = sd->focus_highlight.animate;
5665 elm_win_socket_listen(Evas_Object *obj,
5666 const char *svcname,
5670 ELM_WIN_CHECK(obj) EINA_FALSE;
5671 Eina_Bool ret = EINA_FALSE;
5672 eo_do(obj, elm_obj_win_socket_listen(svcname, svcnum, svcsys, &ret));
5677 _socket_listen(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5679 const char *svcname = va_arg(*list, const char *);
5680 int svcnum = va_arg(*list, int);
5681 Eina_Bool svcsys = va_arg(*list, int);
5682 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5683 Elm_Win_Smart_Data *sd = _pd;
5686 if (!sd->ee) return;
5688 if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
5694 /* windowing specific calls - shall we do this differently? */
5697 elm_win_xwindow_get(const Evas_Object *obj)
5701 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5703 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5704 return _elm_ee_xwin_get(ee);
5707 ELM_WIN_CHECK(obj) 0;
5708 Ecore_X_Window ret = 0;
5709 eo_do((Eo *) obj, elm_obj_win_xwindow_get(&ret));
5714 _xwindow_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5716 Ecore_X_Window *ret = va_arg(*list, Ecore_X_Window *);
5717 Elm_Win_Smart_Data *sd = _pd;
5719 #ifdef HAVE_ELEMENTARY_X
5727 *ret = elm_win_xwindow_get(sd->parent);
5734 EAPI Ecore_Wl_Window *
5735 elm_win_wl_window_get(const Evas_Object *obj)
5737 if (!obj) return NULL;
5739 if ((!ENGINE_COMPARE(ELM_WAYLAND_SHM)) &&
5740 (!ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5743 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5745 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5746 return _elm_ee_wlwin_get(ee);
5749 ELM_WIN_CHECK(obj) NULL;
5750 Ecore_Wl_Window *ret = NULL;
5751 eo_do((Eo *) obj, elm_obj_win_wl_window_get(&ret));
5756 _wl_window_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5758 Ecore_Wl_Window **ret = va_arg(*list, Ecore_Wl_Window **);
5759 #if HAVE_ELEMENTARY_WAYLAND
5760 Elm_Win_Smart_Data *sd = _pd;
5768 *ret = elm_win_wl_window_get(sd->parent);
5778 elm_win_trap_set(const Elm_Win_Trap *t)
5780 DBG("old %p, new %p", trap, t);
5782 if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
5784 CRI("trying to set a trap version %lu while %lu was expected!",
5785 t->version, ELM_WIN_TRAP_VERSION);
5794 elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
5797 ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
5799 floating = !!floating;
5800 if (floating == sd->floating) return;
5801 sd->floating = floating;
5802 #ifdef HAVE_ELEMENTARY_X
5803 _elm_win_xwindow_get(sd);
5807 ecore_x_e_illume_window_state_set
5808 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING);
5810 ecore_x_e_illume_window_state_set
5811 (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL);
5817 elm_win_floating_mode_get(const Evas_Object *obj)
5819 ELM_WIN_CHECK(obj) EINA_FALSE;
5820 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
5822 return sd->floating;
5826 _window_id_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5828 Ecore_Window *ret = va_arg(*list, Ecore_Window *);
5829 Elm_Win_Smart_Data *sd = _pd;
5831 if ((ENGINE_COMPARE(ELM_WAYLAND_SHM)) || (ENGINE_COMPARE(ELM_WAYLAND_EGL)))
5833 #if HAVE_ELEMENTARY_WAYLAND
5836 *ret = (Ecore_Window)ecore_wl_window_surface_id_get(sd->wl.win);
5841 Ecore_Wl_Window *parent;
5843 parent = elm_win_wl_window_get(sd->parent);
5844 if (parent) *ret = (Ecore_Window)ecore_wl_window_surface_id_get(parent);
5851 #ifdef HAVE_ELEMENTARY_X
5852 _elm_win_xwindow_get(sd);
5855 *ret = (Ecore_Window)sd->x.xwin;
5860 *ret = (Ecore_Window)elm_win_xwindow_get(sd->parent);
5870 _elm_win_focus_highlight_start(Evas_Object *obj)
5872 ELM_WIN_DATA_GET(obj, sd);
5874 if (!elm_win_focus_highlight_enabled_get(obj)) return;
5875 sd->focus_highlight.cur.visible = EINA_TRUE;
5876 sd->focus_highlight.geometry_changed = EINA_TRUE;
5877 _elm_win_focus_highlight_reconfigure_job(obj);
5881 elm_win_window_id_get(const Evas_Object *obj)
5885 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5887 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5888 return ecore_evas_window_get(ee);
5891 ELM_WIN_CHECK(obj) 0;
5892 Ecore_Window ret = 0;
5893 eo_do((Eo *) obj, elm_obj_win_window_id_get(&ret));
5898 _class_constructor(Eo_Class *klass)
5900 const Eo_Op_Func_Description func_desc[] = {
5901 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
5902 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_win_smart_add),
5903 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_win_smart_del),
5904 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_win_smart_resize),
5905 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_win_smart_move),
5906 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_win_smart_show),
5907 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_win_smart_hide),
5909 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_ON_FOCUS), _elm_win_smart_on_focus),
5910 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_EVENT), _elm_win_smart_event),
5911 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_win_smart_focus_next_manager_is),
5912 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT), _elm_win_smart_focus_next),
5913 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_win_smart_focus_direction_manager_is),
5914 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_win_smart_focus_direction),
5915 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_THEME_APPLY), _elm_win_smart_theme),
5917 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), _win_constructor),
5918 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD), _resize_object_add),
5919 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), _resize_object_del),
5920 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TYPE_GET), _type_get),
5921 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_SET), _title_set),
5922 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_GET), _title_get),
5923 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET), _icon_name_set),
5924 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET), _icon_name_get),
5925 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_SET), _role_set),
5926 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_GET), _role_get),
5927 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET), _icon_object_set),
5928 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET), _icon_object_get),
5929 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET), _autodel_set),
5930 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET), _autodel_get),
5931 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ACTIVATE), _activate),
5932 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LOWER), _lower),
5933 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RAISE), _raise),
5934 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CENTER), _center),
5935 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET), _borderless_set),
5936 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET), _borderless_get),
5937 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_SET), _shaped_set),
5938 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_GET), _shaped_get),
5939 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_SET), _alpha_set),
5940 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_GET), _alpha_get),
5941 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET), _override_set),
5942 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET), _override_get),
5943 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET), _fullscreen_set),
5944 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET), _fullscreen_get),
5945 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET), _main_menu_get),
5946 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET), _maximized_set),
5947 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET), _maximized_get),
5948 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET), _iconified_set),
5949 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET), _iconified_get),
5950 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET), _withdrawn_set),
5951 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET), _withdrawn_get),
5952 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET), _available_profiles_set),
5953 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET), _available_profiles_get),
5954 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_SET), _profile_set),
5955 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROFILE_GET), _profile_get),
5956 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_SET), _urgent_set),
5957 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_GET), _urgent_get),
5958 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET), _demand_attention_set),
5959 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET), _demand_attention_get),
5960 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_SET), _modal_set),
5961 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_GET), _modal_get),
5962 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_SET), _aspect_set),
5963 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_GET), _aspect_get),
5964 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET), _size_base_set),
5965 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET), _size_base_get),
5966 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET), _size_step_set),
5967 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET), _size_step_get),
5968 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_SET), _layer_set),
5969 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_GET), _layer_get),
5970 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_SET), _rotation_set),
5971 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET), _rotation_with_resize_set),
5972 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_GET), _rotation_get),
5973 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_SET), _sticky_set),
5974 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_GET), _sticky_get),
5975 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET), _keyboard_mode_set),
5976 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET), _keyboard_mode_get),
5977 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET), _keyboard_win_set),
5978 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET), _keyboard_win_get),
5979 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET), _indicator_mode_set),
5980 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET), _indicator_mode_get),
5981 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET), _indicator_opacity_set),
5982 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET), _indicator_opacity_get),
5983 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET), _screen_position_get),
5984 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_GET), _focus_get),
5985 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET), _screen_constrain_set),
5986 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET), _screen_constrain_get),
5987 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET), _screen_size_get),
5988 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET), _screen_dpi_get),
5989 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET), _conformant_set),
5990 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET), _conformant_get),
5991 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET), _quickpanel_set),
5992 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET), _quickpanel_get),
5993 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET), _quickpanel_priority_major_set),
5994 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET), _quickpanel_priority_major_get),
5995 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET), _quickpanel_priority_minor_set),
5996 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET), _quickpanel_priority_minor_get),
5997 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET), _quickpanel_zone_set),
5998 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET), _quickpanel_zone_get),
5999 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET), _prop_focus_skip_set),
6000 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND), _illume_command_send),
6001 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET), _inlined_image_object_get),
6002 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET), _focus_highlight_enabled_set),
6003 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET), _focus_highlight_enabled_get),
6004 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET), _focus_highlight_style_set),
6005 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET), _focus_highlight_style_get),
6006 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET), _focus_highlight_animate_set),
6007 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET), _focus_highlight_animate_get),
6008 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN), _socket_listen),
6009 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), _xwindow_get),
6010 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), _wl_window_get),
6011 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET), _window_id_get),
6012 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET), _wm_rotation_supported_get),
6013 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET), _wm_preferred_rotation_set),
6014 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET), _wm_preferred_rotation_get),
6015 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET), _wm_available_rotations_set),
6016 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET), _wm_available_rotations_get),
6017 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET), _wm_manual_rotation_done_set),
6018 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET), _wm_manual_rotation_done_get),
6019 EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE), _wm_manual_rotation_done),
6023 eo_class_funcs_set(klass, func_desc);
6025 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
6028 static const Eo_Op_Description op_desc[] = {
6029 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR, "Adds a window object."),
6030 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD, "Add subobj as a resize object of window obj."),
6031 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL, "Delete subobj as a resize object of window obj."),
6032 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TYPE_GET, "Get the type of the window."),
6033 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_SET, "Set the title of the window."),
6034 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_GET, "Get the title of the window."),
6035 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET, "Set the icon name of the window."),
6036 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET, "Get the icon name of the window."),
6037 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_SET, "Set the role of the window."),
6038 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_GET, "Get the role of the window."),
6039 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET, "Set a window object's icon."),
6040 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET, "Get the icon object used for the window."),
6041 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET, "Set the window's autodel state."),
6042 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET, "Get the window's autodel state."),
6043 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ACTIVATE, "Activate a window object."),
6044 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LOWER, "Lower a window object."),
6045 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RAISE, "Raise a window object."),
6046 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CENTER, "Center a window on its screen."),
6047 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET, "Set the borderless state of a window."),
6048 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET, "Get the borderless state of a window."),
6049 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_SET, "Set the shaped state of a window."),
6050 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_GET, "Get the shaped state of a window."),
6051 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_SET, "Set the alpha channel state of a window."),
6052 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_GET, "Get the alpha channel state of a window."),
6053 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET, "Set the override state of a window."),
6054 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET, "Get the override state of a window."),
6055 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET, "Set the fullscreen state of a window."),
6056 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET, "Get the fullscreen state of a window."),
6057 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAIN_MENU_GET, "Get the Main Menu of a window."),
6058 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET, "Set the maximized state of a window."),
6059 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET, "Get the maximized state of a window."),
6060 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET, "Set the iconified state of a window."),
6061 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET, "Get the iconified state of a window."),
6062 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET, "Set the withdrawn state of a window."),
6063 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET, "Get the withdrawn state of a window."),
6064 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_SET, "Set the array of available profiles to a window."),
6065 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AVAILABLE_PROFILES_GET, "Get the array of available profiles of a window."),
6066 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_SET, "Set the profile of a window."),
6067 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROFILE_GET, "Get the profile of a window."),
6068 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_SET, "Set the urgent state of a window."),
6069 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_GET, "Get the urgent state of a window."),
6070 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET, "Set the demand_attention state of a window."),
6071 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET, "Get the demand_attention state of a window."),
6072 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_SET, "Set the modal state of a window."),
6073 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_GET, "Get the modal state of a window."),
6074 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_SET, "Set the aspect ratio of a window."),
6075 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_GET, "Get the aspect ratio of a window."),
6076 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET, "Set the base window size used with stepping calculation."),
6077 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET, "Get the base size of a window."),
6078 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET, "Set the window stepping used with sizing calculation."),
6079 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET, "Get the stepping of a window."),
6080 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_SET, "Set the layer of the window."),
6081 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_GET, "Get the layer of the window."),
6082 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_SET, "Set the rotation of the window."),
6083 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET, "Rotates the window and resizes it."),
6084 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_GET, "Get the rotation of the window."),
6085 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_SET, "Set the sticky state of the window."),
6086 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_GET, "Get the sticky state of the window."),
6087 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET, "Sets the keyboard mode of the window."),
6088 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET, "Get the keyboard mode of the window."),
6089 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET, "Sets whether the window is a keyboard."),
6090 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET, "Get whether the window is a keyboard."),
6091 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET, "Sets the indicator mode of the window."),
6092 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET, "Get the indicator mode of the window."),
6093 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET, "Sets the indicator opacity mode of the window."),
6094 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET, "Get the indicator opacity mode of the window."),
6095 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET, "Get the screen position of a window."),
6096 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_GET, "Determine whether a window has focus."),
6097 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."),
6098 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."),
6099 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET, "Get screen geometry details for the screen that a window is on."),
6100 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET, "Get screen dpi for the screen that a window is on."),
6101 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET, "Set if this window is an illume conformant window."),
6102 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET, "Get if this window is an illume conformant window."),
6103 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET, "Set a window to be an illume quickpanel window."),
6104 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET, "Get if this window is a quickpanel or not."),
6105 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET, "Set the major priority of a quickpanel window."),
6106 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET, "Get the major priority of a quickpanel window."),
6107 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET, "Set the minor priority of a quickpanel window."),
6108 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET, "Get the minor priority of a quickpanel window."),
6109 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET, "Set which zone this quickpanel should appear in."),
6110 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET, "Get which zone this quickpanel should appear in."),
6111 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET, "Set the window to be skipped by keyboard focus."),
6112 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND, "Send a command to the windowing environment."),
6113 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET, "Get the inlined image object handle."),
6114 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET, "Set the enabled status for the focus highlight in a window."),
6115 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET, "Get the enabled value of the focus highlight for this window."),
6116 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET, "Set the style for the focus highlight on this window."),
6117 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET, "Get the style set for the focus highlight object."),
6118 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_SET, "Set the animate status for the focus highlight for this window."),
6119 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ANIMATE_GET, "Get the animate status for the focus highlight for this window."),
6120 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN, "Create a socket to provide the service for Plug widget."),
6121 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, "Get the Ecore_X_Window of an Evas_Object."),
6122 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, "Get the Ecore_Wl_Window of an Evas_Object."),
6123 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WINDOW_ID_GET, "Get the Ecore_Window of an Evas_Object."),
6124 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_ROTATION_SUPPORTED_GET, "Query if the underlying windowing system supports the window manager rotation.."),
6125 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_SET, "Set the preferred rotation hint."),
6126 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_PREFERRED_ROTATION_GET, "Get the preferred rotation hint."),
6127 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_SET, "Set the array of available window rotations."),
6128 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_AVAILABLE_ROTATIONS_GET, "Get the array of available window rotations."),
6129 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_SET, "Set manual rotation done mode of obj window."),
6130 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE_GET, "Get manual rotation done mode of obj window."),
6131 EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WM_MANUAL_ROTATION_DONE, "Set rotation finish manually"),
6132 EO_OP_DESCRIPTION_SENTINEL
6135 static const Eo_Class_Description class_desc = {
6138 EO_CLASS_TYPE_REGULAR,
6139 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WIN_BASE_ID, op_desc, ELM_OBJ_WIN_SUB_ID_LAST),
6141 sizeof(Elm_Win_Smart_Data),
6146 EO_DEFINE_CLASS(elm_obj_win_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);