summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-14 20:28:45 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-22 14:02:37 +0100
commit5c1fde2c57019c78ef02043fa5130714a0d507dc (patch)
treedfc99d519d504a38fa8de806e2090ed6f4989519 /src
parent7f283f0eceb6ab15ca86ee760f04019bab5b1273 (diff)
efl: add free functions to owned types
this commit is a first step in order to add free functions to all the types that are owned. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7627
Diffstat (limited to 'src')
-rw-r--r--src/lib/efl/Efl.h2
-rw-r--r--src/lib/efl/interfaces/efl_observer.c7
-rw-r--r--src/lib/efl/interfaces/efl_types.eot2
-rw-r--r--src/lib/elementary/Elementary.h2
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.c10
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo10
-rw-r--r--src/lib/eo/eina_types.eot2
-rw-r--r--src/tests/elementary/elm_test_focus.c2
-rw-r--r--src/tests/eolian/data/complex_type.eo2
9 files changed, 31 insertions, 8 deletions
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index af6154b766..c150cdc9fb 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -182,6 +182,8 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
182#include "interfaces/efl_text_markup.eo.h" 182#include "interfaces/efl_text_markup.eo.h"
183#include "interfaces/efl_text_markup_util.eo.h" 183#include "interfaces/efl_text_markup_util.eo.h"
184 184
185EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple);
186
185/** 187/**
186 * @brief Get a proxy object referring to a part of an object. 188 * @brief Get a proxy object referring to a part of an object.
187 * 189 *
diff --git a/src/lib/efl/interfaces/efl_observer.c b/src/lib/efl/interfaces/efl_observer.c
index c7efc30b2c..8656b801b9 100644
--- a/src/lib/efl/interfaces/efl_observer.c
+++ b/src/lib/efl/interfaces/efl_observer.c
@@ -257,5 +257,12 @@ _efl_observable_iterator_tuple_new(Eo *obj, Efl_Observable_Data *pd)
257 return &it->iterator; 257 return &it->iterator;
258} 258}
259 259
260EAPI void
261efl_observable_tuple_free(Efl_Observable_Tuple *tuple)
262{
263 //key is not owned
264 eina_iterator_free(tuple->data);
265}
266
260#include "interfaces/efl_observable.eo.c" 267#include "interfaces/efl_observable.eo.c"
261#include "interfaces/efl_observer.eo.c" 268#include "interfaces/efl_observer.eo.c"
diff --git a/src/lib/efl/interfaces/efl_types.eot b/src/lib/efl/interfaces/efl_types.eot
index 06a9426ee8..cf45db8f9c 100644
--- a/src/lib/efl/interfaces/efl_types.eot
+++ b/src/lib/efl/interfaces/efl_types.eot
@@ -39,7 +39,7 @@ struct Efl.Version
39 build_id: string; [[Contains $EFL_BUILD_ID.]] 39 build_id: string; [[Contains $EFL_BUILD_ID.]]
40} 40}
41 41
42struct Efl.Observable_Tuple 42struct @free(efl_observable_tuple_free) Efl.Observable_Tuple
43{ 43{
44 [[This type describes an observable touple]] 44 [[This type describes an observable touple]]
45 key: string; [[Touple key]] 45 key: string; [[Touple key]]
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 6050df643a..1aae5e01f5 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -153,8 +153,10 @@ EAPI extern Elm_Version *elm_version;
153typedef Eo Efl_Ui_Focus_Manager; 153typedef Eo Efl_Ui_Focus_Manager;
154#define _EFL_UI_FOCUS_MANAGER_EO_CLASS_TYPE 154#define _EFL_UI_FOCUS_MANAGER_EO_CLASS_TYPE
155 155
156
156# include <efl_ui_focus_object.eo.h> 157# include <efl_ui_focus_object.eo.h>
157# include <efl_ui_focus_manager.eo.h> 158# include <efl_ui_focus_manager.eo.h>
159EAPI void efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel);
158# include <efl_ui_focus_manager_window_root.eo.h> 160# include <efl_ui_focus_manager_window_root.eo.h>
159# include <efl_ui_focus_manager_calc.eo.h> 161# include <efl_ui_focus_manager_calc.eo.h>
160# include <efl_ui_focus_manager_sub.eo.h> 162# include <efl_ui_focus_manager_sub.eo.h>
diff --git a/src/lib/elementary/efl_ui_focus_manager.c b/src/lib/elementary/efl_ui_focus_manager.c
index 2cb14a6790..31afb9dc98 100644
--- a/src/lib/elementary/efl_ui_focus_manager.c
+++ b/src/lib/elementary/efl_ui_focus_manager.c
@@ -5,5 +5,15 @@
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" 6#include "elm_priv.h"
7 7
8EAPI void
9efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel)
10{
11 eina_list_free(rel->right);
12 eina_list_free(rel->left);
13 eina_list_free(rel->top);
14 eina_list_free(rel->down);
15 free(rel);
16}
17
8#include "efl_ui_focus_manager.eo.c" 18#include "efl_ui_focus_manager.eo.c"
9#include "efl_ui_focus_manager_window_root.eo.c" 19#include "efl_ui_focus_manager_window_root.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo
index 35614712b7..425ad9de67 100644
--- a/src/lib/elementary/efl_ui_focus_manager.eo
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -1,15 +1,15 @@
1import efl_ui; 1import efl_ui;
2import eina_types; 2import eina_types;
3 3
4struct Efl.Ui.Focus.Relations { 4struct @free(efl_ui_focus_relation_free) Efl.Ui.Focus.Relations {
5 [[Structure holding the graph of relations between focussable objects. 5 [[Structure holding the graph of relations between focussable objects.
6 6
7 @since 1.20 7 @since 1.20
8 ]] 8 ]]
9 right : list<Efl.Ui.Focus.Object>; [[List of objects on the right side]] 9 right : list<Efl.Ui.Focus.Object> @owned; [[List of objects on the right side]]
10 left : list<Efl.Ui.Focus.Object>; [[[List of objects on the left side]] 10 left : list<Efl.Ui.Focus.Object> @owned; [[[List of objects on the left side]]
11 top : list<Efl.Ui.Focus.Object>; [[[List of objects above]] 11 top : list<Efl.Ui.Focus.Object> @owned; [[[List of objects above]]
12 down : list<Efl.Ui.Focus.Object>; [[[List of objects below]] 12 down : list<Efl.Ui.Focus.Object> @owned; [[[List of objects below]]
13 next : Efl.Ui.Focus.Object; [[[Next object]] 13 next : Efl.Ui.Focus.Object; [[[Next object]]
14 prev : Efl.Ui.Focus.Object; [[Previous object]] 14 prev : Efl.Ui.Focus.Object; [[Previous object]]
15 parent : Efl.Ui.Focus.Object; [[Parent object]] 15 parent : Efl.Ui.Focus.Object; [[Parent object]]
diff --git a/src/lib/eo/eina_types.eot b/src/lib/eo/eina_types.eot
index d0b3dcbcb9..a70a6553e9 100644
--- a/src/lib/eo/eina_types.eot
+++ b/src/lib/eo/eina_types.eot
@@ -99,7 +99,7 @@ struct @extern Eina.Stat {
99 ctimensec: ulong; [[The nano version of the timestmap when the file was created]] 99 ctimensec: ulong; [[The nano version of the timestmap when the file was created]]
100} 100}
101 101
102struct @extern Eina.Promise; [[Eina promise type]] 102struct @extern @free(eina_promise_free) Eina.Promise; [[Eina promise type]]
103 103
104/* FIXME: This definitely shouldn't be here. */ 104/* FIXME: This definitely shouldn't be here. */
105type Efl.Event_Cb: __undefined_type; [[Efl event callback type]] 105type Efl.Event_Cb: __undefined_type; [[Efl event callback type]]
diff --git a/src/tests/elementary/elm_test_focus.c b/src/tests/elementary/elm_test_focus.c
index e9bc5a97c9..cfcefb28e3 100644
--- a/src/tests/elementary/elm_test_focus.c
+++ b/src/tests/elementary/elm_test_focus.c
@@ -144,6 +144,8 @@ EFL_START_TEST(pos_check2)
144 144
145#undef ck_assert_set_eq 145#undef ck_assert_set_eq
146 146
147 efl_ui_focus_relation_free(rel);
148
147 efl_unref(middle); 149 efl_unref(middle);
148 efl_unref(north_east); 150 efl_unref(north_east);
149 efl_unref(north_west); 151 efl_unref(north_west);
diff --git a/src/tests/eolian/data/complex_type.eo b/src/tests/eolian/data/complex_type.eo
index e8fe1a785e..511a8eee76 100644
--- a/src/tests/eolian/data/complex_type.eo
+++ b/src/tests/eolian/data/complex_type.eo
@@ -1,4 +1,4 @@
1struct @extern Eo; 1struct @free(efl_del) @extern Eo;
2 2
3class Complex_Type { 3class Complex_Type {
4 methods { 4 methods {