[Scummvm-cvs-logs] scummvm master -> fda6e1534bc1dfad7f1f32ccf0bb51f3eb34974d

tsoliman tarek at bashasoliman.com
Tue Nov 29 21:42:42 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
29c0386f2c MAEMO: Add basic graphics manager
fda6e1534b MAEMO: Fix zoom key capture on N900 (fixes bug#3443037)


Commit: 29c0386f2c5d1a8a03cab0010e7c7c7e27fe2e94
    https://github.com/scummvm/scummvm/commit/29c0386f2c5d1a8a03cab0010e7c7c7e27fe2e94
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-11-29T11:38:17-08:00

Commit Message:
MAEMO: Add basic graphics manager

Changed paths:
  A backends/graphics/maemosdl/maemosdl-graphics.cpp
  A backends/graphics/maemosdl/maemosdl-graphics.h
    backends/module.mk
    backends/platform/maemo/maemo.cpp



diff --git a/backends/graphics/maemosdl/maemosdl-graphics.cpp b/backends/graphics/maemosdl/maemosdl-graphics.cpp
new file mode 100644
index 0000000..3309d91
--- /dev/null
+++ b/backends/graphics/maemosdl/maemosdl-graphics.cpp
@@ -0,0 +1,34 @@
+/* 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.
+ *
+ */
+#if defined(MAEMO)
+
+#include "common/scummsys.h"
+
+#include "backends/platform/maemo/maemo.h"
+#include "backends/events/maemosdl/maemosdl-events.h"
+#include "backends/graphics/maemosdl/maemosdl-graphics.h"
+
+MaemoSdlGraphicsManager::MaemoSdlGraphicsManager(SdlEventSource *sdlEventSource)
+	: SurfaceSdlGraphicsManager(sdlEventSource) {
+}
+
+#endif
diff --git a/backends/graphics/maemosdl/maemosdl-graphics.h b/backends/graphics/maemosdl/maemosdl-graphics.h
new file mode 100644
index 0000000..4a675b6
--- /dev/null
+++ b/backends/graphics/maemosdl/maemosdl-graphics.h
@@ -0,0 +1,37 @@
+/* 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.
+ *
+ */
+
+#if defined(MAEMO)
+
+#ifndef BACKENDS_GRAPHICS_MAEMOSDL_GRAPHICS_H
+#define BACKENDS_GRAPHICS_MAEMOSDL_GRAPHICS_H
+
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
+
+class MaemoSdlGraphicsManager : public SurfaceSdlGraphicsManager {
+public:
+	MaemoSdlGraphicsManager(SdlEventSource *sdlEventSource);
+};
+
+#endif
+
+#endif
diff --git a/backends/module.mk b/backends/module.mk
index 89cde44..6be595a 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -149,7 +149,8 @@ endif
 
 ifeq ($(BACKEND),maemo)
 MODULE_OBJS += \
-	events/maemosdl/maemosdl-events.o
+	events/maemosdl/maemosdl-events.o \
+	graphics/maemosdl/maemosdl-graphics.o
 endif
 
 ifeq ($(BACKEND),n64)
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index a188503..454a136 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -29,6 +29,7 @@
 
 #include "backends/platform/maemo/maemo.h"
 #include "backends/events/maemosdl/maemosdl-events.h"
+#include "backends/graphics/maemosdl/maemosdl-graphics.h"
 #include "common/textconsole.h"
 
 
@@ -47,6 +48,9 @@ void OSystem_SDL_Maemo::initBackend() {
 	if (_eventSource == 0)
 		_eventSource = new MaemoSdlEventSource();
 
+	if (_graphicsManager == 0)
+		_graphicsManager = new MaemoSdlGraphicsManager(_eventSource);
+
 	ConfMan.set("vkeybdpath", DATA_PATH);
 
 	_model = Model(detectModel());


Commit: fda6e1534bc1dfad7f1f32ccf0bb51f3eb34974d
    https://github.com/scummvm/scummvm/commit/fda6e1534bc1dfad7f1f32ccf0bb51f3eb34974d
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-11-29T12:39:15-08:00

Commit Message:
MAEMO: Fix zoom key capture on N900 (fixes bug#3443037)

This was semi-intentionally skipped in the intial port revival
because the focus was on N810 at the time.

This is mostly copied from the old 1.2.1 port and then cleaned up.

Changed paths:
    backends/graphics/maemosdl/maemosdl-graphics.cpp
    backends/graphics/maemosdl/maemosdl-graphics.h



diff --git a/backends/graphics/maemosdl/maemosdl-graphics.cpp b/backends/graphics/maemosdl/maemosdl-graphics.cpp
index 3309d91..527ef82 100644
--- a/backends/graphics/maemosdl/maemosdl-graphics.cpp
+++ b/backends/graphics/maemosdl/maemosdl-graphics.cpp
@@ -21,6 +21,8 @@
  */
 #if defined(MAEMO)
 
+#include "SDL_syswm.h"
+
 #include "common/scummsys.h"
 
 #include "backends/platform/maemo/maemo.h"
@@ -31,4 +33,28 @@ MaemoSdlGraphicsManager::MaemoSdlGraphicsManager(SdlEventSource *sdlEventSource)
 	: SurfaceSdlGraphicsManager(sdlEventSource) {
 }
 
+bool MaemoSdlGraphicsManager::loadGFXMode() {
+	bool success = SurfaceSdlGraphicsManager::loadGFXMode();
+
+	// fix the problematic zoom key capture in Maemo5/N900
+	SDL_SysWMinfo info;
+	SDL_VERSION(&info.version);
+	if (SDL_GetWMInfo(&info)) {
+		Display *dpy = info.info.x11.display;
+		Window win;
+		unsigned long val = 1;
+		Atom atom_zoom = XInternAtom(dpy, "_HILDON_ZOOM_KEY_ATOM", 0);
+		info.info.x11.lock_func();
+		win = info.info.x11.fswindow;
+		if (win)
+			XChangeProperty(dpy, win, atom_zoom, XA_INTEGER, 32, PropModeReplace, (unsigned char *) &val, 1); // grab zoom keys
+		win = info.info.x11.wmwindow;
+		if (win)
+			XChangeProperty(dpy, win, atom_zoom, XA_INTEGER, 32, PropModeReplace, (unsigned char *) &val, 1); // grab zoom keys
+		info.info.x11.unlock_func();
+	}
+
+	return success;
+}
+
 #endif
diff --git a/backends/graphics/maemosdl/maemosdl-graphics.h b/backends/graphics/maemosdl/maemosdl-graphics.h
index 4a675b6..81064d2 100644
--- a/backends/graphics/maemosdl/maemosdl-graphics.h
+++ b/backends/graphics/maemosdl/maemosdl-graphics.h
@@ -30,6 +30,9 @@
 class MaemoSdlGraphicsManager : public SurfaceSdlGraphicsManager {
 public:
 	MaemoSdlGraphicsManager(SdlEventSource *sdlEventSource);
+
+protected:
+	virtual bool loadGFXMode();
 };
 
 #endif






More information about the Scummvm-git-logs mailing list