diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index ce7103cb5f..2987c190b8 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -149,7 +149,6 @@ elm_public_eolian_files += \ lib/elementary/elm_atspi_bridge.eo \ lib/elementary/elm_atspi_app_object.eo \ lib/elementary/efl_ui_image_zoomable_pan.eo \ - lib/elementary/elm_pan.eo \ lib/elementary/elm_toolbar.eo \ lib/elementary/elm_toolbar_item.eo \ lib/elementary/elm_view_list.eo \ @@ -376,6 +375,8 @@ lib/elementary/elm_notify_eo.c \ lib/elementary/elm_notify_eo.legacy.c \ lib/elementary/elm_panel_eo.c \ lib/elementary/elm_panel_eo.legacy.c \ +lib/elementary/elm_pan_eo.c \ +lib/elementary/elm_pan_eo.legacy.c \ $(NULL) elm_legacy_eo_headers = \ @@ -533,6 +534,8 @@ lib/elementary/elm_notify_eo.h \ lib/elementary/elm_notify_eo.legacy.h \ lib/elementary/elm_panel_eo.h \ lib/elementary/elm_panel_eo.legacy.h \ +lib/elementary/elm_pan_eo.h \ +lib/elementary/elm_pan_eo.legacy.h \ $(NULL) diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index e23cc5a4e6..e40ab07949 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -4972,4 +4972,4 @@ _elm_interface_scrollable_item_loop_enabled_get(const Eo *obj EINA_UNUSED, Elm_S EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_interface_scrollable) #include "elm_interface_scrollable.eo.c" -#include "elm_pan.eo.c" +#include "elm_pan_eo.c" diff --git a/src/lib/elementary/elm_interface_scrollable.h b/src/lib/elementary/elm_interface_scrollable.h index 4da12df41e..64e6f88209 100644 --- a/src/lib/elementary/elm_interface_scrollable.h +++ b/src/lib/elementary/elm_interface_scrollable.h @@ -32,10 +32,10 @@ */ #ifdef EFL_EO_API_SUPPORT -#include "elm_pan.eo.h" +#include "elm_pan_eo.h" #endif #ifndef EFL_NOLEGACY_API_SUPPORT -#include "elm_pan.eo.legacy.h" +#include "elm_pan_eo.legacy.h" #endif /** diff --git a/src/lib/elementary/elm_pan.eo b/src/lib/elementary/elm_pan.eo deleted file mode 100644 index 086032e0cb..0000000000 --- a/src/lib/elementary/elm_pan.eo +++ /dev/null @@ -1,58 +0,0 @@ -class Elm.Pan extends Efl.Canvas.Group -{ - [[Elementary pan class]] - legacy_prefix: elm_pan; - eo_prefix: elm_obj_pan; - event_prefix: elm_pan; - data: Elm_Pan_Smart_Data; - methods { - @property pos { - [[Position]] - set { - } - get { - } - values { - x: int; [[X coordinate]] - y: int; [[Y coordinate]] - } - } - @property content_size { - [[Content size]] - get { - } - values { - w: int; [[Width]] - h: int; [[Height]] - } - } - @property pos_min { - [[Minimal position]] - get { - } - values { - x: int; [[X coordinate]] - y: int; [[Y coordinate]] - } - } - @property pos_max { - [[Maximal position]] - get { - } - values { - x: int; [[X coordinate]] - y: int; [[Y coordinate]] - } - } - } - implements { - Efl.Object.constructor; - class.constructor; - Efl.Gfx.Entity.visible { set; } - Efl.Gfx.Entity.position { set; } - Efl.Gfx.Entity.size { set; } - } - events { - changed: void; [[Called when pan object changed]] - } -} diff --git a/src/lib/elementary/elm_pan_eo.c b/src/lib/elementary/elm_pan_eo.c new file mode 100644 index 0000000000..7214e125a8 --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.c @@ -0,0 +1,76 @@ +EWAPI const Efl_Event_Description _ELM_PAN_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); + +void _elm_pan_pos_set(Eo *obj, Elm_Pan_Smart_Data *pd, int x, int y); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_pan_pos_set, EFL_FUNC_CALL(x, y), int x, int y); + +void _elm_pan_pos_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_pos_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +void _elm_pan_content_size_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_content_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +void _elm_pan_pos_min_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_pos_min_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +void _elm_pan_pos_max_get(const Eo *obj, Elm_Pan_Smart_Data *pd, int *x, int *y); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_pan_pos_max_get, EFL_FUNC_CALL(x, y), int *x, int *y); + +Efl_Object *_elm_pan_efl_object_constructor(Eo *obj, Elm_Pan_Smart_Data *pd); + + +void _elm_pan_efl_gfx_entity_visible_set(Eo *obj, Elm_Pan_Smart_Data *pd, Eina_Bool v); + + +void _elm_pan_efl_gfx_entity_position_set(Eo *obj, Elm_Pan_Smart_Data *pd, Eina_Position2D pos); + + +void _elm_pan_efl_gfx_entity_size_set(Eo *obj, Elm_Pan_Smart_Data *pd, Eina_Size2D size); + + +static Eina_Bool +_elm_pan_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PAN_EXTRA_OPS +#define ELM_PAN_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_set, _elm_pan_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_get, _elm_pan_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_content_size_get, _elm_pan_content_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_min_get, _elm_pan_pos_min_get), + EFL_OBJECT_OP_FUNC(elm_obj_pan_pos_max_get, _elm_pan_pos_max_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_pan_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_pan_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_pan_efl_gfx_entity_position_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_pan_efl_gfx_entity_size_set), + ELM_PAN_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_pan_class_desc = { + EO_VERSION, + "Elm.Pan", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Pan_Smart_Data), + _elm_pan_class_initializer, + _elm_pan_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_pan_class_get, &_elm_pan_class_desc, EFL_CANVAS_GROUP_CLASS, NULL); + +#include "elm_pan_eo.legacy.c" diff --git a/src/lib/elementary/elm_pan_eo.h b/src/lib/elementary/elm_pan_eo.h new file mode 100644 index 0000000000..a09652a4c8 --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.h @@ -0,0 +1,87 @@ +#ifndef _ELM_PAN_EO_H_ +#define _ELM_PAN_EO_H_ + +#ifndef _ELM_PAN_EO_CLASS_TYPE +#define _ELM_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Pan; + +#endif + +#ifndef _ELM_PAN_EO_TYPES +#define _ELM_PAN_EO_TYPES + + +#endif +/** Elementary pan class + * + * @ingroup Elm_Pan + */ +#define ELM_PAN_CLASS elm_pan_class_get() + +EWAPI const Efl_Class *elm_pan_class_get(void); + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_set(Eo *obj, int x, int y); + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_get(const Eo *obj, int *x, int *y); + +/** + * @brief Content size + * + * @param[in] obj The object. + * @param[out] w Width + * @param[out] h Height + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_content_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Minimal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_min_get(const Eo *obj, int *x, int *y); + +/** + * @brief Maximal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan + */ +EOAPI void elm_obj_pan_pos_max_get(const Eo *obj, int *x, int *y); + +EWAPI extern const Efl_Event_Description _ELM_PAN_EVENT_CHANGED; + +/** Called when pan object changed + * + * @ingroup Elm_Pan + */ +#define ELM_PAN_EVENT_CHANGED (&(_ELM_PAN_EVENT_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_pan_eo.legacy.c b/src/lib/elementary/elm_pan_eo.legacy.c new file mode 100644 index 0000000000..0b4e98f3da --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI void +elm_pan_pos_set(Elm_Pan *obj, int x, int y) +{ + elm_obj_pan_pos_set(obj, x, y); +} + +EAPI void +elm_pan_pos_get(const Elm_Pan *obj, int *x, int *y) +{ + elm_obj_pan_pos_get(obj, x, y); +} + +EAPI void +elm_pan_content_size_get(const Elm_Pan *obj, int *w, int *h) +{ + elm_obj_pan_content_size_get(obj, w, h); +} + +EAPI void +elm_pan_pos_min_get(const Elm_Pan *obj, int *x, int *y) +{ + elm_obj_pan_pos_min_get(obj, x, y); +} + +EAPI void +elm_pan_pos_max_get(const Elm_Pan *obj, int *x, int *y) +{ + elm_obj_pan_pos_max_get(obj, x, y); +} diff --git a/src/lib/elementary/elm_pan_eo.legacy.h b/src/lib/elementary/elm_pan_eo.legacy.h new file mode 100644 index 0000000000..857b2e8a75 --- /dev/null +++ b/src/lib/elementary/elm_pan_eo.legacy.h @@ -0,0 +1,72 @@ +#ifndef _ELM_PAN_EO_LEGACY_H_ +#define _ELM_PAN_EO_LEGACY_H_ + +#ifndef _ELM_PAN_EO_CLASS_TYPE +#define _ELM_PAN_EO_CLASS_TYPE + +typedef Eo Elm_Pan; + +#endif + +#ifndef _ELM_PAN_EO_TYPES +#define _ELM_PAN_EO_TYPES + + +#endif + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[in] x X coordinate + * @param[in] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_set(Elm_Pan *obj, int x, int y); + +/** + * @brief Position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_get(const Elm_Pan *obj, int *x, int *y); + +/** + * @brief Content size + * + * @param[in] obj The object. + * @param[out] w Width + * @param[out] h Height + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_content_size_get(const Elm_Pan *obj, int *w, int *h); + +/** + * @brief Minimal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_min_get(const Elm_Pan *obj, int *x, int *y); + +/** + * @brief Maximal position + * + * @param[in] obj The object. + * @param[out] x X coordinate + * @param[out] y Y coordinate + * + * @ingroup Elm_Pan_Group + */ +EAPI void elm_pan_pos_max_get(const Elm_Pan *obj, int *x, int *y); + +#endif diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 72b7d30eae..e61e549212 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -198,7 +198,6 @@ pub_eo_files = [ 'elm_atspi_bridge.eo', 'elm_atspi_app_object.eo', 'efl_ui_image_zoomable_pan.eo', - 'elm_pan.eo', 'elm_toolbar.eo', 'elm_toolbar_item.eo', 'elm_view_list.eo', @@ -779,6 +778,8 @@ elementary_pub_headers = [ 'elm_notify_eo.legacy.h', 'elm_panel_eo.h', 'elm_panel_eo.legacy.h', + 'elm_pan_eo.h', + 'elm_pan_eo.legacy.h', ] elementary_header_src = [