1fd7d9bd3Smrg/*
2fd7d9bd3Smrg** xgc
3fd7d9bd3Smrg**
4fd7d9bd3Smrg** xgc.h
5fd7d9bd3Smrg*/
6fd7d9bd3Smrg
7fd7d9bd3Smrg#include "constants.h"
8fd7d9bd3Smrg
9fd7d9bd3Smrgtypedef struct {
10fd7d9bd3Smrg  Display  *dpy;		/* the display! */
11fd7d9bd3Smrg  Screen   *scr;		/* the screen! */
12fd7d9bd3Smrg  Window    win;		/* the window the test runs in */
13fd7d9bd3Smrg  GC        gc;			/* the GC! */
14fd7d9bd3Smrg  GC        miscgc;		/* used for doing stuff when we don't want
15fd7d9bd3Smrg				   to change the normal GC */
16fd7d9bd3Smrg  XGCValues gcv;		/* a separate copy of what's in the GC,
17fd7d9bd3Smrg				   since we're not allowed to look in it */
18fd7d9bd3Smrg  Pixmap    tile;		/* what we tile with */
19fd7d9bd3Smrg  Pixmap    stipple;		/* what we stipple with */
20fd7d9bd3Smrg  XImage   *image;		/* image for GetImage & PutImage */
21fd7d9bd3Smrg  int       test;		/* which test is being run */
22fd7d9bd3Smrg  float     percent;		/* percentage of test to run */
23fd7d9bd3Smrg  Pixel     foreground;
24fd7d9bd3Smrg  Pixel     background;
25fd7d9bd3Smrg  char      *fontname;
26fd7d9bd3Smrg} XStuff;                       /* All the stuff that only X needs to
27fd7d9bd3Smrg                                   know about */
28fd7d9bd3Smrg
29fd7d9bd3Smrgtypedef struct {
30fd7d9bd3Smrg  char name[40];  		/* name as it will appear on the screen */
31fd7d9bd3Smrg  char text[40];	       	/* Xgc command it translates to */
32fd7d9bd3Smrg  int num_commands;		/* number of command buttons inside it */
33fd7d9bd3Smrg  int columns;			/* how many columns of command buttons; if
34fd7d9bd3Smrg				   0, then there's only one row */
35fd7d9bd3Smrg  struct {
36fd7d9bd3Smrg    char name[40];		/* name as it will appear on the screen */
37fd7d9bd3Smrg    char text[40];   		/* Xgc command it translates to */
38fd7d9bd3Smrg  } command_data[MAXCHOICES];
39e53c48bfSmrg} ChoiceStuff;			/* All the info needed to deal with a
40fd7d9bd3Smrg				   choice widget */
41fd7d9bd3Smrgtypedef struct {
42fd7d9bd3Smrg  const char *name;
43fd7d9bd3Smrg  const char *text;
44fd7d9bd3Smrg  int code;
45fd7d9bd3Smrg} XgcData;
46fd7d9bd3Smrg
47fd7d9bd3Smrgtypedef struct {
48fd7d9bd3Smrg  struct {
49fd7d9bd3Smrg    const char *name;
50fd7d9bd3Smrg    const char *text;
51fd7d9bd3Smrg    int   num_toggles;
52fd7d9bd3Smrg    int   columns;
53fd7d9bd3Smrg  } choice;
54fd7d9bd3Smrg  XgcData *data;
55fd7d9bd3Smrg} XgcStuff;
56fd7d9bd3Smrg
57fd7d9bd3Smrgtypedef struct {
58fd7d9bd3Smrg  Widget label;
59fd7d9bd3Smrg  int size;
60fd7d9bd3Smrg  WidgetList widgets;
61fd7d9bd3Smrg} ChoiceDesc;
62fd7d9bd3Smrg
63fd7d9bd3Smrg/************/
64fd7d9bd3Smrg
65fd7d9bd3Smrgextern XStuff X;
66fd7d9bd3Smrgextern Widget topform;
67fd7d9bd3Smrgextern XtAppContext appcontext;
68fd7d9bd3Smrg
69fd7d9bd3Smrgextern XgcStuff TestStuff;
70fd7d9bd3Smrgextern XgcStuff FunctionStuff;
71fd7d9bd3Smrgextern XgcStuff LinestyleStuff;
72fd7d9bd3Smrgextern XgcStuff CapstyleStuff;
73fd7d9bd3Smrgextern XgcStuff JoinstyleStuff;
74fd7d9bd3Smrgextern XgcStuff FillstyleStuff;
75fd7d9bd3Smrgextern XgcStuff FillruleStuff;
76fd7d9bd3Smrgextern XgcStuff ArcmodeStuff;
77fd7d9bd3Smrg
78fd7d9bd3Smrgextern ChoiceDesc *GCdescs[];
79fd7d9bd3Smrgextern ChoiceDesc *testchoicedesc;
80fd7d9bd3Smrgextern Widget test;
81fd7d9bd3Smrgextern Widget GCform;
82fd7d9bd3Smrgextern Widget foregroundtext;
83fd7d9bd3Smrgextern Widget backgroundtext;
84fd7d9bd3Smrgextern Widget linewidthtext;
85fd7d9bd3Smrgextern Widget fonttext;
86fd7d9bd3Smrgextern Widget dashlistchoice;
87fd7d9bd3Smrgextern Widget planemaskchoice;
88fd7d9bd3Smrgextern Widget testchoiceform;
89fd7d9bd3Smrg
90fd7d9bd3Smrgextern Widget result;
91fd7d9bd3Smrg
92fd7d9bd3Smrgextern Boolean recording;
93fd7d9bd3Smrgextern Widget filename_text_widget, recordbutton;
94fd7d9bd3Smrg
95fd7d9bd3Smrgextern int fildes[2];
96fd7d9bd3Smrgextern FILE *outend;
97fd7d9bd3Smrgextern FILE *yyin;
98fd7d9bd3Smrg
99fd7d9bd3Smrg/************/
100fd7d9bd3Smrg
101fd7d9bd3Smrgextern void change_percent(int, Boolean);
102fd7d9bd3Smrgextern void change_test(int, Boolean);
103fd7d9bd3Smrgextern void change_text(Widget, String);
104fd7d9bd3Smrgextern void choose_defaults(ChoiceDesc *[], int);
105fd7d9bd3Smrgextern void circle_line_test(int, int);
106fd7d9bd3Smrgextern void close_file_if_recording(void);
107fd7d9bd3Smrgextern void copyarea_test(void);
108fd7d9bd3Smrgextern void copyplane_test(void);
109fd7d9bd3Smrgextern ChoiceDesc * create_choice(Widget, XgcStuff *);
110fd7d9bd3Smrgextern void create_dashlist_choice(Widget);
111fd7d9bd3Smrgextern void create_planemask_choice(Widget);
112fd7d9bd3Smrgextern void create_testfrac_choice(Widget);
113fd7d9bd3Smrgextern Widget create_text_choice(Widget, int, int, int);
114fd7d9bd3Smrgextern void fillpolygon_test(void);
115fd7d9bd3Smrgextern void GC_change_arcmode(int, Boolean);
116fd7d9bd3Smrgextern void GC_change_background(unsigned long, Boolean);
117fd7d9bd3Smrgextern void GC_change_capstyle(int, Boolean);
118fd7d9bd3Smrgextern void GC_change_dashlist(int, Boolean);
119fd7d9bd3Smrgextern void GC_change_fillrule(int, Boolean);
120fd7d9bd3Smrgextern void GC_change_fillstyle(int, Boolean);
121fd7d9bd3Smrgextern void GC_change_font(char *, Boolean);
122fd7d9bd3Smrgextern void GC_change_foreground(unsigned long, Boolean);
123fd7d9bd3Smrgextern void GC_change_function(int, Boolean);
124fd7d9bd3Smrgextern void GC_change_joinstyle(int, Boolean);
125fd7d9bd3Smrgextern void GC_change_linestyle(int, Boolean);
126fd7d9bd3Smrgextern void GC_change_linewidth(int, Boolean);
127fd7d9bd3Smrgextern void GC_change_planemask(unsigned long, Boolean);
128fd7d9bd3Smrgextern void genericarc_test(Boolean);
129fd7d9bd3Smrgextern void genericrectangle_test(Boolean);
130fd7d9bd3Smrgextern void get_filename(void (*)(void), void (*)(void));
131fd7d9bd3Smrgextern void imagetext16_test(void);
132fd7d9bd3Smrgextern void imagetext8_test(void);
133fd7d9bd3Smrgextern void interpret(const char *);
134fd7d9bd3Smrgextern void line_up_labels(ChoiceDesc *[], int);
135fd7d9bd3Smrgextern void polyarc_test(void);
136fd7d9bd3Smrgextern void polyfillarc_test(void);
137fd7d9bd3Smrgextern void polyfillrectangle_test(void);
138fd7d9bd3Smrgextern void polyline_test(void);
139fd7d9bd3Smrgextern void polypoint_test(void);
140fd7d9bd3Smrgextern void polyrectangle_test(void);
141fd7d9bd3Smrgextern void polysegment_test(void);
142fd7d9bd3Smrgextern void polytext16_test(void);
143fd7d9bd3Smrgextern void polytext8_test(void);
144fd7d9bd3Smrgextern void print_if_recording(const char *);
145fd7d9bd3Smrgextern void putimage_test(void);
146fd7d9bd3Smrgextern void read_from_keyboard(void);
147fd7d9bd3Smrgextern void run_test(void);
148fd7d9bd3Smrgextern void select_button(ChoiceDesc *, int);
149fd7d9bd3Smrgextern void set_text(Widget, char *);
150fd7d9bd3Smrgextern void show_result(char *);
151fd7d9bd3Smrgextern void start_playback(void);
152fd7d9bd3Smrgextern void toggle_recordbutton(Widget, caddr_t, caddr_t);
153fd7d9bd3Smrgextern void update_dashlist(int);
154fd7d9bd3Smrgextern void update_planemask(long);
155fd7d9bd3Smrgextern void update_slider(int);
156fd7d9bd3Smrgextern void yyerror(const char *);
157fd7d9bd3Smrgextern int yylex(void);
158fd7d9bd3Smrgextern int yyparse(void);
159fd7d9bd3Smrgextern void yyrestart(FILE *);
160fd7d9bd3Smrgextern int yywrap(void);
161fd7d9bd3Smrg
162fd7d9bd3Smrg
163