[Scummvm-cvs-logs] SF.net SVN: scummvm:[53832] scummvm/trunk/engines/sword25

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Oct 25 23:51:11 CEST 2010


Revision: 53832
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53832&view=rev
Author:   fingolfin
Date:     2010-10-25 21:51:11 +0000 (Mon, 25 Oct 2010)

Log Message:
-----------
SWORD25: Get rid of classes ScummVMWindow and Window

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/input/inputengine.cpp
    scummvm/trunk/engines/sword25/kernel/kernel.cpp
    scummvm/trunk/engines/sword25/kernel/kernel.h
    scummvm/trunk/engines/sword25/kernel/kernel_script.cpp
    scummvm/trunk/engines/sword25/module.mk

Removed Paths:
-------------
    scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp
    scummvm/trunk/engines/sword25/kernel/scummvmwindow.h
    scummvm/trunk/engines/sword25/kernel/window.cpp
    scummvm/trunk/engines/sword25/kernel/window.h

Modified: scummvm/trunk/engines/sword25/input/inputengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/input/inputengine.cpp	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/input/inputengine.cpp	2010-10-25 21:51:11 UTC (rev 53832)
@@ -122,10 +122,6 @@
 			alterKeyboardState(event.kbd.keycode, (event.type == Common::EVENT_KEYDOWN) ? 0x80 : 0);
 			break;
 
-		case Common::EVENT_QUIT:
-			Kernel::getInstance()->getWindow()->setWindowAlive(false);
-			break;
-
 		default:
 			break;
 		}

Modified: scummvm/trunk/engines/sword25/kernel/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel.cpp	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/kernel/kernel.cpp	2010-10-25 21:51:11 UTC (rev 53832)
@@ -50,7 +50,6 @@
 Kernel *Kernel::_instance = 0;
 
 Kernel::Kernel() :
-	_pWindow(NULL),
 	_running(false),
 	_pResourceManager(NULL),
 	_initSuccess(false) {
@@ -74,13 +73,6 @@
 			_superclasses.push_back(new Superclass(this, BS_SERVICE_TABLE[i].superclassId));
 	}
 
-	// Create window object
-	_pWindow = Window::createBSWindow(0, 0, 0, 0, false);
-	if (!_pWindow) {
-		BS_LOG_ERRORLN("Failed to create the window.");
-	} else
-		BS_LOGLN("Window created.");
-
 	// Create the resource manager
 	_pResourceManager = new ResourceManager(this);
 
@@ -117,10 +109,6 @@
 		_superclasses.pop_back();
 	}
 
-	// Release the window object
-	delete _pWindow;
-	BS_LOGLN("Window destroyed.");
-
 	// Resource-Manager freigeben
 	delete _pResourceManager;
 

Modified: scummvm/trunk/engines/sword25/kernel/kernel.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel.h	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/kernel/kernel.h	2010-10-25 21:51:11 UTC (rev 53832)
@@ -52,7 +52,6 @@
 #include "engines/engine.h"
 
 #include "sword25/kernel/common.h"
-#include "sword25/kernel/window.h"
 #include "sword25/kernel/resmanager.h"
 
 namespace Sword25 {
@@ -74,16 +73,7 @@
 */
 class Kernel {
 public:
-	// Window methods
-	// ----------------
 
-	/**
-	 * Returns a pointer to the window object
-	 */
-	Window *getWindow() {
-		return _pWindow;
-	}
-
 	// Service Methods
 	// ---------------
 
@@ -291,10 +281,6 @@
 	bool _initSuccess; // Specifies whether the engine was set up correctly
 	bool _running;  // Specifies whether the application should keep running on the next main loop iteration
 
-	// Active window
-	// -------------
-	Window *_pWindow;
-
 	// Random number generator
 	// -----------------------
 	Common::RandomSource _rnd;

Modified: scummvm/trunk/engines/sword25/kernel/kernel_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel_script.cpp	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/kernel/kernel_script.cpp	2010-10-25 21:51:11 UTC (rev 53832)
@@ -35,7 +35,6 @@
 #include "sword25/kernel/common.h"
 #include "sword25/kernel/kernel.h"
 #include "sword25/kernel/filesystemutil.h"
-#include "sword25/kernel/window.h"
 #include "sword25/kernel/resmanager.h"
 #include "sword25/kernel/persistenceservice.h"
 #include "sword25/script/script.h"
@@ -213,200 +212,149 @@
 };
 
 static int isVisible(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushbooleancpp(L, true);
 
-	lua_pushbooleancpp(L, pWindow->isVisible());
-
 	return 1;
 }
 
 static int setVisible(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+//	pWindow->setVisible(lua_tobooleancpp(L, 1));
 
-	pWindow->setVisible(lua_tobooleancpp(L, 1));
-
 	return 0;
 }
 
 static int getX(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushnumber(L, 0);
 
-	lua_pushnumber(L, pWindow->getX());
-
 	return 1;
 }
 
 static int getY(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushnumber(L, 0);
 
-	lua_pushnumber(L, pWindow->getY());
-
 	return 1;
 }
 
 static int setX(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This is called by system/boot.lua with -1 as value.
+//	pWindow->setX(static_cast<int>(luaL_checknumber(L, 1)));
 
-	pWindow->setX(static_cast<int>(luaL_checknumber(L, 1)));
-
 	return 0;
 }
 
 static int setY(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This is called by system/boot.lua with -1 as value.
+//	pWindow->setY(static_cast<int>(luaL_checknumber(L, 1)));
 
-	pWindow->setY(static_cast<int>(luaL_checknumber(L, 1)));
-
 	return 0;
 }
 
 static int getClientX(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushnumber(L, 0);
 
-	lua_pushnumber(L, pWindow->getClientX());
-
 	return 1;
 }
 
 static int getClientY(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushnumber(L, 0);
 
-	lua_pushnumber(L, pWindow->getClientY());
-
 	return 1;
 }
 
 static int getWidth(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushnumber(L, 800);
 
-	lua_pushnumber(L, pWindow->getWidth());
-
 	return 1;
 }
 
 static int getHeight(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushnumber(L, 600);
 
-	lua_pushnumber(L, pWindow->getHeight());
-
 	return 1;
 }
 
 static int setWidth(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This is called by system/boot.lua with 800 as value.
+//	pWindow->setWidth(static_cast<int>(luaL_checknumber(L, 1)));
 
-	pWindow->setWidth(static_cast<int>(luaL_checknumber(L, 1)));
-
 	return 0;
 }
 
 static int setHeight(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This is called by system/boot.lua with 600 as value.
+//	pWindow->setHeight(static_cast<int>(luaL_checknumber(L, 1)));
 
-	pWindow->setHeight(static_cast<int>(luaL_checknumber(L, 1)));
-
 	return 0;
 }
 
 static int getTitle(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushstring(L, "");
 
-	lua_pushstring(L, pWindow->getTitle().c_str());
-
 	return 1;
 }
 
 static int setTitle(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This is called by system/boot.lua and system/menu.lua, to
+	// set the window title to the (localized) game name.
+	// FIXME: Should we call OSystem::setWindowCaption() here?
+//	pWindow->setTitle(luaL_checkstring(L, 1));
 
-	pWindow->setTitle(luaL_checkstring(L, 1));
-
 	return 0;
 }
 
 static int processMessages(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This is called by the main loop in system/boot.lua,
+	// and the game keeps running as true is returned here.
+	// It terminates if we return false.
 
-	lua_pushbooleancpp(L, pWindow->processMessages());
+	// TODO: We could do more stuff here if desired...
 
+	// TODO: We could always return true here, and leave quit handling
+	// to the closeWanted() opcode; see also the TODO comment in there.
+
+	lua_pushbooleancpp(L, !Engine::shouldQuit());
+
 	return 1;
 }
 
 static int closeWanted(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This is called by system/interface.lua to determine whether the
+	// user requested the game to close (e.g. by clicking the 'close' widget
+	// of the game window). As a consequence (i.e. this function returns true),
+	// a quit confirmation dialog is shown.
 
-	lua_pushbooleancpp(L, pWindow->closeWanted());
+	// TODO: ScummVM currently has a bug / misfeature where some engines provide
+	// quit confirmation dialogs, some don't; in addition, we have a global confirmation
+	// dialog (but the user has to explicitly activate that in the config).
+	// Anyway, this can lead to *two* confirmation dialogs being shown.
+	// If it wasn't for that, we could simply check for Engine::shouldQuit() here,
+	// and then invoke EventMan::resetQuit. But currently this would result in
+	// the user seeing two confirmation dialogs. Bad.
+	lua_pushbooleancpp(L, false);
 
 	return 1;
 }
 
 static int waitForFocus(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushbooleancpp(L, true);
 
-	lua_pushbooleancpp(L, pWindow->waitForFocus());
-
 	return 1;
 }
 
 static int hasFocus(lua_State *L) {
-	Kernel *pKernel = Kernel::getInstance();
-	BS_ASSERT(pKernel);
-	Window *pWindow = pKernel->getWindow();
-	BS_ASSERT(pWindow);
+	// This function apparently is not used by the game scripts
+	lua_pushbooleancpp(L, true);
 
-	lua_pushbooleancpp(L, pWindow->hasFocus());
-
 	return 1;
 }
 

Deleted: scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp	2010-10-25 21:51:11 UTC (rev 53832)
@@ -1,297 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-/*
- * This code is based on Broken Sword 2.5 engine
- *
- * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
- *
- * Licensed under GNU GPL v2
- *
- */
-
-#include "common/system.h"
-#include "engines/util.h"
-#include "graphics/pixelformat.h"
-#include "sword25/kernel/scummvmwindow.h"
-#include "sword25/kernel/kernel.h"
-#include "sword25/input/inputengine.h"
-
-#define BS_LOG_PREFIX "WIN32WINDOW"
-
-namespace Sword25 {
-
-bool ScummVMWindow::_classRegistered = false;
-
-// Constructor / Destructor
-// ------------------------
-ScummVMWindow::ScummVMWindow(int x, int y, int width, int height, bool visible) {
-	// Presume that init will fail
-	_initSuccess = false;
-
-	// We don't support any window creation except at the origin 0,0
-	assert(x == 0);
-	assert(y == 0);
-
-	if (!_classRegistered) {
-		// Nothing here currently
-
-		_classRegistered = true;
-	}
-
-	// Fenstersichtbarkeit setzen
-	setVisible(visible);
-
-	// Indicate success
-	_initSuccess = true;
-	_windowAlive = true;
-	_closeWanted = false;
-}
-
-ScummVMWindow::~ScummVMWindow() {
-}
-
-// Get Methods
-// ------------
-int ScummVMWindow::getX() {
-	return 0;
-}
-
-int ScummVMWindow::getY() {
-	return 0;
-}
-
-int ScummVMWindow::getClientX() {
-	return 0;
-}
-
-int ScummVMWindow::getClientY() {
-	return 0;
-}
-
-int ScummVMWindow::getWidth() {
-	return g_system->getWidth();
-}
-
-int ScummVMWindow::getHeight() {
-	return g_system->getHeight();
-}
-
-Common::String ScummVMWindow::getTitle() {
-	return Common::String("");
-}
-
-bool ScummVMWindow::isVisible() {
-	return true;
-}
-
-bool ScummVMWindow::hasFocus() {
-	// FIXME: Is there a way to tell if ScummVM has the focus in Windowed mode?
-	return true;
-}
-
-uint ScummVMWindow::getWindowHandle() {
-	return 0;
-}
-
-void ScummVMWindow::setWindowAlive(bool v) {
-	_windowAlive = v;
-}
-
-
-// Set Methods
-// ------------
-
-void ScummVMWindow::setX(int X) {
-	// No implementation
-}
-
-void ScummVMWindow::setY(int Y) {
-	// No implementation
-}
-
-void ScummVMWindow::setWidth(int width) {
-	// No implementation
-}
-
-void ScummVMWindow::setHeight(int height) {
-	// No implementation
-}
-
-void ScummVMWindow::setVisible(bool visible) {
-	// No implementation
-}
-
-void ScummVMWindow::setTitle(const Common::String &title) {
-	// No implementation
-}
-
-bool ScummVMWindow::processMessages() {
-	// All messages are handled separately in the input manager. The only thing we
-	// need to do here is to keep returning whether the window/game is still alive
-	return _windowAlive;
-}
-
-bool ScummVMWindow::waitForFocus() {
-	// No implementation
-	return true;
-}
-
-// FIXME: Special keys detected here need to be moved into the Input Engine
-/*
-// Die WindowProc aller Fenster der Klasse
-LRESULT CALLBACK BS_ScummVMWindow::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
-    switch(uMsg)
-    {
-    case WM_PAINT:
-        ValidateRect(hwnd, NULL);
-        break;
-
-    case WM_DESTROY:
-        // Das Fenster wird zerst\xF6rt
-        PostQuitMessage(0);
-        break;
-
-    case WM_CLOSE:
-        {
-            BS_Window * WindowPtr = BS_Kernel::GetInstance()->GetWindow();
-            if (WindowPtr) {
-                WindowPtr->SetCloseWanted(true);
-            }
-            break;
-        }
-
-    case WM_KEYDOWN:
-        {
-            // Tastendr\xFCcke, die f\xFCr das Inputmodul interessant sind, werden diesem gemeldet.
-            BS_InputEngine * InputPtr = BS_Kernel::GetInstance()->GetInput();
-
-            if (InputPtr)
-            {
-                switch (wParam)
-                {
-                case VK_RETURN:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_ENTER);
-                    break;
-
-                case VK_LEFT:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_LEFT);
-                    break;
-
-                case VK_RIGHT:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_RIGHT);
-                    break;
-
-                case VK_HOME:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_HOME);
-                    break;
-
-                case VK_END:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_END);
-                    break;
-
-                case VK_BACK:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_BACKSPACE);
-                    break;
-
-                case VK_TAB:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_TAB);
-                    break;
-
-                case VK_INSERT:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_INSERT);
-                    break;
-
-                case VK_DELETE:
-                    InputPtr->ReportCommand(BS_InputEngine::KEY_COMMAND_DELETE);
-                    break;
-                }
-            }
-            break;
-        }
-
-    case WM_KEYUP:
-    case WM_SYSKEYUP:
-        // Alle Tastendr\xFCcke werden ignoriert, damit Windows per DefWindowProc() nicht darauf
-        // reagieren kann und damit unerwartete Seiteneffekte ausl\xF6st.
-        // Zum Beispiel w\xFCrden ALT und F10 Tastendr\xFCcke das "Men\xFC" aktivieren und somit den Message-Loop zum Stillstand bringen.
-        break;
-
-    case WM_SYSCOMMAND:
-        // Verhindern, dass der Bildschirmschoner aktiviert wird, w\xE4hrend das Spiel l\xE4uft
-        if (wParam != SC_SCREENSAVE) return DefWindowProc(hwnd,uMsg,wParam,lParam);
-        break;
-
-    case WM_CHAR:
-        {
-            byte theChar = static_cast<byte>(wParam & 0xff);
-
-            // Alle Zeichen, die keine Steuerzeichen sind, werden als Buchstaben dem Input-Service mitgeteilt.
-            if (theChar >= 32)
-            {
-                BS_InputEngine * InputPtr = BS_Kernel::GetInstance()->GetInput();
-                if (InputPtr) InputPtr->ReportCharacter(theChar);
-            }
-        }
-        break;
-
-    case WM_SETCURSOR:
-        {
-            // Der Systemcursor wird in der Client-Area des Fensters nicht angezeigt, jedoch in der nicht Client-Area, damit der Benutzer das Fenster wie gewohnt
-            // schlie\xDFen und verschieben kann.
-
-            // Koordinaten des Cursors in der Client-Area berechnen.
-            POINT pt;
-            GetCursorPos(&pt);
-            ScreenToClient(hwnd, &pt);
-
-            // Feststellen, ob sich der Cursor in der Client-Area befindet.
-            // Get client rect
-            RECT rc;
-            GetClientRect(hwnd, &rc);
-
-            // See if cursor is in client area
-            if(PtInRect(&rc, pt))
-                // In der Client-Area keinen Cursor anzeigen.
-                SetCursor(NULL);
-            else
-                // Ausserhalb der Client-Area den Cursor anzeigen.
-                SetCursor(LoadCursor(NULL, IDC_ARROW));
-
-            return TRUE;
-        }
-        break;
-
-    default:
-        // Um alle anderen Vorkommnisse k\xFCmmert sich Windows
-        return DefWindowProc(hwnd,uMsg,wParam,lParam);
-    }
-
-    return 0;
-}
-*/
-
-} // End of namespace Sword25

Deleted: scummvm/trunk/engines/sword25/kernel/scummvmwindow.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/scummvmwindow.h	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/kernel/scummvmwindow.h	2010-10-25 21:51:11 UTC (rev 53832)
@@ -1,83 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-/*
- * This code is based on Broken Sword 2.5 engine
- *
- * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
- *
- * Licensed under GNU GPL v2
- *
- */
-
-/*
-    BS_ScummVMWindow
-    ----------------
-    Implementation of the BS_Window Interfaces for ScummVM
-*/
-
-#ifndef SWORD25_SCUMMVMWINDOW_H
-#define SWORD25_SCUMMVMWINDOW_H
-
-#include "sword25/kernel/common.h"
-#include "sword25/kernel/window.h"
-
-namespace Sword25 {
-
-class ScummVMWindow : public Window {
-public:
-	ScummVMWindow(int x, int y, int width, int height, bool visible);
-	virtual ~ScummVMWindow();
-
-	bool isVisible();
-	void setVisible(bool visible);
-	int getX();
-	void setX(int x);
-	int getY();
-	void setY(int x);
-	int getClientX();
-	int getClientY();
-	int getWidth();
-	void setWidth(int width);
-	int getHeight();
-	void setHeight(int height);
-	Common::String getTitle();
-	void setWindowAlive(bool v);
-	void setTitle(const Common::String &title);
-	bool hasFocus();
-	uint getWindowHandle();
-	bool waitForFocus();
-	bool processMessages();
-
-private:
-	static bool _classRegistered;
-	bool _windowAlive;
-	int  _clientXDelta;
-	int  _clientYDelta;
-};
-
-} // End of namespace Sword25
-
-#endif

Deleted: scummvm/trunk/engines/sword25/kernel/window.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/window.cpp	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/kernel/window.cpp	2010-10-25 21:51:11 UTC (rev 53832)
@@ -1,69 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-/*
- * This code is based on Broken Sword 2.5 engine
- *
- * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
- *
- * Licensed under GNU GPL v2
- *
- */
-
-#include "sword25/kernel/window.h"
-
-// Alle Implementationen von BS_Window m\xFCssen hier eingetragen werden
-#include "sword25/kernel/scummvmwindow.h"
-
-namespace Sword25 {
-
-// Erstellt ein Fenster des GUI des aktuellen Betriebssystems
-Window *Window::createBSWindow(int x, int y, int width, int height, bool visible) {
-	// Fenster erstellen
-	Window *pWindow = (Window *) new ScummVMWindow(x, y, width, height, visible);
-
-	// Falls das Fenster erfolgreich initialisiert wurde, wird ein Pointer auf das Fensterobjekt
-	// zur\xFCckgegeben
-	if (pWindow->_initSuccess)
-		return pWindow;
-
-	// Ansonsten wird das Fensterobjekt zerst\xF6rt und NULL zur\xFCckgegeben
-	delete pWindow;
-	return NULL;
-}
-
-// Gibt True zur\xFCck wenn das Fenster WM_CLOSE empfangen hat -
-// solange, bis RejectClose() aufgerufen wurde.
-bool Window::closeWanted() {
-	bool result = _closeWanted;
-	_closeWanted = false;
-	return result;
-}
-
-void Window::setCloseWanted(bool wanted) {
-	_closeWanted = wanted;
-}
-
-} // End of namespace Sword25

Deleted: scummvm/trunk/engines/sword25/kernel/window.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/window.h	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/kernel/window.h	2010-10-25 21:51:11 UTC (rev 53832)
@@ -1,174 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-/*
- * This code is based on Broken Sword 2.5 engine
- *
- * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
- *
- * Licensed under GNU GPL v2
- *
- */
-
-/*
- * BS_Window
- * ---------
- * Simple window class interface. This is being encapsulated in a class for
- * reasons of portability.
- *
- * Autor: Malte Thiesen
- */
-
-#ifndef SWORD25_WINDOW_H
-#define SWORD25_WINDOW_H
-
-#include "sword25/kernel/common.h"
-
-namespace Sword25 {
-
-/**
- * A simple window class interface
- *
- * Windows are exclusively created by BS_Window::CreateBSWindow().
- * BS_Windows selects the correct class for the environment.
- */
-class Window {
-protected:
-	bool _initSuccess;
-	bool _closeWanted;
-
-public:
-	virtual ~Window() {}
-
-	/**
-	 * Returns the visibility of the window.
-	 */
-	virtual bool isVisible() = 0;
-
-	/**
-	 * Sets the visibility of the window
-	 * @param Visible       Specifies whether the window should be visible or hidden
-	 */
-	virtual void setVisible(bool visible) = 0;
-	/**
-	 * Returns the X position of the window
-	 */
-	virtual int getX() = 0;
-	/**
-	 * Sets the X position of the window
-	 * @paramX      The new X position for the window, or -1 for centre aligned
-	 */
-	virtual void setX(int X) = 0;
-	/**
-	 * Gets the Y position of the window
-	 */
-	virtual int getY() = 0;
-	/**
-	 * Sets the Y position of the window
-	 * @param Y     The new Y position for the window, or -1 for centre aligned
-	 */
-	virtual void setY(int X) = 0;
-	/**
-	 * Returns the X position of the window's client area
-	 */
-	virtual int getClientX() = 0;
-	/**
-	 * Returns the Y position of the window's client area
-	 */
-	virtual int getClientY() = 0;
-	/**
-	 * Returns the width of the window without the frame
-	 */
-	virtual int getWidth() = 0;
-	/**
-	 * Sets the width of the window without the frame
-	 */
-	virtual void setWidth(int width) = 0;
-	/**
-	 * Gets the height of the window without the frame
-	 */
-	virtual int getHeight() = 0;
-	/**
-	 * Sets the height of the window without the frame
-	 */
-	virtual void setHeight(int height) = 0;
-	/**
-	 * Returns the title of the window
-	 */
-	virtual Common::String getTitle() = 0;
-	/**
-	 * Sets the title of the window
-	 * @param Title     The new window title
-	*/
-	virtual void setTitle(const Common::String &title) = 0;
-	/**
-	 * Handle the processing of any pending window messages. This method should be called
-	 * during the main loop.
-	 */
-	virtual bool processMessages() = 0;
-	/**
-	 * Pauses the applicaiton until the window has focus, or has been closed.
-	 * Returns false if the window was closed.
-	 */
-	virtual bool waitForFocus() = 0;
-	/**
-	 * Returns true if the window has focus, false otherwise.
-	 */
-	virtual bool hasFocus() = 0;
-	/**
-	 * Returns the system handle that represents the window. Note that any use of the handle
-	 * will not be portable code.
-	 */
-	virtual uint getWindowHandle() = 0;
-
-	virtual void setWindowAlive(bool v) = 0;
-
-	/**
-	 * Specifies whether the window is wanted to be closed. This is used together with CloseWanted()
-	 * to allow scripts to query when the main window should be closed, or the user is asking it to close
-	 **/
-	void setCloseWanted(bool wanted);
-	/**
-	 * Returns the previous value set in a call to SetCloseWanted.
-	 * Note that calling this also resets the value back to false, until such time as the SetCloseWanted()
-	 * method is called again.
-	**/
-	bool closeWanted();
-
-	/**
-	 * Creates a new window instance. Returns a pointer to the window, or NULL if the creation failed.
-	 * Note: It is the responsibility of the client to free the pointer when done with it.
-	 * @param X         The X position of the window, or -1 for centre horizontal alignment
-	 * @param Y         The Y position of the window, or -1 for centre vertical alignment
-	 * @param Width     The width of the window without the frame
-	 * @param Height    The height of the window without the frame
-	 * @param Visible   Specifies whether window should be visible
-	 */
-	static Window *createBSWindow(int x, int y, int width, int height, bool visible);
-};
-
-} // End of namespace Sword25
-
-#endif

Modified: scummvm/trunk/engines/sword25/module.mk
===================================================================
--- scummvm/trunk/engines/sword25/module.mk	2010-10-25 19:59:32 UTC (rev 53831)
+++ scummvm/trunk/engines/sword25/module.mk	2010-10-25 21:51:11 UTC (rev 53832)
@@ -43,8 +43,6 @@
 	kernel/persistenceservice.o \
 	kernel/resmanager.o \
 	kernel/resource.o \
-	kernel/scummvmwindow.o \
-	kernel/window.o \
 	math/geometry.o \
 	math/geometry_script.o \
 	math/polygon.o \


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list