home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l350 / 3.ddi / EXAMPLES / GDEMO / GSERVER.H < prev    next >
Encoding:
Text File  |  1992-12-22  |  9.4 KB  |  321 lines

  1. /* gserver.h - Graphics server header file */
  2.  
  3. /************************************************************************/
  4. /*    Copyright (C) 1986-1993 Phar Lap Software, Inc.            */
  5. /*    Unpublished - rights reserved under the Copyright Laws of the    */
  6. /*    United States.  Use, duplication, or disclosure by the         */
  7. /*    Government is subject to restrictions as set forth in         */
  8. /*    subparagraph (c)(1)(ii) of the Rights in Technical Data and     */
  9. /*    Computer Software clause at 252.227-7013.            */
  10. /*    Phar Lap Software, Inc., 60 Aberdeen Ave., Cambridge, MA 02138    */
  11. /************************************************************************/
  12.  
  13. /*
  14.  
  15. This file contains definitions for the graphics server
  16. example program for 386|DOS-Extender.  It is included both 
  17. by the real and protected mode sides of the server code.
  18. It defines the protocol that the real and protected mode
  19. code use to communicate.  The file contains the following
  20. definitions:
  21.  
  22.     * Command codes
  23.     * Offsets in the graphics commands buffer of arguments
  24.  
  25. */
  26.  
  27. /*
  28.  * Prototypes for functions available to the protected mode program only
  29.  */
  30. int _gbuffmode(int newmode);
  31. void  _fmoveto(short x, short y);
  32.  
  33. /*
  34.  * Size of graphics commands buffer, in bytes
  35.  * We keep two commands buffers, one used by the protected mode code, and
  36.  * one in real mode memory for real mode server.
  37.  */
  38. #define GBUFF_SIZE 4096
  39.  
  40. /*
  41.  * Data types for pointers into the graphics commands buffer.  
  42.  */
  43. typedef char *GBPTR;
  44. typedef short *GBSPTR;
  45. typedef long *GBLPTR;
  46. typedef double *GBDPTR;
  47.  
  48. /* 
  49.  
  50. Command codes
  51.  
  52. */
  53.  
  54. /* For MSC 5.1 */
  55. #define op_arc            1
  56. #define op_clearscreen        2
  57. #define op_displaycursor    3
  58. #define op_ellipse        4
  59. #define op_floodfill        5
  60. #define op_getbkcolor        6
  61. #define op_getcolor        7
  62. #define op_getcurrentposition    8
  63. #define op_getextposition    9
  64. #define op_getfillmask        10
  65. /* #define op_getimage        11 not supported */
  66. #define op_getlinestyle        12
  67. /* #define op_getlogcoord        13 no longer used -- #defined in
  68.                     terms of getviewcoord in graph.h */
  69. #define op_getphyscoord        14
  70. #define op_getpixel        15
  71. #define op_gettextcolor        16
  72. #define op_gettextposition    17
  73. #define op_getvideoconfig    18
  74. #define op_imagesize        19
  75. #define op_lineto        20
  76. #define op_logorg        21
  77. #define op_moveto        22
  78. #define op_outtext        23
  79. #define op_pie            24
  80. /* #define op_putimage        25 not supported */
  81. #define op_rectangle        26
  82. #define op_remapallpalette    27 
  83. #define op_remappalette        28
  84. #define op_selectpalette    29
  85. #define op_setactivepage    30
  86. #define op_setbkcolor        31    
  87. #define op_setcliprgn        32
  88. #define op_setcolor        33
  89. #define op_setfillmask        34
  90. #define op_setlinestyle        35
  91. #define op_setlogorg        36
  92. #define op_setpixel        37
  93. #define op_settextcolor        38
  94. #define op_settextposition    39
  95. #define op_settextwindow    40    
  96. #define op_setvideomode        41
  97. #define op_setviewport        42
  98. #define op_setvisualpage    43
  99. #define op_wrapon        44
  100. #define op_setnullmask        45
  101.  
  102.  
  103. /* For MSC 6.0 */
  104. #define op_arc_w        48
  105. #define op_arc_wxy        49
  106. #define op_ellipse_w        50
  107. #define op_ellipse_wxy        51
  108. #define op_floodfill_w        52
  109. #define op_getactivepage    53
  110. #define op_getarcinfo        54
  111. #define op_getcurrentposition_w    55
  112. #define op_getfontinfo        56
  113. #define op_getgtextextent    57
  114. #define op_getgtextvector    58
  115. /* #define op_getimage_w        59 not supported */
  116. /* #define op_getimage_wxy        60 not supported */
  117. #define op_getpixel_w        61
  118. #define op_gettextcursor    62
  119. #define op_gettextwindow    63
  120. #define op_getviewcoord_w    64
  121. #define op_getviewcoord_wxy    65
  122. #define op_getvisualpage    66
  123. #define op_getwindowcoord    67
  124. #define op_getwritemode        68
  125. #define op_grstatus        69
  126. #define op_imagesize_w        70
  127. #define op_imagesize_wxy    71
  128. #define op_lineto_w        72
  129. #define op_moveto_w        73
  130. #define op_outgtext        74
  131. #define op_outmem        75
  132. #define op_pie_w        76
  133. #define op_pie_wxy        77
  134. /* #define op_polygon        78 not supported */
  135. /* #define op_polygon_w        79 not supported */
  136. /* #define op_polygon_wxy        80 not supported */
  137. /* #define op_putimage_w        81 not supported */
  138. #define op_rectangle_w        82
  139. #define op_rectangle_wxy    83
  140. #define op_registerfonts    84
  141. #define op_scrolltextwindow    85
  142. #define op_setfont        86
  143. #define op_setgtextvector    87
  144. #define op_setpixel_w        88
  145. #define op_settextcursor    89
  146. #define op_settextrows        90
  147. #define op_setvideomoderows    91
  148. #define op_setwindow        93
  149. #define op_setwritemode        94
  150. #define op_unregisterfonts    95
  151.  
  152. #define op_getviewcoord        96
  153.  
  154. /* For MSC 7.0 */
  155. #define op_inchar        97
  156.  
  157.  
  158. /*
  159.  
  160. Defines for offsets of arguments in the graphics commands buffer
  161.  
  162. */
  163.  
  164. #define SHORT0P        ((GBSPTR)(bp + 0))
  165. #define SHORT2P        ((GBSPTR)(bp + 2))
  166. #define SHORT4P        ((GBSPTR)(bp + 4))
  167. #define SHORT6P        ((GBSPTR)(bp + 6))
  168. #define SHORT8P        ((GBSPTR)(bp + 8))
  169. #define SHORT10P    ((GBSPTR)(bp + 10))
  170. #define SHORT12P    ((GBSPTR)(bp + 12))
  171. #define SHORT14P    ((GBSPTR)(bp + 14))
  172. #define SHORT16P    ((GBSPTR)(bp + 16))
  173. #define SHORT18P    ((GBSPTR)(bp + 18))
  174. #define SHORT20P    ((GBSPTR)(bp + 20))
  175. #define SHORT22P    ((GBSPTR)(bp + 22))
  176. #define SHORT24P    ((GBSPTR)(bp + 24))
  177. #define SHORT26P    ((GBSPTR)(bp + 26))
  178. #define SHORT28P    ((GBSPTR)(bp + 28))
  179. #define SHORT30P    ((GBSPTR)(bp + 30))
  180. #define SHORT32P    ((GBSPTR)(bp + 32))
  181. #define SHORT34P    ((GBSPTR)(bp + 34))
  182. #define SHORT36P    ((GBSPTR)(bp + 36))
  183. #define SHORT38P    ((GBSPTR)(bp + 38))
  184. #define SHORT40P    ((GBSPTR)(bp + 40))
  185. #define SHORT42P    ((GBSPTR)(bp + 42))
  186. #define SHORT44P    ((GBSPTR)(bp + 44))
  187. #define SHORT46P    ((GBSPTR)(bp + 46))
  188. #define SHORT48P    ((GBSPTR)(bp + 48))
  189. #define SHORT50P    ((GBSPTR)(bp + 50))
  190. #define SHORT52P    ((GBSPTR)(bp + 52))
  191. #define SHORT54P    ((GBSPTR)(bp + 54))
  192. #define SHORT56P    ((GBSPTR)(bp + 56))
  193. #define SHORT58P    ((GBSPTR)(bp + 58))
  194. #define SHORT60P    ((GBSPTR)(bp + 60))
  195. #define SHORT62P    ((GBSPTR)(bp + 62))
  196. #define SHORT64P    ((GBSPTR)(bp + 64))
  197. #define SHORT66P    ((GBSPTR)(bp + 66))
  198. #define SHORT124P    ((GBSPTR)(bp + 124))
  199.  
  200. #define SHORT0        (*SHORT0P)
  201. #define SHORT2        (*SHORT2P)
  202. #define SHORT4        (*SHORT4P)
  203. #define SHORT6        (*SHORT6P)
  204. #define SHORT8        (*SHORT8P)
  205. #define SHORT10        (*SHORT10P)
  206. #define SHORT12        (*SHORT12P)
  207. #define SHORT14        (*SHORT14P)
  208. #define SHORT16        (*SHORT16P)
  209. #define SHORT18        (*SHORT18P)
  210. #define SHORT20        (*SHORT20P)
  211. #define SHORT22        (*SHORT22P)
  212. #define SHORT24        (*SHORT24P)
  213. #define SHORT26        (*SHORT26P)
  214. #define SHORT28        (*SHORT28P)
  215. #define SHORT30        (*SHORT30P)
  216. #define SHORT32        (*SHORT32P)
  217. #define SHORT34        (*SHORT34P)
  218. #define SHORT36        (*SHORT36P)
  219. #define SHORT38        (*SHORT38P)
  220. #define SHORT40        (*SHORT40P)
  221. #define SHORT42        (*SHORT42P)
  222. #define SHORT44        (*SHORT44P)
  223. #define SHORT46        (*SHORT46P)
  224. #define SHORT48        (*SHORT48P)
  225. #define SHORT50        (*SHORT50P)
  226. #define SHORT52        (*SHORT52P)
  227. #define SHORT54        (*SHORT54P)
  228. #define SHORT56        (*SHORT56P)
  229. #define SHORT58        (*SHORT58P)
  230. #define SHORT60        (*SHORT60P)
  231. #define SHORT62        (*SHORT62P)
  232. #define SHORT64        (*SHORT64P)
  233. #define SHORT66        (*SHORT66P)
  234. #define SHORT124    (*SHORT124P)
  235.  
  236. #define LONG0P        ((GBLPTR)(bp + 0))
  237. #define LONG2P        ((GBLPTR)(bp + 2))
  238. #define LONG4P        ((GBLPTR)(bp + 4))
  239. #define LONG6P        ((GBLPTR)(bp + 6))
  240. #define LONG8P        ((GBLPTR)(bp + 8))
  241. #define LONG10P        ((GBLPTR)(bp + 10))
  242. #define LONG12P        ((GBLPTR)(bp + 12))
  243. #define LONG14P        ((GBLPTR)(bp + 14))
  244. #define LONG16P        ((GBLPTR)(bp + 16))
  245. #define LONG32P        ((GBLPTR)(bp + 32))
  246.  
  247. #define LONG0        (*LONG0P)
  248. #define LONG2        (*LONG2P)
  249. #define LONG4        (*LONG4P)
  250. #define LONG6        (*LONG6P)
  251. #define LONG8        (*LONG8P)
  252. #define LONG10        (*LONG10P)
  253. #define LONG12        (*LONG12P)
  254. #define LONG14        (*LONG14P)
  255. #define LONG16        (*LONG16P)
  256. #define LONG32        (*LONG32P)
  257.  
  258. #define DOUBL0P        ((GBDPTR)(bp + 0))
  259. #define DOUBL2P        ((GBDPTR)(bp + 2))
  260. #define DOUBL4P        ((GBDPTR)(bp + 4))
  261. #define DOUBL6P        ((GBDPTR)(bp + 6))
  262. #define DOUBL8P        ((GBDPTR)(bp + 8))
  263. #define DOUBL10P    ((GBDPTR)(bp + 10))
  264. #define DOUBL12P    ((GBDPTR)(bp + 12))
  265. #define DOUBL14P    ((GBDPTR)(bp + 14))
  266. #define DOUBL16P    ((GBDPTR)(bp + 16))
  267. #define DOUBL18P    ((GBDPTR)(bp + 18))
  268. #define DOUBL20P    ((GBDPTR)(bp + 20))
  269. #define DOUBL22P    ((GBDPTR)(bp + 22))
  270. #define DOUBL24P    ((GBDPTR)(bp + 24))
  271. #define DOUBL26P    ((GBDPTR)(bp + 26))
  272. #define DOUBL28P    ((GBDPTR)(bp + 28))
  273. #define DOUBL30P    ((GBDPTR)(bp + 30))
  274. #define DOUBL32P    ((GBDPTR)(bp + 32))
  275. #define DOUBL34P    ((GBDPTR)(bp + 34))
  276. #define DOUBL36P    ((GBDPTR)(bp + 36))
  277. #define DOUBL38P    ((GBDPTR)(bp + 38))
  278. #define DOUBL40P    ((GBDPTR)(bp + 40))
  279. #define DOUBL42P    ((GBDPTR)(bp + 42))
  280. #define DOUBL44P    ((GBDPTR)(bp + 44))
  281. #define DOUBL46P    ((GBDPTR)(bp + 46))
  282. #define DOUBL48P    ((GBDPTR)(bp + 48))
  283. #define DOUBL50P    ((GBDPTR)(bp + 50))
  284. #define DOUBL52P    ((GBDPTR)(bp + 52))
  285. #define DOUBL54P    ((GBDPTR)(bp + 54))
  286. #define DOUBL56P    ((GBDPTR)(bp + 56))
  287. #define DOUBL58P    ((GBDPTR)(bp + 58))
  288. #define DOUBL60P    ((GBDPTR)(bp + 60))
  289.  
  290. #define DOUBL0        (*DOUBL0P)
  291. #define DOUBL2        (*DOUBL2P)
  292. #define DOUBL4        (*DOUBL4P)
  293. #define DOUBL6        (*DOUBL6P)
  294. #define DOUBL8        (*DOUBL8P)
  295. #define DOUBL10        (*DOUBL10P)
  296. #define DOUBL12        (*DOUBL12P)
  297. #define DOUBL14        (*DOUBL14P)
  298. #define DOUBL16        (*DOUBL16P)
  299. #define DOUBL18        (*DOUBL18P)
  300. #define DOUBL20        (*DOUBL20P)
  301. #define DOUBL22        (*DOUBL22P)
  302. #define DOUBL24        (*DOUBL24P)
  303. #define DOUBL26        (*DOUBL26P)
  304. #define DOUBL28        (*DOUBL28P)
  305. #define DOUBL30        (*DOUBL30P)
  306. #define DOUBL32        (*DOUBL32P)
  307. #define DOUBL34        (*DOUBL34P)
  308. #define DOUBL36        (*DOUBL36P)
  309. #define DOUBL38        (*DOUBL38P)
  310. #define DOUBL40        (*DOUBL40P)
  311. #define DOUBL42        (*DOUBL42P)
  312. #define DOUBL44        (*DOUBL44P)
  313. #define DOUBL46        (*DOUBL46P)
  314. #define DOUBL48        (*DOUBL48P)
  315. #define DOUBL50        (*DOUBL50P)
  316. #define DOUBL52        (*DOUBL52P)
  317. #define DOUBL54        (*DOUBL54P)
  318. #define DOUBL56        (*DOUBL56P)
  319. #define DOUBL58        (*DOUBL58P)
  320. #define DOUBL60        (*DOUBL60P)
  321.