From 10ac0f6eafba93292289c5d1873f319534a2d92f Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 2 Sep 2014 10:03:04 +0200 Subject: [PATCH 01/16] autotools: move to a little bit less deprecated gettext. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0938474bb1..395e24a444 100644 --- a/configure.ac +++ b/configure.ac @@ -242,7 +242,7 @@ EFL_INIT ### gettext -AM_GNU_GETTEXT_VERSION([0.17]) +AM_GNU_GETTEXT_VERSION([0.18]) m4_ifdef([AC_GNU_GETTEXT], [ AC_GNU_GETTEXT([external]) From a941d9c2fdb0262a4fa15a2f57dde015283f96b6 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 29 Aug 2014 17:51:10 +0200 Subject: [PATCH 02/16] ecore/drm: Remove another leftover from dead spartacus --- src/lib/ecore_drm/Ecore_Drm.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h index c5a741daa2..74ec4fc791 100644 --- a/src/lib/ecore_drm/Ecore_Drm.h +++ b/src/lib/ecore_drm/Ecore_Drm.h @@ -53,13 +53,6 @@ typedef enum _Ecore_Drm_Seat_Capabilities EVDEV_SEAT_TOUCH = (1 << 2), } Ecore_Drm_Seat_Capabilities; -/* structure for message passing */ -typedef struct _Ecore_Drm_Message -{ - int opcode, size; - void *data; -} Ecore_Drm_Message; - /* structure for fb objects */ typedef struct _Ecore_Drm_Fb { From b13bafabbaec0a3dab6f86f1736ba609ffd01caa Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 2 Sep 2014 10:47:38 +0100 Subject: [PATCH 03/16] eolian: support for default param values where applicable + API --- src/lib/eolian/Eolian.h | 10 +++++++++ src/lib/eolian/database_fill.c | 1 + src/lib/eolian/database_function_parameter.c | 4 +++- .../eolian/database_function_parameter_api.c | 7 ++++++ src/lib/eolian/eo_definitions.h | 1 + src/lib/eolian/eo_parser.c | 22 ++++++++++++++----- src/lib/eolian/eolian_database.h | 3 ++- 7 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 9cf640a22c..40815db4b0 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -778,6 +778,16 @@ EAPI Eolian_Parameter_Dir eolian_parameter_direction_get(const Eolian_Function_P */ EAPI const Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Parameter *param); +/* + * @brief Get the default value of a parameter + * + * @param[in] param_desc parameter handle + * @return the value or NULL + * + * @ingroup Eolian + */ +EAPI const Eolian_Expression *eolian_parameter_default_value_get(const Eolian_Function_Parameter *param); + /* * @brief Get name of a parameter * diff --git a/src/lib/eolian/database_fill.c b/src/lib/eolian/database_fill.c index dbcade782b..78e6d5f2fd 100644 --- a/src/lib/eolian/database_fill.c +++ b/src/lib/eolian/database_fill.c @@ -4,6 +4,7 @@ static Eina_Bool _db_fill_param(Eina_List **plist, Eo_Param_Def *param) { Eolian_Function_Parameter *p = database_parameter_add(param->type, + param->value, param->name, param->comment); p->param_dir = param->way; diff --git a/src/lib/eolian/database_function_parameter.c b/src/lib/eolian/database_function_parameter.c index d6498169c7..5c00993bd9 100644 --- a/src/lib/eolian/database_function_parameter.c +++ b/src/lib/eolian/database_function_parameter.c @@ -2,12 +2,14 @@ #include "eolian_database.h" Eolian_Function_Parameter * -database_parameter_add(Eolian_Type *type, const char *name, const char *description) +database_parameter_add(Eolian_Type *type, Eolian_Expression *value, + const char *name, const char *description) { Eolian_Function_Parameter *param = NULL; param = calloc(1, sizeof(*param)); param->name = eina_stringshare_add(name); param->type = type; + param->value = value; param->description = eina_stringshare_add(description); return param; } diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c index 712c82ef75..10e8d0fd01 100644 --- a/src/lib/eolian/database_function_parameter_api.c +++ b/src/lib/eolian/database_function_parameter_api.c @@ -15,6 +15,13 @@ eolian_parameter_type_get(const Eolian_Function_Parameter *param) return param->type; } +EAPI const Eolian_Expression * +eolian_parameter_default_value_get(const Eolian_Function_Parameter *param) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(param, NULL); + return param->value; +} + EAPI Eina_Stringshare * eolian_parameter_name_get(const Eolian_Function_Parameter *param) { diff --git a/src/lib/eolian/eo_definitions.h b/src/lib/eolian/eo_definitions.h index 533e0bd31a..67d45ce3fe 100644 --- a/src/lib/eolian/eo_definitions.h +++ b/src/lib/eolian/eo_definitions.h @@ -23,6 +23,7 @@ typedef struct _Eo_Param_Def Eolian_Object base; Eolian_Parameter_Dir way; Eolian_Type *type; + Eolian_Expression *value; Eina_Stringshare *name; Eina_Stringshare *comment; Eina_Bool nonull:1; diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 370ae25c04..565c63b7a9 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1124,7 +1124,7 @@ parse_return(Eo_Lexer *ls, Eina_Bool allow_void) } static void -parse_param(Eo_Lexer *ls, Eina_Bool allow_inout) +parse_param(Eo_Lexer *ls, Eina_Bool allow_inout, Eina_Bool is_vals) { Eo_Param_Def *par = calloc(1, sizeof(Eo_Param_Def)); par->base.file = eina_stringshare_ref(ls->filename); @@ -1159,6 +1159,16 @@ parse_param(Eo_Lexer *ls, Eina_Bool allow_inout) check(ls, TOK_VALUE); par->name = eina_stringshare_ref(ls->t.value.s); eo_lexer_get(ls); + if ((is_vals || (par->way == EOLIAN_OUT_PARAM)) && (ls->t.token == '(')) + { + int line = ls->line_number, col = ls->column; + ls->expr_mode = EINA_TRUE; + eo_lexer_get(ls); + par->value = parse_expr(ls); + ls->expr_mode = EINA_FALSE; + pop_expr(ls); + check_match(ls, ')', '(', line, col); + } if (ls->t.kw == KW_at_nonull) { par->nonull = EINA_TRUE; @@ -1278,11 +1288,11 @@ end: } static void -parse_params(Eo_Lexer *ls, Eina_Bool allow_inout) +parse_params(Eo_Lexer *ls, Eina_Bool allow_inout, Eina_Bool is_vals) { PARSE_SECTION { - parse_param(ls, allow_inout); + parse_param(ls, allow_inout, is_vals); ls->tmp.params = eina_list_append(ls->tmp.params, ls->tmp.param); ls->tmp.param = NULL; } @@ -1347,13 +1357,13 @@ body: break; case KW_keys: CASE_LOCK(ls, keys, "keys definition") - parse_params(ls, EINA_FALSE); + parse_params(ls, EINA_FALSE, EINA_FALSE); prop->keys = ls->tmp.params; ls->tmp.params = NULL; break; case KW_values: CASE_LOCK(ls, values, "values definition") - parse_params(ls, EINA_FALSE); + parse_params(ls, EINA_FALSE, EINA_TRUE); prop->values = ls->tmp.params; ls->tmp.params = NULL; break; @@ -1454,7 +1464,7 @@ body: break; case KW_params: CASE_LOCK(ls, params, "params definition") - parse_params(ls, EINA_TRUE); + parse_params(ls, EINA_TRUE, EINA_FALSE); meth->params = ls->tmp.params; ls->tmp.params = NULL; break; diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index ba4cb7b194..01da332cf7 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -118,6 +118,7 @@ struct _Eolian_Function_Parameter Eolian_Object base; Eina_Stringshare *name; Eolian_Type *type; + Eolian_Expression *value; Eina_Stringshare *description; Eolian_Parameter_Dir param_dir; Eina_Bool is_const_on_get :1; /* True if const in this the get property */ @@ -313,7 +314,7 @@ void database_function_del(Eolian_Function *fid); /* func parameters */ -Eolian_Function_Parameter *database_parameter_add(Eolian_Type *type, const char *name, const char *description); +Eolian_Function_Parameter *database_parameter_add(Eolian_Type *type, Eolian_Expression *value, const char *name, const char *description); void database_parameter_del(Eolian_Function_Parameter *pdesc); /* implements */ From 5e063b37a240205cee05412c2167e2865ad022ab Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 2 Sep 2014 11:00:19 +0100 Subject: [PATCH 04/16] eolian: tests for default param values --- src/tests/eolian/data/class_simple.eo | 4 ++-- src/tests/eolian/eolian_parsing.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tests/eolian/data/class_simple.eo b/src/tests/eolian/data/class_simple.eo index 73e5f8f916..a64a9aa891 100644 --- a/src/tests/eolian/data/class_simple.eo +++ b/src/tests/eolian/data/class_simple.eo @@ -13,7 +13,7 @@ class Class_Simple { get { } values { - int value; /*@ Value description */ + int value (100); /*@ Value description */ } } b { @@ -28,7 +28,7 @@ class Class_Simple { params { @in int a; /*@ a */ @inout char b; - @out double c; + @out double c (1337.6); } return: char * (null); /*@ comment for method return */ } diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 4010fddf1a..19565042a4 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -501,6 +501,11 @@ START_TEST(eolian_simple_parsing) fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int")); fail_if(strcmp(eolian_parameter_name_get(param), "value")); fail_if(strcmp(eolian_parameter_description_get(param), "Value description")); + expr = eolian_parameter_default_value_get(param); + fail_if(!expr); + v = eolian_expression_eval(expr, EOLIAN_MASK_INT); + fail_if(v.type != EOLIAN_EXPR_INT); + fail_if(v.value.i != 100); /* legacy only */ fail_if(!(fid = eolian_class_function_get_by_name(class, "b", EOLIAN_PROPERTY))); @@ -546,6 +551,11 @@ START_TEST(eolian_simple_parsing) fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double")); fail_if(strcmp(eolian_parameter_name_get(param), "c")); fail_if(eolian_parameter_description_get(param)); + expr = eolian_parameter_default_value_get(param); + fail_if(!expr); + v = eolian_expression_eval(expr, EOLIAN_MASK_FLOAT); + fail_if(v.type != EOLIAN_EXPR_DOUBLE); + fail_if(v.value.d != 1337.6); fail_if(eina_iterator_next(iter, &dummy)); eina_iterator_free(iter); From 15281561e5f9e00566418450c1206a5de41fb469 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Tue, 2 Sep 2014 11:42:32 +0100 Subject: [PATCH 05/16] evas textblock: fixed ellipsis character cut off issue with complex markup text. Summary: Evas Textblock ellipsis is handled in a item. When the ellipsis item is added in the text, some characters are cut off considering width of ellipsis character. But, it is handled in only one text item. If there are many short text item, the ellipsis item can be cut off visually. And there was a bug in the patch when text is displayed in two lines or more. The bug is also fixed. Fixes Phab ticket T1213 @fix Test Plan: This commit includes test case. Reviewers: woohyun, seoz, sohyun, tasn, raster Subscribers: cedric, herdsman Differential Revision: https://phab.enlightenment.org/D1360 --- src/lib/evas/canvas/evas_object_textblock.c | 74 +++++++++++++++++---- src/tests/evas/evas_test_textblock.c | 20 ++++++ 2 files changed, 80 insertions(+), 14 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 9cd26b14d5..bbe6bea38b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -4375,7 +4375,7 @@ _layout_ellipsis_item_new(Ctxt *c, const Evas_Object_Textblock_Item *cur_it) static inline void _layout_handle_ellipsis(Ctxt *c, Evas_Object_Textblock_Item *it, Eina_List *i) { - Evas_Object_Textblock_Text_Item *ellip_ti; + Evas_Object_Textblock_Text_Item *ti, *ellip_ti; Evas_Object_Textblock_Item *last_it; Evas_Coord save_cx; int wrap; @@ -4385,26 +4385,72 @@ _layout_handle_ellipsis(Ctxt *c, Evas_Object_Textblock_Item *it, Eina_List *i) save_cx = c->x; c->w -= ellip_ti->parent.w; - if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) + /* If there is no enough space for ellipsis item, remove all of items */ + if (c->w <= 0) { - Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it); - - wrap = _layout_text_cutoff_get(c, last_it->format, ti); - if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap)) - { - _layout_item_text_split_strip_white(c, ti, i, wrap); - } - else if ((wrap == 0) && (c->ln->items)) + while (c->ln->items) { last_it = _ITEM(EINA_INLIST_GET(c->ln->items)->last); + c->ln->items = _ITEM(eina_inlist_remove( + EINA_INLIST_GET(c->ln->items), + EINA_INLIST_GET(last_it))); } - } - else if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) - { - /* We don't want to add this format item. */ last_it = NULL; } + while (last_it) + { + if (last_it->type == EVAS_TEXTBLOCK_ITEM_TEXT) + { + ti = _ITEM_TEXT(last_it); + + wrap = _layout_text_cutoff_get(c, last_it->format, ti); + + if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap)) + { + _layout_item_text_split_strip_white(c, ti, i, wrap); + break; + } + else if (wrap < 0) + { + break; + } + } + else + { + /* We will ignore format items. ex) tab + * But, if there is tag and size is acceptable, we have to insert it to line. */ + if (!strncmp(_ITEM_FORMAT(last_it)->item, "item", 4) && + ((c->w - c->o->style_pad.l - c->o->style_pad.r - c->marginl - c->marginr) >= (c->x + last_it->adv))) + { + break; + } + } + + if (c->ln->items && last_it != it) + { + c->ln->items = _ITEM(eina_inlist_remove( + EINA_INLIST_GET(c->ln->items), + EINA_INLIST_GET(last_it))); + } + + last_it = (c->ln->items) ? _ITEM(EINA_INLIST_GET(c->ln->items)->last) : NULL; + + if (last_it) + { + /* We need to renew ellipsis item. + * Because, base format is changed to last_it. + * We can't reuse it. */ + c->w += ellip_ti->parent.w; + ellip_ti = _layout_ellipsis_item_new(c, last_it); + c->w -= ellip_ti->parent.w; + c->x -= last_it->adv; + if (c->x < 0) + c->x = 0; + save_cx = c->x; + } + } + c->x = save_cx; c->w += ellip_ti->parent.w; /* If we should add this item, do it */ diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index c740be2c7e..3b49eb98f4 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -1763,6 +1763,26 @@ START_TEST(evas_textblock_wrapping) evas_object_textblock_size_formatted_get(tb, &w, &h); ck_assert_int_le(w, (nw / 2)); + evas_object_textblock_text_markup_set(tb, "ababab"); + evas_textblock_cursor_format_prepend(cur, "+ font_size=50 ellipsis=1.0"); + evas_object_textblock_size_native_get(tb, &nw, &nh); + evas_object_resize(tb, nw / 2, nh * 2); + evas_object_textblock_size_formatted_get(tb, &w, &h); + ck_assert_int_le(w, (nw / 2)); + + evas_object_textblock_text_markup_set(tb, ""); + evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0"); + evas_object_resize(tb, 101, 100); + evas_object_textblock_size_formatted_get(tb, &w, &h); + ck_assert_int_le(w, 100); + + evas_object_textblock_text_markup_set(tb, "ab"); + evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0"); + evas_object_textblock_size_native_get(tb, &nw, &nh); + evas_object_resize(tb, nw / 2, nh * 2); + evas_object_textblock_size_formatted_get(tb, &w, &h); + ck_assert_int_le(w, ellip_w); + { double ellip; for(ellip = 0.0; ellip <= 1.0; ellip = ellip + 0.1) From 09a517812f49eb373307841ed960822c92cc56c5 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 2 Sep 2014 12:53:29 +0200 Subject: [PATCH 06/16] autotools: missing cflags for building NEON support. --- src/Makefile_Evas.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 4f0ec0c915..7da7fb8c85 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -395,6 +395,7 @@ lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ @EVAS_CFLAGS@ \ @VALGRIND_CFLAGS@ \ +@NEON_CFLAGS@ \ @ALTIVEC_CFLAGS@ # SSE3 From 231b2f304496cfe873bd8cfb45099abbde4a9602 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 2 Sep 2014 12:39:38 +0100 Subject: [PATCH 07/16] eolian: enum validation fix --- src/lib/eolian/database_validate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 25251cbd71..9ed53878a4 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -17,7 +17,10 @@ static Eina_Bool _ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, const Eolian_Enum_Type_Field *ef, Eina_Bool *success) { - *success = _validate_expr(ef->value, NULL, EOLIAN_MASK_INT); + if (ef->value) + *success = _validate_expr(ef->value, NULL, EOLIAN_MASK_INT); + else + *success = EINA_TRUE; return *success; } From e5ed4b7f043218efc95a5ebdd26b9fa2b24a80fb Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 2 Sep 2014 12:56:54 +0100 Subject: [PATCH 08/16] Ecore exe: Fix ecore_exe_send (on posix). --- src/lib/ecore/ecore_exe_posix.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c index e199ceceba..3938ecf505 100644 --- a/src/lib/ecore/ecore_exe_posix.c +++ b/src/lib/ecore/ecore_exe_posix.c @@ -530,14 +530,26 @@ _impl_ecore_exe_send(Ecore_Exe *obj, const void *data, int size) { - if (exe->close_stdin) - { - ERR("Ecore_Exe %p stdin is closed! Cannot send %d bytes from %p", - exe, size, data); - return EINA_FALSE; - } + void *buf; - return _impl_ecore_exe_send(obj, exe, data, size); + if (exe->child_fd_write == -1) + { + ERR("Ecore_Exe %p created without ECORE_EXE_PIPE_WRITE! " + "Cannot send %d bytes from %p", exe, size, data); + return EINA_FALSE; + } + + buf = realloc(exe->write_data_buf, exe->write_data_size + size); + if (!buf) return EINA_FALSE; + + exe->write_data_buf = buf; + memcpy((char *)exe->write_data_buf + exe->write_data_size, data, size); + exe->write_data_size += size; + + if (exe->write_fd_handler) + ecore_main_fd_handler_active_set(exe->write_fd_handler, ECORE_FD_WRITE); + + return EINA_TRUE; } void From 9ffe700aaca63a8091f704a08b1b013f003f34b6 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 2 Sep 2014 13:06:59 +0100 Subject: [PATCH 09/16] eolian: simplify expr serialize and fix null/bool case --- src/lib/eolian/database_expr_api.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/eolian/database_expr_api.c b/src/lib/eolian/database_expr_api.c index 8c60927d85..186900a812 100644 --- a/src/lib/eolian/database_expr_api.c +++ b/src/lib/eolian/database_expr_api.c @@ -229,19 +229,21 @@ _expr_serialize(const Eolian_Expression *expr, Eina_Strbuf *buf, Eina_Bool outer case EOLIAN_EXPR_DOUBLE: case EOLIAN_EXPR_STRING: case EOLIAN_EXPR_CHAR: - case EOLIAN_EXPR_NULL: - case EOLIAN_EXPR_BOOL: { - Eolian_Value v = eolian_expression_eval(expr, EOLIAN_MASK_ALL); - if (!v.type) - return EINA_FALSE; - const char *x = eolian_expression_value_to_literal(&v); + Eolian_Value *v = (Eolian_Value*)&expr->type; + const char *x = eolian_expression_value_to_literal(v); if (!x) return EINA_FALSE; eina_strbuf_append(buf, x); eina_stringshare_del(x); break; } + case EOLIAN_EXPR_NULL: + eina_strbuf_append(buf, "null"); + break; + case EOLIAN_EXPR_BOOL: + eina_strbuf_append(buf, expr->value.b ? "true" : "false"); + break; case EOLIAN_EXPR_NAME: case EOLIAN_EXPR_ENUM: { From 1a58ad78ab630f35b360a329aff6de410c023952 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 2 Sep 2014 13:23:26 +0100 Subject: [PATCH 10/16] Ecore exe: Mark obj as unused. --- src/lib/ecore/ecore_exe_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c index 3938ecf505..1fd178312b 100644 --- a/src/lib/ecore/ecore_exe_posix.c +++ b/src/lib/ecore/ecore_exe_posix.c @@ -525,7 +525,7 @@ _impl_ecore_exe_eo_base_finalize(Eo *obj, Ecore_Exe_Data *exe) } Eina_Bool -_impl_ecore_exe_send(Ecore_Exe *obj, +_impl_ecore_exe_send(Ecore_Exe *obj EINA_UNUSED, Ecore_Exe_Data *exe, const void *data, int size) From 0998f2af5cfb4ae00402a715e38e099b28c82382 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 2 Sep 2014 13:32:47 +0100 Subject: [PATCH 11/16] eolian: new APIs for expression analysis This adds a few new APIs to retrieve the type of an expression, operators for binary and unary expressions, lhs/rhs for binary expressions, expr for unary expressions and value for other expressions. --- src/lib/eolian/Eolian.h | 126 +++++++++++++++++++++++++++++ src/lib/eolian/database_expr_api.c | 63 +++++++++++++++ src/lib/eolian/eolian_database.h | 38 --------- 3 files changed, 189 insertions(+), 38 deletions(-) diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 40815db4b0..c05e14a37c 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -217,6 +217,44 @@ typedef struct _Eolian_Value Eolian_Value_Union value; } Eolian_Value; +typedef enum +{ + EOLIAN_BINOP_INVALID = -1, + + EOLIAN_BINOP_ADD, /* + int, float */ + EOLIAN_BINOP_SUB, /* - int, float */ + EOLIAN_BINOP_MUL, /* * int, float */ + EOLIAN_BINOP_DIV, /* / int, float */ + EOLIAN_BINOP_MOD, /* % int */ + + EOLIAN_BINOP_EQ, /* == all types */ + EOLIAN_BINOP_NQ, /* != all types */ + EOLIAN_BINOP_GT, /* > int, float */ + EOLIAN_BINOP_LT, /* < int, float */ + EOLIAN_BINOP_GE, /* >= int, float */ + EOLIAN_BINOP_LE, /* <= int, float */ + + EOLIAN_BINOP_AND, /* && all types */ + EOLIAN_BINOP_OR, /* || all types */ + + EOLIAN_BINOP_BAND, /* & int */ + EOLIAN_BINOP_BOR, /* | int */ + EOLIAN_BINOP_BXOR, /* ^ int */ + EOLIAN_BINOP_LSH, /* << int */ + EOLIAN_BINOP_RSH /* >> int */ +} Eolian_Binary_Operator; + +typedef enum +{ + EOLIAN_UNOP_INVALID = -1, + + EOLIAN_UNOP_UNM, /* - sint */ + EOLIAN_UNOP_UNP, /* + sint */ + + EOLIAN_UNOP_NOT, /* ! int, float, bool */ + EOLIAN_UNOP_BNOT, /* ~ int */ +} Eolian_Unary_Operator; + /* * @brief Parse a given .eo file and fill the database. * @@ -1540,6 +1578,94 @@ EAPI Eina_Stringshare *eolian_expression_value_to_literal(const Eolian_Value *v) */ EAPI Eina_Stringshare *eolian_expression_serialize(const Eolian_Expression *expr); +/* + * @brief Get the type of an expression. + * + * @param[in] expr the expression. + * @return the expression type. + * + * @ingroup Eolian + */ +EAPI Eolian_Expression_Type eolian_expression_type_get(const Eolian_Expression *expr); + +/* + * @brief Get the binary operator of an expression. + * + * @param[in] expr the expression. + * @return the binary operator, EOLIAN_BINOP_INVALID on failure. + * + * This only works on binary expressions, otherwise it returns + * EOLIAN_BINOP_INVALID. + * + * @ingroup Eolian + */ +EAPI Eolian_Binary_Operator eolian_expression_binary_operator_get(const Eolian_Expression *expr); + +/* + * @brief Get the lhs (left hand side) of a binary expression. + * + * @param[in] expr the expression. + * @return the expression or NULL. + * + * This only works on binary expressions, otherwise it returns NULL. + * + * @ingroup Eolian + */ +EAPI const Eolian_Expression *eolian_expression_binary_lhs_get(const Eolian_Expression *expr); + +/* + * @brief Get the rhs (right hand side) of a binary expression. + * + * @param[in] expr the expression. + * @return the expression or NULL. + * + * This only works on binary expressions, otherwise it returns NULL. + * + * @ingroup Eolian + */ +EAPI const Eolian_Expression *eolian_expression_binary_rhs_get(const Eolian_Expression *expr); + +/* + * @brief Get the unary operator of an expression. + * + * @param[in] expr the expression. + * @return the unary operator, EOLIAN_UNOP_INVALID on failure. + * + * This only works on unary expressions, otherwise it returns + * EOLIAN_UNOP_INVALID. + * + * @ingroup Eolian + */ +EAPI Eolian_Unary_Operator eolian_expression_unary_operator_get(const Eolian_Expression *expr); + +/* + * @brief Get the expression of an unary expression. + * + * @param[in] expr the expression. + * @return the expression or NULL. + * + * This only works on unary expressions, otherwise it returns NULL. + * + * @ingroup Eolian + */ +EAPI const Eolian_Expression *eolian_expression_unary_expression_get(const Eolian_Expression *expr); + +/* + * @brief Get the value of an expression. + * + * @param[in] expr the expression. + * @return the value. + * + * Keep in mind that this doesn't evaluate anything. That's why it only works + * on expressions that actually hold values (not unknown, not binary, not + * unary). For some types of expressions (enum, name), this stores the actual + * name (in the value.s field). Resources for this are held by the database. + * Don't attempt to free the string or anything like that. + * + * @ingroup Eolian + */ +EAPI Eolian_Value eolian_expression_value_get(const Eolian_Expression *expr); + /* * @brief Get a global variable by name. Supports namespaces. * diff --git a/src/lib/eolian/database_expr_api.c b/src/lib/eolian/database_expr_api.c index 186900a812..54a8d7f711 100644 --- a/src/lib/eolian/database_expr_api.c +++ b/src/lib/eolian/database_expr_api.c @@ -285,3 +285,66 @@ eolian_expression_serialize(const Eolian_Expression *expr) eina_strbuf_free(buf); return ret; } + +EAPI Eolian_Expression_Type +eolian_expression_type_get(const Eolian_Expression *expr) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(expr, EOLIAN_EXPR_UNKNOWN); + return expr->type; +} + +EAPI Eolian_Binary_Operator +eolian_expression_binary_operator_get(const Eolian_Expression *expr) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(expr, EOLIAN_BINOP_INVALID); + EINA_SAFETY_ON_FALSE_RETURN_VAL(expr->type == EOLIAN_EXPR_BINARY, + EOLIAN_BINOP_INVALID); + return expr->binop; +} + +EAPI const Eolian_Expression * +eolian_expression_binary_lhs_get(const Eolian_Expression *expr) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(expr, NULL); + EINA_SAFETY_ON_FALSE_RETURN_VAL(expr->type == EOLIAN_EXPR_BINARY, NULL); + return expr->lhs; +} + +EAPI const Eolian_Expression * +eolian_expression_binary_rhs_get(const Eolian_Expression *expr) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(expr, NULL); + EINA_SAFETY_ON_FALSE_RETURN_VAL(expr->type == EOLIAN_EXPR_BINARY, NULL); + return expr->rhs; +} + +EAPI Eolian_Unary_Operator +eolian_expression_unary_operator_get(const Eolian_Expression *expr) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(expr, EOLIAN_UNOP_INVALID); + EINA_SAFETY_ON_FALSE_RETURN_VAL(expr->type == EOLIAN_EXPR_UNARY, + EOLIAN_UNOP_INVALID); + return expr->unop; +} + +EAPI const Eolian_Expression * +eolian_expression_unary_expression_get(const Eolian_Expression *expr) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(expr, NULL); + EINA_SAFETY_ON_FALSE_RETURN_VAL(expr->type == EOLIAN_EXPR_UNARY, NULL); + return expr->expr; +} + +EAPI Eolian_Value +eolian_expression_value_get(const Eolian_Expression *expr) +{ + Eolian_Value v; + v.type = EOLIAN_EXPR_UNKNOWN; + EINA_SAFETY_ON_NULL_RETURN_VAL(expr, v); + EINA_SAFETY_ON_FALSE_RETURN_VAL(expr->type != EOLIAN_EXPR_UNKNOWN + && expr->type != EOLIAN_EXPR_BINARY + && expr->type != EOLIAN_EXPR_UNARY, v); + v.type = expr->type; + v.value = expr->value; + return v; +} diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index 01da332cf7..46276b3988 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -201,44 +201,6 @@ struct _Eolian_Enum_Type_Field Eina_Stringshare *comment; }; -typedef enum -{ - EOLIAN_BINOP_INVALID = -1, - - EOLIAN_BINOP_ADD, /* + int, float */ - EOLIAN_BINOP_SUB, /* - int, float */ - EOLIAN_BINOP_MUL, /* * int, float */ - EOLIAN_BINOP_DIV, /* / int, float */ - EOLIAN_BINOP_MOD, /* % int */ - - EOLIAN_BINOP_EQ, /* == all types */ - EOLIAN_BINOP_NQ, /* != all types */ - EOLIAN_BINOP_GT, /* > int, float */ - EOLIAN_BINOP_LT, /* < int, float */ - EOLIAN_BINOP_GE, /* >= int, float */ - EOLIAN_BINOP_LE, /* <= int, float */ - - EOLIAN_BINOP_AND, /* && all types */ - EOLIAN_BINOP_OR, /* || all types */ - - EOLIAN_BINOP_BAND, /* & int */ - EOLIAN_BINOP_BOR, /* | int */ - EOLIAN_BINOP_BXOR, /* ^ int */ - EOLIAN_BINOP_LSH, /* << int */ - EOLIAN_BINOP_RSH /* >> int */ -} Eolian_Binary_Operator; - -typedef enum -{ - EOLIAN_UNOP_INVALID = -1, - - EOLIAN_UNOP_UNM, /* - sint */ - EOLIAN_UNOP_UNP, /* + sint */ - - EOLIAN_UNOP_NOT, /* ! int, float, bool */ - EOLIAN_UNOP_BNOT, /* ~ int */ -} Eolian_Unary_Operator; - struct _Eolian_Expression { Eolian_Object base; From c0701f38a0b77f93c0c042e27cba73b8d4fd6d6e Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 2 Sep 2014 15:32:53 +0200 Subject: [PATCH 12/16] evas: forgotten evas canvas event EVAS_CANVAS_EVENT_DEVICE_CHANGED. --- src/lib/evas/Evas_Eo.h | 2 ++ src/lib/evas/canvas/evas_callbacks.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index a807e0a963..ce629c214e 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -10,6 +10,7 @@ EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_OBJECT_FOCUS_IN; EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_OBJECT_FOCUS_OUT; EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_PRE; EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_POST; +EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_DEVICE_CHANGED; // Callbacks events for use with Evas canvases #define EVAS_CANVAS_EVENT_FOCUS_IN (&(_EVAS_CANVAS_EVENT_FOCUS_IN)) @@ -20,6 +21,7 @@ EAPI extern const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_POST; #define EVAS_CANVAS_EVENT_OBJECT_FOCUS_OUT (&(_EVAS_CANVAS_EVENT_OBJECT_FOCUS_OUT)) #define EVAS_CANVAS_EVENT_RENDER_PRE (&(_EVAS_CANVAS_EVENT_RENDER_PRE)) #define EVAS_CANVAS_EVENT_RENDER_POST (&(_EVAS_CANVAS_EVENT_RENDER_POST)) +#define EVAS_CANVAS_EVENT_DEVICE_CHANGED (&(_EVAS_CANVAS_EVENT_DEVICE_CHANGED)) #include "canvas/evas_signal_interface.eo.h" #include "canvas/evas_draggable_interface.eo.h" diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index 4beac93d58..d22f6fafbf 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c @@ -25,6 +25,9 @@ EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_OBJECT_FOCUS_IN = EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_OBJECT_FOCUS_OUT = EO_HOT_EVENT_DESCRIPTION("Canvas Object Focus Out", "Canvas object lost focus"); +EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_DEVICE_CHANGED = + EO_HOT_EVENT_DESCRIPTION("Device changed", + "Devices added, removed or changed to the canvas"); /** * Evas events descriptions for Eo. */ @@ -63,6 +66,7 @@ static const Eo_Event_Description *_legacy_evas_callback_table[EVAS_CALLBACK_LAS EVAS_CANVAS_EVENT_RENDER_PRE, EVAS_CANVAS_EVENT_RENDER_POST, EVAS_OBJECT_EVENT_IMAGE_RESIZE, + EVAS_CANVAS_EVENT_DEVICE_CHANGED, NULL }; From 5bac48a79dbedb961358a3806517a00abb6d5550 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 2 Sep 2014 16:03:45 +0200 Subject: [PATCH 13/16] evas: actually just define the right number of events. --- src/lib/evas/canvas/evas_callbacks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index d22f6fafbf..a1b82314c3 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c @@ -66,8 +66,7 @@ static const Eo_Event_Description *_legacy_evas_callback_table[EVAS_CALLBACK_LAS EVAS_CANVAS_EVENT_RENDER_PRE, EVAS_CANVAS_EVENT_RENDER_POST, EVAS_OBJECT_EVENT_IMAGE_RESIZE, - EVAS_CANVAS_EVENT_DEVICE_CHANGED, - NULL + EVAS_CANVAS_EVENT_DEVICE_CHANGED }; typedef struct From ddeb306d02640aa21597449c2b3cd4e398b40147 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 2 Sep 2014 15:40:20 +0100 Subject: [PATCH 14/16] Updated gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9ba26f070d..04d2a24fc3 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,4 @@ tags /config.rpath /coverage /src/lib/ecore_x/ecore_x_vsync +Session.vim From 82b2ed7a40d1d07426f0c62287e3372cdfa27441 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 2 Sep 2014 17:10:47 +0200 Subject: [PATCH 15/16] examples: Add latest example binaries to .gitignore These are build and should be ignored by git. --- src/examples/ecore/.gitignore | 1 + src/examples/evas/.gitignore | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/examples/ecore/.gitignore b/src/examples/ecore/.gitignore index d77145eaf5..497f0f3598 100644 --- a/src/examples/ecore/.gitignore +++ b/src/examples/ecore/.gitignore @@ -38,3 +38,4 @@ /ecore_imf_example /ecore_pipe_gstreamer_example /ecore_getopt_example +/ecore_compose_get_example diff --git a/src/examples/evas/.gitignore b/src/examples/evas/.gitignore index 063c750973..518039b230 100644 --- a/src/examples/evas/.gitignore +++ b/src/examples/evas/.gitignore @@ -26,3 +26,7 @@ /evas_3d_frustum /evas_3d_moon_space /evas_3d_obj +/evas_3d_cube_rotate +/evas_3d_shooter +/evas_gl +/evas_transparent From 3f468537fd38a3d8f6e59521a485fde38ebc1b6e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 2 Sep 2014 15:16:40 -0400 Subject: [PATCH 16/16] edje_cc now throws an error during link combination when the current part has no name @fix --- src/bin/edje/edje_cc_handlers.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index afaaf73fdb..41331ca0a8 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -2845,6 +2845,11 @@ _link_combine(void) eina_list_move_list(&combine, (Eina_List**)&tup->data, l); } current_program = el->pr; + if (!el->epp->common.name) + { + ERR("A part without a name was detected."); + exit(-1); + } _program_target_add(strdup(el->epp->common.name)); EINA_LIST_FREE(combine, ell) {