PicoGUI is no longer maintained by the author.
authorSam Lantinga <slouken@libsdl.org>
Wed, 26 Jul 2006 03:55:56 +0000
changeset 19453182150b470f
parent 1944 91f41fc124a7
child 1946 103760c3a5dc
PicoGUI is no longer maintained by the author.
README.PicoGUI
configure.in
include/SDL_config.h.in
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/picogui/SDL_pgevents.c
src/video/picogui/SDL_pgevents_c.h
src/video/picogui/SDL_pgvideo.c
src/video/picogui/SDL_pgvideo.h
     1.1 --- a/README.PicoGUI	Wed Jul 26 03:24:27 2006 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,50 +0,0 @@
     1.4 - ========================
     1.5 -  Using SDL with PicoGUI
     1.6 - ========================
     1.7 -
     1.8 -- Originally contributed by Micah Dowty <micahjd@users.sourceforge.net>
     1.9 -
    1.10 -PicoGUI is a scalable GUI system with a unique architecture, primarily focused
    1.11 -on scalability to various embedded systems. You can find more information
    1.12 -including a FAQ at http://picogui.org
    1.13 -
    1.14 -To use the patch:
    1.15 -
    1.16 -  1. When compiling, add the "--enable-video-picogui" switch to ./configure
    1.17 -
    1.18 -  2. When running your program, ensure that the picogui driver for SDL
    1.19 -     is in use by setting the SDL_VIDEODRIVER environment variable 
    1.20 -     to "picogui".
    1.21 -
    1.22 -  3. The program must also be linked to the C client library for PicoGUI
    1.23 -     (libpgui.so). If the program is being compiled with a patched SDL 
    1.24 -     installed this should be done automatically. If you want to use an
    1.25 -     existing binary with PicoGUI, you can set the LD_PRELOAD environment
    1.26 -     variable to the path of your libpgui.so file.
    1.27 -
    1.28 -Capabilities:
    1.29 -
    1.30 -  So far only basic functionality is provided on true color (linear16/24/32)
    1.31 -  devices. Accessing a memory mapped bitmap, updating the display, and handling
    1.32 -  mouse/keyboard input. This functionality has been tested with several
    1.33 -  applications, including mplayer, Xine, sldroids, and Abuse.
    1.34 -
    1.35 -TODO list:
    1.36 -
    1.37 -  - YUV overlays will be helpful for watching video on set top boxes or other
    1.38 -    embedded devices that have some graphics acceleration hardware
    1.39 -
    1.40 -  - Account for rotated bitmap storage in pgserver
    1.41 -
    1.42 -  - Support for hiding or changing the cursor
    1.43 -
    1.44 -  - The display should be centered when the SDL application is smaller
    1.45 -    than the PicoGUI panel
    1.46 -
    1.47 -  - Fullscreen or any other special modes
    1.48 -
    1.49 -  - Support for indexed and grayscale modes
    1.50 -
    1.51 -  - Probably much more...
    1.52 -
    1.53 ---- The End ---
     2.1 --- a/configure.in	Wed Jul 26 03:24:27 2006 +0000
     2.2 +++ b/configure.in	Wed Jul 26 03:55:56 2006 +0000
     2.3 @@ -1302,31 +1302,6 @@
     2.4      fi
     2.5  }
     2.6  
     2.7 -dnl Set up the PicoGUI video driver if enabled
     2.8 -CheckPicoGUI()
     2.9 -{
    2.10 -    AC_ARG_ENABLE(video-picogui,
    2.11 -AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]),
    2.12 -                  , enable_video_picogui=no)
    2.13 -    if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
    2.14 -        AC_MSG_CHECKING(for PicoGUI support)
    2.15 -        video_picogui=no
    2.16 -        AC_TRY_COMPILE([
    2.17 -         #include <picogui.h>
    2.18 -        ],[
    2.19 -        ],[
    2.20 -        video_picogui=yes
    2.21 -        ])
    2.22 -        AC_MSG_RESULT($video_picogui)
    2.23 -        if test x$video_picogui = xyes; then
    2.24 -            AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
    2.25 -            SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
    2.26 -            SDL_LIBS="$SDL_LIBS -lpgui"
    2.27 -            have_video=yes
    2.28 -        fi
    2.29 -    fi
    2.30 -}
    2.31 -
    2.32  dnl Set up the Atari Bios keyboard driver
    2.33  CheckAtariBiosEvent()
    2.34  {
    2.35 @@ -2063,7 +2038,6 @@
    2.36          CheckVGL
    2.37          CheckWscons
    2.38          CheckQtopia
    2.39 -        CheckPicoGUI
    2.40          CheckOpenGLX11
    2.41          CheckInputEvents
    2.42          CheckTslib
     3.1 --- a/include/SDL_config.h.in	Wed Jul 26 03:24:27 2006 +0000
     3.2 +++ b/include/SDL_config.h.in	Wed Jul 26 03:55:56 2006 +0000
     3.3 @@ -265,7 +265,6 @@
     3.4  #undef SDL_VIDEO_DRIVER_NANOX
     3.5  #undef SDL_VIDEO_DRIVER_OS2FS
     3.6  #undef SDL_VIDEO_DRIVER_PHOTON
     3.7 -#undef SDL_VIDEO_DRIVER_PICOGUI
     3.8  #undef SDL_VIDEO_DRIVER_PS2GS
     3.9  #undef SDL_VIDEO_DRIVER_QTOPIA
    3.10  #undef SDL_VIDEO_DRIVER_RISCOS
     4.1 --- a/src/video/SDL_sysvideo.h	Wed Jul 26 03:24:27 2006 +0000
     4.2 +++ b/src/video/SDL_sysvideo.h	Wed Jul 26 03:55:56 2006 +0000
     4.3 @@ -360,9 +360,6 @@
     4.4  #if SDL_VIDEO_DRIVER_GEM
     4.5  extern VideoBootStrap GEM_bootstrap;
     4.6  #endif
     4.7 -#if SDL_VIDEO_DRIVER_PICOGUI
     4.8 -extern VideoBootStrap PG_bootstrap;
     4.9 -#endif
    4.10  #if SDL_VIDEO_DRIVER_DC
    4.11  extern VideoBootStrap DC_bootstrap;
    4.12  #endif
     5.1 --- a/src/video/SDL_video.c	Wed Jul 26 03:24:27 2006 +0000
     5.2 +++ b/src/video/SDL_video.c	Wed Jul 26 03:55:56 2006 +0000
     5.3 @@ -109,9 +109,6 @@
     5.4  #if SDL_VIDEO_DRIVER_GEM
     5.5      &GEM_bootstrap,
     5.6  #endif
     5.7 -#if SDL_VIDEO_DRIVER_PICOGUI
     5.8 -    &PG_bootstrap,
     5.9 -#endif
    5.10  #if SDL_VIDEO_DRIVER_DC
    5.11      &DC_bootstrap,
    5.12  #endif
     6.1 --- a/src/video/picogui/SDL_pgevents.c	Wed Jul 26 03:24:27 2006 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,129 +0,0 @@
     6.4 -/*
     6.5 -    SDL - Simple DirectMedia Layer
     6.6 -    Copyright (C) 1997-2006 Sam Lantinga
     6.7 -
     6.8 -    This library is free software; you can redistribute it and/or
     6.9 -    modify it under the terms of the GNU Lesser General Public
    6.10 -    License as published by the Free Software Foundation; either
    6.11 -    version 2.1 of the License, or (at your option) any later version.
    6.12 -
    6.13 -    This library is distributed in the hope that it will be useful,
    6.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.16 -    Lesser General Public License for more details.
    6.17 -
    6.18 -    You should have received a copy of the GNU Lesser General Public
    6.19 -    License along with this library; if not, write to the Free Software
    6.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    6.21 -
    6.22 -    Sam Lantinga
    6.23 -    slouken@libsdl.org
    6.24 -
    6.25 -    Micah Dowty
    6.26 -    micahjd@users.sourceforge.net
    6.27 -*/
    6.28 -#include "SDL_config.h"
    6.29 -
    6.30 -#include "SDL.h"
    6.31 -#include "../../events/SDL_sysevents.h"
    6.32 -#include "../../events/SDL_events_c.h"
    6.33 -#include "SDL_pgvideo.h"
    6.34 -#include "SDL_pgevents_c.h"
    6.35 -
    6.36 -int
    6.37 -PG_HandleClose(struct pgEvent *evt)
    6.38 -{
    6.39 -    SDL_PrivateQuit();
    6.40 -    return 1;                   /* Intercept the event's normal quit handling */
    6.41 -}
    6.42 -
    6.43 -int
    6.44 -PG_HandleResize(struct pgEvent *evt)
    6.45 -{
    6.46 -    SDL_PrivateResize(evt->e.size.w, evt->e.size.h);
    6.47 -    return 0;
    6.48 -}
    6.49 -
    6.50 -int
    6.51 -PG_HandleKey(struct pgEvent *evt)
    6.52 -{
    6.53 -    SDL_keysym sym;
    6.54 -    SDL_memset(&sym, 0, sizeof(sym));
    6.55 -    sym.sym = evt->e.kbd.key;
    6.56 -    sym.mod = evt->e.kbd.mods;
    6.57 -    SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
    6.58 -    return 0;
    6.59 -}
    6.60 -
    6.61 -int
    6.62 -PG_HandleChar(struct pgEvent *evt)
    6.63 -{
    6.64 -    SDL_keysym sym;
    6.65 -    SDL_memset(&sym, 0, sizeof(sym));
    6.66 -    sym.unicode = evt->e.kbd.key;
    6.67 -    sym.mod = evt->e.kbd.mods;
    6.68 -    SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
    6.69 -    return 0;
    6.70 -}
    6.71 -
    6.72 -int
    6.73 -PG_HandleMouseButton(struct pgEvent *evt)
    6.74 -{
    6.75 -    /* We need to focus the canvas when it's clicked */
    6.76 -    if (evt->extra) {
    6.77 -        SDL_VideoDevice *this = (SDL_VideoDevice *) evt->extra;
    6.78 -        pgFocus(this->hidden->wCanvas);
    6.79 -    }
    6.80 -    SDL_PrivateMouseButton(evt->type == PG_WE_PNTR_DOWN, evt->e.pntr.chbtn,
    6.81 -                           evt->e.pntr.x, evt->e.pntr.y);
    6.82 -    return 0;
    6.83 -}
    6.84 -
    6.85 -int
    6.86 -PG_HandleMouseMotion(struct pgEvent *evt)
    6.87 -{
    6.88 -    SDL_PrivateMouseMotion(evt->e.pntr.btn, 0, evt->e.pntr.x, evt->e.pntr.y);
    6.89 -    return 0;
    6.90 -}
    6.91 -
    6.92 -void
    6.93 -PG_PumpEvents(_THIS)
    6.94 -{
    6.95 -    /* Process all pending events */
    6.96 -    pgEventPoll();
    6.97 -}
    6.98 -
    6.99 -void
   6.100 -PG_InitOSKeymap(_THIS)
   6.101 -{
   6.102 -    /* We need no keymap */
   6.103 -}
   6.104 -
   6.105 -void
   6.106 -PG_InitEvents(_THIS)
   6.107 -{
   6.108 -    /* Turn on all the mouse and keyboard triggers for our canvas, normally less important
   6.109 -     * events like mouse movement are ignored to save bandwidth. */
   6.110 -    pgSetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK,
   6.111 -                pgGetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK) |
   6.112 -                PG_TRIGGER_UP | PG_TRIGGER_DOWN | PG_TRIGGER_MOVE |
   6.113 -                PG_TRIGGER_KEYUP | PG_TRIGGER_KEYDOWN | PG_TRIGGER_CHAR, 0);
   6.114 -
   6.115 -    /* Start our canvas out focused, so we get keyboard input */
   6.116 -    pgFocus(this->hidden->wCanvas);
   6.117 -
   6.118 -    /* Set up bindings for all the above event handlers */
   6.119 -    pgBind(this->hidden->wApp, PG_WE_CLOSE, &PG_HandleClose, NULL);
   6.120 -    pgBind(this->hidden->wCanvas, PG_WE_BUILD, &PG_HandleResize, NULL);
   6.121 -    pgBind(this->hidden->wCanvas, PG_WE_KBD_CHAR, &PG_HandleChar, NULL);
   6.122 -    pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYUP, &PG_HandleKey, NULL);
   6.123 -    pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYDOWN, &PG_HandleKey, NULL);
   6.124 -    pgBind(this->hidden->wCanvas, PG_WE_PNTR_MOVE, &PG_HandleMouseMotion,
   6.125 -           NULL);
   6.126 -    pgBind(this->hidden->wCanvas, PG_WE_PNTR_UP, &PG_HandleMouseButton, NULL);
   6.127 -    pgBind(this->hidden->wCanvas, PG_WE_PNTR_DOWN, &PG_HandleMouseButton,
   6.128 -           this);
   6.129 -}
   6.130 -
   6.131 -/* end of SDL_pgevents.c ... */
   6.132 -/* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/video/picogui/SDL_pgevents_c.h	Wed Jul 26 03:24:27 2006 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,37 +0,0 @@
     7.4 -/*
     7.5 -    SDL - Simple DirectMedia Layer
     7.6 -    Copyright (C) 1997-2006 Sam Lantinga
     7.7 -
     7.8 -    This library is free software; you can redistribute it and/or
     7.9 -    modify it under the terms of the GNU Lesser General Public
    7.10 -    License as published by the Free Software Foundation; either
    7.11 -    version 2.1 of the License, or (at your option) any later version.
    7.12 -
    7.13 -    This library is distributed in the hope that it will be useful,
    7.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    7.16 -    Lesser General Public License for more details.
    7.17 -
    7.18 -    You should have received a copy of the GNU Lesser General Public
    7.19 -    License along with this library; if not, write to the Free Software
    7.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    7.21 -
    7.22 -    Sam Lantinga
    7.23 -    slouken@libsdl.org
    7.24 -
    7.25 -    Micah Dowty
    7.26 -    micahjd@users.sourceforge.net
    7.27 -*/
    7.28 -#include "SDL_config.h"
    7.29 -
    7.30 -#include "SDL_pgvideo.h"
    7.31 -
    7.32 -/* Variables and functions exported by SDL_sysevents.c to other parts 
    7.33 -   of the native video subsystem (SDL_sysvideo.c)
    7.34 -*/
    7.35 -extern void PG_PumpEvents(_THIS);
    7.36 -extern void PG_InitEvents(_THIS);
    7.37 -extern void PG_InitOSKeymap(_THIS);
    7.38 -
    7.39 -/* end of SDL_pgevents_c.h ... */
    7.40 -/* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/video/picogui/SDL_pgvideo.c	Wed Jul 26 03:24:27 2006 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,386 +0,0 @@
     8.4 -/*
     8.5 -    SDL - Simple DirectMedia Layer
     8.6 -    Copyright (C) 1997-2006 Sam Lantinga
     8.7 -
     8.8 -    This library is free software; you can redistribute it and/or
     8.9 -    modify it under the terms of the GNU Lesser General Public
    8.10 -    License as published by the Free Software Foundation; either
    8.11 -    version 2.1 of the License, or (at your option) any later version.
    8.12 -
    8.13 -    This library is distributed in the hope that it will be useful,
    8.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.16 -    Lesser General Public License for more details.
    8.17 -
    8.18 -    You should have received a copy of the GNU Lesser General Public
    8.19 -    License along with this library; if not, write to the Free Software
    8.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    8.21 -
    8.22 -    Sam Lantinga
    8.23 -    slouken@libsdl.org
    8.24 -
    8.25 -    Micah Dowty
    8.26 -    micahjd@users.sourceforge.net
    8.27 -*/
    8.28 -#include "SDL_config.h"
    8.29 -
    8.30 -#include "SDL_video.h"
    8.31 -#include "SDL_mouse.h"
    8.32 -#include "../SDL_sysvideo.h"
    8.33 -#include "../SDL_pixels_c.h"
    8.34 -#include "../../events/SDL_events_c.h"
    8.35 -
    8.36 -#include "SDL_pgvideo.h"
    8.37 -#include "SDL_pgevents_c.h"
    8.38 -
    8.39 -#define PGVID_DRIVER_NAME "picogui"
    8.40 -
    8.41 -/* Initialization/Query functions */
    8.42 -static int PG_VideoInit(_THIS, SDL_PixelFormat * vformat);
    8.43 -static SDL_Rect **PG_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags);
    8.44 -static SDL_Surface *PG_SetVideoMode(_THIS, SDL_Surface * current, int width,
    8.45 -                                    int height, int bpp, Uint32 flags);
    8.46 -static int PG_SetColors(_THIS, int firstcolor, int ncolors,
    8.47 -                        SDL_Color * colors);
    8.48 -static void PG_VideoQuit(_THIS);
    8.49 -
    8.50 -/* Hardware surface functions */
    8.51 -static int PG_AllocHWSurface(_THIS, SDL_Surface * surface);
    8.52 -static int PG_LockHWSurface(_THIS, SDL_Surface * surface);
    8.53 -static void PG_UnlockHWSurface(_THIS, SDL_Surface * surface);
    8.54 -static void PG_FreeHWSurface(_THIS, SDL_Surface * surface);
    8.55 -
    8.56 -/* etc. */
    8.57 -static void PG_UpdateRects(_THIS, int numrects, SDL_Rect * rects);
    8.58 -
    8.59 -// The implementation dependent data for the window manager cursor
    8.60 -struct WMcursor
    8.61 -{
    8.62 -    /* Our cursor is a PicoGUI theme */
    8.63 -    pghandle theme;
    8.64 -};
    8.65 -
    8.66 -/* WM functions */
    8.67 -void PG_SetCaption(_THIS, const char *title, const char *icon);
    8.68 -WMcursor *PG_CreateWMCursor(_THIS, Uint8 * data, Uint8 * mask,
    8.69 -                            int w, int h, int hot_x, int hot_y);
    8.70 -void PG_FreeWMCursor(_THIS, WMcursor * cursor);
    8.71 -void PG_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
    8.72 -int PG_ShowWMCursor(_THIS, WMcursor * cursor);
    8.73 -
    8.74 -/* PicoGUI driver bootstrap functions */
    8.75 -
    8.76 -static int
    8.77 -PG_Available(void)
    8.78 -{
    8.79 -    /* FIXME: The current client lib doesn't give a way to see if the picogui
    8.80 -     *        server is reachable without causing a fatal error if it isn't.
    8.81 -     *        This should be fixed in cli_c2, but until then assume we can
    8.82 -     *        connect. Since more common drivers like X11 are probed first anyway,
    8.83 -     *        this shouldn't be a huge problem.
    8.84 -     */
    8.85 -    return (1);
    8.86 -}
    8.87 -
    8.88 -static void
    8.89 -PG_DeleteDevice(SDL_VideoDevice * device)
    8.90 -{
    8.91 -    SDL_free(device->hidden);
    8.92 -    SDL_free(device);
    8.93 -}
    8.94 -
    8.95 -static SDL_VideoDevice *
    8.96 -PG_CreateDevice(int devindex)
    8.97 -{
    8.98 -    SDL_VideoDevice *device;
    8.99 -
   8.100 -    /* Initialize all variables that we clean on shutdown */
   8.101 -    device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
   8.102 -    if (device) {
   8.103 -        SDL_memset(device, 0, (sizeof *device));
   8.104 -        device->hidden = (struct SDL_PrivateVideoData *)
   8.105 -            SDL_malloc((sizeof *device->hidden));
   8.106 -    }
   8.107 -    if ((device == NULL) || (device->hidden == NULL)) {
   8.108 -        SDL_OutOfMemory();
   8.109 -        if (device) {
   8.110 -            SDL_free(device);
   8.111 -        }
   8.112 -        return (0);
   8.113 -    }
   8.114 -    SDL_memset(device->hidden, 0, (sizeof *device->hidden));
   8.115 -
   8.116 -    /* Set the function pointers */
   8.117 -    device->VideoInit = PG_VideoInit;
   8.118 -    device->ListModes = PG_ListModes;
   8.119 -    device->SetVideoMode = PG_SetVideoMode;
   8.120 -    device->CreateYUVOverlay = NULL;
   8.121 -    device->SetColors = PG_SetColors;
   8.122 -    device->UpdateRects = PG_UpdateRects;
   8.123 -    device->VideoQuit = PG_VideoQuit;
   8.124 -    device->AllocHWSurface = PG_AllocHWSurface;
   8.125 -    device->CheckHWBlit = NULL;
   8.126 -    device->FillHWRect = NULL;
   8.127 -    device->SetHWColorKey = NULL;
   8.128 -    device->SetHWAlpha = NULL;
   8.129 -    device->LockHWSurface = PG_LockHWSurface;
   8.130 -    device->UnlockHWSurface = PG_UnlockHWSurface;
   8.131 -    device->FlipHWSurface = NULL;
   8.132 -    device->FreeHWSurface = PG_FreeHWSurface;
   8.133 -    device->SetCaption = PG_SetCaption;
   8.134 -    device->SetIcon = NULL;
   8.135 -    device->IconifyWindow = NULL;
   8.136 -    device->GrabInput = NULL;
   8.137 -
   8.138 -    device->PumpEvents = PG_PumpEvents;
   8.139 -    device->InitOSKeymap = PG_InitOSKeymap;
   8.140 -
   8.141 -    device->ShowWMCursor = PG_ShowWMCursor;
   8.142 -    device->CreateWMCursor = PG_CreateWMCursor;
   8.143 -    device->FreeWMCursor = PG_FreeWMCursor;
   8.144 -    device->WarpWMCursor = PG_WarpWMCursor;
   8.145 -
   8.146 -    device->free = PG_DeleteDevice;
   8.147 -
   8.148 -    return device;
   8.149 -}
   8.150 -
   8.151 -VideoBootStrap PG_bootstrap = {
   8.152 -    PGVID_DRIVER_NAME, "PicoGUI SDL driver",
   8.153 -    PG_Available, PG_CreateDevice
   8.154 -};
   8.155 -
   8.156 -
   8.157 -int
   8.158 -PG_VideoInit(_THIS, SDL_PixelFormat * vformat)
   8.159 -{
   8.160 -    /* Connect to the PicoGUI server. No way to process command line args yet,
   8.161 -     * but since this is based on SHM it's not important to be able to specify
   8.162 -     * a remote PicoGUI server.
   8.163 -     *
   8.164 -     * FIXME: Another nitpick about the current client lib is there's no
   8.165 -     *        clean way to indicate that command line args are not available.
   8.166 -     */
   8.167 -    pgInit(0, (char **) "");
   8.168 -    this->hidden->mi = *pgGetVideoMode();
   8.169 -
   8.170 -    /* Create a picogui application and canvas. We'll populate the canvas later. */
   8.171 -    this->hidden->wApp = pgRegisterApp(PG_APP_NORMAL, "SDL", 0);
   8.172 -    this->hidden->wCanvas = pgNewWidget(PG_WIDGET_CANVAS, 0, 0);
   8.173 -    pgSetWidget(PGDEFAULT, PG_WP_SIDE, PG_S_ALL, 0);
   8.174 -
   8.175 -    PG_InitEvents(this);
   8.176 -
   8.177 -    /* Determine the current screen size */
   8.178 -    this->info.current_w = this->hidden->mi.lxres;
   8.179 -    this->info.current_h = this->hidden->mi.lyres;
   8.180 -
   8.181 -    /* Determine the screen depth.
   8.182 -     * We change this during the SDL_SetVideoMode implementation... 
   8.183 -     * Round up to the nearest Bytes per pixel
   8.184 -     */
   8.185 -    vformat->BitsPerPixel = this->hidden->mi.bpp;
   8.186 -    vformat->BytesPerPixel = this->hidden->mi.bpp >> 3;
   8.187 -    if (this->hidden->mi.bpp & 7)
   8.188 -        vformat->BytesPerPixel++;
   8.189 -
   8.190 -    /* We're done! */
   8.191 -    return (0);
   8.192 -}
   8.193 -
   8.194 -SDL_Rect **
   8.195 -PG_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
   8.196 -{
   8.197 -    return (SDL_Rect **) - 1;
   8.198 -}
   8.199 -
   8.200 -SDL_Surface *
   8.201 -PG_SetVideoMode(_THIS, SDL_Surface * current,
   8.202 -                int width, int height, int bpp, Uint32 flags)
   8.203 -{
   8.204 -    if (this->hidden->bitmap) {
   8.205 -        /* Free old bitmap */
   8.206 -        if (current->pixels) {
   8.207 -            shmdt(current->pixels);
   8.208 -            current->pixels = NULL;
   8.209 -        }
   8.210 -        pgDelete(this->hidden->bitmap);
   8.211 -    }
   8.212 -
   8.213 -    /* Allocate the new pixel format for the screen */
   8.214 -    if (!SDL_ReallocFormat(current, bpp, 0, 0, 0, 0)) {
   8.215 -        SDL_SetError("Couldn't allocate new pixel format for requested mode");
   8.216 -        return (NULL);
   8.217 -    }
   8.218 -
   8.219 -    /* Create a new picogui bitmap */
   8.220 -    this->hidden->bitmap = pgCreateBitmap(width, height);
   8.221 -    this->hidden->shm = *pgMakeSHMBitmap(this->hidden->bitmap);
   8.222 -    current->pixels = shmat(shmget(this->hidden->shm.shm_key,
   8.223 -                                   this->hidden->shm.shm_length, 0), NULL, 0);
   8.224 -
   8.225 -    /* Reset the canvas, and draw persistent and incremental grops.
   8.226 -     * Use mapping and offsets to center it.
   8.227 -     */
   8.228 -
   8.229 -    pgWriteCmd(this->hidden->wCanvas, PGCANVAS_NUKE, 0);
   8.230 -
   8.231 -    /* 0. Set the source position during incremental rendering
   8.232 -     */
   8.233 -    pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 5, PG_GROP_SETSRC, 0, 0,
   8.234 -               0, 0);
   8.235 -    pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROPFLAGS, 1,
   8.236 -               PG_GROPF_INCREMENTAL);
   8.237 -
   8.238 -    /* 1. Incremental bitmap rendering
   8.239 -     */
   8.240 -    pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 6, PG_GROP_BITMAP,
   8.241 -               0, 0, 0, 0, this->hidden->bitmap);
   8.242 -    pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROPFLAGS, 1,
   8.243 -               PG_GROPF_INCREMENTAL);
   8.244 -
   8.245 -    /* 2. Normal bitmap rendering
   8.246 -     */
   8.247 -    pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 6, PG_GROP_BITMAP,
   8.248 -               0, 0, this->hidden->shm.width, this->hidden->shm.height,
   8.249 -               this->hidden->bitmap);
   8.250 -
   8.251 -    /* Set up the new mode framebuffer */
   8.252 -    current->flags = 0;
   8.253 -    current->w = this->hidden->shm.width;
   8.254 -    current->h = this->hidden->shm.height;
   8.255 -    current->pitch = this->hidden->shm.pitch;
   8.256 -
   8.257 -    /* Set up pixel format */
   8.258 -    current->format->BitsPerPixel = this->hidden->shm.bpp;
   8.259 -    current->format->BytesPerPixel = this->hidden->shm.bpp >> 3;
   8.260 -    if (this->hidden->shm.bpp & 7)
   8.261 -        current->format->BytesPerPixel++;
   8.262 -    current->format->palette = NULL;
   8.263 -    current->format->Rmask = this->hidden->shm.red_mask;
   8.264 -    current->format->Gmask = this->hidden->shm.green_mask;
   8.265 -    current->format->Bmask = this->hidden->shm.blue_mask;
   8.266 -    current->format->Amask = this->hidden->shm.alpha_mask;
   8.267 -    current->format->Rshift = this->hidden->shm.red_shift;
   8.268 -    current->format->Gshift = this->hidden->shm.green_shift;
   8.269 -    current->format->Bshift = this->hidden->shm.blue_shift;
   8.270 -    current->format->Ashift = this->hidden->shm.alpha_shift;
   8.271 -    current->format->Rloss = 8 - this->hidden->shm.red_length;
   8.272 -    current->format->Gloss = 8 - this->hidden->shm.green_length;
   8.273 -    current->format->Bloss = 8 - this->hidden->shm.blue_length;
   8.274 -    current->format->Aloss = 8 - this->hidden->shm.alpha_length;
   8.275 -
   8.276 -    /* Draw the app */
   8.277 -    pgUpdate();
   8.278 -
   8.279 -    /* We're done */
   8.280 -    return (current);
   8.281 -}
   8.282 -
   8.283 -/* We don't actually allow hardware surfaces other than the main one */
   8.284 -static int
   8.285 -PG_AllocHWSurface(_THIS, SDL_Surface * surface)
   8.286 -{
   8.287 -    return (-1);
   8.288 -}
   8.289 -static void
   8.290 -PG_FreeHWSurface(_THIS, SDL_Surface * surface)
   8.291 -{
   8.292 -    return;
   8.293 -}
   8.294 -
   8.295 -/* We need to wait for vertical retrace on page flipped displays */
   8.296 -static int
   8.297 -PG_LockHWSurface(_THIS, SDL_Surface * surface)
   8.298 -{
   8.299 -    return (0);
   8.300 -}
   8.301 -
   8.302 -static void
   8.303 -PG_UnlockHWSurface(_THIS, SDL_Surface * surface)
   8.304 -{
   8.305 -    return;
   8.306 -}
   8.307 -
   8.308 -static void
   8.309 -PG_UpdateRects(_THIS, int numrects, SDL_Rect * rects)
   8.310 -{
   8.311 -    int i;
   8.312 -
   8.313 -    for (i = 0; i < numrects; i++) {
   8.314 -        if (rects[i].w <= 0 || rects[i].h <= 0)
   8.315 -            continue;
   8.316 -
   8.317 -        /* Schedule an incremental update for this rectangle, using
   8.318 -         * the canvas gropnodes we've loaded beforehand.
   8.319 -         */
   8.320 -        pgWriteCmd(this->hidden->wCanvas, PGCANVAS_FINDGROP, 1, 0);
   8.321 -        pgWriteCmd(this->hidden->wCanvas, PGCANVAS_MOVEGROP, 4,
   8.322 -                   rects[i].x, rects[i].y, rects[i].w, rects[i].h);
   8.323 -        pgWriteCmd(this->hidden->wCanvas, PGCANVAS_FINDGROP, 1, 1);
   8.324 -        pgWriteCmd(this->hidden->wCanvas, PGCANVAS_MOVEGROP, 4,
   8.325 -                   rects[i].x, rects[i].y, rects[i].w, rects[i].h);
   8.326 -
   8.327 -        /* Go perform the update */
   8.328 -        pgWriteCmd(this->hidden->wCanvas, PGCANVAS_INCREMENTAL, 0);
   8.329 -        pgSubUpdate(this->hidden->wCanvas);
   8.330 -    }
   8.331 -}
   8.332 -
   8.333 -int
   8.334 -PG_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color * colors)
   8.335 -{
   8.336 -    /* do nothing of note. */
   8.337 -    return (1);
   8.338 -}
   8.339 -
   8.340 -/* Note:  If we are terminated, this could be called in the middle of
   8.341 -   another SDL video routine -- notably UpdateRects.
   8.342 -*/
   8.343 -void
   8.344 -PG_VideoQuit(_THIS)
   8.345 -{
   8.346 -    if (this->screen->pixels != NULL) {
   8.347 -        shmdt(this->screen->pixels);
   8.348 -        this->screen->pixels = NULL;
   8.349 -        pgDelete(this->hidden->bitmap);
   8.350 -    }
   8.351 -    pgDelete(this->hidden->wCanvas);
   8.352 -    pgDelete(this->hidden->wApp);
   8.353 -}
   8.354 -
   8.355 -void
   8.356 -PG_SetCaption(_THIS, const char *title, const char *icon)
   8.357 -{
   8.358 -    if (title != NULL)
   8.359 -        pgReplaceText(this->hidden->wApp, title);
   8.360 -    pgUpdate();
   8.361 -}
   8.362 -
   8.363 -/* FIXME: The cursor stuff isn't implemented yet! */
   8.364 -
   8.365 -WMcursor *
   8.366 -PG_CreateWMCursor(_THIS, Uint8 * data, Uint8 * mask,
   8.367 -                  int w, int h, int hot_x, int hot_y)
   8.368 -{
   8.369 -    static WMcursor dummy;
   8.370 -    return &dummy;
   8.371 -}
   8.372 -
   8.373 -void
   8.374 -PG_FreeWMCursor(_THIS, WMcursor * cursor)
   8.375 -{
   8.376 -}
   8.377 -
   8.378 -void
   8.379 -PG_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
   8.380 -{
   8.381 -}
   8.382 -
   8.383 -int
   8.384 -PG_ShowWMCursor(_THIS, WMcursor * cursor)
   8.385 -{
   8.386 -    return 1;
   8.387 -}
   8.388 -
   8.389 -/* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/video/picogui/SDL_pgvideo.h	Wed Jul 26 03:24:27 2006 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,52 +0,0 @@
     9.4 -/*
     9.5 -    SDL - Simple DirectMedia Layer
     9.6 -    Copyright (C) 1997-2006 Sam Lantinga
     9.7 -
     9.8 -    This library is free software; you can redistribute it and/or
     9.9 -    modify it under the terms of the GNU Lesser General Public
    9.10 -    License as published by the Free Software Foundation; either
    9.11 -    version 2.1 of the License, or (at your option) any later version.
    9.12 -
    9.13 -    This library is distributed in the hope that it will be useful,
    9.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    9.16 -    Lesser General Public License for more details.
    9.17 -
    9.18 -    You should have received a copy of the GNU Lesser General Public
    9.19 -    License along with this library; if not, write to the Free Software
    9.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    9.21 -
    9.22 -    Sam Lantinga
    9.23 -    slouken@libsdl.org
    9.24 -
    9.25 -    Micah Dowty
    9.26 -    micahjd@users.sourceforge.net
    9.27 -*/
    9.28 -#include "SDL_config.h"
    9.29 -
    9.30 -#ifndef _SDL_pgvideo_h
    9.31 -#define _SDL_pgvideo_h
    9.32 -
    9.33 -#include "SDL_mouse.h"
    9.34 -#include "SDL_mutex.h"
    9.35 -#include "../SDL_sysvideo.h"
    9.36 -
    9.37 -#include <picogui.h>
    9.38 -#include <sys/shm.h>
    9.39 -
    9.40 -/* Hidden "this" pointer for the video functions */
    9.41 -#define _THIS	SDL_VideoDevice *this
    9.42 -
    9.43 -
    9.44 -/* Private display data */
    9.45 -
    9.46 -struct SDL_PrivateVideoData
    9.47 -{
    9.48 -    pghandle wApp, wCanvas;     /* PicoGUI widgets */
    9.49 -    pghandle bitmap;
    9.50 -    struct pgshmbitmap shm;     /* shared memory info */
    9.51 -    struct pgmodeinfo mi;       /* PicoGUI video mode info structure */
    9.52 -};
    9.53 -
    9.54 -#endif /* _SDL_pgvideo_h */
    9.55 -/* vi: set ts=4 sw=4 expandtab: */