1 #include <Elementary.h>
7 * The window class of Elementary. Contains functions to manipulate
10 * Signals that you can add callbacks for are:
12 * "delete,request" - the user requested to delete the window
13 * "focus,in" - window got focus
14 * "focus,out" - window lost focus
15 * "moved" - window that holds the canvas was moved
18 typedef struct _Elm_Win Elm_Win;
24 Evas_Object *parent, *win_obj;
26 #ifdef HAVE_ELEMENTARY_X
28 Ecore_Event_Handler *client_message_handler;
30 Ecore_Job *deferred_resize_job;
31 Ecore_Job *deferred_child_eval_job;
34 Elm_Win_Keyboard_Mode kbdmode;
35 Eina_Bool autodel : 1;
36 int *autodel_clear, rot;
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;
60 static const char *widtype = NULL;
61 static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
62 static void _elm_win_obj_callback_parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
63 static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
64 static void _elm_win_move(Ecore_Evas *ee);
65 static void _elm_win_resize(Ecore_Evas *ee);
66 static void _elm_win_delete_request(Ecore_Evas *ee);
67 static void _elm_win_resize_job(void *data);
68 #ifdef HAVE_ELEMENTARY_X
69 static void _elm_win_xwin_update(Elm_Win *win);
71 static void _elm_win_eval_subobjs(Evas_Object *obj);
72 static void _elm_win_subobj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
73 static void _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
74 static void _elm_win_focus_highlight_init(Elm_Win *win);
75 static void _elm_win_focus_highlight_shutdown(Elm_Win *win);
76 static void _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible);
77 static void _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win);
78 static void _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win);
79 static void _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission, const char *source);
80 static void _elm_win_focus_highlight_reconfigure(Elm_Win *win);
82 Eina_List *_elm_win_list = NULL;
83 int _elm_win_deferred_free = 0;
86 _elm_win_move(Ecore_Evas *ee)
88 Evas_Object *obj = ecore_evas_object_associate_get(ee);
93 win = elm_widget_data_get(obj);
95 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
98 evas_object_smart_callback_call(win->win_obj, "moved", NULL);
102 _elm_win_resize(Ecore_Evas *ee)
104 Evas_Object *obj = ecore_evas_object_associate_get(ee);
108 win = elm_widget_data_get(obj);
110 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
111 win->deferred_resize_job = ecore_job_add(_elm_win_resize_job, win);
115 _elm_win_focus_in(Ecore_Evas *ee)
117 Evas_Object *obj = ecore_evas_object_associate_get(ee);
121 win = elm_widget_data_get(obj);
123 /*NB: Why two different "focus signals" here ??? */
124 evas_object_smart_callback_call(win->win_obj, "focus-in", NULL); // FIXME: remove me
125 evas_object_smart_callback_call(win->win_obj, "focus,in", NULL);
126 win->focus_highlight.cur.visible = EINA_TRUE;
127 _elm_win_focus_highlight_reconfigure_job_start(win);
131 _elm_win_focus_out(Ecore_Evas *ee)
133 Evas_Object *obj = ecore_evas_object_associate_get(ee);
137 win = elm_widget_data_get(obj);
139 evas_object_smart_callback_call(win->win_obj, "focus-out", NULL); // FIXME: remove me
140 evas_object_smart_callback_call(win->win_obj, "focus,out", NULL);
141 win->focus_highlight.cur.visible = EINA_FALSE;
142 _elm_win_focus_highlight_reconfigure_job_start(win);
146 _elm_win_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
148 Elm_Win *wd = elm_widget_data_get(obj);
149 const Eina_List *items;
150 void *(*list_data_get) (const Eina_List *list);
158 if (!(items = elm_widget_focus_custom_chain_get(obj)))
164 list_data_get = eina_list_data_get;
166 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
172 *next = (Evas_Object *)obj;
177 _elm_win_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
179 if (elm_widget_focus_get(obj))
180 evas_object_focus_set(obj, EINA_TRUE);
182 evas_object_focus_set(obj, EINA_FALSE);
186 _elm_win_event_cb(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
188 if (type == EVAS_CALLBACK_KEY_DOWN)
190 Evas_Event_Key_Down *ev = event_info;
191 if (!strcmp(ev->keyname, "Tab"))
193 if(evas_key_modifier_is_set(ev->modifiers, "Shift"))
194 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
196 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
197 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
206 _deferred_ecore_evas_free(void *data)
208 ecore_evas_free(data);
209 _elm_win_deferred_free--;
213 _elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
215 elm_object_focus(obj);
219 _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
226 evas_object_event_callback_del_full(win->parent, EVAS_CALLBACK_DEL,
227 _elm_win_obj_callback_parent_del, win);
230 if (win->autodel_clear) *(win->autodel_clear) = -1;
231 _elm_win_list = eina_list_remove(_elm_win_list, win->win_obj);
232 while (win->subobjs) elm_win_resize_object_del(obj, win->subobjs->data);
233 ecore_evas_callback_delete_request_set(win->ee, NULL);
234 ecore_evas_callback_resize_set(win->ee, NULL);
235 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
236 if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
237 while (((child = evas_object_bottom_get(win->evas))) &&
240 evas_object_del(child);
242 while (((child = evas_object_top_get(win->evas))) &&
245 evas_object_del(child);
247 #ifdef HAVE_ELEMENTARY_X
248 if (win->client_message_handler)
249 ecore_event_handler_del(win->client_message_handler);
251 // FIXME: Why are we flushing edje on every window destroy ??
252 // edje_file_cache_flush();
253 // edje_collection_cache_flush();
254 // evas_image_cache_flush(win->evas);
255 // evas_font_cache_flush(win->evas);
256 // FIXME: we are in the del handler for the object and delete the canvas
257 // that lives under it from the handler... nasty. deferring doesn't help either
259 ecore_job_add(_deferred_ecore_evas_free, win->ee);
260 _elm_win_deferred_free++;
261 // ecore_evas_free(win->ee);
263 _elm_win_focus_highlight_shutdown(win);
264 eina_stringshare_del(win->focus_highlight.style);
268 if ((!_elm_win_list) &&
269 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
271 edje_file_cache_flush();
272 edje_collection_cache_flush();
273 evas_image_cache_flush(e);
274 evas_font_cache_flush(e);
280 _elm_win_obj_callback_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
283 if (obj == win->parent) win->parent = NULL;
287 _elm_win_obj_intercept_show(void *data __UNUSED__, Evas_Object *obj)
289 // this is called to make sure all smart containers have calculated their
290 // sizes BEFORE we show the window to make sure it initially appears at
291 // our desired size (ie min size is known first)
292 evas_smart_objects_calculate(evas_object_evas_get(obj));
293 evas_object_show(obj);
297 _elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
301 if (ecore_evas_override_get(win->ee))
305 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
308 evas_object_smart_callback_call(win->win_obj, "moved", NULL);
313 _elm_win_delete_request(Ecore_Evas *ee)
315 Evas_Object *obj = ecore_evas_object_associate_get(ee);
317 if (strcmp(elm_widget_type_get(obj), "win")) return;
319 win = elm_widget_data_get(obj);
321 int autodel = win->autodel;
322 win->autodel_clear = &autodel;
323 evas_object_smart_callback_call(win->win_obj, "delete-request", NULL); // FIXME: remove me
324 evas_object_smart_callback_call(win->win_obj, "delete,request", NULL);
325 // FIXME: if above callback deletes - then the below will be invalid
326 if (autodel) evas_object_del(win->win_obj);
327 else win->autodel_clear = NULL;
331 _elm_win_resize_job(void *data)
338 win->deferred_resize_job = NULL;
339 ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
340 evas_object_resize(win->win_obj, w, h);
341 EINA_LIST_FOREACH(win->subobjs, l, obj)
343 evas_object_move(obj, 0, 0);
344 evas_object_resize(obj, w, h);
348 #ifdef HAVE_ELEMENTARY_X
350 _elm_win_xwindow_get(Elm_Win *win)
354 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
355 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
357 if (win->ee) win->xwin = ecore_evas_software_x11_window_get(win->ee);
359 else if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
360 ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
361 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
362 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
363 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
364 ENGINE_COMPARE(ELM_OPENGL_SDL))
367 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
369 if (win->ee) win->xwin = ecore_evas_software_x11_16_window_get(win->ee);
371 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
373 if (win->ee) win->xwin = ecore_evas_software_x11_8_window_get(win->ee);
375 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
377 if (win->ee) win->xwin = ecore_evas_xrender_x11_window_get(win->ee);
379 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
381 if (win->ee) win->xwin = ecore_evas_gl_x11_window_get(win->ee);
383 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
385 if (win->ee) win->xwin = (long)ecore_evas_win32_window_get(win->ee);
387 #undef ENGINE_COMPARE
391 #ifdef HAVE_ELEMENTARY_X
393 _elm_win_xwin_update(Elm_Win *win)
395 _elm_win_xwindow_get(win);
400 win2 = elm_widget_data_get(win->parent);
404 ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
408 if (!win->xwin) return; /* nothing more to do */
413 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
415 case ELM_WIN_DIALOG_BASIC:
416 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
418 case ELM_WIN_DESKTOP:
419 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
422 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK);
424 case ELM_WIN_TOOLBAR:
425 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
428 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU);
430 case ELM_WIN_UTILITY:
431 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY);
434 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH);
436 case ELM_WIN_DROPDOWN_MENU:
437 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
439 case ELM_WIN_POPUP_MENU:
440 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
442 case ELM_WIN_TOOLTIP:
443 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
445 case ELM_WIN_NOTIFICATION:
446 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
449 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO);
452 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND);
457 ecore_x_e_virtual_keyboard_state_set
458 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
463 _elm_win_eval_subobjs(Evas_Object *obj)
466 const Evas_Object *child;
468 Elm_Win *win = elm_widget_data_get(obj);
469 Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
473 EINA_LIST_FOREACH(win->subobjs, l, child)
475 evas_object_size_hint_weight_get(child, &wx, &wy);
476 if (wx == 0.0) xx = 0;
477 if (wy == 0.0) xy = 0;
479 evas_object_size_hint_min_get(child, &w, &h);
482 if (w > minw) minw = w;
483 if (h > minh) minh = h;
485 evas_object_size_hint_max_get(child, &w, &h);
488 if (maxw == -1) maxw = w;
489 else if ((w > 0) && (w < maxw)) maxw = w;
490 if (maxh == -1) maxh = h;
491 else if ((h > 0) && (h < maxh)) maxh = h;
493 if (!xx) maxw = minw;
495 if (!xy) maxh = minh;
497 evas_object_size_hint_min_set(obj, minw, minh);
498 evas_object_size_hint_max_set(obj, maxw, maxh);
499 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
500 if (w < minw) w = minw;
501 if (h < minh) h = minh;
502 if ((maxw >= 0) && (w > maxw)) w = maxw;
503 if ((maxh >= 0) && (h > maxh)) h = maxh;
504 evas_object_resize(obj, w, h);
508 _elm_win_subobj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
510 Elm_Win *win = elm_widget_data_get(data);
511 win->subobjs = eina_list_remove(win->subobjs, obj);
512 _elm_win_eval_subobjs(win->win_obj);
516 _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
518 _elm_win_eval_subobjs(data);
522 _elm_win_shutdown(void)
524 while (_elm_win_list)
525 evas_object_del(_elm_win_list->data);
529 _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme)
536 EINA_LIST_FOREACH(_elm_win_list, l, obj)
537 elm_widget_theme(obj);
541 EINA_LIST_FOREACH(_elm_win_list, l, obj)
542 elm_widget_theme_specific(obj, th, EINA_FALSE);
546 #ifdef HAVE_ELEMENTARY_X
548 _elm_win_client_message(void *data, int type __UNUSED__, void *event)
551 Ecore_X_Event_Client_Message *e = event;
553 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
554 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
556 if ((unsigned)e->data.l[0] == win->xwin)
558 Evas *evas = evas_object_evas_get(win->win_obj);
561 edje_file_cache_flush();
562 edje_collection_cache_flush();
563 evas_image_cache_flush(evas);
564 evas_font_cache_flush(evas);
568 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
570 if ((unsigned)e->data.l[0] == win->xwin)
572 Evas *evas = evas_object_evas_get(win->win_obj);
575 edje_file_cache_flush();
576 edje_collection_cache_flush();
577 evas_image_cache_flush(evas);
578 evas_font_cache_flush(evas);
579 evas_render_dump(evas);
583 return ECORE_CALLBACK_PASS_ON;
588 _elm_win_focus_target_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
592 win->focus_highlight.geometry_changed = EINA_TRUE;
593 _elm_win_focus_highlight_reconfigure_job_start(win);
597 _elm_win_focus_target_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
601 win->focus_highlight.geometry_changed = EINA_TRUE;
602 _elm_win_focus_highlight_reconfigure_job_start(win);
606 _elm_win_focus_target_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
610 win->focus_highlight.cur.target = NULL;
612 _elm_win_focus_highlight_reconfigure_job_start(win);
616 _elm_win_focus_target_callbacks_add(Elm_Win *win)
618 Evas_Object *obj = win->focus_highlight.cur.target;
620 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
621 _elm_win_focus_target_move, win);
622 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
623 _elm_win_focus_target_resize, win);
624 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
625 _elm_win_focus_target_del, win);
629 _elm_win_focus_target_callbacks_del(Elm_Win *win)
631 Evas_Object *obj = win->focus_highlight.cur.target;
633 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
634 _elm_win_focus_target_move, win);
635 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
636 _elm_win_focus_target_resize, win);
637 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
638 _elm_win_focus_target_del, win);
642 _elm_win_focus_target_get(Evas_Object *obj)
644 Evas_Object *o = obj;
648 if (elm_widget_is(o))
650 if (!elm_widget_highlight_ignore_get(o))
652 o = elm_widget_parent_get(o);
654 o = evas_object_smart_parent_get(o);
658 o = elm_widget_parent_widget_get(o);
660 o = evas_object_smart_parent_get(o);
669 _elm_win_object_focus_in(void *data, Evas *e __UNUSED__, void *event_info)
671 Evas_Object *obj = event_info, *target;
674 if (win->focus_highlight.cur.target == obj)
677 target = _elm_win_focus_target_get(obj);
678 win->focus_highlight.cur.target = target;
679 if (elm_widget_highlight_in_theme_get(target))
680 win->focus_highlight.cur.handled = EINA_TRUE;
682 _elm_win_focus_target_callbacks_add(win);
684 _elm_win_focus_highlight_reconfigure_job_start(win);
688 _elm_win_object_focus_out(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
692 if (!win->focus_highlight.cur.target)
695 if (!win->focus_highlight.cur.handled)
696 _elm_win_focus_target_callbacks_del(win);
697 win->focus_highlight.cur.target = NULL;
698 win->focus_highlight.cur.handled = EINA_FALSE;
700 _elm_win_focus_highlight_reconfigure_job_start(win);
704 _elm_win_focus_highlight_hide(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
706 evas_object_hide(obj);
710 _elm_win_focus_highlight_init(Elm_Win *win)
712 evas_event_callback_add(win->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
713 _elm_win_object_focus_in, win);
714 evas_event_callback_add(win->evas,
715 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
716 _elm_win_object_focus_out, win);
718 win->focus_highlight.cur.target = evas_focus_get(win->evas);
720 win->focus_highlight.top = edje_object_add(win->evas);
721 win->focus_highlight.changed_theme = EINA_TRUE;
722 edje_object_signal_callback_add(win->focus_highlight.top,
723 "elm,action,focus,hide,end", "",
724 _elm_win_focus_highlight_hide, NULL);
725 edje_object_signal_callback_add(win->focus_highlight.top,
726 "elm,action,focus,anim,end", "",
727 _elm_win_focus_highlight_anim_end, win);
728 _elm_win_focus_highlight_reconfigure_job_start(win);
732 _elm_win_focus_highlight_shutdown(Elm_Win *win)
734 _elm_win_focus_highlight_reconfigure_job_stop(win);
735 if (win->focus_highlight.cur.target)
737 _elm_win_focus_target_callbacks_del(win);
738 win->focus_highlight.cur.target = NULL;
740 if (win->focus_highlight.top)
742 evas_object_del(win->focus_highlight.top);
743 win->focus_highlight.top = NULL;
746 evas_event_callback_del_full(win->evas,
747 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
748 _elm_win_object_focus_in, win);
749 evas_event_callback_del_full(win->evas,
750 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
751 _elm_win_object_focus_out, win);
755 _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible)
759 top = win->focus_highlight.top;
764 evas_object_show(top);
765 edje_object_signal_emit(top, "elm,action,focus,show", "elm");
771 edje_object_signal_emit(top, "elm,action,focus,hide", "elm");
776 _elm_win_focus_highlight_reconfigure_job(void *data)
778 _elm_win_focus_highlight_reconfigure((Elm_Win *)data);
782 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win)
784 if (win->focus_highlight.reconf_job)
785 ecore_job_del(win->focus_highlight.reconf_job);
786 win->focus_highlight.reconf_job = ecore_job_add(
787 _elm_win_focus_highlight_reconfigure_job, win);
791 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win)
793 if (win->focus_highlight.reconf_job)
794 ecore_job_del(win->focus_highlight.reconf_job);
795 win->focus_highlight.reconf_job = NULL;
799 _elm_win_focus_highlight_simple_setup(Elm_Win *win, Evas_Object *obj)
801 Evas_Object *clip, *target = win->focus_highlight.cur.target;
802 Evas_Coord x, y, w, h;
804 clip = evas_object_clip_get(target);
805 evas_object_geometry_get(target, &x, &y, &w, &h);
807 evas_object_move(obj, x, y);
808 evas_object_resize(obj, w, h);
809 evas_object_clip_set(obj, clip);
813 _elm_win_focus_highlight_anim_setup(Elm_Win *win, Evas_Object *obj)
815 Evas_Coord tx, ty, tw, th;
816 Evas_Coord w, h, px, py, pw, ph;
817 Edje_Message_Int_Set *m;
818 Evas_Object *previous = win->focus_highlight.prev.target;
819 Evas_Object *target = win->focus_highlight.cur.target;
821 evas_object_geometry_get(win->win_obj, NULL, NULL, &w, &h);
822 evas_object_geometry_get(target, &tx, &ty, &tw, &th);
823 evas_object_geometry_get(previous, &px, &py, &pw, &ph);
824 evas_object_move(obj, 0, 0);
825 evas_object_resize(obj, tw, th);
826 evas_object_clip_unset(obj);
828 m = alloca(sizeof(*m) + (sizeof(int) * 8));
838 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
842 _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
845 _elm_win_focus_highlight_simple_setup(win, obj);
849 _elm_win_focus_highlight_reconfigure(Elm_Win *win)
851 Evas_Object *target = win->focus_highlight.cur.target;
852 Evas_Object *previous = win->focus_highlight.prev.target;
853 Evas_Object *top = win->focus_highlight.top;
854 Eina_Bool visible_changed;
855 Eina_Bool common_visible;
856 const char *sig = NULL;
858 _elm_win_focus_highlight_reconfigure_job_stop(win);
860 visible_changed = (win->focus_highlight.cur.visible !=
861 win->focus_highlight.prev.visible);
863 if ((target == previous) && (!visible_changed) &&
864 (!win->focus_highlight.geometry_changed))
867 if ((previous) && (win->focus_highlight.prev.handled))
868 elm_widget_signal_emit(previous, "elm,action,focus_highlight,hide", "elm");
871 common_visible = EINA_FALSE;
872 else if (win->focus_highlight.cur.handled)
874 common_visible = EINA_FALSE;
875 if (win->focus_highlight.cur.visible)
876 sig = "elm,action,focus_highlight,show";
878 sig = "elm,action,focus_highlight,hide";
881 common_visible = win->focus_highlight.cur.visible;
883 _elm_win_focus_highlight_visible_set(win, common_visible);
885 elm_widget_signal_emit(target, sig, "elm");
887 if ((!target) || (!common_visible) || (win->focus_highlight.cur.handled))
890 if (win->focus_highlight.changed_theme)
893 if (win->focus_highlight.style)
894 str = win->focus_highlight.style;
897 _elm_theme_object_set(win->win_obj, top, "focus_highlight", "top",
899 win->focus_highlight.changed_theme = EINA_FALSE;
901 if (_elm_config->focus_highlight_animate)
903 str = edje_object_data_get(win->focus_highlight.top, "animate");
904 win->focus_highlight.top_animate = ((str) && (!strcmp(str, "on")));
908 if ((win->focus_highlight.top_animate) && (previous) &&
909 (!win->focus_highlight.prev.handled))
910 _elm_win_focus_highlight_anim_setup(win, top);
912 _elm_win_focus_highlight_simple_setup(win, top);
913 evas_object_raise(top);
916 win->focus_highlight.geometry_changed = EINA_FALSE;
917 win->focus_highlight.prev = win->focus_highlight.cur;
922 _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
924 Evas_Event_Key_Down *ev = event_info;
926 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
930 if ((strcmp(ev->keyname, "F12")) ||
931 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
934 printf("Tree graph generated.\n");
935 elm_object_tree_dot_dump(obj, "./dump.dot");
940 * Adds a window object. If this is the first window created, pass NULL as
943 * @param parent Parent object to add the window to, or NULL
944 * @param name The name of the window
945 * @param type The window type, one of the following:
947 * ELM_WIN_DIALOG_BASIC
955 * @return The created object, or NULL on failure
960 elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
964 const char *fontpath;
966 win = ELM_NEW(Elm_Win);
968 #define FALLBACK_TRY(engine) \
971 CRITICAL(engine " engine creation failed. Trying software X11."); \
972 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
975 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
976 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
978 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
979 #ifdef HAVE_ELEMENTARY_X
980 win->client_message_handler = ecore_event_handler_add
981 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
984 else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
986 win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
987 FALLBACK_TRY("Sofware FB");
989 else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
991 win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
992 FALLBACK_TRY("Sofware DirectFB");
994 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
996 win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
997 FALLBACK_TRY("Sofware-16");
998 #ifdef HAVE_ELEMENTARY_X
999 win->client_message_handler = ecore_event_handler_add
1000 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1003 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
1005 win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
1006 FALLBACK_TRY("Sofware-8");
1007 #ifdef HAVE_ELEMENTARY_X
1008 win->client_message_handler = ecore_event_handler_add
1009 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1012 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
1014 win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
1015 FALLBACK_TRY("XRender");
1016 #ifdef HAVE_ELEMENTARY_X
1017 win->client_message_handler = ecore_event_handler_add
1018 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1021 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
1023 win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
1024 FALLBACK_TRY("OpenGL");
1025 #ifdef HAVE_ELEMENTARY_X
1026 win->client_message_handler = ecore_event_handler_add
1027 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1030 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
1032 win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
1033 FALLBACK_TRY("Sofware Win32");
1035 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1037 win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
1038 FALLBACK_TRY("Sofware-16-WinCE");
1040 else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
1042 win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
1043 FALLBACK_TRY("Sofware SDL");
1045 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
1047 win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
1048 FALLBACK_TRY("Sofware-16-SDL");
1050 else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
1052 win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
1053 FALLBACK_TRY("OpenGL SDL");
1059 ERR("Cannot create window.");
1063 #ifdef HAVE_ELEMENTARY_X
1064 _elm_win_xwindow_get(win);
1066 if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
1067 ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
1068 // bg pixmap done by x - has other issues like can be redrawn by x before it
1069 // is filled/ready by app
1070 // ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
1073 win->parent = parent;
1075 evas_object_event_callback_add(win->parent, EVAS_CALLBACK_DEL,
1076 _elm_win_obj_callback_parent_del, win);
1078 win->evas = ecore_evas_get(win->ee);
1079 win->win_obj = elm_widget_add(win->evas);
1080 elm_widget_type_set(win->win_obj, "win");
1081 ELM_SET_WIDTYPE(widtype, "win");
1082 elm_widget_data_set(win->win_obj, win);
1083 elm_widget_event_hook_set(win->win_obj, _elm_win_event_cb);
1084 elm_widget_on_focus_hook_set(win->win_obj, _elm_win_on_focus_hook, NULL);
1085 elm_widget_can_focus_set(win->win_obj, EINA_TRUE);
1086 elm_widget_highlight_ignore_set(win->win_obj, EINA_TRUE);
1087 elm_widget_focus_next_hook_set(win->win_obj, _elm_win_focus_next_hook);
1088 evas_object_color_set(win->win_obj, 0, 0, 0, 0);
1089 evas_object_move(win->win_obj, 0, 0);
1090 evas_object_resize(win->win_obj, 1, 1);
1091 evas_object_layer_set(win->win_obj, 50);
1092 evas_object_pass_events_set(win->win_obj, EINA_TRUE);
1094 evas_object_intercept_show_callback_add(win->win_obj,
1095 _elm_win_obj_intercept_show, win);
1096 ecore_evas_object_associate(win->ee, win->win_obj,
1097 ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
1098 ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
1099 ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
1100 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
1101 _elm_win_obj_callback_show, win);
1102 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
1103 _elm_win_obj_callback_del, win);
1104 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_MOVE,
1105 _elm_win_obj_callback_move, win);
1107 ecore_evas_name_class_set(win->ee, name, _elm_appname);
1108 ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
1109 ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
1110 ecore_evas_callback_focus_in_set(win->ee, _elm_win_focus_in);
1111 ecore_evas_callback_focus_out_set(win->ee, _elm_win_focus_out);
1112 ecore_evas_callback_move_set(win->ee, _elm_win_move);
1113 evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024));
1114 evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
1115 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
1116 evas_font_path_append(win->evas, fontpath);
1117 if (!_elm_config->font_hinting)
1118 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
1119 else if (_elm_config->font_hinting == 1)
1120 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_AUTO);
1121 else if (_elm_config->font_hinting == 2)
1122 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_BYTECODE);
1124 #ifdef HAVE_ELEMENTARY_X
1125 _elm_win_xwin_update(win);
1128 _elm_win_list = eina_list_append(_elm_win_list, win->win_obj);
1130 if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
1132 ecore_evas_fullscreen_set(win->ee, 1);
1134 #undef ENGINE_COMPARE
1136 if (_elm_config->focus_highlight_enable)
1137 elm_win_focus_highlight_enabled_set(win->win_obj, EINA_TRUE);
1140 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(win->evas, "Control");
1141 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_KEY_DOWN,
1142 _debug_key_down, win);
1143 Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0, EINA_TRUE);
1144 printf("Key F12 exclusive for dot tree generation. (%d)\n", ret);
1146 return win->win_obj;
1150 * Add @p subobj as a resize object of window @p obj.
1152 * @param obj The window object
1153 * @param subobj The resize object to add
1158 elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
1162 ELM_CHECK_WIDTYPE(obj, widtype);
1163 win = elm_widget_data_get(obj);
1165 win->subobjs = eina_list_append(win->subobjs, subobj);
1166 elm_widget_sub_object_add(obj, subobj);
1167 evas_object_event_callback_add(subobj, EVAS_CALLBACK_DEL,
1168 _elm_win_subobj_callback_del, obj);
1169 evas_object_event_callback_add(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1170 _elm_win_subobj_callback_changed_size_hints,
1172 ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
1173 evas_object_move(subobj, 0, 0);
1174 evas_object_resize(subobj, w, h);
1175 _elm_win_eval_subobjs(obj);
1179 * Delete @p subobj as a resize object of window @p obj.
1181 * @param obj The window object
1182 * @param subobj The resize object to add
1187 elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
1190 ELM_CHECK_WIDTYPE(obj, widtype);
1191 win = elm_widget_data_get(obj);
1193 evas_object_event_callback_del_full(subobj,
1194 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1195 _elm_win_subobj_callback_changed_size_hints,
1197 evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL,
1198 _elm_win_subobj_callback_del, obj);
1199 win->subobjs = eina_list_remove(win->subobjs, subobj);
1200 elm_widget_sub_object_del(obj, subobj);
1201 _elm_win_eval_subobjs(obj);
1205 * Set the title of the window
1207 * @param obj The window object
1208 * @param title The title to set
1213 elm_win_title_set(Evas_Object *obj, const char *title)
1216 ELM_CHECK_WIDTYPE(obj, widtype);
1217 win = elm_widget_data_get(obj);
1219 ecore_evas_title_set(win->ee, title);
1223 * Get the title of the window
1225 * @param obj The window object
1231 elm_win_title_get(const Evas_Object *obj)
1234 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1235 win = elm_widget_data_get(obj);
1236 if (!win) return NULL;
1237 return ecore_evas_title_get(win->ee);
1241 * Set the window's autodel state.
1243 * @param obj The window object
1244 * @param autodel If true, the window will automatically delete itself when closed
1249 elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
1252 ELM_CHECK_WIDTYPE(obj, widtype);
1253 win = elm_widget_data_get(obj);
1255 win->autodel = autodel;
1259 * Get the window's autodel state.
1261 * @param obj The window object
1262 * @return If the window will automatically delete itself when closed
1267 elm_win_autodel_get(const Evas_Object *obj)
1270 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1271 win = elm_widget_data_get(obj);
1272 if (!win) return EINA_FALSE;
1273 return win->autodel;
1277 * Activate a window object.
1279 * @param obj The window object
1284 elm_win_activate(Evas_Object *obj)
1287 ELM_CHECK_WIDTYPE(obj, widtype);
1288 win = elm_widget_data_get(obj);
1290 ecore_evas_activate(win->ee);
1294 * Lower a window object.
1296 * @param obj The window object
1301 elm_win_lower(Evas_Object *obj)
1304 ELM_CHECK_WIDTYPE(obj, widtype);
1305 win = elm_widget_data_get(obj);
1307 ecore_evas_lower(win->ee);
1311 * Raise a window object.
1313 * @param obj The window object
1318 elm_win_raise(Evas_Object *obj)
1321 ELM_CHECK_WIDTYPE(obj, widtype);
1322 win = elm_widget_data_get(obj);
1324 ecore_evas_raise(win->ee);
1328 * Set the borderless state of a window.
1330 * @param obj The window object
1331 * @param borderless If true, the window is borderless
1336 elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless)
1339 ELM_CHECK_WIDTYPE(obj, widtype);
1340 win = elm_widget_data_get(obj);
1342 ecore_evas_borderless_set(win->ee, borderless);
1343 #ifdef HAVE_ELEMENTARY_X
1344 _elm_win_xwin_update(win);
1349 * Get the borderless state of a window.
1351 * @param obj The window object
1352 * @return If true, the window is borderless
1357 elm_win_borderless_get(const Evas_Object *obj)
1360 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1361 win = elm_widget_data_get(obj);
1362 if (!win) return EINA_FALSE;
1363 return ecore_evas_borderless_get(win->ee);
1367 * Set the shaped state of a window.
1369 * @param obj The window object
1370 * @param shaped If true, the window is shaped
1375 elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
1378 ELM_CHECK_WIDTYPE(obj, widtype);
1379 win = elm_widget_data_get(obj);
1381 ecore_evas_shaped_set(win->ee, shaped);
1382 #ifdef HAVE_ELEMENTARY_X
1383 _elm_win_xwin_update(win);
1388 * Get the shaped state of a window.
1390 * @param obj The window object
1391 * @return If true, the window is shaped
1396 elm_win_shaped_get(const Evas_Object *obj)
1399 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1400 win = elm_widget_data_get(obj);
1401 if (!win) return EINA_FALSE;
1402 return ecore_evas_shaped_get(win->ee);
1406 * Set the alpha channel state of a window.
1408 * @param obj The window object
1409 * @param alpha If true, the window has an alpha channel
1414 elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
1417 ELM_CHECK_WIDTYPE(obj, widtype);
1418 win = elm_widget_data_get(obj);
1420 #ifdef HAVE_ELEMENTARY_X
1425 if (!_elm_config->compositing)
1426 elm_win_shaped_set(obj, alpha);
1428 ecore_evas_alpha_set(win->ee, alpha);
1431 ecore_evas_alpha_set(win->ee, alpha);
1432 _elm_win_xwin_update(win);
1436 ecore_evas_alpha_set(win->ee, alpha);
1440 * Get the alpha channel state of a window.
1442 * @param obj The window object
1443 * @return If true, the window has an alpha channel
1448 elm_win_alpha_get(const Evas_Object *obj)
1451 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1452 win = elm_widget_data_get(obj);
1453 if (!win) return EINA_FALSE;
1454 return ecore_evas_alpha_get(win->ee);
1458 * Set the transparency state of a window.
1460 * @param obj The window object
1461 * @param transparent If true, the window is transparent
1466 elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
1469 ELM_CHECK_WIDTYPE(obj, widtype);
1470 win = elm_widget_data_get(obj);
1473 #ifdef HAVE_ELEMENTARY_X
1476 ecore_evas_transparent_set(win->ee, transparent);
1477 _elm_win_xwin_update(win);
1481 ecore_evas_transparent_set(win->ee, transparent);
1485 * Get the transparency state of a window.
1487 * @param obj The window object
1488 * @return If true, the window is transparent
1493 elm_win_transparent_get(const Evas_Object *obj)
1496 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1497 win = elm_widget_data_get(obj);
1498 if (!win) return EINA_FALSE;
1500 return ecore_evas_transparent_get(win->ee);
1504 * Set the override state of a window.
1506 * @param obj The window object
1507 * @param override If true, the window is overridden
1512 elm_win_override_set(Evas_Object *obj, Eina_Bool override)
1515 ELM_CHECK_WIDTYPE(obj, widtype);
1516 win = elm_widget_data_get(obj);
1518 ecore_evas_override_set(win->ee, override);
1519 #ifdef HAVE_ELEMENTARY_X
1520 _elm_win_xwin_update(win);
1525 * Get the override state of a window.
1527 * @param obj The window object
1528 * @return If true, the window is overridden
1533 elm_win_override_get(const Evas_Object *obj)
1536 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1537 win = elm_widget_data_get(obj);
1538 if (!win) return EINA_FALSE;
1539 return ecore_evas_override_get(win->ee);
1543 * Set the fullscreen state of a window.
1545 * @param obj The window object
1546 * @param fullscreen If true, the window is fullscreen
1551 elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
1554 ELM_CHECK_WIDTYPE(obj, widtype);
1555 win = elm_widget_data_get(obj);
1558 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1559 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
1560 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1562 // these engines... can ONLY be fullscreen
1567 ecore_evas_fullscreen_set(win->ee, fullscreen);
1568 #ifdef HAVE_ELEMENTARY_X
1569 _elm_win_xwin_update(win);
1572 #undef ENGINE_COMPARE
1576 * Get the fullscreen state of a window.
1578 * @param obj The window object
1579 * @return If true, the window is fullscreen
1584 elm_win_fullscreen_get(const Evas_Object *obj)
1587 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1588 win = elm_widget_data_get(obj);
1589 if (!win) return EINA_FALSE;
1591 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1592 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
1593 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1595 // these engines... can ONLY be fullscreen
1600 return ecore_evas_fullscreen_get(win->ee);
1602 #undef ENGINE_COMPARE
1606 * Set the maximized state of a window.
1608 * @param obj The window object
1609 * @param maximized If true, the window is maximized
1614 elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized)
1617 ELM_CHECK_WIDTYPE(obj, widtype);
1618 win = elm_widget_data_get(obj);
1620 ecore_evas_maximized_set(win->ee, maximized);
1621 #ifdef HAVE_ELEMENTARY_X
1622 _elm_win_xwin_update(win);
1627 * Get the maximized state of a window.
1629 * @param obj The window object
1630 * @return If true, the window is maximized
1635 elm_win_maximized_get(const Evas_Object *obj)
1638 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1639 win = elm_widget_data_get(obj);
1640 if (!win) return EINA_FALSE;
1641 return ecore_evas_maximized_get(win->ee);
1645 * Set the iconified state of a window.
1647 * @param obj The window object
1648 * @param iconified If true, the window is iconified
1653 elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified)
1656 ELM_CHECK_WIDTYPE(obj, widtype);
1657 win = elm_widget_data_get(obj);
1659 ecore_evas_iconified_set(win->ee, iconified);
1660 #ifdef HAVE_ELEMENTARY_X
1661 _elm_win_xwin_update(win);
1666 * Get the iconified state of a window.
1668 * @param obj The window object
1669 * @return If true, the window is iconified
1674 elm_win_iconified_get(const Evas_Object *obj)
1677 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1678 win = elm_widget_data_get(obj);
1679 if (!win) return EINA_FALSE;
1680 return ecore_evas_iconified_get(win->ee);
1684 * Set the layer of the window.
1686 * @param obj The window object
1687 * @param layer The layer of the window
1692 elm_win_layer_set(Evas_Object *obj, int layer)
1695 ELM_CHECK_WIDTYPE(obj, widtype);
1696 win = elm_widget_data_get(obj);
1698 ecore_evas_layer_set(win->ee, layer);
1699 #ifdef HAVE_ELEMENTARY_X
1700 _elm_win_xwin_update(win);
1705 * Get the layer of the window.
1707 * @param obj The window object
1708 * @return The layer of the window
1713 elm_win_layer_get(const Evas_Object *obj)
1716 ELM_CHECK_WIDTYPE(obj, widtype) -1;
1717 win = elm_widget_data_get(obj);
1718 if (!win) return -1;
1719 return ecore_evas_layer_get(win->ee);
1723 * Set the rotation of the window.
1725 * @param obj The window object
1726 * @param rotation The rotation of the window, in degrees (0-360)
1731 elm_win_rotation_set(Evas_Object *obj, int rotation)
1734 ELM_CHECK_WIDTYPE(obj, widtype);
1735 win = elm_widget_data_get(obj);
1737 if (win->rot == rotation) return;
1738 win->rot = rotation;
1739 ecore_evas_rotation_set(win->ee, rotation);
1740 evas_object_size_hint_min_set(obj, -1, -1);
1741 evas_object_size_hint_max_set(obj, -1, -1);
1742 _elm_win_eval_subobjs(obj);
1743 #ifdef HAVE_ELEMENTARY_X
1744 _elm_win_xwin_update(win);
1749 * Rotates the window and resizes it
1751 * @param obj The window object
1752 * @param layer The rotation of the window in degrees (0-360)
1757 elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
1760 ELM_CHECK_WIDTYPE(obj, widtype);
1761 win = elm_widget_data_get(obj);
1763 if (win->rot == rotation) return;
1764 win->rot = rotation;
1765 ecore_evas_rotation_with_resize_set(win->ee, rotation);
1766 evas_object_size_hint_min_set(obj, -1, -1);
1767 evas_object_size_hint_max_set(obj, -1, -1);
1768 _elm_win_eval_subobjs(obj);
1769 #ifdef HAVE_ELEMENTARY_X
1770 _elm_win_xwin_update(win);
1775 * Get the rotation of the window.
1777 * @param obj The window object
1778 * @return The rotation of the window in degrees (0-360)
1783 elm_win_rotation_get(const Evas_Object *obj)
1786 ELM_CHECK_WIDTYPE(obj, widtype) -1;
1787 win = elm_widget_data_get(obj);
1788 if (!win) return -1;
1793 * Set the sticky state of the window.
1795 * @param obj The window object
1796 * @param sticky If true, the window's sticky state is enabled
1801 elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky)
1804 ELM_CHECK_WIDTYPE(obj, widtype);
1805 win = elm_widget_data_get(obj);
1807 ecore_evas_sticky_set(win->ee, sticky);
1808 #ifdef HAVE_ELEMENTARY_X
1809 _elm_win_xwin_update(win);
1814 * Get the sticky state of the window.
1816 * @param obj The window object
1817 * @return If true, the window's sticky state is enabled
1822 elm_win_sticky_get(const Evas_Object *obj)
1825 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1826 win = elm_widget_data_get(obj);
1827 if (!win) return EINA_FALSE;
1828 return ecore_evas_sticky_get(win->ee);
1832 * Sets the keyboard mode of the window.
1834 * @param obj The window object
1835 * @param mode The mode to set; one of:
1836 * ELM_WIN_KEYBOARD_UNKNOWN
1837 * ELM_WIN_KEYBOARD_OFF
1838 * ELM_WIN_KEYBOARD_ON
1839 * ELM_WIN_KEYBOARD_ALPHA
1840 * ELM_WIN_KEYBOARD_NUMERIC
1841 * ELM_WIN_KEYBOARD_PIN
1842 * ELM_WIN_KEYBOARD_PHONE_NUMBER
1843 * ELM_WIN_KEYBOARD_HEX
1844 * ELM_WIN_KEYBOARD_TERMINAL
1845 * ELM_WIN_KEYBOARD_PASSWORD
1846 * ELM_WIN_KEYBOARD_IP
1847 * ELM_WIN_KEYBOARD_HOST
1848 * ELM_WIN_KEYBOARD_FILE
1849 * ELM_WIN_KEYBOARD_URL
1850 * ELM_WIN_KEYBOARD_KEYPAD
1851 * ELM_WIN_KEYBOARD_J2ME
1856 elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
1859 ELM_CHECK_WIDTYPE(obj, widtype);
1860 win = elm_widget_data_get(obj);
1862 if (mode == win->kbdmode) return;
1863 #ifdef HAVE_ELEMENTARY_X
1864 _elm_win_xwindow_get(win);
1866 win->kbdmode = mode;
1867 #ifdef HAVE_ELEMENTARY_X
1869 ecore_x_e_virtual_keyboard_state_set
1870 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
1875 * Gets the keyboard mode of the window.
1877 * @param obj The window object
1878 * @return The mode; one of:
1879 * ELM_WIN_KEYBOARD_UNKNOWN
1880 * ELM_WIN_KEYBOARD_OFF
1881 * ELM_WIN_KEYBOARD_ON
1882 * ELM_WIN_KEYBOARD_ALPHA
1883 * ELM_WIN_KEYBOARD_NUMERIC
1884 * ELM_WIN_KEYBOARD_PIN
1885 * ELM_WIN_KEYBOARD_PHONE_NUMBER
1886 * ELM_WIN_KEYBOARD_HEX
1887 * ELM_WIN_KEYBOARD_TERMINAL
1888 * ELM_WIN_KEYBOARD_PASSWORD
1889 * ELM_WIN_KEYBOARD_IP
1890 * ELM_WIN_KEYBOARD_HOST
1891 * ELM_WIN_KEYBOARD_FILE
1892 * ELM_WIN_KEYBOARD_URL
1893 * ELM_WIN_KEYBOARD_KEYPAD
1894 * ELM_WIN_KEYBOARD_J2ME
1898 EAPI Elm_Win_Keyboard_Mode
1899 elm_win_keyboard_mode_get(const Evas_Object *obj)
1902 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_KEYBOARD_UNKNOWN;
1903 win = elm_widget_data_get(obj);
1904 if (!win) return ELM_WIN_KEYBOARD_UNKNOWN;
1905 return win->kbdmode;
1909 * Sets whether the window is a keyboard.
1911 * @param obj The window object
1912 * @param is_keyboard If true, the window is a virtual keyboard
1917 elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
1920 ELM_CHECK_WIDTYPE(obj, widtype);
1921 win = elm_widget_data_get(obj);
1923 #ifdef HAVE_ELEMENTARY_X
1924 _elm_win_xwindow_get(win);
1926 ecore_x_e_virtual_keyboard_set(win->xwin, is_keyboard);
1931 * Gets whether the window is a keyboard.
1933 * @param obj The window object
1934 * @return If the window is a virtual keyboard
1939 elm_win_keyboard_win_get(const Evas_Object *obj)
1942 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1943 win = elm_widget_data_get(obj);
1944 if (!win) return EINA_FALSE;
1945 #ifdef HAVE_ELEMENTARY_X
1946 _elm_win_xwindow_get(win);
1948 return ecore_x_e_virtual_keyboard_get(win->xwin);
1954 * Get the screen position of a window.
1956 * @param obj The window object
1957 * @param x The int to store the x coordinate to
1958 * @param y The int to store the y coordinate to
1963 elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
1966 ELM_CHECK_WIDTYPE(obj, widtype);
1967 win = elm_widget_data_get(obj);
1969 if (x) *x = win->screen.x;
1970 if (y) *y = win->screen.y;
1974 * Set if this window is an illume conformant window
1976 * @param obj The window object
1977 * @param conformant The conformant flag (1 = conformant, 0 = non-conformant)
1982 elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
1985 ELM_CHECK_WIDTYPE(obj, widtype);
1986 win = elm_widget_data_get(obj);
1988 #ifdef HAVE_ELEMENTARY_X
1989 _elm_win_xwindow_get(win);
1991 ecore_x_e_illume_conformant_set(win->xwin, conformant);
1996 * Get if this window is an illume conformant window
1998 * @param obj The window object
1999 * @return A boolean if this window is illume conformant or not
2004 elm_win_conformant_get(const Evas_Object *obj)
2007 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2008 win = elm_widget_data_get(obj);
2009 if (!win) return EINA_FALSE;
2010 #ifdef HAVE_ELEMENTARY_X
2011 _elm_win_xwindow_get(win);
2013 return ecore_x_e_illume_conformant_get(win->xwin);
2019 * Set a window to be an illume quickpanel window
2021 * By default window objects are not quickpanel windows.
2023 * @param obj The window object
2024 * @param quickpanel The quickpanel flag (1 = quickpanel, 0 = normal window)
2029 elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel)
2032 ELM_CHECK_WIDTYPE(obj, widtype);
2033 win = elm_widget_data_get(obj);
2035 #ifdef HAVE_ELEMENTARY_X
2036 _elm_win_xwindow_get(win);
2039 ecore_x_e_illume_quickpanel_set(win->xwin, quickpanel);
2042 Ecore_X_Window_State states[2];
2044 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
2045 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
2046 ecore_x_netwm_window_state_set(win->xwin, states, 2);
2047 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
2054 * Get if this window is a quickpanel or not
2056 * @param obj The window object
2057 * @return A boolean if this window is a quickpanel or not
2062 elm_win_quickpanel_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 #ifdef HAVE_ELEMENTARY_X
2069 _elm_win_xwindow_get(win);
2071 return ecore_x_e_illume_quickpanel_get(win->xwin);
2077 * Set the major priority of a quickpanel window
2079 * @param obj The window object
2080 * @param priority The major priority for this quickpanel
2085 elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority)
2088 ELM_CHECK_WIDTYPE(obj, widtype);
2089 win = elm_widget_data_get(obj);
2091 #ifdef HAVE_ELEMENTARY_X
2092 _elm_win_xwindow_get(win);
2094 ecore_x_e_illume_quickpanel_priority_major_set(win->xwin, priority);
2099 * Get the major priority of a quickpanel window
2101 * @param obj The window object
2102 * @return The major priority of this quickpanel
2107 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
2110 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2111 win = elm_widget_data_get(obj);
2112 if (!win) return -1;
2113 #ifdef HAVE_ELEMENTARY_X
2114 _elm_win_xwindow_get(win);
2116 return ecore_x_e_illume_quickpanel_priority_major_get(win->xwin);
2122 * Set the minor priority of a quickpanel window
2124 * @param obj The window object
2125 * @param priority The minor priority for this quickpanel
2130 elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority)
2133 ELM_CHECK_WIDTYPE(obj, widtype);
2134 win = elm_widget_data_get(obj);
2136 #ifdef HAVE_ELEMENTARY_X
2137 _elm_win_xwindow_get(win);
2139 ecore_x_e_illume_quickpanel_priority_minor_set(win->xwin, priority);
2144 * Get the minor priority of a quickpanel window
2146 * @param obj The window object
2147 * @return The minor priority of this quickpanel
2152 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
2155 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2156 win = elm_widget_data_get(obj);
2157 if (!win) return -1;
2158 #ifdef HAVE_ELEMENTARY_X
2159 _elm_win_xwindow_get(win);
2161 return ecore_x_e_illume_quickpanel_priority_minor_get(win->xwin);
2167 * Set which zone this quickpanel should appear in
2169 * @param obj The window object
2170 * @param zone The requested zone for this quickpanel
2175 elm_win_quickpanel_zone_set(Evas_Object *obj, int zone)
2178 ELM_CHECK_WIDTYPE(obj, widtype);
2179 win = elm_widget_data_get(obj);
2181 #ifdef HAVE_ELEMENTARY_X
2182 _elm_win_xwindow_get(win);
2184 ecore_x_e_illume_quickpanel_zone_set(win->xwin, zone);
2189 * Get which zone this quickpanel should appear in
2191 * @param obj The window object
2192 * @return The requested zone for this quickpanel
2197 elm_win_quickpanel_zone_get(const Evas_Object *obj)
2200 ELM_CHECK_WIDTYPE(obj, widtype) 0;
2201 win = elm_widget_data_get(obj);
2203 #ifdef HAVE_ELEMENTARY_X
2204 _elm_win_xwindow_get(win);
2206 return ecore_x_e_illume_quickpanel_zone_get(win->xwin);
2212 * Set the window to be skipped by keyboard focus
2214 * This sets the window to be skipped by normal keyboard input. This means
2215 * a window manager will be asked to not focus this window as well as omit
2216 * it from things like the taskbar, pager, "alt-tab" list etc. etc.
2218 * Call this and enable it on a window BEFORE you show it for the first time,
2219 * otherwise it may have no effect.
2221 * Use this for windows that have only output information or might only be
2222 * interacted with by the mouse or fingers, and never for typing input.
2223 * Be careful that this may have side-effects like making the window
2224 * non-accessible in some cases unless the window is specially handled. Use
2227 * @param obj The window object
2228 * @param skip The skip flag state (EINA_TRUE if it is to be skipped)
2233 elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
2236 ELM_CHECK_WIDTYPE(obj, widtype);
2237 win = elm_widget_data_get(obj);
2239 #ifdef HAVE_ELEMENTARY_X
2240 _elm_win_xwindow_get(win);
2245 Ecore_X_Window_State states[2];
2247 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
2248 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
2249 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
2250 ecore_x_netwm_window_state_set(win->xwin, states, 2);
2257 * Send a command to the windowing environment
2259 * This is intended to work in touchscreen or small screen device environments
2260 * where there is a more simplistic window management policy in place. This
2261 * uses the window object indicated to select which part of the environment
2262 * to control (the part that this window lives in), and provides a command
2263 * and an optional parameter structure (use NULL for this if not needed).
2265 * @param obj The window object that lives in the environment to control
2266 * @param command The command to send
2267 * @param params Optional parameters for the command
2272 elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *params __UNUSED__)
2275 ELM_CHECK_WIDTYPE(obj, widtype);
2276 win = elm_widget_data_get(obj);
2278 #ifdef HAVE_ELEMENTARY_X
2279 _elm_win_xwindow_get(win);
2284 case ELM_ILLUME_COMMAND_FOCUS_BACK:
2285 ecore_x_e_illume_focus_back_send(win->xwin);
2287 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
2288 ecore_x_e_illume_focus_forward_send(win->xwin);
2290 case ELM_ILLUME_COMMAND_FOCUS_HOME:
2291 ecore_x_e_illume_focus_home_send(win->xwin);
2293 case ELM_ILLUME_COMMAND_CLOSE:
2294 ecore_x_e_illume_close_send(win->xwin);
2304 * Set the enabled status for the focus highlight in a window
2306 * This function will enable or disable the focus highlight only for the
2307 * given window, regardless of the global setting for it
2309 * @param obj The window where to enable the highlight
2310 * @param enabled The enabled value for the highlight
2315 elm_win_focus_highlight_enabled_set(Evas_Object *obj, Eina_Bool enabled)
2319 ELM_CHECK_WIDTYPE(obj, widtype);
2321 win = elm_widget_data_get(obj);
2322 enabled = !!enabled;
2323 if (win->focus_highlight.enabled == enabled)
2326 win->focus_highlight.enabled = enabled;
2328 if (win->focus_highlight.enabled)
2329 _elm_win_focus_highlight_init(win);
2331 _elm_win_focus_highlight_shutdown(win);
2335 * Get the enabled value of the focus highlight for this window
2337 * @param obj The window in which to check if the focus highlight is enabled
2339 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
2344 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
2348 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2350 win = elm_widget_data_get(obj);
2351 return win->focus_highlight.enabled;
2355 * Set the style for the focus highlight on this window
2357 * Sets the style to use for theming the highlight of focused objects on
2358 * the given window. If @p style is NULL, the default will be used.
2360 * @param obj The window where to set the style
2361 * @param style The style to set
2366 elm_win_focus_highlight_style_set(Evas_Object *obj, const char *style)
2370 ELM_CHECK_WIDTYPE(obj, widtype);
2372 win = elm_widget_data_get(obj);
2373 eina_stringshare_replace(&win->focus_highlight.style, style);
2374 win->focus_highlight.changed_theme = EINA_TRUE;
2375 _elm_win_focus_highlight_reconfigure_job_start(win);
2379 * Get the style set for the focus highlight object
2381 * Gets the style set for this windows highilght object, or NULL if none
2384 * @param obj The window to retrieve the highlights style from
2386 * @return The style set or NULL if none was. Default is used in that case.
2391 elm_win_focus_highlight_style_get(const Evas_Object *obj)
2395 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2397 win = elm_widget_data_get(obj);
2398 return win->focus_highlight.style;
2401 typedef struct _Widget_Data Widget_Data;
2406 Evas_Object *content;
2409 static void _del_hook(Evas_Object *obj);
2410 static void _theme_hook(Evas_Object *obj);
2411 static void _sizing_eval(Evas_Object *obj);
2412 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
2413 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
2415 static const char *widtype2 = NULL;
2418 _del_hook(Evas_Object *obj)
2420 Widget_Data *wd = elm_widget_data_get(obj);
2426 _theme_hook(Evas_Object *obj)
2428 Widget_Data *wd = elm_widget_data_get(obj);
2429 _elm_theme_object_set(obj, wd->frm, "win", "inwin", elm_widget_style_get(obj));
2431 edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content);
2436 _elm_inwin_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
2438 Widget_Data *wd = elm_widget_data_get(obj);
2443 /* Try Focus cycle in subitem */
2446 elm_widget_focus_next_get(wd->content, dir, next);
2451 *next = (Evas_Object *)obj;
2456 _sizing_eval(Evas_Object *obj)
2458 Widget_Data *wd = elm_widget_data_get(obj);
2459 Evas_Coord minw = -1, minh = -1;
2461 evas_object_size_hint_min_get(wd->content, &minw, &minh);
2462 edje_object_size_min_calc(wd->frm, &minw, &minh);
2463 evas_object_size_hint_min_set(obj, minw, minh);
2464 evas_object_size_hint_max_set(obj, -1, -1);
2468 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2474 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
2476 Widget_Data *wd = elm_widget_data_get(obj);
2477 Evas_Object *sub = event_info;
2478 if (sub == wd->content)
2480 evas_object_event_callback_del_full
2481 (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
2488 * @defgroup Inwin Inwin
2490 * An inwin is a window inside a window that is useful for a quick popup. It does not hover.
2493 elm_win_inwin_add(Evas_Object *obj)
2499 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2500 win = elm_widget_data_get(obj);
2501 if (!win) return NULL;
2502 wd = ELM_NEW(Widget_Data);
2503 obj2 = elm_widget_add(win->evas);
2504 elm_widget_type_set(obj2, "inwin");
2505 ELM_SET_WIDTYPE(widtype2, "inwin");
2506 elm_widget_sub_object_add(obj, obj2);
2507 evas_object_size_hint_weight_set(obj2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2508 evas_object_size_hint_align_set(obj2, EVAS_HINT_FILL, EVAS_HINT_FILL);
2509 elm_win_resize_object_add(obj, obj2);
2511 elm_widget_data_set(obj2, wd);
2512 elm_widget_del_hook_set(obj2, _del_hook);
2513 elm_widget_theme_hook_set(obj2, _theme_hook);
2514 elm_widget_focus_next_hook_set(obj2, _elm_inwin_focus_next_hook);
2515 elm_widget_can_focus_set(obj2, EINA_TRUE);
2516 elm_widget_highlight_ignore_set(obj2, EINA_TRUE);
2518 wd->frm = edje_object_add(win->evas);
2519 _elm_theme_object_set(obj, wd->frm, "win", "inwin", "default");
2520 elm_widget_resize_object_set(obj2, wd->frm);
2522 evas_object_smart_callback_add(obj2, "sub-object-del", _sub_del, obj2);
2529 * Activates an inwin object
2531 * @param obj The inwin to activate
2536 elm_win_inwin_activate(Evas_Object *obj)
2538 ELM_CHECK_WIDTYPE(obj, widtype2);
2539 Widget_Data *wd = elm_widget_data_get(obj);
2541 evas_object_raise(obj);
2542 evas_object_show(obj);
2543 edje_object_signal_emit(wd->frm, "elm,action,show", "elm");
2544 elm_object_focus(obj);
2548 * Set the content of an inwin object.
2550 * Once the content object is set, a previously set one will be deleted.
2551 * If you want to keep that old content object, use the
2552 * elm_win_inwin_content_unset() function.
2554 * @param obj The inwin object
2555 * @param content The object to set as content
2560 elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
2562 ELM_CHECK_WIDTYPE(obj, widtype2);
2563 Widget_Data *wd = elm_widget_data_get(obj);
2565 if (wd->content == content) return;
2566 if (wd->content) evas_object_del(wd->content);
2567 wd->content = content;
2570 elm_widget_sub_object_add(obj, content);
2571 evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2572 _changed_size_hints, obj);
2573 edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
2579 * Get the content of an inwin object.
2581 * Return the content object which is set for this widget.
2583 * @param obj The inwin object
2584 * @return The content that is being used
2589 elm_win_inwin_content_get(const Evas_Object *obj)
2591 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
2592 Widget_Data *wd = elm_widget_data_get(obj);
2593 if (!wd) return NULL;
2598 * Unset the content of an inwin object.
2600 * Unparent and return the content object which was set for this widget.
2602 * @param obj The inwin object
2603 * @return The content that was being used
2608 elm_win_inwin_content_unset(Evas_Object *obj)
2610 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
2611 Widget_Data *wd = elm_widget_data_get(obj);
2612 if (!wd) return NULL;
2613 if (!wd->content) return NULL;
2614 Evas_Object *content = wd->content;
2615 elm_widget_sub_object_del(obj, wd->content);
2616 edje_object_part_unswallow(wd->frm, wd->content);
2621 /* windowing spcific calls - shall we do this differently? */
2623 * Get the Ecore_X_Window of an Evas_Object
2625 * @param obj The object
2627 * @return The Ecore_X_Window of @p obj
2632 elm_win_xwindow_get(const Evas_Object *obj)
2634 Ecore_X_Window xwin = 0;
2635 Ecore_Evas *ee = NULL;
2637 #ifdef HAVE_ELEMENTARY_X
2638 ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
2639 if (ee) xwin = (Ecore_X_Window)ecore_evas_window_get(ee);