home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 152.lha / LinkUnTmpRas / LinkUnTmpRas.h < prev   
C/C++ Source or Header  |  1988-04-26  |  2KB  |  57 lines

  1. /* LinkUnTmpRas.h  -- allocate, initialize and link a TmpRas structure
  2.  *                    into the given RastPort.  AllocRaster's a
  3.  *                    temporary raster area using the given size.
  4.  *                    Also a function to unlink and free the TmpRas and
  5.  *                    Raster.
  6.  *   Written for Manx 3.4a
  7.  *
  8.  * Copyright  1988, Patrick White.
  9.  *    Anybody can use this code in any commercial or non-commercial program.
  10.  * It may not be sold alone or as part of a code toolbox (without prior
  11.  * arrangments with me).
  12.  */
  13. /* struct  TmpRas  *InitLinkTR( rport, width, height, ret_code );
  14.  * struct  RastPort  *rport;    -- RastPort to attatch TmpRas to
  15.  * LONG width;                  -- max width of screen or window
  16.  * LONG height;                 -- max height of screen or window
  17.  * LONG *ret_code;              -- return code to indicate errors
  18.  *
  19.  * allocate, init, then link into the RastPort, a TmpRas structure and
  20.  * related Raster.
  21.  *
  22.  * return codes from ret_code
  23.  *       0 == all ok.. worked perfectly
  24.  *      -1 == GfxBase not opened
  25.  *      -2 == can't allocate raster
  26.  *      -3 == can't allocate TmpRas structure
  27.  */
  28. /* LONG  UnlinkFreeTR( rport, width, height )
  29.  * struct  RastPort  *rport;    -- RastPort to unlink and free TmpRas from
  30.  * LONG    width;               -- max width of window or screen
  31.  * LONG    height;              -- max height of window or screen
  32.  *
  33.  * unlink and free the TmpRas and raster in a rasterport -- ASSUMES THAT
  34.  * BOTH WERE ALLOCATED BY THE ABOVE FUNCTION.  If this is not the case,
  35.  * expect a visit from the GURU.
  36.  *
  37.  * return codes
  38.  *       0 == everything ok
  39.  *      -1 == GfxBase no longer open -- nothing done
  40.  *      -2 == TmpRas ptr was NULL
  41.  */
  42. /* LONG  FreeTmpRas( tmpras, width, height )
  43.  * struct  TmpRas  *tmpras;     -- ptr to TmpRas struct to free
  44.  * LONG width;                  -- width of raster to free
  45.  * LONG height;                 -- height of raster to free
  46.  *
  47.  * free a TmpRas structure alloacted by InitLinkTR()
  48.  * (does the grunt work for UnlinkFreeTmpRas().. but dosen't unlink it)
  49.  *
  50.  * return codes:
  51.  *    0 == all ok
  52.  *   -2 == NULL tmpras ptr
  53.  */
  54. struct  TmpRas  *InitLinkTR();
  55. LONG            UnlinkFreeTR();
  56. LONG            FreeTmpRas();
  57.