1 #include <Elementary.h>
4 typedef struct _Elm_Win Elm_Win;
10 Evas_Object *parent, *win_obj, *img_obj, *frame_obj;
12 #ifdef HAVE_ELEMENTARY_X
14 Ecore_Event_Handler *client_message_handler;
16 Ecore_Job *deferred_resize_job;
17 Ecore_Job *deferred_child_eval_job;
20 Elm_Win_Keyboard_Mode kbdmode;
23 Elm_Win_Indicator_Mode indmode;
24 Elm_Win_Indicator_Opacity_Mode ind_o_mode;
25 >>>>>>> remotes/origin/upstream
33 Eina_Bool autodel : 1;
34 Eina_Bool constrain : 1;
35 Eina_Bool resizing : 1;
37 >>>>>>> remotes/origin/upstream
39 int *autodel_clear, rot;
51 Evas_Object *obj, *hot_obj;
54 >>>>>>> remotes/origin/upstream
60 Eina_Bool visible : 1;
61 Eina_Bool handled : 1;
65 Ecore_Job *reconf_job;
67 Eina_Bool enabled : 1;
68 Eina_Bool changed_theme : 1;
69 Eina_Bool top_animate : 1;
70 Eina_Bool geometry_changed : 1;
77 const char *icon_name;
83 Eina_Bool demand_attention : 1;
84 Eina_Bool autodel : 1;
85 Eina_Bool constrain : 1;
86 Eina_Bool resizing : 1;
87 Eina_Bool iconified : 1;
88 Eina_Bool withdrawn : 1;
90 Eina_Bool fullscreen : 1;
91 Eina_Bool maximized : 1;
92 Eina_Bool skip_focus : 1;
93 >>>>>>> remotes/origin/upstream
96 static const char *widtype = NULL;
97 static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
98 static void _elm_win_obj_callback_img_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
99 static void _elm_win_obj_callback_parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
100 static void _elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
101 static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
102 static void _elm_win_move(Ecore_Evas *ee);
103 static void _elm_win_resize(Ecore_Evas *ee);
104 static void _elm_win_delete_request(Ecore_Evas *ee);
105 static void _elm_win_resize_job(void *data);
106 #ifdef HAVE_ELEMENTARY_X
107 static void _elm_win_xwin_update(Elm_Win *win);
109 static void _elm_win_eval_subobjs(Evas_Object *obj);
110 static void _elm_win_subobj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
111 static void _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
112 static void _elm_win_focus_highlight_init(Elm_Win *win);
113 static void _elm_win_focus_highlight_shutdown(Elm_Win *win);
114 static void _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible);
115 static void _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win);
116 static void _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win);
117 static void _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission, const char *source);
118 static void _elm_win_focus_highlight_reconfigure(Elm_Win *win);
120 static void _elm_win_frame_add(Elm_Win *win, const char *style);
121 static void _elm_win_frame_cb_move_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
122 static void _elm_win_frame_cb_resize_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source);
123 static void _elm_win_frame_cb_minimize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
124 static void _elm_win_frame_cb_maximize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
125 static void _elm_win_frame_cb_close(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__);
129 //static void _elm_win_pointer_add(Elm_Win *win, const char *style);
131 >>>>>>> remotes/origin/upstream
132 static const char SIG_DELETE_REQUEST[] = "delete,request";
133 static const char SIG_FOCUS_OUT[] = "focus,out";
134 static const char SIG_FOCUS_IN[] = "focus,in";
135 static const char SIG_MOVED[] = "moved";
136 static const char SIG_THEME_CHANGED[] = "theme,changed";
139 static const char SIG_WITHDRAWN[] = "withdrawn";
140 static const char SIG_ICONIFIED[] = "iconified";
141 static const char SIG_NORMAL[] = "normal";
142 static const char SIG_STICK[] = "stick";
143 static const char SIG_UNSTICK[] = "unstick";
144 static const char SIG_FULLSCREEN[] = "fullscreen";
145 static const char SIG_UNFULLSCREEN[] = "unfullscreen";
146 static const char SIG_MAXIMIZED[] = "maximized";
147 static const char SIG_UNMAXIMIZED[] = "unmaximized";
148 >>>>>>> remotes/origin/upstream
150 static const Evas_Smart_Cb_Description _signals[] = {
151 {SIG_DELETE_REQUEST, ""},
162 {SIG_FULLSCREEN, ""},
163 {SIG_UNFULLSCREEN, ""},
165 {SIG_UNMAXIMIZED, ""},
166 >>>>>>> remotes/origin/upstream
172 Eina_List *_elm_win_list = NULL;
173 int _elm_win_deferred_free = 0;
175 // exmaple shot spec (wait 0.1 sec then save as my-window.png):
176 // ELM_ENGINE="shot:delay=0.1:file=my-window.png"
179 _shot_delay_get(Elm_Win *win)
182 char *d = strdup(win->shot.info);
185 for (p = (char *)win->shot.info; *p; p++)
187 if (!strncmp(p, "delay=", 6))
191 for (pd = d, p += 6; (*p) && (*p != ':'); p++, pd++)
206 _shot_file_get(Elm_Win *win)
209 char *tmp = strdup(win->shot.info);
210 char *repname = NULL;
212 if (!tmp) return NULL;
214 for (p = (char *)win->shot.info; *p; p++)
216 if (!strncmp(p, "file=", 5))
219 if (!win->shot.repeat_count) return tmp;
222 char *dotptr = strrchr(tmp, '.');
225 size_t size = sizeof(char)*(strlen(tmp) + 16);
226 repname = malloc(size);
227 strncpy(repname, tmp, dotptr - tmp);
228 snprintf(repname + (dotptr - tmp), size - (dotptr - tmp), "%03i",
229 win->shot.shot_counter + 1);
230 strcat(repname, dotptr);
238 if (!win->shot.repeat_count) return strdup("out.png");
240 repname = malloc(sizeof(char) * 24);
241 snprintf(repname, sizeof(char) * 24, "out%03i.png", win->shot.shot_counter + 1);
246 _shot_repeat_count_get(Elm_Win *win)
249 char *d = strdup(win->shot.info);
252 for (p = (char *)win->shot.info; *p; p++)
254 if (!strncmp(p, "repeat=", 7))
258 for (pd = d, p += 7; (*p) && (*p != ':'); p++, pd++)
265 if (v > 1000) v = 999;
275 _shot_key_get(Elm_Win *win __UNUSED__)
281 _shot_flags_get(Elm_Win *win __UNUSED__)
287 _shot_do(Elm_Win *win)
291 unsigned int *pixels;
293 char *file, *key, *flags;
295 ecore_evas_manual_render(win->ee);
296 pixels = (void *)ecore_evas_buffer_pixels_get(win->ee);
298 ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
299 if ((w < 1) || (h < 1)) return;
300 file = _shot_file_get(win);
302 key = _shot_key_get(win);
303 flags = _shot_flags_get(win);
304 ee = ecore_evas_buffer_new(1, 1);
305 o = evas_object_image_add(ecore_evas_get(ee));
306 evas_object_image_alpha_set(o, ecore_evas_alpha_get(win->ee));
307 evas_object_image_size_set(o, w, h);
308 evas_object_image_data_set(o, pixels);
309 if (!evas_object_image_save(o, file, key, flags))
311 ERR("Cannot save window to '%s' (key '%s', flags '%s')",
316 if (flags) free(flags);
318 if (win->shot.repeat_count) win->shot.shot_counter++;
322 _shot_delay(void *data)
326 if (win->shot.repeat_count)
328 int remainshot = (win->shot.repeat_count - win->shot.shot_counter);
329 if (remainshot > 0) return EINA_TRUE;
331 win->shot.timer = NULL;
337 _shot_init(Elm_Win *win)
339 if (!win->shot.info) return;
340 win->shot.repeat_count = _shot_repeat_count_get(win);
341 win->shot.shot_counter = 0;
345 _shot_handle(Elm_Win *win)
347 if (!win->shot.info) return;
348 win->shot.timer = ecore_timer_add(_shot_delay_get(win), _shot_delay, win);
352 _elm_win_move(Ecore_Evas *ee)
354 Evas_Object *obj = ecore_evas_object_associate_get(ee);
359 win = elm_widget_data_get(obj);
361 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
364 evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL);
368 _elm_win_resize(Ecore_Evas *ee)
370 Evas_Object *obj = ecore_evas_object_associate_get(ee);
374 win = elm_widget_data_get(obj);
376 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
377 win->deferred_resize_job = ecore_job_add(_elm_win_resize_job, win);
381 _elm_win_mouse_in(Ecore_Evas *ee)
386 if (!(obj = ecore_evas_object_associate_get(ee))) return;
387 if (!(win = elm_widget_data_get(obj))) return;
388 if (win->resizing) win->resizing = EINA_FALSE;
392 _elm_win_focus_in(Ecore_Evas *ee)
394 Evas_Object *obj = ecore_evas_object_associate_get(ee);
398 win = elm_widget_data_get(obj);
400 _elm_widget_top_win_focused_set(win->win_obj, EINA_TRUE);
402 if (win->show_count == 1)
404 if (!elm_widget_focus_order_get(obj))
405 >>>>>>> remotes/origin/upstream
407 elm_widget_focus_steal(win->win_obj);
411 elm_widget_focus_restore(win->win_obj);
412 evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_IN, NULL);
413 win->focus_highlight.cur.visible = EINA_TRUE;
414 _elm_win_focus_highlight_reconfigure_job_start(win);
417 edje_object_signal_emit(win->frame_obj, "elm,action,focus", "elm");
419 else if (win->img_obj)
426 _elm_win_focus_out(Ecore_Evas *ee)
428 Evas_Object *obj = ecore_evas_object_associate_get(ee);
432 win = elm_widget_data_get(obj);
434 elm_object_focus_set(win->win_obj, EINA_FALSE);
435 _elm_widget_top_win_focused_set(win->win_obj, EINA_FALSE);
436 evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_OUT, NULL);
437 win->focus_highlight.cur.visible = EINA_FALSE;
438 _elm_win_focus_highlight_reconfigure_job_start(win);
441 edje_object_signal_emit(win->frame_obj, "elm,action,unfocus", "elm");
443 else if (win->img_obj)
452 _elm_win_state_change(Ecore_Evas *ee)
456 Eina_Bool ch_withdrawn = EINA_FALSE;
457 Eina_Bool ch_sticky = EINA_FALSE;
458 Eina_Bool ch_iconified = EINA_FALSE;
459 Eina_Bool ch_fullscreen = EINA_FALSE;
460 Eina_Bool ch_maximized = EINA_FALSE;
462 if (!(obj = ecore_evas_object_associate_get(ee))) return;
464 if (!(win = elm_widget_data_get(obj))) return;
466 if (win->withdrawn != ecore_evas_withdrawn_get(win->ee))
468 win->withdrawn = ecore_evas_withdrawn_get(win->ee);
469 ch_withdrawn = EINA_TRUE;
471 if (win->sticky != ecore_evas_sticky_get(win->ee))
473 win->sticky = ecore_evas_sticky_get(win->ee);
474 ch_sticky = EINA_TRUE;
476 if (win->iconified != ecore_evas_iconified_get(win->ee))
478 win->iconified = ecore_evas_iconified_get(win->ee);
479 ch_iconified = EINA_TRUE;
481 if (win->fullscreen != ecore_evas_fullscreen_get(win->ee))
483 win->fullscreen = ecore_evas_fullscreen_get(win->ee);
484 ch_fullscreen = EINA_TRUE;
486 if (win->maximized != ecore_evas_maximized_get(win->ee))
488 win->maximized = ecore_evas_maximized_get(win->ee);
489 ch_maximized = EINA_TRUE;
491 if ((ch_withdrawn) || (ch_iconified))
494 evas_object_smart_callback_call(win->win_obj, SIG_WITHDRAWN, NULL);
495 else if (win->iconified)
496 evas_object_smart_callback_call(win->win_obj, SIG_ICONIFIED, NULL);
498 evas_object_smart_callback_call(win->win_obj, SIG_NORMAL, NULL);
503 evas_object_smart_callback_call(win->win_obj, SIG_STICK, NULL);
505 evas_object_smart_callback_call(win->win_obj, SIG_UNSTICK, NULL);
510 evas_object_smart_callback_call(win->win_obj, SIG_FULLSCREEN, NULL);
512 evas_object_smart_callback_call(win->win_obj, SIG_UNFULLSCREEN, NULL);
517 evas_object_smart_callback_call(win->win_obj, SIG_MAXIMIZED, NULL);
519 evas_object_smart_callback_call(win->win_obj, SIG_UNMAXIMIZED, NULL);
523 >>>>>>> remotes/origin/upstream
525 _elm_win_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
527 Elm_Win *wd = elm_widget_data_get(obj);
528 const Eina_List *items;
529 void *(*list_data_get) (const Eina_List *list);
537 if (!(items = elm_widget_focus_custom_chain_get(obj)))
543 list_data_get = eina_list_data_get;
545 elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
551 *next = (Evas_Object *)obj;
556 _elm_win_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
558 Elm_Win *win = elm_widget_data_get(obj);
562 evas_object_focus_set(win->img_obj, elm_widget_focus_get(obj));
564 evas_object_focus_set(obj, elm_widget_focus_get(obj));
568 _elm_win_event_cb(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
570 if (type == EVAS_CALLBACK_KEY_DOWN)
572 Evas_Event_Key_Down *ev = event_info;
573 if (!strcmp(ev->keyname, "Tab"))
575 if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
576 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
578 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
579 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
582 else if ((!strcmp(ev->keyname, "Left")) ||
583 (!strcmp(ev->keyname, "KP_Left")))
585 //TODO : woohyun jung
587 else if ((!strcmp(ev->keyname, "Right")) ||
588 (!strcmp(ev->keyname, "KP_Right")))
590 //TODO : woohyun jung
592 else if ((!strcmp(ev->keyname, "Up")) ||
593 (!strcmp(ev->keyname, "KP_Up")))
595 //TODO : woohyun jung
597 else if ((!strcmp(ev->keyname, "Down")) ||
598 (!strcmp(ev->keyname, "KP_Down")))
600 //TODO : woohyun jung
608 _deferred_ecore_evas_free(void *data)
610 ecore_evas_free(data);
611 _elm_win_deferred_free--;
615 _elm_win_obj_callback_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
619 if (!win->show_count) win->show_count++;
620 if (win->shot.info) _shot_handle(win);
624 _elm_win_obj_callback_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
630 evas_object_hide(win->frame_obj);
632 else if (win->img_obj)
634 evas_object_hide(win->img_obj);
638 if (win->pointer.obj)
640 evas_object_hide(win->pointer.obj);
641 ecore_evas_hide(win->pointer.ee);
643 >>>>>>> remotes/origin/upstream
647 _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info __UNUSED__)
654 evas_object_event_callback_del_full(win->parent, EVAS_CALLBACK_DEL,
655 _elm_win_obj_callback_parent_del, win);
658 if (win->autodel_clear) *(win->autodel_clear) = -1;
659 _elm_win_list = eina_list_remove(_elm_win_list, win->win_obj);
660 while (win->subobjs) elm_win_resize_object_del(obj, win->subobjs->data);
663 ecore_evas_callback_delete_request_set(win->ee, NULL);
664 ecore_evas_callback_resize_set(win->ee, NULL);
666 if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
667 if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
668 if (win->shot.info) eina_stringshare_del(win->shot.info);
669 if (win->shot.timer) ecore_timer_del(win->shot.timer);
670 evas_object_event_callback_del_full(win->win_obj, EVAS_CALLBACK_DEL,
671 _elm_win_obj_callback_del, win);
672 while (((child = evas_object_bottom_get(win->evas))) &&
675 evas_object_del(child);
677 while (((child = evas_object_top_get(win->evas))) &&
680 evas_object_del(child);
682 #ifdef HAVE_ELEMENTARY_X
683 if (win->client_message_handler)
684 ecore_event_handler_del(win->client_message_handler);
686 // FIXME: Why are we flushing edje on every window destroy ??
687 // edje_file_cache_flush();
688 // edje_collection_cache_flush();
689 // evas_image_cache_flush(win->evas);
690 // evas_font_cache_flush(win->evas);
691 // FIXME: we are in the del handler for the object and delete the canvas
692 // that lives under it from the handler... nasty. deferring doesn't help either
702 ecore_job_add(_deferred_ecore_evas_free, win->ee);
703 _elm_win_deferred_free++;
707 _elm_win_focus_highlight_shutdown(win);
708 eina_stringshare_del(win->focus_highlight.style);
712 if (win->title) eina_stringshare_del(win->title);
713 if (win->icon_name) eina_stringshare_del(win->icon_name);
714 if (win->role) eina_stringshare_del(win->role);
715 if (win->icon) evas_object_del(win->icon);
717 >>>>>>> remotes/origin/upstream
720 if ((!_elm_win_list) &&
721 (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
723 edje_file_cache_flush();
724 edje_collection_cache_flush();
725 evas_image_cache_flush(e);
726 evas_font_cache_flush(e);
732 _elm_win_obj_callback_img_obj_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
735 if (!win->img_obj) return;
736 evas_object_event_callback_del_full
737 (win->img_obj, EVAS_CALLBACK_DEL, _elm_win_obj_callback_img_obj_del, win);
738 evas_object_del(win->img_obj);
742 _elm_win_obj_callback_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
745 if (obj == win->parent) win->parent = NULL;
749 _elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y)
755 if ((x != win->screen.x) || (y != win->screen.y))
759 evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL);
764 evas_object_move(obj, x, y);
769 _elm_win_obj_intercept_show(void *data, Evas_Object *obj)
772 // this is called to make sure all smart containers have calculated their
773 // sizes BEFORE we show the window to make sure it initially appears at
774 // our desired size (ie min size is known first)
775 evas_smart_objects_calculate(evas_object_evas_get(obj));
778 evas_object_show(win->frame_obj);
780 else if (win->img_obj)
782 evas_object_show(win->img_obj);
786 if (win->pointer.obj)
788 ecore_evas_show(win->pointer.ee);
789 evas_object_show(win->pointer.obj);
790 /* ecore_evas_wayland_pointer_set(win->pointer.ee, 10, 10); */
792 >>>>>>> remotes/origin/upstream
793 evas_object_show(obj);
797 _elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
801 if (ecore_evas_override_get(win->ee))
805 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
808 evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL);
814 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
818 else if (win->img_obj)
822 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
825 // evas_object_move(win->img_obj, x, y);
830 _elm_win_obj_callback_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
837 else if (win->img_obj)
839 Evas_Coord w = 1, h = 1;
841 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
845 ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &sw, &sh);
851 evas_object_image_size_set(win->img_obj, w, h);
856 _elm_win_delete_request(Ecore_Evas *ee)
858 Evas_Object *obj = ecore_evas_object_associate_get(ee);
860 if (strcmp(elm_widget_type_get(obj), "win")) return;
862 win = elm_widget_data_get(obj);
864 int autodel = win->autodel;
865 win->autodel_clear = &autodel;
866 evas_object_ref(win->win_obj);
867 evas_object_smart_callback_call(win->win_obj, SIG_DELETE_REQUEST, NULL);
868 // FIXME: if above callback deletes - then the below will be invalid
869 if (autodel) evas_object_del(win->win_obj);
870 else win->autodel_clear = NULL;
871 evas_object_unref(win->win_obj);
875 _elm_win_resize_job(void *data)
882 win->deferred_resize_job = NULL;
883 ecore_evas_request_geometry_get(win->ee, NULL, NULL, &w, &h);
887 ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &sw, &sh);
893 evas_object_resize(win->frame_obj, w, h);
895 else if (win->img_obj)
898 evas_object_resize(win->win_obj, w, h);
899 EINA_LIST_FOREACH(win->subobjs, l, obj)
901 evas_object_move(obj, 0, 0);
902 evas_object_resize(obj, w, h);
906 #ifdef HAVE_ELEMENTARY_X
908 _elm_win_xwindow_get(Elm_Win *win)
913 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
915 #define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
916 >>>>>>> remotes/origin/upstream
917 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
919 if (win->ee) win->xwin = ecore_evas_software_x11_window_get(win->ee);
921 else if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
922 ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
923 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
924 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
925 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
926 ENGINE_COMPARE(ELM_OPENGL_SDL) ||
927 ENGINE_COMPARE(ELM_OPENGL_COCOA))
930 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
932 if (win->ee) win->xwin = ecore_evas_software_x11_16_window_get(win->ee);
934 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
936 if (win->ee) win->xwin = ecore_evas_software_x11_8_window_get(win->ee);
939 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
941 if (win->ee) win->xwin = ecore_evas_xrender_x11_window_get(win->ee);
944 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
946 if (win->ee) win->xwin = ecore_evas_gl_x11_window_get(win->ee);
948 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
950 if (win->ee) win->xwin = (long)ecore_evas_win32_window_get(win->ee);
952 #undef ENGINE_COMPARE
956 #ifdef HAVE_ELEMENTARY_X
958 _elm_win_xwin_update(Elm_Win *win)
964 >>>>>>> remotes/origin/upstream
965 _elm_win_xwindow_get(win);
970 win2 = elm_widget_data_get(win->parent);
974 ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
978 if (!win->xwin) return; /* nothing more to do */
983 if (!s) s = _elm_appname;
985 if (win->icon_name) s = win->icon_name;
986 ecore_x_icccm_icon_name_set(win->xwin, s);
987 ecore_x_netwm_icon_name_set(win->xwin, s);
990 if (s) ecore_x_icccm_window_role_set(win->xwin, s);
997 data = evas_object_image_data_get(win->icon, EINA_FALSE);
1001 int w = 0, h = 0, stride, x, y;
1005 evas_object_image_size_get(win->icon, &w, &h);
1006 stride = evas_object_image_stride_get(win->icon);
1007 if ((w > 0) && (h > 0) &&
1008 (stride >= (int)(w * sizeof(unsigned int))))
1012 ic.data = malloc(w * h * sizeof(unsigned int));
1016 p = (unsigned char *)data;
1017 p2 = (unsigned int *)ic.data;
1018 for (y = 0; y < h; y++)
1020 for (x = 0; x < w; x++)
1022 *p2 = *((unsigned int *)p);
1023 p += sizeof(unsigned int);
1026 p += (stride - (w * sizeof(unsigned int)));
1028 ecore_x_netwm_icons_set(win->xwin, &ic, 1);
1032 evas_object_image_data_set(win->icon, data);
1036 >>>>>>> remotes/origin/upstream
1040 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
1042 case ELM_WIN_DIALOG_BASIC:
1043 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
1045 case ELM_WIN_DESKTOP:
1046 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
1049 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DOCK);
1051 case ELM_WIN_TOOLBAR:
1052 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
1055 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_MENU);
1057 case ELM_WIN_UTILITY:
1058 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_UTILITY);
1060 case ELM_WIN_SPLASH:
1061 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_SPLASH);
1063 case ELM_WIN_DROPDOWN_MENU:
1064 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
1066 case ELM_WIN_POPUP_MENU:
1067 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
1069 case ELM_WIN_TOOLTIP:
1070 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
1072 case ELM_WIN_NOTIFICATION:
1073 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
1076 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_COMBO);
1079 ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DND);
1084 ecore_x_e_virtual_keyboard_state_set
1085 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
1088 if (win->indmode == ELM_WIN_INDICATOR_SHOW)
1089 ecore_x_e_illume_indicator_state_set
1090 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
1091 else if (win->indmode == ELM_WIN_INDICATOR_HIDE)
1092 ecore_x_e_illume_indicator_state_set
1093 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
1094 >>>>>>> remotes/origin/upstream
1099 _elm_win_eval_subobjs(Evas_Object *obj)
1102 const Evas_Object *child;
1104 Elm_Win *win = elm_widget_data_get(obj);
1105 Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
1109 EINA_LIST_FOREACH(win->subobjs, l, child)
1111 evas_object_size_hint_weight_get(child, &wx, &wy);
1112 if (wx == 0.0) xx = 0;
1113 if (wy == 0.0) xy = 0;
1115 evas_object_size_hint_min_get(child, &w, &h);
1118 if (w > minw) minw = w;
1119 if (h > minh) minh = h;
1121 evas_object_size_hint_max_get(child, &w, &h);
1124 if (maxw == -1) maxw = w;
1125 else if ((w > 0) && (w < maxw)) maxw = w;
1126 if (maxh == -1) maxh = h;
1127 else if ((h > 0) && (h < maxh)) maxh = h;
1129 if (!xx) maxw = minw;
1131 if (!xy) maxh = minh;
1133 evas_object_size_hint_min_set(obj, minw, minh);
1134 evas_object_size_hint_max_set(obj, maxw, maxh);
1135 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1136 if (w < minw) w = minw;
1137 if (h < minh) h = minh;
1138 if ((maxw >= 0) && (w > maxw)) w = maxw;
1139 if ((maxh >= 0) && (h > maxh)) h = maxh;
1140 evas_object_resize(obj, w, h);
1144 _elm_win_subobj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
1146 Elm_Win *win = elm_widget_data_get(data);
1147 win->subobjs = eina_list_remove(win->subobjs, obj);
1148 _elm_win_eval_subobjs(win->win_obj);
1152 _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1154 _elm_win_eval_subobjs(data);
1158 _elm_win_shutdown(void)
1160 while (_elm_win_list)
1161 evas_object_del(_elm_win_list->data);
1165 _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme)
1172 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1173 elm_widget_theme(obj);
1177 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1178 elm_widget_theme_specific(obj, th, EINA_FALSE);
1183 _elm_win_translate(void)
1188 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1189 elm_widget_translate(obj);
1192 #ifdef HAVE_ELEMENTARY_X
1194 _elm_win_client_message(void *data, int type __UNUSED__, void *event)
1196 Elm_Win *win = data;
1197 Ecore_X_Event_Client_Message *e = event;
1199 if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
1200 if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
1202 if ((unsigned)e->data.l[0] == win->xwin)
1204 Evas *evas = evas_object_evas_get(win->win_obj);
1207 edje_file_cache_flush();
1208 edje_collection_cache_flush();
1209 evas_image_cache_flush(evas);
1210 evas_font_cache_flush(evas);
1214 else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
1216 if ((unsigned)e->data.l[0] == win->xwin)
1218 Evas *evas = evas_object_evas_get(win->win_obj);
1221 edje_file_cache_flush();
1222 edje_collection_cache_flush();
1223 evas_image_cache_flush(evas);
1224 evas_font_cache_flush(evas);
1225 evas_render_dump(evas);
1229 return ECORE_CALLBACK_PASS_ON;
1234 _elm_win_focus_target_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1236 Elm_Win *win = data;
1238 win->focus_highlight.geometry_changed = EINA_TRUE;
1239 _elm_win_focus_highlight_reconfigure_job_start(win);
1243 _elm_win_focus_target_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1245 Elm_Win *win = data;
1247 win->focus_highlight.geometry_changed = EINA_TRUE;
1248 _elm_win_focus_highlight_reconfigure_job_start(win);
1252 _elm_win_focus_target_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1254 Elm_Win *win = data;
1256 win->focus_highlight.cur.target = NULL;
1258 _elm_win_focus_highlight_reconfigure_job_start(win);
1262 _elm_win_focus_target_callbacks_add(Elm_Win *win)
1264 Evas_Object *obj = win->focus_highlight.cur.target;
1266 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
1267 _elm_win_focus_target_move, win);
1268 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
1269 _elm_win_focus_target_resize, win);
1270 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
1271 _elm_win_focus_target_del, win);
1275 _elm_win_focus_target_callbacks_del(Elm_Win *win)
1277 Evas_Object *obj = win->focus_highlight.cur.target;
1279 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE,
1280 _elm_win_focus_target_move, win);
1281 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
1282 _elm_win_focus_target_resize, win);
1283 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
1284 _elm_win_focus_target_del, win);
1287 static Evas_Object *
1288 _elm_win_focus_target_get(Evas_Object *obj)
1290 Evas_Object *o = obj;
1294 if (elm_widget_is(o))
1296 if (!elm_widget_highlight_ignore_get(o))
1298 o = elm_widget_parent_get(o);
1300 o = evas_object_smart_parent_get(o);
1304 o = elm_widget_parent_widget_get(o);
1306 o = evas_object_smart_parent_get(o);
1315 _elm_win_object_focus_in(void *data, Evas *e __UNUSED__, void *event_info)
1317 Evas_Object *obj = event_info, *target;
1318 Elm_Win *win = data;
1320 if (win->focus_highlight.cur.target == obj)
1323 target = _elm_win_focus_target_get(obj);
1324 win->focus_highlight.cur.target = target;
1325 if (elm_widget_highlight_in_theme_get(target))
1326 win->focus_highlight.cur.handled = EINA_TRUE;
1328 _elm_win_focus_target_callbacks_add(win);
1330 _elm_win_focus_highlight_reconfigure_job_start(win);
1334 _elm_win_object_focus_out(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__)
1336 Elm_Win *win = data;
1338 if (!win->focus_highlight.cur.target)
1341 if (!win->focus_highlight.cur.handled)
1342 _elm_win_focus_target_callbacks_del(win);
1343 win->focus_highlight.cur.target = NULL;
1344 win->focus_highlight.cur.handled = EINA_FALSE;
1346 _elm_win_focus_highlight_reconfigure_job_start(win);
1350 _elm_win_focus_highlight_hide(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
1352 evas_object_hide(obj);
1356 _elm_win_focus_highlight_init(Elm_Win *win)
1358 evas_event_callback_add(win->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1359 _elm_win_object_focus_in, win);
1360 evas_event_callback_add(win->evas,
1361 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1362 _elm_win_object_focus_out, win);
1364 win->focus_highlight.cur.target = evas_focus_get(win->evas);
1366 win->focus_highlight.top = edje_object_add(win->evas);
1367 win->focus_highlight.changed_theme = EINA_TRUE;
1368 edje_object_signal_callback_add(win->focus_highlight.top,
1369 "elm,action,focus,hide,end", "",
1370 _elm_win_focus_highlight_hide, NULL);
1371 edje_object_signal_callback_add(win->focus_highlight.top,
1372 "elm,action,focus,anim,end", "",
1373 _elm_win_focus_highlight_anim_end, win);
1374 _elm_win_focus_highlight_reconfigure_job_start(win);
1378 _elm_win_focus_highlight_shutdown(Elm_Win *win)
1380 _elm_win_focus_highlight_reconfigure_job_stop(win);
1381 if (win->focus_highlight.cur.target)
1383 _elm_win_focus_target_callbacks_del(win);
1384 win->focus_highlight.cur.target = NULL;
1386 if (win->focus_highlight.top)
1388 evas_object_del(win->focus_highlight.top);
1389 win->focus_highlight.top = NULL;
1392 evas_event_callback_del_full(win->evas,
1393 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
1394 _elm_win_object_focus_in, win);
1395 evas_event_callback_del_full(win->evas,
1396 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
1397 _elm_win_object_focus_out, win);
1401 _elm_win_focus_highlight_visible_set(Elm_Win *win, Eina_Bool visible)
1405 top = win->focus_highlight.top;
1410 evas_object_show(top);
1411 edje_object_signal_emit(top, "elm,action,focus,show", "elm");
1417 edje_object_signal_emit(top, "elm,action,focus,hide", "elm");
1422 _elm_win_focus_highlight_reconfigure_job(void *data)
1424 _elm_win_focus_highlight_reconfigure((Elm_Win *)data);
1428 _elm_win_focus_highlight_reconfigure_job_start(Elm_Win *win)
1430 if (win->focus_highlight.reconf_job)
1431 ecore_job_del(win->focus_highlight.reconf_job);
1432 win->focus_highlight.reconf_job = ecore_job_add(
1433 _elm_win_focus_highlight_reconfigure_job, win);
1437 _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win)
1439 if (win->focus_highlight.reconf_job)
1440 ecore_job_del(win->focus_highlight.reconf_job);
1441 win->focus_highlight.reconf_job = NULL;
1445 _elm_win_focus_highlight_simple_setup(Elm_Win *win, Evas_Object *obj)
1447 Evas_Object *clip, *target = win->focus_highlight.cur.target;
1448 Evas_Coord x, y, w, h;
1450 clip = evas_object_clip_get(target);
1451 evas_object_geometry_get(target, &x, &y, &w, &h);
1453 evas_object_move(obj, x, y);
1454 evas_object_resize(obj, w, h);
1455 evas_object_clip_set(obj, clip);
1459 _elm_win_focus_highlight_anim_setup(Elm_Win *win, Evas_Object *obj)
1461 Evas_Coord tx, ty, tw, th;
1462 Evas_Coord w, h, px, py, pw, ph;
1463 Edje_Message_Int_Set *m;
1464 Evas_Object *previous = win->focus_highlight.prev.target;
1465 Evas_Object *target = win->focus_highlight.cur.target;
1467 evas_object_geometry_get(win->win_obj, NULL, NULL, &w, &h);
1468 evas_object_geometry_get(target, &tx, &ty, &tw, &th);
1469 evas_object_geometry_get(previous, &px, &py, &pw, &ph);
1470 evas_object_move(obj, 0, 0);
1471 evas_object_resize(obj, tw, th);
1472 evas_object_clip_unset(obj);
1474 m = alloca(sizeof(*m) + (sizeof(int) * 8));
1484 edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
1488 _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
1490 Elm_Win *win = data;
1491 _elm_win_focus_highlight_simple_setup(win, obj);
1495 _elm_win_focus_highlight_reconfigure(Elm_Win *win)
1497 Evas_Object *target = win->focus_highlight.cur.target;
1498 Evas_Object *previous = win->focus_highlight.prev.target;
1499 Evas_Object *top = win->focus_highlight.top;
1500 Eina_Bool visible_changed;
1501 Eina_Bool common_visible;
1502 const char *sig = NULL;
1504 _elm_win_focus_highlight_reconfigure_job_stop(win);
1506 visible_changed = (win->focus_highlight.cur.visible !=
1507 win->focus_highlight.prev.visible);
1509 if ((target == previous) && (!visible_changed) &&
1510 (!win->focus_highlight.geometry_changed))
1513 if ((previous) && (win->focus_highlight.prev.handled))
1514 elm_widget_signal_emit(previous, "elm,action,focus_highlight,hide", "elm");
1517 common_visible = EINA_FALSE;
1518 else if (win->focus_highlight.cur.handled)
1520 common_visible = EINA_FALSE;
1521 if (win->focus_highlight.cur.visible)
1522 sig = "elm,action,focus_highlight,show";
1524 sig = "elm,action,focus_highlight,hide";
1527 common_visible = win->focus_highlight.cur.visible;
1529 _elm_win_focus_highlight_visible_set(win, common_visible);
1531 elm_widget_signal_emit(target, sig, "elm");
1533 if ((!target) || (!common_visible) || (win->focus_highlight.cur.handled))
1536 if (win->focus_highlight.changed_theme)
1539 if (win->focus_highlight.style)
1540 str = win->focus_highlight.style;
1543 _elm_theme_object_set(win->win_obj, top, "focus_highlight", "top",
1545 win->focus_highlight.changed_theme = EINA_FALSE;
1547 if (_elm_config->focus_highlight_animate)
1549 str = edje_object_data_get(win->focus_highlight.top, "animate");
1550 win->focus_highlight.top_animate = ((str) && (!strcmp(str, "on")));
1554 if ((win->focus_highlight.top_animate) && (previous) &&
1555 (!win->focus_highlight.prev.handled))
1556 _elm_win_focus_highlight_anim_setup(win, top);
1558 _elm_win_focus_highlight_simple_setup(win, top);
1559 evas_object_raise(top);
1562 win->focus_highlight.geometry_changed = EINA_FALSE;
1563 win->focus_highlight.prev = win->focus_highlight.cur;
1567 _elm_win_frame_add(Elm_Win *win, const char *style)
1569 evas_output_framespace_set(win->evas, 0, 22, 0, 26);
1571 win->frame_obj = edje_object_add(win->evas);
1572 _elm_theme_set(NULL, win->frame_obj, "border", "base", style);
1573 evas_object_is_frame_object_set(win->frame_obj, EINA_TRUE);
1574 evas_object_move(win->frame_obj, 0, 0);
1575 evas_object_resize(win->frame_obj, 1, 1);
1577 edje_object_signal_callback_add(win->frame_obj, "elm,action,move,start",
1578 "elm", _elm_win_frame_cb_move_start, win);
1579 edje_object_signal_callback_add(win->frame_obj, "elm,action,resize,start",
1580 "*", _elm_win_frame_cb_resize_start, win);
1581 edje_object_signal_callback_add(win->frame_obj, "elm,action,minimize",
1582 "elm", _elm_win_frame_cb_minimize, win);
1583 edje_object_signal_callback_add(win->frame_obj, "elm,action,maximize",
1584 "elm", _elm_win_frame_cb_maximize, win);
1585 edje_object_signal_callback_add(win->frame_obj, "elm,action,close",
1586 "elm", _elm_win_frame_cb_close, win);
1590 _elm_win_frame_cb_move_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1594 if (!(win = data)) return;
1595 /* FIXME: Change mouse pointer */
1597 /* NB: 0,0 are dummy values. Wayland handles the move by itself */
1598 ecore_evas_move(win->ee, 0, 0);
1602 _elm_win_frame_cb_resize_start(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source)
1606 if (!(win = data)) return;
1607 if (win->resizing) return;
1608 win->resizing = EINA_TRUE;
1610 /* FIXME: Change mouse pointer */
1612 if (!strcmp(source, "elm.event.resize.t"))
1613 win->resize_location = 1;
1614 else if (!strcmp(source, "elm.event.resize.b"))
1615 win->resize_location = 2;
1616 else if (!strcmp(source, "elm.event.resize.l"))
1617 win->resize_location = 4;
1618 else if (!strcmp(source, "elm.event.resize.r"))
1619 win->resize_location = 8;
1620 else if (!strcmp(source, "elm.event.resize.tl"))
1621 win->resize_location = 5;
1622 else if (!strcmp(source, "elm.event.resize.tr"))
1623 win->resize_location = 9;
1624 else if (!strcmp(source, "elm.event.resize.bl"))
1625 win->resize_location = 6;
1626 else if (!strcmp(source, "elm.event.resize.br"))
1627 win->resize_location = 10;
1629 win->resize_location = 0;
1632 /* FIXME: Change to more generic wayland resize function */
1634 >>>>>>> remotes/origin/upstream
1635 if (win->resize_location > 0)
1636 ecore_evas_wayland_resize(win->ee, win->resize_location);
1640 _elm_win_frame_cb_minimize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1644 if (!(win = data)) return;
1647 win->iconified = EINA_TRUE;
1648 >>>>>>> remotes/origin/upstream
1649 ecore_evas_iconified_set(win->ee, EINA_TRUE);
1653 _elm_win_frame_cb_maximize(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1657 if (!(win = data)) return;
1659 ecore_evas_maximized_set(win->ee, EINA_TRUE);
1661 if (win->maximized) win->maximized = EINA_FALSE;
1662 else win->maximized = EINA_TRUE;
1663 ecore_evas_maximized_set(win->ee, win->maximized);
1664 >>>>>>> remotes/origin/upstream
1668 _elm_win_frame_cb_close(void *data, Evas_Object *obj __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
1672 if (!(win = data)) return;
1673 evas_object_del(win->win_obj);
1680 _elm_win_pointer_add(Elm_Win *win, const char *style)
1686 win->pointer.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 32, 32, 0);
1687 ecore_evas_resize(win->pointer.ee, 32, 32);
1689 win->pointer.evas = ecore_evas_get(win->ee);
1691 win->pointer.obj = edje_object_add(win->pointer.evas);
1692 _elm_theme_set(NULL, win->pointer.obj, "pointer", "base", style);
1693 edje_object_size_min_calc(win->pointer.obj, &mw, &mh);
1694 evas_object_move(win->pointer.obj, 0, 0);
1695 evas_object_resize(win->pointer.obj, 32, 32);
1696 evas_object_show(win->pointer.obj);
1700 >>>>>>> remotes/origin/upstream
1703 _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
1705 Evas_Event_Key_Down *ev = event_info;
1707 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
1710 if ((strcmp(ev->keyname, "F12")) ||
1711 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
1714 printf("Tree graph generated.\n");
1715 elm_object_tree_dot_dump(obj, "./dump.dot");
1720 _win_img_hide(void *data,
1722 Evas_Object *obj __UNUSED__,
1723 void *event_info __UNUSED__)
1725 Elm_Win *win = data;
1727 elm_widget_focus_hide_handle(win->win_obj);
1731 _win_img_mouse_up(void *data,
1733 Evas_Object *obj __UNUSED__,
1736 Elm_Win *win = data;
1737 Evas_Event_Mouse_Up *ev = event_info;
1738 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1739 elm_widget_focus_mouse_up_handle(win->win_obj);
1743 _win_img_focus_in(void *data,
1745 Evas_Object *obj __UNUSED__,
1746 void *event_info __UNUSED__)
1748 Elm_Win *win = data;
1749 elm_widget_focus_steal(win->win_obj);
1753 _win_img_focus_out(void *data,
1755 Evas_Object *obj __UNUSED__,
1756 void *event_info __UNUSED__)
1758 Elm_Win *win = data;
1759 elm_widget_focused_object_clear(win->win_obj);
1763 _win_inlined_image_set(Elm_Win *win)
1765 evas_object_image_alpha_set(win->img_obj, EINA_FALSE);
1766 evas_object_image_filled_set(win->img_obj, EINA_TRUE);
1767 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_DEL,
1768 _elm_win_obj_callback_img_obj_del, win);
1770 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_HIDE,
1771 _win_img_hide, win);
1772 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_MOUSE_UP,
1773 _win_img_mouse_up, win);
1774 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_IN,
1775 _win_img_focus_in, win);
1776 evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_OUT,
1777 _win_img_focus_out, win);
1781 _subobj_del(Elm_Win *win, Evas_Object *obj, Evas_Object *subobj)
1783 evas_object_event_callback_del_full(subobj,
1784 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1785 _elm_win_subobj_callback_changed_size_hints,
1787 evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL,
1788 _elm_win_subobj_callback_del, obj);
1789 win->subobjs = eina_list_remove(win->subobjs, subobj);
1790 _elm_win_eval_subobjs(obj);
1796 _elm_win_obj_icon_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
1798 Elm_Win *win = data;
1799 if (win->icon == obj) win->icon = NULL;
1802 >>>>>>> remotes/origin/upstream
1804 elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
1808 const char *fontpath;
1810 win = ELM_NEW(Elm_Win);
1812 #define FALLBACK_TRY(engine) \
1815 CRITICAL(engine " engine creation failed. Trying default."); \
1816 win->ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL); \
1819 elm_engine_set(ecore_evas_engine_name_get(win->ee)); \
1821 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1824 elm_config_preferred_engine_set(ecore_evas_engine_name_get(win->ee)); \
1826 #define ENGINE_COMPARE(name) (_elm_preferred_engine && !strcmp(_elm_preferred_engine, name))
1828 win->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
1829 win->indmode = ELM_WIN_INDICATOR_UNKNOWN;
1831 >>>>>>> remotes/origin/upstream
1834 case ELM_WIN_INLINED_IMAGE:
1837 Evas *e = evas_object_evas_get(parent);
1840 ee = ecore_evas_ecore_evas_get(e);
1842 win->img_obj = ecore_evas_object_image_new(ee);
1843 if (!win->img_obj) break;
1844 win->ee = ecore_evas_object_ecore_evas_get(win->img_obj);
1847 _win_inlined_image_set(win);
1850 evas_object_del(win->img_obj);
1851 win->img_obj = NULL;
1855 case ELM_WIN_SOCKET_IMAGE:
1856 win->ee = ecore_evas_extn_socket_new(1, 1);
1860 if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
1862 win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
1863 #ifdef HAVE_ELEMENTARY_X
1864 win->client_message_handler = ecore_event_handler_add
1865 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1867 FALLBACK_TRY("Sofware X11");
1869 else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
1871 win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
1872 FALLBACK_TRY("Sofware FB");
1874 else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
1876 win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
1877 FALLBACK_TRY("Sofware DirectFB");
1879 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
1881 win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
1882 FALLBACK_TRY("Sofware-16");
1883 #ifdef HAVE_ELEMENTARY_X
1884 win->client_message_handler = ecore_event_handler_add
1885 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1888 else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
1890 win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
1891 FALLBACK_TRY("Sofware-8");
1892 #ifdef HAVE_ELEMENTARY_X
1893 win->client_message_handler = ecore_event_handler_add
1894 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1898 else if (ENGINE_COMPARE(ELM_XRENDER_X11))
1900 win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
1901 FALLBACK_TRY("XRender");
1902 #ifdef HAVE_ELEMENTARY_X
1903 win->client_message_handler = ecore_event_handler_add
1904 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1908 else if (ENGINE_COMPARE(ELM_OPENGL_X11))
1913 if (_elm_config->vsync)
1915 opt[opt_i] = ECORE_EVAS_GL_X11_OPT_VSYNC;
1921 win->ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, opt);
1923 win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
1924 FALLBACK_TRY("OpenGL");
1925 #ifdef HAVE_ELEMENTARY_X
1926 win->client_message_handler = ecore_event_handler_add
1927 (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
1930 else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
1932 win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
1933 FALLBACK_TRY("Sofware Win32");
1935 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
1937 win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
1938 FALLBACK_TRY("Sofware-16-WinCE");
1940 else if (ENGINE_COMPARE(ELM_SOFTWARE_PSL1GHT))
1942 win->ee = ecore_evas_psl1ght_new(NULL, 1, 1);
1943 FALLBACK_TRY("PSL1GHT");
1945 else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
1947 win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
1948 FALLBACK_TRY("Sofware SDL");
1950 else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
1952 win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
1953 FALLBACK_TRY("Sofware-16-SDL");
1955 else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
1957 win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
1958 FALLBACK_TRY("OpenGL SDL");
1960 else if (ENGINE_COMPARE(ELM_OPENGL_COCOA))
1962 win->ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
1963 FALLBACK_TRY("OpenGL Cocoa");
1965 else if (ENGINE_COMPARE(ELM_BUFFER))
1967 win->ee = ecore_evas_buffer_new(1, 1);
1969 else if (ENGINE_COMPARE(ELM_EWS))
1971 win->ee = ecore_evas_ews_new(0, 0, 1, 1);
1973 else if (ENGINE_COMPARE(ELM_WAYLAND_SHM))
1975 win->ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 1, 1, 0);
1977 win->evas = ecore_evas_get(win->ee);
1979 _elm_win_frame_add(win, "default");
1981 win->evas = ecore_evas_get(win->ee);
1983 _elm_win_frame_add(win, "default");
1984 // _elm_win_pointer_add(win, "default");
1985 >>>>>>> remotes/origin/upstream
1987 else if (ENGINE_COMPARE(ELM_WAYLAND_EGL))
1989 win->ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 1, 1, 0);
1991 win->evas = ecore_evas_get(win->ee);
1993 _elm_win_frame_add(win, "default");
1995 else if (!strncmp(_elm_config->engine, "shot:", 5))
1997 win->ee = ecore_evas_buffer_new(1, 1);
1998 ecore_evas_manual_render_set(win->ee, EINA_TRUE);
1999 win->shot.info = eina_stringshare_add(_elm_config->engine + 5);
2001 win->evas = ecore_evas_get(win->ee);
2003 _elm_win_frame_add(win, "default");
2004 // _elm_win_pointer_add(win, "default");
2006 else if (!strncmp(_elm_preferred_engine, "shot:", 5))
2008 win->ee = ecore_evas_buffer_new(1, 1);
2009 ecore_evas_manual_render_set(win->ee, EINA_TRUE);
2010 win->shot.info = eina_stringshare_add(_elm_preferred_engine + 5);
2011 >>>>>>> remotes/origin/upstream
2020 ERR("Cannot create window.");
2024 #ifdef HAVE_ELEMENTARY_X
2025 _elm_win_xwindow_get(win);
2027 if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
2028 ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
2029 // bg pixmap done by x - has other issues like can be redrawn by x before it
2030 // is filled/ready by app
2031 // ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
2034 win->parent = parent;
2036 evas_object_event_callback_add(win->parent, EVAS_CALLBACK_DEL,
2037 _elm_win_obj_callback_parent_del, win);
2039 win->evas = ecore_evas_get(win->ee);
2040 win->win_obj = elm_widget_add(win->evas);
2041 elm_widget_type_set(win->win_obj, "win");
2042 ELM_SET_WIDTYPE(widtype, "win");
2043 elm_widget_data_set(win->win_obj, win);
2044 elm_widget_event_hook_set(win->win_obj, _elm_win_event_cb);
2045 elm_widget_on_focus_hook_set(win->win_obj, _elm_win_on_focus_hook, NULL);
2046 elm_widget_can_focus_set(win->win_obj, EINA_TRUE);
2047 elm_widget_highlight_ignore_set(win->win_obj, EINA_TRUE);
2048 elm_widget_focus_next_hook_set(win->win_obj, _elm_win_focus_next_hook);
2049 evas_object_color_set(win->win_obj, 0, 0, 0, 0);
2050 evas_object_move(win->win_obj, 0, 0);
2051 evas_object_resize(win->win_obj, 1, 1);
2052 evas_object_layer_set(win->win_obj, 50);
2053 evas_object_pass_events_set(win->win_obj, EINA_TRUE);
2058 // evas_object_clip_set(win->win_obj, win->frame_obj);
2060 evas_object_clip_set(win->win_obj, win->frame_obj);
2061 >>>>>>> remotes/origin/upstream
2062 evas_object_stack_below(win->frame_obj, win->win_obj);
2065 if (type == ELM_WIN_INLINED_IMAGE)
2066 elm_widget_parent2_set(win->win_obj, parent);
2067 ecore_evas_object_associate(win->ee, win->win_obj,
2068 ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
2069 ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
2070 ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
2071 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
2072 _elm_win_obj_callback_show, win);
2073 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_HIDE,
2074 _elm_win_obj_callback_hide, win);
2075 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
2076 _elm_win_obj_callback_del, win);
2077 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_MOVE,
2078 _elm_win_obj_callback_move, win);
2079 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_RESIZE,
2080 _elm_win_obj_callback_resize, win);
2082 evas_object_intercept_move_callback_add(win->win_obj,
2083 _elm_win_obj_intercept_move, win);
2084 evas_object_intercept_show_callback_add(win->win_obj,
2085 _elm_win_obj_intercept_show, win);
2087 evas_object_smart_callback_add(win->win_obj, "sub-object-del", (Evas_Smart_Cb)_subobj_del, win);
2088 ecore_evas_name_class_set(win->ee, name, _elm_appname);
2089 ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
2090 ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
2091 ecore_evas_callback_mouse_in_set(win->ee, _elm_win_mouse_in);
2092 ecore_evas_callback_focus_in_set(win->ee, _elm_win_focus_in);
2093 ecore_evas_callback_focus_out_set(win->ee, _elm_win_focus_out);
2094 ecore_evas_callback_move_set(win->ee, _elm_win_move);
2097 ecore_evas_callback_state_change_set(win->ee, _elm_win_state_change);
2098 >>>>>>> remotes/origin/upstream
2099 evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024));
2100 evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
2101 EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
2102 evas_font_path_append(win->evas, fontpath);
2103 if (!_elm_config->font_hinting)
2104 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_NONE);
2105 else if (_elm_config->font_hinting == 1)
2106 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_AUTO);
2107 else if (_elm_config->font_hinting == 2)
2108 evas_font_hinting_set(win->evas, EVAS_FONT_HINTING_BYTECODE);
2110 #ifdef HAVE_ELEMENTARY_X
2111 _elm_win_xwin_update(win);
2114 _elm_win_list = eina_list_append(_elm_win_list, win->win_obj);
2116 if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
2118 ecore_evas_fullscreen_set(win->ee, 1);
2120 #undef ENGINE_COMPARE
2122 if (_elm_config->focus_highlight_enable)
2123 elm_win_focus_highlight_enabled_set(win->win_obj, EINA_TRUE);
2126 Evas_Modifier_Mask mask = evas_key_modifier_mask_get(win->evas, "Control");
2127 evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_KEY_DOWN,
2128 _debug_key_down, win);
2130 Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0,
2132 printf("Ctrl+F12 key combination exclusive for dot tree generation\n");
2135 evas_object_smart_callbacks_descriptions_set(win->win_obj, _signals);
2137 return win->win_obj;
2141 elm_win_util_standard_add(const char *name, const char *title)
2143 Evas_Object *win, *bg;
2145 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
2146 if (!win) return NULL;
2147 elm_win_title_set(win, title);
2148 bg = elm_bg_add(win);
2151 evas_object_del(win);
2154 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2155 elm_win_resize_object_add(win, bg);
2156 evas_object_show(bg);
2161 elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
2165 ELM_CHECK_WIDTYPE(obj, widtype);
2166 win = elm_widget_data_get(obj);
2168 if (eina_list_data_find(win->subobjs, subobj)) return;
2169 win->subobjs = eina_list_append(win->subobjs, subobj);
2170 elm_widget_sub_object_add(obj, subobj);
2171 evas_object_event_callback_add(subobj, EVAS_CALLBACK_DEL,
2172 _elm_win_subobj_callback_del, obj);
2173 evas_object_event_callback_add(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2174 _elm_win_subobj_callback_changed_size_hints,
2176 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
2177 evas_object_move(subobj, 0, 0);
2178 evas_object_resize(subobj, w, h);
2179 _elm_win_eval_subobjs(obj);
2183 elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
2186 ELM_CHECK_WIDTYPE(obj, widtype);
2187 win = elm_widget_data_get(obj);
2189 evas_object_event_callback_del_full(subobj,
2190 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2191 _elm_win_subobj_callback_changed_size_hints,
2193 evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL,
2194 _elm_win_subobj_callback_del, obj);
2195 win->subobjs = eina_list_remove(win->subobjs, subobj);
2196 elm_widget_sub_object_del(obj, subobj);
2197 _elm_win_eval_subobjs(obj);
2201 elm_win_title_set(Evas_Object *obj, const char *title)
2204 ELM_CHECK_WIDTYPE(obj, widtype);
2205 win = elm_widget_data_get(obj);
2208 ecore_evas_title_set(win->ee, title);
2210 edje_object_part_text_set(win->frame_obj, "elm.text.title", title);
2212 if (!win || !title) return;
2213 eina_stringshare_replace(&(win->title), title);
2214 ecore_evas_title_set(win->ee, win->title);
2216 edje_object_part_text_set(win->frame_obj, "elm.text.title", win->title);
2217 >>>>>>> remotes/origin/upstream
2221 elm_win_title_get(const Evas_Object *obj)
2224 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2225 win = elm_widget_data_get(obj);
2226 if (!win) return NULL;
2228 return ecore_evas_title_get(win->ee);
2234 elm_win_icon_name_set(Evas_Object *obj, const char *icon_name)
2237 ELM_CHECK_WIDTYPE(obj, widtype);
2238 win = elm_widget_data_get(obj);
2239 if (!win || !icon_name) return;
2240 eina_stringshare_replace(&(win->icon_name), icon_name);
2241 #ifdef HAVE_ELEMENTARY_X
2242 _elm_win_xwin_update(win);
2247 elm_win_icon_name_get(const Evas_Object *obj)
2250 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2251 win = elm_widget_data_get(obj);
2252 if (!win) return NULL;
2253 return win->icon_name;
2257 elm_win_role_set(Evas_Object *obj, const char *role)
2260 ELM_CHECK_WIDTYPE(obj, widtype);
2261 win = elm_widget_data_get(obj);
2262 if (!win || !role) return;
2263 eina_stringshare_replace(&(win->role), role);
2264 #ifdef HAVE_ELEMENTARY_X
2265 _elm_win_xwin_update(win);
2270 elm_win_role_get(const Evas_Object *obj)
2273 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2274 win = elm_widget_data_get(obj);
2275 if (!win) return NULL;
2280 elm_win_icon_object_set(Evas_Object *obj, Evas_Object *icon)
2283 ELM_CHECK_WIDTYPE(obj, widtype);
2284 win = elm_widget_data_get(obj);
2287 evas_object_event_callback_del_full(win->icon, EVAS_CALLBACK_DEL,
2288 _elm_win_obj_icon_callback_del, win);
2291 evas_object_event_callback_add(win->icon, EVAS_CALLBACK_DEL,
2292 _elm_win_obj_icon_callback_del, win);
2293 #ifdef HAVE_ELEMENTARY_X
2294 _elm_win_xwin_update(win);
2298 EAPI const Evas_Object *
2299 elm_win_icon_object_get(const Evas_Object *obj)
2302 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2303 win = elm_widget_data_get(obj);
2304 if (!win) return NULL;
2306 >>>>>>> remotes/origin/upstream
2310 elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
2313 ELM_CHECK_WIDTYPE(obj, widtype);
2314 win = elm_widget_data_get(obj);
2316 win->autodel = autodel;
2320 elm_win_autodel_get(const Evas_Object *obj)
2323 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2324 win = elm_widget_data_get(obj);
2325 if (!win) return EINA_FALSE;
2326 return win->autodel;
2330 elm_win_activate(Evas_Object *obj)
2333 ELM_CHECK_WIDTYPE(obj, widtype);
2334 win = elm_widget_data_get(obj);
2336 ecore_evas_activate(win->ee);
2340 elm_win_lower(Evas_Object *obj)
2343 ELM_CHECK_WIDTYPE(obj, widtype);
2344 win = elm_widget_data_get(obj);
2346 ecore_evas_lower(win->ee);
2350 elm_win_raise(Evas_Object *obj)
2353 ELM_CHECK_WIDTYPE(obj, widtype);
2354 win = elm_widget_data_get(obj);
2356 ecore_evas_raise(win->ee);
2360 elm_win_center(Evas_Object *obj, Eina_Bool h, Eina_Bool v)
2363 int win_w, win_h, screen_w, screen_h, nx, ny;
2364 ELM_CHECK_WIDTYPE(obj, widtype);
2365 win = elm_widget_data_get(obj);
2367 ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &screen_w, &screen_h);
2368 if ((!screen_w) || (!screen_h)) return;
2369 evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
2370 if ((!win_w) || (!win_h)) return;
2371 if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
2372 else nx = win->screen.x;
2373 if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
2374 else ny = win->screen.y;
2377 evas_object_move(obj, nx, ny);
2381 elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless)
2384 ELM_CHECK_WIDTYPE(obj, widtype);
2385 win = elm_widget_data_get(obj);
2387 ecore_evas_borderless_set(win->ee, borderless);
2388 #ifdef HAVE_ELEMENTARY_X
2389 _elm_win_xwin_update(win);
2394 elm_win_borderless_get(const Evas_Object *obj)
2397 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2398 win = elm_widget_data_get(obj);
2399 if (!win) return EINA_FALSE;
2400 return ecore_evas_borderless_get(win->ee);
2404 elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
2407 ELM_CHECK_WIDTYPE(obj, widtype);
2408 win = elm_widget_data_get(obj);
2410 ecore_evas_shaped_set(win->ee, shaped);
2411 #ifdef HAVE_ELEMENTARY_X
2412 _elm_win_xwin_update(win);
2417 elm_win_shaped_get(const Evas_Object *obj)
2420 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2421 win = elm_widget_data_get(obj);
2422 if (!win) return EINA_FALSE;
2423 return ecore_evas_shaped_get(win->ee);
2427 elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
2430 ELM_CHECK_WIDTYPE(obj, widtype);
2431 win = elm_widget_data_get(obj);
2436 else if (win->img_obj)
2438 evas_object_image_alpha_set(win->img_obj, alpha);
2439 ecore_evas_alpha_set(win->ee, alpha);
2443 #ifdef HAVE_ELEMENTARY_X
2448 if (!_elm_config->compositing)
2449 elm_win_shaped_set(obj, alpha);
2451 ecore_evas_alpha_set(win->ee, alpha);
2454 ecore_evas_alpha_set(win->ee, alpha);
2455 _elm_win_xwin_update(win);
2459 ecore_evas_alpha_set(win->ee, alpha);
2464 elm_win_alpha_get(const Evas_Object *obj)
2467 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2468 win = elm_widget_data_get(obj);
2469 if (!win) return EINA_FALSE;
2473 else if (win->img_obj)
2475 return evas_object_image_alpha_get(win->img_obj);
2477 return ecore_evas_alpha_get(win->ee);
2483 EINA_DEPRECATED EAPI void
2484 >>>>>>> remotes/origin/upstream
2485 elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
2488 ELM_CHECK_WIDTYPE(obj, widtype);
2489 win = elm_widget_data_get(obj);
2495 else if (win->img_obj)
2497 evas_object_image_alpha_set(win->img_obj, transparent);
2501 #ifdef HAVE_ELEMENTARY_X
2504 ecore_evas_transparent_set(win->ee, transparent);
2505 _elm_win_xwin_update(win);
2509 ecore_evas_transparent_set(win->ee, transparent);
2516 EINA_DEPRECATED EAPI Eina_Bool
2517 >>>>>>> remotes/origin/upstream
2518 elm_win_transparent_get(const Evas_Object *obj)
2521 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2522 win = elm_widget_data_get(obj);
2523 if (!win) return EINA_FALSE;
2525 return ecore_evas_transparent_get(win->ee);
2529 elm_win_override_set(Evas_Object *obj, Eina_Bool override)
2532 ELM_CHECK_WIDTYPE(obj, widtype);
2533 win = elm_widget_data_get(obj);
2535 ecore_evas_override_set(win->ee, override);
2536 #ifdef HAVE_ELEMENTARY_X
2537 _elm_win_xwin_update(win);
2542 elm_win_override_get(const Evas_Object *obj)
2545 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2546 win = elm_widget_data_get(obj);
2547 if (!win) return EINA_FALSE;
2548 return ecore_evas_override_get(win->ee);
2552 elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
2555 ELM_CHECK_WIDTYPE(obj, widtype);
2556 win = elm_widget_data_get(obj);
2560 // YYY: handle if win->img_obj
2561 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
2563 // YYY: handle if win->img_obj
2564 #define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
2565 >>>>>>> remotes/origin/upstream
2566 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
2567 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
2569 // these engines... can ONLY be fullscreen
2576 win->fullscreen = fullscreen;
2577 >>>>>>> remotes/origin/upstream
2578 ecore_evas_fullscreen_set(win->ee, fullscreen);
2579 #ifdef HAVE_ELEMENTARY_X
2580 _elm_win_xwin_update(win);
2583 #undef ENGINE_COMPARE
2587 elm_win_fullscreen_get(const Evas_Object *obj)
2590 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2591 win = elm_widget_data_get(obj);
2592 if (!win) return EINA_FALSE;
2595 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
2597 #define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
2598 >>>>>>> remotes/origin/upstream
2599 if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
2600 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
2602 // these engines... can ONLY be fullscreen
2608 return ecore_evas_fullscreen_get(win->ee);
2610 return win->fullscreen;
2611 >>>>>>> remotes/origin/upstream
2613 #undef ENGINE_COMPARE
2617 elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized)
2620 ELM_CHECK_WIDTYPE(obj, widtype);
2621 win = elm_widget_data_get(obj);
2625 win->maximized = maximized;
2626 >>>>>>> remotes/origin/upstream
2627 // YYY: handle if win->img_obj
2628 ecore_evas_maximized_set(win->ee, maximized);
2629 #ifdef HAVE_ELEMENTARY_X
2630 _elm_win_xwin_update(win);
2635 elm_win_maximized_get(const Evas_Object *obj)
2638 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2639 win = elm_widget_data_get(obj);
2640 if (!win) return EINA_FALSE;
2642 return ecore_evas_maximized_get(win->ee);
2644 return win->maximized;
2645 >>>>>>> remotes/origin/upstream
2649 elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified)
2652 ELM_CHECK_WIDTYPE(obj, widtype);
2653 win = elm_widget_data_get(obj);
2657 win->iconified = iconified;
2658 >>>>>>> remotes/origin/upstream
2659 ecore_evas_iconified_set(win->ee, iconified);
2660 #ifdef HAVE_ELEMENTARY_X
2661 _elm_win_xwin_update(win);
2666 elm_win_iconified_get(const Evas_Object *obj)
2669 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2670 win = elm_widget_data_get(obj);
2671 if (!win) return EINA_FALSE;
2673 return ecore_evas_iconified_get(win->ee);
2675 return win->iconified;
2679 elm_win_withdrawn_set(Evas_Object *obj, Eina_Bool withdrawn)
2682 ELM_CHECK_WIDTYPE(obj, widtype);
2683 win = elm_widget_data_get(obj);
2685 win->withdrawn = withdrawn;
2686 ecore_evas_withdrawn_set(win->ee, withdrawn);
2687 #ifdef HAVE_ELEMENTARY_X
2688 _elm_win_xwin_update(win);
2693 elm_win_withdrawn_get(const Evas_Object *obj)
2696 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2697 win = elm_widget_data_get(obj);
2698 if (!win) return EINA_FALSE;
2699 return win->withdrawn;
2703 elm_win_urgent_set(Evas_Object *obj, Eina_Bool urgent)
2706 ELM_CHECK_WIDTYPE(obj, widtype);
2707 win = elm_widget_data_get(obj);
2709 win->urgent = urgent;
2710 ecore_evas_urgent_set(win->ee, urgent);
2711 #ifdef HAVE_ELEMENTARY_X
2712 _elm_win_xwin_update(win);
2717 elm_win_urgent_get(const Evas_Object *obj)
2720 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2721 win = elm_widget_data_get(obj);
2722 if (!win) return EINA_FALSE;
2727 elm_win_demand_attention_set(Evas_Object *obj, Eina_Bool demand_attention)
2730 ELM_CHECK_WIDTYPE(obj, widtype);
2731 win = elm_widget_data_get(obj);
2733 win->demand_attention = demand_attention;
2734 ecore_evas_demand_attention_set(win->ee, demand_attention);
2735 #ifdef HAVE_ELEMENTARY_X
2736 _elm_win_xwin_update(win);
2741 elm_win_demand_attention_get(const Evas_Object *obj)
2744 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2745 win = elm_widget_data_get(obj);
2746 if (!win) return EINA_FALSE;
2747 return win->demand_attention;
2751 elm_win_modal_set(Evas_Object *obj, Eina_Bool modal)
2754 ELM_CHECK_WIDTYPE(obj, widtype);
2755 win = elm_widget_data_get(obj);
2758 ecore_evas_modal_set(win->ee, modal);
2759 #ifdef HAVE_ELEMENTARY_X
2760 _elm_win_xwin_update(win);
2765 elm_win_modal_get(const Evas_Object *obj)
2768 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2769 win = elm_widget_data_get(obj);
2770 if (!win) return EINA_FALSE;
2775 elm_win_aspect_set(Evas_Object *obj, double aspect)
2778 ELM_CHECK_WIDTYPE(obj, widtype);
2779 win = elm_widget_data_get(obj);
2781 win->aspect = aspect;
2782 ecore_evas_aspect_set(win->ee, aspect);
2783 #ifdef HAVE_ELEMENTARY_X
2784 _elm_win_xwin_update(win);
2789 elm_win_aspect_get(const Evas_Object *obj)
2792 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2793 win = elm_widget_data_get(obj);
2794 if (!win) return EINA_FALSE;
2796 >>>>>>> remotes/origin/upstream
2800 elm_win_layer_set(Evas_Object *obj, int layer)
2803 ELM_CHECK_WIDTYPE(obj, widtype);
2804 win = elm_widget_data_get(obj);
2806 ecore_evas_layer_set(win->ee, layer);
2807 #ifdef HAVE_ELEMENTARY_X
2808 _elm_win_xwin_update(win);
2813 elm_win_layer_get(const Evas_Object *obj)
2816 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2817 win = elm_widget_data_get(obj);
2818 if (!win) return -1;
2819 return ecore_evas_layer_get(win->ee);
2823 elm_win_rotation_set(Evas_Object *obj, int rotation)
2826 ELM_CHECK_WIDTYPE(obj, widtype);
2827 win = elm_widget_data_get(obj);
2829 if (win->rot == rotation) return;
2830 win->rot = rotation;
2831 ecore_evas_rotation_set(win->ee, rotation);
2832 evas_object_size_hint_min_set(obj, -1, -1);
2833 evas_object_size_hint_max_set(obj, -1, -1);
2834 _elm_win_eval_subobjs(obj);
2835 #ifdef HAVE_ELEMENTARY_X
2836 _elm_win_xwin_update(win);
2841 elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
2844 ELM_CHECK_WIDTYPE(obj, widtype);
2845 win = elm_widget_data_get(obj);
2847 if (win->rot == rotation) return;
2848 win->rot = rotation;
2849 ecore_evas_rotation_with_resize_set(win->ee, rotation);
2850 evas_object_size_hint_min_set(obj, -1, -1);
2851 evas_object_size_hint_max_set(obj, -1, -1);
2852 _elm_win_eval_subobjs(obj);
2853 #ifdef HAVE_ELEMENTARY_X
2854 _elm_win_xwin_update(win);
2859 elm_win_rotation_get(const Evas_Object *obj)
2862 ELM_CHECK_WIDTYPE(obj, widtype) -1;
2863 win = elm_widget_data_get(obj);
2864 if (!win) return -1;
2869 elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky)
2872 ELM_CHECK_WIDTYPE(obj, widtype);
2873 win = elm_widget_data_get(obj);
2877 win->sticky = sticky;
2878 >>>>>>> remotes/origin/upstream
2879 ecore_evas_sticky_set(win->ee, sticky);
2880 #ifdef HAVE_ELEMENTARY_X
2881 _elm_win_xwin_update(win);
2886 elm_win_sticky_get(const Evas_Object *obj)
2889 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2890 win = elm_widget_data_get(obj);
2891 if (!win) return EINA_FALSE;
2893 return ecore_evas_sticky_get(win->ee);
2896 >>>>>>> remotes/origin/upstream
2900 elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
2903 ELM_CHECK_WIDTYPE(obj, widtype);
2904 win = elm_widget_data_get(obj);
2906 if (mode == win->kbdmode) return;
2907 #ifdef HAVE_ELEMENTARY_X
2908 _elm_win_xwindow_get(win);
2910 win->kbdmode = mode;
2911 #ifdef HAVE_ELEMENTARY_X
2913 ecore_x_e_virtual_keyboard_state_set
2914 (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
2918 EAPI Elm_Win_Keyboard_Mode
2919 elm_win_keyboard_mode_get(const Evas_Object *obj)
2922 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_KEYBOARD_UNKNOWN;
2923 win = elm_widget_data_get(obj);
2924 if (!win) return ELM_WIN_KEYBOARD_UNKNOWN;
2925 return win->kbdmode;
2929 elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
2932 ELM_CHECK_WIDTYPE(obj, widtype);
2933 win = elm_widget_data_get(obj);
2935 #ifdef HAVE_ELEMENTARY_X
2936 _elm_win_xwindow_get(win);
2938 ecore_x_e_virtual_keyboard_set(win->xwin, is_keyboard);
2945 elm_win_keyboard_win_get(const Evas_Object *obj)
2948 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2949 win = elm_widget_data_get(obj);
2950 if (!win) return EINA_FALSE;
2951 #ifdef HAVE_ELEMENTARY_X
2952 _elm_win_xwindow_get(win);
2954 return ecore_x_e_virtual_keyboard_get(win->xwin);
2962 elm_win_indicator_mode_set(Evas_Object *obj, Elm_Win_Indicator_Mode mode)
2965 ELM_CHECK_WIDTYPE(obj, widtype);
2966 win = elm_widget_data_get(obj);
2968 if (mode == win->indmode) return;
2969 #ifdef HAVE_ELEMENTARY_X
2970 _elm_win_xwindow_get(win);
2972 win->indmode = mode;
2973 #ifdef HAVE_ELEMENTARY_X
2976 if (win->indmode == ELM_WIN_INDICATOR_SHOW)
2977 ecore_x_e_illume_indicator_state_set
2978 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
2979 else if (win->indmode == ELM_WIN_INDICATOR_HIDE)
2980 ecore_x_e_illume_indicator_state_set
2981 (win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
2986 EAPI Elm_Win_Indicator_Mode
2987 elm_win_indicator_mode_get(const Evas_Object *obj)
2990 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_INDICATOR_UNKNOWN;
2991 win = elm_widget_data_get(obj);
2992 if (!win) return ELM_WIN_INDICATOR_UNKNOWN;
2993 return win->indmode;
2997 elm_win_indicator_opacity_set(Evas_Object *obj, Elm_Win_Indicator_Opacity_Mode mode)
3000 ELM_CHECK_WIDTYPE(obj, widtype);
3001 win = elm_widget_data_get(obj);
3003 if (mode == win->ind_o_mode) return;
3004 win->ind_o_mode = mode;
3005 #ifdef HAVE_ELEMENTARY_X
3006 _elm_win_xwindow_get(win);
3009 if (win->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
3010 ecore_x_e_illume_indicator_opacity_set
3011 (win->xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
3012 else if (win->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
3013 ecore_x_e_illume_indicator_opacity_set
3014 (win->xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
3015 else if (win->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
3016 ecore_x_e_illume_indicator_opacity_set
3017 (win->xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
3023 EAPI Elm_Win_Indicator_Opacity_Mode
3024 elm_win_indicator_opacity_get(const Evas_Object *obj)
3027 ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
3028 win = elm_widget_data_get(obj);
3029 if (!win) return ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
3030 return win->ind_o_mode;
3034 >>>>>>> remotes/origin/upstream
3035 elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
3038 ELM_CHECK_WIDTYPE(obj, widtype);
3039 win = elm_widget_data_get(obj);
3041 if (x) *x = win->screen.x;
3042 if (y) *y = win->screen.y;
3046 elm_win_focus_get(const Evas_Object *obj)
3049 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
3050 win = elm_widget_data_get(obj);
3051 if (!win) return EINA_FALSE;
3052 return ecore_evas_focus_get(win->ee);
3056 elm_win_screen_constrain_set(Evas_Object *obj, Eina_Bool constrain)
3059 ELM_CHECK_WIDTYPE(obj, widtype);
3060 win = elm_widget_data_get(obj);
3062 win->constrain = !!constrain;
3066 elm_win_screen_constrain_get(Evas_Object *obj)
3069 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
3070 win = elm_widget_data_get(obj);
3071 if (!win) return EINA_FALSE;
3072 return win->constrain;
3076 elm_win_screen_size_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
3079 ELM_CHECK_WIDTYPE(obj, widtype);
3080 win = elm_widget_data_get(obj);
3082 ecore_evas_screen_geometry_get(win->ee, x, y, w, h);
3086 elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
3089 ELM_CHECK_WIDTYPE(obj, widtype);
3090 win = elm_widget_data_get(obj);
3092 #ifdef HAVE_ELEMENTARY_X
3093 _elm_win_xwindow_get(win);
3095 ecore_x_e_illume_conformant_set(win->xwin, conformant);
3102 elm_win_conformant_get(const Evas_Object *obj)
3105 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
3106 win = elm_widget_data_get(obj);
3107 if (!win) return EINA_FALSE;
3108 #ifdef HAVE_ELEMENTARY_X
3109 _elm_win_xwindow_get(win);
3111 return ecore_x_e_illume_conformant_get(win->xwin);
3117 elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel)
3120 ELM_CHECK_WIDTYPE(obj, widtype);
3121 win = elm_widget_data_get(obj);
3123 #ifdef HAVE_ELEMENTARY_X
3124 _elm_win_xwindow_get(win);
3127 ecore_x_e_illume_quickpanel_set(win->xwin, quickpanel);
3130 Ecore_X_Window_State states[2];
3132 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
3133 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
3134 ecore_x_netwm_window_state_set(win->xwin, states, 2);
3135 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
3144 elm_win_quickpanel_get(const Evas_Object *obj)
3147 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
3148 win = elm_widget_data_get(obj);
3149 if (!win) return EINA_FALSE;
3150 #ifdef HAVE_ELEMENTARY_X
3151 _elm_win_xwindow_get(win);
3153 return ecore_x_e_illume_quickpanel_get(win->xwin);
3159 elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority)
3162 ELM_CHECK_WIDTYPE(obj, widtype);
3163 win = elm_widget_data_get(obj);
3165 #ifdef HAVE_ELEMENTARY_X
3166 _elm_win_xwindow_get(win);
3168 ecore_x_e_illume_quickpanel_priority_major_set(win->xwin, priority);
3175 elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
3178 ELM_CHECK_WIDTYPE(obj, widtype) -1;
3179 win = elm_widget_data_get(obj);
3180 if (!win) return -1;
3181 #ifdef HAVE_ELEMENTARY_X
3182 _elm_win_xwindow_get(win);
3184 return ecore_x_e_illume_quickpanel_priority_major_get(win->xwin);
3190 elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority)
3193 ELM_CHECK_WIDTYPE(obj, widtype);
3194 win = elm_widget_data_get(obj);
3196 #ifdef HAVE_ELEMENTARY_X
3197 _elm_win_xwindow_get(win);
3199 ecore_x_e_illume_quickpanel_priority_minor_set(win->xwin, priority);
3206 elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
3209 ELM_CHECK_WIDTYPE(obj, widtype) -1;
3210 win = elm_widget_data_get(obj);
3211 if (!win) return -1;
3212 #ifdef HAVE_ELEMENTARY_X
3213 _elm_win_xwindow_get(win);
3215 return ecore_x_e_illume_quickpanel_priority_minor_get(win->xwin);
3221 elm_win_quickpanel_zone_set(Evas_Object *obj, int zone)
3224 ELM_CHECK_WIDTYPE(obj, widtype);
3225 win = elm_widget_data_get(obj);
3227 #ifdef HAVE_ELEMENTARY_X
3228 _elm_win_xwindow_get(win);
3230 ecore_x_e_illume_quickpanel_zone_set(win->xwin, zone);
3237 elm_win_quickpanel_zone_get(const Evas_Object *obj)
3240 ELM_CHECK_WIDTYPE(obj, widtype) 0;
3241 win = elm_widget_data_get(obj);
3243 #ifdef HAVE_ELEMENTARY_X
3244 _elm_win_xwindow_get(win);
3246 return ecore_x_e_illume_quickpanel_zone_get(win->xwin);
3252 elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip)
3255 ELM_CHECK_WIDTYPE(obj, widtype);
3256 win = elm_widget_data_get(obj);
3259 #ifdef HAVE_ELEMENTARY_X
3260 _elm_win_xwindow_get(win);
3265 Ecore_X_Window_State states[2];
3267 ecore_x_icccm_hints_set(win->xwin, 0, 0, 0, 0, 0, 0, 0);
3268 states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
3269 states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
3270 ecore_x_netwm_window_state_set(win->xwin, states, 2);
3277 win->skip_focus = skip;
3278 ecore_evas_focus_skip_set(win->ee, skip);
3279 >>>>>>> remotes/origin/upstream
3283 elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *params __UNUSED__)
3286 ELM_CHECK_WIDTYPE(obj, widtype);
3287 win = elm_widget_data_get(obj);
3289 #ifdef HAVE_ELEMENTARY_X
3290 _elm_win_xwindow_get(win);
3295 case ELM_ILLUME_COMMAND_FOCUS_BACK:
3296 ecore_x_e_illume_focus_back_send(win->xwin);
3298 case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
3299 ecore_x_e_illume_focus_forward_send(win->xwin);
3301 case ELM_ILLUME_COMMAND_FOCUS_HOME:
3302 ecore_x_e_illume_focus_home_send(win->xwin);
3304 case ELM_ILLUME_COMMAND_CLOSE:
3305 ecore_x_e_illume_close_send(win->xwin);
3317 elm_win_inlined_image_object_get(Evas_Object *obj)
3320 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
3321 win = elm_widget_data_get(obj);
3322 if (!win) return NULL;
3323 return win->img_obj;
3327 elm_win_focus_highlight_enabled_set(Evas_Object *obj, Eina_Bool enabled)
3331 ELM_CHECK_WIDTYPE(obj, widtype);
3333 win = elm_widget_data_get(obj);
3334 enabled = !!enabled;
3335 if (win->focus_highlight.enabled == enabled)
3338 win->focus_highlight.enabled = enabled;
3340 if (win->focus_highlight.enabled)
3341 _elm_win_focus_highlight_init(win);
3343 _elm_win_focus_highlight_shutdown(win);
3347 elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
3351 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
3353 win = elm_widget_data_get(obj);
3354 return win->focus_highlight.enabled;
3358 elm_win_focus_highlight_style_set(Evas_Object *obj, const char *style)
3362 ELM_CHECK_WIDTYPE(obj, widtype);
3364 win = elm_widget_data_get(obj);
3365 eina_stringshare_replace(&win->focus_highlight.style, style);
3366 win->focus_highlight.changed_theme = EINA_TRUE;
3367 _elm_win_focus_highlight_reconfigure_job_start(win);
3371 elm_win_focus_highlight_style_get(const Evas_Object *obj)
3375 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
3377 win = elm_widget_data_get(obj);
3378 return win->focus_highlight.style;
3383 elm_win_indicator_state_set(Evas_Object *obj, int show_state)
3386 if (strcmp(elm_widget_type_get(obj), "win")) return;
3387 win = elm_widget_data_get(obj);
3389 #ifdef HAVE_ELEMENTARY_X
3390 _elm_win_xwindow_get(win);
3392 return ecore_x_window_prop_property_set (win->xwin,
3393 ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE, ECORE_X_ATOM_CARDINAL, 32, &show_state, 1);
3399 elm_win_indicator_state_get(Evas_Object *obj)
3402 if (strcmp(elm_widget_type_get(obj), "win")) return -1;
3403 win = elm_widget_data_get(obj);
3404 if (!win) return -1;
3405 #ifdef HAVE_ELEMENTARY_X
3406 _elm_win_xwindow_get(win);
3412 unsigned int *prop_data = NULL;
3414 ret = ecore_x_window_prop_property_get (win->xwin,
3415 ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE, ECORE_X_ATOM_CARDINAL, 32, (void *)&prop_data, &count);
3416 if( ret && prop_data )
3417 memcpy (&show, prop_data, sizeof (int));
3419 if (prop_data) free (prop_data);
3429 >>>>>>> remotes/origin/upstream
3430 typedef struct _Widget_Data Widget_Data;
3435 Evas_Object *content;
3438 static void _del_hook(Evas_Object *obj);
3439 static void _theme_hook(Evas_Object *obj);
3440 static void _sizing_eval(Evas_Object *obj);
3441 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
3442 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
3444 static const char *widtype2 = NULL;
3447 _del_hook(Evas_Object *obj)
3449 Widget_Data *wd = elm_widget_data_get(obj);
3455 _theme_hook(Evas_Object *obj)
3457 Widget_Data *wd = elm_widget_data_get(obj);
3458 _elm_theme_object_set(obj, wd->frm, "win", "inwin", elm_widget_style_get(obj));
3460 edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content);
3463 evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
3467 _elm_inwin_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
3469 Widget_Data *wd = elm_widget_data_get(obj);
3474 /* Try Focus cycle in subitem */
3477 elm_widget_focus_next_get(wd->content, dir, next);
3482 *next = (Evas_Object *)obj;
3489 _elm_inwin_text_set_hook(Evas_Object *obj, const char *item, const char *text)
3491 Widget_Data *wd = elm_widget_data_get(obj);
3493 if (!wd || !item) return;
3494 edje_object_part_text_set(wd->frm, item, text);
3499 _elm_inwin_text_get_hook(const Evas_Object *obj, const char *item)
3501 Widget_Data *wd = elm_widget_data_get(obj);
3503 if (!item || !wd || !wd->frm) return NULL;
3504 return edje_object_part_text_get(wd->frm, item);
3508 >>>>>>> remotes/origin/upstream
3509 _sizing_eval(Evas_Object *obj)
3511 Widget_Data *wd = elm_widget_data_get(obj);
3512 Evas_Coord minw = -1, minh = -1;
3514 evas_object_size_hint_min_get(wd->content, &minw, &minh);
3515 edje_object_size_min_calc(wd->frm, &minw, &minh);
3516 evas_object_size_hint_min_set(obj, minw, minh);
3517 evas_object_size_hint_max_set(obj, -1, -1);
3521 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
3527 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
3529 Widget_Data *wd = elm_widget_data_get(obj);
3530 Evas_Object *sub = event_info;
3531 if (sub == wd->content)
3533 evas_object_event_callback_del_full
3534 (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
3541 elm_win_inwin_add(Evas_Object *obj)
3547 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
3548 win = elm_widget_data_get(obj);
3549 if (!win) return NULL;
3550 wd = ELM_NEW(Widget_Data);
3551 obj2 = elm_widget_add(win->evas);
3552 elm_widget_type_set(obj2, "inwin");
3553 ELM_SET_WIDTYPE(widtype2, "inwin");
3554 elm_widget_sub_object_add(obj, obj2);
3555 evas_object_size_hint_weight_set(obj2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3556 evas_object_size_hint_align_set(obj2, EVAS_HINT_FILL, EVAS_HINT_FILL);
3557 elm_win_resize_object_add(obj, obj2);
3559 elm_widget_data_set(obj2, wd);
3560 elm_widget_del_hook_set(obj2, _del_hook);
3561 elm_widget_theme_hook_set(obj2, _theme_hook);
3562 elm_widget_focus_next_hook_set(obj2, _elm_inwin_focus_next_hook);
3565 elm_widget_text_set_hook_set(obj2, _elm_inwin_text_set_hook);
3566 elm_widget_text_get_hook_set(obj2, _elm_inwin_text_get_hook);
3567 >>>>>>> remotes/origin/upstream
3568 elm_widget_can_focus_set(obj2, EINA_TRUE);
3569 elm_widget_highlight_ignore_set(obj2, EINA_TRUE);
3571 wd->frm = edje_object_add(win->evas);
3572 _elm_theme_object_set(obj, wd->frm, "win", "inwin", "default");
3573 elm_widget_resize_object_set(obj2, wd->frm);
3575 evas_object_smart_callback_add(obj2, "sub-object-del", _sub_del, obj2);
3582 elm_win_inwin_activate(Evas_Object *obj)
3584 ELM_CHECK_WIDTYPE(obj, widtype2);
3585 Widget_Data *wd = elm_widget_data_get(obj);
3587 evas_object_raise(obj);
3588 evas_object_show(obj);
3589 edje_object_signal_emit(wd->frm, "elm,action,show", "elm");
3590 elm_object_focus_set(obj, EINA_TRUE);
3594 elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
3596 ELM_CHECK_WIDTYPE(obj, widtype2);
3597 Widget_Data *wd = elm_widget_data_get(obj);
3599 if (wd->content == content) return;
3600 if (wd->content) evas_object_del(wd->content);
3601 wd->content = content;
3604 elm_widget_sub_object_add(obj, content);
3605 evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3606 _changed_size_hints, obj);
3607 edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
3613 elm_win_inwin_content_get(const Evas_Object *obj)
3615 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
3616 Widget_Data *wd = elm_widget_data_get(obj);
3617 if (!wd) return NULL;
3622 elm_win_inwin_content_unset(Evas_Object *obj)
3624 ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
3625 Widget_Data *wd = elm_widget_data_get(obj);
3626 if (!wd) return NULL;
3627 if (!wd->content) return NULL;
3628 Evas_Object *content = wd->content;
3629 elm_widget_sub_object_del(obj, wd->content);
3630 evas_object_event_callback_del_full(wd->content,
3631 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
3632 _changed_size_hints, obj);
3633 edje_object_part_unswallow(wd->frm, wd->content);
3639 elm_win_socket_listen(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
3644 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
3645 win = elm_widget_data_get(obj);
3646 if (!win) return EINA_FALSE;
3647 if (!win->ee) return EINA_FALSE;
3649 if(!ecore_evas_extn_socket_listen(win->ee, svcname, svcnum, svcsys))
3655 /* windowing spcific calls - shall we do this differently? */
3657 static Ecore_X_Window
3658 _elm_ee_win_get(const Evas_Object *obj)
3661 #ifdef HAVE_ELEMENTARY_X
3662 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
3663 if (ee) return (Ecore_X_Window)ecore_evas_window_get(ee);
3669 elm_win_xwindow_get(const Evas_Object *obj)
3675 type = elm_widget_type_get(obj);
3676 if ((!type) || (type != widtype)) return _elm_ee_win_get(obj);
3677 win = elm_widget_data_get(obj);
3679 #ifdef HAVE_ELEMENTARY_X
3680 if (win->xwin) return win->xwin;
3681 if (win->parent) return elm_win_xwindow_get(win->parent);