home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Educational / RasMol / Source / graphics.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-18  |  3.6 KB  |  200 lines

  1. /* graphics.h
  2.  * RasMol2 Molecular Graphics
  3.  * Roger Sayle, August 1995
  4.  * Version 2.6
  5.  */
  6.  
  7. #ifdef APPLEMAC      
  8. #define InitialWide  400
  9. #define InitialHigh  400
  10. #endif
  11.  
  12. #ifdef IBMPC
  13. #define InitialWide  480
  14. #define InitialHigh  480
  15. #endif
  16.  
  17. #ifndef InitialWide
  18. #define InitialWide  576
  19. #define InitialHigh  576
  20. #endif
  21.  
  22.  
  23. #ifdef EIGHTBIT
  24. #define LutSize  256
  25. #else
  26. #define LutSize  1024
  27. #endif
  28.  
  29.  
  30. #define RFRotateX  0x0001
  31. #define RFRotateY  0x0002
  32. #define RFRotateZ  0x0004
  33. #define RFZoom     0x0008
  34. #define RFTransX   0x0010
  35. #define RFTransY   0x0020
  36. #define RFTransZ   0x0040
  37. #define RFSlab     0x0080
  38. #define RFReSize   0x0100
  39. #define RFColour   0x0200
  40. #define RFRefresh  0x0400
  41. #define RFPoint1   0x1000
  42. #define RFPoint2   0x2000
  43.  
  44. #define RFTrans    0x0070
  45. #define RFRotate   0x0007
  46. #define RFApply    0x017F
  47. #define RFDials    0x00FF
  48. #define RFMagnify  0x0108
  49. #define RFInitial  0x01FF
  50. #define RFPoint    0x3000
  51.  
  52.  
  53. #define MMRasMol   0x00
  54. #define MMInsight  0x01
  55. #define MMQuanta   0x02
  56.  
  57.  
  58. #define ButMax   8
  59.  
  60.  
  61. #ifdef GRAPHICS
  62. double DialValue[8];
  63. int WinHigh, WinWide;
  64. int PointX, PointY;
  65. int XRange, WRange;
  66. int YRange, HRange;
  67. int UseHourGlass;
  68. int DisableMenu;
  69. int ReDrawFlag;
  70. int MouseMode;
  71. int Range;
  72.  
  73. Pixel __huge *FBuffer;
  74. short __huge *DBuffer;
  75.  
  76. Pixel Lut[LutSize];
  77. Byte RLut[LutSize];
  78. Byte GLut[LutSize];
  79. Byte BLut[LutSize];
  80. Byte ULut[LutSize];
  81.  
  82.  
  83. #ifdef IBMPC
  84. LOGPALETTE __far *Palette;
  85. HPALETTE ColourMap;
  86. HGLOBAL FBufHandle;
  87. HGLOBAL DBufHandle;
  88. HBITMAP PixMap;
  89. HWND CanvWin;
  90. #endif /* IBMPC */
  91.  
  92. #ifdef APPLEMAC
  93. ControlHandle HScroll;
  94. ControlHandle VScroll;
  95. CursHandle CanvCursor;
  96. CursHandle CmndCursor;
  97. CursHandle WaitCursor;
  98. WindowPtr CanvWin;
  99. WindowPtr CmndWin;
  100. THPrint PrintHand;
  101. Handle FBufHandle;
  102. Handle DBufHandle;
  103. #endif /* APPLEMAC */
  104.  
  105. #else /* GRAPHICS */
  106. extern double DialValue[8];
  107. extern int WinHigh, WinWide;
  108. extern int PointX, PointY;
  109. extern int XRange, WRange;
  110. extern int YRange, HRange;
  111. extern int UseHourGlass;
  112. extern int DisableMenu;
  113. extern int ReDrawFlag;
  114. extern int MouseMode;
  115. extern int Range;
  116.  
  117. extern Pixel __huge *FBuffer;
  118. extern short __huge *DBuffer;
  119.  
  120. extern Pixel Lut[LutSize];
  121. extern Byte RLut[LutSize];
  122. extern Byte GLut[LutSize];
  123. extern Byte BLut[LutSize];
  124. extern Byte ULut[LutSize];
  125.  
  126.  
  127. #ifdef IBMPC
  128. extern LOGPALETTE __far *Palette;
  129. extern HPALETTE ColourMap;
  130. extern HGLOBAL FBufHandle;
  131. extern HGLOBAL DBufHandle;
  132. extern HBITMAP PixMap;
  133. extern HWND CanvWin;
  134. #endif /* IBMPC */
  135.  
  136. #ifdef APPLEMAC
  137. extern ControlHandle HScroll;
  138. extern ControlHandle VScroll;
  139. extern CursHandle CanvCursor;
  140. extern CursHandle CmndCursor;
  141. extern CursHandle WaitCursor;
  142. extern WindowPtr CanvWin;
  143. extern WindowPtr CmndWin;
  144. extern THPrint PrintHand;
  145. extern Handle FBufHandle;
  146. extern Handle DBufHandle;
  147. #endif /* APPLEMAC */
  148.  
  149.  
  150. #ifdef FUNCPROTO
  151. int CreateImage();
  152. void TransferImage();
  153. int ClipboardImage();
  154. void ClearImage();
  155. int PrintImage();
  156.  
  157. void AllocateColourMap();
  158. void UpdateScrollBars();
  159. int LookUpColour( char*, int*, int*, int* );
  160. void SetMouseMode( int );
  161. void EnableMenus( int );
  162. void CloseDisplay();
  163. void BeginWait();
  164. void EndWait();
  165.  
  166. #ifdef IBMPC
  167. int OpenDisplay( HANDLE, int );
  168. #else
  169. int OpenDisplay( int, int );
  170. #endif
  171.  
  172. #if !defined(IBMPC) && !defined(APPLEMAC)
  173. int FetchEvent( int );
  174. #endif
  175.  
  176. #else /* non-ANSI C compiler */
  177. int CreateImage();
  178. void TransferImage();
  179. int ClipboardImage();
  180. void ClearImage();
  181. int PrintImage();
  182.  
  183. int OpenDisplay();
  184. void AllocateColourMap();
  185. void UpdateScrollBars();
  186. int LookUpColour();
  187. void SetMouseMode();
  188. void EnableMenus();
  189. void CloseDisplay();
  190. void BeginWait();
  191. void EndWait();
  192.  
  193. #if !defined(IBMPC) && !defined(APPLEMAC)
  194. int FetchEvent();
  195. #endif
  196.  
  197. #endif
  198. #endif /* GRAPHICS */
  199.  
  200.