From 84a5a5e98f869bb09147e52a6125c05ba8d04ac9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 5 Mar 2019 17:00:37 -0500 Subject: [PATCH] elm_thumb: remove all legacy usage from eo files this takes the current generated output from eolian for legacy code in efl and adds it to the tree, then removes legacy references from the corresponding eo files. in the case where the entire eo file was for a legacy object, that eo file has been removed from the tree ref T7724 Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D8205 --- src/Makefile_Elementary.am | 4 +- src/lib/elementary/elm_thumb.c | 4 +- src/lib/elementary/elm_thumb.eo | 26 ---------- src/lib/elementary/elm_thumb_eo.c | 85 ++++++++++++++++++++++++++++++++ src/lib/elementary/elm_thumb_eo.h | 64 ++++++++++++++++++++++++ src/lib/elementary/elm_thumb_eo.legacy.h | 17 +++++++ src/lib/elementary/elm_thumb_legacy.h | 2 +- src/lib/elementary/elm_view_form.c | 2 +- src/lib/elementary/meson.build | 3 +- 9 files changed, 175 insertions(+), 32 deletions(-) delete mode 100644 src/lib/elementary/elm_thumb.eo create mode 100644 src/lib/elementary/elm_thumb_eo.c create mode 100644 src/lib/elementary/elm_thumb_eo.h create mode 100644 src/lib/elementary/elm_thumb_eo.legacy.h diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 3e528a2..fd15e9c 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -210,7 +210,6 @@ elm_legacy_eolian_files = \ lib/elementary/elm_actionslider_part.eo \ lib/elementary/elm_bubble_part.eo \ lib/elementary/elm_fileselector_part.eo \ - lib/elementary/elm_thumb.eo \ $(NULL) elm_eolian_type_files = \ @@ -404,6 +403,7 @@ lib/elementary/elm_systray_eo.c \ lib/elementary/elm_systray_eo.legacy.c \ lib/elementary/elm_table_eo.c \ lib/elementary/elm_table_eo.legacy.c \ +lib/elementary/elm_thumb_eo.c \ $(NULL) elm_legacy_eo_headers = \ @@ -605,6 +605,8 @@ lib/elementary/elm_systray_eo.h \ lib/elementary/elm_systray_eo.legacy.h \ lib/elementary/elm_table_eo.h \ lib/elementary/elm_table_eo.legacy.h \ +lib/elementary/elm_thumb_eo.h \ +lib/elementary/elm_thumb_eo.legacy.h \ $(NULL) diff --git a/src/lib/elementary/elm_thumb.c b/src/lib/elementary/elm_thumb.c index a36abe7..df6244e 100644 --- a/src/lib/elementary/elm_thumb.c +++ b/src/lib/elementary/elm_thumb.c @@ -7,7 +7,7 @@ #include #include "elm_priv.h" -#include "elm_thumb.eo.h" +#include "elm_thumb_eo.h" #include "elm_widget_thumb.h" #define MY_CLASS_NAME "Elm_Thumb" @@ -936,4 +936,4 @@ elm_thumb_reload(Evas_Object *obj) #define ELM_THUMB_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_thumb) -#include "elm_thumb.eo.c" +#include "elm_thumb_eo.c" diff --git a/src/lib/elementary/elm_thumb.eo b/src/lib/elementary/elm_thumb.eo deleted file mode 100644 index 76837b3..0000000 --- a/src/lib/elementary/elm_thumb.eo +++ /dev/null @@ -1,26 +0,0 @@ -class Elm.Thumb extends Efl.Ui.Layout_Base implements Efl.File, Efl.Ui.Clickable, - Efl.Ui.Draggable, Efl.Ui.Legacy -{ - [[Elementary thumbnail class]] - legacy_prefix: elm_thumb; - eo_prefix: elm_obj_thumb; - event_prefix: elm_thumb; - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.finalize; - Efl.File.load; - Efl.File.loaded { get; } - Efl.File.file { get; set; } - Efl.File.key { get; set; } - Efl.Gfx.Entity.visible { set; } - Efl.Ui.Draggable.drag_target { get; set; } - } - events { - generate,error: void; [[Called when an error occurred during thumbnail generation]] - generate,start: void; [[Called when thumbnail generation started]] - generate,stop: void; [[Called when thumbnail generation stopped]] - load,error: void; [[Called when an error occurred during loading]] - press: void; [[Called when pressed]] - } -} diff --git a/src/lib/elementary/elm_thumb_eo.c b/src/lib/elementary/elm_thumb_eo.c new file mode 100644 index 0000000..d65f2ee --- /dev/null +++ b/src/lib/elementary/elm_thumb_eo.c @@ -0,0 +1,85 @@ +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_ERROR = + EFL_EVENT_DESCRIPTION("generate,error"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_START = + EFL_EVENT_DESCRIPTION("generate,start"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_STOP = + EFL_EVENT_DESCRIPTION("generate,stop"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_LOAD_ERROR = + EFL_EVENT_DESCRIPTION("load,error"); +EWAPI const Efl_Event_Description _ELM_THUMB_EVENT_PRESS = + EFL_EVENT_DESCRIPTION("press"); + +Efl_Object *_elm_thumb_efl_object_constructor(Eo *obj, Elm_Thumb_Data *pd); + + +Efl_Object *_elm_thumb_efl_object_finalize(Eo *obj, Elm_Thumb_Data *pd); + + +Eina_Error _elm_thumb_efl_file_load(Eo *obj, Elm_Thumb_Data *pd); + + +Eina_Bool _elm_thumb_efl_file_loaded_get(const Eo *obj, Elm_Thumb_Data *pd); + + +Eina_Error _elm_thumb_efl_file_file_set(Eo *obj, Elm_Thumb_Data *pd, const char *file); + + +const char *_elm_thumb_efl_file_file_get(const Eo *obj, Elm_Thumb_Data *pd); + + +void _elm_thumb_efl_file_key_set(Eo *obj, Elm_Thumb_Data *pd, const char *key); + + +const char *_elm_thumb_efl_file_key_get(const Eo *obj, Elm_Thumb_Data *pd); + + +void _elm_thumb_efl_gfx_entity_visible_set(Eo *obj, Elm_Thumb_Data *pd, Eina_Bool v); + + +void _elm_thumb_efl_ui_draggable_drag_target_set(Eo *obj, Elm_Thumb_Data *pd, Eina_Bool set); + + +Eina_Bool _elm_thumb_efl_ui_draggable_drag_target_get(const Eo *obj, Elm_Thumb_Data *pd); + + +static Eina_Bool +_elm_thumb_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_THUMB_EXTRA_OPS +#define ELM_THUMB_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_thumb_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_finalize, _elm_thumb_efl_object_finalize), + EFL_OBJECT_OP_FUNC(efl_file_load, _elm_thumb_efl_file_load), + EFL_OBJECT_OP_FUNC(efl_file_loaded_get, _elm_thumb_efl_file_loaded_get), + EFL_OBJECT_OP_FUNC(efl_file_set, _elm_thumb_efl_file_file_set), + EFL_OBJECT_OP_FUNC(efl_file_get, _elm_thumb_efl_file_file_get), + EFL_OBJECT_OP_FUNC(efl_file_key_set, _elm_thumb_efl_file_key_set), + EFL_OBJECT_OP_FUNC(efl_file_key_get, _elm_thumb_efl_file_key_get), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_thumb_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_ui_draggable_drag_target_set, _elm_thumb_efl_ui_draggable_drag_target_set), + EFL_OBJECT_OP_FUNC(efl_ui_draggable_drag_target_get, _elm_thumb_efl_ui_draggable_drag_target_get), + ELM_THUMB_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_thumb_class_desc = { + EO_VERSION, + "Elm.Thumb", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Thumb_Data), + _elm_thumb_class_initializer, + _elm_thumb_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_thumb_class_get, &_elm_thumb_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_thumb_eo.h b/src/lib/elementary/elm_thumb_eo.h new file mode 100644 index 0000000..09eed0a --- /dev/null +++ b/src/lib/elementary/elm_thumb_eo.h @@ -0,0 +1,64 @@ +#ifndef _ELM_THUMB_EO_H_ +#define _ELM_THUMB_EO_H_ + +#ifndef _ELM_THUMB_EO_CLASS_TYPE +#define _ELM_THUMB_EO_CLASS_TYPE + +typedef Eo Elm_Thumb; + +#endif + +#ifndef _ELM_THUMB_EO_TYPES +#define _ELM_THUMB_EO_TYPES + + +#endif +/** Elementary thumbnail class + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_CLASS elm_thumb_class_get() + +EWAPI const Efl_Class *elm_thumb_class_get(void); + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_ERROR; + +/** Called when an error occurred during thumbnail generation + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_GENERATE_ERROR (&(_ELM_THUMB_EVENT_GENERATE_ERROR)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_START; + +/** Called when thumbnail generation started + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_GENERATE_START (&(_ELM_THUMB_EVENT_GENERATE_START)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_GENERATE_STOP; + +/** Called when thumbnail generation stopped + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_GENERATE_STOP (&(_ELM_THUMB_EVENT_GENERATE_STOP)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_LOAD_ERROR; + +/** Called when an error occurred during loading + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_LOAD_ERROR (&(_ELM_THUMB_EVENT_LOAD_ERROR)) + +EWAPI extern const Efl_Event_Description _ELM_THUMB_EVENT_PRESS; + +/** Called when pressed + * + * @ingroup Elm_Thumb + */ +#define ELM_THUMB_EVENT_PRESS (&(_ELM_THUMB_EVENT_PRESS)) + +#endif diff --git a/src/lib/elementary/elm_thumb_eo.legacy.h b/src/lib/elementary/elm_thumb_eo.legacy.h new file mode 100644 index 0000000..cde5938 --- /dev/null +++ b/src/lib/elementary/elm_thumb_eo.legacy.h @@ -0,0 +1,17 @@ +#ifndef _ELM_THUMB_EO_LEGACY_H_ +#define _ELM_THUMB_EO_LEGACY_H_ + +#ifndef _ELM_THUMB_EO_CLASS_TYPE +#define _ELM_THUMB_EO_CLASS_TYPE + +typedef Eo Elm_Thumb; + +#endif + +#ifndef _ELM_THUMB_EO_TYPES +#define _ELM_THUMB_EO_TYPES + + +#endif + +#endif diff --git a/src/lib/elementary/elm_thumb_legacy.h b/src/lib/elementary/elm_thumb_legacy.h index b37e395..48fcc1a 100644 --- a/src/lib/elementary/elm_thumb_legacy.h +++ b/src/lib/elementary/elm_thumb_legacy.h @@ -314,4 +314,4 @@ EAPI void elm_thumb_path_get(const Evas_Object *obj, const char **file, const ch */ EAPI void elm_thumb_reload(Evas_Object *obj); -#include "elm_thumb.eo.legacy.h" +#include "elm_thumb_eo.legacy.h" diff --git a/src/lib/elementary/elm_view_form.c b/src/lib/elementary/elm_view_form.c index 23f20e4..5bb910b 100644 --- a/src/lib/elementary/elm_view_form.c +++ b/src/lib/elementary/elm_view_form.c @@ -10,7 +10,7 @@ #include "elm_priv.h" #include "elm_entry_eo.h" -#include "elm_thumb.eo.h" +#include "elm_thumb_eo.h" #include "elm_label_eo.h" #include diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 837a09a..32d2097 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -18,7 +18,6 @@ pub_legacy_eo_files = [ 'elm_actionslider_part.eo', 'elm_bubble_part.eo', 'elm_fileselector_part.eo', - 'elm_thumb.eo', ] pub_eo_file_target = [] @@ -921,6 +920,8 @@ elementary_pub_headers = [ 'elm_systray_eo.legacy.h', 'elm_table_eo.h', 'elm_table_eo.legacy.h', + 'elm_thumb_eo.h', + 'elm_thumb_eo.legacy.h', ] elementary_header_src = [ -- 2.7.4