home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / graph2.zip / graph2.h < prev    next >
Text File  |  1996-09-25  |  3KB  |  117 lines

  1. #if !defined (__GRAPH2_HPP__)
  2. #define __GRAPH2_HPP__ 1
  3.  
  4. #if defined (__cplusplus)
  5. extern "C" {
  6. #endif
  7.  
  8. #if defined (__GNUC__)
  9.    #if !defined (_System)
  10.       #if defined (__cplusplus)
  11.          #define _System
  12.       #else
  13.          #define _System __attribute__((system))
  14.       #endif
  15.       #define _System_Defined_
  16.    #endif
  17. #endif
  18.  
  19.  
  20. #pragma pack(1)
  21. typedef struct __Rgb2__ {
  22.    unsigned char b;
  23.    unsigned char g;
  24.    unsigned char r;
  25.    unsigned char options;
  26. } Rgb2;
  27. #pragma pack(4)
  28.  
  29. /* Do not change this constants, because graph2.exe uses hardcoded */
  30. /* sizes */
  31. #define SCREENX      640
  32. #define SCREENY      480
  33. #define COLORS       256
  34.  
  35. #define COLORMASK     0xFF
  36.  
  37. #define GR_NORMAL   0x00
  38. #define GR_OR       0x01
  39. #define GR_XOR      0x02
  40. #define GR_AND      0x03
  41.  
  42. typedef struct __GraphMem__ {
  43.    unsigned long ulSize;
  44.    unsigned char GrMode;
  45.    unsigned char GrColor;
  46.    unsigned GrXPos;
  47.    unsigned GrYPos;
  48.    unsigned long colors;
  49.    Rgb2  Palette[COLORS];
  50.    unsigned char GrBuf[SCREENX*SCREENY];
  51.    volatile unsigned long modify;
  52.    volatile unsigned long palmodify;
  53. } GraphMem;
  54.  
  55. extern GraphMem* __GrPtr;
  56. #if defined (__WATCOMC__)
  57.    #pragma aux __GrPtr "*"       /* Alle anderen Compiler sind ok */
  58. #endif
  59.  
  60. unsigned      _System __GrInit(unsigned clientFg);
  61. /* unsigned clientFg==0 means: start Graph2.exe minimized */
  62. /* else start Graph2.exe in Foreground with focus */
  63.  
  64. unsigned      _System __GrTerm(void);
  65.  
  66. unsigned char _System __GrGetMode(void);
  67. void          _System __GrSetMode(unsigned newMode);
  68. /* newMode is one of the GR_XXX-constants */
  69.  
  70. unsigned char _System __GrGetColor(void);
  71. void          _System __GrSetColor(unsigned char paintColor);
  72.  
  73. void          _System __GrSetScreen(unsigned char color);
  74. void          _System __GrCls(void);
  75.  
  76. void          _System __GrSetPalEntry1(unsigned index, unsigned long packedRgb2);
  77. void          _System __GrSetPalEntry (unsigned index, unsigned char r,
  78.                                        unsigned char g, unsigned char b);
  79.  
  80. void          _System __GrGetPalEntry1(unsigned index, unsigned long* packedRgb2);
  81. void          _System __GrGetPalEntry2(unsigned index, Rgb2* rgb);
  82. void          _System __GrGetPalEntry(unsigned index, unsigned char *r,
  83.                                       unsigned char *g, unsigned char *b);
  84.  
  85. void          _System __GrMoveTo(unsigned x, unsigned y);
  86. unsigned      _System __GrGetX(void);
  87. unsigned      _System __GrGetY(void);
  88.  
  89. void          _System __GrSetPel(unsigned x, unsigned y);
  90. unsigned char _System __GrGetPel(unsigned x, unsigned y);
  91.  
  92. void          _System __GrLineTo(unsigned x, unsigned y);
  93. void          _System __GrLine(unsigned x, unsigned y, unsigned xe, unsigned ye);
  94.  
  95. void          _System __GrCircle(unsigned x, unsigned y, unsigned radius);
  96.  
  97.  
  98. void          _System __GrRectl(unsigned xlu, unsigned ylu,
  99.                                 unsigned xrt, unsigned yrt);
  100. void          _System __GrFillRectl(unsigned xlu, unsigned ylu,
  101.                                     unsigned xrt, unsigned yrt);
  102.  
  103. #if defined (__GNUC__)
  104.    #if defined (IN_GRAPH2)
  105.        #include <fastgraph2.h>
  106.    #endif
  107.    #if defined (_System_Defined_)
  108.       #undef _System_Defined_
  109.       #undef _System
  110.    #endif
  111. #endif
  112.  
  113. #if defined (__cplusplus)
  114. }
  115. #endif
  116. #endif   /* __GRAPH2_HPP__ */
  117.