From 32504a8cfa8639a8ff80a28bc308c73d98c25e39 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Fri, 12 Oct 2018 15:42:31 +0900 Subject: [PATCH] elementary textpath: support legacy APIs Summary: Efl.Ui.Textpath was added when we were developing new interfaces. So, basically, it does not support 'legacy' APIs. ex) elm_textpath_add But, in Tizen, the legacy APIs had been delivered in old version of EFL. To reduce maintainning cost between the platforms, this patch will be helpful. @feature Test Plan: N/A Reviewers: Hermet, woohyun, zmike, cedric, herdsman Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7033 --- src/Makefile_Elementary.am | 3 ++ src/lib/elementary/Elementary.h | 2 +- src/lib/elementary/efl_ui_textpath.c | 29 ++++++++++++++++++++ src/lib/elementary/efl_ui_textpath.eo | 1 + src/lib/elementary/efl_ui_textpath_legacy.eo | 9 ++++++ src/lib/elementary/elm_textpath.h | 15 ++++++++++ src/lib/elementary/elm_textpath_legacy.h | 15 ++++++++++ 7 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/lib/elementary/efl_ui_textpath_legacy.eo create mode 100644 src/lib/elementary/elm_textpath.h create mode 100644 src/lib/elementary/elm_textpath_legacy.h diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 4e906e1190..865c623841 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -56,6 +56,7 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_text_factory_emoticons.eo \ lib/elementary/efl_ui_text_factory_fallback.eo \ lib/elementary/efl_ui_textpath.eo \ + lib/elementary/efl_ui_textpath_legacy.eo \ lib/elementary/efl_ui_translatable.eo \ lib/elementary/efl_ui_clock.eo \ lib/elementary/efl_ui_cursor.eo \ @@ -630,6 +631,8 @@ includesub_HEADERS = \ lib/elementary/elm_sys_notify.h \ lib/elementary/elm_table.h \ lib/elementary/elm_table_legacy.h \ + lib/elementary/elm_textpath.h \ + lib/elementary/elm_textpath_legacy.h \ lib/elementary/elm_theme.h \ lib/elementary/elm_thumb.h \ lib/elementary/elm_thumb_common.h \ diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index 9ede3d650b..97ef0838d8 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -160,7 +160,6 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include -# include # include # include # include @@ -269,6 +268,7 @@ typedef Eo Efl_Ui_Focus_Manager; #include #include #include +#include #include #include #include diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index 20b04092b0..be6de4de36 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -758,3 +758,32 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_textpath, EFL_UI_TEXTPATH, Efl_Ui_Textpath_Dat EFL_CANVAS_GROUP_ADD_OPS(efl_ui_textpath) #include "efl_ui_textpath.eo.c" + +#include "efl_ui_textpath_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_textpath" +/* Legacy APIs */ + +static void +_efl_ui_textpath_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_textpath_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_TEXTPATH_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_textpath_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_TEXTPATH_LEGACY_CLASS, parent); +} + +#include "efl_ui_textpath_legacy.eo.c" + diff --git a/src/lib/elementary/efl_ui_textpath.eo b/src/lib/elementary/efl_ui_textpath.eo index 8feca95bd5..d506d2b901 100644 --- a/src/lib/elementary/efl_ui_textpath.eo +++ b/src/lib/elementary/efl_ui_textpath.eo @@ -7,6 +7,7 @@ enum Efl.Ui.Textpath_Direction { class Efl.Ui.Textpath (Efl.Ui.Layout.Object, Efl.Text, Efl.Gfx.Path) { [[Efl Ui Textpath class]] + legacy_prefix: elm_textpath; methods { circle_set { [[Set a circle with given center, radius, and start angle.]] diff --git a/src/lib/elementary/efl_ui_textpath_legacy.eo b/src/lib/elementary/efl_ui_textpath_legacy.eo new file mode 100644 index 0000000000..fd19602b1f --- /dev/null +++ b/src/lib/elementary/efl_ui_textpath_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Textpath_Legacy (Efl.Ui.Textpath, Efl.Ui.Legacy) +{ + [[Textpath widget]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/elm_textpath.h b/src/lib/elementary/elm_textpath.h new file mode 100644 index 0000000000..780f1fa222 --- /dev/null +++ b/src/lib/elementary/elm_textpath.h @@ -0,0 +1,15 @@ +/** + * @defgroup Elm_Textpath Textpath + * @ingroup Elementary + */ + +#ifdef EFL_EO_API_SUPPORT +#include "efl_ui_textpath.eo.h" +#define EFL_UI_RADIO_EVENT_CHANGED EFL_UI_NSTATE_EVENT_CHANGED +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_textpath_legacy.h" +#endif +/** + * @} + */ diff --git a/src/lib/elementary/elm_textpath_legacy.h b/src/lib/elementary/elm_textpath_legacy.h new file mode 100644 index 0000000000..b57dafff15 --- /dev/null +++ b/src/lib/elementary/elm_textpath_legacy.h @@ -0,0 +1,15 @@ +typedef Eo Elm_Textpath; + +/** + * @brief Add a new textpath to the parent + * + * @param[in] parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Elm_Textpath + * + * @since 1.22 + */ +EAPI Evas_Object *elm_textpath_add(Evas_Object *parent); + +#include "efl_ui_textpath.eo.legacy.h"