home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC6.DMS / in.adf / incl.lha / INCLUDE / clib / graphics_protos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-29  |  13.5 KB  |  305 lines

  1. #ifndef  CLIB_GRAPHICS_PROTOS_H
  2. #define  CLIB_GRAPHICS_PROTOS_H
  3.  
  4. /*
  5. **    $VER: graphics_protos.h 39.31 (29.4.93)
  6. **    Includes Release 40.15
  7. **
  8. **    C prototypes. For use with 32 bit integers only.
  9. **
  10. **    (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. */
  13.  
  14. #ifndef  GRAPHICS_GFX_H
  15. #include <graphics/gfx.h>
  16. #endif
  17. #ifndef  GRAPHICS_DISPLAYINFO_H
  18. #include <graphics/displayinfo.h>
  19. #endif
  20. #ifndef  GRAPHICS_GELS_H
  21. #include <graphics/gels.h>
  22. #endif
  23. #ifndef  GRAPHICS_RASTPORT_H
  24. #include <graphics/rastport.h>
  25. #endif
  26. #ifndef  GRAPHICS_VIEW_H
  27. #include <graphics/view.h>
  28. #endif
  29. #ifndef  GRAPHICS_COPPER_H
  30. #include <graphics/copper.h>
  31. #endif
  32. #ifndef  GRAPHICS_CLIP_H
  33. #include <graphics/clip.h>
  34. #endif
  35. #ifndef  GRAPHICS_REGIONS_H
  36. #include <graphics/regions.h>
  37. #endif
  38. #ifndef  GRAPHICS_SPRITE_H
  39. #include <graphics/sprite.h>
  40. #endif
  41. #ifndef  GRAPHICS_TEXT_H
  42. #include <graphics/text.h>
  43. #endif
  44. #ifndef  HARDWARE_BLIT_H
  45. #include <hardware/blit.h>
  46. #endif
  47.  
  48. #ifdef __cplusplus
  49. #define CLIBCPLUSON
  50. #pragma -
  51. #endif
  52.  
  53. /*------ BitMap primitives ------*/
  54. LONG BltBitMap( struct BitMap *srcBitMap, long xSrc, long ySrc,
  55.     struct BitMap *destBitMap, long xDest, long yDest, long xSize,
  56.     long ySize, unsigned long minterm, unsigned long mask,
  57.     PLANEPTR tempA );
  58. void BltTemplate( PLANEPTR source, long xSrc, long srcMod,
  59.     struct RastPort *destRP, long xDest, long yDest, long xSize,
  60.     long ySize );
  61. /*------ Text routines ------*/
  62. void ClearEOL( struct RastPort *rp );
  63. void ClearScreen( struct RastPort *rp );
  64. WORD TextLength( struct RastPort *rp, STRPTR string, unsigned long count );
  65. LONG Text( struct RastPort *rp, STRPTR string, unsigned long count );
  66. LONG SetFont( struct RastPort *rp, struct TextFont *textFont );
  67. struct TextFont *OpenFont( struct TextAttr *textAttr );
  68. void CloseFont( struct TextFont *textFont );
  69. ULONG AskSoftStyle( struct RastPort *rp );
  70. ULONG SetSoftStyle( struct RastPort *rp, unsigned long style,
  71.     unsigned long enable );
  72. /*------    Gels routines ------*/
  73. void AddBob( struct Bob *bob, struct RastPort *rp );
  74. void AddVSprite( struct VSprite *vSprite, struct RastPort *rp );
  75. void DoCollision( struct RastPort *rp );
  76. void DrawGList( struct RastPort *rp, struct ViewPort *vp );
  77. void InitGels( struct VSprite *head, struct VSprite *tail,
  78.     struct GelsInfo *gelsInfo );
  79. void InitMasks( struct VSprite *vSprite );
  80. void RemIBob( struct Bob *bob, struct RastPort *rp, struct ViewPort *vp );
  81. void RemVSprite( struct VSprite *vSprite );
  82. void SetCollision( unsigned long num,
  83.     void (*routine)(struct VSprite *vSprite, APTR),
  84.     struct GelsInfo *gelsInfo );
  85. void SortGList( struct RastPort *rp );
  86. void AddAnimOb( struct AnimOb *anOb, struct AnimOb **anKey,
  87.     struct RastPort *rp );
  88. void Animate( struct AnimOb **anKey, struct RastPort *rp );
  89. BOOL GetGBuffers( struct AnimOb *anOb, struct RastPort *rp, long flag );
  90. void InitGMasks( struct AnimOb *anOb );
  91. /*------    General graphics routines ------*/
  92. void DrawEllipse( struct RastPort *rp, long xCenter, long yCenter, long a,
  93.     long b );
  94. LONG AreaEllipse( struct RastPort *rp, long xCenter, long yCenter, long a,
  95.     long b );
  96. void LoadRGB4( struct ViewPort *vp, UWORD *colors, long count );
  97. void InitRastPort( struct RastPort *rp );
  98. void InitVPort( struct ViewPort *vp );
  99. ULONG MrgCop( struct View *view );
  100. ULONG MakeVPort( struct View *view, struct ViewPort *vp );
  101. void LoadView( struct View *view );
  102. void WaitBlit( void );
  103. void SetRast( struct RastPort *rp, unsigned long pen );
  104. void Move( struct RastPort *rp, long x, long y );
  105. void Draw( struct RastPort *rp, long x, long y );
  106. LONG AreaMove( struct RastPort *rp, long x, long y );
  107. LONG AreaDraw( struct RastPort *rp, long x, long y );
  108. LONG AreaEnd( struct RastPort *rp );
  109. void WaitTOF( void );
  110. void QBlit( struct bltnode *blit );
  111. void InitArea( struct AreaInfo *areaInfo, APTR vectorBuffer,
  112.     long maxVectors );
  113. void SetRGB4( struct ViewPort *vp, long index, unsigned long red,
  114.     unsigned long green, unsigned long blue );
  115. void QBSBlit( struct bltnode *blit );
  116. void BltClear( PLANEPTR memBlock, unsigned long byteCount,
  117.     unsigned long flags );
  118. void RectFill( struct RastPort *rp, long xMin, long yMin, long xMax,
  119.     long yMax );
  120. void BltPattern( struct RastPort *rp, PLANEPTR mask, long xMin, long yMin,
  121.     long xMax, long yMax, unsigned long maskBPR );
  122. ULONG ReadPixel( struct RastPort *rp, long x, long y );
  123. LONG WritePixel( struct RastPort *rp, long x, long y );
  124. BOOL Flood( struct RastPort *rp, unsigned long mode, long x, long y );
  125. void PolyDraw( struct RastPort *rp, long count, WORD *polyTable );
  126. void SetAPen( struct RastPort *rp, unsigned long pen );
  127. void SetBPen( struct RastPort *rp, unsigned long pen );
  128. void SetDrMd( struct RastPort *rp, unsigned long drawMode );
  129. void InitView( struct View *view );
  130. void CBump( struct UCopList *copList );
  131. void CMove( struct UCopList *copList, APTR destination, long data );
  132. void CWait( struct UCopList *copList, long v, long h );
  133. LONG VBeamPos( void );
  134. void InitBitMap( struct BitMap *bitMap, long depth, long width, long height );
  135. void ScrollRaster( struct RastPort *rp, long dx, long dy, long xMin, long yMin,
  136.     long xMax, long yMax );
  137. void WaitBOVP( struct ViewPort *vp );
  138. WORD GetSprite( struct SimpleSprite *sprite, long num );
  139. void FreeSprite( long num );
  140. void ChangeSprite( struct ViewPort *vp, struct SimpleSprite *sprite,
  141.     PLANEPTR newData );
  142. void MoveSprite( struct ViewPort *vp, struct SimpleSprite *sprite, long x,
  143.     long y );
  144. void LockLayerRom( struct Layer *layer );
  145. void UnlockLayerRom( struct Layer *layer );
  146. void SyncSBitMap( struct Layer *layer );
  147. void CopySBitMap( struct Layer *layer );
  148. void OwnBlitter( void );
  149. void DisownBlitter( void );
  150. struct TmpRas *InitTmpRas( struct TmpRas *tmpRas, PLANEPTR buffer,
  151.     long size );
  152. void AskFont( struct RastPort *rp, struct TextAttr *textAttr );
  153. void AddFont( struct TextFont *textFont );
  154. void RemFont( struct TextFont *textFont );
  155. PLANEPTR AllocRaster( unsigned long width, unsigned long height );
  156. void FreeRaster( PLANEPTR p, unsigned long width, unsigned long height );
  157. void AndRectRegion( struct Region *region, struct Rectangle *rectangle );
  158. BOOL OrRectRegion( struct Region *region, struct Rectangle *rectangle );
  159. struct Region *NewRegion( void );
  160. BOOL ClearRectRegion( struct Region *region, struct Rectangle *rectangle );
  161. void ClearRegion( struct Region *region );
  162. void DisposeRegion( struct Region *region );
  163. void FreeVPortCopLists( struct ViewPort *vp );
  164. void FreeCopList( struct CopList *copList );
  165. void ClipBlit( struct RastPort *srcRP, long xSrc, long ySrc,
  166.     struct RastPort *destRP, long xDest, long yDest, long xSize,
  167.     long ySize, unsigned long minterm );
  168. BOOL XorRectRegion( struct Region *region, struct Rectangle *rectangle );
  169. void FreeCprList( struct cprlist *cprList );
  170. struct ColorMap *GetColorMap( long entries );
  171. void FreeColorMap( struct ColorMap *colorMap );
  172. ULONG GetRGB4( struct ColorMap *colorMap, long entry );
  173. void ScrollVPort( struct ViewPort *vp );
  174. struct CopList *UCopperListInit( struct UCopList *uCopList, long n );
  175. void FreeGBuffers( struct AnimOb *anOb, struct RastPort *rp, long flag );
  176. void BltBitMapRastPort( struct BitMap *srcBitMap, long xSrc, long ySrc,
  177.     struct RastPort *destRP, long xDest, long yDest, long xSize,
  178.     long ySize, unsigned long minterm );
  179. BOOL OrRegionRegion( struct Region *srcRegion, struct Region *destRegion );
  180. BOOL XorRegionRegion( struct Region *srcRegion, struct Region *destRegion );
  181. BOOL AndRegionRegion( struct Region *srcRegion, struct Region *destRegion );
  182. void SetRGB4CM( struct ColorMap *colorMap, long index, unsigned long red,
  183.     unsigned long green, unsigned long blue );
  184. void BltMaskBitMapRastPort( struct BitMap *srcBitMap, long xSrc, long ySrc,
  185.     struct RastPort *destRP, long xDest, long yDest, long xSize,
  186.     long ySize, unsigned long minterm, PLANEPTR bltMask );
  187. BOOL AttemptLockLayerRom( struct Layer *layer );
  188. /*--- functions in V36 or higher (Release 2.0) ---*/
  189. APTR GfxNew( unsigned long gfxNodeType );
  190. void GfxFree( APTR gfxNodePtr );
  191. void GfxAssociate( APTR associateNode, APTR gfxNodePtr );
  192. void BitMapScale( struct BitScaleArgs *bitScaleArgs );
  193. UWORD ScalerDiv( unsigned long factor, unsigned long numerator,
  194.     unsigned long denominator );
  195. WORD TextExtent( struct RastPort *rp, STRPTR string, long count,
  196.     struct TextExtent *textExtent );
  197. ULONG TextFit( struct RastPort *rp, STRPTR string, unsigned long strLen,
  198.     struct TextExtent *textExtent, struct TextExtent *constrainingExtent,
  199.     long strDirection, unsigned long constrainingBitWidth,
  200.     unsigned long constrainingBitHeight );
  201. APTR GfxLookUp( APTR associateNode );
  202. BOOL VideoControl( struct ColorMap *colorMap, struct TagItem *tagarray );
  203. BOOL VideoControlTags( struct ColorMap *colorMap, unsigned long tag1Type,
  204.     ... );
  205. struct MonitorSpec *OpenMonitor( STRPTR monitorName,
  206.     unsigned long displayID );
  207. BOOL CloseMonitor( struct MonitorSpec *monitorSpec );
  208. DisplayInfoHandle FindDisplayInfo( unsigned long displayID );
  209. ULONG NextDisplayInfo( unsigned long displayID );
  210. ULONG GetDisplayInfoData( DisplayInfoHandle handle, UBYTE *buf,
  211.     unsigned long size, unsigned long tagID, unsigned long displayID );
  212. void FontExtent( struct TextFont *font, struct TextExtent *fontExtent );
  213. LONG ReadPixelLine8( struct RastPort *rp, unsigned long xstart,
  214.     unsigned long ystart, unsigned long width, UBYTE *array,
  215.     struct RastPort *tempRP );
  216. LONG WritePixelLine8( struct RastPort *rp, unsigned long xstart,
  217.     unsigned long ystart, unsigned long width, UBYTE *array,
  218.     struct RastPort *tempRP );
  219. LONG ReadPixelArray8( struct RastPort *rp, unsigned long xstart,
  220.     unsigned long ystart, unsigned long xstop, unsigned long ystop,
  221.     UBYTE *array, struct RastPort *temprp );
  222. LONG WritePixelArray8( struct RastPort *rp, unsigned long xstart,
  223.     unsigned long ystart, unsigned long xstop, unsigned long ystop,
  224.     UBYTE *array, struct RastPort *temprp );
  225. LONG GetVPModeID( struct ViewPort *vp );
  226. LONG ModeNotAvailable( unsigned long modeID );
  227. WORD WeighTAMatch( struct TextAttr *reqTextAttr,
  228.     struct TextAttr *targetTextAttr, struct TagItem *targetTags );
  229. WORD WeighTAMatchTags( struct TextAttr *reqTextAttr,
  230.     struct TextAttr *targetTextAttr, unsigned long tag1Type, ... );
  231. void EraseRect( struct RastPort *rp, long xMin, long yMin, long xMax,
  232.     long yMax );
  233. ULONG ExtendFont( struct TextFont *font, struct TagItem *fontTags );
  234. ULONG ExtendFontTags( struct TextFont *font, unsigned long tag1Type, ... );
  235. void StripFont( struct TextFont *font );
  236. /*--- functions in V39 or higher (Release 3) ---*/
  237. UWORD CalcIVG( struct View *v, struct ViewPort *vp );
  238. LONG AttachPalExtra( struct ColorMap *cm, struct ViewPort *vp );
  239. LONG ObtainBestPenA( struct ColorMap *cm, unsigned long r, unsigned long g,
  240.     unsigned long b, struct TagItem *tags );
  241. LONG ObtainBestPen( struct ColorMap *cm, unsigned long r, unsigned long g,
  242.     unsigned long b, unsigned long tag1Type, ... );
  243. void SetRGB32( struct ViewPort *vp, unsigned long n, unsigned long r,
  244.     unsigned long g, unsigned long b );
  245. ULONG GetAPen( struct RastPort *rp );
  246. ULONG GetBPen( struct RastPort *rp );
  247. ULONG GetDrMd( struct RastPort *rp );
  248. ULONG GetOutlinePen( struct RastPort *rp );
  249. void LoadRGB32( struct ViewPort *vp, ULONG *table );
  250. ULONG SetChipRev( unsigned long want );
  251. void SetABPenDrMd( struct RastPort *rp, unsigned long apen, unsigned long bpen,
  252.     unsigned long drawmode );
  253. void GetRGB32( struct ColorMap *cm, unsigned long firstcolor,
  254.     unsigned long ncolors, ULONG *table );
  255. struct BitMap *AllocBitMap( unsigned long sizex, unsigned long sizey,
  256.     unsigned long depth, unsigned long flags,
  257.     struct BitMap *friend_bitmap );
  258. void FreeBitMap( struct BitMap *bm );
  259. LONG GetExtSpriteA( struct ExtSprite *ss, struct TagItem *tags );
  260. LONG GetExtSprite( struct ExtSprite *ss, unsigned long tag1Type, ... );
  261. ULONG CoerceMode( struct ViewPort *vp, unsigned long monitorid,
  262.     unsigned long flags );
  263. void ChangeVPBitMap( struct ViewPort *vp, struct BitMap *bm,
  264.     struct DBufInfo *db );
  265. void ReleasePen( struct ColorMap *cm, unsigned long n );
  266. ULONG ObtainPen( struct ColorMap *cm, unsigned long n, unsigned long r,
  267.     unsigned long g, unsigned long b, long f );
  268. ULONG GetBitMapAttr( struct BitMap *bm, unsigned long attrnum );
  269. struct DBufInfo *AllocDBufInfo( struct ViewPort *vp );
  270. void FreeDBufInfo( struct DBufInfo *dbi );
  271. ULONG SetOutlinePen( struct RastPort *rp, unsigned long pen );
  272. ULONG SetWriteMask( struct RastPort *rp, unsigned long msk );
  273. void SetMaxPen( struct RastPort *rp, unsigned long maxpen );
  274. void SetRGB32CM( struct ColorMap *cm, unsigned long n, unsigned long r,
  275.     unsigned long g, unsigned long b );
  276. void ScrollRasterBF( struct RastPort *rp, long dx, long dy, long xMin,
  277.     long yMin, long xMax, long yMax );
  278. LONG FindColor( struct ColorMap *cm, unsigned long r, unsigned long g,
  279.     unsigned long b, long maxcolor );
  280. struct ExtSprite *AllocSpriteDataA( struct BitMap *bm, struct TagItem *tags );
  281. struct ExtSprite *AllocSpriteData( struct BitMap *bm, unsigned long tag1Type,
  282.     ... );
  283. LONG ChangeExtSpriteA( struct ViewPort *vp, struct ExtSprite *oldsprite,
  284.     struct ExtSprite *newsprite, struct TagItem *tags );
  285. LONG ChangeExtSprite( struct ViewPort *vp, struct ExtSprite *oldsprite,
  286.     struct ExtSprite *newsprite, unsigned long tag1Type, ... );
  287. void FreeSpriteData( struct ExtSprite *sp );
  288. void SetRPAttrsA( struct RastPort *rp, struct TagItem *tags );
  289. void SetRPAttrs( struct RastPort *rp, unsigned long tag1Type, ... );
  290. void GetRPAttrsA( struct RastPort *rp, struct TagItem *tags );
  291. void GetRPAttrs( struct RastPort *rp, unsigned long tag1Type, ... );
  292. ULONG BestModeIDA( struct TagItem *tags );
  293. ULONG BestModeID( unsigned long tag1Type, ... );
  294. /*--- functions in V40 or higher (Release 3.1) ---*/
  295. void WriteChunkyPixels( struct RastPort *rp, unsigned long xstart,
  296.     unsigned long ystart, unsigned long xstop, unsigned long ystop,
  297.     UBYTE *array, long bytesperrow );
  298.  
  299. #ifdef CLIBCPLUSON
  300. #undef CLIBCPLUSON
  301. #pragma +
  302. #endif
  303.  
  304. #endif     /* CLIB_GRAPHICS_PROTOS_H */
  305.