ManaPlus
client.cpp
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-2017 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 #include "progs/dyecmd/client.h"
24 
25 #include "configmanager.h"
26 #include "dirs.h"
27 #include "eventsmanager.h"
28 #include "graphicsmanager.h"
29 #include "main.h"
30 #include "settings.h"
31 #include "soundmanager.h"
32 
33 #include "fs/virtfs/fs.h"
34 #include "fs/virtfs/tools.h"
35 
36 #include "gui/dialogsmanager.h"
37 #include "gui/gui.h"
38 #include "gui/skin.h"
39 #include "gui/popupmanager.h"
40 #include "gui/windowmanager.h"
41 
42 #include "gui/widgets/button.h"
44 #include "gui/widgets/desktop.h"
45 #include "gui/widgets/window.h"
47 
48 #include "input/inputmanager.h"
49 #include "input/joystick.h"
50 #include "input/keyboardconfig.h"
51 
53 
54 #include "resources/imagehelper.h"
55 
57 
59 
60 #include "utils/cpu.h"
61 #include "utils/delete2.h"
62 #include "utils/env.h"
63 #include "utils/fuzzer.h"
64 #include "utils/gettext.h"
65 #include "utils/gettexthelper.h"
66 #include "utils/mrand.h"
67 #ifdef ANDROID
68 #include "fs/paths.h"
69 #endif // ANDROID
70 #include "utils/sdlcheckutils.h"
71 #include "utils/sdlhelper.h"
72 #include "utils/timer.h"
73 
75 
76 #include "configuration.h"
77 
78 #include "net/ipc.h"
79 
80 #ifdef WIN32
81 PRAGMA48(GCC diagnostic push)
82 PRAGMA48(GCC diagnostic ignored "-Wshadow")
83 #include <SDL_syswm.h>
84 PRAGMA48(GCC diagnostic pop)
85 #include <sys/time.h>
86 #include "fs/specialfolder.h"
87 #undef ERROR
88 #endif // WIN32
89 
90 #ifdef ANDROID
91 #ifndef USE_SDL2
92 PRAGMA48(GCC diagnostic push)
93 PRAGMA48(GCC diagnostic ignored "-Wshadow")
94 #include <SDL_screenkeyboard.h>
95 PRAGMA48(GCC diagnostic pop)
96 #include <fstream>
97 #endif // USE_SDL2
98 #endif // ANDROID
99 
100 PRAGMA48(GCC diagnostic push)
101 PRAGMA48(GCC diagnostic ignored "-Wshadow")
102 #ifdef USE_SDL2
103 #include <SDL2_framerate.h>
104 #else // USE_SDL2
105 #include <SDL_framerate.h>
106 #endif // USE_SDL2
107 PRAGMA48(GCC diagnostic pop)
108 
109 #include "debug.h"
110 
111 std::string errorMessage;
112 
113 Client *client = nullptr;
114 
115 extern FPSmanager fpsManager;
116 
117 volatile bool runCounters;
118 bool isSafeMode = false;
121 unsigned int tmwServerVersion = 0;
122 time_t start_time;
123 unsigned int mLastHost = 0;
124 unsigned long mSearchHash = 0;
126 
128  ActionListener(),
129  mCurrentDialog(nullptr),
130  mSetupButton(nullptr),
131  mVideoButton(nullptr),
132  mHelpButton(nullptr),
133  mAboutButton(nullptr),
134  mThemesButton(nullptr),
135  mPerfomanceButton(nullptr),
136 #ifdef ANDROID
137  mCloseButton(nullptr),
138 #endif // ANDROID
139  mState(State::GAME),
140  mOldState(State::START),
141  mSkin(nullptr),
142  mButtonPadding(1),
143  mButtonSpacing(3)
144 {
146 }
147 
149 {
150 }
151 
153 {
154 }
155 
156 // +++ need remove duplicate from here
158 {
159  logger = new Logger;
160  SDL::initLogger();
161 
162  initRand();
163 
164  // Load branding information
165  if (!settings.options.brandingPath.empty())
168 
171 
172  // Configure logger
173  if (!settings.options.logFileName.empty())
174  {
176  }
177  else
178  {
180  "manaplus.log");
181  }
183 
184 #ifdef USE_FUZZER
185  Fuzzer::init();
186 #endif // USE_FUZZER
187 
188  if (settings.options.test.empty())
189  ConfigManager::backupConfig("config.xml");
191  SDL::setLogLevel(config.getIntValue("sdlLogLevel"));
193  initPaths();
194  logger->log("init 4");
195  logger->setDebugLog(config.getBoolValue("debugLog"));
196  logger->setReportUnimplemented(config.getBoolValue("unimplimentedLog"));
197 
198  config.incValue("runcount");
199 
200 #ifndef ANDROID
201  if (settings.options.test.empty())
203 #endif // ANDROID
204 
206  {
207  logger->error(strprintf("%s couldn't be set as home directory! "
208  "Exiting.", settings.localDataDir.c_str()));
209  }
210 
212 
213 /*
214  chatLogger = new ChatLogger;
215  if (settings.options.chatLogDir.empty())
216  {
217  chatLogger->setBaseLogDir(settings.localDataDir
218  + std::string("/logs/"));
219  }
220  else
221  {
222  chatLogger->setBaseLogDir(settings.options.chatLogDir);
223  }
224 */
225  // Log the client version
227  logger->log("Start configPath: " + config.getConfigPath());
228 
230 
231  // Initialize SDL
232  logger->log1("Initializing SDL...");
233  if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)
234  {
235  logger->safeError(strprintf("Could not initialize SDL: %s",
236  SDL_GetError()));
237  }
238  atexit(SDL_Quit);
239 
240 #ifndef USE_SDL2
241  SDL_EnableUNICODE(1);
242 #endif // USE_SDL2
243 
247 
248 #ifdef WIN32
250 #endif // WIN32
251 #ifndef USE_SDL2
253 #endif // USE_SDL2
254 
256  logVars();
257  Cpu::detect();
259 #if defined(USE_OPENGL)
260 #if !defined(ANDROID) && !defined(__APPLE__) && !defined(__native_client__)
261  if (!settings.options.safeMode && settings.options.test.empty()
262  && !config.getBoolValue("videodetected"))
263  {
265  }
266 #endif // !defined(ANDROID) && !defined(__APPLE__) &&
267  // !defined(__native_client__)
268 #endif // defined(USE_OPENGL)
269 
270  updateEnv();
271  SDL::allowScreenSaver(config.getBoolValue("allowscreensaver"));
272  initGraphics();
273 
274 #ifndef WIN32
277 #endif // WIN32
278 
280 
281  // Add the main data directories to our VirtFs search path
282  if (!settings.options.dataPath.empty())
283  {
285  Append_false);
286  }
287 
288  // Add the local data directory to VirtFs search path
290  Append_false);
293 #ifdef ENABLE_CUSTOMNLS
294  TranslationManager::loadGettextLang();
295 #endif // ENABLE_CUSTOMNLS
296 
297 #ifdef USE_SDL2
299 #endif // USE_SDL2
301 
303 
304  theme = new Theme;
306  touchManager.init();
307 
308  // Initialize the item and emote shortcuts.
309 // for (size_t f = 0; f < SHORTCUT_TABS; f ++)
310 // itemShortcut[f] = new ItemShortcut(f);
311 // emoteShortcut = new EmoteShortcut;
312 // dropShortcut = new DropShortcut;
313 
314  gui = new Gui;
318 
320 
321  // Initialize keyboard
322  keyboard.init();
323  inputManager.init();
324 
325  // Initialise player relations
326  Joystick::init();
328 
329  keyboard.update();
330  if (joystick != nullptr)
331  joystick->update();
332 
333 // if (mState != State::ERROR)
334 // mState = State::CHOOSE_SERVER;
335 
336  startTimers();
337 
338  const int fpsLimit = config.getIntValue("fpslimit");
339  settings.limitFps = fpsLimit > 0;
340 
341  SDL_initFramerate(&fpsManager);
342  WindowManager::setFramerate(fpsLimit);
343 
344  start_time = time(nullptr);
345 
346 // PlayerInfo::init();
347 
348 #ifdef ANDROID
349 #ifndef USE_SDL2
350  WindowManager::updateScreenKeyboard(SDL_GetScreenKeyboardHeight(nullptr));
351 #endif // USE_SDL2
352 #endif // ANDROID
353 
354  mSkin = theme->load("windowmenu.xml", "");
355  if (mSkin != nullptr)
356  {
358  mButtonSpacing = mSkin->getOption("spacing", 3);
359  }
360 }
361 
363 {
365  gameClear();
366  else
367  testsClear();
368 }
369 
371 {
372  // Initialize sound engine
373  try
374  {
375  if (config.getBoolValue("sound"))
376  soundManager.init();
377 
380  }
381  catch (const char *const err)
382  {
384  errorMessage = err;
385  logger->log("Warning: %s", err);
386  }
388  "loginMusic",
389  "Magick - Real.ogg"),
391 }
392 
394 {
395 #ifndef USE_SDL2
397 #endif // USE_SDL2
398 
399  runCounters = config.getBoolValue("packetcounters");
400 
402 
403 #ifdef USE_SDL2
405 #endif // USE_SDL2
406 
411 
413 }
414 
416 {
417  if (logger != nullptr)
418  logger->log1("Quitting1");
419 
422  if (windowContainer != nullptr)
424 
425  stopTimers();
426 
427  delete2(ipc);
428 
429  if (logger != nullptr)
430  logger->log1("Quitting2");
431 
435  delete2(gui);
436 
437  if (logger != nullptr)
438  logger->log1("Quitting3");
439 
441 
442  if (logger != nullptr)
443  logger->log1("Quitting4");
444 
445  XML::cleanupXML();
446 
447  if (logger != nullptr)
448  logger->log1("Quitting5");
449 
451 
452  if (logger != nullptr)
453  logger->log1("Quitting6");
454 
457 
459 
460  if (logger != nullptr)
461  logger->log1("Quitting8");
462 
464 
465  if (logger != nullptr)
466  logger->log1("Quitting9");
467 
468  delete2(joystick);
469 
470  keyboard.deinit();
471 
472  if (logger != nullptr)
473  logger->log1("Quitting10");
474 
476 
477 #ifdef DEBUG_CONFIG
478  config.enableKeyLogging();
479 #endif // DEBUG_CONFIG
480 
482  config.write();
484 
485  config.clear();
487 
488  if (logger != nullptr)
489  logger->log1("Quitting11");
490 
491 #ifdef USE_PROFILER
493 #endif // USE_PROFILER
494 
495 #ifdef DEBUG_OPENGL_LEAKS
496  if (logger)
497  logger->log("textures left: %d", textures_count);
498 #endif // DEBUG_OPENGL_LEAKS
499 
501 
502  if (logger != nullptr)
503  logger->log1("Quitting12");
504 
505 // delete2(chatLogger);
507  VirtFs::deinit();
508 }
509 
510 #define ADDBUTTON(var, object) var = object; \
511  x -= var->getWidth() + mButtonSpacing; \
512  var->setPosition(x, mButtonPadding); \
513  top->add(var);
514 
516 {
517  if (gui == nullptr)
518  return;
519 
520  BasicContainer2 *const top = static_cast<BasicContainer2*>(
521  gui->getTop());
522 
523  if (top == nullptr)
524  return;
525 
526  CREATEWIDGETV(desktop, Desktop, nullptr);
527  top->add(desktop);
528  int x = top->getWidth() - mButtonPadding;
530  // TRANSLATORS: setup tab quick button
531  _("Setup"), "Setup", this))
533  // TRANSLATORS: perfoamance tab quick button
534  _("Performance"), "Perfomance", this))
536  // TRANSLATORS: video tab quick button
537  _("Video"), "Video", this))
539  // TRANSLATORS: theme tab quick button
540  _("Theme"), "Themes", this))
542  // TRANSLATORS: theme tab quick button
543  _("About"), "about", this))
545  // TRANSLATORS: theme tab quick button
546  _("Help"), "help", this))
547 #ifdef ANDROID
548  ADDBUTTON(mCloseButton, new Button(desktop,
549  // TRANSLATORS: close quick button
550  _("Close"), "close", this))
551 #endif // ANDROID
552 
555 }
556 
558 {
559  int lastTickTime = tick_time;
560 
561  while (mState != State::EXIT)
562  {
563  PROFILER_START();
565  continue;
566 
567  BLOCK_START("Client::gameExec 4")
568  if (gui != nullptr)
569  gui->logic();
570  cur_time = time(nullptr);
571  int k = 0;
572  while (lastTickTime != tick_time && k < 40)
573  {
574 // if (mGame)
575 // mGame->logic();
576 // else
577  if (gui != nullptr)
578  gui->handleInput();
579 
580  ++lastTickTime;
581  k ++;
582  }
584 
585  logic_count += k;
586  if (gui != nullptr)
587  gui->slowLogic();
588 // if (mGame)
589 // mGame->slowLogic();
590  slowLogic();
591  BLOCK_END("Client::gameExec 4")
592 
593  // This is done because at some point tick_time will wrap.
594  lastTickTime = tick_time;
595 
596  // Update the screen when application is visible, delay otherwise.
598  {
599  frame_count++;
600  if (gui != nullptr)
601  gui->draw();
603  }
604  else
605  {
606  SDL_Delay(100);
607  }
608 
609  BLOCK_START("~Client::SDL_framerateDelay")
610  if (settings.limitFps)
611  SDL_framerateDelay(&fpsManager);
612  BLOCK_END("~Client::SDL_framerateDelay")
613 
614  BLOCK_START("Client::gameExec 6")
615 /*
616  if (mState == State::CONNECT_GAME)
617  {
618  stateConnectGame1();
619  }
620 */
621  BLOCK_END("Client::gameExec 6")
622 
623  if (mState != mOldState)
624  {
625  BLOCK_START("Client::gameExec 7")
626 
627  mOldState = mState;
628 
629  // Get rid of the dialog of the previous state
631 
632  // State has changed, while the quitDialog was active, it might
633  // not be correct anymore
634 /*
635  if (mQuitDialog)
636  {
637  mQuitDialog->scheduleDelete();
638  mQuitDialog = nullptr;
639  }
640 */
641  BLOCK_END("Client::gameExec 7")
642 
643  BLOCK_START("Client::gameExec 8")
644  PRAGMA45(GCC diagnostic push)
645  PRAGMA45(GCC diagnostic ignored "-Wswitch-enum")
646  switch (mState)
647  {
648  case State::GAME:
649  stateGame();
650  break;
651 
652  case State::LOAD_DATA:
653  {
654  BLOCK_START("Client::gameExec State::LOAD_DATA")
655  logger->log1("State: LOAD DATA");
656 
657  // If another data path has been set,
658  // we don't load any other files...
659  if (settings.options.dataPath.empty())
660  {
661  // Add customdata directory
663  "customdata/",
664  "zip",
665  Append_false);
666  }
667 
669  {
671  settings.updatesDir, "local/"),
672  "zip",
673  Append_false);
674 
678  "local/"),
679  Append_false);
680  }
681 
682  logger->log("Init paths");
683  paths.init("paths.xml", UseVirtFs_true);
685  initPaths();
688 
689  if (desktop != nullptr)
691 
693  BLOCK_END("Client::gameExec State::LOAD_DATA")
694  break;
695  }
696  case State::START:
697  default:
699  break;
700  }
701  PRAGMA45(GCC diagnostic pop)
702  BLOCK_END("Client::gameExec 8")
703  }
704  PROFILER_END();
705  }
706 
707  return 0;
708 }
709 
710 void Client::action(const ActionEvent &event)
711 {
712  std::string tab;
713  const std::string &eventId = event.getId();
714 
715  if (eventId == "close")
716  {
718  return;
719  }
720  if (eventId == "Setup")
721  {
722  tab.clear();
723  }
724  else if (eventId == "help")
725  {
727  return;
728  }
729  else if (eventId == "about")
730  {
732  return;
733  }
734  else if (eventId == "Video")
735  {
736  tab = "Video";
737  }
738  else if (eventId == "Themes")
739  {
740  tab = "Theme";
741  }
742  else if (eventId == "Perfomance")
743  {
744  tab = "Perfomance";
745  }
746  else
747  {
748  return;
749  }
750 }
751 
752 void Client::moveButtons(const int width)
753 {
754  if (mSetupButton != nullptr)
755  {
756  int x = width - mSetupButton->getWidth() - mButtonPadding;
758 #ifndef WIN32
761 
764 
767 
770 
773 #ifdef ANDROID
774  x -= mCloseButton->getWidth() + mButtonSpacing;
775  mCloseButton->setPosition(x, mButtonPadding);
776 #endif // ANDROID
777 #endif // WIN32
778  }
779 }
780 
781 void Client::windowRemoved(const Window *const window)
782 {
783  if (mCurrentDialog == window)
784  mCurrentDialog = nullptr;
785 }
786 
788 {
789 #ifdef ANDROID
790  logger->log("APPDIR: %s", getenv("APPDIR"));
791  logger->log("DATADIR2: %s", getSdStoragePath().c_str());
792 #endif // ANDROID
793 }
794 
796 {
797 }
798 
800 {
801  return 0;
802 }
803 
805 {
806  const std::string &name = settings.serverName;
807  if (name == "server.themanaworld.org"
808  || name == "themanaworld.org"
809  || name == "167.114.185.71")
810  {
811  return true;
812  }
813  return false;
814 }
815 
817 {
818 }
Definition: logger.h:67
void setSize(const int width, const int height)
Definition: widget.cpp:366
void gameInit()
Definition: client.cpp:157
Configuration branding
void testsClear()
Definition: client.cpp:152
bool deinit()
Definition: fs.cpp:784
std::string test
Definition: options.h:87
static bool isTmw()
Definition: client.cpp:804
Uint32 SDL_framerateDelay(FPSmanager *manager)
Delay execution to maintain a constant framerate and calculate fps.
void slowLogic()
Definition: gui.cpp:322
#define _(s)
Definition: gettext.h:34
void logic()
Definition: gui.cpp:301
int getWidth() const
Definition: widget.h:220
void log1(const char *const log_text)
Definition: logger.cpp:222
StateT mOldState
Definition: client.h:108
ImageHelper * imageHelper
Definition: imagehelper.cpp:43
std::string logFileName
Definition: options.h:82
int packetVersion
Definition: client.cpp:120
std::string updatesDir
Definition: settings.h:108
std::string serverName
Definition: settings.h:112
static void storeSafeParameters()
unsigned int tmwServerVersion
Definition: client.cpp:121
#define PROFILER_END()
Definition: perfomance.h:77
volatile bool runCounters
Definition: client.cpp:117
volatile int tick_time
Definition: timer.cpp:52
Gui * gui
Definition: gui.cpp:110
void setState(const StateT state)
Definition: client.h:65
time_t start_time
Definition: client.cpp:122
Joystick * joystick
Definition: joystick.cpp:42
WindowContainer * windowContainer
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wunused-result") int TestLauncher
bool mountDir(std::string newDir, const Append append)
Definition: fs.cpp:392
void setBrandingDefaults(Configuration &cfg)
Definition: defaults.cpp:471
void init()
Definition: playerinfo.cpp:446
Options options
Definition: settings.h:128
static void initLang()
static void deleteRenderers()
static void extractDataDir() A_CONST
Definition: dirs.cpp:178
int textures_count
Definition: client.cpp:125
static void backupConfig(const std::string &name)
int mButtonPadding
Definition: client.h:111
volatile int frame_count
Definition: timer.cpp:55
std::string pathJoin(std::string str1, const std::string &str2)
Definition: window.h:98
#define BLOCK_START(name)
Definition: perfomance.h:78
Definition: button.h:94
SoundManager soundManager
Button * mVideoButton
Definition: client.h:98
Configuration config
void clear()
Definition: playerinfo.cpp:464
static void updateDataPath()
Definition: dirs.cpp:160
static void initFunctions()
Definition: dyepalette.cpp:252
PopupManager * popupManager
bool limitFps
Definition: settings.h:151
#define BLOCK_END(name)
Definition: perfomance.h:79
IPC * ipc
Definition: ipc.cpp:36
static void selectSkin()
Definition: theme.cpp:597
virtual void updateScreen()=0
int getIntValue(const std::string &key) const
std::string brandingPath
Definition: options.h:78
void draw()
Definition: gui.cpp:469
StateT mState
Definition: client.h:107
Client * client
Definition: client.cpp:113
#define CREATEWIDGETV(var, type,...)
Definition: createwidget.h:24
#define delete2(var)
Definition: delete2.h:24
const Image *restrict const top
Configuration serverConfig
Definition: gui.h:115
int getWidth() const
Definition: graphics.cpp:642
int getOption(const std::string &name) const
Definition: skin.h:105
Logger * logger
Definition: logger.cpp:95
std::string localDataDir
Definition: settings.h:110
void searchAndAddArchives(const std::string &path, const std::string &ext, const Append append)
Definition: tools.cpp:40
void postInit(Graphics *const graphics)
Definition: gui.cpp:150
Button * mAboutButton
Definition: client.h:100
void testsInit()
Definition: client.cpp:148
void update()
Definition: joystick.cpp:350
std::string errorMessage
Definition: client.cpp:111
Settings settings
Definition: settings.cpp:31
int getPadding() const
Definition: skin.h:99
bool safeMode
Definition: options.h:97
const bool UseVirtFs_true
Definition: usevirtfs.h:29
bool getBoolValue(const std::string &key) const
volatile int logic_count
Definition: timer.cpp:56
FPSmanager fpsManager
bool handleInput()
Definition: gui.cpp:387
std::string logFileName
Definition: settings.h:120
virtual void beginDraw()
Definition: graphics.h:440
const std::string & getConfigPath() const
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
void setFramerate(const unsigned int fpsLimit)
Button * mSetupButton
Definition: client.h:97
static void initRootDir()
Definition: dirs.cpp:265
void startTimers()
Definition: timer.cpp:112
void updateScreenKeyboard(const int height)
static void cleanUp()
Definition: graphics.cpp:158
void setLogLevel(const int level)
Definition: sdlhelper.cpp:190
void safeError(const std::string &error_text) __attribute__((noreturn))
Definition: logger.cpp:378
int getHeight() const
Definition: graphics.cpp:647
virtual void add(Widget *const widget)
void moveButtons(const int width)
Definition: client.cpp:752
void setDebugLog(const bool n)
Definition: logger.h:178
int gameExec()
Definition: client.cpp:557
static void loadCurrentLang()
bool skipUpdate
Definition: options.h:94
#define nullptr
Definition: localconsts.h:44
Graphics * mainGraphics
Definition: graphics.cpp:108
void setSfxVolume(const int volume)
Definition: theme.h:52
void setPosition(const int x, const int y)
Definition: widget.cpp:160
static int testsExec()
Definition: client.cpp:799
#define PRAGMA48(str)
Definition: localconsts.h:214
unsigned int mLastHost
Definition: client.cpp:123
#define PROFILER_START()
Definition: perfomance.h:76
volatile time_t cur_time
Definition: timer.cpp:57
#define FULL_VERSION
Definition: main.h:163
void initSoundManager()
Definition: client.cpp:370
Definition: client.h:48
std::string dataPath
Definition: options.h:80
void setMusicVolume(const int volume)
void slowLogic()
Definition: client.cpp:795
EventsManager eventsManager
int serverVersion
Definition: client.cpp:119
bool handleEvents() const
void initRand()
Definition: mrand.cpp:34
Skin * load(const std::string &filename, const std::string &filename2, const bool full=true, const std::string &defaultPath=getThemePath())
Definition: theme.cpp:178
Structure holding the state and timing information of the framerate controller.
Configuration paths
bool isSafeMode
Definition: client.cpp:118
void playMusic(const std::string &fileName, const SkipError skipError)
const bool Append_false
Definition: append.h:29
void stateGame()
Definition: client.cpp:515
std::string getValue(const std::string &key, const std::string &deflt) const
Theme * theme
Definition: theme.cpp:61
Window * mCurrentDialog
Definition: client.h:96
Widget * getTop() const
Definition: gui.h:247
Skin * mSkin
Definition: client.h:110
bool testMode
Definition: options.h:98
bool setWriteDir(const std::string &newDir)
Definition: fs.cpp:330
void reloadWallpaper()
Definition: desktop.cpp:114
void initLogger()
Definition: sdlhelper.cpp:186
Client()
Definition: client.cpp:127
Button * mPerfomanceButton
Definition: client.h:102
void windowRemoved(const Window *const window)
Definition: client.cpp:781
~Client()
Definition: client.cpp:362
void detect()
Definition: cpu.cpp:45
Button * mThemesButton
Definition: client.h:101
void stopTimers()
Definition: timer.cpp:120
void setLogFile(const std::string &logFilename)
Definition: logger.cpp:118
static void mountDataDir()
Definition: dirs.cpp:197
void SDL_initFramerate(FPSmanager *manager)
Initialize the framerate manager.
virtual void postInit()
Definition: graphics.h:461
#define ADDBUTTON(var, object)
Definition: client.cpp:510
void setConfigDefaults2(Configuration &cfg)
Definition: defaults.cpp:424
KeyboardConfig keyboard
static void logVars()
Definition: client.cpp:787
void gameClear()
Definition: client.cpp:415
static void initGraphics()
Definition: client.cpp:393
static void initScreenshotDir()
Definition: dirs.cpp:535
InputManager inputManager
TouchManager touchManager
void init(const std::string &filename, const UseVirtFs useResManager=UseVirtFs_false, const SkipError skipError=SkipError_false)
void error(const std::string &error_text) __attribute__((noreturn))
Definition: logger.cpp:415
void allowScreenSaver(const bool allow)
Definition: sdlhelper.cpp:209
static void loadDictionaryLang()
Button * mHelpButton
Definition: client.h:99
void log(const char *const log_text,...)
Definition: logger.cpp:243
const bool SkipError_true
Definition: skiperror.h:29
Desktop * desktop
Definition: desktop.cpp:48
unsigned long mSearchHash
Definition: client.cpp:124
void cleanupXML()
Definition: libxml.cpp:312
void action(const ActionEvent &event)
Definition: client.cpp:710
static void initConfiguration()
DialogsManager * dialogsManager
void updateEnv()
Definition: env.cpp:29
void incValue(const std::string &key)
virtual void postInit()
Definition: imagehelper.h:109
Definition: state.h:32
GraphicsManager graphicsManager
void executeAction(const InputActionT keyNum)
static void init()
Definition: joystick.cpp:72
void setReportUnimplemented(const bool n)
Definition: logger.h:181
static void initHomeDir()
Definition: dirs.cpp:325
int mButtonSpacing
Definition: client.h:112
static void checkConfigVersion()
static void initPaths()
Definition: client.cpp:816
void setPathsDefaults(Configuration &cfg)
Definition: defaults.cpp:531