aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-18 14:14:36 +1000
committerDavid Walter Seikel2014-04-18 14:14:36 +1000
commit6e35e5b6e2335026cc13471d95829eaf124c2ba4 (patch)
tree61994cbe03d4a87cfb65bdb8f955b36911faf977 /ClientHamr
parentTODO and comment additions. (diff)
downloadSledjHamr-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.c29
-rw-r--r--ClientHamr/GuiLua/skang.lua12
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
561static int clear(lua_State *L)
562{
563// TODO - This is just a stub for now.
564
565 return 0;
566}
567
561static int loopWindow(lua_State *L) 568static 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
582static 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
575static int closeWindow(lua_State *L) 595static 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,
991thingasm('nada', 'Do nothing.', function () --[[ This function intentionally left blank. ]] end) 991thingasm('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.
995clear = function ()
996end
997
998skang = function (name) 995skang = function (name)
999end 996end
1000quit = function ()
1001end
1002 997
1003thingasm('clear', 'The current skin is cleared of all widgets.', clear)
1004thingasm('skang', 'Parse the contents of a skang file or URL.', skang, 'URL') 998thingasm('skang', 'Parse the contents of a skang file or URL.', skang, 'URL')
1005thingasm('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
1011moduleEnd(_M) 1001moduleEnd(_M)