1 #ifndef _lua__hpp__included__
2 #define _lua__hpp__included__
5 #include "controllerframe.hpp"
10 * Function implemented in C++ exported to Lua.
18 lua_function(const std::string
& name
) throw(std::bad_alloc
);
20 * Unregister function.
22 virtual ~lua_function() throw();
27 virtual int invoke(lua_State
* L
) = 0;
33 * Register function pointer as lua function.
35 class function_ptr_luafun
: public lua_function
41 function_ptr_luafun(const std::string
& name
, int (*_fn
)(lua_State
* L
, const std::string
& fname
))
49 int invoke(lua_State
* L
)
54 int (*fn
)(lua_State
* L
, const std::string
& fname
);
57 struct lua_render_context
63 struct render_queue
* queue
;
68 void init_lua() throw();
69 void quit_lua() throw();
70 void lua_callback_do_paint(struct lua_render_context
* ctx
) throw();
71 void lua_callback_do_video(struct lua_render_context
* ctx
) throw();
72 void lua_callback_do_input(controller_frame
& data
, bool subframe
) throw();
73 void lua_callback_do_reset() throw();
74 void lua_callback_do_frame() throw();
75 void lua_callback_do_readwrite() throw();
76 void lua_callback_startup() throw();
77 void lua_callback_pre_load(const std::string
& name
) throw();
78 void lua_callback_err_load(const std::string
& name
) throw();
79 void lua_callback_post_load(const std::string
& name
, bool was_state
) throw();
80 void lua_callback_pre_save(const std::string
& name
, bool is_state
) throw();
81 void lua_callback_err_save(const std::string
& name
) throw();
82 void lua_callback_post_save(const std::string
& name
, bool is_state
) throw();
83 void lua_callback_snoop_input(uint32_t port
, uint32_t controller
, uint32_t index
, short value
) throw();
84 void lua_callback_quit() throw();
86 extern bool lua_supported
;
87 extern bool lua_requests_repaint
;
88 extern bool lua_requests_subframe_paint
;