This file is indexed.

/usr/include/libwmf/ipa.h is in libwmf-dev 0.2.8.4-10ubuntu1.1.

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
/* libwmf (<libwmf/ipa.h>): library for wmf conversion
   Copyright (C) 2000 - various; see CREDITS, ChangeLog, and sources

   The libwmf Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The libwmf Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the libwmf Library; see the file COPYING.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */


/* Interface Programmable des Applications ??
 */
#ifndef LIBWMF_IPA_H
#define LIBWMF_IPA_H

#include <libwmf/types.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Type declarations
 */
typedef struct _wmfRGB                 wmfRGB;
typedef struct _wmfBMP                 wmfBMP;

typedef struct _wmfBrush               wmfBrush;
typedef struct _wmfPen                 wmfPen;
typedef struct _wmfFont                wmfFont;

typedef struct _wmfFontData            wmfFontData;
typedef struct _wmfColorData           wmfColorData;

typedef struct _wmfDC                  wmfDC;

typedef struct _wmfFlood_t             wmfFlood_t;
typedef struct _wmfDrawPixel_t         wmfDrawPixel_t;
typedef struct _wmfDrawArc_t           wmfDrawArc_t;
typedef struct _wmfDrawLine_t          wmfDrawLine_t;
typedef struct _wmfPolyLine_t          wmfPolyLine_t;
typedef struct _wmfPolyPoly_t          wmfPolyPoly_t;
typedef struct _wmfDrawRectangle_t     wmfDrawRectangle_t;
typedef struct _wmfPolyRectangle_t     wmfPolyRectangle_t;
typedef struct _wmfBMP_Read_t          wmfBMP_Read_t;
typedef struct _wmfBMP_Draw_t          wmfBMP_Draw_t;
typedef struct _wmfROP_Draw_t          wmfROP_Draw_t;
typedef struct _wmfDrawText_t          wmfDrawText_t;
typedef struct _wmfUserData_t          wmfUserData_t;

typedef struct _wmfFunctionReference   wmfFunctionReference;

typedef float (*wmfStringWidth) (wmfAPI*,wmfFont*,char*);
typedef void  (*wmfMap)         (wmfAPI*,wmfFont*);

/* Device-layer device-independent default functions
 */
extern void   wmf_ipa_bmp_b64 (wmfAPI*,wmfBMP_Draw_t*,wmfStream*);
extern void   wmf_ipa_bmp_png (wmfAPI*,wmfBMP_Draw_t*,char*);
extern void   wmf_ipa_bmp_jpg (wmfAPI*,wmfBMP_Draw_t*,char*);
extern void   wmf_ipa_bmp_eps (wmfAPI*,wmfBMP_Draw_t*,char*);
extern void   wmf_ipa_bmp_read (wmfAPI*,wmfBMP_Read_t*);
extern void   wmf_ipa_bmp_free (wmfAPI*,wmfBMP*);
extern wmfBMP wmf_ipa_bmp_copy (wmfAPI*,wmfBMP*,unsigned int,unsigned int);
extern int    wmf_ipa_bmp_color (wmfAPI*,wmfBMP*,wmfRGB*,unsigned int,unsigned int);
extern void   wmf_ipa_bmp_setcolor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned char,unsigned int,unsigned int);
extern int    wmf_ipa_bmp_interpolate (wmfAPI*,wmfBMP*,wmfRGB*,float,float);

extern void          wmf_ipa_color_init (wmfAPI*);
extern void          wmf_ipa_color_add (wmfAPI*,wmfRGB*);
extern unsigned long wmf_ipa_color_index (wmfAPI*,wmfRGB*);
extern unsigned long wmf_ipa_color_count (wmfAPI*);
extern wmfRGB*       wmf_ipa_color (wmfAPI*,unsigned long);

extern char*        wmf_ipa_page_format (wmfAPI*,wmf_page_t);
extern unsigned int wmf_ipa_page_width  (wmfAPI*,wmf_page_t);
extern unsigned int wmf_ipa_page_height (wmfAPI*,wmf_page_t);

/* Other useful functions
 */
extern wmfRGB wmf_rgb_white (wmfAPI*);
extern wmfRGB wmf_rgb_black (wmfAPI*);
extern wmfRGB wmf_rgb_color (wmfAPI*,float,float,float);

/* Structure definitions
 */
struct _wmfRGB
{	unsigned char r;
	unsigned char g;
	unsigned char b;
};

struct _wmfBMP
{	U16 width;
	U16 height;

	void* data;
};

struct _wmfPen
{	U16 lopnStyle;

	double width;
	double height;

	wmfRGB lopnColor;
};

struct _wmfBrush
{	U16 lbStyle;
	U16 lbHatch;

	wmfRGB lbColor;
	wmfBMP bmp;
};

struct _wmfFont
{	U16 lfHeight;
	U16 lfWidth;

	S16 lfEscapement;
	S16 lfOrientation;

	U16 lfWeight;

	U8 lfItalic;
	U8 lfUnderline;
	U8 lfStrikeOut;
	U8 lfCharSet;
	U8 lfOutPrecision;
	U8 lfClipPrecision;
	U8 lfQuality;
	U8 lfPitchAndFamily;

	char* lfFaceName;

	void* user_data;
};

/**
 * API->font_data is a pointer to a wmfFontData. wmf_api_create () sets this up automatically, but
 * wmf_lite_create () does not. If you use wmf_lite_create () then you \b must create your own
 * wmfFontData. \b libwmflite requires you to define \p map and \p stringwidth functions but the
 * rest of these fields are ignored (they are only used by \b libwmf).
 */
struct _wmfFontData
{	/**
	 * Necessary field: exactly what the function does is irrelevant.
	 */
	wmfMap map;

	/**
	 * Necessary field: returns width of specified string in points, assuming (unstretched)
	 * font size of 1pt.
	 */
	wmfStringWidth stringwidth;

	/**
	 * A handle for data, unused by libwmflite
	 */
	void* user_data;
};

struct _wmfColorData
{	unsigned long max;
	unsigned long count;

	wmfRGB* rgb;
};

struct _wmfDC
{	void* userdata;

	wmfBrush* brush;
	wmfPen* pen;
	wmfFont* font;

	wmfRGB textcolor;
	wmfRGB bgcolor;

	U16 textalign;
	U16 bgmode;
	U16 polyfillmode;
	U16 charextra;
	U16 breakextra;

	U16 ROPmode;

	struct
	{	S32 Ox;
		S32 Oy;
		S32 width;
		S32 height;
	} Window;

	double pixel_width; /* Display pixel dimensions (inches) */
	double pixel_height;

	U16 map_mode;

	void* clip;
};

/* IPA info structures
 */
struct _wmfFlood_t
{	wmfDC* dc;

	wmfD_Coord pt;
	wmfRGB color;

	U16 type;

	double pixel_width;
	double pixel_height;
};

struct _wmfDrawPixel_t
{	wmfDC* dc;

	wmfD_Coord pt;
	wmfRGB color;

	double pixel_width;
	double pixel_height;
};

struct _wmfDrawArc_t
{	wmfDC* dc;

	wmfD_Coord TL;
	wmfD_Coord BR;

	wmfD_Coord start; /* draw_ellipse: (ignored) */
	wmfD_Coord end;
};

struct _wmfDrawLine_t
{	wmfDC* dc;

	wmfD_Coord from;
	wmfD_Coord to;
};

struct _wmfPolyLine_t
{	wmfDC* dc;

	wmfD_Coord* pt;

	U16 count;
};

struct _wmfPolyPoly_t
{	wmfDC* dc;

	wmfD_Coord** pt; /* pt[i][*] = points of ith polygon */

	U16* count;      /* points in ith polygon */
	U16  npoly;      /* number of polygons */
};

struct _wmfDrawRectangle_t
{	wmfDC* dc;

	wmfD_Coord TL;
	wmfD_Coord BR;

	float width; /* draw_rectangle: axes of corner ellipses; zero if un-rounded */
	float height;
};

struct _wmfPolyRectangle_t
{	wmfDC* dc;

	wmfD_Coord* TL; /* region_frame & region_paint: TL[count],BR[count] give the */
	wmfD_Coord* BR; /* final `extents'... */

	unsigned int count;

	float width;  /* region_frame: border thickness; zero otherwise */
	float height;
};

struct _wmfBMP_Read_t          /* Two means available for accessing BMP image:        */
{	long offset;           /* (1) position in source file of start of BMP;        *
                                * use API->bbuf.seek to set pos(ition), etc.          */
	long length;           /* (2) buffer of length length containing image of BMP */
	unsigned char* buffer;

	U16 width;  /* WMF player may preset these values; zero otherwise. */
	U16 height; /* Use caution - may be buggy... ?? [TODO]             */

	wmfBMP bmp;
};

struct _wmfBMP_Draw_t
{	wmfDC* dc;

	wmfD_Coord pt;
	wmfBMP bmp;

	U32 type;

	struct
	{	U16 x;
		U16 y;
		U16 w;
		U16 h;
	} crop;

	double pixel_width;
	double pixel_height;
};

struct _wmfROP_Draw_t
{	wmfDC* dc;

	wmfD_Coord TL;
	wmfD_Coord BR;

	U32 ROP;

	double pixel_width;
	double pixel_height;
};

struct _wmfDrawText_t
{	wmfDC* dc;

	wmfD_Coord pt;

	wmfD_Coord TL; /* Clip zone */
	wmfD_Coord BR;

	struct /* An estimated surround zone */
	{	wmfD_Coord TL;
		wmfD_Coord TR;
		wmfD_Coord BL;
		wmfD_Coord BR;
	} bbox;

	char* str;

	U16 flags;

	double font_height;
	double font_ratio;  /* width to height ratio */
};

struct _wmfUserData_t	/* TODO: Need to be careful with usage here; not all these are set by the player! */
{	wmfDC* dc;          /* dc is guaranteed */

	void* data;         /* data also, except for init */
};

struct _wmfFunctionReference
{	void (*device_open) (wmfAPI*);
	void (*device_close) (wmfAPI*);
	void (*device_begin) (wmfAPI*);
	void (*device_end) (wmfAPI*);

	void (*flood_interior) (wmfAPI*,wmfFlood_t*);
	void (*flood_exterior) (wmfAPI*,wmfFlood_t*);

	void (*draw_pixel) (wmfAPI*,wmfDrawPixel_t*);
	void (*draw_pie) (wmfAPI*,wmfDrawArc_t*);
	void (*draw_chord) (wmfAPI*,wmfDrawArc_t*);
	void (*draw_arc) (wmfAPI*,wmfDrawArc_t*);
	void (*draw_ellipse) (wmfAPI*,wmfDrawArc_t*);
	void (*draw_line) (wmfAPI*,wmfDrawLine_t*);
	void (*poly_line) (wmfAPI*,wmfPolyLine_t*);
	void (*draw_polygon) (wmfAPI*,wmfPolyLine_t*);
	void (*draw_polypolygon) (wmfAPI*,wmfPolyPoly_t*);
	void (*draw_rectangle) (wmfAPI*,wmfDrawRectangle_t*);

	void (*rop_draw) (wmfAPI*,wmfROP_Draw_t*);
	void (*bmp_draw) (wmfAPI*,wmfBMP_Draw_t*);
	void (*bmp_read) (wmfAPI*,wmfBMP_Read_t*);
	void (*bmp_free) (wmfAPI*,wmfBMP*);

	void (*draw_text) (wmfAPI*,wmfDrawText_t*);

	void (*udata_init) (wmfAPI*,wmfUserData_t*);
	void (*udata_copy) (wmfAPI*,wmfUserData_t*);
	void (*udata_set) (wmfAPI*,wmfUserData_t*);
	void (*udata_free) (wmfAPI*,wmfUserData_t*);

	void (*region_frame) (wmfAPI*,wmfPolyRectangle_t*);
	void (*region_paint) (wmfAPI*,wmfPolyRectangle_t*);
	void (*region_clip) (wmfAPI*,wmfPolyRectangle_t*);
};

#ifdef __cplusplus
}
#endif

#endif /* ! LIBWMF_IPA_H */