summaryrefslogtreecommitdiff
path: root/src/lib/efl
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-28 17:11:15 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-28 17:29:03 +0900
commit76ab8e3f54a138c524c0ea18be9f124f89853ceb (patch)
tree24f244d34327917e797f2673f446bc56fbd03add /src/lib/efl
parentce8460406813f2205afe0cf7dde6cd412e1140be (diff)
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.
Diffstat (limited to 'src/lib/efl')
-rw-r--r--src/lib/efl/interfaces/efl_pack.eo9
-rw-r--r--src/lib/efl/interfaces/efl_pack_grid.eo9
-rw-r--r--src/lib/efl/interfaces/efl_pack_linear.eo42
3 files changed, 44 insertions, 16 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)
19 unpack { 19 unpack {
20 [[Removes an existing item from the container, without deleting it.]] 20 [[Removes an existing item from the container, without deleting it.]]
21 params { 21 params {
22 subobj: Efl.Gfx @owned; [[Unpacked object]] 22 subobj: Efl.Gfx; [[The unpacked object.]]
23 } 23 }
24 return: bool; [[$false if $subobj wasn't a child or can't be removed]] 24 return: bool; [[$false if $subobj wasn't a child or can't be removed]]
25 } 25 }
@@ -30,11 +30,12 @@ interface Efl.Pack (Efl.Container)
30 spot, replacing any already existing element or append to the end 30 spot, replacing any already existing element or append to the end
31 of the container if there is no default part. 31 of the container if there is no default part.
32 32
33 The container takes ownership of this object. This means if packing 33 When this container is deleted, it will request deletion on the
34 failed, the object will be unrefed. 34 given $subobj. Use @.unpack to remove $subobj from this container
35 without deleting it.
35 ]] 36 ]]
36 params { 37 params {
37 subobj: Efl.Gfx @owned; [[Packed object]] 38 subobj: Efl.Gfx; [[An object to pack.]]
38 } 39 }
39 return: bool; [[$false if $subobj could not be packed.]] 40 return: bool; [[$false if $subobj could not be packed.]]
40 } 41 }
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)
6 eo_prefix: efl_pack; 6 eo_prefix: efl_pack;
7 methods { 7 methods {
8 pack_grid { 8 pack_grid {
9 [[Pack object on the grid]] 9 [[Pack object at a given location in the grid.
10
11 When this container is deleted, it will request deletion on the
12 given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
13 container without deleting it.
14 ]]
10 params { 15 params {
11 subobj: Efl.Gfx @owned; [[Object]] 16 subobj: Efl.Gfx; [[A child object to pack in this grid.]]
12 col: int; [[Column number]] 17 col: int; [[Column number]]
13 row: int; [[Row number]] 18 row: int; [[Row number]]
14 colspan: int @optional; [[0 means 1, -1 means @.grid_columns]] 19 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)
7 [[Prepend an object at the beginning of this container. 7 [[Prepend an object at the beginning of this container.
8 8
9 This is the same as @.pack_at($subobj, 0). 9 This is the same as @.pack_at($subobj, 0).
10
11 When this container is deleted, it will request deletion on the
12 given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
13 container without deleting it.
10 ]] 14 ]]
11 params { 15 params {
12 @in subobj: Efl.Gfx @owned; [[Item to pack.]] 16 @in subobj: Efl.Gfx; [[Item to pack.]]
13 } 17 }
14 return: bool; [[$false if $subobj could not be packed]] 18 return: bool; [[$false if $subobj could not be packed]]
15 } 19 }
@@ -17,41 +21,59 @@ interface Efl.Pack.Linear (Efl.Pack)
17 [[Append object at the end of this container. 21 [[Append object at the end of this container.
18 22
19 This is the same as @.pack_at($subobj, -1). 23 This is the same as @.pack_at($subobj, -1).
24
25 When this container is deleted, it will request deletion on the
26 given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
27 container without deleting it.
20 ]] 28 ]]
21 params { 29 params {
22 @in subobj: Efl.Gfx @owned; [[Item to pack.]] 30 @in subobj: Efl.Gfx; [[Item to pack at the end.]]
23 } 31 }
24 return: bool; [[$false if $subobj could not be packed]] 32 return: bool; [[$false if $subobj could not be packed]]
25 } 33 }
26 pack_before { 34 pack_before {
27 [[Prepend item before other sub object.]] 35 [[Prepend item before other sub object.
36
37 When this container is deleted, it will request deletion on the
38 given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
39 container without deleting it.
40 ]]
28 params { 41 params {
29 @in subobj: Efl.Gfx @owned; [[Item to pack.]] 42 @in subobj: Efl.Gfx; [[Item to pack before $existing.]]
30 @in existing: const(Efl.Gfx); [[Item to refer to.]] 43 @in existing: const(Efl.Gfx); [[Item to refer to.]]
31 } 44 }
32 return: bool; [[$false if $existing could not be found or $subobj 45 return: bool; [[$false if $existing could not be found or $subobj
33 could not be packed]] 46 could not be packed.]]
34 } 47 }
35 pack_after { 48 pack_after {
36 [[Append item after other sub object.]] 49 [[Append item after other sub object.
50
51 When this container is deleted, it will request deletion on the
52 given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
53 container without deleting it.
54 ]]
37 params { 55 params {
38 @in subobj: Efl.Gfx @owned; [[Item to pack.]] 56 @in subobj: Efl.Gfx; [[Item to pack after $existing.]]
39 @in existing: const(Efl.Gfx); [[Item to refer to.]] 57 @in existing: const(Efl.Gfx); [[Item to refer to.]]
40 } 58 }
41 return: bool; [[$false if $existing could not be found or $subobj 59 return: bool; [[$false if $existing could not be found or $subobj
42 could not be packed]] 60 could not be packed.]]
43 } 61 }
44 pack_at { 62 pack_at {
45 [[Inserts $subobj at the specified $index. 63 [[Inserts $subobj at the specified $index.
46 64
47 Valid range: -$count to +$count. -1 refers to the last element. 65 Valid range: -$count to +$count. -1 refers to the last element.
48 Out of range indices will trigger an append. 66 Out of range indices will trigger an append.
67
68 When this container is deleted, it will request deletion on the
69 given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
70 container without deleting it.
49 ]] 71 ]]
50 params { 72 params {
51 @in subobj: Efl.Gfx @owned; [[Item to pack.]] 73 @in subobj: Efl.Gfx; [[Item to pack at given index.]]
52 @in index: int; [[A position.]] 74 @in index: int; [[A position.]]
53 } 75 }
54 return: bool; [[$false if $subobj could not be packed]] 76 return: bool; [[$false if $subobj could not be packed.]]
55 } 77 }
56 pack_content_get { 78 pack_content_get {
57 [[Content at a given index in this container. 79 [[Content at a given index in this container.