-- $LastChangedDate: 2011-03-17 19:59:52 -0400 (Thu, 17 Mar 2011) $
-- Macros written in Lua to expand C++ code for bindings between C++/Lua.
-- Avoid lua_/LUA_ which is reserved by Lua.

bindTable = {

class = "Program",
typesig = nil,
luaCanInstantiate = false,

headers =
[[
#include "base/module.hh"
using namespace base;
#include "program/module.hh"
using namespace program;
]],

func_Exit = {
    comments = "Program:Exit( int )",
    code = [[
        EXIT( POP_INT( L ) );
    ]]
},

func_Reset = {
    comments = "Program:Reset()",
    code = [[
        GET_PROGRAM().Reset();
    ]]
},

func_FlushSceneGraph = {
    comments = "Program:FlushSceneGraph() -- flushes then reloads essential parts of scene-graph",
    code = [[
        GET_PROGRAM().FlushSceneGraph();
    ]]
},

func_SetPause = {
    comments = "Program:SetPause( bool )",
    code = [[
        GET_PROGRAM().SetPause( POP_BOOL( L ) );
    ]]
},

func_IfPaused = {
    comments = "bool Program:IfPaused()",
    code = [[
        lua_pushboolean( L, GET_PROGRAM().IfPaused() );
        return 1;  // stack items to return
    ]]
},

func_DequeueCommand = {
    comments = "string Program:DequeueCommand()\n * Returns next command or nil.",
    code = [[
        const string cmd = GET_PROGRAM().DequeueCommand();
        if ( cmd.empty() )
            lua_pushnil( L );
        else
            lua_pushstring( L, cmd.c_str() );
        return 1;  // stack items to return
    ]]
},

}
