/* podscreen.h: Library providing unified access to Apple iPod displays Copyright (C) 2005 Matthew Westcott This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Author contact information: E-mail: matthew@west.co.tt Postal address: 14 Daisy Hill Drive, Adlington, Chorley, Lancs, PR6 9NE, United Kingdom */ #ifndef PODSCREEN_H #define PODSCREEN_H /* Datatype representing a pixel value */ typedef unsigned char psPixel; /* upgrade to unsigned short for colour... */ /* Predefined colour names */ typedef enum _psColor { PS_COLOR_BLACK, PS_COLOR_DARKGREY, PS_COLOR_LIGHTGREY, PS_COLOR_WHITE, PS_COLOR_RED, PS_COLOR_GREEN, PS_COLOR_BLUE, PS_COLOR_YELLOW, PS_COLOR_MAGENTA, PS_COLOR_CYAN, } psColor; typedef struct _psScreen { int width; int height; int is_color; /* true if this is a color display */ psPixel **pixels; /* screen - rectangular array of pixel values */ psPixel (*find_color)(unsigned char r, unsigned char g, unsigned char b); /* return the pixel value most closely matching the given RGB color */ psPixel *palette; /* array mapping entries in the psColor list to valid pixel values for this screen */ /* Following fields are for internal use only and are subject to change in future versions */ psPixel **last_screen; /* back buffer */ unsigned long ipod_rtc; unsigned long lcd_base; unsigned long lcd_busy_mask; } psScreen; typedef enum _psIpodFamily { PS_IPOD_FAMILY_ORIGINAL, PS_IPOD_FAMILY_MINI, PS_IPOD_FAMILY_COLOR, PS_IPOD_FAMILY_NANO, PS_IPOD_FAMILY_VIDEO } psIpodFamily; /* Fetch a screen of the desired type to work with; 'desired' is ignored if running on a real iPod */ psScreen *psGetScreen(psIpodFamily desired); /* Send updated pixel data to the screen */ void psUpdate(psScreen *scr); /* Release screen */ void *psReleaseScreen(psScreen *scr); #endif /* #ifndef PODSCREEN_H */