diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 7a3510770a..9087ef11fe 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -183,7 +183,6 @@ elm_private_eolian_files = \ # Legacy classes - not part of public EO API elm_legacy_eolian_files = \ lib/elementary/efl_ui_clock_legacy.eo \ - lib/elementary/elm_plug.eo \ lib/elementary/elm_popup.eo \ lib/elementary/elm_route.eo \ lib/elementary/elm_scroller.eo \ @@ -377,6 +376,8 @@ lib/elementary/elm_pan_eo.c \ lib/elementary/elm_pan_eo.legacy.c \ lib/elementary/elm_photo_eo.c \ lib/elementary/elm_player_eo.c \ +lib/elementary/elm_plug_eo.c \ +lib/elementary/elm_plug_eo.legacy.c \ $(NULL) elm_legacy_eo_headers = \ @@ -540,6 +541,8 @@ lib/elementary/elm_photo_eo.h \ lib/elementary/elm_photo_eo.legacy.h \ lib/elementary/elm_player_eo.h \ lib/elementary/elm_player_eo.legacy.h \ +lib/elementary/elm_plug_eo.h \ +lib/elementary/elm_plug_eo.legacy.h \ $(NULL) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 410eeb8f66..24b88f6f08 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -31,7 +31,7 @@ #include "elm_part_helper.h" #include "efl_ui_win_part.eo.h" -#include "elm_plug.eo.h" +#include "elm_plug_eo.h" #include "efl_ui_win_legacy_eo.h" #include "efl_ui_win_socket_legacy_eo.h" #include "efl_ui_win_inlined_legacy_eo.h" diff --git a/src/lib/elementary/elm_plug.c b/src/lib/elementary/elm_plug.c index 8eec937773..f55c616ec7 100644 --- a/src/lib/elementary/elm_plug.c +++ b/src/lib/elementary/elm_plug.c @@ -193,4 +193,4 @@ _elm_plug_class_constructor(Efl_Class *klass) #define ELM_PLUG_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_OPS(elm_plug) -#include "elm_plug.eo.c" +#include "elm_plug_eo.c" diff --git a/src/lib/elementary/elm_plug.eo b/src/lib/elementary/elm_plug.eo deleted file mode 100644 index 5954a8cce0..0000000000 --- a/src/lib/elementary/elm_plug.eo +++ /dev/null @@ -1,43 +0,0 @@ -class Elm.Plug extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Legacy -{ - [[Elementary plug class]] - legacy_prefix: elm_plug; - eo_prefix: elm_obj_plug; - event_prefix: elm_plug; - data: null; - methods { - @property image_object { - get { - [[Get the basic Evas_Image object from this object (widget). - - This function allows one to get the underlying Evas object of type - Image from this elementary widget. It can be useful to do things - like get the pixel data, save the image to a file, etc. - - Note: Be careful to not manipulate it, as it is under control of - elementary. - ]] - return: Efl.Canvas.Object; [[The inlined image object or $null.]] - } - } - connect { - [[Connect a plug widget to service provided by socket image.]] - return: bool; [[$true on success, $false on error.]] - params { - @in svcname: string; [[The service name to connect to set up by the socket.]] - @in svcnum: int; [[The service number to connect to (set up by socket).]] - @in svcsys: bool; [[Boolean to set if the service is a system one or not (set up by socket).]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Focus.Object.on_focus_update; - } - events { - image,deleted: void; [[Called when image was deleted]] - image,resized: Eina.Position2D; [[Called when image was resized]] - } -} diff --git a/src/lib/elementary/elm_plug_eo.c b/src/lib/elementary/elm_plug_eo.c new file mode 100644 index 0000000000..7dc8c4daad --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.c @@ -0,0 +1,59 @@ +EWAPI const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_DELETED = + EFL_EVENT_DESCRIPTION("image,deleted"); +EWAPI const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_RESIZED = + EFL_EVENT_DESCRIPTION("image,resized"); + +Efl_Canvas_Object *_elm_plug_image_object_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_plug_image_object_get, Efl_Canvas_Object *, NULL); + +Eina_Bool _elm_plug_connect(Eo *obj, void *pd, const char *svcname, int svcnum, Eina_Bool svcsys); + +EOAPI EFL_FUNC_BODYV(elm_obj_plug_connect, Eina_Bool, 0, EFL_FUNC_CALL(svcname, svcnum, svcsys), const char *svcname, int svcnum, Eina_Bool svcsys); + +Efl_Object *_elm_plug_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _elm_plug_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +Eina_Bool _elm_plug_efl_ui_focus_object_on_focus_update(Eo *obj, void *pd); + + +static Eina_Bool +_elm_plug_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_PLUG_EXTRA_OPS +#define ELM_PLUG_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_plug_image_object_get, _elm_plug_image_object_get), + EFL_OBJECT_OP_FUNC(elm_obj_plug_connect, _elm_plug_connect), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_plug_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_plug_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_on_focus_update, _elm_plug_efl_ui_focus_object_on_focus_update), + ELM_PLUG_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_plug_class_desc = { + EO_VERSION, + "Elm.Plug", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_plug_class_initializer, + _elm_plug_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_plug_class_get, &_elm_plug_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_plug_eo.legacy.c" diff --git a/src/lib/elementary/elm_plug_eo.h b/src/lib/elementary/elm_plug_eo.h new file mode 100644 index 0000000000..f27785ff88 --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.h @@ -0,0 +1,73 @@ +#ifndef _ELM_PLUG_EO_H_ +#define _ELM_PLUG_EO_H_ + +#ifndef _ELM_PLUG_EO_CLASS_TYPE +#define _ELM_PLUG_EO_CLASS_TYPE + +typedef Eo Elm_Plug; + +#endif + +#ifndef _ELM_PLUG_EO_TYPES +#define _ELM_PLUG_EO_TYPES + + +#endif +/** Elementary plug class + * + * @ingroup Elm_Plug + */ +#define ELM_PLUG_CLASS elm_plug_class_get() + +EWAPI const Efl_Class *elm_plug_class_get(void); + +/** + * @brief Get the basic Evas_Image object from this object (widget). + * + * This function allows one to get the underlying Evas object of type Image + * from this elementary widget. It can be useful to do things like get the + * pixel data, save the image to a file, etc. + * + * @note Be careful to not manipulate it, as it is under control of elementary. + * + * @param[in] obj The object. + * + * @return The inlined image object or @c null. + * + * @ingroup Elm_Plug + */ +EOAPI Efl_Canvas_Object *elm_obj_plug_image_object_get(const Eo *obj); + +/** + * @brief Connect a plug widget to service provided by socket image. + * + * @param[in] obj The object. + * @param[in] svcname The service name to connect to set up by the socket. + * @param[in] svcnum The service number to connect to (set up by socket). + * @param[in] svcsys Boolean to set if the service is a system one or not (set + * up by socket). + * + * @return @c true on success, @c false on error. + * + * @ingroup Elm_Plug + */ +EOAPI Eina_Bool elm_obj_plug_connect(Eo *obj, const char *svcname, int svcnum, Eina_Bool svcsys); + +EWAPI extern const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_DELETED; + +/** Called when image was deleted + * + * @ingroup Elm_Plug + */ +#define ELM_PLUG_EVENT_IMAGE_DELETED (&(_ELM_PLUG_EVENT_IMAGE_DELETED)) + +EWAPI extern const Efl_Event_Description _ELM_PLUG_EVENT_IMAGE_RESIZED; + +/** Called when image was resized + * @return Eina_Position2D + * + * @ingroup Elm_Plug + */ +#define ELM_PLUG_EVENT_IMAGE_RESIZED (&(_ELM_PLUG_EVENT_IMAGE_RESIZED)) + +#endif diff --git a/src/lib/elementary/elm_plug_eo.legacy.c b/src/lib/elementary/elm_plug_eo.legacy.c new file mode 100644 index 0000000000..04e3277d85 --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI Efl_Canvas_Object * +elm_plug_image_object_get(const Elm_Plug *obj) +{ + return elm_obj_plug_image_object_get(obj); +} + +EAPI Eina_Bool +elm_plug_connect(Elm_Plug *obj, const char *svcname, int svcnum, Eina_Bool svcsys) +{ + return elm_obj_plug_connect(obj, svcname, svcnum, svcsys); +} diff --git a/src/lib/elementary/elm_plug_eo.legacy.h b/src/lib/elementary/elm_plug_eo.legacy.h new file mode 100644 index 0000000000..8d772cba7f --- /dev/null +++ b/src/lib/elementary/elm_plug_eo.legacy.h @@ -0,0 +1,49 @@ +#ifndef _ELM_PLUG_EO_LEGACY_H_ +#define _ELM_PLUG_EO_LEGACY_H_ + +#ifndef _ELM_PLUG_EO_CLASS_TYPE +#define _ELM_PLUG_EO_CLASS_TYPE + +typedef Eo Elm_Plug; + +#endif + +#ifndef _ELM_PLUG_EO_TYPES +#define _ELM_PLUG_EO_TYPES + + +#endif + +/** + * @brief Get the basic Evas_Image object from this object (widget). + * + * This function allows one to get the underlying Evas object of type Image + * from this elementary widget. It can be useful to do things like get the + * pixel data, save the image to a file, etc. + * + * @note Be careful to not manipulate it, as it is under control of elementary. + * + * @param[in] obj The object. + * + * @return The inlined image object or @c null. + * + * @ingroup Elm_Plug_Group + */ +EAPI Efl_Canvas_Object *elm_plug_image_object_get(const Elm_Plug *obj); + +/** + * @brief Connect a plug widget to service provided by socket image. + * + * @param[in] obj The object. + * @param[in] svcname The service name to connect to set up by the socket. + * @param[in] svcnum The service number to connect to (set up by socket). + * @param[in] svcsys Boolean to set if the service is a system one or not (set + * up by socket). + * + * @return @c true on success, @c false on error. + * + * @ingroup Elm_Plug_Group + */ +EAPI Eina_Bool elm_plug_connect(Elm_Plug *obj, const char *svcname, int svcnum, Eina_Bool svcsys); + +#endif diff --git a/src/lib/elementary/elm_plug_legacy.h b/src/lib/elementary/elm_plug_legacy.h index 5c04ec36fa..58bc85424b 100644 --- a/src/lib/elementary/elm_plug_legacy.h +++ b/src/lib/elementary/elm_plug_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_plug_add(Evas_Object *parent); -#include "elm_plug.eo.legacy.h" \ No newline at end of file +#include "elm_plug_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/elm_widget_plug.h b/src/lib/elementary/elm_widget_plug.h index 8798fee764..8fb923c323 100644 --- a/src/lib/elementary/elm_widget_plug.h +++ b/src/lib/elementary/elm_widget_plug.h @@ -2,7 +2,7 @@ #define ELM_WIDGET_PLUG_H #include "Elementary.h" -#include "elm_plug.eo.h" +#include "elm_plug_eo.h" /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 3dab5717e9..004c7a76e3 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -1,6 +1,5 @@ pub_legacy_eo_files = [ 'efl_ui_clock_legacy.eo', - 'elm_plug.eo', 'elm_popup.eo', 'elm_route.eo', 'elm_scroller.eo', @@ -782,6 +781,8 @@ elementary_pub_headers = [ 'elm_photo_eo.legacy.h', 'elm_player_eo.h', 'elm_player_eo.legacy.h', + 'elm_plug_eo.h', + 'elm_plug_eo.legacy.h', ] elementary_header_src = [