ManaPlus
client.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef PROGS_DYECMD_CLIENT_H
24 #define PROGS_DYECMD_CLIENT_H
25 
26 #include "enums/state.h"
27 
29 
30 #include "localconsts.h"
31 
32 class Button;
33 class Skin;
34 class Window;
35 
36 extern bool isSafeMode;
37 extern int serverVersion;
38 extern unsigned int tmwServerVersion;
39 extern time_t start_time;
40 extern int textures_count;
41 
42 extern std::string errorMessage;
43 
48 class Client final : public ActionListener
49 {
50  public:
51  Client();
52 
54 
55  ~Client() override final;
56 
57  void gameInit();
58 
59  void testsInit();
60 
61  int gameExec();
62 
63  static int testsExec();
64 
65  void setState(const StateT state)
66  { mState = state; }
67 
69  { return mState; }
70 
71  void action(const ActionEvent &event) override final;
72 
73  void moveButtons(const int width);
74 
75  void windowRemoved(const Window *const window);
76 
77  void updatePinState();
78 
79  void focusWindow();
80 
81  void slowLogic();
82 
83  static bool isTmw();
84 
85  private:
86  void stateGame();
87 
88  void initSoundManager();
89 
90  static void initGraphics();
91 
92  static void initPaths();
93 
94  void gameClear();
95 
96  void testsClear();
97 
98  static void logVars();
99 
107 #ifdef ANDROID
108  Button *mCloseButton;
109 #endif // ANDROID
110 
113 
117 };
118 
119 extern Client *client;
120 extern unsigned int mLastHost;
121 extern unsigned long mSearchHash;
122 
123 #endif // PROGS_DYECMD_CLIENT_H
Client::initPaths
static void initPaths()
Definition: client.cpp:849
client
Client * client
Definition: client.cpp:117
Client::initGraphics
static void initGraphics()
Definition: client.cpp:412
Client::updatePinState
void updatePinState()
Definition: client.cpp:816
ActionEvent
Definition: actionevent.h:96
Client::isTmw
static bool isTmw()
Definition: client.cpp:837
Client::testsClear
void testsClear()
Definition: client.cpp:164
mSearchHash
unsigned long mSearchHash
Definition: client.cpp:136
textures_count
int textures_count
Definition: client.cpp:137
Client::testsInit
void testsInit()
Definition: client.cpp:160
Window
Definition: window.h:98
Button
Definition: button.h:96
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition: localconsts.h:52
Client::slowLogic
void slowLogic()
Definition: client.cpp:828
errorMessage
std::string errorMessage
Definition: client.cpp:115
Client::~Client
~Client()
Definition: client.cpp:381
localconsts.h
Client::moveButtons
void moveButtons(const int width)
Definition: client.cpp:773
Client::mAboutButton
Button * mAboutButton
Definition: client.h:104
Client::getState
StateT getState() const
Definition: client.h:68
Client::mButtonSpacing
int mButtonSpacing
Definition: client.h:116
noexcept2
#define noexcept2
Definition: localconsts.h:49
Client::mSkin
Skin * mSkin
Definition: client.h:114
Client::initSoundManager
void initSoundManager()
Definition: client.cpp:389
Client::setState
void setState(const StateT state)
Definition: client.h:65
ActionListener
Definition: actionlistener.h:77
Client::mSetupButton
Button * mSetupButton
Definition: client.h:101
final
#define final
Definition: localconsts.h:45
Client::focusWindow
void focusWindow()
Definition: client.cpp:808
Client::windowRemoved
void windowRemoved(const Window *const window)
Definition: client.cpp:802
start_time
time_t start_time
Definition: client.cpp:134
Client::mThemesButton
Button * mThemesButton
Definition: client.h:105
Client::gameExec
int gameExec()
Definition: client.cpp:576
Client::mPerfomanceButton
Button * mPerfomanceButton
Definition: client.h:106
tmwServerVersion
unsigned int tmwServerVersion
Definition: client.cpp:133
Client::mState
StateT mState
Definition: client.h:111
Client::Client
Client()
Definition: client.cpp:139
Client::logVars
static void logVars()
Definition: client.cpp:820
Client::mCurrentDialog
Window * mCurrentDialog
Definition: client.h:100
actionlistener.h
Client::mHelpButton
Button * mHelpButton
Definition: client.h:103
isSafeMode
bool isSafeMode
Definition: client.cpp:122
Client::mVideoButton
Button * mVideoButton
Definition: client.h:102
serverVersion
int serverVersion
Definition: client.cpp:123
Client::mOldState
StateT mOldState
Definition: client.h:112
Client::mButtonPadding
int mButtonPadding
Definition: client.h:115
Client
Definition: client.h:48
A_WARN_UNUSED
#define A_WARN_UNUSED
Definition: localconsts.h:160
Client::stateGame
void stateGame()
Definition: client.cpp:534
state.h
Client::gameInit
void gameInit()
Definition: client.cpp:169
Client::testsExec
static int testsExec()
Definition: client.cpp:832
Skin
Definition: skin.h:35
StateT
State ::T StateT
Definition: state.h:70
mLastHost
unsigned int mLastHost
Definition: client.cpp:135
Client::action
void action(const ActionEvent &event)
Definition: client.cpp:731
Client::gameClear
void gameClear()
Definition: client.cpp:434