The Battle for Wesnoth  1.19.5+dev
lua_interpreter.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2024
3  by Chris Beck <render787@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
19 
20 class lua_kernel_base;
21 
22 namespace gui2::dialogs
23 {
24 
26 {
27 public:
28  class lua_model;
29  class input_model;
30  class view;
31  class controller;
32 
34 
35  virtual void pre_show() override;
36 
37  enum WHICH_KERNEL { APP, GAME };
38  static void display(lua_kernel_base * lk);
39  static void display(WHICH_KERNEL which);
40 private:
41  const std::unique_ptr<controller> controller_;
42 
43  virtual const std::string& window_id() const override;
44 };
45 
46 } // namespace dialogs
The controller is responsible to hold all the input widgets, and a pointer to the model and view.
The input_model keeps track of what commands were executed before, and figures out what should be dis...
The lua model is responsible to interact with the lua kernel base and keep track of what should be di...
virtual void pre_show() override
Bind the controller, initialize one of the static labels with info about this kernel,...
static void display(lua_kernel_base *lk)
Display a new console, using given video and lua kernel.
virtual const std::string & window_id() const override
The ID of the window to build.
const std::unique_ptr< controller > controller_
lua_interpreter(lua_kernel_base &lk)
Abstract base class for all modal dialogs.