home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-23 | 54.3 KB | 1,272 lines |
- Newsgroups: comp.sources.x
- From: demaree@imec.be (Antoon Demaree)
- Subject: v21i053: xvig - XviG Graphics Library, Part06/10
- Message-ID: <1993Nov23.172814.17240@sparky.sterling.com>
- X-Md4-Signature: 67f4d17479ea032d1ca028eadc5e39fc
- Sender: chris@sparky.sterling.com (Chris Olson)
- Organization: Sterling Software
- Date: Tue, 23 Nov 1993 17:28:14 GMT
- Approved: chris@sterling.com
-
- Submitted-by: demaree@imec.be (Antoon Demaree)
- Posting-number: Volume 21, Issue 53
- Archive-name: xvig/part06
- Environment: X11
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: version_1.1/bin/EMPTY version_1.1/include/xvig.h
- # version_1.1/man/xvig.ps.4 version_1.1/src/ftext.c
- # version_1.1/src/init.c
- # Wrapped by chris@sparky on Tue Nov 23 11:17:58 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 6 (of 10)."'
- if test -f 'version_1.1/bin/EMPTY' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'version_1.1/bin/EMPTY'\"
- else
- echo shar: Extracting \"'version_1.1/bin/EMPTY'\" \(0 characters\)
- sed "s/^X//" >'version_1.1/bin/EMPTY' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'version_1.1/bin/EMPTY'`; then
- echo shar: \"'version_1.1/bin/EMPTY'\" unpacked with wrong size!
- fi
- # end of 'version_1.1/bin/EMPTY'
- fi
- if test -f 'version_1.1/include/xvig.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'version_1.1/include/xvig.h'\"
- else
- echo shar: Extracting \"'version_1.1/include/xvig.h'\" \(4803 characters\)
- sed "s/^X//" >'version_1.1/include/xvig.h' <<'END_OF_FILE'
- X/* File>>> xvig.h
- X--
- X-- %M% -- version %I% (IMEC) last updated: %E%
- X--
- X-- Copyright (c) 1993
- X-- IMEC vzw
- X-- Kapeldreef 75
- X-- B-3001 LEUVEN
- X-- BELGIUM
- X--
- X-- Author : A. Demaree
- X--
- X-- Date : October 1, 1993
- X--
- X-- Function : Header file for XviG version 1.1
- X--
- X-- Comment :
- X--
- X-- Review :
- X--
- X*/
- X
- X
- X#ifndef __XVIG_H
- X#define __XVIG_H
- X
- X
- X/*
- X-- The default colors, if not set by the user program
- X*/
- X
- X#define XviG_NR_OF_COLORS 16
- X
- X#define XviG_COLOR_BLACK 0
- X#define XviG_COLOR_WHITE 1
- X#define XviG_COLOR_RED 2
- X#define XviG_COLOR_GREEN 3
- X#define XviG_COLOR_BLUE 4
- X#define XviG_COLOR_CYAN 5
- X#define XviG_COLOR_MAGENTA 6
- X#define XviG_COLOR_YELLOW 7
- X#define XviG_COLOR_ORANGE 8
- X#define XviG_COLOR_GREEN_YELLOW 9
- X#define XviG_COLOR_GREEN_CYAN 10
- X#define XviG_COLOR_BLUE_CYAN 11
- X#define XviG_COLOR_BLUE_MAGENTA 12
- X#define XviG_COLOR_RED_MAGENTA 13
- X#define XviG_COLOR_DARK_GRAY 14
- X#define XviG_COLOR_LIGHT_GRAY 15
- X
- X
- X/*
- X-- The linestyles and fillpatterns
- X*/
- X
- X#define XviG_NR_OF_LINESTYLES 8
- X#define XviG_NR_OF_FILLPATTERNS 42
- X
- X
- X/*
- X-- The cursor types
- X*/
- X
- X#define XviG_CURSOR_ARROW 0L
- X#define XviG_CURSOR_XHAIR -1L
- X
- X
- X/*
- X-- The cursor input enabling
- X*/
- X
- X#define XviG_KEY 0
- X#define XviG_BUTTON 1
- X#define XviG_KEY_BUTTON 2
- X
- X
- X/*
- X-- The mouse button return values
- X*/
- X
- X#define XviG_BUTTON1 -1
- X#define XviG_BUTTON2 -2
- X#define XviG_BUTTON3 -3
- X#define XviG_BUTTON4 -4
- X#define XviG_BUTTON5 -5
- X
- X
- X/*
- X-- The functions
- X*/
- X
- Xextern int XviG_Init(char *classname,
- X int color_array[][3],
- X int nr_of_colors);
- X
- Xextern void XviG_Exit(void);
- X
- Xextern int XviG_OpenWindow(char *name,
- X int x,
- X int y,
- X unsigned int *width,
- X unsigned int *height);
- X
- Xextern int XviG_CloseWindow(char *name);
- X
- Xextern int XviG_SelectWindow(char *name);
- X
- Xextern void XviG_WindowSize(unsigned int *width,
- X unsigned int *height);
- X
- Xextern void XviG_WindowPosition(int *x,
- X int *y);
- X
- Xextern void XviG_ClearWindow(void);
- X
- Xextern void XviG_SetColor(int nr);
- X
- Xextern void XviG_SetLineStyle(int nr,
- X unsigned int width);
- X
- Xextern void XviG_SetFillStyle(int nr);
- X
- Xextern int XviG_SetFont(int nr);
- X
- Xextern void XviG_DrawPoint(int x,
- X int y);
- X
- Xextern void XviG_DrawLine(int x1,
- X int y1,
- X int x2,
- X int y2);
- X
- Xextern void XviG_DrawPolyLine(int *coords,
- X int npoints);
- X
- Xextern void XviG_DrawRectangle(int x1,
- X int y1,
- X int x2,
- X int y2);
- X
- Xextern void XviG_DrawPolygon(int *coords,
- X int npoints);
- X
- Xextern void XviG_DrawArc(int x,
- X int y,
- X unsigned int radius1,
- X unsigned int radius2,
- X int angle1,
- X int angle2);
- X
- Xextern void XviG_FillRectangle(int x1,
- X int y1,
- X int x2,
- X int y2);
- X
- Xextern void XviG_FillPolygon(int *coords,
- X int npoints);
- X
- Xextern void XviG_FillArc(int x,
- X int y,
- X unsigned int radius1,
- X unsigned int radius2,
- X int angle1,
- X int angle2);
- X
- Xextern void XviG_PolyText(char *contents,
- X int x,
- X int y,
- X unsigned int width,
- X unsigned int height,
- X int rotation);
- X
- Xextern void XviG_FontText(char *contents,
- X int x,
- X int y);
- X
- Xextern void XviG_FontTextSize(char *contents,
- X int *x_offset,
- X int *y_offset,
- X unsigned int *width,
- X unsigned int *height);
- X
- Xextern void XviG_Flush(void);
- X
- Xextern void XviG_SetSenseKbd(int sense_char);
- X
- Xextern int XviG_SenseKbd(void);
- X
- Xextern void XviG_OpenCursor(unsigned int width,
- X unsigned int height,
- X int hot_x,
- X int hot_y);
- X
- Xextern long XviG_CloseCursor(void);
- X
- Xextern void XviG_DeleteCursor(long cursor);
- X
- Xextern void XviG_SetCursor(long cursor);
- X
- Xextern int XviG_GetCursor(int type,
- X int *x_pos,
- X int *y_pos);
- X
- X
- X#endif /* __XVIG_H */
- END_OF_FILE
- if test 4803 -ne `wc -c <'version_1.1/include/xvig.h'`; then
- echo shar: \"'version_1.1/include/xvig.h'\" unpacked with wrong size!
- fi
- # end of 'version_1.1/include/xvig.h'
- fi
- if test -f 'version_1.1/man/xvig.ps.4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'version_1.1/man/xvig.ps.4'\"
- else
- echo shar: Extracting \"'version_1.1/man/xvig.ps.4'\" \(33567 characters\)
- sed "s/^X//" >'version_1.1/man/xvig.ps.4' <<'END_OF_FILE'
- X2474 y Fl(Abstract)69 2580 y Fn(This)h(text)f(describ)q(es)i(ho)o(w)e(to)g
- X(use)h(the)f(graphics)h(pac)o(k)m(age)g Fk(XviG)e Fn(\(v)o(ersion)i(1.1\).)22
- 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
- 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
- X(Windo)o(w)g(en)o(vironmen)o(t,)69 2693 y(without)j(ha)o(ving)g(to)g(deal)h
- 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
- 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
- X(erful)g(but)h(v)o(ery)f(easy)g(to)f(use)i(library)g(for)e(pro)q(ducing)j
- X(simple)f(graphics.)p eop
- X%%Page: 1 2
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1285 b Fj(CONTENTS)p
- X-45 -28 1999 2 v -45 116 a Fq(Con)n(ten)n(ts)-45 218 y Fl(1)42
- Xb(In)o(tro)q(duction)1636 b(3)-45 320 y(2)42 b(The)18 b(XviG)f(System)1510
- 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
- X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- Xb Fn(3)23 433 y(2.2)46 b(Refreshing)16 b(a)f(Windo)o(w)f Fi(:)22
- Xb(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- Xb Fn(3)-45 535 y Fl(3)42 b(The)18 b(XviG)f(F)l(unctions)1456
- Xb(4)23 591 y Fn(3.1)46 b(Initializin)q(g)17 b(XviG)35 b Fi(:)22
- Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
- X(:)61 b Fn(4)23 647 y(3.2)46 b(Quiting)17 b(XviG)25 b Fi(:)d(:)h(:)f(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- Xb Fn(4)23 704 y(3.3)46 b(Ab)q(out)15 b(Windo)o(ws)46 b Fi(:)22
- Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
- X(:)61 b Fn(5)128 760 y(3.3.1)50 b(Op)q(ening)17 b(a)e(Windo)o(w)h
- XFi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- Xb Fn(5)128 817 y(3.3.2)50 b(Closing)16 b(a)f(Windo)o(w)37 b
- XFi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- Xb Fn(5)128 873 y(3.3.3)50 b(Selecting)17 b(a)e(Windo)o(w)42
- Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- 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
- X(w)36 b Fi(:)23 b(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(6)128 986
- 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
- Xb Fi(:)e(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(6)128 1043 y(3.3.6)50 b(Erasing)16
- Xb(a)e(Windo)o(w)34 b Fi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)
- Xf(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
- X(:)g(:)h(:)61 b Fn(7)23 1099 y(3.4)46 b(Setting)15 b(Dra)o(w)f(A)o(ttributes)
- X27 b Fi(:)c(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- Xb Fn(7)128 1156 y(3.4.1)50 b(Setting)16 b(the)f(Color)21 b
- XFi(:)i(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)
- Xf(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61
- 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)
- Xh(Width)k Fi(:)i(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(8)128 1268 y(3.4.3)50
- Xb(Setting)16 b(the)f(Fill)i(St)o(yle)j Fi(:)i(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(8)23 1325 y(3.5)46 b(Dra)o(wing)14
- Xb(Ob)s(jects)34 b Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(9)128 1381 y(3.5.1)50
- 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
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(9)128 1438 y(3.5.2)50
- Xb(Dra)o(wing)15 b(a)g(Line)24 b Fi(:)e(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)
- Xh(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)h(:)f(:)g(:)h(:)61 b Fn(9)128 1494 y(3.5.3)50 b(Dra)o(wing)15
- Xb(a)g(P)o(olyline)22 b Fi(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f
- X(:)g(:)h(:)38 b Fn(11)128 1551 y(3.5.4)50 b(Dra)o(wing)15 b(a)g(Rectangle)21
- Xb Fi(:)h(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(11)128 1607 y(3.5.5)50 b(Dra)o(wing)15 b(a)g(P)o(olygon)20
- Xb Fi(:)i(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(11)128 1664 y(3.5.6)50 b(Dra)o(wing)15 b(an)g(Arc)d Fi(:)22
- Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- 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(:)
- Xf(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- 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)
- Xk Fi(:)i(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(13)128 1833
- Xy(3.6.2)50 b(Dra)o(wing)15 b(T)l(ext)g(Using)h(F)l(on)o(ts)g
- XFi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(13)23
- X1889 y(3.7)46 b(Flushing)16 b(the)g(Graphics)f(Output)e Fi(:)23
- Xb(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(15)23
- X1946 y(3.8)46 b(Sensing)16 b(the)g(Keyb)q(oard)38 b Fi(:)22
- Xb(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(15)128 2002 y(3.8.1)50 b(Setting)16 b(a)f(Keyb)q(oard)h(Sense)g
- X(Character)27 b Fi(:)22 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(15)128 2059
- Xy(3.8.2)50 b(Asking)16 b(for)f(a)g('Sense)g(Keyb)q(oard')45
- Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(16)23 2115
- Xy(3.9)46 b(Ab)q(out)15 b(the)h(Cursor)e Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(16)128
- X2172 y(3.9.1)50 b(Creating)15 b(a)g(New)g(User)h(Cursor)45
- Xb Fi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(16)128
- X2228 y(3.9.2)50 b(Closing)16 b(a)f(User)g(Cursor)31 b Fi(:)23
- Xb(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(17)128
- X2285 y(3.9.3)50 b(Setting)16 b(a)f(Cursor)f(T)o(yp)q(e)25 b
- XFi(:)e(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)
- Xf(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(17)128 2341 y(3.9.4)50 b(Deleting)17 b(a)d(User)i(Cursor)11
- Xb Fi(:)23 b(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(17)128 2398 y(3.9.5)50 b(Asking)16 b(for)f(Cursor)f(Input)27
- Xb Fi(:)22 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(18)-45 2499 y Fl(4)k(Using)18 b(XviG)1626 b(19)23 2556
- Xy Fn(4.1)46 b(En)o(vironmen)o(t)41 b Fi(:)22 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)
- Xg(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
- XFn(19)23 2612 y(4.2)46 b(W)l(riting)16 b(C)f(Programs)e(with)j(XviG)22
- Xb Fi(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
- XFn(19)23 2669 y(4.3)46 b(The)15 b(Resource)h(Manager)f(Database)27
- Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
- XFn(19)128 2725 y(4.3.1)50 b(The)16 b(Geometry)e(of)h(XviG)g(Windo)o(ws)23
- Xb Fi(:)g(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(19)128 2782 y(4.3.2)50
- 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
- X(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)h(:)f(:)g(:)h(:)38 b Fn(20)943 2932 y(1)p eop
- X%%Page: 2 3
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1285 b Fj(CONTENTS)p
- X-45 -28 1999 2 v 23 116 a Fn(4.4)46 b(Installation)38 b Fi(:)22
- Xb(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h
- X(:)f(:)g(:)h(:)38 b Fn(21)23 172 y(4.5)46 b(T)l(roublesho)q(oting)13
- Xb Fi(:)23 b(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)h(:)f(:)g(:)h(:)38 b Fn(21)23 229 y(4.6)46 b(Problem)15
- Xb(Rep)q(orting)24 b Fi(:)f(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)
- Xf(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h
- X(:)f(:)h(:)f(:)g(:)h(:)38 b Fn(21)-45 331 y Fl(A)28 b(The)18
- Xb(XviG)f(Header)h(File)1382 b(22)-45 433 y(B)31 b(Some)17 b(Examples)1538
- Xb(26)23 489 y Fn(B.1)37 b(Displa)o(ying)16 b(the)g(Default)f(Colormap)27
- Xb Fi(:)22 b(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38 b
- XFn(26)23 546 y(B.2)f(Creating)15 b(a)g(User)g(Cursor)45 b Fi(:)23
- Xb(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g
- X(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(27)23 602 y(B.3)f(Use)15 b(of)g(the)g('Sense)h(Keyb)q(oard')k
- XFi(:)i(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)g(:)
- Xh(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- 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(:)
- Xg(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
- X(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)38
- Xb Fn(31)943 2932 y(2)p eop
- X%%Page: 3 4
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1294 b Fj(In)o(tro)q(duction)p
- X-45 -28 1999 2 v -45 116 a Fq(1)69 b(In)n(tro)r(duction)-45
- X217 y Fn(Although)14 b(the)f(X)h(Windo)o(w)f(system)g(is)g(an)h(extremely)f
- X(p)q(o)o(w)o(erful)h(graphics)g(pac)o(k)m(age,)f(pro)q(ducing)h(simple)h
- X(graphics)-45 274 y(with)k(it)f(isn't)g(an)g(easy)g(job.)28
- Xb(Due)18 b(to)g(the)g(nature)g(of)f(the)h(X)g(Windo)o(w)h(system,)f(the)g
- X(programmer)e(has)i(to)g(deal)-45 330 y(with)e(a)g(lot)g(of)f(o)o(v)o(erhead)
- Xh(pro)q(duced)h(b)o(y)f(the)f(ev)o(en)o(t-driv)o(en)i(mec)o(hanism.)23
- Xb(In)16 b(fact,)f(he)i(has)e(to)h(react)f(on)h(all)h(kinds)-45
- X387 y(of)g('messages')e(that)i(the)g(X)g(Windo)o(w)g(system)f(noti\014es)i
- X(him)f(of,)g(lik)o(e)h(windo)o(w)f(gro)o(wing)f(and)h(shrinking,)i(hidden)-45
- X443 y(windo)o(ws,)c(mouse)g(mo)o(v)o(emen)o(t,)f(k)o(ey)h(presses)h(and)f
- X(mouse)g(button)g(clic)o(ks,)h(etc.)26 500 y(In)g(order)g(for)f(the)h(user)g
- 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
- X(h)h(more)g(easier)g(w)o(a)o(y)l(,)f(the)h Fk(XviG)-45 556
- Xy Fn(graphics)11 b(pac)o(k)m(age)f(has)h(b)q(een)g(dev)o(elop)q(ed.)20
- Xb Fk(XviG)10 b Fn(stands)g(for)f(\\)p Fl(X)h Fn(Windo)o(w)g
- XFl(vi)p Fn(rtual)h Fl(G)p Fn(raphics")g(and)f(is)h(considered)-45
- 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)
- 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
- X(X)g(Windo)o(w)g(ev)o(en)o(t-)-45 669 y(driv)o(en)22 b(graphics.)37
- Xb(This)21 b(means)g(that)f Fk(XviG)g Fn(pro)o(vides)h(the)g(user)g(only)h
- X(with)f(a)f(n)o(um)o(b)q(er)h(of)g(straigh)o(tforw)o(ard)-45
- X725 y(functions)g(for)f(op)q(ening)h(windo)o(ws,)g(de\014ning)h(colors,)f
- X(dra)o(wing)f(lines,)j(rectangles,)f Fi(:)8 b(:)g(:)d Fn(,)21
- Xb(creating)g(cursors)e(and)-45 782 y(getting)f(cursor)g(input,)h(etc.)29
- 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
- X(an)o(ything)i(ab)q(out)f(all)h(the)f(fancy)g(\(and)-45 838
- Xy(complicated\))e(features)f(of)g(the)g(X)g(Windo)o(w)h(system.)26
- 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)
- Xq(duce)i Fh(simple)f Fn(graphics,)h(whic)o(h)g(means)f(that)g(is)g(do)q(es)h
- X(not)-45 951 y(pro)o(vide)d(scrollbars,)f(p)q(op-up)i(men)o(us,)e(fancy)g
- X(text)g(features,)f(etc.)-45 1047 y(In)i(section)g(2)f(the)g(concept)h(of)e
- X(the)i Fk(XviG)e Fn(system)h(is)h(explained)h(brie\015y)l(.)-45
- X1103 y(In)f(section)g(3)f(all)h(functions)g(and)f(de\014nitions)i(of)e
- XFk(XviG)f Fn(are)h(giv)o(en.)-45 1160 y(In)h(section)g(4)f(is)g(describ)q(ed)
- Xi(what)e(the)g(user)h(m)o(ust)e(kno)o(w)h(when)h(dev)o(elopping)h(or)d
- X(running)j(an)e Fk(XviG)f Fn(program.)-45 1216 y(App)q(endix)k(A)d(lists)h
- X(the)f(program)f(header)i(\014le)g(to)e(b)q(e)i(included)i(in)e(C)f
- X(programs.)-45 1273 y(Finally)i(app)q(endix)g(B)e(will)i(giv)o(e)e(some)g
- X(examples)h(of)f(programming)g(with)g(the)g Fk(XviG)g Fn(pac)o(k)m(age.)-45
- X1416 y Fq(2)69 b(The)23 b(XviG)f(System)-45 1519 y Fg(2.1)56
- 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
- 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
- X(generated)g(b)o(y)g(the)h(X)f(Windo)o(w)g(system)g(from)f(the)-45
- X1661 y(programmer.)20 b(X)c(ev)o(en)o(ts)f(are)h(related)g(to)f(a)g(windo)o
- 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)
- Xo(hild)j(program)-45 1718 y(is)d(started)f(that)g(handles)i(all)f(these)g(X)g
- 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
- X(ted)d(\(e.g.)19 b(windo)o(w)c(size,)-45 1774 y(cursor)e(p)q(osition\))h(is)g
- X(requested)f(b)o(y)g(the)h(user)f(program)f(to)h(this)g(c)o(hild)i(program)d
- X(and)h(transmitted)g(from)g(the)g(c)o(hild)-45 1831 y(program)j(bac)o(k)h(to)
- 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
- X(no)h(in)o(terest)g(to)f(the)h(user)h(program,)d(lik)o(e)-45
- X1887 y(windo)o(w)h(hiding)g(and)g(iconifying,)h(windo)o(w)e(resizing)h(and)g
- X(refreshing,)f(are)g(dealt)h(with)f(b)o(y)h(this)f(c)o(hild)i(program.)26
- X1944 y(The)d(comm)o(unication)h(b)q(et)o(w)o(een)f(the)g(c)o(hild)i
- X(program\(s\))c(and)i(the)g(user)g(program)f(uses)h(the)h(X)f(proto)q(col.)19
- Xb(This)-45 2000 y(implies)f(that)c(there)i(is)f(no)h(loss)f(of)g(p)q
- X(erformance)g(of)g(this)h(graphics)g(system)f(compared)g(to)g(a)g(regular)g
- X(X)g(Windo)o(w)-45 2056 y(program.)-45 2178 y Fg(2.2)56 b(Refreshing)17
- Xb(a)i(Windo)n(w)-45 2264 y Fk(XviG)d Fn(is)h(built)i(on)d(top)h(of)f
- XFh(Xlib)p Fn(.)24 b(This)17 b(implies)i(that)d(a)h(windo)o(w)g(refresh)f(is)i
- X(not)e(done)h(automatically)g(b)o(y)g(X.)g(A)-45 2320 y(windo)o(w)g(refresh)g
- X(is)g(needed)h(when)f(resizing)h(a)f(windo)o(w,)g(when)g(pushing)h(and/or)e
- X(p)q(opping)i(windo)o(w,)f(and)g(when)-45 2377 y(de-iconifying)h(a)d(windo)o
- 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
- X(y)h(the)g Fk(XviG)f Fn(c)o(hild)i(program.)33 b(Ev)o(ery)19
- Xb(windo)o(w)h(has)g(a)f(bac)o(kup)-45 2490 y(pixmap)e(asso)q(ciated)g(with)g
- X(it)f(whic)o(h)i(has)e(the)g(same)g(size)i(as)e(the)g(windo)o(w.)24
- Xb(All)18 b(ob)s(jects)d(that)h(are)g(dra)o(wn)g(in)h(the)-45
- X2546 y(windo)o(w)c(are)g(also)f(dra)o(wn)h(to)f(that)g(pixmap.)20
- Xb(When)13 b(a)g(refresh)f(is)i(needed,)g(the)f(pixmap)g(is)h(copied)g(to)e
- 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
- X(pixmap)i(is)f(set)f(when)h(the)g(windo)o(w)g(is)g(op)q(ened.)25
- Xb(When)17 b(the)g(windo)o(w)g(is)g(resized,)-45 2659 y(the)i(pixmap)g(size)h
- X(is)f(not)g(immediately)h(adapted,)f(whic)o(h)h(means)e(that)h(up)q(on)g(a)f
- X(refresh,)i(some)e(graphics)h(data)-45 2716 y(ma)o(y)f(b)q(e)h(lost)f(in)i
- X(the)e(windo)o(w.)30 b(The)19 b(bac)o(kup)g(pixmap)g(is)g(only)g(adjusted)f
- X(to)g(the)h(correct)f(size)h(when)g(the)f(user)-45 2772 y(program)c
- X(explicitely)k(asks)d(for)g(it)g(through)g(the)g Ff(XviG)p
- X916 2772 15 2 v 17 w(WindowSize)f Fn(call.)21 b(\(see)15 b(section)h(3.3.4\))
- X943 2932 y(3)p eop
- X%%Page: 4 5
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
- Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fq(3)69
- Xb(The)23 b(XviG)f(F)-6 b(unctions)-45 217 y Fn(T)l(o)16 b(distinguish)j(the)e
- X(prede\014ned)h(names)f(of)f(the)g Fk(XviG)g Fn(graphics)h(pac)o(k)m(age)g
- X(from)f(other)g(pac)o(k)m(ages,)g(all)i(function)-45 274 y(names,)d(v)m
- X(alues)h(and)g(sym)o(b)q(ols)f(related)h(to)e Fk(XviG)h Fn(start)f(with)h
- X(the)h(pre\014x)f(')p Fh(XviG)p 1382 274 14 2 v 16 w Fn('.)-45
- X394 y Fg(3.1)56 b(Initializing)16 b(XviG)-45 480 y Fn(The)j(follo)o(wing)g
- X(function)g(m)o(ust)f(b)q(e)h(called)h(b)q(efore)f(an)o(y)f(other)g(function)
- 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
- X536 y(called)f(exactly)f(once.)k(This)c(function)g(do)q(es)f(not)g(create)g
- X(an)o(y)g(windo)o(ws)g(y)o(et.)-45 632 y(Syn)o(tax)g(:)27 719
- Xy Ff(int)23 b(XviG_Init\(char)f(*classname,)361 775 y(int)h
- X(color_array[][3],)361 832 y(int)g(nr_of_colors\))-45 918 y
- XFn(Input)16 b(parameters)f(:)23 1005 y Fm(\017)23 b Ff(classname)14
- 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)
- Xg(resource)g(manager,)f(or)h(NULL.)69 1118 y(F)l(or)f(the)i(purp)q(ose)f(of)g
- X(this)h(parameter,)e(see)h(section)h(4.3)e(ab)q(out)h(the)h(resource)f
- X(manager.)23 1209 y Fm(\017)23 b Ff(color)p 192 1209 15 2 v
- X16 w(array)15 b Fn(:)69 1265 y(A)d(t)o(w)o(o-dimensional)g(arra)o(y)f(of)g
- X(in)o(teger)h(v)m(alues)h(de\014ning)g(the)f(colormap,)g(or)f(NULL)h(if)h
- X(the)e(default)i(colormap)69 1322 y(is)j(used)f(for)g(the)g(application.)23
- X1413 y Fm(\017)23 b Ff(nr)p 120 1413 V 17 w(of)p 185 1413 V
- 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)
- Xh(the)f(user-sp)q(eci\014ed)j(colormap,)d(or)g(0)f(when)i(the)f(default)h
- X(colormap)f(is)h(used.)-45 1556 y(Return)g(v)m(alue)g(:)23
- X1643 y Fm(\017)23 b Ff(1)15 b Fn(when)h(the)f(initialization)j(w)o(as)c
- X(successful.)23 1734 y Fm(\017)23 b Ff(0)15 b Fn(when)h(the)f(initialization)
- Xj(w)o(as)c(not)h(successful.)-45 1820 y(The)h Ff(color)p 172
- X1820 V 17 w(array)f Fn(parameter)g(con)o(tains)h(three)h(in)o(teger)f(v)m
- 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
- X(ecify)g(the)-45 1877 y(R)o(GB)e(v)m(alues)h(for)e(a)h(sp)q(eci\014c)i
- X(color,)d(and)h(m)o(ust)f(range)h(from)f(0)h(to)f(255)g(inclusiv)o(e.)22
- Xb(The)15 b(n)o(um)o(b)q(er)g(of)g(en)o(tries)g(in)g(the)-45
- X1933 y(colormap)g(is)h(only)g(limited)h(b)o(y)e(the)g(hardw)o(are)g(the)g
- X(program)f(is)i(running)g(on.)-45 1990 y(E.g.)j(a)c(colormap)g(con)o(taining)
- Xh(only)g(the)f(colors)g(red,)g(green)h(and)f(blue)i(m)o(ust)d(b)q(e)i
- X(de\014ned)h(as)e(follo)o(ws)g(:)74 2077 y Ff(int)24 b(my_colormap[][3])e(=)h
- X({)h({)g(255,)f(0,)h(0)f(},)h({)g(0,)f(255,)h(0)f(},)h({0,)f(0,)h(255})f(};)
- X-45 2163 y Fn(The)17 b(default)h(colormap)e(con)o(tains)h(16)g(colors,)g
- 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
- Xb(See)18 b(section)f(3.4.1)-45 2220 y(for)e(these)g(default)h(colors.)-45
- X2340 y Fg(3.2)56 b(Quiting)18 b(XviG)-45 2426 y Fn(The)f(follo)o(wing)h
- X(function)g(call)f(m)o(ust)g(b)q(e)g(the)g(last)g(one)g(from)f(the)h
- XFk(XviG)f Fn(pac)o(k)m(age)h(and)g(m)o(ust)f(b)q(e)i(called)g(exactly)-45
- X2482 y(once.)-45 2578 y(Syn)o(tax)d(:)27 2665 y Ff(void)23
- Xb(XviG_Exit\(void\))-45 2751 y Fn(This)13 b(function)g(will)h(close)f(all)h
- X(op)q(en)f(windo)o(ws)f(and)h(delete)g(all)g(user-de\014ned)h(cursors,)e(if)h
- X(not)f(y)o(et)g(closed)h(or)f(deleted)-45 2808 y(resp)q(ectiv)o(ely)17
- Xb(b)o(y)e(the)g(user)h(program.)943 2932 y(4)p eop
- X%%Page: 5 6
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
- Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fg(3.3)56
- Xb(Ab)r(out)18 b(Windo)n(ws)-45 202 y Fk(XviG)f Fn(allo)o(ws)h(the)g(user)f
- 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)
- 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
- X(these)f(windo)o(w)g(to)g(dra)o(w)g(or)f(to)h(ask)g(cursor)f(input.)21
- 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.)
- X-45 315 y(Di\013eren)o(t)f(windo)o(ws)h(are)g(de\014ned)g(b)o(y)g(their)g
- X(name.)20 b(Only)c(one)e(windo)o(w)h(can)g(b)q(e)g(selected)h(for)e(output)g
- X(or)h(input)g(at)-45 371 y(the)g(same)g(time.)-45 488 y Fl(3.3.1)52
- Xb(Op)q(ening)19 b(a)f(Windo)o(w)-45 574 y Fn(Syn)o(tax)d(:)27
- X653 y Ff(int)23 b(XviG_OpenWindow\(char)e(*name,)504 709 y(int)i(x,)504
- X766 y(int)g(y,)504 822 y(unsigned)g(int)g(*width,)504 879 y(unsigned)g(int)g
- X(*height\))-45 958 y Fn(Input)16 b(parameters)f(:)23 1036 y
- XFm(\017)23 b Ff(name)14 b Fn(:)69 1093 y(The)h(name)g(de\014ning)i(the)e
- X(windo)o(w.)21 b(This)15 b(name)h(m)o(ust)e(b)q(e)i(unique.)23
- X1181 y Fm(\017)23 b Ff(x)15 b Fn(and)g Ff(y)g Fn(:)69 1237
- Xy(The)g(screen)h(co)q(ordinates)g(of)e(the)i(upp)q(er)g(left)f(corner)g(of)g
- X(the)g(windo)o(w)h(p)q(osition)g(on)f(the)h(screen.)69 1294
- Xy(If)f(one)h(of)f(these)g(v)m(alues)i(is)e(negativ)o(e,)h(the)f(p)q
- 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)
- Xo(trol)f(of)f(the)69 1350 y(windo)o(w)h(manager,)f(if)i(one)f(is)h(running)g
- X(for)f(the)g(screen)h(y)o(ou)f(are)g(displa)o(ying)i(on.)-45
- X1429 y(Input/output)f(parameters)e(:)23 1508 y Fm(\017)23 b
- XFf(width)14 b Fn(and)i Ff(height)e Fn(:)69 1564 y(As)h(input,)h(these)f
- X(parameters)g(sp)q(ecify)h(the)f(initial)j(width)d(and)h(heigh)o(t)f(of)g
- X(the)h(windo)o(w.)69 1621 y(As)g(output,)g(they)g(sp)q(ecify)h(the)f(actual)h
- 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
- X(c)o(hanged)f(b)o(y)g(the)69 1677 y(windo)o(w)f(manager.)-45
- X1756 y(Return)h(v)m(alue)g(:)23 1835 y Fm(\017)23 b Ff(1)15
- Xb Fn(if)g(the)h(windo)o(w)f(has)g(b)q(een)i(op)q(ened)f(successfully)l(.)23
- 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
- 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
- X(already)h(exists.)-45 2001 y(See)d(also)g(section)g(4.3.1)e(ab)q(out)i(the)f
- X(resource)h(manager)f(for)g(more)g(info)h(ab)q(out)g(the)f(p)q(ositioning)j
- X(and)e(size)g(of)f Fk(XviG)-45 2058 y Fn(windo)o(ws)k(on)f(the)g(screen.)-45
- X2175 y Fl(3.3.2)52 b(Closing)18 b(a)g(Windo)o(w)-45 2261 y
- XFn(Syn)o(tax)d(:)27 2340 y Ff(int)23 b(XviG_CloseWindow\(char)e(*name\))-45
- X2418 y Fn(Input)16 b(parameter)f(:)23 2497 y Fm(\017)23 b Ff(name)14
- Xb Fn(:)69 2554 y(The)h(name)g(of)g(the)h(windo)o(w)f(to)f(close.)-45
- X2632 y(Return)i(v)m(alue)g(:)23 2711 y Fm(\017)23 b Ff(1)15
- Xb Fn(if)g(the)h(windo)o(w)f(has)g(b)q(een)i(closed)f(successfully)l(.)23
- 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
- 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
- X(es)h(not)e(exist.)943 2932 y(5)p eop
- X%%Page: 6 7
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
- Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.3.3)52
- Xb(Selecting)19 b(a)f(Windo)o(w)-45 202 y Fn(T)l(o)12 b(direct)i(the)e(output)
- Xg(to)g(a)g(sp)q(eci\014c)j(windo)o(w)d(\(dra)o(wing)g(ob)s(jects\))g(and)g
- X(to)g(get)g(input)i(from)d(the)i(windo)o(w)g(\(windo)o(w)-45
- X258 y(size,)j(cursor)f(input\),)g(the)h(windo)o(w)f(m)o(ust)g(b)q(e)g
- X(selected)i(\014rst.)-45 315 y(Remark)e(that)g(the)g(last)g(windo)o(w)h(that)
- Xe(has)h(b)q(een)i(op)q(ened)f(is)g(automatically)f(selected.)-45
- X410 y(Syn)o(tax)g(:)27 504 y Ff(int)23 b(XviG_SelectWindow\(char)e(*name\))
- X-45 598 y Fn(Input)16 b(parameter)f(:)23 692 y Fm(\017)23 b
- XFf(name)14 b Fn(:)69 748 y(The)h(name)g(of)g(the)h(windo)o(w)f(to)f(select.)
- X-45 842 y(Return)i(v)m(alue)g(:)23 936 y Fm(\017)23 b Ff(1)15
- Xb Fn(if)g(the)h(windo)o(w)f(has)g(b)q(een)i(selected.)23 1030
- Xy Fm(\017)23 b Ff(0)15 b Fn(if)g(the)h(windo)o(w)f(with)h(the)f(sp)q
- X(eci\014ed)i(name)f(do)q(es)f(not)g(exist.)-45 1150 y Fl(3.3.4)52
- Xb(Asking)17 b(for)g(the)h(Size)g(of)f(a)h(Windo)o(w)-45 1235
- 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
- X(resized,)g(e.g.)27 b(b)o(y)17 b(the)h(windo)o(w)g(manager.)26
- 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)
- Xg(the)g(\(new\))g(size)h(of)f(a)g(windo)o(w.)-45 1387 y(Syn)o(tax)g(:)27
- X1481 y Ff(void)23 b(XviG_WindowSize\(unsigned)e(int)i(*width,)528
- X1538 y(unsigned)g(int)g(*height\))-45 1632 y Fn(Output)16 b(parameters)e(:)23
- X1725 y Fm(\017)23 b Ff(width)14 b Fn(and)i Ff(height)e Fn(:)69
- X1782 y(The)h(actual)h(width)f(and)h(heigh)o(t)f(of)g(the)g(curren)o(tly)h
- X(selected)h(windo)o(w.)-45 1876 y(See)f(also)f(section)h(2.2)e(for)h(the)g
- X(side)h(e\013ect)f(of)g(this)h(function)g(call.)-45 1996 y
- 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
- 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
- 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
- X(manager.)22 b(A)o(t)16 b(an)o(y)-45 2138 y(momen)o(t,)e(the)i(user)f
- X(program)f(can)h(ask)g(the)g(\(new\))g(p)q(osition)h(of)f(a)g(windo)o(w)g(on)
- Xh(the)f(screen.)-45 2234 y(Syn)o(tax)g(:)27 2327 y Ff(void)23
- Xb(XviG_WindowPosition\(int)e(*x,)623 2384 y(int)j(*y\))-45
- X2478 y Fn(Output)16 b(parameters)e(:)23 2571 y Fm(\017)23 b
- XFf(x)15 b Fn(and)g Ff(y)g Fn(:)69 2628 y(The)g(actual)h(p)q(osition)g(\(upp)q
- X(er)g(left)f(corner\))g(of)g(the)g(curren)o(tly)h(selected)g(windo)o(w.)943
- X2932 y(6)p eop
- X%%Page: 7 8
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
- Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.3.6)52
- Xb(Erasing)18 b(a)g(Windo)o(w)-45 202 y Fn(The)c(follo)o(wing)h(function)g
- X(erases)e(the)h(con)o(ten)o(ts)g(of)f(the)h(curren)o(tly)g(selected)h(windo)o
- 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
- X(kground)g(color)g(\(=)h(blac)o(k\).)-45 354 y(Syn)o(tax)f(:)27
- X438 y Ff(void)23 b(XviG_ClearWindow\(void\))-45 558 y Fg(3.4)56
- Xb(Setting)18 b(Dra)n(w)h(A)n(ttributes)-45 644 y Fn(Dra)o(w)d(attributes)h
- X(are)g(the)h(color,)f(the)h(linest)o(yle,)h(the)f(linewidth)h(and)f(the)f
- X(\014llst)o(yle.)28 b(These)18 b(attributes)f(are)g(not)-45
- X700 y(related)e(to)e(one)h(windo)o(w,)g(but)g(are)f(global)i(to)e(all)i
- X(windo)o(ws.)20 b(When)14 b(an)g(attribute)f(is)i(set,)e(it)i(remains)f(v)m
- X(alid)h(for)f(all)-45 757 y(subsequen)o(t)i(dra)o(w)e(calls,)i(un)o(til)h
- X(the)e(attribute)g(v)m(alue)h(is)g(c)o(hanged.)-45 875 y Fl(3.4.1)52
- Xb(Setting)19 b(the)e(Color)-45 961 y Fn(T)l(o)e(set)g(the)g(color)h(for)e
- X(subsequen)o(t)i(dra)o(w)e(calls,)i(use)g(the)f(follo)o(wing)h(function.)-45
- X1056 y(Syn)o(tax)f(:)27 1140 y Ff(void)23 b(XviG_SetColor\(int)f(nr\))-45
- X1224 y Fn(Input)16 b(parameter)f(:)23 1309 y Fm(\017)23 b Ff(nr)15
- Xb Fn(:)69 1365 y(The)h(en)o(try)f(in)h(the)g(colormap)f(de\014ned)i(with)f
- X(the)f Ff(XviG)p 1049 1365 15 2 v 17 w(Init)g Fn(function.)21
- Xb(The)16 b(\014rst)f(en)o(try)g(gets)g(n)o(um)o(b)q(er)h(0,)69
- X1422 y(the)f(second)h(en)o(try)f(n)o(um)o(b)q(er)g(1,)g(etc.)69
- X1478 y(When)g(the)f(default)h(colormap)f(is)h(used,)g(the)f(follo)o(wing)h
- X(16)f(sym)o(b)q(ols)h(are)f(de\014ned)i(to)d(sp)q(ecify)j(this)f(parame-)69
- X1534 y(ter)g(:)331 1635 y Ff(XviG_COLOR_BLACK)331 1692 y(XviG_COLOR_WHITE)331
- X1748 y(XviG_COLOR_RED)331 1805 y(XviG_COLOR_GREEN)331 1861
- Xy(XviG_COLOR_BLUE)331 1918 y(XviG_COLOR_CYAN)331 1974 y(XviG_COLOR_MAGENTA)
- X331 2031 y(XviG_COLOR_YELLOW)331 2087 y(XviG_COLOR_ORANGE)331
- X2143 y(XviG_COLOR_GREEN_YELLOW)331 2200 y(XviG_COLOR_GREEN_CYAN)331
- X2256 y(XviG_COLOR_BLUE_CYAN)331 2313 y(XviG_COLOR_BLUE_MAGENTA)331
- X2369 y(XviG_COLOR_RED_MAGENTA)331 2426 y(XviG_COLOR_DARK_GRAY)331
- X2482 y(XviG_COLOR_LIGHT_GRAY)-45 2640 y Fn(A)g(de\014nition)i(of)e(the)g(n)o
- 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
- X(ailable)h(:)122 2724 y Ff(XviG_NR_OF_COLORS)-45 2808 y Fn(whic)o(h)f(has)f
- X(a)g(v)m(alue)i(of)d(16.)943 2932 y(7)p eop
- X%%Page: 8 9
- Xbop -45 -46 a Fl(XviG)17 b(Users)g(Man)o(ual)1135 b Fj(The)16
- Xb(XviG)f(F)l(unctions)p -45 -28 1999 2 v -45 116 a Fl(3.4.2)52
- Xb(Setting)19 b(the)e(Line)i(St)o(yle)e(and)h(Line)h(Width)-45
- X202 y Fn(T)l(o)c(set)g(the)g(line)i(attributes)e(for)g(subsequen)o(t)h(dra)o
- X(w)e(calls,)i(use)f(the)h(follo)o(wing)g(function.)-45 297
- Xy(Syn)o(tax)f(:)27 391 y Ff(void)23 b(XviG_SetLineStyle\(int)e(nr,)576
- X448 y(unsigned)h(int)i(width\))-45 541 y Fn(Input)16 b(parameters)f(:)23
- X635 y Fm(\017)23 b Ff(nr)15 b Fn(:)69 692 y(The)g(iden)o(ti\014cation)i(n)o
- 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
- X(or)e(p)q(olygons)i(with.)23 785 y Fm(\017)23 b Ff(width)14
- Xb Fn(:)69 842 y(The)h(width)h(of)f(the)g(lines.)69 898 y(Notice)g(that)e(a)h
- 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
- X(t)f(results.)20 b(A)14 b(0)g(v)m(alue)i(sp)q(eci\014es)g(a)e(simple)69
- 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
- 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
- X(yles)i(in)f Fk(XviG)e Fn(is)i(giv)o(en)g(b)o(y)f(:)122 1142
- Xy Ff(XviG_NR_OF_LINESTYLES)-45 1236 y Fn(whic)o(h)h(has)f(a)g(v)m(alue)i(of)d
- X(8.)-45 1332 y(Figure)h(1)f(sho)o(ws)g(the)g(8)g(di\013eren)o(t)h(linest)o
- X(yles)h(with)e(their)h(iden)o(ti\014cation)h(n)o(um)o(b)q(er)f(whic)o(h)g
- X(are)f(a)o(v)m(ailable)i(in)g Fk(XviG)p Fn(.)458 1391 y
- X 15984967 12235407 0 0 15984967 12235407 startTexFig
- X458 1391 a
- X%%BeginDocument: line.eps
- X/inch {72 mul} def
- X/picstr 31 string def
- X/plotimage
- X{243 186 1 [243 0 0 -186 0 186]
- X {currentfile picstr readhexstring pop}
- X image
- X} def
- Xgsave
- X243 186 scale
- Xplotimage
- Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- Xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
- Xfffffffff00000000000000666666666666666601980660198066c0c0c0c
- X0c0c0c0cfff7fffffffffffff6ffffffffffffffffffffffffffffedffff
- Xfffffffffefff7fffffffffffff6ffffffffffffffffffffffffffffedff
- Xfffffffffffefff7fffffffffffff7ffffffffffffff6fffffffffffffef
- Xfffffffffffffefff7fffffffffffff7ffffffffffffff6fffffffffffff
- Xeffffffffffffffefff7fffffffffffff6ffffffffffffffffffffffffff
- Xffedfffffffffffffffff7fffffffffffff6ffffffffffffffffffffffff
- Xffffedfffffffffffffffff7fffffffffffff7ffffffffffffff6fffffff
- Xffffffedfffffffffffffefff7fffffffffffff7ffffffffffffff6fffff
- Xfffffffffdfffffffffffffefff7fffffffffffff6ffffffffffffffefff
- Xfffffffffffdfffffffffffffefff7fffffffffffff6ffffffffffffffef
- Xffffffffffffedfffffffffffffefff7fffffffffffff7ffffffffffffff
- X6fffffffffffffeffffffffffffffefff7fffffffffffff7ffffffffffff
- Xff6ffffffffffffffffffffffffffffefff7fffffffffffff6ffffffffff
- Xffffeffffffffffffffdfffffffffffffffff7fffffffffffff6ffffffff
- Xffffffefffffffffffffedfffffffffffffffff7fffffffffffff7ffffff
- Xffffffff7fffffffffffffedfffffffffffffefff7fffffffffffff7ffff
- Xffffffffff7fffffffffffffedfffffffffffffefff7fffffffffffff6ff
- Xffffffffffffefffffffffffffedfffffffffffffefff7fffffffffffff6
- Xffffffffffffffefffffffffffffedfffffffffffffefff7ffffffffffff
- Xf7ffffffffffffff7fffffffffffffeffffffffffffffefff7ffffffffff
- Xfff7ffffffffffffff7fffffffffffffeffffffffffffffefff7ffffffff
- Xfffff6ffffffffffffffefffffffffffffedfffffffffffffffff7ffffff
- Xfffffff6ffffffffffffffeffffffffffffffdfffffffffffffffff7ffff
- Xfffffffff7ffffffffffffff6ffffffffffffffdfffffffffffffefff7ff
- Xfffffffffff7ffffffffffffff6fffffffffffffedfffffffffffffefff7
- Xfffffffffffff6ffffffffffffffefffffffffffffedfffffffffffffeff
- Xf7fffffffffffff6ffffffffffffffeffffffffffffffdfffffffffffffe
- Xfff7fffffffffffff7ffffffffffffff6fffffffffffffffffffffffffff
- Xfefff7fffffffffffff7ffffffffffffff6fffffffffffffefffffffffff
- Xfffefff7fffffffffffff6ffffffffffffffffffffffffffffedffffffff
- Xfffffffff7fffffffffffff6ffffffffffffffffffffffffffffedffffff
- Xfffffffffff7fffffffffffff7ffffffffffffff6fffffffffffffedffff
- Xfffffffffefff7fffffffffffff7ffffffffffffff6fffffffffffffedff
- Xfffffffffffefff7fffffffffffff6ffffffffffffffffffffffffffffed
- Xfffffffffffffefff7fffffffffffff6ffffffffffffffffffffffffffff
- Xedfffffffffffffefff7fffffffffffff7ffffffffffffff6fffffffffff
- Xffeffffffffffffffefff7fffffffffffff7ffffffffffffff6fffffffff
- Xfffffffffffffffffffefff7fffffffffffff6ffffffffffffffefffffff
- Xfffffffdfffffffffffffffff7fffffffffffff6ffffffffffffffefffff
- Xffffffffedfffffffffffffffff7fffffffffffff7ffffffffffffff6fff
- Xffffffffffedfffffffffffffefff7fffffffffffff7ffffffffffffff6f
- Xfffffffffffffdfffffffffffffefff7fffffffffffff6ffffffffffffff
- Xeffffffffffffffdfffffffffffffefff7fffffffffffff6ffffffffffff
- Xffefffffffffffffedfffffffffffffefff7fffffffffffff7ffffffffff
- Xffff7fffffffffffffeffffffffffffffefff7fffffffffffff7ffffffff
- Xffffff7fffffffffffffeffffffffffffffefff7fffffffffffff6ffffff
- Xffffffffefffffffffffffedfffffffffffffffff7fffffffffffff6ffff
- END_OF_FILE
- if test 33567 -ne `wc -c <'version_1.1/man/xvig.ps.4'`; then
- echo shar: \"'version_1.1/man/xvig.ps.4'\" unpacked with wrong size!
- fi
- # end of 'version_1.1/man/xvig.ps.4'
- fi
- if test -f 'version_1.1/src/ftext.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'version_1.1/src/ftext.c'\"
- else
- echo shar: Extracting \"'version_1.1/src/ftext.c'\" \(6557 characters\)
- sed "s/^X//" >'version_1.1/src/ftext.c' <<'END_OF_FILE'
- X/* File>>> ftext.c
- X--
- X-- %M% -- version %I% (IMEC) last updated: %E%
- X--
- X-- Copyright (c) 1993
- X-- IMEC vzw
- X-- Kapeldreef 75
- X-- B-3001 LEUVEN
- X-- BELGIUM
- X--
- X-- Author : A. Demaree
- X--
- X-- Date : September 27, 1993
- X--
- X-- Function : Routines to draw text using fonts.
- X--
- X-- Comment :
- X--
- X-- Review :
- X--
- X*/
- X
- X
- X/*------------------------------------------------------------------------------
- X-- Global include files
- X------------------------------------------------------------------------------*/
- X
- X#include <stdlib.h>
- X#include <stdio.h>
- X#include <string.h>
- X#include <X11/Xlib.h>
- X
- X/*------------------------------------------------------------------------------
- X-- Local include files
- X------------------------------------------------------------------------------*/
- X
- X#include "xviglocal.h"
- X
- X/*------------------------------------------------------------------------------
- X-- Local type definitions
- X------------------------------------------------------------------------------*/
- X
- Xtypedef struct FontItem aFontItem, *FontItem;
- X
- Xstruct FontItem {
- X char *name;
- X XFontStruct *font_struct;
- X int status; /* (-1 = error) (0 = not yet loaded) (1 = ok) */
- X};
- X
- X/*------------------------------------------------------------------------------
- X-- Static variable declarations
- X------------------------------------------------------------------------------*/
- X
- Xstatic FontItem fontList = (FontItem) NULL;
- Xstatic int nr_of_fonts = 0;
- Xstatic int current_font = 0;
- Xstatic char *def_fontlist[5] = {
- X "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1",
- X "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1",
- X "-adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1",
- X "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1",
- X "-adobe-courier-medium-r-normal--24-240-75-75-m-150-iso8859-1" };
- X
- X/*------------------------------------------------------------------------------
- X-- Local function declarations
- X------------------------------------------------------------------------------*/
- X
- Xstatic void get_fontnames(void);
- X
- X/*------------------------------------------------------------------------------
- X--
- X--
- X--
- X------------------------------------------------------------------------------*/
- X
- Xint XviG_SetFont(int nr)
- X{
- X if (!fontList)
- X get_fontnames();
- X
- X if (nr_of_fonts == 0)
- X {
- X fprintf(stderr, "ERROR : No fontnames defined to select.\n");
- X current_font = 0;
- X return 0;
- X }
- X
- X if ((nr < 1) || (nr > nr_of_fonts))
- X {
- X printf("WARNING : Invalid font number %d, using font number %d.\n",
- X nr, nr_of_fonts);
- X current_font = nr_of_fonts;
- X }
- X else
- X current_font = nr;
- X
- X nr = current_font - 1;
- X
- X if (fontList[nr].status == 1)
- X {
- X XSetFont(XviG_display, XviG_gc, fontList[nr].font_struct->fid);
- X return 1;
- X }
- X
- X if (fontList[nr].status == 0)
- X {
- X if (fontList[nr].font_struct =
- X XLoadQueryFont(XviG_display, fontList[nr].name))
- X {
- X fontList[nr].status = 1;
- X XSetFont(XviG_display, XviG_gc, fontList[nr].font_struct->fid);
- X return 1;
- X }
- X
- X fprintf(stderr, "ERROR : Cannot load font '%s'.\n", fontList[nr].name);
- X fontList[nr].status = -1;
- X current_font = 0;
- X return 0;
- X }
- X
- X if (fontList[nr].status == -1)
- X {
- X fprintf(stderr, "ERROR : Cannot select font '%s'.\n", fontList[nr].name);
- X current_font = 0;
- X return 0;
- X }
- X
- X current_font = 0;
- X return 0;
- X}
- X
- X/*------------------------------------------------------------------------------
- X--
- X--
- X--
- X------------------------------------------------------------------------------*/
- X
- Xstatic void get_fontnames(void)
- X{
- X int i;
- X
- X if ((i = XviG_GetRMMaxFonts()) == 0)
- X {
- X fontList = (FontItem) malloc(5 * sizeof(aFontItem));
- X fontList[0].status = fontList[1].status = fontList[2].status
- X = fontList[3].status = fontList[4].status
- X = 0;
- X fontList[0].name = def_fontlist[0];
- X fontList[1].name = def_fontlist[1];
- X fontList[2].name = def_fontlist[2];
- X fontList[3].name = def_fontlist[3];
- X fontList[4].name = def_fontlist[4];
- X nr_of_fonts = 5;
- X }
- X else
- X {
- X fontList = (FontItem) malloc(i * sizeof(aFontItem));
- X nr_of_fonts = i;
- X for (i = 0; i < nr_of_fonts; i++)
- X {
- X fontList[i].status = 0;
- X if (!(fontList[i].name = XviG_GetRMFontName(i+1)))
- X {
- X printf("WARNING : Maxfonts = %d, but only %d fontnames defined.\n",
- X nr_of_fonts, i);
- X nr_of_fonts = i;
- X }
- X }
- X }
- X}
- X
- X/*------------------------------------------------------------------------------
- X--
- X--
- X--
- X------------------------------------------------------------------------------*/
- X
- Xvoid XviG_FontText(char *contents,
- X int x,
- X int y)
- X{
- X if (current_font == 0)
- X {
- X fprintf(stderr, "ERROR : No font selected.\n");
- X return;
- X }
- X
- X XDrawString(XviG_display, XviG_window, XviG_gc,
- X x, y, contents, (int) strlen(contents));
- X XDrawString(XviG_display, XviG_pixmap, XviG_gc,
- X x, y, contents, (int) strlen(contents));
- X}
- X
- X/*------------------------------------------------------------------------------
- X--
- X--
- X--
- X------------------------------------------------------------------------------*/
- X
- Xvoid XviG_FontTextSize(char *contents,
- X int *x_offset,
- X int *y_offset,
- X unsigned int *width,
- X unsigned int *height)
- X{
- X int dir_rtn, ascent_rtn, descent_rtn;
- X XCharStruct overall_rtn;
- X
- X if (current_font == 0)
- X {
- X fprintf(stderr, "ERROR : No font selected.\n");
- X *x_offset = *y_offset = 0;
- X *width = *height = 0;
- X return;
- X }
- X
- X XTextExtents(fontList[current_font-1].font_struct,
- X contents, (int) strlen(contents),
- X &dir_rtn, &ascent_rtn, &descent_rtn, &overall_rtn);
- X
- X *x_offset = overall_rtn.lbearing;
- X *y_offset = overall_rtn.descent;
- X *width = overall_rtn.rbearing - overall_rtn.lbearing;
- X *height = overall_rtn.ascent + overall_rtn.descent;
- X}
- X
- X/*------------------------------------------------------------------------------
- X--
- X--
- X--
- X------------------------------------------------------------------------------*/
- X
- Xvoid XviG_CleanupFonts(void)
- X{
- X int i;
- X
- X if (fontList)
- X {
- X for (i = 0; i < nr_of_fonts; i++)
- X {
- X if (fontList[i].status == 1)
- X XFreeFont(XviG_display, fontList[i].font_struct);
- X }
- X
- X free(fontList);
- X
- X fontList = (FontItem) NULL;
- X nr_of_fonts = 0;
- X current_font = 0;
- X }
- X}
- END_OF_FILE
- if test 6557 -ne `wc -c <'version_1.1/src/ftext.c'`; then
- echo shar: \"'version_1.1/src/ftext.c'\" unpacked with wrong size!
- fi
- # end of 'version_1.1/src/ftext.c'
- fi
- if test -f 'version_1.1/src/init.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'version_1.1/src/init.c'\"
- else
- echo shar: Extracting \"'version_1.1/src/init.c'\" \(5313 characters\)
- sed "s/^X//" >'version_1.1/src/init.c' <<'END_OF_FILE'
- X/* File>>> init.c
- X--
- X-- %M% -- version %I% (IMEC) last updated: %E%
- X--
- X-- Copyright (c) 1993
- X-- IMEC vzw
- X-- Kapeldreef 75
- X-- B-3001 LEUVEN
- X-- BELGIUM
- X--
- X-- Author : A. Demaree
- X--
- X-- Date : February 1, 1993
- X--
- X-- Function :
- X--
- X-- Comment :
- X--
- X-- Review :
- X--
- X*/
- X
- X
- X/*------------------------------------------------------------------------------
- X-- Global include files
- X------------------------------------------------------------------------------*/
- X
- X#include <stdlib.h>
- X#include <stdio.h>
- X#include <string.h>
- X#include <sys/file.h>
- X#include <X11/Xlib.h>
- X
- X/*------------------------------------------------------------------------------
- X-- Local include files
- X------------------------------------------------------------------------------*/
- X
- X#define MAIN
- X#include "xviglocal.h"
- X#undef MAIN
- X
- X/*------------------------------------------------------------------------------
- X-- Static variable declarations
- X------------------------------------------------------------------------------*/
- X
- X
- X/*------------------------------------------------------------------------------
- X-- Local function declarations
- X------------------------------------------------------------------------------*/
- X
- X
- X/*------------------------------------------------------------------------------
- X--
- X--
- X--
- X------------------------------------------------------------------------------*/
- X
- Xint XviG_Init(char *classname,
- X int color_array[][3],
- X int nr_of_colors)
- X{
- X XGCValues xgcv;
- X
- X printf("\n>>> XviG Graphics Package Copyright Imec (c) 1993 <<<\n\n");
- X
- X /*
- X -- Get the environment variable 'XVIG' and check it
- X */
- X
- X if (!(XviG_pathname = getenv("XVIG")))
- X {
- X fprintf(stderr,
- X "ERROR : Environment variable 'XVIG' has not been defined.\n");
- X return 0;
- X }
- X
- X if (access(XviG_pathname, F_OK) == -1)
- X {
- X fprintf(stderr, "ERROR : File '%s' not found.\n", XviG_pathname);
- X return 0;
- X }
- X
- X if (access(XviG_pathname, X_OK) == -1)
- X {
- X fprintf(stderr, "ERROR : File '%s' is not executable.\n", XviG_pathname);
- X return 0;
- X }
- X
- X /*
- X -- Open the display
- X */
- X
- X if (!(XviG_display = XOpenDisplay(NULL)))
- X {
- X char *dname;
- X
- X if (!(dname = getenv("DISPLAY")))
- X fprintf(stderr,
- X "ERROR : Environment variable 'DISPLAY' has not been defined.\n");
- X else
- X fprintf(stderr,
- X "ERROR : Cannot open display '%s'.\n", dname);
- X
- X return 0;
- X }
- X
- X XviG_screen_nr = DefaultScreen(XviG_display);
- X
- X /*
- X -- Create a dummy window
- X */
- X
- X if (!(XviG_dummy_window = XCreateSimpleWindow(XviG_display,
- X RootWindow(XviG_display, XviG_screen_nr),
- X 0, 0, 10, 10, 0,
- X WhitePixel(XviG_display, XviG_screen_nr),
- X BlackPixel(XviG_display, XviG_screen_nr))))
- X {
- X fprintf(stderr, "ERROR : Cannot create dummy window.\n");
- X XCloseDisplay(XviG_display);
- X
- X return 0;
- X }
- X
- X XSelectInput(XviG_display, XviG_dummy_window, KeyPressMask | ButtonPressMask);
- X
- X /*
- X -- About the Graphical Context, create a separate one for drawing simple
- X -- objects and for drawing filled objects to avoid interference
- X */
- X
- X xgcv.graphics_exposures = False;
- X XviG_gc = XCreateGC(XviG_display, XviG_dummy_window,
- X GCGraphicsExposures, &xgcv);
- X XviG_gc_fill = XCreateGC(XviG_display, XviG_dummy_window,
- X GCGraphicsExposures, &xgcv);
- X
- X /*
- X -- Create the colors and the fillpatterns
- X */
- X
- X XviG_CreateColors(color_array, nr_of_colors);
- X XviG_CreateFillpatterns();
- X
- X /*
- X -- Create the Atoms (unique numbers) for the ClientMessage events
- X */
- X
- X XviG_MESSAGE_INIT =
- X XInternAtom(XviG_display, MESSAGE_INIT, False);
- X XviG_MESSAGE_KEY =
- X XInternAtom(XviG_display, MESSAGE_KEY, False);
- X XviG_MESSAGE_BUTTON =
- X XInternAtom(XviG_display, MESSAGE_BUTTON, False);
- X XviG_MESSAGE_KEY_BUTTON =
- X XInternAtom(XviG_display, MESSAGE_KEY_BUTTON, False);
- X XviG_MESSAGE_SIZE =
- X XInternAtom(XviG_display, MESSAGE_SIZE, False);
- X XviG_MESSAGE_SENSEKBD_ON =
- X XInternAtom(XviG_display, MESSAGE_SENSEKBD_ON, False);
- X XviG_MESSAGE_SENSEKBD_OFF =
- X XInternAtom(XviG_display, MESSAGE_SENSEKBD_OFF, False);
- X XviG_MESSAGE_SENSEKBD =
- X XInternAtom(XviG_display, MESSAGE_SENSEKBD, False);
- X XviG_MESSAGE_CURSOR =
- X XInternAtom(XviG_display, MESSAGE_CURSOR, False);
- X XviG_MESSAGE_QUIT =
- X XInternAtom(XviG_display, MESSAGE_QUIT, False);
- X
- X /*
- X -- About the Resource Manager
- X */
- X
- X if (classname)
- X {
- X XviG_class = STRNEW(classname);
- X XviG_GetRMDatabase();
- X }
- X else
- X XviG_class = (char *) NULL;
- X
- X XviG_cursor_mode = False;
- X
- X return 1;
- X}
- X
- X/*------------------------------------------------------------------------------
- X--
- X--
- X--
- X------------------------------------------------------------------------------*/
- X
- Xvoid XviG_Exit(void)
- X{
- X XviG_DeleteRMDatabase();
- X
- X XviG_CleanupWindows();
- X XviG_CleanupCursors();
- X XviG_CleanupFillpatterns();
- X XviG_CleanupFonts();
- X
- X XFreeGC(XviG_display, XviG_gc);
- X XFreeGC(XviG_display, XviG_gc_fill);
- X
- X XDestroyWindow(XviG_display, XviG_dummy_window);
- X XCloseDisplay(XviG_display);
- X}
- END_OF_FILE
- if test 5313 -ne `wc -c <'version_1.1/src/init.c'`; then
- echo shar: \"'version_1.1/src/init.c'\" unpacked with wrong size!
- fi
- # end of 'version_1.1/src/init.c'
- fi
- echo shar: End of archive 6 \(of 10\).
- cp /dev/null ark6isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 10 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- echo "Merging xvig.ps parts... "
- cat version_1.1/man/xvig.ps.? > version_1.1/man/xvig.ps
- rm version_1.1/man/xvig.ps.?
- echo "Done."
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
- --
- // chris@Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! | sources-x@sterling.com
- "It's intuitively obvious to the |
- most casual observer..." | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
-