elm_plug: 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 <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8192
This commit is contained in:
Mike Blumenkrantz 2019-03-05 17:00:37 -05:00 committed by Cedric BAIL
parent d3be7698e3
commit 192bbfa502
11 changed files with 203 additions and 49 deletions

View File

@ -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)

View File

@ -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"

View File

@ -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"

View File

@ -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]]
}
}

View File

@ -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"

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -8,4 +8,4 @@
*/
EAPI Evas_Object *elm_plug_add(Evas_Object *parent);
#include "elm_plug.eo.legacy.h"
#include "elm_plug_eo.legacy.h"

View File

@ -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

View File

@ -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 = [