/[public]/psiconv/trunk/lib/psiconv/data.h
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/data.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2 Revision 196
1/* 1/*
2 data.h - Part of psiconv, a PSION 5 file formats converter 2 data.h - Part of psiconv, a PSION 5 file formats converter
3 Copyright (c) 1999 Frodo Looijaard <frodol@dds.nl> 3 Copyright (c) 1999-2004 Frodo Looijaard <frodol@dds.nl>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/ 18*/
19 19
20/* This file contains the declarations of all types that are used to 20/* This file contains the declarations of all types that are used to
21 represent the Word file. Variables of these types are written by the 21 represent the Psion files. Variables of these types are written by the
22 parse routines, and read by the generation routines. */ 22 parse routines, and read by the generation routines.
23
24 Mostly, the data structures reflect the file format documentation,
25 as included in the formats directory. When in doubt, refer there. */
23 26
24#ifndef PSICONV_DATA_H 27#ifndef PSICONV_DATA_H
25#define PSICONV_DATA_H 28#define PSICONV_DATA_H
26 29
27#include "general.h" 30#include <psiconv/general.h>
28#include "list.h" 31#include <psiconv/list.h>
29 32
30/* All types which end on _t are plain types; all other types are pointers 33/* All types which end on _t are plain types; all other types are pointers
31 to structs */ 34 to structs. */
32 35
36#ifdef __cplusplus
37extern "C" {
38#endif /* __cplusplus */
39
40/* Forward declaration (for psiconv_embedded_object_section) */
41typedef struct psiconv_file_s *psiconv_file;
42
43
44/* Enums and simple types */
45
46
47/* Floating point number representation */
48typedef double psiconv_float_t;
49
50/* The supported file types. */
33typedef enum psiconv_file_type { 51typedef enum psiconv_file_type {
34 psiconv_unknown_file, 52 psiconv_unknown_file,
35 psiconv_word_file, 53 psiconv_word_file,
36 psiconv_texted_file, 54 psiconv_texted_file,
37 psiconv_mfm_file, 55 psiconv_mbm_file,
38 psiconv_sketch_file 56 psiconv_sketch_file,
57 psiconv_clipart_file,
58 psiconv_sheet_file
39} psiconv_file_type_t; 59} psiconv_file_type_t;
40 60
41/* Length indicators */ 61/* String representation. A string is an array of UCS2 characters, terminated
62 by a 0. So they are just like normal C strings, except that they are built
63 of psiconv_ucs2 elements instead of char elements.
64 The psiconv_ucs2 type holds 16 bits; see unicode.h for more information. */
42typedef psiconv_u32 psiconv_S_t; 65typedef psiconv_ucs2 *psiconv_string_t;
43typedef psiconv_u32 psiconv_X_t;
44 66
45/* A string */ 67/* Represent lengths (in centimeters) and sizes (in points).
46typedef char *psiconv_string_t;
47
48/* In the Psion file, these are identical; but we translate them to more 68 In the Psion file, these are identical; but we translate them to more
49 human-readable quantities */ 69 human-readable quantities */
50typedef float psiconv_length_t; /* For offsets in centimeters */ 70typedef float psiconv_length_t; /* For offsets in centimeters */
51typedef float psiconv_size_t; /* For sizes in points */ 71typedef float psiconv_size_t; /* For sizes in points */
52 72
53/* Some enums */ 73/* Represent booleans. As false is zero in the enum, you can still do things
74 like { if (test) ... } instead of { if (test == psiconv_bool_true) ... }.
75 Choose whatever style suits you best. */
54typedef enum psiconv_bool 76typedef enum psiconv_bool
55{ 77{
56 psiconv_bool_false, 78 psiconv_bool_false,
57 psiconv_bool_true 79 psiconv_bool_true
58} psiconv_bool_t; 80} psiconv_bool_t;
59 81
82/* Some kind of three-valued boolean, used at several places. */
83typedef enum psiconv_triple
84{
85 psiconv_triple_on,
86 psiconv_triple_off,
87 psiconv_triple_auto
88} psiconv_triple_t;
89
90/* Text can be in superscript or subscript or neither, but never both
91 superscript and subscript at once. Also, super-superscript and things
92 like that do not exist in the Psion world. */
60typedef enum psiconv_super_sub 93typedef enum psiconv_super_sub
61{ psiconv_normalscript, 94{ psiconv_normalscript,
62 psiconv_superscript, 95 psiconv_superscript,
63 psiconv_subscript 96 psiconv_subscript
64} psiconv_super_sub_t; 97} psiconv_super_sub_t;
65 98
99/* Horizontal justification. */
66typedef enum psiconv_justify_hor 100typedef enum psiconv_justify_hor
67{ psiconv_justify_left, 101{ psiconv_justify_left,
68 psiconv_justify_centre, 102 psiconv_justify_centre,
69 psiconv_justify_right, 103 psiconv_justify_right,
70 psiconv_justify_full 104 psiconv_justify_full
71} psiconv_justify_hor_t; 105} psiconv_justify_hor_t;
72 106
107/* Vertical justification. */
73typedef enum psiconv_justify_ver 108typedef enum psiconv_justify_ver
74{ psiconv_justify_top, 109{ psiconv_justify_top,
75 psiconv_justify_middle, 110 psiconv_justify_middle,
76 psiconv_justify_bottom 111 psiconv_justify_bottom
77} psiconv_justify_ver_t; 112} psiconv_justify_ver_t;
78 113
114/* Borders around text fields. */
79typedef enum psiconv_border_kind 115typedef enum psiconv_border_kind
80{ psiconv_border_none, 116{ psiconv_border_none, /* No border */
81 psiconv_border_solid, 117 psiconv_border_solid, /* Single line */
82 psiconv_border_double, 118 psiconv_border_double, /* Double line */
83 psiconv_border_dotted, 119 psiconv_border_dotted, /* Dotted line: . . . . . */
84 psiconv_border_striped, 120 psiconv_border_dashed, /* Dashed line: _ _ _ _ _ */
85 psiconv_border_dotstripe, 121 psiconv_border_dotdashed, /* Dotted/dashed line: _ . _ . _ */
86 psiconv_border_dotdotstripe 122 psiconv_border_dotdotdashed /* Dotted/dashed line: . . _ . . _ */
87} psiconv_border_kind_t; 123} psiconv_border_kind_t;
88 124
89/* Colors. 125/* Though each printer driver has its own fonts for printing, they are
90 black: 0x00 0x00 0x00 126 represented on the Psion screen by a few built-in fonts. */
91 white: 0xff 0xff 0xff */
92typedef struct psiconv_color
93{
94 psiconv_u8 red;
95 psiconv_u8 green;
96 psiconv_u8 blue;
97} * psiconv_color;
98
99typedef struct psiconv_font 127typedef enum psiconv_screenfont
100{ 128{
101 char *name; 129 psiconv_font_misc, /* Nonproportional symbols, like Wingbat? */
130 psiconv_font_sansserif, /* Proportional sans-serif, like Arial */
131 psiconv_font_nonprop, /* Nonproportional, like Courier */
132 psiconv_font_serif /* Proportional serifed, like Times */
102 psiconv_u8 screenfont; 133} psiconv_screenfont_t;
103} *psiconv_font;
104 134
105typedef struct psiconv_border
106{
107 psiconv_border_kind_t kind;
108 psiconv_size_t thickness; /* Set to 1/20 for non-solid lines */
109 psiconv_color color;
110} *psiconv_border;
111 135
112typedef struct psiconv_bullet 136/* The kind of tab. Note that decimal tabs are not supported by the Psion. */
113{
114 psiconv_bool_t on;
115 psiconv_size_t font_size;
116 psiconv_u8 character;
117 psiconv_bool_t indent;
118 psiconv_color color;
119 psiconv_font font;
120} *psiconv_bullet;
121
122typedef enum psiconv_tab_kind 137typedef enum psiconv_tab_kind
123{ 138{
124 psiconv_tab_left, 139 psiconv_tab_left, /* Left tab */
125 psiconv_tab_centre, 140 psiconv_tab_centre, /* Centre tab */
126 psiconv_tab_right 141 psiconv_tab_right /* Right tab */
127} psiconv_tab_kind_t; 142} psiconv_tab_kind_t;
128 143
129typedef struct psiconv_tab 144/* When text has to be replaced, the kind of replacement to do
130{ 145 (not yet implemented!) */
131 psiconv_length_t location;
132 psiconv_tab_kind_t kind;
133} *psiconv_tab;
134
135
136typedef psiconv_list psiconv_tab_list; /* of struct psiconv_tab */
137
138typedef struct psiconv_all_tabs
139{
140 psiconv_length_t normal;
141 psiconv_tab_list extras;
142} *psiconv_all_tabs;
143
144typedef struct psiconv_character_layout
145{
146 psiconv_color color;
147 psiconv_color back_color;
148 psiconv_size_t font_size;
149 psiconv_bool_t italic;
150 psiconv_bool_t bold;
151 psiconv_super_sub_t super_sub;
152 psiconv_bool_t underline;
153 psiconv_bool_t strike_out;
154 psiconv_font font;
155} *psiconv_character_layout;
156
157typedef struct psiconv_paragraph_layout
158{
159 psiconv_color back_color;
160 psiconv_length_t indent_left;
161 psiconv_length_t indent_right;
162 psiconv_length_t indent_first;
163 psiconv_justify_hor_t justify_hor;
164 psiconv_justify_ver_t justify_ver;
165 psiconv_size_t interline;
166 psiconv_bool_t interline_exact;
167 psiconv_size_t top_space;
168 psiconv_size_t bottom_space;
169 psiconv_bool_t on_one_page;
170 psiconv_bool_t together_with; /* What the heck is this? */
171 psiconv_bool_t on_next_page;
172 psiconv_bool_t no_widow_protection;
173 psiconv_length_t border_distance;
174 psiconv_bullet bullet;
175 psiconv_border left_border;
176 psiconv_border right_border;
177 psiconv_border top_border;
178 psiconv_border bottom_border;
179 psiconv_all_tabs tabs;
180} *psiconv_paragraph_layout;
181
182typedef struct psiconv_header_section
183{
184 psiconv_u32 uid1;
185 psiconv_u32 uid2;
186 psiconv_u32 uid3;
187 psiconv_u32 checksum;
188 psiconv_u32 section_table_offset;
189 psiconv_file_type_t file;
190} *psiconv_header_section;
191
192typedef struct psiconv_section_table_entry
193{
194 psiconv_u32 id;
195 psiconv_u32 offset;
196} *psiconv_section_table_entry;
197
198typedef psiconv_list psiconv_section_table_section;
199/* Of struct sectiontable_entry */
200
201typedef struct psiconv_application_id_section
202{
203 psiconv_u32 id;
204 psiconv_string_t name;
205} *psiconv_application_id_section;
206
207typedef struct psiconv_in_line_layout
208{
209 psiconv_character_layout layout;
210 int length;
211} *psiconv_in_line_layout;
212
213typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */
214
215typedef enum psiconv_replacement_type 146typedef enum psiconv_replacement_type
216{ 147{
217 psiconv_replace_time, 148 psiconv_replace_time,
218 psiconv_replace_date, 149 psiconv_replace_date,
219 psiconv_replace_pagenr, 150 psiconv_replace_pagenr,
220 psiconv_replace_nr_of_pages, 151 psiconv_replace_nr_of_pages,
221 psiconv_replace_filename 152 psiconv_replace_filename
222} psiconv_replacement_type_t; 153} psiconv_replacement_type_t;
223 154
155
156/* Here starts the struct definitions */
157
158/* The color of a single pixel, in RGB format.
159 Black: 0x00 0x00 0x00
160 White: 0xff 0xff 0xff */
161typedef struct psiconv_color_s
162{
163 psiconv_u8 red;
164 psiconv_u8 green;
165 psiconv_u8 blue;
166} * psiconv_color;
167
168
169/* Complete font information: both a printer font and a corresponding screen
170 font to display it. */
171typedef struct psiconv_font_s
172{
173 psiconv_string_t name; /* Printer font */
174 psiconv_screenfont_t screenfont; /* Screen font */
175} *psiconv_font;
176
177/* Complete border information */
178typedef struct psiconv_border_s
179{
180 psiconv_border_kind_t kind; /* Border kind */
181 psiconv_size_t thickness; /* Set to 1/20 for non-solid lines */
182 psiconv_color color; /* Border color */
183} *psiconv_border;
184
185/* Complete bullet information.
186 If indent if off, the bullet is at the first line indentation level,
187 and the line text begins right after it. If it is on, the bullet is at
188 the minimum of the first line and left indentation, and the text starts
189 at the maximum of both. */
190typedef struct psiconv_bullet_s
191{
192 psiconv_bool_t on; /* Whether the bullet is shown */
193 psiconv_size_t font_size; /* Bullet font size */
194 psiconv_ucs2 character; /* Bullet character */
195 psiconv_bool_t indent; /* Whether to indent (see above */
196 psiconv_color color; /* Bullet color */
197 psiconv_font font; /* Bullet font */
198} *psiconv_bullet;
199
200/* Complete single tab information */
201typedef struct psiconv_tab_s
202{
203 psiconv_length_t location; /* The indentation level */
204 psiconv_tab_kind_t kind; /* Tab kind */
205} *psiconv_tab;
206
207/* A list of tabs */
208typedef psiconv_list psiconv_tab_list; /* of struct psiconv_tab_s */
209
210/* Information about all tabs.
211 Normal tabs start after the rightmost extra tab */
212typedef struct psiconv_all_tabs_s
213{
214 psiconv_length_t normal; /* Normal tab distance */
215 psiconv_tab_list extras; /* Additional defined tabs */
216} *psiconv_all_tabs;
217
218/* Character layout.
219 This structure holds all layout information that can be applied on the
220 character level (as opposed to layouts that only apply to whole
221 paragraphs).
222 Note that at all times, this structure holds the complete layout
223 information; we do not use incremental layouts, unlike the Psion
224 file format itself. So if an italic text is also underlined, the
225 character_layout will have both set for that region. */
226typedef struct psiconv_character_layout_s
227{
228 psiconv_color color; /* Character color */
229 psiconv_color back_color; /* Background color */
230 psiconv_size_t font_size; /* Font size */
231 psiconv_bool_t italic; /* Use italics? */
232 psiconv_bool_t bold; /* Use bold? */
233 psiconv_super_sub_t super_sub; /* Use super/subscript? */
234 psiconv_bool_t underline; /* Underline? */
235 psiconv_bool_t strikethrough; /* Strike through? */
236 psiconv_font font; /* Character font */
237} *psiconv_character_layout;
238
239/* Paragraph layout.
240 This structure holds all layout information that can be applied on the
241 paragraph level (as opposed to layouts that also apply to single
242 characters).
243 Note that at all times, this structure holds the complete layout
244 information; we do not use incremental layouts, unlike the Psion
245 file format itself.
246 Linespacing is the amount of vertical space between lines. If
247 linespacing_exact is set, this amount is used even if that would make
248 text overlap; if it is not set, a greater distance is used if text would
249 otherwise overlap.
250 Several booleans determine where page breaks may be set. keep_together
251 forbids page breaks in the middle of the paragraph; keep_with_next
252 forbids page breaks between this and the next paragraph. on_next_page
253 forces a pagebreak before the paragraph. no_widow_protection allows
254 one single line of the paragraph on a page, and the rest on another page.
255 Sheet cell text normally does not wrap; wrap_to_fit_cell allows this. */
256typedef struct psiconv_paragraph_layout_s
257{
258 psiconv_color back_color; /* Background color */
259 psiconv_length_t indent_left; /* Left indentation (except first line) */
260 psiconv_length_t indent_right; /* Right indentation */
261 psiconv_length_t indent_first; /* First line left indentation */
262 psiconv_justify_hor_t justify_hor; /* Horizontal justification */
263 psiconv_justify_ver_t justify_ver; /* Vertical justification */
264 psiconv_size_t linespacing; /* The linespacing */
265 psiconv_bool_t linespacing_exact; /* Is linespacing exact or the minimum? */
266 psiconv_size_t space_above; /* Vertical space before the paragraph */
267 psiconv_size_t space_below; /* Vertical space after the paragraph */
268 psiconv_bool_t keep_together; /* Keep lines on one page? */
269 psiconv_bool_t keep_with_next; /* Disallow pagebreak after paragraph? */
270 psiconv_bool_t on_next_page; /* Force page break before paragraph? */
271 psiconv_bool_t no_widow_protection; /* Undo widow protection? */
272 psiconv_bool_t wrap_to_fit_cell; /* Wrap sheet cell text? */
273 psiconv_length_t border_distance; /* Distance to borders */
274 psiconv_bullet bullet; /* Bullet information */
275 psiconv_border left_border; /* Left border information */
276 psiconv_border right_border; /* Right border information */
277 psiconv_border top_border; /* Top border information */
278 psiconv_border bottom_border; /* Bottom border information */
279 psiconv_all_tabs tabs; /* All tab information */
280} *psiconv_paragraph_layout;
281
282/* A Header Section.
283 It contains the three UIDs and the checksum, and the type of file.
284 As the type of file uniquely defines the UIDs, and as the UIDs determine
285 the checksum, this is never included in a regular psiconv_file structure.
286 It can be used to read the header section separately, though. */
287typedef struct psiconv_header_section_s
288{
289 psiconv_u32 uid1;
290 psiconv_u32 uid2;
291 psiconv_u32 uid3;
292 psiconv_u32 checksum;
293 psiconv_file_type_t file;
294} *psiconv_header_section;
295
296/* A Section Table Section entry.
297 Each entry has a UID and an offset.
298 This is never included in a regular psiconv_file structure, as the
299 information is too low-level. It is used internally, though. */
300typedef struct psiconv_section_table_entry_s
301{
302 psiconv_u32 id; /* Section UID */
303 psiconv_u32 offset; /* Section offset within the file */
304} *psiconv_section_table_entry;
305
306/* A Section Table Section.
307 A list of sections and their offsets.
308 It is simply a list of Section Table Section Entries.
309 This is never included in a regular psiconv_file structure, as the
310 information is too low-level. It is used internally, though. */
311typedef psiconv_list psiconv_section_table_section;
312 /* Of struct psiconv_sectiontable_entry_s */
313
314/* An Application ID Section.
315 The type of file.
316 Never included in a regular psiconv_file structure, because it is too
317 low-level. You can always recover it if you know the file type. Used
318 internally.
319 The name should probably be case-insensitive. */
320typedef struct psiconv_application_id_section_s
321{
322 psiconv_u32 id; /* File type UID */
323 psiconv_string_t name; /* File type name */
324} *psiconv_application_id_section;
325
326/* An Object Icon Section.
327 The icon used for an embedded object. */
328typedef struct psiconv_object_icon_section_s
329{
330 psiconv_length_t icon_width; /* Icon width */
331 psiconv_length_t icon_height; /* Icon height */
332 psiconv_string_t icon_name; /* Icon name */
333} *psiconv_object_icon_section;
334
335/* An Object Display Section.
336 How an embedded icon should be displayed.
337 The sizes are computed after cropping or resizing; if the object is shown
338 as an icon, the icon sizes are used here. */
339typedef struct psiconv_object_display_section_s
340{
341 psiconv_bool_t show_icon; /* Show an icon or the whole file? */
342 psiconv_length_t width; /* Object display width */
343 psiconv_length_t height; /* Object display height */
344} *psiconv_object_display_section;
345
346/* An Embedded Object Section.
347 All data about an embedded object.
348 An object is another psiconv_file, which is embedded in the current
349 file. Objects can also be embedded in each other, of course. */
350typedef struct psiconv_embedded_object_section_s
351{
352 psiconv_object_icon_section icon; /* Icon information */
353 psiconv_object_display_section display; /* Display information */
354 psiconv_file object; /* The object itself */
355} *psiconv_embedded_object_section;
356
357/* Inline character-level layout information.
358 Information how some characters should be laid out.
359 Note that, though you can choose specific layouts for an object, this
360 will probably not affect the object's rendering.
361 Usually, object will be NULL, and the object_width and object_height
362 will be ignored.
363 The object sizes are the same as in the Object Display Section, so
364 this information seems to be redundant. */
365typedef struct psiconv_in_line_layout_s
366{
367 psiconv_character_layout layout; /* Layout information */
368 int length; /* Number of characters */
369 psiconv_embedded_object_section object; /* Embedded object or NULL */
370 psiconv_length_t object_width; /* Object display width */
371 psiconv_length_t object_height; /* Object display height */
372} *psiconv_in_line_layout;
373
374/* Inline character information for a whole line.
375 A list of inline character information */
376typedef psiconv_list psiconv_in_line_layouts;
377 /* of struct psiconv_in_line_layout_s */
378
379/* What to replace where in text. Not yet implemented!
380 (not yet implemented!) */
224typedef struct psiconv_replacement 381typedef struct psiconv_replacement_s
225{ 382{
226 int offset; 383 int offset; /* Offset in text */
227 int cur_len; 384 int cur_len; /* Length of text to replace */
228 psiconv_replacement_type_t type; 385 psiconv_replacement_type_t type; /* Kind of replacement */
229} *psiconv_replacement; 386} *psiconv_replacement;
230 387
388/* A list of replacements */
231typedef psiconv_list psiconv_replacements; /* of struct replacement */ 389typedef psiconv_list psiconv_replacements; /* of struct psiconv_replacement_s */
232 390
391/* A paragraph of text.
392 Layout and actual paragraph text are combined here, even though
393 they are seperated in the Psion file format.
394 The base style is referred to, but the base_character and
395 base_paragraph have all style settings already incorporated.
396 The base style can be found using the psiconv_get_style function.
397 The in_lines are either an empty list, or they should apply to exactly
398 the number of characters in this paragraph */
233typedef struct psiconv_paragraph 399typedef struct psiconv_paragraph_s
234{ 400{
235 char *text; 401 psiconv_string_t text; /* Paragraph text */
236 psiconv_character_layout base_character; 402 psiconv_character_layout base_character; /* Base character layout */
237 psiconv_paragraph_layout base_paragraph; 403 psiconv_paragraph_layout base_paragraph; /* Base paragraph layout */
238 psiconv_s16 base_style; 404 psiconv_s16 base_style; /* Paragraph style */
239 psiconv_in_line_layouts in_lines; 405 psiconv_in_line_layouts in_lines; /* In-paragraph layout */
240 psiconv_replacements replacements; 406 psiconv_replacements replacements; /* Replacements like the date */
241} *psiconv_paragraph; 407} *psiconv_paragraph;
242 408
409/* A collection of text paragraphs */
243typedef psiconv_list psiconv_text_and_layout; /* Of struct paragraphs */ 410typedef psiconv_list psiconv_text_and_layout;
411 /* Of struct psiconv_paragraph_s */
244 412
413/* A TextEd Section.
414 Text and simple layout, without styles. */
245typedef struct psiconv_texted_section 415typedef struct psiconv_texted_section_s
246{ 416{
247 psiconv_text_and_layout paragraphs; 417 psiconv_text_and_layout paragraphs;
248} *psiconv_texted_section; 418} *psiconv_texted_section;
249 419
420/* A Page Header.
421 All information about a page header or footer.
422 An explicit base paragraph and character layout is found; this is used
423 as a sort of base style, on which all further formatting is based */
250typedef struct psiconv_page_header 424typedef struct psiconv_page_header_s
251{ 425{
252 psiconv_bool_t on_first_page; 426 psiconv_bool_t on_first_page; /* Display on first page? */
253 psiconv_paragraph_layout base_paragraph_layout; 427 psiconv_paragraph_layout base_paragraph_layout; /* Base paragraph layout */
254 psiconv_character_layout base_character_layout; 428 psiconv_character_layout base_character_layout; /* Base character layout */
255 psiconv_texted_section text; 429 psiconv_texted_section text; /* The actual text */
256} *psiconv_page_header; 430} *psiconv_page_header;
257 431
432/* A Page Layout Section
433 All information about the layout of a page.
434 Margins, page size, the header, the footer and page numbers */
258typedef struct psiconv_page_layout_section 435typedef struct psiconv_page_layout_section_s
259{ 436{
260 psiconv_u32 first_page_nr; 437 psiconv_u32 first_page_nr; /* Page numbers start counting here */
261 psiconv_length_t header_dist; 438 psiconv_length_t header_dist; /* Distance of header to text */
262 psiconv_length_t footer_dist; 439 psiconv_length_t footer_dist; /* Distance of footer to text */
263 psiconv_length_t left_margin; 440 psiconv_length_t left_margin; /* Left margin */
264 psiconv_length_t right_margin; 441 psiconv_length_t right_margin; /* Right margin */
265 psiconv_length_t top_margin; 442 psiconv_length_t top_margin; /* Top margin */
266 psiconv_length_t bottom_margin; 443 psiconv_length_t bottom_margin; /* Bottom margin */
267 psiconv_length_t page_width; 444 psiconv_length_t page_width; /* Page width */
268 psiconv_length_t page_height; 445 psiconv_length_t page_height; /* Page height */
269 psiconv_page_header header; 446 psiconv_page_header header; /* Header information */
270 psiconv_page_header footer; 447 psiconv_page_header footer; /* Footer information */
448 psiconv_bool_t landscape; /* Landscape orientation? */
271} * psiconv_page_layout_section; 449} * psiconv_page_layout_section;
272 450
451/* A Word Status Section
452 Settings of the Word program.
453 Several whitespace and related characters can be explicitely shown.
454 Embedded pictures and graphs can be iconized or displayed full.
455 Toolbars can be shown or hidden.
456 Long lines can be wrapped, or you have to use scrolling.
457 The cursor position is the character number of the text.
458 Zoom level: 1000 is "normal" */
273typedef struct psiconv_word_status_section 459typedef struct psiconv_word_status_section_s
274{ 460{
275 psiconv_bool_t show_tabs; 461 psiconv_bool_t show_tabs; /* Show tabs? */
276 psiconv_bool_t show_spaces; 462 psiconv_bool_t show_spaces; /* Show spaces? */
277 psiconv_bool_t show_paragraph_ends; 463 psiconv_bool_t show_paragraph_ends; /* Show paragraph ends? */
278 psiconv_bool_t show_line_breaks; 464 psiconv_bool_t show_line_breaks; /* Show line breaks */
279 psiconv_bool_t show_hard_minus; 465 psiconv_bool_t show_hard_minus; /* Show hard dashes? */
280 psiconv_bool_t show_hard_space; 466 psiconv_bool_t show_hard_space; /* Show hard spaces? */
281 psiconv_bool_t show_full_pictures; 467 psiconv_bool_t show_full_pictures; /* Show embedded pictures (or iconize)? */
282 psiconv_bool_t show_full_graphs; 468 psiconv_bool_t show_full_graphs; /* Show embedded graphs (or iconize)? */
283 psiconv_bool_t show_top_toolbar; 469 psiconv_bool_t show_top_toolbar; /* Show top toolbar? */
284 psiconv_bool_t show_side_toolbar; 470 psiconv_bool_t show_side_toolbar; /* Show side toolbar? */
285 psiconv_bool_t fit_lines_to_screen; 471 psiconv_bool_t fit_lines_to_screen; /* Wrap lines? */
286 psiconv_u32 cursor_position; 472 psiconv_u32 cursor_position; /* Cursor position (character number) */
287 psiconv_u32 display_size; 473 psiconv_u32 display_size; /* Zooming level */
288} *psiconv_word_status_section; 474} *psiconv_word_status_section;
289 475
476/* A Word Style.
477 All information about a single Style.
478 A builtin style may not be changed in the Word program.
479 Outline level is zero if unused.
480 The name may be NULL for the normal style! */
290typedef struct psiconv_word_style 481typedef struct psiconv_word_style_s
482{
483 psiconv_character_layout character; /* character-level layout */
484 psiconv_paragraph_layout paragraph; /* paragraph-level layout */
485 psiconv_ucs2 hotkey; /* The hotkey */
486 psiconv_string_t name; /* Style name */
487 psiconv_bool_t built_in; /* Builtin style? */
488 psiconv_u32 outline_level; /* Outline level */
489} *psiconv_word_style;
490
491/* A list of Word Styles */
492typedef psiconv_list psiconv_word_style_list;
493 /* Of struct psiconv_word_style_s */
494
495/* A Word Styles Section
496 All information about styles.
497 Note that the name of the normal style is NULL! */
498typedef struct psiconv_word_styles_section_s
499{
500 psiconv_word_style normal; /* The normal (unspecified) style */
501 psiconv_word_style_list styles; /* All other defined styles */
502} *psiconv_word_styles_section;
503
504/* A Word File
505 All information about a Word File.
506 Note that a section can be NULL if it is not present. */
507typedef struct psiconv_word_f_s
508{
509 psiconv_page_layout_section page_sec; /* Page layout */
510 psiconv_text_and_layout paragraphs; /* Text and text layout */
511 psiconv_word_status_section status_sec; /* Internal Word program settings */
512 psiconv_word_styles_section styles_sec; /* Styles */
513} *psiconv_word_f;
514
515/* A TextEd File
516 All information about a TextEd File.
517 Note that a section can be NULL if it is not present. */
518typedef struct psiconv_texted_f_s
519{
520 psiconv_page_layout_section page_sec; /* Page layout */
521 psiconv_texted_section texted_sec; /* Text and text layout */
522} *psiconv_texted_f;
523
524/* A Jumptable Section.
525 A simple list of offsets.
526 This is never included in a regular psiconv_file structure, as the
527 information is too low-level. It is used internally, though. */
528typedef psiconv_list psiconv_jumptable_section; /* of psiconv_u32 */
529
530/* A Paint Data Section
531 A collection of pixels.
532 Normalized values [0..1] for each color component.
533 Origin is (x,y)=(0,0), to get pixel at (X,Y) use index [Y*xsize+X] */
534typedef struct psiconv_paint_data_section_s
535{
536 psiconv_u32 xsize; /* Number of pixels in a row */
537 psiconv_u32 ysize; /* Number of pixels in a column */
538 psiconv_length_t pic_xsize; /* 0 if not specified */
539 psiconv_length_t pic_ysize; /* 0 if not specified */
540 float *red;
541 float *green;
542 float *blue;
543} *psiconv_paint_data_section;
544
545/* A collection of Paint Data Sections */
546typedef psiconv_list psiconv_pictures;
547 /* of struct psiconv_paint_data_section_s */
548
549/* A MBM file
550 All information about a MBM file
551 MBM files contain one or more pictures. */
552typedef struct psiconv_mbm_f_s
553{
554 psiconv_pictures sections;
555} *psiconv_mbm_f;
556
557/* Read the Psiconv file format documentation for a complete discription.
558 Basic idea: a picture has a certain display size. Within it, the pixel
559 data begins at a certain offset. Around it, there is an empty form.
560 The first eight values are before magnification and cuts.
561 Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0
562 cuts everything away. */
563typedef struct psiconv_sketch_section_s
564{
565 psiconv_u16 displayed_xsize;
566 psiconv_u16 displayed_ysize;
567 psiconv_u16 picture_data_x_offset;
568 psiconv_u16 picture_data_y_offset;
569 psiconv_u16 form_xsize;
570 psiconv_u16 form_ysize;
571 psiconv_u16 displayed_size_x_offset;
572 psiconv_u16 displayed_size_y_offset;
573 float magnification_x; /* computed relative to first eight values */
574 float magnification_y; /* computed relative to first eight values */
575 float cut_left; /* computed relative to first eight values */
576 float cut_right; /* computed relative to first eight values */
577 float cut_top; /* computed relative to first eight values */
578 float cut_bottom; /* computed relative to first eight values */
579 psiconv_paint_data_section picture;
580} *psiconv_sketch_section;
581
582typedef struct psiconv_sketch_f_s
583{
584 psiconv_sketch_section sketch_sec;
585} *psiconv_sketch_f;
586
587typedef struct psiconv_clipart_section_s
588{
589 /* Perhaps later on some currently unknown stuff. */
590 psiconv_paint_data_section picture;
591} * psiconv_clipart_section;
592
593typedef psiconv_list psiconv_cliparts; /* of struct psiconv_clipart_section_s */
594
595typedef struct psiconv_clipart_f_s
596{
597 psiconv_cliparts sections;
598} *psiconv_clipart_f;
599
600typedef struct psiconv_sheet_ref_s
601{
602 psiconv_s16 offset;
603 psiconv_bool_t absolute;
604} psiconv_sheet_ref_t;
605
606typedef struct psiconv_sheet_cell_reference_s
607{
608 psiconv_sheet_ref_t row;
609 psiconv_sheet_ref_t column;
610} psiconv_sheet_cell_reference_t;
611
612typedef struct psiconv_sheet_cell_block_s
613{
614 psiconv_sheet_cell_reference_t first;
615 psiconv_sheet_cell_reference_t last;
616} psiconv_sheet_cell_block_t;
617
618typedef enum psiconv_cell_type
619{
620 psiconv_cell_blank,
621 psiconv_cell_int,
622 psiconv_cell_bool,
623 psiconv_cell_error,
624 psiconv_cell_float,
625 psiconv_cell_string
626} psiconv_cell_type_t;
627
628typedef enum psiconv_sheet_errorcode
629{
630 psiconv_sheet_error_none,
631 psiconv_sheet_error_null,
632 psiconv_sheet_error_divzero,
633 psiconv_sheet_error_value,
634 psiconv_sheet_error_reference,
635 psiconv_sheet_error_name,
636 psiconv_sheet_error_number,
637 psiconv_sheet_error_notavail
638} psiconv_sheet_errorcode_t;
639
640typedef enum psiconv_sheet_numberformat_code
641{
642 psiconv_numberformat_general,
643 psiconv_numberformat_fixeddecimal,
644 psiconv_numberformat_scientific,
645 psiconv_numberformat_currency,
646 psiconv_numberformat_percent,
647 psiconv_numberformat_triads,
648 psiconv_numberformat_boolean,
649 psiconv_numberformat_text,
650 psiconv_numberformat_date_dmm,
651 psiconv_numberformat_date_mmd,
652 psiconv_numberformat_date_ddmmyy,
653 psiconv_numberformat_date_mmddyy,
654 psiconv_numberformat_date_yymmdd,
655 psiconv_numberformat_date_dmmm,
656 psiconv_numberformat_date_dmmmyy,
657 psiconv_numberformat_date_ddmmmyy,
658 psiconv_numberformat_date_mmm,
659 psiconv_numberformat_date_monthname,
660 psiconv_numberformat_date_mmmyy,
661 psiconv_numberformat_date_monthnameyy,
662 psiconv_numberformat_date_monthnamedyyyy,
663 psiconv_numberformat_datetime_ddmmyyyyhhii,
664 psiconv_numberformat_datetime_ddmmyyyyHHii,
665 psiconv_numberformat_datetime_mmddyyyyhhii,
666 psiconv_numberformat_datetime_mmddyyyyHHii,
667 psiconv_numberformat_datetime_yyyymmddhhii,
668 psiconv_numberformat_datetime_yyyymmddHHii,
669 psiconv_numberformat_time_hhii,
670 psiconv_numberformat_time_hhiiss,
671 psiconv_numberformat_time_HHii,
672 psiconv_numberformat_time_HHiiss
673} psiconv_sheet_numberformat_code_t;
674
675typedef struct psiconv_sheet_numberformat_s
676{
677 psiconv_sheet_numberformat_code_t code;
678 psiconv_u8 decimal;
679} *psiconv_sheet_numberformat;
680
681typedef struct psiconv_sheet_cell_layout_s
291{ 682{
292 psiconv_character_layout character; 683 psiconv_character_layout character;
293 psiconv_paragraph_layout paragraph; 684 psiconv_paragraph_layout paragraph;
294 psiconv_u8 hotkey; 685 psiconv_sheet_numberformat numberformat;
686} * psiconv_sheet_cell_layout;
687
688typedef struct psiconv_sheet_cell_s
689{
690 psiconv_u16 column;
691 psiconv_u16 row;
692 psiconv_cell_type_t type;
693 union {
694 psiconv_u32 dat_int;
695 double dat_float;
696 psiconv_string_t dat_string;
697 psiconv_bool_t dat_bool;
698 psiconv_sheet_errorcode_t dat_error;
699 } data;
700 psiconv_sheet_cell_layout layout;
701 psiconv_bool_t calculated;
702 psiconv_u32 ref_formula;
703} *psiconv_sheet_cell;
704
705typedef psiconv_list psiconv_sheet_cell_list;
706 /* Of struct psiconv_sheet_cell_s */
707
708typedef struct psiconv_sheet_status_section_s
709{
710 psiconv_bool_t show_graph;
711 psiconv_u32 cursor_row;
712 psiconv_u32 cursor_column;
713 psiconv_bool_t show_top_sheet_toolbar;
714 psiconv_bool_t show_side_sheet_toolbar;
715 psiconv_bool_t show_top_graph_toolbar;
716 psiconv_bool_t show_side_graph_toolbar;
717 psiconv_u32 sheet_display_size;
718 psiconv_u32 graph_display_size;
719 psiconv_triple_t show_horizontal_scrollbar;
720 psiconv_triple_t show_vertical_scrollbar;
721} *psiconv_sheet_status_section;
722
723typedef enum psiconv_formula_type
724{
725 psiconv_formula_unknown,
726 psiconv_formula_op_lt,
727 psiconv_formula_op_le,
728 psiconv_formula_op_gt,
729 psiconv_formula_op_ge,
730 psiconv_formula_op_ne,
731 psiconv_formula_op_eq,
732 psiconv_formula_op_add,
733 psiconv_formula_op_sub,
734 psiconv_formula_op_mul,
735 psiconv_formula_op_div,
736 psiconv_formula_op_pow,
737 psiconv_formula_op_pos,
738 psiconv_formula_op_neg,
739 psiconv_formula_op_not,
740 psiconv_formula_op_and,
741 psiconv_formula_op_or,
742 psiconv_formula_op_con,
743 psiconv_formula_op_bra,
744 psiconv_formula_mark_eof,
745 psiconv_formula_dat_float,
746 psiconv_formula_dat_int,
747 psiconv_formula_dat_var,
748 psiconv_formula_dat_string,
749 psiconv_formula_dat_cellref,
750 psiconv_formula_dat_cellblock,
751 psiconv_formula_dat_vcellblock,
752 psiconv_formula_mark_opsep,
753 psiconv_formula_mark_opend,
754 psiconv_formula_fun_false,
755 psiconv_formula_fun_if,
756 psiconv_formula_fun_true,
757 psiconv_formula_fun_cell,
758 psiconv_formula_fun_errortype,
759 psiconv_formula_fun_isblank,
760 psiconv_formula_fun_iserr,
761 psiconv_formula_fun_iserror,
762 psiconv_formula_fun_islogical,
763 psiconv_formula_fun_isna,
764 psiconv_formula_fun_isnontext,
765 psiconv_formula_fun_isnumber,
766 psiconv_formula_fun_istext,
767 psiconv_formula_fun_n,
768 psiconv_formula_fun_type,
769 psiconv_formula_fun_address,
770 psiconv_formula_fun_column,
771 psiconv_formula_fun_columns,
772 psiconv_formula_fun_hlookup,
773 psiconv_formula_fun_index,
774 psiconv_formula_fun_indirect,
775 psiconv_formula_fun_lookup,
776 psiconv_formula_fun_offset,
777 psiconv_formula_fun_row,
778 psiconv_formula_fun_rows,
779 psiconv_formula_fun_vlookup,
780 psiconv_formula_fun_char,
781 psiconv_formula_fun_code,
782 psiconv_formula_fun_exact,
783 psiconv_formula_fun_find,
784 psiconv_formula_fun_left,
785 psiconv_formula_fun_len,
786 psiconv_formula_fun_lower,
787 psiconv_formula_fun_mid,
788 psiconv_formula_fun_proper,
789 psiconv_formula_fun_replace,
790 psiconv_formula_fun_rept,
791 psiconv_formula_fun_right,
792 psiconv_formula_fun_string,
793 psiconv_formula_fun_t,
794 psiconv_formula_fun_trim,
795 psiconv_formula_fun_upper,
796 psiconv_formula_fun_value,
797 psiconv_formula_fun_date,
798 psiconv_formula_fun_datevalue,
799 psiconv_formula_fun_day,
800 psiconv_formula_fun_hour,
801 psiconv_formula_fun_minute,
802 psiconv_formula_fun_month,
803 psiconv_formula_fun_now,
804 psiconv_formula_fun_second,
805 psiconv_formula_fun_today,
806 psiconv_formula_fun_time,
807 psiconv_formula_fun_timevalue,
808 psiconv_formula_fun_year,
809 psiconv_formula_fun_abs,
810 psiconv_formula_fun_acos,
811 psiconv_formula_fun_asin,
812 psiconv_formula_fun_atan,
813 psiconv_formula_fun_atan2,
814 psiconv_formula_fun_cos,
815 psiconv_formula_fun_degrees,
816 psiconv_formula_fun_exp,
817 psiconv_formula_fun_fact,
818 psiconv_formula_fun_int,
819 psiconv_formula_fun_ln,
820 psiconv_formula_fun_log10,
821 psiconv_formula_fun_mod,
822 psiconv_formula_fun_pi,
823 psiconv_formula_fun_radians,
824 psiconv_formula_fun_rand,
825 psiconv_formula_fun_round,
826 psiconv_formula_fun_sign,
827 psiconv_formula_fun_sin,
828 psiconv_formula_fun_sqrt,
829 psiconv_formula_fun_sumproduct,
830 psiconv_formula_fun_tan,
831 psiconv_formula_fun_trunc,
832 psiconv_formula_fun_cterm,
833 psiconv_formula_fun_ddb,
834 psiconv_formula_fun_fv,
835 psiconv_formula_fun_irr,
836 psiconv_formula_fun_npv,
837 psiconv_formula_fun_pmt,
838 psiconv_formula_fun_pv,
839 psiconv_formula_fun_rate,
840 psiconv_formula_fun_sln,
841 psiconv_formula_fun_syd,
842 psiconv_formula_fun_term,
843 psiconv_formula_fun_combin,
844 psiconv_formula_fun_permut,
845 psiconv_formula_vfn_average,
846 psiconv_formula_vfn_choose,
847 psiconv_formula_vfn_count,
848 psiconv_formula_vfn_counta,
849 psiconv_formula_vfn_countblank,
850 psiconv_formula_vfn_max,
851 psiconv_formula_vfn_min,
852 psiconv_formula_vfn_product,
853 psiconv_formula_vfn_stdevp,
854 psiconv_formula_vfn_stdev,
855 psiconv_formula_vfn_sum,
856 psiconv_formula_vfn_sumsq,
857 psiconv_formula_vfn_varp,
858 psiconv_formula_vfn_var
859} psiconv_formula_type_t;
860
861typedef psiconv_list psiconv_formula_list; /* Of struct psiconv_formula_s */
862
863typedef struct psiconv_formula_s
864{
865 psiconv_formula_type_t type;
866 union {
867 psiconv_u32 dat_int;
868 double dat_float;
869 psiconv_string_t dat_string;
870 psiconv_sheet_cell_reference_t dat_cellref;
871 psiconv_sheet_cell_block_t dat_cellblock;
872 psiconv_formula_list fun_operands;
873 psiconv_u32 dat_variable;
874 } data;
875} *psiconv_formula;
876
877typedef struct psiconv_sheet_line_s
878{
879 psiconv_u32 position;
880 psiconv_sheet_cell_layout layout;
881} *psiconv_sheet_line;
882
883typedef psiconv_list psiconv_sheet_line_list;
884 /* Of struct psiconv_sheet_line_s */
885
886typedef struct psiconv_sheet_grid_size_s
887{
888 psiconv_u32 line_number;
889 psiconv_length_t size;
890} *psiconv_sheet_grid_size;
891
892typedef psiconv_list psiconv_sheet_grid_size_list;
893 /* Of struct psiconv_sheet_grid_size_s */
894
895typedef psiconv_list psiconv_sheet_grid_break_list; /* of psiconv_u32 */
896
897typedef struct psiconv_sheet_grid_section_s
898{
899 psiconv_bool_t show_column_titles;
900 psiconv_bool_t show_row_titles;
901 psiconv_bool_t show_vertical_grid;
902 psiconv_bool_t show_horizontal_grid;
903 psiconv_bool_t freeze_rows;
904 psiconv_bool_t freeze_columns;
905 psiconv_u32 frozen_rows;
906 psiconv_u32 frozen_columns;
907 psiconv_u32 first_unfrozen_row_displayed;
908 psiconv_u32 first_unfrozen_column_displayed;
909 psiconv_bool_t show_page_breaks;
910 psiconv_u32 first_row;
911 psiconv_u32 first_column;
912 psiconv_u32 last_row;
913 psiconv_u32 last_column;
914 psiconv_length_t default_row_height;
915 psiconv_length_t default_column_width;
916 psiconv_sheet_grid_size_list row_heights;
917 psiconv_sheet_grid_size_list column_heights;
918 psiconv_sheet_grid_break_list row_page_breaks;
919 psiconv_sheet_grid_break_list column_page_breaks;
920} *psiconv_sheet_grid_section;
921
922typedef struct psiconv_sheet_worksheet_s
923{
924 psiconv_sheet_cell_layout default_layout;
925 psiconv_sheet_cell_list cells;
926 psiconv_bool_t show_zeros;
927 psiconv_sheet_line_list row_default_layouts;
928 psiconv_sheet_line_list col_default_layouts;
929 psiconv_sheet_grid_section grid;
930} *psiconv_sheet_worksheet;
931
932typedef psiconv_list psiconv_sheet_worksheet_list;
933 /* of struct psiconv_sheet_worksheet_s */
934
935typedef enum psiconv_variable_type
936{
937 psiconv_var_int,
938 psiconv_var_float,
939 psiconv_var_string,
940 psiconv_var_cellref,
941 psiconv_var_cellblock
942} psiconv_variable_type_t;
943
944typedef struct psiconv_sheet_variable_s
945{
946 psiconv_u32 number;
295 psiconv_string_t name; 947 psiconv_string_t name;
296 psiconv_bool_t built_in; 948 psiconv_variable_type_t type;
297} *psiconv_word_style; 949 union {
950 psiconv_s32 dat_int;
951 double dat_float;
952 psiconv_string_t dat_string;
953 psiconv_sheet_cell_reference_t dat_cellref;
954 psiconv_sheet_cell_block_t dat_cellblock;
955 } data;
956} *psiconv_sheet_variable;
957
958typedef psiconv_list psiconv_sheet_variable_list;
959 /* of struct psiconv_sheet_variable_s */
298 960
299typedef psiconv_list psiconv_word_style_list; /* Of style */
300
301typedef struct psiconv_word_styles_section 961typedef struct psiconv_sheet_name_section_s
302{ 962{
303 psiconv_word_style normal; 963 psiconv_string_t name;
304 psiconv_word_style_list styles; 964} *psiconv_sheet_name_section;
305} *psiconv_word_styles_section;
306 965
966typedef struct psiconv_sheet_info_section_s
967{
968 psiconv_bool_t auto_recalc;
969} *psiconv_sheet_info_section;
970
971typedef struct psiconv_sheet_workbook_section_s
972{
973 psiconv_formula_list formulas;
974 psiconv_sheet_worksheet_list worksheets;
975 psiconv_sheet_variable_list variables;
976 psiconv_sheet_info_section info;
977 psiconv_sheet_name_section name;
978} *psiconv_sheet_workbook_section;
979
307typedef struct psiconv_word_f { 980typedef struct psiconv_sheet_f_s
981{
308 psiconv_page_layout_section page_sec; 982 psiconv_page_layout_section page_sec;
309 psiconv_text_and_layout paragraphs;
310 psiconv_word_status_section status_sec; 983 psiconv_sheet_status_section status_sec;
311 psiconv_word_styles_section styles_sec; 984 psiconv_sheet_workbook_section workbook_sec;
312} *psiconv_word_f;
313
314typedef struct psiconv_texted_f {
315 psiconv_page_layout_section page_sec;
316 psiconv_texted_section texted_sec;
317} *psiconv_texted_f; 985} *psiconv_sheet_f;
318 986
319typedef struct psiconv_file { 987/* NB: psiconv_file is already defined above */
988struct psiconv_file_s
989{
320 psiconv_file_type_t type; 990 psiconv_file_type_t type;
321 void *file; 991 void *file;
322} *psiconv_file; 992};
323 993
324 994
325/* UID1 */ 995/* UID1 */
326#define PSICONV_ID_PSION5 0x10000037 996#define PSICONV_ID_PSION5 0x10000037
997#define PSICONV_ID_CLIPART 0x10000041
327/* UID2 */ 998/* UID2 */
328#define PSICONV_ID_DATA_FILE 0x1000006D 999#define PSICONV_ID_DATA_FILE 0x1000006D
1000#define PSICONV_ID_MBM_FILE 0x10000042
329/* UID3 */ 1001/* UID3 */
330#define PSICONV_ID_WORD 0x1000007F 1002#define PSICONV_ID_WORD 0x1000007F
331#define PSICONV_ID_TEXTED 0x10000085 1003#define PSICONV_ID_TEXTED 0x10000085
1004#define PSICONV_ID_SKETCH 0x1000007D
1005#define PSICONV_ID_SHEET 0x10000088
332 1006
333/* Section table ids */ 1007/* Section table ids */
334#define PSICONV_ID_WORD_STATUS_SECTION 0x10000243 1008#define PSICONV_ID_WORD_STATUS_SECTION 0x10000243
335#define PSICONV_ID_APPL_ID_SECTION 0x10000089 1009#define PSICONV_ID_APPL_ID_SECTION 0x10000089
336#define PSICONV_ID_TEXT_SECTION 0x10000106 1010#define PSICONV_ID_TEXT_SECTION 0x10000106
337#define PSICONV_ID_LAYOUT_SECTION 0x10000143 1011#define PSICONV_ID_LAYOUT_SECTION 0x10000143
338#define PSICONV_ID_WORD_STYLES_SECTION 0x10000104 1012#define PSICONV_ID_WORD_STYLES_SECTION 0x10000104
339#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 1013#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105
340#define PSICONV_ID_PASSWORD_SECTION 0x100000CD 1014#define PSICONV_ID_PASSWORD_SECTION 0x100000CD
1015#define PSICONV_ID_SKETCH_SECTION 0x1000007D
1016#define PSICONV_ID_SHEET_STATUS_SECTION 0x1000011F
1017#define PSICONV_ID_SHEET_WORKBOOK_SECTION 0x1000011D
1018#define PSICONV_ID_SHEET_GRAPH_SECTION 0x10000121
341 1019
342/* Other ids */ 1020/* Other ids */
343#define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd 1021#define PSICONV_ID_PAGE_DIMENSIONS1 0x100000fd
1022#define PSICONV_ID_PAGE_DIMENSIONS2 0x1000010e
344#define PSICONV_ID_TEXTED_BODY 0x1000005c 1023#define PSICONV_ID_TEXTED_BODY 0x1000005c
345#define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063 1024#define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063
346#define PSICONV_ID_TEXTED_UNKNOWN 0x10000065 1025#define PSICONV_ID_TEXTED_UNKNOWN 0x10000065
347#define PSICONV_ID_TEXTED_LAYOUT 0x10000066 1026#define PSICONV_ID_TEXTED_LAYOUT 0x10000066
348#define PSICONV_ID_TEXTED_TEXT 0x10000064 1027#define PSICONV_ID_TEXTED_TEXT 0x10000064
349#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F 1028#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F
350#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C 1029#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C
1030#define PSICONV_ID_CLIPART_ITEM 0x10000040
1031#define PSICONV_ID_OBJECT 0x10000051
1032#define PSICONV_ID_OBJECT_DISPLAY_SECTION 0x10000146
1033#define PSICONV_ID_OBJECT_ICON_SECTION 0x1000012A
1034#define PSICONV_ID_OBJECT_SECTION_TABLE_SECTION 0x10000144
351 1035
352 1036
353/* Return a clean layout_status. You can modify it at will */ 1037/* Return a clean layout_status. You can modify it at will. Returns NULL
1038 if there is not enough memory. */
354extern psiconv_character_layout psiconv_basic_character_layout(void); 1039extern psiconv_character_layout psiconv_basic_character_layout(void);
355 1040
356/* Return a clean layout_status. You can modify it at will */ 1041/* Return a clean layout_status. You can modify it at will. Returns NULL
1042 if there is not enough memory. */
357extern psiconv_paragraph_layout psiconv_basic_paragraph_layout(void); 1043extern psiconv_paragraph_layout psiconv_basic_paragraph_layout(void);
358 1044
359/* Clone a layout_status: the new copy is completely independent of the 1045/* Clone a layout_status: the new copy is completely independent of the
360 original one */ 1046 original one. Returns NULL if there is not enough memory. */
361extern psiconv_paragraph_layout psiconv_clone_paragraph_layout 1047extern psiconv_paragraph_layout psiconv_clone_paragraph_layout
362 (psiconv_paragraph_layout ls); 1048 (psiconv_paragraph_layout ls);
363 1049
364extern psiconv_character_layout psiconv_clone_character_layout 1050extern psiconv_character_layout psiconv_clone_character_layout
365 (psiconv_character_layout ls); 1051 (psiconv_character_layout ls);
366 1052
367/* Get a numbered style */ 1053/* Get a numbered style. Returns NULL if the style is unknown. */
368extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); 1054extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr);
1055/* Get a numbered formula. Returns NULL if the style is unknown. */
1056extern psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr);
1057
1058/* Return the default layout */
1059extern psiconv_sheet_cell_layout psiconv_get_default_layout
1060 (psiconv_sheet_line_list row_defaults,
1061 psiconv_sheet_line_list col_defaults,
1062 psiconv_sheet_cell_layout cell_default,
1063 int row,int col);
369 1064
370extern void psiconv_free_color(psiconv_color color); 1065extern void psiconv_free_color(psiconv_color color);
371extern void psiconv_free_border(psiconv_border border); 1066extern void psiconv_free_border(psiconv_border border);
372extern void psiconv_free_bullet(psiconv_bullet bullet); 1067extern void psiconv_free_bullet(psiconv_bullet bullet);
373extern void psiconv_free_font(psiconv_font font); 1068extern void psiconv_free_font(psiconv_font font);
376extern void psiconv_free_paragraph_layout(psiconv_paragraph_layout layout); 1071extern void psiconv_free_paragraph_layout(psiconv_paragraph_layout layout);
377extern void psiconv_free_character_layout(psiconv_character_layout layout); 1072extern void psiconv_free_character_layout(psiconv_character_layout layout);
378extern void psiconv_free_word_style(psiconv_word_style style); 1073extern void psiconv_free_word_style(psiconv_word_style style);
379extern void psiconv_free_word_styles_section 1074extern void psiconv_free_word_styles_section
380 (psiconv_word_styles_section styles); 1075 (psiconv_word_styles_section styles);
1076extern void psiconv_free_formula(psiconv_formula formula);
1077extern void psiconv_free_formula_list(psiconv_formula_list list);
1078extern void psiconv_free_sheet_status_section
1079 (psiconv_sheet_status_section section);
1080extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout);
1081extern void psiconv_free_sheet_grid_break_list
1082 (psiconv_sheet_grid_break_list list);
1083extern void psiconv_free_sheet_grid_size(psiconv_sheet_grid_size s);
1084extern void psiconv_free_sheet_grid_size_list
1085 (psiconv_sheet_grid_size_list list);
1086extern void psiconv_free_sheet_grid_section(psiconv_sheet_grid_section sec);
1087extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet);
1088extern void psiconv_free_sheet_worksheet_list
1089 (psiconv_sheet_worksheet_list list);
1090
1091extern void psiconv_free_sheet_f(psiconv_sheet_f file);
1092extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell);
1093extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list);
1094extern void psiconv_free_sheet_numberformat
1095 (psiconv_sheet_numberformat numberformat);
1096extern void psiconv_free_sheet_line_list(psiconv_sheet_line_list list);
1097extern void psiconv_free_sheet_line(psiconv_sheet_line line);
1098extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section);
1099extern void psiconv_free_sheet_variable(psiconv_sheet_variable list);
1100extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list);
1101extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section);
1102extern void psiconv_free_sheet_workbook_section
1103 (psiconv_sheet_workbook_section section);
381extern void psiconv_free_header_section(psiconv_header_section header); 1104extern void psiconv_free_header_section(psiconv_header_section header);
382extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); 1105extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry);
383extern void psiconv_free_section_table_section 1106extern void psiconv_free_section_table_section
384 (psiconv_section_table_section section); 1107 (psiconv_section_table_section section);
385extern void psiconv_free_application_id_section 1108extern void psiconv_free_application_id_section
386 (psiconv_application_id_section section); 1109 (psiconv_application_id_section section);
1110extern void psiconv_free_object_display_section
1111 (psiconv_object_display_section section);
1112extern void psiconv_free_object_icon_section
1113 (psiconv_object_icon_section section);
1114extern void psiconv_free_embedded_object_section
1115 (psiconv_embedded_object_section object);
387extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); 1116extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout);
388extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); 1117extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts);
389extern void psiconv_free_replacement(psiconv_replacement replacement); 1118extern void psiconv_free_replacement(psiconv_replacement replacement);
390extern void psiconv_free_replacements(psiconv_replacements replacements); 1119extern void psiconv_free_replacements(psiconv_replacements replacements);
391extern void psiconv_free_paragraph(psiconv_paragraph paragraph); 1120extern void psiconv_free_paragraph(psiconv_paragraph paragraph);
395extern void psiconv_free_page_layout_section 1124extern void psiconv_free_page_layout_section
396 (psiconv_page_layout_section section); 1125 (psiconv_page_layout_section section);
397extern void psiconv_free_word_status_section 1126extern void psiconv_free_word_status_section
398 (psiconv_word_status_section section); 1127 (psiconv_word_status_section section);
399extern void psiconv_free_word_f(psiconv_word_f file); 1128extern void psiconv_free_word_f(psiconv_word_f file);
1129extern void psiconv_free_texted_f(psiconv_texted_f file);
1130extern void psiconv_free_paint_data_section(psiconv_paint_data_section section);
1131extern void psiconv_free_pictures(psiconv_pictures section);
1132extern void psiconv_free_jumptable_section
1133 (psiconv_jumptable_section section);
1134extern void psiconv_free_mbm_f(psiconv_mbm_f file);
1135extern void psiconv_free_sketch_section(psiconv_sketch_section sec);
1136extern void psiconv_free_sketch_f(psiconv_sketch_f file);
1137extern void psiconv_free_clipart_section(psiconv_clipart_section section);
1138extern void psiconv_free_cliparts(psiconv_cliparts section);
1139extern void psiconv_free_clipart_f(psiconv_clipart_f file);
1140
400extern void psiconv_free_file(psiconv_file file); 1141extern void psiconv_free_file(psiconv_file file);
401 1142
1143extern int psiconv_compare_color(const psiconv_color value1,
1144 const psiconv_color value2);
1145extern int psiconv_compare_font(const psiconv_font value1,
1146 const psiconv_font value2);
1147extern int psiconv_compare_border(const psiconv_border value1,
1148 const psiconv_border value2);
1149extern int psiconv_compare_bullet(const psiconv_bullet value1,
1150 const psiconv_bullet value2);
1151extern int psiconv_compare_tab(const psiconv_tab value1,
1152 const psiconv_tab value2);
1153extern int psiconv_compare_all_tabs(const psiconv_all_tabs value1,
1154 const psiconv_all_tabs value2);
1155extern int psiconv_compare_paragraph_layout
1156 (const psiconv_paragraph_layout value1,
1157 const psiconv_paragraph_layout value2);
1158
1159extern int psiconv_compare_character_layout
1160 (const psiconv_character_layout value1,
1161 const psiconv_character_layout value2);
1162
1163/* Get a newly allocated file with sensible defaults, ready to generate. */
1164extern psiconv_file psiconv_empty_file(psiconv_file_type_t type);
1165
1166
1167#ifdef __cplusplus
1168}
1169#endif /* __cplusplus */
402 1170
403#endif /* def PSICONV_DATA_H */ 1171#endif /* def PSICONV_DATA_H */

Legend:
Removed from v.2  
changed lines
  Added in v.196

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26