scummvm/backends/platform/tizen/system.h

103 lines
2.9 KiB
C
Raw Normal View History

2011-08-07 21:33:32 +10:00
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2011-08-07 21:33:32 +10:00
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
2013-06-25 21:08:55 +10:00
#ifndef TIZEN_SYSTEM_H
#define TIZEN_SYSTEM_H
2011-08-07 21:33:32 +10:00
#include <FApp.h>
#include <FGraphics.h>
#include <FUi.h>
#include <FSystem.h>
#include <FBase.h>
#include <FIoFile.h>
#include "config.h"
#include "common/scummsys.h"
#include "backends/modular-backend.h"
2013-06-25 21:08:55 +10:00
#include "backends/platform/tizen/fs.h"
#include "backends/platform/tizen/form.h"
#include "backends/platform/tizen/audio.h"
#include "backends/platform/tizen/graphics.h"
2011-08-07 21:33:32 +10:00
#if defined(_DEBUG)
2013-06-25 21:08:55 +10:00
#define logEntered() AppLog("%s entered (%s %d)", __FUNCTION__, __FILE__, __LINE__);
#define logLeaving() AppLog("%s leaving (%s %d)", __FUNCTION__, __FILE__, __LINE__);
2011-08-07 21:33:32 +10:00
#else
#define logEntered()
#define logLeaving()
#endif
2013-06-25 21:08:55 +10:00
TizenAppForm *systemStart(Tizen::App::Application *app);
2011-08-07 21:33:32 +10:00
void systemError(const char *message);
2013-06-25 21:08:55 +10:00
#define USER_MESSAGE_EXIT 1000
#define USER_MESSAGE_EXIT_ERR 1001
#define USER_MESSAGE_EXIT_ERR_CONFIG 1002
2011-08-07 21:33:32 +10:00
//
2013-06-25 21:08:55 +10:00
// TizenSystem
2011-08-07 21:33:32 +10:00
//
2013-06-25 21:08:55 +10:00
class TizenSystem :
public ModularBackend,
Common::EventSource {
2011-08-07 21:33:32 +10:00
public:
2013-06-25 21:08:55 +10:00
TizenSystem(TizenAppForm *appForm);
~TizenSystem();
2011-08-07 21:33:32 +10:00
result Construct();
void closeAudio();
void closeGraphics();
void destroyBackend();
void setMute(bool on);
void exitSystem();
bool isClosing() { return _appForm->isClosing(); }
2013-06-25 21:08:55 +10:00
TizenGraphicsManager *getGraphics() {
return (TizenGraphicsManager *)_graphicsManager;
2011-08-07 21:33:32 +10:00
}
private:
void initBackend();
result initModules();
void updateScreen();
bool pollEvent(Common::Event &event);
2013-05-17 00:18:09 +03:00
uint32 getMillis(bool skipRecord = false);
2011-08-07 21:33:32 +10:00
void delayMillis(uint msecs);
void getTimeAndDate(TimeDate &t) const;
void fatalError();
void logMessage(LogMessageType::Type type, const char *message);
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);
2011-08-07 21:33:32 +10:00
Common::EventSource *getDefaultEventSource() { return this; }
2011-08-07 21:33:32 +10:00
Common::SeekableReadStream *createConfigReadStream();
Common::WriteStream *createConfigWriteStream();
2011-08-22 09:46:30 +02:00
2013-06-25 21:08:55 +10:00
TizenAppForm *_appForm;
2011-08-07 21:33:32 +10:00
AudioThread *_audioThread;
long long _epoch;
2013-06-25 21:08:55 +10:00
Common::String _resourcePath;
2011-08-07 21:33:32 +10:00
};
#endif