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

  1. Newsgroups: comp.sources.x
  2. From: demaree@imec.be (Antoon Demaree)
  3. Subject: v21i052:  xvig - XviG Graphics Library, Part05/10
  4. Message-ID: <1993Nov23.172801.17161@sparky.sterling.com>
  5. X-Md4-Signature: 151e0e61504f44c4ab43176fcac6c0eb
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Tue, 23 Nov 1993 17:28:01 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: demaree@imec.be (Antoon Demaree)
  12. Posting-number: Volume 21, Issue 52
  13. Archive-name: xvig/part05
  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/examples/cursortest.c
  21. #   version_1.1/man/xvig.ps.8 version_1.1/src/draw.c
  22. #   version_1.1/src/pattern.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 5 (of 10)."'
  27. if test -f 'version_1.1/examples/cursortest.c' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'version_1.1/examples/cursortest.c'\"
  29. else
  30.   echo shar: Extracting \"'version_1.1/examples/cursortest.c'\" \(1958 characters\)
  31.   sed "s/^X//" >'version_1.1/examples/cursortest.c' <<'END_OF_FILE'
  32. X#include <stdlib.h>
  33. X#include <stdio.h>
  34. X#include "xvig.h"
  35. X
  36. X#define COLOR_BLACK   0
  37. X#define COLOR_WHITE   1
  38. X#define COLOR_RED     2
  39. X#define COLOR_GREEN   3
  40. X#define COLOR_BLUE    4
  41. X#define NUMBER_OF_COLORS  5
  42. X
  43. Xstatic int colmap[NUMBER_OF_COLORS][3] = { {   0,   0,   0 },     /* Black */
  44. X                                           { 255, 255, 255 },     /* White */
  45. X                                           { 255,   0,   0 },     /* Red   */
  46. X                                           {   0, 255,   0 },     /* Green */
  47. X                                           {   0,   0, 255 } };   /* Blue  */
  48. X
  49. Xmain()
  50. X{
  51. X  unsigned int ww = 600, hh = 600;
  52. X  int x1, y1, x2, y2, chr;
  53. X  int arrow_coords[] = { 0,40,20,20,10,10,50,0,40,40,30,30,10,50 };
  54. X  long cursor;
  55. X
  56. X  /* -- Initialize -- */
  57. X
  58. X  if (!XviG_Init("CursorTest", colmap, NUMBER_OF_COLORS))
  59. X    exit(1);
  60. X
  61. X  /* -- Create a BIG red arrow cursor -- */
  62. X
  63. X  XviG_OpenCursor(51, 51, 50, 0);
  64. X  XviG_SetColor(COLOR_RED);
  65. X  XviG_SetFillStyle(0);
  66. X  XviG_FillPolygon(arrow_coords, 7);
  67. X  XviG_SetColor(COLOR_WHITE);
  68. X  XviG_SetLineStyle(0, 0);
  69. X  XviG_DrawPolygon(arrow_coords, 7);
  70. X  cursor = XviG_CloseCursor();
  71. X
  72. X  /* -- Open a window and set the new arrow cursor -- */
  73. X
  74. X  if (!XviG_OpenWindow("Cursor", -1, -1, &ww, &hh))
  75. X  {
  76. X    XviG_Exit();
  77. X    exit(1);
  78. X  }
  79. X
  80. X  XviG_SetCursor(cursor);
  81. X
  82. X  /* -- Draw a rectangle between two indicated cursor position -- */
  83. X
  84. X  chr = XviG_GetCursor(XviG_BUTTON, &x1, &y1);
  85. X  chr = XviG_GetCursor(XviG_BUTTON, &x2, &y2);
  86. X
  87. X  XviG_SetColor(COLOR_BLUE);
  88. X  XviG_SetFillStyle(17);
  89. X  XviG_FillRectangle(x1, y1, x2, y2);
  90. X  XviG_SetColor(COLOR_GREEN);
  91. X  XviG_SetLineStyle(0, 5);
  92. X  XviG_DrawRectangle(x1, y1, x2, y2);
  93. X
  94. X  /* -- Hit any key to exit -- */
  95. X
  96. X  XviG_SetCursor(XviG_CURSOR_ARROW);
  97. X
  98. X  chr = XviG_GetCursor(XviG_KEY, &x1, &y1);
  99. X
  100. X  /* -- Cleanup and exit -- */
  101. X
  102. X  XviG_DeleteCursor(cursor);
  103. X
  104. X  if (!XviG_CloseWindow("Cursor"))
  105. X  {
  106. X    XviG_Exit();
  107. X    exit(1);
  108. X  }
  109. X
  110. X  XviG_Exit();
  111. X
  112. X  return 0;
  113. X}
  114. END_OF_FILE
  115.   if test 1958 -ne `wc -c <'version_1.1/examples/cursortest.c'`; then
  116.     echo shar: \"'version_1.1/examples/cursortest.c'\" unpacked with wrong size!
  117.   fi
  118.   # end of 'version_1.1/examples/cursortest.c'
  119. fi
  120. if test -f 'version_1.1/man/xvig.ps.8' -a "${1}" != "-c" ; then 
  121.   echo shar: Will not clobber existing file \"'version_1.1/man/xvig.ps.8'\"
  122. else
  123.   echo shar: Extracting \"'version_1.1/man/xvig.ps.8'\" \(33805 characters\)
  124.   sed "s/^X//" >'version_1.1/man/xvig.ps.8' <<'END_OF_FILE'
  125. X2740 y(ab)q(out)12 b(the)h(resource)f(manager)g(for)g(more)g(info)h(on)f(ho)o
  126. X(w)g(to)g(do)g(that.)18 b(The)13 b(X)f(Windo)o(w)h(system)f(command)g
  127. XFh(xlsfonts)-45 2796 y Fn(giv)o(es)k(a)e(list)i(of)f(X)g(fon)o(ts)g(that)f
  128. X(are)h(a)o(v)m(ailable)i(on)e(y)o(our)g(system.)932 2932 y(13)p
  129. Xeop
  130. X%%Page: 14 15
  131. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  132. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fn(Before)g(the)h(text)e
  133. X(can)i(b)q(e)g(dra)o(wn,)e(a)h(fon)o(t)f(m)o(ust)h(ha)o(v)o(e)g(b)q(een)h
  134. X(successfully)h(selected.)-45 172 y(The)f(color)f(of)g(the)g(text)g(can)g(b)q
  135. X(e)h(set)f(with)g(the)h Ff(XviG)p 882 172 15 2 v 16 w(SetColor)e
  136. XFn(function)i(call.)-45 229 y(As)f(opp)q(osed)h(to)f(text)f(comp)q(osed)i(of)
  137. Xf(p)q(olylines,)i(fon)o(t)d(text)h(can)g(only)h(b)q(e)g(dra)o(wn)f(in)h
  138. X(horizon)o(tal)f(direction.)11 335 y(1.)22 b Fl(Setting)d(a)e(F)l(on)o(t)69
  139. X410 y Fn(T)l(o)e(select)h(a)f(fon)o(t,)f(use)h(the)g(follo)o(wing)h
  140. X(function.)69 506 y(Syn)o(tax)f(:)140 618 y Ff(int)24 b(XviG_SetFont\(int)e
  141. X(nr\))69 731 y Fn(Input)16 b(parameter)e(:)123 825 y Fm(\017)23
  142. Xb Ff(nr)15 b Fn(:)169 881 y(The)g(n)o(um)o(b)q(er)h(of)f(the)g(fon)o(t)f(to)h
  143. X(select)h(from)e(the)i(ordered)f(list)h(of)f(fon)o(ts.)69 975
  144. Xy(Return)h(v)m(alue)g(:)123 1069 y Fm(\017)23 b Ff(1)15 b Fn(if)g(the)h(fon)o
  145. X(t)e(has)h(b)q(een)i(selected.)123 1142 y Fm(\017)23 b Ff(0)15
  146. Xb Fn(if)g(the)h(system)f(w)o(as)f(unable)i(to)f(load)g(and/or)g(select)h(the)
  147. Xf(fon)o(t.)11 1236 y(2.)22 b Fl(Dra)o(wing)17 b(T)l(ext)69
  148. X1311 y Fn(T)l(o)e(dra)o(w)f(the)i(text)e(string)h(with)h(the)f(curren)o(tly)h
  149. X(selected)g(fon)o(t,)e(use)i(the)f(follo)o(wing)h(function.)69
  150. X1406 y(Syn)o(tax)f(:)140 1519 y Ff(void)24 b(XviG_FontText\(char)d
  151. X(*contents,)594 1575 y(int)i(x,)594 1632 y(int)g(y\))69 1744
  152. Xy Fn(Input)16 b(parameters)e(:)123 1838 y Fm(\017)23 b Ff(contents)14
  153. Xb Fn(:)169 1894 y(A)h(non-NULL)g(string)g(con)o(taining)h(the)e(text)g(to)g
  154. X(b)q(e)i(dra)o(wn.)j(An)o(y)c(c)o(haracter)f(a)o(v)m(ailable)i(in)f(the)g
  155. X(fon)o(t)f(is)169 1951 y(v)m(alid.)21 b(Other)16 b(c)o(haracters)e(are)h(not)
  156. Xg(prin)o(ted.)123 2024 y Fm(\017)23 b Ff(x)15 b Fn(and)g Ff(y)g
  157. XFn(:)169 2080 y(The)e(co)q(ordinate)g(of)f(the)h(p)q(oin)o(t)h(where)f(the)g
  158. X(text)f(string)h(is)g(to)f(b)q(e)i(started.)k(The)13 b(text)f(string)h(is)g
  159. X(b)q(ottom)169 2137 y(left)i(adjusted)h(to)e(this)i(co)q(ordinate.)11
  160. X2231 y(3.)22 b Fl(The)c(Size)g(of)f(a)h(T)l(ext)f(String)69
  161. X2306 y Fn(T)l(o)d(get)g(a)h(measure)f(of)h(the)f(size)i(of)e(the)h(text)f
  162. X(string)h(with)g(the)f(curren)o(tly)i(selected)f(fon)o(t,)f(use)h(the)g
  163. X(follo)o(wing)69 2362 y(function.)21 b(Notice)15 b(that)g(an)g(x-)g(and)g
  164. X(y-o\013set)g(are)g(p)q(ossible.)69 2458 y(Syn)o(tax)g(:)140
  165. X2570 y Ff(void)24 b(XviG_FontTextSize\(char)d(*contents,)689
  166. X2627 y(int)j(*x_offset,)689 2683 y(int)g(*y_offset,)689 2740
  167. Xy(unsigned)f(int)g(*width,)689 2796 y(unsigned)g(int)g(*height\))932
  168. X2932 y Fn(14)p eop
  169. X%%Page: 15 16
  170. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  171. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v 69 116 a Fn(Input)h(parameter)e(:)
  172. X123 210 y Fm(\017)23 b Ff(contents)14 b Fn(:)169 266 y(A)h(non-NULL)i(string)
  173. Xe(con)o(taining)h(the)f(text)g(to)f(get)h(the)g(size)h(of.)69
  174. X360 y(Output)f(parameters)g(:)123 454 y Fm(\017)23 b Ff(x)p
  175. X196 454 15 2 v 17 w(offset)14 b Fn(and)i Ff(y)p 484 454 V 17
  176. Xw(offset)e Fn(:)169 510 y(The)h(o\013set)f(of)h(the)g(string)h(in)g(X-)f(and)
  177. Xg(Y-direction.)123 583 y Fm(\017)23 b Ff(width)14 b Fn(and)i
  178. XFf(height)e Fn(:)169 640 y(The)h(o)o(v)o(erall)h(width)f(and)h(heigh)o(t)f
  179. X(of)g(the)g(string.)69 734 y(Th)o(us,)j(for)f(a)g(string)h(dra)o(wn)f(at)g(p)
  180. Xq(osition)i Ff([x,y])p Fn(,)e(the)h(b)q(ounding)h(b)q(o)o(x)f(of)f(that)g
  181. X(string)h(\(i.e.)27 b(the)18 b(smallest)69 790 y(rectangle)13
  182. Xb(that)f(encloses)i(the)e(shap)q(e)i(of)e(all)i(c)o(haracters\))d(describ)q
  183. X(ed)k(in)f(terms)e(of)g(these)h(output)f(parameters)69 846
  184. Xy(is)k(de\014ned)g(b)o(y)f(the)g(follo)o(wing)h(lo)o(w)o(er)f(left)h(and)f
  185. X(upp)q(er)h(righ)o(t)f(co)q(ordinates)h(:)188 959 y Ff([x)24
  186. Xb(+)f(x_offset,)g(y)h(+)g(y_offset])188 1015 y([x)g(+)f(x_offset)g(+)h
  187. X(width,)f(y)h(+)f(y_offset)g(-)h(height])-45 1137 y Fg(3.7)56
  188. Xb(Flushing)18 b(the)h(Graphics)f(Output)-45 1223 y Fn(Due)e(to)f(the)h(async)
  189. Xo(hronous)f(nature)h(of)f(the)h(X)g(Windo)o(w)f(system,)g(graphics)i(calls)f
  190. X(are)g(bu\013ered)g(un)o(til)h(the)f(bu\013er)-45 1279 y(is)f(full)g(or)f(un)
  191. Xo(til)h(the)f(user)g(program)f(asks)g(for)h(the)g(bu\013er)g(to)f(b)q(e)i
  192. X(\015ushed.)21 b(The)14 b(latter)f(is)i(done)f(with)h(the)f(follo)o(wing)-45
  193. X1336 y(function)i(call.)21 b(It)15 b(\015ushes)h(the)g(output)f(to)f(all)i
  194. X(op)q(en)g(windo)o(ws.)-45 1431 y(Syn)o(tax)f(:)27 1525 y Ff(void)23
  195. Xb(XviG_Flush\(void\))-45 1647 y Fg(3.8)56 b(Sensing)18 b(the)g(Keyb)r(oard)
  196. X-45 1733 y Fn(The)d Fk(XviG)e Fn(pac)o(k)m(age)h(allo)o(ws)h(to)e(ask)h(if)h
  197. X(the)f(k)o(eyb)q(oard)g(has)g(b)q(een)h(touc)o(hed.)20 b(This)15
  198. Xb(can)f(b)q(e)h(used)g(e.g.)k(to)13 b(in)o(terrupt)-45 1789
  199. Xy(a)i(large)g(sequence)i(of)d(dra)o(w)h(commands.)-45 1846
  200. Xy(The)j(w)o(a)o(y)e(this)i(is)f(done)h(is)g(b)o(y)f(setting)g(a)g(sense)h(c)o
  201. X(haracter)e(\(a)h(prin)o(table)h(c)o(haracter)f(on)g(the)h(k)o(eyb)q(oard\).)
  202. X25 b(When)-45 1902 y(this)16 b(c)o(haracter)f(is)h(touc)o(hed,)g(it)g(is)g
  203. X(remem)o(b)q(ered)g(b)o(y)g(the)f Fk(XviG)g Fn(system)h(un)o(til)g(the)g
  204. X(user)g(program)e(asks)h(whether)-45 1959 y(there)g(has)h(actually)f(b)q(een)
  205. Xi(a)e('sense)g(k)o(eyb)q(oard')g(since)h(the)f(sense)h(c)o(haracter)f(w)o(as)
  206. Xf(set.)-45 2015 y(Setting)g(a)f(sense)h(c)o(haracter)f(and)h(asking)g(for)f
  207. X(a)g('sense)h(k)o(eyb)q(oard')f(is)h(related)g(to)f(the)h(curren)o(tly)g
  208. X(selected)h(windo)o(w.)-45 2135 y Fl(3.8.1)52 b(Setting)19
  209. Xb(a)e(Keyb)q(oard)h(Sense)f(Character)-45 2221 y Fn(Syn)o(tax)e(:)27
  210. X2315 y Ff(void)23 b(XviG_SetSenseKbd\(int)e(sense_char\))-45
  211. X2409 y Fn(Input)16 b(parameter)f(:)23 2502 y Fm(\017)23 b Ff(sense)p
  212. X192 2502 V 16 w(char)15 b Fn(:)69 2559 y(When)20 b(a)f(prin)o(table)h(c)o
  213. X(haracter)f(is)h(sp)q(eci\014ed,)i(the)e('sense)f(k)o(eyb)q(oard')g(mec)o
  214. X(hanism)h(is)g(activ)m(ated)g(and)f(the)69 2615 y(sense)c(c)o(haracter)g(is)h
  215. X(set)f(to)f(the)h(sp)q(eci\014ed)j(one.)69 2672 y(When)d(0)g(is)h(sp)q
  216. X(eci\014ed,)h(the)e('sense)h(k)o(eyb)q(oard')e(mec)o(hanism)i(is)g(disabled.)
  217. X932 2932 y(15)p eop
  218. X%%Page: 16 17
  219. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  220. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.8.2)52
  221. Xb(Asking)17 b(for)g(a)h('Sense)e(Keyb)q(oard')-45 202 y Fn(Syn)o(tax)f(:)27
  222. X296 y Ff(int)23 b(XviG_SenseKbd\(void\))-45 389 y Fn(Return)16
  223. Xb(v)m(alue)g(:)23 483 y Fm(\017)23 b Ff(1)15 b Fn(if)g(the)h(sense)f(c)o
  224. X(haracter)g(on)g(the)g(k)o(eyb)q(oard)g(has)g(b)q(een)i(touc)o(hed.)23
  225. X577 y Fm(\017)23 b Ff(0)15 b Fn(if)g(the)h(sense)f(c)o(haracter)g(has)g(not)g
  226. X(b)q(een)h(touc)o(hed.)-45 699 y Fg(3.9)56 b(Ab)r(out)18 b(the)h(Cursor)-45
  227. X784 y Fn(With)d(the)f Fk(XviG)f Fn(pac)o(k)m(age,)h(three)g(t)o(yp)q(es)h(of)
  228. Xe(cursors)h(can)h(b)q(e)f(used)h(:)23 878 y Fm(\017)23 b Fn(a)15
  229. Xb(standard)f(X)i(blac)o(k)f(&)h(white)g(arro)o(w)d(cursor.)23
  230. X972 y Fm(\017)23 b Fn(a)15 b(crosshair)g(cursor)g(with)g(an)o(y)g(of)g(the)g
  231. X(de\014ned)i(colors.)23 1066 y Fm(\017)23 b Fn(a)15 b(user)g(de\014ned)i
  232. X(cursor.)-45 1160 y(A)g(user)g(cursor)f(ma)o(y)g(con)o(tain)h(an)o(y)f(of)g
  233. X(the)h(dra)o(w)f(ob)s(jects)g(as)g(describ)q(ed)j(in)e(section)g(3.5,)f(with)
  234. Xh(an)o(y)f(of)h(the)f(dra)o(w)-45 1216 y(attributes)f(as)g(describ)q(ed)i(in)
  235. Xf(section)g(3.4.)-45 1273 y(An)g(arbitrary)e(n)o(um)o(b)q(er)i(of)f(user)g
  236. X(cursors)g(can)g(b)q(e)h(de\014ned)g(sim)o(ultaneously)l(.)-45
  237. X1329 y(Notice)h(that)e(the)i(creation)f(of)g(a)g(user)g(cursor)g(is)h(not)f
  238. X(related)g(to)g(a)g(windo)o(w.)23 b(The)16 b(cursor)g(can)h(b)q(e)g(set)f
  239. X(and)g(used)-45 1386 y(in)g(an)o(y)f Fk(XviG)g Fn(windo)o(w.)-45
  240. X1506 y Fl(3.9.1)52 b(Creating)18 b(a)g(New)f(User)g(Cursor)-45
  241. X1591 y Fn(The)i(follo)o(wing)g(function)g(creates)g(the)f(pixmap)h(for)f(a)g
  242. X(new)h(user)g(cursor.)29 b(When)19 b(this)g(function)g(is)g(called,)h(the)-45
  243. X1648 y(output)d(to)f(a)g(windo)o(w)h(is)g(temp)q(orarily)h(disabled)g(and)f
  244. X(all)h(subsequen)o(t)f(dra)o(w)f(calls)i(are)f(directed)h(to)e(this)h(cursor)
  245. X-45 1704 y(pixmap)f(un)o(til)g(the)g(cursor)f(is)g(\014nished)i(and)f
  246. X(closed.)-45 1761 y(Only)h(one)e(cursor)g(can)g(b)q(e)h(op)q(en)g(at)e(a)h
  247. X(same)g(time.)-45 1817 y(No)g(windo)o(ws)g(can)h(b)q(e)g(op)q(ened,)g
  248. X(selected)g(or)f(closed)h(while)h(a)d(cursor)h(is)h(op)q(en.)-45
  249. X1913 y(Syn)o(tax)f(:)27 2007 y Ff(void)23 b(XviG_OpenCursor\(unsigned)e(int)i
  250. X(width,)528 2063 y(unsigned)g(int)g(height,)528 2120 y(int)g(hot_x,)528
  251. X2176 y(int)g(hot_y\))-45 2270 y Fn(Input)16 b(parameters)f(:)23
  252. X2364 y Fm(\017)23 b Ff(width)14 b Fn(and)i Ff(height)e Fn(:)69
  253. X2420 y(The)h(dimensions)i(of)e(the)g(user)g(cursor)g(pixmap.)69
  254. X2477 y(The)e(user)g(can)g(dra)o(w)f(in)h(this)g(pixmap)h(from)e(the)h(co)q
  255. X(ordinate)g(\(0,0\))e(to)h(the)h(co)q(ordinate)g(\(width-1,heigh)o(t-1\).)23
  256. X2570 y Fm(\017)23 b Ff(hot)p 144 2570 15 2 v 17 w(x)15 b Fn(and)g
  257. XFf(hot)p 360 2570 V 17 w(y)g Fn(:)69 2627 y(The)g(hot-sp)q(ot)g(of)g(the)g
  258. X(new)h(user)f(cursor,)f(the)i(so-called)g('zero)f(p)q(oin)o(t'.)69
  259. X2683 y(This)h(co)q(ordinate)f(should)h(b)q(e)g(a)f(p)q(oin)o(t)h(inside)h
  260. X(the)e(cursor)g(pixmap.)932 2932 y(16)p eop
  261. X%%Page: 17 18
  262. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  263. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.9.2)52
  264. Xb(Closing)18 b(a)g(User)f(Cursor)-45 202 y Fn(When)h(the)f(con)o(ten)o(ts)g
  265. X(of)f(a)h(user)g(cursor)g(is)h(completely)h(\014nished,)g(it)e(m)o(ust)g(b)q
  266. X(e)h(closed.)26 b(This)18 b(mak)o(es)f(the)g(cursor)-45 258
  267. Xy(a)o(v)m(ailable)g(for)e(getting)g(input)h(from)e(a)h(windo)o(w.)-45
  268. X315 y(When)i(the)f(cursor)f(is)i(closed,)g(the)f(previously)h(activ)o(e)f
  269. X(windo)o(w,)h(if)f(an)o(y)l(,)g(is)g(set)g(again)g(to)g(the)g(curren)o(tly)g
  270. X(selected)-45 371 y(windo)o(w.)-45 467 y(Syn)o(tax)f(:)27 545
  271. Xy Ff(long)23 b(XviG_CloseCursor\(void\))-45 623 y Fn(Return)16
  272. Xb(v)m(alue)g(:)23 701 y Fm(\017)23 b Fn(A)15 b(unique)i(cursor)e(iden)o
  273. X(ti\014er.)23 789 y Fm(\017)23 b Ff(0)15 b Fn(if)g(no)h(cursor)e(w)o(as)h(op)
  274. Xq(en.)-45 906 y Fl(3.9.3)52 b(Setting)19 b(a)e(Cursor)g(T)o(yp)q(e)-45
  275. X992 y Fn(The)d(follo)o(wing)f(function)h(sets)f(one)g(of)g(the)g(three)h
  276. X(cursor)e(t)o(yp)q(es)h(for)g(the)g(curren)o(tly)h(selected)g(windo)o(w.)20
  277. Xb(The)13 b(cursor)-45 1048 y(t)o(yp)q(e)i(remains)h(activ)o(e)f(for)g(the)g
  278. X(windo)o(w)h(un)o(til)g(another)f(cursor)g(t)o(yp)q(e)g(is)h(set.)-45
  279. X1105 y(The)g(default)g(cursor)e(t)o(yp)q(e)i(is)g(the)f(arro)o(w)f(cursor.)19
  280. Xb(The)d(crosshair)f(cursor)g(and)h(the)f(user)g(de\014ned)i(cursor)e(b)q
  281. X(ecome)-45 1161 y(visible)22 b(only)e(when)g(cursor)f(input)h(is)g
  282. X(requested.)33 b(When)20 b(no)g(cursor)f(input)h(is)g(requested)g(and)g(the)f
  283. X(p)q(oin)o(ter)h(is)-45 1218 y(en)o(tering)c(an)f Fk(XviG)f
  284. XFn(graphics)i(windo)o(w,)f(y)o(ou)g(simply)h(get)f(the)g(arro)o(w)f(cursor.)
  285. X-45 1313 y(Syn)o(tax)h(:)27 1392 y Ff(void)23 b(XviG_SetCursor\(long)e
  286. X(cursor\))-45 1470 y Fn(Input)16 b(parameter)f(:)23 1548 y
  287. XFm(\017)23 b Ff(cursor)14 b Fn(:)69 1605 y(This)i(v)m(alue)g(can)f(b)q(e)h
  288. X(one)g(of)e(the)i(prede\014ned)g(sym)o(b)q(ols)331 1698 y Ff
  289. X(XviG_CURSOR_ARROW)331 1755 y(XviG_CURSOR_XHAIR)69 1905 y Fn(or)e(the)i(iden)
  290. Xo(ti\014er)h(of)d(a)h(user)h(de\014ned)g(cursor)f(as)g(returned)g(b)o(y)h
  291. X(the)f(function)h Ff(XviG)p 1532 1905 15 2 v 16 w(CloseCursor)p
  292. XFn(.)-45 1983 y(If)g(a)f(crosshair)g(cursor)g(is)g(w)o(an)o(ted,)g(the)g
  293. X(color)g(of)g(the)g(crosshair)g(can)h(b)q(e)g(set)f(b)o(y)g(preceding)i(this)
  294. Xe(function)h(call)h(b)o(y)-45 2040 y(a)g Ff(XviG)p 94 2040
  295. XV 17 w(SetColor)f Fn(call,)i(i.e.)27 b(the)17 b(curren)o(t)g(color)h(at)e
  296. X(the)h(momen)o(t)g(of)g(the)g Ff(XviG)p 1401 2040 V 17 w(SetCursor)f
  297. XFn(call)i(will)h(b)q(e)f(used)-45 2096 y(for)d(the)g(crosshair)g(color.)-45
  298. X2213 y Fl(3.9.4)52 b(Deleting)19 b(a)f(User)e(Cursor)-45 2299
  299. Xy Fn(When)h(a)f(user)h(de\014ned)h(cursor)e(is)i(no)e(longer)h(needed,)h(is)f
  300. X(ma)o(y)f(b)q(e)h(deleted)h(to)e(sa)o(v)o(e)g(resources)h(in)g(the)g(X)f
  301. X(serv)o(er.)-45 2356 y(Ho)o(w)o(ev)o(er,)e(b)q(efore)h(deleting,)h(the)f
  302. X(user)g(m)o(ust)f(mak)o(e)h(sure)g(that)f(this)h(cursor)g(is)g(no)g(longer)g
  303. X(set)g(in)h(an)o(y)e(of)h(the)g(op)q(en)-45 2412 y(windo)o(ws.)-45
  304. X2508 y(Syn)o(tax)g(:)27 2586 y Ff(void)23 b(XviG_DeleteCursor\(long)e
  305. X(cursor\))-45 2664 y Fn(Input)16 b(parameter)f(:)23 2743 y
  306. XFm(\017)23 b Ff(cursor)14 b Fn(:)69 2799 y(The)c(unique)i(iden)o(ti\014er)g
  307. X(of)d(the)i(cursor)e(to)h(delete,)i(as)e(it)g(w)o(as)f(returned)i(b)o(y)f
  308. X(the)g(function)h Ff(XviG)p 1684 2799 V 17 w(CloseCursor)p
  309. XFn(.)932 2932 y(17)p eop
  310. X%%Page: 18 19
  311. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
  312. Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.9.5)52
  313. Xb(Asking)17 b(for)g(Cursor)f(Input)-45 202 y Fn(T)l(o)11 b(ask)h(for)f(the)g
  314. X(co)q(ordinate)h(of)f(the)h(cursor)f(and/or)g(a)h(k)o(eypress)f(or)g(mouse)h
  315. X(buttonpress)f(in)i(the)e(curren)o(tly)h(selected)-45 258 y(windo)o(w,)j(use)
  316. Xh(the)f(follo)o(wing)h(function.)-45 354 y(Syn)o(tax)f(:)27
  317. X448 y Ff(int)23 b(XviG_GetCursor\(int)f(type,)480 504 y(int)i(*x_pos,)480
  318. X560 y(int)g(*y_pos\))-45 654 y Fn(Input)16 b(parameter)f(:)23
  319. X748 y Fm(\017)23 b Ff(type)14 b Fn(:)69 805 y(The)j(input)h(t)o(yp)q(e)f(to)g
  320. X(b)q(e)g(enabled)i(to)d(get)h(cursor)g(input)h(from.)24 b(Only)19
  321. Xb(the)e(k)o(eyb)q(oard)g(can)g(b)q(e)g(enabled,)i(or)69 861
  322. Xy(only)d(the)f(mouse)g(buttons,)g(or)f(b)q(oth)i(can)f(b)q(e)h(enabled.)69
  323. X917 y(The)f(follo)o(wing)h(prede\014ned)h(sym)o(b)q(ols)e(m)o(ust)g(b)q(e)h
  324. X(used)g(to)e(set)h(this)h(parameter)e(:)331 1030 y Ff(XviG_KEY)331
  325. X1086 y(XviG_BUTTON)331 1143 y(XviG_KEY_BUTTON)-45 1312 y Fn(Output)i
  326. X(parameters)e(:)23 1406 y Fm(\017)23 b Ff(x)p 96 1406 15 2
  327. Xv 17 w(pos)15 b Fn(and)g Ff(y)p 312 1406 V 17 w(pos)g Fn(:)69
  328. X1462 y(The)g(p)q(osition)h(of)f(the)h(cursor)e(in)i(the)g(windo)o(w)f(when)h
  329. X(a)f(k)o(ey)g(or)f(mouse)i(button)f(w)o(as)f(pressed.)-45 1556
  330. Xy(Return)i(v)m(alue)g(:)23 1650 y Fm(\017)23 b Fn(The)c(ASCI)q(I)g(v)m(alue)h
  331. X(of)e(the)h(prin)o(table)g(c)o(haracter)f(or)g(con)o(trol)g(c)o(haracter)g
  332. X(that)g(has)g(b)q(een)i(pressed)f(on)f(the)69 1706 y(k)o(eyb)q(oard.)i(A)15
  333. Xb(distinction)i(b)q(et)o(w)o(een)e(upp)q(ercase)i(and)e(lo)o(w)o(ercase)g(c)o
  334. X(haracters)f(is)i(made.)23 1800 y Fm(\017)23 b Ff(0)15 b Fn(when)h(a)e
  335. X(non-prin)o(table)j(c)o(haracter)e(\(e.g.)k(a)c(function)h(k)o(ey\))e(has)h
  336. X(b)q(een)i(pressed.)23 1894 y Fm(\017)23 b Fn(One)16 b(of)f(the)g(follo)o
  337. X(wing)h(prede\014ned)h(v)m(alues)f(when)g(a)e(mouse)i(button)f(has)g(b)q(een)
  338. Xh(pressed)g(:)331 2006 y Ff(XviG_BUTTON1)331 2063 y(XviG_BUTTON2)331
  339. X2119 y(XviG_BUTTON3)331 2176 y(XviG_BUTTON4)331 2232 y(XviG_BUTTON5)-45
  340. X2401 y Fn(When)k(asking)g(for)g(cursor)f(input,)j(the)e(graphics)g(output)g
  341. X(to)f(all)h(windo)o(ws)g(is)h(automatically)f(\015ushed.)35
  342. Xb(So)20 b(no)-45 2458 y Ff(XviG)p 54 2458 V 17 w(Flush)14 b
  343. XFn(function)i(call)h(is)e(needed)i(b)q(efore)e(this)h(call.)-45
  344. X2553 y(If)f(the)g('sense)g(k)o(eyb)q(oard')f(mec)o(hanism)h(is)g(activ)o(e)g
  345. X(for)f(the)h(curren)o(tly)g(selected)h(windo)o(w,)e(this)i(function)f(call)h
  346. X(resets)-45 2610 y(to)f(the)g(status)f(that)h(the)g(sense)h(c)o(haracter)e
  347. X(has)h(not)g(b)q(een)h(touc)o(hed)g(y)o(et.)932 2932 y(18)p
  348. Xeop
  349. X%%Page: 19 20
  350. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1309 b Fj(Using)16
  351. Xb(XviG)p -45 -28 1999 2 v -45 116 a Fq(4)69 b(Using)23 b(XviG)-45
  352. X219 y Fg(4.1)56 b(En)n(vironmen)n(t)-45 305 y Fn(T)l(o)15 b(b)q(e)h(able)g
  353. X(to)e(dev)o(elop)j(or)d(run)i(an)f Fk(XviG)f Fn(program)g(the)i(follo)o(wing)
  354. Xg(en)o(vironmen)o(t)f(v)m(ariables)i(m)o(ust)d(b)q(e)i(set)f(:)69
  355. X399 y Fh(XVIGDIR)39 b Fn(:)20 b(The)c(pathname)f(of)f(the)i(ro)q(ot)e
  356. X(directory)i(of)e(the)i Fk(XviG)e Fn(system)h(installation)h(:)347
  357. X455 y Fh(~c)n(ad/xvig/r)n(ele)n(ase)69 526 y(XVIG)124 b Fn(:)20
  358. Xb(The)c(complete)g(pathname)f(for)f(the)h Fk(XviG)g Fn(c)o(hild)i(program)d
  359. X(:)347 582 y Fj($)p Fh(XVIGDIR/bin/)p Fj($)p Fm(f)p Fh(HT)p
  360. XFm(g)p Fh(bin/xvig)-45 666 y Fn(The)24 b(en)o(vironmen)o(t)f(v)m(ariable)i
  361. XFh(XVIGDIR)e Fn(can)g(b)q(e)h(used)g(in)g(Mak)o(e\014les)g(to)e(refer)h(to)g
  362. X(the)g Fk(XviG)g Fn(link)i(library)-45 723 y(')p Fj($)p Fh(XVIGDIR/lib/)p
  363. XFj($)p Fm(f)p Fh(HT)p Fm(g)p Fh(lib/xvig.a)p Fn(')12 b(and)j(to)g(the)g
  364. XFk(XviG)f Fn(include)k(\014le)e(')p Fj($)p Fh(XVIGDIR/include/xvig.h)p
  365. XFn('.)-45 779 y(The)g(en)o(vironmen)o(t)f(v)m(ariable)i Fh(XVIG)e
  366. XFn(m)o(ust)g(b)q(e)h(set)f(for)f(the)i(system)f(to)f(\014nd)j(the)e
  367. XFk(XviG)g Fn(c)o(hild)i(program)d(whic)o(h)i(is)-45 836 y(started)f(eac)o(h)g
  368. X(time)g(a)g(new)h(windo)o(w)f(is)h(op)q(ened.)-45 931 y(F)l(urthermore,)e
  369. X(the)i(standard)e(X)i(feature)f(of)f(setting)i(the)f(en)o(vironmen)o(t)g(v)m
  370. X(ariable)i Fh(DISPLA)m(Y)c Fn(is)j(also)f(v)m(alid.)-45 1053
  371. Xy Fg(4.2)56 b(W)-5 b(riting)18 b(C)h(Programs)f(with)g(XviG)-45
  372. X1139 y Fn(User)f(programs)e(m)o(ust)h(include)j(the)d(header)h(\014le)g(')p
  373. XFh(xvig.h)p Fn(')f(from)g(the)g(directory)h(')p Fj($)p Fh(XVIGDIR/include)p
  374. XFn(')d(and)j(link)-45 1195 y(with)f(the)f(library)h(')p Fh(xvig.a)p
  375. XFn(')e(from)h(the)g(directory)h(')p Fj($)p Fh(XVIGDIR/lib/)p
  376. XFj($)p Fm(f)p Fh(HT)p Fm(g)p Fh(l)o(ib)p Fn(')c(and)j(the)h
  377. XFh(Xlib)e Fn(library)1755 1179 y Fe(1)1775 1195 y Fn(.)-45
  378. X1252 y(When)i(the)f(function)h Ff(XviG)p 443 1252 15 2 v 17
  379. Xw(PolyText)e Fn(is)h(used,)h(the)f Fh(math)h Fn(library)g(m)o(ust)f(also)g(b)
  380. Xq(e)h(included.)-45 1347 y(A)f(simple)i(Mak)o(e\014le)f(ma)o(y)e(lo)q(ok)i
  381. X(lik)o(e)g(this)g(:)122 1441 y Ff(IDIR)24 b(=)f($\(XVIGDIR\)/include)122
  382. X1498 y(LIB)48 b(=)23 b($\(XVIGDIR\)/lib/$\(HT\)lib/xvig)o(.a)122
  383. X1611 y(my_program:)g(my_program.c)313 1667 y($\(CC\))g(my_program.c)g
  384. X(-I$\(IDIR\))f($\(LIB\))h(-lX11)g(-lm)h(-o)f(my_program)-45
  385. X1761 y Fn(The)16 b(header)f(\014le)h(is)g(ANSI-C)g(st)o(yle,)f(so)g(protot)o
  386. X(yping)f(for)h(the)g(functions)h(is)g(pro)o(vided.)-45 1883
  387. Xy Fg(4.3)56 b(The)18 b(Resource)g(Manager)h(Database)-45 1968
  388. Xy Fn(T)l(o)d(set)g(some)g(of)g(the)g(c)o(haracteristics)h(for)e(the)h
  389. X(application)i(lik)o(e)g(the)e(geometry)f(of)h(graphics)h(windo)o(ws,)f(and)g
  390. X(the)-45 2025 y(fon)o(ts)e(to)g(use)h(in)h(the)f(windo)o(ws,)f(the)h(user)g
  391. X(can)g(use)g(the)g(Resource)g(Manager)f(database,)g(i.e.)20
  392. Xb(the)15 b(\014le)h(')p Fh(.Xdefaults)p Fn(')-45 2081 y(in)e(his)f(home)g
  393. X(directory)l(.)19 b(Therefore)13 b(a)f Fh(ClassName)g Fn(is)h(needed.)20
  394. Xb(This)14 b Fh(ClassName)d Fn(is)i(the)g(string)g(that)f(is)h(pro)o(vided)-45
  395. X2138 y(as)j(the)g(\014rst)g(parameter)f(to)g(the)i Ff(XviG)p
  396. X639 2138 V 16 w(Init)f Fn(function)h(call.)23 b(When)17 b(the)f
  397. XFf(classname)f Fn(parameter)g(to)h Ff(XviG)p 1864 2138 V 16
  398. Xw(Init)-45 2194 y Fn(is)g(NULL,)g(then)f(the)g(Resource)h(Manager)f(database)
  399. Xf(is)i(not)f(used)h(and)f(no)g(c)o(haracteristics)h(can)f(b)q(e)h(set.)-45
  400. X2314 y Fl(4.3.1)52 b(The)18 b(Geometry)e(of)i(XviG)f(Windo)o(ws)-45
  401. X2400 y Fn(T)l(o)e(de\014ne)h(the)e(geometry)g(of)h(windo)o(ws)f(created)h
  402. X(with)g(the)g Fk(XviG)f Fn(graphics)h(pac)o(k)m(age,)g(use)g(the)g(follo)o
  403. X(wing)g(syn)o(tax)-45 2457 y(in)h(the)f(Resource)h(Manager)f(database)f
  404. X(\014le)j(')p Fh(.Xdefaults)p Fn(')d(:)218 2550 y Ff
  405. X(<ClassName>.xvig.<Window)o(Name>.g)o(eometry)p -45 2591 807
  406. X2 v 7 2618 a Fd(1)24 2634 y Fc(On)d(HP/Ap)q(ollo)i(Domain/OS)g(systems,)f
  407. X(there's)f(no)g(need)h(to)f(link)i(with)e(the)h Fb(Xlib)d Fc(library)k(since)
  408. Xf(this)g(library)h(is)f(a)f(shared)h(library)m(.)932 2932 y
  409. XFn(19)p eop
  410. X%%Page: 20 21
  411. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1309 b Fj(Using)16
  412. Xb(XviG)p -45 -28 1999 2 v -45 116 a Ff(ClassName)e Fn(is)i(the)f(string)g
  413. X(that)g(is)g(pro)o(vided)h(as)f(the)h(\014rst)e(parameter)h(to)f(the)i
  414. XFf(XviG)p 1448 116 15 2 v 16 w(Init)f Fn(function)h(call.)-45
  415. X172 y Ff(WindowName)e Fn(is)i(the)f(name)g(of)g(the)g(windo)o(w)h(that)e(is)i
  416. X(pro)o(vided)g(with)f(the)h Ff(XviG)p 1362 172 V 16 w(OpenWindow)e
  417. XFn(function)i(call.)-45 268 y(When)e(y)o(ou)g(are)g(not)f(in)o(terested)i(in)
  418. Xf(the)g(windo)o(w)g(name,)g(or)g(the)g(windo)o(w)g(name)g(is)g(unkno)o(wn,)g
  419. X(then)g(the)g(wildcard)-45 324 y(c)o(haracter)h(')p Ff(*)p
  420. XFn(')f(can)h(b)q(e)h(used.)-45 420 y(The)g(v)m(alue)g(of)f(this)g(resource)h
  421. X(is)f(the)h(standard)e(X)i(notation)f(for)f(sp)q(ecifying)j(a)e(windo)o(w)g
  422. X(geometry)l(.)-45 516 y(E.g.:)122 609 y Ff(My_Program.xvig.My_Window.ge)o
  423. X(ometry:)68 b(800x600+100+100)122 722 y(Test.xvig.Window1.geometry:)259
  424. Xb(400x300+10+10)122 779 y(Test.xvig.Window2.geometry:)g(400x300-10+10)122
  425. X835 y(Test.xvig.Window3.geometry:)g(400x300-10-10)122 892 y
  426. X(Test.xvig.Window4.geometry:)g(400x300+10-10)122 1005 y
  427. X(Draw.xvig.*.geometry:)403 b(800x600+300+0)-45 1098 y Fn(The)16
  428. Xb(order)f(of)f(precedence)j(for)e(p)q(ositioning)i(a)e(windo)o(w)g(on)g(the)g
  429. X(screen)h(is)g(as)f(follo)o(ws)g(:)11 1192 y(1.)22 b(If)14
  430. Xb(the)g(windo)o(w)g(geometry)f(is)i(sp)q(eci\014ed)h(in)f(the)f(Resource)h
  431. X(Manager)e(database)g(\014le)i(')p Fh(.Xdefaults)p Fn(',)e(then)h(this)69
  432. X1249 y(geometry)g(is)i(used.)11 1342 y(2.)22 b(If)14 b(the)g(windo)o(w)f(p)q
  433. X(ositions)i Ff(x)f Fn(and)g Ff(y)p Fn(,)f(sp)q(eci\014ed)j(with)e(the)g
  434. XFf(XviG)p 1178 1342 V 16 w(OpenWindow)f Fn(function,)h(are)f(non-negativ)o
  435. X(e,)69 1399 y(then)i(this)h(geometry)e(is)i(used.)11 1493 y(3.)22
  436. Xb(If)16 b(at)f(least)g(one)h(of)f(these)h Ff(x)f Fn(and)h Ff(y)f
  437. XFn(windo)o(w)h(p)q(ositions)g(is)g(negativ)o(e,)g(then)g(the)f(placemen)o(t)i
  438. X(of)e(the)g(windo)o(w)69 1549 y(is)h(left)f(o)o(v)o(er)f(to)h(the)g(con)o
  439. X(trol)g(of)g(the)g(windo)o(w)h(manager,)e(if)h(one)h(is)f(running.)-45
  440. X1669 y Fl(4.3.2)52 b(F)l(on)o(ts)17 b(to)g(Use)h(in)g(XviG)f(Windo)o(ws)-45
  441. X1755 y Fn(The)f(user)f(can)h(de\014ne)g(an)f(unlimited)j(n)o(um)o(b)q(er)e
  442. X(of)f(fon)o(ts)f(to)h(b)q(e)h(used)g(in)g(his)g(user)f(program)f(\(if)i(he)g
  443. X(is)f(not)g(pleased)-45 1812 y(with)g(the)f(\014v)o(e)g(default)h(ones\))f(b)
  444. Xo(y)g(sp)q(ecifying)i(them)e(in)i(the)e(Resource)h(Manager)e(database)h
  445. X(\014le)h(')p Fh(.Xdefaults)p Fn('.)j(Use)-45 1868 y(the)d(X)h(Windo)o(w)f
  446. X(system)g(command)g Fh(xlsfonts)f Fn(to)g(\014nd)i(out)f(what)g(X)g(fon)o(ts)
  447. Xf(are)h(a)o(v)m(ailable)i(on)e(y)o(our)g(system.)-45 1964 y(The)h(syn)o(tax)e
  448. X(for)h(de\014ning)h(fon)o(ts)f(is)g(:)218 2057 y Ff(<ClassName>.xvig.maxfont)
  449. Xo(s:)93 b(<nr>)218 2114 y(<ClassName>.xvig.font1:)164 b(<fontname-1>)218
  450. X2170 y(<ClassName>.xvig.font2:)g(<fontname-2>)218 2227 y(.............)218
  451. X2283 y(<ClassName>.xvig.font<nr)o(>:)93 b(<fontname-nr>)-45
  452. X2377 y Fn(Notice)16 b(that)e(the)i(fon)o(tnames)e(itself)i(ma)o(y)f(con)o
  453. X(tain)g(wildcard)h(c)o(haracters.)-45 2473 y(E.g.:)122 2566
  454. Xy Ff(Test.xvig.maxfonts:)69 b(6)122 2623 y(Test.xvig.font1:)141
  455. Xb(-*-helvetica-bold-r-normal--)o(8-80-75)o(-75-*)122 2679 y(Test.xvig.font2:)
  456. Xg(-*-helvetica-bold-r-normal--)o(10-100-)o(75-75-*)122 2736
  457. Xy(Test.xvig.font3:)g(-*-helvetica-bold-r-normal--)o(12-120-)o(75-75-*)122
  458. X2792 y(Test.xvig.font4:)g(-*-helvetica-bold-r-normal--)o(14-140-)o(75-75-*)
  459. X932 2932 y Fn(20)p eop
  460. X%%Page: 21 22
  461. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1309 b Fj(Using)16
  462. Xb(XviG)p -45 -28 1999 2 v 122 116 a Ff(Test.xvig.font5:)141
  463. Xb(-*-helvetica-bold-r-normal--)o(18-180-)o(75-75-*)122 172
  464. Xy(Test.xvig.font6:)g(-*-helvetica-bold-r-normal--)o(24-240-)o(75-75-*)26
  465. X266 y Fn(F)l(or)14 b(this)i(example,)g(the)f(user)g(program)f(can)i(use)f
  466. X(the)g(n)o(um)o(b)q(ers)h Ff(1)f Fn(to)f Ff(6)h Fn(with)h(the)f(function)h
  467. XFf(XviG)p 1759 266 15 2 v 17 w(SetFont)p Fn(.)-45 388 y Fg(4.4)56
  468. Xb(Installation)-45 474 y Fn(If)12 b(the)f(user)g(program)f(is)h(b)q(eing)i
  469. X(installed)g(at)d(another)h(site,)h(don't)e(forget)g(also)i(to)e(install)i
  470. X(the)g Fk(XviG)e Fn(c)o(hild)j(program)-45 530 y(and)j(set)f(the)g(en)o
  471. X(vironmen)o(t)g(v)m(ariable)i Fh(XVIG)d Fn(to)h(the)g(appropriate)g(new)h
  472. X(pathname)f(of)g(that)f(c)o(hild)j(program.)-45 652 y Fg(4.5)56
  473. Xb(T)-5 b(roublesho)r(oting)-45 738 y Fn(F)l(or)17 b(the)h(momen)o(t,)f
  474. X(little)i(securit)o(y)f(has)g(b)q(een)g(built)h(in)o(to)f(the)g
  475. XFk(XviG)e Fn(system)i(itself.)28 b(It)17 b(is)i(founded)f(mainly)h(on)-45
  476. X794 y(the)c(reliabili)q(t)o(y)i(of)e(the)g(X)g(Windo)o(w)h(system.)26
  477. X851 y(When)e(the)f(user)h(program)e(dies)j(unexp)q(ectedly)h(b)q(efore)d(the)
  478. Xh(graphics)g(windo)o(ws)g(ha)o(v)o(e)f(b)q(een)h(closed)h(and)e(these)-45
  479. X907 y(windo)o(ws)18 b(remain)f(on)g(the)h(screen,)g(they)f(can)g(b)q(e)h
  480. X(closed)g(b)o(y)f(killing)j(the)d Fk(XviG)g Fn(pro)q(cess)g(asso)q(ciated)h
  481. X(with)f(eac)o(h)-45 963 y(windo)o(w.)26 1020 y(When)d(for)g(some)g(reason)g
  482. X(a)g(graphics)g(windo)o(w)h(gets)f(closed)h(unexp)q(ectedly)l(,)h(the)f(user)
  483. Xf(program)f(is)i(v)o(ery)f(lik)o(ely)-45 1076 y(to)h(hang)g(or)g(crash)g
  484. X(when)g(it)h(tries)f(to)g(address)g(suc)o(h)g(a)g(windo)o(w)h(that)e(no)h
  485. X(longer)h(exists.)-45 1198 y Fg(4.6)56 b(Problem)17 b(Rep)r(orting)-45
  486. X1284 y Fn(When)k(problems)f(o)q(ccur)h(or)e(when)i(extensions)f(are)g
  487. X(requested,)h(the)f(author)g(can)g(b)q(e)h(informed)f(b)o(y)g(electronic)-45
  488. X1340 y(mail)d(and/or)e(b)o(y)h(\014lling)i(in)e(a)g(problem)g(rep)q(ort.)22
  489. Xb(The)16 b(author)f(only)h(\014les)h(the)f(request\(s\).)21
  490. Xb(VSDM)15 b(managemen)o(t)-45 1397 y(decides)i(on)e(the)g(actual)h(implemen)o
  491. X(tation.)-45 1453 y(Up)q(dates)g(will)h(b)q(e)e(made)h(\014rst)e(in)i(an)g
  492. X(exp)q(erimen)o(tal)g(v)o(ersion)g(and)f(ma)o(y)g(then)g(b)q(e)h(included)i
  493. X(in)e(a)f(next)g(release.)932 2932 y(21)p eop
  494. X%%Page: 22 23
  495. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1097 b Fj(The)16
  496. Xb(XviG)f(Header)h(File)p -45 -28 1999 2 v -45 116 a Fq(A)69
  497. Xb(The)22 b(XviG)h(Header)f(File)-45 252 y Fa(/*)d(File>>>)e(xvig.h)-45
  498. X298 y(--)-45 344 y(--)i(\045M\045)f(--)h(version)e(\045I\045)i(\(IMEC\))233
  499. Xb(last)18 b(updated:)e(\045E\045)-45 389 y(--)-45 435 y(--)j(Copyright)d
  500. X(\(c\))j(1993)-45 481 y(--)g(IMEC)f(vzw)-45 526 y(--)h(Kapeldreef)d(75)-45
  501. X572 y(--)j(B-3001)e(LEUVEN)-45 618 y(--)i(BELGIUM)-45 663 y(--)-45
  502. X709 y(--)g(Author)57 b(:)19 b(A.)g(Demaree)-45 755 y(--)-45
  503. X800 y(--)g(Date)97 b(:)19 b(October)e(1,)i(1993)-45 846 y(--)-45
  504. X891 y(--)g(Function)e(:)i(Header)e(file)h(for)h(XviG)f(version)f(1.1)-45
  505. X937 y(--)-45 983 y(--)i(Comment)37 b(:)-45 1028 y(--)-45 1074
  506. Xy(--)19 b(Review)57 b(:)-45 1120 y(--)-45 1165 y(*/)-45 1302
  507. Xy(#ifndef)17 b(__XVIG_H)-45 1348 y(#define)g(__XVIG_H)-45 1439
  508. Xy(/*)-45 1485 y(--)i(The)f(default)f(colors,)g(if)i(not)g(set)f(by)h(the)f
  509. X(user)g(program)-45 1531 y(*/)-45 1622 y(#define)f(XviG_NR_OF)o(_C)o(OLO)o
  510. X(RS)153 b(16)-45 1713 y(#define)17 b(XviG_COLOR)o(_B)o(LAC)o(K)193
  511. Xb(0)-45 1759 y(#define)17 b(XviG_COLOR)o(_W)o(HIT)o(E)193 b(1)-45
  512. X1805 y(#define)17 b(XviG_COLOR)o(_R)o(ED)232 b(2)-45 1850 y(#define)17
  513. Xb(XviG_COLOR)o(_G)o(REE)o(N)193 b(3)-45 1896 y(#define)17 b(XviG_COLOR)o(_B)o
  514. X(LUE)212 b(4)-45 1942 y(#define)17 b(XviG_COLOR)o(_C)o(YAN)212
  515. Xb(5)-45 1987 y(#define)17 b(XviG_COLOR)o(_M)o(AGE)o(NTA)153
  516. Xb(6)-45 2033 y(#define)17 b(XviG_COLOR)o(_Y)o(ELL)o(OW)173
  517. Xb(7)-45 2079 y(#define)17 b(XviG_COLOR)o(_O)o(RAN)o(GE)173
  518. Xb(8)-45 2124 y(#define)17 b(XviG_COLOR)o(_G)o(REE)o(N_Y)o(EL)o(LOW)55
  519. Xb(9)-45 2170 y(#define)17 b(XviG_COLOR)o(_G)o(REE)o(N_C)o(YA)o(N)75
  520. Xb(10)-45 2216 y(#define)17 b(XviG_COLOR)o(_B)o(LUE)o(_CY)o(AN)94
  521. Xb(11)-45 2261 y(#define)17 b(XviG_COLOR)o(_B)o(LUE)o(_MA)o(GE)o(NTA)35
  522. Xb(12)-45 2307 y(#define)17 b(XviG_COLOR)o(_R)o(ED_)o(MAG)o(EN)o(TA)55
  523. Xb(13)-45 2353 y(#define)17 b(XviG_COLOR)o(_D)o(ARK)o(_GR)o(AY)94
  524. Xb(14)-45 2398 y(#define)17 b(XviG_COLOR)o(_L)o(IGH)o(T_G)o(RA)o(Y)75
  525. Xb(15)-45 2490 y(/*)-45 2535 y(--)19 b(The)f(linestyles)e(and)j(fillpatte)o
  526. X(rn)o(s)-45 2581 y(*/)-45 2672 y(#define)e(XviG_NR_OF)o(_L)o(INE)o(STY)o(LE)o
  527. X(S)95 b(8)-45 2718 y(#define)17 b(XviG_NR_OF)o(_F)o(ILL)o(PAT)o(TE)o(RNS)35
  528. Xb(42)932 2932 y Fn(22)p eop
  529. X%%Page: 23 24
  530. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1097 b Fj(The)16
  531. Xb(XviG)f(Header)h(File)p -45 -28 1999 2 v -45 116 a Fa(/*)-45
  532. X162 y(--)j(The)f(cursor)g(types)-45 207 y(*/)-45 299 y(#define)f(XviG_CURSO)o
  533. X(R_)o(ARR)o(OW)55 b(0L)-45 344 y(#define)17 b(XviG_CURSO)o(R_)o(XHA)o(IR)36
  534. Xb(-1L)-45 436 y(/*)-45 481 y(--)19 b(The)f(cursor)g(input)f(enabling)-45
  535. X527 y(*/)-45 618 y(#define)g(XviG_KEY)174 b(0)-45 664 y(#define)17
  536. Xb(XviG_BUTTO)o(N)115 b(1)-45 709 y(#define)17 b(XviG_KEY_B)o(UT)o(TON)36
  537. Xb(2)-45 801 y(/*)-45 846 y(--)19 b(The)f(mouse)g(button)f(return)h(values)-45
  538. X892 y(*/)-45 983 y(#define)f(XviG_BUTTO)o(N1)36 b(-1)-45 1029
  539. Xy(#define)17 b(XviG_BUTTO)o(N2)36 b(-2)-45 1075 y(#define)17
  540. Xb(XviG_BUTTO)o(N3)36 b(-3)-45 1120 y(#define)17 b(XviG_BUTTO)o(N4)36
  541. Xb(-4)-45 1166 y(#define)17 b(XviG_BUTTO)o(N5)36 b(-5)-45 1257
  542. Xy(/*)-45 1303 y(--)19 b(The)f(functions)-45 1349 y(*/)-45 1440
  543. Xy(extern)f(int)i(XviG_Init)o(\(ch)o(ar)d(*classname)o(,)367
  544. X1486 y(int)j(color_ar)o(ray)o([])o([3])o(,)367 1531 y(int)g(nr_of_co)o(lor)o
  545. X(s\))o(;)-45 1623 y(extern)e(void)i(XviG_Exi)o(t\(v)o(oid)o(\);)-45
  546. X1714 y(extern)e(int)i(XviG_Open)o(Win)o(dow)o(\(c)o(har)d(*name,)485
  547. X1760 y(int)i(x,)485 1805 y(int)g(y,)485 1851 y(unsigned)e(int)j(*width,)485
  548. X1897 y(unsigned)d(int)j(*height\);)-45 1988 y(extern)e(int)i(XviG_Clos)o(eWi)
  549. Xo(ndo)o(w\()o(cha)o(r)d(*name\);)-45 2079 y(extern)h(int)i(XviG_Sele)o(ctW)o
  550. X(ind)o(ow)o(\(ch)o(ar)d(*name\);)-45 2171 y(extern)h(void)i(XviG_Win)o(dow)o
  551. X(Siz)o(e\()o(uns)o(ig)o(ned)d(int)i(*width,)504 2216 y(unsigned)f(int)h
  552. X(*height\);)-45 2308 y(extern)f(void)i(XviG_Win)o(dow)o(Pos)o(it)o(ion)o(\(i)
  553. Xo(nt)d(*x,)583 2353 y(int)i(*y\);)-45 2445 y(extern)f(void)i(XviG_Cle)o(arW)o
  554. X(ind)o(ow)o(\(vo)o(id)o(\);)-45 2536 y(extern)e(void)i(XviG_Set)o(Col)o(or\()
  555. Xo(in)o(t)e(nr\);)-45 2627 y(extern)g(void)i(XviG_Set)o(Lin)o(eSt)o(yl)o(e\(i)
  556. Xo(nt)d(nr,)544 2673 y(unsigned)g(int)j(width\);)-45 2764 y(extern)e(void)i
  557. X(XviG_Set)o(Fil)o(lSt)o(yl)o(e\(i)o(nt)d(nr\);)932 2932 y Fn(23)p
  558. Xeop
  559. X%%Page: 24 25
  560. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1097 b Fj(The)16
  561. Xb(XviG)f(Header)h(File)p -45 -28 1999 2 v -45 162 a Fa(extern)h(int)i
  562. X(XviG_SetF)o(ont)o(\(in)o(t)d(nr\);)-45 253 y(extern)h(void)i(XviG_Dra)o(wPo)
  563. Xo(int)o(\(i)o(nt)d(x,)485 299 y(int)i(y\);)-45 390 y(extern)f(void)i
  564. X(XviG_Dra)o(wLi)o(ne\()o(in)o(t)e(x1,)465 436 y(int)i(y1,)465
  565. X481 y(int)g(x2,)465 527 y(int)g(y2\);)-45 618 y(extern)e(void)i(XviG_Dra)o
  566. X(wPo)o(lyL)o(in)o(e\(i)o(nt)d(*coords,)544 664 y(int)i(npoints\);)-45
  567. X755 y(extern)f(void)i(XviG_Dra)o(wRe)o(cta)o(ng)o(le\()o(in)o(t)e(x1,)563
  568. X801 y(int)i(y1,)563 846 y(int)g(x2,)563 892 y(int)g(y2\);)-45
  569. X983 y(extern)e(void)i(XviG_Dra)o(wPo)o(lyg)o(on)o(\(in)o(t)d(*coords,)524
  570. X1029 y(int)i(npoints\);)-45 1120 y(extern)f(void)i(XviG_Dra)o(wAr)o(c\(i)o
  571. X(nt)d(x,)446 1166 y(int)i(y,)446 1212 y(unsigned)e(int)i(radius1,)446
  572. X1257 y(unsigned)e(int)i(radius2,)446 1303 y(int)g(angle1,)446
  573. X1349 y(int)g(angle2\);)-45 1440 y(extern)f(void)i(XviG_Fil)o(lRe)o(cta)o(ng)o
  574. X(le\()o(in)o(t)e(x1,)563 1486 y(int)i(y1,)563 1531 y(int)g(x2,)563
  575. X1577 y(int)g(y2\);)-45 1668 y(extern)e(void)i(XviG_Fil)o(lPo)o(lyg)o(on)o
  576. X(\(in)o(t)d(*coords,)524 1714 y(int)i(npoints\);)-45 1805 y(extern)f(void)i
  577. X(XviG_Fil)o(lAr)o(c\(i)o(nt)d(x,)446 1851 y(int)i(y,)446 1897
  578. Xy(unsigned)e(int)i(radius1,)446 1942 y(unsigned)e(int)i(radius2,)446
  579. X1988 y(int)g(angle1,)446 2034 y(int)g(angle2\);)-45 2125 y(extern)f(void)i
  580. X(XviG_Pol)o(yTe)o(xt\()o(ch)o(ar)d(*contents,)465 2171 y(int)j(x,)465
  581. X2216 y(int)g(y,)465 2262 y(unsigned)e(int)h(width,)465 2308
  582. Xy(unsigned)f(int)h(height,)465 2353 y(int)h(rotation)o(\);)-45
  583. X2445 y(extern)e(void)i(XviG_Fon)o(tTe)o(xt\()o(ch)o(ar)d(*contents,)465
  584. X2490 y(int)j(x,)465 2536 y(int)g(y\);)-45 2627 y(extern)e(void)i(XviG_Fon)o
  585. X(tTe)o(xtS)o(iz)o(e\(c)o(ha)o(r)e(*contents)o(,)544 2673 y(int)h(*x_offset,)
  586. X544 2719 y(int)g(*y_offset,)544 2764 y(unsigned)e(int)j(*width,)932
  587. X2932 y Fn(24)p eop
  588. X%%Page: 25 26
  589. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1097 b Fj(The)16
  590. Xb(XviG)f(Header)h(File)p -45 -28 1999 2 v 544 116 a Fa(unsigned)g(int)j
  591. X(*height\))o(;)-45 207 y(extern)e(void)i(XviG_Flu)o(sh\()o(voi)o(d\))o(;)-45
  592. X299 y(extern)e(void)i(XviG_Set)o(Sen)o(seK)o(bd)o(\(in)o(t)d(sense_char\))o
  593. X(;)-45 390 y(extern)h(int)i(XviG_Sens)o(eKb)o(d\(v)o(oi)o(d\);)-45
  594. X481 y(extern)e(void)i(XviG_Ope)o(nCu)o(rso)o(r\()o(uns)o(ig)o(ned)d(int)i
  595. X(width,)504 527 y(unsigned)f(int)h(height,)504 573 y(int)h(hot_x,)504
  596. X618 y(int)g(hot_y\);)-45 709 y(extern)e(long)i(XviG_Clo)o(seC)o(urs)o(or)o
  597. X(\(vo)o(id)o(\);)-45 801 y(extern)e(void)i(XviG_Del)o(ete)o(Cur)o(so)o(r\(l)o
  598. X(on)o(g)e(cursor\);)-45 892 y(extern)g(void)i(XviG_Set)o(Cur)o(sor)o(\(l)o
  599. X(ong)d(cursor\);)-45 983 y(extern)h(int)i(XviG_GetC)o(urs)o(or\()o(in)o(t)e
  600. X(type,)465 1029 y(int)i(*x_pos,)465 1075 y(int)g(*y_pos\);)-45
  601. X1166 y(#endif)37 b(/*)19 b(__XVIG_H)d(*/)932 2932 y Fn(25)p
  602. Xeop
  603. X%%Page: 26 27
  604. Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1230 b Fj(Some)15
  605. Xb(Examples)p -45 -28 1999 2 v -45 116 a Fq(B)69 b(Some)22 b(Examples)-45
  606. X217 y Fn(The)16 b(follo)o(wing)g(examples)f(are)g(a)o(v)m(ailable)i(on)e(the)
  607. Xh(directory)f(')p Fj($)p Fh(XVIGDIR/examples)p Fn('.)-45 335
  608. Xy Fg(B.1)56 b(Displa)n(ying)18 b(the)g(Default)g(Colormap)-45
  609. X456 y Fa(#include)f(<stdlib.h)o(>)-45 502 y(#include)g(<stdio.h>)-45
  610. X547 y(#include)g("xvig.h")-45 639 y(main\(\))-45 684 y({)-6
  611. X730 y(char)h(win_name[])e(=)j("Colors";)-6 776 y(unsigned)e(int)h
  612. X(window_widt)o(h)e(=)k(700,)e(window_he)o(ig)o(ht)e(=)j(400;)-6
  613. X821 y(int)g(x,)g(x2,)f(y,)h(i,)g(chr;)-6 913 y(/*)g(--)g(Initialize)d(--)j
  614. X(*/)-6 1004 y(if)g(\(!XviG_Ini)o(t\(")o(Co)o(lor)o(Tes)o(t")o(,)e(NULL,)g
  615. X(0\)\))34 1050 y(exit\(1\);)-6 1141 y(/*)i(--)g(Open)f(the)h(window)e(--)i
  616. X(*/)-6 1232 y(if)g(\(!XviG_Ope)o(nWi)o(nd)o(ow\()o(win)o(_n)o(ame)o(,)d(-1,)j
  617. X(-1,)f(&window_wi)o(dth)o(,)f(&window_)o(hei)o(ght)o(\)\))-6
  618. X1278 y({)34 1324 y(XviG_Exit)o(\(\))o(;)34 1369 y(exit\(1\);)-6
  619. X1415 y(})-6 1506 y(/*)i(--)g(Draw)f(the)h(colors)e(--)i(*/)-6
  620. X1598 y(for)g(\(x)g(=)g(0,)g(i)g(=)g(0;)g(i)g(<)h(XviG_NR_)o(OF_)o(CO)o(LOR)o
  621. X(S;)c(i++\))-6 1643 y({)34 1689 y(x2)i(=)i(window_wi)o(dt)o(h)d(*)i(\(i)g(+)g
  622. X(1\))g(/)g(XviG_NR_OF)o(_C)o(OLO)o(RS)o(;)34 1735 y(XviG_SetC)o(ol)o(or\()o
  623. X(i\))o(;)34 1780 y(XviG_Fill)o(Re)o(cta)o(ng)o(le\()o(x,)d(0,)j(x2,)f
  624. X(window_heig)o(ht)o(\);)34 1826 y(x)h(=)g(x2;)-6 1872 y(})-6
  625. END_OF_FILE
  626.   if test 33805 -ne `wc -c <'version_1.1/man/xvig.ps.8'`; then
  627.     echo shar: \"'version_1.1/man/xvig.ps.8'\" unpacked with wrong size!
  628.   fi
  629.   # end of 'version_1.1/man/xvig.ps.8'
  630. fi
  631. if test -f 'version_1.1/src/draw.c' -a "${1}" != "-c" ; then 
  632.   echo shar: Will not clobber existing file \"'version_1.1/src/draw.c'\"
  633. else
  634.   echo shar: Extracting \"'version_1.1/src/draw.c'\" \(7300 characters\)
  635.   sed "s/^X//" >'version_1.1/src/draw.c' <<'END_OF_FILE'
  636. X/* File>>> draw.c
  637. X--
  638. X-- %M% -- version %I% (IMEC)            last updated: %E%
  639. X--
  640. X-- Copyright (c) 1993
  641. X-- IMEC vzw
  642. X-- Kapeldreef 75
  643. X-- B-3001 LEUVEN
  644. X-- BELGIUM
  645. X--
  646. X-- Author   : A. Demaree
  647. X--
  648. X-- Date     : February 1, 1993
  649. X--
  650. X-- Function :
  651. X--
  652. X-- Comment  :
  653. X--
  654. X-- Review   :
  655. X--
  656. X*/
  657. X
  658. X
  659. X/*------------------------------------------------------------------------------
  660. X-- Global include files
  661. X------------------------------------------------------------------------------*/
  662. X
  663. X#include <stdlib.h>
  664. X#include <stdio.h>
  665. X#include <string.h>
  666. X#include <X11/Xlib.h>
  667. X
  668. X/*------------------------------------------------------------------------------
  669. X-- Local include files
  670. X------------------------------------------------------------------------------*/
  671. X
  672. X#include "xviglocal.h"
  673. X
  674. X/*------------------------------------------------------------------------------
  675. X-- Static variable declarations
  676. X------------------------------------------------------------------------------*/
  677. X
  678. Xstatic XPoint *points = (XPoint *) NULL;
  679. Xstatic int nr_of_points = 0;
  680. X
  681. X/*------------------------------------------------------------------------------
  682. X-- Local function declarations
  683. X------------------------------------------------------------------------------*/
  684. X
  685. X
  686. X/*------------------------------------------------------------------------------
  687. X--
  688. X--
  689. X--
  690. X------------------------------------------------------------------------------*/
  691. X
  692. Xvoid XviG_DrawPoint(int x,
  693. X                    int y)
  694. X{
  695. X  XDrawPoint(XviG_display, XviG_window, XviG_gc, x, y);
  696. X  XDrawPoint(XviG_display, XviG_pixmap, XviG_gc, x, y);
  697. X}
  698. X
  699. X/*------------------------------------------------------------------------------
  700. X--
  701. X--
  702. X--
  703. X------------------------------------------------------------------------------*/
  704. X
  705. Xvoid XviG_DrawLine(int x1,
  706. X                   int y1,
  707. X                   int x2,
  708. X                   int y2)
  709. X{
  710. X  XDrawLine(XviG_display, XviG_window, XviG_gc, x1, y1, x2, y2);
  711. X  XDrawLine(XviG_display, XviG_pixmap, XviG_gc, x1, y1, x2, y2);
  712. X}
  713. X
  714. X/*------------------------------------------------------------------------------
  715. X--
  716. X--
  717. X--
  718. X------------------------------------------------------------------------------*/
  719. X
  720. Xvoid XviG_DrawPolyLine(int *coords,
  721. X                       int npoints)
  722. X{
  723. X  int i, j;
  724. X
  725. X  if (!points)
  726. X  {
  727. X    points = (XPoint *) malloc(npoints * sizeof(XPoint));
  728. X    nr_of_points = npoints;
  729. X  }
  730. X  else
  731. X  if (npoints > nr_of_points)
  732. X  {
  733. X    points = (XPoint *) realloc((void *) points, npoints * sizeof(XPoint));
  734. X    nr_of_points = npoints;
  735. X  }
  736. X
  737. X  for (i = 0, j = 0; j < npoints; j++)
  738. X  {
  739. X    points[j].x = coords[i++];
  740. X    points[j].y = coords[i++];
  741. X  }
  742. X
  743. X  XDrawLines(XviG_display, XviG_window, XviG_gc,
  744. X             points, npoints, CoordModeOrigin);
  745. X  XDrawLines(XviG_display, XviG_pixmap, XviG_gc,
  746. X             points, npoints, CoordModeOrigin);
  747. X}
  748. X
  749. X/*------------------------------------------------------------------------------
  750. X--
  751. X--
  752. X--
  753. X------------------------------------------------------------------------------*/
  754. X
  755. Xvoid XviG_DrawRectangle(int x1,
  756. X                        int y1,
  757. X                        int x2,
  758. X                        int y2)
  759. X{
  760. X  XDrawRectangle(XviG_display, XviG_window, XviG_gc,
  761. X                 MIN(x1, x2), MIN(y1, y2), ABS(x2-x1), ABS(y2-y1));
  762. X  XDrawRectangle(XviG_display, XviG_pixmap, XviG_gc,
  763. X                 MIN(x1, x2), MIN(y1, y2), ABS(x2-x1), ABS(y2-y1));
  764. X}
  765. X
  766. X/*------------------------------------------------------------------------------
  767. X--
  768. X--
  769. X--
  770. X------------------------------------------------------------------------------*/
  771. X
  772. Xvoid XviG_DrawPolygon(int *coords,
  773. X                      int npoints)
  774. X{
  775. X  int i, j, npts_new;
  776. X
  777. X  npts_new = ((coords[0] != coords[(npoints-1)*2]) ||
  778. X              (coords[1] != coords[(npoints*2)-1])) ? npoints + 1 : npoints;
  779. X
  780. X  if (!points)
  781. X  {
  782. X    points = (XPoint *) malloc(npts_new * sizeof(XPoint));
  783. X    nr_of_points = npts_new;
  784. X  }
  785. X  else
  786. X  if (npts_new > nr_of_points)
  787. X  {
  788. X    points = (XPoint *) realloc((void *) points, npts_new * sizeof(XPoint));
  789. X    nr_of_points = npts_new;
  790. X  }
  791. X
  792. X  for (i = 0, j = 0; j < npoints; j++)
  793. X  {
  794. X    points[j].x = coords[i++];
  795. X    points[j].y = coords[i++];
  796. X  }
  797. X
  798. X  if (npoints != npts_new)
  799. X  {
  800. X    points[j].x = coords[0];
  801. X    points[j].y = coords[1];
  802. X  }
  803. X
  804. X  XDrawLines(XviG_display, XviG_window, XviG_gc,
  805. X             points, npts_new, CoordModeOrigin);
  806. X  XDrawLines(XviG_display, XviG_pixmap, XviG_gc,
  807. X             points, npts_new, CoordModeOrigin);
  808. X}
  809. X
  810. X/*------------------------------------------------------------------------------
  811. X--
  812. X--
  813. X--
  814. X------------------------------------------------------------------------------*/
  815. X
  816. Xvoid XviG_DrawArc(int x,
  817. X                  int y,
  818. X                  unsigned int radius1,
  819. X                  unsigned int radius2,
  820. X                  int angle1,
  821. X                  int angle2)
  822. X{
  823. X  XDrawArc(XviG_display, XviG_window, XviG_gc,
  824. X           x-radius1, y-radius2, 2*radius1, 2*radius2, angle1*64, angle2*64);
  825. X  XDrawArc(XviG_display, XviG_pixmap, XviG_gc,
  826. X           x-radius1, y-radius2, 2*radius1, 2*radius2, angle1*64, angle2*64);
  827. X}
  828. X
  829. X/*------------------------------------------------------------------------------
  830. X--
  831. X--
  832. X--
  833. X------------------------------------------------------------------------------*/
  834. X
  835. Xvoid XviG_FillRectangle(int x1,
  836. X                        int y1,
  837. X                        int x2,
  838. X                        int y2)
  839. X{
  840. X  XFillRectangle(XviG_display, XviG_window, XviG_gc_fill,
  841. X                 MIN(x1, x2), MIN(y1, y2), ABS(x2-x1), ABS(y2-y1));
  842. X  XFillRectangle(XviG_display, XviG_pixmap, XviG_gc_fill,
  843. X                 MIN(x1, x2), MIN(y1, y2), ABS(x2-x1), ABS(y2-y1));
  844. X}
  845. X
  846. X/*------------------------------------------------------------------------------
  847. X--
  848. X--
  849. X--
  850. X------------------------------------------------------------------------------*/
  851. X
  852. Xvoid XviG_FillPolygon(int *coords,
  853. X                      int npoints)
  854. X{
  855. X  int i, j;
  856. X
  857. X  if (!points)
  858. X  {
  859. X    points = (XPoint *) malloc(npoints * sizeof(XPoint));
  860. X    nr_of_points = npoints;
  861. X  }
  862. X  else
  863. X  if (npoints > nr_of_points)
  864. X  {
  865. X    points = (XPoint *) realloc((void *) points, npoints * sizeof(XPoint));
  866. X    nr_of_points = npoints;
  867. X  }
  868. X
  869. X  for (i = 0, j = 0; j < npoints; j++)
  870. X  {
  871. X    points[j].x = coords[i++];
  872. X    points[j].y = coords[i++];
  873. X  }
  874. X
  875. X  XFillPolygon(XviG_display, XviG_window, XviG_gc_fill,
  876. X               points, npoints, Complex, CoordModeOrigin);
  877. X  XFillPolygon(XviG_display, XviG_pixmap, XviG_gc_fill,
  878. X               points, npoints, Complex, CoordModeOrigin);
  879. X}
  880. X
  881. X/*------------------------------------------------------------------------------
  882. X--
  883. X--
  884. X--
  885. X------------------------------------------------------------------------------*/
  886. X
  887. Xvoid XviG_FillArc(int x,
  888. X                  int y,
  889. X                  unsigned int radius1,
  890. X                  unsigned int radius2,
  891. X                  int angle1,
  892. X                  int angle2)
  893. X{
  894. X  XFillArc(XviG_display, XviG_window, XviG_gc_fill,
  895. X           x-radius1, y-radius2, 2*radius1, 2*radius2, angle1*64, angle2*64);
  896. X  XFillArc(XviG_display, XviG_pixmap, XviG_gc_fill,
  897. X           x-radius1, y-radius2, 2*radius1, 2*radius2, angle1*64, angle2*64);
  898. X}
  899. X
  900. X/*------------------------------------------------------------------------------
  901. X--
  902. X--
  903. X--
  904. X------------------------------------------------------------------------------*/
  905. X
  906. Xvoid XviG_Flush(void)
  907. X{
  908. X  XFlush(XviG_display);
  909. X}
  910. END_OF_FILE
  911.   if test 7300 -ne `wc -c <'version_1.1/src/draw.c'`; then
  912.     echo shar: \"'version_1.1/src/draw.c'\" unpacked with wrong size!
  913.   fi
  914.   # end of 'version_1.1/src/draw.c'
  915. fi
  916. if test -f 'version_1.1/src/pattern.c' -a "${1}" != "-c" ; then 
  917.   echo shar: Will not clobber existing file \"'version_1.1/src/pattern.c'\"
  918. else
  919.   echo shar: Extracting \"'version_1.1/src/pattern.c'\" \(7132 characters\)
  920.   sed "s/^X//" >'version_1.1/src/pattern.c' <<'END_OF_FILE'
  921. X/* File>>> pattern.c
  922. X--
  923. X-- %M% -- version %I% (IMEC)            last updated: %E%
  924. X--
  925. X-- Copyright (c) 1993
  926. X-- IMEC vzw
  927. X-- Kapeldreef 75
  928. X-- B-3001 LEUVEN
  929. X-- BELGIUM
  930. X--
  931. X-- Author   : A. Demaree
  932. X--
  933. X-- Date     : February 1, 1993
  934. X--
  935. X-- Function :
  936. X--
  937. X-- Comment  :
  938. X--
  939. X-- Review   :
  940. X--
  941. X*/
  942. X
  943. X
  944. X/*------------------------------------------------------------------------------
  945. X-- Global include files
  946. X------------------------------------------------------------------------------*/
  947. X
  948. X#include <stdlib.h>
  949. X#include <stdio.h>
  950. X#include <string.h>
  951. X#include <X11/Xlib.h>
  952. X
  953. X/*------------------------------------------------------------------------------
  954. X-- Local include files
  955. X------------------------------------------------------------------------------*/
  956. X
  957. X#include "xviglocal.h"
  958. X#include "pattern.h"
  959. X
  960. X/*------------------------------------------------------------------------------
  961. X-- Static variable declarations
  962. X------------------------------------------------------------------------------*/
  963. X
  964. X
  965. X/*------------------------------------------------------------------------------
  966. X-- Local function declarations
  967. X------------------------------------------------------------------------------*/
  968. X
  969. Xstatic void Create_Fillpattern(int nr,
  970. X                               char *bits,
  971. X                               unsigned int width,
  972. X                               unsigned int height);
  973. X
  974. X/*------------------------------------------------------------------------------
  975. X--
  976. X--
  977. X--
  978. X------------------------------------------------------------------------------*/
  979. X
  980. Xvoid XviG_SetLineStyle(int nr,
  981. X                       unsigned int width)
  982. X{
  983. X  int local_nr;
  984. X
  985. X  if ((local_nr = nr % XviG_NR_OF_LINESTYLES) == 0)
  986. X    XSetLineAttributes(XviG_display, XviG_gc,
  987. X                       width, LineSolid, CapButt, JoinMiter);
  988. X  else
  989. X  {
  990. X    local_nr = ABS(local_nr);
  991. X    XSetLineAttributes(XviG_display, XviG_gc,
  992. X                       width, LineOnOffDash, CapButt, JoinMiter);
  993. X    XSetDashes(XviG_display, XviG_gc,
  994. X               0, linestyle[local_nr], linestyle_length[local_nr]);
  995. X  }
  996. X
  997. X  /*
  998. X  -- Save the linewidth and linestyle to be used in the XviG_PolyText call
  999. X  */
  1000. X
  1001. X  XviG_save_linewidth = width;
  1002. X  XviG_save_linestyle = (local_nr == 0) ? LineSolid : LineOnOffDash;
  1003. X}
  1004. X
  1005. X/*------------------------------------------------------------------------------
  1006. X--
  1007. X--
  1008. X--
  1009. X------------------------------------------------------------------------------*/
  1010. X
  1011. Xvoid XviG_SetFillStyle(int nr)
  1012. X{
  1013. X  int local_nr;
  1014. X
  1015. X  if ((local_nr = nr % XviG_NR_OF_FILLPATTERNS) == 0)
  1016. X    XSetFillStyle(XviG_display, XviG_gc_fill, FillSolid);
  1017. X  else
  1018. X  {
  1019. X    local_nr = ABS(local_nr);
  1020. X    XSetFillStyle(XviG_display, XviG_gc_fill, FillStippled);
  1021. X    XSetStipple(XviG_display, XviG_gc_fill, fillpattern[local_nr]);
  1022. X  }
  1023. X}
  1024. X
  1025. X/*------------------------------------------------------------------------------
  1026. X--
  1027. X--
  1028. X--
  1029. X------------------------------------------------------------------------------*/
  1030. X
  1031. Xvoid XviG_CreateFillpatterns(void)
  1032. X{
  1033. X  Create_Fillpattern( 0, (char *) fill00_bits, fill00_width, fill00_height);
  1034. X  Create_Fillpattern( 1, (char *) fill01_bits, fill01_width, fill01_height);
  1035. X  Create_Fillpattern( 2, (char *) fill02_bits, fill02_width, fill02_height);
  1036. X  Create_Fillpattern( 3, (char *) fill03_bits, fill03_width, fill03_height);
  1037. X  Create_Fillpattern( 4, (char *) fill04_bits, fill04_width, fill04_height);
  1038. X  Create_Fillpattern( 5, (char *) fill05_bits, fill05_width, fill05_height);
  1039. X  Create_Fillpattern( 6, (char *) fill06_bits, fill06_width, fill06_height);
  1040. X  Create_Fillpattern( 7, (char *) fill07_bits, fill07_width, fill07_height);
  1041. X  Create_Fillpattern( 8, (char *) fill08_bits, fill08_width, fill08_height);
  1042. X  Create_Fillpattern( 9, (char *) fill09_bits, fill09_width, fill09_height);
  1043. X  Create_Fillpattern(10, (char *) fill10_bits, fill10_width, fill10_height);
  1044. X  Create_Fillpattern(11, (char *) fill11_bits, fill11_width, fill11_height);
  1045. X  Create_Fillpattern(12, (char *) fill12_bits, fill12_width, fill12_height);
  1046. X  Create_Fillpattern(13, (char *) fill13_bits, fill13_width, fill13_height);
  1047. X  Create_Fillpattern(14, (char *) fill14_bits, fill14_width, fill14_height);
  1048. X  Create_Fillpattern(15, (char *) fill15_bits, fill15_width, fill15_height);
  1049. X  Create_Fillpattern(16, (char *) fill16_bits, fill16_width, fill16_height);
  1050. X  Create_Fillpattern(17, (char *) fill17_bits, fill17_width, fill17_height);
  1051. X  Create_Fillpattern(18, (char *) fill18_bits, fill18_width, fill18_height);
  1052. X  Create_Fillpattern(19, (char *) fill19_bits, fill19_width, fill19_height);
  1053. X  Create_Fillpattern(20, (char *) fill20_bits, fill20_width, fill20_height);
  1054. X  Create_Fillpattern(21, (char *) fill21_bits, fill21_width, fill21_height);
  1055. X  Create_Fillpattern(22, (char *) fill22_bits, fill22_width, fill22_height);
  1056. X  Create_Fillpattern(23, (char *) fill23_bits, fill23_width, fill23_height);
  1057. X  Create_Fillpattern(24, (char *) fill24_bits, fill24_width, fill24_height);
  1058. X  Create_Fillpattern(25, (char *) fill25_bits, fill25_width, fill25_height);
  1059. X  Create_Fillpattern(26, (char *) fill26_bits, fill26_width, fill26_height);
  1060. X  Create_Fillpattern(27, (char *) fill27_bits, fill27_width, fill27_height);
  1061. X  Create_Fillpattern(28, (char *) fill28_bits, fill28_width, fill28_height);
  1062. X  Create_Fillpattern(29, (char *) fill29_bits, fill29_width, fill29_height);
  1063. X  Create_Fillpattern(30, (char *) fill30_bits, fill30_width, fill30_height);
  1064. X  Create_Fillpattern(31, (char *) fill31_bits, fill31_width, fill31_height);
  1065. X  Create_Fillpattern(32, (char *) fill32_bits, fill32_width, fill32_height);
  1066. X  Create_Fillpattern(33, (char *) fill33_bits, fill33_width, fill33_height);
  1067. X  Create_Fillpattern(34, (char *) fill34_bits, fill34_width, fill34_height);
  1068. X  Create_Fillpattern(35, (char *) fill35_bits, fill35_width, fill35_height);
  1069. X  Create_Fillpattern(36, (char *) fill36_bits, fill36_width, fill36_height);
  1070. X  Create_Fillpattern(37, (char *) fill37_bits, fill37_width, fill37_height);
  1071. X  Create_Fillpattern(38, (char *) fill38_bits, fill38_width, fill38_height);
  1072. X  Create_Fillpattern(39, (char *) fill39_bits, fill39_width, fill39_height);
  1073. X  Create_Fillpattern(40, (char *) fill40_bits, fill40_width, fill40_height);
  1074. X  Create_Fillpattern(41, (char *) fill41_bits, fill41_width, fill41_height);
  1075. X}
  1076. X
  1077. X/*------------------------------------------------------------------------------
  1078. X--
  1079. X--
  1080. X--
  1081. X------------------------------------------------------------------------------*/
  1082. X
  1083. Xstatic void Create_Fillpattern(int nr,
  1084. X                               char *bits,
  1085. X                               unsigned int width,
  1086. X                               unsigned int height)
  1087. X{
  1088. X  if ((fillpattern[nr] = XCreateBitmapFromData(XviG_display, XviG_dummy_window,
  1089. X                                               bits, width, height)) == None)
  1090. X    printf("WARNING : Could not create fillpattern %d.\n", nr);
  1091. X}
  1092. X
  1093. X/*------------------------------------------------------------------------------
  1094. X--
  1095. X--
  1096. X--
  1097. X------------------------------------------------------------------------------*/
  1098. X
  1099. Xvoid XviG_CleanupFillpatterns(void)
  1100. X{
  1101. X  int i;
  1102. X
  1103. X  for (i = 0; i < XviG_NR_OF_FILLPATTERNS; i++)
  1104. X    if (fillpattern[i] != None)
  1105. X      XFreePixmap(XviG_display, fillpattern[i]);
  1106. X}
  1107. END_OF_FILE
  1108.   if test 7132 -ne `wc -c <'version_1.1/src/pattern.c'`; then
  1109.     echo shar: \"'version_1.1/src/pattern.c'\" unpacked with wrong size!
  1110.   fi
  1111.   # end of 'version_1.1/src/pattern.c'
  1112. fi
  1113. echo shar: End of archive 5 \(of 10\).
  1114. cp /dev/null ark5isdone
  1115. MISSING=""
  1116. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1117.     if test ! -f ark${I}isdone ; then
  1118.     MISSING="${MISSING} ${I}"
  1119.     fi
  1120. done
  1121. if test "${MISSING}" = "" ; then
  1122.     echo You have unpacked all 10 archives.
  1123.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1124.     echo "Merging xvig.ps parts... "
  1125.     cat version_1.1/man/xvig.ps.? > version_1.1/man/xvig.ps
  1126.     rm version_1.1/man/xvig.ps.?
  1127.     echo "Done."
  1128. else
  1129.     echo You still must unpack the following archives:
  1130.     echo "        " ${MISSING}
  1131. fi
  1132. exit 0
  1133. exit 0 # Just in case...
  1134. -- 
  1135.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  1136. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  1137.  "It's intuitively obvious to the |
  1138.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1139.