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