Commit 126d32c5 authored by Sam Lantinga's avatar Sam Lantinga

PicoGUI is no longer maintained by the author.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401991
parent 81cdb586
========================
Using SDL with PicoGUI
========================
- Originally contributed by Micah Dowty <micahjd@users.sourceforge.net>
PicoGUI is a scalable GUI system with a unique architecture, primarily focused
on scalability to various embedded systems. You can find more information
including a FAQ at http://picogui.org
To use the patch:
1. When compiling, add the "--enable-video-picogui" switch to ./configure
2. When running your program, ensure that the picogui driver for SDL
is in use by setting the SDL_VIDEODRIVER environment variable
to "picogui".
3. The program must also be linked to the C client library for PicoGUI
(libpgui.so). If the program is being compiled with a patched SDL
installed this should be done automatically. If you want to use an
existing binary with PicoGUI, you can set the LD_PRELOAD environment
variable to the path of your libpgui.so file.
Capabilities:
So far only basic functionality is provided on true color (linear16/24/32)
devices. Accessing a memory mapped bitmap, updating the display, and handling
mouse/keyboard input. This functionality has been tested with several
applications, including mplayer, Xine, sldroids, and Abuse.
TODO list:
- YUV overlays will be helpful for watching video on set top boxes or other
embedded devices that have some graphics acceleration hardware
- Account for rotated bitmap storage in pgserver
- Support for hiding or changing the cursor
- The display should be centered when the SDL application is smaller
than the PicoGUI panel
- Fullscreen or any other special modes
- Support for indexed and grayscale modes
- Probably much more...
--- The End ---
......@@ -1302,31 +1302,6 @@ AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]
fi
}
dnl Set up the PicoGUI video driver if enabled
CheckPicoGUI()
{
AC_ARG_ENABLE(video-picogui,
AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]),
, enable_video_picogui=no)
if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
AC_MSG_CHECKING(for PicoGUI support)
video_picogui=no
AC_TRY_COMPILE([
#include <picogui.h>
],[
],[
video_picogui=yes
])
AC_MSG_RESULT($video_picogui)
if test x$video_picogui = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
SDL_LIBS="$SDL_LIBS -lpgui"
have_video=yes
fi
fi
}
dnl Set up the Atari Bios keyboard driver
CheckAtariBiosEvent()
{
......@@ -2063,7 +2038,6 @@ case "$host" in
CheckVGL
CheckWscons
CheckQtopia
CheckPicoGUI
CheckOpenGLX11
CheckInputEvents
CheckTslib
......
......@@ -265,7 +265,6 @@
#undef SDL_VIDEO_DRIVER_NANOX
#undef SDL_VIDEO_DRIVER_OS2FS
#undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_PICOGUI
#undef SDL_VIDEO_DRIVER_PS2GS
#undef SDL_VIDEO_DRIVER_QTOPIA
#undef SDL_VIDEO_DRIVER_RISCOS
......
......@@ -360,9 +360,6 @@ extern VideoBootStrap XBIOS_bootstrap;
#if SDL_VIDEO_DRIVER_GEM
extern VideoBootStrap GEM_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_PICOGUI
extern VideoBootStrap PG_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_DC
extern VideoBootStrap DC_bootstrap;
#endif
......
......@@ -109,9 +109,6 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_GEM
&GEM_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_PICOGUI
&PG_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_DC
&DC_bootstrap,
#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
Micah Dowty
micahjd@users.sourceforge.net
*/
#include "SDL_config.h"
#include "SDL.h"
#include "../../events/SDL_sysevents.h"
#include "../../events/SDL_events_c.h"
#include "SDL_pgvideo.h"
#include "SDL_pgevents_c.h"
int
PG_HandleClose(struct pgEvent *evt)
{
SDL_PrivateQuit();
return 1; /* Intercept the event's normal quit handling */
}
int
PG_HandleResize(struct pgEvent *evt)
{
SDL_PrivateResize(evt->e.size.w, evt->e.size.h);
return 0;
}
int
PG_HandleKey(struct pgEvent *evt)
{
SDL_keysym sym;
SDL_memset(&sym, 0, sizeof(sym));
sym.sym = evt->e.kbd.key;
sym.mod = evt->e.kbd.mods;
SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
return 0;
}
int
PG_HandleChar(struct pgEvent *evt)
{
SDL_keysym sym;
SDL_memset(&sym, 0, sizeof(sym));
sym.unicode = evt->e.kbd.key;
sym.mod = evt->e.kbd.mods;
SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
return 0;
}
int
PG_HandleMouseButton(struct pgEvent *evt)
{
/* We need to focus the canvas when it's clicked */
if (evt->extra) {
SDL_VideoDevice *this = (SDL_VideoDevice *) evt->extra;
pgFocus(this->hidden->wCanvas);
}
SDL_PrivateMouseButton(evt->type == PG_WE_PNTR_DOWN, evt->e.pntr.chbtn,
evt->e.pntr.x, evt->e.pntr.y);
return 0;
}
int
PG_HandleMouseMotion(struct pgEvent *evt)
{
SDL_PrivateMouseMotion(evt->e.pntr.btn, 0, evt->e.pntr.x, evt->e.pntr.y);
return 0;
}
void
PG_PumpEvents(_THIS)
{
/* Process all pending events */
pgEventPoll();
}
void
PG_InitOSKeymap(_THIS)
{
/* We need no keymap */
}
void
PG_InitEvents(_THIS)
{
/* Turn on all the mouse and keyboard triggers for our canvas, normally less important
* events like mouse movement are ignored to save bandwidth. */
pgSetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK,
pgGetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK) |
PG_TRIGGER_UP | PG_TRIGGER_DOWN | PG_TRIGGER_MOVE |
PG_TRIGGER_KEYUP | PG_TRIGGER_KEYDOWN | PG_TRIGGER_CHAR, 0);
/* Start our canvas out focused, so we get keyboard input */
pgFocus(this->hidden->wCanvas);
/* Set up bindings for all the above event handlers */
pgBind(this->hidden->wApp, PG_WE_CLOSE, &PG_HandleClose, NULL);
pgBind(this->hidden->wCanvas, PG_WE_BUILD, &PG_HandleResize, NULL);
pgBind(this->hidden->wCanvas, PG_WE_KBD_CHAR, &PG_HandleChar, NULL);
pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYUP, &PG_HandleKey, NULL);
pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYDOWN, &PG_HandleKey, NULL);
pgBind(this->hidden->wCanvas, PG_WE_PNTR_MOVE, &PG_HandleMouseMotion,
NULL);
pgBind(this->hidden->wCanvas, PG_WE_PNTR_UP, &PG_HandleMouseButton, NULL);
pgBind(this->hidden->wCanvas, PG_WE_PNTR_DOWN, &PG_HandleMouseButton,
this);
}
/* end of SDL_pgevents.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
Micah Dowty
micahjd@users.sourceforge.net
*/
#include "SDL_config.h"
#include "SDL_pgvideo.h"
/* Variables and functions exported by SDL_sysevents.c to other parts
of the native video subsystem (SDL_sysvideo.c)
*/
extern void PG_PumpEvents(_THIS);
extern void PG_InitEvents(_THIS);
extern void PG_InitOSKeymap(_THIS);
/* end of SDL_pgevents_c.h ... */
/* 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
Micah Dowty
micahjd@users.sourceforge.net
*/
#include "SDL_config.h"
#ifndef _SDL_pgvideo_h
#define _SDL_pgvideo_h
#include "SDL_mouse.h"
#include "SDL_mutex.h"
#include "../SDL_sysvideo.h"
#include <picogui.h>
#include <sys/shm.h>
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this
/* Private display data */
struct SDL_PrivateVideoData
{
pghandle wApp, wCanvas; /* PicoGUI widgets */
pghandle bitmap;
struct pgshmbitmap shm; /* shared memory info */
struct pgmodeinfo mi; /* PicoGUI video mode info structure */
};
#endif /* _SDL_pgvideo_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