home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / vibrant / ncbidraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-05  |  10.1 KB  |  268 lines  |  [TEXT/R*ch]

  1. /*   ncbidraw.h
  2. * ===========================================================================
  3. *
  4. *                            PUBLIC DOMAIN NOTICE
  5. *            National Center for Biotechnology Information (NCBI)
  6. *
  7. *  This software/database is a "United States Government Work" under the
  8. *  terms of the United States Copyright Act.  It was written as part of
  9. *  the author's official duties as a United States Government employee and
  10. *  thus cannot be copyrighted.  This software/database is freely available
  11. *  to the public for use. The National Library of Medicine and the U.S.
  12. *  Government do not place any restriction on its use or reproduction.
  13. *  We would, however, appreciate having the NCBI and the author cited in
  14. *  any work or product based on this material
  15. *
  16. *  Although all reasonable efforts have been taken to ensure the accuracy
  17. *  and reliability of the software and data, the NLM and the U.S.
  18. *  Government do not and cannot warrant the performance or results that
  19. *  may be obtained by using this software or data. The NLM and the U.S.
  20. *  Government disclaim all warranties, express or implied, including
  21. *  warranties of performance, merchantability or fitness for any particular
  22. *  purpose.
  23. *
  24. * ===========================================================================
  25. *
  26. * File Name:  ncbidraw.h
  27. *
  28. * Author:  Jonathan Kans
  29. *
  30. * Version Creation Date:   1/1/91
  31. *
  32. * $Revision: 2.4 $
  33. *
  34. * File Description: 
  35. *       Vibrant drawing procedure definitions
  36. *
  37. * Modifications:  
  38. * --------------------------------------------------------------------------
  39. * Date     Name        Description of modification
  40. * -------  ----------  -----------------------------------------------------
  41. *
  42. *
  43. * ==========================================================================
  44. */
  45.  
  46. #ifndef _NCBIDRAW_
  47. #define _NCBIDRAW_
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. /***  PORTABLE GRAPHIC PRIMITIVE OBJECT TYPES  ***/
  54.  
  55. /*
  56. *  Platform independent point and rectangle data structures.
  57. */
  58.  
  59. #ifdef DCLAP
  60. #define Nlm_IntD  Nlm_Int4
  61. #else
  62. #define Nlm_IntD  Nlm_Int2
  63. #endif
  64.  
  65. typedef  struct  Nlm_point {
  66.   Nlm_IntD  x;
  67.   Nlm_IntD  y;
  68. } Nlm_PoinT, PNTR Nlm_PointPtr;
  69.  
  70. typedef  struct  Nlm_rect {
  71.   Nlm_IntD  left;
  72.   Nlm_IntD  top;
  73.   Nlm_IntD  right;
  74.   Nlm_IntD  bottom;
  75. } Nlm_RecT, PNTR Nlm_RectPtr;
  76.  
  77. typedef  Nlm_Handle  Nlm_RegioN;
  78.  
  79. typedef  struct  Nlm_font {
  80.   Nlm_VoidPtr  dummy;
  81. } HNDL Nlm_FonT;
  82.  
  83. /***  GLOBAL VARIABLES  ***/
  84.  
  85. /*
  86. *  The update region contains the update region on drawing requests,
  87. *  and contains at least the visible region during other callbacks.
  88. *  Clipping is set to the update region on drawing events.  The
  89. *  update rectangle has the minimum rectangular boundary of the
  90. *  update region.  These variables are kept up to date by the Vibrant
  91. *  event loop.
  92. */
  93.  
  94. extern  Nlm_RegioN  Nlm_updateRgn;
  95. extern  Nlm_RecT    Nlm_updateRect;
  96.  
  97. /*
  98. *  The standard systemFont and programFont variables are used to
  99. *  specify fonts for dialog objects and scrolling text objects.
  100. */
  101.  
  102. extern  Nlm_FonT  Nlm_systemFont;
  103. extern  Nlm_FonT  Nlm_programFont;
  104.  
  105. /*
  106. *  Miscellaneous constants for pixel sizes of the standard font.
  107. */
  108.  
  109. extern  Nlm_Int2  Nlm_stdAscent;
  110. extern  Nlm_Int2  Nlm_stdDescent;
  111. extern  Nlm_Int2  Nlm_stdLeading;
  112. extern  Nlm_Int2  Nlm_stdFontHeight;
  113. extern  Nlm_Int2  Nlm_stdLineHeight;
  114. extern  Nlm_Int2  Nlm_stdCharWidth;
  115.  
  116. /***  DRAWING PROCEDURES  ***/
  117.  
  118. void         Nlm_SetUpDrawingTools PROTO((void));
  119. void         Nlm_CleanUpDrawingTools PROTO((void));
  120.  
  121. /*
  122. *  It is not necessary to create a new font when switching colors.  The
  123. *  family for GetFont can be Roman, Swiss, Modern, Script, or Decorative.
  124. */
  125.  
  126. /*
  127. *  ScrollRect will erase and invalidate all invalid regions.
  128. */
  129.  
  130. void         Nlm_ResetDrawingTools PROTO((void));
  131.  
  132. void         Nlm_CopyMode PROTO((void));
  133. void         Nlm_MergeMode PROTO((void));
  134. void         Nlm_InvertMode PROTO((void));
  135. void         Nlm_EraseMode PROTO((void));
  136.  
  137. void         Nlm_Black PROTO((void));
  138. void         Nlm_Red PROTO((void));
  139. void         Nlm_Green PROTO((void));
  140. void         Nlm_Blue PROTO((void));
  141. void         Nlm_Cyan PROTO((void));
  142. void         Nlm_Magenta PROTO((void));
  143. void         Nlm_Yellow PROTO((void));
  144. void         Nlm_White PROTO((void));
  145. void         Nlm_Gray PROTO((void));
  146. void         Nlm_LtGray PROTO((void));
  147. void         Nlm_DkGray PROTO((void));
  148. void         Nlm_SelectColor PROTO((Nlm_Uint1 red, Nlm_Uint1 green, Nlm_Uint1 blue));
  149. Nlm_Uint4    Nlm_GetColor PROTO((void));
  150. void         Nlm_SetColor PROTO((Nlm_Uint4 color));
  151. void         Nlm_InvertColors PROTO((void));
  152.  
  153. void         Nlm_Solid PROTO((void));
  154. void         Nlm_Dark PROTO((void));
  155. void         Nlm_Medium PROTO((void));
  156. void         Nlm_Light PROTO((void));
  157. void         Nlm_Empty PROTO((void));
  158. void         Nlm_Dotted PROTO((void));
  159. void         Nlm_Dashed PROTO((void));
  160. void         Nlm_WidePen PROTO((Nlm_Int2 width));
  161.  
  162. Nlm_FonT     Nlm_GetFont PROTO((Nlm_CharPtr name, Nlm_Int2 size, Nlm_Boolean bld, Nlm_Boolean itlc, Nlm_Boolean undrln, Nlm_CharPtr fmly));
  163. Nlm_FonT     Nlm_ParseFont PROTO((Nlm_CharPtr spec));
  164. void         Nlm_SelectFont PROTO((Nlm_FonT f));
  165. void         Nlm_AssignPrinterFont PROTO((Nlm_FonT scrnFont, Nlm_FonT prtrFont));
  166.  
  167. Nlm_Int2     Nlm_CharWidth PROTO((Nlm_Char ch));
  168. Nlm_Int2     Nlm_StringWidth PROTO((Nlm_CharPtr text));
  169. Nlm_Int2     Nlm_TextWidth PROTO((Nlm_CharPtr text, Nlm_sizeT len));
  170. Nlm_Int2     Nlm_Ascent PROTO((void));
  171. Nlm_Int2     Nlm_Descent PROTO((void));
  172. Nlm_Int2     Nlm_Leading PROTO((void));
  173. Nlm_Int2     Nlm_FontHeight PROTO((void));
  174. Nlm_Int2     Nlm_LineHeight PROTO((void));
  175. Nlm_Int2     Nlm_MaxCharWidth PROTO((void));
  176.  
  177. void         Nlm_SetPen PROTO((Nlm_PoinT pt));
  178. void         Nlm_GetPen PROTO((Nlm_PointPtr pt));
  179.  
  180. void         Nlm_PaintChar PROTO((Nlm_Char ch));
  181. void         Nlm_PaintString PROTO((Nlm_CharPtr text));
  182. void CDECL   Nlm_PaintText VPROTO((char *format, ...));
  183.  
  184. void         Nlm_DrawString PROTO((Nlm_RectPtr r, Nlm_CharPtr text, Nlm_Char jst, Nlm_Boolean gray));
  185. void         Nlm_DrawText PROTO((Nlm_RectPtr r, Nlm_CharPtr text, Nlm_sizeT len, Nlm_Char jst, Nlm_Boolean gray));
  186.  
  187. void         Nlm_MoveTo PROTO((Nlm_IntD x, Nlm_IntD y));
  188. void         Nlm_LineTo PROTO((Nlm_IntD x, Nlm_IntD y));
  189. void         Nlm_DrawLine PROTO((Nlm_PoinT pt1, Nlm_PoinT pt2));
  190.  
  191. void         Nlm_LoadPt PROTO((Nlm_PointPtr pt, Nlm_IntD x, Nlm_IntD y));
  192. void         Nlm_AddPt PROTO((Nlm_PoinT src, Nlm_PointPtr dst));
  193. void         Nlm_SubPt PROTO((Nlm_PoinT src, Nlm_PointPtr dst));
  194. Nlm_Boolean  Nlm_EqualPt PROTO((Nlm_PoinT p1, Nlm_PoinT p2));
  195. Nlm_Boolean  Nlm_PtInRect PROTO((Nlm_PoinT pt, Nlm_RectPtr r));
  196. Nlm_Boolean  Nlm_PtInRgn PROTO((Nlm_PoinT pt, Nlm_RegioN rgn));
  197.  
  198. void         Nlm_LoadRect PROTO((Nlm_RectPtr r, Nlm_IntD lf, Nlm_IntD tp, Nlm_IntD rt, Nlm_IntD bt));
  199. void         Nlm_UpsetRect PROTO((Nlm_RectPtr r, Nlm_IntD lf, Nlm_IntD tp, Nlm_IntD rt, Nlm_IntD bt));
  200. void         Nlm_OffsetRect PROTO((Nlm_RectPtr r, Nlm_IntD dx, Nlm_IntD dy));
  201. void         Nlm_InsetRect PROTO((Nlm_RectPtr r, Nlm_IntD dx, Nlm_IntD dy));
  202. Nlm_Boolean  Nlm_SectRect PROTO((Nlm_RectPtr src1, Nlm_RectPtr src2, Nlm_RectPtr dst));
  203. Nlm_Boolean  Nlm_UnionRect PROTO((Nlm_RectPtr src1, Nlm_RectPtr src2, Nlm_RectPtr dst));
  204. Nlm_Boolean  Nlm_EqualRect PROTO((Nlm_RectPtr r1, Nlm_RectPtr r2));
  205. Nlm_Boolean  Nlm_EmptyRect PROTO((Nlm_RectPtr r));
  206. Nlm_Boolean  Nlm_RectInRect PROTO((Nlm_RectPtr r1, Nlm_RectPtr r2));
  207. Nlm_Boolean  Nlm_RectInRgn PROTO((Nlm_RectPtr r, Nlm_RegioN rgn));
  208.  
  209. void         Nlm_EraseRect PROTO((Nlm_RectPtr r));
  210. void         Nlm_FrameRect PROTO((Nlm_RectPtr r));
  211. void         Nlm_PaintRect PROTO((Nlm_RectPtr r));
  212. void         Nlm_InvertRect PROTO((Nlm_RectPtr r));
  213. void         Nlm_ScrollRect PROTO((Nlm_RectPtr r, Nlm_IntD dx, Nlm_IntD dy));
  214.  
  215. void         Nlm_EraseOval PROTO((Nlm_RectPtr r));
  216. void         Nlm_FrameOval PROTO((Nlm_RectPtr r));
  217. void         Nlm_PaintOval PROTO((Nlm_RectPtr r));
  218. void         Nlm_InvertOval PROTO((Nlm_RectPtr r));
  219.  
  220. void         Nlm_EraseRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  221. void         Nlm_FrameRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  222. void         Nlm_PaintRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  223. void         Nlm_InvertRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  224.  
  225. void         Nlm_EraseArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  226. void         Nlm_FrameArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  227. void         Nlm_PaintArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  228. void         Nlm_InvertArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  229.  
  230. void         Nlm_ErasePoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  231. void         Nlm_FramePoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  232. void         Nlm_PaintPoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  233. void         Nlm_InvertPoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  234.  
  235. Nlm_RegioN   Nlm_CreateRgn PROTO((void));
  236. Nlm_RegioN   Nlm_DestroyRgn PROTO((Nlm_RegioN rgn));
  237. void         Nlm_ClearRgn PROTO((Nlm_RegioN rgn));
  238. void         Nlm_LoadRectRgn PROTO((Nlm_RegioN rgn, Nlm_IntD lf, Nlm_IntD tp, Nlm_IntD rt, Nlm_IntD bt));
  239. void         Nlm_OffsetRgn PROTO((Nlm_RegioN rgn, Nlm_IntD dx, Nlm_IntD dy));
  240. void         Nlm_SectRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  241. void         Nlm_UnionRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  242. void         Nlm_DiffRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  243. void         Nlm_XorRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  244. Nlm_Boolean  Nlm_EqualRgn PROTO((Nlm_RegioN rgn1, Nlm_RegioN rgn2));
  245. Nlm_Boolean  Nlm_EmptyRgn PROTO((Nlm_RegioN rgn));
  246.  
  247. void         Nlm_EraseRgn PROTO((Nlm_RegioN rgn));
  248. void         Nlm_FrameRgn PROTO((Nlm_RegioN rgn));
  249. void         Nlm_PaintRgn PROTO((Nlm_RegioN rgn));
  250. void         Nlm_InvertRgn PROTO((Nlm_RegioN rgn));
  251.  
  252. void         Nlm_ClipRect PROTO((Nlm_RectPtr r));
  253. void         Nlm_ClipRgn PROTO((Nlm_RegioN rgn));
  254. void         Nlm_ResetClip PROTO((void));
  255.  
  256. void         Nlm_ValidRect PROTO((Nlm_RectPtr r));
  257. void         Nlm_InvalRect PROTO((Nlm_RectPtr r));
  258. void         Nlm_ValidRgn PROTO((Nlm_RegioN rgn));
  259. void         Nlm_InvalRgn PROTO((Nlm_RegioN rgn));
  260.  
  261. void         Nlm_CopyBits PROTO((Nlm_RectPtr r, Nlm_VoidPtr source));
  262.  
  263. #ifdef __cplusplus
  264. }
  265. #endif
  266.  
  267. #endif
  268.