From 2bf508836de65f5d92141e2747685a9f225537e5 Mon Sep 17 00:00:00 2001 From: Ji-Youn Park Date: Thu, 2 Jun 2016 16:48:17 +0830 Subject: [PATCH] Efl.Gfx.Size.Hint: add Efl.Gfx.Size.Hint skeletton create Efl.Gfx.Size.Hint skeletton and change elm_win eo. remove size_step and size_base API from elm_win and inherit from Efl.Gfx.Size.hint --- src/Makefile_Efl.am | 1 + src/lib/efl/Efl.h | 1 + src/lib/efl/Makefile.am | 1 + src/lib/efl/interfaces/efl_gfx_size_hint.eo | 42 ++++++++++++++++ src/lib/efl/interfaces/efl_interfaces_main.c | 2 + src/lib/elementary/elm_win.c | 32 ++++++++++-- src/lib/elementary/elm_win.eo | 49 +++--------------- src/lib/elementary/elm_win_legacy.h | 52 ++++++++++++++++++++ 8 files changed, 133 insertions(+), 47 deletions(-) create mode 100644 src/lib/efl/interfaces/efl_gfx_size_hint.eo diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 594e6eb9ce..d9119eb2cf 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -23,6 +23,7 @@ efl_eolian_files = \ lib/efl/interfaces/efl_gfx_gradient_linear.eo \ lib/efl/interfaces/efl_gfx_gradient_radial.eo \ lib/efl/interfaces/efl_gfx_filter.eo \ + lib/efl/interfaces/efl_gfx_size_hint.eo \ lib/efl/interfaces/efl_model.eo \ lib/efl/interfaces/efl_animator.eo \ lib/efl/interfaces/efl_orientation.eo \ diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 777c874fe8..0dba0f2f04 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -106,6 +106,7 @@ EAPI extern const Eo_Event_Description _EFL_GFX_PATH_CHANGED; #include "interfaces/efl_gfx_gradient_linear.eo.h" #include "interfaces/efl_gfx_gradient_radial.eo.h" #include "interfaces/efl_gfx_filter.eo.h" +#include "interfaces/efl_gfx_size_hint.eo.h" #define EFL_GFX_COLOR_SET(value) (value << 8) #define EFL_GFX_COLOR16_SET(value) (value) diff --git a/src/lib/efl/Makefile.am b/src/lib/efl/Makefile.am index b8c22f35de..f6138e6f51 100644 --- a/src/lib/efl/Makefile.am +++ b/src/lib/efl/Makefile.am @@ -25,6 +25,7 @@ interfaces/efl_gfx_gradient.eo \ interfaces/efl_gfx_gradient_linear.eo \ interfaces/efl_gfx_gradient_radial.eo \ interfaces/efl_gfx_filter.eo \ +interfaces/efl_gfx_size_hint.eo \ interfaces/efl_model.eo \ interfaces/efl_animator.eo \ interfaces/efl_orientation.eo \ diff --git a/src/lib/efl/interfaces/efl_gfx_size_hint.eo b/src/lib/efl/interfaces/efl_gfx_size_hint.eo new file mode 100644 index 0000000000..6e86fbc887 --- /dev/null +++ b/src/lib/efl/interfaces/efl_gfx_size_hint.eo @@ -0,0 +1,42 @@ +interface Efl.Gfx.Size.Hint { + methods { + @property base { + set { + [[Set the hint for an object's base size used with stepping calculation + + Base size + stepping is what is calculated for object sizing + restrictions. + + ]] + } + get { + [[Get the base size of an object. + + ]] + } + values { + w: int; [[The base width.]] + h: int; [[The base height.]] + } + } + @property step { + set { + [[Set the hint for an object stepping used with sizing calculation. + + Base size + stepping is what is calculated for object sizing + restrictions. + + ]] + } + get { + [[Get the stepping of an object. + + ]] + } + values { + w: int; [[The stepping width (0 disables).]] + h: int; [[The stepping height (0 disables).]] + } + } + } +} diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index 71241bdb8d..10ae01a0e7 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -26,6 +26,8 @@ #include "interfaces/efl_gfx_filter.eo.c" +#include "interfaces/efl_gfx_size_hint.eo.c" + #include "interfaces/efl_vpath.eo.c" #include "interfaces/efl_screen.eo.c" diff --git a/src/lib/elementary/elm_win.c b/src/lib/elementary/elm_win.c index bcd43050b9..8b717837f4 100644 --- a/src/lib/elementary/elm_win.c +++ b/src/lib/elementary/elm_win.c @@ -4735,7 +4735,7 @@ _elm_win_aspect_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) } EOLIAN static void -_elm_win_size_base_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h) +_elm_win_efl_gfx_size_hint_base_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h) { sd->size_base_w = w; sd->size_base_h = h; @@ -4746,14 +4746,14 @@ _elm_win_size_base_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h) } EOLIAN static void -_elm_win_size_base_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h) +_elm_win_efl_gfx_size_hint_base_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h) { if (w) *w = sd->size_base_w; if (h) *h = sd->size_base_h; } EOLIAN static void -_elm_win_size_step_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h) +_elm_win_efl_gfx_size_hint_step_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h) { sd->size_step_w = w; sd->size_step_h = h; @@ -4764,7 +4764,7 @@ _elm_win_size_step_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int w, int h) } EOLIAN static void -_elm_win_size_step_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h) +_elm_win_efl_gfx_size_hint_step_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h) { if (w) *w = sd->size_step_w; if (h) *h = sd->size_step_h; @@ -6336,4 +6336,28 @@ elm_win_title_get(const Evas_Object *obj) return sd->title; } +EAPI void +elm_win_size_base_set(Evas_Object *obj, int w, int h) +{ + efl_gfx_size_hint_base_set(obj, w, h); +} + +EAPI void +elm_win_size_base_get(const Evas_Object *obj, int *w, int *h) +{ + efl_gfx_size_hint_base_get(obj, w, h); +} + +EAPI void +elm_win_size_step_set(Evas_Object *obj, int w, int h) +{ + efl_gfx_size_hint_step_set(obj, w, h); +} + +EAPI void +elm_win_size_step_get(const Evas_Object *obj, int *w, int *h) +{ + efl_gfx_size_hint_step_get(obj, w, h); +} + #include "elm_win.eo.c" diff --git a/src/lib/elementary/elm_win.eo b/src/lib/elementary/elm_win.eo index 7b8c042f1d..1d160fdeb7 100644 --- a/src/lib/elementary/elm_win.eo +++ b/src/lib/elementary/elm_win.eo @@ -162,7 +162,8 @@ enum Elm.Win.Urgent_Mode class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, Elm.Interface.Atspi_Widget_Action, Efl.Pack, - Efl.Input.State, Efl.Input.Interface, Efl.Screen) + Efl.Input.State, Efl.Input.Interface, Efl.Screen, + Efl.Gfx.Size.Hint) { legacy_prefix: elm_win; eo_prefix: elm_obj_win; @@ -582,27 +583,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, name: string @nullable; } } - @property size_step { - set { - [[Set the window stepping used with sizing calculation. - - Base size + stepping is what is calculated for window sizing - restrictions. - - @since 1.7 - ]] - } - get { - [[Get the stepping of a window. - - @since 1.7 - ]] - } - values { - w: int; [[The stepping width (0 disables).]] - h: int; [[The stepping height (0 disables).]] - } - } @property available_profiles { set { [[Set the array of available profiles to a window. @@ -701,27 +681,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, profile: string; [[The string value of a window profile.]] } } - @property size_base { - set { - [[Set the base window size used with stepping calculation - - Base size + stepping is what is calculated for window sizing - restrictions. - - @since 1.7 - ]] - } - get { - [[Get the base size of a window. - - @since 1.7 - ]] - } - values { - w: int; [[The base width.]] - h: int; [[The base height.]] - } - } @property main_menu { get { [[Get the Main Menu of a window.]] @@ -947,6 +906,10 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, Efl.Screen.dpi.get; Efl.Screen.rotation.get; Efl.Screen.size.get; + Efl.Gfx.Size.Hint.base.set; + Efl.Gfx.Size.Hint.base.get; + Efl.Gfx.Size.Hint.step.set; + Efl.Gfx.Size.Hint.step.get; } constructors { .name; diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index 1a2a5385a5..65fd71758f 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -852,3 +852,55 @@ EAPI void elm_win_title_set(Evas_Object *obj, const char *title); */ EAPI const char *elm_win_title_get(const Evas_Object *obj); +/** + * @brief Set the base window size used with stepping calculation + * + * Base size + stepping is what is calculated for window sizing restrictions. + * + * @param[in] w The base width. + * @param[in] h The base height. + * + * @since 1.7 + * + * @ingroup Elm_Win + */ +EAPI void elm_win_size_base_set(Evas_Object *obj, int w, int h); + +/** + * @brief Get the base size of a window. + * + * @param[out] w The base width. + * @param[out] h The base height. + * + * @since 1.7 + * + * @ingroup Elm_Win + */ +EAPI void elm_win_size_base_get(const Evas_Object *obj, int *w, int *h); + +/** + * @brief Set the window stepping used with sizing calculation. + * + * Base size + stepping is what is calculated for window sizing restrictions. + * + * @param[in] w The stepping width (0 disables). + * @param[in] h The stepping height (0 disables). + * + * @since 1.7 + * + * @ingroup Elm_Win + */ +EAPI void elm_win_size_step_set(Evas_Object *obj, int w, int h); + +/** + * @brief Get the stepping of a window. + * + * @param[out] w The stepping width (0 disables). + * @param[out] h The stepping height (0 disables). + * + * @since 1.7 + * + * @ingroup Elm_Win + */ +EAPI void elm_win_size_step_get(const Evas_Object *obj, int *w, int *h); +