1 #include <Elementary.h>
4 typedef struct _Elm_Win Elm_Win;
10 Evas_Object *parent, *win_obj, *img_obj, *frame_obj;
12 #ifdef HAVE_ELEMENTARY_X
14 Ecore_Event_Handler *client_message_handler;
16 Ecore_Job *deferred_resize_job;
17 Ecore_Job *deferred_child_eval_job;
20 Elm_Win_Keyboard_Mode kbdmode;
21 Elm_Win_Indicator_Mode indmode;
29 int *autodel_clear, rot;
38 Evas_Object *obj, *hot_obj;
46 Eina_Bool visible : 1;
47 Eina_Bool handled : 1;
51 Ecore_Job *reconf_job;
53 Eina_Bool enabled : 1;
54 Eina_Bool changed_theme : 1;
55 Eina_Bool top_animate : 1;
56 Eina_Bool geometry_changed : 1;
62 Eina_Bool demand_attention : 1;
63 Eina_Bool autodel : 1;
64 Eina_Bool constrain : 1;
65 Eina_Bool resizing : 1;
66 Eina_Bool iconified : 1;
67 Eina_Bool withdrawn : 1;
69 Eina_Bool fullscreen : 1;
70 Eina_Bool maximized : 1;
71 Eina_Bool skip_focus : 1;
74 static const char *widtype = NULL;
75 static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
76 static void _elm_win_obj_callback_img_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
77 static void _elm_win_obj_callback_parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
78 static void _elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
79 static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
80 static void _elm_win_move(Ecore_Evas *ee);
81 static void _elm_win_resize(Ecore_Evas *ee);
82 static void _elm_win_delete_request(Ecore_Evas *ee);
83 static void _elm_win_resize_job(void *data);
84 #ifdef HAVE_ELEMENTARY_X
85 static void _elm_win_xwin_update(Elm_Win *win);
87 static void _elm_win_eval_subobjs(Evas_Object *obj);
88 static void _elm_win_subobj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
89 static void _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
90 static void _elm_win_focus_highlight_init(Elm_Win *win);
91 static void _elm_win_focus_highlight_shutdown(Elm_Win *win);
92 static void _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible);
93 static void _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win);
94 static void _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win);
95 static void _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission, const char *source);
96 static void _elm_win_focus_highlight_reconfigure(Elm_Win *win);
98 static void _elm_win_frame_add(Elm_Win *win, const char *style);
99 static void _elm_win_frame_cb_move_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
100 static void _elm_win_frame_cb_resize_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source);
101 static void _elm_win_frame_cb_minimize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
102 static void _elm_win_frame_cb_maximize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
103 static void _elm_win_frame_cb_close(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
105 //static void _elm_win_pointer_add(Elm_Win *win, const char *style);
107 static const char SIG_DELETE_REQUEST[] = "delete,request";
108 static const char SIG_FOCUS_OUT[] = "focus,out";
109 static const char SIG_FOCUS_IN[] = "focus,in";
110 static const char SIG_MOVED[] = "moved";
111 static const char SIG_THEME_CHANGED[] = "theme,changed";
112 static const char SIG_WITHDRAWN[] = "withdrawn";
113 static const char SIG_ICONIFIED[] = "iconified";
114 static const char SIG_NORMAL[] = "normal";
115 static const char SIG_STICK[] = "stick";
116 static const char SIG_UNSTICK[] = "unstick";
117 static const char SIG_FULLSCREEN[] = "fullscreen";
118 static const char SIG_UNFULLSCREEN[] = "unfullscreen";
119 static const char SIG_MAXIMIZED[] = "maximized";
120 static const char SIG_UNMAXIMIZED[] = "unmaximized";
122 static const Evas_Smart_Cb_Description _signals[] = {
123 {SIG_DELETE_REQUEST, ""},
132 {SIG_FULLSCREEN, ""},
133 {SIG_UNFULLSCREEN, ""},
135 {SIG_UNMAXIMIZED, ""},
141 Eina_List *_elm_win_list = NULL;
142 int _elm_win_deferred_free = 0;
144 // exmaple shot spec (wait 0.1 sec then save as my-window.png):
145 // ELM_ENGINE="shot:delay=0.1:file=my-window.png"
148 _shot_delay_get(Elm_Win *win)
151 char *d = strdup(win->shot.info);
154 for (p = (char *)win->shot.info; *p; p++)
156 if (!strncmp(p, "delay=", 6))
160 for (pd = d, p += 6; (*p) && (*p != ':'); p++, pd++)
175 _shot_file_get(Elm_Win *win)
178 char *tmp = strdup(win->shot.info);
179 char *repname = NULL;
181 if (!tmp) return NULL;
183 for (p = (char *)win->shot.info; *p; p++)
185 if (!strncmp(p, "file=", 5))
188 if (!win->shot.repeat_count) return tmp;
191 char *dotptr = strrchr(tmp, '.');
194 size_t size = sizeof(char)*(strlen(tmp) + 16);
195 repname = malloc(size);
196 strncpy(repname, tmp, dotptr - tmp);
197 snprintf(repname + (dotptr - tmp), size - (dotptr - tmp), "%03i",
198 win->shot.shot_counter + 1);
199 strcat(repname, dotptr);
207 if (!win->shot.repeat_count) return strdup("out.png");
209 repname = malloc(sizeof(char) * 24);
210 snprintf(repname, sizeof(char) * 24, "out%03i.png", win->shot.shot_counter + 1);
215 _shot_repeat_count_get(Elm_Win *win)
218 char *d = strdup(win->shot.info);
221 for (p = (char *)win->shot.info; *p; p++)
223 if (!strncmp(p, "repeat=", 7))
227 for (pd = d, p += 7; (*p) && (*p != ':'); p++, pd++)
234 if (v > 1000) v = 999;
244 _shot_key_get(Elm_Win *win __UNUSED__)
250 _shot_flags_get(Elm_Win *win __UNUSED__)
256 _shot_do(Elm_Win *win)
260 unsigned int *pixels;
262 char *file, *key, *flags;
264 ecore_evas_manual_render(win->ee);
265 pixels = (void *)ecore_evas_buffer_pixels_get(win->ee);
267 ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
268 if ((w < 1) || (h < 1)) return;
269 file = _shot_file_get(win);
271 key = _shot_key_get(win);
272 flags = _shot_flags_get(win);
273 ee = ecore_evas_buffer_new(1, 1);
274 o = evas_object_image_add(ecore_evas_get(ee));
275 evas_object_image_alpha_set(o, ecore_evas_alpha_get(win->ee));
276 evas_object_image_size_set(o, w, h);
277 evas_object_image_data_set(o, pixels);
278 if (!evas_object_image_save(o, file, key, flags))
280 ERR("Cannot save window to '%s' (key '%s', flags '%s')",
285 if (flags) free(flags);
287 if (win->shot.repeat_count) win->shot.shot_counter++;
291 _shot_delay(void *data)
295 if (win->shot.repeat_count)
297 int remainshot = (win->shot.repeat_count - win->shot.shot_counter);
298 if (remainshot > 0) return EINA_TRUE;
300 win->shot.timer = NULL;
306 _shot_init(Elm_Win *win)
308 if (!win->shot.info) return;
309 win->shot.repeat_count = _shot_repeat_count_get(win);
310 win->shot.shot_counter = 0;
314 _shot_handle(Elm_Win *win)
316 if (!win->shot.info) return;
317 win->shot.timer = ecore_timer_add(_shot_delay_get(win), _shot_delay, win);
321 _elm_win_move(Ecore_Evas *ee)
323 Evas_Object *obj = ecore_evas_object_associate_get(ee);
328 win = elm_widget_data_get(obj);
330 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
333 evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL);
337 _elm_win_resize(Ecore_Evas *ee)
339 Evas_Object *obj = ecore_evas_object_associate_get(ee);
343 win = elm_widget_data_get(obj);
345 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
346 win->deferred_resize_job = ecore_job_add(_elm_win_resize_job, win);
350 _elm_win_mouse_in(Ecore_Evas *ee)
355 if (!(obj = ecore_evas_object_associate_get(ee))) return;
356 if (!(win = elm_widget_data_get(obj))) return;
357 if (win->resizing) win->resizing = EINA_FALSE;
361 _elm_win_focus_in(Ecore_Evas *ee)
363 Evas_Object *obj = ecore_evas_object_associate_get(ee);
367 win = elm_widget_data_get(obj);
369 _elm_widget_top_win_focused_set(win->win_obj, EINA_TRUE);
370 if (!elm_widget_focus_order_get(obj))
372 elm_widget_focus_steal(win->win_obj);
376 elm_widget_focus_restore(win->win_obj);
377 evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_IN, NULL);
378 win->focus_highlight.cur.visible = EINA_TRUE;
379 _elm_win_focus_highlight_reconfigure_job_start(win);
382 edje_object_signal_emit(win->frame_obj, "elm,action,focus", "elm");
384 else if (win->img_obj)
391 _elm_win_focus_out(Ecore_Evas *ee)
393 Evas_Object *obj = ecore_evas_object_associate_get(ee);
397 win = elm_widget_data_get(obj);
399 elm_object_focus_set(win->win_obj, EINA_FALSE);
400 _elm_widget_top_win_focused_set(win->win_obj, EINA_FALSE);
401 evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_OUT, NULL);
402 win->focus_highlight.cur.visible = EINA_FALSE;
403 _elm_win_focus_highlight_reconfigure_job_start(win);
406 edje_object_signal_emit(win->frame_obj, "elm,action,unfocus", "elm");
408 else if (win->img_obj)
415 _elm_win_state_change(Ecore_Evas *ee)
419 Eina_Bool ch_withdrawn = EINA_FALSE;
420 Eina_Bool ch_sticky = EINA_FALSE;
421 Eina_Bool ch_iconified = EINA_FALSE;
422 Eina_Bool ch_fullscreen = EINA_FALSE;
423 Eina_Bool ch_maximized = EINA_FALSE;
425 if (!(obj = ecore_evas_object_associate_get(ee))) return;
427 if (!(win = elm_widget_data_get(obj))) return;
429 if (win->withdrawn != ecore_evas_withdrawn_get(win->ee))
431 win->withdrawn = ecore_evas_withdrawn_get(win->ee);
432 ch_withdrawn = EINA_TRUE;
434 if (win->sticky != ecore_evas_sticky_get(win->ee))
436 win->sticky = ecore_evas_sticky_get(win->ee);
437 ch_sticky = EINA_TRUE;
439 if (win->iconified != ecore_evas_iconified_get(win->ee))
441 win->iconified = ecore_evas_iconified_get(win->ee);
442 ch_iconified = EINA_TRUE;
444 if (win->fullscreen != ecore_evas_fullscreen_get(win->ee))
446 win->fullscreen = ecore_evas_fullscreen_get(win->ee);
447 ch_fullscreen = EINA_TRUE;
449 if (win->maximized != ecore_evas_maximized_get(win->ee))
451 win->maximized = ecore_evas_maximized_get(win->ee);
452 ch_maximized = EINA_TRUE;
454 if ((ch_withdrawn) || (ch_iconified))
457 evas_object_smart_callback_call(win->win_obj, SIG_WITHDRAWN, NULL);
458 else if (win->iconified)
459 evas_object_smart_callback_call(win->win_obj, SIG_ICONIFIED, NULL);
461 evas_object_smart_callback_call(win->win_obj, SIG_NORMAL, NULL);
466 evas_object_smart_callback_call(win->win_obj, SIG_STICK, NULL);
468 evas_object_smart_callback_call(win->win_obj, SIG_UNSTICK, NULL);
473 evas_object_smart_callback_call(win->win_obj, SIG_FULLSCREEN, NULL);
475 evas_object_smart_callback_call(win->win_obj, SIG_UNFULLSCREEN, NULL);
480 evas_object_smart_callback_call(win->win_obj, SIG_MAXIMIZED, NULL);
482 evas_object_smart_callback_call(win->win_obj, SIG_UNMAXIMIZED, NULL);
487 _elm_win_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
489 Elm_Win *wd = elm_widget_data_get(obj);
490 const Eina_List *items;
491 void *(*list_data_get) (const Eina_List *list);
499 if (!(items = elm_widget_focus_custom_chain_get(obj)))
505 list_data_get = eina_list_data_get;
507 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
513 *next = (Evas_Object *)obj;
518 _elm_win_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
520 Elm_Win *win = elm_widget_data_get(obj);
524 evas_object_focus_set(win->img_obj, elm_widget_focus_get(obj));
526 evas_object_focus_set(obj, elm_widget_focus_get(obj));
530 _elm_win_event_cb(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
532 if (type == EVAS_CALLBACK_KEY_DOWN)
534 Evas_Event_Key_Down *ev = event_info;
535 if (!strcmp(ev->keyname, "Tab"))
537 if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
538 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
540 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
541 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
544 else if ((!strcmp(ev->keyname, "Left")) ||
545 (!strcmp(ev->keyname, "KP_Left")))
547 //TODO : woohyun jung
549 else if ((!strcmp(ev->keyname, "Right")) ||
550 (!strcmp(ev->keyname, "KP_Right")))
552 //TODO : woohyun jung
554 else if ((!strcmp(ev->keyname, "Up")) ||
555 (!strcmp(ev->keyname, "KP_Up")))
557 //TODO : woohyun jung
559 else if ((!strcmp(ev->keyname, "Down")) ||
560 (!strcmp(ev->keyname, "KP_Down")))
562 //TODO : woohyun jung
570 _deferred_ecore_evas_free(void *data)
572 ecore_evas_free(data);
573 _elm_win_deferred_free--;
577 _elm_win_obj_callback_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
581 if (!win->show_count) win->show_count++;
582 if (win->shot.info) _shot_handle(win);
586 _elm_win_obj_callback_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
592 evas_object_hide(win->frame_obj);
594 else if (win->img_obj)
596 evas_object_hide(win->img_obj);
598 if (win->pointer.obj)
600 evas_object_hide(win->pointer.obj);
601 ecore_evas_hide(win->pointer.ee);
606 _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info __UNUSED__)
613 evas_object_event_callback_del_full(win->parent, EVAS_CALLBACK_DEL,
614 _elm_win_obj_callback_parent_del, win);
617 if (win->autodel_clear) *(win->autodel_clear) = -1;
618 _elm_win_list = eina_list_remove(_elm_win_list, win->win_obj);
619 while (win->subobjs) elm_win_resize_object_del(obj, win->subobjs->data);
622 ecore_evas_callback_delete_request_set(win->ee, NULL);
623 ecore_evas_callback_resize_set(win->ee, NULL);
625 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
626 if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
627 if (win->shot.info) eina_stringshare_del(win->shot.info);
628 if (win->shot.timer) ecore_timer_del(win->shot.timer);
629 evas_object_event_callback_del_full(win->win_obj, EVAS_CALLBACK_DEL,
630 _elm_win_obj_callback_del, win);
631 while (((child = evas_object_bottom_get(win->evas))) &&
634 evas_object_del(child);
636 while (((child = evas_object_top_get(win->evas))) &&
639 evas_object_del(child);
641 #ifdef HAVE_ELEMENTARY_X
642 if (win->client_message_handler)
643 ecore_event_handler_del(win->client_message_handler);
645 // FIXME: Why are we flushing edje on every window destroy ??
646 // edje_file_cache_flush();
647 // edje_collection_cache_flush();
648 // evas_image_cache_flush(win->evas);
649 // evas_font_cache_flush(win->evas);
650 // FIXME: we are in the del handler for the object and delete the canvas
651 // that lives under it from the handler... nasty. deferring doesn't help either
661 ecore_job_add(_deferred_ecore_evas_free, win->ee);
662 _elm_win_deferred_free++;
666 _elm_win_focus_highlight_shutdown(win);
667 eina_stringshare_del(win->focus_highlight.style);
671 if ((!_elm_win_list) &&
672 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
674 edje_file_cache_flush();
675 edje_collection_cache_flush();
676 evas_image_cache_flush(e);
677 evas_font_cache_flush(e);
683 _elm_win_obj_callback_img_obj_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
686 if (!win->img_obj) return;
687 evas_object_event_callback_del_full
688 (win->img_obj, EVAS_CALLBACK_DEL, _elm_win_obj_callback_img_obj_del, win);
689 evas_object_del(win->img_obj);
693 _elm_win_obj_callback_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
696 if (obj == win->parent) win->parent = NULL;
700 _elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y)
706 if ((x != win->screen.x) || (y != win->screen.y))
710 evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL);
715 evas_object_move(obj, x, y);
720 _elm_win_obj_intercept_show(void *data, Evas_Object *obj)
723 // this is called to make sure all smart containers have calculated their
724 // sizes BEFORE we show the window to make sure it initially appears at
725 // our desired size (ie min size is known first)
726 evas_smart_objects_calculate(evas_object_evas_get(obj));
729 evas_object_show(win->frame_obj);
731 else if (win->img_obj)
733 evas_object_show(win->img_obj);
735 if (win->pointer.obj)
737 ecore_evas_show(win->pointer.ee);
738 evas_object_show(win->pointer.obj);
739 /* ecore_evas_wayland_pointer_set(win->pointer.ee, 10, 10); */
741 evas_object_show(obj);
745 _elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
749 if (ecore_evas_override_get(win->ee))
753 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
756 evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL);
762 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
766 else if (win->img_obj)
770 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
773 // evas_object_move(win->img_obj, x, y);
778 _elm_win_obj_callback_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
785 else if (win->img_obj)
787 Evas_Coord w = 1, h = 1;
789 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
793 ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &sw, &sh);
799 evas_object_image_size_set(win->img_obj, w, h);
804 _elm_win_delete_request(Ecore_Evas *ee)
806 Evas_Object *obj = ecore_evas_object_associate_get(ee);
808 if (strcmp(elm_widget_type_get(obj), "win")) return;
810 win = elm_widget_data_get(obj);
812 int autodel = win->autodel;
813 win->autodel_clear = &autodel;
814 evas_object_ref(win->win_obj);
815 evas_object_smart_callback_call(win->win_obj, SIG_DELETE_REQUEST, NULL);
816 // FIXME: if above callback deletes - then the below will be invalid
817 if (autodel) evas_object_del(win->win_obj);
818 else win->autodel_clear = NULL;
819 evas_object_unref(win->win_obj);
823 _elm_win_resize_job(void *data)
830 win->deferred_resize_job = NULL;
831 ecore_evas_request_geometry_get(win->ee, NULL, NULL, &w, &h);
835 ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &sw, &sh);
841 evas_object_resize(win->frame_obj, w, h);
843 else if (win->img_obj)
846 evas_object_resize(win->win_obj, w, h);
847 EINA_LIST_FOREACH(win->subobjs, l, obj)
849 evas_object_move(obj, 0, 0);
850 evas_object_resize(obj, w, h);
854 #ifdef HAVE_ELEMENTARY_X
856 _elm_win_xwindow_get(Elm_Win *win)
860 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
861 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
863 if (win->ee) win->xwin = ecore_evas_software_x11_window_get(win->ee);
865 else if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
866 ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
867 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
868 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
869 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
870 ENGINE_COMPARE(ELM_OPENGL_SDL) ||
871 ENGINE_COMPARE(ELM_OPENGL_COCOA))
874 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
876 if (win->ee) win->xwin = ecore_evas_software_x11_16_window_get(win->ee);
878 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
880 if (win->ee) win->xwin = ecore_evas_software_x11_8_window_get(win->ee);
883 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
885 if (win->ee) win->xwin = ecore_evas_xrender_x11_window_get(win->ee);
888 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
890 if (win->ee) win->xwin = ecore_evas_gl_x11_window_get(win->ee);
892 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
894 if (win->ee) win->xwin = (long)ecore_evas_win32_window_get(win->ee);
896 #undef ENGINE_COMPARE
900 #ifdef HAVE_ELEMENTARY_X
902 _elm_win_xwin_update(Elm_Win *win)
904 // ecore_x_icccm_icon_name_set
905 // ecore_x_icccm_window_role_set
906 // ecore_x_netwm_visible_name_set
907 // ecore_x_netwm_icon_name_set
908 // ecore_x_netwm_visible_icon_name_set
909 // ecore_x_netwm_icons_set
910 _elm_win_xwindow_get(win);
915 win2 = elm_widget_data_get(win->parent);
919 ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
923 if (!win->xwin) return; /* nothing more to do */
928 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
930 case ELM_WIN_DIALOG_BASIC:
931 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
933 case ELM_WIN_DESKTOP:
934 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
937 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK);
939 case ELM_WIN_TOOLBAR:
940 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
943 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU);
945 case ELM_WIN_UTILITY:
946 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY);
949 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH);
951 case ELM_WIN_DROPDOWN_MENU:
952 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
954 case ELM_WIN_POPUP_MENU:
955 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
957 case ELM_WIN_TOOLTIP:
958 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
960 case ELM_WIN_NOTIFICATION:
961 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
964 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO);
967 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND);
972 ecore_x_e_virtual_keyboard_state_set
973 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
974 if (win->indmode == ELM_WIN_INDICATOR_SHOW)
975 ecore_x_e_illume_indicator_state_set
976 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
977 else if (win->indmode == ELM_WIN_INDICATOR_HIDE)
978 ecore_x_e_illume_indicator_state_set
979 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
984 _elm_win_eval_subobjs(Evas_Object *obj)
987 const Evas_Object *child;
989 Elm_Win *win = elm_widget_data_get(obj);
990 Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
994 EINA_LIST_FOREACH(win->subobjs, l, child)
996 evas_object_size_hint_weight_get(child, &wx, &wy);
997 if (wx == 0.0) xx = 0;
998 if (wy == 0.0) xy = 0;
1000 evas_object_size_hint_min_get(child, &w, &h);
1003 if (w > minw) minw = w;
1004 if (h > minh) minh = h;
1006 evas_object_size_hint_max_get(child, &w, &h);
1009 if (maxw == -1) maxw = w;
1010 else if ((w > 0) && (w < maxw)) maxw = w;
1011 if (maxh == -1) maxh = h;
1012 else if ((h > 0) && (h < maxh)) maxh = h;
1014 if (!xx) maxw = minw;
1016 if (!xy) maxh = minh;
1018 evas_object_size_hint_min_set(obj, minw, minh);
1019 evas_object_size_hint_max_set(obj, maxw, maxh);
1020 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1021 if (w < minw) w = minw;
1022 if (h < minh) h = minh;
1023 if ((maxw >= 0) && (w > maxw)) w = maxw;
1024 if ((maxh >= 0) && (h > maxh)) h = maxh;
1025 evas_object_resize(obj, w, h);
1029 _elm_win_subobj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
1031 Elm_Win *win = elm_widget_data_get(data);
1032 win->subobjs = eina_list_remove(win->subobjs, obj);
1033 _elm_win_eval_subobjs(win->win_obj);
1037 _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1039 _elm_win_eval_subobjs(data);
1043 _elm_win_shutdown(void)
1045 while (_elm_win_list)
1046 evas_object_del(_elm_win_list->data);
1050 _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme)
1057 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1058 elm_widget_theme(obj);
1062 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1063 elm_widget_theme_specific(obj, th, EINA_FALSE);
1068 _elm_win_translate(void)
1073 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1074 elm_widget_translate(obj);
1077 #ifdef HAVE_ELEMENTARY_X
1079 _elm_win_client_message(void *data, int type __UNUSED__, void *event)
1081 Elm_Win *win = data;
1082 Ecore_X_Event_Client_Message *e = event;
1084 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
1085 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
1087 if ((unsigned)e->data.l[0] == win->xwin)
1089 Evas *evas = evas_object_evas_get(win->win_obj);
1092 edje_file_cache_flush();
1093 edje_collection_cache_flush();
1094 evas_image_cache_flush(evas);
1095 evas_font_cache_flush(evas);
1099 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
1101 if ((unsigned)e->data.l[0] == win->xwin)
1103 Evas *evas = evas_object_evas_get(win->win_obj);
1106 edje_file_cache_flush();
1107 edje_collection_cache_flush();
1108 evas_image_cache_flush(evas);
1109 evas_font_cache_flush(evas);
1110 evas_render_dump(evas);
1114 return ECORE_CALLBACK_PASS_ON;
1119 _elm_win_focus_target_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1121 Elm_Win *win = data;
1123 win->focus_highlight.geometry_changed = EINA_TRUE;
1124 _elm_win_focus_highlight_reconfigure_job_start(win);
1128 _elm_win_focus_target_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1130 Elm_Win *win = data;
1132 win->focus_highlight.geometry_changed = EINA_TRUE;
1133 _elm_win_focus_highlight_reconfigure_job_start(win);
1137 _elm_win_focus_target_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1139 Elm_Win *win = data;
1141 win->focus_highlight.cur.target = NULL;
1143 _elm_win_focus_highlight_reconfigure_job_start(win);
1147 _elm_win_focus_target_callbacks_add(Elm_Win *win)
1149 Evas_Object *obj = win->focus_highlight.cur.target;
1151 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
1152 _elm_win_focus_target_move, win);
1153 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
1154 _elm_win_focus_target_resize, win);
1155 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
1156 _elm_win_focus_target_del, win);
1160 _elm_win_focus_target_callbacks_del(Elm_Win *win)
1162 Evas_Object *obj = win->focus_highlight.cur.target;
1164 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
1165 _elm_win_focus_target_move, win);
1166 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
1167 _elm_win_focus_target_resize, win);
1168 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
1169 _elm_win_focus_target_del, win);
1172 static Evas_Object *
1173 _elm_win_focus_target_get(Evas_Object *obj)
1175 Evas_Object *o = obj;
1179 if (elm_widget_is(o))
1181 if (!elm_widget_highlight_ignore_get(o))
1183 o = elm_widget_parent_get(o);
1185 o = evas_object_smart_parent_get(o);
1189 o = elm_widget_parent_widget_get(o);
1191 o = evas_object_smart_parent_get(o);
1200 _elm_win_object_focus_in(void *data, Evas *e __UNUSED__, void *event_info)
1202 Evas_Object *obj = event_info, *target;
1203 Elm_Win *win = data;
1205 if (win->focus_highlight.cur.target == obj)
1208 target = _elm_win_focus_target_get(obj);
1209 win->focus_highlight.cur.target = target;
1210 if (elm_widget_highlight_in_theme_get(target))
1211 win->focus_highlight.cur.handled = EINA_TRUE;
1213 _elm_win_focus_target_callbacks_add(win);
1215 _elm_win_focus_highlight_reconfigure_job_start(win);
1219 _elm_win_object_focus_out(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
1221 Elm_Win *win = data;
1223 if (!win->focus_highlight.cur.target)
1226 if (!win->focus_highlight.cur.handled)
1227 _elm_win_focus_target_callbacks_del(win);
1228 win->focus_highlight.cur.target = NULL;
1229 win->focus_highlight.cur.handled = EINA_FALSE;
1231 _elm_win_focus_highlight_reconfigure_job_start(win);
1235 _elm_win_focus_highlight_hide(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
1237 evas_object_hide(obj);
1241 _elm_win_focus_highlight_init(Elm_Win *win)
1243 evas_event_callback_add(win->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1244 _elm_win_object_focus_in, win);
1245 evas_event_callback_add(win->evas,
1246 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1247 _elm_win_object_focus_out, win);
1249 win->focus_highlight.cur.target = evas_focus_get(win->evas);
1251 win->focus_highlight.top = edje_object_add(win->evas);
1252 win->focus_highlight.changed_theme = EINA_TRUE;
1253 edje_object_signal_callback_add(win->focus_highlight.top,
1254 "elm,action,focus,hide,end", "",
1255 _elm_win_focus_highlight_hide, NULL);
1256 edje_object_signal_callback_add(win->focus_highlight.top,
1257 "elm,action,focus,anim,end", "",
1258 _elm_win_focus_highlight_anim_end, win);
1259 _elm_win_focus_highlight_reconfigure_job_start(win);
1263 _elm_win_focus_highlight_shutdown(Elm_Win *win)
1265 _elm_win_focus_highlight_reconfigure_job_stop(win);
1266 if (win->focus_highlight.cur.target)
1268 _elm_win_focus_target_callbacks_del(win);
1269 win->focus_highlight.cur.target = NULL;
1271 if (win->focus_highlight.top)
1273 evas_object_del(win->focus_highlight.top);
1274 win->focus_highlight.top = NULL;
1277 evas_event_callback_del_full(win->evas,
1278 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1279 _elm_win_object_focus_in, win);
1280 evas_event_callback_del_full(win->evas,
1281 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1282 _elm_win_object_focus_out, win);
1286 _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible)
1290 top = win->focus_highlight.top;
1295 evas_object_show(top);
1296 edje_object_signal_emit(top, "elm,action,focus,show", "elm");
1302 edje_object_signal_emit(top, "elm,action,focus,hide", "elm");
1307 _elm_win_focus_highlight_reconfigure_job(void *data)
1309 _elm_win_focus_highlight_reconfigure((Elm_Win *)data);
1313 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win)
1315 if (win->focus_highlight.reconf_job)
1316 ecore_job_del(win->focus_highlight.reconf_job);
1317 win->focus_highlight.reconf_job = ecore_job_add(
1318 _elm_win_focus_highlight_reconfigure_job, win);
1322 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win)
1324 if (win->focus_highlight.reconf_job)
1325 ecore_job_del(win->focus_highlight.reconf_job);
1326 win->focus_highlight.reconf_job = NULL;
1330 _elm_win_focus_highlight_simple_setup(Elm_Win *win, Evas_Object *obj)
1332 Evas_Object *clip, *target = win->focus_highlight.cur.target;
1333 Evas_Coord x, y, w, h;
1335 clip = evas_object_clip_get(target);
1336 evas_object_geometry_get(target, &x, &y, &w, &h);
1338 evas_object_move(obj, x, y);
1339 evas_object_resize(obj, w, h);
1340 evas_object_clip_set(obj, clip);
1344 _elm_win_focus_highlight_anim_setup(Elm_Win *win, Evas_Object *obj)
1346 Evas_Coord tx, ty, tw, th;
1347 Evas_Coord w, h, px, py, pw, ph;
1348 Edje_Message_Int_Set *m;
1349 Evas_Object *previous = win->focus_highlight.prev.target;
1350 Evas_Object *target = win->focus_highlight.cur.target;
1352 evas_object_geometry_get(win->win_obj, NULL, NULL, &w, &h);
1353 evas_object_geometry_get(target, &tx, &ty, &tw, &th);
1354 evas_object_geometry_get(previous, &px, &py, &pw, &ph);
1355 evas_object_move(obj, 0, 0);
1356 evas_object_resize(obj, tw, th);
1357 evas_object_clip_unset(obj);
1359 m = alloca(sizeof(*m) + (sizeof(int) * 8));
1369 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
1373 _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
1375 Elm_Win *win = data;
1376 _elm_win_focus_highlight_simple_setup(win, obj);
1380 _elm_win_focus_highlight_reconfigure(Elm_Win *win)
1382 Evas_Object *target = win->focus_highlight.cur.target;
1383 Evas_Object *previous = win->focus_highlight.prev.target;
1384 Evas_Object *top = win->focus_highlight.top;
1385 Eina_Bool visible_changed;
1386 Eina_Bool common_visible;
1387 const char *sig = NULL;
1389 _elm_win_focus_highlight_reconfigure_job_stop(win);
1391 visible_changed = (win->focus_highlight.cur.visible !=
1392 win->focus_highlight.prev.visible);
1394 if ((target == previous) && (!visible_changed) &&
1395 (!win->focus_highlight.geometry_changed))
1398 if ((previous) && (win->focus_highlight.prev.handled))
1399 elm_widget_signal_emit(previous, "elm,action,focus_highlight,hide", "elm");
1402 common_visible = EINA_FALSE;
1403 else if (win->focus_highlight.cur.handled)
1405 common_visible = EINA_FALSE;
1406 if (win->focus_highlight.cur.visible)
1407 sig = "elm,action,focus_highlight,show";
1409 sig = "elm,action,focus_highlight,hide";
1412 common_visible = win->focus_highlight.cur.visible;
1414 _elm_win_focus_highlight_visible_set(win, common_visible);
1416 elm_widget_signal_emit(target, sig, "elm");
1418 if ((!target) || (!common_visible) || (win->focus_highlight.cur.handled))
1421 if (win->focus_highlight.changed_theme)
1424 if (win->focus_highlight.style)
1425 str = win->focus_highlight.style;
1428 _elm_theme_object_set(win->win_obj, top, "focus_highlight", "top",
1430 win->focus_highlight.changed_theme = EINA_FALSE;
1432 if (_elm_config->focus_highlight_animate)
1434 str = edje_object_data_get(win->focus_highlight.top, "animate");
1435 win->focus_highlight.top_animate = ((str) && (!strcmp(str, "on")));
1439 if ((win->focus_highlight.top_animate) && (previous) &&
1440 (!win->focus_highlight.prev.handled))
1441 _elm_win_focus_highlight_anim_setup(win, top);
1443 _elm_win_focus_highlight_simple_setup(win, top);
1444 evas_object_raise(top);
1447 win->focus_highlight.geometry_changed = EINA_FALSE;
1448 win->focus_highlight.prev = win->focus_highlight.cur;
1452 _elm_win_frame_add(Elm_Win *win, const char *style)
1454 evas_output_framespace_set(win->evas, 0, 22, 0, 26);
1456 win->frame_obj = edje_object_add(win->evas);
1457 _elm_theme_set(NULL, win->frame_obj, "border", "base", style);
1458 evas_object_is_frame_object_set(win->frame_obj, EINA_TRUE);
1459 evas_object_move(win->frame_obj, 0, 0);
1460 evas_object_resize(win->frame_obj, 1, 1);
1462 edje_object_signal_callback_add(win->frame_obj, "elm,action,move,start",
1463 "elm", _elm_win_frame_cb_move_start, win);
1464 edje_object_signal_callback_add(win->frame_obj, "elm,action,resize,start",
1465 "*", _elm_win_frame_cb_resize_start, win);
1466 edje_object_signal_callback_add(win->frame_obj, "elm,action,minimize",
1467 "elm", _elm_win_frame_cb_minimize, win);
1468 edje_object_signal_callback_add(win->frame_obj, "elm,action,maximize",
1469 "elm", _elm_win_frame_cb_maximize, win);
1470 edje_object_signal_callback_add(win->frame_obj, "elm,action,close",
1471 "elm", _elm_win_frame_cb_close, win);
1475 _elm_win_frame_cb_move_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1479 if (!(win = data)) return;
1480 /* FIXME: Change mouse pointer */
1482 /* NB: 0,0 are dummy values. Wayland handles the move by itself */
1483 ecore_evas_move(win->ee, 0, 0);
1487 _elm_win_frame_cb_resize_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source)
1491 if (!(win = data)) return;
1492 if (win->resizing) return;
1493 win->resizing = EINA_TRUE;
1495 /* FIXME: Change mouse pointer */
1497 if (!strcmp(source, "elm.event.resize.t"))
1498 win->resize_location = 1;
1499 else if (!strcmp(source, "elm.event.resize.b"))
1500 win->resize_location = 2;
1501 else if (!strcmp(source, "elm.event.resize.l"))
1502 win->resize_location = 4;
1503 else if (!strcmp(source, "elm.event.resize.r"))
1504 win->resize_location = 8;
1505 else if (!strcmp(source, "elm.event.resize.tl"))
1506 win->resize_location = 5;
1507 else if (!strcmp(source, "elm.event.resize.tr"))
1508 win->resize_location = 9;
1509 else if (!strcmp(source, "elm.event.resize.bl"))
1510 win->resize_location = 6;
1511 else if (!strcmp(source, "elm.event.resize.br"))
1512 win->resize_location = 10;
1514 win->resize_location = 0;
1516 if (win->resize_location > 0)
1517 ecore_evas_wayland_resize(win->ee, win->resize_location);
1521 _elm_win_frame_cb_minimize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1525 if (!(win = data)) return;
1526 win->iconified = EINA_TRUE;
1527 ecore_evas_iconified_set(win->ee, EINA_TRUE);
1531 _elm_win_frame_cb_maximize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1535 if (!(win = data)) return;
1536 if (win->maximized) win->maximized = EINA_FALSE;
1537 else win->maximized = EINA_TRUE;
1538 ecore_evas_maximized_set(win->ee, win->maximized);
1542 _elm_win_frame_cb_close(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1546 if (!(win = data)) return;
1547 evas_object_del(win->win_obj);
1552 _elm_win_pointer_add(Elm_Win *win, const char *style)
1558 win->pointer.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 32, 32, 0);
1559 ecore_evas_resize(win->pointer.ee, 32, 32);
1561 win->pointer.evas = ecore_evas_get(win->ee);
1563 win->pointer.obj = edje_object_add(win->pointer.evas);
1564 _elm_theme_set(NULL, win->pointer.obj, "pointer", "base", style);
1565 edje_object_size_min_calc(win->pointer.obj, &mw, &mh);
1566 evas_object_move(win->pointer.obj, 0, 0);
1567 evas_object_resize(win->pointer.obj, 32, 32);
1568 evas_object_show(win->pointer.obj);
1574 _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
1576 Evas_Event_Key_Down *ev = event_info;
1578 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
1581 if ((strcmp(ev->keyname, "F12")) ||
1582 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
1585 printf("Tree graph generated.\n");
1586 elm_object_tree_dot_dump(obj, "./dump.dot");
1591 _win_img_hide(void *data,
1593 Evas_Object *obj __UNUSED__,
1594 void *event_info __UNUSED__)
1596 Elm_Win *win = data;
1598 elm_widget_focus_hide_handle(win->win_obj);
1602 _win_img_mouse_up(void *data,
1604 Evas_Object *obj __UNUSED__,
1607 Elm_Win *win = data;
1608 Evas_Event_Mouse_Up *ev = event_info;
1609 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1610 elm_widget_focus_mouse_up_handle(win->win_obj);
1614 _win_img_focus_in(void *data,
1616 Evas_Object *obj __UNUSED__,
1617 void *event_info __UNUSED__)
1619 Elm_Win *win = data;
1620 elm_widget_focus_steal(win->win_obj);
1624 _win_img_focus_out(void *data,
1626 Evas_Object *obj __UNUSED__,
1627 void *event_info __UNUSED__)
1629 Elm_Win *win = data;
1630 elm_widget_focused_object_clear(win->win_obj);
1634 _win_inlined_image_set(Elm_Win *win)
1636 evas_object_image_alpha_set(win->img_obj, EINA_FALSE);
1637 evas_object_image_filled_set(win->img_obj, EINA_TRUE);
1638 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_DEL,
1639 _elm_win_obj_callback_img_obj_del, win);
1641 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_HIDE,
1642 _win_img_hide, win);
1643 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_MOUSE_UP,
1644 _win_img_mouse_up, win);
1645 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_IN,
1646 _win_img_focus_in, win);
1647 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_OUT,
1648 _win_img_focus_out, win);
1652 _subobj_del(Elm_Win *win, Evas_Object *obj, Evas_Object *subobj)
1654 evas_object_event_callback_del_full(subobj,
1655 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1656 _elm_win_subobj_callback_changed_size_hints,
1658 evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL,
1659 _elm_win_subobj_callback_del, obj);
1660 win->subobjs = eina_list_remove(win->subobjs, subobj);
1661 _elm_win_eval_subobjs(obj);
1665 elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
1669 const char *fontpath;
1671 win = ELM_NEW(Elm_Win);
1673 #define FALLBACK_TRY(engine) \
1676 CRITICAL(engine " engine creation failed. Trying default."); \
1677 win->ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL); \
1679 elm_engine_set(ecore_evas_engine_name_get(win->ee)); \
1681 #define ENGINE_COMPARE(name) (_elm_config->engine && !strcmp(_elm_config->engine, name))
1683 win->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
1684 win->indmode = ELM_WIN_INDICATOR_UNKNOWN;
1688 case ELM_WIN_INLINED_IMAGE:
1691 Evas *e = evas_object_evas_get(parent);
1694 ee = ecore_evas_ecore_evas_get(e);
1696 win->img_obj = ecore_evas_object_image_new(ee);
1697 if (!win->img_obj) break;
1698 win->ee = ecore_evas_object_ecore_evas_get(win->img_obj);
1701 _win_inlined_image_set(win);
1704 evas_object_del(win->img_obj);
1705 win->img_obj = NULL;
1709 case ELM_WIN_SOCKET_IMAGE:
1710 win->ee = ecore_evas_extn_socket_new(1, 1);
1714 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
1716 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
1717 #ifdef HAVE_ELEMENTARY_X
1718 win->client_message_handler = ecore_event_handler_add
1719 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1721 FALLBACK_TRY("Sofware X11");
1723 else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
1725 win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
1726 FALLBACK_TRY("Sofware FB");
1728 else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
1730 win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
1731 FALLBACK_TRY("Sofware DirectFB");
1733 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
1735 win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
1736 FALLBACK_TRY("Sofware-16");
1737 #ifdef HAVE_ELEMENTARY_X
1738 win->client_message_handler = ecore_event_handler_add
1739 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1742 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
1744 win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
1745 FALLBACK_TRY("Sofware-8");
1746 #ifdef HAVE_ELEMENTARY_X
1747 win->client_message_handler = ecore_event_handler_add
1748 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1752 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
1754 win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
1755 FALLBACK_TRY("XRender");
1756 #ifdef HAVE_ELEMENTARY_X
1757 win->client_message_handler = ecore_event_handler_add
1758 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1762 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
1767 if (_elm_config->vsync)
1769 opt[opt_i] = ECORE_EVAS_GL_X11_OPT_VSYNC;
1775 win->ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt);
1777 win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
1778 FALLBACK_TRY("OpenGL");
1779 #ifdef HAVE_ELEMENTARY_X
1780 win->client_message_handler = ecore_event_handler_add
1781 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1784 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
1786 win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
1787 FALLBACK_TRY("Sofware Win32");
1789 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1791 win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
1792 FALLBACK_TRY("Sofware-16-WinCE");
1794 else if (ENGINE_COMPARE(ELM_SOFTWARE_PSL1GHT))
1796 win->ee = ecore_evas_psl1ght_new(NULL, 1, 1);
1797 FALLBACK_TRY("PSL1GHT");
1799 else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
1801 win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
1802 FALLBACK_TRY("Sofware SDL");
1804 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
1806 win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
1807 FALLBACK_TRY("Sofware-16-SDL");
1809 else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
1811 win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
1812 FALLBACK_TRY("OpenGL SDL");
1814 else if (ENGINE_COMPARE(ELM_OPENGL_COCOA))
1816 win->ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
1817 FALLBACK_TRY("OpenGL Cocoa");
1819 else if (ENGINE_COMPARE(ELM_BUFFER))
1821 win->ee = ecore_evas_buffer_new(1, 1);
1823 else if (ENGINE_COMPARE(ELM_EWS))
1825 win->ee = ecore_evas_ews_new(0, 0, 1, 1);
1827 else if (ENGINE_COMPARE(ELM_WAYLAND_SHM))
1829 win->ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
1830 win->evas = ecore_evas_get(win->ee);
1832 _elm_win_frame_add(win, "default");
1833 // _elm_win_pointer_add(win, "default");
1835 else if (ENGINE_COMPARE(ELM_WAYLAND_EGL))
1837 win->ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
1838 win->evas = ecore_evas_get(win->ee);
1840 _elm_win_frame_add(win, "default");
1841 // _elm_win_pointer_add(win, "default");
1843 else if (!strncmp(_elm_config->engine, "shot:", 5))
1845 win->ee = ecore_evas_buffer_new(1, 1);
1846 ecore_evas_manual_render_set(win->ee, EINA_TRUE);
1847 win->shot.info = eina_stringshare_add(_elm_config->engine + 5);
1856 ERR("Cannot create window.");
1860 #ifdef HAVE_ELEMENTARY_X
1861 _elm_win_xwindow_get(win);
1863 if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
1864 ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
1865 // bg pixmap done by x - has other issues like can be redrawn by x before it
1866 // is filled/ready by app
1867 // ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
1870 win->parent = parent;
1872 evas_object_event_callback_add(win->parent, EVAS_CALLBACK_DEL,
1873 _elm_win_obj_callback_parent_del, win);
1875 win->evas = ecore_evas_get(win->ee);
1876 win->win_obj = elm_widget_add(win->evas);
1877 elm_widget_type_set(win->win_obj, "win");
1878 ELM_SET_WIDTYPE(widtype, "win");
1879 elm_widget_data_set(win->win_obj, win);
1880 elm_widget_event_hook_set(win->win_obj, _elm_win_event_cb);
1881 elm_widget_on_focus_hook_set(win->win_obj, _elm_win_on_focus_hook, NULL);
1882 elm_widget_can_focus_set(win->win_obj, EINA_TRUE);
1883 elm_widget_highlight_ignore_set(win->win_obj, EINA_TRUE);
1884 elm_widget_focus_next_hook_set(win->win_obj, _elm_win_focus_next_hook);
1885 evas_object_color_set(win->win_obj, 0, 0, 0, 0);
1886 evas_object_move(win->win_obj, 0, 0);
1887 evas_object_resize(win->win_obj, 1, 1);
1888 evas_object_layer_set(win->win_obj, 50);
1889 evas_object_pass_events_set(win->win_obj, EINA_TRUE);
1893 evas_object_clip_set(win->win_obj, win->frame_obj);
1894 evas_object_stack_below(win->frame_obj, win->win_obj);
1897 if (type == ELM_WIN_INLINED_IMAGE)
1898 elm_widget_parent2_set(win->win_obj, parent);
1899 ecore_evas_object_associate(win->ee, win->win_obj,
1900 ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
1901 ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
1902 ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
1903 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
1904 _elm_win_obj_callback_show, win);
1905 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_HIDE,
1906 _elm_win_obj_callback_hide, win);
1907 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
1908 _elm_win_obj_callback_del, win);
1909 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_MOVE,
1910 _elm_win_obj_callback_move, win);
1911 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_RESIZE,
1912 _elm_win_obj_callback_resize, win);
1914 evas_object_intercept_move_callback_add(win->win_obj,
1915 _elm_win_obj_intercept_move, win);
1916 evas_object_intercept_show_callback_add(win->win_obj,
1917 _elm_win_obj_intercept_show, win);
1919 evas_object_smart_callback_add(win->win_obj, "sub-object-del", (Evas_Smart_Cb)_subobj_del, win);
1920 ecore_evas_name_class_set(win->ee, name, _elm_appname);
1921 ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
1922 ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
1923 ecore_evas_callback_mouse_in_set(win->ee, _elm_win_mouse_in);
1924 ecore_evas_callback_focus_in_set(win->ee, _elm_win_focus_in);
1925 ecore_evas_callback_focus_out_set(win->ee, _elm_win_focus_out);
1926 ecore_evas_callback_move_set(win->ee, _elm_win_move);
1927 ecore_evas_callback_state_change_set(win->ee, _elm_win_state_change);
1928 evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024));
1929 evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
1930 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
1931 evas_font_path_append(win->evas, fontpath);
1932 if (!_elm_config->font_hinting)
1933 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
1934 else if (_elm_config->font_hinting == 1)
1935 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_AUTO);
1936 else if (_elm_config->font_hinting == 2)
1937 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_BYTECODE);
1939 #ifdef HAVE_ELEMENTARY_X
1940 _elm_win_xwin_update(win);
1943 _elm_win_list = eina_list_append(_elm_win_list, win->win_obj);
1945 if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
1947 ecore_evas_fullscreen_set(win->ee, 1);
1949 #undef ENGINE_COMPARE
1951 if (_elm_config->focus_highlight_enable)
1952 elm_win_focus_highlight_enabled_set(win->win_obj, EINA_TRUE);
1955 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(win->evas, "Control");
1956 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_KEY_DOWN,
1957 _debug_key_down, win);
1959 Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0,
1961 printf("Ctrl+F12 key combination exclusive for dot tree generation\n");
1964 evas_object_smart_callbacks_descriptions_set(win->win_obj, _signals);
1966 return win->win_obj;
1970 elm_win_util_standard_add(const char *name, const char *title)
1972 Evas_Object *win, *bg;
1974 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
1975 if (!win) return NULL;
1976 elm_win_title_set(win, title);
1977 bg = elm_bg_add(win);
1980 evas_object_del(win);
1983 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1984 elm_win_resize_object_add(win, bg);
1985 evas_object_show(bg);
1990 elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
1994 ELM_CHECK_WIDTYPE(obj, widtype);
1995 win = elm_widget_data_get(obj);
1997 if (eina_list_data_find(win->subobjs, subobj)) return;
1998 win->subobjs = eina_list_append(win->subobjs, subobj);
1999 elm_widget_sub_object_add(obj, subobj);
2000 evas_object_event_callback_add(subobj, EVAS_CALLBACK_DEL,
2001 _elm_win_subobj_callback_del, obj);
2002 evas_object_event_callback_add(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2003 _elm_win_subobj_callback_changed_size_hints,
2005 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
2006 evas_object_move(subobj, 0, 0);
2007 evas_object_resize(subobj, w, h);
2008 _elm_win_eval_subobjs(obj);
2012 elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
2015 ELM_CHECK_WIDTYPE(obj, widtype);
2016 win = elm_widget_data_get(obj);
2018 evas_object_event_callback_del_full(subobj,
2019 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2020 _elm_win_subobj_callback_changed_size_hints,
2022 evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL,
2023 _elm_win_subobj_callback_del, obj);
2024 win->subobjs = eina_list_remove(win->subobjs, subobj);
2025 elm_widget_sub_object_del(obj, subobj);
2026 _elm_win_eval_subobjs(obj);
2030 elm_win_title_set(Evas_Object *obj, const char *title)
2033 ELM_CHECK_WIDTYPE(obj, widtype);
2034 win = elm_widget_data_get(obj);
2035 if (!win || !title) return;
2036 ecore_evas_title_set(win->ee, title);
2038 edje_object_part_text_set(win->frame_obj, "elm.text.title", title);
2042 elm_win_title_get(const Evas_Object *obj)
2045 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2046 win = elm_widget_data_get(obj);
2047 if (!win) return NULL;
2048 return ecore_evas_title_get(win->ee);
2052 elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
2055 ELM_CHECK_WIDTYPE(obj, widtype);
2056 win = elm_widget_data_get(obj);
2058 win->autodel = autodel;
2062 elm_win_autodel_get(const Evas_Object *obj)
2065 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2066 win = elm_widget_data_get(obj);
2067 if (!win) return EINA_FALSE;
2068 return win->autodel;
2072 elm_win_activate(Evas_Object *obj)
2075 ELM_CHECK_WIDTYPE(obj, widtype);
2076 win = elm_widget_data_get(obj);
2078 ecore_evas_activate(win->ee);
2082 elm_win_lower(Evas_Object *obj)
2085 ELM_CHECK_WIDTYPE(obj, widtype);
2086 win = elm_widget_data_get(obj);
2088 ecore_evas_lower(win->ee);
2092 elm_win_raise(Evas_Object *obj)
2095 ELM_CHECK_WIDTYPE(obj, widtype);
2096 win = elm_widget_data_get(obj);
2098 ecore_evas_raise(win->ee);
2102 elm_win_center(Evas_Object *obj, Eina_Bool h, Eina_Bool v)
2105 int win_w, win_h, screen_w, screen_h, nx, ny;
2106 ELM_CHECK_WIDTYPE(obj, widtype);
2107 win = elm_widget_data_get(obj);
2109 ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &screen_w, &screen_h);
2110 if ((!screen_w) || (!screen_h)) return;
2111 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
2112 if ((!win_w) || (!win_h)) return;
2113 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
2114 else nx = win->screen.x;
2115 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
2116 else ny = win->screen.y;
2119 evas_object_move(obj, nx, ny);
2123 elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless)
2126 ELM_CHECK_WIDTYPE(obj, widtype);
2127 win = elm_widget_data_get(obj);
2129 ecore_evas_borderless_set(win->ee, borderless);
2130 #ifdef HAVE_ELEMENTARY_X
2131 _elm_win_xwin_update(win);
2136 elm_win_borderless_get(const Evas_Object *obj)
2139 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2140 win = elm_widget_data_get(obj);
2141 if (!win) return EINA_FALSE;
2142 return ecore_evas_borderless_get(win->ee);
2146 elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
2149 ELM_CHECK_WIDTYPE(obj, widtype);
2150 win = elm_widget_data_get(obj);
2152 ecore_evas_shaped_set(win->ee, shaped);
2153 #ifdef HAVE_ELEMENTARY_X
2154 _elm_win_xwin_update(win);
2159 elm_win_shaped_get(const Evas_Object *obj)
2162 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2163 win = elm_widget_data_get(obj);
2164 if (!win) return EINA_FALSE;
2165 return ecore_evas_shaped_get(win->ee);
2169 elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
2172 ELM_CHECK_WIDTYPE(obj, widtype);
2173 win = elm_widget_data_get(obj);
2178 else if (win->img_obj)
2180 evas_object_image_alpha_set(win->img_obj, alpha);
2181 ecore_evas_alpha_set(win->ee, alpha);
2185 #ifdef HAVE_ELEMENTARY_X
2190 if (!_elm_config->compositing)
2191 elm_win_shaped_set(obj, alpha);
2193 ecore_evas_alpha_set(win->ee, alpha);
2196 ecore_evas_alpha_set(win->ee, alpha);
2197 _elm_win_xwin_update(win);
2201 ecore_evas_alpha_set(win->ee, alpha);
2206 elm_win_alpha_get(const Evas_Object *obj)
2209 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2210 win = elm_widget_data_get(obj);
2211 if (!win) return EINA_FALSE;
2215 else if (win->img_obj)
2217 return evas_object_image_alpha_get(win->img_obj);
2219 return ecore_evas_alpha_get(win->ee);
2223 elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
2226 ELM_CHECK_WIDTYPE(obj, widtype);
2227 win = elm_widget_data_get(obj);
2233 else if (win->img_obj)
2235 evas_object_image_alpha_set(win->img_obj, transparent);
2239 #ifdef HAVE_ELEMENTARY_X
2242 ecore_evas_transparent_set(win->ee, transparent);
2243 _elm_win_xwin_update(win);
2247 ecore_evas_transparent_set(win->ee, transparent);
2252 elm_win_transparent_get(const Evas_Object *obj)
2255 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2256 win = elm_widget_data_get(obj);
2257 if (!win) return EINA_FALSE;
2259 return ecore_evas_transparent_get(win->ee);
2263 elm_win_override_set(Evas_Object *obj, Eina_Bool override)
2266 ELM_CHECK_WIDTYPE(obj, widtype);
2267 win = elm_widget_data_get(obj);
2269 ecore_evas_override_set(win->ee, override);
2270 #ifdef HAVE_ELEMENTARY_X
2271 _elm_win_xwin_update(win);
2276 elm_win_override_get(const Evas_Object *obj)
2279 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2280 win = elm_widget_data_get(obj);
2281 if (!win) return EINA_FALSE;
2282 return ecore_evas_override_get(win->ee);
2286 elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
2289 ELM_CHECK_WIDTYPE(obj, widtype);
2290 win = elm_widget_data_get(obj);
2292 // YYY: handle if win->img_obj
2293 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
2294 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
2295 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
2297 // these engines... can ONLY be fullscreen
2302 win->fullscreen = fullscreen;
2303 ecore_evas_fullscreen_set(win->ee, fullscreen);
2304 #ifdef HAVE_ELEMENTARY_X
2305 _elm_win_xwin_update(win);
2308 #undef ENGINE_COMPARE
2312 elm_win_fullscreen_get(const Evas_Object *obj)
2315 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2316 win = elm_widget_data_get(obj);
2317 if (!win) return EINA_FALSE;
2318 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
2319 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
2320 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
2322 // these engines... can ONLY be fullscreen
2327 return win->fullscreen;
2329 #undef ENGINE_COMPARE
2333 elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized)
2336 ELM_CHECK_WIDTYPE(obj, widtype);
2337 win = elm_widget_data_get(obj);
2339 win->maximized = maximized;
2340 // YYY: handle if win->img_obj
2341 ecore_evas_maximized_set(win->ee, maximized);
2342 #ifdef HAVE_ELEMENTARY_X
2343 _elm_win_xwin_update(win);
2348 elm_win_maximized_get(const Evas_Object *obj)
2351 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2352 win = elm_widget_data_get(obj);
2353 if (!win) return EINA_FALSE;
2354 return win->maximized;
2358 elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified)
2361 ELM_CHECK_WIDTYPE(obj, widtype);
2362 win = elm_widget_data_get(obj);
2364 win->iconified = iconified;
2365 ecore_evas_iconified_set(win->ee, iconified);
2366 #ifdef HAVE_ELEMENTARY_X
2367 _elm_win_xwin_update(win);
2372 elm_win_iconified_get(const Evas_Object *obj)
2375 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2376 win = elm_widget_data_get(obj);
2377 if (!win) return EINA_FALSE;
2378 return win->iconified;
2382 elm_win_withdrawn_set(Evas_Object *obj, Eina_Bool withdrawn)
2385 ELM_CHECK_WIDTYPE(obj, widtype);
2386 win = elm_widget_data_get(obj);
2388 win->withdrawn = withdrawn;
2389 ecore_evas_withdrawn_set(win->ee, withdrawn);
2390 #ifdef HAVE_ELEMENTARY_X
2391 _elm_win_xwin_update(win);
2396 elm_win_withdrawn_get(const Evas_Object *obj)
2399 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2400 win = elm_widget_data_get(obj);
2401 if (!win) return EINA_FALSE;
2402 return win->withdrawn;
2406 elm_win_urgent_set(Evas_Object *obj, Eina_Bool urgent)
2409 ELM_CHECK_WIDTYPE(obj, widtype);
2410 win = elm_widget_data_get(obj);
2412 win->urgent = urgent;
2413 ecore_evas_urgent_set(win->ee, urgent);
2414 #ifdef HAVE_ELEMENTARY_X
2415 _elm_win_xwin_update(win);
2420 elm_win_urgent_get(const Evas_Object *obj)
2423 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2424 win = elm_widget_data_get(obj);
2425 if (!win) return EINA_FALSE;
2430 elm_win_demand_attention_set(Evas_Object *obj, Eina_Bool demand_attention)
2433 ELM_CHECK_WIDTYPE(obj, widtype);
2434 win = elm_widget_data_get(obj);
2436 win->demand_attention = demand_attention;
2437 ecore_evas_demand_attention_set(win->ee, demand_attention);
2438 #ifdef HAVE_ELEMENTARY_X
2439 _elm_win_xwin_update(win);
2444 elm_win_demand_attention_get(const Evas_Object *obj)
2447 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2448 win = elm_widget_data_get(obj);
2449 if (!win) return EINA_FALSE;
2450 return win->demand_attention;
2454 elm_win_modal_set(Evas_Object *obj, Eina_Bool modal)
2457 ELM_CHECK_WIDTYPE(obj, widtype);
2458 win = elm_widget_data_get(obj);
2461 ecore_evas_modal_set(win->ee, modal);
2462 #ifdef HAVE_ELEMENTARY_X
2463 _elm_win_xwin_update(win);
2468 elm_win_modal_get(const Evas_Object *obj)
2471 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2472 win = elm_widget_data_get(obj);
2473 if (!win) return EINA_FALSE;
2478 elm_win_aspect_set(Evas_Object *obj, double aspect)
2481 ELM_CHECK_WIDTYPE(obj, widtype);
2482 win = elm_widget_data_get(obj);
2484 win->aspect = aspect;
2485 ecore_evas_aspect_set(win->ee, aspect);
2486 #ifdef HAVE_ELEMENTARY_X
2487 _elm_win_xwin_update(win);
2492 elm_win_aspect_get(const Evas_Object *obj)
2495 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2496 win = elm_widget_data_get(obj);
2497 if (!win) return EINA_FALSE;
2502 elm_win_layer_set(Evas_Object *obj, int layer)
2505 ELM_CHECK_WIDTYPE(obj, widtype);
2506 win = elm_widget_data_get(obj);
2508 ecore_evas_layer_set(win->ee, layer);
2509 #ifdef HAVE_ELEMENTARY_X
2510 _elm_win_xwin_update(win);
2515 elm_win_layer_get(const Evas_Object *obj)
2518 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2519 win = elm_widget_data_get(obj);
2520 if (!win) return -1;
2521 return ecore_evas_layer_get(win->ee);
2525 elm_win_rotation_set(Evas_Object *obj, int rotation)
2528 ELM_CHECK_WIDTYPE(obj, widtype);
2529 win = elm_widget_data_get(obj);
2531 if (win->rot == rotation) return;
2532 win->rot = rotation;
2533 ecore_evas_rotation_set(win->ee, rotation);
2534 evas_object_size_hint_min_set(obj, -1, -1);
2535 evas_object_size_hint_max_set(obj, -1, -1);
2536 _elm_win_eval_subobjs(obj);
2537 #ifdef HAVE_ELEMENTARY_X
2538 _elm_win_xwin_update(win);
2543 elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
2546 ELM_CHECK_WIDTYPE(obj, widtype);
2547 win = elm_widget_data_get(obj);
2549 if (win->rot == rotation) return;
2550 win->rot = rotation;
2551 ecore_evas_rotation_with_resize_set(win->ee, rotation);
2552 evas_object_size_hint_min_set(obj, -1, -1);
2553 evas_object_size_hint_max_set(obj, -1, -1);
2554 _elm_win_eval_subobjs(obj);
2555 #ifdef HAVE_ELEMENTARY_X
2556 _elm_win_xwin_update(win);
2561 elm_win_rotation_get(const Evas_Object *obj)
2564 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2565 win = elm_widget_data_get(obj);
2566 if (!win) return -1;
2571 elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky)
2574 ELM_CHECK_WIDTYPE(obj, widtype);
2575 win = elm_widget_data_get(obj);
2577 win->sticky = sticky;
2578 ecore_evas_sticky_set(win->ee, sticky);
2579 #ifdef HAVE_ELEMENTARY_X
2580 _elm_win_xwin_update(win);
2585 elm_win_sticky_get(const Evas_Object *obj)
2588 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2589 win = elm_widget_data_get(obj);
2590 if (!win) return EINA_FALSE;
2595 elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
2598 ELM_CHECK_WIDTYPE(obj, widtype);
2599 win = elm_widget_data_get(obj);
2601 if (mode == win->kbdmode) return;
2602 #ifdef HAVE_ELEMENTARY_X
2603 _elm_win_xwindow_get(win);
2605 win->kbdmode = mode;
2606 #ifdef HAVE_ELEMENTARY_X
2608 ecore_x_e_virtual_keyboard_state_set
2609 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
2613 EAPI Elm_Win_Keyboard_Mode
2614 elm_win_keyboard_mode_get(const Evas_Object *obj)
2617 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_KEYBOARD_UNKNOWN;
2618 win = elm_widget_data_get(obj);
2619 if (!win) return ELM_WIN_KEYBOARD_UNKNOWN;
2620 return win->kbdmode;
2624 elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
2627 ELM_CHECK_WIDTYPE(obj, widtype);
2628 win = elm_widget_data_get(obj);
2630 #ifdef HAVE_ELEMENTARY_X
2631 _elm_win_xwindow_get(win);
2633 ecore_x_e_virtual_keyboard_set(win->xwin, is_keyboard);
2640 elm_win_keyboard_win_get(const Evas_Object *obj)
2643 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2644 win = elm_widget_data_get(obj);
2645 if (!win) return EINA_FALSE;
2646 #ifdef HAVE_ELEMENTARY_X
2647 _elm_win_xwindow_get(win);
2649 return ecore_x_e_virtual_keyboard_get(win->xwin);
2655 elm_win_indicator_mode_set(Evas_Object *obj, Elm_Win_Indicator_Mode mode)
2658 ELM_CHECK_WIDTYPE(obj, widtype);
2659 win = elm_widget_data_get(obj);
2661 if (mode == win->indmode) return;
2662 #ifdef HAVE_ELEMENTARY_X
2663 _elm_win_xwindow_get(win);
2665 win->indmode = mode;
2666 #ifdef HAVE_ELEMENTARY_X
2669 if (win->indmode == ELM_WIN_INDICATOR_SHOW)
2670 ecore_x_e_illume_indicator_state_set
2671 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
2672 else if (win->indmode == ELM_WIN_INDICATOR_HIDE)
2673 ecore_x_e_illume_indicator_state_set
2674 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
2679 EAPI Elm_Win_Indicator_Mode
2680 elm_win_indicator_mode_get(const Evas_Object *obj)
2683 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_INDICATOR_UNKNOWN;
2684 win = elm_widget_data_get(obj);
2685 if (!win) return ELM_WIN_INDICATOR_UNKNOWN;
2686 return win->indmode;
2690 elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
2693 ELM_CHECK_WIDTYPE(obj, widtype);
2694 win = elm_widget_data_get(obj);
2696 if (x) *x = win->screen.x;
2697 if (y) *y = win->screen.y;
2701 elm_win_focus_get(const Evas_Object *obj)
2704 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2705 win = elm_widget_data_get(obj);
2706 if (!win) return EINA_FALSE;
2707 return ecore_evas_focus_get(win->ee);
2711 elm_win_screen_constrain_set(Evas_Object *obj, Eina_Bool constrain)
2714 ELM_CHECK_WIDTYPE(obj, widtype);
2715 win = elm_widget_data_get(obj);
2717 win->constrain = !!constrain;
2721 elm_win_screen_constrain_get(Evas_Object *obj)
2724 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2725 win = elm_widget_data_get(obj);
2726 if (!win) return EINA_FALSE;
2727 return win->constrain;
2731 elm_win_screen_size_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
2734 ELM_CHECK_WIDTYPE(obj, widtype);
2735 win = elm_widget_data_get(obj);
2737 ecore_evas_screen_geometry_get(win->ee, x, y, w, h);
2741 elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
2744 ELM_CHECK_WIDTYPE(obj, widtype);
2745 win = elm_widget_data_get(obj);
2747 #ifdef HAVE_ELEMENTARY_X
2748 _elm_win_xwindow_get(win);
2750 ecore_x_e_illume_conformant_set(win->xwin, conformant);
2757 elm_win_conformant_get(const Evas_Object *obj)
2760 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2761 win = elm_widget_data_get(obj);
2762 if (!win) return EINA_FALSE;
2763 #ifdef HAVE_ELEMENTARY_X
2764 _elm_win_xwindow_get(win);
2766 return ecore_x_e_illume_conformant_get(win->xwin);
2772 elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel)
2775 ELM_CHECK_WIDTYPE(obj, widtype);
2776 win = elm_widget_data_get(obj);
2778 #ifdef HAVE_ELEMENTARY_X
2779 _elm_win_xwindow_get(win);
2782 ecore_x_e_illume_quickpanel_set(win->xwin, quickpanel);
2785 Ecore_X_Window_State states[2];
2787 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
2788 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
2789 ecore_x_netwm_window_state_set(win->xwin, states, 2);
2790 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
2799 elm_win_quickpanel_get(const Evas_Object *obj)
2802 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2803 win = elm_widget_data_get(obj);
2804 if (!win) return EINA_FALSE;
2805 #ifdef HAVE_ELEMENTARY_X
2806 _elm_win_xwindow_get(win);
2808 return ecore_x_e_illume_quickpanel_get(win->xwin);
2814 elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority)
2817 ELM_CHECK_WIDTYPE(obj, widtype);
2818 win = elm_widget_data_get(obj);
2820 #ifdef HAVE_ELEMENTARY_X
2821 _elm_win_xwindow_get(win);
2823 ecore_x_e_illume_quickpanel_priority_major_set(win->xwin, priority);
2830 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
2833 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2834 win = elm_widget_data_get(obj);
2835 if (!win) return -1;
2836 #ifdef HAVE_ELEMENTARY_X
2837 _elm_win_xwindow_get(win);
2839 return ecore_x_e_illume_quickpanel_priority_major_get(win->xwin);
2845 elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority)
2848 ELM_CHECK_WIDTYPE(obj, widtype);
2849 win = elm_widget_data_get(obj);
2851 #ifdef HAVE_ELEMENTARY_X
2852 _elm_win_xwindow_get(win);
2854 ecore_x_e_illume_quickpanel_priority_minor_set(win->xwin, priority);
2861 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
2864 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2865 win = elm_widget_data_get(obj);
2866 if (!win) return -1;
2867 #ifdef HAVE_ELEMENTARY_X
2868 _elm_win_xwindow_get(win);
2870 return ecore_x_e_illume_quickpanel_priority_minor_get(win->xwin);
2876 elm_win_quickpanel_zone_set(Evas_Object *obj, int zone)
2879 ELM_CHECK_WIDTYPE(obj, widtype);
2880 win = elm_widget_data_get(obj);
2882 #ifdef HAVE_ELEMENTARY_X
2883 _elm_win_xwindow_get(win);
2885 ecore_x_e_illume_quickpanel_zone_set(win->xwin, zone);
2892 elm_win_quickpanel_zone_get(const Evas_Object *obj)
2895 ELM_CHECK_WIDTYPE(obj, widtype) 0;
2896 win = elm_widget_data_get(obj);
2898 #ifdef HAVE_ELEMENTARY_X
2899 _elm_win_xwindow_get(win);
2901 return ecore_x_e_illume_quickpanel_zone_get(win->xwin);
2907 elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
2910 ELM_CHECK_WIDTYPE(obj, widtype);
2911 win = elm_widget_data_get(obj);
2913 win->skip_focus = skip;
2914 ecore_evas_focus_skip_set(win->ee, skip);
2918 elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *params __UNUSED__)
2921 ELM_CHECK_WIDTYPE(obj, widtype);
2922 win = elm_widget_data_get(obj);
2924 #ifdef HAVE_ELEMENTARY_X
2925 _elm_win_xwindow_get(win);
2930 case ELM_ILLUME_COMMAND_FOCUS_BACK:
2931 ecore_x_e_illume_focus_back_send(win->xwin);
2933 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
2934 ecore_x_e_illume_focus_forward_send(win->xwin);
2936 case ELM_ILLUME_COMMAND_FOCUS_HOME:
2937 ecore_x_e_illume_focus_home_send(win->xwin);
2939 case ELM_ILLUME_COMMAND_CLOSE:
2940 ecore_x_e_illume_close_send(win->xwin);
2952 elm_win_inlined_image_object_get(Evas_Object *obj)
2955 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2956 win = elm_widget_data_get(obj);
2957 if (!win) return NULL;
2958 return win->img_obj;
2962 elm_win_focus_highlight_enabled_set(Evas_Object *obj, Eina_Bool enabled)
2966 ELM_CHECK_WIDTYPE(obj, widtype);
2968 win = elm_widget_data_get(obj);
2969 enabled = !!enabled;
2970 if (win->focus_highlight.enabled == enabled)
2973 win->focus_highlight.enabled = enabled;
2975 if (win->focus_highlight.enabled)
2976 _elm_win_focus_highlight_init(win);
2978 _elm_win_focus_highlight_shutdown(win);
2982 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
2986 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2988 win = elm_widget_data_get(obj);
2989 return win->focus_highlight.enabled;
2993 elm_win_focus_highlight_style_set(Evas_Object *obj, const char *style)
2997 ELM_CHECK_WIDTYPE(obj, widtype);
2999 win = elm_widget_data_get(obj);
3000 eina_stringshare_replace(&win->focus_highlight.style, style);
3001 win->focus_highlight.changed_theme = EINA_TRUE;
3002 _elm_win_focus_highlight_reconfigure_job_start(win);
3006 elm_win_focus_highlight_style_get(const Evas_Object *obj)
3010 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
3012 win = elm_widget_data_get(obj);
3013 return win->focus_highlight.style;
3016 typedef struct _Widget_Data Widget_Data;
3021 Evas_Object *content;
3024 static void _del_hook(Evas_Object *obj);
3025 static void _theme_hook(Evas_Object *obj);
3026 static void _sizing_eval(Evas_Object *obj);
3027 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
3028 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
3030 static const char *widtype2 = NULL;
3033 _del_hook(Evas_Object *obj)
3035 Widget_Data *wd = elm_widget_data_get(obj);
3041 _theme_hook(Evas_Object *obj)
3043 Widget_Data *wd = elm_widget_data_get(obj);
3044 _elm_theme_object_set(obj, wd->frm, "win", "inwin", elm_widget_style_get(obj));
3046 edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content);
3049 evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
3053 _elm_inwin_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
3055 Widget_Data *wd = elm_widget_data_get(obj);
3060 /* Try Focus cycle in subitem */
3063 elm_widget_focus_next_get(wd->content, dir, next);
3068 *next = (Evas_Object *)obj;
3073 _elm_inwin_text_set_hook(Evas_Object *obj, const char *item, const char *text)
3075 Widget_Data *wd = elm_widget_data_get(obj);
3077 if (!wd || !item) return;
3078 edje_object_part_text_set(wd->frm, item, text);
3083 _elm_inwin_text_get_hook(const Evas_Object *obj, const char *item)
3085 Widget_Data *wd = elm_widget_data_get(obj);
3087 if (!item || !wd || !wd->frm) return NULL;
3088 return edje_object_part_text_get(wd->frm, item);
3092 _sizing_eval(Evas_Object *obj)
3094 Widget_Data *wd = elm_widget_data_get(obj);
3095 Evas_Coord minw = -1, minh = -1;
3097 evas_object_size_hint_min_get(wd->content, &minw, &minh);
3098 edje_object_size_min_calc(wd->frm, &minw, &minh);
3099 evas_object_size_hint_min_set(obj, minw, minh);
3100 evas_object_size_hint_max_set(obj, -1, -1);
3104 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
3110 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
3112 Widget_Data *wd = elm_widget_data_get(obj);
3113 Evas_Object *sub = event_info;
3114 if (sub == wd->content)
3116 evas_object_event_callback_del_full
3117 (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
3124 elm_win_inwin_add(Evas_Object *obj)
3130 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
3131 win = elm_widget_data_get(obj);
3132 if (!win) return NULL;
3133 wd = ELM_NEW(Widget_Data);
3134 obj2 = elm_widget_add(win->evas);
3135 elm_widget_type_set(obj2, "inwin");
3136 ELM_SET_WIDTYPE(widtype2, "inwin");
3137 elm_widget_sub_object_add(obj, obj2);
3138 evas_object_size_hint_weight_set(obj2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3139 evas_object_size_hint_align_set(obj2, EVAS_HINT_FILL, EVAS_HINT_FILL);
3140 elm_win_resize_object_add(obj, obj2);
3142 elm_widget_data_set(obj2, wd);
3143 elm_widget_del_hook_set(obj2, _del_hook);
3144 elm_widget_theme_hook_set(obj2, _theme_hook);
3145 elm_widget_focus_next_hook_set(obj2, _elm_inwin_focus_next_hook);
3146 elm_widget_text_set_hook_set(obj2, _elm_inwin_text_set_hook);
3147 elm_widget_text_get_hook_set(obj2, _elm_inwin_text_get_hook);
3148 elm_widget_can_focus_set(obj2, EINA_TRUE);
3149 elm_widget_highlight_ignore_set(obj2, EINA_TRUE);
3151 wd->frm = edje_object_add(win->evas);
3152 _elm_theme_object_set(obj, wd->frm, "win", "inwin", "default");
3153 elm_widget_resize_object_set(obj2, wd->frm);
3155 evas_object_smart_callback_add(obj2, "sub-object-del", _sub_del, obj2);
3162 elm_win_inwin_activate(Evas_Object *obj)
3164 ELM_CHECK_WIDTYPE(obj, widtype2);
3165 Widget_Data *wd = elm_widget_data_get(obj);
3167 evas_object_raise(obj);
3168 evas_object_show(obj);
3169 edje_object_signal_emit(wd->frm, "elm,action,show", "elm");
3170 elm_object_focus_set(obj, EINA_TRUE);
3174 elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
3176 ELM_CHECK_WIDTYPE(obj, widtype2);
3177 Widget_Data *wd = elm_widget_data_get(obj);
3179 if (wd->content == content) return;
3180 if (wd->content) evas_object_del(wd->content);
3181 wd->content = content;
3184 elm_widget_sub_object_add(obj, content);
3185 evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3186 _changed_size_hints, obj);
3187 edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
3193 elm_win_inwin_content_get(const Evas_Object *obj)
3195 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
3196 Widget_Data *wd = elm_widget_data_get(obj);
3197 if (!wd) return NULL;
3202 elm_win_inwin_content_unset(Evas_Object *obj)
3204 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
3205 Widget_Data *wd = elm_widget_data_get(obj);
3206 if (!wd) return NULL;
3207 if (!wd->content) return NULL;
3208 Evas_Object *content = wd->content;
3209 elm_widget_sub_object_del(obj, wd->content);
3210 evas_object_event_callback_del_full(wd->content,
3211 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3212 _changed_size_hints, obj);
3213 edje_object_part_unswallow(wd->frm, wd->content);
3219 elm_win_socket_listen(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
3224 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
3225 win = elm_widget_data_get(obj);
3226 if (!win) return EINA_FALSE;
3227 if (!win->ee) return EINA_FALSE;
3229 if(!ecore_evas_extn_socket_listen(win->ee, svcname, svcnum, svcsys))
3235 /* windowing spcific calls - shall we do this differently? */
3237 static Ecore_X_Window
3238 _elm_ee_win_get(const Evas_Object *obj)
3241 #ifdef HAVE_ELEMENTARY_X
3242 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
3243 if (ee) return (Ecore_X_Window)ecore_evas_window_get(ee);
3249 elm_win_xwindow_get(const Evas_Object *obj)
3255 type = elm_widget_type_get(obj);
3256 if ((!type) || (type != widtype)) return _elm_ee_win_get(obj);
3257 win = elm_widget_data_get(obj);
3259 #ifdef HAVE_ELEMENTARY_X
3260 if (win->xwin) return win->xwin;
3261 if (win->parent) return elm_win_xwindow_get(win->parent);