diff options
author | VelocityRa | 2017-04-02 01:34:15 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-17 23:45:22 +0200 |
commit | f2f420e15fb1b7f1e8e9897550bbc0abbca438c8 (patch) | |
tree | 48ff35497a60dddbd0fdb6c352e6273912c43854 /graphics | |
parent | b28a4a8c3d4175d90b444cbc0a51508f6f8cc753 (diff) | |
download | scummvm-rg350-f2f420e15fb1b7f1e8e9897550bbc0abbca438c8.tar.gz scummvm-rg350-f2f420e15fb1b7f1e8e9897550bbc0abbca438c8.tar.bz2 scummvm-rg350-f2f420e15fb1b7f1e8e9897550bbc0abbca438c8.zip |
GRAPHICS: Skeleton of MacTextWindow
Needed to add 2 helper methods to MacWindowManager to make it cleaner
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/macgui/mactextwindow.cpp | 36 | ||||
-rw-r--r-- | graphics/macgui/mactextwindow.h | 36 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.cpp | 17 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.h | 11 | ||||
-rw-r--r-- | graphics/module.mk | 1 |
5 files changed, 95 insertions, 6 deletions
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp new file mode 100644 index 0000000000..fc41be4fd0 --- /dev/null +++ b/graphics/macgui/mactextwindow.cpp @@ -0,0 +1,36 @@ +/* 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 + * 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. + * + */ + +#include "graphics/macgui/macwindowmanager.h" +#include "graphics/macgui/mactextwindow.h" + +namespace Graphics { + +MacTextWindow::MacTextWindow(MacWindowManager *wm) : + MacWindow(wm->getNextId(), true, true, true, wm) { + wm->addWindowInitialized(this); +} + +MacTextWindow::~MacTextWindow() { +} + +} // End of namespace Graphics diff --git a/graphics/macgui/mactextwindow.h b/graphics/macgui/mactextwindow.h new file mode 100644 index 0000000000..2e1cf4f3fe --- /dev/null +++ b/graphics/macgui/mactextwindow.h @@ -0,0 +1,36 @@ +/* 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 + * 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. + * + */ + +#ifndef GRAPHICS_MACGUI_MACTEXTWINDOW_H +#define GRAPHICS_MACGUI_MACTEXTWINDOW_H + +namespace Graphics { + +class MacTextWindow : public MacWindow { +public: + MacTextWindow(MacWindowManager *wm); + ~MacTextWindow(); +}; + +} // End of namespace Graphics + +#endif diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 53299599f7..b64ff1048f 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -178,20 +178,25 @@ MacWindow *MacWindowManager::addWindow(bool scrollable, bool resizable, bool edi _windows.push_back(w); _windowStack.push_back(w); - setActive(_lastId); - - _lastId++; + setActive(getNextId()); return w; } +void MacWindowManager::addWindowInitialized(MacWindow *macwindow) { + _windows.push_back(macwindow); + _windowStack.push_back(macwindow); +} + +int MacWindowManager::getNextId() { + return _lastId++; +} + MacMenu *MacWindowManager::addMenu() { - _menu = new MacMenu(_lastId, _screen->getBounds(), this); + _menu = new MacMenu(getNextId(), _screen->getBounds(), this); _windows.push_back(_menu); - _lastId++; - return _menu; } diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h index bd597f6626..ec7f4f1341 100644 --- a/graphics/macgui/macwindowmanager.h +++ b/graphics/macgui/macwindowmanager.h @@ -104,6 +104,17 @@ public: */ MacWindow *addWindow(bool scrollable, bool resizable, bool editable); /** + * Adds a window that has already been initialized to the registry. + * Like addWindow, but this doesn't create/allocate the Window. + * @param macWindow the window to be added to the registry + */ + void addWindowInitialized(MacWindow *macwindow); + /** + * Returns the next available id and the increments the internal counter. + * @return next (new) window id that can be used + */ + int getNextId(); + /** * Add the menu to the desktop. * Note that the returned menu is empty, and therefore must be filled * afterwards. diff --git a/graphics/module.mk b/graphics/module.mk index d862ee840a..dbe5a3b084 100644 --- a/graphics/module.mk +++ b/graphics/module.mk @@ -16,6 +16,7 @@ MODULE_OBJS := \ macgui/macfontmanager.o \ macgui/macmenu.o \ macgui/mactext.o \ + macgui/mactextwindow.o \ macgui/macwindow.o \ macgui/macwindowborder.o \ macgui/macwindowmanager.o \ |