jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=76ab8e3f54a138c524c0ea18be9f124f89853ceb
commit 76ab8e3f54a138c524c0ea18be9f124f89853ceb Author: Jean-Philippe Andre <[email protected]> Date: Thu Sep 28 17:11:15 2017 +0900 efl: Remove @owned tag from pack/content APIs Refer to the previous commits for more context. When an evas object is given to a container, be it with a variant of efl_pack() or efl_content_set(), its "ownership" is given to the new parent container. But ownership here means that the new container may delete the child when it sees fit (i.e. when the container itself dies, for instance). This does not mean that a reference was passed from the calling context to the container. The actual EO owner of the child is always the canvas or another canvas object, even if it the object is unpacked. Note: This means that invalid calls to efl_pack or efl_content_set will not automatically delete the child object. This is the same as legacy, and results in floating objects. Just check the return value! :) Hopefully this is correct for bindings. --- src/lib/efl/interfaces/efl_pack.eo | 9 ++++--- src/lib/efl/interfaces/efl_pack_grid.eo | 9 +++++-- src/lib/efl/interfaces/efl_pack_linear.eo | 42 +++++++++++++++++++++++-------- src/lib/elementary/efl_ui_win.eo | 2 +- src/lib/elementary/elm_gengrid_item.eo | 2 +- src/lib/elementary/elm_genlist_item.eo | 2 +- src/lib/evas/canvas/efl_canvas_group.eo | 2 +- 7 files changed, 48 insertions(+), 20 deletions(-) diff --git a/src/lib/efl/interfaces/efl_pack.eo b/src/lib/efl/interfaces/efl_pack.eo index 8b9a78973f..fbee67a076 100644 --- a/src/lib/efl/interfaces/efl_pack.eo +++ b/src/lib/efl/interfaces/efl_pack.eo @@ -19,7 +19,7 @@ interface Efl.Pack (Efl.Container) unpack { [[Removes an existing item from the container, without deleting it.]] params { - subobj: Efl.Gfx @owned; [[Unpacked object]] + subobj: Efl.Gfx; [[The unpacked object.]] } return: bool; [[$false if $subobj wasn't a child or can't be removed]] } @@ -30,11 +30,12 @@ interface Efl.Pack (Efl.Container) spot, replacing any already existing element or append to the end of the container if there is no default part. - The container takes ownership of this object. This means if packing - failed, the object will be unrefed. + When this container is deleted, it will request deletion on the + given $subobj. Use @.unpack to remove $subobj from this container + without deleting it. ]] params { - subobj: Efl.Gfx @owned; [[Packed object]] + subobj: Efl.Gfx; [[An object to pack.]] } return: bool; [[$false if $subobj could not be packed.]] } diff --git a/src/lib/efl/interfaces/efl_pack_grid.eo b/src/lib/efl/interfaces/efl_pack_grid.eo index 73b9d3bc19..3cd9cb27e8 100644 --- a/src/lib/efl/interfaces/efl_pack_grid.eo +++ b/src/lib/efl/interfaces/efl_pack_grid.eo @@ -6,9 +6,14 @@ interface Efl.Pack.Grid (Efl.Pack.Linear) eo_prefix: efl_pack; methods { pack_grid { - [[Pack object on the grid]] + [[Pack object at a given location in the grid. + + When this container is deleted, it will request deletion on the + given $subobj. Use @Efl.Pack.unpack to remove $subobj from this + container without deleting it. + ]] params { - subobj: Efl.Gfx @owned; [[Object]] + subobj: Efl.Gfx; [[A child object to pack in this grid.]] col: int; [[Column number]] row: int; [[Row number]] colspan: int @optional; [[0 means 1, -1 means @.grid_columns]] diff --git a/src/lib/efl/interfaces/efl_pack_linear.eo b/src/lib/efl/interfaces/efl_pack_linear.eo index c8ee058fe1..2ee7deee83 100644 --- a/src/lib/efl/interfaces/efl_pack_linear.eo +++ b/src/lib/efl/interfaces/efl_pack_linear.eo @@ -7,9 +7,13 @@ interface Efl.Pack.Linear (Efl.Pack) [[Prepend an object at the beginning of this container. This is the same as @.pack_at($subobj, 0). + + When this container is deleted, it will request deletion on the + given $subobj. Use @Efl.Pack.unpack to remove $subobj from this + container without deleting it. ]] params { - @in subobj: Efl.Gfx @owned; [[Item to pack.]] + @in subobj: Efl.Gfx; [[Item to pack.]] } return: bool; [[$false if $subobj could not be packed]] } @@ -17,41 +21,59 @@ interface Efl.Pack.Linear (Efl.Pack) [[Append object at the end of this container. This is the same as @.pack_at($subobj, -1). + + When this container is deleted, it will request deletion on the + given $subobj. Use @Efl.Pack.unpack to remove $subobj from this + container without deleting it. ]] params { - @in subobj: Efl.Gfx @owned; [[Item to pack.]] + @in subobj: Efl.Gfx; [[Item to pack at the end.]] } return: bool; [[$false if $subobj could not be packed]] } pack_before { - [[Prepend item before other sub object.]] + [[Prepend item before other sub object. + + When this container is deleted, it will request deletion on the + given $subobj. Use @Efl.Pack.unpack to remove $subobj from this + container without deleting it. + ]] params { - @in subobj: Efl.Gfx @owned; [[Item to pack.]] + @in subobj: Efl.Gfx; [[Item to pack before $existing.]] @in existing: const(Efl.Gfx); [[Item to refer to.]] } return: bool; [[$false if $existing could not be found or $subobj - could not be packed]] + could not be packed.]] } pack_after { - [[Append item after other sub object.]] + [[Append item after other sub object. + + When this container is deleted, it will request deletion on the + given $subobj. Use @Efl.Pack.unpack to remove $subobj from this + container without deleting it. + ]] params { - @in subobj: Efl.Gfx @owned; [[Item to pack.]] + @in subobj: Efl.Gfx; [[Item to pack after $existing.]] @in existing: const(Efl.Gfx); [[Item to refer to.]] } return: bool; [[$false if $existing could not be found or $subobj - could not be packed]] + could not be packed.]] } pack_at { [[Inserts $subobj at the specified $index. Valid range: -$count to +$count. -1 refers to the last element. Out of range indices will trigger an append. + + When this container is deleted, it will request deletion on the + given $subobj. Use @Efl.Pack.unpack to remove $subobj from this + container without deleting it. ]] params { - @in subobj: Efl.Gfx @owned; [[Item to pack.]] + @in subobj: Efl.Gfx; [[Item to pack at given index.]] @in index: int; [[A position.]] } - return: bool; [[$false if $subobj could not be packed]] + return: bool; [[$false if $subobj could not be packed.]] } pack_content_get { [[Content at a given index in this container. diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index f65f549932..73f2715c64 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -368,7 +368,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Access.Window, type @Efl.Canvas.Image or @Efl.Ui.Image are allowed. ]] values { - icon: Efl.Canvas.Object @owned @nullable; + icon: Efl.Canvas.Object @nullable; [[The image object to use for an icon.]] } } diff --git a/src/lib/elementary/elm_gengrid_item.eo b/src/lib/elementary/elm_gengrid_item.eo index dc63ed3333..3bda536ee2 100644 --- a/src/lib/elementary/elm_gengrid_item.eo +++ b/src/lib/elementary/elm_gengrid_item.eo @@ -234,7 +234,7 @@ class Elm.Gengrid.Item(Elm.Widget.Item) @since 1.18 ]] params { - @out l: list<Efl.Canvas.Object @owned> @owned; [[The contents list to return.]] + @out l: list<Efl.Canvas.Object> @owned; [[The contents list to return.]] } } } diff --git a/src/lib/elementary/elm_genlist_item.eo b/src/lib/elementary/elm_genlist_item.eo index a6ef85d3d1..4763df2710 100644 --- a/src/lib/elementary/elm_genlist_item.eo +++ b/src/lib/elementary/elm_genlist_item.eo @@ -334,7 +334,7 @@ class Elm.Genlist.Item(Elm.Widget.Item) elsewhere if the user wants to. ]] params { - @out l: list<Efl.Canvas.Object @owned> @owned; [[The contents list to return.]] + @out l: list<Efl.Canvas.Object> @owned; [[The contents list to return.]] } } update { diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo index e3af2ca038..602b0bdc04 100644 --- a/src/lib/evas/canvas/efl_canvas_group.eo +++ b/src/lib/evas/canvas/efl_canvas_group.eo @@ -81,7 +81,7 @@ class Efl.Canvas.Group (Efl.Canvas.Object) See also @.group_member_is. ]] params { - @in sub_obj: Efl.Canvas.Object @owned @nonull; [[The member object.]] + @in sub_obj: Efl.Canvas.Object @nonull; [[The member object.]] } legacy: null; } --
