ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

engines/stark/ui/screen.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef STARK_UI_SCREEN_H
00024 #define STARK_UI_SCREEN_H
00025 
00026 #include "common/array.h"
00027 #include "common/rect.h"
00028 
00029 #include "engines/stark/ui/window.h"
00030 
00031 namespace Stark {
00032 
00036 class Screen {
00037 public:
00038     enum Name {
00039         kScreenMainMenu,
00040         kScreenGame,
00041         kScreenFMV,
00042         kScreenDiaryIndex,
00043         kScreenSettingsMenu,
00044         kScreenSaveMenu,
00045         kScreenLoadMenu,
00046         kScreenFMVMenu,
00047         kScreenDiaryPages,
00048         kScreenDialog
00049     };
00050 
00051     explicit Screen(Name name) : _name(name) {};
00052     virtual ~Screen() {};
00053 
00055     Name getName() const { return _name; }
00056 
00058     virtual void open() {}
00059 
00061     virtual void close() {}
00062 
00064     virtual void render() = 0;
00065 
00067     virtual void handleGameLoop() {}
00068 
00070     virtual void onScreenChanged() {}
00071 
00072     virtual void handleMouseMove() = 0;
00073     virtual void handleClick() = 0;
00074     virtual void handleRightClick() = 0;
00075     virtual void handleDoubleClick() = 0;
00076 
00077 private:
00078     Name _name;
00079 };
00080 
00081 class SingleWindowScreen : public Screen, public Window {
00082 public:
00083     SingleWindowScreen(Name name, Gfx::Driver *gfx, Cursor *cursor) :
00084             Screen(name), Window(gfx, cursor) {}
00085 
00086     void handleGameLoop() override { Window::handleGameLoop(); }
00087     void render() override { Window::render(); }
00088 
00089     void handleMouseMove() override { Window::handleMouseMove(); }
00090     void handleClick() override { Window::handleClick(); }
00091     void handleRightClick() override { Window::handleRightClick(); }
00092     void handleDoubleClick() override { Window::handleDoubleClick(); }
00093 };
00094 
00095 } // End of namespace Stark
00096 
00097  #endif // STARK_UI_SCREEN_H


Generated on Sat Mar 16 2019 05:01:52 for ResidualVM by doxygen 1.7.1
curved edge   curved edge