The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
application_lua_kernel.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2016 by Chris Beck <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 
16 #ifndef SCRIPTING_APP_LUA_KERNEL_HPP
17 #define SCRIPTING_APP_LUA_KERNEL_HPP
18 
22 
23 #include <boost/noncopyable.hpp>
24 #include <string>
25 #include <vector>
26 
27 class CVideo;
28 struct lua_State;
29 
31 public:
33 
34  virtual std::string my_name() { return "Application Lua Kernel"; }
35 
36  typedef std::vector<std::function<bool(void)> > request_list;
37 
38  class thread : private boost::noncopyable {
40  bool started_;
41 
42  thread(lua_State *);
43  public :
44  bool is_running();
46 
47  request_list run_script(const plugins_context & ctxt, const std::vector<plugins_manager::event> & queue);
48 
49  friend class application_lua_kernel;
50  };
51 
52  thread * load_script_from_string(const std::string &); //throws
53  thread * load_script_from_file(const std::string &); //throws
54 };
55 
56 #endif
Definition: video.hpp:58
thread * load_script_from_string(const std::string &)
virtual std::string my_name()
std::vector< std::function< bool(void)> > request_list
request_list run_script(const plugins_context &ctxt, const std::vector< plugins_manager::event > &queue)
GLsizei const GLcharARB ** string
Definition: glew.h:4503
thread * load_script_from_file(const std::string &)