home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume21 / xvig / part06 < prev    next >
Encoding:
Text File  |  1993-11-23  |  54.3 KB  |  1,272 lines

  1. Newsgroups: comp.sources.x
  2. From: demaree@imec.be (Antoon Demaree)
  3. Subject: v21i053:  xvig - XviG Graphics Library, Part06/10
  4. Message-ID: <1993Nov23.172814.17240@sparky.sterling.com>
  5. X-Md4-Signature: 67f4d17479ea032d1ca028eadc5e39fc
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Tue, 23 Nov 1993 17:28:14 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: demaree@imec.be (Antoon Demaree)
  12. Posting-number: Volume 21, Issue 53
  13. Archive-name: xvig/part06
  14. Environment: X11
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  version_1.1/bin/EMPTY version_1.1/include/xvig.h
  21. #   version_1.1/man/xvig.ps.4 version_1.1/src/ftext.c
  22. #   version_1.1/src/init.c
  23. # Wrapped by chris@sparky on Tue Nov 23 11:17:58 1993
  24. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 6 (of 10)."'
  27. if test -f 'version_1.1/bin/EMPTY' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'version_1.1/bin/EMPTY'\"
  29. else
  30.   echo shar: Extracting \"'version_1.1/bin/EMPTY'\" \(0 characters\)
  31.   sed "s/^X//" >'version_1.1/bin/EMPTY' <<'END_OF_FILE'
  32. END_OF_FILE
  33.   if test 0 -ne `wc -c <'version_1.1/bin/EMPTY'`; then
  34.     echo shar: \"'version_1.1/bin/EMPTY'\" unpacked with wrong size!
  35.   fi
  36.   # end of 'version_1.1/bin/EMPTY'
  37. fi
  38. if test -f 'version_1.1/include/xvig.h' -a "${1}" != "-c" ; then 
  39.   echo shar: Will not clobber existing file \"'version_1.1/include/xvig.h'\"
  40. else
  41.   echo shar: Extracting \"'version_1.1/include/xvig.h'\" \(4803 characters\)
  42.   sed "s/^X//" >'version_1.1/include/xvig.h' <<'END_OF_FILE'
  43. X/* File>>> xvig.h
  44. X--
  45. X-- %M% -- version %I% (IMEC)            last updated: %E%
  46. X--
  47. X-- Copyright (c) 1993
  48. X-- IMEC vzw
  49. X-- Kapeldreef 75
  50. X-- B-3001 LEUVEN
  51. X-- BELGIUM
  52. X--
  53. X-- Author   : A. Demaree
  54. X--
  55. X-- Date     : October 1, 1993
  56. X--
  57. X-- Function : Header file for XviG version 1.1
  58. X--
  59. X-- Comment  :
  60. X--
  61. X-- Review   :
  62. X--
  63. X*/
  64. X
  65. X
  66. X#ifndef __XVIG_H
  67. X#define __XVIG_H
  68. X
  69. X
  70. X/*
  71. X-- The default colors, if not set by the user program
  72. X*/
  73. X
  74. X#define XviG_NR_OF_COLORS        16
  75. X
  76. X#define XviG_COLOR_BLACK          0
  77. X#define XviG_COLOR_WHITE          1
  78. X#define XviG_COLOR_RED            2
  79. X#define XviG_COLOR_GREEN          3
  80. X#define XviG_COLOR_BLUE           4
  81. X#define XviG_COLOR_CYAN           5
  82. X#define XviG_COLOR_MAGENTA        6
  83. X#define XviG_COLOR_YELLOW         7
  84. X#define XviG_COLOR_ORANGE         8
  85. X#define XviG_COLOR_GREEN_YELLOW   9
  86. X#define XviG_COLOR_GREEN_CYAN    10
  87. X#define XviG_COLOR_BLUE_CYAN     11
  88. X#define XviG_COLOR_BLUE_MAGENTA  12
  89. X#define XviG_COLOR_RED_MAGENTA   13
  90. X#define XviG_COLOR_DARK_GRAY     14
  91. X#define XviG_COLOR_LIGHT_GRAY    15
  92. X
  93. X
  94. X/*
  95. X-- The linestyles and fillpatterns
  96. X*/
  97. X
  98. X#define XviG_NR_OF_LINESTYLES     8
  99. X#define XviG_NR_OF_FILLPATTERNS  42
  100. X
  101. X
  102. X/*
  103. X-- The cursor types
  104. X*/
  105. X
  106. X#define XviG_CURSOR_ARROW   0L
  107. X#define XviG_CURSOR_XHAIR  -1L
  108. X
  109. X
  110. X/*
  111. X-- The cursor input enabling
  112. X*/
  113. X
  114. X#define XviG_KEY         0
  115. X#define XviG_BUTTON      1
  116. X#define XviG_KEY_BUTTON  2
  117. X
  118. X
  119. X/*
  120. X-- The mouse button return values
  121. X*/
  122. X
  123. X#define XviG_BUTTON1  -1
  124. X#define XviG_BUTTON2  -2
  125. X#define XviG_BUTTON3  -3
  126. X#define XviG_BUTTON4  -4
  127. X#define XviG_BUTTON5  -5
  128. X
  129. X
  130. X/*
  131. X-- The functions
  132. X*/
  133. X
  134. Xextern int XviG_Init(char *classname,
  135. X                     int color_array[][3],
  136. X                     int nr_of_colors);
  137. X
  138. Xextern void XviG_Exit(void);
  139. X
  140. Xextern int XviG_OpenWindow(char *name,
  141. X                           int x,
  142. X                           int y,
  143. X                           unsigned int *width,
  144. X                           unsigned int *height);
  145. X
  146. Xextern int XviG_CloseWindow(char *name);
  147. X
  148. Xextern int XviG_SelectWindow(char *name);
  149. X
  150. Xextern void XviG_WindowSize(unsigned int *width,
  151. X                            unsigned int *height);
  152. X
  153. Xextern void XviG_WindowPosition(int *x,
  154. X                                int *y);
  155. X
  156. Xextern void XviG_ClearWindow(void);
  157. X
  158. Xextern void XviG_SetColor(int nr);
  159. X
  160. Xextern void XviG_SetLineStyle(int nr,
  161. X                              unsigned int width);
  162. X
  163. Xextern void XviG_SetFillStyle(int nr);
  164. X
  165. Xextern int XviG_SetFont(int nr);
  166. X
  167. Xextern void XviG_DrawPoint(int x,
  168. X                           int y);
  169. X
  170. Xextern void XviG_DrawLine(int x1,
  171. X                          int y1,
  172. X                          int x2,
  173. X                          int y2);
  174. X
  175. Xextern void XviG_DrawPolyLine(int *coords,
  176. X                              int npoints);
  177. X
  178. Xextern void XviG_DrawRectangle(int x1,
  179. X                               int y1,
  180. X                               int x2,
  181. X                               int y2);
  182. X
  183. Xextern void XviG_DrawPolygon(int *coords,
  184. X                             int npoints);
  185. X
  186. Xextern void XviG_DrawArc(int x,
  187. X                         int y,
  188. X                         unsigned int radius1,
  189. X                         unsigned int radius2,
  190. X                         int angle1,
  191. X                         int angle2);
  192. X
  193. Xextern void XviG_FillRectangle(int x1,
  194. X                               int y1,
  195. X                               int x2,
  196. X                               int y2);
  197. X
  198. Xextern void XviG_FillPolygon(int *coords,
  199. X                             int npoints);
  200. X
  201. Xextern void XviG_FillArc(int x,
  202. X                         int y,
  203. X                         unsigned int radius1,
  204. X                         unsigned int radius2,
  205. X                         int angle1,
  206. X                         int angle2);
  207. X
  208. Xextern void XviG_PolyText(char *contents,
  209. X                          int x,
  210. X                          int y,
  211. X                          unsigned int width,
  212. X                          unsigned int height,
  213. X                          int rotation);
  214. X
  215. Xextern void XviG_FontText(char *contents,
  216. X                          int x,
  217. X                          int y);
  218. X
  219. Xextern void XviG_FontTextSize(char *contents,
  220. X                              int *x_offset,
  221. X                              int *y_offset,
  222. X                              unsigned int *width,
  223. X                              unsigned int *height);
  224. X
  225. Xextern void XviG_Flush(void);
  226. X
  227. Xextern void XviG_SetSenseKbd(int sense_char);
  228. X
  229. Xextern int XviG_SenseKbd(void);
  230. X
  231. Xextern void XviG_OpenCursor(unsigned int width,
  232. X                            unsigned int height,
  233. X                            int hot_x,
  234. X                            int hot_y);
  235. X
  236. Xextern long XviG_CloseCursor(void);
  237. X
  238. Xextern void XviG_DeleteCursor(long cursor);
  239. X
  240. Xextern void XviG_SetCursor(long cursor);
  241. X
  242. Xextern int XviG_GetCursor(int type,
  243. X                          int *x_pos,
  244. X                          int *y_pos);
  245. X
  246. X
  247. X#endif  /* __XVIG_H */
  248. END_OF_FILE
  249.   if test 4803 -ne `wc -c <'version_1.1/include/xvig.h'`; then
  250.     echo shar: \"'version_1.1/include/xvig.h'\" unpacked with wrong size!
  251.   fi
  252.   # end of 'version_1.1/include/xvig.h'
  253. fi
  254. if test -f 'version_1.1/man/xvig.ps.4' -a "${1}" != "-c" ; then 
  255.   echo shar: Will not clobber existing file \"'version_1.1/man/xvig.ps.4'\"
  256. else
  257.   echo shar: Extracting \"'version_1.1/man/xvig.ps.4'\" \(33567 characters\)
  258.   sed "s/^X//" >'version_1.1/man/xvig.ps.4' <<'END_OF_FILE'
  259. X2474 y Fl(Abstract)69 2580 y Fn(This)h(text)f(describ)q(es)i(ho)o(w)e(to)g
  260. X(use)h(the)f(graphics)h(pac)o(k)m(age)g Fk(XviG)e Fn(\(v)o(ersion)i(1.1\).)22
  261. Xb Fk(XviG)16 b Fn(allo)o(ws)h(to)69 2636 y(op)q(en)c(windo)o(ws,)f(dra)o(w)g
  262. X(all)h(kinds)g(of)f(ob)s(jects)f(and)i(get)e(cursor)h(input)h(in)g(an)g(X)f
  263. X(Windo)o(w)g(en)o(vironmen)o(t,)69 2693 y(without)j(ha)o(ving)g(to)g(deal)h
  264. X(with)f(the)h(o)o(v)o(erhead)f(pro)q(duced)h(b)o(y)f(the)g(X)h(Windo)o(w)f
  265. X(system.)k(It)c(pro)o(vides)69 2749 y(the)g(user)g(with)h(a)f(p)q(o)o(w)o
  266. X(erful)g(but)h(v)o(ery)f(easy)g(to)f(use)i(library)g(for)e(pro)q(ducing)j
  267. X(simple)f(graphics.)p eop
  268. X%%Page: 1 2
  269. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1285 b Fj(CONTENTS)p
  270. X-45 -28 1999 2 v -45 116 a Fq(Con)n(ten)n(ts)-45 218 y Fl(1)42
  271. Xb(In)o(tro)q(duction)1636 b(3)-45 320 y(2)42 b(The)18 b(XviG)f(System)1510
  272. Xb(3)23 376 y Fn(2.1)46 b(Ho)o(w)14 b(XviG)i(W)l(orks)i Fi(:)k(:)h(:)f(:)g(:)h
  273. X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
  274. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  275. Xb Fn(3)23 433 y(2.2)46 b(Refreshing)16 b(a)f(Windo)o(w)f Fi(:)22
  276. Xb(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
  277. X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  278. Xb Fn(3)-45 535 y Fl(3)42 b(The)18 b(XviG)f(F)l(unctions)1456
  279. Xb(4)23 591 y Fn(3.1)46 b(Initializin)q(g)17 b(XviG)35 b Fi(:)22
  280. Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
  281. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
  282. X(:)61 b Fn(4)23 647 y(3.2)46 b(Quiting)17 b(XviG)25 b Fi(:)d(:)h(:)f(:)h(:)f
  283. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
  284. X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  285. Xb Fn(4)23 704 y(3.3)46 b(Ab)q(out)15 b(Windo)o(ws)46 b Fi(:)22
  286. Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
  287. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
  288. X(:)61 b Fn(5)128 760 y(3.3.1)50 b(Op)q(ening)17 b(a)e(Windo)o(w)h
  289. XFi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
  290. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  291. Xb Fn(5)128 817 y(3.3.2)50 b(Closing)16 b(a)f(Windo)o(w)37 b
  292. XFi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
  293. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  294. Xb Fn(5)128 873 y(3.3.3)50 b(Selecting)17 b(a)e(Windo)o(w)42
  295. Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
  296. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  297. Xb Fn(6)128 930 y(3.3.4)50 b(Asking)16 b(for)f(the)g(Size)h(of)f(a)g(Windo)o
  298. X(w)36 b Fi(:)23 b(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  299. X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(6)128 986
  300. Xy(3.3.5)50 b(Asking)16 b(for)f(the)g(P)o(osition)g(of)g(a)g(Windo)o(w)24
  301. Xb Fi(:)e(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  302. X(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(6)128 1043 y(3.3.6)50 b(Erasing)16
  303. Xb(a)e(Windo)o(w)34 b Fi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)
  304. Xf(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
  305. X(:)g(:)h(:)61 b Fn(7)23 1099 y(3.4)46 b(Setting)15 b(Dra)o(w)f(A)o(ttributes)
  306. X27 b Fi(:)c(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g
  307. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  308. Xb Fn(7)128 1156 y(3.4.1)50 b(Setting)16 b(the)f(Color)21 b
  309. XFi(:)i(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)
  310. Xf(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
  311. Xb Fn(7)128 1212 y(3.4.2)50 b(Setting)16 b(the)f(Line)i(St)o(yle)e(and)h(Line)
  312. Xh(Width)k Fi(:)i(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  313. X(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(8)128 1268 y(3.4.3)50
  314. Xb(Setting)16 b(the)f(Fill)i(St)o(yle)j Fi(:)i(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  315. X(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  316. X(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(8)23 1325 y(3.5)46 b(Dra)o(wing)14
  317. Xb(Ob)s(jects)34 b Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  318. X(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  319. X(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(9)128 1381 y(3.5.1)50
  320. Xb(Dra)o(wing)15 b(a)g(P)o(oin)o(t)37 b Fi(:)23 b(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  321. X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  322. X(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(9)128 1438 y(3.5.2)50
  323. Xb(Dra)o(wing)15 b(a)g(Line)24 b Fi(:)e(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)
  324. Xh(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  325. X(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(9)128 1494 y(3.5.3)50 b(Dra)o(wing)15
  326. Xb(a)g(P)o(olyline)22 b Fi(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  327. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
  328. X(:)g(:)h(:)38 b Fn(11)128 1551 y(3.5.4)50 b(Dra)o(wing)15 b(a)g(Rectangle)21
  329. Xb Fi(:)h(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
  330. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  331. Xb Fn(11)128 1607 y(3.5.5)50 b(Dra)o(wing)15 b(a)g(P)o(olygon)20
  332. Xb Fi(:)i(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
  333. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  334. Xb Fn(11)128 1664 y(3.5.6)50 b(Dra)o(wing)15 b(an)g(Arc)d Fi(:)22
  335. Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
  336. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  337. Xb Fn(12)23 1720 y(3.6)46 b(Dra)o(wing)14 b(T)l(ext)25 b Fi(:)d(:)h(:)f(:)h(:)
  338. Xf(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
  339. X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  340. Xb Fn(12)128 1777 y(3.6.1)50 b(Dra)o(wing)15 b(T)l(ext)g(Using)h(P)o(olylines)
  341. Xk Fi(:)i(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  342. X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(13)128 1833
  343. Xy(3.6.2)50 b(Dra)o(wing)15 b(T)l(ext)g(Using)h(F)l(on)o(ts)g
  344. XFi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  345. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(13)23
  346. X1889 y(3.7)46 b(Flushing)16 b(the)g(Graphics)f(Output)e Fi(:)23
  347. Xb(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  348. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(15)23
  349. X1946 y(3.8)46 b(Sensing)16 b(the)g(Keyb)q(oard)38 b Fi(:)22
  350. Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
  351. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  352. Xb Fn(15)128 2002 y(3.8.1)50 b(Setting)16 b(a)f(Keyb)q(oard)h(Sense)g
  353. X(Character)27 b Fi(:)22 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  354. X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(15)128 2059
  355. Xy(3.8.2)50 b(Asking)16 b(for)f(a)g('Sense)g(Keyb)q(oard')45
  356. Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  357. X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(16)23 2115
  358. Xy(3.9)46 b(Ab)q(out)15 b(the)h(Cursor)e Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  359. X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  360. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(16)128
  361. X2172 y(3.9.1)50 b(Creating)15 b(a)g(New)g(User)h(Cursor)45
  362. Xb Fi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  363. X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(16)128
  364. X2228 y(3.9.2)50 b(Closing)16 b(a)f(User)g(Cursor)31 b Fi(:)23
  365. Xb(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  366. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(17)128
  367. X2285 y(3.9.3)50 b(Setting)16 b(a)f(Cursor)f(T)o(yp)q(e)25 b
  368. XFi(:)e(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)
  369. Xf(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  370. Xb Fn(17)128 2341 y(3.9.4)50 b(Deleting)17 b(a)d(User)i(Cursor)11
  371. Xb Fi(:)23 b(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
  372. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  373. Xb Fn(17)128 2398 y(3.9.5)50 b(Asking)16 b(for)f(Cursor)f(Input)27
  374. Xb Fi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  375. X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  376. Xb Fn(18)-45 2499 y Fl(4)k(Using)18 b(XviG)1626 b(19)23 2556
  377. Xy Fn(4.1)46 b(En)o(vironmen)o(t)41 b Fi(:)22 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)
  378. Xg(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  379. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
  380. XFn(19)23 2612 y(4.2)46 b(W)l(riting)16 b(C)f(Programs)e(with)j(XviG)22
  381. Xb Fi(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  382. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
  383. XFn(19)23 2669 y(4.3)46 b(The)15 b(Resource)h(Manager)f(Database)27
  384. Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  385. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
  386. XFn(19)128 2725 y(4.3.1)50 b(The)16 b(Geometry)e(of)h(XviG)g(Windo)o(ws)23
  387. Xb Fi(:)g(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  388. X(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(19)128 2782 y(4.3.2)50
  389. Xb(F)l(on)o(ts)15 b(to)f(Use)i(in)g(XviG)f(Windo)o(ws)25 b Fi(:)d(:)h(:)f(:)g
  390. X(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  391. X(:)h(:)f(:)g(:)h(:)38 b Fn(20)943 2932 y(1)p eop
  392. X%%Page: 2 3
  393. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1285 b Fj(CONTENTS)p
  394. X-45 -28 1999 2 v 23 116 a Fn(4.4)46 b(Installation)38 b Fi(:)22
  395. Xb(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  396. X(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h
  397. X(:)f(:)g(:)h(:)38 b Fn(21)23 172 y(4.5)46 b(T)l(roublesho)q(oting)13
  398. Xb Fi(:)23 b(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
  399. X(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  400. X(:)h(:)f(:)g(:)h(:)38 b Fn(21)23 229 y(4.6)46 b(Problem)15
  401. Xb(Rep)q(orting)24 b Fi(:)f(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)
  402. Xf(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
  403. X(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(21)-45 331 y Fl(A)28 b(The)18
  404. Xb(XviG)f(Header)h(File)1382 b(22)-45 433 y(B)31 b(Some)17 b(Examples)1538
  405. Xb(26)23 489 y Fn(B.1)37 b(Displa)o(ying)16 b(the)g(Default)f(Colormap)27
  406. Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
  407. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
  408. XFn(26)23 546 y(B.2)f(Creating)15 b(a)g(User)g(Cursor)45 b Fi(:)23
  409. Xb(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
  410. X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  411. Xb Fn(27)23 602 y(B.3)f(Use)15 b(of)g(the)g('Sense)h(Keyb)q(oard')k
  412. XFi(:)i(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)
  413. Xh(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  414. Xb Fn(29)23 658 y(B.4)f(Dra)o(wing)14 b(T)l(ext)25 b Fi(:)d(:)h(:)f(:)h(:)f(:)
  415. Xg(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
  416. X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
  417. Xb Fn(31)943 2932 y(2)p eop
  418. X%%Page: 3 4
  419. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1294 b Fj(In)o(tro)q(duction)p
  420. X-45 -28 1999 2 v -45 116 a Fq(1)69 b(In)n(tro)r(duction)-45
  421. X217 y Fn(Although)14 b(the)f(X)h(Windo)o(w)f(system)g(is)g(an)h(extremely)f
  422. X(p)q(o)o(w)o(erful)h(graphics)g(pac)o(k)m(age,)f(pro)q(ducing)h(simple)h
  423. X(graphics)-45 274 y(with)k(it)f(isn't)g(an)g(easy)g(job.)28
  424. Xb(Due)18 b(to)g(the)g(nature)g(of)f(the)h(X)g(Windo)o(w)h(system,)f(the)g
  425. X(programmer)e(has)i(to)g(deal)-45 330 y(with)e(a)g(lot)g(of)f(o)o(v)o(erhead)
  426. Xh(pro)q(duced)h(b)o(y)f(the)f(ev)o(en)o(t-driv)o(en)i(mec)o(hanism.)23
  427. Xb(In)16 b(fact,)f(he)i(has)e(to)h(react)f(on)h(all)h(kinds)-45
  428. X387 y(of)g('messages')e(that)i(the)g(X)g(Windo)o(w)g(system)f(noti\014es)i
  429. X(him)f(of,)g(lik)o(e)h(windo)o(w)f(gro)o(wing)f(and)h(shrinking,)i(hidden)-45
  430. X443 y(windo)o(ws,)c(mouse)g(mo)o(v)o(emen)o(t,)f(k)o(ey)h(presses)h(and)f
  431. X(mouse)g(button)g(clic)o(ks,)h(etc.)26 500 y(In)g(order)g(for)f(the)h(user)g
  432. X(to)g(b)q(e)g(able)h(to)e(pro)q(duce)i(simple)h(graphics)e(in)h(a)e(m)o(uc)o
  433. X(h)h(more)g(easier)g(w)o(a)o(y)l(,)f(the)h Fk(XviG)-45 556
  434. Xy Fn(graphics)11 b(pac)o(k)m(age)f(has)h(b)q(een)g(dev)o(elop)q(ed.)20
  435. Xb Fk(XviG)10 b Fn(stands)g(for)f(\\)p Fl(X)h Fn(Windo)o(w)g
  436. XFl(vi)p Fn(rtual)h Fl(G)p Fn(raphics")g(and)f(is)h(considered)-45
  437. X613 y(to)h(b)q(e)i(an)e(I/O-driv)o(en)i(graphics)g(pac)o(k)m(age)e(\(as)g(it)
  438. Xh(w)o(as)f(in)i(the)f('go)q(o)q(d)f(old)h(da)o(ys'\))f(instead)h(of)f(the)h
  439. X(X)g(Windo)o(w)g(ev)o(en)o(t-)-45 669 y(driv)o(en)22 b(graphics.)37
  440. Xb(This)21 b(means)g(that)f Fk(XviG)g Fn(pro)o(vides)h(the)g(user)g(only)h
  441. X(with)f(a)f(n)o(um)o(b)q(er)h(of)g(straigh)o(tforw)o(ard)-45
  442. X725 y(functions)g(for)f(op)q(ening)h(windo)o(ws,)g(de\014ning)h(colors,)f
  443. X(dra)o(wing)f(lines,)j(rectangles,)f Fi(:)8 b(:)g(:)d Fn(,)21
  444. Xb(creating)g(cursors)e(and)-45 782 y(getting)f(cursor)g(input,)h(etc.)29
  445. Xb(In)18 b(this)h(w)o(a)o(y)l(,)e(he)i(do)q(es)f(not)g(need)h(to)e(kno)o(w)g
  446. X(an)o(ything)i(ab)q(out)f(all)h(the)f(fancy)g(\(and)-45 838
  447. Xy(complicated\))e(features)f(of)g(the)g(X)g(Windo)o(w)h(system.)26
  448. X895 y(The)i Fk(XviG)g Fn(graphics)g(pac)o(k)m(age)g(is)h(mean)o(t)f(to)f(pro)
  449. Xq(duce)i Fh(simple)f Fn(graphics,)h(whic)o(h)g(means)f(that)g(is)g(do)q(es)h
  450. X(not)-45 951 y(pro)o(vide)d(scrollbars,)f(p)q(op-up)i(men)o(us,)e(fancy)g
  451. X(text)g(features,)f(etc.)-45 1047 y(In)i(section)g(2)f(the)g(concept)h(of)e
  452. X(the)i Fk(XviG)e Fn(system)h(is)h(explained)h(brie\015y)l(.)-45
  453. X1103 y(In)f(section)g(3)f(all)h(functions)g(and)f(de\014nitions)i(of)e
  454. XFk(XviG)f Fn(are)h(giv)o(en.)-45 1160 y(In)h(section)g(4)f(is)g(describ)q(ed)
  455. Xi(what)e(the)g(user)h(m)o(ust)e(kno)o(w)h(when)h(dev)o(elopping)h(or)d
  456. X(running)j(an)e Fk(XviG)f Fn(program.)-45 1216 y(App)q(endix)k(A)d(lists)h
  457. X(the)f(program)f(header)i(\014le)g(to)e(b)q(e)i(included)i(in)e(C)f
  458. X(programs.)-45 1273 y(Finally)i(app)q(endix)g(B)e(will)i(giv)o(e)e(some)g
  459. X(examples)h(of)f(programming)g(with)g(the)g Fk(XviG)g Fn(pac)o(k)m(age.)-45
  460. X1416 y Fq(2)69 b(The)23 b(XviG)f(System)-45 1519 y Fg(2.1)56
  461. Xb(Ho)n(w)19 b(XviG)f(W)-5 b(orks)-45 1605 y Fn(The)14 b(purp)q(ose)f(of)g
  462. X(the)h Fk(XviG)e Fn(system)h(is)h(to)e(hide)j(all)f(the)f(ev)o(en)o(ts)g
  463. X(generated)g(b)o(y)g(the)h(X)f(Windo)o(w)g(system)g(from)f(the)-45
  464. X1661 y(programmer.)20 b(X)c(ev)o(en)o(ts)f(are)h(related)g(to)f(a)g(windo)o
  465. X(w.)22 b(So,)15 b(for)g(eac)o(h)h(windo)o(w)g(that)f(is)h(op)q(ened,)h(a)e(c)
  466. Xo(hild)j(program)-45 1718 y(is)d(started)f(that)g(handles)i(all)f(these)g(X)g
  467. X(ev)o(en)o(ts.)k(Only)d(the)e(data)g(that)g(is)h(sp)q(eci\014cally)i(w)o(an)o
  468. X(ted)d(\(e.g.)19 b(windo)o(w)c(size,)-45 1774 y(cursor)e(p)q(osition\))h(is)g
  469. X(requested)f(b)o(y)g(the)h(user)f(program)f(to)h(this)g(c)o(hild)i(program)d
  470. X(and)h(transmitted)g(from)g(the)g(c)o(hild)-45 1831 y(program)j(bac)o(k)h(to)
  471. Xf(the)h(user)g(program.)24 b(Other)17 b(X)g(ev)o(en)o(ts)g(that)f(are)h(of)f
  472. X(no)h(in)o(terest)g(to)f(the)h(user)h(program,)d(lik)o(e)-45
  473. X1887 y(windo)o(w)h(hiding)g(and)g(iconifying,)h(windo)o(w)e(resizing)h(and)g
  474. X(refreshing,)f(are)g(dealt)h(with)f(b)o(y)h(this)f(c)o(hild)i(program.)26
  475. X1944 y(The)d(comm)o(unication)h(b)q(et)o(w)o(een)f(the)g(c)o(hild)i
  476. X(program\(s\))c(and)i(the)g(user)g(program)f(uses)h(the)h(X)f(proto)q(col.)19
  477. Xb(This)-45 2000 y(implies)f(that)c(there)i(is)f(no)h(loss)f(of)g(p)q
  478. X(erformance)g(of)g(this)h(graphics)g(system)f(compared)g(to)g(a)g(regular)g
  479. X(X)g(Windo)o(w)-45 2056 y(program.)-45 2178 y Fg(2.2)56 b(Refreshing)17
  480. Xb(a)i(Windo)n(w)-45 2264 y Fk(XviG)d Fn(is)h(built)i(on)d(top)h(of)f
  481. XFh(Xlib)p Fn(.)24 b(This)17 b(implies)i(that)d(a)h(windo)o(w)g(refresh)f(is)i
  482. X(not)e(done)h(automatically)g(b)o(y)g(X.)g(A)-45 2320 y(windo)o(w)g(refresh)g
  483. X(is)g(needed)h(when)f(resizing)h(a)f(windo)o(w,)g(when)g(pushing)h(and/or)e
  484. X(p)q(opping)i(windo)o(w,)f(and)g(when)-45 2377 y(de-iconifying)h(a)d(windo)o
  485. X(w.)26 2433 y(The)20 b(windo)o(w)g(refresh)g(is)g(tak)o(en)f(care)h(of)f(b)o
  486. X(y)h(the)g Fk(XviG)f Fn(c)o(hild)i(program.)33 b(Ev)o(ery)19
  487. Xb(windo)o(w)h(has)g(a)f(bac)o(kup)-45 2490 y(pixmap)e(asso)q(ciated)g(with)g
  488. X(it)f(whic)o(h)i(has)e(the)g(same)g(size)i(as)e(the)g(windo)o(w.)24
  489. Xb(All)18 b(ob)s(jects)d(that)h(are)g(dra)o(wn)g(in)h(the)-45
  490. X2546 y(windo)o(w)c(are)g(also)f(dra)o(wn)h(to)f(that)g(pixmap.)20
  491. Xb(When)13 b(a)g(refresh)f(is)i(needed,)g(the)f(pixmap)g(is)h(copied)g(to)e
  492. X(the)h(windo)o(w.)26 2603 y(Ho)o(w)o(ev)o(er,)i(the)i(size)h(of)e(the)g
  493. X(pixmap)i(is)f(set)f(when)h(the)g(windo)o(w)g(is)g(op)q(ened.)25
  494. Xb(When)17 b(the)g(windo)o(w)g(is)g(resized,)-45 2659 y(the)i(pixmap)g(size)h
  495. X(is)f(not)g(immediately)h(adapted,)f(whic)o(h)h(means)e(that)h(up)q(on)g(a)f
  496. X(refresh,)i(some)e(graphics)h(data)-45 2716 y(ma)o(y)f(b)q(e)h(lost)f(in)i
  497. X(the)e(windo)o(w.)30 b(The)19 b(bac)o(kup)g(pixmap)g(is)g(only)g(adjusted)f
  498. X(to)g(the)h(correct)f(size)h(when)g(the)f(user)-45 2772 y(program)c
  499. X(explicitely)k(asks)d(for)g(it)g(through)g(the)g Ff(XviG)p
  500. X916 2772 15 2 v 17 w(WindowSize)f Fn(call.)21 b(\(see)15 b(section)h(3.3.4\))
  501. X943 2932 y(3)p eop
  502. X%%Page: 4 5
  503. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  504. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fq(3)69
  505. Xb(The)23 b(XviG)f(F)-6 b(unctions)-45 217 y Fn(T)l(o)16 b(distinguish)j(the)e
  506. X(prede\014ned)h(names)f(of)f(the)g Fk(XviG)g Fn(graphics)h(pac)o(k)m(age)g
  507. X(from)f(other)g(pac)o(k)m(ages,)g(all)i(function)-45 274 y(names,)d(v)m
  508. X(alues)h(and)g(sym)o(b)q(ols)f(related)h(to)e Fk(XviG)h Fn(start)f(with)h
  509. X(the)h(pre\014x)f(')p Fh(XviG)p 1382 274 14 2 v 16 w Fn('.)-45
  510. X394 y Fg(3.1)56 b(Initializing)16 b(XviG)-45 480 y Fn(The)j(follo)o(wing)g
  511. X(function)g(m)o(ust)f(b)q(e)h(called)h(b)q(efore)f(an)o(y)f(other)g(function)
  512. Xi(of)e(the)g Fk(XviG)g Fn(pac)o(k)m(age)g(and)h(m)o(ust)f(b)q(e)-45
  513. X536 y(called)f(exactly)f(once.)k(This)c(function)g(do)q(es)f(not)g(create)g
  514. X(an)o(y)g(windo)o(ws)g(y)o(et.)-45 632 y(Syn)o(tax)g(:)27 719
  515. Xy Ff(int)23 b(XviG_Init\(char)f(*classname,)361 775 y(int)h
  516. X(color_array[][3],)361 832 y(int)g(nr_of_colors\))-45 918 y
  517. XFn(Input)16 b(parameters)f(:)23 1005 y Fm(\017)23 b Ff(classname)14
  518. Xb Fn(:)69 1062 y(The)h(name)g(de\014nition)i(to)e(b)q(e)h(used)g(b)o(y)f(the)
  519. Xg(resource)g(manager,)f(or)h(NULL.)69 1118 y(F)l(or)f(the)i(purp)q(ose)f(of)g
  520. X(this)h(parameter,)e(see)h(section)h(4.3)e(ab)q(out)h(the)h(resource)f
  521. X(manager.)23 1209 y Fm(\017)23 b Ff(color)p 192 1209 15 2 v
  522. X16 w(array)15 b Fn(:)69 1265 y(A)d(t)o(w)o(o-dimensional)g(arra)o(y)f(of)g
  523. X(in)o(teger)h(v)m(alues)h(de\014ning)g(the)f(colormap,)g(or)f(NULL)h(if)h
  524. X(the)e(default)i(colormap)69 1322 y(is)j(used)f(for)g(the)g(application.)23
  525. X1413 y Fm(\017)23 b Ff(nr)p 120 1413 V 17 w(of)p 185 1413 V
  526. X17 w(colors)14 b Fn(:)69 1469 y(The)h(n)o(um)o(b)q(er)h(of)f(en)o(tries)g(in)
  527. Xh(the)f(user-sp)q(eci\014ed)j(colormap,)d(or)g(0)f(when)i(the)f(default)h
  528. X(colormap)f(is)h(used.)-45 1556 y(Return)g(v)m(alue)g(:)23
  529. X1643 y Fm(\017)23 b Ff(1)15 b Fn(when)h(the)f(initialization)j(w)o(as)c
  530. X(successful.)23 1734 y Fm(\017)23 b Ff(0)15 b Fn(when)h(the)f(initialization)
  531. Xj(w)o(as)c(not)h(successful.)-45 1820 y(The)h Ff(color)p 172
  532. X1820 V 17 w(array)f Fn(parameter)g(con)o(tains)h(three)h(in)o(teger)f(v)m
  533. X(alues)h(p)q(er)f(en)o(try)l(.)22 b(These)17 b(in)o(teger)f(v)m(alues)h(sp)q
  534. X(ecify)g(the)-45 1877 y(R)o(GB)e(v)m(alues)h(for)e(a)h(sp)q(eci\014c)i
  535. X(color,)d(and)h(m)o(ust)f(range)h(from)f(0)h(to)f(255)g(inclusiv)o(e.)22
  536. Xb(The)15 b(n)o(um)o(b)q(er)g(of)g(en)o(tries)g(in)g(the)-45
  537. X1933 y(colormap)g(is)h(only)g(limited)h(b)o(y)e(the)g(hardw)o(are)g(the)g
  538. X(program)f(is)i(running)g(on.)-45 1990 y(E.g.)j(a)c(colormap)g(con)o(taining)
  539. Xh(only)g(the)f(colors)g(red,)g(green)h(and)f(blue)i(m)o(ust)d(b)q(e)i
  540. X(de\014ned)h(as)e(follo)o(ws)g(:)74 2077 y Ff(int)24 b(my_colormap[][3])e(=)h
  541. X({)h({)g(255,)f(0,)h(0)f(},)h({)g(0,)f(255,)h(0)f(},)h({0,)f(0,)h(255})f(};)
  542. X-45 2163 y Fn(The)17 b(default)h(colormap)e(con)o(tains)h(16)g(colors,)g
  543. X(whic)o(h)g(are)g(de\014ned)h(b)o(y)f(a)f(sym)o(b)q(ol)i(de\014nition.)26
  544. Xb(See)18 b(section)f(3.4.1)-45 2220 y(for)e(these)g(default)h(colors.)-45
  545. X2340 y Fg(3.2)56 b(Quiting)18 b(XviG)-45 2426 y Fn(The)f(follo)o(wing)h
  546. X(function)g(call)f(m)o(ust)g(b)q(e)g(the)g(last)g(one)g(from)f(the)h
  547. XFk(XviG)f Fn(pac)o(k)m(age)h(and)g(m)o(ust)f(b)q(e)i(called)g(exactly)-45
  548. X2482 y(once.)-45 2578 y(Syn)o(tax)d(:)27 2665 y Ff(void)23
  549. Xb(XviG_Exit\(void\))-45 2751 y Fn(This)13 b(function)g(will)h(close)f(all)h
  550. X(op)q(en)f(windo)o(ws)f(and)h(delete)g(all)g(user-de\014ned)h(cursors,)e(if)h
  551. X(not)f(y)o(et)g(closed)h(or)f(deleted)-45 2808 y(resp)q(ectiv)o(ely)17
  552. Xb(b)o(y)e(the)g(user)h(program.)943 2932 y(4)p eop
  553. X%%Page: 5 6
  554. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  555. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fg(3.3)56
  556. Xb(Ab)r(out)18 b(Windo)n(ws)-45 202 y Fk(XviG)f Fn(allo)o(ws)h(the)g(user)f
  557. X(program)g(to)g(op)q(en)h(an)g(arbitrary)f(n)o(um)o(b)q(er)h(of)f(windo)o(ws)
  558. Xh(and)g(to)f(switc)o(h)h(con)o(tin)o(uously)-45 258 y(b)q(et)o(w)o(een)e
  559. X(these)f(windo)o(w)g(to)g(dra)o(w)g(or)f(to)h(ask)g(cursor)f(input.)21
  560. Xb(Windo)o(ws)16 b(alw)o(a)o(ys)e(ha)o(v)o(e)h(a)g(blac)o(k)g(bac)o(kground.)
  561. X-45 315 y(Di\013eren)o(t)f(windo)o(ws)h(are)g(de\014ned)g(b)o(y)g(their)g
  562. X(name.)20 b(Only)c(one)e(windo)o(w)h(can)g(b)q(e)g(selected)h(for)e(output)g
  563. X(or)h(input)g(at)-45 371 y(the)g(same)g(time.)-45 488 y Fl(3.3.1)52
  564. Xb(Op)q(ening)19 b(a)f(Windo)o(w)-45 574 y Fn(Syn)o(tax)d(:)27
  565. X653 y Ff(int)23 b(XviG_OpenWindow\(char)e(*name,)504 709 y(int)i(x,)504
  566. X766 y(int)g(y,)504 822 y(unsigned)g(int)g(*width,)504 879 y(unsigned)g(int)g
  567. X(*height\))-45 958 y Fn(Input)16 b(parameters)f(:)23 1036 y
  568. XFm(\017)23 b Ff(name)14 b Fn(:)69 1093 y(The)h(name)g(de\014ning)i(the)e
  569. X(windo)o(w.)21 b(This)15 b(name)h(m)o(ust)e(b)q(e)i(unique.)23
  570. X1181 y Fm(\017)23 b Ff(x)15 b Fn(and)g Ff(y)g Fn(:)69 1237
  571. Xy(The)g(screen)h(co)q(ordinates)g(of)e(the)i(upp)q(er)g(left)f(corner)g(of)g
  572. X(the)g(windo)o(w)h(p)q(osition)g(on)f(the)h(screen.)69 1294
  573. Xy(If)f(one)h(of)f(these)g(v)m(alues)i(is)e(negativ)o(e,)h(the)f(p)q
  574. X(ositioning)i(of)e(the)g(windo)o(w)h(is)f(left)h(o)o(v)o(er)f(to)f(the)i(con)
  575. Xo(trol)f(of)f(the)69 1350 y(windo)o(w)h(manager,)f(if)i(one)f(is)h(running)g
  576. X(for)f(the)g(screen)h(y)o(ou)f(are)g(displa)o(ying)i(on.)-45
  577. X1429 y(Input/output)f(parameters)e(:)23 1508 y Fm(\017)23 b
  578. XFf(width)14 b Fn(and)i Ff(height)e Fn(:)69 1564 y(As)h(input,)h(these)f
  579. X(parameters)g(sp)q(ecify)h(the)f(initial)j(width)d(and)h(heigh)o(t)f(of)g
  580. X(the)h(windo)o(w.)69 1621 y(As)g(output,)g(they)g(sp)q(ecify)h(the)f(actual)h
  581. X(width)f(and)h(heigh)o(t,)f(e.g.)22 b(when)17 b(they)f(ha)o(v)o(e)g(b)q(een)h
  582. X(c)o(hanged)f(b)o(y)g(the)69 1677 y(windo)o(w)f(manager.)-45
  583. X1756 y(Return)h(v)m(alue)g(:)23 1835 y Fm(\017)23 b Ff(1)15
  584. Xb Fn(if)g(the)h(windo)o(w)f(has)g(b)q(een)i(op)q(ened)f(successfully)l(.)23
  585. X1922 y Fm(\017)23 b Ff(0)15 b Fn(if)g(the)h(windo)o(w)f(could)h(not)f(b)q(e)h
  586. X(op)q(ened)g(or)f(if)h(a)f(windo)o(w)g(with)h(the)f(sp)q(eci\014ed)i(name)e
  587. X(already)h(exists.)-45 2001 y(See)d(also)g(section)g(4.3.1)e(ab)q(out)i(the)f
  588. X(resource)h(manager)f(for)g(more)g(info)h(ab)q(out)g(the)f(p)q(ositioning)j
  589. X(and)e(size)g(of)f Fk(XviG)-45 2058 y Fn(windo)o(ws)k(on)f(the)g(screen.)-45
  590. X2175 y Fl(3.3.2)52 b(Closing)18 b(a)g(Windo)o(w)-45 2261 y
  591. XFn(Syn)o(tax)d(:)27 2340 y Ff(int)23 b(XviG_CloseWindow\(char)e(*name\))-45
  592. X2418 y Fn(Input)16 b(parameter)f(:)23 2497 y Fm(\017)23 b Ff(name)14
  593. Xb Fn(:)69 2554 y(The)h(name)g(of)g(the)h(windo)o(w)f(to)f(close.)-45
  594. X2632 y(Return)i(v)m(alue)g(:)23 2711 y Fm(\017)23 b Ff(1)15
  595. Xb Fn(if)g(the)h(windo)o(w)f(has)g(b)q(een)i(closed)f(successfully)l(.)23
  596. X2799 y Fm(\017)23 b Ff(0)15 b Fn(if)g(the)h(windo)o(w)f(could)h(not)f(b)q(e)h
  597. X(closed)g(or)f(if)h(a)e(windo)o(w)i(with)f(the)h(sp)q(eci\014ed)h(name)e(do)q
  598. X(es)h(not)e(exist.)943 2932 y(5)p eop
  599. X%%Page: 6 7
  600. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  601. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.3.3)52
  602. Xb(Selecting)19 b(a)f(Windo)o(w)-45 202 y Fn(T)l(o)12 b(direct)i(the)e(output)
  603. Xg(to)g(a)g(sp)q(eci\014c)j(windo)o(w)d(\(dra)o(wing)g(ob)s(jects\))g(and)g
  604. X(to)g(get)g(input)i(from)d(the)i(windo)o(w)g(\(windo)o(w)-45
  605. X258 y(size,)j(cursor)f(input\),)g(the)h(windo)o(w)f(m)o(ust)g(b)q(e)g
  606. X(selected)i(\014rst.)-45 315 y(Remark)e(that)g(the)g(last)g(windo)o(w)h(that)
  607. Xe(has)h(b)q(een)i(op)q(ened)f(is)g(automatically)f(selected.)-45
  608. X410 y(Syn)o(tax)g(:)27 504 y Ff(int)23 b(XviG_SelectWindow\(char)e(*name\))
  609. X-45 598 y Fn(Input)16 b(parameter)f(:)23 692 y Fm(\017)23 b
  610. XFf(name)14 b Fn(:)69 748 y(The)h(name)g(of)g(the)h(windo)o(w)f(to)f(select.)
  611. X-45 842 y(Return)i(v)m(alue)g(:)23 936 y Fm(\017)23 b Ff(1)15
  612. Xb Fn(if)g(the)h(windo)o(w)f(has)g(b)q(een)i(selected.)23 1030
  613. Xy Fm(\017)23 b Ff(0)15 b Fn(if)g(the)h(windo)o(w)f(with)h(the)f(sp)q
  614. X(eci\014ed)i(name)f(do)q(es)f(not)g(exist.)-45 1150 y Fl(3.3.4)52
  615. Xb(Asking)17 b(for)g(the)h(Size)g(of)f(a)h(Windo)o(w)-45 1235
  616. Xy Fn(A)g(windo)o(w)g(on)f(the)h(screen)g(ma)o(y)f(ha)o(v)o(e)g(b)q(een)i
  617. X(resized,)g(e.g.)27 b(b)o(y)17 b(the)h(windo)o(w)g(manager.)26
  618. Xb(A)o(t)17 b(an)o(y)g(momen)o(t,)g(the)-45 1292 y(user)f(program)e(can)h(ask)
  619. Xg(the)g(\(new\))g(size)h(of)f(a)g(windo)o(w.)-45 1387 y(Syn)o(tax)g(:)27
  620. X1481 y Ff(void)23 b(XviG_WindowSize\(unsigned)e(int)i(*width,)528
  621. X1538 y(unsigned)g(int)g(*height\))-45 1632 y Fn(Output)16 b(parameters)e(:)23
  622. X1725 y Fm(\017)23 b Ff(width)14 b Fn(and)i Ff(height)e Fn(:)69
  623. X1782 y(The)h(actual)h(width)f(and)h(heigh)o(t)f(of)g(the)g(curren)o(tly)h
  624. X(selected)h(windo)o(w.)-45 1876 y(See)f(also)f(section)h(2.2)e(for)h(the)g
  625. X(side)h(e\013ect)f(of)g(this)h(function)g(call.)-45 1996 y
  626. XFl(3.3.5)52 b(Asking)17 b(for)g(the)h(P)o(osition)g(of)f(a)h(Windo)o(w)-45
  627. X2082 y Fn(A)f(windo)o(w)f(on)g(the)h(screen)g(ma)o(y)e(ha)o(v)o(e)h(b)q(een)i
  628. X(mo)o(v)o(ed)d(and/or)h(resized,)i(e.g.)k(b)o(y)17 b(the)f(windo)o(w)h
  629. X(manager.)22 b(A)o(t)16 b(an)o(y)-45 2138 y(momen)o(t,)e(the)i(user)f
  630. X(program)f(can)h(ask)g(the)g(\(new\))g(p)q(osition)h(of)f(a)g(windo)o(w)g(on)
  631. Xh(the)f(screen.)-45 2234 y(Syn)o(tax)g(:)27 2327 y Ff(void)23
  632. Xb(XviG_WindowPosition\(int)e(*x,)623 2384 y(int)j(*y\))-45
  633. X2478 y Fn(Output)16 b(parameters)e(:)23 2571 y Fm(\017)23 b
  634. XFf(x)15 b Fn(and)g Ff(y)g Fn(:)69 2628 y(The)g(actual)h(p)q(osition)g(\(upp)q
  635. X(er)g(left)f(corner\))g(of)g(the)g(curren)o(tly)h(selected)g(windo)o(w.)943
  636. X2932 y(6)p eop
  637. X%%Page: 7 8
  638. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  639. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.3.6)52
  640. Xb(Erasing)18 b(a)g(Windo)o(w)-45 202 y Fn(The)c(follo)o(wing)h(function)g
  641. X(erases)e(the)h(con)o(ten)o(ts)g(of)f(the)h(curren)o(tly)g(selected)h(windo)o
  642. X(w)g(and)f(puts)g(the)g(windo)o(w)g(bac)o(k)-45 258 y(to)h(the)g(bac)o
  643. X(kground)g(color)g(\(=)h(blac)o(k\).)-45 354 y(Syn)o(tax)f(:)27
  644. X438 y Ff(void)23 b(XviG_ClearWindow\(void\))-45 558 y Fg(3.4)56
  645. Xb(Setting)18 b(Dra)n(w)h(A)n(ttributes)-45 644 y Fn(Dra)o(w)d(attributes)h
  646. X(are)g(the)h(color,)f(the)h(linest)o(yle,)h(the)f(linewidth)h(and)f(the)f
  647. X(\014llst)o(yle.)28 b(These)18 b(attributes)f(are)g(not)-45
  648. X700 y(related)e(to)e(one)h(windo)o(w,)g(but)g(are)f(global)i(to)e(all)i
  649. X(windo)o(ws.)20 b(When)14 b(an)g(attribute)f(is)i(set,)e(it)i(remains)f(v)m
  650. X(alid)h(for)f(all)-45 757 y(subsequen)o(t)i(dra)o(w)e(calls,)i(un)o(til)h
  651. X(the)e(attribute)g(v)m(alue)h(is)g(c)o(hanged.)-45 875 y Fl(3.4.1)52
  652. Xb(Setting)19 b(the)e(Color)-45 961 y Fn(T)l(o)e(set)g(the)g(color)h(for)e
  653. X(subsequen)o(t)i(dra)o(w)e(calls,)i(use)g(the)f(follo)o(wing)h(function.)-45
  654. X1056 y(Syn)o(tax)f(:)27 1140 y Ff(void)23 b(XviG_SetColor\(int)f(nr\))-45
  655. X1224 y Fn(Input)16 b(parameter)f(:)23 1309 y Fm(\017)23 b Ff(nr)15
  656. Xb Fn(:)69 1365 y(The)h(en)o(try)f(in)h(the)g(colormap)f(de\014ned)i(with)f
  657. X(the)f Ff(XviG)p 1049 1365 15 2 v 17 w(Init)g Fn(function.)21
  658. Xb(The)16 b(\014rst)f(en)o(try)g(gets)g(n)o(um)o(b)q(er)h(0,)69
  659. X1422 y(the)f(second)h(en)o(try)f(n)o(um)o(b)q(er)g(1,)g(etc.)69
  660. X1478 y(When)g(the)f(default)h(colormap)f(is)h(used,)g(the)f(follo)o(wing)h
  661. X(16)f(sym)o(b)q(ols)h(are)f(de\014ned)i(to)d(sp)q(ecify)j(this)f(parame-)69
  662. X1534 y(ter)g(:)331 1635 y Ff(XviG_COLOR_BLACK)331 1692 y(XviG_COLOR_WHITE)331
  663. X1748 y(XviG_COLOR_RED)331 1805 y(XviG_COLOR_GREEN)331 1861
  664. Xy(XviG_COLOR_BLUE)331 1918 y(XviG_COLOR_CYAN)331 1974 y(XviG_COLOR_MAGENTA)
  665. X331 2031 y(XviG_COLOR_YELLOW)331 2087 y(XviG_COLOR_ORANGE)331
  666. X2143 y(XviG_COLOR_GREEN_YELLOW)331 2200 y(XviG_COLOR_GREEN_CYAN)331
  667. X2256 y(XviG_COLOR_BLUE_CYAN)331 2313 y(XviG_COLOR_BLUE_MAGENTA)331
  668. X2369 y(XviG_COLOR_RED_MAGENTA)331 2426 y(XviG_COLOR_DARK_GRAY)331
  669. X2482 y(XviG_COLOR_LIGHT_GRAY)-45 2640 y Fn(A)g(de\014nition)i(of)e(the)g(n)o
  670. X(um)o(b)q(er)h(of)f(colors)g(in)h(the)f(default)h(colormap)f(is)h(a)o(v)m
  671. X(ailable)h(:)122 2724 y Ff(XviG_NR_OF_COLORS)-45 2808 y Fn(whic)o(h)f(has)f
  672. X(a)g(v)m(alue)i(of)d(16.)943 2932 y(7)p eop
  673. X%%Page: 8 9
  674. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  675. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.4.2)52
  676. Xb(Setting)19 b(the)e(Line)i(St)o(yle)e(and)h(Line)h(Width)-45
  677. X202 y Fn(T)l(o)c(set)g(the)g(line)i(attributes)e(for)g(subsequen)o(t)h(dra)o
  678. X(w)e(calls,)i(use)f(the)h(follo)o(wing)g(function.)-45 297
  679. Xy(Syn)o(tax)f(:)27 391 y Ff(void)23 b(XviG_SetLineStyle\(int)e(nr,)576
  680. X448 y(unsigned)h(int)i(width\))-45 541 y Fn(Input)16 b(parameters)f(:)23
  681. X635 y Fm(\017)23 b Ff(nr)15 b Fn(:)69 692 y(The)g(iden)o(ti\014cation)i(n)o
  682. X(um)o(b)q(er)f(of)f(the)g(linest)o(yle)i(to)d(dra)o(w)h(lines,)h(rectangles)g
  683. X(or)e(p)q(olygons)i(with.)23 785 y Fm(\017)23 b Ff(width)14
  684. Xb Fn(:)69 842 y(The)h(width)h(of)f(the)g(lines.)69 898 y(Notice)g(that)e(a)h
  685. X(width)h(of)f(0)g(and)h(a)f(width)g(of)g(1)g(ma)o(y)g(giv)o(e)h(di\013eren)o
  686. X(t)f(results.)20 b(A)14 b(0)g(v)m(alue)i(sp)q(eci\014es)g(a)e(simple)69
  687. X955 y(line,)i(while)h(a)e(1)g(v)m(alue)h(will)h(dra)o(w)e(lines)h(with)g(a)f
  688. X(width)h(of)e(1)h(pixel.)-45 1049 y(The)h(n)o(um)o(b)q(er)f(of)g(linest)o
  689. X(yles)i(in)f Fk(XviG)e Fn(is)i(giv)o(en)g(b)o(y)f(:)122 1142
  690. Xy Ff(XviG_NR_OF_LINESTYLES)-45 1236 y Fn(whic)o(h)h(has)f(a)g(v)m(alue)i(of)d
  691. X(8.)-45 1332 y(Figure)h(1)f(sho)o(ws)g(the)g(8)g(di\013eren)o(t)h(linest)o
  692. X(yles)h(with)e(their)h(iden)o(ti\014cation)h(n)o(um)o(b)q(er)f(whic)o(h)g
  693. X(are)f(a)o(v)m(ailable)i(in)g Fk(XviG)p Fn(.)458 1391 y
  694. X 15984967 12235407 0 0 15984967 12235407 startTexFig
  695. X458 1391 a
  696. X%%BeginDocument: line.eps
  697. X/inch {72 mul} def
  698. X/picstr 31 string def
  699. X/plotimage
  700. X{243 186 1 [243 0 0 -186 0 186]
  701. X  {currentfile picstr readhexstring pop}
  702. X  image
  703. X} def
  704. Xgsave
  705. X243 186 scale
  706. Xplotimage
  707. Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  708. Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  709. Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  710. Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  711. Xfffffffff00000000000000666666666666666601980660198066c0c0c0c
  712. X0c0c0c0cfff7fffffffffffff6ffffffffffffffffffffffffffffedffff
  713. Xfffffffffefff7fffffffffffff6ffffffffffffffffffffffffffffedff
  714. Xfffffffffffefff7fffffffffffff7ffffffffffffff6fffffffffffffef
  715. Xfffffffffffffefff7fffffffffffff7ffffffffffffff6fffffffffffff
  716. Xeffffffffffffffefff7fffffffffffff6ffffffffffffffffffffffffff
  717. Xffedfffffffffffffffff7fffffffffffff6ffffffffffffffffffffffff
  718. Xffffedfffffffffffffffff7fffffffffffff7ffffffffffffff6fffffff
  719. Xffffffedfffffffffffffefff7fffffffffffff7ffffffffffffff6fffff
  720. Xfffffffffdfffffffffffffefff7fffffffffffff6ffffffffffffffefff
  721. Xfffffffffffdfffffffffffffefff7fffffffffffff6ffffffffffffffef
  722. Xffffffffffffedfffffffffffffefff7fffffffffffff7ffffffffffffff
  723. X6fffffffffffffeffffffffffffffefff7fffffffffffff7ffffffffffff
  724. Xff6ffffffffffffffffffffffffffffefff7fffffffffffff6ffffffffff
  725. Xffffeffffffffffffffdfffffffffffffffff7fffffffffffff6ffffffff
  726. Xffffffefffffffffffffedfffffffffffffffff7fffffffffffff7ffffff
  727. Xffffffff7fffffffffffffedfffffffffffffefff7fffffffffffff7ffff
  728. Xffffffffff7fffffffffffffedfffffffffffffefff7fffffffffffff6ff
  729. Xffffffffffffefffffffffffffedfffffffffffffefff7fffffffffffff6
  730. Xffffffffffffffefffffffffffffedfffffffffffffefff7ffffffffffff
  731. Xf7ffffffffffffff7fffffffffffffeffffffffffffffefff7ffffffffff
  732. Xfff7ffffffffffffff7fffffffffffffeffffffffffffffefff7ffffffff
  733. Xfffff6ffffffffffffffefffffffffffffedfffffffffffffffff7ffffff
  734. Xfffffff6ffffffffffffffeffffffffffffffdfffffffffffffffff7ffff
  735. Xfffffffff7ffffffffffffff6ffffffffffffffdfffffffffffffefff7ff
  736. Xfffffffffff7ffffffffffffff6fffffffffffffedfffffffffffffefff7
  737. Xfffffffffffff6ffffffffffffffefffffffffffffedfffffffffffffeff
  738. Xf7fffffffffffff6ffffffffffffffeffffffffffffffdfffffffffffffe
  739. Xfff7fffffffffffff7ffffffffffffff6fffffffffffffffffffffffffff
  740. Xfefff7fffffffffffff7ffffffffffffff6fffffffffffffefffffffffff
  741. Xfffefff7fffffffffffff6ffffffffffffffffffffffffffffedffffffff
  742. Xfffffffff7fffffffffffff6ffffffffffffffffffffffffffffedffffff
  743. Xfffffffffff7fffffffffffff7ffffffffffffff6fffffffffffffedffff
  744. Xfffffffffefff7fffffffffffff7ffffffffffffff6fffffffffffffedff
  745. Xfffffffffffefff7fffffffffffff6ffffffffffffffffffffffffffffed
  746. Xfffffffffffffefff7fffffffffffff6ffffffffffffffffffffffffffff
  747. Xedfffffffffffffefff7fffffffffffff7ffffffffffffff6fffffffffff
  748. Xffeffffffffffffffefff7fffffffffffff7ffffffffffffff6fffffffff
  749. Xfffffffffffffffffffefff7fffffffffffff6ffffffffffffffefffffff
  750. Xfffffffdfffffffffffffffff7fffffffffffff6ffffffffffffffefffff
  751. Xffffffffedfffffffffffffffff7fffffffffffff7ffffffffffffff6fff
  752. Xffffffffffedfffffffffffffefff7fffffffffffff7ffffffffffffff6f
  753. Xfffffffffffffdfffffffffffffefff7fffffffffffff6ffffffffffffff
  754. Xeffffffffffffffdfffffffffffffefff7fffffffffffff6ffffffffffff
  755. Xffefffffffffffffedfffffffffffffefff7fffffffffffff7ffffffffff
  756. Xffff7fffffffffffffeffffffffffffffefff7fffffffffffff7ffffffff
  757. Xffffff7fffffffffffffeffffffffffffffefff7fffffffffffff6ffffff
  758. Xffffffffefffffffffffffedfffffffffffffffff7fffffffffffff6ffff
  759. END_OF_FILE
  760.   if test 33567 -ne `wc -c <'version_1.1/man/xvig.ps.4'`; then
  761.     echo shar: \"'version_1.1/man/xvig.ps.4'\" unpacked with wrong size!
  762.   fi
  763.   # end of 'version_1.1/man/xvig.ps.4'
  764. fi
  765. if test -f 'version_1.1/src/ftext.c' -a "${1}" != "-c" ; then 
  766.   echo shar: Will not clobber existing file \"'version_1.1/src/ftext.c'\"
  767. else
  768.   echo shar: Extracting \"'version_1.1/src/ftext.c'\" \(6557 characters\)
  769.   sed "s/^X//" >'version_1.1/src/ftext.c' <<'END_OF_FILE'
  770. X/* File>>> ftext.c
  771. X--
  772. X-- %M% -- version %I% (IMEC)            last updated: %E%
  773. X--
  774. X-- Copyright (c) 1993
  775. X-- IMEC vzw
  776. X-- Kapeldreef 75
  777. X-- B-3001 LEUVEN
  778. X-- BELGIUM
  779. X--
  780. X-- Author   : A. Demaree
  781. X--
  782. X-- Date     : September 27, 1993
  783. X--
  784. X-- Function : Routines to draw text using fonts.
  785. X--
  786. X-- Comment  :
  787. X--
  788. X-- Review   :
  789. X--
  790. X*/
  791. X
  792. X
  793. X/*------------------------------------------------------------------------------
  794. X-- Global include files
  795. X------------------------------------------------------------------------------*/
  796. X
  797. X#include <stdlib.h>
  798. X#include <stdio.h>
  799. X#include <string.h>
  800. X#include <X11/Xlib.h>
  801. X
  802. X/*------------------------------------------------------------------------------
  803. X-- Local include files
  804. X------------------------------------------------------------------------------*/
  805. X
  806. X#include "xviglocal.h"
  807. X
  808. X/*------------------------------------------------------------------------------
  809. X-- Local type definitions
  810. X------------------------------------------------------------------------------*/
  811. X
  812. Xtypedef struct FontItem aFontItem, *FontItem;
  813. X
  814. Xstruct FontItem {
  815. X  char *name;
  816. X  XFontStruct *font_struct;
  817. X  int status;               /* (-1 = error) (0 = not yet loaded) (1 = ok) */
  818. X};
  819. X
  820. X/*------------------------------------------------------------------------------
  821. X-- Static variable declarations
  822. X------------------------------------------------------------------------------*/
  823. X
  824. Xstatic FontItem fontList = (FontItem) NULL;
  825. Xstatic int nr_of_fonts = 0;
  826. Xstatic int current_font = 0;
  827. Xstatic char *def_fontlist[5] = {
  828. X              "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1",
  829. X              "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1",
  830. X              "-adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1",
  831. X              "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1",
  832. X              "-adobe-courier-medium-r-normal--24-240-75-75-m-150-iso8859-1" };
  833. X
  834. X/*------------------------------------------------------------------------------
  835. X-- Local function declarations
  836. X------------------------------------------------------------------------------*/
  837. X
  838. Xstatic void get_fontnames(void);
  839. X
  840. X/*------------------------------------------------------------------------------
  841. X--
  842. X--
  843. X--
  844. X------------------------------------------------------------------------------*/
  845. X
  846. Xint XviG_SetFont(int nr)
  847. X{
  848. X  if (!fontList)
  849. X    get_fontnames();
  850. X
  851. X  if (nr_of_fonts == 0)
  852. X  {
  853. X    fprintf(stderr, "ERROR : No fontnames defined to select.\n");
  854. X    current_font = 0;
  855. X    return 0;
  856. X  }
  857. X
  858. X  if ((nr < 1) || (nr > nr_of_fonts))
  859. X  {
  860. X    printf("WARNING : Invalid font number %d, using font number %d.\n",
  861. X           nr, nr_of_fonts);
  862. X    current_font = nr_of_fonts;
  863. X  }
  864. X  else
  865. X    current_font = nr;
  866. X
  867. X  nr = current_font - 1;
  868. X
  869. X  if (fontList[nr].status == 1)
  870. X  {
  871. X    XSetFont(XviG_display, XviG_gc, fontList[nr].font_struct->fid);
  872. X    return 1;
  873. X  }
  874. X
  875. X  if (fontList[nr].status == 0)
  876. X  {
  877. X    if (fontList[nr].font_struct =
  878. X                           XLoadQueryFont(XviG_display, fontList[nr].name))
  879. X    {
  880. X      fontList[nr].status = 1;
  881. X      XSetFont(XviG_display, XviG_gc, fontList[nr].font_struct->fid);
  882. X      return 1;
  883. X    }
  884. X
  885. X    fprintf(stderr, "ERROR : Cannot load font '%s'.\n", fontList[nr].name);
  886. X    fontList[nr].status = -1;
  887. X    current_font = 0;
  888. X    return 0;
  889. X  }
  890. X
  891. X  if (fontList[nr].status == -1)
  892. X  {
  893. X    fprintf(stderr, "ERROR : Cannot select font '%s'.\n", fontList[nr].name);
  894. X    current_font = 0;
  895. X    return 0;
  896. X  }
  897. X
  898. X  current_font = 0;
  899. X  return 0;
  900. X}
  901. X
  902. X/*------------------------------------------------------------------------------
  903. X--
  904. X--
  905. X--
  906. X------------------------------------------------------------------------------*/
  907. X
  908. Xstatic void get_fontnames(void)
  909. X{
  910. X  int i;
  911. X
  912. X  if ((i = XviG_GetRMMaxFonts()) == 0)
  913. X  {
  914. X    fontList = (FontItem) malloc(5 * sizeof(aFontItem));
  915. X    fontList[0].status = fontList[1].status = fontList[2].status
  916. X                       = fontList[3].status = fontList[4].status
  917. X                       = 0;
  918. X    fontList[0].name = def_fontlist[0];
  919. X    fontList[1].name = def_fontlist[1];
  920. X    fontList[2].name = def_fontlist[2];
  921. X    fontList[3].name = def_fontlist[3];
  922. X    fontList[4].name = def_fontlist[4];
  923. X    nr_of_fonts = 5;
  924. X  }
  925. X  else
  926. X  {
  927. X    fontList = (FontItem) malloc(i * sizeof(aFontItem));
  928. X    nr_of_fonts = i;
  929. X    for (i = 0; i < nr_of_fonts; i++)
  930. X    {
  931. X      fontList[i].status = 0;
  932. X      if (!(fontList[i].name = XviG_GetRMFontName(i+1)))
  933. X      {
  934. X        printf("WARNING : Maxfonts = %d, but only %d fontnames defined.\n",
  935. X               nr_of_fonts, i);
  936. X        nr_of_fonts = i;
  937. X      }
  938. X    }
  939. X  }
  940. X}
  941. X
  942. X/*------------------------------------------------------------------------------
  943. X--
  944. X--
  945. X--
  946. X------------------------------------------------------------------------------*/
  947. X
  948. Xvoid XviG_FontText(char *contents,
  949. X                   int x,
  950. X                   int y)
  951. X{
  952. X  if (current_font == 0)
  953. X  {
  954. X    fprintf(stderr, "ERROR : No font selected.\n");
  955. X    return;
  956. X  }
  957. X
  958. X  XDrawString(XviG_display, XviG_window, XviG_gc,
  959. X              x, y, contents, (int) strlen(contents));
  960. X  XDrawString(XviG_display, XviG_pixmap, XviG_gc,
  961. X              x, y, contents, (int) strlen(contents));
  962. X}
  963. X
  964. X/*------------------------------------------------------------------------------
  965. X--
  966. X--
  967. X--
  968. X------------------------------------------------------------------------------*/
  969. X
  970. Xvoid XviG_FontTextSize(char *contents,
  971. X                       int *x_offset,
  972. X                       int *y_offset,
  973. X                       unsigned int *width,
  974. X                       unsigned int *height)
  975. X{
  976. X  int dir_rtn, ascent_rtn, descent_rtn;
  977. X  XCharStruct overall_rtn;
  978. X
  979. X  if (current_font == 0)
  980. X  {
  981. X    fprintf(stderr, "ERROR : No font selected.\n");
  982. X    *x_offset = *y_offset = 0;
  983. X    *width = *height = 0;
  984. X    return;
  985. X  }
  986. X
  987. X  XTextExtents(fontList[current_font-1].font_struct,
  988. X               contents, (int) strlen(contents),
  989. X               &dir_rtn, &ascent_rtn, &descent_rtn, &overall_rtn);
  990. X
  991. X  *x_offset = overall_rtn.lbearing;
  992. X  *y_offset = overall_rtn.descent;
  993. X  *width = overall_rtn.rbearing - overall_rtn.lbearing;
  994. X  *height = overall_rtn.ascent + overall_rtn.descent;
  995. X}
  996. X
  997. X/*------------------------------------------------------------------------------
  998. X--
  999. X--
  1000. X--
  1001. X------------------------------------------------------------------------------*/
  1002. X
  1003. Xvoid XviG_CleanupFonts(void)
  1004. X{
  1005. X  int i;
  1006. X
  1007. X  if (fontList)
  1008. X  {
  1009. X    for (i = 0; i < nr_of_fonts; i++)
  1010. X    {
  1011. X      if (fontList[i].status == 1)
  1012. X        XFreeFont(XviG_display, fontList[i].font_struct);
  1013. X    }
  1014. X
  1015. X    free(fontList);
  1016. X
  1017. X    fontList = (FontItem) NULL;
  1018. X    nr_of_fonts = 0;
  1019. X    current_font = 0;
  1020. X  }
  1021. X}
  1022. END_OF_FILE
  1023.   if test 6557 -ne `wc -c <'version_1.1/src/ftext.c'`; then
  1024.     echo shar: \"'version_1.1/src/ftext.c'\" unpacked with wrong size!
  1025.   fi
  1026.   # end of 'version_1.1/src/ftext.c'
  1027. fi
  1028. if test -f 'version_1.1/src/init.c' -a "${1}" != "-c" ; then 
  1029.   echo shar: Will not clobber existing file \"'version_1.1/src/init.c'\"
  1030. else
  1031.   echo shar: Extracting \"'version_1.1/src/init.c'\" \(5313 characters\)
  1032.   sed "s/^X//" >'version_1.1/src/init.c' <<'END_OF_FILE'
  1033. X/* File>>> init.c
  1034. X--
  1035. X-- %M% -- version %I% (IMEC)            last updated: %E%
  1036. X--
  1037. X-- Copyright (c) 1993
  1038. X-- IMEC vzw
  1039. X-- Kapeldreef 75
  1040. X-- B-3001 LEUVEN
  1041. X-- BELGIUM
  1042. X--
  1043. X-- Author   : A. Demaree
  1044. X--
  1045. X-- Date     : February 1, 1993
  1046. X--
  1047. X-- Function :
  1048. X--
  1049. X-- Comment  :
  1050. X--
  1051. X-- Review   :
  1052. X--
  1053. X*/
  1054. X
  1055. X
  1056. X/*------------------------------------------------------------------------------
  1057. X-- Global include files
  1058. X------------------------------------------------------------------------------*/
  1059. X
  1060. X#include <stdlib.h>
  1061. X#include <stdio.h>
  1062. X#include <string.h>
  1063. X#include <sys/file.h>
  1064. X#include <X11/Xlib.h>
  1065. X
  1066. X/*------------------------------------------------------------------------------
  1067. X-- Local include files
  1068. X------------------------------------------------------------------------------*/
  1069. X
  1070. X#define MAIN
  1071. X#include "xviglocal.h"
  1072. X#undef MAIN
  1073. X
  1074. X/*------------------------------------------------------------------------------
  1075. X-- Static variable declarations
  1076. X------------------------------------------------------------------------------*/
  1077. X
  1078. X
  1079. X/*------------------------------------------------------------------------------
  1080. X-- Local function declarations
  1081. X------------------------------------------------------------------------------*/
  1082. X
  1083. X
  1084. X/*------------------------------------------------------------------------------
  1085. X--
  1086. X--
  1087. X--
  1088. X------------------------------------------------------------------------------*/
  1089. X
  1090. Xint XviG_Init(char *classname,
  1091. X              int color_array[][3],
  1092. X              int nr_of_colors)
  1093. X{
  1094. X  XGCValues xgcv;
  1095. X
  1096. X  printf("\n>>> XviG Graphics Package   Copyright Imec (c) 1993 <<<\n\n");
  1097. X
  1098. X  /*
  1099. X  -- Get the environment variable 'XVIG' and check it
  1100. X  */
  1101. X
  1102. X  if (!(XviG_pathname = getenv("XVIG")))
  1103. X  {
  1104. X    fprintf(stderr,
  1105. X            "ERROR : Environment variable 'XVIG' has not been defined.\n");
  1106. X    return 0;
  1107. X  }
  1108. X
  1109. X  if (access(XviG_pathname, F_OK) == -1)
  1110. X  {
  1111. X    fprintf(stderr, "ERROR : File '%s' not found.\n", XviG_pathname);
  1112. X    return 0;
  1113. X  }
  1114. X
  1115. X  if (access(XviG_pathname, X_OK) == -1)
  1116. X  {
  1117. X    fprintf(stderr, "ERROR : File '%s' is not executable.\n", XviG_pathname);
  1118. X    return 0;
  1119. X  }
  1120. X
  1121. X  /*
  1122. X  -- Open the display
  1123. X  */
  1124. X
  1125. X  if (!(XviG_display = XOpenDisplay(NULL)))
  1126. X  {
  1127. X    char *dname;
  1128. X
  1129. X    if (!(dname = getenv("DISPLAY")))
  1130. X      fprintf(stderr,
  1131. X              "ERROR : Environment variable 'DISPLAY' has not been defined.\n");
  1132. X    else
  1133. X      fprintf(stderr,
  1134. X              "ERROR : Cannot open display '%s'.\n", dname);
  1135. X
  1136. X    return 0;
  1137. X  }
  1138. X
  1139. X  XviG_screen_nr = DefaultScreen(XviG_display);
  1140. X
  1141. X  /*
  1142. X  -- Create a dummy window
  1143. X  */
  1144. X
  1145. X  if (!(XviG_dummy_window = XCreateSimpleWindow(XviG_display,
  1146. X                                   RootWindow(XviG_display, XviG_screen_nr),
  1147. X                                   0, 0, 10, 10, 0,
  1148. X                                   WhitePixel(XviG_display, XviG_screen_nr),
  1149. X                                   BlackPixel(XviG_display, XviG_screen_nr))))
  1150. X  {
  1151. X    fprintf(stderr, "ERROR : Cannot create dummy window.\n");
  1152. X    XCloseDisplay(XviG_display);
  1153. X
  1154. X    return 0;
  1155. X  }
  1156. X
  1157. X  XSelectInput(XviG_display, XviG_dummy_window, KeyPressMask | ButtonPressMask);
  1158. X
  1159. X  /*
  1160. X  -- About the Graphical Context, create a separate one for drawing simple
  1161. X  -- objects and for drawing filled objects to avoid interference
  1162. X  */
  1163. X
  1164. X  xgcv.graphics_exposures = False;
  1165. X  XviG_gc = XCreateGC(XviG_display, XviG_dummy_window,
  1166. X                      GCGraphicsExposures, &xgcv);
  1167. X  XviG_gc_fill = XCreateGC(XviG_display, XviG_dummy_window,
  1168. X                           GCGraphicsExposures, &xgcv);
  1169. X
  1170. X  /*
  1171. X  -- Create the colors and the fillpatterns
  1172. X  */
  1173. X
  1174. X  XviG_CreateColors(color_array, nr_of_colors);
  1175. X  XviG_CreateFillpatterns();
  1176. X
  1177. X  /*
  1178. X  -- Create the Atoms (unique numbers) for the ClientMessage events
  1179. X  */
  1180. X
  1181. X  XviG_MESSAGE_INIT =
  1182. X                  XInternAtom(XviG_display, MESSAGE_INIT, False);
  1183. X  XviG_MESSAGE_KEY =
  1184. X                  XInternAtom(XviG_display, MESSAGE_KEY, False);
  1185. X  XviG_MESSAGE_BUTTON =
  1186. X                  XInternAtom(XviG_display, MESSAGE_BUTTON, False);
  1187. X  XviG_MESSAGE_KEY_BUTTON =
  1188. X                  XInternAtom(XviG_display, MESSAGE_KEY_BUTTON, False);
  1189. X  XviG_MESSAGE_SIZE =
  1190. X                  XInternAtom(XviG_display, MESSAGE_SIZE, False);
  1191. X  XviG_MESSAGE_SENSEKBD_ON =
  1192. X                  XInternAtom(XviG_display, MESSAGE_SENSEKBD_ON, False);
  1193. X  XviG_MESSAGE_SENSEKBD_OFF =
  1194. X                  XInternAtom(XviG_display, MESSAGE_SENSEKBD_OFF, False);
  1195. X  XviG_MESSAGE_SENSEKBD =
  1196. X                  XInternAtom(XviG_display, MESSAGE_SENSEKBD, False);
  1197. X  XviG_MESSAGE_CURSOR =
  1198. X                  XInternAtom(XviG_display, MESSAGE_CURSOR, False);
  1199. X  XviG_MESSAGE_QUIT =
  1200. X                  XInternAtom(XviG_display, MESSAGE_QUIT, False);
  1201. X
  1202. X  /*
  1203. X  -- About the Resource Manager
  1204. X  */
  1205. X
  1206. X  if (classname)
  1207. X  {
  1208. X    XviG_class = STRNEW(classname);
  1209. X    XviG_GetRMDatabase();
  1210. X  }
  1211. X  else
  1212. X    XviG_class = (char *) NULL;
  1213. X
  1214. X  XviG_cursor_mode = False;
  1215. X
  1216. X  return 1;
  1217. X}
  1218. X
  1219. X/*------------------------------------------------------------------------------
  1220. X--
  1221. X--
  1222. X--
  1223. X------------------------------------------------------------------------------*/
  1224. X
  1225. Xvoid XviG_Exit(void)
  1226. X{
  1227. X  XviG_DeleteRMDatabase();
  1228. X
  1229. X  XviG_CleanupWindows();
  1230. X  XviG_CleanupCursors();
  1231. X  XviG_CleanupFillpatterns();
  1232. X  XviG_CleanupFonts();
  1233. X
  1234. X  XFreeGC(XviG_display, XviG_gc);
  1235. X  XFreeGC(XviG_display, XviG_gc_fill);
  1236. X
  1237. X  XDestroyWindow(XviG_display, XviG_dummy_window);
  1238. X  XCloseDisplay(XviG_display);
  1239. X}
  1240. END_OF_FILE
  1241.   if test 5313 -ne `wc -c <'version_1.1/src/init.c'`; then
  1242.     echo shar: \"'version_1.1/src/init.c'\" unpacked with wrong size!
  1243.   fi
  1244.   # end of 'version_1.1/src/init.c'
  1245. fi
  1246. echo shar: End of archive 6 \(of 10\).
  1247. cp /dev/null ark6isdone
  1248. MISSING=""
  1249. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1250.     if test ! -f ark${I}isdone ; then
  1251.     MISSING="${MISSING} ${I}"
  1252.     fi
  1253. done
  1254. if test "${MISSING}" = "" ; then
  1255.     echo You have unpacked all 10 archives.
  1256.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1257.     echo "Merging xvig.ps parts... "
  1258.     cat version_1.1/man/xvig.ps.? > version_1.1/man/xvig.ps
  1259.     rm version_1.1/man/xvig.ps.?
  1260.     echo "Done."
  1261. else
  1262.     echo You still must unpack the following archives:
  1263.     echo "        " ${MISSING}
  1264. fi
  1265. exit 0
  1266. exit 0 # Just in case...
  1267. -- 
  1268.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  1269. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  1270.  "It's intuitively obvious to the |
  1271.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1272.