home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / desklib / examples / DeskLib / Examples / Widget5 / !Widget5 / h / SpriteWin < prev    next >
Encoding:
Text File  |  1995-05-03  |  3.6 KB  |  121 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  *        File: SpriteWin.h                                             *
  4.  *                                                                      *
  5.  *     Purpose: Store 256 grey level arbitrary sized images in 6 'image *
  6.  *              banks' and display them in a window using a pixel       *
  7.  *              colour translation table to map the grey levels to the  *
  8.  *              screen palette if required.                             *
  9.  *                                                                      *
  10.  ************************************************************************/
  11.  
  12.  /*
  13.   * number of image banks
  14.   */
  15. #define number_IMAGES 6
  16.  
  17.  /*
  18.   * image bank information block
  19.   */
  20. typedef struct {
  21.     window_handle window;
  22.     int                 imageno;          /* for internal use only */
  23.     sprite_area         spritearea;
  24.     int                 header;           /* offset from start of spritearea to header */
  25.     int                 image;            /* offset from start of spritearea to image */
  26.     int                 linebytes;
  27.     wimp_point          size;
  28.     wimp_point          plotcoord;
  29.     sprite_scalefactors scale;            /* used for zoom window */
  30.     sprite_scalefactors screenscale;      /* used on screen */
  31.     char                *pixtranstable;
  32.     char                pixtransbuffer[256];
  33. } spritewin_block;
  34.  
  35.  /*
  36.   * initialisation to be done on startup
  37.   */
  38. extern void SpriteWin_Init(void);
  39.  
  40.  /*
  41.   * returns TRUE if the image is free
  42.   */
  43. extern BOOL SpriteWin_FreeImage(int imageno);
  44.  
  45.  /*
  46.   * returns TRUE if image is same size as 'res'
  47.   */
  48. extern BOOL SpriteWin_SameSize(wimp_point *res, int imageno);
  49.  
  50.  /*
  51.   * returns TRUE if both images are the same size
  52.   */
  53. extern BOOL SpriteWin_Identical(int image1, int image2);
  54.  
  55.  /*
  56.   * refreshes the window of the image bank 'imageno'
  57.   */
  58. extern void SpriteWin_RefreshWin(int imageno);
  59.  
  60.  /*
  61.   * creates blank image at size 'res' in image bank 'imageno' and opens window
  62.   * returns TRUE if image created
  63.   */
  64. extern BOOL SpriteWin_Create(wimp_point *res, int imageno);
  65.  
  66.  /*
  67.   * creates just blank image in 'block' at size 'res'
  68.   */
  69. extern BOOL SpriteWin_CreateImage(spritewin_block *block, wimp_point *res);
  70.     
  71.  /*
  72.   * creates window for image in 'block' and displays it
  73.   */
  74. extern void SpriteWin_CreateWindow(spritewin_block *block);
  75.  
  76.  /*
  77.   * returns the value of the pixel at 'pos'
  78.   */
  79. extern int SpriteWin_GetPixel(wimp_point *pos, int imageno);
  80.  
  81.  /*
  82.   * sets the colour of the pixel at 'pos' to 'pixel'
  83.   */
  84. extern void SpriteWin_PutPixel(wimp_point *pos, int pixel, int imageno);
  85.  
  86.  /*
  87.   * returns the size of the image 'imageno'
  88.   */
  89. extern wimp_point *SpriteWin_GetSize(int imageno);
  90.  
  91.  /*
  92.   * returns a pointer to the spritewin_block for image bank 'imageno'
  93.   */
  94. extern spritewin_block *SpriteWin_GetImageBlock(int imageno);
  95.  
  96.  /*
  97.   * adds the image bank info block 'block' to the list of image banks
  98.   * returns FALSE if bank in use
  99.   */
  100. extern BOOL SpriteWin_AddImageBlock(spritewin_block *block, int imageno);
  101.  
  102.  /*
  103.   * removes the image bank info block 'block' from the list of image banks
  104.   */
  105. extern void SpriteWin_RemoveImageBlock(int imageno);
  106.  
  107.  /*
  108.   * initialises variables in information block
  109.   */
  110. extern void SpriteWin_InitBlock(spritewin_block *block, int imageno);
  111.  
  112.  /*
  113.   * closes savebox and menu for save widget 5 file
  114.   */
  115. extern void SpriteWin_CloseSaveWidget5(void);
  116.  
  117.  /*
  118.   * closes savebox and menu for all other file formats
  119.   */
  120. extern void SpriteWin_CloseSave(void);
  121.