Factor stuff related to our_movie into separate file
[lsnes.git] / lua.hpp
blobed65bffd77762927c07ee2cfb435bcdc3fe8dfb9
1 #ifndef _lua__hpp__included__
2 #define _lua__hpp__included__
4 #include "render.hpp"
5 #include "window.hpp"
6 #include "controllerdata.hpp"
8 struct lua_State;
10 /**
11 * Function implemented in C++ exported to Lua.
13 class lua_function
15 public:
16 /**
17 * Register function.
19 lua_function(const std::string& name) throw(std::bad_alloc);
20 /**
21 * Unregister function.
23 virtual ~lua_function() throw();
25 /**
26 * Invoke function.
28 virtual int invoke(lua_State* L, window* win) = 0;
29 protected:
30 std::string fname;
33 struct lua_render_context
35 uint32_t left_gap;
36 uint32_t right_gap;
37 uint32_t top_gap;
38 uint32_t bottom_gap;
39 struct render_queue* queue;
40 uint32_t width;
41 uint32_t height;
42 uint32_t rshift;
43 uint32_t gshift;
44 uint32_t bshift;
47 void init_lua(window* win) throw();
48 void lua_callback_do_paint(struct lua_render_context* ctx, window* win) throw();
49 void lua_callback_do_video(struct lua_render_context* ctx, window* win) throw();
50 void lua_callback_do_input(controls_t& data, bool subframe, window* win) throw();
51 void lua_callback_do_reset(window* win) throw();
52 void lua_callback_do_readwrite(window* win) throw();
53 void lua_callback_startup(window* win) throw();
54 void lua_callback_pre_load(const std::string& name, window* win) throw();
55 void lua_callback_err_load(const std::string& name, window* win) throw();
56 void lua_callback_post_load(const std::string& name, bool was_state, window* win) throw();
57 void lua_callback_pre_save(const std::string& name, bool is_state, window* win) throw();
58 void lua_callback_err_save(const std::string& name, window* win) throw();
59 void lua_callback_post_save(const std::string& name, bool is_state, window* win) throw();
60 void lua_callback_snoop_input(uint32_t port, uint32_t controller, uint32_t index, short value, window* win) throw();
61 void lua_callback_quit(window* win) throw();
63 extern bool lua_requests_repaint;
64 extern bool lua_requests_subframe_paint;
66 #endif