[5182e8]: manuals / vgui_ref_manual / images.tex  Maximize  Restore  History

Download this file

365 lines (329 with data), 10.3 kB

  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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
\batchmode
\documentclass[12pt]{report}
\makeatletter \usepackage{epsfig}
\usepackage{epsfig}
\usepackage{/users/kym/target/target/vxl/vgui/doc/tools/verbawf2e}
\usepackage{/users/kym/target/target/vxl/vgui/doc/tools/cxx}
\usepackage{alltt}
\topmargin=-0.5in
\oddsidemargin=-0.2in
\evensidemargin=0.1in
\textwidth=6.6in
\textheight=8.9in
\providecommand{\tr}{{\em TargetJr }}
\parskip =.16in
\parindent=0in
\par\usepackage[dvips]{color}
\pagecolor[gray]{.7}
\makeatletter
\count@=\the\catcode`\_ \catcode`\_=8
\newenvironment{tex2html_wrap}{}{} \catcode`\_=\count@
\makeatother
\ifx\AtBeginDocument\undefined \newcommand{\AtBeginDocument}[1]{}\fi
\newbox\sizebox
\setlength{\hoffset}{0pt}\setlength{\voffset}{0pt}
\addtolength{\textheight}{\footskip}\setlength{\footskip}{0pt}
\addtolength{\textheight}{\topmargin}\setlength{\topmargin}{0pt}
\addtolength{\textheight}{\headheight}\setlength{\headheight}{0pt}
\addtolength{\textheight}{\headsep}\setlength{\headsep}{0pt}
\setlength{\textwidth}{349pt}
\newwrite\lthtmlwrite
\makeatletter
\let\realnormalsize=\normalsize
\global\topskip=2sp
\def\preveqno{}\let\real@float=\@float \let\realend@float=\end@float
\def\@float{\let\@savefreelist\@freelist\real@float}
\def\end@float{\realend@float\global\let\@freelist\@savefreelist}
\let\real@dbflt=\@dbflt \let\end@dblfloat=\end@float
\let\@largefloatcheck=\relax
\def\@dbflt{\let\@savefreelist\@freelist\real@dbflt}
\def\adjustnormalsize{\def\normalsize{\mathsurround=0pt \realnormalsize
\parindent=0pt\abovedisplayskip=0pt\belowdisplayskip=0pt}\normalsize}%
\def\lthtmltypeout#1{{\let\protect\string\immediate\write\lthtmlwrite{#1}}}%
\newcommand\lthtmlhboxmathA{\adjustnormalsize\setbox\sizebox=\hbox\bgroup}%
\newcommand\lthtmlvboxmathA{\adjustnormalsize\setbox\sizebox=\vbox\bgroup%
\let\ifinner=\iffalse }%
\newcommand\lthtmlboxmathZ{\@next\next\@currlist{}{\def\next{\voidb@x}}%
\expandafter\box\next\egroup}%
\newcommand\lthtmlmathtype[1]{\def\lthtmlmathenv{#1}}%
\newcommand\lthtmllogmath{\lthtmltypeout{l2hSize %
:\lthtmlmathenv:\the\ht\sizebox::\the\dp\sizebox::\the\wd\sizebox.\preveqno}}%
\newcommand\lthtmlfigureA[1]{\let\@savefreelist\@freelist
\lthtmlmathtype{#1}\lthtmlvboxmathA}%
\newcommand\lthtmlfigureZ{\lthtmlboxmathZ\lthtmllogmath\copy\sizebox
\global\let\@freelist\@savefreelist}%
\newcommand\lthtmldisplayA[1]{\lthtmlmathtype{#1}\lthtmlvboxmathA}%
\newcommand\lthtmldisplayB[1]{\edef\preveqno{(\theequation)}%
\lthtmldisplayA{#1}\let\@eqnnum\relax}%
\newcommand\lthtmldisplayZ{\lthtmlboxmathZ\lthtmllogmath\lthtmlsetmath}%
\newcommand\lthtmlinlinemathA[1]{\lthtmlmathtype{#1}\lthtmlhboxmathA \vrule height1.5ex width0pt }%
\newcommand\lthtmlinlineA[1]{\lthtmlmathtype{#1}\lthtmlhboxmathA}%
\newcommand\lthtmlinlineZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %
\expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetinline}
\newcommand\lthtmlinlinemathZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %
\expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetmath}
\def\lthtmlsetinline{\hbox{\vrule width.1em\vtop{\vbox{%
\kern.1em\copy\sizebox}\ifdim\dp\sizebox>0pt\kern.1em\else\kern.3pt\fi
\ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}}
\def\lthtmlsetmath{\hbox{\vrule width.1em\setbox1=\vtop{\vbox{%
\kern.1em\kern0.8 pt\hbox{\hglue.17em\copy\sizebox\hglue0.8 pt}}\kern.3pt%
\ifdim\dp\sizebox>0pt\kern.1em\fi \kern0.8 pt%
\ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}\message{ht\the\ht1: dp\the\dp1}\box1}}
\def\centerinlinemath{%\dimen1=\ht\sizebox
\dimen1=\ifdim\ht\sizebox<\dp\sizebox \dp\sizebox\else\ht\sizebox\fi
\advance\dimen1by.5pt \vrule width0pt height\dimen1 depth\dimen1
\dp\sizebox=\dimen1\ht\sizebox=\dimen1\relax}
\def\lthtmlcheckvsize{\ifdim\ht\sizebox<\vsize\expandafter\vfill
\else\expandafter\vss\fi}%
\makeatletter \tracingstats = 1
\begin{document}
\pagestyle{empty}\thispagestyle{empty}%
\lthtmltypeout{latex2htmlLength hsize=\the\hsize}%
\lthtmltypeout{latex2htmlLength vsize=\the\vsize}%
\lthtmltypeout{latex2htmlLength hoffset=\the\hoffset}%
\lthtmltypeout{latex2htmlLength voffset=\the\voffset}%
\lthtmltypeout{latex2htmlLength topmargin=\the\topmargin}%
\lthtmltypeout{latex2htmlLength topskip=\the\topskip}%
\lthtmltypeout{latex2htmlLength headheight=\the\headheight}%
\lthtmltypeout{latex2htmlLength headsep=\the\headsep}%
\lthtmltypeout{latex2htmlLength parskip=\the\parskip}%
\lthtmltypeout{latex2htmlLength oddsidemargin=\the\oddsidemargin}%
\makeatletter
\if@twoside\lthtmltypeout{latex2htmlLength evensidemargin=\the\evensidemargin}%
\else\lthtmltypeout{latex2htmlLength evensidemargin=\the\oddsidemargin}\fi%
\makeatother
\stepcounter{chapter}
{\newpage\clearpage
\lthtmlinlinemathA{tex2html_wrap_inline17}%
$\mbox{$\bullet$}$%
\lthtmlinlinemathZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{chapter}
{\newpage\clearpage
\lthtmlfigureA{figure21}%
\begin{figure}
\epsfig{figure=zoomer-deck-example.eps} \end{figure}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{verbawf28}%
\begin{verbawf}class image\_tableau
\{
// image data
char* image\_data;
int width, height;
// draw method
void draw()
\{
glRasterPos(0,0);
glDrawPixels(..., image\_data, ...);
\}
\par // handle event
bool handle_imple(vgui_event const &e)
\{
if (e is a draw event)
draw();
return true;
\}
\};
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
{\newpage\clearpage
\lthtmlfigureA{verbawf30}%
\begin{verbawf}class tableau
\{
public:
virtual bool handle_event(vgui_event const&) = 0;
\};
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{verbawf35}%
\begin{verbawf}class zoomer\_tableau : public tableau
\{
vgui_slot child_tableau;
float zoom\_factor;
void draw()
\{
// Change state
glScale3f(zoom\_factor, zoom\_factor, zoom\_factor);
// Ask child tableau to draw in new zoomed coordinates
child->draw();
// Undo the coordinate change
glScale3f(1/zoom\_factor, 1/zoom\_factor, 1/zoom\_factor);
\}
\par // handle event
bool handle_imple(vgui_event const &e)
\{
if (e is a draw event)
draw();
return true;
\}
\};
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{verbawf39}%
\begin{verbawf}class composite\_tableau : public tableau {
vgui_slot left_tableau;
vgui_slot right_tableau;
\par void draw() {
// move origin, clip, viewport etc, so all drawing is
// in left pane
glScale(...);
...
glViewport(...);
// Draw the left child in the new coordinates
left->draw();
\par // Reset for right pane
glScale(...);
...
glViewport(...);
// Draw the right child
right->draw();
// Restore GL state
...
}
\par // handle event
bool handle_imple(vgui_event const &e)
\{
if (e is a draw event)
draw();
return true;
\}
};
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{verbawf44}%
\begin{verbawf}class zoomer\_tableau : public tableau
\{
vgui_slot child_tableau;
float zoom\_factor;
// Event handling method.
bool handle\_impl(event e)
\{
if ({\em e is control-mouse-drag})
\{
// This event interests us, use it to set the zoom factor
zoom\_factor = exp(e.x);
// Tell our parent we've used this event
return true;
\}
else
\{
// This event is uninteresting to us, pass it to the child.
bool eaten = child->handle(e);
\par // Restore GL state
...
\par // Tell our parent whether the child used the event
return eaten;
\}
\};
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{section}
\stepcounter{subsection}
\stepcounter{subsection}
\stepcounter{subsection}
\stepcounter{subsection}
\stepcounter{chapter}
\stepcounter{section}
\stepcounter{section}
\stepcounter{section}
\stepcounter{subsection}
{\newpage\clearpage
\lthtmlfigureA{verbawf128}%
\begin{verbawf}void vgui\_Foo\_adaptor::update(vgui\_message const &e)
\{
if (e.user == vgui\_tableau::msg\_redraw)
foo\_draw();
else
vgui\_adaptor::update(e);
\}
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
{\newpage\clearpage
\lthtmlfigureA{verbawf132}%
\begin{verbawf}void vgui\_Xm\_adaptor::draw()
\{
make\_current();
vgui\_tableau *tableau = get\_tableau();
glDrawBuffer(GL\_BACK);
vgui\_matrix\_state::clear\_gl\_matrices();
if (tableau)
\{
do\_clear();
vgui\_event e;
e.type = vgui\_DRAW;
dispatch(e);
swap\_buffers();
\}
\}
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{subsection}
\stepcounter{subsection}
{\newpage\clearpage
\lthtmlfigureA{verbawf138}%
\begin{verbawf}class vgui\_Xm : public vgui
\{
public:
static vgui\_Xm* instance();
protected:
vgui\_Xm();
static vgui\_Xm* instance\_;
\};
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
{\newpage\clearpage
\lthtmlfigureA{verbawf141}%
\begin{verbawf}vgui\_Xm* vgui\_Xm::instance\_ = 0;
static vgui\_Xm* vgui\_Xm\_instantiation = vgui\_Xm::instance();
vgui\_Xm* vgui\_Xm::instance()
\{
if (instance\_ == 0)
instance\_ = new vgui\_Xm;
return instance\_;
\}
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
{\newpage\clearpage
\lthtmlfigureA{verbawf146}%
\begin{verbawf}void vgui\_Xm::run\_impl()
\{
XtAppMainLoop(app\_context);
\}
void vgui\_Fl::run=\_impl()
\{
Fl::run();
\}
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
{\newpage\clearpage
\lthtmlfigureA{verbawf148}%
\begin{verbawf}vgui\_window* vgui\_Fl::produce\_window\_impl(int width, int height, char const* title)
\{
return new vgui\_Fl\_window(width, height, title);
\}
\end{verbawf}%
\lthtmlfigureZ
\hfill\lthtmlcheckvsize\clearpage}
\stepcounter{subsection}
\stepcounter{subsection}
\stepcounter{subsection}
\end{document}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks