diff options
author | David Walter Seikel | 2014-04-18 14:14:36 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-18 14:14:36 +1000 |
commit | 6e35e5b6e2335026cc13471d95829eaf124c2ba4 (patch) | |
tree | 61994cbe03d4a87cfb65bdb8f955b36911faf977 /ClientHamr | |
parent | TODO and comment additions. (diff) | |
download | SledjHamr-6e35e5b6e2335026cc13471d95829eaf124c2ba4.zip SledjHamr-6e35e5b6e2335026cc13471d95829eaf124c2ba4.tar.gz SledjHamr-6e35e5b6e2335026cc13471d95829eaf124c2ba4.tar.bz2 SledjHamr-6e35e5b6e2335026cc13471d95829eaf124c2ba4.tar.xz |
Move clear() and quit() to GuiLua.c, and actually implement quit().
Diffstat (limited to 'ClientHamr')
-rw-r--r-- | ClientHamr/GuiLua/GuiLua.c | 29 | ||||
-rw-r--r-- | ClientHamr/GuiLua/skang.lua | 12 |
2 files changed, 27 insertions, 14 deletions
diff --git a/ClientHamr/GuiLua/GuiLua.c b/ClientHamr/GuiLua/GuiLua.c index 9ef60de..27e01d7 100644 --- a/ClientHamr/GuiLua/GuiLua.c +++ b/ClientHamr/GuiLua/GuiLua.c | |||
@@ -558,6 +558,13 @@ static int window(lua_State *L) | |||
558 | return 0; | 558 | return 0; |
559 | } | 559 | } |
560 | 560 | ||
561 | static int clear(lua_State *L) | ||
562 | { | ||
563 | // TODO - This is just a stub for now. | ||
564 | |||
565 | return 0; | ||
566 | } | ||
567 | |||
561 | static int loopWindow(lua_State *L) | 568 | static int loopWindow(lua_State *L) |
562 | { | 569 | { |
563 | globals *ourGlobals; | 570 | globals *ourGlobals; |
@@ -572,6 +579,19 @@ static int loopWindow(lua_State *L) | |||
572 | return 0; | 579 | return 0; |
573 | } | 580 | } |
574 | 581 | ||
582 | static int quit(lua_State *L) | ||
583 | { | ||
584 | globals *ourGlobals; | ||
585 | |||
586 | lua_getfield(L, LUA_REGISTRYINDEX, globName); | ||
587 | ourGlobals = lua_touserdata(L, -1); | ||
588 | lua_pop(L, 1); | ||
589 | |||
590 | _on_done(ourGlobals, NULL, NULL); | ||
591 | |||
592 | return 0; | ||
593 | } | ||
594 | |||
575 | static int closeWindow(lua_State *L) | 595 | static int closeWindow(lua_State *L) |
576 | { | 596 | { |
577 | globals *ourGlobals; | 597 | globals *ourGlobals; |
@@ -644,9 +664,12 @@ int luaopen_libGuiLua(lua_State *L) | |||
644 | skang = lua_gettop(L); | 664 | skang = lua_gettop(L); |
645 | 665 | ||
646 | // Define our functions. | 666 | // Define our functions. |
647 | push_lua(L, "@ ( = $ $ & $ )", skang, THINGASM, skang, "window", "Opens our window.", window, "number,number,string", 0); | 667 | //thingasm{'window', 'The size and title of the application Frame.', window, 'x,y,name', acl='GGG'} |
648 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "loopWindow", "Run our windows main loop.", loopWindow, 0); | 668 | push_lua(L, "@ ( { = $ $ & $ $acl } )", skang, THINGASM, skang, "window", "Opens our window.", window, "number,number,string", "GGG", 0); |
649 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "closeWindow", "Closes our window.", closeWindow, 0); | 669 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "clear", "The current skin is cleared of all widgets", clear, 0); |
670 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "loopWindow", "Run our windows main loop.", loopWindow, 0); | ||
671 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "quit", "Quit, exit, remove thyself.", quit, 0); | ||
672 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "closeWindow", "Closes our window.", closeWindow, 0); | ||
650 | 673 | ||
651 | // A test of the array building stuff. | 674 | // A test of the array building stuff. |
652 | push_lua(L, "@ ( { = $ $ % $widget !required } )", skang, THINGASM, skang, "wibble", "It's wibbly!", 1, "'edit', 'The wibblinator:', 1, 1, 10, 50", 1, 0); | 675 | push_lua(L, "@ ( { = $ $ % $widget !required } )", skang, THINGASM, skang, "wibble", "It's wibbly!", 1, "'edit', 'The wibblinator:', 1, 1, 10, 50", 1, 0); |
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua index 5dbf36f..8a882d2 100644 --- a/ClientHamr/GuiLua/skang.lua +++ b/ClientHamr/GuiLua/skang.lua | |||
@@ -991,21 +991,11 @@ thingasm('set', 'Set the current value of an existing Thing or metadata.', set, | |||
991 | thingasm('nada', 'Do nothing.', function () --[[ This function intentionally left blank. ]] end) | 991 | thingasm('nada', 'Do nothing.', function () --[[ This function intentionally left blank. ]] end) |
992 | 992 | ||
993 | 993 | ||
994 | -- TODO - Some function stubs, for now. Fill them up later. Probably move the lot to GuiLua.c. | 994 | -- TODO - Some function stubs, for now. Fill them up later. |
995 | clear = function () | ||
996 | end | ||
997 | |||
998 | skang = function (name) | 995 | skang = function (name) |
999 | end | 996 | end |
1000 | quit = function () | ||
1001 | end | ||
1002 | 997 | ||
1003 | thingasm('clear', 'The current skin is cleared of all widgets.', clear) | ||
1004 | thingasm('skang', 'Parse the contents of a skang file or URL.', skang, 'URL') | 998 | thingasm('skang', 'Parse the contents of a skang file or URL.', skang, 'URL') |
1005 | thingasm('quit', 'Quit, exit, remove thyself.', quit) | ||
1006 | |||
1007 | -- TODO - This moved to the GuiLua.c, but it's not all there yet. | ||
1008 | --thingasm{'window', 'The size and title of the application Frame.', window, 'x,y,name', acl='GGG'} | ||
1009 | 999 | ||
1010 | 1000 | ||
1011 | moduleEnd(_M) | 1001 | moduleEnd(_M) |