ALL: Remove WebOS port

This commit is contained in:
Eugene Sandulenko 2020-08-01 14:56:16 +02:00
parent 23e213574b
commit eaa86f9333
18 changed files with 8 additions and 990 deletions

View file

@ -1,434 +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.
*
*/
#ifdef WEBOS
#include "common/scummsys.h"
#include "common/system.h"
#include "common/str.h"
#include "common/translation.h"
#include "backends/events/webossdl/webossdl-events.h"
#include "gui/message.h"
#include "engines/engine.h"
// PDL.h provided by the official Palm WebOS PDK.
#include <PDL.h>
/**
* WebOS devices only have a Shift key and a CTRL key. There is also an Alt
* key (the orange key) but this is already processed by WebOS to change the
* mode of the keys so ScummVM must not use this key as a modifier. Instead
* pressing down the gesture area is used as Alt key.
*
* @param mod The pressed key modifier as detected by SDL.
* @param event The ScummVM event to setup.
*/
void WebOSSdlEventSource::SDLModToOSystemKeyFlags(SDL_Keymod mod,
Common::Event &event) {
event.kbd.flags = 0;
if (mod & KMOD_SHIFT)
event.kbd.flags |= Common::KBD_SHIFT;
if (mod & KMOD_CTRL)
event.kbd.flags |= Common::KBD_CTRL;
// Holding down the gesture area emulates the ALT key
if (_gestureDown)
event.kbd.flags |= Common::KBD_ALT;
}
/**
* Before calling the original SDL implementation this method checks if the
* gesture area is pressed down.
*
* @param ev The SDL event
* @param event The ScummVM event.
* @return True if event was processed, false if not.
*/
bool WebOSSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) {
// Handle gesture area tap.
if (ev.key.keysym.sym == SDLK_WORLD_71) {
_gestureDown = true;
return true;
}
// Ensure that ALT key (Gesture down) is ignored when back or forward
// gesture is detected. This is needed for WebOS 1 which releases the
// gesture tap AFTER the backward gesture event and not BEFORE (Like
// WebOS 2).
if (ev.key.keysym.sym == 27 || ev.key.keysym.sym == 229) {
_gestureDown = false;
}
// handle virtual keyboard dismiss key
if (ev.key.keysym.sym == 24) {
int gblPDKVersion = PDL_GetPDKVersion();
// check for correct PDK Version, as this determines whether an
// OS-supplied virtual keyboard is available on this device.
if (gblPDKVersion >= 300) {
PDL_SetKeyboardState(PDL_FALSE);
return true;
}
}
// Call original SDL key handler.
return SdlEventSource::handleKeyDown(ev, event);
}
/**
* Before calling the original SDL implementation this method checks if the
* gesture area has been released.
*
* @param ev The SDL event
* @param event The ScummVM event.
* @return True if event was processed, false if not.
*/
bool WebOSSdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) {
// Handle gesture area tap.
if (ev.key.keysym.sym == SDLK_WORLD_71) {
_gestureDown = false;
return true;
}
// handle virtual keyboard dismiss key
if (ev.key.keysym.sym == 24) {
int gblPDKVersion = PDL_GetPDKVersion();
// check for correct PDK Version, as this determines whether an
// OS-supplied virtual keyboard is available on this device.
if (gblPDKVersion >= 300) {
PDL_SetKeyboardState(PDL_FALSE);
return true;
}
}
// Call original SDL key handler.
return SdlEventSource::handleKeyUp(ev, event);
}
/**
* Handles mouse button press.
*
* @param ev The SDL event
* @param event The ScummVM event.
* @return True if event was processed, false if not.
*/
bool WebOSSdlEventSource::handleMouseButtonDown(SDL_Event &ev,
Common::Event &event) {
_dragDiffX[ev.button.which] = 0;
_dragDiffY[ev.button.which] = 0;
_fingerDown[ev.button.which] = true;
_screenDownTime[ev.button.which] = g_system->getMillis();
if (ev.button.which == 0) {
// Do a click when the finger lifts unless we leave the range
_doClick = true;
// Queue up dragging if auto-drag mode is on
if (_autoDragMode)
_queuedDragTime = g_system->getMillis() + QUEUED_DRAG_DELAY;
// Turn drag mode on instantly for a double-tap
else if (g_system->getMillis() - _dragStartTime < DOUBLETAP_LIMIT) {
_dragging = true;
event.type = Common::EVENT_LBUTTONDOWN;
processMouseEvent(event, _curX, _curY);
}
// If we're not in trackpad mode, move the cursor to the tap
if (!_trackpadMode) {
_curX = MIN(_screenX, MAX(0, 0 + ev.motion.x));
_curY = MIN(_screenY, MAX(0, 0 + ev.motion.y));
// If we're already clicking, hold it until after the move.
if (event.type == Common::EVENT_LBUTTONDOWN) {
processMouseEvent(event, _curX, _curY);
g_system->getEventManager()->pushEvent(event);
}
// Move the mouse
event.type = Common::EVENT_MOUSEMOVE;
processMouseEvent(event, _curX, _curY);
}
// Watch for a double-tap-triggered drag
_dragStartTime = g_system->getMillis();
} else if (ev.button.which == 1) {
// Kill any queued drag event if a second finger goes down
if (_queuedDragTime > 0)
_queuedDragTime = 0;
_doClick = false;
}
return true;
}
/**
* Handles mouse button release.
*
* @param ev The SDL event
* @param event The ScummVM event.
* @return True if event was processed, false if not.
*/
bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev,
Common::Event &event) {
// Only react if the finger hasn't been virtually lifted already
if (_fingerDown[ev.button.which]) {
// No matter what, if it's the first finger that's lifted when
// we're dragging, just lift the mouse button.
if (ev.button.which == 0 && _dragging) {
event.type = Common::EVENT_LBUTTONUP;
processMouseEvent(event, _curX, _curY);
_dragging = false;
} else {
// If it was the first finger and the click hasn't been
// canceled, it's a click.
if (ev.button.which == 0 && _doClick &&
!_fingerDown[1] && !_fingerDown[2]) {
event.type = Common::EVENT_LBUTTONUP;
processMouseEvent(event, _curX, _curY);
g_system->getEventManager()->pushEvent(event);
event.type = Common::EVENT_LBUTTONDOWN;
if (_queuedDragTime > 0)
_queuedDragTime = 0;
} else if (ev.button.which == 1 &&
_fingerDown[0] && _fingerDown[1] && !_fingerDown[2]) {
// If the first finger's down and the second taps, it's a
// right mouse click.
event.type = Common::EVENT_RBUTTONDOWN;
processMouseEvent(event, _curX, _curY);
_queuedRUpTime = g_system->getMillis() + QUEUED_RUP_DELAY;
} else if (ev.button.which == 2 &&
_fingerDown[0] && _fingerDown[1]) {
// If two fingers are down and a third taps, it's a middle
// click -- but lift the second finger so it doesn't register
// as a right click.
event.type = Common::EVENT_MBUTTONUP;
processMouseEvent(event, _curX, _curY);
g_system->getEventManager()->pushEvent(event);
event.type = Common::EVENT_MBUTTONDOWN;
_fingerDown[1] = false;
}
}
// Officially lift the finger that was raised.
_fingerDown[ev.button.which] = false;
}
return true;
}
/**
* Handles mouse motion.
*
* @param ev The SDL event
* @param event The ScummVM event.
* @return True if event was processed, false if not.
*/
bool WebOSSdlEventSource::handleMouseMotion(SDL_Event &ev,
Common::Event &event) {
if (_fingerDown[ev.motion.which]) {
_dragDiffX[ev.motion.which] += ev.motion.xrel;
_dragDiffY[ev.motion.which] += ev.motion.yrel;
switch (ev.motion.which) {
case 0:
// If our dragDiff goes too many pixels in either direction,
// kill the future click and any queued drag event.
if (_doClick && (ABS(_dragDiffX[0]) > MOUSE_DEADZONE_PIXELS ||
ABS(_dragDiffY[0]) > MOUSE_DEADZONE_PIXELS)) {
_doClick = false;
if (_queuedDragTime > 0)
_queuedDragTime = 0;
}
// If only one finger is on the screen and moving, that's
// the mouse pointer.
if (!_fingerDown[1] && !_fingerDown[2]) {
if (_trackpadMode) {
_curX = MIN(_screenX, MAX(0, _curX + ev.motion.xrel));
_curY = MIN(_screenY, MAX(0, _curY + ev.motion.yrel));
} else {
_curX = MIN(_screenX, MAX(0, 0 + ev.motion.x));
_curY = MIN(_screenY, MAX(0, 0 + ev.motion.y));
}
event.type = Common::EVENT_MOUSEMOVE;
processMouseEvent(event, _curX, _curY);
}
break;
case 1:
// Check for a two-finger swipe
if (_fingerDown[0] && !_fingerDown[2]) {
// Check for a vertical swipe
if (ABS(_dragDiffY[0]) > _swipeDistY &&
ABS(_dragDiffY[1]) > _swipeDistY) {
// Virtually lift fingers to prevent repeat triggers
_fingerDown[0] = _fingerDown[1] = false;
if (_dragDiffY[0] < 0 && _dragDiffY[1] < 0) {
// A swipe up triggers the keyboard, if it exists. We
// test for existance of a virtual OS keyboard by
// checking for the version of the linked PDK libs.
int gblPDKVersion = PDL_GetPDKVersion();
if (gblPDKVersion >= 300)
PDL_SetKeyboardState(PDL_TRUE);
} else if (_dragDiffY[0] > 0 && _dragDiffY[1] > 0) {
// A swipe down triggers the menu
if (g_engine && !g_engine->isPaused())
g_engine->openMainMenuDialog();
}
return true;
}
// Check for a horizontal swipe
if (ABS(_dragDiffX[0]) > _swipeDistX &&
ABS(_dragDiffX[1]) > _swipeDistX) {
// Virtually lift fingers to prevent repeat triggers
_fingerDown[0] = _fingerDown[1] = false;
if (_dragDiffX[0] < 0 && _dragDiffX[1] < 0) {
// A swipe left presses escape
event.type = Common::EVENT_KEYDOWN;
event.kbd.flags = 0;
event.kbd.keycode = Common::KEYCODE_ESCAPE;
event.kbd.ascii = Common::ASCII_ESCAPE;
_queuedEscapeUpTime = g_system->getMillis() +
QUEUED_KEY_DELAY;
} else if (_dragDiffX[0] > 0 && _dragDiffX[1] > 0) {
// A swipe right toggles trackpad mode
_trackpadMode = !_trackpadMode;
g_system->showMouse(_trackpadMode);
// I18N: Trackpad mode toggle status.
Common::String dialogMsg(_("Trackpad mode is now"));
dialogMsg += " ";
// I18N: Trackpad mode on or off.
dialogMsg += (_trackpadMode ? _("ON") : _("OFF"));
dialogMsg += ".\n";
// I18N: Instructions to toggle Trackpad mode.
dialogMsg +=
_("Swipe two fingers to the right to toggle.");
GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal();
}
return true;
}
}
break;
case 2:
// Check for a three-finger swipe
if (_fingerDown[0] && _fingerDown[1]) {
// Swipe to the right toggles Auto-drag
if (_dragDiffX[0] > _swipeDistX &&
_dragDiffX[1] > _swipeDistX &&
_dragDiffX[2] > _swipeDistX) {
// Virtually lift fingers to prevent repeat triggers
_fingerDown[0] = _fingerDown[1] = _fingerDown[2] = false;
// Toggle Auto-drag mode
_autoDragMode = !_autoDragMode;
// I18N: Auto-drag toggle status.
Common::String dialogMsg(_("Auto-drag mode is now"));
dialogMsg += " ";
// I18N: Auto-drag on or off.
dialogMsg += (_autoDragMode ? _("ON") : _("OFF"));
dialogMsg += ".\n";
// I18N: Instructions to toggle auto-drag.
dialogMsg += _(
"Swipe three fingers to the right to toggle.");
GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal();
return true;
} else if (_dragDiffY[0] > _swipeDistY &&
_dragDiffY[1] > _swipeDistY &&
_dragDiffY[2] > _swipeDistY ) {
// Swipe down to emulate spacebar (pause)
// Virtually lift fingers to prevent repeat triggers
_fingerDown[0] = _fingerDown[1] = _fingerDown[2] = false;
// Press space
event.type = Common::EVENT_KEYDOWN;
event.kbd.flags = 0;
event.kbd.keycode = Common::KEYCODE_SPACE;
event.kbd.ascii = Common::ASCII_SPACE;
_queuedSpaceUpTime = g_system->getMillis() +
QUEUED_KEY_DELAY;
}
}
}
}
return true;
}
/**
* Before calling the original SDL implementation, this method loads in
* queued events.
*
* @param event The ScummVM event
*/
bool WebOSSdlEventSource::pollEvent(Common::Event &event) {
uint32 curTime = g_system->getMillis();
// Event-dependent nitializations for when SDL runs its first poll.
if (_firstPoll) {
// Set the initial dimensions
calculateDimensions();
// Having a mouse pointer on screen when not in Trackpad mode is poor
// interface design, because the user won't know whether to tap buttons
// or drag the pointer to them. On the first poll, set the appropriate
// pointer visibility.
g_system->showMouse(_trackpadMode);
_firstPoll = false;
}
// Run down the priority list for queued events. The built-in
// event queue runs events on the next poll, which causes many
// WebOS devices (and a few game engines) to ignore certain inputs.
// Allowing keys and clicks to stay "down" longer is enough to register
// the press.
if (_queuedEscapeUpTime != 0 && curTime >= _queuedEscapeUpTime) {
event.type = Common::EVENT_KEYUP;
event.kbd.flags = 0;
event.kbd.keycode = Common::KEYCODE_ESCAPE;
event.kbd.ascii = Common::ASCII_ESCAPE;
_queuedEscapeUpTime = 0;
return true;
} else if (_queuedSpaceUpTime != 0 && curTime >= _queuedSpaceUpTime) {
event.type = Common::EVENT_KEYUP;
event.kbd.flags = 0;
event.kbd.keycode = Common::KEYCODE_SPACE;
event.kbd.ascii = Common::ASCII_SPACE;
_queuedSpaceUpTime = 0;
return true;
} else if (_queuedRUpTime != 0 && curTime >= _queuedRUpTime) {
event.type = Common::EVENT_RBUTTONUP;
processMouseEvent(event, _curX, _curY);
_queuedRUpTime = 0;
return true;
} else if (_queuedDragTime != 0 && curTime >= _queuedDragTime) {
event.type = Common::EVENT_LBUTTONDOWN;
_dragging = true;
processMouseEvent(event, _curX, _curY);
_queuedDragTime = 0;
return true;
}
return SdlEventSource::pollEvent(event);
}
/**
* Sets the _screenX and _screenY variables to the effective screen dimensions,
* and alters _swipeDistX and _swipeDistY to the correct relative values.
*/
void WebOSSdlEventSource::calculateDimensions() {
_screenX = g_system->getOverlayWidth();
_screenY = g_system->getOverlayHeight();
_swipeDistX = _screenX * SWIPE_PERCENT_HORIZ / 100;
_swipeDistY = _screenY * SWIPE_PERCENT_VERT / 100;
}
#endif

View file

@ -1,115 +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.
*
*/
#if !defined(BACKEND_EVENTS_SDL_WEBOS_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
#define BACKEND_EVENTS_SDL_WEBOS_H
#include "backends/events/sdl/sdl-events.h"
/**
* SDL events manager for WebOS
*/
class WebOSSdlEventSource : public SdlEventSource {
public:
enum {
DOUBLETAP_LIMIT = 400,
MAX_FINGERS = 3,
MOUSE_DEADZONE_PIXELS = 5,
QUEUED_DRAG_DELAY = 500,
QUEUED_KEY_DELAY = 250,
QUEUED_RUP_DELAY = 50,
SWIPE_PERCENT_HORIZ = 15,
SWIPE_PERCENT_VERT = 20
};
WebOSSdlEventSource() :
_gestureDown(false),
_dragStartTime(0), _dragging(false),
_curX(0), _curY(0),
_screenX(0), _screenY(0),
_trackpadMode(false), _autoDragMode(true),
_doClick(true),
_queuedDragTime(0), _queuedEscapeUpTime(0), _queuedSpaceUpTime(0),
_queuedRUpTime(0),
_firstPoll(true) {
for (int i = 0; i < MAX_FINGERS; i++) {
_fingerDown[i] = false;
_screenDownTime[i] = _dragDiffX[i] = _dragDiffY[i] = 0;
}
};
protected:
// Inidicates if gesture area is pressed down or not.
bool _gestureDown;
// The timestamp when screen was pressed down for each finger.
uint32 _screenDownTime[MAX_FINGERS];
// The timestamp when a possible drag operation was triggered.
uint32 _dragStartTime;
// The distance each finger traveled from touch to release.
int _dragDiffX[MAX_FINGERS], _dragDiffY[MAX_FINGERS];
// Indicates if we are in drag mode.
bool _dragging;
// The current mouse position on the screen.
int _curX, _curY;
// The current screen dimensions
int _screenX, _screenY;
// The drag distance for linear gestures
int _swipeDistX, _swipeDistY;
// Indicates if we're in trackpad mode or tap-to-move mode.
bool _trackpadMode;
// Indicates if we're in automatic drag mode.
bool _autoDragMode;
// Tracks which fingers are currently touching the screen.
bool _fingerDown[MAX_FINGERS];
// Indicates if a click should be executed when the first finger is lifted
bool _doClick;
// Indicates whether the event poll has been run before
bool _firstPoll;
// Event queues
uint32 _queuedDragTime, _queuedEscapeUpTime, _queuedSpaceUpTime,
_queuedRUpTime;
// SDL overrides
virtual void SDLModToOSystemKeyFlags(SDL_Keymod mod, Common::Event &event);
virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);
virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event);
virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event);
virtual bool pollEvent(Common::Event &event);
// Utility functions
void calculateDimensions();
};
#endif

View file

@ -331,11 +331,6 @@ MODULE_OBJS += \
events/samsungtvsdl/samsungtvsdl-events.o events/samsungtvsdl/samsungtvsdl-events.o
endif endif
ifeq ($(BACKEND),webos)
MODULE_OBJS += \
events/webossdl/webossdl-events.o
endif
ifeq ($(BACKEND),wii) ifeq ($(BACKEND),wii)
MODULE_OBJS += \ MODULE_OBJS += \
fs/wii/wii-fs.o \ fs/wii/wii-fs.o \

View file

@ -22,7 +22,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(MAEMO) && !defined(WEBOS) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3) && !defined(PSP2) && !defined(ANDROIDSDL) && !defined(NINTENDO_SWITCH) #if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(MAEMO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3) && !defined(PSP2) && !defined(ANDROIDSDL) && !defined(NINTENDO_SWITCH)
#include "backends/platform/sdl/posix/posix.h" #include "backends/platform/sdl/posix/posix.h"
#include "backends/plugins/sdl/sdl-provider.h" #include "backends/plugins/sdl/sdl-provider.h"

View file

@ -1,52 +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.
*
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
#include "backends/platform/webos/webos.h"
#include "backends/plugins/sdl/sdl-provider.h"
#include "base/main.h"
#if defined(WEBOS)
#include <unistd.h>
int main(int argc, char* argv[]) {
g_system = new OSystem_SDL_WebOS();
assert(g_system);
((OSystem_SDL_WebOS *)g_system)->init();
#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
#endif
// Invoke the actual ScummVM main entry point:
int res = scummvm_main(argc, argv);
// Free OSystem
g_system->destroy();
return res;
}
#endif

View file

@ -1,10 +0,0 @@
MODULE := backends/platform/webos
MODULE_OBJS := \
main.o \
webos.o
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
OBJS := $(MODULE_OBJS) $(OBJS)
MODULE_DIRS += $(sort $(dir $(MODULE_OBJS)))

View file

@ -1,48 +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.
*
*/
#include "backends/platform/webos/webos.h"
#include "backends/events/webossdl/webossdl-events.h"
#include "backends/keymapper/keymapper.h"
#if defined(WEBOS)
using namespace Common;
OSystem_SDL_WebOS::OSystem_SDL_WebOS()
:
OSystem_POSIX() {
}
/**
* Initializes the backend.
*/
void OSystem_SDL_WebOS::initBackend() {
// Create the events manager
if (_eventSource == 0)
_eventSource = new WebOSSdlEventSource();
// Call parent implementation of this method
OSystem_SDL::initBackend();
}
#endif

View file

@ -1,36 +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.
*
*/
#ifndef PLATFORM_SDL_WEBOS_H
#define PLATFORM_SDL_WEBOS_H
#include "common/system.h"
#include "backends/platform/sdl/posix/posix.h"
class OSystem_SDL_WebOS : public OSystem_POSIX {
public:
OSystem_SDL_WebOS();
virtual void initBackend();
};
#endif

View file

@ -1,105 +0,0 @@
# WebOS specific build targets
# ============================================================================
#
# Build instructions:
#
# 1. Install the WebOS SDK and PDK and setup the environment variables
# WEBOS_SDK and WEBOS_PDK accordingly.
#
# 2. Cross-compile zlib, flac, mad and tremor and install it into the PDK.
#
# 3. Prepare the ScummVM source for a webOS build:
# $ ./configure --host=webos --enable-plugins --default-dynamic \
# --enable-release
#
# 4. Create the package:
# $ make package
#
# The package is now in the "portdist" folder.
#
# See https://wiki.scummvm.org/index.php/Compiling_ScummVM/WebOS for
# more detailed build instructions.
#
#
# Palm App catalog instructions:
#
# VER_PACKAGE must be set to a number which is higher than the currently
# used package version in the app catalog. So when creating an updated
# package for ScummVM 1.3.9 and the current ScummVM package in the app
# catalog is version 1.3.0902 then you must specify VER_PACKAGE=3 to create
# the ScummVM package with version 1.3.0903. Yeah, I know that's ugly but
# WebOS package version numbers are restricted to three numeric components.
#
# As long as Palm doesn't support Team-maintained apps the uploaded packages
# MUST NOT be packaged with the default "org.scummvm" base id. Instead apps
# must be uploaded with a user-specific base id. A good practice is using
# the github user as base id: com.github.<username>. It is also necessary
# to use a user-specific app name when submitting the created package to the
# Palm app catalog. Use "ScummVM (<username>)" instead of "ScummVM" and
# "ScummVM Beta (<username>)" instead of "ScummVM Beta".
#
# The app id is automatically parsed from the installation prefix. So add a
# configure parameter like this to prepare a build of a package for the Palm
# App Catalog:
#
# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm
#
# To build a package for the Palm Beta App Catalog add "-beta" to the prefix:
#
# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm-beta
# ============================================================================
# Increment this number when the packaging of the app has been changed while
# ScummVM itself has the same version as before. The number can be reset to
# 0 when the ScummVM version is increased.
VER_PACKAGE = 0
PATH_DIST = $(srcdir)/dists/webos
PATH_MOJO = $(PATH_DIST)/mojo
APP_ID = $(shell basename $(prefix))
APP_VERSION = $(shell printf "%d.%d.%02d%02d" $(VER_MAJOR) $(VER_MINOR) $(VER_PATCH) $(VER_PACKAGE))
DESTDIR ?= staging
PORTDISTDIR ?= portdist
ifeq ($(HOST_COMPILER),Darwin)
SED_DASH_I = "-i \"\""
else
SED_DASH_I = "-i"
endif
install: all
$(QUIET)$(INSTALL) -d "$(DESTDIR)$(prefix)"
ifeq ($(HOST_COMPILER),Darwin)
$(QUIET)$(INSTALL) -m 0644 "$(PATH_MOJO)/"* "$(DESTDIR)$(prefix)/"
else
$(QUIET)$(INSTALL) -m 0644 -t "$(DESTDIR)$(prefix)/" "$(PATH_MOJO)/"*
endif
$(QUIET)$(INSTALL) -m 0755 "$(PATH_MOJO)/start" "$(DESTDIR)$(prefix)/"
$(QUIET)$(INSTALL) -d "$(DESTDIR)$(bindir)"
$(QUIET)$(INSTALL) -c -m 755 "./$(EXECUTABLE)" "$(DESTDIR)$(bindir)/$(EXECUTABLE)"
$(QUIET)$(STRIP) "$(DESTDIR)$(bindir)/$(EXECUTABLE)"
$(QUIET)$(INSTALL) -d "$(DESTDIR)$(docdir)"
$(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) "$(DESTDIR)$(docdir)"
$(QUIET)$(INSTALL) -d "$(DESTDIR)$(datadir)"
$(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(datadir)/"
ifdef DYNAMIC_MODULES
$(QUIET)$(INSTALL) -d "$(DESTDIR)$(libdir)/"
$(QUIET)$(INSTALL) -c -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/"
$(QUIET)$(STRIP) "$(DESTDIR)$(libdir)/"*
endif
$(QUIET)sed $(SED_DASH_I) s/'APP_VERSION'/'$(APP_VERSION)'/ "$(DESTDIR)$(prefix)/appinfo.json"
$(QUIET)sed $(SED_DASH_I) s/'APP_ID'/'$(APP_ID)'/ "$(DESTDIR)$(prefix)/appinfo.json"
ifneq (,$(findstring -beta,$(APP_ID)))
$(QUIET)sed $(SED_DASH_I) s/'APP_TITLE'/'ScummVM Beta'/ "$(DESTDIR)$(prefix)/appinfo.json"
else
$(QUIET)sed $(SED_DASH_I) s/'APP_TITLE'/'ScummVM'/ "$(DESTDIR)$(prefix)/appinfo.json"
endif
uninstall:
$(QUIET)$(RM_REC) "$(DESTDIR)$(prefix)"
package: uninstall install
$(QUIET)$(RM_REC) "$(PORTDISTDIR)"
$(QUIET)$(MKDIR) "$(PORTDISTDIR)"
$(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format "$(DESTDIR)$(prefix)" -o "$(PORTDISTDIR)"
.PHONY: install uninstall package

86
configure vendored
View file

@ -946,7 +946,7 @@ Configuration:
-h, --help display this help and exit -h, --help display this help and exit
--backend=BACKEND backend to build (3ds, android, dc, dingux, ds, gcw0, --backend=BACKEND backend to build (3ds, android, dc, dingux, ds, gcw0,
gph, iphone, ios7, maemo, n64, null, openpandora, gph, iphone, ios7, maemo, n64, null, openpandora,
ps2, psp, psp2, samsungtv, sdl, switch, webos, wii) [sdl] ps2, psp, psp2, samsungtv, sdl, switch, wii) [sdl]
Installation directories: Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX --prefix=PREFIX install architecture-independent files in PREFIX
@ -999,7 +999,6 @@ Special configuration feature:
psp for PlayStation Portable psp for PlayStation Portable
samsungtv for Samsung TV samsungtv for Samsung TV
switch for Nintendo Switch switch for Nintendo Switch
webos for HP Palm WebOS
wii for Nintendo Wii wii for Nintendo Wii
Game engines: Game engines:
@ -1788,21 +1787,6 @@ switch)
# Switch SDK has C++11 constructs so we must enable it # Switch SDK has C++11 constructs so we must enable it
_use_cxx11=yes _use_cxx11=yes
;; ;;
webos)
_host_os=webos
_host_cpu=arm
_host_alias=arm-none-linux-gnueabi
# The prefix is always the same on WebOS so we hardcode the default
# here. It is still possible to define a custom prefix which is
# needed when packaging the app with a user-specific app ID.
test "x$prefix" = xNONE && prefix=/media/cryptofs/apps/usr/palm/applications/org.scummvm.scummvm
# WebOS apps are installed into app-specific directories. The
# default directory structure of ScummVM makes no sense here so we
# hardcode WebOS specific directories here.
datarootdir='${prefix}/data'
datadir='${datarootdir}'
docdir='${prefix}/doc'
;;
wii) wii)
_host_os=wii _host_os=wii
_host_cpu=powerpc _host_cpu=powerpc
@ -1956,16 +1940,6 @@ riscos)
add_line_to_config_mk "BINDHELP := bindhelp" add_line_to_config_mk "BINDHELP := bindhelp"
fi fi
;; ;;
webos)
if test -z "$WEBOS_SDK"; then
echo "Please set WEBOS_SDK in your environment. export WEBOS_SDK=<path to WebOS SDK>"
exit 1
fi
if test -z "$WEBOS_PDK"; then
echo "Please set WEBOS_PDK in your environment. export WEBOS_PDK=<path to WebOS PDK>"
exit 1
fi
;;
*) *)
;; ;;
esac esac
@ -2341,7 +2315,7 @@ fi
# However, some platforms use GNU extensions in system header files, so # However, some platforms use GNU extensions in system header files, so
# for these we must not use -pedantic. # for these we must not use -pedantic.
case $_host_os in case $_host_os in
3ds | android | androidsdl | gamecube | ps2 | psp | switch | wii | webos) 3ds | android | androidsdl | gamecube | ps2 | psp | switch | wii)
;; ;;
*) *)
# ICC does not support pedantic, while GCC and clang do. # ICC does not support pedantic, while GCC and clang do.
@ -3130,22 +3104,6 @@ EOF
_optimization_level=-O3 _optimization_level=-O3
fi fi
;; ;;
webos)
append_var CXXFLAGS "--sysroot=$WEBOS_PDK/arm-gcc/sysroot"
append_var CXXFLAGS "-I$WEBOS_PDK/include"
append_var CXXFLAGS "-I$WEBOS_PDK/include/SDL"
append_var CXXFLAGS "-I$WEBOS_PDK/device/usr/include"
# These compiler options are needed to support the Palm Pixi
append_var CXXFLAGS "-mcpu=arm1136jf-s"
append_var CXXFLAGS "-mfpu=vfp "
append_var CXXFLAGS "-mfloat-abi=softfp"
append_var LDFLAGS "-L$WEBOS_PDK/device/lib"
append_var LDFLAGS "-L$WEBOS_PDK/device/usr/lib"
append_var LDFLAGS "-Wl,--allow-shlib-undefined"
append_var LDFLAGS "--sysroot=$WEBOS_PDK/arm-gcc/sysroot"
add_line_to_config_mk "WEBOS_SDK = $WEBOS_SDK"
_seq_midi=no
;;
wii) wii)
_optimization_level=-Os _optimization_level=-Os
append_var CXXFLAGS "-mrvl" append_var CXXFLAGS "-mrvl"
@ -3583,17 +3541,6 @@ if test -n "$_host"; then
_vkeybd=yes _vkeybd=yes
_port_mk="backends/platform/sdl/switch/switch.mk" _port_mk="backends/platform/sdl/switch/switch.mk"
;; ;;
webos)
_backend="webos"
_port_mk="backends/platform/webos/webos.mk"
_build_scalers=yes
_build_hq_scalers=no
_timidity=no
_mt32emu=no
_seq_midi=no
_vkeybd=no
add_line_to_config_mk "HOST_COMPILER = `uname`"
;;
wii) wii)
_backend="wii" _backend="wii"
_build_scalers=no _build_scalers=no
@ -3769,15 +3716,6 @@ case $_backend in
_sdl=auto _sdl=auto
append_var MODULES "backends/platform/sdl" append_var MODULES "backends/platform/sdl"
;; ;;
webos)
# There is no sdl-config in the WebOS PDK so we don't use find_sdlconfig here.
# The PDL library acts as the WebOS device toolchain, and is required to control the virtual keyboard among other OS-level events.
append_var LIBS "-lSDL -lpdl"
append_var DEFINES "-DWEBOS"
append_var MODULES "backends/platform/sdl"
_sdl=yes
_sdlversion=1.2.0
;;
wii) wii)
append_var DEFINES "-D__WII__" append_var DEFINES "-D__WII__"
append_var DEFINES "-DGEKKO" append_var DEFINES "-DGEKKO"
@ -3921,7 +3859,7 @@ fi
# Enable 16bit support only for backends which support it # Enable 16bit support only for backends which support it
# #
case $_backend in case $_backend in
3ds | android | androidsdl | dingux | dc | gph | iphone | ios7 | maemo | null | openpandora | psp | psp2 | samsungtv | sdl | switch | webos | wii) 3ds | android | androidsdl | dingux | dc | gph | iphone | ios7 | maemo | null | openpandora | psp | psp2 | samsungtv | sdl | switch | wii)
if test "$_16bit" = auto ; then if test "$_16bit" = auto ; then
_16bit=yes _16bit=yes
else else
@ -3997,7 +3935,7 @@ case $_host_os in
amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp2 | psp | riscos | wii) amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp2 | psp | riscos | wii)
_posix=no _posix=no
;; ;;
3ds | android | androidsdl | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | ios7 | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | switch | uclinux* | webos) 3ds | android | androidsdl | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | ios7 | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | switch | uclinux*)
_posix=yes _posix=yes
;; ;;
os2-emx*) os2-emx*)
@ -4219,18 +4157,6 @@ PLUGIN_LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backend
_mak_plugins=' _mak_plugins='
LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/main_prog.ld LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/main_prog.ld
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -lstdc++ -lc PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -lstdc++ -lc
'
;;
webos)
_plugin_prefix="lib"
_plugin_suffix=".so"
append_var CXXFLAGS "-fpic"
append_var LIBS "-ldl"
_mak_plugins='
PLUGIN_EXTRA_DEPS =
PLUGIN_LDFLAGS += -shared $(LDFLAGS)
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
POST_OBJS_FLAGS := -Wl,-no-whole-archive
' '
;; ;;
*) *)
@ -5735,8 +5661,8 @@ case $_backend in
# Add ../plugins as a path so plugins can be found when running from a .PND. # Add ../plugins as a path so plugins can be found when running from a .PND.
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"../plugins\\\"" append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"../plugins\\\""
;; ;;
maemo | webos) maemo)
# The WebOS and Maemo apps want the plugins in the "lib" directory # The Maemo apps want the plugins in the "lib" directory
# without a scummvm sub directory. # without a scummvm sub directory.
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$libdir\\\"" append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$libdir\\\""
;; ;;

View file

@ -1,37 +0,0 @@
README for the WebOS port of ScummVM
------------------------------------
INSTALLATION
When starting ScummVM the first time on a WebOS device it creates the
following directory structure on the flash drive:
ScummVM/
Extras/
Games/
Plugins/
Saves/
Screenshots/
Themes/
To install the games switch your WebOS device to USB drive mode and copy
the game folders into the ScummVM/Games directory. Then start ScummVM,
click "Add game" and select the game folder.
CONTROLS
Touchscreen
The touchscreen operates like a touchpad. The mouse cursor is independent
of the touched point, it is moved relative to its current position.
Tap + movement: Mouse movement
Tap without movement: Left mouse button click
Tap held for >0.5s without movement: Right mouse button click
Tap held for >1s without movement: Middle mouse button click
Double Tap + movement: Drag and drop
Gesture area
Back gesture: Escape
Forward gesture: ScummVM menu

View file

@ -1,10 +0,0 @@
{
"id": "APP_ID",
"version": "APP_VERSION",
"vendor": "ScummVM Team",
"type": "pdk",
"main": "start",
"title": "APP_TITLE",
"icon": "icon.png",
"requiredMemory": 64
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View file

@ -1 +0,0 @@
filemode.755=start,bin/scummvm

View file

@ -1,32 +0,0 @@
[scummvm]
gui_theme=scummremastered
mute=false
speech_volume=192
native_mt32=false
midi_gain=100
talkspeed=60
subtitles=true
multi_midi=false
fullscreen=true
sfx_volume=192
music_volume=192
autosave_period=300
music_driver=auto
opl_driver=auto
aspect_ratio=false
speech_mute=false
enable_gs=false
browser_lastpath=/media/internal/ScummVM/Games
savepath=/media/internal/ScummVM/Saves
[keymapper]
keymap_global_MEN=FORWARD
keymap_gui_VIR=C+k
keymap_global_SKL=PERIOD
keymap_global_SKC=ESCAPE
keymap_gui_REM=AT
keymap_global_PAU=SPACE
keymap_gui_CLO=ESCAPE
keymap_gui_CLI=RETURN
keymap_global_VIR=C+k
keymap_global_REM=AT

View file

@ -1,22 +0,0 @@
#!/bin/sh
# Setup directories
APPDIR=$(readlink -f $(dirname $0))
SCUMMVMDIR=/media/internal/ScummVM
# Create the initial ScummVM directory structure
mkdir -p $SCUMMVMDIR/Games
mkdir -p $SCUMMVMDIR/Saves
mkdir -p $SCUMMVMDIR/Screenshots
# Install default configuration file if not already present
if [ ! -f $SCUMMVMDIR/scummvmrc ]
then
cp $APPDIR/scummvmrc-default $SCUMMVMDIR/scummvmrc
fi
# Change into the screenshots directory so screenshots are saved there
cd $SCUMMVMDIR/Screenshots
# Run the game
exec $APPDIR/bin/scummvm -c $SCUMMVMDIR/scummvmrc

View file

@ -31,7 +31,7 @@
#include "lure/events.h" #include "lure/events.h"
#include "lure/lure.h" #include "lure/lure.h"
#if defined(__SYMBIAN32__) || defined(WEBOS) || defined(__ANDROID__) || defined(__WII__) #if defined(__SYMBIAN32__) || defined(__ANDROID__) || defined(__WII__)
#define LURE_CLICKABLE_MENUS #define LURE_CLICKABLE_MENUS
#endif #endif

View file

@ -59,7 +59,6 @@ backends/events/gph/gph-events.cpp
backends/events/maemosdl/maemosdl-events.cpp backends/events/maemosdl/maemosdl-events.cpp
backends/events/openpandora/op-events.cpp backends/events/openpandora/op-events.cpp
backends/events/symbiansdl/symbiansdl-events.cpp backends/events/symbiansdl/symbiansdl-events.cpp
backends/events/webossdl/webossdl-events.cpp
backends/graphics/opengl/opengl-graphics.cpp backends/graphics/opengl/opengl-graphics.cpp
backends/graphics/openglsdl/openglsdl-graphics.cpp backends/graphics/openglsdl/openglsdl-graphics.cpp
backends/graphics/surfacesdl/surfacesdl-graphics.cpp backends/graphics/surfacesdl/surfacesdl-graphics.cpp