diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-31 19:32:14 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-31 19:32:14 (GMT) |
| commit | e8628274ada57b6a526e7cdb261875ac95f05db5 (patch) | |
| tree | 4ff364c1099cba6ebca1c3a5eb9829367251ba8a /src/cat/LuaWindow.h | |
| parent | 493a32a1b28f15cf02bb69c3735b9a411448c523 (diff) | |
| download | powder-e8628274ada57b6a526e7cdb261875ac95f05db5.zip powder-e8628274ada57b6a526e7cdb261875ac95f05db5.tar.gz | |
Events for Window object (Lua)
Diffstat (limited to 'src/cat/LuaWindow.h')
| -rw-r--r-- | src/cat/LuaWindow.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/cat/LuaWindow.h b/src/cat/LuaWindow.h index ea7b98f..0c4a305 100644 --- a/src/cat/LuaWindow.h +++ b/src/cat/LuaWindow.h @@ -8,6 +8,7 @@ extern "C" { #include "LuaLuna.h" +#include "interface/Platform.h" namespace ui { class Window; @@ -15,11 +16,58 @@ namespace ui class LuaWindow { + int onInitializedFunction; + int onExitFunction; + int onTickFunction; + int onDrawFunction; + int onFocusFunction; + int onBlurFunction; + int onTryExitFunction; + int onTryOkayFunction; + int onMouseMoveFunction; + int onMouseDownFunction; + int onMouseUpFunction; + int onMouseWheelFunction; + int onKeyPressFunction; + int onKeyReleaseFunction; + ui::Window * window; lua_State * l; int position(lua_State * l); int size(lua_State * l); int addComponent(lua_State * l); + + //Set event handlers + int onInitialized(lua_State * l); + int onExit(lua_State * l); + int onTick(lua_State * l); + int onDraw(lua_State * l); + int onFocus(lua_State * l); + int onBlur(lua_State * l); + int onTryExit(lua_State * l); + int onTryOkay(lua_State * l); + int onMouseMove(lua_State * l); + int onMouseDown(lua_State * l); + int onMouseUp(lua_State * l); + int onMouseWheel(lua_State * l); + int onKeyPress(lua_State * l); + int onKeyRelease(lua_State * l); + + void triggerOnInitialized(); + void triggerOnExit(); + void triggerOnTick(float deltaTime); + void triggerOnDraw(); + void triggerOnFocus(); + void triggerOnBlur(); + void triggerOnTryExit(); + void triggerOnTryOkay(); + void triggerOnMouseMove(int x, int y, int dx, int dy); + void triggerOnMouseDown(int x, int y, unsigned button); + void triggerOnMouseUp(int x, int y, unsigned button); + void triggerOnMouseWheel(int x, int y, int d); + void triggerOnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); + void triggerOnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt); + public: static const char className[]; static Luna<LuaWindow>::RegType methods[]; |
