… | |
… | |
93 | } psiconv_border_kind_t; |
93 | } psiconv_border_kind_t; |
94 | |
94 | |
95 | /* Colors. |
95 | /* Colors. |
96 | black: 0x00 0x00 0x00 |
96 | black: 0x00 0x00 0x00 |
97 | white: 0xff 0xff 0xff */ |
97 | white: 0xff 0xff 0xff */ |
98 | typedef struct psiconv_color |
98 | typedef struct psiconv_color_s |
99 | { |
99 | { |
100 | psiconv_u8 red; |
100 | psiconv_u8 red; |
101 | psiconv_u8 green; |
101 | psiconv_u8 green; |
102 | psiconv_u8 blue; |
102 | psiconv_u8 blue; |
103 | } * psiconv_color; |
103 | } * psiconv_color; |
104 | |
104 | |
105 | typedef struct psiconv_font |
105 | typedef struct psiconv_font_s |
106 | { |
106 | { |
107 | char *name; |
107 | char *name; |
108 | psiconv_u8 screenfont; |
108 | psiconv_u8 screenfont; |
109 | } *psiconv_font; |
109 | } *psiconv_font; |
110 | |
110 | |
111 | typedef struct psiconv_border |
111 | typedef struct psiconv_border_s |
112 | { |
112 | { |
113 | psiconv_border_kind_t kind; |
113 | psiconv_border_kind_t kind; |
114 | psiconv_size_t thickness; /* Set to 1/20 for non-solid lines */ |
114 | psiconv_size_t thickness; /* Set to 1/20 for non-solid lines */ |
115 | psiconv_color color; |
115 | psiconv_color color; |
116 | } *psiconv_border; |
116 | } *psiconv_border; |
117 | |
117 | |
118 | typedef struct psiconv_bullet |
118 | typedef struct psiconv_bullet_s |
119 | { |
119 | { |
120 | psiconv_bool_t on; |
120 | psiconv_bool_t on; |
121 | psiconv_size_t font_size; |
121 | psiconv_size_t font_size; |
122 | psiconv_u8 character; |
122 | psiconv_u8 character; |
123 | psiconv_bool_t indent; |
123 | psiconv_bool_t indent; |
… | |
… | |
130 | psiconv_tab_left, |
130 | psiconv_tab_left, |
131 | psiconv_tab_centre, |
131 | psiconv_tab_centre, |
132 | psiconv_tab_right |
132 | psiconv_tab_right |
133 | } psiconv_tab_kind_t; |
133 | } psiconv_tab_kind_t; |
134 | |
134 | |
135 | typedef struct psiconv_tab |
135 | typedef struct psiconv_tab_s |
136 | { |
136 | { |
137 | psiconv_length_t location; |
137 | psiconv_length_t location; |
138 | psiconv_tab_kind_t kind; |
138 | psiconv_tab_kind_t kind; |
139 | } *psiconv_tab; |
139 | } *psiconv_tab; |
140 | |
140 | |
141 | |
141 | |
142 | typedef psiconv_list psiconv_tab_list; /* of struct psiconv_tab */ |
142 | typedef psiconv_list psiconv_tab_list; /* of struct psiconv_tab */ |
143 | |
143 | |
144 | typedef struct psiconv_all_tabs |
144 | typedef struct psiconv_all_tabs_s |
145 | { |
145 | { |
146 | psiconv_length_t normal; |
146 | psiconv_length_t normal; |
147 | psiconv_tab_list extras; |
147 | psiconv_tab_list extras; |
148 | } *psiconv_all_tabs; |
148 | } *psiconv_all_tabs; |
149 | |
149 | |
150 | typedef struct psiconv_character_layout |
150 | typedef struct psiconv_character_layout_s |
151 | { |
151 | { |
152 | psiconv_color color; |
152 | psiconv_color color; |
153 | psiconv_color back_color; |
153 | psiconv_color back_color; |
154 | psiconv_size_t font_size; |
154 | psiconv_size_t font_size; |
155 | psiconv_bool_t italic; |
155 | psiconv_bool_t italic; |
… | |
… | |
158 | psiconv_bool_t underline; |
158 | psiconv_bool_t underline; |
159 | psiconv_bool_t strike_out; |
159 | psiconv_bool_t strike_out; |
160 | psiconv_font font; |
160 | psiconv_font font; |
161 | } *psiconv_character_layout; |
161 | } *psiconv_character_layout; |
162 | |
162 | |
163 | typedef struct psiconv_paragraph_layout |
163 | typedef struct psiconv_paragraph_layout_s |
164 | { |
164 | { |
165 | psiconv_color back_color; |
165 | psiconv_color back_color; |
166 | psiconv_length_t indent_left; |
166 | psiconv_length_t indent_left; |
167 | psiconv_length_t indent_right; |
167 | psiconv_length_t indent_right; |
168 | psiconv_length_t indent_first; |
168 | psiconv_length_t indent_first; |
… | |
… | |
183 | psiconv_border top_border; |
183 | psiconv_border top_border; |
184 | psiconv_border bottom_border; |
184 | psiconv_border bottom_border; |
185 | psiconv_all_tabs tabs; |
185 | psiconv_all_tabs tabs; |
186 | } *psiconv_paragraph_layout; |
186 | } *psiconv_paragraph_layout; |
187 | |
187 | |
188 | typedef struct psiconv_header_section |
188 | typedef struct psiconv_header_section_s |
189 | { |
189 | { |
190 | psiconv_u32 uid1; |
190 | psiconv_u32 uid1; |
191 | psiconv_u32 uid2; |
191 | psiconv_u32 uid2; |
192 | psiconv_u32 uid3; |
192 | psiconv_u32 uid3; |
193 | psiconv_u32 checksum; |
193 | psiconv_u32 checksum; |
194 | psiconv_file_type_t file; |
194 | psiconv_file_type_t file; |
195 | } *psiconv_header_section; |
195 | } *psiconv_header_section; |
196 | |
196 | |
197 | typedef struct psiconv_section_table_entry |
197 | typedef struct psiconv_section_table_entry_s |
198 | { |
198 | { |
199 | psiconv_u32 id; |
199 | psiconv_u32 id; |
200 | psiconv_u32 offset; |
200 | psiconv_u32 offset; |
201 | } *psiconv_section_table_entry; |
201 | } *psiconv_section_table_entry; |
202 | |
202 | |
203 | typedef psiconv_list psiconv_section_table_section; |
203 | typedef psiconv_list psiconv_section_table_section; |
204 | /* Of struct sectiontable_entry */ |
204 | /* Of struct sectiontable_entry */ |
205 | |
205 | |
206 | typedef struct psiconv_application_id_section |
206 | typedef struct psiconv_application_id_section_s |
207 | { |
207 | { |
208 | psiconv_u32 id; |
208 | psiconv_u32 id; |
209 | psiconv_string_t name; |
209 | psiconv_string_t name; |
210 | } *psiconv_application_id_section; |
210 | } *psiconv_application_id_section; |
211 | |
211 | |
212 | typedef struct psiconv_in_line_layout |
212 | typedef struct psiconv_in_line_layout_s |
213 | { |
213 | { |
214 | psiconv_character_layout layout; |
214 | psiconv_character_layout layout; |
215 | int length; |
215 | int length; |
216 | } *psiconv_in_line_layout; |
216 | } *psiconv_in_line_layout; |
217 | |
217 | |
… | |
… | |
224 | psiconv_replace_pagenr, |
224 | psiconv_replace_pagenr, |
225 | psiconv_replace_nr_of_pages, |
225 | psiconv_replace_nr_of_pages, |
226 | psiconv_replace_filename |
226 | psiconv_replace_filename |
227 | } psiconv_replacement_type_t; |
227 | } psiconv_replacement_type_t; |
228 | |
228 | |
229 | typedef struct psiconv_replacement |
229 | typedef struct psiconv_replacement_s |
230 | { |
230 | { |
231 | int offset; |
231 | int offset; |
232 | int cur_len; |
232 | int cur_len; |
233 | psiconv_replacement_type_t type; |
233 | psiconv_replacement_type_t type; |
234 | } *psiconv_replacement; |
234 | } *psiconv_replacement; |
235 | |
235 | |
236 | typedef psiconv_list psiconv_replacements; /* of struct replacement */ |
236 | typedef psiconv_list psiconv_replacements; /* of struct replacement */ |
237 | |
237 | |
238 | typedef struct psiconv_paragraph |
238 | typedef struct psiconv_paragraph_s |
239 | { |
239 | { |
240 | char *text; |
240 | char *text; |
241 | psiconv_character_layout base_character; |
241 | psiconv_character_layout base_character; |
242 | psiconv_paragraph_layout base_paragraph; |
242 | psiconv_paragraph_layout base_paragraph; |
243 | psiconv_s16 base_style; |
243 | psiconv_s16 base_style; |
… | |
… | |
245 | psiconv_replacements replacements; |
245 | psiconv_replacements replacements; |
246 | } *psiconv_paragraph; |
246 | } *psiconv_paragraph; |
247 | |
247 | |
248 | typedef psiconv_list psiconv_text_and_layout; /* Of struct paragraphs */ |
248 | typedef psiconv_list psiconv_text_and_layout; /* Of struct paragraphs */ |
249 | |
249 | |
250 | typedef struct psiconv_texted_section |
250 | typedef struct psiconv_texted_section_s |
251 | { |
251 | { |
252 | psiconv_text_and_layout paragraphs; |
252 | psiconv_text_and_layout paragraphs; |
253 | } *psiconv_texted_section; |
253 | } *psiconv_texted_section; |
254 | |
254 | |
255 | typedef struct psiconv_page_header |
255 | typedef struct psiconv_page_header_s |
256 | { |
256 | { |
257 | psiconv_bool_t on_first_page; |
257 | psiconv_bool_t on_first_page; |
258 | psiconv_paragraph_layout base_paragraph_layout; |
258 | psiconv_paragraph_layout base_paragraph_layout; |
259 | psiconv_character_layout base_character_layout; |
259 | psiconv_character_layout base_character_layout; |
260 | psiconv_texted_section text; |
260 | psiconv_texted_section text; |
261 | } *psiconv_page_header; |
261 | } *psiconv_page_header; |
262 | |
262 | |
263 | typedef struct psiconv_page_layout_section |
263 | typedef struct psiconv_page_layout_section_s |
264 | { |
264 | { |
265 | psiconv_u32 first_page_nr; |
265 | psiconv_u32 first_page_nr; |
266 | psiconv_length_t header_dist; |
266 | psiconv_length_t header_dist; |
267 | psiconv_length_t footer_dist; |
267 | psiconv_length_t footer_dist; |
268 | psiconv_length_t left_margin; |
268 | psiconv_length_t left_margin; |
… | |
… | |
273 | psiconv_length_t page_height; |
273 | psiconv_length_t page_height; |
274 | psiconv_page_header header; |
274 | psiconv_page_header header; |
275 | psiconv_page_header footer; |
275 | psiconv_page_header footer; |
276 | } * psiconv_page_layout_section; |
276 | } * psiconv_page_layout_section; |
277 | |
277 | |
278 | typedef struct psiconv_word_status_section |
278 | typedef struct psiconv_word_status_section_s |
279 | { |
279 | { |
280 | psiconv_bool_t show_tabs; |
280 | psiconv_bool_t show_tabs; |
281 | psiconv_bool_t show_spaces; |
281 | psiconv_bool_t show_spaces; |
282 | psiconv_bool_t show_paragraph_ends; |
282 | psiconv_bool_t show_paragraph_ends; |
283 | psiconv_bool_t show_line_breaks; |
283 | psiconv_bool_t show_line_breaks; |
… | |
… | |
290 | psiconv_bool_t fit_lines_to_screen; |
290 | psiconv_bool_t fit_lines_to_screen; |
291 | psiconv_u32 cursor_position; |
291 | psiconv_u32 cursor_position; |
292 | psiconv_u32 display_size; |
292 | psiconv_u32 display_size; |
293 | } *psiconv_word_status_section; |
293 | } *psiconv_word_status_section; |
294 | |
294 | |
295 | typedef struct psiconv_word_style |
295 | typedef struct psiconv_word_style_s |
296 | { |
296 | { |
297 | psiconv_character_layout character; |
297 | psiconv_character_layout character; |
298 | psiconv_paragraph_layout paragraph; |
298 | psiconv_paragraph_layout paragraph; |
299 | psiconv_u8 hotkey; |
299 | psiconv_u8 hotkey; |
300 | psiconv_string_t name; |
300 | psiconv_string_t name; |
… | |
… | |
302 | psiconv_u32 outline_level; |
302 | psiconv_u32 outline_level; |
303 | } *psiconv_word_style; |
303 | } *psiconv_word_style; |
304 | |
304 | |
305 | typedef psiconv_list psiconv_word_style_list; /* Of style */ |
305 | typedef psiconv_list psiconv_word_style_list; /* Of style */ |
306 | |
306 | |
307 | typedef struct psiconv_word_styles_section |
307 | typedef struct psiconv_word_styles_section_s |
308 | { |
308 | { |
309 | psiconv_word_style normal; |
309 | psiconv_word_style normal; |
310 | psiconv_word_style_list styles; |
310 | psiconv_word_style_list styles; |
311 | } *psiconv_word_styles_section; |
311 | } *psiconv_word_styles_section; |
312 | |
312 | |
313 | typedef struct psiconv_word_f { |
313 | typedef struct psiconv_word_f_s |
|
|
314 | { |
314 | psiconv_page_layout_section page_sec; |
315 | psiconv_page_layout_section page_sec; |
315 | psiconv_text_and_layout paragraphs; |
316 | psiconv_text_and_layout paragraphs; |
316 | psiconv_word_status_section status_sec; |
317 | psiconv_word_status_section status_sec; |
317 | psiconv_word_styles_section styles_sec; |
318 | psiconv_word_styles_section styles_sec; |
318 | } *psiconv_word_f; |
319 | } *psiconv_word_f; |
319 | |
320 | |
320 | typedef struct psiconv_texted_f { |
321 | typedef struct psiconv_texted_f_s |
|
|
322 | { |
321 | psiconv_page_layout_section page_sec; |
323 | psiconv_page_layout_section page_sec; |
322 | psiconv_texted_section texted_sec; |
324 | psiconv_texted_section texted_sec; |
323 | } *psiconv_texted_f; |
325 | } *psiconv_texted_f; |
324 | |
326 | |
325 | typedef psiconv_list psiconv_jumptable_section; /* of psiconv_u32 */ |
327 | typedef psiconv_list psiconv_jumptable_section; /* of psiconv_u32 */ |
326 | |
328 | |
327 | /* Normalized values [0..1] for each component |
329 | /* Normalized values [0..1] for each component |
328 | Origin is (x,y)=(0,0), to get pixel at (X,Y) use index [Y*xsize+X] */ |
330 | Origin is (x,y)=(0,0), to get pixel at (X,Y) use index [Y*xsize+X] */ |
329 | typedef struct psiconv_paint_data_section { |
331 | typedef struct psiconv_paint_data_section_s |
|
|
332 | { |
330 | psiconv_u32 xsize; |
333 | psiconv_u32 xsize; |
331 | psiconv_u32 ysize; |
334 | psiconv_u32 ysize; |
332 | psiconv_length_t pic_xsize; /* 0 if not specified */ |
335 | psiconv_length_t pic_xsize; /* 0 if not specified */ |
333 | psiconv_length_t pic_ysize; /* 0 if not specified */ |
336 | psiconv_length_t pic_ysize; /* 0 if not specified */ |
334 | float *red; |
337 | float *red; |
… | |
… | |
337 | } *psiconv_paint_data_section; |
340 | } *psiconv_paint_data_section; |
338 | |
341 | |
339 | typedef psiconv_list psiconv_pictures; |
342 | typedef psiconv_list psiconv_pictures; |
340 | /* of struct psiconv_paint_data_section */ |
343 | /* of struct psiconv_paint_data_section */ |
341 | |
344 | |
342 | typedef struct psiconv_mbm_f { |
345 | typedef struct psiconv_mbm_f_s |
|
|
346 | { |
343 | psiconv_pictures sections; |
347 | psiconv_pictures sections; |
344 | } *psiconv_mbm_f; |
348 | } *psiconv_mbm_f; |
345 | |
349 | |
346 | /* This is a little intricated. A picture may be embedded in a larger form. |
350 | /* This is a little intricated. A picture may be embedded in a larger form. |
347 | A form is empty, except for the picture. The form has size form_{x,y}size, |
351 | A form is empty, except for the picture. The form has size form_{x,y}size, |
348 | and the picture is at offset picture_{x,y}_offset within the form. The |
352 | and the picture is at offset picture_{x,y}_offset within the form. The |
349 | picture itself has size picture_{x,y}size. |
353 | picture itself has size picture_{x,y}size. |
350 | Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0 |
354 | Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0 |
351 | cuts everything away. */ |
355 | cuts everything away. */ |
352 | typedef struct psiconv_sketch_section { |
356 | typedef struct psiconv_sketch_section_s |
|
|
357 | { |
353 | psiconv_u16 form_xsize; |
358 | psiconv_u16 form_xsize; |
354 | psiconv_u16 form_ysize; |
359 | psiconv_u16 form_ysize; |
355 | psiconv_u16 picture_x_offset; |
360 | psiconv_u16 picture_x_offset; |
356 | psiconv_u16 picture_y_offset; |
361 | psiconv_u16 picture_y_offset; |
357 | psiconv_u16 picture_xsize; |
362 | psiconv_u16 picture_xsize; |
… | |
… | |
363 | float cut_top; /* computed relative to first six values */ |
368 | float cut_top; /* computed relative to first six values */ |
364 | float cut_bottom; /* computed relative to first six values */ |
369 | float cut_bottom; /* computed relative to first six values */ |
365 | psiconv_paint_data_section picture; |
370 | psiconv_paint_data_section picture; |
366 | } *psiconv_sketch_section; |
371 | } *psiconv_sketch_section; |
367 | |
372 | |
368 | typedef struct psiconv_sketch_f { |
373 | typedef struct psiconv_sketch_f_s |
|
|
374 | { |
369 | psiconv_sketch_section sketch_sec; |
375 | psiconv_sketch_section sketch_sec; |
370 | } *psiconv_sketch_f; |
376 | } *psiconv_sketch_f; |
371 | |
377 | |
372 | typedef struct psiconv_clipart_section { |
378 | typedef struct psiconv_clipart_section_s |
|
|
379 | { |
373 | /* Perhaps later on some currently unknown stuff. */ |
380 | /* Perhaps later on some currently unknown stuff. */ |
374 | psiconv_paint_data_section picture; |
381 | psiconv_paint_data_section picture; |
375 | } * psiconv_clipart_section; |
382 | } * psiconv_clipart_section; |
376 | |
383 | |
377 | typedef psiconv_list psiconv_cliparts; /* of struct psiconv_clipart_section */ |
384 | typedef psiconv_list psiconv_cliparts; /* of struct psiconv_clipart_section */ |
378 | |
385 | |
379 | typedef struct psiconv_clipart_f { |
386 | typedef struct psiconv_clipart_f_s |
|
|
387 | { |
380 | psiconv_cliparts sections; |
388 | psiconv_cliparts sections; |
381 | } *psiconv_clipart_f; |
389 | } *psiconv_clipart_f; |
382 | |
390 | |
383 | typedef struct psiconv_file { |
391 | typedef struct psiconv_file_s |
|
|
392 | { |
384 | psiconv_file_type_t type; |
393 | psiconv_file_type_t type; |
385 | void *file; |
394 | void *file; |
386 | } *psiconv_file; |
395 | } *psiconv_file; |
387 | |
396 | |
388 | |
397 | |