The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
advanced_graphics_options.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 - 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 #ifndef GUI_DIALOGS_ADVANCED_GRAPHICS_OPTIONS_HPP_INCLUDED
16 #define GUI_DIALOGS_ADVANCED_GRAPHICS_OPTIONS_HPP_INCLUDED
17 
18 #include "gui/dialogs/dialog.hpp"
19 #include "gui/widgets/group.hpp"
20 #include "utils/make_enum.hpp"
21 
22 namespace gui2
23 {
24 class tlabel;
25 class ttoggle_button;
26 
28 {
29 public:
30  /** Constructor. */
32 
33  /**
34  * The display function.
35  *
36  * See @ref tdialog for more information.
37  */
38  static void display(CVideo& video)
39  {
40  tadvanced_graphics_options().show(video);
41  }
42 
43  // These names must match the infixes of the widget ids in advanced_graphics_options.cfg
44  static const std::vector<std::string> scale_cases;
45 
46  // These names must match the suffixes of the widget ids in advanced_graphics_options.cfg
47  MAKE_ENUM(SCALING_ALGORITHM,
48  (LINEAR, "linear")
49  (NEAREST_NEIGHBOR, "nn")
50  (XBRZ_LIN, "xbrzlin")
51  (XBRZ_NN, "xbrznn")
52  )
53 
54 private:
55  /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
56  virtual const std::string& window_id() const;
57 
58  /** Inherited from tdialog. */
59  void pre_show(twindow& window);
60 
61  /** Inherited from tdialog. */
62  void post_show(twindow& window);
63 
64  void setup_scale_case(const std::string &, twindow &);
65  void update_scale_case(const std::string &);
66  SCALING_ALGORITHM get_scale_pref(const std::string& pref_id);
67 
68  std::map<std::string,tgroup<SCALING_ALGORITHM> > groups_;
69 };
70 
71 } // end namespace gui2
72 
73 #endif
static const std::vector< std::string > scale_cases
SCALING_ALGORITHM get_scale_pref(const std::string &pref_id)
void setup_scale_case(const std::string &, twindow &)
MAKE_ENUM(SCALING_ALGORITHM,(LINEAR,"linear")(NEAREST_NEIGHBOR,"nn")(XBRZ_LIN,"xbrzlin")(XBRZ_NN,"xbrznn")) private void pre_show(twindow &window)
Inherited from tdialog, implemented by REGISTER_DIALOG.
#define MAKE_ENUM(NAME, CONTENT)
Definition: make_enum.hpp:157
Definition: video.hpp:58
std::map< std::string, tgroup< SCALING_ALGORITHM > > groups_
STL namespace.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
static void display(CVideo &video)
The display function.
Abstract base class for all dialogs.
Definition: dialog.hpp:121
void post_show(twindow &window)
Inherited from tdialog.
virtual const std::string & window_id() const =0
The id of the window to build.
Defines the MAKE_ENUM macro.