new program action PARAM_COPY, awesome crazy stuff! :-)
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 27 Mar 2010 01:26:10 +0000 (01:26 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 27 Mar 2010 01:26:10 +0000 (01:26 +0000)
commit43e6645b028bafd3a463fa31f9852478f9e233bc
treedc9515bd4ce2a004a21339e0223157c0bec6ff04
parent505577b8368dd47959e37788a2fd4b5ceab5edc0
new program action PARAM_COPY, awesome crazy stuff! :-)

Edje got a new program action called PARAM_COPY in the form:

   action: PARAM_COPY "src_part" "src_param" "dst_part" "dst_param";

This will copy the parameter "src_param" from part "src_part" to
parameter "dst_param" of part "dst_part".

So far so good, why the "crazy" in the first line? Because this also:
  * do type conversion!
  * set properties of native parts, not just EXTERNAL!

The type conversion allows one to get an integer and display that in a
text property, or get an string and convert into a float.

The set of native parts is quite simple, basically a map of Edje.h
edje_object_part_*_set(). With that one can set the string to be used
by a TEXT, or set drag page/step/size/value! (page/step increments are
not supported at the moment, if it is worth, they may be supported in
future).

Sample EDC:

{{{

  // test.edc, compile with edje_cc and run with edje_player

   externals {
      external: "elm";
   }
   collections {
      group { name: "main";
         parts {
            part { name: "bg"; type: RECT;
               description { state: "default" 0.0;
                  color: 255 255 255 255;
               }
            }
            part { name: "entry"; type: EXTERNAL;
               source: "elm/scrolled_entry";
               description { state: "default" 0.0;
                  rel2.relative: 1.0 0.5;
               }
            }
            part { name: "display"; type: TEXT;
               description { state: "default" 0.0;
                  color: 0 128 0 255;
                  rel1.relative: 0.0 0.5;
                  text { font: "Sans"; size: 16; }
               }
            }
            programs {
               program {
                  signal: "changed";
                  source: "entry";
                  action: PARAM_COPY "entry" "text" "display" "text";
               }
            }
         }
      }
   }

}}}

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@47500 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
src/bin/edje_cc_handlers.c
src/lib/Edje.h
src/lib/edje_data.c
src/lib/edje_entry.c
src/lib/edje_private.h
src/lib/edje_program.c
src/lib/edje_util.c