Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/bin


Modified Files:
        edje_cc_handlers.c 


Log Message:
Add GROUP Parts to edje.

These can be used to automatically swallow in another group from the same file.

Parts within child groups can be referred to by a ':' separated 'full path' of
part names. Any API functions that take a part name will now accept a full path
also.

Signals emitted by child objects will be repeated up to the parents with the
source changed to be the path relative to the receiving object.  E.g in the
example below, a mouse moving over the lower light green rectangle would result
in the parent object recieving a "mouse,move" signal with source "bot:inner".

**** NEW RESTRICTION ****  part names should no longer include a ':' character.
This is not yet enforced by edje_cc, but will cause the part to be inaccessible
from the API.

Example EDC:

collections {
  group {
    name: "parent";
    parts {
      part {
        name: "top";
        type: GROUP;
        source: "child";
        description {
          state: "default" 0.0;
          rel2.relative: 1 0.5;
        }
      }
      part {
        name: "bot";
        type: GROUP;
        source: "child";
        description {
          state: "default" 0.0;
          rel1.relative: 0 0.5;
        }
      }
    }
  }
  group {
    name: "child";
    parts {
      part {
        name: "base";
        type: RECT;
        description {
          state: "default" 0.0;
          color: 160 208 8 255;
        }
      }
      part {
        name: "inner";
        type: RECT;
        description {
          state: "default" 0.0;
          rel1.offset: 10 10;
          rel2.offset: -11 -11;
          color: 210 228 76 255;
        }
      }
    }
  }
}

===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_cc_handlers.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- edje_cc_handlers.c  31 Mar 2007 10:53:22 -0000      1.72
+++ edje_cc_handlers.c  27 May 2007 05:28:07 -0000      1.73
@@ -45,6 +45,7 @@
 static void st_collections_group_parts_part_repeat_events(void);
 static void st_collections_group_parts_part_use_alternate_font_metrics(void);
 static void st_collections_group_parts_part_clip_to_id(void);
+static void st_collections_group_parts_part_source(void);
 static void st_collections_group_parts_part_dragable_x(void);
 static void st_collections_group_parts_part_dragable_y(void);
 static void st_collections_group_parts_part_dragable_confine(void);
@@ -179,6 +180,7 @@
      {"collections.group.parts.part.repeat_events", 
st_collections_group_parts_part_repeat_events},
      {"collections.group.parts.part.use_alternate_font_metrics", 
st_collections_group_parts_part_use_alternate_font_metrics},
      {"collections.group.parts.part.clip_to", 
st_collections_group_parts_part_clip_to_id},
+     {"collections.group.parts.part.source", 
st_collections_group_parts_part_source},
      {"collections.group.parts.part.dragable.x", 
st_collections_group_parts_part_dragable_x},
      {"collections.group.parts.part.dragable.y", 
st_collections_group_parts_part_dragable_y},
      {"collections.group.parts.part.dragable.confine", 
st_collections_group_parts_part_dragable_confine},
@@ -949,6 +951,7 @@
                         "SWALLOW", EDJE_PART_TYPE_SWALLOW,
                         "TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK,
                         "GRADIENT", EDJE_PART_TYPE_GRADIENT,
+                        "GROUP", EDJE_PART_TYPE_GROUP,
                         NULL);
 }
 
@@ -1008,6 +1011,29 @@
        data_queue_part_lookup(pc, name, &(ep->clip_to_id));
        free(name);
      }
+}
+
+static void
+st_collections_group_parts_part_source(void)
+{
+   Edje_Part_Collection *pc;
+   Edje_Part *ep;
+
+   check_arg_count(1);
+   
+   pc = evas_list_data(evas_list_last(edje_collections));
+   ep = evas_list_data(evas_list_last(pc->parts));
+
+   if (ep->type != EDJE_PART_TYPE_GROUP)
+     {
+       fprintf(stderr, "%s: Error. parse error %s:%i. "
+               "source attribute in non-GROUP part.\n",
+               progname, file_in, line - 1);
+       exit(-1);
+     }
+
+   //XXX validate this somehow (need to decide on the format also)
+   ep->source = parse_str(0);
 }
 
 static void



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to