Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-09-06 10:20:08 +09:00
commit e97c4f3749
67 changed files with 1002 additions and 954 deletions

View File

@ -67,7 +67,7 @@ test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
snprintf(buf, sizeof(buf), "%s/objects/multibuttonentry.edj", elm_app_data_dir_get());
layout = efl_add(EFL_UI_LAYOUT_CLASS, win,
elm_layout_file_set(efl_added, buf, "multibuttonentry_test"),
elm_win_resize_object_add(win, efl_added));
efl_content_set(win, efl_added));
array = eina_array_new(10);
for (i = 0; i < 9; i++)

View File

@ -18,7 +18,7 @@ _gen_param(Eina_Strbuf *buf, Eolian_Function_Parameter *pr,
const Eolian_Type *prt = eolian_parameter_type_get(pr);
const Eolian_Typedecl *ptd = eolian_type_typedecl_get(prt);
const char *prn = eolian_parameter_name_get(pr);
Eina_Stringshare *prtn = eolian_type_c_type_get(prt, EOLIAN_C_TYPE_PARAM);
Eina_Stringshare *prtn = eolian_parameter_c_type_get(pr, EINA_FALSE);
if (ptd && (eolian_typedecl_type_get(ptd) == EOLIAN_TYPEDECL_FUNCTION_POINTER))
{
@ -83,6 +83,7 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid,
Eina_Bool var_as_ret = EINA_FALSE;
const Eolian_Type *rtp = eolian_function_return_type_get(fid, ftype);
Eina_Bool return_move = eolian_function_return_is_move(fid, ftype);
Eina_Stringshare *rtps = NULL;
if (ftype == EOLIAN_PROP_GET && !rtp)
{
void *d1, *d2;
@ -92,6 +93,7 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid,
Eolian_Function_Parameter *pr = (Eolian_Function_Parameter *)d1;
rtp = eolian_parameter_type_get(pr);
return_move = eolian_parameter_is_move(pr);
rtps = eolian_parameter_c_type_get(pr, EINA_TRUE);
var_as_ret = EINA_TRUE;
}
eina_iterator_free(itr);
@ -119,17 +121,18 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid,
eina_strbuf_append(buf, "EOAPI ");
if (rtp)
{
Eina_Stringshare *rtps = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN);
if (!rtps)
rtps = eolian_function_return_c_type_get(fid, ftype);
eina_strbuf_append(buf, rtps);
if (rtps[strlen(rtps) - 1] != '*')
eina_strbuf_append_char(buf, ' ');
eina_stringshare_del(rtps);
}
else
eina_strbuf_append(buf, "void ");
eina_strbuf_append(buf, fcn);
eina_stringshare_del(fcn);
eina_stringshare_del(rtps);
Eina_Strbuf *flagbuf = NULL;
int nidx = !eolian_function_is_static(fid);

View File

@ -103,11 +103,11 @@ _gen_func_pointer_param(const char *name, Eina_Stringshare *c_type,
}
static void
_append_defval(Eina_Strbuf *buf, const Eolian_Expression *exp, const Eolian_Type *tp)
_append_defval(Eina_Strbuf *buf, const Eolian_Expression *exp, const Eolian_Type *tp, const char *ctp)
{
if (exp)
{
Eolian_Value val = eolian_expression_eval_type(exp, tp);
Eolian_Value val = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
if (lit)
{
@ -139,13 +139,11 @@ _append_defval(Eina_Strbuf *buf, const Eolian_Expression *exp, const Eolian_Type
free(sn);
return;
}
Eina_Stringshare *ctp = eolian_type_c_type_get(btp, EOLIAN_C_TYPE_DEFAULT);
if (strchr(ctp, '*'))
{
eina_strbuf_append(buf, "NULL");
return;
}
eina_stringshare_del(ctp);
/* enums and remaining regulars... 0 should do */
eina_strbuf_append(buf, "0");
}
@ -377,9 +375,11 @@ _get_reflect_initf(const Eolian_Type *abtp)
}
static void
_gen_reflect_get(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt,
_gen_reflect_get(Eina_Strbuf *buf, const char *cnamel,
const Eolian_Function_Parameter *pr,
const Eolian_Function *fid, Eina_Hash *refh)
{
const Eolian_Type *valt = eolian_parameter_type_get(pr);
if (eolian_type_is_ptr(valt))
return;
@ -399,7 +399,7 @@ _gen_reflect_get(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt,
cnamel, eolian_function_name_get(fid));
eina_strbuf_append(buf, "{\n");
Eina_Stringshare *ct = eolian_type_c_type_get(valt, EOLIAN_C_TYPE_RETURN);
Eina_Stringshare *ct = eolian_parameter_c_type_get(pr, EINA_TRUE);
const char *starsp = (ct[strlen(ct) - 1] != '*') ? " " : "";
Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, EOLIAN_PROP_GET);
@ -412,9 +412,11 @@ _gen_reflect_get(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt,
}
static void
_gen_reflect_set(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt,
_gen_reflect_set(Eina_Strbuf *buf, const char *cnamel,
const Eolian_Function_Parameter *pr,
const Eolian_Function *fid, Eina_Hash *refh)
{
const Eolian_Type *valt = eolian_parameter_type_get(pr);
if (eolian_type_is_ptr(valt))
return;
@ -435,7 +437,7 @@ _gen_reflect_set(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt,
eina_strbuf_append(buf, "{\n");
eina_strbuf_append(buf, " Eina_Error r = 0;");
Eina_Stringshare *ct = eolian_type_c_type_get(valt, EOLIAN_C_TYPE_PARAM);
Eina_Stringshare *ct = eolian_parameter_c_type_get(pr, EINA_FALSE);
const char *starsp = (ct[strlen(ct) - 1] != '*') ? " " : "";
eina_strbuf_append_printf(buf, " %s%scval;\n", ct, starsp);
eina_stringshare_del(ct);
@ -458,14 +460,11 @@ _gen_reflect_set(Eina_Strbuf *buf, const char *cnamel, const Eolian_Type *valt,
}
static void
_emit_class_function(Eina_Strbuf *buf, const Eolian_Function *fid, const Eolian_Type *rtp, Eina_Strbuf *params_full,
_emit_class_function(Eina_Strbuf *buf, const Eolian_Function *fid, const char *rtpn, Eina_Strbuf *params_full,
const char *ocnamel, const char *func_suffix, Eina_Strbuf *params, const char *function_name)
{
eina_strbuf_append(buf, "EOAPI ");
if (rtp)
eina_strbuf_append(buf, eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN));
else
eina_strbuf_append(buf, "void");
eina_strbuf_append(buf, rtpn);
eina_strbuf_append(buf, " ");
eina_strbuf_append(buf, function_name);
eina_strbuf_append(buf, "(");
@ -476,7 +475,7 @@ _emit_class_function(Eina_Strbuf *buf, const Eolian_Function *fid, const Eolian_
eina_strbuf_append(buf, ")\n");
eina_strbuf_append(buf, "{\n");
eina_strbuf_append_printf(buf, " %s();\n", eolian_class_c_get_function_name_get(eolian_function_class_get(fid)));
if (rtp)
if (strcmp(rtpn, "void"))
eina_strbuf_append(buf, " return ");
else
eina_strbuf_append(buf, " ");
@ -504,14 +503,16 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
Eina_Bool var_as_ret = EINA_FALSE;
/* assume we're not generating reflection api by default */
const Eolian_Type *reflect_type = NULL;
const Eolian_Function_Parameter *reflect_param = NULL;
const Eolian_Expression *def_ret = NULL;
const Eolian_Type *rtp = eolian_function_return_type_get(fid, ftype);
Eina_Stringshare *rtpn = NULL;
if (rtp)
{
is_auto = EINA_FALSE; /* can't do auto if func returns */
def_ret = eolian_function_return_default_value_get(fid, ftype);
rtpn = eolian_function_return_c_type_get(fid, ftype);
}
const char *func_suffix = "";
@ -528,9 +529,10 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
rtp = eolian_parameter_type_get(pr);
/* reflect only when returning 1 val */
if (!eolian_parameter_is_by_ref(pr))
reflect_type = rtp;
reflect_param = pr;
var_as_ret = EINA_TRUE;
def_ret = eolian_parameter_default_value_get(pr);
rtpn = eolian_parameter_c_type_get(pr, EINA_TRUE);
}
eina_iterator_free(itr);
}
@ -545,7 +547,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
{
Eolian_Function_Parameter *pr = d1;
if (!eolian_parameter_is_by_ref(pr))
reflect_type = eolian_parameter_type_get(pr);
reflect_param = pr;
}
eina_iterator_free(itr);
}
@ -560,13 +562,12 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
{
Eina_Iterator *itr = eolian_property_keys_get(fid, ftype);
if (itr) /* has keys: no reflection */
reflect_type = NULL;
reflect_param = NULL;
Eolian_Function_Parameter *pr;
EINA_ITERATOR_FOREACH(itr, pr)
{
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
Eina_Stringshare *ptn = eolian_parameter_c_type_get(pr, EINA_FALSE);
if (eina_strbuf_length_get(params))
eina_strbuf_append(params, ", ");
@ -646,7 +647,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
const Eolian_Expression *dfv = eolian_parameter_default_value_get(pr);
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
Eina_Stringshare *ptn = eolian_parameter_c_type_get(pr, EINA_FALSE);
const Eolian_Typedecl *ptd = eolian_type_typedecl_get(pt);
Eina_Bool had_star = ptn[strlen(ptn) - 1] == '*';
@ -720,8 +721,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
if (impl_same_class && eolian_implement_is_pure_virtual(impl, ftype))
impl_need = EINA_FALSE;
Eina_Stringshare *rtpn = rtp ? eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN)
: eina_stringshare_add("void");
if (!rtpn)
rtpn = eina_stringshare_add("void");
char *cname = NULL, *cnamel = NULL, *ocnamel = NULL;
eo_gen_class_names_get(cl, &cname, NULL, &cnamel);
@ -809,7 +810,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
if (rtp)
{
eina_strbuf_append(buf, " return ");
_append_defval(buf, def_ret, rtp);
_append_defval(buf, def_ret, rtp, rtpn);
eina_strbuf_append(buf, ";\n");
}
eina_strbuf_append(buf, "}\n\n");
@ -837,12 +838,12 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
if (impl_same_class && !eolian_function_is_static(fid))
{
/* generate reflection implementation */
if (reflect_type)
if (reflect_param)
{
if (ftype == EOLIAN_PROP_GET)
_gen_reflect_get(buf, cnamel, reflect_type, fid, refh);
_gen_reflect_get(buf, cnamel, reflect_param, fid, refh);
else
_gen_reflect_set(buf, cnamel, reflect_type, fid, refh);
_gen_reflect_set(buf, cnamel, reflect_param, fid, refh);
}
void *data;
@ -893,7 +894,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
if (strcmp(rtpn, "void"))
{
eina_strbuf_append_printf(buf, ", %s, ", rtpn);
_append_defval(buf, def_ret, rtp);
_append_defval(buf, def_ret, rtp, rtpn);
}
if (fallback_free_ownership)
@ -912,7 +913,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
eina_stringshare_del(eofn);
}
if (impl_same_class && eolian_function_is_static(fid))
_emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, eolian_function_full_c_name_get(fid, ftype));
_emit_class_function(buf, fid, rtpn, params_full, ocnamel, func_suffix, params, eolian_function_full_c_name_get(fid, ftype));
free(cname);
free(cnamel);
@ -1245,8 +1246,7 @@ _gen_params(const Eolian_Function *fid, Eolian_Function_Type ftype,
EINA_ITERATOR_FOREACH(itr, pr)
{
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
Eina_Stringshare *ptn = eolian_parameter_c_type_get(pr, EINA_FALSE);
eina_strbuf_append(params, ", ");
eina_strbuf_append(params, prn);
@ -1276,7 +1276,7 @@ _gen_params(const Eolian_Function *fid, Eolian_Function_Type ftype,
const char *prn = eolian_parameter_name_get(pr);
const Eolian_Type *pt = eolian_parameter_type_get(pr);
const Eolian_Typedecl *ptd = eolian_type_typedecl_get(pt);
Eina_Stringshare *ptn = eolian_type_c_type_get(pt, EOLIAN_C_TYPE_PARAM);
Eina_Stringshare *ptn = eolian_parameter_c_type_get(pr, EINA_FALSE);
if (ptd && eolian_typedecl_type_get(ptd) == EOLIAN_TYPEDECL_FUNCTION_POINTER)
{
@ -1339,6 +1339,7 @@ _gen_proto(const Eolian_Class *cl, const Eolian_Function *fid,
Eina_Bool var_as_ret = EINA_FALSE;
const Eolian_Type *rtp = eolian_function_return_type_get(fid, ftype);
Eina_Stringshare *rtpn = NULL;
if ((ftype == EOLIAN_PROP_GET) && !rtp)
{
void *d1, *d2;
@ -1347,6 +1348,7 @@ _gen_proto(const Eolian_Class *cl, const Eolian_Function *fid,
{
Eolian_Function_Parameter *pr = d1;
rtp = eolian_parameter_type_get(pr);
rtpn = eolian_parameter_c_type_get(pr, EINA_FALSE);
var_as_ret = EINA_TRUE;
}
eina_iterator_free(itr);
@ -1355,7 +1357,8 @@ _gen_proto(const Eolian_Class *cl, const Eolian_Function *fid,
eina_strbuf_append(buf, "EOLIAN static ");
if (rtp)
{
Eina_Stringshare *rtpn = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN);
if (!rtpn)
rtpn = eolian_function_return_c_type_get(fid, ftype);
eina_strbuf_append(buf, rtpn);
eina_stringshare_del(rtpn);
}

View File

@ -41,9 +41,8 @@ _type_generate(const Eolian_State *state, const Eolian_Typedecl *tp,
Eina_Iterator *membs = eolian_typedecl_struct_fields_get(tp);
EINA_ITERATOR_FOREACH(membs, memb)
{
const Eolian_Type *mtp = eolian_typedecl_struct_field_type_get(memb);
Eina_Stringshare *ct = NULL;
ct = eolian_type_c_type_get(mtp, EOLIAN_C_TYPE_DEFAULT);
ct = eolian_typedecl_struct_field_c_type_get(memb);
eina_strbuf_append_printf(buf, " %s%s%s;",
ct, strchr(ct, '*') ? "" : " ",
eolian_typedecl_struct_field_name_get(memb));
@ -137,8 +136,9 @@ _type_generate(const Eolian_State *state, const Eolian_Typedecl *tp,
eina_strbuf_append(buf, "void ");
else
{
Eina_Stringshare *ct = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN);
Eina_Stringshare *ct = eolian_function_return_c_type_get(fid, EOLIAN_FUNCTION_POINTER);
eina_strbuf_append_printf(buf, "%s ", ct);
eina_stringshare_del(ct);
}
/* Function name */
@ -191,7 +191,7 @@ _var_generate(const Eolian_State *state, const Eolian_Variable *vr)
eina_strbuf_prepend_printf(buf, "#ifndef %s\n", fn);
eina_strbuf_append_printf(buf, "#define %s ", fn);
const Eolian_Expression *vv = eolian_variable_value_get(vr);
Eolian_Value val = eolian_expression_eval_type(vv, vt);
Eolian_Value val = eolian_expression_eval(vv, EOLIAN_MASK_ALL);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append(buf, lit);
Eina_Stringshare *exp = eolian_expression_serialize(vv);
@ -397,7 +397,7 @@ _source_gen_var(Eina_Strbuf *buf, const Eolian_Variable *vr)
eina_stringshare_del(ct);
free(fn);
Eolian_Value val = eolian_expression_eval_type(vv, vt);
Eolian_Value val = eolian_expression_eval(vv, EOLIAN_MASK_ALL);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append(buf, lit);
eina_strbuf_append_char(buf, ';');

View File

@ -460,7 +460,6 @@ ffi.cdef [[
const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp);
Eolian_Value_t eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m);
Eolian_Value_t eolian_expression_eval_type(const Eolian_Expression *expr, const Eolian_Type *type);
const char *eolian_expression_value_to_literal(const Eolian_Value *v);
const char *eolian_expression_serialize(const Eolian_Expression *expr);
Eolian_Expression_Type eolian_expression_type_get(const Eolian_Expression *expr);
@ -1711,12 +1710,6 @@ M.Expression = ffi.metatype("Eolian_Expression", {
return ffi.cast("Eolian_Value*", v)
end,
eval_type = function(self, tp)
local v = eolian.eolian_expression_eval_type(self, tp)
if v == nil then return nil end
return ffi.cast("Eolian_Value*", v)
end,
serialize = function(self)
local v = eolian.eolian_expression_serialize(self)
if v == nil then return nil end

View File

@ -315,6 +315,7 @@ elm_main(int argc EINA_UNUSED, char **argv)
elm_win_resize_object_add(win, wbox);
//window show
efl_gfx_entity_visible_set(win, EINA_TRUE);
efl_gfx_entity_size_set(win, EINA_SIZE2D(417, 600));
elm_run();

View File

@ -74,7 +74,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
Efl_Ui_Factory *factory;
Evas_Object *win, *li;
Eo *model;
Efl_Select_Model *selmodel;
Efl_Ui_Select_Model *selmodel;
win = elm_win_util_standard_add("list_view", "List_View");
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@ -82,7 +82,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
elm_win_autodel_set(win, EINA_TRUE);
model = _make_model(win);
selmodel = efl_add(EFL_SELECT_MODEL_CLASS, efl_main_loop_get()
selmodel = efl_add(EFL_UI_SELECT_MODEL_CLASS, efl_main_loop_get()
, efl_ui_view_model_set(efl_added, model)
);

View File

@ -125,9 +125,7 @@ EAPI Eo *efl_main_loop_get(void);
#include "efl_container_model.eo.h"
#include "efl_composite_model.eo.h"
#include "efl_boolean_model.eo.h"
#include "efl_select_model.eo.h"
#include "efl_filter_model.eo.h"
#include "efl_view_model.eo.h"
/**
* @}

View File

@ -59,6 +59,76 @@ efl_model_list_value_get(Eina_List *childrens,
return v;
}
#define EFL_COMPOSITE_MODEL_CHILD_INDEX "child.index"
#define EFL_COMPOSITE_MODEL_PROPERTIES(name, dyn, sta, ...) \
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__)
#define EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, obj, klass, dyn, ...) \
Eina_Iterator *name; \
do \
{ \
static const char *static_props__[] = { \
__VA_ARGS__ \
}; \
name = _efl_composite_model_properties_mix( \
((obj) ? efl_model_properties_get(efl_super((obj), (klass))) : NULL), \
(dyn), \
EINA_C_ARRAY_ITERATOR_NEW(static_props__)); \
} \
while (0)
static inline Eina_Iterator *
_efl_composite_model_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Eina_Iterator *sta)
{
Eina_Iterator *its[3];
int i = 0;
if (sta) its[i++] = sta;
if (dyn) its[i++] = dyn;
if (super) its[i++] = super;
switch (i)
{
case 1: return its[0];
case 2: return eina_multi_iterator_new(its[0], its[1]);
case 3: return eina_multi_iterator_new(its[0], its[1], its[2]);
default: return NULL;
};
}
#define EFL_COMPOSITE_LOOKUP_RETURN(Remember, Parent, View, Base) \
Efl_Model *Remember; \
char buf[1024]; \
\
snprintf(buf, sizeof (buf), Base"-%p", Parent); \
Remember = efl_key_wref_get(View, buf); \
if (Remember) \
{ \
efl_ref(Remember); \
return Remember; \
}
#define EFL_COMPOSITE_REMEMBER_RETURN(Remember, View) \
efl_key_wref_set(View, buf, Remember); \
return Remember;
static inline Efl_Model *
_efl_composite_lookup(const Efl_Class *self, Eo *parent, Efl_Model *view, unsigned int index)
{
EFL_COMPOSITE_LOOKUP_RETURN(remember, parent, view, "_efl.composite_model");
remember = efl_add_ref(self, parent,
efl_ui_view_model_set(efl_added, view),
efl_composite_model_index_set(efl_added, index),
efl_loop_model_volatile_make(efl_added));
if (!remember) return NULL;
EFL_COMPOSITE_REMEMBER_RETURN(remember, view);
}
#undef EAPI
#define EAPI

View File

@ -4,7 +4,7 @@
#include <Efl_Core.h>
#include "efl_composite_model_private.h"
#include "ecore_internal.h"
typedef struct _Efl_Boolean_Model_Data Efl_Boolean_Model_Data;
typedef struct _Efl_Boolean_Model_Value Efl_Boolean_Model_Value;

View File

@ -7,8 +7,6 @@
#include <Ecore.h>
#include "ecore_private.h"
#include "efl_composite_model_private.h"
#include "efl_composite_model.eo.h"
typedef struct _Efl_Composite_Model_Data Efl_Composite_Model_Data;

View File

@ -1,74 +0,0 @@
#ifndef EFL_COMPOSITE_MODEL_PRIVATE_H_
# define EFL_COMPOSITE_MODEL_PRIVATE_H_
#define EFL_COMPOSITE_MODEL_CHILD_INDEX "child.index"
#define EFL_COMPOSITE_MODEL_PROPERTIES(name, dyn, sta, ...) \
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__)
#define EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, obj, klass, dyn, ...) \
Eina_Iterator *name; \
do \
{ \
static const char *static_props__[] = { \
__VA_ARGS__ \
}; \
name = _efl_composite_model_properties_mix( \
((obj) ? efl_model_properties_get(efl_super((obj), (klass))) : NULL), \
(dyn), \
EINA_C_ARRAY_ITERATOR_NEW(static_props__)); \
} \
while (0)
static inline Eina_Iterator *
_efl_composite_model_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Eina_Iterator *sta)
{
Eina_Iterator *its[3];
int i = 0;
if (sta) its[i++] = sta;
if (dyn) its[i++] = dyn;
if (super) its[i++] = super;
switch (i)
{
case 1: return its[0];
case 2: return eina_multi_iterator_new(its[0], its[1]);
case 3: return eina_multi_iterator_new(its[0], its[1], its[2]);
default: return NULL;
};
}
#define EFL_COMPOSITE_LOOKUP_RETURN(Remember, Parent, View, Base) \
Efl_Model *Remember; \
char buf[1024]; \
\
snprintf(buf, sizeof (buf), Base"-%p", Parent); \
Remember = efl_key_wref_get(View, buf); \
if (Remember) \
{ \
efl_ref(Remember); \
return Remember; \
}
#define EFL_COMPOSITE_REMEMBER_RETURN(Remember, View) \
efl_key_wref_set(View, buf, Remember); \
return Remember;
static inline Efl_Model *
_efl_composite_lookup(const Efl_Class *self, Eo *parent, Efl_Model *view, unsigned int index)
{
EFL_COMPOSITE_LOOKUP_RETURN(remember, parent, view, "_efl.composite_model");
remember = efl_add_ref(self, parent,
efl_ui_view_model_set(efl_added, view),
efl_composite_model_index_set(efl_added, index),
efl_loop_model_volatile_make(efl_added));
if (!remember) return NULL;
EFL_COMPOSITE_REMEMBER_RETURN(remember, view);
}
#endif

View File

@ -8,7 +8,6 @@
#include <Ecore.h>
#include "ecore_internal.h"
#include "efl_composite_model_private.h"
typedef struct _Efl_Container_Property_Data Efl_Container_Property_Data;
typedef struct _Efl_Container_Model_Data Efl_Container_Model_Data;

View File

@ -4,7 +4,7 @@
#include <Efl_Core.h>
#include "efl_composite_model_private.h"
#include "ecore_internal.h"
typedef struct _Efl_Filter_Model_Mapping Efl_Filter_Model_Mapping;
struct _Efl_Filter_Model_Mapping

View File

@ -59,9 +59,7 @@ pub_eo_files = [
'efl_generic_model.eo',
'efl_container_model.eo',
'efl_boolean_model.eo',
'efl_select_model.eo',
'efl_composite_model.eo',
'efl_view_model.eo',
'efl_core_env.eo',
'efl_core_proc_env.eo',
'efl_core_command_line.eo',
@ -141,11 +139,8 @@ ecore_src = [
'efl_container_model.c',
'efl_composite_model.c',
'efl_boolean_model.c',
'efl_select_model.c',
'efl_composite_model_private.h',
'efl_model_accessor_view.c',
'efl_model_accessor_view_private.h',
'efl_view_model.c',
'efl_filter_model.c',
'efl_linear_interpolator.c',
'efl_accelerate_interpolator.c',

View File

@ -286,6 +286,7 @@ typedef struct _Ecore_Wl2_Event_Window_Rotation
int rotation, w, h, angle;
Eina_Bool resize : 1;
} Ecore_Wl2_Event_Window_Rotation;
typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Prepare;
typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Prepare_Done;
typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Request;
@ -598,7 +599,6 @@ EAPI struct wl_shm *ecore_wl2_display_shm_get(Ecore_Wl2_Display *display);
* @param display The Ecore_Wl2_Display for which to retrieve the existing
* Wayland dmabuf interface from
*
*
* @return The wl_dmabuf which this Ecore_Wl2_Display is using
*
* @ingroup Ecore_Wl2_Display_Group
@ -640,8 +640,11 @@ EAPI void ecore_wl2_display_screen_size_get(Ecore_Wl2_Display *display, int *w,
/**
* Get all the Ecore_Wl2_Input from the display.
*
* @param display The display
*
* @return A Eina_Iterator of Ecore_Wl2_Input or @c NULL on error
*
* @ingroup Ecore_Wl2_Display_Group
* @since 1.19
*/
@ -649,9 +652,12 @@ EAPI Eina_Iterator *ecore_wl2_display_inputs_get(Ecore_Wl2_Display *display);
/**
* Find a seat for a given display object using the seat id
*
* @param display The display
* @param id The seat id
*
* @return The corresponding Ecore_Wl2_Input object or @c NULL if no match is found
*
* @ingroup Ecore_Wl2_Display_Group
* @since 1.20
*/
@ -659,9 +665,12 @@ EAPI Ecore_Wl2_Input *ecore_wl2_display_input_find(const Ecore_Wl2_Display *disp
/**
* Find a seat for a given display object using the seat id
*
* @param display The display
* @param name The seat name
*
* @return The corresponding Ecore_Wl2_Input object or @c NULL if no match is found
*
* @ingroup Ecore_Wl2_Display_Group
* @since 1.20
*/
@ -1087,8 +1096,8 @@ EAPI Eina_Bool ecore_wl2_window_rotation_app_get(Ecore_Wl2_Window *window);
/**
* Set preferred rotation on a given window
*
* @param window
* @param rot
* @param window The window to set preferred rotation on
* @param rot The value of the preferred rotation to set
*
* @ingroup Ecore_Wl2_Window_Group
* @since 1.20
@ -1098,7 +1107,7 @@ EAPI void ecore_wl2_window_preferred_rotation_set(Ecore_Wl2_Window *window, int
/**
* Get preferred rotation for a given window
*
* @param window
* @param window The window to get preferred rotation from
*
* @return Given windows preferred rotation
*
@ -1183,7 +1192,9 @@ EAPI void ecore_wl2_window_aux_hint_del(Ecore_Wl2_Window *window, int id);
/**
* @brief Get the activated state of a window
* @param window The window
*
* @param window The window to get activated state from
*
* @return @c EINA_TRUE if activated
*
* @ingroup Ecore_Wl2_Window_Group
@ -1193,6 +1204,7 @@ EAPI Eina_Bool ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window);
/**
* @brief Set the seat for a popup window to be used with grab
*
* @param window The window
* @param input The seat
*
@ -1231,8 +1243,8 @@ EAPI Ecore_Wl2_Display *ecore_wl2_window_display_get(const Ecore_Wl2_Window *win
/**
* Set if this window should ignore focus requests
*
* @param window
* @param focus_skip
* @param window The window to set ignore focus requests on
* @param focus_skip EINA_TRUE if this window should skip focus requests, EINA_FALSE otherwise
*
* @ingroup Ecore_Wl2_Window_Group
* @since 1.20
@ -1242,7 +1254,7 @@ EAPI void ecore_wl2_window_focus_skip_set(Ecore_Wl2_Window *window, Eina_Bool fo
/**
* Get if this window ignores focus requests
*
* @param window
* @param window The window to get the focus skip value from
*
* @return EINA_TRUE if a window should skip focus requests, EINA_FALSE otherwise
*
@ -1265,8 +1277,8 @@ EAPI void ecore_wl2_window_role_set(Ecore_Wl2_Window *window, const char *role);
/**
* Set if a given window is in floating mode
*
* @param window
* @param floating
* @param window The window to set floating mode on
* @param floating EINA_TRUE if this window should be in floating mode, EINA_FALSE otherwise
*
* @ingroup Ecore_Wl2_Window_Group
* @since 1.20
@ -1276,7 +1288,7 @@ EAPI void ecore_wl2_window_floating_mode_set(Ecore_Wl2_Window *window, Eina_Bool
/**
* Get if a given window is in floating mode
*
* @param window
* @param window The window to get floating mode
*
* @return EINA_TRUE if floating, EINA_FALSE otherwise
*
@ -1317,8 +1329,11 @@ EAPI Ecore_Wl2_Seat_Capabilities ecore_wl2_input_seat_capabilities_get(Ecore_Wl2
/**
* Get the wayland's seat id from an input.
*
* @param input The input
*
* @return The seat id
*
* @ingroup Ecore_Wl2_Input_Group
* @since 1.19
*/
@ -1326,8 +1341,11 @@ EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input) EINA_WARN_
/**
* Get the display object of an input
*
* @param input The input
*
* @return The display
*
* @ingroup Ecore_Wl2_Input_Group
* @since 1.20
*/
@ -1335,8 +1353,11 @@ EAPI Ecore_Wl2_Display *ecore_wl2_input_display_get(const Ecore_Wl2_Input *input
/**
* Get the xkb_keymap object of an input
*
* @param input The input
*
* @return The xkb_keymap object
*
* @ingroup Ecore_Wl2_Input_Group
* @since 1.20
*/
@ -1344,8 +1365,11 @@ EAPI struct xkb_keymap *ecore_wl2_input_keymap_get(const Ecore_Wl2_Input *input)
/**
* Get the name of an input
*
* @param input The input
*
* @return The name
*
* @ingroup Ecore_Wl2_Input_Group
* @since 1.20
*/
@ -1353,10 +1377,13 @@ EAPI Eina_Stringshare *ecore_wl2_input_name_get(Ecore_Wl2_Input *input);
/**
* Get the keyboard repeat rate and delay of an input
*
* @param input The input
* @param rate Pointer to store the repeat rate (in seconds)
* @param rate Pointer to store the repeat delay (in seconds)
*
* @return True if repeat is enabled
*
* @ingroup Ecore_Wl2_Input_Group
* @since 1.20
*/
@ -1364,9 +1391,12 @@ EAPI Eina_Bool ecore_wl2_input_keyboard_repeat_get(const Ecore_Wl2_Input *input,
/**
* Get the Evas_Device for the seat belonging to a window from an input
*
* @param input The input
* @param window The window
*
* @return The device object
*
* @ingroup Ecore_Wl2_Input_Group
* @since 1.20
*/
@ -1426,7 +1456,6 @@ EAPI void ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const cha
* This call initializes a data source and offeres the given mimetypes
*
* @param input the input where to add on the data source
*
* @param types a null-terminated array of mimetypes
*
* @ingroup Ecore_Wl2_Dnd_Group
@ -1438,10 +1467,9 @@ EAPI void ecore_wl2_dnd_drag_types_set(Ecore_Wl2_Input *input, const char **type
* Start a drag on the given input
*
* @param input the input to use
*
* @param window the window which is the origin of the drag operation
*
* @param drag_window the window which is used as window of the visible hint.
*
* @return The serial for the start_drag request
*
* @ingroup Ecore_Wl2_Dnd_Group
@ -1459,7 +1487,7 @@ EAPI uint32_t ecore_wl2_dnd_drag_start(Ecore_Wl2_Input *input, Ecore_Wl2_Window
* @ingroup Ecore_Wl2_Dnd_Group
* @since 1.20
*/
EAPI EAPI void ecore_wl2_dnd_set_actions(Ecore_Wl2_Input *input);
EAPI void ecore_wl2_dnd_set_actions(Ecore_Wl2_Input *input);
/**
* End a drag started by a call to ecore_wl2_dnd_drag_start
@ -1487,7 +1515,6 @@ EAPI Ecore_Wl2_Offer* ecore_wl2_dnd_selection_get(Ecore_Wl2_Input *input);
* where the caller of this api must write the data (encoded in the given mimetype) to the fd
*
* @param input the input to provice this types on
*
* @param types a null-terminated array of mimetypes supported by the client
*
* @return serial of request on success, 0 on failure
@ -1696,6 +1723,7 @@ EAPI int ecore_wl2_output_dpi_get(Ecore_Wl2_Output *output);
* @param output The output to get the transform of
*
* @return The output's current transform value
*
* @ingroup Ecore_Wl2_Output_Group
* @since 1.20
*/
@ -1719,6 +1747,7 @@ EAPI int ecore_wl2_display_compositor_version_get(Ecore_Wl2_Display *disp);
* @param offer Offer object to use
*
* @return or´ed values from Ecore_Wl2_Drag_Action which are describing the available actions
*
* @ingroup Ecore_Wl2_Dnd_Group
* @since 1.19
*/
@ -1861,8 +1890,8 @@ EAPI void ecore_wl2_session_recovery_disable(void);
* A surface that has been commit will be in the "pending" state until
* the compositor tells us it's time to draw again via a frame callback.
*
* @surface surface to commit
* @flush EINA_TRUE if we need to flush immediately.
* @param window The window whose surface we want to commit
* @param flush EINA_TRUE if we need to flush immediately.
*
* @since 1.21
*/
@ -1874,6 +1903,8 @@ EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush);
* A surface is pending if it's been commit but we haven't received a
* frame callback for it yet. This mean's we're not ready to draw yet.
*
* @param window The window whose surface we want to check
*
* @return whether the window's surface is pending or not.
*
* @since 1.21
@ -1883,9 +1914,9 @@ EAPI Eina_Bool ecore_wl2_window_pending_get(Ecore_Wl2_Window *window);
/**
* Add a callback that fires when the window's surface_frame callback fires
*
* @window the window to add a callback on
* @cb The callback
* @data user data to provide to the callback handler
* @param window The window to add a callback on
* @param cb The callback
* @param data User data to provide to the callback handler
*
* @since 1.21
*/
@ -1894,8 +1925,8 @@ EAPI Ecore_Wl2_Frame_Cb_Handle *ecore_wl2_window_frame_callback_add(Ecore_Wl2_Wi
/**
* delete a callback that fires when the window's surface_frame callback fires
*
* @window the window to add a callback on
* @cb The callback handle
* @param window The window to add a callback on
* @param cb The callback handle
*
* @since 1.21
*/
@ -1909,11 +1940,11 @@ EAPI void ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle)
* has a valid buffer. That is, call with implicit true and buffer NULL at
* the time of glSwapBuffers.
*
* @window the target window
* @buffer the buffer to attach
* @x x offset from corner
* @y y offset from corner
* @implicit true if an external library is doing the actual attaching
* @param window The target window
* @param buffer The buffer to attach
* @param x X offset from corner
* @param y Y offset from corner
* @param implicit True if an external library is doing the actual attaching
*
* @since 1.21
*/
@ -1926,7 +1957,8 @@ EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, void *buffer, in
* so the display should be flushed at appropriate times, such
* as after a commit.
*
* @param display
* @param display The display to flush
*
* @since 1.21
*/
EAPI void ecore_wl2_display_flush(Ecore_Wl2_Display *display);
@ -1934,7 +1966,7 @@ EAPI void ecore_wl2_display_flush(Ecore_Wl2_Display *display);
/**
* Get if a given window is resizing
*
* @param window
* @param window The window to check for resizing
*
* @return EINA_TRUE if resizing, EINA_FALSE otherwise
*
@ -1953,7 +1985,8 @@ EAPI Eina_Bool ecore_wl2_window_resizing_get(Ecore_Wl2_Window *window);
* Events deferred during an update will automatically fire
* immediately after the caller calls ecore_wl2_window_commit.
*
* @param window
* @param window The window whose state we want to latch
*
* @since 1.21
*/
EAPI void ecore_wl2_window_update_begin(Ecore_Wl2_Window *window);

View File

@ -1600,11 +1600,23 @@ static void
_delete_emit(Edje *ed, Evas_Textblock_Cursor *c, Entry *en, size_t pos,
Eina_Bool backspace)
{
if (!evas_textblock_cursor_char_next(c))
if (backspace)
{
return;
if (!evas_textblock_cursor_char_prev(c))
{
return;
}
evas_textblock_cursor_char_next(c);
}
else
{
if (!evas_textblock_cursor_char_next(c))
{
return;
}
evas_textblock_cursor_char_prev(c);
}
evas_textblock_cursor_char_prev(c);
Edje_Entry_Change_Info *info = calloc(1, sizeof(*info));
if (!info)
@ -1617,16 +1629,40 @@ _delete_emit(Edje *ed, Evas_Textblock_Cursor *c, Entry *en, size_t pos,
info->insert = EINA_FALSE;
if (backspace)
{
info->change.del.start = pos - 1;
Evas_Textblock_Cursor *cc = evas_object_textblock_cursor_new(en->rp->object);
evas_textblock_cursor_copy(c, cc);
Eina_Bool remove_cluster = evas_textblock_cursor_at_cluster_as_single_glyph(cc,EINA_FALSE);
if (remove_cluster)
{
evas_textblock_cursor_cluster_prev(cc);
}
else
{
evas_textblock_cursor_char_prev(cc);
}
info->change.del.start = evas_textblock_cursor_pos_get(cc);
info->change.del.end = pos;
tmp = evas_textblock_cursor_content_get(c);
evas_textblock_cursor_char_delete(c);
tmp = evas_textblock_cursor_range_text_get(c, cc, EVAS_TEXTBLOCK_TEXT_MARKUP);
evas_textblock_cursor_range_delete(c, cc);
evas_textblock_cursor_free(cc);
}
else
{
Evas_Textblock_Cursor *cc = evas_object_textblock_cursor_new(en->rp->object);
evas_textblock_cursor_copy(c, cc);
evas_textblock_cursor_cluster_next(cc);
Eina_Bool remove_cluster = evas_textblock_cursor_at_cluster_as_single_glyph(cc,EINA_TRUE);
if (remove_cluster)
{
evas_textblock_cursor_cluster_next(cc);
}
else
{
evas_textblock_cursor_char_next(cc);
}
info->change.del.start = evas_textblock_cursor_pos_get(cc);
info->change.del.end = pos;
@ -1954,7 +1990,7 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
else
{
if (evas_textblock_cursor_char_prev(en->cursor))
//if (evas_textblock_cursor_char_prev(en->cursor))
{
_delete_emit(ed, en->cursor, en, old_cur_pos, EINA_TRUE);
}

View File

@ -466,7 +466,17 @@ edje_object_mmap_set(Edje_Object *obj, const Eina_File *file, const char *group)
EAPI Eina_Bool
edje_object_file_set(Edje_Object *obj, const char *file, const char *group)
{
efl_file_unload(obj);
// We can't blindly unload here - this loses swallowed content (in
// swallows, boxes, tables etc.) ... this here along with an actual
// implementation of file unload broke the pager in E for starters
// as shading then unshading (double click titlebar) a window would
// lose the mini preview image obj swallowed in. also fullscreening
// would do it. this also broke gadget bar, the xkb gadget in it too
// and more... so this is a particularly bad thing break. we need to
// iterate over every child and re-swallow, re-pack into boxes, tables
// etc. because that is what edje used to do. unloading here is definitely
// worse ... so disable for now.
// efl_file_unload(obj);
return efl_file_simple_load(obj, file, group);
}

View File

@ -22,13 +22,16 @@ efreet_uri_decode(const char *full_uri)
Efreet_Uri *uri;
const char *p;
char scheme[64], authority[_POSIX_HOST_NAME_MAX], path[PATH_MAX];
char *sep;
int i = 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(full_uri, NULL);
/* An uri should be in the form <scheme>:[<authority>][<path>][<query>][<fragment>] */
if (!strstr(full_uri, ":")) return NULL;
sep = strchr(full_uri, ':');
if (!sep) return NULL;
/* check if we have a Windows PATH, that is a letter follow by a colon */
if ((sep - full_uri) == 1) return NULL;
memset(scheme, 0, 64);
memset(authority, 0, _POSIX_HOST_NAME_MAX);

View File

@ -762,63 +762,6 @@ _efl_io_model_efl_model_property_set(Eo *obj,
return efl_loop_future_rejected(obj, err);
}
static void
_efl_io_model_children_list(void *data, Eina_Array *entries)
{
Eina_File_Direct_Info *info;
Efl_Model *obj = data;
Efl_Io_Model_Data *pd;
Efl_Model_Children_Event cevt = { 0 };
Eina_Array_Iterator iterator;
unsigned int i;
pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS);
if (!pd) return ;
EINA_ARRAY_ITER_NEXT(entries, i, info, iterator)
{
Efl_Io_Model_Info *mi;
if (_already_added(pd, info->path)) continue;
if (pd->filter.cb)
{
if (!pd->filter.cb(pd->filter.data, obj, info))
continue ;
}
mi = calloc(1, sizeof (Efl_Io_Model_Info));
if (!mi) continue ;
mi->path_length = info->path_length;
mi->path = eina_stringshare_add(info->path);
mi->name_start = info->name_start;
mi->name_length = info->name_length;
mi->type = _efl_io_model_info_type_get(info, NULL);
mi->parent_ref = EINA_FALSE;
mi->child_ref = EINA_TRUE;
cevt.index = eina_list_count(pd->files);
cevt.child = NULL;
pd->files = eina_list_append(pd->files, mi);
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
}
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
}
static void
_efl_io_model_children_list_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
{
Efl_Io_Model_Data *pd = data;
pd->request.listing = NULL;
pd->listed = EINA_TRUE;
}
/**
* Children Count Get
*/
@ -835,30 +778,6 @@ _efl_io_model_efl_model_children_count_get(const Eo *obj, Efl_Io_Model_Data *pd)
{
_eio_build_st(obj, pd);
}
else if (!pd->listed &&
!pd->request.listing &&
pd->info->type == EINA_FILE_DIR)
{
Efl_Io_Manager *iom;
Eina_Future *f;
iom = efl_provider_find(obj, EFL_IO_MANAGER_CLASS);
if (!iom)
{
ERR("Could not find an Efl.Io.Manager on %p.", obj);
return 0;
}
f = efl_io_manager_direct_ls(iom, pd->path, EINA_FALSE,
(void*) obj, _efl_io_model_children_list, NULL);
//start monitoring before listing is done
//we will filter later on if we already published a file or not
_efl_io_model_efl_model_monitor_add(pd);
pd->request.listing = efl_future_then(obj, f,
.free = _efl_io_model_children_list_cleanup,
.data = pd);
}
return eina_list_count(pd->files);
}

View File

@ -11,7 +11,11 @@ function @beta EflIoFilter {
class @beta Efl.Io.Model extends Efl.Loop_Model
{
[[Efl Io model class]]
[[Efl Io model class
Model is populated asynchronously from a monitoring thread, so values
won't be correct immediately.
]]
methods {
children_filter_set {
@ -32,9 +36,9 @@ class @beta Efl.Io.Model extends Efl.Loop_Model
@property path {
[[ Define the root path of a model.
]]
set { [[ Only possible during construction. ]] }
get { }
values {
set { [[ Only possible during construction. ]] }
get { }
values {
path: string; [[ Root path of the model. ]]
}
}

View File

@ -277,6 +277,8 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
# include <efl_ui_tab_bar.eo.h>
# include <efl_ui_tab_page.eo.h>
# include <efl_ui_tab_pager.eo.h>
# include <efl_ui_select_model.eo.h>
# include <efl_ui_view_model.eo.h>
/**
* Initialize Elementary
*

View File

@ -300,14 +300,14 @@ _size_accessor_get_at(void *data, Efl_Ui_Position_Manager_Size_Call_Config conf,
for (i = 0; i < (conf.range.end_id - conf.range.start_id); ++i)
{
Efl_Gfx_Entity *geom = eina_list_data_get(lst), *parent;
Eina_Size2D size = efl_gfx_hint_size_min_get(geom);
Eina_Size2D size = efl_gfx_hint_size_combined_min_get(geom);
parent = efl_ui_item_parent_get(geom);
sizes[i].size = size;
_fill_depth(geom, &sizes[i].element_depth, &sizes[i].depth_leader);
if (i == 0 && !sizes[0].depth_leader && parent)
{
result.parent_size = efl_gfx_hint_size_min_get(parent);
result.parent_size = efl_gfx_hint_size_combined_min_get(parent);
}
lst = eina_list_next(lst);
if (!lst)

View File

@ -2,20 +2,17 @@
# include <config.h>
#endif
#include "Eina.h"
#include "Efl.h"
#include <Ecore.h>
#include "Eo.h"
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_select_model.eo.h"
#include "efl_model_accessor_view_private.h"
#include "efl_composite_model_private.h"
#include "efl_ui_select_model.eo.h"
#include "ecore_internal.h"
typedef struct _Efl_Select_Model_Data Efl_Select_Model_Data;
typedef struct _Efl_Ui_Select_Model_Data Efl_Ui_Select_Model_Data;
struct _Efl_Select_Model_Data
struct _Efl_Ui_Select_Model_Data
{
Efl_Select_Model_Data *parent;
Efl_Ui_Select_Model_Data *parent;
unsigned long last;
Eina_Bool single_selection : 1;
@ -23,20 +20,20 @@ struct _Efl_Select_Model_Data
};
static Eo*
_efl_select_model_efl_object_constructor(Eo *obj,
Efl_Select_Model_Data *pd EINA_UNUSED)
_efl_ui_select_model_efl_object_constructor(Eo *obj,
Efl_Ui_Select_Model_Data *pd EINA_UNUSED)
{
Eo *parent;
obj = efl_constructor(efl_super(obj, EFL_SELECT_MODEL_CLASS));
obj = efl_constructor(efl_super(obj, EFL_UI_SELECT_MODEL_CLASS));
efl_boolean_model_boolean_add(obj, "selected", EINA_FALSE);
pd->last = -1;
parent = efl_parent_get(obj);
if (efl_isa(parent, EFL_SELECT_MODEL_CLASS))
pd->parent = efl_data_scope_get(parent, EFL_SELECT_MODEL_CLASS);
if (efl_isa(parent, EFL_UI_SELECT_MODEL_CLASS))
pd->parent = efl_data_scope_get(parent, EFL_UI_SELECT_MODEL_CLASS);
return obj;
}
@ -44,7 +41,7 @@ _efl_select_model_efl_object_constructor(Eo *obj,
static Eina_Value
_commit_change(Eo *child, void *data EINA_UNUSED, const Eina_Value v)
{
Efl_Select_Model_Data *pd;
Efl_Ui_Select_Model_Data *pd;
Eina_Value *selected = NULL;
Eina_Bool selflag = EINA_FALSE;
@ -53,7 +50,7 @@ _commit_change(Eo *child, void *data EINA_UNUSED, const Eina_Value v)
selected = efl_model_property_get(child, "selected");
pd = efl_data_scope_get(efl_parent_get(child), EFL_SELECT_MODEL_CLASS);
pd = efl_data_scope_get(efl_parent_get(child), EFL_UI_SELECT_MODEL_CLASS);
if (!pd) goto on_error;
eina_value_bool_get(selected, &selflag);
@ -62,7 +59,7 @@ _commit_change(Eo *child, void *data EINA_UNUSED, const Eina_Value v)
// select case
pd->none = EINA_FALSE;
pd->last = efl_composite_model_index_get(child);
efl_event_callback_call(child, EFL_SELECT_MODEL_EVENT_SELECTED, child);
efl_event_callback_call(child, EFL_UI_SELECT_MODEL_EVENT_SELECTED, child);
}
else
{
@ -75,7 +72,7 @@ _commit_change(Eo *child, void *data EINA_UNUSED, const Eina_Value v)
pd->last = 0;
pd->none = EINA_TRUE;
}
efl_event_callback_call(child, EFL_SELECT_MODEL_EVENT_UNSELECTED, child);
efl_event_callback_call(child, EFL_UI_SELECT_MODEL_EVENT_UNSELECTED, child);
}
on_error:
@ -222,7 +219,7 @@ _untangle_error(void *data, Eina_Error err)
// where we could end up here.
Eina_Error *error = calloc(1, sizeof (Eina_Error));
f = efl_model_property_set(efl_super(child, EFL_SELECT_MODEL_CLASS),
f = efl_model_property_set(efl_super(child, EFL_UI_SELECT_MODEL_CLASS),
"selected", eina_value_bool_new(EINA_FALSE));
// Once this is done, we need to repropagate the error
*error = err;
@ -241,19 +238,19 @@ _untangle_free(void *data,
}
static Eina_Iterator *
_efl_select_model_efl_model_properties_get(const Eo *obj,
Efl_Select_Model_Data *pd EINA_UNUSED)
_efl_ui_select_model_efl_model_properties_get(const Eo *obj,
Efl_Ui_Select_Model_Data *pd EINA_UNUSED)
{
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props,
obj, EFL_SELECT_MODEL_CLASS,
obj, EFL_UI_SELECT_MODEL_CLASS,
NULL,
"self.selected", "child.selected", "single_selection");
return props;
}
static Eina_Future *
_efl_select_model_efl_model_property_set(Eo *obj,
Efl_Select_Model_Data *pd,
_efl_ui_select_model_efl_model_property_set(Eo *obj,
Efl_Ui_Select_Model_Data *pd,
const char *property, Eina_Value *value)
{
Eina_Value vf = EINA_VALUE_EMPTY;
@ -296,7 +293,7 @@ _efl_select_model_efl_model_property_set(Eo *obj,
Eina_Value *prev;
Eina_Future *chain;
prev = efl_model_property_get(efl_super(obj, EFL_SELECT_MODEL_CLASS), "selected");
prev = efl_model_property_get(efl_super(obj, EFL_UI_SELECT_MODEL_CLASS), "selected");
success = eina_value_bool_get(prev, &prevflag);
success &= eina_value_bool_convert(value, &newflag);
@ -309,7 +306,7 @@ _efl_select_model_efl_model_property_set(Eo *obj,
single_selection = pd->parent->single_selection;
// First store the new value in the boolean model we inherit from
chain = efl_model_property_set(efl_super(obj, EFL_SELECT_MODEL_CLASS),
chain = efl_model_property_set(efl_super(obj, EFL_UI_SELECT_MODEL_CLASS),
"selected", value);
// Now act !
@ -357,12 +354,12 @@ _efl_select_model_efl_model_property_set(Eo *obj,
.free = _clear_child);
}
return efl_model_property_set(efl_super(obj, EFL_SELECT_MODEL_CLASS),
return efl_model_property_set(efl_super(obj, EFL_UI_SELECT_MODEL_CLASS),
property, value);
}
static Eina_Value *
_efl_select_model_efl_model_property_get(const Eo *obj, Efl_Select_Model_Data *pd, const char *property)
_efl_ui_select_model_efl_model_property_get(const Eo *obj, Efl_Ui_Select_Model_Data *pd, const char *property)
{
if (eina_streq("single_selection", property))
return eina_value_bool_new(pd->single_selection);
@ -377,34 +374,34 @@ _efl_select_model_efl_model_property_get(const Eo *obj, Efl_Select_Model_Data *p
// Redirect to are we ourself selected
if (pd->parent && eina_streq("self.selected", property))
{
return efl_model_property_get(efl_super(obj, EFL_SELECT_MODEL_CLASS), "selected");
return efl_model_property_get(efl_super(obj, EFL_UI_SELECT_MODEL_CLASS), "selected");
}
return efl_model_property_get(efl_super(obj, EFL_SELECT_MODEL_CLASS), property);
return efl_model_property_get(efl_super(obj, EFL_UI_SELECT_MODEL_CLASS), property);
}
static void
_efl_select_model_single_selection_set(Eo *obj EINA_UNUSED, Efl_Select_Model_Data *pd, Eina_Bool enable)
_efl_ui_select_model_single_selection_set(Eo *obj EINA_UNUSED, Efl_Ui_Select_Model_Data *pd, Eina_Bool enable)
{
pd->single_selection = enable;
}
static Eina_Bool
_efl_select_model_single_selection_get(const Eo *obj EINA_UNUSED, Efl_Select_Model_Data *pd)
_efl_ui_select_model_single_selection_get(const Eo *obj EINA_UNUSED, Efl_Ui_Select_Model_Data *pd)
{
return pd->single_selection;
}
static Eina_Iterator *
_efl_select_model_selected_get(Eo *obj, Efl_Select_Model_Data *pd EINA_UNUSED)
_efl_ui_select_model_selected_get(Eo *obj, Efl_Ui_Select_Model_Data *pd EINA_UNUSED)
{
return efl_boolean_model_boolean_iterator_get(obj, "selected", EINA_TRUE);
}
static Eina_Iterator *
_efl_select_model_unselected_get(Eo *obj, Efl_Select_Model_Data *pd EINA_UNUSED)
_efl_ui_select_model_unselected_get(Eo *obj, Efl_Ui_Select_Model_Data *pd EINA_UNUSED)
{
return efl_boolean_model_boolean_iterator_get(obj, "selected", EINA_FALSE);
}
#include "efl_select_model.eo.c"
#include "efl_ui_select_model.eo.c"

View File

@ -1,6 +1,6 @@
class @beta Efl.Select_Model extends Efl.Boolean_Model
class @beta Efl.Ui.Select_Model extends Efl.Boolean_Model
{
[[Efl select model class]]
[[Efl ui select model class]]
methods {
selected_get {
[[Get an iterator of all the selected child of this model.

View File

@ -611,6 +611,8 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
if (!efl_text_cursor_equal(obj, start, end))
{
efl_canvas_text_range_delete(obj, start, end);
EFL_UI_TEXT_DATA_GET(obj, sd);
_efl_ui_text_select_none(obj, sd);
}
cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN);
info.insert = EINA_TRUE;
@ -3983,8 +3985,8 @@ _efl_ui_text_selection_changed_cb(void *data, const Efl_Event *event EINA_UNUSED
if (!text || (text[0] == '\0'))
{
_edje_signal_emit(sd, "selection,cleared", "efl.text");
sd->have_selection = EINA_FALSE;
_selection_clear(data, 0);
sd->have_selection = EINA_FALSE;
}
else
{

View File

@ -2,31 +2,27 @@
# include <config.h>
#endif
#include <Efl.h>
#include <Eina.h>
#include <Eo.h>
#include <Ecore.h>
#include <Elementary.h>
#include "elm_priv.h"
#include "ecore_internal.h"
#include "efl_composite_model_private.h"
typedef struct _Efl_Ui_View_Model_Data Efl_Ui_View_Model_Data;
typedef struct _Efl_Ui_View_Model_Bind Efl_Ui_View_Model_Bind;
typedef struct _Efl_Ui_View_Model_Text Efl_Ui_View_Model_Text;
typedef struct _Efl_Ui_View_Model_Logic Efl_Ui_View_Model_Logic;
typedef struct _Efl_Ui_View_Model_Property_Ref Efl_Ui_View_Model_Property_Ref;
typedef struct _Efl_View_Model_Data Efl_View_Model_Data;
typedef struct _Efl_View_Model_Bind Efl_View_Model_Bind;
typedef struct _Efl_View_Model_Text Efl_View_Model_Text;
typedef struct _Efl_View_Model_Logic Efl_View_Model_Logic;
typedef struct _Efl_View_Model_Property_Ref Efl_View_Model_Property_Ref;
struct _Efl_View_Model_Data
struct _Efl_Ui_View_Model_Data
{
// FIXME: If parent is set, always access parent... recursively?
Efl_View_Model_Data *parent;
Efl_Ui_View_Model_Data *parent;
Eina_Hash *bound; // Stringhash of Efl_View_Model_Bind
Eina_Hash *logics; // Stringhash of Efl_View_Model_Logic
Eina_Hash *texts; // Stringhash of Efl_View_Model_Text
Eina_Hash *bound; // Stringhash of Efl_Ui_View_Model_Bind
Eina_Hash *logics; // Stringhash of Efl_Ui_View_Model_Logic
Eina_Hash *texts; // Stringhash of Efl_Ui_View_Model_Text
Eina_Hash *deduplication; // Stringhash of Efl_View_Model_Property_Ref
Eina_Hash *deduplication; // Stringhash of Efl_Ui_View_Model_Property_Ref
struct {
Eina_Bool property_changed : 1;
@ -37,7 +33,7 @@ struct _Efl_View_Model_Data
Eina_Bool children_bind : 1; // Define if child object should be automatically binded
};
struct _Efl_View_Model_Text
struct _Efl_Ui_View_Model_Text
{
Eina_Stringshare *name;
Eina_Stringshare *definition;
@ -46,21 +42,21 @@ struct _Efl_View_Model_Text
Efl_Model *self;
};
struct _Efl_View_Model_Bind
struct _Efl_Ui_View_Model_Bind
{
Eina_Stringshare *source;
Eina_List *destinations;
};
struct _Efl_View_Model_Logic
struct _Efl_Ui_View_Model_Logic
{
struct {
EflViewModelPropertyGet fct;
EflUiViewModelPropertyGet fct;
Eina_Free_Cb free_cb;
void *data;
} get;
struct {
EflViewModelPropertySet fct;
EflUiViewModelPropertySet fct;
Eina_Free_Cb free_cb;
void *data;
} set;
@ -70,7 +66,7 @@ struct _Efl_View_Model_Logic
Eina_Stringshare *property;
};
struct _Efl_View_Model_Property_Ref
struct _Efl_Ui_View_Model_Property_Ref
{
EINA_REFCOUNT;
Eina_Stringshare *property;
@ -79,21 +75,21 @@ struct _Efl_View_Model_Property_Ref
static void
_ref_free(void *data)
{
Efl_View_Model_Property_Ref *r = data;
Efl_Ui_View_Model_Property_Ref *r = data;
eina_stringshare_del(r->property);
free(r);
}
static void
_ref_add(Efl_View_Model_Data *pd, Eina_Stringshare *property)
_ref_add(Efl_Ui_View_Model_Data *pd, Eina_Stringshare *property)
{
Efl_View_Model_Property_Ref *r;
Efl_Ui_View_Model_Property_Ref *r;
r = eina_hash_find(pd->deduplication, property);
if (!r)
{
r = calloc(1, sizeof (Efl_View_Model_Property_Ref));
r = calloc(1, sizeof (Efl_Ui_View_Model_Property_Ref));
if (!r) return ;
r->property = eina_stringshare_ref(property);
@ -104,9 +100,9 @@ _ref_add(Efl_View_Model_Data *pd, Eina_Stringshare *property)
}
static void
_ref_del(Efl_View_Model_Data *pd, Eina_Stringshare *property)
_ref_del(Efl_Ui_View_Model_Data *pd, Eina_Stringshare *property)
{
Efl_View_Model_Property_Ref *r;
Efl_Ui_View_Model_Property_Ref *r;
r = eina_hash_find(pd->deduplication, property);
if (!r) return ;
@ -118,14 +114,14 @@ _ref_del(Efl_View_Model_Data *pd, Eina_Stringshare *property)
static void
_logic_free(void *data)
{
Efl_View_Model_Logic *logic = data;
Efl_Ui_View_Model_Logic *logic = data;
Eina_Stringshare *source;
if (logic->get.free_cb) logic->get.free_cb(logic->get.data);
if (logic->set.free_cb) logic->set.free_cb(logic->set.data);
EINA_LIST_FREE(logic->sources, source)
{
efl_view_model_property_unbind(logic->object, source, logic->property);
efl_ui_view_model_property_unbind(logic->object, source, logic->property);
eina_stringshare_del(source);
}
eina_stringshare_del(logic->property);
@ -133,16 +129,16 @@ _logic_free(void *data)
}
static Eina_Value *
_efl_view_model_property_dummy_get(void *data EINA_UNUSED,
const Efl_View_Model *view_model EINA_UNUSED,
_efl_ui_view_model_property_dummy_get(void *data EINA_UNUSED,
const Efl_Ui_View_Model *view_model EINA_UNUSED,
Eina_Stringshare *property EINA_UNUSED)
{
return eina_value_error_new(EFL_MODEL_ERROR_NOT_SUPPORTED);
}
static Eina_Future *
_efl_view_model_property_dummy_set(void *data EINA_UNUSED,
Efl_View_Model *view_model,
_efl_ui_view_model_property_dummy_set(void *data EINA_UNUSED,
Efl_Ui_View_Model *view_model,
Eina_Stringshare *property EINA_UNUSED,
Eina_Value *value EINA_UNUSED)
{
@ -150,13 +146,13 @@ _efl_view_model_property_dummy_set(void *data EINA_UNUSED,
}
static Eina_Error
_efl_view_model_property_logic_add(Eo *obj, Efl_View_Model_Data *pd,
_efl_ui_view_model_property_logic_add(Eo *obj, Efl_Ui_View_Model_Data *pd,
const char *property,
void *get_data, EflViewModelPropertyGet get, Eina_Free_Cb get_free_cb,
void *set_data, EflViewModelPropertySet set, Eina_Free_Cb set_free_cb,
void *get_data, EflUiViewModelPropertyGet get, Eina_Free_Cb get_free_cb,
void *set_data, EflUiViewModelPropertySet set, Eina_Free_Cb set_free_cb,
Eina_Iterator *bound)
{
Efl_View_Model_Logic *logic;
Efl_Ui_View_Model_Logic *logic;
Eina_Stringshare *prop;
const char *source;
@ -168,15 +164,15 @@ _efl_view_model_property_logic_add(Eo *obj, Efl_View_Model_Data *pd,
return EFL_MODEL_ERROR_INCORRECT_VALUE;
}
logic = calloc(1, sizeof (Efl_View_Model_Logic));
logic = calloc(1, sizeof (Efl_Ui_View_Model_Logic));
if (!logic) return ENOMEM;
logic->object = obj;
logic->property = prop;
logic->get.fct = get ? get : _efl_view_model_property_dummy_get;
logic->get.fct = get ? get : _efl_ui_view_model_property_dummy_get;
logic->get.free_cb = get_free_cb;
logic->get.data = get_data;
logic->set.fct = set ? set : _efl_view_model_property_dummy_set;
logic->set.fct = set ? set : _efl_ui_view_model_property_dummy_set;
logic->set.free_cb = set_free_cb;
logic->set.data = set_data;
@ -185,17 +181,17 @@ _efl_view_model_property_logic_add(Eo *obj, Efl_View_Model_Data *pd,
EINA_ITERATOR_FOREACH(bound, source)
{
logic->sources = eina_list_append(logic->sources, eina_stringshare_add(source));
efl_view_model_property_bind(obj, source, property);
efl_ui_view_model_property_bind(obj, source, property);
}
return 0;
}
static Eina_Error
_efl_view_model_property_logic_del(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd,
_efl_ui_view_model_property_logic_del(Eo *obj EINA_UNUSED, Efl_Ui_View_Model_Data *pd,
const char *property)
{
Efl_View_Model_Logic *logic;
Efl_Ui_View_Model_Logic *logic;
logic = eina_hash_find(pd->logics, property);
if (!logic) return EFL_MODEL_ERROR_INCORRECT_VALUE;
@ -235,13 +231,13 @@ _lookup_next_token(const char *definition,
}
static Eina_Error
_efl_view_model_property_string_add(Eo *obj, Efl_View_Model_Data *pd,
_efl_ui_view_model_property_string_add(Eo *obj, Efl_Ui_View_Model_Data *pd,
const char *name,
const char *definition,
const char *not_ready,
const char *on_error)
{
Efl_View_Model_Text *text;
Efl_Ui_View_Model_Text *text;
Eina_Stringshare *sn;
Eina_Slstr *st = NULL;
Eina_Slstr *sp = NULL;
@ -255,9 +251,9 @@ _efl_view_model_property_string_add(Eo *obj, Efl_View_Model_Data *pd,
// Lookup if there is an existing property defined and undo it first
text = eina_hash_find(pd->texts, sn);
if (text) efl_view_model_property_string_del(obj, sn);
if (text) efl_ui_view_model_property_string_del(obj, sn);
text = calloc(1, sizeof (Efl_View_Model_Text));
text = calloc(1, sizeof (Efl_Ui_View_Model_Text));
if (!text) goto on_error;
err = EFL_MODEL_ERROR_INCORRECT_VALUE;
@ -272,21 +268,21 @@ _efl_view_model_property_string_add(Eo *obj, Efl_View_Model_Data *pd,
lookup;
definition += lookup, lookup = _lookup_next_token(definition, &st, &sp))
{
if (sp) efl_view_model_property_bind(obj, sp, name);
if (sp) efl_ui_view_model_property_bind(obj, sp, name);
}
for (lookup = _lookup_next_token(not_ready, &st, &sp);
lookup;
not_ready += lookup, lookup = _lookup_next_token(not_ready, &st, &sp))
{
if (sp) efl_view_model_property_bind(obj, sp, name);
if (sp) efl_ui_view_model_property_bind(obj, sp, name);
}
for (lookup = _lookup_next_token(on_error, &st, &sp);
lookup;
on_error += lookup, lookup = _lookup_next_token(on_error, &st, &sp))
{
if (sp) efl_view_model_property_bind(obj, sp, name);
if (sp) efl_ui_view_model_property_bind(obj, sp, name);
}
eina_hash_direct_add(pd->texts, text->name, text);
@ -302,7 +298,7 @@ _efl_view_model_property_string_add(Eo *obj, Efl_View_Model_Data *pd,
static void
_text_free(void *data)
{
Efl_View_Model_Text *text = data;
Efl_Ui_View_Model_Text *text = data;
Eina_Stringshare *st;
Eina_Stringshare *sp;
int lookup;
@ -313,7 +309,7 @@ _text_free(void *data)
lookup;
tmp += lookup, lookup = _lookup_next_token(tmp, &st, &sp))
{
if (sp) efl_view_model_property_unbind(text->self, sp, text->name);
if (sp) efl_ui_view_model_property_unbind(text->self, sp, text->name);
}
tmp = text->not_ready;
@ -321,7 +317,7 @@ _text_free(void *data)
lookup;
tmp += lookup, lookup = _lookup_next_token(tmp, &st, &sp))
{
if (sp) efl_view_model_property_unbind(text->self, sp, text->name);
if (sp) efl_ui_view_model_property_unbind(text->self, sp, text->name);
}
tmp = text->on_error;
@ -329,7 +325,7 @@ _text_free(void *data)
lookup;
tmp += lookup, lookup = _lookup_next_token(tmp, &st, &sp))
{
if (sp) efl_view_model_property_unbind(text->self, sp, text->name);
if (sp) efl_ui_view_model_property_unbind(text->self, sp, text->name);
}
eina_stringshare_del(text->name);
@ -339,11 +335,11 @@ _text_free(void *data)
}
static Eina_Error
_efl_view_model_property_string_del(Eo *obj EINA_UNUSED,
Efl_View_Model_Data *pd,
_efl_ui_view_model_property_string_del(Eo *obj EINA_UNUSED,
Efl_Ui_View_Model_Data *pd,
const char *name)
{
Efl_View_Model_Text *text;
Efl_Ui_View_Model_Text *text;
Eina_Stringshare *sn;
Eina_Error err = EFL_MODEL_ERROR_INCORRECT_VALUE;
@ -361,10 +357,10 @@ _efl_view_model_property_string_del(Eo *obj EINA_UNUSED,
}
static void
_efl_view_model_property_bind(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd,
_efl_ui_view_model_property_bind(Eo *obj EINA_UNUSED, Efl_Ui_View_Model_Data *pd,
const char *source, const char *destination)
{
Efl_View_Model_Bind *bind;
Efl_Ui_View_Model_Bind *bind;
Eina_Stringshare *src;
Eina_Stringshare *dst;
@ -374,7 +370,7 @@ _efl_view_model_property_bind(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd,
bind = eina_hash_find(pd->bound, src);
if (!bind)
{
bind = calloc(1, sizeof (Efl_View_Model_Bind));
bind = calloc(1, sizeof (Efl_Ui_View_Model_Bind));
if (!bind) goto on_error;
bind->source = eina_stringshare_ref(src);
@ -390,10 +386,10 @@ _efl_view_model_property_bind(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd,
}
static void
_efl_view_model_property_unbind(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd,
_efl_ui_view_model_property_unbind(Eo *obj EINA_UNUSED, Efl_Ui_View_Model_Data *pd,
const char *source, const char *destination)
{
Efl_View_Model_Bind *bind;
Efl_Ui_View_Model_Bind *bind;
Eina_Stringshare *src;
Eina_Stringshare *dst;
Eina_Stringshare *cmp;
@ -426,7 +422,7 @@ _efl_view_model_property_unbind(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd,
static void
_bind_free(void *data)
{
Efl_View_Model_Bind *bind = data;
Efl_Ui_View_Model_Bind *bind = data;
Eina_Stringshare *dst;
eina_stringshare_del(bind->source);
@ -438,11 +434,11 @@ _bind_free(void *data)
}
static void
_efl_view_model_property_bind_lookup(Eina_Array *changed_properties,
Efl_View_Model_Data *pd,
_efl_ui_view_model_property_bind_lookup(Eina_Array *changed_properties,
Efl_Ui_View_Model_Data *pd,
Eina_Stringshare *src)
{
Efl_View_Model_Bind *bind;
Efl_Ui_View_Model_Bind *bind;
if (!pd) return ;
bind = eina_hash_find(pd->bound, src);
@ -463,16 +459,16 @@ _efl_view_model_property_bind_lookup(Eina_Array *changed_properties,
if (dup == dest) continue ;
eina_array_push(changed_properties, dest);
_efl_view_model_property_bind_lookup(changed_properties, pd, dest);
_efl_ui_view_model_property_bind_lookup(changed_properties, pd, dest);
}
}
_efl_view_model_property_bind_lookup(changed_properties, pd->parent, src);
_efl_ui_view_model_property_bind_lookup(changed_properties, pd->parent, src);
}
static void
_efl_view_model_property_changed(void *data, const Efl_Event *event)
_efl_ui_view_model_property_changed(void *data, const Efl_Event *event)
{
Efl_View_Model_Data *pd = data;
Efl_Ui_View_Model_Data *pd = data;
Efl_Model_Property_Event *ev = event->info;
Efl_Model_Property_Event nev = { 0 };
const char *property;
@ -493,7 +489,7 @@ _efl_view_model_property_changed(void *data, const Efl_Event *event)
eina_array_push(nev.changed_properties, property);
src = eina_stringshare_ref(property);
_efl_view_model_property_bind_lookup(nev.changed_properties, pd, src);
_efl_ui_view_model_property_bind_lookup(nev.changed_properties, pd, src);
}
efl_event_callback_call(event->object, EFL_MODEL_EVENT_PROPERTIES_CHANGED, &nev);
@ -504,7 +500,7 @@ _efl_view_model_property_changed(void *data, const Efl_Event *event)
}
static void
_efl_view_model_children_bind_set(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd, Eina_Bool enable)
_efl_ui_view_model_children_bind_set(Eo *obj EINA_UNUSED, Efl_Ui_View_Model_Data *pd, Eina_Bool enable)
{
if (pd->finalized) return;
@ -512,41 +508,41 @@ _efl_view_model_children_bind_set(Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd,
}
static Eina_Bool
_efl_view_model_children_bind_get(const Eo *obj EINA_UNUSED, Efl_View_Model_Data *pd)
_efl_ui_view_model_children_bind_get(const Eo *obj EINA_UNUSED, Efl_Ui_View_Model_Data *pd)
{
return pd->children_bind;
}
static void
_efl_view_model_parent_data(Efl_View_Model *child, Efl_View_Model_Data *ppd)
_efl_ui_view_model_parent_data(Efl_Ui_View_Model *child, Efl_Ui_View_Model_Data *ppd)
{
Efl_View_Model_Data *cpd;
Efl_Ui_View_Model_Data *cpd;
cpd = efl_data_scope_get(child, EFL_VIEW_MODEL_CLASS);
cpd = efl_data_scope_get(child, EFL_UI_VIEW_MODEL_CLASS);
cpd->parent = ppd;
cpd->propagating = ppd->propagating;
}
static Efl_View_Model *
_efl_view_model_child_lookup(Efl_View_Model_Data *pd, Efl_Object *parent, Efl_Model *view)
static Efl_Ui_View_Model *
_efl_ui_view_model_child_lookup(Efl_Ui_View_Model_Data *pd, Efl_Object *parent, Efl_Model *view)
{
EFL_COMPOSITE_LOOKUP_RETURN(co, parent, view, "_efl.view_model");
EFL_COMPOSITE_LOOKUP_RETURN(co, parent, view, "_efl.ui.view_model");
co = efl_add(EFL_VIEW_MODEL_CLASS, parent,
co = efl_add(EFL_UI_VIEW_MODEL_CLASS, parent,
efl_ui_view_model_set(efl_added, view),
_efl_view_model_parent_data(efl_added, pd));
_efl_ui_view_model_parent_data(efl_added, pd));
if (!co) return NULL;
EFL_COMPOSITE_REMEMBER_RETURN(co, view);
}
static void
_efl_view_model_child_added(void *data, const Efl_Event *event)
_efl_ui_view_model_child_added(void *data, const Efl_Event *event)
{
Efl_Model_Children_Event *ev = event->info;
Efl_Model_Children_Event nevt = { 0 };
Efl_View_Model_Data *pd = data;
Efl_View_Model *co;
Efl_Ui_View_Model_Data *pd = data;
Efl_Ui_View_Model *co;
if (pd->propagating.child_added) return ;
if (!pd->children_bind) return;
@ -557,7 +553,7 @@ _efl_view_model_child_added(void *data, const Efl_Event *event)
// Our strategy is to rebuild a new Child_Add and cancel the current one.
efl_event_callback_stop(event->object);
co = _efl_view_model_child_lookup(pd, event->object, ev->child);
co = _efl_ui_view_model_child_lookup(pd, event->object, ev->child);
if (!co) return;
nevt.index = ev->index;
@ -569,12 +565,12 @@ _efl_view_model_child_added(void *data, const Efl_Event *event)
}
static void
_efl_view_model_child_removed(void *data, const Efl_Event *event)
_efl_ui_view_model_child_removed(void *data, const Efl_Event *event)
{
Efl_Model_Children_Event *ev = event->info;
Efl_Model_Children_Event nevt = { 0 };
Efl_View_Model_Data *pd = data;
Efl_View_Model *co;
Efl_Ui_View_Model_Data *pd = data;
Efl_Ui_View_Model *co;
if (pd->propagating.child_removed) return ;
if (!pd->children_bind) return;
@ -585,7 +581,7 @@ _efl_view_model_child_removed(void *data, const Efl_Event *event)
// Our strategy is to rebuild a new Child_Add and cancel the current one.
efl_event_callback_stop(event->object);
co = _efl_view_model_child_lookup(pd, event->object, ev->child);
co = _efl_ui_view_model_child_lookup(pd, event->object, ev->child);
if (!co) return;
nevt.index = ev->index;
@ -599,15 +595,15 @@ _efl_view_model_child_removed(void *data, const Efl_Event *event)
pd->propagating.child_removed = EINA_FALSE;
}
EFL_CALLBACKS_ARRAY_DEFINE(efl_view_model_intercept,
{ EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_view_model_property_changed },
{ EFL_MODEL_EVENT_CHILD_ADDED, _efl_view_model_child_added },
{ EFL_MODEL_EVENT_CHILD_REMOVED, _efl_view_model_child_removed })
EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_view_model_intercept,
{ EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_ui_view_model_property_changed },
{ EFL_MODEL_EVENT_CHILD_ADDED, _efl_ui_view_model_child_added },
{ EFL_MODEL_EVENT_CHILD_REMOVED, _efl_ui_view_model_child_removed })
static Efl_Object *
_efl_view_model_efl_object_constructor(Eo *obj, Efl_View_Model_Data *pd)
_efl_ui_view_model_efl_object_constructor(Eo *obj, Efl_Ui_View_Model_Data *pd)
{
obj = efl_constructor(efl_super(obj, EFL_VIEW_MODEL_CLASS));
obj = efl_constructor(efl_super(obj, EFL_UI_VIEW_MODEL_CLASS));
pd->children_bind = EINA_TRUE;
pd->bound = eina_hash_stringshared_new(_bind_free);
@ -615,23 +611,23 @@ _efl_view_model_efl_object_constructor(Eo *obj, Efl_View_Model_Data *pd)
pd->deduplication = eina_hash_stringshared_new(_ref_free);
pd->texts = eina_hash_stringshared_new(_text_free);
efl_event_callback_array_priority_add(obj, efl_view_model_intercept(), EFL_CALLBACK_PRIORITY_BEFORE, pd);
efl_event_callback_array_priority_add(obj, efl_ui_view_model_intercept(), EFL_CALLBACK_PRIORITY_BEFORE, pd);
return obj;
}
static Efl_Object *
_efl_view_model_efl_object_finalize(Eo *obj, Efl_View_Model_Data *pd)
_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_VIEW_MODEL_CLASS));
return efl_finalize(efl_super(obj, EFL_UI_VIEW_MODEL_CLASS));
}
static void
_efl_view_model_efl_object_destructor(Eo *obj, Efl_View_Model_Data *pd)
_efl_ui_view_model_efl_object_destructor(Eo *obj, Efl_Ui_View_Model_Data *pd)
{
efl_event_callback_array_del(obj, efl_view_model_intercept(), pd);
efl_event_callback_array_del(obj, efl_ui_view_model_intercept(), pd);
eina_hash_free(pd->bound);
pd->bound = NULL;
@ -645,30 +641,30 @@ _efl_view_model_efl_object_destructor(Eo *obj, Efl_View_Model_Data *pd)
eina_hash_free(pd->deduplication);
pd->deduplication = NULL;
efl_destructor(efl_super(obj, EFL_VIEW_MODEL_CLASS));
efl_destructor(efl_super(obj, EFL_UI_VIEW_MODEL_CLASS));
}
static Efl_View_Model_Logic *
_efl_view_model_property_logic_lookup(Efl_View_Model_Data *pd, Eina_Stringshare *property)
static Efl_Ui_View_Model_Logic *
_efl_ui_view_model_property_logic_lookup(Efl_Ui_View_Model_Data *pd, Eina_Stringshare *property)
{
Efl_View_Model_Logic *logic;
Efl_Ui_View_Model_Logic *logic;
if (!pd) return NULL;
logic = eina_hash_find(pd->logics, property);
if (!logic) return _efl_view_model_property_logic_lookup(pd->parent, property);
if (!logic) return _efl_ui_view_model_property_logic_lookup(pd->parent, property);
return logic;
}
static Eina_Future *
_efl_view_model_efl_model_property_set(Eo *obj, Efl_View_Model_Data *pd,
_efl_ui_view_model_efl_model_property_set(Eo *obj, Efl_Ui_View_Model_Data *pd,
const char *property, Eina_Value *value)
{
Efl_View_Model_Logic *logic;
Efl_Ui_View_Model_Logic *logic;
Eina_Stringshare *prop;
Eina_Future *f;
prop = eina_stringshare_add(property);
logic = _efl_view_model_property_logic_lookup(pd, prop);
logic = _efl_ui_view_model_property_logic_lookup(pd, prop);
if (logic)
f = logic->set.fct(logic->get.data, obj, prop, value);
else
@ -676,7 +672,7 @@ _efl_view_model_efl_model_property_set(Eo *obj, Efl_View_Model_Data *pd,
if (eina_hash_find(pd->texts, prop))
f = efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY);
else
f = efl_model_property_set(efl_super(obj, EFL_VIEW_MODEL_CLASS), property, value);
f = efl_model_property_set(efl_super(obj, EFL_UI_VIEW_MODEL_CLASS), property, value);
}
eina_stringshare_del(prop);
@ -684,7 +680,7 @@ _efl_view_model_efl_model_property_set(Eo *obj, Efl_View_Model_Data *pd,
}
static Eina_Value *
_efl_view_model_text_generate(const Eo *obj,
_efl_ui_view_model_text_generate(const Eo *obj,
Eina_Strbuf *out,
Eina_Stringshare *pattern,
Eina_Bool stop_on_error)
@ -726,9 +722,9 @@ _efl_view_model_text_generate(const Eo *obj,
}
static Eina_Value *
_efl_view_model_text_property_get(const Eo *obj, Efl_View_Model_Data *pd, Eina_Stringshare *prop)
_efl_ui_view_model_text_property_get(const Eo *obj, Efl_Ui_View_Model_Data *pd, Eina_Stringshare *prop)
{
Efl_View_Model_Text *lookup;
Efl_Ui_View_Model_Text *lookup;
Eina_Strbuf *buf;
Eina_Value *r;
Eina_Error err = 0;
@ -737,11 +733,11 @@ _efl_view_model_text_property_get(const Eo *obj, Efl_View_Model_Data *pd, Eina_S
lookup = eina_hash_find(pd->texts, prop);
// Lookup for property definition in the parent, but property value will be fetched on
// the child object doing the request.
if (!lookup) return _efl_view_model_text_property_get(obj, pd->parent, prop);
if (!lookup) return _efl_ui_view_model_text_property_get(obj, pd->parent, prop);
buf = eina_strbuf_new();
r = _efl_view_model_text_generate(obj, buf,
r = _efl_ui_view_model_text_generate(obj, buf,
lookup->definition,
!!(lookup->on_error || lookup->not_ready));
if (eina_value_type_get(r) != EINA_VALUE_TYPE_ERROR)
@ -751,7 +747,7 @@ _efl_view_model_text_property_get(const Eo *obj, Efl_View_Model_Data *pd, Eina_S
eina_strbuf_reset(buf);
eina_value_free(r);
r = _efl_view_model_text_generate(obj, buf, lookup->not_ready, !!lookup->on_error);
r = _efl_ui_view_model_text_generate(obj, buf, lookup->not_ready, !!lookup->on_error);
if (eina_value_type_get(r) != EINA_VALUE_TYPE_ERROR)
goto done;
}
@ -760,7 +756,7 @@ _efl_view_model_text_property_get(const Eo *obj, Efl_View_Model_Data *pd, Eina_S
eina_strbuf_reset(buf);
eina_value_free(r);
r = _efl_view_model_text_generate(obj, buf, lookup->on_error, 0);
r = _efl_ui_view_model_text_generate(obj, buf, lookup->on_error, 0);
}
done:
@ -770,21 +766,21 @@ _efl_view_model_text_property_get(const Eo *obj, Efl_View_Model_Data *pd, Eina_S
}
static Eina_Value *
_efl_view_model_efl_model_property_get(const Eo *obj, Efl_View_Model_Data *pd,
_efl_ui_view_model_efl_model_property_get(const Eo *obj, Efl_Ui_View_Model_Data *pd,
const char *property)
{
Efl_View_Model_Logic *logic;
Efl_Ui_View_Model_Logic *logic;
Eina_Stringshare *prop;
Eina_Value *r;
prop = eina_stringshare_add(property);
logic = _efl_view_model_property_logic_lookup(pd, prop);
logic = _efl_ui_view_model_property_logic_lookup(pd, prop);
if (logic)
r = logic->get.fct(logic->get.data, obj, prop);
else
{
r = _efl_view_model_text_property_get(obj, pd, prop);
if (!r) r = efl_model_property_get(efl_super(obj, EFL_VIEW_MODEL_CLASS), property);
r = _efl_ui_view_model_text_property_get(obj, pd, prop);
if (!r) r = efl_model_property_get(efl_super(obj, EFL_UI_VIEW_MODEL_CLASS), property);
}
eina_stringshare_del(prop);
@ -792,25 +788,25 @@ _efl_view_model_efl_model_property_get(const Eo *obj, Efl_View_Model_Data *pd,
}
static Eina_Iterator *
_efl_view_model_efl_model_properties_get(const Eo *obj, Efl_View_Model_Data *pd)
_efl_ui_view_model_efl_model_properties_get(const Eo *obj, Efl_Ui_View_Model_Data *pd)
{
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props, obj, EFL_VIEW_MODEL_CLASS,
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props, obj, EFL_UI_VIEW_MODEL_CLASS,
eina_hash_iterator_key_new(pd->deduplication));
return props;
}
typedef struct _Efl_View_Model_Slice_Request Efl_View_Model_Slice_Request;
struct _Efl_View_Model_Slice_Request
typedef struct _Efl_Ui_View_Model_Slice_Request Efl_Ui_View_Model_Slice_Request;
struct _Efl_Ui_View_Model_Slice_Request
{
Efl_View_Model_Data *pd;
Efl_Ui_View_Model_Data *pd;
unsigned int start;
};
static Eina_Value
_efl_view_model_slice_then(Eo *o, void *data, const Eina_Value v)
_efl_ui_view_model_slice_then(Eo *o, void *data, const Eina_Value v)
{
Efl_View_Model_Slice_Request *req = data;
Efl_Ui_View_Model_Slice_Request *req = data;
Eo *target;
Eina_Value r = EINA_VALUE_EMPTY;
unsigned int i, len;
@ -821,7 +817,7 @@ _efl_view_model_slice_then(Eo *o, void *data, const Eina_Value v)
{
Eo *composite;
composite = _efl_view_model_child_lookup(req->pd, o, target);
composite = _efl_ui_view_model_child_lookup(req->pd, o, target);
eina_value_array_append(&r, composite);
}
@ -829,21 +825,21 @@ _efl_view_model_slice_then(Eo *o, void *data, const Eina_Value v)
}
static void
_efl_view_model_slice_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
_efl_ui_view_model_slice_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
{
free(data);
}
static Eina_Future *
_efl_view_model_efl_model_children_slice_get(Eo *obj, Efl_View_Model_Data *pd,
_efl_ui_view_model_efl_model_children_slice_get(Eo *obj, Efl_Ui_View_Model_Data *pd,
unsigned int start, unsigned int count)
{
Efl_View_Model_Slice_Request *req;
Efl_Ui_View_Model_Slice_Request *req;
Eina_Future *f;
f = efl_model_children_slice_get(efl_super(obj, EFL_VIEW_MODEL_CLASS), start, count);
f = efl_model_children_slice_get(efl_super(obj, EFL_UI_VIEW_MODEL_CLASS), start, count);
req = malloc(sizeof (Efl_View_Model_Slice_Request));
req = malloc(sizeof (Efl_Ui_View_Model_Slice_Request));
if (!req)
{
eina_future_cancel(f);
@ -854,9 +850,9 @@ _efl_view_model_efl_model_children_slice_get(Eo *obj, Efl_View_Model_Data *pd,
req->start = start;
return efl_future_then(obj, f, .success_type = EINA_VALUE_TYPE_ARRAY,
.success = _efl_view_model_slice_then,
.free = _efl_view_model_slice_clean,
.success = _efl_ui_view_model_slice_then,
.free = _efl_ui_view_model_slice_clean,
.data = req);
}
#include "efl_view_model.eo.c"
#include "efl_ui_view_model.eo.c"

View File

@ -1,23 +1,23 @@
function @beta EflViewModelPropertyGet {
function @beta EflUiViewModelPropertyGet {
[[Function called when a property is get.]]
params {
@in view_model: const(Efl.View_Model); [[The ViewModel object the @.property.get is issued on.]]
@in view_model: const(Efl.Ui.View_Model); [[The ViewModel object the @.property.get is issued on.]]
@in property: stringshare; [[The property name the @.property.get is issued on.]]
}
return: any_value_ptr; [[The property value.]]
};
function @beta EflViewModelPropertySet {
function @beta EflUiViewModelPropertySet {
[[Function called when a property is set.]]
params {
@in view_model: Efl.View_Model; [[The ViewModel object the @.property.set is issued on.]]
@in view_model: Efl.Ui.View_Model; [[The ViewModel object the @.property.set is issued on.]]
@in property: stringshare; [[The property name the @.property.set is issued on.]]
@in value: any_value_ptr @owned; [[The new value to set.]]
}
return: future<any_value_ptr>; [[The value that was finally set.]]
};
class @beta Efl.View_Model extends Efl.Composite_Model
class @beta Efl.Ui.View_Model extends Efl.Composite_Model
{
[[Efl model providing helpers for custom properties used when linking a model to a view and you need to
generate/adapt values for display.
@ -70,9 +70,9 @@ class @beta Efl.View_Model extends Efl.Composite_Model
]]
params {
property: string; [[The property to bind on to.]]
get: EflViewModelPropertyGet; [[Define the get callback called when the @Efl.Model.property.get is called
get: EflUiViewModelPropertyGet; [[Define the get callback called when the @Efl.Model.property.get is called
with the above property name.]]
set: EflViewModelPropertySet; [[Define the set callback called when the @Efl.Model.property.set is called
set: EflUiViewModelPropertySet; [[Define the set callback called when the @Efl.Model.property.set is called
with the above property name.]]
binded: iterator<string>; [[Iterator of property name to bind with this defined property see
@.property_bind.]]
@ -100,7 +100,7 @@ class @beta Efl.View_Model extends Efl.Composite_Model
]]
params {
@in source: string; [[Property name in the composited model.]]
@in destination: string; [[Property name in the @Efl.View_Model]]
@in destination: string; [[Property name in the @Efl.Ui.View_Model]]
}
}
property_unbind {
@ -110,7 +110,7 @@ class @beta Efl.View_Model extends Efl.Composite_Model
]]
params {
@in source: string; [[Property name in the composited model.]]
@in destination: string; [[Property name in the @Efl.View_Model]]
@in destination: string; [[Property name in the @Efl.Ui.View_Model]]
}
}
@property children_bind {
@ -139,6 +139,6 @@ class @beta Efl.View_Model extends Efl.Composite_Model
Efl.Model.property { set; get; }
}
constructors {
Efl.View_Model.children_bind @optional;
Efl.Ui.View_Model.children_bind @optional;
}
}

View File

@ -148,7 +148,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
The style can only be set before @Efl.Object.finalize, which means
at construction time of the object (inside $efl_add in C).
]]
set @protected {
set {
[[Can only be called during construction, before finalize.]]
return: Eina.Error;
[[Whether the style was successfully applied or not, see

View File

@ -183,6 +183,8 @@ pub_eo_files = [
'efl_ui_single_selectable.eo',
'efl_ui_position_manager_data_access_v1.eo',
'efl_ui_tab_bar_default_item.eo',
'efl_ui_select_model.eo',
'efl_ui_view_model.eo',
]
foreach eo_file : pub_eo_files
@ -940,7 +942,9 @@ elementary_src = [
'efl_ui_position_manager_entity.c',
'efl_ui_position_manager_list.c',
'efl_ui_position_manager_grid.c',
'efl_ui_tab_bar_default_item.c'
'efl_ui_tab_bar_default_item.c',
'efl_ui_select_model.c',
'efl_ui_view_model.c',
]
elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl]

View File

@ -335,7 +335,12 @@ _find_mod(const char *name)
p > path;
p--)
{
if (*p == '/')
if ((*p == '/')
/* FIXME : find a better way to handle Windows path in all the EFL */
#ifdef _WIN32
|| (*p == '\\')
#endif
)
{
found++;
// found == 1 -> p = /module.*

View File

@ -1903,6 +1903,23 @@ EAPI Eina_Bool eolian_parameter_is_by_ref(const Eolian_Function_Parameter *param
*/
EAPI Eina_Bool eolian_parameter_is_move(const Eolian_Function_Parameter *param_desc);
/*
* @brief Get the full C type name of the given parameter.
*
* @param[in] param_desc parameter handle
* @param[in] as_return if true, it will be treated as a return type
* @return The C type name assuming @c param_desc is not NULL.
*
* You're responsible for the stringshare. The @c as_return argument is meant
* for properties, where the first out-param gets made into a return, which
* has different typing characteristics.
*
* @see eolian_type_c_type_get
*
* @ingroup Eolian
*/
EAPI Eina_Stringshare *eolian_parameter_c_type_get(const Eolian_Function_Parameter *param_desc, Eina_Bool as_return);
/*
* @brief Get the return type of a function.
*
@ -2001,6 +2018,21 @@ EAPI Eina_Bool eolian_function_return_is_by_ref(const Eolian_Function *foo_id, E
*/
EAPI Eina_Bool eolian_function_return_is_move(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
/*
* @brief Get the full C type name of the return value.
*
* @param[in] function_id id of the function
* @param[in] ftype type of the function
* @return The C type name.
*
* You're responsible for the stringshare.
*
* @see eolian_type_c_type_get
*
* @ingroup Eolian
*/
EAPI Eina_Stringshare *eolian_function_return_c_type_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
/*
* @brief Indicates if a function object is const.
*
@ -2574,6 +2606,20 @@ EAPI Eina_Bool eolian_typedecl_struct_field_is_by_ref(const Eolian_Struct_Type_F
*/
EAPI Eina_Bool eolian_typedecl_struct_field_is_move(const Eolian_Struct_Type_Field *fl);
/*
* @brief Get the full C type name of the struct field.
*
* @param[in] fl the field.
* @return The C type name.
*
* You're responsible for the stringshare.
*
* @see eolian_type_c_type_get
*
* @ingroup Eolian
*/
EAPI Eina_Stringshare *eolian_typedecl_struct_field_c_type_get(const Eolian_Struct_Type_Field *fl);
/*
* @brief Get an iterator to all fields of an enum type.
*
@ -3031,20 +3077,6 @@ eolian_type_namespaces_get(const Eolian_Type *tp)
*/
EAPI Eolian_Value eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m);
/*
* @brief Evaluate an Eolian expression given a type instead of a mask.
*
* @param[in] expr the expression.
* @param[in] type the type the expression is assigned to.
* @return the value, its type is set to EOLIAN_EXPR_UNKNOWN on error.
*
* The mask is automatically decided from the given type, allowing only values
* that can be assigned to that type.
*
* @ingroup Eolian
*/
EAPI Eolian_Value eolian_expression_eval_type(const Eolian_Expression *expr, const Eolian_Type *type);
/*
* @brief Convert the result of expression evaluation to a literal as in how
* it would appear in C (e.g. strings are quoted and escaped).

View File

@ -15,16 +15,6 @@ eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m)
return database_expr_eval(NULL, (Eolian_Expression *)expr, m, NULL, NULL);
}
EAPI Eolian_Value
eolian_expression_eval_type(const Eolian_Expression *expr,
const Eolian_Type *type)
{
Eolian_Value err;
err.type = EOLIAN_EXPR_UNKNOWN;
EINA_SAFETY_ON_NULL_RETURN_VAL(expr, err);
return database_expr_eval_type(NULL, (Eolian_Expression *)expr, type, NULL, NULL);
}
static void
_append_char_escaped(Eina_Strbuf *buf, char c)
{

View File

@ -342,6 +342,46 @@ eolian_function_return_is_move(const Eolian_Function *fid,
}
}
EAPI Eina_Stringshare *
eolian_function_return_c_type_get(const Eolian_Function *fid,
Eolian_Function_Type ftype)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, EINA_FALSE);
const Eolian_Type *tp = NULL;
Eina_Bool by_ref = EINA_FALSE;
switch (ftype)
{
case EOLIAN_METHOD:
case EOLIAN_FUNCTION_POINTER:
if (fid->type != ftype)
return NULL;
tp = fid->get_ret_type;
by_ref = fid->get_return_by_ref;
break;
case EOLIAN_PROP_GET:
if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY))
return NULL;
tp = fid->get_ret_type;
by_ref = fid->get_return_by_ref;
break;
case EOLIAN_PROP_SET:
if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY))
return NULL;
tp = fid->set_ret_type;
by_ref = fid->set_return_by_ref;
break;
default:
return NULL;
}
Eina_Strbuf *buf = eina_strbuf_new();
database_type_to_str(tp, buf, NULL, EOLIAN_C_TYPE_RETURN, by_ref);
Eina_Stringshare *ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}
EAPI Eina_Bool
eolian_function_object_is_const(const Eolian_Function *fid)
{

View File

@ -53,3 +53,17 @@ eolian_parameter_is_by_ref(const Eolian_Function_Parameter *param)
EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
return param->by_ref;
}
EAPI Eina_Stringshare *
eolian_parameter_c_type_get(const Eolian_Function_Parameter *param_desc,
Eina_Bool as_return)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(param_desc, NULL);
Eina_Strbuf *buf = eina_strbuf_new();
database_type_to_str(param_desc->type, buf, NULL,
as_return ? EOLIAN_C_TYPE_RETURN : EOLIAN_C_TYPE_PARAM,
param_desc->by_ref);
Eina_Stringshare *ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}

View File

@ -101,7 +101,7 @@ _buf_add_suffix(Eina_Strbuf *buf, const char *suffix)
void
database_type_to_str(const Eolian_Type *tp,
Eina_Strbuf *buf, const char *name,
Eolian_C_Type_Type ctype)
Eolian_C_Type_Type ctype, Eina_Bool by_ref)
{
if ((tp->type == EOLIAN_TYPE_REGULAR
|| tp->type == EOLIAN_TYPE_CLASS
@ -128,7 +128,7 @@ database_type_to_str(const Eolian_Type *tp,
{
/* handles arrays and pointers as they all serialize to pointers */
database_type_to_str(tp->base_type, buf, NULL,
EOLIAN_C_TYPE_DEFAULT);
EOLIAN_C_TYPE_DEFAULT, EINA_FALSE);
_buf_add_suffix(buf, "*");
if (tp->is_const && (ctype != EOLIAN_C_TYPE_RETURN))
eina_strbuf_append(buf, " const");
@ -137,6 +137,8 @@ database_type_to_str(const Eolian_Type *tp,
_buf_add_suffix(buf, "*");
if (tp->is_ptr)
_buf_add_suffix(buf, "*");
if (by_ref)
_buf_add_suffix(buf, "*");
_buf_add_suffix(buf, name);
}
@ -153,7 +155,7 @@ _stype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
EINA_LIST_FOREACH(tp->field_list, l, sf)
{
database_type_to_str(sf->type, buf, sf->base.name,
EOLIAN_C_TYPE_DEFAULT);
EOLIAN_C_TYPE_DEFAULT, sf->by_ref);
eina_strbuf_append(buf, "; ");
}
eina_strbuf_append(buf, "}");
@ -191,7 +193,7 @@ _atype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
eina_strbuf_append(buf, "typedef ");
database_type_to_str(tp->base_type, buf, tp->base.c_name,
EOLIAN_C_TYPE_DEFAULT);
EOLIAN_C_TYPE_DEFAULT, EINA_FALSE);
}
void

View File

@ -77,6 +77,17 @@ eolian_typedecl_struct_field_is_move(const Eolian_Struct_Type_Field *fl)
return fl->move;
}
EAPI Eina_Stringshare *
eolian_typedecl_struct_field_c_type_get(const Eolian_Struct_Type_Field *fl)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fl, NULL);
Eina_Strbuf *buf = eina_strbuf_new();
database_type_to_str(fl->type, buf, NULL, EOLIAN_C_TYPE_DEFAULT, fl->by_ref);
Eina_Stringshare *ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}
EAPI Eina_Iterator *
eolian_typedecl_enum_fields_get(const Eolian_Typedecl *tp)
{
@ -262,7 +273,7 @@ eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype)
Eina_Strbuf *buf;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
buf = eina_strbuf_new();
database_type_to_str(tp, buf, NULL, ctype);
database_type_to_str(tp, buf, NULL, ctype, EINA_FALSE);
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;

View File

@ -109,7 +109,8 @@ static Eina_Bool _validate_type_by_ref(Validate_State *vals, Eolian_Type *tp,
Eina_Bool by_ref, Eina_Bool move);
static Eina_Bool _validate_expr(Eolian_Expression *expr,
const Eolian_Type *tp,
Eolian_Expression_Mask msk);
Eolian_Expression_Mask msk,
Eina_Bool by_ref);
static Eina_Bool _validate_function(Validate_State *vals,
Eolian_Function *func,
Eina_Hash *nhash);
@ -139,7 +140,7 @@ _ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
const Eolian_Enum_Type_Field *ef, Cb_Ret *sc)
{
if (ef->value)
sc->succ = _validate_expr(ef->value, NULL, EOLIAN_MASK_INT);
sc->succ = _validate_expr(ef->value, NULL, EOLIAN_MASK_INT, EINA_FALSE);
else
sc->succ = EINA_TRUE;
@ -218,8 +219,11 @@ _validate_by_ref(Eolian_Type *tp, Eina_Bool by_ref, Eina_Bool move)
database_type_is_ownable(tp->base.unit, tp, EINA_FALSE);
/* only allow value types when @by_ref */
if (by_ref && !maybe_ownable)
return EINA_FALSE;
if (by_ref && maybe_ownable)
{
_eo_parser_log(&tp->base, "@by_ref is only allowed for value types");
return EINA_FALSE;
}
/* futures can be whatever... */
if (tp->btype == EOLIAN_TYPE_BUILTIN_FUTURE)
@ -229,7 +233,7 @@ _validate_by_ref(Eolian_Type *tp, Eina_Bool by_ref, Eina_Bool move)
if (!move)
return EINA_TRUE;
/* marked @move, now pointer-like or otherwise ownable, error */
/* marked @move, not pointer-like or otherwise ownable, error */
if (!maybe_ownable || !tp->ownable)
{
_eo_parser_log(&tp->base, "type '%s' is not ownable", tp->base.name);
@ -397,10 +401,12 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
static Eina_Bool
_validate_expr(Eolian_Expression *expr, const Eolian_Type *tp,
Eolian_Expression_Mask msk)
Eolian_Expression_Mask msk, Eina_Bool by_ref)
{
Eolian_Value val;
if (tp)
if (by_ref)
val = database_expr_eval(expr->base.unit, expr, EOLIAN_MASK_NULL, NULL, NULL);
else if (tp)
val = database_expr_eval_type(expr->base.unit, expr, tp, NULL, NULL);
else
val = database_expr_eval(expr->base.unit, expr, msk, NULL, NULL);
@ -417,7 +423,7 @@ _validate_param(Validate_State *vals, Eolian_Function_Parameter *param)
if (!_validate_type_by_ref(vals, param->type, param->by_ref, param->move))
return EINA_FALSE;
if (param->value && !_validate_expr(param->value, param->type, 0))
if (param->value && !_validate_expr(param->value, param->type, 0, param->by_ref))
return EINA_FALSE;
if (!_validate_doc(param->doc))
@ -465,11 +471,13 @@ _validate_function(Validate_State *vals, Eolian_Function *func, Eina_Hash *nhash
return _reset_stable(vals, was_stable, EINA_FALSE);
if (func->get_ret_val && !_validate_expr(func->get_ret_val,
func->get_ret_type, 0))
func->get_ret_type, 0,
func->get_return_by_ref))
return _reset_stable(vals, was_stable, EINA_FALSE);
if (func->set_ret_val && !_validate_expr(func->set_ret_val,
func->set_ret_type, 0))
func->set_ret_type, 0,
func->set_return_by_ref))
return _reset_stable(vals, was_stable, EINA_FALSE);
#define EOLIAN_PARAMS_VALIDATE(params) \
@ -1431,7 +1439,7 @@ _validate_variable(Validate_State *vals, Eolian_Variable *var)
if (!_validate_type(vals, var->base_type))
return _reset_stable(vals, was_stable, EINA_FALSE);
if (var->value && !_validate_expr(var->value, var->base_type, 0))
if (var->value && !_validate_expr(var->value, var->base_type, 0, EINA_FALSE))
return _reset_stable(vals, was_stable, EINA_FALSE);
if (!_validate_doc(var->doc))

View File

@ -425,7 +425,7 @@ void database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp);
void database_type_del(Eolian_Type *tp);
void database_typedecl_del(Eolian_Typedecl *tp);
void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name, Eolian_C_Type_Type ctype);
void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name, Eolian_C_Type_Type ctype, Eina_Bool by_ref);
void database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf);
Eolian_Typedecl *database_type_decl_find(const Eolian_Unit *src, const Eolian_Type *tp);

View File

@ -366,6 +366,12 @@ inline bool operator!=(complex_type_def const& lhs, complex_type_def const& rhs)
return !(lhs == rhs);
}
namespace value_ownership
{
const bool moved = true;
const bool unmoved = false;
};
// type_def represents a type where it is used, like a method parameter or a struc field, in contrast to more
// specifict types like struct_def, class_def, function_def, which represents a declaration of a type.
struct type_def
@ -383,11 +389,11 @@ struct type_def
type_def(variant_type original_type, std::string c_type, bool has_own, bool is_ptr, bool is_beta, std::string doc_summary)
: original_type(original_type), c_type(c_type), has_own(has_own), is_ptr(is_ptr), is_beta(is_beta), doc_summary(doc_summary) {}
type_def(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype)
type_def(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype, bool is_moved)
{
set(eolian_type, unit, ctype);
set(eolian_type, unit, ctype, is_moved);
}
void set(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype);
void set(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype, bool is_moved);
void set(Eolian_Expression_Type eolian_exp_type);
friend inline bool operator<(type_def const& lhs, type_def const& rhs)
@ -427,13 +433,13 @@ inline bool operator!=(type_def const& lhs, type_def const& rhs)
type_def const void_ {attributes::regular_type_def{"void", {qualifier_info::is_none, {}}, {}}, "void", false, false, false, ""};
inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype)
inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype, bool is_moved)
{
c_type = ::eolian_type_c_type_get(eolian_type, ctype);
is_value_type = ('*' != c_type.back());
// ::eina_stringshare_del(stringshare); // this crashes
Eolian_Type const* stp = eolian_type_base_type_get(eolian_type);
has_own = !!::eolian_type_is_owned(eolian_type);
has_own = is_moved;
is_ptr = !!::eolian_type_is_ptr(eolian_type);
Eolian_Typedecl const* decl = eolian_type_typedecl_get(eolian_type);
@ -476,7 +482,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni
{{::eolian_type_short_name_get(eolian_type), {qualifiers(eolian_type), {}}, {}}, {}};
while (stp)
{
complex.subtypes.push_back({stp, unit, EOLIAN_C_TYPE_DEFAULT});
complex.subtypes.push_back({stp, unit, EOLIAN_C_TYPE_DEFAULT, eolian_type_is_move(stp)});
stp = eolian_type_next_type_get(stp);
}
original_type = complex;
@ -534,7 +540,7 @@ struct alias_def
is_undefined = true;
else
{
base_type = type_def(::eolian_typedecl_base_type_get(alias_obj), unit, EOLIAN_C_TYPE_DEFAULT);
base_type = type_def(::eolian_typedecl_base_type_get(alias_obj), unit, EOLIAN_C_TYPE_DEFAULT, value_ownership::unmoved);
is_undefined = false;
}
@ -587,7 +593,7 @@ struct parameter_def
documentation_def documentation, Eolian_Unit const* unit)
: direction(std::move(direction)), type(std::move(type)), param_name(std::move(param_name)), documentation(documentation), unit(unit) {}
parameter_def(Eolian_Function_Parameter const* param, Eolian_Unit const* unit)
: type( ::eolian_parameter_type_get(param), unit, EOLIAN_C_TYPE_PARAM)
: type( ::eolian_parameter_type_get(param), unit, EOLIAN_C_TYPE_PARAM, eolian_parameter_is_move(param))
, param_name( ::eolian_parameter_name_get(param)), unit(unit)
{
Eolian_Parameter_Dir direction = ::eolian_parameter_direction_get(param);
@ -741,7 +747,7 @@ struct function_def
return_documentation = eolian_function_return_documentation_get(function, type);
scope = static_cast<member_scope>(eolian_function_scope_get(function, type));
if(r_type)
return_type.set(r_type, unit, EOLIAN_C_TYPE_RETURN);
return_type.set(r_type, unit, EOLIAN_C_TYPE_RETURN, eolian_function_return_is_move(function, type));
if(type == EOLIAN_METHOD || type == EOLIAN_FUNCTION_POINTER)
{
for(efl::eina::iterator<Eolian_Function_Parameter> param_iterator ( ::eolian_function_parameters_get(function))
@ -997,7 +1003,7 @@ struct variable_def
variable_def(Eolian_Variable const* variable, Eolian_Unit const* unit)
: name(::eolian_variable_short_name_get(variable))
, full_name(::eolian_variable_name_get(variable))
, base_type(::eolian_variable_base_type_get(variable), unit, ::EOLIAN_C_TYPE_DEFAULT)
, base_type(::eolian_variable_base_type_get(variable), unit, ::EOLIAN_C_TYPE_DEFAULT, value_ownership::unmoved)
, documentation(::eolian_variable_documentation_get(variable))
, type(static_cast<variable_type>(::eolian_variable_type_get(variable)))
, expression_value()
@ -1015,7 +1021,7 @@ struct variable_def
if (!expr)
throw std::runtime_error("Could not get constant variable value expression");
this->expression_value = ::eolian_expression_eval_type(expr, ::eolian_variable_base_type_get(variable));
this->expression_value = ::eolian_expression_eval(expr, ::EOLIAN_MASK_ALL);
}
}
};
@ -1081,7 +1087,7 @@ struct event_def
event_def(Eolian_Event const* event, Eolian_Class const* cls, Eolian_Unit const* unit)
: klass(cls, {attributes::qualifier_info::is_none, std::string()})
, type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{})
, type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT, value_ownership::unmoved}} : eina::optional<type_def>{})
, name( ::eolian_event_name_get(event))
, c_name( ::eolian_event_c_macro_get(event))
, beta( ::eolian_event_is_beta(event))
@ -1546,7 +1552,8 @@ struct struct_field_def
{
name = eolian_typedecl_struct_field_name_get(struct_field);
try {
type.set(eolian_typedecl_struct_field_type_get(struct_field), unit, EOLIAN_C_TYPE_DEFAULT);
type.set(eolian_typedecl_struct_field_type_get(struct_field), unit, EOLIAN_C_TYPE_DEFAULT
, eolian_typedecl_struct_field_is_move(struct_field));
} catch(std::runtime_error const&) { /* Silently skip pointer fields*/ }
documentation = ::eolian_typedecl_struct_field_documentation_get(struct_field);
}

View File

@ -624,7 +624,10 @@ ethumb_frame_set(Ethumb *e, const char *theme_file, const char *group, const cha
{
edje_object_part_unswallow(frame->edje, e->img);
if (!theme_file)
_ethumb_frame_free(frame);
{
_ethumb_frame_free(frame);
frame = NULL;
}
}
if (!theme_file)

View File

@ -148,6 +148,17 @@ EWAPI extern const Efl_Event_Description _EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED
#define EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED (&(_EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED))
/* Efl.Animation.Player END */
/*TextBlock Internal function*/
/**
* Check if cursor is at cluster with one glyph (replace codepoints with new codepoint).
*
* @param cur the cursor.
* @param forward if Eina_True check cluster after cusror position, else before cursor position.
*/
EAPI Eina_Bool evas_textblock_cursor_at_cluster_as_single_glyph(Evas_Textblock_Cursor *cur,Eina_Bool forward);
#ifdef __cplusplus
}
#endif

View File

@ -154,7 +154,10 @@ _mesh_fini(Evas_Canvas3D_Mesh_Data *pd)
}
if (pd->indices && pd->owns_indices)
free(pd->indices);
{
free(pd->indices);
pd->indices = NULL;
}
if (pd->nodes)
eina_hash_free(pd->nodes);

View File

@ -7834,7 +7834,8 @@ _escaped_is_eq_and_advance(const char *s, const char *s_end,
* @param escape_values array of Escape_Value to look inside, Sorted by Escape
* @param escape_values_len is the len of Escape_Value array
*/
int _escaped_string_search(const char * s, size_t s_len, const Escape_Value escape_values[], const size_t escape_values_len)
static int
_escaped_string_search(const char *s, size_t s_len, const Escape_Value escape_values[], const size_t escape_values_len)
{
int l = 0;
int r = escape_values_len - 1;
@ -7868,7 +7869,8 @@ int _escaped_string_search(const char * s, size_t s_len, const Escape_Value esca
* @param escape_values array of Escape_Value to look inside, Sorted by Value
* @param escape_values_len is the len of Escape_Value array
*/
int _escaped_value_search(const char * s, const Escape_Value escape_values[], const size_t escape_values_len)
static int
_escaped_value_search(const char *s, const Escape_Value escape_values[], const size_t escape_values_len)
{
int l = 0;
int r = escape_values_len - 1;
@ -9662,7 +9664,7 @@ _evas_textblock_grapheme_breaks_new(Evas_Object_Textblock_Item *it, size_t len)
}
static size_t
_evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc)
_evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc, Eina_Bool *is_single_glyph)
{
Evas_Object_Textblock_Paragraph *par;
Efl_Canvas_Text_Data *o;
@ -9728,6 +9730,67 @@ _evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc
free(grapheme_breaks);
}
#ifdef OT_SUPPORT
if (is_single_glyph)
{
Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(last_it);
Evas_Text_Props_Info *info = ti->text_props.info;
int it_index = ((inc) ? cur->pos : ret) - last_it->text_pos;
Evas_Font_OT_Info ot;
if (ti->text_props.len != ti->text_props.text_len)/*if code point count same as glyph count skip it*/
{
Evas_BiDi_Direction itdir = ti->text_props.bidi_dir;
int i = 0;
if (itdir == EFL_TEXT_BIDIRECTIONAL_TYPE_RTL)
{
for (i = ti->text_props.len-1 ; i >= 0; i--)
{
ot = info->ot[i];
if (ot.source_cluster >= (size_t)it_index)
break;
}
if (i <= 0)
{
if (ti->text_props.text_len - ot.source_cluster >= 2)
*is_single_glyph = EINA_TRUE;
}
else
{
Evas_Font_OT_Info ot_next = info->ot[i - 1];
if (ot_next.source_cluster - ot.source_cluster >= 2)
*is_single_glyph = EINA_TRUE;
}
}
else
{
for (i = 0; i < (int) ti->text_props.len; i++)
{
ot = info->ot[i];
if ((int)ot.source_cluster >= it_index)
break;
}
if ((i + 1) >= (int) ti->text_props.len)
{
if (ti->text_props.text_len - ot.source_cluster >= 2)
*is_single_glyph = EINA_TRUE;
}
else
{
Evas_Font_OT_Info ot_next = info->ot[i + 1];
if (ot_next.source_cluster - ot.source_cluster >= 2)
*is_single_glyph = EINA_TRUE;
}
}
}
else
{
is_single_glyph = EINA_FALSE;
}
}
#else//#ifdef OT_SUPPORT
(void)is_single_glyph;
#endif//#ifdef OT_SUPPORT
}
}
}
@ -9735,6 +9798,18 @@ _evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc
return ret;
}
EAPI Eina_Bool evas_textblock_cursor_at_cluster_as_single_glyph(Evas_Textblock_Cursor *cur,Eina_Bool forward)
{
Eina_Bool is_single_glyph = EINA_FALSE;
size_t ret = _evas_textblock_cursor_cluster_pos_get(cur, forward, &is_single_glyph);
if ((abs(ret-cur->pos) > 1) && is_single_glyph)
{
return EINA_TRUE;
}
return EINA_FALSE;
}
static Eina_Bool
_evas_textblock_cursor_next(Evas_Textblock_Cursor *cur, Eina_Bool per_cluster)
{
@ -9754,7 +9829,7 @@ _evas_textblock_cursor_next(Evas_Textblock_Cursor *cur, Eina_Bool per_cluster)
if (text[ind])
{
if (per_cluster)
ind = _evas_textblock_cursor_cluster_pos_get(cur, EINA_TRUE);
ind = _evas_textblock_cursor_cluster_pos_get(cur, EINA_TRUE, NULL);
if (ind <= (int)cur->pos)
ind = cur->pos + 1;
@ -9801,7 +9876,7 @@ _evas_textblock_cursor_prev(Evas_Textblock_Cursor *cur, Eina_Bool per_cluster)
{
if (per_cluster)
{
size_t ret = _evas_textblock_cursor_cluster_pos_get(cur, EINA_FALSE);
size_t ret = _evas_textblock_cursor_cluster_pos_get(cur, EINA_FALSE, NULL);
if (ret != cur->pos)
{

View File

@ -1,161 +0,0 @@
#ifndef __EVIL_H__
#define __EVIL_H__
/**
* @file Evil.h
* @brief The file that provides miscellaneous functions ported from Unix.
*/
/**
* @page evil_main Evil
* @author Vincent Torri
* @date 2008 (created)
*
* @section toc Table of Contents
*
* @li @ref evil_main_intro
* @li @ref evil_main_ack
* @li @ref evil_main_compiling
* @li @ref evil_main_next_steps
*
* @section evil_main_intro Introduction
*
* The Evil library is an evil library that ports some evil Unix
* functions to the Windows (XP or above, or Mobile) platform. The
* evilness is so huge that the most of the functions are not POSIX or
* BSD compliant.
*
* These functions are intended to be used in the Enlightenment
* Foundation Libraries only and can be compiled only on Windows,
* using MSYS/MinGW on Windows, and cross-compilation on Unix. This
* library is minimal in the sense that only the functions needed to
* compile the EFL are available. The purpose of this library is NOT
* to have a full POSIX emulation et it is NOT a replacement of
* cygwin. To compare the size of the DLL themselves, Evil is around
* 33 KB and cygwin DLL is around 800 KB.
*
* @section evil_main_ack Acknowledgments
*
* This library has receive some from people interested in the EFL or
* not. Among them, evil thanks to Lars Munch, Raoul Hecky, Nicolas
* Aguirre, Tor Lillqvist, Lance Fetters, Vincent Richomme, Paul
* Vixie, Daniel Stenberg, who helped the author of the library in
* different fields (code and tests).
*
* @section evil_main_compiling How to compile
*
* Evil is a library your application links to. The procedure for
* this is very simple. You simply have to compile your application
* with the appropriate compiler flags that the @p pkg-config script
* outputs. For example:
*
* Compiling C or C++ files into object files:
*
* @verbatim
gcc -c -o main.o main.c `pkg-config --cflags evil`
@endverbatim
*
* Linking object files into a binary executable:
*
* @verbatim
gcc -o my_application main.o `pkg-config --libs evil`
@endverbatim
*
* See @ref pkgconfig
*
* @section evil_main_next_steps Next Steps
*
* After you understood what Evil is and installed it in your system
* you should proceed understanding the programming interface.
*
* Recommended reading:
*
* @li @ref Evil_Mman
* @li @ref Evil_Unistd_Group
* @li @ref Evil_Dlfcn
* @li @ref Evil_Langinfo_Group
* @li @ref Evil_Locale_Group
* @li @ref Evil_Stdio_Group
* @li @ref Evil_Main_Group
* @li @ref Evil_String_Group
* @li @ref Evil_Stdlib_Group
* @li @ref Evil_Time_Group
*/
/**
* @cond LOCAL
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _MSC_VER
# ifdef _WIN64
typedef __int64 pid_t;
# else
typedef int pid_t;
# endif
typedef SSIZE_T ssize_t;
typedef unsigned short mode_t;
# define strdup(str) _strdup(str)
#endif
#ifndef S_ISDIR
# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
#endif
#ifndef S_ISREG
# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#endif
#define S_ISLNK(m) 0
#define S_IRUSR _S_IRUSR
#ifndef S_IRGRP
# define S_IRGRP S_IRUSR
#endif
#ifndef S_IROTH
# define S_IROTH S_IRUSR
#endif
#define S_IWUSR _S_IWUSR
#ifndef S_IWGRP
# define S_IWGRP S_IWUSR
#endif
#ifndef S_IWOTH
# define S_IWOTH S_IWUSR
#endif
#define S_IXUSR _S_IXUSR
#ifndef S_IXGRP
# define S_IXGRP S_IXUSR
#endif
#ifndef S_IXOTH
# define S_IXOTH S_IXUSR
#endif
#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
#ifndef S_IRWXG
# define S_IRWXG _S_IRWXU
#endif
#ifndef S_IRWXO
# define S_IRWXO _S_IRWXU
#endif
#define _S_IXUSR _S_IEXEC
#define _S_IWUSR _S_IWRITE
#define _S_IRUSR _S_IREAD
#include "evil_private.h"
#ifdef __cplusplus
}
#endif
/**
* @endcond
*/
#endif /* __EVIL_H__ */

View File

@ -1,22 +1,6 @@
evil_deps = []
evil_pub_deps = []
if target_machine.system() == 'windows'
evil_header_src = [
'Evil.h',
'evil_dlfcn.h',
'evil_fcntl.h',
'evil_langinfo.h',
'evil_locale.h',
'evil_macro_wrapper.h',
'evil_main.h',
'evil_stdio.h',
'evil_stdlib.h',
'evil_string.h',
'evil_time.h',
'evil_unistd.h',
'evil_util.h',
]
evil_src = [
'evil_dlfcn.c',
'evil_fcntl.c',
@ -53,5 +37,6 @@ if target_machine.system() == 'windows'
)
else
evil = declare_dependency()
automatic_pkgfile = false
endif
automatic_pkgfile = false

View File

@ -27,7 +27,6 @@
static const Efl_Test_Case etc[] = {
{ "Efl_Container_Model", efl_test_case_container_model },
{ "Efl_View_Model", efl_test_case_view_model },
{ "Efl_Boolean_Model", efl_test_case_boolean_model },
{ NULL, NULL }
};

View File

@ -22,7 +22,6 @@
#include <check.h>
#include "../efl_check.h"
void efl_test_case_container_model(TCase *tc);
void efl_test_case_view_model(TCase *tc);
void efl_test_case_boolean_model(TCase *tc);
#endif /* EFL_SUITE_H_ */

View File

@ -70,47 +70,6 @@ _children_slice_get_then(void *data EINA_UNUSED,
return v;
}
static Eina_Value
_selection_children_slice_get_then(void *data EINA_UNUSED,
const Eina_Value v,
const Eina_Future *dead_future EINA_UNUSED)
{
unsigned int i, len;
Efl_Model *child = NULL;
fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
{
Eina_Value *p_int = NULL;
Eina_Value *p_bool = NULL;
Eina_Value *p_index = NULL;
int v_int = 0;
unsigned int index = 0;
Eina_Bool v_bool = EINA_FALSE;
p_bool = efl_model_property_get(child, "selected");
p_int = efl_model_property_get(child, "test_p_int");
p_index = efl_model_property_get(child, "child.index");
eina_value_get(p_bool, &v_bool);
eina_value_get(p_int, &v_int);
fail_if(!eina_value_uint_convert(p_index, &index));
fail_if(v_bool != base_selections[i]);
fail_if(v_int != base_ints[i]);
ck_assert_int_eq(i, index);
eina_value_free(p_bool);
eina_value_free(p_int);
eina_value_free(p_index);
}
ecore_main_loop_quit();
return v;
}
EFL_START_TEST(efl_test_boolean_model)
{
Efl_Generic_Model *base_model, *child;
@ -145,62 +104,6 @@ EFL_START_TEST(efl_test_boolean_model)
}
EFL_END_TEST
static Eina_Value
_wait_propagate(void *data EINA_UNUSED,
const Eina_Value v,
const Eina_Future *dead_future EINA_UNUSED)
{
ecore_main_loop_quit();
return v;
}
EFL_START_TEST(efl_test_select_model)
{
Efl_Generic_Model *base_model, *child;
int i;
Eina_Value v = { 0 };
Efl_Select_Model *model;
Eina_Future *future;
Eina_Iterator *it;
uint64_t *index;
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
base_model = efl_add_ref(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get());
ck_assert(!!base_model);
for (i = 0; i < child_number; ++i)
{
child = efl_model_child_add(base_model);
ck_assert(!!child);
ck_assert(eina_value_set(&v, base_ints[i]));
efl_model_property_set(child, "test_p_int", &v);
}
model = efl_add_ref(EFL_SELECT_MODEL_CLASS, efl_main_loop_get(),
efl_ui_view_model_set(efl_added, base_model));
ck_assert(!!model);
future = efl_model_property_set(model, "child.selected", eina_value_int_new(2));
eina_future_then(future, _wait_propagate, NULL, NULL);
ecore_main_loop_begin();
future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model));
eina_future_then(future, _selection_children_slice_get_then, NULL, NULL);
ecore_main_loop_begin();
it = efl_select_model_selected_get(model);
EINA_ITERATOR_FOREACH(it, index)
fail_if(*index != 2);
eina_iterator_free(it);
it = efl_select_model_unselected_get(model);
EINA_ITERATOR_FOREACH(it, index)
fail_if(*index == 2);
eina_iterator_free(it);
}
EFL_END_TEST
typedef struct _Efl_Filter_Model_Wait Efl_Filter_Model_Wait;
struct _Efl_Filter_Model_Wait
{
@ -465,6 +368,5 @@ void
efl_test_case_boolean_model(TCase *tc)
{
tcase_add_test(tc, efl_test_boolean_model);
tcase_add_test(tc, efl_test_select_model);
tcase_add_test(tc, efl_test_filter_model);
}

View File

@ -3,7 +3,6 @@ efl_suite_src = [
'efl_suite.h',
'efl_test_composite_model.c',
'efl_test_container_model.c',
'efl_test_view_model.c'
]
efl_suite_bin = executable('efl_suite',

View File

@ -7,7 +7,7 @@ class Dummy.Event_Manager extends Efl.Object {
set {
}
values {
emitter: Efl.Object @owned;
emitter: Efl.Object @move;
}
}

View File

@ -4,7 +4,7 @@ interface Dummy.Inherit_Iface {
params {
@in v: stringshare;
}
return: stringshare @owned;
return: stringshare @move;
}
}
}

View File

@ -134,13 +134,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
params {
@in v: stringshare;
}
return: stringshare @owned;
return: stringshare @move;
}
in_own_stringshare {
params {
@in v: stringshare @owned;
@in v: stringshare @move;
}
return: stringshare @owned;
return: stringshare @move;
}
out_stringshare {
@ -150,7 +150,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
out_own_stringshare {
params {
@out v: stringshare @owned;
@out v: stringshare @move;
}
}
@ -158,21 +158,21 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
return: stringshare;
}
return_own_stringshare {
return: stringshare @owned;
return: stringshare @move;
}
in_string {
params {
@in str: string;
}
return: mstring @owned;
return: mstring @move;
}
in_own_string {
params {
@in str: mstring @owned;
@in str: mstring @move;
}
return: mstring @owned;
return: mstring @move;
}
return_string {
@ -180,7 +180,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
return_own_string {
return: mstring @owned;
return: mstring @move;
}
out_string {
@ -191,7 +191,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
out_own_string {
params {
@out str: mstring @owned;
@out str: mstring @move;
}
}
@ -203,7 +203,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
call_in_own_string {
params {
@in str: mstring @owned;
@in str: mstring @move;
}
}
@ -212,7 +212,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
call_return_own_string {
return: mstring @owned;
return: mstring @move;
}
call_out_string {
@ -220,7 +220,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
call_out_own_string {
return: mstring @owned;
return: mstring @move;
}
// Stringshare virtual helpers
@ -232,7 +232,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
call_in_own_stringshare {
params {
@in str: stringshare @owned;
@in str: stringshare @move;
}
}
@ -241,7 +241,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
call_return_own_stringshare {
return: stringshare @owned;
return: stringshare @move;
}
call_out_stringshare {
@ -249,7 +249,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
call_out_own_stringshare {
return: stringshare @owned;
return: stringshare @move;
}
eina_slice_in {
@ -313,14 +313,14 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_binbuf_in_own {
params {
@in binbuf: binbuf @owned;
@in binbuf: binbuf @move;
}
return: bool;
}
call_eina_binbuf_in_own {
params {
@in str: binbuf @owned;
@in str: binbuf @move;
}
return: bool;
}
@ -346,13 +346,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_binbuf_out_own {
params {
@out binbuf: binbuf @owned;
@out binbuf: binbuf @move;
}
return: bool;
}
call_eina_binbuf_out_own {
return: binbuf @owned;
return: binbuf @move;
}
eina_binbuf_return {
@ -368,11 +368,11 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_binbuf_return_own {
return: binbuf @owned;
return: binbuf @move;
}
call_eina_binbuf_return_own {
return: binbuf @owned;
return: binbuf @move;
}
/* Eina Array */
@ -387,7 +387,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_int_in_own {
params {
@in arr: array<int> @owned; // <int @owned>
@in arr: array<int> @move; // <int @move>
}
return: bool;
}
@ -407,7 +407,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_int_out_own {
params {
@out arr: array<int> @owned; // <int @owned>
@out arr: array<int> @move; // <int @move>
}
return: bool;
}
@ -420,7 +420,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_array_int_return_own {
return: array<int> @owned; // <int @owned>
return: array<int> @move; // <int @move>
}
/* String */
@ -433,7 +433,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_str_in_own {
params {
@in arr: array<mstring @owned> @owned;
@in arr: array<mstring @move> @move;
}
return: bool;
}
@ -453,7 +453,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_str_out_own {
params {
@out arr: array<mstring @owned> @owned;
@out arr: array<mstring @move> @move;
}
return: bool;
}
@ -466,7 +466,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_array_str_return_own {
return: array<mstring @owned> @owned;
return: array<mstring @move> @move;
}
/* Eina_Stringshare */
@ -479,7 +479,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_strshare_in_own {
params {
@in arr: array<stringshare @owned> @owned;
@in arr: array<stringshare @move> @move;
}
return: bool;
}
@ -499,7 +499,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_strshare_out_own {
params {
@out arr: array<stringshare @owned> @owned;
@out arr: array<stringshare @move> @move;
}
return: bool;
}
@ -512,7 +512,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_array_strshare_return_own {
return: array<stringshare @owned> @owned;
return: array<stringshare @move> @move;
}
/* Object */
@ -525,7 +525,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_obj_in_own {
params {
@in arr: array<Dummy.Numberwrapper @owned> @owned;
@in arr: array<Dummy.Numberwrapper @move> @move;
}
return: bool;
}
@ -545,7 +545,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_array_obj_out_own {
params {
@out arr: array<Dummy.Numberwrapper @owned> @owned;
@out arr: array<Dummy.Numberwrapper @move> @move;
}
return: bool;
}
@ -558,7 +558,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_array_obj_return_own {
return: array<Dummy.Numberwrapper @owned> @owned;
return: array<Dummy.Numberwrapper @move> @move;
}
eina_array_obj_return_in {
@ -580,7 +580,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_int_in_own {
params {
@in lst: list<int> @owned; // <int @owned>
@in lst: list<int> @move; // <int @move>
}
return: bool;
}
@ -600,7 +600,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_int_out_own {
params {
@out lst: list<int> @owned; // <int @owned>
@out lst: list<int> @move; // <int @move>
}
return: bool;
}
@ -613,7 +613,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_list_int_return_own {
return: list<int> @owned; // <int @owned>
return: list<int> @move; // <int @move>
}
/* String */
@ -626,7 +626,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_str_in_own {
params {
@in lst: list<mstring @owned> @owned;
@in lst: list<mstring @move> @move;
}
return: bool;
}
@ -646,7 +646,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_str_out_own {
params {
@out lst: list<mstring @owned> @owned;
@out lst: list<mstring @move> @move;
}
return: bool;
}
@ -659,7 +659,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_list_str_return_own {
return: list<mstring @owned> @owned;
return: list<mstring @move> @move;
}
/* Eina_Stringshare */
@ -672,7 +672,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_strshare_in_own {
params {
@in lst: list<stringshare @owned> @owned;
@in lst: list<stringshare @move> @move;
}
return: bool;
}
@ -692,7 +692,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_strshare_out_own {
params {
@out lst: list<stringshare @owned> @owned;
@out lst: list<stringshare @move> @move;
}
return: bool;
}
@ -705,7 +705,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_list_strshare_return_own {
return: list<stringshare @owned> @owned;
return: list<stringshare @move> @move;
}
/* Object */
@ -718,7 +718,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_obj_in_own {
params {
@in lst: list<Dummy.Numberwrapper @owned> @owned;
@in lst: list<Dummy.Numberwrapper @move> @move;
}
return: bool;
}
@ -738,7 +738,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_list_obj_out_own {
params {
@out lst: list<Dummy.Numberwrapper @owned> @owned;
@out lst: list<Dummy.Numberwrapper @move> @move;
}
return: bool;
}
@ -751,7 +751,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_list_obj_return_own {
return: list<Dummy.Numberwrapper @owned> @owned;
return: list<Dummy.Numberwrapper @move> @move;
}
eina_list_obj_return_in {
@ -774,7 +774,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
/*
eina_hash_int_in_own {
params {
@in hsh: hash<int, int> @owned; // <, int @owned>
@in hsh: hash<int, int> @move; // <, int @move>
}
return: bool;
}
@ -796,7 +796,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
/*
eina_hash_int_out_own {
params {
@out hsh: hash<int, int> @owned; // <, int @owned>
@out hsh: hash<int, int> @move; // <, int @move>
}
return: bool;
}
@ -814,7 +814,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
/*
eina_hash_int_return_own {
return: hash<int, int> @owned; // <, int @owned>
return: hash<int, int> @move; // <, int @move>
}
check_eina_hash_int_return_own {
return: bool;
@ -831,7 +831,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_hash_str_in_own {
params {
@in hsh: hash<string, mstring @owned> @owned;
@in hsh: hash<string, mstring @move> @move;
}
return: bool;
}
@ -851,7 +851,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_hash_str_out_own {
params {
@out hsh: hash<string, mstring @owned> @owned;
@out hsh: hash<string, mstring @move> @move;
}
return: bool;
}
@ -867,7 +867,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_hash_str_return_own {
return: hash<string, mstring @owned> @owned;
return: hash<string, mstring @move> @move;
}
check_eina_hash_str_return_own {
return: bool;
@ -883,7 +883,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_hash_strshare_in_own {
params {
@in hsh: hash<stringshare, stringshare @owned> @owned;
@in hsh: hash<stringshare, stringshare @move> @move;
}
return: bool;
}
@ -903,7 +903,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_hash_strshare_out_own {
params {
@out hsh: hash<stringshare, stringshare @owned> @owned;
@out hsh: hash<stringshare, stringshare @move> @move;
}
return: bool;
}
@ -919,7 +919,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_hash_strshare_return_own {
return: hash<stringshare, stringshare @owned> @owned;
return: hash<stringshare, stringshare @move> @move;
}
check_eina_hash_strshare_return_own {
return: bool;
@ -939,7 +939,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_hash_obj_in_own {
params {
@in hsh: hash<Dummy.Numberwrapper, Dummy.Numberwrapper @owned> @owned;
@in hsh: hash<Dummy.Numberwrapper, Dummy.Numberwrapper @move> @move;
@in nwk1: Dummy.Numberwrapper;
@in nwv1: Dummy.Numberwrapper;
@out nwk2: Dummy.Numberwrapper;
@ -977,7 +977,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_hash_obj_out_own {
params {
@out hsh: hash<Dummy.Numberwrapper, Dummy.Numberwrapper @owned> @owned;
@out hsh: hash<Dummy.Numberwrapper, Dummy.Numberwrapper @move> @move;
@out nwk: Dummy.Numberwrapper;
@out nwv: Dummy.Numberwrapper;
}
@ -1009,7 +1009,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
@out nwk: Dummy.Numberwrapper;
@out nwv: Dummy.Numberwrapper;
}
return: hash<Dummy.Numberwrapper, Dummy.Numberwrapper @owned> @owned;
return: hash<Dummy.Numberwrapper, Dummy.Numberwrapper @move> @move;
}
check_eina_hash_obj_return_own {
return: bool;
@ -1027,7 +1027,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_int_in_own {
params {
@in itr: iterator<int> @owned;
@in itr: iterator<int> @move;
}
return: bool;
}
@ -1047,7 +1047,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_int_out_own {
params {
@out itr: iterator<int> @owned;
@out itr: iterator<int> @move;
}
return: bool;
}
@ -1060,7 +1060,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_iterator_int_return_own {
return: iterator<int> @owned;
return: iterator<int> @move;
}
/* String */
@ -1073,7 +1073,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_str_in_own {
params {
@in itr: iterator<mstring> @owned;
@in itr: iterator<mstring> @move;
}
return: bool;
}
@ -1093,7 +1093,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_str_out_own {
params {
@out itr: iterator<mstring> @owned;
@out itr: iterator<mstring> @move;
}
return: bool;
}
@ -1106,7 +1106,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_iterator_str_return_own {
return: iterator<mstring> @owned;
return: iterator<mstring> @move;
}
/* Eina_Stringshare */
@ -1119,7 +1119,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_strshare_in_own {
params {
@in itr: iterator<stringshare> @owned;
@in itr: iterator<stringshare> @move;
}
return: bool;
}
@ -1139,7 +1139,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_strshare_out_own {
params {
@out itr: iterator<stringshare> @owned;
@out itr: iterator<stringshare> @move;
}
return: bool;
}
@ -1152,7 +1152,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_iterator_strshare_return_own {
return: iterator<stringshare> @owned;
return: iterator<stringshare> @move;
}
/* Object */
@ -1165,7 +1165,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_obj_in_own {
params {
@in itr: iterator<Dummy.Numberwrapper> @owned;
@in itr: iterator<Dummy.Numberwrapper> @move;
}
return: bool;
}
@ -1185,7 +1185,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
eina_iterator_obj_out_own {
params {
@out itr: iterator<Dummy.Numberwrapper> @owned;
@out itr: iterator<Dummy.Numberwrapper> @move;
}
return: bool;
}
@ -1198,7 +1198,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
eina_iterator_obj_return_own {
return: iterator<Dummy.Numberwrapper> @owned;
return: iterator<Dummy.Numberwrapper> @move;
}
/* Function Pointer */
@ -1249,7 +1249,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
set_value_ptr_own {
params {
value: any_value_ptr @owned;
value: any_value_ptr @move;
}
}
@ -1266,7 +1266,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
get_value_ptr_own {
return: any_value_ptr @owned;
return: any_value_ptr @move;
}
get_value_ptr {
@ -1293,7 +1293,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
out_value_ptr_own {
params {
@out value: any_value_ptr @owned;
@out value: any_value_ptr @move;
}
}
@ -1322,7 +1322,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
struct_simple_ptr_in_own {
params {
@in simple: ptr(Dummy.StructSimple) @owned;
@in simple: ptr(Dummy.StructSimple) @move;
}
return: Dummy.StructSimple;
}
@ -1345,7 +1345,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
struct_simple_ptr_out_own {
params {
@out simple: ptr(Dummy.StructSimple) @owned;
@out simple: ptr(Dummy.StructSimple) @move;
}
return: Dummy.StructSimple;
}
@ -1361,7 +1361,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
struct_simple_ptr_return_own {
return: ptr(Dummy.StructSimple) @owned;
return: ptr(Dummy.StructSimple) @move;
}
*/
@ -1380,7 +1380,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
call_struct_simple_ptr_in_own {
params {
@in simple: ptr(Dummy.StructSimple) @owned;
@in simple: ptr(Dummy.StructSimple) @move;
}
}
*/
@ -1400,7 +1400,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
call_struct_simple_ptr_out_own {
params {
@out simple: ptr(Dummy.StructSimple) @owned;
@out simple: ptr(Dummy.StructSimple) @move;
}
}
*/
@ -1415,7 +1415,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
call_struct_simple_ptr_return_own {
return: ptr(Dummy.StructSimple) @owned;
return: ptr(Dummy.StructSimple) @move;
}
*/
@ -1436,7 +1436,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
struct_complex_ptr_in_own {
params {
@in complex: ptr(Dummy.StructComplex) @owned;
@in complex: ptr(Dummy.StructComplex) @move;
}
return: bool;
}
@ -1458,7 +1458,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
//
// struct_complex_ptr_out_own {
// params {
// @out complex: ptr(Dummy.StructComplex) @owned;
// @out complex: ptr(Dummy.StructComplex) @move;
// }
// return: bool;
// }
@ -1472,7 +1472,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
// }
//
// struct_complex_ptr_return_own {
// return: ptr(Dummy.StructComplex) @owned;
// return: ptr(Dummy.StructComplex) @move;
// }
emit_event_with_string {
@ -1615,7 +1615,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
params {
@in acc: accessor<int>;
}
return: accessor<int> @owned;
return: accessor<int> @move;
}
@property setter_only {

View File

@ -38,6 +38,8 @@ static const Efl_Test_Case etc[] = {
{ "efl_ui_collection", efl_ui_test_item_container },
{ "efl_ui_grid_container", efl_ui_test_grid_container },
{ "efl_ui_list_container", efl_ui_test_list_container },
{ "efl_ui_select_model", efl_ui_test_select_model },
{ "efl_ui_view_model", efl_ui_test_view_model },
{ NULL, NULL }
};

View File

@ -49,6 +49,8 @@ void efl_ui_test_grid_container(TCase *tc);
void efl_ui_test_config(TCase *tc);
void efl_ui_test_popup(TCase *tc);
void efl_ui_test_scroller(TCase *tc);
void efl_ui_test_select_model(TCase *tc);
void efl_ui_test_view_model(TCase *tc);
void loop_timer_interval_set(Eo *obj, double in);

View File

@ -0,0 +1,130 @@
/* EFL - EFL library
* Copyright (C) 2013 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "efl_ui_suite.h"
static const int child_number = 3;
static const int base_ints[] = { 41, 42, 43 };
static const Eina_Bool base_selections[] = { EINA_FALSE, EINA_FALSE, EINA_TRUE };
static Eina_Value
_selection_children_slice_get_then(void *data EINA_UNUSED,
const Eina_Value v,
const Eina_Future *dead_future EINA_UNUSED)
{
unsigned int i, len;
Efl_Model *child = NULL;
fail_if(eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY);
EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
{
Eina_Value *p_int = NULL;
Eina_Value *p_bool = NULL;
Eina_Value *p_index = NULL;
int v_int = 0;
unsigned int index = 0;
Eina_Bool v_bool = EINA_FALSE;
p_bool = efl_model_property_get(child, "selected");
p_int = efl_model_property_get(child, "test_p_int");
p_index = efl_model_property_get(child, "child.index");
eina_value_get(p_bool, &v_bool);
eina_value_get(p_int, &v_int);
fail_if(!eina_value_uint_convert(p_index, &index));
fail_if(v_bool != base_selections[i]);
fail_if(v_int != base_ints[i]);
ck_assert_int_eq(i, index);
eina_value_free(p_bool);
eina_value_free(p_int);
eina_value_free(p_index);
}
ecore_main_loop_quit();
return v;
}
static Eina_Value
_wait_propagate(void *data EINA_UNUSED,
const Eina_Value v,
const Eina_Future *dead_future EINA_UNUSED)
{
ecore_main_loop_quit();
return v;
}
EFL_START_TEST(efl_test_select_model)
{
Efl_Generic_Model *base_model, *child;
int i;
Eina_Value v = { 0 };
Efl_Ui_Select_Model *model;
Eina_Future *future;
Eina_Iterator *it;
uint64_t *index;
eina_value_setup(&v, EINA_VALUE_TYPE_INT);
base_model = efl_add_ref(EFL_GENERIC_MODEL_CLASS, efl_main_loop_get());
ck_assert(!!base_model);
for (i = 0; i < child_number; ++i)
{
child = efl_model_child_add(base_model);
ck_assert(!!child);
ck_assert(eina_value_set(&v, base_ints[i]));
efl_model_property_set(child, "test_p_int", &v);
}
model = efl_add_ref(EFL_UI_SELECT_MODEL_CLASS, efl_main_loop_get(),
efl_ui_view_model_set(efl_added, base_model));
ck_assert(!!model);
future = efl_model_property_set(model, "child.selected", eina_value_int_new(2));
eina_future_then(future, _wait_propagate, NULL, NULL);
ecore_main_loop_begin();
future = efl_model_children_slice_get(model, 0, efl_model_children_count_get(model));
eina_future_then(future, _selection_children_slice_get_then, NULL, NULL);
ecore_main_loop_begin();
it = efl_ui_select_model_selected_get(model);
EINA_ITERATOR_FOREACH(it, index)
fail_if(*index != 2);
eina_iterator_free(it);
it = efl_ui_select_model_unselected_get(model);
EINA_ITERATOR_FOREACH(it, index)
fail_if(*index == 2);
eina_iterator_free(it);
}
EFL_END_TEST
void
efl_ui_test_select_model(TCase *tc)
{
tcase_add_test(tc, efl_test_select_model);
}

View File

@ -20,10 +20,7 @@
# include "config.h"
#endif
#include "efl_suite.h"
#include <Efl.h>
#include <Ecore.h>
#include "efl_ui_suite.h"
static const int child_number = 3;
static const int base_ints[] = { 41, 42, 43 };
@ -31,7 +28,7 @@ static const char *_efl_test_view_model_label_format = "Index %i.";
static const char *dependences[] = { "test_p_int" };
static Eina_Value *
_efl_test_view_model_label_get(void *data, const Efl_View_Model *mv, Eina_Stringshare *property)
_efl_test_view_model_label_get(void *data, const Efl_Ui_View_Model *mv, Eina_Stringshare *property)
{
Eina_Strbuf *buf;
Eina_Value *r;
@ -54,7 +51,7 @@ _efl_test_view_model_label_get(void *data, const Efl_View_Model *mv, Eina_String
}
static Eina_Future *
_efl_test_view_model_label_set(void *data EINA_UNUSED, Efl_View_Model *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED)
_efl_test_view_model_label_set(void *data EINA_UNUSED, Efl_Ui_View_Model *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED)
{
return efl_loop_future_rejected(mv, EFL_MODEL_ERROR_READ_ONLY);
}
@ -66,7 +63,7 @@ _efl_test_view_model_label_clean(void *data)
}
static Eina_Value *
_efl_test_view_model_color_get(void *data EINA_UNUSED, const Efl_View_Model *mv, Eina_Stringshare *property)
_efl_test_view_model_color_get(void *data EINA_UNUSED, const Efl_Ui_View_Model *mv, Eina_Stringshare *property)
{
Eina_Strbuf *buf;
Eina_Value *r;
@ -88,7 +85,7 @@ _efl_test_view_model_color_get(void *data EINA_UNUSED, const Efl_View_Model *mv,
}
static Eina_Future *
_efl_test_view_model_color_set(void *data EINA_UNUSED, Efl_View_Model *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED)
_efl_test_view_model_color_set(void *data EINA_UNUSED, Efl_Ui_View_Model *mv, Eina_Stringshare *property EINA_UNUSED, Eina_Value *value EINA_UNUSED)
{
return efl_loop_future_rejected(mv, EFL_MODEL_ERROR_READ_ONLY);
}
@ -318,36 +315,36 @@ EFL_START_TEST(efl_test_view_model)
efl_model_property_set(child, "test_p_int", &v);
}
mv = efl_add_ref(EFL_VIEW_MODEL_CLASS, efl_main_loop_get(),
mv = efl_add_ref(EFL_UI_VIEW_MODEL_CLASS, efl_main_loop_get(),
efl_ui_view_model_set(efl_added, base_model));
ck_assert(!!mv);
efl_view_model_property_logic_add(mv, "label",
efl_ui_view_model_property_logic_add(mv, "label",
(void*) _efl_test_view_model_label_format, _efl_test_view_model_label_get, _efl_test_view_model_label_clean,
(void*) _efl_test_view_model_label_format, _efl_test_view_model_label_set, _efl_test_view_model_label_clean,
EINA_C_ARRAY_ITERATOR_NEW(dependences));
efl_view_model_property_logic_add(mv, "color",
efl_ui_view_model_property_logic_add(mv, "color",
NULL, _efl_test_view_model_color_get, _efl_test_view_model_color_clean,
NULL, _efl_test_view_model_color_set, _efl_test_view_model_color_clean,
EINA_C_ARRAY_ITERATOR_NEW(dependences));
efl_view_model_property_logic_add(mv, "deadend",
efl_ui_view_model_property_logic_add(mv, "deadend",
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL);
efl_view_model_property_string_add(mv, "output",
efl_ui_view_model_property_string_add(mv, "output",
"${label} has ${color} for index ${index}",
"${index} not ready",
"${index} in error");
efl_view_model_property_string_add(mv, "broken",
efl_ui_view_model_property_string_add(mv, "broken",
"${nope} has ${color} for index ${index}",
"${index} not ready",
"${index} in error with '${nope}'");
efl_view_model_property_string_add(mv, "weird", "${} % { } has ${", NULL, NULL);
efl_ui_view_model_property_string_add(mv, "weird", "${} % { } has ${", NULL, NULL);
f = efl_model_children_slice_get(mv, 0, efl_model_children_count_get(mv));
f = efl_future_then(mv, f, .success_type = EINA_VALUE_TYPE_ARRAY,
@ -367,7 +364,7 @@ EFL_START_TEST(efl_test_view_model)
EFL_END_TEST
void
efl_test_case_view_model(TCase *tc)
efl_ui_test_view_model(TCase *tc)
{
tcase_add_test(tc, efl_test_view_model);
}

View File

@ -6,7 +6,7 @@
#include <Elementary.h>
#include "elm_suite.h"
EFL_START_TEST(elm_check_legacy_type_check)
EFL_START_TEST(elm_test_check_legacy_type_check)
{
Evas_Object *win, *check;
const char *type;
@ -26,7 +26,7 @@ EFL_START_TEST(elm_check_legacy_type_check)
}
EFL_END_TEST
EFL_START_TEST(elm_check_onoff_text)
EFL_START_TEST(elm_test_check_onoff_text)
{
Evas_Object *win, *check;
@ -49,7 +49,7 @@ EFL_START_TEST(elm_check_onoff_text)
}
EFL_END_TEST
EFL_START_TEST(elm_check_state)
EFL_START_TEST(elm_test_check_state)
{
Evas_Object *win, *check;
Eina_Bool state = EINA_TRUE;
@ -85,8 +85,8 @@ EFL_END_TEST
void elm_test_check(TCase *tc)
{
tcase_add_test(tc, elm_check_legacy_type_check);
tcase_add_test(tc, elm_check_onoff_text);
tcase_add_test(tc, elm_check_state);
tcase_add_test(tc, elm_test_check_legacy_type_check);
tcase_add_test(tc, elm_test_check_onoff_text);
tcase_add_test(tc, elm_test_check_state);
tcase_add_test(tc, elm_atspi_role_get);
}

View File

@ -154,6 +154,8 @@ efl_ui_suite_src = [
'efl_ui_test_position_manager_common.c',
'efl_ui_test_popup.c',
'efl_ui_test_scroller.c',
'efl_ui_test_select_model.c',
'efl_ui_test_view_model.c',
]
efl_ui_suite = executable('efl_ui_suite',

View File

@ -31,9 +31,9 @@ class Class_Simple {
@in a: int; [[a]]
@inout b: char;
@out c: double (1337.6);
@in d: ptr(int);
@in d: int @by_ref;
}
return: ptr(char) (null); [[comment for method return]]
return: mstring (null); [[comment for method return]]
}
}
}

View File

@ -7,7 +7,7 @@ class Consts {
@inout b: char;
@out c: double;
}
return: ptr(char) (null); [[comment for method return]]
return: int;
}
}
}

View File

@ -41,7 +41,7 @@ abstract Object_Impl extends Base {
@inout b: char;
@out c: double;
}
return: ptr(char) (null); [[comment for method return]]
return: mstring (null); [[comment for method return]]
}
foo2 @const {
[[comment foo]]

View File

@ -38,7 +38,7 @@ abstract Override extends Base {
params {
@in idx: int;
@out a: int (250);
@out str: ptr(char) (null);
@out str: mstring (null);
}
}
}

View File

@ -1,5 +1,5 @@
struct Named {
field: ptr(int);
field: int @by_ref;
something: string;
}
@ -24,7 +24,7 @@ class Struct {
return: mstring @move;
}
bar {
return: ptr(Named);
return: Named @by_ref;
}
}
}

View File

@ -425,7 +425,7 @@ EFL_START_TEST(eolian_complex_type)
/* Properties return type */
fail_if(!(fid = eolian_class_function_by_name_get(class, "a", EOLIAN_PROPERTY)));
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_PROP_SET)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(!(type_name = eolian_function_return_c_type_get(fid, EOLIAN_PROP_SET)));
fail_if(!eolian_function_return_is_move(fid, EOLIAN_PROP_SET));
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_LIST);
fail_if(strcmp(type_name, "Eina_List *"));
@ -450,7 +450,7 @@ EFL_START_TEST(eolian_complex_type)
eina_iterator_free(iter);
fail_if(strcmp(eolian_parameter_name_get(param), "value"));
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!(type_name = eolian_parameter_c_type_get(param, EINA_FALSE)));
fail_if(!eolian_parameter_is_move(param));
fail_if(strcmp(type_name, "Eina_List *"));
eina_stringshare_del(type_name);
@ -464,7 +464,7 @@ EFL_START_TEST(eolian_complex_type)
/* Methods return type */
fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_METHOD)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(!(type_name = eolian_function_return_c_type_get(fid, EOLIAN_METHOD)));
fail_if(!eolian_function_return_is_move(fid, EOLIAN_METHOD));
fail_if(strcmp(type_name, "Eina_List *"));
eina_stringshare_del(type_name);
@ -481,7 +481,7 @@ EFL_START_TEST(eolian_complex_type)
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(strcmp(eolian_parameter_name_get(param), "buf"));
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!(type_name = eolian_parameter_c_type_get(param, EINA_FALSE)));
fail_if(!eolian_parameter_is_move(param));
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_MSTRING);
fail_if(strcmp(type_name, "char *"));
@ -490,7 +490,7 @@ EFL_START_TEST(eolian_complex_type)
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(strcmp(eolian_parameter_name_get(param), "sl"));
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!(type_name = eolian_parameter_c_type_get(param, EINA_FALSE)));
fail_if(eolian_parameter_is_move(param));
fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_SLICE);
fail_if(strcmp(type_name, "Eina_Slice"));
@ -615,11 +615,10 @@ EFL_START_TEST(eolian_simple_parsing)
/* Method */
fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(!eolian_function_is_beta(fid));
fail_if(!eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
/* Function return */
tp = eolian_function_return_type_get(fid, EOLIAN_METHOD);
fail_if(!tp);
string = eolian_type_c_type_get(tp, EOLIAN_C_TYPE_RETURN);
string = eolian_function_return_c_type_get(fid, EOLIAN_METHOD);
fail_if(!string);
fail_if(strcmp(string, "char *"));
eina_stringshare_del(string);
@ -652,7 +651,7 @@ EFL_START_TEST(eolian_simple_parsing)
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
fail_if(strcmp(eolian_type_short_name_get(eolian_parameter_type_get(param)), "int"));
fail_if(!eolian_type_is_ptr(eolian_parameter_type_get(param)));
fail_if(!eolian_parameter_is_by_ref(param));
fail_if(strcmp(eolian_parameter_name_get(param), "d"));
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
@ -695,13 +694,13 @@ EFL_START_TEST(eolian_struct)
fail_if(strcmp(file, "struct.eo"));
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
fail_if(!eolian_type_is_ptr(ftype));
fail_if(!eolian_typedecl_struct_field_is_by_ref(field));
fail_if(!(type_name = eolian_type_short_name_get(ftype)));
fail_if(strcmp(type_name, "int"));
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
fail_if(eolian_type_is_ptr(ftype));
fail_if(!(type_name = eolian_type_c_type_get(ftype, EOLIAN_C_TYPE_DEFAULT)));
fail_if(eolian_typedecl_struct_field_is_by_ref(field));
fail_if(!(type_name = eolian_typedecl_struct_field_c_type_get(field)));
fail_if(strcmp(type_name, "const char *"));
eina_stringshare_del(type_name);
@ -728,7 +727,7 @@ EFL_START_TEST(eolian_struct)
fail_if(!(func = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD)));
fail_if(!(type = eolian_function_return_type_get(func, EOLIAN_METHOD)));
fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_REGULAR);
fail_if(!eolian_type_is_ptr(type));
fail_if(!eolian_function_return_is_by_ref(func, EOLIAN_METHOD));
fail_if(!(tdl = eolian_type_typedecl_get(type)));
fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
@ -800,7 +799,7 @@ EFL_START_TEST(eolian_var)
fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "int"));
fail_if(!(exp = eolian_variable_value_get(var)));
v = eolian_expression_eval_type(exp, type);
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 5);
@ -812,7 +811,7 @@ EFL_START_TEST(eolian_var)
fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "float"));
fail_if(!(exp = eolian_variable_value_get(var)));
v = eolian_expression_eval_type(exp, type);
v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
fail_if(v.type != EOLIAN_EXPR_FLOAT);
fail_if(((int)v.value.f) != 10);
@ -1348,20 +1347,20 @@ EFL_START_TEST(eolian_function_types)
fail_if(strcmp(eolian_function_name_get(fid), "SimpleFunc"));
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_FUNCTION_POINTER))); // void is null_return_type?
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(!(type_name = eolian_function_return_c_type_get(fid, EOLIAN_FUNCTION_POINTER)));
fail_if(strcmp(type_name, "const char *"));
fail_if(!(iter = (eolian_function_parameters_get(fid))));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(strcmp(eolian_parameter_name_get(param), "a"));
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!(type_name = eolian_parameter_c_type_get(param, EINA_FALSE)));
fail_if(strcmp(type_name, "int"));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(strcmp(eolian_parameter_name_get(param), "b"));
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!(type_name = eolian_parameter_c_type_get(param, EINA_FALSE)));
fail_if(strcmp(type_name, "double"));
fail_if(eina_iterator_next(iter, &dummy));
@ -1374,7 +1373,7 @@ EFL_START_TEST(eolian_function_types)
fail_if(eolian_function_type_get(fid) != EOLIAN_FUNCTION_POINTER);
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_FUNCTION_POINTER)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(!(type_name = eolian_function_return_c_type_get(fid, EOLIAN_FUNCTION_POINTER)));
fail_if(strcmp(type_name, "double"));
fail_if(!(iter = (eolian_function_parameters_get(fid))));
@ -1384,7 +1383,7 @@ EFL_START_TEST(eolian_function_types)
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
fail_if(eolian_parameter_is_move(param));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!(type_name = eolian_parameter_c_type_get(param, EINA_FALSE)));
fail_if(strcmp(type_name, "const char *"));
/*out own string */
@ -1393,7 +1392,7 @@ EFL_START_TEST(eolian_function_types)
fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM);
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!eolian_parameter_is_move(param));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!(type_name = eolian_parameter_c_type_get(param, EINA_FALSE)));
fail_if(strcmp(type_name, "char *"));
fail_if(eina_iterator_next(iter, &dummy));

View File

@ -20,17 +20,17 @@ class Complex extends Efl.Object
}
incontcontown {
params {
l: list<list<string>> @owned;
l: list<list<string>> @move;
}
}
incontowncontown {
params {
l: list<list<string> @owned> @owned;
l: list<list<string> @move> @owned;
}
}
incontowncont {
params {
l: list<list<string> @owned>;
l: list<list<string> @move>;
}
}
instringcont {
@ -40,12 +40,12 @@ class Complex extends Efl.Object
}
instringowncont {
params {
l: list<mstring @owned>;
l: list<mstring @move>;
}
}
instringcontown {
params {
l: list<string> @owned;
l: list<string> @move;
}
}
inarray {
@ -55,7 +55,7 @@ class Complex extends Efl.Object
}
inarrayown {
params {
l: array<string> @owned;
l: array<string> @move;
}
}
inhash {
@ -65,7 +65,7 @@ class Complex extends Efl.Object
}
inhashown {
params {
l: hash<string, string> @owned;
l: hash<string, string> @move;
}
}
initerator {
@ -75,7 +75,7 @@ class Complex extends Efl.Object
}
initeratorown {
params {
l: iterator<int> @owned;
l: iterator<int> @move;
}
}
inaccessor {
@ -85,7 +85,7 @@ class Complex extends Efl.Object
}
inaccessorown {
params {
l: accessor<int> @owned;
l: accessor<int> @move;
}
}
// out
@ -101,17 +101,17 @@ class Complex extends Efl.Object
}
outcontcontown {
params {
@out l: list<list<string>> @owned;
@out l: list<list<string>> @move;
}
}
outcontowncontown {
params {
@out l: list<list<string> @owned> @owned;
@out l: list<list<string> @move> @owned;
}
}
outcontowncont {
params {
@out l: list<list<string> @owned>;
@out l: list<list<string> @move>;
}
}
outstringcont {
@ -121,12 +121,12 @@ class Complex extends Efl.Object
}
outstringowncont {
params {
@out l: list<mstring @owned>;
@out l: list<mstring @move>;
}
}
outstringcontown {
params {
@out l: list<string> @owned;
@out l: list<string> @move;
}
}
outarray {
@ -136,7 +136,7 @@ class Complex extends Efl.Object
}
outarrayown {
params {
@out l: array<string> @owned;
@out l: array<string> @move;
}
}
outhash {
@ -146,7 +146,7 @@ class Complex extends Efl.Object
}
outhashown {
params {
@out l: hash<string, string> @owned;
@out l: hash<string, string> @move;
}
}
outiterator {
@ -156,7 +156,7 @@ class Complex extends Efl.Object
}
outiteratorown {
params {
@out l: iterator<int> @owned;
@out l: iterator<int> @move;
}
}
outaccessor {
@ -166,7 +166,7 @@ class Complex extends Efl.Object
}
outaccessorown {
params {
@out l: accessor<int> @owned;
@out l: accessor<int> @move;
}
}
foo {

View File

@ -20,7 +20,7 @@ class @beta Name1.Name2.Type_Generation extends Efl.Object
}
instringown {
params {
@in v: mstring @owned;
@in v: mstring @move;
}
}
instringshare {
@ -30,7 +30,7 @@ class @beta Name1.Name2.Type_Generation extends Efl.Object
}
instringshareown {
params {
@in v: stringshare @owned;
@in v: stringshare @move;
}
}
// return
@ -44,13 +44,13 @@ class @beta Name1.Name2.Type_Generation extends Efl.Object
return: string;
}
returnstringown {
return: mstring @owned;
return: mstring @move;
}
returnstringshare {
return: stringshare;
}
returnstringshareown {
return: stringshare @owned;
return: stringshare @move;
}
// out
outvoidptr {
@ -70,7 +70,7 @@ class @beta Name1.Name2.Type_Generation extends Efl.Object
}
outstringshareown {
params {
@out v: stringshare @owned;
@out v: stringshare @move;
}
}
// classname