aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-05 17:06:21 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-05 17:07:26 +0200
commit653fddfc1e17e1290ddd5881150ada3738782d4e (patch)
tree4e225d58575d068fbbc89fb58c470d0f66d2c10d
parentefl_ui_navigation_bar: remove Efl.Content implemention (diff)
downloadefl-653fddfc1e17e1290ddd5881150ada3738782d4e.tar.gz
eolian: add support for marking and checking parts as beta
-rw-r--r--src/lib/elementary/efl_ui_widget.eo4
-rw-r--r--src/lib/eolian/Eolian.h13
-rw-r--r--src/lib/eolian/database_validate.c13
-rw-r--r--src/lib/eolian/eo_parser.c5
-rw-r--r--src/tests/eolian/data/parts.eo2
-rw-r--r--src/tests/eolian/eolian_parsing.c3
6 files changed, 35 insertions, 5 deletions
diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo
index 05ef4b3b7f..40e51aed92 100644
--- a/src/lib/elementary/efl_ui_widget.eo
+++ b/src/lib/elementary/efl_ui_widget.eo
@@ -400,8 +400,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
}
}
parts {
- shadow: Efl.Ui.Widget_Part_Shadow;
- background: Efl.Ui.Widget_Part_Bg;
+ shadow @beta: Efl.Ui.Widget_Part_Shadow;
+ background @beta: Efl.Ui.Widget_Part_Bg;
}
implements {
class.constructor;
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 72018e7f83..748edb9be6 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2218,6 +2218,19 @@ EAPI const Eolian_Class *eolian_part_class_get(const Eolian_Part *part);
EAPI const Eolian_Documentation *eolian_part_documentation_get(const Eolian_Part *part);
/*
+ * @brief Get whether a part is beta.
+ *
+ * @see eolian_object_is_beta
+ *
+ * @ingroup Eolian
+ */
+static inline Eina_Bool
+eolian_part_is_beta(const Eolian_Part *part)
+{
+ return eolian_object_is_beta(EOLIAN_OBJECT(part));
+}
+
+/*
* @brief Get an event in a class by its name
*
* @param[in] klass the class
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 285d19a692..cc1ad5ad7c 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -480,8 +480,10 @@ _validate_part(Validate_State *vals, Eolian_Part *part, Eina_Hash *nhash)
return EINA_TRUE;
}
+ Eina_Bool was_stable = _set_stable(vals, !part->base.is_beta && vals->stable);
+
if (!_validate_doc(part->doc))
- return EINA_FALSE;
+ return _reset_stable(vals, was_stable, EINA_FALSE);
/* switch the class name for class */
Eolian_Class *pcl = eina_hash_find(part->base.unit->classes, part->klass_name);
@@ -489,7 +491,13 @@ _validate_part(Validate_State *vals, Eolian_Part *part, Eina_Hash *nhash)
{
_eo_parser_log(&part->base, "unknown part class '%s' (incorrect case?)",
part->klass_name);
- return EINA_FALSE;
+ return _reset_stable(vals, was_stable, EINA_FALSE);
+ }
+ else if (vals->stable && pcl->base.is_beta)
+ {
+ _eo_parser_log(&part->base, "beta part class '%s' used in stable context",
+ pcl->base.name);
+ return _reset_stable(vals, was_stable, EINA_FALSE);
}
eina_stringshare_del(part->klass_name);
part->klass = pcl;
@@ -497,6 +505,7 @@ _validate_part(Validate_State *vals, Eolian_Part *part, Eina_Hash *nhash)
if (!oobj)
eina_hash_add(nhash, &part->base.name, &part->base);
+ _reset_stable(vals, was_stable, EINA_TRUE);
return _validate(&part->base);
}
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index f0b631ca4a..ebf3b1c038 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -1406,6 +1406,11 @@ parse_part(Eo_Lexer *ls)
check(ls, TOK_VALUE);
part->base.name = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
+ if (ls->t.kw == KW_at_beta)
+ {
+ part->base.is_beta = EINA_TRUE;
+ eo_lexer_get(ls);
+ }
check_next(ls, ':');
Eina_Strbuf *buf = eina_strbuf_new();
eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf);
diff --git a/src/tests/eolian/data/parts.eo b/src/tests/eolian/data/parts.eo
index e7062f543b..7f925afbac 100644
--- a/src/tests/eolian/data/parts.eo
+++ b/src/tests/eolian/data/parts.eo
@@ -1,6 +1,6 @@
class Parts extends Override {
parts {
part1: Override; [[Part 1]]
- part2: Parts; [[Part 2]]
+ part2 @beta: Parts; [[Part 2]]
}
}
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index cf8fcf4d63..a581f9409f 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1529,6 +1529,9 @@ EFL_START_TEST(eolian_parts)
fail_if(!(klass = eolian_part_class_get(part)));
ck_assert_str_eq(part_classes[i], eolian_class_short_name_get(klass));
+
+ fail_if(eolian_part_is_beta(part) && (i == 0));
+
i++;
}
eina_iterator_free(iter);