[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Screensavers for the console

From: M. Gerards
Subject: Re: Screensavers for the console
Date: Sun, 11 May 2003 00:00:30 +0200
User-agent: Internet Messaging Program (IMP) 3.1

I forgot to include the interfaces, here they are:

/*  screensaver.h - interfaces for the screensaver.
    Copyright (C) 2003 Free Software Foundation, Inc.
    Written by Marco Gerards <metgerards@student.han.nl>.
    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
    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.,
    59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.  */

/* Callback functions that should be implemented in the screensaver.  */

/* Initialize the screensaver. Arguments are passed using argv and
   argc, set NEXT to the number of the last parsed argument + 1.  */
error_t ssaver_init (int argv, char **argv, int *next);

/* Deinitialize the screensaver.  */
error_t ssaver_fini (void);

/* Start the screensaver.  */
error_t ssaver_start (void);

/* Stop the screensaver.  */
error_t ssaver_stop (void);

#define DISPLAY_MODE_TEXT       1

/* Kind of states that should be saved/restored with
   display_save_state and display_restore_state.  */
#define DISPLAY_STATE_MODE      1
#define DISPLAY_STATE_FONT      2
#define DISPLAY_STATE_ALL       0xFFFF

/* Structure describing a single graphics mode.  */
struct display_graphics_mode
  /* Type mode, set to DISPLAY_MODE_TEXT or DISPLAY_MODE_GRAPHICS.  */
  int modetype;
  /* The depth (graphics mode only).  */
  int depth;
  /* The amount of colors (text mode only).  */
  int colors;
  /* Horizontal resolution.  */
  int width;
  /* Vertical resolution.  */
  int height;
  /* Blinking of characters is supported (Text mode only).  */
  int blink;
  /* Modex is used (for memory organisation).  */
  int modex;
  /* Reserved for private use for the display driver.  */
  void *info;

typedef struct display_graphics_mode display_graph_mode_t;

/* Callback functions that should be implemented in the display
   driver.  */

/* Return 1 if grapics can be displayed with this driver, return 0 if
   only text is supported.  */
int display_supports_grapics (void);

/* Returns a NULL terminated array of available graphics/text
   modes. A modelist is always returned, even when graphics are not
   available.  */
error_t display_available_modes (display_graphics_mode_t **modelist);

/* Search for graphics modes with the parameters as set in MODE. When
   a search criteria in MODE is set to -1 it will be ignored in the
   search. Returns a NULL terminated array of available graphics modes
   that match the search criteria in MODELIST. A modelist is always
   returned, even when graphics are not available.  */
error_t display_find_mode (display_graphics_mode_t mode, 
                           display_graphics_mode_t **modelist);

/* Switch to graphics mode MODE. The mode should be returned by the
   display driver and may not be generated by the caller. Returns
   EINVAL when MODE is an invalid mode.  */
error_t display_set_mode (display_graphics_mode_t mode);

/* Get the current graphics mode.  */
error_t display_get_current_mode (display_graphics_mode_t *curmode);

/* Save state so it can be restored before the screensaver is
   stopped. A pointer to a state structure is returned, it must be
   stored for the display_restore_mode call. WHICHSTATES teel which
   states should be saved.  */
error_t display_save_mode (void **STATE, int whichstates);

/* Restore the old state stored in STATE. WHICHSTATES tells which
   states should be restored. When destroy is set the
   memory pointed by in STATE is freed and can't be used to restore the
   state.  */
error_t display_restore_mode (void *STATE, int whichstates, int destroy);

/* Get a pointer to the display memory of the current mode. This may
   be video memory or a virtual buffer.  */
void *display_get_mem (void);

/* Update or switch videobuffers so the graphics are shown.  */
void *display_update (void);

/* Set the system font as the active font, instead of the current
   font (Use for displaying text).  */
error_t display_set_systemfont (void);

/* Switch the display on or off. Set ONOFF to 0 to switch it on and 1
   to switch it on. This function should only be implemented if supported
   by hardware.  */
error_t display_onoff (int onoff);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]