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