Outline revision fd7d9bd3
1
2                        Outline for Xbench
3                        ------------------
4
5GENERAL
6-------
7
8Stuff starting with '-' are callbacks for that widget.
9'<>' means whatever is appropriate.
10
11Choice widgets will either be implemented as a new type of widget or a
12form containing a bunch of Command widgets.  The automatic callbacks for
13the commands are:
14   - set all children of parent to normal colors
15   - set oneself to reverse colors
16There will be a
17   - put <> in buffer, specified by the parent widget
18There will also be a
19   - put <>\n in buffer
20specific to each command.
21
22In general, the buffer does not need to be looked at until the test is
23actually run; however, if we decide to "gray out" choices in the Graphics
24Options window that have nothing to do with the benchmark, then choosing
25a benchmark must flush also.
26
27Widgets - we need to decide whether the windows that are turn-on-and-offable
28should be children of Form, or of TopLevel.  If they're children of Form,
29then the user won't be able to stack them or have a say in where they go.
30We also might run out of space.  If they're children of TopLevel, the user
31can decide where they go, but he's going to have to choose their location
32(with the wm) every time they come up.  I would vote for the latter approach.
33(Uh oh... I don't think that the TopLevel widget can have more than one
34child...)
35
36All choosing Widgets should write strings in the Xbench language to some
37buffer, where the actual testing thing can pull them out.
38
39
40
41HIERARCHY OF WIDGETS
42--------------------
43
44Form (form) surrounding the whole thing (owned by TopLevel)
45Title (label) on top describing version & current test (owned by Form)
46MenuLine (form) under Title giving top level choices (owned by Form)
47MenuLine contains these Commands:
48   Run
49       - flush the buffer
50       - run benchmark
51   BenchmarkOptionsOn
52       - map benchmark options window (BenchmarkOptions)
53   BenchmarkOptionsOff
54       - unmap benchmark options window
55   GraphicsOptionsOn
56       - map graphics options window (GraphicsOptions)
57   GraphicsOptionsOff
58       - unmap graphics options window
59   DescriptionOn
60       - map description window (Description)
61   DescriptionOff
62       - unmap description window
63   RecordingOn
64       - bring up dialog box for name of file
65       - start saving commands into file (set a global boolean TRUE)
66   RecordingOff
67       - stop saving commands into file (set the global boolean FALSE)
68   Playback
69       - bring up dialog box for name of file
70       - read from file until EOF
71   Quit
72       - quit
73   
74The toggling command buttons exist in pairs, of which only one is visible at
75any one point.  This makes callbacks/names of buttons easier to implement.
76
77---
78
79BenchmarkOptions (form) describing benchmark options (owned by Toplevel?)
80BenchmarkOptions contains:
81   TestChoice (choice) the 16 different test choices.
82       - put "test <>" in buffer
83       - put description of test in Description window
84       - call disable_gc_choices() with the GC field flags
85   Iterations (text) the number of times to run.
86       - put "iterations <>" in buffer
87   
88---
89
90GraphicsOptions (form) describing graphics options (owned by Toplevel?)
91GraphicsOptions contains:
92   ChooseFunction (choice)
93       - put "function <>" in buffer
94   ChooseColormap (choice)
95       - put "colormap <>" in buffer
96   Foreground (text)
97       - put "foreground <>" in buffer
98   Background (text)
99       - put "background <>" in buffer
100   LineWidth (text)
101       - put "linewidth <>" in buffer
102   LineStyle (choice)
103       - put "linestyle <>" in buffer
104   CapStyle (choice)
105       - put "capstyle <>" in buffer
106   JoinStyle (choice)
107       - put "joinstyle <>" in buffer
108   FillStyle (choice)
109       - put "fillstyle <>" in buffer
110   FillRule (choice)
111       - put "fillrule <>" in buffer
112   ArcMode (choice)
113       - put "arcmode <>" in buffer
114   TStipOrigin (text * 2)
115       - put "tsorigin <>" in buffer
116   DashList (???)
117       - put "dashlist <>" in buffer
118   DashOffset (text?)
119       - put "dashoffset <>" in buffer
120   ClipMask (choice)
121       - put "clipmask <>" in buffer
122   Planemask (text)
123       - put "planemask <>" in buffer
124
125We need specialized widgets for DashList, possibly TStipOrigin and DashOffset.
126
127Still to be decided: can one choose GC options that have no meaning for that
128  particular benchmark? I don't think it should be a problem.
129
130---
131
132Description (text) describing the current test (owned by Toplevel?)
133
134I really need to find out how to use sources and sinks for Text widgets -
135the documentation does not say how to do it.
136
137Every test will have a block of text associated with it.  When a new 
138benchmark is chosen, its associated text will become the source for the
139Description widget.  Note that we don't have to worry about whether 
140Description is mapped or not; we're just setting a source.
141
142---
143
144Analysis (text) describing the results of the current test (owned by Form -
145we always want this to be around)
146
147This will display the name of the test, the important values of the GC,
148the results of the test, and a short analysis thereof.  If more than
149one test of a particular benchmark is performed, it will be appended to
150the analysis source (not replacing it).  This will allow for comparing
151results obtained with different GC's.
152
153---
154
155Test (core + expose event handler) for doing the test.
156
157All this really needs to do, besides actually doing the test, is to
158time it and make sure the Analysis part knows about it.
159
160---
161
162RecordingOn / RecordingOff / Playback
163
164When the user presses Playback, pretty much all we have to do is to
1651) change the buffer to the file that he wants, and 2) start reading.
166The rest should be taken care of the buffer-interpreting module.
167
168RecordingOn changes the output buffer _and_ the input buffer to the 
169desired file.
170       
171RecordingOff changes them both back to the usual.
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192