summaryrefslogtreecommitdiff
path: root/xgc.h
blob: c3a7021ee497a4fed35412f9c0fd656e5c85bd7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/*
** xgc
**
** xgc.h
*/
/* $XFree86: xc/programs/xgc/xgc.h,v 1.5 2003/05/07 21:17:06 herrb Exp $ */

#include "constants.h"

typedef struct {
  Display  *dpy;		/* the display! */
  Screen   *scr;		/* the screen! */
  Window    win;		/* the window the test runs in */
  GC        gc;			/* the GC! */
  GC        miscgc;		/* used for doing stuff when we don't want
				   to change the normal GC */
  XGCValues gcv;		/* a separate copy of what's in the GC,
				   since we're not allowed to look in it */
  Pixmap    tile;		/* what we tile with */
  Pixmap    stipple;		/* what we stipple with */
  XImage   *image;		/* image for GetImage & PutImage */
  int       test;		/* which test is being run */
  float     percent;		/* percentage of test to run */
  Pixel     foreground;
  Pixel     background;
  char      *fontname;
} XStuff;                       /* All the stuff that only X needs to
                                   know about */

typedef struct {
  char name[40];  		/* name as it will appear on the screen */
  char text[40];	       	/* Xgc command it translates to */
  int num_commands;		/* number of command buttons inside it */
  int columns;			/* how many columns of command buttons; if
				   0, then there's only one row */
  struct {
    char name[40];		/* name as it will appear on the screen */
    char text[40];   		/* Xgc command it translates to */
  } command_data[MAXCHOICES];
} ChoiceStuff;			/* All the info needed to deal with a 
				   choice widget */
typedef struct {
  const char *name;
  const char *text;
  int code;
} XgcData;

typedef struct {
  struct {
    const char *name;
    const char *text;
    int   num_toggles;
    int   columns;
  } choice;
  XgcData *data;
} XgcStuff;

typedef struct {
  Widget label;
  int size;
  WidgetList widgets;
} ChoiceDesc;

#ifndef HAS_SNPRINTF
#include <X11/Xmu/SysUtil.h>
#define snprintf XmuSnprintf
#endif

/************/

extern XStuff X;
extern Widget topform;
extern XtAppContext appcontext;

extern XgcStuff TestStuff;
extern XgcStuff FunctionStuff;
extern XgcStuff LinestyleStuff;
extern XgcStuff CapstyleStuff;
extern XgcStuff JoinstyleStuff;
extern XgcStuff FillstyleStuff;
extern XgcStuff FillruleStuff;
extern XgcStuff ArcmodeStuff;

extern ChoiceDesc *GCdescs[];
extern ChoiceDesc *testchoicedesc;
extern Widget test;
extern Widget GCform;
extern Widget foregroundtext;
extern Widget backgroundtext;
extern Widget linewidthtext;
extern Widget fonttext;
extern Widget dashlistchoice;
extern Widget planemaskchoice;
extern Widget testchoiceform;

extern Widget result;

extern Boolean recording;
extern Widget filename_text_widget, recordbutton;

extern int fildes[2];
extern FILE *outend;
extern FILE *yyin;

/************/

extern void change_percent(int, Boolean);
extern void change_test(int, Boolean);
extern void change_text(Widget, String);
extern void choose_defaults(ChoiceDesc *[], int);
extern void circle_line_test(int, int);
extern void close_file_if_recording(void);
extern void copyarea_test(void);
extern void copyplane_test(void);
extern ChoiceDesc * create_choice(Widget, XgcStuff *);
extern void create_dashlist_choice(Widget);
extern void create_planemask_choice(Widget);
extern void create_testfrac_choice(Widget);
extern Widget create_text_choice(Widget, int, int, int);
extern void fillpolygon_test(void);
extern void GC_change_arcmode(int, Boolean);
extern void GC_change_background(unsigned long, Boolean);
extern void GC_change_capstyle(int, Boolean);
extern void GC_change_dashlist(int, Boolean);
extern void GC_change_fillrule(int, Boolean);
extern void GC_change_fillstyle(int, Boolean);
extern void GC_change_font(char *, Boolean);
extern void GC_change_foreground(unsigned long, Boolean);
extern void GC_change_function(int, Boolean);
extern void GC_change_joinstyle(int, Boolean);
extern void GC_change_linestyle(int, Boolean);
extern void GC_change_linewidth(int, Boolean);
extern void GC_change_planemask(unsigned long, Boolean);
extern void genericarc_test(Boolean);
extern void genericrectangle_test(Boolean);
extern void get_filename(void (*)(void), void (*)(void));
extern void imagetext16_test(void);
extern void imagetext8_test(void);
extern void interpret(const char *);
extern void line_up_labels(ChoiceDesc *[], int);
extern void polyarc_test(void);
extern void polyfillarc_test(void);
extern void polyfillrectangle_test(void);
extern void polyline_test(void);
extern void polypoint_test(void);
extern void polyrectangle_test(void);
extern void polysegment_test(void);
extern void polytext16_test(void);
extern void polytext8_test(void);
extern void print_if_recording(const char *);
extern void putimage_test(void);
extern void read_from_keyboard(void);
extern void run_test(void);
extern void select_button(ChoiceDesc *, int);
extern void set_text(Widget, char *);
extern void show_result(char *);
extern void start_playback(void);
extern void toggle_recordbutton(Widget, caddr_t, caddr_t);
extern void update_dashlist(int);
extern void update_planemask(long);
extern void update_slider(int);
extern void yyerror(const char *);
extern int yylex(void);
extern int yyparse(void);
extern void yyrestart(FILE *);
extern int yywrap(void);