This file is indexed.

/usr/include/InterViews/layout.h is in ivtools-dev 1.2.11a1-6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
/*
 * Copyright (c) 1987, 1988, 1989, 1990, 1991 Stanford University
 * Copyright (c) 1991 Silicon Graphics, Inc.
 *
 * Permission to use, copy, modify, distribute, and sell this software and 
 * its documentation for any purpose is hereby granted without fee, provided
 * that (i) the above copyright notices and this permission notice appear in
 * all copies of the software and related documentation, and (ii) the names of
 * Stanford and Silicon Graphics may not be used in any advertising or
 * publicity relating to the software without the specific, prior written
 * permission of Stanford and Silicon Graphics.
 * 
 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR
 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
 * OF THIS SOFTWARE.
 */

/*
 * Layout - structured layout
 */

#ifndef iv_layout_h
#define iv_layout_h

#include <IV-3_1/InterViews/deck.h> // too avoid confusion with IV-2_6
#include <InterViews/monoglyph.h>
#include <InterViews/polyglyph.h>
#include <InterViews/scrbox.h>

class Layout {
protected:
    Layout();
public:
    virtual ~Layout();

    virtual void request(
        GlyphIndex count, const Requisition*, Requisition& result
    );
    virtual void allocate(
        const Allocation& given, GlyphIndex count, const Requisition*,
	Allocation* result
    );
};

class Color;
class Font;
class PolyGlyph;

//: factory object for layout glyphs.
// <a href=../refman3.1/refman.html#PAGE61>in reference manual</a>
class LayoutKit {
protected:
    LayoutKit();
public:
    virtual ~LayoutKit();

    static LayoutKit* instance();
protected:
    static void instance(LayoutKit*);
public:
    virtual PolyGlyph* box(Layout*, GlyphIndex size = 10) const;
    virtual PolyGlyph* hbox(GlyphIndex size) const;
    virtual PolyGlyph* hbox(
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil,
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil
    ) const;
    virtual PolyGlyph* vbox(GlyphIndex size) const;
    virtual PolyGlyph* vbox(
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil,
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil
    ) const;
    virtual PolyGlyph* hbox_first_aligned(GlyphIndex size) const;
    virtual PolyGlyph* hbox_first_aligned(
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil,
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil
    ) const;
    virtual PolyGlyph* vbox_first_aligned(GlyphIndex size) const;
    virtual PolyGlyph* vbox_first_aligned(
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil,
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil
    ) const;

    virtual ScrollBox* vscrollbox(GlyphIndex size = 10) const;

    virtual PolyGlyph* overlay(
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil,
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil
    ) const;

    virtual Deck* deck(GlyphIndex size) const;
    virtual Deck* deck(
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil,
	Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil, Glyph* = nil
    ) const;

    virtual MonoGlyph* back(Glyph*, Glyph* under) const;
    virtual MonoGlyph* front(Glyph*, Glyph* over) const;
    virtual MonoGlyph* between(Glyph*, Glyph* under, Glyph* over) const;

    virtual Glyph* glue(
	DimensionName, Coord natural, Coord stretch, Coord shrink,
	float alignment
    ) const;
    virtual Glyph* glue(const Requisition&) const;
    virtual Glyph* hglue() const;
    virtual Glyph* hglue(Coord natural) const;
    virtual Glyph* hglue(Coord natural, Coord stretch, Coord shrink) const;
    virtual Glyph* hglue(
	Coord natural, Coord stretch, Coord shrink, float alignment
    ) const;
    virtual Glyph* hspace(Coord natural) const;
    virtual Glyph* vglue() const;
    virtual Glyph* vglue(Coord natural) const;
    virtual Glyph* vglue(Coord natural, Coord stretch, Coord shrink) const;
    virtual Glyph* vglue(
	Coord natural, Coord stretch, Coord shrink, float alignment
    ) const;
    virtual Glyph* vspace(Coord natural) const;

    virtual Glyph* shape_of(Glyph*) const;
    virtual Glyph* shape_of_xy(Glyph*, Glyph*) const;

    virtual Glyph* discretionary(int penalty, Glyph*) const;
    virtual Glyph* discretionary(
	int penalty, Glyph* no, Glyph* before, Glyph* in, Glyph* after
    ) const;

    virtual Glyph* strut(
	const Font*, Coord natural = 0, Coord stretch = 0, Coord shrink = 0
    ) const;
    virtual Glyph* hstrut(
	Coord right_bearing, Coord left_bearing = 0,
	Coord natural = 0, Coord stretch = 0, Coord shrink = 0
    ) const;
    virtual Glyph* vstrut(
	Coord ascent, Coord descent = 0,
	Coord natural = 0, Coord stretch = 0, Coord shrink = 0
    ) const;

    virtual Glyph* spaces(
	int count, Coord each, const Font*, const Color*
    ) const;

    virtual MonoGlyph* center(Glyph*, float x = 0.5, float y = 0.5) const;
    virtual MonoGlyph* center_dimension(
	Glyph*, DimensionName, float align
    ) const;
    virtual MonoGlyph* hcenter(Glyph*, float x = 0.5) const;
    virtual MonoGlyph* vcenter(Glyph*, float y = 0.5) const;

    virtual MonoGlyph* fixed(Glyph*, Coord x, Coord y) const;
    virtual MonoGlyph* fixed_dimension(
	Glyph*, DimensionName, Coord
    ) const;
    virtual MonoGlyph* hfixed(Glyph*, Coord x) const;
    virtual MonoGlyph* vfixed(Glyph*, Coord y) const;

    virtual MonoGlyph* flexible(
	Glyph*, Coord stretch = fil, Coord shrink = fil
    ) const;
    virtual MonoGlyph* flexible_dimension(
	Glyph*, DimensionName, Coord stretch = fil, Coord shrink = fil
    ) const;
    virtual MonoGlyph* hflexible(
	Glyph*, Coord stretch = fil, Coord shrink = fil
    ) const;
    virtual MonoGlyph* vflexible(
	Glyph*, Coord stretch = fil, Coord shrink = fil
    ) const;

    virtual MonoGlyph* natural(Glyph*, Coord x, Coord y) const;
    virtual MonoGlyph* natural_dimension(
	Glyph*, DimensionName, Coord
    ) const;
    virtual MonoGlyph* hnatural(Glyph*, Coord x) const;
    virtual MonoGlyph* vnatural(Glyph*, Coord y) const;

    virtual MonoGlyph* margin(Glyph*, Coord) const;
    virtual MonoGlyph* margin(Glyph*, Coord hmargin, Coord vmargin) const;
    virtual MonoGlyph* margin(
	Glyph*,
	Coord lmargin, Coord rmargin, Coord bmargin, Coord tmargin
    ) const;
    virtual MonoGlyph* margin(
	Glyph*,
	Coord lmargin, Coord lstretch, Coord lshrink,
	Coord rmargin, Coord rstretch, Coord rshrink,
	Coord bmargin, Coord bstretch, Coord bshrink,
	Coord tmargin, Coord tstretch, Coord tshrink
    ) const;
    virtual MonoGlyph* hmargin(Glyph*, Coord) const;
    virtual MonoGlyph* hmargin(Glyph*, Coord lmargin, Coord rmargin) const;
    virtual MonoGlyph* hmargin(
	Glyph*,
	Coord lmargin, Coord lstretch, Coord lshrink,
	Coord rmargin, Coord rstretch, Coord rshrink
    ) const;
    virtual MonoGlyph* vmargin(Glyph*, Coord) const;
    virtual MonoGlyph* vmargin(Glyph*, Coord bmargin, Coord tmargin) const;
    virtual MonoGlyph* vmargin(
	Glyph*,
	Coord bmargin, Coord bstretch, Coord bshrink,
	Coord tmargin, Coord tstretch, Coord tshrink
    ) const;
    virtual MonoGlyph* lmargin(Glyph*, Coord) const;
    virtual MonoGlyph* lmargin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;
    virtual MonoGlyph* rmargin(Glyph*, Coord) const;
    virtual MonoGlyph* rmargin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;
    virtual MonoGlyph* bmargin(Glyph*, Coord) const;
    virtual MonoGlyph* bmargin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;
    virtual MonoGlyph* tmargin(Glyph*, Coord) const;
    virtual MonoGlyph* tmargin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;

    /* backward compatibility */
    MonoGlyph* fixed_span(Glyph*, Coord x, Coord y) const;
    MonoGlyph* fixed_span_dimension(Glyph*, DimensionName, Coord) const;
    MonoGlyph* h_fixed_span(Glyph*, Coord x) const;
    MonoGlyph* v_fixed_span(Glyph*, Coord y) const;

    MonoGlyph* variable_span(
	Glyph*, Coord stretch = fil, Coord shrink = fil
    ) const;
    MonoGlyph* variable_span_dimension(
	Glyph*, DimensionName, Coord stretch = fil, Coord shrink = fil
    ) const;
    MonoGlyph* h_variable_span(
	Glyph*, Coord stretch = fil, Coord shrink = fil
    ) const;
    MonoGlyph* v_variable_span(
	Glyph*, Coord stretch = fil, Coord shrink = fil
    ) const;

    MonoGlyph* natural_span(Glyph*, Coord x, Coord y) const;
    MonoGlyph* natural_span_dimension(
	Glyph*, DimensionName, Coord
    ) const;
    MonoGlyph* h_natural_span(Glyph*, Coord x) const;
    MonoGlyph* v_natural_span(Glyph*, Coord y) const;

    MonoGlyph* h_margin(Glyph*, Coord) const;
    MonoGlyph* h_margin(Glyph*, Coord lmargin, Coord rmargin) const;
    MonoGlyph* h_margin(
	Glyph*,
	Coord lmargin, Coord lstretch, Coord lshrink,
	Coord rmargin, Coord rstretch, Coord rshrink
    ) const;
    MonoGlyph* v_margin(Glyph*, Coord) const;
    MonoGlyph* v_margin(Glyph*, Coord bmargin, Coord tmargin) const;
    MonoGlyph* v_margin(
	Glyph*,
	Coord bmargin, Coord bstretch, Coord bshrink,
	Coord tmargin, Coord tstretch, Coord tshrink
    ) const;
    MonoGlyph* l_margin(Glyph*, Coord) const;
    MonoGlyph* l_margin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;
    MonoGlyph* r_margin(Glyph*, Coord) const;
    MonoGlyph* r_margin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;
    MonoGlyph* b_margin(Glyph*, Coord) const;
    MonoGlyph* b_margin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;
    MonoGlyph* t_margin(Glyph*, Coord) const;
    MonoGlyph* t_margin(
	Glyph*, Coord, Coord stretch, Coord shrink
    ) const;
};

/* inline old names to new names */

inline MonoGlyph* LayoutKit::fixed_span(Glyph* g, Coord x, Coord y) const {
    return fixed(g, x, y);
}

inline MonoGlyph* LayoutKit::fixed_span_dimension(
    Glyph* g, DimensionName d, Coord c
) const {
    return fixed_dimension(g, d, c);
}

inline MonoGlyph* LayoutKit::h_fixed_span(Glyph* g, Coord x) const {
    return hfixed(g, x);
}

inline MonoGlyph* LayoutKit::v_fixed_span(Glyph* g, Coord y) const {
    return vfixed(g, y);
}

inline MonoGlyph* LayoutKit::variable_span(
    Glyph* g, Coord stretch, Coord shrink
) const {
    return flexible(g, stretch, shrink);
}

inline MonoGlyph* LayoutKit::variable_span_dimension(
    Glyph* g, DimensionName d, Coord stretch, Coord shrink
) const {
    return flexible_dimension(g, d, stretch, shrink);
}

inline MonoGlyph* LayoutKit::h_variable_span(
    Glyph* g, Coord stretch, Coord shrink
) const {
    return hflexible(g, stretch, shrink);
}

inline MonoGlyph* LayoutKit::v_variable_span(
    Glyph* g, Coord stretch, Coord shrink
) const {
    return vflexible(g, stretch, shrink);
}

inline MonoGlyph* LayoutKit::natural_span(Glyph* g, Coord x, Coord y) const {
    return natural(g, x, y);
}

inline MonoGlyph* LayoutKit::natural_span_dimension(
    Glyph* g, DimensionName d, Coord c
) const {
    return natural_dimension(g, d, c);
}

inline MonoGlyph* LayoutKit::h_natural_span(Glyph* g, Coord x) const {
    return hnatural(g, x);
}

inline MonoGlyph* LayoutKit::v_natural_span(Glyph* g, Coord y) const {
    return vnatural(g, y);
}

inline MonoGlyph* LayoutKit::h_margin(Glyph* g, Coord m) const {
    return hmargin(g, m);
}

inline MonoGlyph* LayoutKit::h_margin(
    Glyph* g, Coord lmargin, Coord rmargin
) const {
    return hmargin(g, lmargin, rmargin);
}

inline MonoGlyph* LayoutKit::h_margin(
    Glyph* g,
    Coord lmargin, Coord lstretch, Coord lshrink,
    Coord rmargin, Coord rstretch, Coord rshrink
) const {
    return hmargin(g, lmargin, lstretch, lshrink, rmargin, rstretch, rshrink);
}

inline MonoGlyph* LayoutKit::v_margin(Glyph* g, Coord m) const {
    return vmargin(g, m);
}

inline MonoGlyph* LayoutKit::v_margin(
    Glyph* g, Coord bmargin, Coord tmargin
) const {
    return vmargin(g, bmargin, tmargin);
}

inline MonoGlyph* LayoutKit::v_margin(
    Glyph* g,
    Coord bmargin, Coord bstretch, Coord bshrink,
    Coord tmargin, Coord tstretch, Coord tshrink
) const {
    return vmargin(g, bmargin, bstretch, bshrink, tmargin, tstretch, tshrink);
}

inline MonoGlyph* LayoutKit::l_margin(Glyph* g, Coord m) const {
    return lmargin(g, m);
}

inline MonoGlyph* LayoutKit::l_margin(
    Glyph* g, Coord natural, Coord stretch, Coord shrink
) const {
    return lmargin(g, natural, stretch, shrink);
}

inline MonoGlyph* LayoutKit::r_margin(Glyph* g, Coord m) const {
    return rmargin(g, m);
}

inline MonoGlyph* LayoutKit::r_margin(
    Glyph* g, Coord natural, Coord stretch, Coord shrink
) const {
    return rmargin(g, natural, stretch, shrink);
}

inline MonoGlyph* LayoutKit::b_margin(Glyph* g, Coord m) const {
    return bmargin(g, m);
}

inline MonoGlyph* LayoutKit::b_margin(
    Glyph* g, Coord natural, Coord stretch, Coord shrink
) const {
    return bmargin(g, natural, stretch, shrink);
}

inline MonoGlyph* LayoutKit::t_margin(Glyph* g, Coord m) const {
    return tmargin(g, m);
}

inline MonoGlyph* LayoutKit::t_margin(
    Glyph* g, Coord natural, Coord stretch, Coord shrink
) const {
    return tmargin(g, natural, stretch, shrink);
}

#endif