Commit f63cb9f2 authored by Sam Lantinga's avatar Sam Lantinga

David Hedbor is no longer maintaining the Qtopia code.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402024
parent 3972b779
==============================================================================
Using the Simple DirectMedia Layer with Qtopia/OPIE
==============================================================================
==============================================================================
I. Setting up the Qtopia development environment.
This document will not explain how to setup the Qtopia development
environment. That is outside the scope of the document. You can read
more on this subject in this excellent howto:
http://www.zauruszone.com/howtos/linux_compiler_setup_howto.html
==============================================================================
II. Building the Simple DirectMedia Layer libraries using the arm
cross-compiler
This is somewhat tricky since the name of the compiler binaries
differ from the standard. Also you should disable features not
needed. The command below works for me. Note that it's all one
line. You can also set the NM, LD etc environment variables
separately.
NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ RANLIB=arm-linux-ranlib AR=arm-linux-ar ./configure --enable-video-qtopia --disable-video-dummy --disable-video-fbcon --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --prefix=/opt/Qtopia/sharp/ arm-unknown-linux-gnu
One thing to note is that the above configure will include joystick
support, even though you can't have joysticks on the Zaurus. The
reason for this is to avoid link / compile / runtime errors with
applications that have joystick support.
==============================================================================
III. Building the Simple DirectMedia Layer test programs:
After installing, making sure the correct sdl-config is in your
path, run configure like this:
NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar ./configure arm-unknown-linux-gnu
==============================================================================
IV. Application porting notes
One thing I have noticed is that applications sometimes don't exit
correctly. Their icon remains in the taskbar and they tend to
relaunch themselves automatically. I believe this problem doesn't
occur if you exit your application using the exit() method. However,
if you end main() with 'return 0;' or so, this seems to happen.
Also note that when running in landscape mode - i.e requesting a
window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH
and HEIGHT normally is 240 and 320 - the image is blitted so that
the hardware buttons are on the left side of the display. This might
not always be desirable but such is the code today.
==============================================================================
V. Enjoy! :)
If you have a project you'd like me to know about, or want to ask questions,
go ahead and join the SDL developer's mailing list by sending e-mail to:
sdl-request@libsdl.org
and put "subscribe" into the subject of the message. Or alternatively you
can use the web interface:
http://www.libsdl.org/mailman/listinfo/sdl
==============================================================================
VI. What is supported:
Keyboard (Sharp Zaurus)
Hardware buttons
Stylus input (mouse)
Video. Allows fullscreen both in portrait mode (up to WIDTHxHEIGHT
size window) and in landscape mode (up to HEIGHTxWIDTH).
All other SDL functionality works like a normal Linux system (threads,
audio etc).
--
David Hedbor <david@hedbor.org>
http://david.hedbor.org/ http://eongames.com/
...@@ -1268,40 +1268,6 @@ AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]] ...@@ -1268,40 +1268,6 @@ AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]
fi fi
} }
dnl Set up the QTopia video driver if enabled
CheckQtopia()
{
AC_ARG_ENABLE(video-qtopia,
AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]),
, enable_video_qtopia=no)
if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
AC_MSG_CHECKING(for Qtopia support)
video_qtopia=no
QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
AC_LANG_CPLUSPLUS
OLD_CXX="$CXXFLAGS"
CXXFLAGS="$QTOPIA_FLAGS"
AC_TRY_COMPILE([
#include <qpe/qpeapplication.h>
],[
],[
video_qtopia=yes
])
CXXFLAGS="$OLD_CXX"
AC_MSG_RESULT($video_qtopia)
if test x$video_qtopia = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
have_video=yes
fi
AC_LANG_C
fi
}
dnl Set up the Atari Bios keyboard driver dnl Set up the Atari Bios keyboard driver
CheckAtariBiosEvent() CheckAtariBiosEvent()
{ {
...@@ -2045,7 +2011,6 @@ case "$host" in ...@@ -2045,7 +2011,6 @@ case "$host" in
CheckSVGA CheckSVGA
CheckVGL CheckVGL
CheckWscons CheckWscons
CheckQtopia
CheckOpenGLX11 CheckOpenGLX11
CheckInputEvents CheckInputEvents
CheckTslib CheckTslib
......
...@@ -266,7 +266,6 @@ ...@@ -266,7 +266,6 @@
#undef SDL_VIDEO_DRIVER_OS2FS #undef SDL_VIDEO_DRIVER_OS2FS
#undef SDL_VIDEO_DRIVER_PHOTON #undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_PS2GS #undef SDL_VIDEO_DRIVER_PS2GS
#undef SDL_VIDEO_DRIVER_QTOPIA
#undef SDL_VIDEO_DRIVER_RISCOS #undef SDL_VIDEO_DRIVER_RISCOS
#undef SDL_VIDEO_DRIVER_SVGALIB #undef SDL_VIDEO_DRIVER_SVGALIB
#undef SDL_VIDEO_DRIVER_TOOLBOX #undef SDL_VIDEO_DRIVER_TOOLBOX
......
/* Include the SDL main definition header */
#include "SDL_main.h"
#include <stdlib.h>
#include <unistd.h>
#ifdef main
#undef main
#endif
#ifdef QWS
#include <qpe/qpeapplication.h>
#include <qapplication.h>
#include <qpe/qpeapplication.h>
#include <stdlib.h>
// Workaround for OPIE to remove taskbar icon. Also fixes
// some issues in Qtopia where there are left-over qcop files in /tmp/.
// I'm guessing this will also clean up the taskbar in the Sharp version
// of Qtopia.
static inline void
cleanupQCop()
{
QString appname(qApp->argv()[0]);
int slash = appname.findRev("/");
if (slash != -1) {
appname = appname.mid(slash + 1);
}
QString cmd =
QPEApplication::qpeDir() +
"bin/qcop QPE/System 'closing(QString)' '" + appname + "'";
system(cmd.latin1());
cmd = "/tmp/qcop-msg-" + appname;
unlink(cmd.latin1());
}
static QPEApplication *app;
#endif
extern int SDL_main(int argc, char *argv[]);
int
main(int argc, char *argv[])
{
#ifdef QWS
// This initializes the Qtopia application. It needs to be done here
// because it parses command line options.
app = new QPEApplication(argc, argv);
QWidget dummy;
app->showMainWidget(&dummy);
atexit(cleanupQCop);
#endif
// Exit here because if return is used, the application
// doesn't seem to quit correctly.
exit(SDL_main(argc, argv));
}
/* vi: set ts=4 sw=4 expandtab: */
...@@ -306,9 +306,6 @@ extern VideoBootStrap NX_bootstrap; ...@@ -306,9 +306,6 @@ extern VideoBootStrap NX_bootstrap;
#if SDL_VIDEO_DRIVER_IPOD #if SDL_VIDEO_DRIVER_IPOD
extern VideoBootStrap iPod_bootstrap; extern VideoBootStrap iPod_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_QTOPIA
extern VideoBootStrap Qtopia_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_WSCONS #if SDL_VIDEO_DRIVER_WSCONS
extern VideoBootStrap WSCONS_bootstrap; extern VideoBootStrap WSCONS_bootstrap;
#endif #endif
......
...@@ -55,9 +55,6 @@ static VideoBootStrap *bootstrap[] = { ...@@ -55,9 +55,6 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_IPOD #if SDL_VIDEO_DRIVER_IPOD
&iPod_bootstrap, &iPod_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_QTOPIA
&Qtopia_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_WSCONS #if SDL_VIDEO_DRIVER_WSCONS
&WSCONS_bootstrap, &WSCONS_bootstrap,
#endif #endif
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include <qpe/qpeapplication.h>
#include <qapplication.h>
#include <qevent.h>
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_error.h"
/* Flag to tell whether or not the Be application is active or not */
int SDL_QPEAppActive = 0;
static QPEApplication *app;
int
SDL_InitQPEApp()
{
if (SDL_QPEAppActive <= 0) {
if (!qApp) {
int argc = 1;
char *argv[] = { {"SDLApp"} };
app = new QPEApplication(argc, argv);
QWidget dummy;
app->showMainWidget(&dummy);
} else {
app = (QPEApplication *) qApp;
}
SDL_QPEAppActive++;
}
return 0;
}
/* Quit the QPE Application, if there's nothing left to do */
void
SDL_QuitQPEApp(void)
{
/* Decrement the application reference count */
SDL_QPEAppActive--;
/* If the reference count reached zero, clean up the app */
if (SDL_QPEAppActive == 0 && app) {
delete app;
app = 0;
qApp = 0;
}
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* Handle the QPE application loop */
/* Initialize the QPE Application, if it's not already started */
extern int SDL_InitQPEApp(void);
/* Quit the QPE Application, if there's nothing left to do */
extern void SDL_QuitQPEApp(void);
/* Flag to tell whether the app is active or not */
extern int SDL_QPEAppActive;
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_QWin_h
#define _SDL_QWin_h
#include <stdio.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qwidget.h>
#include <qpainter.h>
#include <qdirectpainter_qws.h>
#include "SDL_events.h"
extern "C"
{
#include "../../events/SDL_events_c.h"
};
typedef enum
{
SDL_QT_NO_ROTATION = 0,
SDL_QT_ROTATION_90,
SDL_QT_ROTATION_270
} screenRotationT;
extern screenRotationT screenRotation;
class SDL_QWin:public QWidget
{
void QueueKey(QKeyEvent * e, int pressed);
public:
SDL_QWin(const QSize & size);
virtual ~ SDL_QWin();
virtual bool shown(void)
{
return isVisible();
}
/* If called, the next resize event will not be forwarded to SDL. */
virtual void inhibitResize(void)
{
my_inhibit_resize = true;
}
void setImage(QImage * image);
void setOffset(int x, int y)
{
my_offset = QPoint(x, y);
}
void GetXYOffset(int &x, int &y)
{
x = my_offset.x();
y = my_offset.y();
}
QImage *image(void)
{
return my_image;
}
void setWFlags(WFlags flags)
{
QWidget::setWFlags(flags);
my_flags = flags;
}
const QPoint & mousePos() const
{
return my_mouse_pos;
}
void setMousePos(const QPoint & newpos);
void setFullscreen(bool);
bool lockScreen(bool force = false);
void unlockScreen();
void repaintRect(const QRect & rect);
protected:
/* Handle resizing of the window */
virtual void resizeEvent(QResizeEvent * e);
void focusInEvent(QFocusEvent *);
void focusOutEvent(QFocusEvent *);
void closeEvent(QCloseEvent * e);
void mouseMoveEvent(QMouseEvent * e);
void mousePressEvent(QMouseEvent * e);
void mouseReleaseEvent(QMouseEvent * e);
void paintEvent(QPaintEvent * ev);
void keyPressEvent(QKeyEvent * e)
{
QueueKey(e, 1);
}
void keyReleaseEvent(QKeyEvent * e)
{
QueueKey(e, 0);
}
private:
bool repaintRotation0(const QRect & rect);
bool repaintRotation1(const QRect & rect);
bool repaintRotation3(const QRect & rect);
void enableFullscreen();
QDirectPainter *my_painter;
QImage *my_image;
bool my_inhibit_resize;
QPoint my_offset;
QPoint my_mouse_pos;
WFlags my_flags;
WFlags my_has_fullscreen;
unsigned int my_locked;
};
#endif /* _SDL_QWin_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_lowvideo_h
#define _SDL_lowvideo_h
#include "SDL_mouse.h"
#include "../SDL_sysvideo.h"
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *_this
/* Private display data */
struct SDL_PrivateVideoData
{
/* The main window */
SDL_QWin *SDL_Win;
/* The fullscreen mode list */
#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
int SDL_nummodes[NUM_MODELISTS];
SDL_Rect **SDL_modelist[NUM_MODELISTS];
/* A completely clear cursor */
WMcursor *BlankCursor;
/* Mouse state variables */
Uint32 last_buttons;
QPoint last_point;
/* Keyboard state variables */
int key_flip;
//struct key_info keyinfo[2];
};
/* Old variable names */
#define SDL_Win (_this->hidden->SDL_Win)
#define saved_mode (_this->hidden->saved_mode)
#define SDL_nummodes (_this->hidden->SDL_nummodes)
#define SDL_modelist (_this->hidden->SDL_modelist)
#define SDL_BlankCursor (_this->hidden->BlankCursor)
#define last_buttons (_this->hidden->last_buttons)
#define last_point (_this->hidden->last_point)
#define key_flip (_this->hidden->key_flip)
#define keyinfo (_this->hidden->keyinfo)
#endif /* _SDL_lowvideo_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include <qpe/qpeapplication.h>
#include <stdio.h>
#include <string.h>
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_QWin.h"
#include "SDL_lowvideo.h"
#include "SDL_timer.h"
extern "C"
{
#include "../../events/SDL_sysevents.h"
#include "../../events/SDL_events_c.h"
#include "SDL_sysevents_c.h"
// static SDLKey keymap[128];
/* This is special because we know it will be run in a loop in a separate
thread. Normally this function should loop as long as there are input
states changing, i.e. new events arriving.
*/
void QT_PumpEvents(_THIS)
{
if (!qApp) {
return;
}
// printf("processing events: %p\n", qApp);
//qApp->processOneEvent(); // wait for a event
qApp->processEvents(); // and process all outstanding ones
#if 0
BView *view;
BRect bounds;
BPoint point;
uint32 buttons;
const uint32 button_masks[3] = {
B_PRIMARY_MOUSE_BUTTON,
B_TERTIARY_MOUSE_BUTTON,
B_SECONDARY_MOUSE_BUTTON,
};
unsigned int i, j;
/* Check out the mouse buttons and position (slight race condition) */
if (SDL_Win->Lock()) {
/* Don't do anything if we have no view */
view = SDL_Win->View();
if (!view) {
SDL_Win->Unlock();
return;
}
bounds = view->Bounds();
/* Get new input state, if still active */
if (SDL_Win->IsActive()) {
key_flip = !key_flip;
get_key_info(&keyinfo[key_flip]);
view->GetMouse(&point, &buttons, true);
} else {
key_flip = key_flip;
point = last_point;
buttons = last_buttons;
}
SDL_Win->Unlock();
} else {
return;
}
/* If our view is active, we'll find key changes here */
if (SDL_memcmp(keyinfo[0].key_states, keyinfo[1].key_states, 16) != 0) {
for (i = 0; i < 16; ++i) {
Uint8 new_state, transition;
new_state = keyinfo[key_flip].key_states[i];
transition = keyinfo[!key_flip].key_states[i] ^
keyinfo[key_flip].key_states[i];
for (j = 0; j < 8; ++j) {
if (transition & 0x80)
QueueKey(i * 8 + j, new_state & 0x80);
transition <<= 1;
new_state <<= 1;
}
}
}
/* We check keyboard, but not mouse if mouse isn't in window */
if (!bounds.Contains(point)) {
/* Mouse moved outside our view? */
if (SDL_GetAppState() & SDL_APPMOUSEFOCUS) {
SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
be_app->SetCursor(B_HAND_CURSOR);
}
return;
}
/* Has the mouse moved back into our view? */
if (!(SDL_GetAppState() & SDL_APPMOUSEFOCUS)) {
/* Reset the B_HAND_CURSOR to our own */
SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
SDL_SetCursor(NULL);
}
/* Check for mouse motion */
if (point != last_point) {
int x, y;
SDL_Win->GetXYOffset(x, y);
x = (int) point.x - x;
y = (int) point.y - y;
SDL_PrivateMouseMotion(0, 0, x, y);
}
last_point = point;
/* Add any mouse button events */
for (i = 0; i < SDL_TABLESIZE(button_masks); ++i) {
if ((buttons ^ last_buttons) & button_masks[i]) {
if (buttons & button_masks[i]) {
SDL_PrivateMouseButton(SDL_PRESSED, 1 + i, 0, 0);
} else {
SDL_PrivateMouseButton(SDL_RELEASED, 1 + i, 0, 0);
}
}
}
last_buttons = buttons;
#endif
}
void QT_InitOSKeymap(_THIS)
{
#if 0
unsigned int i;
/* Initialize all the key states as "up" */
key_flip = 0;
SDL_memset(keyinfo[key_flip].key_states, 0, 16);
/* Initialize the key translation table */
for (i = 0; i < SDL_TABLESIZE(keymap); ++i)
keymap[i] = SDLK_UNKNOWN;
// keymap[0x01] = SDLK_ESCAPE;
// keymap[B_F1_KEY] = SDLK_F1;
// keymap[B_F2_KEY] = SDLK_F2;
// keymap[B_F3_KEY] = SDLK_F3;
// keymap[B_F4_KEY] = SDLK_F4;
// keymap[B_F5_KEY] = SDLK_F5;
// keymap[B_F6_KEY] = SDLK_F6;
// keymap[B_F7_KEY] = SDLK_F7;
// keymap[B_F8_KEY] = SDLK_F8;
// keymap[B_F9_KEY] = SDLK_F9;
// keymap[B_F10_KEY] = SDLK_F10;
// keymap[B_F11_KEY] = SDLK_F11;
// keymap[B_F12_KEY] = SDLK_F12;
// keymap[B_PRINT_KEY] = SDLK_PRINT;
//keymap[B_SCROLL_KEY] = SDLK_SCROLLOCK;
// keymap[B_PAUSE_KEY] = SDLK_PAUSE;
keymap[0x11] = SDLK_BACKQUOTE;
keymap[0x12] = SDLK_1;
keymap[0x13] = SDLK_2;
keymap[0x14] = SDLK_3;
keymap[0x15] = SDLK_4;
keymap[0x16] = SDLK_5;
keymap[0x17] = SDLK_6;
keymap[0x18] = SDLK_7;
keymap[0x19] = SDLK_8;
keymap[0x1a] = SDLK_9;
keymap[0x1b] = SDLK_0;
keymap[0x1c] = SDLK_MINUS;
keymap[0x1d] = SDLK_EQUALS;
keymap[0x1e] = SDLK_BACKSPACE;
keymap[0x1f] = SDLK_INSERT;
keymap[0x20] = SDLK_HOME;
keymap[0x21] = SDLK_PAGEUP;
//keymap[0x22] = SDLK_NUMLOCK;
keymap[0x23] = SDLK_KP_DIVIDE;
keymap[0x24] = SDLK_KP_MULTIPLY;
keymap[0x25] = SDLK_KP_MINUS;
keymap[0x26] = SDLK_TAB;
keymap[0x27] = SDLK_q;
keymap[0x28] = SDLK_w;
keymap[0x29] = SDLK_e;
keymap[0x2a] = SDLK_r;
keymap[0x2b] = SDLK_t;
keymap[0x2c] = SDLK_y;
keymap[0x2d] = SDLK_u;
keymap[0x2e] = SDLK_i;
keymap[0x2f] = SDLK_o;
keymap[0x30] = SDLK_p;
keymap[0x31] = SDLK_LEFTBRACKET;
keymap[0x32] = SDLK_RIGHTBRACKET;
keymap[0x33] = SDLK_BACKSLASH;
keymap[0x34] = SDLK_DELETE;
keymap[0x35] = SDLK_END;
keymap[0x36] = SDLK_PAGEDOWN;
keymap[0x37] = SDLK_KP7;
keymap[0x38] = SDLK_KP8;
keymap[0x39] = SDLK_KP9;
keymap[0x3a] = SDLK_KP_PLUS;
//keymap[0x3b] = SDLK_CAPSLOCK;
keymap[0x3c] = SDLK_a;
keymap[0x3d] = SDLK_s;
keymap[0x3e] = SDLK_d;
keymap[0x3f] = SDLK_f;
keymap[0x40] = SDLK_g;
keymap[0x41] = SDLK_h;
keymap[0x42] = SDLK_j;
keymap[0x43] = SDLK_k;
keymap[0x44] = SDLK_l;
keymap[0x45] = SDLK_SEMICOLON;
keymap[0x46] = SDLK_QUOTE;
keymap[0x47] = SDLK_RETURN;
keymap[0x48] = SDLK_KP4;
keymap[0x49] = SDLK_KP5;
keymap[0x4a] = SDLK_KP6;
keymap[0x4b] = SDLK_LSHIFT;
keymap[0x4c] = SDLK_z;
keymap[0x4d] = SDLK_x;
keymap[0x4e] = SDLK_c;
keymap[0x4f] = SDLK_v;
keymap[0x50] = SDLK_b;
keymap[0x51] = SDLK_n;
keymap[0x52] = SDLK_m;
keymap[0x53] = SDLK_COMMA;
keymap[0x54] = SDLK_PERIOD;
keymap[0x55] = SDLK_SLASH;
keymap[0x56] = SDLK_RSHIFT;
keymap[0x57] = SDLK_UP;
keymap[0x58] = SDLK_KP1;
keymap[0x59] = SDLK_KP2;
keymap[0x5a] = SDLK_KP3;
keymap[0x5b] = SDLK_KP_ENTER;
//keymap[0x5c] = SDLK_LCTRL;
//keymap[0x5d] = SDLK_LALT;
keymap[0x5e] = SDLK_SPACE;
//keymap[0x5f] = SDLK_RALT;
//keymap[0x60] = SDLK_RCTRL;
keymap[0x61] = SDLK_LEFT;
keymap[0x62] = SDLK_DOWN;
keymap[0x63] = SDLK_RIGHT;
keymap[0x64] = SDLK_KP0;
keymap[0x65] = SDLK_KP_PERIOD;
//keymap[0x66] = SDLK_LMETA;
//keymap[0x67] = SDLK_RMETA;
//keymap[0x68] = SDLK_MENU;
keymap[0x69] = SDLK_EURO;
keymap[0x6a] = SDLK_KP_EQUALS;
keymap[0x6b] = SDLK_POWER;
#endif
}
}; /* Extern C */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_lowvideo.h"
/* Variables and functions exported by SDL_sysevents.c to other parts
of the native video subsystem (SDL_sysvideo.c)
*/
extern void QT_InitOSKeymap(_THIS);
extern void QT_PumpEvents(_THIS);
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_QWin.h"
extern "C"
{
#include "SDL_sysmouse_c.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor
{
char *bits;
};
WMcursor *QT_CreateWMCursor(_THIS,
Uint8 * data, Uint8 * mask, int w, int h,
int hot_x, int hot_y)
{
static WMcursor dummy;
dummy.bits = 0;
return &dummy;
}
int QT_ShowWMCursor(_THIS, WMcursor * cursor)
{
return 1;
}
void QT_FreeWMCursor(_THIS, WMcursor * cursor)
{
}
void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
SDL_Win->setMousePos(QPoint(x, y));
}
}; /* Extern C */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_lowvideo.h"
/* Functions to be exported */
extern void QT_FreeWMCursor(_THIS, WMcursor * cursor);
extern WMcursor *QT_CreateWMCursor(_THIS,
Uint8 * data, Uint8 * mask, int w, int h,
int hot_x, int hot_y);
extern int QT_ShowWMCursor(_THIS, WMcursor * cursor);
extern void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_QWin.h"
extern "C"
{
#include "SDL_syswm_c.h"
void QT_SetWMCaption(_THIS, const char *title, const char *icon)
{
SDL_Win->setCaption(title);
}
}; /* Extern C */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_lowvideo.h"
/* Functions to be exported */
extern void QT_SetWMCaption(_THIS, const char *title, const char *icon);
/* vi: set ts=4 sw=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment