Commit 81cdb586 authored by Sam Lantinga's avatar Sam Lantinga

The AAlib driver is fun, but not worth rewriting for SDL 1.3

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401990
parent dc312617
...@@ -1268,32 +1268,6 @@ AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]] ...@@ -1268,32 +1268,6 @@ AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]
fi fi
} }
dnl Find the AAlib includes
CheckAAlib()
{
AC_ARG_ENABLE(video-aalib,
AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [[default=no]]]),
, enable_video_aalib=no)
if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
AC_MSG_CHECKING(for AAlib support)
video_aalib=no
AC_TRY_COMPILE([
#include <aalib.h>
],[
],[
video_aalib=yes
])
AC_MSG_RESULT($video_aalib)
if test x$video_aalib = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
have_video=yes
fi
fi
}
dnl Set up the QTopia video driver if enabled dnl Set up the QTopia video driver if enabled
CheckQtopia() CheckQtopia()
{ {
...@@ -2088,7 +2062,6 @@ case "$host" in ...@@ -2088,7 +2062,6 @@ case "$host" in
CheckSVGA CheckSVGA
CheckVGL CheckVGL
CheckWscons CheckWscons
CheckAAlib
CheckQtopia CheckQtopia
CheckPicoGUI CheckPicoGUI
CheckOpenGLX11 CheckOpenGLX11
......
...@@ -249,7 +249,6 @@ ...@@ -249,7 +249,6 @@
#undef SDL_TIMER_WINCE #undef SDL_TIMER_WINCE
/* Enable various video drivers */ /* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_AALIB
#undef SDL_VIDEO_DRIVER_BWINDOW #undef SDL_VIDEO_DRIVER_BWINDOW
#undef SDL_VIDEO_DRIVER_COCOA #undef SDL_VIDEO_DRIVER_COCOA
#undef SDL_VIDEO_DRIVER_CYBERGRAPHICS #undef SDL_VIDEO_DRIVER_CYBERGRAPHICS
......
...@@ -372,9 +372,6 @@ extern VideoBootStrap RISCOS_bootstrap; ...@@ -372,9 +372,6 @@ extern VideoBootStrap RISCOS_bootstrap;
#if SDL_VIDEO_DRIVER_OS2FS #if SDL_VIDEO_DRIVER_OS2FS
extern VideoBootStrap OS2FSLib_bootstrap; extern VideoBootStrap OS2FSLib_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_AALIB
extern VideoBootStrap AALIB_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_DUMMY #if SDL_VIDEO_DRIVER_DUMMY
extern VideoBootStrap DUMMY_bootstrap; extern VideoBootStrap DUMMY_bootstrap;
#endif #endif
......
...@@ -121,9 +121,6 @@ static VideoBootStrap *bootstrap[] = { ...@@ -121,9 +121,6 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_OS2FS #if SDL_VIDEO_DRIVER_OS2FS
&OS2FSLib_bootstrap, &OS2FSLib_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_AALIB
&AALIB_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_DUMMY #if SDL_VIDEO_DRIVER_DUMMY
&DUMMY_bootstrap, &DUMMY_bootstrap,
#endif #endif
......
/*
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 event stream, converting AA events into SDL events */
#include <stdio.h>
#include <aalib.h>
#include "SDL.h"
#include "../../events/SDL_sysevents.h"
#include "../../events/SDL_events_c.h"
#include "SDL_aavideo.h"
#include "SDL_aaevents_c.h"
/* The translation tables from a console scancode to a SDL keysym */
static SDLKey keymap[401];
static SDL_keysym *TranslateKey(int scancode, SDL_keysym * keysym);
void
AA_PumpEvents(_THIS)
{
int posted = 0;
int mouse_button, mouse_x, mouse_y;
int evt;
SDL_keysym keysym;
static int prev_button = -1, prev_x = -1, prev_y = -1;
if (!this->screen) /* Wait till we got the screen initialized */
return;
do {
posted = 0;
/* Gather events */
/* Get mouse status */
SDL_mutexP(AA_mutex);
aa_getmouse(AA_context, &mouse_x, &mouse_y, &mouse_button);
SDL_mutexV(AA_mutex);
mouse_x = mouse_x * this->screen->w / aa_scrwidth(AA_context);
mouse_y = mouse_y * this->screen->h / aa_scrheight(AA_context);
/* Compare against previous state and generate events */
if (prev_button != mouse_button) {
if (mouse_button & AA_BUTTON1) {
if (!(prev_button & AA_BUTTON1)) {
posted += SDL_PrivateMouseButton(SDL_PRESSED, 1, 0, 0);
}
} else {
if (prev_button & AA_BUTTON1) {
posted += SDL_PrivateMouseButton(SDL_RELEASED, 1, 0, 0);
}
}
if (mouse_button & AA_BUTTON2) {
if (!(prev_button & AA_BUTTON2)) {
posted += SDL_PrivateMouseButton(SDL_PRESSED, 2, 0, 0);
}
} else {
if (prev_button & AA_BUTTON2) {
posted += SDL_PrivateMouseButton(SDL_RELEASED, 2, 0, 0);
}
}
if (mouse_button & AA_BUTTON3) {
if (!(prev_button & AA_BUTTON3)) {
posted += SDL_PrivateMouseButton(SDL_PRESSED, 3, 0, 0);
}
} else {
if (prev_button & AA_BUTTON3) {
posted += SDL_PrivateMouseButton(SDL_RELEASED, 3, 0, 0);
}
}
}
if (prev_x != mouse_x || prev_y != mouse_y) {
posted += SDL_PrivateMouseMotion(0, 0, mouse_x, mouse_y);
}
prev_button = mouse_button;
prev_x = mouse_x;
prev_y = mouse_y;
/* Get keyboard event */
SDL_mutexP(AA_mutex);
evt = aa_getevent(AA_context, 0);
SDL_mutexV(AA_mutex);
if ((evt > AA_NONE) && (evt < AA_RELEASE) && (evt != AA_MOUSE)
&& (evt != AA_RESIZE)) {
/* Key pressed */
/* printf("Key pressed: %d (%c)\n", evt, evt); */
posted +=
SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(evt, &keysym));
} else if (evt >= AA_RELEASE) {
/* Key released */
evt &= ~AA_RELEASE;
/* printf("Key released: %d (%c)\n", evt, evt); */
posted +=
SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(evt, &keysym));
}
}
while (posted);
}
void
AA_InitOSKeymap(_THIS)
{
int i;
static const char *std_keys =
" 01234567890&#'()_-|$*+-=/\\:;.,!?<>{}[]@~%^\x9";
const char *std;
/* Initialize the AAlib key translation table */
for (i = 0; i < SDL_arraysize(keymap); ++i)
keymap[i] = SDLK_UNKNOWN;
/* Alphabet keys */
for (i = 0; i < 26; ++i) {
keymap['a' + i] = SDLK_a + i;
keymap['A' + i] = SDLK_a + i;
}
/* Function keys */
for (i = 0; i < 12; ++i) {
keymap[334 + i] = SDLK_F1 + i;
}
/* Keys that have the same symbols and don't have to be translated */
for (std = std_keys; *std; std++) {
keymap[*std] = *std;
}
keymap[13] = SDLK_RETURN;
keymap[AA_BACKSPACE] = SDLK_BACKSPACE;
keymap[369] = SDLK_LSHIFT;
keymap[370] = SDLK_RSHIFT;
keymap[371] = SDLK_LCTRL;
keymap[372] = SDLK_RCTRL;
keymap[377] = SDLK_LALT;
keymap[270] = SDLK_RALT;
keymap[271] = SDLK_NUMLOCK;
keymap[373] = SDLK_CAPSLOCK;
keymap[164] = SDLK_SCROLLOCK;
keymap[243] = SDLK_INSERT;
keymap[304] = SDLK_DELETE;
keymap[224] = SDLK_HOME;
keymap[231] = SDLK_END;
keymap[229] = SDLK_PAGEUP;
keymap[230] = SDLK_PAGEDOWN;
keymap[241] = SDLK_PRINT;
keymap[163] = SDLK_BREAK;
keymap[302] = SDLK_KP0;
keymap[300] = SDLK_KP1;
keymap[297] = SDLK_KP2;
keymap[299] = SDLK_KP3;
keymap[294] = SDLK_KP4;
keymap[301] = SDLK_KP5;
keymap[296] = SDLK_KP6;
keymap[293] = SDLK_KP7;
keymap[295] = SDLK_KP8;
keymap[298] = SDLK_KP9;
keymap[AA_ESC] = SDLK_ESCAPE;
keymap[AA_UP] = SDLK_UP;
keymap[AA_DOWN] = SDLK_DOWN;
keymap[AA_LEFT] = SDLK_LEFT;
keymap[AA_RIGHT] = SDLK_RIGHT;
}
static SDL_keysym *
TranslateKey(int scancode, SDL_keysym * keysym)
{
/* Sanity check */
if (scancode >= SDL_arraysize(keymap))
scancode = AA_UNKNOWN;
/* Set the keysym information */
keysym->scancode = scancode;
keysym->sym = keymap[scancode];
keysym->mod = KMOD_NONE;
/* If UNICODE is on, get the UNICODE value for the key */
keysym->unicode = 0;
if (SDL_TranslateUNICODE) {
/* Populate the unicode field with the ASCII value */
keysym->unicode = scancode;
}
return (keysym);
}
/* 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_aavideo.h"
/* Variables and functions exported by SDL_sysevents.c to other parts
of the native video subsystem (SDL_sysvideo.c)
*/
extern void AA_initkeymaps(int fd);
extern void AA_mousecallback(int button, int dx, int dy,
int u1, int u2, int u3, int u4);
extern void AA_keyboardcallback(int scancode, int pressed);
extern void AA_InitOSKeymap(_THIS);
extern void AA_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 <stdio.h>
#include "SDL_mouse.h"
#include "../../events/SDL_events_c.h"
#include "SDL_aamouse_c.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor
{
int unused;
};
/* 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_aavideo.h"
/* Functions to be exported */
/* 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_aavideo_h
#define _SDL_aavideo_h
#include "SDL_mouse.h"
#include "SDL_mutex.h"
#include "../SDL_sysvideo.h"
#include <aalib.h>
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this
#define SDL_NUMMODES 6
/* Private display data */
struct SDL_PrivateVideoData
{
SDL_Rect *SDL_modelist[SDL_NUMMODES + 1];
aa_context *context;
aa_palette palette;
aa_renderparams *rparams;
double x_ratio, y_ratio;
int w, h;
SDL_mutex *mutex;
int in_x11;
void *buffer;
};
/* Old variable names */
#define SDL_modelist (this->hidden->SDL_modelist)
#define AA_context (this->hidden->context)
#define AA_palette (this->hidden->palette)
#define AA_rparams (this->hidden->rparams)
#define AA_buffer (this->hidden->buffer)
#define AA_x_ratio (this->hidden->x_ratio)
#define AA_y_ratio (this->hidden->y_ratio)
#define AA_mutex (this->hidden->mutex)
#define AA_in_x11 (this->hidden->in_x11)
#define AA_w (this->hidden->w)
#define AA_h (this->hidden->h)
#endif /* _SDL_aavideo_h */
/* 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