OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
OptionsVideoState.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom 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 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_OPTIONSVIDEOSTATE_H
20 #define OPENXCOM_OPTIONSVIDEOSTATE_H
21 
22 #include "../Engine/State.h"
23 #include "OptionsBaseState.h"
24 #include <SDL.h>
25 
26 namespace OpenXcom
27 {
28 
29 class TextButton;
30 class ToggleTextButton;
31 class Text;
32 class TextEdit;
33 class ArrowButton;
34 class ComboBox;
35 class InteractiveSurface;
36 
42 {
43 private:
44  static const std::string GL_EXT, GL_FOLDER, GL_STRING;
45 
46  InteractiveSurface *_displaySurface;
47  Text *_txtDisplayResolution, *_txtDisplayX;
48  TextEdit *_txtDisplayWidth, *_txtDisplayHeight;
49  ArrowButton *_btnDisplayResolutionUp, *_btnDisplayResolutionDown;
50 
51  Text *_txtLanguage, *_txtFilter, *_txtGeoScale, *_txtBattleScale;
52  ComboBox *_cbxLanguage, *_cbxFilter, *_cbxDisplayMode, *_cbxGeoScale, *_cbxBattleScale;
53  Text *_txtMode;
54  Text *_txtOptions;
55  ToggleTextButton *_btnLetterbox, *_btnLockMouse;
56 
57  SDL_Rect** _res;
58  int _resAmount, _resCurrent;
59  std::vector<std::string> _langs, _filters;
60 
61  void updateDisplayResolution();
62 public:
64  OptionsVideoState(Game *game, OptionsOrigin origin);
68  void btnDisplayResolutionUpClick(Action *action);
72  void txtDisplayWidthChange(Action *action);
74  void txtDisplayHeightChange(Action *action);
76  void cbxLanguageChange(Action *action);
78  void cbxFilterChange(Action *action);
80  void updateDisplayMode(Action *action);
82  void btnLetterboxClick(Action *action);
84  void btnLockMouseClick(Action *action);
86  void updateBattlescapeScale(Action *action);
88  void updateGeoscapeScale(Action *action);
90  void resize(int &, int &);
92  void handle(Action *action);
93 };
94 
95 }
96 
97 #endif
void btnLetterboxClick(Action *action)
Handler for clicking the Letterboxed button.
Definition: OptionsVideoState.cpp:516
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
Definition: ToggleTextButton.h:31
Screen that lets the user configure various Video options.
Definition: OptionsVideoState.h:41
Text string displayed on screen.
Definition: Text.h:41
~OptionsVideoState()
Cleans up the Options state.
Definition: OptionsVideoState.cpp:327
void updateGeoscapeScale(Action *action)
Handler for updating the selected geoscape scale.
Definition: OptionsVideoState.cpp:535
void cbxLanguageChange(Action *action)
Handler for changing the Language combobox.
Definition: OptionsVideoState.cpp:442
void updateBattlescapeScale(Action *action)
Handler for updating the selected battlescape scale.
Definition: OptionsVideoState.cpp:544
void btnLockMouseClick(Action *action)
Handler for clicking the Lock Mouse button.
Definition: OptionsVideoState.cpp:525
void btnDisplayResolutionUpClick(Action *action)
Handler for clicking the Next Resolution button.
Definition: OptionsVideoState.cpp:336
void txtDisplayHeightChange(Action *action)
Handler for changing the Display Height text.
Definition: OptionsVideoState.cpp:415
Text button with a list dropdown when pressed.
Definition: ComboBox.h:38
Button with an arrow on it.
Definition: ArrowButton.h:37
void resize(int &, int &)
Update the resolution settings, we just resized the window.
Definition: OptionsVideoState.cpp:554
void updateDisplayMode(Action *action)
Handler for clicking the Display Mode combobox.
Definition: OptionsVideoState.cpp:483
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
void handle(Action *action)
Handles keypresses.
Definition: OptionsVideoState.cpp:569
OptionsVideoState(Game *game, OptionsOrigin origin)
Creates the Options state.
Definition: OptionsVideoState.cpp:49
void txtDisplayWidthChange(Action *action)
Handler for changing the Display Width text.
Definition: OptionsVideoState.cpp:388
Editable version of Text.
Definition: TextEdit.h:35
Options base state for common stuff across Options windows.
Definition: OptionsBaseState.h:43
void btnDisplayResolutionDownClick(Action *action)
Handler for clicking the Previous Resolution button.
Definition: OptionsVideoState.cpp:355
void cbxFilterChange(Action *action)
Handler for changing the Filter combobox.
Definition: OptionsVideoState.cpp:451