On Sat, May 2, 2009 at 4:15 PM, pieterg <piet...@gmx.com> wrote:
> On Saturday 02 May 2009 19:26:00 Gustavo Sverzut Barbieri wrote:
>> On Sat, May 2, 2009 at 1:28 PM, pieterg <piet...@gmx.com> wrote:
>> > How about if we allow the use of "group:signal" as signal name?
>> > I've implemented this as a test, and it works like expected.
>>
>> I don't know if it would break things, possibly you better do check if
>> there is a part with that id and it is GROUP in order to avoid
>> breaking existing apps that may use ":" in the name.
>
> OK, good point. So something like this perhaps?

mostly. I liked your patch, but committed a slightly different version
that does only one strchr() and uses strdupa() instead of strdup() as
strings live for short time and are rather small.

I also changed it to use the part name, not the source name as usually
you can have more than one part using the same group/source. See
attached example.

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
collections {
   group {
      name: "inner";
      parts {
         part {
            name: "part";
            type: RECT;
            mouse_events: 0;
            description {
               state: "default" 0.0;
               color: 255 255 255 255;
               rel1 {
                  relative: 0.0 0.0;
                  offset: 0 0;
               }
               rel2 {
                  relative: 1.0 1.0;
                  offset: -1 -1;
               }
            }
            description {
               state: "state" 0.0;
               inherit: "default" 0.0;
               color: 255 0 0 255;
            }
         }

         programs {
            program {
               name: "prog";
               signal: "sig";
               source: "src";
               action: STATE_SET "state" 0.0;
               target: "part";
            }
         }
      }
   }

   group {
      name: "main";
      parts {
         part {
            name: "bg";
            type: RECT;
            mouse_events: 0;
            description {
               state: "default" 0.0;
               color: 0 0 0 255;
               rel1 {
                  relative: 0.0 0.0;
                  offset: 0 0;
               }
               rel2 {
                  relative: 1.0 1.0;
                  offset: -1 -1;
               }
            }
         }

         part {
            name: "a";
            type: GROUP;
            source: "inner";
            mouse_events: 0;
            description {
               state: "default" 0.0;
               rel1 {
                  relative: 0.0 0.0;
                  offset: 0 0;
               }
               rel2 {
                  relative: 0.5 0.5;
                  offset: -1 -1;
               }
            }
         }

         part {
            name: "b";
            type: GROUP;
            source: "inner";
            mouse_events: 0;
            description {
               state: "default" 0.0;
               rel1 {
                  relative: 0.5 0.0;
                  offset: 0 0;
               }
               rel2 {
                  relative: 1.0 0.5;
                  offset: -1 -1;
               }
            }
         }

         part {
            name: "event_a";
            type: RECT;
            mouse_events: 1;
            description {
               state: "default" 0.0;
               color: 255 255 0 255;
               rel1 {
                  relative: 0.0 0.5;
                  offset: 0 0;
               }
               rel2 {
                  relative: 0.5 1.0;
                  offset: -1 -1;
               }
            }
         }

         part {
            name: "event_b";
            type: RECT;
            mouse_events: 1;
            description {
               state: "default" 0.0;
               color: 255 0 255 255;
               rel1 {
                  relative: 0.5 0.5;
                  offset: 0 0;
               }
               rel2 {
                  relative: 1.0 1.0;
                  offset: -1 -1;
               }
            }
         }

         programs {
            program {
               name: "pa";
               signal: "mouse,clicked,1";
               source: "event_a";
               action: SIGNAL_EMIT "a:sig" "src";
            }

            program {
               name: "pb";
               signal: "mouse,clicked,1";
               source: "event_b";
               action: SIGNAL_EMIT "b:sig" "src";
            }
         }
      }
   }
}
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to