home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PGL.ZIP / PGLCS.ZIP / PGL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-20  |  15.6 KB  |  425 lines

  1. /*
  2.  *****************************************************************************
  3.  *****************************************************************************
  4.  ***                                                                       ***
  5.  ***     PGL.H - PGL 'C' Language Include File                             ***
  6.  ***        Turbo C/C++, Microsoft C / Quick C, WATCOM C                      ***
  7.  ***                                                                       ***
  8.  ***        Copyright (C) 1991 AnSOFT, Inc. - All Rights Reservd.             ***
  9.  ***                                                                       ***
  10.  *****************************************************************************
  11.  *****************************************************************************
  12. */
  13. #ifndef PGL_DEF
  14. #define PGL_DEF
  15.  
  16. /* 
  17.  *   Page Orientation 
  18. */
  19. #define pgPORTRAIT      0
  20. #define pgLANDSCAPE     1
  21.  
  22. /*  
  23.  *   Page Size 
  24. */
  25. #define pgHALFPAGE      0
  26. #define pgFULLPAGE      1
  27. #define pgSMALLPAGE     2
  28.           
  29. /* 
  30.  *   Device Type 
  31. */
  32. #define pgDOTMATRIX     0
  33. #define pgLASERJET      1
  34. #define pgPCX           2
  35. #define pgEPS           3
  36.  
  37. /*
  38.  *   Printer ON/OFF definition
  39. */
  40. #define  pgOFF          0
  41. #define  pgON           1
  42.  
  43. /*
  44.  *   Line style definition
  45. */
  46. #define  pgLSOLID       0
  47. #define  pgLHUGEDASH    1
  48. #define  pgLBIGDASH     2
  49. #define  pgLMEDDASH     3
  50. #define  pgLSMALLDASH   4
  51. #define  pgLWIDEDOT     5
  52. #define  pgLCLOSEDOT    6
  53. #define  pgLDASHDOT     7
  54. #define  pgLCENTER      8
  55.  
  56. /*
  57.  *   Fill Style Definition
  58. */
  59. #define  pgFEMPTY       0
  60. #define  pgFSOLID       1
  61. #define  pgFLINE        2
  62. #define  pgFLTSLASH     3
  63. #define  pgFSLASH       4
  64. #define  pgFBKSLASH     5
  65. #define  pgFLTBKSLASH   6
  66. #define  pgFHATCH       7
  67. #define  pgFXHATCH      8
  68. #define  pgFINTERLEAVE  9
  69. #define  pgFWIDEDOT    10
  70. #define  pgFCLOSEDOT   11
  71.  
  72. /*   
  73.  *   Fill Flag  Constants
  74. */
  75. #define pgOUTLINE       1
  76. #define pgFILL          2
  77. #define pgOFILL         3
  78.  
  79. /*
  80. *  Fill Mechanism - Opaque & Transparent
  81. */
  82. #define pgTRANS         0
  83. #define pgOPAQ          1
  84.             
  85. #ifndef PGLTEXT_JUST
  86. enum pgltext_just
  87. {
  88.     pgLEFT      = 0,
  89.     pgCENTER    = 1,
  90.     pgRIGHT  = 2,
  91.     pgBOTTOM = 0,
  92.     pgTOP    = 2
  93. };
  94. #define PGLTEXT_JUST
  95. #endif
  96.  
  97. /*
  98.  *   Font Style Definition
  99. */
  100. #ifndef PGLFONT_NAMES
  101. #define PGLFONT_NAMES
  102. enum font_text
  103. {
  104.   pgSMALL    = 0,
  105.   pgSIMPLEX  = 1,
  106.   pgDUPLEX   = 2,
  107.   pgTRIPLEX  = 3,
  108.   pgGOTHIC   = 4,
  109.   pgSCRIPT   = 5,
  110.   pgSDUPLEX  = 6
  111. };
  112. #endif
  113.  
  114. /*
  115.  *****************************************************************************
  116.  ***   PGL 16 Bit C Interface                                              ***
  117.  *****************************************************************************
  118. */
  119. #ifndef __386__
  120. #ifdef __cplusplus
  121. extern "C" {
  122. #endif
  123.  
  124. #if defined(__WATCOMC__)
  125.   #include <stddef.h>
  126.   #ifndef LANG
  127.       #define LANG far cdecl
  128.   #endif
  129. #else
  130.   #ifndef LANG
  131.       #define LANG far 
  132.   #endif
  133. #endif
  134.  
  135. /*
  136.  *****************************************************************************
  137.  ***   PGL Device Info Commands                                            ***
  138.  *****************************************************************************
  139. */
  140. int   LANG pgGetDevColors   ( int res );
  141. int   LANG pgGetDevHeight   ( void );
  142. int   LANG pgGetDevMaxX     ( int res );
  143. int   LANG pgGetDevMaxY     ( int res );
  144. int   LANG pgGetDevModes    ( void );
  145. int   LANG pgGetDevOffsetX  ( void );
  146. int   LANG pgGetDevOffsetY  ( void );
  147. int   LANG pgGetDevPlanes   ( int res );
  148. int   LANG pgGetDevResX     ( int res );
  149. int   LANG pgGetDevResY     ( int res );
  150. int   LANG pgGetDevType     ( void );  
  151. int   LANG pgGetDevWidth    ( void );
  152.  
  153. short LANG pgLoadDevInfo    ( char far * name );
  154.  
  155. void  LANG pgSetPageMargins ( int left, int top, int right, int bot );
  156. void  LANG pgSetPageForm    ( int form );
  157. void  LANG pgSetPageSize    ( int size );
  158.  
  159. /*
  160.  *****************************************************************************
  161.  ***   PGL System Commands                                                 ***
  162.  *****************************************************************************
  163. */
  164. void  LANG pgClearDrw       ( int far * err );
  165. void  LANG pgEndDrw         ( void );
  166. int   LANG pgGetStatus      ( void );
  167. void  LANG pgInitDrw        ( char far * file, int width, int height,
  168.                               int far * err );
  169. void  LANG pgNewPage        ( void );
  170. void  LANG pgOpenDrw        ( char far * file , int far * err);
  171.  
  172. /*
  173.  *****************************************************************************
  174.  ***   PGL BitMap  Commands                                                ***
  175.  *****************************************************************************
  176. */
  177. void LANG pgBMInit         ( int x, int y,
  178.                              int width, int height, int bpp, int rle );
  179. void LANG pgBMData         ( int row, int far * data );
  180. void LANG pgBMEnd          ( void );
  181.  
  182. /*
  183.  *****************************************************************************
  184.  ***   PGL Drawing Commands                                                ***
  185.  *****************************************************************************
  186. */
  187. void  LANG pgArc            ( int x, int y, int rad, int sa, int ea );
  188. void  LANG pgCircle         ( int x, int y, int rad, int fillflag );
  189. void  LANG pgClearViewPort  ( void );
  190. void  LANG pgEllArc         ( int x, int y, int radx, int rady,
  191.                               int sa, int ea );
  192. void  LANG pgEllipse        ( int x, int y, int radx, int rady,
  193.                               int fillflag );
  194.  
  195. void  LANG pgLine           ( int x1, int y1, int x2, int  y2 );
  196. void  LANG pgLineRel        ( int x, int y );
  197. void  LANG pgLineTo         ( int x, int y );
  198. void  LANG pgMoveTo         ( int x, int y );
  199. void  LANG pgMoveRel        ( int x, int y );
  200. void  LANG pgPie            ( int x, int y, int rad, int sa, int ea,
  201.                               int fillflag );
  202. void  LANG pgPolyLine       ( int far * polydata, int npoints );
  203. void  LANG pgPolygon        ( int far * polydata, int npoints, int fillflag );
  204. void  LANG pgRectangle      ( int x1, int y1, int x2, int y2, int fillflag );
  205. void  LANG pgSector         ( int x, int y, int radx, int rady, int sa, int ea,
  206.                               int fillflag );
  207. void  LANG pgSetPixel       ( int x, int y, int color);
  208.  
  209. /*
  210.  *****************************************************************************
  211.  ***   Commands To Set The Graphics System & Parameters                    ***
  212.  *****************************************************************************
  213. */
  214. void  LANG pgSetColor       ( int color );
  215. void  LANG pgSetPalette     ( int index, int color );
  216. void  LANG pgSetRgbPalette  ( int index, int red, int green, int blue );
  217. void  LANG pgSetDefaults    ( void );
  218. void  LANG pgSetFillMode    ( int mode );
  219. void  LANG pgSetFillStyle   ( int style, int color );
  220. void  LANG pgSetFillPattern ( char far *style, int color );
  221. void  LANG pgSetLineStyle   ( int style, int thick );
  222. void  LANG pgSetLineWeight  ( int weight );
  223. void  LANG pgSetLinePattern ( int pat, int thick );
  224. void  LANG pgSetClipArea    ( int cx1, int cy1, int cx2, int cy2 );
  225. void  LANG pgSetClipping    ( int flag );
  226. void  LANG pgSetPrn         ( int flag );
  227. void  LANG pgSetViewPort    ( int x1, int y1, int x2, int y2 );
  228.  
  229. /*
  230.  *****************************************************************************
  231.  ***   PGL Graphics Text Functions                                         ***
  232.  *****************************************************************************
  233. */
  234. void  LANG pgDrawText       ( char far * str );
  235. void  LANG pgDrawTextXY     ( int x, int y, char far * str );
  236. int   LANG pgGetCharSpacing ( void );
  237. int   LANG pgGetTextBolding ( void );
  238. int   LANG pgGetTextHeight  ( void );
  239. void  LANG pgGetTextJustify ( int far *horiz, int far *vert );
  240. int   LANG pgGetTextLength  ( char far *str );
  241. void  LANG pgGetTextOrient  ( int far *ox, int far *oy );
  242. void  LANG pgGetTextScaling ( int far *multx, int far *divx,
  243.                               int far *multy, int far *divy );
  244. int   LANG pgGetTextStyle   ( void );
  245.  
  246. void  LANG pgSetCharSpacing ( int space );
  247. void  LANG pgSetTextBolding ( int thick );
  248. void  LANG pgSetTextJustify ( int horiz, int vert );
  249. void  LANG pgSetTextOrient  ( int ox, int oy );
  250. void  LANG pgSetTextScaling ( int multx, int divx, int multy, int divy );
  251. void  LANG pgSetTextStyle   ( int fontno );
  252.  
  253. /*
  254.  *****************************************************************************
  255.  ***   Commands To Get The Graphics System Parameters                      ***
  256.  *****************************************************************************
  257. */
  258. int   LANG pgGetAbsX        ( void );
  259. int   LANG pgGetAbsY        ( void );
  260. void  LANG pgGetClipArea    ( int far *cx1, int far *cy1,
  261.                               int far *cx2, int far *cy2 );
  262. int   LANG pgGetClipping    ( void );
  263. int   LANG pgGetColor       ( void );
  264. int   LANG pgGetFillMode    ( void );
  265. void  LANG pgGetFillPattern ( char far *style, int far *color );
  266. void  LANG pgGetFillStyle   ( int far *style, int far *color );
  267. void  LANG pgGetLinePattern ( int far *pat, int far *thick );
  268. void  LANG pgGetLineStyle   ( int far *style, int far *thick );
  269. int   LANG pgGetLineWeight  ( void );
  270. int   LANG pgGetMaxX        ( void );
  271. int   LANG pgGetMaxY        ( void );
  272. int   LANG pgGetPrn         ( void );
  273. void  LANG pgGetViewPort    ( int far *x1, int far *y1,
  274.                               int far *x2, int far *y2 );
  275. int   LANG pgGetX           ( void );
  276. int   LANG pgGetY           ( void );
  277.  
  278. #ifdef __cplusplus
  279. }
  280. #endif
  281. #else
  282. /*
  283. *****************************************************************************
  284. ***   PGL 32 Bit C Interface                                              ***
  285. *****************************************************************************
  286. */
  287. /*
  288. #ifdef __cplusplus
  289. extern "C" {
  290. #endif
  291. */
  292. #include <stddef.h>
  293. #define LANG
  294.  
  295. int   LANG pgLoadDevInfo    ( char * name );
  296.  
  297. void  LANG pgSetPageMargins ( int left, int top, int right, int bot );
  298. void  LANG pgSetPageForm    ( int form );
  299. void  LANG pgSetPageSize    ( int size );
  300.  
  301. int   LANG pgGetDevModes    ( void );
  302. int   LANG pgGetDevType     ( void );  
  303. int   LANG pgGetDevHeight   ( void );
  304. int   LANG pgGetDevWidth    ( void );
  305. int   LANG pgGetDevOffsetX  ( void );
  306. int   LANG pgGetDevOffsetY  ( void );
  307.  
  308. int   LANG pgGetDevColors   ( int res );
  309. int   LANG pgGetDevMaxX     ( int res );
  310. int   LANG pgGetDevMaxY     ( int res );
  311. int   LANG pgGetDevResX     ( int res );
  312. int   LANG pgGetDevResY     ( int res );
  313. int   LANG pgGetDevPlanes   ( int res );
  314.  
  315. /****************************************************************************
  316. *   PGL Bitmap functions
  317. *****************************************************************************
  318. */
  319. void LANG pgBMInit ( int x, int y, int width, int height, int bpp, int rle );
  320. void LANG pgBMData ( int row, int * data );
  321. void LANG pgBMEnd  ( void );
  322.  
  323. /****************************************************************************
  324. *   PGL System functions
  325. *****************************************************************************
  326. */
  327. void LANG pgInitDrw    ( char  *file, int width, int height, int * err );
  328. void LANG pgOpenDrw    ( char  *file , int * err);
  329. void LANG pgClearDrw   ( int  * err );
  330. void LANG pgEndDrw     ( void );
  331. void LANG pgNewPage    ( void );
  332. int LANG pgGetStatus   ( void );
  333.  
  334. /****************************************************************************
  335. *   PGL Drawing Commands
  336. *****************************************************************************
  337. */
  338. void LANG pgMoveTo        ( int x, int y );
  339. void LANG pgMoveRel       ( int x, int y );
  340. void LANG pgLineTo        ( int x, int y );
  341. void LANG pgLineRel       ( int x, int y );
  342. void LANG pgLine          ( int x1, int y1, int x2, int  y2 );
  343. void LANG pgSetPixel      ( int x, int y, int color);
  344. void LANG pgArc           ( int x, int y, int rad, int sa, int ea );
  345. void LANG pgEllArc        ( int x, int y, int radx, int rady, int sa, int ea );
  346. void LANG pgPie           ( int x, int y, int rad, int sa, int ea, int fillflag );
  347. void LANG pgSector        ( int x, int y, int radx, int rady, int sa, int ea, int fillflag );
  348. void LANG pgRectangle     ( int x1, int y1, int x2, int y2, int fillflag );
  349. void LANG pgCircle        ( int x, int y, int rad, int fillflag );
  350. void LANG pgEllipse       ( int x, int y, int radx, int rady, int fillflag );
  351. void LANG pgPolygon       ( int  *polydata, int numpoints, int fillflag );
  352. void LANG pgPolyLine      ( int  *polydata, int numpoints );
  353. void LANG pgDrawText      ( char  *str );
  354. void LANG pgDrawTextXY    ( int x, int y, char *str );
  355. void LANG pgClearViewPort ( void );
  356. void LANG pgBMInit        ( int x, int y, int width, int height, int bpp, int rle);
  357. void LANG pgBMData        ( int row, int * data );
  358. void LANG pgBMEnd         ( void );
  359.  
  360.  
  361. /****************************************************************************
  362. *     Commands To Set The Graphics System & Parameters
  363. *****************************************************************************
  364. */
  365. void LANG pgSetColor       ( int color );
  366. void LANG pgSetPalette     ( int index, int color );
  367. void LANG pgSetRgbPalette  ( int index, int red, int green, int blue );
  368. void LANG pgSetDefaults    ( void );
  369. void LANG pgSetFillMode    ( int mode );
  370. void LANG pgSetFillStyle   ( int style, int color );
  371. void LANG pgSetFillPattern ( char *style, int color );
  372. void LANG pgSetLineStyle   ( int style, int thick );
  373. void LANG pgSetLineWeight  ( int weight );
  374. void LANG pgSetLinePattern ( int pat, int thick );
  375. void LANG pgSetTextBolding ( int thick );
  376. void LANG pgSetCharSpacing ( int space );
  377. void LANG pgSetTextScaling ( int multx, int divx, int multy, int divy );
  378. void LANG pgSetTextSize    ( int size );
  379. void LANG pgSetTextJustify ( int horiz, int vert );
  380. void LANG pgSetTextItalics ( int ital );
  381. void LANG pgSetTextOrient  ( int ox, int oy );
  382. void LANG pgSetTextStyle   ( int fontno );
  383. void LANG pgSetClipArea    ( int cx1, int cy1, int cx2, int cy2 );
  384. void LANG pgSetClipping    ( int flag );
  385. void LANG pgSetPrn         ( int flag );
  386. void LANG pgSetViewPort    ( int x1, int y1, int x2, int y2 );
  387.  
  388. /****************************************************************************
  389. *     Commands To Get The Graphics System Parameters
  390. *****************************************************************************
  391. */
  392. int   LANG pgGetColor       ( void );
  393. int   LANG pgGetFillMode    ( void );
  394. void  LANG pgGetFillStyle   ( int  *style, int  *color );
  395. void  LANG pgGetFillPattern ( char *style, int  *color );
  396. void  LANG pgGetLineStyle   ( int  *style, int  *thick );
  397. int   LANG pgGetLineWeight  ( void );
  398. void  LANG pgGetLinePattern ( int  *pat, int  *thick );
  399. int   LANG pgGetMaxX        ( void );
  400. int   LANG pgGetMaxY        ( void );
  401. int   LANG pgGetTextBolding ( void );
  402. int   LANG pgGetCharSpacing ( void );
  403. void  LANG pgGetTextScaling ( int  *multx, int  *divx, int  *multy, int  *divy );
  404. void  LANG pgGetTextJustify ( int  *horiz, int  *vert );
  405. int   LANG pgGetTextItalics ( void );
  406. void  LANG pgGetTextOrient  ( int  *ox, int  *oy );
  407. int   LANG pgGetTextStyle   ( void );
  408. void  LANG pgGetClipArea    ( int  *cx1, int  *cy1, int *cx2, int *cy2 );
  409. int   LANG pgGetClipping    ( void );
  410. int   LANG pgGetPrn         ( void );
  411. int   LANG pgGetTextHeight  ( void );
  412. int   LANG pgGetTextLength  ( char  * str );
  413. int   LANG pgGetX           ( void );
  414. int   LANG pgGetY           ( void );
  415. int   LANG pgGetAbsX        ( void );
  416. int   LANG pgGetAbsY        ( void );
  417. void  LANG pgGetViewPort    ( int  *x1, int  *y1, int  *x2, int  *y2 );
  418. /*
  419. #ifdef __cplusplus
  420. }
  421. #endif
  422. */
  423. #endif
  424. #endif
  425.