bdilly pushed a commit to branch master.

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

commit b251e1a4ac5ddc73c085064431982f6baa909443
Author: Bruno Dilly <[email protected]>
Date:   Wed Feb 1 17:14:39 2017 -0200

    edje: change seat signals
    
    Use seat names as prefix, not as suffix, following
    a top-down approach and avoiding issues
    with applications that may be receiving
    doubled signals (legacy + suffixed).
    
    So instead of "mouse,in,seat1" signal will be
    "seat,seat1,mouse,in".
---
 src/examples/edje/dynamic_multiseat.edc      |  9 ++--
 src/examples/edje/multiseat.edc              | 64 ++++++++++++++--------------
 src/examples/edje/multiseat_custom_names.edc |  8 ++--
 src/examples/edje/multiseat_filter.edc       | 34 +++++++++------
 src/lib/edje/edje_program.c                  |  4 +-
 5 files changed, 65 insertions(+), 54 deletions(-)

diff --git a/src/examples/edje/dynamic_multiseat.edc 
b/src/examples/edje/dynamic_multiseat.edc
index d512f03..eacdcb5 100644
--- a/src/examples/edje/dynamic_multiseat.edc
+++ b/src/examples/edje/dynamic_multiseat.edc
@@ -244,7 +244,8 @@ collections {
 
                strncpy(seat_name, sig[strlen("seat,added,")],
                        strchr(sig[strlen("seat,added,")], ","));
-               snprintf(buf, 128, "seat,color,%s,r=%i,g=%i,b=%i", seat_name,
+               snprintf(buf, sizeof(buf),
+                        "seat,color,%s,r=%i,g=%i,b=%i", seat_name,
                         r, g, b);
                emit(buf, "theme");
             }
@@ -252,12 +253,12 @@ collections {
 
          program {
             name: "button,in";
-            signal: "mouse,in,*";
+            signal: "seat,*,mouse,in";
             source: "button_bg,*";
             script {
                new idx, r, g, b;
 
-               idx = atoi(sig[strlen("mouse,in,seat")]) - 1;
+               idx = atoi(sig[strlen("seat,seat")]) - 1;
                r = fetch_int(red, idx);
                g = fetch_int(green, idx);
                b = fetch_int(blue, idx);
@@ -268,7 +269,7 @@ collections {
 
          program {
             name: "button,out";
-            signal: "mouse,out,*";
+            signal: "seat,*,mouse,out";
             source: "button_bg,*";
             script {
                set_color_class(src, 200, 200, 200, 255);
diff --git a/src/examples/edje/multiseat.edc b/src/examples/edje/multiseat.edc
index ce1779b..5738ec9 100644
--- a/src/examples/edje/multiseat.edc
+++ b/src/examples/edje/multiseat.edc
@@ -469,7 +469,7 @@ collections {
 
          program {
             name: "focus,t1,s1";
-            signal: "mouse,clicked,1,seat1";
+            signal: "seat,seat1,mouse,clicked,1";
             source: "example/text1";
             action: FOCUS_SET "seat1";
             target: "example/text1";
@@ -477,7 +477,7 @@ collections {
 
          program {
             name: "focus,color,t1,s1";
-            signal: "focus,part,in,seat1";
+            signal: "seat,seat1,focus,part,in";
             source: "example/text1";
             action: STATE_SET "focused,s1" 0.0;
             target: "bg_text1";
@@ -485,7 +485,7 @@ collections {
 
          program {
             name: "unfocus,color,t1,s1";
-            signal: "focus,part,out,seat1";
+            signal: "seat,seat1,focus,part,out";
             source: "example/text1";
             action: STATE_SET "default" 0.0;
             target: "bg_text1";
@@ -493,7 +493,7 @@ collections {
 
          program {
             name: "focus,t2,s1";
-            signal: "mouse,clicked,1,seat1";
+            signal: "seat,seat1,mouse,clicked,1";
             source: "example/text2";
             action: FOCUS_SET "seat1";
             target: "example/text2";
@@ -501,7 +501,7 @@ collections {
 
          program {
             name: "focus,color,t2,s1";
-            signal: "focus,part,in,seat1";
+            signal: "seat,seat1,focus,part,in";
             source: "example/text2";
             action: STATE_SET "focused,s1" 0.0;
             target: "bg_text2";
@@ -509,7 +509,7 @@ collections {
 
          program {
             name: "unfocus,color,t2,s1";
-            signal: "focus,part,out,seat1";
+            signal: "seat,seat1,focus,part,out";
             source: "example/text2";
             action: STATE_SET "default" 0.0;
             target: "bg_text2";
@@ -517,7 +517,7 @@ collections {
 
          program {
             name: "focus,t1,s2";
-            signal: "mouse,clicked,1,seat2";
+            signal: "seat,seat2,mouse,clicked,1";
             source: "example/text1";
             action: FOCUS_SET "seat2";
             target: "example/text1";
@@ -525,7 +525,7 @@ collections {
 
          program {
             name: "focus,color,t1,s2";
-            signal: "focus,part,in,seat2";
+            signal: "seat,seat2,focus,part,in";
             source: "example/text1";
             action: STATE_SET "focused,s2" 0.0;
             target: "bg_text1";
@@ -533,7 +533,7 @@ collections {
 
          program {
             name: "unfocus,color,t1,s2";
-            signal: "focus,part,out,seat2";
+            signal: "seat,seat2,focus,part,out";
             source: "example/text1";
             action: STATE_SET "default" 0.0;
             target: "bg_text1";
@@ -541,7 +541,7 @@ collections {
 
          program {
             name: "focus,t2,s2";
-            signal: "mouse,clicked,1,seat2";
+            signal: "seat,seat2,mouse,clicked,1";
             source: "example/text2";
             action: FOCUS_SET "seat2";
             target: "example/text2";
@@ -549,7 +549,7 @@ collections {
 
          program {
             name: "focus,color,t2,s2";
-            signal: "focus,part,in,seat2";
+            signal: "seat,seat2,focus,part,in";
             source: "example/text2";
             action: STATE_SET "focused,s2" 0.0;
             target: "bg_text2";
@@ -557,7 +557,7 @@ collections {
 
          program {
             name: "unfocus,color,t2,s2";
-            signal: "focus,part,out,seat2";
+            signal: "seat,seat2,focus,part,out";
             source: "example/text2";
             action: STATE_SET "default" 0.0;
             target: "bg_text2";
@@ -565,7 +565,7 @@ collections {
 
          program {
             name: "button,left,in";
-            signal: "mouse,in,seat1";
+            signal: "seat,seat1,mouse,in";
             source: "button_bg";
             action: STATE_SET "on" 0.0;
             target: "button_left_over";
@@ -573,7 +573,7 @@ collections {
 
          program {
             name: "button,left,out";
-            signal: "mouse,out,seat1";
+            signal: "seat,seat1,mouse,out";
             source: "button_bg";
             action: STATE_SET "default" 0.0;
             target: "button_left_over";
@@ -581,7 +581,7 @@ collections {
 
          program {
             name: "button,left,focus";
-            signal: "mouse,clicked,1,seat1";
+            signal: "seat,seat1,mouse,clicked,1";
             source: "button_bg";
             action: FOCUS_SET "seat1";
             target: "button_bg";
@@ -589,7 +589,7 @@ collections {
 
          program {
             name: "button,left,focused";
-            signal: "focus,part,in,seat1";
+            signal: "seat,seat1,focus,part,in";
             source: "button_bg";
             action: STATE_SET "on" 0.0;
             target: "button_left_focus";
@@ -597,7 +597,7 @@ collections {
 
          program {
             name: "button,left,unfocused";
-            signal: "focus,part,out,seat1";
+            signal: "seat,seat1,focus,part,out";
             source: "button_bg";
             action: STATE_SET "default" 0.0;
             target: "button_left_focus";
@@ -605,7 +605,7 @@ collections {
 
          program {
             name: "button,right,in";
-            signal: "mouse,in,seat2";
+            signal: "seat,seat2,mouse,in";
             source: "button_bg";
             action: STATE_SET "on" 0.0;
             target: "button_right_over";
@@ -613,7 +613,7 @@ collections {
 
          program {
             name: "button,right,out";
-            signal: "mouse,out,seat2";
+            signal: "seat,seat2,mouse,out";
             source: "button_bg";
             action: STATE_SET "default" 0.0;
             target: "button_right_over";
@@ -621,7 +621,7 @@ collections {
 
          program {
             name: "button,right,focus";
-            signal: "mouse,clicked,1,seat2";
+            signal: "seat,seat2,mouse,clicked,1";
             source: "button_bg";
             action: FOCUS_SET "seat2";
             target: "button_bg";
@@ -629,7 +629,7 @@ collections {
 
          program {
             name: "button,right,focused";
-            signal: "focus,part,in,seat2";
+            signal: "seat,seat2,focus,part,in";
             source: "button_bg";
             action: STATE_SET "on" 0.0;
             target: "button_right_focus";
@@ -637,7 +637,7 @@ collections {
 
          program {
             name: "button,right,unfocused";
-            signal: "focus,part,out,seat2";
+            signal: "seat,seat2,focus,part,out";
             source: "button_bg";
             action: STATE_SET "default" 0.0;
             target: "button_right_focus";
@@ -645,7 +645,7 @@ collections {
 
          program {
             name: "knob1,s1";
-            signal: "drag,start,seat1";
+            signal: "seat,seat1,drag,start";
             source: "example/knob1";
             action: STATE_SET "focused,s1" 0.0;
             target: "example/knob1";
@@ -653,7 +653,7 @@ collections {
 
          program {
             name: "knob1,s2";
-            signal: "drag,start,seat2";
+            signal: "seat,seat2,drag,start";
             source: "example/knob1";
             action: STATE_SET "focused,s2" 0.0;
             target: "example/knob1";
@@ -661,7 +661,7 @@ collections {
 
          program {
             name: "knob1,seat1";
-            signal: "drag,stop,*";
+            signal: "seat,*,drag,stop";
             source: "example/knob1";
             action: STATE_SET "default" 0.0;
             target: "example/knob1";
@@ -669,7 +669,7 @@ collections {
 
          program {
             name: "knob2,s1";
-            signal: "drag,start,seat1";
+            signal: "seat,seat1,drag,start";
             source: "example/knob2";
             action: STATE_SET "focused,s1" 0.0;
             target: "example/knob2";
@@ -677,7 +677,7 @@ collections {
 
          program {
             name: "knob2,s2";
-            signal: "drag,start,seat2";
+            signal: "seat,seat2,drag,start";
             source: "example/knob2";
             action: STATE_SET "focused,s2" 0.0;
             target: "example/knob2";
@@ -685,7 +685,7 @@ collections {
 
          program {
             name: "knob2,seat1";
-            signal: "drag,stop,*";
+            signal: "seat,*,drag,stop";
             source: "example/knob2";
             action: STATE_SET "default" 0.0;
             target: "example/knob2";
@@ -693,7 +693,7 @@ collections {
 
          program {
             name: "rect,focus,s1";
-            signal: "mouse,clicked,1,seat1";
+            signal: "seat,seat1,mouse,clicked,1";
             source: "example/swallow";
             action: FOCUS_OBJECT "seat1";
             target: "example/swallow";
@@ -701,14 +701,14 @@ collections {
 
          program {
             name: "rect,unfocus,s1";
-            signal: "mouse,clicked,1,seat1";
+            signal: "seat,seat1,mouse,clicked,1";
             source: "unfocus_area";
             action: FOCUS_OBJECT "seat1";
          }
 
          program {
             name: "rect,focus,s2";
-            signal: "mouse,clicked,1,seat2";
+            signal: "seat,seat2,mouse,clicked,1";
             source: "example/swallow";
             action: FOCUS_OBJECT "seat2";
             target: "example/swallow";
@@ -716,7 +716,7 @@ collections {
 
          program {
             name: "rect,unfocus,s2";
-            signal: "mouse,clicked,1,seat2";
+            signal: "seat,seat2,mouse,clicked,1";
             source: "unfocus_area";
             action: FOCUS_OBJECT "seat2";
          }
diff --git a/src/examples/edje/multiseat_custom_names.edc 
b/src/examples/edje/multiseat_custom_names.edc
index eb5c493..7da3b5e 100644
--- a/src/examples/edje/multiseat_custom_names.edc
+++ b/src/examples/edje/multiseat_custom_names.edc
@@ -125,7 +125,7 @@ collections {
       programs {
          program {
             name: "button,1,over,default";
-            signal: "mouse,in,default";
+            signal: "seat,default,mouse,in";
             source: "button_bg,1";
             action: STATE_SET "over,default" 0.0;
             target: "button_bg,1";
@@ -133,7 +133,7 @@ collections {
 
          program {
             name: "button,1,over,secondary";
-            signal: "mouse,in,secondary";
+            signal: "seat,secondary,mouse,in";
             source: "button_bg,1";
             action: STATE_SET "over,secondary" 0.0;
             target: "button_bg,1";
@@ -149,7 +149,7 @@ collections {
 
          program {
             name: "button,2,over,default";
-            signal: "mouse,in,default";
+            signal: "seat,default,mouse,in";
             source: "button_bg,2";
             action: STATE_SET "over,default" 0.0;
             target: "button_bg,2";
@@ -157,7 +157,7 @@ collections {
 
          program {
             name: "button,2,over,secondary";
-            signal: "mouse,in,secondary";
+            signal: "seat,secondary,mouse,in";
             source: "button_bg,2";
             action: STATE_SET "over,secondary" 0.0;
             target: "button_bg,2";
diff --git a/src/examples/edje/multiseat_filter.edc 
b/src/examples/edje/multiseat_filter.edc
index 5a89503..d62e3ef 100644
--- a/src/examples/edje/multiseat_filter.edc
+++ b/src/examples/edje/multiseat_filter.edc
@@ -637,24 +637,29 @@ collections {
       programs {
          program {
             name: "clicked";
-            signal: "mouse,clicked,1,*";
+            signal: "seat,*,mouse,clicked,1";
             source: "widget,text,*";
             script {
-                new partid;
+                new seat[256];
+                new partid, idx;
+
+                idx = strchr(sig[strlen("seat,")], ",");
+                strncpy(seat, sig[strlen("seat,")], idx);
+
                 partid = get_part_id(src);
-                set_focus(partid, sig[strlen("mouse,clicked,1,")]);
+                set_focus(partid, seat);
             }
          }
 
          program {
             name: "focused";
-            signal: "focus,part,in,*";
+            signal: "seat,*,focus,part,in";
             source: "widget,text,*";
             script {
                new buf[256];
                new partid;
 
-               snprintf(buf, 128, "widget,bg_text,%s",
+               snprintf(buf, sizeof(buf), "widget,bg_text,%s",
                         src[strlen("widget,text,")]);
                partid = get_part_id(buf);
                set_state(partid, "focused", 0.0);
@@ -663,13 +668,13 @@ collections {
 
          program {
             name: "unfocused";
-            signal: "focus,part,out,*";
+            signal: "seat,*,focus,part,out";
             source: "widget,text,*";
             script {
                new buf[256];
                new partid;
 
-               snprintf(buf, 128, "widget,bg_text,%s",
+               snprintf(buf, sizeof(buf), "widget,bg_text,%s",
                         src[strlen("widget,text,")]);
                partid = get_part_id(buf);
                set_state(partid, "default", 0.0);
@@ -678,7 +683,7 @@ collections {
 
          program {
             name: "drag,start";
-            signal: "drag,start,*";
+            signal: "seat,*,drag,start";
             source: "widget,knob,*";
             script {
                 new partid;
@@ -689,7 +694,7 @@ collections {
 
          program {
             name: "drag,stop";
-            signal: "drag,stop,*";
+            signal: "seat,*,drag,stop";
             source: "widget,knob,*";
             script {
                 new partid;
@@ -732,11 +737,16 @@ collections {
 
          program {
             name: "focus_bt,clicked";
-            signal: "mouse,clicked,1,*";
+            signal: "seat,*,mouse,clicked,1";
             source: "focus_bt";
             script {
-                set_focus(PART:"widget,text,1",
-                          sig[strlen("mouse,clicked,1,")]);
+                new seat[256];
+                new idx;
+
+                idx = strchr(sig[strlen("seat,")], ",");
+                strncpy(seat, sig[strlen("seat,")], idx);
+
+                set_focus(PART:"widget,text,1", seat);
             }
          }
       }
diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c
index cc3ae96..232dcb3 100644
--- a/src/lib/edje/edje_program.c
+++ b/src/lib/edje/edje_program.c
@@ -637,7 +637,7 @@ _edje_seat_name_emit(Edje *ed, const char *name, const char 
*sig, const char *sr
 
    if (!name) return;
 
-   snprintf(buf, sizeof(buf), "%s,%s", sig, name);
+   snprintf(buf, sizeof(buf), "seat,%s,%s", name, sig);
    _edje_emit_full(ed, buf, src, NULL, NULL);
 }
 
@@ -1295,7 +1295,7 @@ _edje_seat_emit(Edje *ed, Efl_Input_Device *dev, const 
char *sig, const char *sr
    seat = efl_input_device_seat_get(dev);
    if (!seat) return;
 
-   snprintf(buf, sizeof(buf), "%s,%s", sig, _edje_seat_name_get(ed, seat));
+   snprintf(buf, sizeof(buf), "seat,%s,%s", _edje_seat_name_get(ed, seat), 
sig);
    _edje_emit_full(ed, buf, src, NULL, NULL);
 }
 

-- 


Reply via email to