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
This commit is contained in:
Marcel Hollerbach 2019-01-14 20:28:45 +01:00
parent 7f283f0ece
commit 5c1fde2c57
9 changed files with 31 additions and 8 deletions

View File

@ -182,6 +182,8 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_text_markup.eo.h"
#include "interfaces/efl_text_markup_util.eo.h"
EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple);
/**
* @brief Get a proxy object referring to a part of an object.
*

View File

@ -257,5 +257,12 @@ _efl_observable_iterator_tuple_new(Eo *obj, Efl_Observable_Data *pd)
return &it->iterator;
}
EAPI void
efl_observable_tuple_free(Efl_Observable_Tuple *tuple)
{
//key is not owned
eina_iterator_free(tuple->data);
}
#include "interfaces/efl_observable.eo.c"
#include "interfaces/efl_observer.eo.c"

View File

@ -39,7 +39,7 @@ struct Efl.Version
build_id: string; [[Contains $EFL_BUILD_ID.]]
}
struct Efl.Observable_Tuple
struct @free(efl_observable_tuple_free) Efl.Observable_Tuple
{
[[This type describes an observable touple]]
key: string; [[Touple key]]

View File

@ -153,8 +153,10 @@ EAPI extern Elm_Version *elm_version;
typedef Eo Efl_Ui_Focus_Manager;
#define _EFL_UI_FOCUS_MANAGER_EO_CLASS_TYPE
# include <efl_ui_focus_object.eo.h>
# include <efl_ui_focus_manager.eo.h>
EAPI void efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel);
# include <efl_ui_focus_manager_window_root.eo.h>
# include <efl_ui_focus_manager_calc.eo.h>
# include <efl_ui_focus_manager_sub.eo.h>

View File

@ -5,5 +5,15 @@
#include <Elementary.h>
#include "elm_priv.h"
EAPI void
efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel)
{
eina_list_free(rel->right);
eina_list_free(rel->left);
eina_list_free(rel->top);
eina_list_free(rel->down);
free(rel);
}
#include "efl_ui_focus_manager.eo.c"
#include "efl_ui_focus_manager_window_root.eo.c"

View File

@ -1,15 +1,15 @@
import efl_ui;
import eina_types;
struct Efl.Ui.Focus.Relations {
struct @free(efl_ui_focus_relation_free) Efl.Ui.Focus.Relations {
[[Structure holding the graph of relations between focussable objects.
@since 1.20
]]
right : list<Efl.Ui.Focus.Object>; [[List of objects on the right side]]
left : list<Efl.Ui.Focus.Object>; [[[List of objects on the left side]]
top : list<Efl.Ui.Focus.Object>; [[[List of objects above]]
down : list<Efl.Ui.Focus.Object>; [[[List of objects below]]
right : list<Efl.Ui.Focus.Object> @owned; [[List of objects on the right side]]
left : list<Efl.Ui.Focus.Object> @owned; [[[List of objects on the left side]]
top : list<Efl.Ui.Focus.Object> @owned; [[[List of objects above]]
down : list<Efl.Ui.Focus.Object> @owned; [[[List of objects below]]
next : Efl.Ui.Focus.Object; [[[Next object]]
prev : Efl.Ui.Focus.Object; [[Previous object]]
parent : Efl.Ui.Focus.Object; [[Parent object]]

View File

@ -99,7 +99,7 @@ struct @extern Eina.Stat {
ctimensec: ulong; [[The nano version of the timestmap when the file was created]]
}
struct @extern Eina.Promise; [[Eina promise type]]
struct @extern @free(eina_promise_free) Eina.Promise; [[Eina promise type]]
/* FIXME: This definitely shouldn't be here. */
type Efl.Event_Cb: __undefined_type; [[Efl event callback type]]

View File

@ -144,6 +144,8 @@ EFL_START_TEST(pos_check2)
#undef ck_assert_set_eq
efl_ui_focus_relation_free(rel);
efl_unref(middle);
efl_unref(north_east);
efl_unref(north_west);

View File

@ -1,4 +1,4 @@
struct @extern Eo;
struct @free(efl_del) @extern Eo;
class Complex_Type {
methods {