Re: [E-devel] edje: emit signal to 'GROUP' part

2009-05-02 Thread pieterg
On Saturday 02 May 2009 16:42:33 Gustavo Sverzut Barbieri wrote:
 On Fri, May 1, 2009 at 4:30 PM, pieterg piet...@gmx.com wrote:
  How can I emit a signal to a 'type: GROUP' part, to be received by a
  program in that group?

 A solution that could help is to create an embryo variant for emit(),
 like emit_group() that would take the PART:id and do the work, this is
 actually easy to do and you can try.

That sounds like a usable workaround. I'll have a look and see if I can 
implement that.

Rgds, Pieter

--
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


Re: [E-devel] edje: emit signal to 'GROUP' part

2009-05-02 Thread pieterg
On Saturday 02 May 2009 16:42:33 Gustavo Sverzut Barbieri wrote:
 A solution that could help is to create an embryo variant for emit(),
 like emit_group() that would take the PART:id and do the work, this is
 actually easy to do and you can try.

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.

Constructions such as

script {
 emit(languageselection:languages_fade_in, );
}

and 

action: SIGNAL_EMIT languageselection:languages_fade_in ;

are possible with this.
And it slightly follows the

source: groupname:partname

convention, which we already have.

--
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


Re: [E-devel] edje: emit signal to 'GROUP' part

2009-05-02 Thread pieterg
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?
Index: edje/src/lib/edje_program.c
===
--- edje/src/lib/edje_program.c	(revision 40487)
+++ edje/src/lib/edje_program.c	(working copy)
@@ -816,6 +816,40 @@
Evas_Object *obj;

if (ed-delete_me) return;
+
+   if (strchr(sig, ':'))
+ {
+   /* the signal contains a colon, split the signal into group:signal, and deliver it to group */
+   int i;
+   char *splitsig = strdup(sig);
+   char *group = splitsig;
+   char *colon = strchr(splitsig, ':');
+   char *newsig;
+   if (colon)
+ {
+*colon = '\0';
+newsig = colon + 1;
+for (i = 0; i  ed-table_parts_size; i++)
+  {
+ Edje_Real_Part *rp;
+ rp = ed-table_parts[i];
+ if (rp-part-type == EDJE_PART_TYPE_GROUP
+  rp-swallowed_object
+  rp-part
+  rp-part-source
+  !strcmp(rp-part-source, group))
+   {
+  Edje *ed2 = _edje_fetch(rp-swallowed_object);
+  if (ed2) _edje_emit(ed2, newsig, src);
+  free(splitsig);
+  return;
+   }
+  }
+ }
+   /* we have no group by that name, continue delivering the signal to our own group */
+   free(splitsig);
+ }
+
emsg.sig = sig;
emsg.src = src;
_edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, emsg);
--
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


Re: [E-devel] edje: emit signal to 'GROUP' part

2009-05-02 Thread pieterg
On Saturday 02 May 2009 22:08:27 Gustavo Sverzut Barbieri wrote:
 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.

Indeed, I was in doubt about whether to use the part name or the source 
name, changed it to the source name the last minute. But in order to allow 
the same group to be swallowed several times, we need to use the part name, 
as you say.

Thanks for committing this.

--
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


[E-devel] edje: emit signal to 'GROUP' part

2009-05-01 Thread pieterg
I'm relatively new to edje, been picking most things up rather quickly.
There's one thing I would like to accomplish, but haven't managed yet:

How can I emit a signal to a 'type: GROUP' part, to be received by a program 
in that group?
The other way around is easy, a signal from source groupname:partname is 
received just fine. But edje_cc doesn't allow me to use 
the groupname:partname convention in a target, or as a program name. And 
I assume that this isn't just a limitation of edje_cc.

My experience is that edje data collections will grow quickly, and it will 
become more and more difficult to keep track of the whole thing, as it 
grows.
Putting different screens and even certain parts of windows into separate 
subgroups really helps to keep things tidy.
But these groups need to communicate with eachother.

A possible workaround is emitting a signal to the application code, and 
letting the application emit the signal to the (sub)group.
I'm doing that now, so I can at least get the desired functionality.

But that's not very nice, especially when those signals are not meant for 
the application to act upon, just for graphical effects in the 
userinterface.
Changing the userinterface would mean changing the application, to 
accomodate all new signal connections between the various parts.
Note that I don't just mean changing a theme, my goal is to have a 
userinterface which controls not just the way things look, but also the way 
things work, which steps the user has to take, and in which order.

Another possible way around this is not to use seperate groups for the 
different windows / window regions, so every component can signal every 
other component in the same large group (and perhaps just put different 
building blocks into different files, to keep a bit of overview)

So my question, again, is it possible to interact with a subgroup? Emit a 
signal to it, or perhaps run a subgroup program directly?
If not, what would be the prefered way to structure large edc's?

Rgds, Pieter

--
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