| 1 |
|
| 2 |
Outline for Xbench |
| 3 |
------------------ |
| 4 |
|
| 5 |
GENERAL |
| 6 |
------- |
| 7 |
|
| 8 |
Stuff starting with '-' are callbacks for that widget. |
| 9 |
'<>' means whatever is appropriate. |
| 10 |
|
| 11 |
Choice widgets will either be implemented as a new type of widget or a |
| 12 |
form containing a bunch of Command widgets. The automatic callbacks for |
| 13 |
the commands are: |
| 14 |
- set all children of parent to normal colors |
| 15 |
- set oneself to reverse colors |
| 16 |
There will be a |
| 17 |
- put <> in buffer, specified by the parent widget |
| 18 |
There will also be a |
| 19 |
- put <>\n in buffer |
| 20 |
specific to each command. |
| 21 |
|
| 22 |
In general, the buffer does not need to be looked at until the test is |
| 23 |
actually run; however, if we decide to "gray out" choices in the Graphics |
| 24 |
Options window that have nothing to do with the benchmark, then choosing |
| 25 |
a benchmark must flush also. |
| 26 |
|
| 27 |
Widgets - we need to decide whether the windows that are turn-on-and-offable |
| 28 |
should be children of Form, or of TopLevel. If they're children of Form, |
| 29 |
then the user won't be able to stack them or have a say in where they go. |
| 30 |
We also might run out of space. If they're children of TopLevel, the user |
| 31 |
can 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 |
| 34 |
child...) |
| 35 |
|
| 36 |
All choosing Widgets should write strings in the Xbench language to some |
| 37 |
buffer, where the actual testing thing can pull them out. |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
HIERARCHY OF WIDGETS |
| 42 |
-------------------- |
| 43 |
|
| 44 |
Form (form) surrounding the whole thing (owned by TopLevel) |
| 45 |
Title (label) on top describing version & current test (owned by Form) |
| 46 |
MenuLine (form) under Title giving top level choices (owned by Form) |
| 47 |
MenuLine 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 |
|
| 74 |
The toggling command buttons exist in pairs, of which only one is visible at |
| 75 |
any one point. This makes callbacks/names of buttons easier to implement. |
| 76 |
|
| 77 |
--- |
| 78 |
|
| 79 |
BenchmarkOptions (form) describing benchmark options (owned by Toplevel?) |
| 80 |
BenchmarkOptions 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 |
|
| 90 |
GraphicsOptions (form) describing graphics options (owned by Toplevel?) |
| 91 |
GraphicsOptions 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 |
|
| 125 |
We need specialized widgets for DashList, possibly TStipOrigin and DashOffset. |
| 126 |
|
| 127 |
Still 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 |
|
| 132 |
Description (text) describing the current test (owned by Toplevel?) |
| 133 |
|
| 134 |
I really need to find out how to use sources and sinks for Text widgets - |
| 135 |
the documentation does not say how to do it. |
| 136 |
|
| 137 |
Every test will have a block of text associated with it. When a new |
| 138 |
benchmark is chosen, its associated text will become the source for the |
| 139 |
Description widget. Note that we don't have to worry about whether |
| 140 |
Description is mapped or not; we're just setting a source. |
| 141 |
|
| 142 |
--- |
| 143 |
|
| 144 |
Analysis (text) describing the results of the current test (owned by Form - |
| 145 |
we always want this to be around) |
| 146 |
|
| 147 |
This will display the name of the test, the important values of the GC, |
| 148 |
the results of the test, and a short analysis thereof. If more than |
| 149 |
one test of a particular benchmark is performed, it will be appended to |
| 150 |
the analysis source (not replacing it). This will allow for comparing |
| 151 |
results obtained with different GC's. |
| 152 |
|
| 153 |
--- |
| 154 |
|
| 155 |
Test (core + expose event handler) for doing the test. |
| 156 |
|
| 157 |
All this really needs to do, besides actually doing the test, is to |
| 158 |
time it and make sure the Analysis part knows about it. |
| 159 |
|
| 160 |
--- |
| 161 |
|
| 162 |
RecordingOn / RecordingOff / Playback |
| 163 |
|
| 164 |
When the user presses Playback, pretty much all we have to do is to |
| 165 |
1) change the buffer to the file that he wants, and 2) start reading. |
| 166 |
The rest should be taken care of the buffer-interpreting module. |
| 167 |
|
| 168 |
RecordingOn changes the output buffer _and_ the input buffer to the |
| 169 |
desired file. |
| 170 |
|
| 171 |
RecordingOff 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 |
|