forked from enlightenment/efl
Remove the doxy-inlined lua example in favor of a cleaner @include
from the examples/ folder. Also expose all the examples to doxygen, you can now browse them all from the generated docs. SVN revision: 53211
This commit is contained in:
parent
98e0d9f009
commit
80e0de0e19
|
@ -455,3 +455,31 @@ Unlike Ebits, Edje separates the layout and behavior logic.
|
|||
@todo Bytecode language for extending programs... but what/how?
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@example embryo_custom_state.edc
|
||||
This example show how to create a custom state from embryo. Clicking on the
|
||||
3 labels will rotate the object in the given direction.
|
||||
|
||||
@example embryo_run_program.edc
|
||||
This example show how to run an edje program from embryo code.
|
||||
|
||||
@example embryo_set_state.edc
|
||||
This example show how to change the state of a part from embryo code.
|
||||
|
||||
@example embryo_set_text.edc
|
||||
This example show how to set the text in TEXT part from embryo code.
|
||||
|
||||
@example embryo_timer.edc
|
||||
This example show the usage of timers in embryo.
|
||||
|
||||
@example external_elm_button.edc
|
||||
This example create some elementary buttons and do some actions on user click.
|
||||
|
||||
@example lua_script.edc
|
||||
This example show the usage of lua scripting to create and animate some
|
||||
objects in the canvas.
|
||||
|
||||
*/
|
||||
|
|
|
@ -52,10 +52,11 @@
|
|||
<ul class="current">
|
||||
<li><a href="files.html">Files</a></li>
|
||||
<li><a href="Edje__Edit_8h.html">Edje Edit API</a></li>
|
||||
<li><a href="examples.html">Examples</a></li>
|
||||
<li><a href="luaref.html">LUA scripting</a></li>
|
||||
<li><a href="Edje_8h.html">Edje API</a></li>
|
||||
<li><a href="edcref.html">EDC Reference</a></li>
|
||||
<li class="current"><a href="index.html">Main Page</a></li>
|
||||
<li class="current"><a href="index.html">Main Page</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -8,155 +8,10 @@
|
|||
* define objects entirely via Lua script (resize handling, event handling
|
||||
* etc. etc.) this places many more demands on them, and thus a more powerful
|
||||
* language is in order. Lua is that language.
|
||||
*
|
||||
*
|
||||
* To get you started, here's an example:
|
||||
* @code
|
||||
* collections {
|
||||
* group { name: "example";
|
||||
* lua_script_only: 1;
|
||||
* lua_script {
|
||||
* --// stick object private/local vars here
|
||||
* local D;
|
||||
* local count = 0;
|
||||
* local fndata = 99;
|
||||
*
|
||||
* local function mycb3 (v)
|
||||
* print("lua::callback transition " .. D.val .. " v: " .. v);
|
||||
* d = {};
|
||||
* edje.size(d);
|
||||
* print("lua::objsize= " .. d.w .. " , " .. d.h);
|
||||
* sz = {w=v * 80, h=v * 40};
|
||||
* D.rect:geom(((d.w / 2) * math.sin(v * 2 * math.pi)) + ((d.w - sz.w) / 2),
|
||||
* ((d.h / 2) * math.cos(v * 2 * math.pi)) + ((d.h - sz.h) / 2),
|
||||
* sz.w, sz.h);
|
||||
* D.rect:color(255, 128, v * 255, 255);
|
||||
* D.rect:move(d);
|
||||
* print("lua::pos= " .. d.x .. " , " .. d.y);
|
||||
*
|
||||
* r = D.rect:above();
|
||||
* if (r ~= nil) then
|
||||
* print("lua::rcol");
|
||||
* r:color(20, v * 255, 60, 255);
|
||||
* else
|
||||
* print("lua::r none!!!!!!!!!!!!!!1");
|
||||
* end
|
||||
* d = edje.size();
|
||||
* D.clip:geom(10, 10, d.w - 20, d.h - 20);
|
||||
* c = D.clip:clipees();
|
||||
* for i=1,table.getn(c),1 do
|
||||
* d = c[i]:geom();
|
||||
* print("lua::" .. i .. " geom = " .. d.x .. "," .. d.y .. " " .. d.w .. "x" .. d.h);
|
||||
* end
|
||||
* return true;
|
||||
* end
|
||||
*
|
||||
* local function mycb2 ()
|
||||
* print("lua::callback animator " .. count);
|
||||
* print("lua:: seconds: " .. edje.seconds());
|
||||
* print("lua:: looptime: " .. edje.looptime());
|
||||
* local date = edje.date();
|
||||
* print("lua:: date: " ..
|
||||
* date.year .. "|" ..
|
||||
* date.month .. "|" ..
|
||||
* date.day .. "|" ..
|
||||
* date.yearday .. "|" ..
|
||||
* date.weekday .. "|" ..
|
||||
* date.hour .. "|" ..
|
||||
* date.min .. "|" ..
|
||||
* date.sec
|
||||
* );
|
||||
* return true;
|
||||
* end
|
||||
*
|
||||
* local function mycb ()
|
||||
* print("lua::callback " .. count .. " fndata = " .. fndata);
|
||||
* count = count + 1; --// keep count of calls - object data
|
||||
* fndata = fndata + 3; --// play with object vars to see if they persist
|
||||
* D.tim = edje.timer(0.25, mycb); --// inside cb add new timer
|
||||
* D.ani = edje.animator(mycb2);
|
||||
* return false; --// cease repeating the timer
|
||||
* end
|
||||
*
|
||||
* --// init object here
|
||||
* D = {}; --// data is empty table to start
|
||||
* D.val = math.random(); --// start with some random value so
|
||||
* fndata = fndata + D.val; --// func data start point
|
||||
* print("lua::init ... " .. D.val);
|
||||
* edje.echo("lua::echo('hello world')");
|
||||
* --// actually add the timer to call mycb in 1.23 sec
|
||||
* D.tim = edje.timer(1.23, mycb);
|
||||
* D.tra = edje.transition(5.0, mycb3);
|
||||
*
|
||||
* if (edje.spanky) then edje.spanky(); end
|
||||
*
|
||||
* edje.messagesend(7, "none" );
|
||||
* edje.messagesend(7, "sig", "signal", "source");
|
||||
* edje.messagesend(7, "str", "hello world");
|
||||
* edje.messagesend(7, "int", 987);
|
||||
* edje.messagesend(7, "float", 987.321);
|
||||
* edje.messagesend(7, "strset", {"hello", "there", "world"});
|
||||
* edje.messagesend(7, "intset", {1, 2, 3});
|
||||
* edje.messagesend(7, "floatset", {1.1, 2.2, 3.3});
|
||||
* edje.messagesend(7, "strint", "hello world", 7);
|
||||
* edje.messagesend(7, "strfloat", "hello world", 7.654);
|
||||
* edje.messagesend(7, "strintset","hello world", {1, 2, 3});
|
||||
*
|
||||
* D.rect = edje.rect();
|
||||
* D.rect:geom (5, 10, 50, 30);
|
||||
* D.rect:color (255, 128, 60, 255);
|
||||
* D.rect:show ();
|
||||
*
|
||||
* D.rect2 = edje.rect();
|
||||
* D.rect2:geom (50, 50, 50, 50);
|
||||
* D.rect2:color (20, 30, 60, 120);
|
||||
* D.rect2:show ();
|
||||
*
|
||||
* D.clip = edje.rect();
|
||||
* D.clip:geom (10, 10, 150, 150);
|
||||
* D.clip:color (200, 200, 50, 200);
|
||||
* D.clip:show ();
|
||||
*
|
||||
* D.rect2:clip(D.clip);
|
||||
* D.rect:clip(D.clip);
|
||||
*
|
||||
* --// example of deleting something
|
||||
* --// D.tim:del();
|
||||
*
|
||||
* --// shutdown func - generally empty or not there. everything gcd for you
|
||||
* function shutdown ()
|
||||
* print("lua::shutdown ... " .. D.val);
|
||||
* end
|
||||
* function show ()
|
||||
* print("lua::show ... " .. D.val);
|
||||
* end
|
||||
* function hide ()
|
||||
* print("lua::hide ... " .. D.val);
|
||||
* end
|
||||
* function move (x, y)
|
||||
* print("lua::move ... " .. D.val);
|
||||
* print(" x=" .. x .. " x=" .. y);
|
||||
* end
|
||||
* function resize (w, h)
|
||||
* print("lua::resize ... " .. D.val);
|
||||
* print(" w=" .. w .. " h=" .. h);
|
||||
* end
|
||||
* function message (id, type, v1, v2)
|
||||
* print("lua::message ... " .. D.val);
|
||||
* print(" id=" .. id .. " type=" .. type);
|
||||
* --// handle youre message type here. chekc id + type then use v1
|
||||
* --// and/or v2 (or neither) appropriately. they are the same as
|
||||
* --// the 2nd and 3rd param passed to edje.messagesend() (if any
|
||||
* --// are passed at all)
|
||||
* end
|
||||
* function signal (sig, src)
|
||||
* print("lua::signal ... " .. D.val);
|
||||
* print(" sig=" .. sig .. " src=" .. src);
|
||||
* end
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @include lua_script.edc
|
||||
*
|
||||
*/
|
||||
|
||||
#include "edje_private.h"
|
||||
|
|
Loading…
Reference in New Issue