elm_notify: 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/D8187
This commit is contained in:
Mike Blumenkrantz 2019-03-05 17:00:37 -05:00 committed by Cedric BAIL
parent 095b8bebc8
commit ff173f8408
12 changed files with 491 additions and 105 deletions

View File

@ -184,7 +184,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_notify.eo \
lib/elementary/elm_panel.eo \
lib/elementary/elm_player.eo \
lib/elementary/elm_plug.eo \
@ -374,6 +373,8 @@ lib/elementary/elm_naviframe_eo.c \
lib/elementary/elm_naviframe_eo.legacy.c \
lib/elementary/elm_naviframe_item_eo.c \
lib/elementary/elm_naviframe_item_eo.legacy.c \
lib/elementary/elm_notify_eo.c \
lib/elementary/elm_notify_eo.legacy.c \
$(NULL)
elm_legacy_eo_headers = \
@ -527,6 +528,8 @@ lib/elementary/elm_naviframe_eo.h \
lib/elementary/elm_naviframe_eo.legacy.h \
lib/elementary/elm_naviframe_item_eo.h \
lib/elementary/elm_naviframe_item_eo.legacy.h \
lib/elementary/elm_notify_eo.h \
lib/elementary/elm_notify_eo.legacy.h \
$(NULL)

View File

@ -4,7 +4,7 @@
#include <Elementary.h>
// FIXME: use smart cb
#include "elm_notify.eo.h"
#include "elm_notify_eo.h"
#define MAX_TRY 40

View File

@ -735,4 +735,4 @@ _elm_notify_part_efl_ui_l10n_l10n_text_set(Eo *obj, void *_pd EINA_UNUSED, const
ELM_PART_CONTENT_DEFAULT_OPS(elm_notify), \
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_notify)
#include "elm_notify.eo.c"
#include "elm_notify_eo.c"

View File

@ -1,98 +0,0 @@
class Elm.Notify extends Efl.Ui.Widget implements Efl.Ui.Focus.Layer, Efl.Content, Efl.Ui.Legacy
{
[[Elementary notification class]]
legacy_prefix: elm_notify;
eo_prefix: elm_obj_notify;
event_prefix: elm_notify;
methods {
@property align {
set {
[[Set the alignment of the notify object
Sets the alignment in which the notify will appear in its parent.
Note: To fill the notify box in the parent area, please pass the
ELM_NOTIFY_ALIGN_FILL to horizontal and vertical.
@since 1.8
]]
}
get {
[[Get the alignment of the notify object
@since 1.8
]]
}
values {
horizontal: double; [[The horizontal alignment of the notification]]
vertical: double; [[The vertical alignment of the notification]]
}
}
@property allow_events {
set {
[[Sets whether events should be passed to by a click outside
its area.
When true if the user clicks outside the window the events will
be caught by the others widgets, else the events are blocked.
Note: The default value is true.
]]
}
get {
[[Return true if events are allowed below the notify object.]]
}
values {
allow: bool; [[$true if events are allowed, $false otherwise]]
}
}
@property timeout {
set {
[[Set the time interval after which the notify window is going to
be hidden.
This function sets a timeout and starts the timer controlling
when the notify is hidden. Since calling evas_object_show() on
a notify restarts the timer controlling when the notify is
hidden, setting this before the notify is shown will in effect
mean starting the timer when the notify is shown.
Note: Set a value <= 0.0 to disable a running timer.
Note: If the value > 0.0 and the notify is previously visible,
the timer will be started with this value, canceling any running
timer.
]]
}
get {
[[Return the timeout value (in seconds)]]
}
values {
timeout: double; [[The timeout in seconds]]
}
}
dismiss {
[[Dismiss a notify object.
@since 1.17
]]
}
}
implements {
class.constructor;
Efl.Object.constructor;
Efl.Gfx.Entity.visible { set; }
Efl.Gfx.Entity.position { set; }
Efl.Gfx.Entity.size { set; }
Efl.Ui.Widget.widget_parent { get; set; }
Efl.Ui.Widget.theme_apply;
Efl.Ui.Widget.widget_sub_object_del;
Efl.Content.content { get; set; }
Efl.Content.content_unset;
Efl.Part.part_get;
}
events {
block,clicked: void; [[Called when block was clicked]]
timeout: void; [[Called when notify timed out]]
dismissed: void; [[Called when notify was dismissed]]
}
}

View File

@ -0,0 +1,179 @@
EWAPI const Efl_Event_Description _ELM_NOTIFY_EVENT_BLOCK_CLICKED =
EFL_EVENT_DESCRIPTION("block,clicked");
EWAPI const Efl_Event_Description _ELM_NOTIFY_EVENT_TIMEOUT =
EFL_EVENT_DESCRIPTION("timeout");
EWAPI const Efl_Event_Description _ELM_NOTIFY_EVENT_DISMISSED =
EFL_EVENT_DESCRIPTION("dismissed");
void _elm_notify_align_set(Eo *obj, Elm_Notify_Data *pd, double horizontal, double vertical);
EOAPI EFL_VOID_FUNC_BODYV(elm_obj_notify_align_set, EFL_FUNC_CALL(horizontal, vertical), double horizontal, double vertical);
void _elm_notify_align_get(const Eo *obj, Elm_Notify_Data *pd, double *horizontal, double *vertical);
EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_notify_align_get, EFL_FUNC_CALL(horizontal, vertical), double *horizontal, double *vertical);
void _elm_notify_allow_events_set(Eo *obj, Elm_Notify_Data *pd, Eina_Bool allow);
static Eina_Error
__eolian_elm_notify_allow_events_set_reflect(Eo *obj, Eina_Value val)
{
Eina_Error r = 0; Eina_Bool cval;
if (!eina_value_bool_convert(&val, &cval))
{
r = EINA_ERROR_VALUE_FAILED;
goto end;
}
elm_obj_notify_allow_events_set(obj, cval);
end:
eina_value_flush(&val);
return r;
}
EOAPI EFL_VOID_FUNC_BODYV(elm_obj_notify_allow_events_set, EFL_FUNC_CALL(allow), Eina_Bool allow);
Eina_Bool _elm_notify_allow_events_get(const Eo *obj, Elm_Notify_Data *pd);
static Eina_Value
__eolian_elm_notify_allow_events_get_reflect(Eo *obj)
{
Eina_Bool val = elm_obj_notify_allow_events_get(obj);
return eina_value_bool_init(val);
}
EOAPI EFL_FUNC_BODY_CONST(elm_obj_notify_allow_events_get, Eina_Bool, 0);
void _elm_notify_timeout_set(Eo *obj, Elm_Notify_Data *pd, double timeout);
static Eina_Error
__eolian_elm_notify_timeout_set_reflect(Eo *obj, Eina_Value val)
{
Eina_Error r = 0; double cval;
if (!eina_value_double_convert(&val, &cval))
{
r = EINA_ERROR_VALUE_FAILED;
goto end;
}
elm_obj_notify_timeout_set(obj, cval);
end:
eina_value_flush(&val);
return r;
}
EOAPI EFL_VOID_FUNC_BODYV(elm_obj_notify_timeout_set, EFL_FUNC_CALL(timeout), double timeout);
double _elm_notify_timeout_get(const Eo *obj, Elm_Notify_Data *pd);
static Eina_Value
__eolian_elm_notify_timeout_get_reflect(Eo *obj)
{
double val = elm_obj_notify_timeout_get(obj);
return eina_value_double_init(val);
}
EOAPI EFL_FUNC_BODY_CONST(elm_obj_notify_timeout_get, double, 0);
void _elm_notify_dismiss(Eo *obj, Elm_Notify_Data *pd);
EOAPI EFL_VOID_FUNC_BODY(elm_obj_notify_dismiss);
Efl_Object *_elm_notify_efl_object_constructor(Eo *obj, Elm_Notify_Data *pd);
void _elm_notify_efl_gfx_entity_visible_set(Eo *obj, Elm_Notify_Data *pd, Eina_Bool v);
void _elm_notify_efl_gfx_entity_position_set(Eo *obj, Elm_Notify_Data *pd, Eina_Position2D pos);
void _elm_notify_efl_gfx_entity_size_set(Eo *obj, Elm_Notify_Data *pd, Eina_Size2D size);
void _elm_notify_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *pd, Efl_Ui_Widget *parent);
Efl_Ui_Widget *_elm_notify_efl_ui_widget_widget_parent_get(const Eo *obj, Elm_Notify_Data *pd);
Eina_Error _elm_notify_efl_ui_widget_theme_apply(Eo *obj, Elm_Notify_Data *pd);
Eina_Bool _elm_notify_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Notify_Data *pd, Efl_Canvas_Object *sub_obj);
Eina_Bool _elm_notify_efl_content_content_set(Eo *obj, Elm_Notify_Data *pd, Efl_Gfx_Entity *content);
Efl_Gfx_Entity *_elm_notify_efl_content_content_get(const Eo *obj, Elm_Notify_Data *pd);
Efl_Gfx_Entity *_elm_notify_efl_content_content_unset(Eo *obj, Elm_Notify_Data *pd);
Efl_Object *_elm_notify_efl_part_part_get(const Eo *obj, Elm_Notify_Data *pd, const char *name);
static Eina_Bool
_elm_notify_class_initializer(Efl_Class *klass)
{
const Efl_Object_Ops *opsp = NULL;
const Efl_Object_Property_Reflection_Ops *ropsp = NULL;
#ifndef ELM_NOTIFY_EXTRA_OPS
#define ELM_NOTIFY_EXTRA_OPS
#endif
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(elm_obj_notify_align_set, _elm_notify_align_set),
EFL_OBJECT_OP_FUNC(elm_obj_notify_align_get, _elm_notify_align_get),
EFL_OBJECT_OP_FUNC(elm_obj_notify_allow_events_set, _elm_notify_allow_events_set),
EFL_OBJECT_OP_FUNC(elm_obj_notify_allow_events_get, _elm_notify_allow_events_get),
EFL_OBJECT_OP_FUNC(elm_obj_notify_timeout_set, _elm_notify_timeout_set),
EFL_OBJECT_OP_FUNC(elm_obj_notify_timeout_get, _elm_notify_timeout_get),
EFL_OBJECT_OP_FUNC(elm_obj_notify_dismiss, _elm_notify_dismiss),
EFL_OBJECT_OP_FUNC(efl_constructor, _elm_notify_efl_object_constructor),
EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_notify_efl_gfx_entity_visible_set),
EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_notify_efl_gfx_entity_position_set),
EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_notify_efl_gfx_entity_size_set),
EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_notify_efl_ui_widget_widget_parent_set),
EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_get, _elm_notify_efl_ui_widget_widget_parent_get),
EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_notify_efl_ui_widget_theme_apply),
EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_notify_efl_ui_widget_widget_sub_object_del),
EFL_OBJECT_OP_FUNC(efl_content_set, _elm_notify_efl_content_content_set),
EFL_OBJECT_OP_FUNC(efl_content_get, _elm_notify_efl_content_content_get),
EFL_OBJECT_OP_FUNC(efl_content_unset, _elm_notify_efl_content_content_unset),
EFL_OBJECT_OP_FUNC(efl_part_get, _elm_notify_efl_part_part_get),
ELM_NOTIFY_EXTRA_OPS
);
opsp = &ops;
static const Efl_Object_Property_Reflection refl_table[] = {
{"allow_events", __eolian_elm_notify_allow_events_set_reflect, __eolian_elm_notify_allow_events_get_reflect},
{"timeout", __eolian_elm_notify_timeout_set_reflect, __eolian_elm_notify_timeout_get_reflect},
};
static const Efl_Object_Property_Reflection_Ops rops = {
refl_table, EINA_C_ARRAY_LENGTH(refl_table)
};
ropsp = &rops;
return efl_class_functions_set(klass, opsp, ropsp);
}
static const Efl_Class_Description _elm_notify_class_desc = {
EO_VERSION,
"Elm.Notify",
EFL_CLASS_TYPE_REGULAR,
sizeof(Elm_Notify_Data),
_elm_notify_class_initializer,
_elm_notify_class_constructor,
NULL
};
EFL_DEFINE_CLASS(elm_notify_class_get, &_elm_notify_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_CONTENT_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL);
#include "elm_notify_eo.legacy.c"

View File

@ -0,0 +1,145 @@
#ifndef _ELM_NOTIFY_EO_H_
#define _ELM_NOTIFY_EO_H_
#ifndef _ELM_NOTIFY_EO_CLASS_TYPE
#define _ELM_NOTIFY_EO_CLASS_TYPE
typedef Eo Elm_Notify;
#endif
#ifndef _ELM_NOTIFY_EO_TYPES
#define _ELM_NOTIFY_EO_TYPES
#endif
/** Elementary notification class
*
* @ingroup Elm_Notify
*/
#define ELM_NOTIFY_CLASS elm_notify_class_get()
EWAPI const Efl_Class *elm_notify_class_get(void);
/**
* @brief Set the alignment of the notify object
*
* Sets the alignment in which the notify will appear in its parent.
*
* @note To fill the notify box in the parent area, please pass the
* ELM_NOTIFY_ALIGN_FILL to horizontal and vertical.
*
* @param[in] obj The object.
* @param[in] horizontal The horizontal alignment of the notification
* @param[in] vertical The vertical alignment of the notification
*
* @since 1.8
*
* @ingroup Elm_Notify
*/
EOAPI void elm_obj_notify_align_set(Eo *obj, double horizontal, double vertical);
/**
* @brief Get the alignment of the notify object
*
* @param[in] obj The object.
* @param[out] horizontal The horizontal alignment of the notification
* @param[out] vertical The vertical alignment of the notification
*
* @since 1.8
*
* @ingroup Elm_Notify
*/
EOAPI void elm_obj_notify_align_get(const Eo *obj, double *horizontal, double *vertical);
/**
* @brief Sets whether events should be passed to by a click outside its area.
*
* When true if the user clicks outside the window the events will be caught by
* the others widgets, else the events are blocked.
*
* @note The default value is true.
*
* @param[in] obj The object.
* @param[in] allow @c true if events are allowed, @c false otherwise
*
* @ingroup Elm_Notify
*/
EOAPI void elm_obj_notify_allow_events_set(Eo *obj, Eina_Bool allow);
/**
* @brief Return true if events are allowed below the notify object.
*
* @param[in] obj The object.
*
* @return @c true if events are allowed, @c false otherwise
*
* @ingroup Elm_Notify
*/
EOAPI Eina_Bool elm_obj_notify_allow_events_get(const Eo *obj);
/**
* @brief Set the time interval after which the notify window is going to be
* hidden.
*
* This function sets a timeout and starts the timer controlling when the
* notify is hidden. Since calling evas_object_show() on a notify restarts the
* timer controlling when the notify is hidden, setting this before the notify
* is shown will in effect mean starting the timer when the notify is shown.
*
* @note Set a value <= 0.0 to disable a running timer.
*
* @note If the value > 0.0 and the notify is previously visible, the timer
* will be started with this value, canceling any running timer.
*
* @param[in] obj The object.
* @param[in] timeout The timeout in seconds
*
* @ingroup Elm_Notify
*/
EOAPI void elm_obj_notify_timeout_set(Eo *obj, double timeout);
/**
* @brief Return the timeout value (in seconds)
*
* @param[in] obj The object.
*
* @return The timeout in seconds
*
* @ingroup Elm_Notify
*/
EOAPI double elm_obj_notify_timeout_get(const Eo *obj);
/** Dismiss a notify object.
*
* @since 1.17
*
* @ingroup Elm_Notify
*/
EOAPI void elm_obj_notify_dismiss(Eo *obj);
EWAPI extern const Efl_Event_Description _ELM_NOTIFY_EVENT_BLOCK_CLICKED;
/** Called when block was clicked
*
* @ingroup Elm_Notify
*/
#define ELM_NOTIFY_EVENT_BLOCK_CLICKED (&(_ELM_NOTIFY_EVENT_BLOCK_CLICKED))
EWAPI extern const Efl_Event_Description _ELM_NOTIFY_EVENT_TIMEOUT;
/** Called when notify timed out
*
* @ingroup Elm_Notify
*/
#define ELM_NOTIFY_EVENT_TIMEOUT (&(_ELM_NOTIFY_EVENT_TIMEOUT))
EWAPI extern const Efl_Event_Description _ELM_NOTIFY_EVENT_DISMISSED;
/** Called when notify was dismissed
*
* @ingroup Elm_Notify
*/
#define ELM_NOTIFY_EVENT_DISMISSED (&(_ELM_NOTIFY_EVENT_DISMISSED))
#endif

View File

@ -0,0 +1,42 @@
EAPI void
elm_notify_align_set(Elm_Notify *obj, double horizontal, double vertical)
{
elm_obj_notify_align_set(obj, horizontal, vertical);
}
EAPI void
elm_notify_align_get(const Elm_Notify *obj, double *horizontal, double *vertical)
{
elm_obj_notify_align_get(obj, horizontal, vertical);
}
EAPI void
elm_notify_allow_events_set(Elm_Notify *obj, Eina_Bool allow)
{
elm_obj_notify_allow_events_set(obj, allow);
}
EAPI Eina_Bool
elm_notify_allow_events_get(const Elm_Notify *obj)
{
return elm_obj_notify_allow_events_get(obj);
}
EAPI void
elm_notify_timeout_set(Elm_Notify *obj, double timeout)
{
elm_obj_notify_timeout_set(obj, timeout);
}
EAPI double
elm_notify_timeout_get(const Elm_Notify *obj)
{
return elm_obj_notify_timeout_get(obj);
}
EAPI void
elm_notify_dismiss(Elm_Notify *obj)
{
elm_obj_notify_dismiss(obj);
}

View File

@ -0,0 +1,114 @@
#ifndef _ELM_NOTIFY_EO_LEGACY_H_
#define _ELM_NOTIFY_EO_LEGACY_H_
#ifndef _ELM_NOTIFY_EO_CLASS_TYPE
#define _ELM_NOTIFY_EO_CLASS_TYPE
typedef Eo Elm_Notify;
#endif
#ifndef _ELM_NOTIFY_EO_TYPES
#define _ELM_NOTIFY_EO_TYPES
#endif
/**
* @brief Set the alignment of the notify object
*
* Sets the alignment in which the notify will appear in its parent.
*
* @note To fill the notify box in the parent area, please pass the
* ELM_NOTIFY_ALIGN_FILL to horizontal and vertical.
*
* @param[in] obj The object.
* @param[in] horizontal The horizontal alignment of the notification
* @param[in] vertical The vertical alignment of the notification
*
* @since 1.8
*
* @ingroup Elm_Notify_Group
*/
EAPI void elm_notify_align_set(Elm_Notify *obj, double horizontal, double vertical);
/**
* @brief Get the alignment of the notify object
*
* @param[in] obj The object.
* @param[out] horizontal The horizontal alignment of the notification
* @param[out] vertical The vertical alignment of the notification
*
* @since 1.8
*
* @ingroup Elm_Notify_Group
*/
EAPI void elm_notify_align_get(const Elm_Notify *obj, double *horizontal, double *vertical);
/**
* @brief Sets whether events should be passed to by a click outside its area.
*
* When true if the user clicks outside the window the events will be caught by
* the others widgets, else the events are blocked.
*
* @note The default value is true.
*
* @param[in] obj The object.
* @param[in] allow @c true if events are allowed, @c false otherwise
*
* @ingroup Elm_Notify_Group
*/
EAPI void elm_notify_allow_events_set(Elm_Notify *obj, Eina_Bool allow);
/**
* @brief Return true if events are allowed below the notify object.
*
* @param[in] obj The object.
*
* @return @c true if events are allowed, @c false otherwise
*
* @ingroup Elm_Notify_Group
*/
EAPI Eina_Bool elm_notify_allow_events_get(const Elm_Notify *obj);
/**
* @brief Set the time interval after which the notify window is going to be
* hidden.
*
* This function sets a timeout and starts the timer controlling when the
* notify is hidden. Since calling evas_object_show() on a notify restarts the
* timer controlling when the notify is hidden, setting this before the notify
* is shown will in effect mean starting the timer when the notify is shown.
*
* @note Set a value <= 0.0 to disable a running timer.
*
* @note If the value > 0.0 and the notify is previously visible, the timer
* will be started with this value, canceling any running timer.
*
* @param[in] obj The object.
* @param[in] timeout The timeout in seconds
*
* @ingroup Elm_Notify_Group
*/
EAPI void elm_notify_timeout_set(Elm_Notify *obj, double timeout);
/**
* @brief Return the timeout value (in seconds)
*
* @param[in] obj The object.
*
* @return The timeout in seconds
*
* @ingroup Elm_Notify_Group
*/
EAPI double elm_notify_timeout_get(const Elm_Notify *obj);
/** Dismiss a notify object.
*
* @since 1.17
*
* @ingroup Elm_Notify_Group
*/
EAPI void elm_notify_dismiss(Elm_Notify *obj);
#endif

View File

@ -33,4 +33,4 @@ EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_O
*/
EAPI Evas_Object *elm_notify_parent_get(const Evas_Object *obj);
#include "elm_notify.eo.legacy.h"
#include "elm_notify_eo.legacy.h"

View File

@ -3,7 +3,7 @@
#include "Elementary.h"
#include <elm_notify.eo.h>
#include <elm_notify_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

@ -3,7 +3,7 @@
#include "Elementary.h"
#include "elm_widget_layout.h"
#include "elm_notify.eo.h"
#include "elm_notify_eo.h"
#include "elm_popup_item.eo.h"
#include "elm_popup.eo.h"

View File

@ -1,6 +1,5 @@
pub_legacy_eo_files = [
'efl_ui_clock_legacy.eo',
'elm_notify.eo',
'elm_panel.eo',
'elm_player.eo',
'elm_plug.eo',
@ -777,6 +776,8 @@ elementary_pub_headers = [
'elm_naviframe_eo.legacy.h',
'elm_naviframe_item_eo.h',
'elm_naviframe_item_eo.legacy.h',
'elm_notify_eo.h',
'elm_notify_eo.legacy.h',
]
elementary_header_src = [