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);
416 ecore_x_e_virtual_keyboard_state_set
417 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
422 _elm_win_eval_subobjs(Evas_Object *obj)
425 const Evas_Object *child;
427 Elm_Win *win = elm_widget_data_get(obj);
428 Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
432 EINA_LIST_FOREACH(win->subobjs, l, child)
434 evas_object_size_hint_weight_get(child, &wx, &wy);
435 if (wx == 0.0) xx = 0;
436 if (wy == 0.0) xy = 0;
438 evas_object_size_hint_min_get(child, &w, &h);
441 if (w > minw) minw = w;
442 if (h > minh) minh = h;
444 evas_object_size_hint_max_get(child, &w, &h);
447 if (maxw == -1) maxw = w;
448 else if ((w > 0) && (w < maxw)) maxw = w;
449 if (maxh == -1) maxh = h;
450 else if ((h > 0) && (h < maxh)) maxh = h;
452 if (!xx) maxw = minw;
454 if (!xy) maxh = minh;
456 evas_object_size_hint_min_set(obj, minw, minh);
457 evas_object_size_hint_max_set(obj, maxw, maxh);
458 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
459 if (w < minw) w = minw;
460 if (h < minh) h = minh;
461 if ((maxw >= 0) && (w > maxw)) w = maxw;
462 if ((maxh >= 0) && (h > maxh)) h = maxh;
463 evas_object_resize(obj, w, h);
467 _elm_win_subobj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
469 Elm_Win *win = elm_widget_data_get(data);
470 win->subobjs = eina_list_remove(win->subobjs, obj);
471 _elm_win_eval_subobjs(win->win_obj);
475 _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
477 _elm_win_eval_subobjs(data);
481 _elm_win_shutdown(void)
483 while (_elm_win_list)
484 evas_object_del(_elm_win_list->data);
488 _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme)
495 EINA_LIST_FOREACH(_elm_win_list, l, obj)
496 elm_widget_theme(obj);
500 EINA_LIST_FOREACH(_elm_win_list, l, obj)
501 elm_widget_theme_specific(obj, th, EINA_FALSE);
505 #ifdef HAVE_ELEMENTARY_X
507 _elm_win_client_message(void *data, int type __UNUSED__, void *event)
510 Ecore_X_Event_Client_Message *e = event;
512 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
513 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
515 if ((unsigned)e->data.l[0] == win->xwin)
517 Evas *evas = evas_object_evas_get(win->win_obj);
520 edje_file_cache_flush();
521 edje_collection_cache_flush();
522 evas_image_cache_flush(evas);
523 evas_font_cache_flush(evas);
527 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
529 if ((unsigned)e->data.l[0] == win->xwin)
531 Evas *evas = evas_object_evas_get(win->win_obj);
534 edje_file_cache_flush();
535 edje_collection_cache_flush();
536 evas_image_cache_flush(evas);
537 evas_font_cache_flush(evas);
538 evas_render_dump(evas);
542 return ECORE_CALLBACK_PASS_ON;
547 _elm_win_focus_target_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
551 win->focus_highlight.geometry_changed = EINA_TRUE;
552 _elm_win_focus_highlight_reconfigure_job_start(win);
556 _elm_win_focus_target_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
560 win->focus_highlight.geometry_changed = EINA_TRUE;
561 _elm_win_focus_highlight_reconfigure_job_start(win);
565 _elm_win_focus_target_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
569 win->focus_highlight.cur.target = NULL;
571 _elm_win_focus_highlight_reconfigure_job_start(win);
575 _elm_win_focus_target_callbacks_add(Elm_Win *win)
577 Evas_Object *obj = win->focus_highlight.cur.target;
579 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
580 _elm_win_focus_target_move, win);
581 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
582 _elm_win_focus_target_resize, win);
583 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
584 _elm_win_focus_target_del, win);
588 _elm_win_focus_target_callbacks_del(Elm_Win *win)
590 Evas_Object *obj = win->focus_highlight.cur.target;
592 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
593 _elm_win_focus_target_move, win);
594 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
595 _elm_win_focus_target_resize, win);
596 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
597 _elm_win_focus_target_del, win);
601 _elm_win_focus_target_get(Evas_Object *obj)
603 Evas_Object *o = obj;
607 if (elm_widget_is(o))
609 if (!elm_widget_highlight_ignore_get(o))
611 o = elm_widget_parent_get(o);
613 o = evas_object_smart_parent_get(o);
617 o = elm_widget_parent_widget_get(o);
619 o = evas_object_smart_parent_get(o);
628 _elm_win_object_focus_in(void *data, Evas *e __UNUSED__, void *event_info)
630 Evas_Object *obj = event_info, *target;
633 if (win->focus_highlight.cur.target == obj)
636 target = _elm_win_focus_target_get(obj);
637 win->focus_highlight.cur.target = target;
638 if (elm_widget_highlight_in_theme_get(target))
639 win->focus_highlight.cur.handled = EINA_TRUE;
641 _elm_win_focus_target_callbacks_add(win);
643 _elm_win_focus_highlight_reconfigure_job_start(win);
647 _elm_win_object_focus_out(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
651 if (!win->focus_highlight.cur.target)
654 if (!win->focus_highlight.cur.handled)
655 _elm_win_focus_target_callbacks_del(win);
656 win->focus_highlight.cur.target = NULL;
657 win->focus_highlight.cur.handled = EINA_FALSE;
659 _elm_win_focus_highlight_reconfigure_job_start(win);
663 _elm_win_focus_highlight_hide(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
665 evas_object_hide(obj);
669 _elm_win_focus_highlight_init(Elm_Win *win)
671 evas_event_callback_add(win->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
672 _elm_win_object_focus_in, win);
673 evas_event_callback_add(win->evas,
674 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
675 _elm_win_object_focus_out, win);
677 win->focus_highlight.cur.target = evas_focus_get(win->evas);
679 win->focus_highlight.top = edje_object_add(win->evas);
680 win->focus_highlight.changed_theme = EINA_TRUE;
681 edje_object_signal_callback_add(win->focus_highlight.top,
682 "elm,action,focus,hide,end", "",
683 _elm_win_focus_highlight_hide, NULL);
684 edje_object_signal_callback_add(win->focus_highlight.top,
685 "elm,action,focus,anim,end", "",
686 _elm_win_focus_highlight_anim_end, win);
687 _elm_win_focus_highlight_reconfigure_job_start(win);
691 _elm_win_focus_highlight_shutdown(Elm_Win *win)
693 _elm_win_focus_highlight_reconfigure_job_stop(win);
694 if (win->focus_highlight.cur.target)
696 _elm_win_focus_target_callbacks_del(win);
697 win->focus_highlight.cur.target = NULL;
699 if (win->focus_highlight.top)
701 evas_object_del(win->focus_highlight.top);
702 win->focus_highlight.top = NULL;
705 evas_event_callback_del_full(win->evas,
706 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
707 _elm_win_object_focus_in, win);
708 evas_event_callback_del_full(win->evas,
709 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
710 _elm_win_object_focus_out, win);
714 _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible)
718 top = win->focus_highlight.top;
723 evas_object_show(top);
724 edje_object_signal_emit(top, "elm,action,focus,show", "elm");
730 edje_object_signal_emit(top, "elm,action,focus,hide", "elm");
735 _elm_win_focus_highlight_reconfigure_job(void *data)
737 _elm_win_focus_highlight_reconfigure((Elm_Win *)data);
741 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win)
743 if (win->focus_highlight.reconf_job)
744 ecore_job_del(win->focus_highlight.reconf_job);
745 win->focus_highlight.reconf_job = ecore_job_add(
746 _elm_win_focus_highlight_reconfigure_job, win);
750 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win)
752 if (win->focus_highlight.reconf_job)
753 ecore_job_del(win->focus_highlight.reconf_job);
754 win->focus_highlight.reconf_job = NULL;
758 _elm_win_focus_highlight_simple_setup(Elm_Win *win, Evas_Object *obj)
760 Evas_Object *clip, *target = win->focus_highlight.cur.target;
761 Evas_Coord x, y, w, h;
763 clip = evas_object_clip_get(target);
764 evas_object_geometry_get(target, &x, &y, &w, &h);
766 evas_object_move(obj, x, y);
767 evas_object_resize(obj, w, h);
768 evas_object_clip_set(obj, clip);
772 _elm_win_focus_highlight_anim_setup(Elm_Win *win, Evas_Object *obj)
774 Evas_Coord tx, ty, tw, th;
775 Evas_Coord w, h, px, py, pw, ph;
776 Edje_Message_Int_Set *m;
777 Evas_Object *previous = win->focus_highlight.prev.target;
778 Evas_Object *target = win->focus_highlight.cur.target;
780 evas_object_geometry_get(win->win_obj, NULL, NULL, &w, &h);
781 evas_object_geometry_get(target, &tx, &ty, &tw, &th);
782 evas_object_geometry_get(previous, &px, &py, &pw, &ph);
783 evas_object_move(obj, 0, 0);
784 evas_object_resize(obj, tw, th);
785 evas_object_clip_unset(obj);
787 m = alloca(sizeof(*m) + (sizeof(int) * 8));
797 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
801 _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
804 _elm_win_focus_highlight_simple_setup(win, obj);
808 _elm_win_focus_highlight_reconfigure(Elm_Win *win)
810 Evas_Object *target = win->focus_highlight.cur.target;
811 Evas_Object *previous = win->focus_highlight.prev.target;
812 Evas_Object *top = win->focus_highlight.top;
813 Eina_Bool visible_changed;
814 Eina_Bool common_visible;
815 const char *sig = NULL;
817 _elm_win_focus_highlight_reconfigure_job_stop(win);
819 visible_changed = (win->focus_highlight.cur.visible !=
820 win->focus_highlight.prev.visible);
822 if ((target == previous) && (!visible_changed) &&
823 (!win->focus_highlight.geometry_changed))
826 if ((previous) && (win->focus_highlight.prev.handled))
827 elm_widget_signal_emit(previous, "elm,action,focus_highlight,hide", "elm");
830 common_visible = EINA_FALSE;
831 else if (win->focus_highlight.cur.handled)
833 common_visible = EINA_FALSE;
834 if (win->focus_highlight.cur.visible)
835 sig = "elm,action,focus_highlight,show";
837 sig = "elm,action,focus_highlight,hide";
840 common_visible = win->focus_highlight.cur.visible;
842 _elm_win_focus_highlight_visible_set(win, common_visible);
844 elm_widget_signal_emit(target, sig, "elm");
846 if ((!target) || (!common_visible) || (win->focus_highlight.cur.handled))
849 if (win->focus_highlight.changed_theme)
852 if (win->focus_highlight.style)
853 str = win->focus_highlight.style;
856 _elm_theme_object_set(win->win_obj, top, "focus_highlight", "top",
858 win->focus_highlight.changed_theme = EINA_FALSE;
860 if (_elm_config->focus_highlight_animate)
862 str = edje_object_data_get(win->focus_highlight.top, "animate");
863 win->focus_highlight.top_animate = ((str) && (!strcmp(str, "on")));
867 if ((win->focus_highlight.top_animate) && (previous) &&
868 (!win->focus_highlight.prev.handled))
869 _elm_win_focus_highlight_anim_setup(win, top);
871 _elm_win_focus_highlight_simple_setup(win, top);
872 evas_object_raise(top);
875 win->focus_highlight.geometry_changed = EINA_FALSE;
876 win->focus_highlight.prev = win->focus_highlight.cur;
881 _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
883 Evas_Event_Key_Down *ev = event_info;
885 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
889 if ((strcmp(ev->keyname, "F12")) ||
890 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
893 printf("Tree graph generated.\n");
894 elm_object_tree_dot_dump(obj, "./dump.dot");
899 * Adds a window object. If this is the first window created, pass NULL as
902 * @param parent Parent object to add the window to, or NULL
903 * @param name The name of the window
904 * @param type The window type, one of the following:
906 * ELM_WIN_DIALOG_BASIC
914 * @return The created object, or NULL on failure
919 elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
923 const char *fontpath;
925 win = ELM_NEW(Elm_Win);
927 #define FALLBACK_TRY(engine) \
930 CRITICAL(engine " engine creation failed. Trying software X11."); \
931 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
934 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
935 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
937 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
938 #ifdef HAVE_ELEMENTARY_X
939 win->client_message_handler = ecore_event_handler_add
940 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
943 else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
945 win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
946 FALLBACK_TRY("Sofware FB");
948 else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
950 win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
951 FALLBACK_TRY("Sofware DirectFB");
953 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
955 win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
956 FALLBACK_TRY("Sofware-16");
957 #ifdef HAVE_ELEMENTARY_X
958 win->client_message_handler = ecore_event_handler_add
959 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
962 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
964 win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
965 FALLBACK_TRY("Sofware-8");
966 #ifdef HAVE_ELEMENTARY_X
967 win->client_message_handler = ecore_event_handler_add
968 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
971 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
973 win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
974 FALLBACK_TRY("XRender");
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_OPENGL_X11))
982 win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
983 FALLBACK_TRY("OpenGL");
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_SOFTWARE_WIN32))
991 win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
992 FALLBACK_TRY("Sofware Win32");
994 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
996 win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
997 FALLBACK_TRY("Sofware-16-WinCE");
999 else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
1001 win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
1002 FALLBACK_TRY("Sofware SDL");
1004 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
1006 win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
1007 FALLBACK_TRY("Sofware-16-SDL");
1009 else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
1011 win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
1012 FALLBACK_TRY("OpenGL SDL");
1018 ERR("Cannot create window.");
1022 #ifdef HAVE_ELEMENTARY_X
1023 _elm_win_xwindow_get(win);
1025 if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
1026 ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
1027 // bg pixmap done by x - has other issues like can be redrawn by x before it
1028 // is filled/ready by app
1029 // ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
1032 win->parent = parent;
1034 evas_object_event_callback_add(win->parent, EVAS_CALLBACK_DEL,
1035 _elm_win_obj_callback_parent_del, win);
1037 win->evas = ecore_evas_get(win->ee);
1038 win->win_obj = elm_widget_add(win->evas);
1039 elm_widget_type_set(win->win_obj, "win");
1040 ELM_SET_WIDTYPE(widtype, "win");
1041 elm_widget_data_set(win->win_obj, win);
1042 elm_widget_event_hook_set(win->win_obj, _elm_win_event_cb);
1043 elm_widget_on_focus_hook_set(win->win_obj, _elm_win_on_focus_hook, NULL);
1044 elm_widget_can_focus_set(win->win_obj, EINA_TRUE);
1045 elm_widget_highlight_ignore_set(win->win_obj, EINA_TRUE);
1046 elm_widget_focus_next_hook_set(win->win_obj, _elm_win_focus_next_hook);
1047 evas_object_color_set(win->win_obj, 0, 0, 0, 0);
1048 evas_object_move(win->win_obj, 0, 0);
1049 evas_object_resize(win->win_obj, 1, 1);
1050 evas_object_layer_set(win->win_obj, 50);
1051 evas_object_pass_events_set(win->win_obj, EINA_TRUE);
1053 evas_object_intercept_show_callback_add(win->win_obj,
1054 _elm_win_obj_intercept_show, win);
1055 ecore_evas_object_associate(win->ee, win->win_obj,
1056 ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
1057 ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
1058 ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
1059 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
1060 _elm_win_obj_callback_show, win);
1061 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
1062 _elm_win_obj_callback_del, win);
1064 ecore_evas_name_class_set(win->ee, name, _elm_appname);
1065 ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
1066 ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
1067 ecore_evas_callback_focus_in_set(win->ee, _elm_win_focus_in);
1068 ecore_evas_callback_focus_out_set(win->ee, _elm_win_focus_out);
1069 ecore_evas_callback_move_set(win->ee, _elm_win_move);
1070 evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024));
1071 evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
1072 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
1073 evas_font_path_append(win->evas, fontpath);
1074 if (!_elm_config->font_hinting)
1075 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
1076 else if (_elm_config->font_hinting == 1)
1077 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_AUTO);
1078 else if (_elm_config->font_hinting == 2)
1079 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_BYTECODE);
1081 #ifdef HAVE_ELEMENTARY_X
1082 _elm_win_xwin_update(win);
1085 _elm_win_list = eina_list_append(_elm_win_list, win->win_obj);
1087 if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
1089 ecore_evas_fullscreen_set(win->ee, 1);
1091 #undef ENGINE_COMPARE
1093 if (_elm_config->focus_highlight_enable)
1094 elm_win_focus_highlight_enabled_set(win->win_obj, EINA_TRUE);
1097 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(win->evas, "Control");
1098 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_KEY_DOWN,
1099 _debug_key_down, win);
1100 Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0, EINA_TRUE);
1101 printf("Key F12 exclusive for dot tree generation. (%d)\n", ret);
1103 return win->win_obj;
1107 * Add @p subobj as a resize object of window @p obj.
1109 * @param obj The window object
1110 * @param subobj The resize object to add
1115 elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
1119 ELM_CHECK_WIDTYPE(obj, widtype);
1120 win = elm_widget_data_get(obj);
1122 win->subobjs = eina_list_append(win->subobjs, subobj);
1123 elm_widget_sub_object_add(obj, subobj);
1124 evas_object_event_callback_add(subobj, EVAS_CALLBACK_DEL,
1125 _elm_win_subobj_callback_del, obj);
1126 evas_object_event_callback_add(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1127 _elm_win_subobj_callback_changed_size_hints,
1129 ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
1130 evas_object_move(subobj, 0, 0);
1131 evas_object_resize(subobj, w, h);
1132 _elm_win_eval_subobjs(obj);
1136 * Delete @p subobj as a resize object of window @p obj.
1138 * @param obj The window object
1139 * @param subobj The resize object to add
1144 elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
1147 ELM_CHECK_WIDTYPE(obj, widtype);
1148 win = elm_widget_data_get(obj);
1150 evas_object_event_callback_del_full(subobj,
1151 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1152 _elm_win_subobj_callback_changed_size_hints,
1154 evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL,
1155 _elm_win_subobj_callback_del, obj);
1156 win->subobjs = eina_list_remove(win->subobjs, subobj);
1157 elm_widget_sub_object_del(obj, subobj);
1158 _elm_win_eval_subobjs(obj);
1162 * Set the title of the window
1164 * @param obj The window object
1165 * @param title The title to set
1170 elm_win_title_set(Evas_Object *obj, const char *title)
1173 ELM_CHECK_WIDTYPE(obj, widtype);
1174 win = elm_widget_data_get(obj);
1176 ecore_evas_title_set(win->ee, title);
1180 * Get the title of the window
1182 * @param obj The window object
1188 elm_win_title_get(const Evas_Object *obj)
1191 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1192 win = elm_widget_data_get(obj);
1193 if (!win) return NULL;
1194 return ecore_evas_title_get(win->ee);
1198 * Set the window's autodel state.
1200 * @param obj The window object
1201 * @param autodel If true, the window will automatically delete itself when closed
1206 elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
1209 ELM_CHECK_WIDTYPE(obj, widtype);
1210 win = elm_widget_data_get(obj);
1212 win->autodel = autodel;
1216 * Get the window's autodel state.
1218 * @param obj The window object
1219 * @return If the window will automatically delete itself when closed
1224 elm_win_autodel_get(const Evas_Object *obj)
1227 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1228 win = elm_widget_data_get(obj);
1229 if (!win) return EINA_FALSE;
1230 return win->autodel;
1234 * Activate a window object.
1236 * @param obj The window object
1241 elm_win_activate(Evas_Object *obj)
1244 ELM_CHECK_WIDTYPE(obj, widtype);
1245 win = elm_widget_data_get(obj);
1247 ecore_evas_activate(win->ee);
1251 * Lower a window object.
1253 * @param obj The window object
1258 elm_win_lower(Evas_Object *obj)
1261 ELM_CHECK_WIDTYPE(obj, widtype);
1262 win = elm_widget_data_get(obj);
1264 ecore_evas_lower(win->ee);
1268 * Raise a window object.
1270 * @param obj The window object
1275 elm_win_raise(Evas_Object *obj)
1278 ELM_CHECK_WIDTYPE(obj, widtype);
1279 win = elm_widget_data_get(obj);
1281 ecore_evas_raise(win->ee);
1285 * Set the borderless state of a window.
1287 * @param obj The window object
1288 * @param borderless If true, the window is borderless
1293 elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless)
1296 ELM_CHECK_WIDTYPE(obj, widtype);
1297 win = elm_widget_data_get(obj);
1299 ecore_evas_borderless_set(win->ee, borderless);
1300 #ifdef HAVE_ELEMENTARY_X
1301 _elm_win_xwin_update(win);
1306 * Get the borderless state of a window.
1308 * @param obj The window object
1309 * @return If true, the window is borderless
1314 elm_win_borderless_get(const Evas_Object *obj)
1317 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1318 win = elm_widget_data_get(obj);
1319 if (!win) return EINA_FALSE;
1320 return ecore_evas_borderless_get(win->ee);
1324 * Set the shaped state of a window.
1326 * @param obj The window object
1327 * @param shaped If true, the window is shaped
1332 elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
1335 ELM_CHECK_WIDTYPE(obj, widtype);
1336 win = elm_widget_data_get(obj);
1338 ecore_evas_shaped_set(win->ee, shaped);
1339 #ifdef HAVE_ELEMENTARY_X
1340 _elm_win_xwin_update(win);
1345 * Get the shaped state of a window.
1347 * @param obj The window object
1348 * @return If true, the window is shaped
1353 elm_win_shaped_get(const Evas_Object *obj)
1356 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1357 win = elm_widget_data_get(obj);
1358 if (!win) return EINA_FALSE;
1359 return ecore_evas_shaped_get(win->ee);
1363 * Set the alpha channel state of a window.
1365 * @param obj The window object
1366 * @param alpha If true, the window has an alpha channel
1371 elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
1374 ELM_CHECK_WIDTYPE(obj, widtype);
1375 win = elm_widget_data_get(obj);
1377 #ifdef HAVE_ELEMENTARY_X
1382 if (!_elm_config->compositing)
1383 elm_win_shaped_set(obj, alpha);
1385 ecore_evas_alpha_set(win->ee, alpha);
1388 ecore_evas_alpha_set(win->ee, alpha);
1389 _elm_win_xwin_update(win);
1393 ecore_evas_alpha_set(win->ee, alpha);
1397 * Get the alpha channel state of a window.
1399 * @param obj The window object
1400 * @return If true, the window has an alpha channel
1405 elm_win_alpha_get(const Evas_Object *obj)
1408 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1409 win = elm_widget_data_get(obj);
1410 if (!win) return EINA_FALSE;
1411 return ecore_evas_alpha_get(win->ee);
1415 * Set the transparency state of a window.
1417 * @param obj The window object
1418 * @param transparent If true, the window is transparent
1423 elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
1426 ELM_CHECK_WIDTYPE(obj, widtype);
1427 win = elm_widget_data_get(obj);
1430 #ifdef HAVE_ELEMENTARY_X
1433 ecore_evas_transparent_set(win->ee, transparent);
1434 _elm_win_xwin_update(win);
1438 ecore_evas_transparent_set(win->ee, transparent);
1442 * Get the transparency state of a window.
1444 * @param obj The window object
1445 * @return If true, the window is transparent
1450 elm_win_transparent_get(const Evas_Object *obj)
1453 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1454 win = elm_widget_data_get(obj);
1455 if (!win) return EINA_FALSE;
1457 return ecore_evas_transparent_get(win->ee);
1461 * Set the override state of a window.
1463 * @param obj The window object
1464 * @param override If true, the window is overridden
1469 elm_win_override_set(Evas_Object *obj, Eina_Bool override)
1472 ELM_CHECK_WIDTYPE(obj, widtype);
1473 win = elm_widget_data_get(obj);
1475 ecore_evas_override_set(win->ee, override);
1476 #ifdef HAVE_ELEMENTARY_X
1477 _elm_win_xwin_update(win);
1482 * Get the override state of a window.
1484 * @param obj The window object
1485 * @return If true, the window is overridden
1490 elm_win_override_get(const Evas_Object *obj)
1493 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1494 win = elm_widget_data_get(obj);
1495 if (!win) return EINA_FALSE;
1496 return ecore_evas_override_get(win->ee);
1500 * Set the fullscreen state of a window.
1502 * @param obj The window object
1503 * @param fullscreen If true, the window is fullscreen
1508 elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
1511 ELM_CHECK_WIDTYPE(obj, widtype);
1512 win = elm_widget_data_get(obj);
1515 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1516 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
1517 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1519 // these engines... can ONLY be fullscreen
1524 ecore_evas_fullscreen_set(win->ee, fullscreen);
1525 #ifdef HAVE_ELEMENTARY_X
1526 _elm_win_xwin_update(win);
1529 #undef ENGINE_COMPARE
1533 * Get the fullscreen state of a window.
1535 * @param obj The window object
1536 * @return If true, the window is fullscreen
1541 elm_win_fullscreen_get(const Evas_Object *obj)
1544 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1545 win = elm_widget_data_get(obj);
1546 if (!win) return EINA_FALSE;
1548 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1549 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
1550 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1552 // these engines... can ONLY be fullscreen
1557 return ecore_evas_fullscreen_get(win->ee);
1559 #undef ENGINE_COMPARE
1563 * Set the maximized state of a window.
1565 * @param obj The window object
1566 * @param maximized If true, the window is maximized
1571 elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized)
1574 ELM_CHECK_WIDTYPE(obj, widtype);
1575 win = elm_widget_data_get(obj);
1577 ecore_evas_maximized_set(win->ee, maximized);
1578 #ifdef HAVE_ELEMENTARY_X
1579 _elm_win_xwin_update(win);
1584 * Get the maximized state of a window.
1586 * @param obj The window object
1587 * @return If true, the window is maximized
1592 elm_win_maximized_get(const Evas_Object *obj)
1595 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1596 win = elm_widget_data_get(obj);
1597 if (!win) return EINA_FALSE;
1598 return ecore_evas_maximized_get(win->ee);
1602 * Set the iconified state of a window.
1604 * @param obj The window object
1605 * @param iconified If true, the window is iconified
1610 elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified)
1613 ELM_CHECK_WIDTYPE(obj, widtype);
1614 win = elm_widget_data_get(obj);
1616 ecore_evas_iconified_set(win->ee, iconified);
1617 #ifdef HAVE_ELEMENTARY_X
1618 _elm_win_xwin_update(win);
1623 * Get the iconified state of a window.
1625 * @param obj The window object
1626 * @return If true, the window is iconified
1631 elm_win_iconified_get(const Evas_Object *obj)
1634 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1635 win = elm_widget_data_get(obj);
1636 if (!win) return EINA_FALSE;
1637 return ecore_evas_iconified_get(win->ee);
1641 * Set the layer of the window.
1643 * @param obj The window object
1644 * @param layer The layer of the window
1649 elm_win_layer_set(Evas_Object *obj, int layer)
1652 ELM_CHECK_WIDTYPE(obj, widtype);
1653 win = elm_widget_data_get(obj);
1655 ecore_evas_layer_set(win->ee, layer);
1656 #ifdef HAVE_ELEMENTARY_X
1657 _elm_win_xwin_update(win);
1662 * Get the layer of the window.
1664 * @param obj The window object
1665 * @return The layer of the window
1670 elm_win_layer_get(const Evas_Object *obj)
1673 ELM_CHECK_WIDTYPE(obj, widtype) -1;
1674 win = elm_widget_data_get(obj);
1675 if (!win) return -1;
1676 return ecore_evas_layer_get(win->ee);
1680 * Set the rotation of the window.
1682 * @param obj The window object
1683 * @param rotation The rotation of the window, in degrees (0-360)
1688 elm_win_rotation_set(Evas_Object *obj, int rotation)
1691 ELM_CHECK_WIDTYPE(obj, widtype);
1692 win = elm_widget_data_get(obj);
1694 if (win->rot == rotation) return;
1695 win->rot = rotation;
1696 ecore_evas_rotation_set(win->ee, rotation);
1697 evas_object_size_hint_min_set(obj, -1, -1);
1698 evas_object_size_hint_max_set(obj, -1, -1);
1699 _elm_win_eval_subobjs(obj);
1700 #ifdef HAVE_ELEMENTARY_X
1701 _elm_win_xwin_update(win);
1706 * Rotates the window and resizes it
1708 * @param obj The window object
1709 * @param layer The rotation of the window in degrees (0-360)
1714 elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
1717 ELM_CHECK_WIDTYPE(obj, widtype);
1718 win = elm_widget_data_get(obj);
1720 if (win->rot == rotation) return;
1721 win->rot = rotation;
1722 ecore_evas_rotation_with_resize_set(win->ee, rotation);
1723 evas_object_size_hint_min_set(obj, -1, -1);
1724 evas_object_size_hint_max_set(obj, -1, -1);
1725 _elm_win_eval_subobjs(obj);
1726 #ifdef HAVE_ELEMENTARY_X
1727 _elm_win_xwin_update(win);
1732 * Get the rotation of the window.
1734 * @param obj The window object
1735 * @return The rotation of the window in degrees (0-360)
1740 elm_win_rotation_get(const Evas_Object *obj)
1743 ELM_CHECK_WIDTYPE(obj, widtype) -1;
1744 win = elm_widget_data_get(obj);
1745 if (!win) return -1;
1750 * Set the sticky state of the window.
1752 * @param obj The window object
1753 * @param sticky If true, the window's sticky state is enabled
1758 elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky)
1761 ELM_CHECK_WIDTYPE(obj, widtype);
1762 win = elm_widget_data_get(obj);
1764 ecore_evas_sticky_set(win->ee, sticky);
1765 #ifdef HAVE_ELEMENTARY_X
1766 _elm_win_xwin_update(win);
1771 * Get the sticky state of the window.
1773 * @param obj The window object
1774 * @return If true, the window's sticky state is enabled
1779 elm_win_sticky_get(const Evas_Object *obj)
1782 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1783 win = elm_widget_data_get(obj);
1784 if (!win) return EINA_FALSE;
1785 return ecore_evas_sticky_get(win->ee);
1789 * Sets the keyboard mode of the window.
1791 * @param obj The window object
1792 * @param mode The mode to set; one of:
1793 * ELM_WIN_KEYBOARD_UNKNOWN
1794 * ELM_WIN_KEYBOARD_OFF
1795 * ELM_WIN_KEYBOARD_ON
1796 * ELM_WIN_KEYBOARD_ALPHA
1797 * ELM_WIN_KEYBOARD_NUMERIC
1798 * ELM_WIN_KEYBOARD_PIN
1799 * ELM_WIN_KEYBOARD_PHONE_NUMBER
1800 * ELM_WIN_KEYBOARD_HEX
1801 * ELM_WIN_KEYBOARD_TERMINAL
1802 * ELM_WIN_KEYBOARD_PASSWORD
1803 * ELM_WIN_KEYBOARD_IP
1804 * ELM_WIN_KEYBOARD_HOST
1805 * ELM_WIN_KEYBOARD_FILE
1806 * ELM_WIN_KEYBOARD_URL
1807 * ELM_WIN_KEYBOARD_KEYPAD
1808 * ELM_WIN_KEYBOARD_J2ME
1813 elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
1816 ELM_CHECK_WIDTYPE(obj, widtype);
1817 win = elm_widget_data_get(obj);
1819 if (mode == win->kbdmode) return;
1820 #ifdef HAVE_ELEMENTARY_X
1821 _elm_win_xwindow_get(win);
1823 win->kbdmode = mode;
1824 #ifdef HAVE_ELEMENTARY_X
1826 ecore_x_e_virtual_keyboard_state_set
1827 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
1832 * Gets the keyboard mode of the window.
1834 * @param obj The window object
1835 * @return The mode; 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
1855 EAPI Elm_Win_Keyboard_Mode
1856 elm_win_keyboard_mode_get(const Evas_Object *obj)
1859 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_KEYBOARD_UNKNOWN;
1860 win = elm_widget_data_get(obj);
1861 if (!win) return ELM_WIN_KEYBOARD_UNKNOWN;
1862 return win->kbdmode;
1866 * Sets whether the window is a keyboard.
1868 * @param obj The window object
1869 * @param is_keyboard If true, the window is a virtual keyboard
1874 elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
1877 ELM_CHECK_WIDTYPE(obj, widtype);
1878 win = elm_widget_data_get(obj);
1880 #ifdef HAVE_ELEMENTARY_X
1881 _elm_win_xwindow_get(win);
1883 ecore_x_e_virtual_keyboard_set(win->xwin, is_keyboard);
1888 * Gets whether the window is a keyboard.
1890 * @param obj The window object
1891 * @return If the window is a virtual keyboard
1896 elm_win_keyboard_win_get(const Evas_Object *obj)
1899 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1900 win = elm_widget_data_get(obj);
1901 if (!win) return EINA_FALSE;
1902 #ifdef HAVE_ELEMENTARY_X
1903 _elm_win_xwindow_get(win);
1905 return ecore_x_e_virtual_keyboard_get(win->xwin);
1911 * Get the screen position of a window.
1913 * @param obj The window object
1914 * @param x The int to store the x coordinate to
1915 * @param y The int to store the y coordinate to
1920 elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
1923 ELM_CHECK_WIDTYPE(obj, widtype);
1924 win = elm_widget_data_get(obj);
1926 if (x) *x = win->screen.x;
1927 if (y) *y = win->screen.y;
1931 * Set if this window is an illume conformant window
1933 * @param obj The window object
1934 * @param conformant The conformant flag (1 = conformant, 0 = non-conformant)
1939 elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
1942 ELM_CHECK_WIDTYPE(obj, widtype);
1943 win = elm_widget_data_get(obj);
1945 #ifdef HAVE_ELEMENTARY_X
1946 _elm_win_xwindow_get(win);
1948 ecore_x_e_illume_conformant_set(win->xwin, conformant);
1953 * Get if this window is an illume conformant window
1955 * @param obj The window object
1956 * @return A boolean if this window is illume conformant or not
1961 elm_win_conformant_get(const Evas_Object *obj)
1964 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1965 win = elm_widget_data_get(obj);
1966 if (!win) return EINA_FALSE;
1967 #ifdef HAVE_ELEMENTARY_X
1968 _elm_win_xwindow_get(win);
1970 return ecore_x_e_illume_conformant_get(win->xwin);
1976 * Set a window to be an illume quickpanel window
1978 * By default window objects are not quickpanel windows.
1980 * @param obj The window object
1981 * @param quickpanel The quickpanel flag (1 = quickpanel, 0 = normal window)
1986 elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel)
1989 ELM_CHECK_WIDTYPE(obj, widtype);
1990 win = elm_widget_data_get(obj);
1992 #ifdef HAVE_ELEMENTARY_X
1993 _elm_win_xwindow_get(win);
1996 ecore_x_e_illume_quickpanel_set(win->xwin, quickpanel);
1999 Ecore_X_Window_State states[2];
2001 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
2002 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
2003 ecore_x_netwm_window_state_set(win->xwin, states, 2);
2004 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
2011 * Get if this window is a quickpanel or not
2013 * @param obj The window object
2014 * @return A boolean if this window is a quickpanel or not
2019 elm_win_quickpanel_get(const Evas_Object *obj)
2022 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2023 win = elm_widget_data_get(obj);
2024 if (!win) return EINA_FALSE;
2025 #ifdef HAVE_ELEMENTARY_X
2026 _elm_win_xwindow_get(win);
2028 return ecore_x_e_illume_quickpanel_get(win->xwin);
2034 * Set the major priority of a quickpanel window
2036 * @param obj The window object
2037 * @param priority The major priority for this quickpanel
2042 elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority)
2045 ELM_CHECK_WIDTYPE(obj, widtype);
2046 win = elm_widget_data_get(obj);
2048 #ifdef HAVE_ELEMENTARY_X
2049 _elm_win_xwindow_get(win);
2051 ecore_x_e_illume_quickpanel_priority_major_set(win->xwin, priority);
2056 * Get the major priority of a quickpanel window
2058 * @param obj The window object
2059 * @return The major priority of this quickpanel
2064 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
2067 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2068 win = elm_widget_data_get(obj);
2069 if (!win) return -1;
2070 #ifdef HAVE_ELEMENTARY_X
2071 _elm_win_xwindow_get(win);
2073 return ecore_x_e_illume_quickpanel_priority_major_get(win->xwin);
2079 * Set the minor priority of a quickpanel window
2081 * @param obj The window object
2082 * @param priority The minor priority for this quickpanel
2087 elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority)
2090 ELM_CHECK_WIDTYPE(obj, widtype);
2091 win = elm_widget_data_get(obj);
2093 #ifdef HAVE_ELEMENTARY_X
2094 _elm_win_xwindow_get(win);
2096 ecore_x_e_illume_quickpanel_priority_minor_set(win->xwin, priority);
2101 * Get the minor priority of a quickpanel window
2103 * @param obj The window object
2104 * @return The minor priority of this quickpanel
2109 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
2112 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2113 win = elm_widget_data_get(obj);
2114 if (!win) return -1;
2115 #ifdef HAVE_ELEMENTARY_X
2116 _elm_win_xwindow_get(win);
2118 return ecore_x_e_illume_quickpanel_priority_minor_get(win->xwin);
2124 * Set which zone this quickpanel should appear in
2126 * @param obj The window object
2127 * @param zone The requested zone for this quickpanel
2132 elm_win_quickpanel_zone_set(Evas_Object *obj, int zone)
2135 ELM_CHECK_WIDTYPE(obj, widtype);
2136 win = elm_widget_data_get(obj);
2138 #ifdef HAVE_ELEMENTARY_X
2139 _elm_win_xwindow_get(win);
2141 ecore_x_e_illume_quickpanel_zone_set(win->xwin, zone);
2146 * Get which zone this quickpanel should appear in
2148 * @param obj The window object
2149 * @return The requested zone for this quickpanel
2154 elm_win_quickpanel_zone_get(const Evas_Object *obj)
2157 ELM_CHECK_WIDTYPE(obj, widtype) 0;
2158 win = elm_widget_data_get(obj);
2160 #ifdef HAVE_ELEMENTARY_X
2161 _elm_win_xwindow_get(win);
2163 return ecore_x_e_illume_quickpanel_zone_get(win->xwin);
2169 * Set the window to be skipped by keyboard focus
2171 * This sets the window to be skipped by normal keyboard input. This means
2172 * a window manager will be asked to not focus this window as well as omit
2173 * it from things like the taskbar, pager, "alt-tab" list etc. etc.
2175 * Call this and enable it on a window BEFORE you show it for the first time,
2176 * otherwise it may have no effect.
2178 * Use this for windows that have only output information or might only be
2179 * interacted with by the mouse or fingers, and never for typing input.
2180 * Be careful that this may have side-effects like making the window
2181 * non-accessible in some cases unless the window is specially handled. Use
2184 * @param obj The window object
2185 * @param skip The skip flag state (EINA_TRUE if it is to be skipped)
2190 elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
2193 ELM_CHECK_WIDTYPE(obj, widtype);
2194 win = elm_widget_data_get(obj);
2196 #ifdef HAVE_ELEMENTARY_X
2197 _elm_win_xwindow_get(win);
2202 Ecore_X_Window_State states[2];
2204 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
2205 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
2206 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
2207 ecore_x_netwm_window_state_set(win->xwin, states, 2);
2214 * Send a command to the windowing environment
2216 * This is intended to work in touchscreen or small screen device environments
2217 * where there is a more simplistic window management policy in place. This
2218 * uses the window object indicated to select which part of the environment
2219 * to control (the part that this window lives in), and provides a command
2220 * and an optional parameter structure (use NULL for this if not needed).
2222 * @param obj The window object that lives in the environment to control
2223 * @param command The command to send
2224 * @param params Optional parameters for the command
2229 elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *params __UNUSED__)
2232 ELM_CHECK_WIDTYPE(obj, widtype);
2233 win = elm_widget_data_get(obj);
2235 #ifdef HAVE_ELEMENTARY_X
2236 _elm_win_xwindow_get(win);
2241 case ELM_ILLUME_COMMAND_FOCUS_BACK:
2242 ecore_x_e_illume_focus_back_send(win->xwin);
2244 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
2245 ecore_x_e_illume_focus_forward_send(win->xwin);
2247 case ELM_ILLUME_COMMAND_FOCUS_HOME:
2248 ecore_x_e_illume_focus_home_send(win->xwin);
2250 case ELM_ILLUME_COMMAND_CLOSE:
2251 ecore_x_e_illume_close_send(win->xwin);
2261 * Set the enabled status for the focus highlight in a window
2263 * This function will enable or disable the focus highlight only for the
2264 * given window, regardless of the global setting for it
2266 * @param obj The window where to enable the highlight
2267 * @param enabled The enabled value for the highlight
2272 elm_win_focus_highlight_enabled_set(Evas_Object *obj, Eina_Bool enabled)
2276 ELM_CHECK_WIDTYPE(obj, widtype);
2278 win = elm_widget_data_get(obj);
2279 enabled = !!enabled;
2280 if (win->focus_highlight.enabled == enabled)
2283 win->focus_highlight.enabled = enabled;
2285 if (win->focus_highlight.enabled)
2286 _elm_win_focus_highlight_init(win);
2288 _elm_win_focus_highlight_shutdown(win);
2292 * Get the enabled value of the focus highlight for this window
2294 * @param obj The window in which to check if the focus highlight is enabled
2296 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
2301 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
2305 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2307 win = elm_widget_data_get(obj);
2308 return win->focus_highlight.enabled;
2312 * Set the style for the focus highlight on this window
2314 * Sets the style to use for theming the highlight of focused objects on
2315 * the given window. If @p style is NULL, the default will be used.
2317 * @param obj The window where to set the style
2318 * @param style The style to set
2323 elm_win_focus_highlight_style_set(Evas_Object *obj, const char *style)
2327 ELM_CHECK_WIDTYPE(obj, widtype);
2329 win = elm_widget_data_get(obj);
2330 eina_stringshare_replace(&win->focus_highlight.style, style);
2331 win->focus_highlight.changed_theme = EINA_TRUE;
2332 _elm_win_focus_highlight_reconfigure_job_start(win);
2336 * Get the style set for the focus highlight object
2338 * Gets the style set for this windows highilght object, or NULL if none
2341 * @param obj The window to retrieve the highlights style from
2343 * @return The style set or NULL if none was. Default is used in that case.
2348 elm_win_focus_highlight_style_get(const Evas_Object *obj)
2352 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2354 win = elm_widget_data_get(obj);
2355 return win->focus_highlight.style;
2358 typedef struct _Widget_Data Widget_Data;
2363 Evas_Object *content;
2366 static void _del_hook(Evas_Object *obj);
2367 static void _theme_hook(Evas_Object *obj);
2368 static void _sizing_eval(Evas_Object *obj);
2369 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
2370 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
2372 static const char *widtype2 = NULL;
2375 _del_hook(Evas_Object *obj)
2377 Widget_Data *wd = elm_widget_data_get(obj);
2383 _theme_hook(Evas_Object *obj)
2385 Widget_Data *wd = elm_widget_data_get(obj);
2386 _elm_theme_object_set(obj, wd->frm, "win", "inwin", elm_widget_style_get(obj));
2388 edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content);
2393 _elm_inwin_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
2395 Widget_Data *wd = elm_widget_data_get(obj);
2400 /* Try Focus cycle in subitem */
2403 elm_widget_focus_next_get(wd->content, dir, next);
2408 *next = (Evas_Object *)obj;
2413 _sizing_eval(Evas_Object *obj)
2415 Widget_Data *wd = elm_widget_data_get(obj);
2416 Evas_Coord minw = -1, minh = -1;
2418 evas_object_size_hint_min_get(wd->content, &minw, &minh);
2419 edje_object_size_min_calc(wd->frm, &minw, &minh);
2420 evas_object_size_hint_min_set(obj, minw, minh);
2421 evas_object_size_hint_max_set(obj, -1, -1);
2425 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2431 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
2433 Widget_Data *wd = elm_widget_data_get(obj);
2434 Evas_Object *sub = event_info;
2435 if (sub == wd->content)
2437 evas_object_event_callback_del_full
2438 (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
2445 * @defgroup Inwin Inwin
2447 * An inwin is a window inside a window that is useful for a quick popup. It does not hover.
2450 elm_win_inwin_add(Evas_Object *obj)
2456 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2457 win = elm_widget_data_get(obj);
2458 if (!win) return NULL;
2459 wd = ELM_NEW(Widget_Data);
2460 obj2 = elm_widget_add(win->evas);
2461 elm_widget_type_set(obj2, "inwin");
2462 ELM_SET_WIDTYPE(widtype2, "inwin");
2463 elm_widget_sub_object_add(obj, obj2);
2464 evas_object_size_hint_weight_set(obj2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2465 evas_object_size_hint_align_set(obj2, EVAS_HINT_FILL, EVAS_HINT_FILL);
2466 elm_win_resize_object_add(obj, obj2);
2468 elm_widget_data_set(obj2, wd);
2469 elm_widget_del_hook_set(obj2, _del_hook);
2470 elm_widget_theme_hook_set(obj2, _theme_hook);
2471 elm_widget_focus_next_hook_set(obj2, _elm_inwin_focus_next_hook);
2472 elm_widget_can_focus_set(obj2, EINA_TRUE);
2473 elm_widget_highlight_ignore_set(obj2, EINA_TRUE);
2475 wd->frm = edje_object_add(win->evas);
2476 _elm_theme_object_set(obj, wd->frm, "win", "inwin", "default");
2477 elm_widget_resize_object_set(obj2, wd->frm);
2479 evas_object_smart_callback_add(obj2, "sub-object-del", _sub_del, obj2);
2486 * Activates an inwin object
2488 * @param obj The inwin to activate
2493 elm_win_inwin_activate(Evas_Object *obj)
2495 ELM_CHECK_WIDTYPE(obj, widtype2);
2496 Widget_Data *wd = elm_widget_data_get(obj);
2498 evas_object_raise(obj);
2499 evas_object_show(obj);
2500 edje_object_signal_emit(wd->frm, "elm,action,show", "elm");
2501 elm_object_focus(obj);
2505 * Set the content of an inwin object.
2507 * Once the content object is set, a previously set one will be deleted.
2508 * If you want to keep that old content object, use the
2509 * elm_win_inwin_content_unset() function.
2511 * @param obj The inwin object
2512 * @param content The object to set as content
2517 elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
2519 ELM_CHECK_WIDTYPE(obj, widtype2);
2520 Widget_Data *wd = elm_widget_data_get(obj);
2522 if (wd->content == content) return;
2523 if (wd->content) evas_object_del(wd->content);
2524 wd->content = content;
2527 elm_widget_sub_object_add(obj, content);
2528 evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2529 _changed_size_hints, obj);
2530 edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
2536 * Get the content of an inwin object.
2538 * Return the content object which is set for this widget.
2540 * @param obj The inwin object
2541 * @return The content that is being used
2546 elm_win_inwin_content_get(const Evas_Object *obj)
2548 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
2549 Widget_Data *wd = elm_widget_data_get(obj);
2550 if (!wd) return NULL;
2555 * Unset the content of an inwin object.
2557 * Unparent and return the content object which was set for this widget.
2559 * @param obj The inwin object
2560 * @return The content that was being used
2565 elm_win_inwin_content_unset(Evas_Object *obj)
2567 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
2568 Widget_Data *wd = elm_widget_data_get(obj);
2569 if (!wd) return NULL;
2570 if (!wd->content) return NULL;
2571 Evas_Object *content = wd->content;
2572 elm_widget_sub_object_del(obj, wd->content);
2573 edje_object_part_unswallow(wd->frm, wd->content);
2578 /* windowing spcific calls - shall we do this differently? */
2580 * Get the Ecore_X_Window of an Evas_Object
2582 * @param obj The object
2584 * @return The Ecore_X_Window of @p obj
2589 elm_win_xwindow_get(const Evas_Object *obj)
2591 Ecore_X_Window xwin = 0;
2592 Ecore_Evas *ee = NULL;
2594 #ifdef HAVE_ELEMENTARY_X
2595 ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
2596 if (ee) xwin = (Ecore_X_Window)ecore_evas_window_get(ee);