home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / c / intuitionpp / ipp / crastporthdl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-06  |  2.7 KB  |  88 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. ///////////////////////////////////////////////////////////////////////////////
  3. ///////////////////                                        ////////////////////
  4. ///////////////////           file : crastporthdl.h        ////////////////////
  5. ///////////////////                                        ////////////////////
  6. ///////////////////////////////////////////////////////////////////////////////
  7. ///////////////////////////////////////////////////////////////////////////////
  8. //
  9. //    Class CRastPortHdl :
  10. //
  11. //        - RastPort handling.
  12. //
  13. //        - This is just a handler to wich you pass a pointer on a valid
  14. //        RastPort structure. I'll do a real RastPort class with creation
  15. //        and destruction, one day.
  16. //
  17. //        - Pass a pointer to its constructor, or turn it on by passing one
  18. //        with 'hdlon()'.
  19. //
  20. //        - Turn it off when the RastPort is no longer valid with 'hdloff()'
  21. //
  22. //        - Some of the method names has been changed compare to original
  23. //        kernel name, see this file to find the new name.
  24.  
  25.  
  26. #ifndef __CRASTPORTHDL__
  27. #define __CRASTPORTHDL__
  28.  
  29. #include <intuition/intuition.h>
  30. #include <graphics/gfxmacros.h>
  31.  
  32. #include <ipp/cfont.h>
  33.  
  34.  
  35. class CRastPortHdl
  36. {
  37. protected:
  38.     struct RastPort *raster;
  39.     int foreground, background;
  40.     CFont rfont;
  41.  
  42.     void resetfont();
  43.     BOOL hdlon(struct RastPort *validraster);
  44.     void hdloff();
  45. public:
  46.     CRastPortHdl();
  47.     CRastPortHdl(struct RastPort *validraster);
  48.     ~CRastPortHdl();
  49.  
  50.     BOOL hdlison();
  51.  
  52.     void clear();
  53.     void setpenpos(int x, int y);
  54.     void setapen(int color);
  55.     void setbpen(int color);
  56.     void setdrmd(int mode);
  57.     void setdrpt(int pattern);
  58.     void setrast(int color);
  59.     ULONG setwritemask(ULONG mask);
  60.  
  61.     void setfont(STRPTR name, UWORD size, UBYTE style, UBYTE flags);
  62.     void setfont(struct TextAttr *textattr);
  63.     struct TextAttr *askfont(struct TextAttr *textattr);
  64.     void writetext(char *string);
  65.     void writetext(int x, int y, char *string);
  66.     WORD textlength(STRPTR string, WORD stringlength);
  67.     ULONG asksoftstyle();
  68.     ULONG setsoftstyle(ULONG mask, ULONG enable);
  69.     void cleareol();
  70.     void printItext(struct IntuiText *itext, WORD x, WORD y);
  71.  
  72.     void writepixel(int x, int y);
  73.     int readpixel(int x, int y);
  74.     void drawline(int x1, int y1, int x2, int y2);
  75.     void drawlineto(int x, int y);
  76.     void drawrect(int x1, int y1, int x2, int y2);
  77.     void drawrectfill(int x1, int y1, int x2, int y2);
  78.     void drawcircle(int x, int y, int radius);
  79.     void drawellipse(int x, int y, int radiusx, int radiusy);
  80.     void drawimage(struct Image *image, int x, int y);
  81.     void flood(int x, int y);
  82.     void polydraw(WORD count, WORD *array);
  83.  
  84.     void scrollraster(WORD dx, WORD dy, WORD xmin, WORD ymin, WORD xmax, WORD ymax);
  85. };
  86.  
  87. #endif //__CRASTPORTHDL__
  88.