From 2e8cbfe9b43220a88b1024a1fe412bc0009e28d4 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Fri, 14 Sep 2012 13:06:57 +0000 Subject: [PATCH] From: Doyoun Kang Subject: [E-devel] [patch] Add APIs for floating mode I added APIs for supporting the floating mode - elm_win_floating_mode_set, elm_win_floating_mode_get. The floating mode will be used on mobile environment. For example, if the video-player window set the floating mode, then e (enlightenment window manager) changes it's geometry and handles it like a popup. Please check these APIs and give an advice for me. SVN revision: 76667 --- legacy/elementary/ChangeLog | 8 +++++++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elm_win.c | 33 +++++++++++++++++++++++++++++ legacy/elementary/src/lib/elm_win.h | 24 +++++++++++++++++++++ 4 files changed, 66 insertions(+) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 4fa62c1e08..0d60ef0af7 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -502,3 +502,11 @@ - elm_layout_text_get - elm_layout_text_set - elm_layout_theme_set + +2012-09-14 Doyoun Kang + + * Add APIs for floating mode + - elm_win_floating_mode_set + - elm_win_floating_mode_get + + diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 3c89e57825..fea60820c8 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -5,6 +5,7 @@ Additions: * Add ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN. * Add elementary_codegen + * Add window floating mode api's Improvements: diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index 28d6c85b41..ae0ecde8e0 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -144,6 +144,7 @@ struct _Elm_Win_Smart_Data Eina_Bool fullscreen : 1; Eina_Bool maximized : 1; Eina_Bool skip_focus : 1; + Eina_Bool floating : 1; }; static const char SIG_DELETE_REQUEST[] = "delete,request"; @@ -4035,3 +4036,35 @@ elm_win_trap_set(const Elm_Win_Trap *t) trap = t; return EINA_TRUE; } + +EAPI void +elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating) +{ + ELM_WIN_CHECK(obj); + ELM_WIN_DATA_GET_OR_RETURN(obj, sd); + + if (floating == sd->floating) return; + sd->floating = floating; +#ifdef HAVE_ELEMENTARY_X + _elm_win_xwindow_get(sd); + if (sd->x.xwin) + { + if (sd->floating) + ecore_x_e_illume_window_state_set + (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING); + else + ecore_x_e_illume_window_state_set + (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL); + } +#endif +} + +EAPI Eina_Bool +elm_win_floating_mode_get(const Evas_Object *obj) +{ + ELM_WIN_CHECK(obj) EINA_FALSE; + ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE); + + return sd->floating; +} + diff --git a/legacy/elementary/src/lib/elm_win.h b/legacy/elementary/src/lib/elm_win.h index 66566e52bc..79aa7ba943 100644 --- a/legacy/elementary/src/lib/elm_win.h +++ b/legacy/elementary/src/lib/elm_win.h @@ -1480,6 +1480,30 @@ struct _Elm_Win_Trap */ EAPI Eina_Bool elm_win_trap_set(const Elm_Win_Trap *trap); +/** + * Set the floating mode of a window. + * + * @param obj The window object + * @param floating If true, the window is floating mode + * + * @ingroup Win + * @see elm_win_floating_mode_get() + * @since 1.8 + */ +EAPI void elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating); + +/** + * Get the floating mode of a window. + * + * @param obj The window object + * @return If true, the window is floating mode + * + * @ingroup Win + * @see elm_win_floating_mode_set() + * @since 1.8 + */ +EAPI Eina_Bool elm_win_floating_mode_get(const Evas_Object *obj); + /** * @} */