1 #include <Elementary.h>
7 * The window class of Elementary. Contains functions to manipulate
11 typedef struct _Elm_Win Elm_Win;
17 Evas_Object *parent, *win_obj;
19 #ifdef HAVE_ELEMENTARY_X
21 Ecore_Event_Handler *client_message_handler;
23 Ecore_Job *deferred_resize_job;
24 Ecore_Job *deferred_child_eval_job;
27 Elm_Win_Keyboard_Mode kbdmode;
28 Eina_Bool autodel : 1;
29 int *autodel_clear, rot;
39 Eina_Bool visible : 1;
40 Eina_Bool handled : 1;
44 Ecore_Job *reconf_job;
46 Eina_Bool enabled : 1;
47 Eina_Bool changed_theme : 1;
48 Eina_Bool top_animate : 1;
49 Eina_Bool geometry_changed : 1;
53 static const char *widtype = NULL;
54 static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
55 static void _elm_win_obj_callback_parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
56 static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
57 static void _elm_win_move(Ecore_Evas *ee);
58 static void _elm_win_resize(Ecore_Evas *ee);
59 static void _elm_win_delete_request(Ecore_Evas *ee);
60 static void _elm_win_resize_job(void *data);
61 #ifdef HAVE_ELEMENTARY_X
62 static void _elm_win_xwin_update(Elm_Win *win);
64 static void _elm_win_eval_subobjs(Evas_Object *obj);
65 static void _elm_win_subobj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
66 static void _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
67 static void _elm_win_focus_highlight_init(Elm_Win *win);
68 static void _elm_win_focus_highlight_shutdown(Elm_Win *win);
69 static void _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible);
70 static void _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win);
71 static void _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win);
72 static void _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission, const char *source);
73 static void _elm_win_focus_highlight_reconfigure(Elm_Win *win);
75 Eina_List *_elm_win_list = NULL;
76 int _elm_win_deferred_free = 0;
79 _elm_win_move(Ecore_Evas *ee)
81 Evas_Object *obj = ecore_evas_object_associate_get(ee);
86 win = elm_widget_data_get(obj);
88 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
91 evas_object_smart_callback_call(win->win_obj, "moved", NULL);
95 _elm_win_resize(Ecore_Evas *ee)
97 Evas_Object *obj = ecore_evas_object_associate_get(ee);
101 win = elm_widget_data_get(obj);
103 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
104 win->deferred_resize_job = ecore_job_add(_elm_win_resize_job, win);
108 _elm_win_focus_in(Ecore_Evas *ee)
110 Evas_Object *obj = ecore_evas_object_associate_get(ee);
114 win = elm_widget_data_get(obj);
116 /*NB: Why two different "focus signals" here ??? */
117 evas_object_smart_callback_call(win->win_obj, "focus-in", NULL); // FIXME: remove me
118 evas_object_smart_callback_call(win->win_obj, "focus,in", NULL);
119 win->focus_highlight.cur.visible = EINA_TRUE;
120 _elm_win_focus_highlight_reconfigure_job_start(win);
124 _elm_win_focus_out(Ecore_Evas *ee)
126 Evas_Object *obj = ecore_evas_object_associate_get(ee);
130 win = elm_widget_data_get(obj);
132 evas_object_smart_callback_call(win->win_obj, "focus-out", NULL); // FIXME: remove me
133 evas_object_smart_callback_call(win->win_obj, "focus,out", NULL);
134 win->focus_highlight.cur.visible = EINA_FALSE;
135 _elm_win_focus_highlight_reconfigure_job_start(win);
139 _elm_win_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
141 Elm_Win *wd = elm_widget_data_get(obj);
142 const Eina_List *items;
143 void *(*list_data_get) (const Eina_List *list);
151 if (!(items = elm_widget_focus_custom_chain_get(obj)))
157 list_data_get = eina_list_data_get;
159 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
165 *next = (Evas_Object *)obj;
170 _elm_win_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
172 if (elm_widget_focus_get(obj))
173 evas_object_focus_set(obj, EINA_TRUE);
175 evas_object_focus_set(obj, EINA_FALSE);
179 _elm_win_event_cb(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
181 if (type == EVAS_CALLBACK_KEY_DOWN)
183 Evas_Event_Key_Down *ev = event_info;
184 if (!strcmp(ev->keyname, "Tab"))
186 if(evas_key_modifier_is_set(ev->modifiers, "Shift"))
187 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
189 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
190 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
199 _deferred_ecore_evas_free(void *data)
201 ecore_evas_free(data);
202 _elm_win_deferred_free--;
206 _elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
208 elm_object_focus(obj);
212 _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
219 evas_object_event_callback_del_full(win->parent, EVAS_CALLBACK_DEL,
220 _elm_win_obj_callback_parent_del, win);
223 if (win->autodel_clear) *(win->autodel_clear) = -1;
224 _elm_win_list = eina_list_remove(_elm_win_list, win->win_obj);
225 while (win->subobjs) elm_win_resize_object_del(obj, win->subobjs->data);
226 ecore_evas_callback_delete_request_set(win->ee, NULL);
227 ecore_evas_callback_resize_set(win->ee, NULL);
228 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
229 if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
230 while (((child = evas_object_bottom_get(win->evas))) &&
233 evas_object_del(child);
235 while (((child = evas_object_top_get(win->evas))) &&
238 evas_object_del(child);
240 #ifdef HAVE_ELEMENTARY_X
241 if (win->client_message_handler)
242 ecore_event_handler_del(win->client_message_handler);
244 // FIXME: Why are we flushing edje on every window destroy ??
245 // edje_file_cache_flush();
246 // edje_collection_cache_flush();
247 // evas_image_cache_flush(win->evas);
248 // evas_font_cache_flush(win->evas);
249 // FIXME: we are in the del handler for the object and delete the canvas
250 // that lives under it from the handler... nasty. deferring doesn't help either
252 ecore_job_add(_deferred_ecore_evas_free, win->ee);
253 _elm_win_deferred_free++;
254 // ecore_evas_free(win->ee);
256 _elm_win_focus_highlight_shutdown(win);
257 eina_stringshare_del(win->focus_highlight.style);
261 if ((!_elm_win_list) &&
262 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
264 edje_file_cache_flush();
265 edje_collection_cache_flush();
266 evas_image_cache_flush(e);
267 evas_font_cache_flush(e);
273 _elm_win_obj_callback_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
276 if (obj == win->parent) win->parent = NULL;
280 _elm_win_obj_intercept_show(void *data __UNUSED__, Evas_Object *obj)
282 // this is called to make sure all smart containers have calculated their
283 // sizes BEFORE we show the window to make sure it initially appears at
284 // our desired size (ie min size is known first)
285 evas_smart_objects_calculate(evas_object_evas_get(obj));
286 evas_object_show(obj);
290 _elm_win_delete_request(Ecore_Evas *ee)
292 Evas_Object *obj = ecore_evas_object_associate_get(ee);
294 if (strcmp(elm_widget_type_get(obj), "win")) return;
296 win = elm_widget_data_get(obj);
298 int autodel = win->autodel;
299 win->autodel_clear = &autodel;
300 evas_object_smart_callback_call(win->win_obj, "delete-request", NULL); // FIXME: remove me
301 evas_object_smart_callback_call(win->win_obj, "delete,request", NULL);
302 // FIXME: if above callback deletes - then the below will be invalid
303 if (autodel) evas_object_del(win->win_obj);
304 else win->autodel_clear = NULL;
308 _elm_win_resize_job(void *data)
315 win->deferred_resize_job = NULL;
316 ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
317 evas_object_resize(win->win_obj, w, h);
318 EINA_LIST_FOREACH(win->subobjs, l, obj)
320 evas_object_move(obj, 0, 0);
321 evas_object_resize(obj, w, h);
325 #ifdef HAVE_ELEMENTARY_X
327 _elm_win_xwindow_get(Elm_Win *win)
331 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
332 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
334 if (win->ee) win->xwin = ecore_evas_software_x11_window_get(win->ee);
336 else if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
337 ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
338 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
339 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
340 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
341 ENGINE_COMPARE(ELM_OPENGL_SDL))
344 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
346 if (win->ee) win->xwin = ecore_evas_software_x11_16_window_get(win->ee);
348 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
350 if (win->ee) win->xwin = ecore_evas_software_x11_8_window_get(win->ee);
352 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
354 if (win->ee) win->xwin = ecore_evas_xrender_x11_window_get(win->ee);
356 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
358 if (win->ee) win->xwin = ecore_evas_gl_x11_window_get(win->ee);
360 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
362 if (win->ee) win->xwin = (long)ecore_evas_win32_window_get(win->ee);
364 #undef ENGINE_COMPARE
368 #ifdef HAVE_ELEMENTARY_X
370 _elm_win_xwin_update(Elm_Win *win)
372 _elm_win_xwindow_get(win);
377 win2 = elm_widget_data_get(win->parent);
381 ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
385 if (!win->xwin) return; /* nothing more to do */
390 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
392 case ELM_WIN_DIALOG_BASIC:
393 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
395 case ELM_WIN_DESKTOP:
396 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
399 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK);
401 case ELM_WIN_TOOLBAR:
402 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
405 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU);
407 case ELM_WIN_UTILITY:
408 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY);
411 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH);
413 case ELM_WIN_DROPDOWN_MENU:
414 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
416 case ELM_WIN_POPUP_MENU:
417 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
419 case ELM_WIN_TOOLTIP:
420 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
422 case ELM_WIN_NOTIFICATION:
423 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
426 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO);
429 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND);
434 ecore_x_e_virtual_keyboard_state_set
435 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
440 _elm_win_eval_subobjs(Evas_Object *obj)
443 const Evas_Object *child;
445 Elm_Win *win = elm_widget_data_get(obj);
446 Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
450 EINA_LIST_FOREACH(win->subobjs, l, child)
452 evas_object_size_hint_weight_get(child, &wx, &wy);
453 if (wx == 0.0) xx = 0;
454 if (wy == 0.0) xy = 0;
456 evas_object_size_hint_min_get(child, &w, &h);
459 if (w > minw) minw = w;
460 if (h > minh) minh = h;
462 evas_object_size_hint_max_get(child, &w, &h);
465 if (maxw == -1) maxw = w;
466 else if ((w > 0) && (w < maxw)) maxw = w;
467 if (maxh == -1) maxh = h;
468 else if ((h > 0) && (h < maxh)) maxh = h;
470 if (!xx) maxw = minw;
472 if (!xy) maxh = minh;
474 evas_object_size_hint_min_set(obj, minw, minh);
475 evas_object_size_hint_max_set(obj, maxw, maxh);
476 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
477 if (w < minw) w = minw;
478 if (h < minh) h = minh;
479 if ((maxw >= 0) && (w > maxw)) w = maxw;
480 if ((maxh >= 0) && (h > maxh)) h = maxh;
481 evas_object_resize(obj, w, h);
485 _elm_win_subobj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
487 Elm_Win *win = elm_widget_data_get(data);
488 win->subobjs = eina_list_remove(win->subobjs, obj);
489 _elm_win_eval_subobjs(win->win_obj);
493 _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
495 _elm_win_eval_subobjs(data);
499 _elm_win_shutdown(void)
501 while (_elm_win_list)
502 evas_object_del(_elm_win_list->data);
506 _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme)
513 EINA_LIST_FOREACH(_elm_win_list, l, obj)
514 elm_widget_theme(obj);
518 EINA_LIST_FOREACH(_elm_win_list, l, obj)
519 elm_widget_theme_specific(obj, th, EINA_FALSE);
523 #ifdef HAVE_ELEMENTARY_X
525 _elm_win_client_message(void *data, int type __UNUSED__, void *event)
528 Ecore_X_Event_Client_Message *e = event;
530 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
531 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
533 if ((unsigned)e->data.l[0] == win->xwin)
535 Evas *evas = evas_object_evas_get(win->win_obj);
538 edje_file_cache_flush();
539 edje_collection_cache_flush();
540 evas_image_cache_flush(evas);
541 evas_font_cache_flush(evas);
545 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
547 if ((unsigned)e->data.l[0] == win->xwin)
549 Evas *evas = evas_object_evas_get(win->win_obj);
552 edje_file_cache_flush();
553 edje_collection_cache_flush();
554 evas_image_cache_flush(evas);
555 evas_font_cache_flush(evas);
556 evas_render_dump(evas);
560 return ECORE_CALLBACK_PASS_ON;
565 _elm_win_focus_target_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
569 win->focus_highlight.geometry_changed = EINA_TRUE;
570 _elm_win_focus_highlight_reconfigure_job_start(win);
574 _elm_win_focus_target_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
578 win->focus_highlight.geometry_changed = EINA_TRUE;
579 _elm_win_focus_highlight_reconfigure_job_start(win);
583 _elm_win_focus_target_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
587 win->focus_highlight.cur.target = NULL;
589 _elm_win_focus_highlight_reconfigure_job_start(win);
593 _elm_win_focus_target_callbacks_add(Elm_Win *win)
595 Evas_Object *obj = win->focus_highlight.cur.target;
597 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
598 _elm_win_focus_target_move, win);
599 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
600 _elm_win_focus_target_resize, win);
601 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
602 _elm_win_focus_target_del, win);
606 _elm_win_focus_target_callbacks_del(Elm_Win *win)
608 Evas_Object *obj = win->focus_highlight.cur.target;
610 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
611 _elm_win_focus_target_move, win);
612 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
613 _elm_win_focus_target_resize, win);
614 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
615 _elm_win_focus_target_del, win);
619 _elm_win_focus_target_get(Evas_Object *obj)
621 Evas_Object *o = obj;
625 if (elm_widget_is(o))
627 if (!elm_widget_highlight_ignore_get(o))
629 o = elm_widget_parent_get(o);
631 o = evas_object_smart_parent_get(o);
635 o = elm_widget_parent_widget_get(o);
637 o = evas_object_smart_parent_get(o);
646 _elm_win_object_focus_in(void *data, Evas *e __UNUSED__, void *event_info)
648 Evas_Object *obj = event_info, *target;
651 if (win->focus_highlight.cur.target == obj)
654 target = _elm_win_focus_target_get(obj);
655 win->focus_highlight.cur.target = target;
656 if (elm_widget_highlight_in_theme_get(target))
657 win->focus_highlight.cur.handled = EINA_TRUE;
659 _elm_win_focus_target_callbacks_add(win);
661 _elm_win_focus_highlight_reconfigure_job_start(win);
665 _elm_win_object_focus_out(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
669 if (!win->focus_highlight.cur.target)
672 if (!win->focus_highlight.cur.handled)
673 _elm_win_focus_target_callbacks_del(win);
674 win->focus_highlight.cur.target = NULL;
675 win->focus_highlight.cur.handled = EINA_FALSE;
677 _elm_win_focus_highlight_reconfigure_job_start(win);
681 _elm_win_focus_highlight_hide(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
683 evas_object_hide(obj);
687 _elm_win_focus_highlight_init(Elm_Win *win)
689 evas_event_callback_add(win->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
690 _elm_win_object_focus_in, win);
691 evas_event_callback_add(win->evas,
692 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
693 _elm_win_object_focus_out, win);
695 win->focus_highlight.cur.target = evas_focus_get(win->evas);
697 win->focus_highlight.top = edje_object_add(win->evas);
698 win->focus_highlight.changed_theme = EINA_TRUE;
699 edje_object_signal_callback_add(win->focus_highlight.top,
700 "elm,action,focus,hide,end", "",
701 _elm_win_focus_highlight_hide, NULL);
702 edje_object_signal_callback_add(win->focus_highlight.top,
703 "elm,action,focus,anim,end", "",
704 _elm_win_focus_highlight_anim_end, win);
705 _elm_win_focus_highlight_reconfigure_job_start(win);
709 _elm_win_focus_highlight_shutdown(Elm_Win *win)
711 _elm_win_focus_highlight_reconfigure_job_stop(win);
712 if (win->focus_highlight.cur.target)
714 _elm_win_focus_target_callbacks_del(win);
715 win->focus_highlight.cur.target = NULL;
717 if (win->focus_highlight.top)
719 evas_object_del(win->focus_highlight.top);
720 win->focus_highlight.top = NULL;
723 evas_event_callback_del_full(win->evas,
724 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
725 _elm_win_object_focus_in, win);
726 evas_event_callback_del_full(win->evas,
727 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
728 _elm_win_object_focus_out, win);
732 _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible)
736 top = win->focus_highlight.top;
741 evas_object_show(top);
742 edje_object_signal_emit(top, "elm,action,focus,show", "elm");
748 edje_object_signal_emit(top, "elm,action,focus,hide", "elm");
753 _elm_win_focus_highlight_reconfigure_job(void *data)
755 _elm_win_focus_highlight_reconfigure((Elm_Win *)data);
759 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win)
761 if (win->focus_highlight.reconf_job)
762 ecore_job_del(win->focus_highlight.reconf_job);
763 win->focus_highlight.reconf_job = ecore_job_add(
764 _elm_win_focus_highlight_reconfigure_job, win);
768 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win)
770 if (win->focus_highlight.reconf_job)
771 ecore_job_del(win->focus_highlight.reconf_job);
772 win->focus_highlight.reconf_job = NULL;
776 _elm_win_focus_highlight_simple_setup(Elm_Win *win, Evas_Object *obj)
778 Evas_Object *clip, *target = win->focus_highlight.cur.target;
779 Evas_Coord x, y, w, h;
781 clip = evas_object_clip_get(target);
782 evas_object_geometry_get(target, &x, &y, &w, &h);
784 evas_object_move(obj, x, y);
785 evas_object_resize(obj, w, h);
786 evas_object_clip_set(obj, clip);
790 _elm_win_focus_highlight_anim_setup(Elm_Win *win, Evas_Object *obj)
792 Evas_Coord tx, ty, tw, th;
793 Evas_Coord w, h, px, py, pw, ph;
794 Edje_Message_Int_Set *m;
795 Evas_Object *previous = win->focus_highlight.prev.target;
796 Evas_Object *target = win->focus_highlight.cur.target;
798 evas_object_geometry_get(win->win_obj, NULL, NULL, &w, &h);
799 evas_object_geometry_get(target, &tx, &ty, &tw, &th);
800 evas_object_geometry_get(previous, &px, &py, &pw, &ph);
801 evas_object_move(obj, 0, 0);
802 evas_object_resize(obj, tw, th);
803 evas_object_clip_unset(obj);
805 m = alloca(sizeof(*m) + (sizeof(int) * 8));
815 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
819 _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
822 _elm_win_focus_highlight_simple_setup(win, obj);
826 _elm_win_focus_highlight_reconfigure(Elm_Win *win)
828 Evas_Object *target = win->focus_highlight.cur.target;
829 Evas_Object *previous = win->focus_highlight.prev.target;
830 Evas_Object *top = win->focus_highlight.top;
831 Eina_Bool visible_changed;
832 Eina_Bool common_visible;
833 const char *sig = NULL;
835 _elm_win_focus_highlight_reconfigure_job_stop(win);
837 visible_changed = (win->focus_highlight.cur.visible !=
838 win->focus_highlight.prev.visible);
840 if ((target == previous) && (!visible_changed) &&
841 (!win->focus_highlight.geometry_changed))
844 if ((previous) && (win->focus_highlight.prev.handled))
845 elm_widget_signal_emit(previous, "elm,action,focus_highlight,hide", "elm");
848 common_visible = EINA_FALSE;
849 else if (win->focus_highlight.cur.handled)
851 common_visible = EINA_FALSE;
852 if (win->focus_highlight.cur.visible)
853 sig = "elm,action,focus_highlight,show";
855 sig = "elm,action,focus_highlight,hide";
858 common_visible = win->focus_highlight.cur.visible;
860 _elm_win_focus_highlight_visible_set(win, common_visible);
862 elm_widget_signal_emit(target, sig, "elm");
864 if ((!target) || (!common_visible) || (win->focus_highlight.cur.handled))
867 if (win->focus_highlight.changed_theme)
870 if (win->focus_highlight.style)
871 str = win->focus_highlight.style;
874 _elm_theme_object_set(win->win_obj, top, "focus_highlight", "top",
876 win->focus_highlight.changed_theme = EINA_FALSE;
878 if (_elm_config->focus_highlight_animate)
880 str = edje_object_data_get(win->focus_highlight.top, "animate");
881 win->focus_highlight.top_animate = ((str) && (!strcmp(str, "on")));
885 if ((win->focus_highlight.top_animate) && (previous) &&
886 (!win->focus_highlight.prev.handled))
887 _elm_win_focus_highlight_anim_setup(win, top);
889 _elm_win_focus_highlight_simple_setup(win, top);
890 evas_object_raise(top);
893 win->focus_highlight.geometry_changed = EINA_FALSE;
894 win->focus_highlight.prev = win->focus_highlight.cur;
899 _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
901 Evas_Event_Key_Down *ev = event_info;
903 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
907 if ((strcmp(ev->keyname, "F12")) ||
908 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
911 printf("Tree graph generated.\n");
912 elm_object_tree_dot_dump(obj, "./dump.dot");
917 * Adds a window object. If this is the first window created, pass NULL as
920 * @param parent Parent object to add the window to, or NULL
921 * @param name The name of the window
922 * @param type The window type, one of the following:
924 * ELM_WIN_DIALOG_BASIC
932 * @return The created object, or NULL on failure
937 elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
941 const char *fontpath;
943 win = ELM_NEW(Elm_Win);
945 #define FALLBACK_TRY(engine) \
948 CRITICAL(engine " engine creation failed. Trying software X11."); \
949 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
952 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
953 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
955 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
956 #ifdef HAVE_ELEMENTARY_X
957 win->client_message_handler = ecore_event_handler_add
958 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
961 else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
963 win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
964 FALLBACK_TRY("Sofware FB");
966 else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
968 win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
969 FALLBACK_TRY("Sofware DirectFB");
971 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
973 win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
974 FALLBACK_TRY("Sofware-16");
975 #ifdef HAVE_ELEMENTARY_X
976 win->client_message_handler = ecore_event_handler_add
977 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
980 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
982 win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
983 FALLBACK_TRY("Sofware-8");
984 #ifdef HAVE_ELEMENTARY_X
985 win->client_message_handler = ecore_event_handler_add
986 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
989 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
991 win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
992 FALLBACK_TRY("XRender");
993 #ifdef HAVE_ELEMENTARY_X
994 win->client_message_handler = ecore_event_handler_add
995 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
998 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
1000 win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
1001 FALLBACK_TRY("OpenGL");
1002 #ifdef HAVE_ELEMENTARY_X
1003 win->client_message_handler = ecore_event_handler_add
1004 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1007 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
1009 win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
1010 FALLBACK_TRY("Sofware Win32");
1012 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1014 win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
1015 FALLBACK_TRY("Sofware-16-WinCE");
1017 else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
1019 win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
1020 FALLBACK_TRY("Sofware SDL");
1022 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
1024 win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
1025 FALLBACK_TRY("Sofware-16-SDL");
1027 else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
1029 win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
1030 FALLBACK_TRY("OpenGL SDL");
1036 ERR("Cannot create window.");
1040 #ifdef HAVE_ELEMENTARY_X
1041 _elm_win_xwindow_get(win);
1043 if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
1044 ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
1045 // bg pixmap done by x - has other issues like can be redrawn by x before it
1046 // is filled/ready by app
1047 // ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
1050 win->parent = parent;
1052 evas_object_event_callback_add(win->parent, EVAS_CALLBACK_DEL,
1053 _elm_win_obj_callback_parent_del, win);
1055 win->evas = ecore_evas_get(win->ee);
1056 win->win_obj = elm_widget_add(win->evas);
1057 elm_widget_type_set(win->win_obj, "win");
1058 ELM_SET_WIDTYPE(widtype, "win");
1059 elm_widget_data_set(win->win_obj, win);
1060 elm_widget_event_hook_set(win->win_obj, _elm_win_event_cb);
1061 elm_widget_on_focus_hook_set(win->win_obj, _elm_win_on_focus_hook, NULL);
1062 elm_widget_can_focus_set(win->win_obj, EINA_TRUE);
1063 elm_widget_highlight_ignore_set(win->win_obj, EINA_TRUE);
1064 elm_widget_focus_next_hook_set(win->win_obj, _elm_win_focus_next_hook);
1065 evas_object_color_set(win->win_obj, 0, 0, 0, 0);
1066 evas_object_move(win->win_obj, 0, 0);
1067 evas_object_resize(win->win_obj, 1, 1);
1068 evas_object_layer_set(win->win_obj, 50);
1069 evas_object_pass_events_set(win->win_obj, EINA_TRUE);
1071 evas_object_intercept_show_callback_add(win->win_obj,
1072 _elm_win_obj_intercept_show, win);
1073 ecore_evas_object_associate(win->ee, win->win_obj,
1074 ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
1075 ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
1076 ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
1077 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
1078 _elm_win_obj_callback_show, win);
1079 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
1080 _elm_win_obj_callback_del, win);
1082 ecore_evas_name_class_set(win->ee, name, _elm_appname);
1083 ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
1084 ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
1085 ecore_evas_callback_focus_in_set(win->ee, _elm_win_focus_in);
1086 ecore_evas_callback_focus_out_set(win->ee, _elm_win_focus_out);
1087 ecore_evas_callback_move_set(win->ee, _elm_win_move);
1088 evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024));
1089 evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
1090 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
1091 evas_font_path_append(win->evas, fontpath);
1092 if (!_elm_config->font_hinting)
1093 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
1094 else if (_elm_config->font_hinting == 1)
1095 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_AUTO);
1096 else if (_elm_config->font_hinting == 2)
1097 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_BYTECODE);
1099 #ifdef HAVE_ELEMENTARY_X
1100 _elm_win_xwin_update(win);
1103 _elm_win_list = eina_list_append(_elm_win_list, win->win_obj);
1105 if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
1107 ecore_evas_fullscreen_set(win->ee, 1);
1109 #undef ENGINE_COMPARE
1111 if (_elm_config->focus_highlight_enable)
1112 elm_win_focus_highlight_enabled_set(win->win_obj, EINA_TRUE);
1115 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(win->evas, "Control");
1116 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_KEY_DOWN,
1117 _debug_key_down, win);
1118 Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0, EINA_TRUE);
1119 printf("Key F12 exclusive for dot tree generation. (%d)\n", ret);
1121 return win->win_obj;
1125 * Add @p subobj as a resize object of window @p obj.
1127 * @param obj The window object
1128 * @param subobj The resize object to add
1133 elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
1137 ELM_CHECK_WIDTYPE(obj, widtype);
1138 win = elm_widget_data_get(obj);
1140 win->subobjs = eina_list_append(win->subobjs, subobj);
1141 elm_widget_sub_object_add(obj, subobj);
1142 evas_object_event_callback_add(subobj, EVAS_CALLBACK_DEL,
1143 _elm_win_subobj_callback_del, obj);
1144 evas_object_event_callback_add(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1145 _elm_win_subobj_callback_changed_size_hints,
1147 ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
1148 evas_object_move(subobj, 0, 0);
1149 evas_object_resize(subobj, w, h);
1150 _elm_win_eval_subobjs(obj);
1154 * Delete @p subobj as a resize object of window @p obj.
1156 * @param obj The window object
1157 * @param subobj The resize object to add
1162 elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
1165 ELM_CHECK_WIDTYPE(obj, widtype);
1166 win = elm_widget_data_get(obj);
1168 evas_object_event_callback_del_full(subobj,
1169 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1170 _elm_win_subobj_callback_changed_size_hints,
1172 evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL,
1173 _elm_win_subobj_callback_del, obj);
1174 win->subobjs = eina_list_remove(win->subobjs, subobj);
1175 elm_widget_sub_object_del(obj, subobj);
1176 _elm_win_eval_subobjs(obj);
1180 * Set the title of the window
1182 * @param obj The window object
1183 * @param title The title to set
1188 elm_win_title_set(Evas_Object *obj, const char *title)
1191 ELM_CHECK_WIDTYPE(obj, widtype);
1192 win = elm_widget_data_get(obj);
1194 ecore_evas_title_set(win->ee, title);
1198 * Get the title of the window
1200 * @param obj The window object
1206 elm_win_title_get(const Evas_Object *obj)
1209 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1210 win = elm_widget_data_get(obj);
1211 if (!win) return NULL;
1212 return ecore_evas_title_get(win->ee);
1216 * Set the window's autodel state.
1218 * @param obj The window object
1219 * @param autodel If true, the window will automatically delete itself when closed
1224 elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
1227 ELM_CHECK_WIDTYPE(obj, widtype);
1228 win = elm_widget_data_get(obj);
1230 win->autodel = autodel;
1234 * Get the window's autodel state.
1236 * @param obj The window object
1237 * @return If the window will automatically delete itself when closed
1242 elm_win_autodel_get(const Evas_Object *obj)
1245 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1246 win = elm_widget_data_get(obj);
1247 if (!win) return EINA_FALSE;
1248 return win->autodel;
1252 * Activate a window object.
1254 * @param obj The window object
1259 elm_win_activate(Evas_Object *obj)
1262 ELM_CHECK_WIDTYPE(obj, widtype);
1263 win = elm_widget_data_get(obj);
1265 ecore_evas_activate(win->ee);
1269 * Lower a window object.
1271 * @param obj The window object
1276 elm_win_lower(Evas_Object *obj)
1279 ELM_CHECK_WIDTYPE(obj, widtype);
1280 win = elm_widget_data_get(obj);
1282 ecore_evas_lower(win->ee);
1286 * Raise a window object.
1288 * @param obj The window object
1293 elm_win_raise(Evas_Object *obj)
1296 ELM_CHECK_WIDTYPE(obj, widtype);
1297 win = elm_widget_data_get(obj);
1299 ecore_evas_raise(win->ee);
1303 * Set the borderless state of a window.
1305 * @param obj The window object
1306 * @param borderless If true, the window is borderless
1311 elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless)
1314 ELM_CHECK_WIDTYPE(obj, widtype);
1315 win = elm_widget_data_get(obj);
1317 ecore_evas_borderless_set(win->ee, borderless);
1318 #ifdef HAVE_ELEMENTARY_X
1319 _elm_win_xwin_update(win);
1324 * Get the borderless state of a window.
1326 * @param obj The window object
1327 * @return If true, the window is borderless
1332 elm_win_borderless_get(const Evas_Object *obj)
1335 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1336 win = elm_widget_data_get(obj);
1337 if (!win) return EINA_FALSE;
1338 return ecore_evas_borderless_get(win->ee);
1342 * Set the shaped state of a window.
1344 * @param obj The window object
1345 * @param shaped If true, the window is shaped
1350 elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
1353 ELM_CHECK_WIDTYPE(obj, widtype);
1354 win = elm_widget_data_get(obj);
1356 ecore_evas_shaped_set(win->ee, shaped);
1357 #ifdef HAVE_ELEMENTARY_X
1358 _elm_win_xwin_update(win);
1363 * Get the shaped state of a window.
1365 * @param obj The window object
1366 * @return If true, the window is shaped
1371 elm_win_shaped_get(const Evas_Object *obj)
1374 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1375 win = elm_widget_data_get(obj);
1376 if (!win) return EINA_FALSE;
1377 return ecore_evas_shaped_get(win->ee);
1381 * Set the alpha channel state of a window.
1383 * @param obj The window object
1384 * @param alpha If true, the window has an alpha channel
1389 elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
1392 ELM_CHECK_WIDTYPE(obj, widtype);
1393 win = elm_widget_data_get(obj);
1395 #ifdef HAVE_ELEMENTARY_X
1400 if (!_elm_config->compositing)
1401 elm_win_shaped_set(obj, alpha);
1403 ecore_evas_alpha_set(win->ee, alpha);
1406 ecore_evas_alpha_set(win->ee, alpha);
1407 _elm_win_xwin_update(win);
1411 ecore_evas_alpha_set(win->ee, alpha);
1415 * Get the alpha channel state of a window.
1417 * @param obj The window object
1418 * @return If true, the window has an alpha channel
1423 elm_win_alpha_get(const Evas_Object *obj)
1426 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1427 win = elm_widget_data_get(obj);
1428 if (!win) return EINA_FALSE;
1429 return ecore_evas_alpha_get(win->ee);
1433 * Set the transparency state of a window.
1435 * @param obj The window object
1436 * @param transparent If true, the window is transparent
1441 elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
1444 ELM_CHECK_WIDTYPE(obj, widtype);
1445 win = elm_widget_data_get(obj);
1448 #ifdef HAVE_ELEMENTARY_X
1451 ecore_evas_transparent_set(win->ee, transparent);
1452 _elm_win_xwin_update(win);
1456 ecore_evas_transparent_set(win->ee, transparent);
1460 * Get the transparency state of a window.
1462 * @param obj The window object
1463 * @return If true, the window is transparent
1468 elm_win_transparent_get(const Evas_Object *obj)
1471 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1472 win = elm_widget_data_get(obj);
1473 if (!win) return EINA_FALSE;
1475 return ecore_evas_transparent_get(win->ee);
1479 * Set the override state of a window.
1481 * @param obj The window object
1482 * @param override If true, the window is overridden
1487 elm_win_override_set(Evas_Object *obj, Eina_Bool override)
1490 ELM_CHECK_WIDTYPE(obj, widtype);
1491 win = elm_widget_data_get(obj);
1493 ecore_evas_override_set(win->ee, override);
1494 #ifdef HAVE_ELEMENTARY_X
1495 _elm_win_xwin_update(win);
1500 * Get the override state of a window.
1502 * @param obj The window object
1503 * @return If true, the window is overridden
1508 elm_win_override_get(const Evas_Object *obj)
1511 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1512 win = elm_widget_data_get(obj);
1513 if (!win) return EINA_FALSE;
1514 return ecore_evas_override_get(win->ee);
1518 * Set the fullscreen state of a window.
1520 * @param obj The window object
1521 * @param fullscreen If true, the window is fullscreen
1526 elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
1529 ELM_CHECK_WIDTYPE(obj, widtype);
1530 win = elm_widget_data_get(obj);
1533 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1534 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
1535 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1537 // these engines... can ONLY be fullscreen
1542 ecore_evas_fullscreen_set(win->ee, fullscreen);
1543 #ifdef HAVE_ELEMENTARY_X
1544 _elm_win_xwin_update(win);
1547 #undef ENGINE_COMPARE
1551 * Get the fullscreen state of a window.
1553 * @param obj The window object
1554 * @return If true, the window is fullscreen
1559 elm_win_fullscreen_get(const Evas_Object *obj)
1562 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1563 win = elm_widget_data_get(obj);
1564 if (!win) return EINA_FALSE;
1566 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1567 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
1568 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1570 // these engines... can ONLY be fullscreen
1575 return ecore_evas_fullscreen_get(win->ee);
1577 #undef ENGINE_COMPARE
1581 * Set the maximized state of a window.
1583 * @param obj The window object
1584 * @param maximized If true, the window is maximized
1589 elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized)
1592 ELM_CHECK_WIDTYPE(obj, widtype);
1593 win = elm_widget_data_get(obj);
1595 ecore_evas_maximized_set(win->ee, maximized);
1596 #ifdef HAVE_ELEMENTARY_X
1597 _elm_win_xwin_update(win);
1602 * Get the maximized state of a window.
1604 * @param obj The window object
1605 * @return If true, the window is maximized
1610 elm_win_maximized_get(const Evas_Object *obj)
1613 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1614 win = elm_widget_data_get(obj);
1615 if (!win) return EINA_FALSE;
1616 return ecore_evas_maximized_get(win->ee);
1620 * Set the iconified state of a window.
1622 * @param obj The window object
1623 * @param iconified If true, the window is iconified
1628 elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified)
1631 ELM_CHECK_WIDTYPE(obj, widtype);
1632 win = elm_widget_data_get(obj);
1634 ecore_evas_iconified_set(win->ee, iconified);
1635 #ifdef HAVE_ELEMENTARY_X
1636 _elm_win_xwin_update(win);
1641 * Get the iconified state of a window.
1643 * @param obj The window object
1644 * @return If true, the window is iconified
1649 elm_win_iconified_get(const Evas_Object *obj)
1652 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1653 win = elm_widget_data_get(obj);
1654 if (!win) return EINA_FALSE;
1655 return ecore_evas_iconified_get(win->ee);
1659 * Set the layer of the window.
1661 * @param obj The window object
1662 * @param layer The layer of the window
1667 elm_win_layer_set(Evas_Object *obj, int layer)
1670 ELM_CHECK_WIDTYPE(obj, widtype);
1671 win = elm_widget_data_get(obj);
1673 ecore_evas_layer_set(win->ee, layer);
1674 #ifdef HAVE_ELEMENTARY_X
1675 _elm_win_xwin_update(win);
1680 * Get the layer of the window.
1682 * @param obj The window object
1683 * @return The layer of the window
1688 elm_win_layer_get(const Evas_Object *obj)
1691 ELM_CHECK_WIDTYPE(obj, widtype) -1;
1692 win = elm_widget_data_get(obj);
1693 if (!win) return -1;
1694 return ecore_evas_layer_get(win->ee);
1698 * Set the rotation of the window.
1700 * @param obj The window object
1701 * @param rotation The rotation of the window, in degrees (0-360)
1706 elm_win_rotation_set(Evas_Object *obj, int rotation)
1709 ELM_CHECK_WIDTYPE(obj, widtype);
1710 win = elm_widget_data_get(obj);
1712 if (win->rot == rotation) return;
1713 win->rot = rotation;
1714 ecore_evas_rotation_set(win->ee, rotation);
1715 evas_object_size_hint_min_set(obj, -1, -1);
1716 evas_object_size_hint_max_set(obj, -1, -1);
1717 _elm_win_eval_subobjs(obj);
1718 #ifdef HAVE_ELEMENTARY_X
1719 _elm_win_xwin_update(win);
1724 * Rotates the window and resizes it
1726 * @param obj The window object
1727 * @param layer The rotation of the window in degrees (0-360)
1732 elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
1735 ELM_CHECK_WIDTYPE(obj, widtype);
1736 win = elm_widget_data_get(obj);
1738 if (win->rot == rotation) return;
1739 win->rot = rotation;
1740 ecore_evas_rotation_with_resize_set(win->ee, rotation);
1741 evas_object_size_hint_min_set(obj, -1, -1);
1742 evas_object_size_hint_max_set(obj, -1, -1);
1743 _elm_win_eval_subobjs(obj);
1744 #ifdef HAVE_ELEMENTARY_X
1745 _elm_win_xwin_update(win);
1750 * Get the rotation of the window.
1752 * @param obj The window object
1753 * @return The rotation of the window in degrees (0-360)
1758 elm_win_rotation_get(const Evas_Object *obj)
1761 ELM_CHECK_WIDTYPE(obj, widtype) -1;
1762 win = elm_widget_data_get(obj);
1763 if (!win) return -1;
1768 * Set the sticky state of the window.
1770 * @param obj The window object
1771 * @param sticky If true, the window's sticky state is enabled
1776 elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky)
1779 ELM_CHECK_WIDTYPE(obj, widtype);
1780 win = elm_widget_data_get(obj);
1782 ecore_evas_sticky_set(win->ee, sticky);
1783 #ifdef HAVE_ELEMENTARY_X
1784 _elm_win_xwin_update(win);
1789 * Get the sticky state of the window.
1791 * @param obj The window object
1792 * @return If true, the window's sticky state is enabled
1797 elm_win_sticky_get(const Evas_Object *obj)
1800 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1801 win = elm_widget_data_get(obj);
1802 if (!win) return EINA_FALSE;
1803 return ecore_evas_sticky_get(win->ee);
1807 * Sets the keyboard mode of the window.
1809 * @param obj The window object
1810 * @param mode The mode to set; one of:
1811 * ELM_WIN_KEYBOARD_UNKNOWN
1812 * ELM_WIN_KEYBOARD_OFF
1813 * ELM_WIN_KEYBOARD_ON
1814 * ELM_WIN_KEYBOARD_ALPHA
1815 * ELM_WIN_KEYBOARD_NUMERIC
1816 * ELM_WIN_KEYBOARD_PIN
1817 * ELM_WIN_KEYBOARD_PHONE_NUMBER
1818 * ELM_WIN_KEYBOARD_HEX
1819 * ELM_WIN_KEYBOARD_TERMINAL
1820 * ELM_WIN_KEYBOARD_PASSWORD
1821 * ELM_WIN_KEYBOARD_IP
1822 * ELM_WIN_KEYBOARD_HOST
1823 * ELM_WIN_KEYBOARD_FILE
1824 * ELM_WIN_KEYBOARD_URL
1825 * ELM_WIN_KEYBOARD_KEYPAD
1826 * ELM_WIN_KEYBOARD_J2ME
1831 elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
1834 ELM_CHECK_WIDTYPE(obj, widtype);
1835 win = elm_widget_data_get(obj);
1837 if (mode == win->kbdmode) return;
1838 #ifdef HAVE_ELEMENTARY_X
1839 _elm_win_xwindow_get(win);
1841 win->kbdmode = mode;
1842 #ifdef HAVE_ELEMENTARY_X
1844 ecore_x_e_virtual_keyboard_state_set
1845 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
1850 * Gets the keyboard mode of the window.
1852 * @param obj The window object
1853 * @return The mode; one of:
1854 * ELM_WIN_KEYBOARD_UNKNOWN
1855 * ELM_WIN_KEYBOARD_OFF
1856 * ELM_WIN_KEYBOARD_ON
1857 * ELM_WIN_KEYBOARD_ALPHA
1858 * ELM_WIN_KEYBOARD_NUMERIC
1859 * ELM_WIN_KEYBOARD_PIN
1860 * ELM_WIN_KEYBOARD_PHONE_NUMBER
1861 * ELM_WIN_KEYBOARD_HEX
1862 * ELM_WIN_KEYBOARD_TERMINAL
1863 * ELM_WIN_KEYBOARD_PASSWORD
1864 * ELM_WIN_KEYBOARD_IP
1865 * ELM_WIN_KEYBOARD_HOST
1866 * ELM_WIN_KEYBOARD_FILE
1867 * ELM_WIN_KEYBOARD_URL
1868 * ELM_WIN_KEYBOARD_KEYPAD
1869 * ELM_WIN_KEYBOARD_J2ME
1873 EAPI Elm_Win_Keyboard_Mode
1874 elm_win_keyboard_mode_get(const Evas_Object *obj)
1877 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_KEYBOARD_UNKNOWN;
1878 win = elm_widget_data_get(obj);
1879 if (!win) return ELM_WIN_KEYBOARD_UNKNOWN;
1880 return win->kbdmode;
1884 * Sets whether the window is a keyboard.
1886 * @param obj The window object
1887 * @param is_keyboard If true, the window is a virtual keyboard
1892 elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
1895 ELM_CHECK_WIDTYPE(obj, widtype);
1896 win = elm_widget_data_get(obj);
1898 #ifdef HAVE_ELEMENTARY_X
1899 _elm_win_xwindow_get(win);
1901 ecore_x_e_virtual_keyboard_set(win->xwin, is_keyboard);
1906 * Gets whether the window is a keyboard.
1908 * @param obj The window object
1909 * @return If the window is a virtual keyboard
1914 elm_win_keyboard_win_get(const Evas_Object *obj)
1917 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1918 win = elm_widget_data_get(obj);
1919 if (!win) return EINA_FALSE;
1920 #ifdef HAVE_ELEMENTARY_X
1921 _elm_win_xwindow_get(win);
1923 return ecore_x_e_virtual_keyboard_get(win->xwin);
1929 * Get the screen position of a window.
1931 * @param obj The window object
1932 * @param x The int to store the x coordinate to
1933 * @param y The int to store the y coordinate to
1938 elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
1941 ELM_CHECK_WIDTYPE(obj, widtype);
1942 win = elm_widget_data_get(obj);
1944 if (x) *x = win->screen.x;
1945 if (y) *y = win->screen.y;
1949 * Set if this window is an illume conformant window
1951 * @param obj The window object
1952 * @param conformant The conformant flag (1 = conformant, 0 = non-conformant)
1957 elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
1960 ELM_CHECK_WIDTYPE(obj, widtype);
1961 win = elm_widget_data_get(obj);
1963 #ifdef HAVE_ELEMENTARY_X
1964 _elm_win_xwindow_get(win);
1966 ecore_x_e_illume_conformant_set(win->xwin, conformant);
1971 * Get if this window is an illume conformant window
1973 * @param obj The window object
1974 * @return A boolean if this window is illume conformant or not
1979 elm_win_conformant_get(const Evas_Object *obj)
1982 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1983 win = elm_widget_data_get(obj);
1984 if (!win) return EINA_FALSE;
1985 #ifdef HAVE_ELEMENTARY_X
1986 _elm_win_xwindow_get(win);
1988 return ecore_x_e_illume_conformant_get(win->xwin);
1994 * Set a window to be an illume quickpanel window
1996 * By default window objects are not quickpanel windows.
1998 * @param obj The window object
1999 * @param quickpanel The quickpanel flag (1 = quickpanel, 0 = normal window)
2004 elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel)
2007 ELM_CHECK_WIDTYPE(obj, widtype);
2008 win = elm_widget_data_get(obj);
2010 #ifdef HAVE_ELEMENTARY_X
2011 _elm_win_xwindow_get(win);
2014 ecore_x_e_illume_quickpanel_set(win->xwin, quickpanel);
2017 Ecore_X_Window_State states[2];
2019 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
2020 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
2021 ecore_x_netwm_window_state_set(win->xwin, states, 2);
2022 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
2029 * Get if this window is a quickpanel or not
2031 * @param obj The window object
2032 * @return A boolean if this window is a quickpanel or not
2037 elm_win_quickpanel_get(const Evas_Object *obj)
2040 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2041 win = elm_widget_data_get(obj);
2042 if (!win) return EINA_FALSE;
2043 #ifdef HAVE_ELEMENTARY_X
2044 _elm_win_xwindow_get(win);
2046 return ecore_x_e_illume_quickpanel_get(win->xwin);
2052 * Set the major priority of a quickpanel window
2054 * @param obj The window object
2055 * @param priority The major priority for this quickpanel
2060 elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority)
2063 ELM_CHECK_WIDTYPE(obj, widtype);
2064 win = elm_widget_data_get(obj);
2066 #ifdef HAVE_ELEMENTARY_X
2067 _elm_win_xwindow_get(win);
2069 ecore_x_e_illume_quickpanel_priority_major_set(win->xwin, priority);
2074 * Get the major priority of a quickpanel window
2076 * @param obj The window object
2077 * @return The major priority of this quickpanel
2082 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
2085 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2086 win = elm_widget_data_get(obj);
2087 if (!win) return -1;
2088 #ifdef HAVE_ELEMENTARY_X
2089 _elm_win_xwindow_get(win);
2091 return ecore_x_e_illume_quickpanel_priority_major_get(win->xwin);
2097 * Set the minor priority of a quickpanel window
2099 * @param obj The window object
2100 * @param priority The minor priority for this quickpanel
2105 elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority)
2108 ELM_CHECK_WIDTYPE(obj, widtype);
2109 win = elm_widget_data_get(obj);
2111 #ifdef HAVE_ELEMENTARY_X
2112 _elm_win_xwindow_get(win);
2114 ecore_x_e_illume_quickpanel_priority_minor_set(win->xwin, priority);
2119 * Get the minor priority of a quickpanel window
2121 * @param obj The window object
2122 * @return The minor priority of this quickpanel
2127 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
2130 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2131 win = elm_widget_data_get(obj);
2132 if (!win) return -1;
2133 #ifdef HAVE_ELEMENTARY_X
2134 _elm_win_xwindow_get(win);
2136 return ecore_x_e_illume_quickpanel_priority_minor_get(win->xwin);
2142 * Set which zone this quickpanel should appear in
2144 * @param obj The window object
2145 * @param zone The requested zone for this quickpanel
2150 elm_win_quickpanel_zone_set(Evas_Object *obj, int zone)
2153 ELM_CHECK_WIDTYPE(obj, widtype);
2154 win = elm_widget_data_get(obj);
2156 #ifdef HAVE_ELEMENTARY_X
2157 _elm_win_xwindow_get(win);
2159 ecore_x_e_illume_quickpanel_zone_set(win->xwin, zone);
2164 * Get which zone this quickpanel should appear in
2166 * @param obj The window object
2167 * @return The requested zone for this quickpanel
2172 elm_win_quickpanel_zone_get(const Evas_Object *obj)
2175 ELM_CHECK_WIDTYPE(obj, widtype) 0;
2176 win = elm_widget_data_get(obj);
2178 #ifdef HAVE_ELEMENTARY_X
2179 _elm_win_xwindow_get(win);
2181 return ecore_x_e_illume_quickpanel_zone_get(win->xwin);
2187 * Set the window to be skipped by keyboard focus
2189 * This sets the window to be skipped by normal keyboard input. This means
2190 * a window manager will be asked to not focus this window as well as omit
2191 * it from things like the taskbar, pager, "alt-tab" list etc. etc.
2193 * Call this and enable it on a window BEFORE you show it for the first time,
2194 * otherwise it may have no effect.
2196 * Use this for windows that have only output information or might only be
2197 * interacted with by the mouse or fingers, and never for typing input.
2198 * Be careful that this may have side-effects like making the window
2199 * non-accessible in some cases unless the window is specially handled. Use
2202 * @param obj The window object
2203 * @param skip The skip flag state (EINA_TRUE if it is to be skipped)
2208 elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
2211 ELM_CHECK_WIDTYPE(obj, widtype);
2212 win = elm_widget_data_get(obj);
2214 #ifdef HAVE_ELEMENTARY_X
2215 _elm_win_xwindow_get(win);
2220 Ecore_X_Window_State states[2];
2222 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
2223 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
2224 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
2225 ecore_x_netwm_window_state_set(win->xwin, states, 2);
2232 * Send a command to the windowing environment
2234 * This is intended to work in touchscreen or small screen device environments
2235 * where there is a more simplistic window management policy in place. This
2236 * uses the window object indicated to select which part of the environment
2237 * to control (the part that this window lives in), and provides a command
2238 * and an optional parameter structure (use NULL for this if not needed).
2240 * @param obj The window object that lives in the environment to control
2241 * @param command The command to send
2242 * @param params Optional parameters for the command
2247 elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *params __UNUSED__)
2250 ELM_CHECK_WIDTYPE(obj, widtype);
2251 win = elm_widget_data_get(obj);
2253 #ifdef HAVE_ELEMENTARY_X
2254 _elm_win_xwindow_get(win);
2259 case ELM_ILLUME_COMMAND_FOCUS_BACK:
2260 ecore_x_e_illume_focus_back_send(win->xwin);
2262 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
2263 ecore_x_e_illume_focus_forward_send(win->xwin);
2265 case ELM_ILLUME_COMMAND_FOCUS_HOME:
2266 ecore_x_e_illume_focus_home_send(win->xwin);
2268 case ELM_ILLUME_COMMAND_CLOSE:
2269 ecore_x_e_illume_close_send(win->xwin);
2279 * Set the enabled status for the focus highlight in a window
2281 * This function will enable or disable the focus highlight only for the
2282 * given window, regardless of the global setting for it
2284 * @param obj The window where to enable the highlight
2285 * @param enabled The enabled value for the highlight
2290 elm_win_focus_highlight_enabled_set(Evas_Object *obj, Eina_Bool enabled)
2294 ELM_CHECK_WIDTYPE(obj, widtype);
2296 win = elm_widget_data_get(obj);
2297 enabled = !!enabled;
2298 if (win->focus_highlight.enabled == enabled)
2301 win->focus_highlight.enabled = enabled;
2303 if (win->focus_highlight.enabled)
2304 _elm_win_focus_highlight_init(win);
2306 _elm_win_focus_highlight_shutdown(win);
2310 * Get the enabled value of the focus highlight for this window
2312 * @param obj The window in which to check if the focus highlight is enabled
2314 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
2319 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
2323 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2325 win = elm_widget_data_get(obj);
2326 return win->focus_highlight.enabled;
2330 * Set the style for the focus highlight on this window
2332 * Sets the style to use for theming the highlight of focused objects on
2333 * the given window. If @p style is NULL, the default will be used.
2335 * @param obj The window where to set the style
2336 * @param style The style to set
2341 elm_win_focus_highlight_style_set(Evas_Object *obj, const char *style)
2345 ELM_CHECK_WIDTYPE(obj, widtype);
2347 win = elm_widget_data_get(obj);
2348 eina_stringshare_replace(&win->focus_highlight.style, style);
2349 win->focus_highlight.changed_theme = EINA_TRUE;
2350 _elm_win_focus_highlight_reconfigure_job_start(win);
2354 * Get the style set for the focus highlight object
2356 * Gets the style set for this windows highilght object, or NULL if none
2359 * @param obj The window to retrieve the highlights style from
2361 * @return The style set or NULL if none was. Default is used in that case.
2366 elm_win_focus_highlight_style_get(const Evas_Object *obj)
2370 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2372 win = elm_widget_data_get(obj);
2373 return win->focus_highlight.style;
2376 typedef struct _Widget_Data Widget_Data;
2381 Evas_Object *content;
2384 static void _del_hook(Evas_Object *obj);
2385 static void _theme_hook(Evas_Object *obj);
2386 static void _sizing_eval(Evas_Object *obj);
2387 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
2388 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
2390 static const char *widtype2 = NULL;
2393 _del_hook(Evas_Object *obj)
2395 Widget_Data *wd = elm_widget_data_get(obj);
2401 _theme_hook(Evas_Object *obj)
2403 Widget_Data *wd = elm_widget_data_get(obj);
2404 _elm_theme_object_set(obj, wd->frm, "win", "inwin", elm_widget_style_get(obj));
2406 edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content);
2411 _elm_inwin_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
2413 Widget_Data *wd = elm_widget_data_get(obj);
2418 /* Try Focus cycle in subitem */
2421 elm_widget_focus_next_get(wd->content, dir, next);
2426 *next = (Evas_Object *)obj;
2431 _sizing_eval(Evas_Object *obj)
2433 Widget_Data *wd = elm_widget_data_get(obj);
2434 Evas_Coord minw = -1, minh = -1;
2436 evas_object_size_hint_min_get(wd->content, &minw, &minh);
2437 edje_object_size_min_calc(wd->frm, &minw, &minh);
2438 evas_object_size_hint_min_set(obj, minw, minh);
2439 evas_object_size_hint_max_set(obj, -1, -1);
2443 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2449 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
2451 Widget_Data *wd = elm_widget_data_get(obj);
2452 Evas_Object *sub = event_info;
2453 if (sub == wd->content)
2455 evas_object_event_callback_del_full
2456 (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
2463 * @defgroup Inwin Inwin
2465 * An inwin is a window inside a window that is useful for a quick popup. It does not hover.
2468 elm_win_inwin_add(Evas_Object *obj)
2474 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2475 win = elm_widget_data_get(obj);
2476 if (!win) return NULL;
2477 wd = ELM_NEW(Widget_Data);
2478 obj2 = elm_widget_add(win->evas);
2479 elm_widget_type_set(obj2, "inwin");
2480 ELM_SET_WIDTYPE(widtype2, "inwin");
2481 elm_widget_sub_object_add(obj, obj2);
2482 evas_object_size_hint_weight_set(obj2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2483 evas_object_size_hint_align_set(obj2, EVAS_HINT_FILL, EVAS_HINT_FILL);
2484 elm_win_resize_object_add(obj, obj2);
2486 elm_widget_data_set(obj2, wd);
2487 elm_widget_del_hook_set(obj2, _del_hook);
2488 elm_widget_theme_hook_set(obj2, _theme_hook);
2489 elm_widget_focus_next_hook_set(obj2, _elm_inwin_focus_next_hook);
2490 elm_widget_can_focus_set(obj2, EINA_TRUE);
2491 elm_widget_highlight_ignore_set(obj2, EINA_TRUE);
2493 wd->frm = edje_object_add(win->evas);
2494 _elm_theme_object_set(obj, wd->frm, "win", "inwin", "default");
2495 elm_widget_resize_object_set(obj2, wd->frm);
2497 evas_object_smart_callback_add(obj2, "sub-object-del", _sub_del, obj2);
2504 * Activates an inwin object
2506 * @param obj The inwin to activate
2511 elm_win_inwin_activate(Evas_Object *obj)
2513 ELM_CHECK_WIDTYPE(obj, widtype2);
2514 Widget_Data *wd = elm_widget_data_get(obj);
2516 evas_object_raise(obj);
2517 evas_object_show(obj);
2518 edje_object_signal_emit(wd->frm, "elm,action,show", "elm");
2519 elm_object_focus(obj);
2523 * Set the content of an inwin object.
2525 * Once the content object is set, a previously set one will be deleted.
2526 * If you want to keep that old content object, use the
2527 * elm_win_inwin_content_unset() function.
2529 * @param obj The inwin object
2530 * @param content The object to set as content
2535 elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
2537 ELM_CHECK_WIDTYPE(obj, widtype2);
2538 Widget_Data *wd = elm_widget_data_get(obj);
2540 if (wd->content == content) return;
2541 if (wd->content) evas_object_del(wd->content);
2542 wd->content = content;
2545 elm_widget_sub_object_add(obj, content);
2546 evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2547 _changed_size_hints, obj);
2548 edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
2554 * Get the content of an inwin object.
2556 * Return the content object which is set for this widget.
2558 * @param obj The inwin object
2559 * @return The content that is being used
2564 elm_win_inwin_content_get(const Evas_Object *obj)
2566 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
2567 Widget_Data *wd = elm_widget_data_get(obj);
2568 if (!wd) return NULL;
2573 * Unset the content of an inwin object.
2575 * Unparent and return the content object which was set for this widget.
2577 * @param obj The inwin object
2578 * @return The content that was being used
2583 elm_win_inwin_content_unset(Evas_Object *obj)
2585 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
2586 Widget_Data *wd = elm_widget_data_get(obj);
2587 if (!wd) return NULL;
2588 if (!wd->content) return NULL;
2589 Evas_Object *content = wd->content;
2590 elm_widget_sub_object_del(obj, wd->content);
2591 edje_object_part_unswallow(wd->frm, wd->content);
2596 /* windowing spcific calls - shall we do this differently? */
2598 * Get the Ecore_X_Window of an Evas_Object
2600 * @param obj The object
2602 * @return The Ecore_X_Window of @p obj
2607 elm_win_xwindow_get(const Evas_Object *obj)
2609 Ecore_X_Window xwin = 0;
2610 Ecore_Evas *ee = NULL;
2612 #ifdef HAVE_ELEMENTARY_X
2613 ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
2614 if (ee) xwin = (Ecore_X_Window)ecore_evas_window_get(ee);