This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch eolian/improvements
in repository efl.
View the commit online.
commit 74eb5e64c5cfc13be6eab649f23481489c89a401
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 21 13:55:20 2026 -0600
elementary: construction-only properties use @construct_only
Win name, type and accel_preference, Elm_Code_Widget code, the
internal text scroller initialize and View_Model children_bind were
guarded by hand-written finalize checks. They now use the generated
guard, which is a mechanical replacement.
This removes the EO_CONSTRUCTOR_CHECK_RETURN macro and View_Model's
finalize override and flag. win_name now uses eina_stringshare_replace.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/elementary/efl_ui_internal_text_scroller.c | 8 +-------
.../elementary/efl_ui_internal_text_scroller.eo | 7 ++++---
src/lib/elementary/efl_ui_view_model.c | 11 -----------
src/lib/elementary/efl_ui_view_model.eo | 7 ++-----
src/lib/elementary/efl_ui_win.c | 23 ++++------------------
src/lib/elementary/efl_ui_win.eo | 16 +++++----------
src/lib/elementary/elm_code_widget.c | 13 ------------
src/lib/elementary/elm_code_widget.eo | 6 ++----
8 files changed, 18 insertions(+), 73 deletions(-)
diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.c b/src/lib/elementary/efl_ui_internal_text_scroller.c
index 2064099ccd..4517ebeef0 100644
--- a/src/lib/elementary/efl_ui_internal_text_scroller.c
+++ b/src/lib/elementary/efl_ui_internal_text_scroller.c
@@ -167,17 +167,11 @@ _efl_ui_internal_text_scroller_efl_object_destructor(Eo *obj,
}
EOLIAN static void
-_efl_ui_internal_text_scroller_initialize(Eo *obj,
+_efl_ui_internal_text_scroller_initialize(Eo *obj EINA_UNUSED,
Efl_Ui_Internal_Text_Scroller_Data *sd,
Efl_Canvas_Textblock *text_obj,
Efl_Ui_Table *text_table)
{
- if (efl_finalized_get(obj))
- {
- ERR("Can only be called on construction");
- return;
- }
-
sd->text_obj = text_obj;
sd->text_table = text_table;
}
diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.eo b/src/lib/elementary/efl_ui_internal_text_scroller.eo
index b616674944..413442173e 100644
--- a/src/lib/elementary/efl_ui_internal_text_scroller.eo
+++ b/src/lib/elementary/efl_ui_internal_text_scroller.eo
@@ -32,9 +32,7 @@ class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller
}
}
initialize {
- [[The Efl.Canvas.Textblock content of this scroller.
- This should be called upon constructing the object.
- ]]
+ [[The Efl.Canvas.Textblock content of this scroller.]]
params {
text_obj: Efl.Canvas.Textblock; [[The text object to query]]
text_table: Efl.Ui.Table; [[The table container of
@@ -42,6 +40,9 @@ class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller
}
}
}
+ constructors {
+ .initialize @optional @construct_only;
+ }
implements {
Efl.Object.constructor;
Efl.Object.finalize;
diff --git a/src/lib/elementary/efl_ui_view_model.c b/src/lib/elementary/efl_ui_view_model.c
index 97ec0b5c4b..d129042986 100644
--- a/src/lib/elementary/efl_ui_view_model.c
+++ b/src/lib/elementary/efl_ui_view_model.c
@@ -29,7 +29,6 @@ struct _Efl_Ui_View_Model_Data
Eina_Bool child_added : 1;
Eina_Bool child_removed : 1;
} propagating; // Boolean to prevent reentrance event emission on the same object
- Eina_Bool finalized : 1;
Eina_Bool children_bind : 1; // Define if child object should be automatically bound
};
@@ -529,8 +528,6 @@ _efl_ui_view_model_property_changed(void *data, const Efl_Event *event)
static void
_efl_ui_view_model_children_bind_set(Eo *obj EINA_UNUSED, Efl_Ui_View_Model_Data *pd, Eina_Bool enable)
{
- if (pd->finalized) return;
-
pd->children_bind = enable;
}
@@ -656,14 +653,6 @@ _efl_ui_view_model_efl_object_constructor(Eo *obj, Efl_Ui_View_Model_Data *pd)
return obj;
}
-static Efl_Object *
-_efl_ui_view_model_efl_object_finalize(Eo *obj, Efl_Ui_View_Model_Data *pd)
-{
- pd->finalized = EINA_TRUE;
-
- return efl_finalize(efl_super(obj, EFL_UI_VIEW_MODEL_CLASS));
-}
-
static void
_efl_ui_view_model_efl_object_destructor(Eo *obj, Efl_Ui_View_Model_Data *pd)
{
diff --git a/src/lib/elementary/efl_ui_view_model.eo b/src/lib/elementary/efl_ui_view_model.eo
index 823d699609..f2b3e3489c 100644
--- a/src/lib/elementary/efl_ui_view_model.eo
+++ b/src/lib/elementary/efl_ui_view_model.eo
@@ -118,9 +118,7 @@ class Efl.Ui.View_Model extends Efl.Composite_Model
@property children_bind {
[[Define if we will intercept all children object reference and
bind them through the ViewModel with the same property logic as this
- one. Be careful of recursivity.
-
- This can only be applied at construction time.]]
+ one. Be careful of recursivity.]]
get {
}
set {
@@ -132,13 +130,12 @@ class Efl.Ui.View_Model extends Efl.Composite_Model
}
implements {
Efl.Object.constructor;
- Efl.Object.finalize;
Efl.Object.destructor;
Efl.Model.children_slice_get;
Efl.Model.properties { get; }
Efl.Model.property { set; get; }
}
constructors {
- Efl.Ui.View_Model.children_bind @optional;
+ Efl.Ui.View_Model.children_bind @optional @construct_only;
}
}
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index f8639bec6d..12b0811801 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -6009,13 +6009,8 @@ _efl_ui_win_efl_ui_l10n_l10n_text_get(const Eo *obj, Efl_Ui_Win_Data *sd, const
}
EOLIAN static void
-_efl_ui_win_win_type_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Type type)
+_efl_ui_win_win_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Type type)
{
- if (efl_finalized_get(obj))
- {
- ERR("This function is only allowed during construction.");
- return;
- }
sd->type = type;
}
@@ -6026,14 +6021,9 @@ _efl_ui_win_win_type_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
}
EOLIAN static void
-_efl_ui_win_win_name_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *name)
+_efl_ui_win_win_name_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *name)
{
- if (efl_finalized_get(obj))
- {
- ERR("This function is only allowed during construction.");
- return;
- }
- sd->name = eina_stringshare_add(name);
+ eina_stringshare_replace(&sd->name, name);
}
EOLIAN static const char *
@@ -6043,13 +6033,8 @@ _efl_ui_win_win_name_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
}
EOLIAN static void
-_efl_ui_win_accel_preference_set(Eo *obj, Efl_Ui_Win_Data *pd, const char *accel)
+_efl_ui_win_accel_preference_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, const char *accel)
{
- if (efl_finalized_get(obj))
- {
- ERR("This function is only allowed during construction.");
- return;
- }
eina_stringshare_replace(&pd->accel_pref, accel);
}
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index 713e254f7f..e27f12958d 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -413,10 +413,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
The meaning of name depends on the underlying windowing system.
- The window name is a construction property that can only be set at
- creation time, before finalize. In C this means inside $efl_add().
-
- Note: Once set, it cannot be modified afterwards.
+ In C this is set inside $efl_add().
]]
set {
}
@@ -431,10 +428,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
It is a hint of how the Window Manager should handle it.
- The window type is a construction property that can only be set at
- creation time, before finalize. In C this means inside $efl_add().
-
- Note: Once set, it cannot be modified afterward.
+ In C this is set inside $efl_add().
If the object is not window object, returns @Efl.Ui.Win_Type.unknown.
]]
@@ -838,15 +832,15 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
Efl.Part.part_get;
}
constructors {
- .win_name;
- .win_type @optional;
+ .win_name @construct_only;
+ .win_type @optional @construct_only;
/* Optional, like win_type beside it. This is @beta, and a mandatory
* constructor property lands in the middle of the generated signature
* for every binding that exposes it -- so building the C# binding with
* beta enabled stopped stable two-argument constructions of a window
* from compiling at all. Nothing needs an acceleration preference to
* make a window; the stable build has always made them without one. */
- .accel_preference @optional;
+ .accel_preference @optional @construct_only;
}
events {
delete,request: void; [[Called when the window receives a delete request]]
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index f408e7a2fc..3e1e2f76ea 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -46,17 +46,6 @@ static Eina_Unicode status_icons[] = {
0
};
-#define EO_CONSTRUCTOR_CHECK_RETURN(obj) do { \
- Eina_Bool finalized; \
- \
- finalized = efl_finalized_get(obj); \
- if (finalized) \
- { \
- ERR("This function is only allowed during construction."); \
- return; \
- } \
-} while (0)
-
static void _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline);
static Evas_Object *_elm_code_widget_grid_for_row_get(Elm_Code_Widget_Data *pd, unsigned int row);
@@ -2346,8 +2335,6 @@ _elm_code_widget_columns_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd
EOLIAN static void
_elm_code_widget_code_set(Eo *obj, Elm_Code_Widget_Data *pd, Elm_Code *code)
{
- EO_CONSTRUCTOR_CHECK_RETURN(obj);
-
pd->code = code;
if (code)
diff --git a/src/lib/elementary/elm_code_widget.eo b/src/lib/elementary/elm_code_widget.eo
index 3bbcff2abe..d27a90f851 100644
--- a/src/lib/elementary/elm_code_widget.eo
+++ b/src/lib/elementary/elm_code_widget.eo
@@ -21,9 +21,7 @@ class @beta Elm.Code_Widget extends Efl.Ui.Layout
c_prefix: efl_ui_code_widget;
methods {
@property code {
- [[The underlying code object that this widget renders.
- This can only be set during construction, once the widget is created the
- backing code object cannot be changed.]]
+ [[The underlying code object that this widget renders.]]
set {
}
get {
@@ -312,7 +310,7 @@ class @beta Elm.Code_Widget extends Efl.Ui.Layout
Efl.Ui.Widget.theme_apply;
}
constructors {
- .code;
+ .code @construct_only;
}
events {
line,clicked: Elm.Code_Line; [[Called when text line was clicked]]
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.