diff options
Diffstat (limited to 'ClientHamr/GuiLua/GuiLua.c')
-rw-r--r-- | ClientHamr/GuiLua/GuiLua.c | 29 |
1 files changed, 26 insertions, 3 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); |