_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

List of all members
LuaCallback Class Reference

#include <luacallback.h>

Public Member Functions

luacallback.cpp - Lua callback.
 LuaCallback (lua_State *lua, lua_Object luaref)
 
 ~LuaCallback ()
 
void pushPreamble ()
 
void pushInteger (int value)
 
void pushIntegers (const std::vector< int > &values)
 
void pushString (const std::string &eventId)
 
void pushTable (std::initializer_list< std::pair< std::string, std::variant< std::string, int >>> list)
 
void pushTable (std::map< std::string, std::variant< std::string, int >> map)
 
void run (int results=0)
 
bool popBoolean ()
 
int popInteger ()
 

Constructor & Destructor Documentation

◆ LuaCallback()

LuaCallback::LuaCallback ( lua_State *  l,
lua_Object  f 
)

LuaCallback constructor

Parameters
lLua state
fListener function

◆ ~LuaCallback()

LuaCallback::~LuaCallback ( )

LuaActionListener destructor

Member Function Documentation

◆ popBoolean()

bool LuaCallback::popBoolean ( )

Pops a boolean value for the callback on the stack.

◆ popInteger()

int LuaCallback::popInteger ( )

Pops an integer value for the callback on the stack.

◆ pushInteger()

void LuaCallback::pushInteger ( int  value)

Push a string argument for the callback on the stack.

Parameters
valuethe integer to push on the stack

◆ pushIntegers()

void LuaCallback::pushIntegers ( const std::vector< int > &  values)

Push a array of integers from callback to stack

Parameters
valuethe integer to push on the stack

◆ pushPreamble()

void LuaCallback::pushPreamble ( )

Push the preamble on the stack to call the callback. Call this function before pushing the arguments on the lua stack.

◆ pushString()

void LuaCallback::pushString ( const std::string &  s)

Push a string argument for the callback on the stack.

Parameters
sthe string to push on the stack

◆ pushTable() [1/2]

void LuaCallback::pushTable ( std::initializer_list< std::pair< std::string, std::variant< std::string, int >>>  list)

Push a table with string keys and string or integer values.

◆ pushTable() [2/2]

void LuaCallback::pushTable ( std::map< std::string, std::variant< std::string, int >>  map)

Push a table with string keys and string or integer values.

◆ run()

void LuaCallback::run ( int  results = 0)

Called when an action is received from a Widget. It is used to be able to receive a notification that an action has occurred.

Parameters
resultsthe number of results to be expected in call

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.