discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6b712f6f02934f013ee54083653cc5d78884486d

commit 6b712f6f02934f013ee54083653cc5d78884486d
Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Mar 24 15:09:16 2014 -0400

    edje_cc now supports the group.inherit_only attribute
    
    use this for flagging a group as a "virtual" group which is only used for 
inheriting
    
    @feature
---
 src/bin/edje/edje_cc.h          |  1 +
 src/bin/edje/edje_cc_handlers.c | 29 ++++++++++++++++++++++++++++-
 src/bin/edje/edje_cc_out.c      |  7 ++++---
 3 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index f9f362b..16cd81e 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -144,6 +144,7 @@ struct _Edje_Part_Collection_Parser
 {
    Edje_Part_Collection common;
    Eina_Bool default_mouse_events;
+   Eina_Bool inherit_only;
 };
 
 /* global fn calls */
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 0b865a8..053a4b7 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -144,7 +144,7 @@ static Edje_Part_Description_Common *current_desc = NULL;
 static Edje_Part_Description_Common *parent_desc = NULL;
 static Edje_Program *current_program = NULL;
 static Eina_List *current_program_lookups = NULL;
-static Eina_Bool current_group_inherit = EINA_FALSE;
+Eina_Bool current_group_inherit = EINA_FALSE;
 static Edje_Program *sequencing = NULL;
 static Eina_List *sequencing_lookups = NULL;
 
@@ -198,6 +198,7 @@ static void ob_collections(void);
 
 static void ob_collections_group(void);
 static void st_collections_group_name(void);
+static void st_collections_group_inherit_only(void);
 static void st_collections_group_inherit(void);
 static void st_collections_group_part_remove(void);
 static void st_collections_group_program_remove(void);
@@ -513,6 +514,7 @@ New_Statement_Handler statement_handlers[] =
      {"collections.group.vibrations.sample.source", 
st_collections_group_vibration_sample_source}, /* dup */
      {"collections.group.name", st_collections_group_name},
      {"collections.group.inherit", st_collections_group_inherit},
+     {"collections.group.inherit_only", st_collections_group_inherit_only},
      {"collections.group.part_remove", st_collections_group_part_remove},
      {"collections.group.program_remove", st_collections_group_program_remove},
      {"collections.group.script_only", st_collections_group_script_only},
@@ -3032,6 +3034,31 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2)
 /**
     @page edcref
     @property
+        inherit_only
+    @parameters
+        1 or 0
+    @effect
+        This flags a group as being used only for inheriting, which
+        will inhibit edje_cc resolving of programs and parts that may
+        not exist in this group, but are located in the group which is 
inheriting
+        this group.
+    @endproperty
+    @since 1.10
+*/
+static void
+st_collections_group_inherit_only(void)
+{
+   Edje_Part_Collection_Parser *pcp;
+
+   check_arg_count(1);
+
+   pcp = eina_list_data_get(eina_list_last(edje_collections));
+   pcp->inherit_only = parse_bool(0);
+}
+
+/**
+    @page edcref
+    @property
         inherit
     @parameters
         [parent group name]
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 21a435f..68bbe17 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -2176,7 +2176,6 @@ data_queue_part_lookup(Edje_Part_Collection *pc, const 
char *name, int *dest)
    Part_Lookup_Key key;
    Part_Lookup *pl = NULL;
    Eina_List *list;
-
    key.pc = pc;
    key.mem.dest = dest;
    key.stable = EINA_TRUE;
@@ -2221,7 +2220,6 @@ data_queue_part_reallocated_lookup(Edje_Part_Collection 
*pc, const char *name,
    Part_Lookup_Key key;
    Part_Lookup *pl = NULL;
    Eina_List *list;
-
    key.pc = pc;
    key.mem.reallocated.base = base;
    key.mem.reallocated.offset = offset;
@@ -2370,6 +2368,9 @@ void *
 data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int 
*dest)
 {
    Program_Lookup *pl;
+   Edje_Part_Collection_Parser *pcp = (Edje_Part_Collection_Parser *)pc;
+
+   if (pcp->inherit_only && (!current_group_inherit)) return NULL;
 
    if (!name) return NULL; /* FIXME: should we stop compiling ? */
 
@@ -2691,7 +2692,7 @@ data_process_lookups(void)
                     }
                }
 
-             if (i == part->key.pc->parts_count)
+             if ((i == part->key.pc->parts_count) && 
(!((Edje_Part_Collection_Parser*)part->key.pc)->inherit_only))
                {
                   ERR("Unable to find part name \"%s\" needed in group '%s'.",
                       alias, part->key.pc->part);

-- 


Reply via email to