jypark pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=242f79a98c27cb34c00847641652277ce4f5ac48
commit 242f79a98c27cb34c00847641652277ce4f5ac48 Author: Ji-Youn Park <jy0703.p...@samsung.com> Date: Fri Jun 3 15:06:13 2016 +0830 elm_win: remove main_menu, window_id, fake_canvas property from eo --- src/lib/elementary/elm_win.c | 237 +++++++++++++++++++----------------- src/lib/elementary/elm_win.eo | 27 ---- src/lib/elementary/elm_win_legacy.h | 62 +++++----- 3 files changed, 155 insertions(+), 171 deletions(-) diff --git a/src/lib/elementary/elm_win.c b/src/lib/elementary/elm_win.c index 0cb8574..77a4aef 100644 --- a/src/lib/elementary/elm_win.c +++ b/src/lib/elementary/elm_win.c @@ -3438,7 +3438,7 @@ elm_win_add(Evas_Object *parent, EAPI Evas_Object * elm_win_fake_add(Ecore_Evas *ee) { - return eo_add(MY_CLASS, NULL, elm_obj_win_fake_canvas_set(eo_self, ee), elm_obj_win_name_set(eo_self, NULL), elm_obj_win_type_set(eo_self, ELM_WIN_FAKE)); + return eo_add(MY_CLASS, NULL, elm_win_fake_canvas_set(eo_self, ee), elm_obj_win_name_set(eo_self, NULL), elm_obj_win_type_set(eo_self, ELM_WIN_FAKE)); } static void @@ -4173,12 +4173,6 @@ _elm_win_eo_base_constructor(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED) } EOLIAN static void -_elm_win_fake_canvas_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Ecore_Evas *oee) -{ - pd->ee = oee; -} - -EOLIAN static void _elm_win_type_set(Eo *obj, Elm_Win_Data *sd, Elm_Win_Type type) { if (eo_finalized_get(obj)) @@ -4581,36 +4575,6 @@ _dbus_menu_set(Eina_Bool dbus_connect, void *data) } } -EOLIAN static Evas_Object * -_elm_win_main_menu_get(Eo *obj, Elm_Win_Data *sd) -{ -#ifdef HAVE_ELEMENTARY_X - Eina_Bool use_dbus = EINA_FALSE; -#endif - - if (sd->main_menu) goto end; - - sd->main_menu = elm_menu_add(obj); - _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE); - -#ifdef HAVE_ELEMENTARY_X - if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE; -#endif - -#ifdef HAVE_ELEMENTARY_X - if (use_dbus && _elm_dbus_menu_register(sd->main_menu)) - { - _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu, - _dbus_menu_set, obj); - } - else -#endif - _dbus_menu_set(EINA_FALSE, obj); - -end: - return sd->main_menu; -} - EOLIAN static void _elm_win_maximized_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool maximized) { @@ -5268,67 +5232,6 @@ elm_win_floating_mode_get(const Evas_Object *obj) return sd->floating; } -EOLIAN static Ecore_Window -_elm_win_window_id_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) -{ - const char *engine_name = ecore_evas_engine_name_get(sd->ee); - - if ((engine_name && - ((!strcmp(engine_name, ELM_WAYLAND_SHM)) || - (!strcmp(engine_name, ELM_WAYLAND_EGL))))) - { -#if HAVE_ELEMENTARY_WL2 - if (sd->wl.win) - return (Ecore_Window)ecore_wl2_window_id_get(sd->wl.win); - if (sd->parent) - { - Ecore_Wl2_Window *parent; - - parent = elm_win_wl_window_get(sd->parent); - if (parent) - return (Ecore_Window)ecore_wl2_window_id_get(parent); - return 0; - } -#endif - } - else if ((engine_name && - ((!strcmp(engine_name, ELM_SOFTWARE_X11)) || - (!strcmp(engine_name, ELM_OPENGL_X11))))) - { -#ifdef HAVE_ELEMENTARY_X - _internal_elm_win_xwindow_get(sd); - if (sd->x.xwin) return (Ecore_Window)sd->x.xwin; - if (sd->parent) return (Ecore_Window)elm_win_xwindow_get(sd->parent); -#endif - } - else if (engine_name && - ((!strcmp(engine_name, ELM_OPENGL_COCOA)) || - (!strcmp(engine_name, "gl_cocoa")))) - { -#ifdef HAVE_ELEMENTARY_COCOA - if (sd->cocoa.win) return (Ecore_Window)(sd->cocoa.win); - if (sd->parent) - { - Ecore_Cocoa_Window *pwin; - pwin = elm_win_cocoa_window_get(sd->parent); - return (Ecore_Window)pwin; - } -#endif - } - else if ((engine_name && - ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) || - (!strcmp(engine_name, ELM_SOFTWARE_DDRAW))))) - { -#ifdef HAVE_ELEMENTARY_WIN32 - _internal_elm_win_win32window_get(sd); - if (sd->win32.win) return (Ecore_Window)sd->win32.win; - if (sd->parent) return (Ecore_Window)elm_win_win32_window_get(sd->parent); -#endif - } - - return 0; -} - void _elm_win_focus_highlight_in_theme_update(Evas_Object *obj, Eina_Bool in_theme) { @@ -5375,23 +5278,6 @@ _elm_win_focus_auto_hide(Evas_Object *obj) } } -EAPI Ecore_Window -elm_win_window_id_get(const Evas_Object *obj) -{ - if (!obj) return 0; - - if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY)) - { - Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); - return ecore_evas_window_get(ee); - } - - ELM_WIN_CHECK(obj) 0; - Ecore_Window ret = 0; - ret = elm_obj_win_window_id_get((Eo *) obj); - return ret; -} - static Eina_Bool _on_atspi_bus_connected(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) { @@ -6464,4 +6350,125 @@ elm_win_inlined_image_object_get(const Evas_Object *obj) return sd->img_obj; } +static Ecore_Window +_elm_win_window_id_get(Elm_Win_Data *sd) +{ + const char *engine_name = ecore_evas_engine_name_get(sd->ee); + + if ((engine_name && + ((!strcmp(engine_name, ELM_WAYLAND_SHM)) || + (!strcmp(engine_name, ELM_WAYLAND_EGL))))) + { +#if HAVE_ELEMENTARY_WL2 + if (sd->wl.win) + return (Ecore_Window)ecore_wl2_window_id_get(sd->wl.win); + if (sd->parent) + { + Ecore_Wl2_Window *parent; + + parent = elm_win_wl_window_get(sd->parent); + if (parent) + return (Ecore_Window)ecore_wl2_window_id_get(parent); + return 0; + } +#endif + } + else if ((engine_name && + ((!strcmp(engine_name, ELM_SOFTWARE_X11)) || + (!strcmp(engine_name, ELM_OPENGL_X11))))) + { +#ifdef HAVE_ELEMENTARY_X + _internal_elm_win_xwindow_get(sd); + if (sd->x.xwin) return (Ecore_Window)sd->x.xwin; + if (sd->parent) return (Ecore_Window)elm_win_xwindow_get(sd->parent); +#endif + } + else if (engine_name && + ((!strcmp(engine_name, ELM_OPENGL_COCOA)) || + (!strcmp(engine_name, "gl_cocoa")))) + { +#ifdef HAVE_ELEMENTARY_COCOA + if (sd->cocoa.win) return (Ecore_Window)(sd->cocoa.win); + if (sd->parent) + { + Ecore_Cocoa_Window *pwin; + pwin = elm_win_cocoa_window_get(sd->parent); + return (Ecore_Window)pwin; + } +#endif + } + else if ((engine_name && + ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) || + (!strcmp(engine_name, ELM_SOFTWARE_DDRAW))))) + { +#ifdef HAVE_ELEMENTARY_WIN32 + _internal_elm_win_win32window_get(sd); + if (sd->win32.win) return (Ecore_Window)sd->win32.win; + if (sd->parent) return (Ecore_Window)elm_win_win32_window_get(sd->parent); +#endif + } + + return 0; +} + +EAPI Ecore_Window +elm_win_window_id_get(const Evas_Object *obj) +{ + if (!obj) return 0; + + if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY)) + { + Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); + return ecore_evas_window_get(ee); + } + + ELM_WIN_CHECK(obj) 0; + ELM_WIN_DATA_GET_OR_RETURN(obj, sd, 0); + Ecore_Window ret = 0; + ret = _elm_win_window_id_get(sd); + return ret; +} + +EAPI void +elm_win_fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee) +{ + ELM_WIN_CHECK(obj); + ELM_WIN_DATA_GET_OR_RETURN(obj, sd); + + sd->ee = oee; +} + +EAPI Evas_Object * +elm_win_main_menu_get(Evas_Object *obj) +{ + ELM_WIN_CHECK(obj) NULL; + ELM_WIN_DATA_GET_OR_RETURN(obj, sd, NULL); + +#ifdef HAVE_ELEMENTARY_X + Eina_Bool use_dbus = EINA_FALSE; +#endif + + if (sd->main_menu) goto end; + + sd->main_menu = elm_menu_add(obj); + _elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE); + +#ifdef HAVE_ELEMENTARY_X + if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE; +#endif + +#ifdef HAVE_ELEMENTARY_X + if (use_dbus && _elm_dbus_menu_register(sd->main_menu)) + { + _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu, + _dbus_menu_set, obj); + } + else +#endif + _dbus_menu_set(EINA_FALSE, obj); + +end: + return sd->main_menu; +} + #include "elm_win.eo.c" diff --git a/src/lib/elementary/elm_win.eo b/src/lib/elementary/elm_win.eo index bd3c8ca..30644de 100644 --- a/src/lib/elementary/elm_win.eo +++ b/src/lib/elementary/elm_win.eo @@ -655,33 +655,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, otherwise it is width divided by height.]] } } - @property main_menu { - get { - [[Get the Main Menu of a window.]] - return: Evas.Object; [[The Main Menu of the window ($null on error).]] - } - } - @property window_id { - get { - [[Get the Ecore_Window of an Evas_Object - - When Elementary is using a Wayland engine, this function - will return the surface id of the elm window's surface. - - @since 1.8 - ]] - return: Ecore_Window; [[The Ecore_Window of an Evas_Object.]] - legacy: null; - } - } - @property fake_canvas @protected { - set { - [[Internal. Used to completent the fake window type.]] - } - values { - oee: Ecore_Evas *; - } - } socket_listen { [[Create a socket to provide the service for Plug widget.]] return: bool; diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index ad36279..5930f35 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -281,21 +281,6 @@ EAPI Ecore_Win32_Window *elm_win_win32_window_get(const Evas_Object *obj); EAPI void elm_win_wm_rotation_preferred_rotation_set(Evas_Object *obj, int rotation); /** - * Get the Ecore_Window of an Evas_Object - * - * When Elementary is using a Wayland engine, this function will return the surface id of the elm window's surface. - * - * @param obj The window object - * @return The Ecore_Window of an Evas_Object - * - * @ingroup Elm_Win - * @since 1.8 - * @note Unless you are getting the window id for the purpose of communicating between client<->compositor over dbus, - * this is definitely not the function you are looking for. - */ -EAPI Ecore_Window elm_win_window_id_get(const Evas_Object *obj); - -/** * @brief Add @c subobj as a resize object of window @c obj. * * Setting an object as a resize object of the window means that the @c subobj @@ -376,20 +361,6 @@ EAPI Ecore_Win32_Window *elm_win_win32_window_get(const Evas_Object *obj); EAPI Ecore_Cocoa_Window *elm_win_cocoa_window_get(const Evas_Object *obj); /** - * @brief Get the Ecore_Window of an Evas_Object - * - * When Elementary is using a Wayland engine, this function will return the - * surface id of the elm window's surface. - * - * @return The Ecore_Window of an Evas_Object. - * - * @since 1.8 - * - * @ingroup Elm_Win - */ -EAPI Ecore_Window elm_win_window_id_get(const Evas_Object *obj); - -/** * @brief Get the trap data associated with a window. * * @return The trap data of the window. @@ -1000,3 +971,36 @@ EAPI int elm_win_layer_get(const Evas_Object *obj); */ EAPI Evas_Object *elm_win_inlined_image_object_get(const Evas_Object *obj); +/** + * @brief Internal. Used to completent the fake window type. + * + * @param[in] oee + * + * @ingroup Elm_Win + */ +EAPI void elm_win_fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee); + +/** + * Get the Ecore_Window of an Evas_Object + * + * When Elementary is using a Wayland engine, this function will return the surface id of the elm window's surface. + * + * @param obj The window object + * @return The Ecore_Window of an Evas_Object + * + * @ingroup Elm_Win + * @since 1.8 + * @note Unless you are getting the window id for the purpose of communicating between client<->compositor over dbus, + * this is definitely not the function you are looking for. + */ +EAPI Ecore_Window elm_win_window_id_get(const Evas_Object *obj); + +/** + * @brief Get the Main Menu of a window. + * + * @return The Main Menu of the window ($null on error). + * + * @ingroup Elm_Win + */ +EAPI Evas_Object *elm_win_main_menu_get(Evas_Object *obj); + --