… | |
… | |
28 | #include "list.h" |
28 | #include "list.h" |
29 | |
29 | |
30 | /* All types which end on _t are plain types; all other types are pointers |
30 | /* All types which end on _t are plain types; all other types are pointers |
31 | to structs */ |
31 | to structs */ |
32 | |
32 | |
|
|
33 | #ifdef __cplusplus |
|
|
34 | extern "C" { |
|
|
35 | #endif /* __cplusplus */ |
|
|
36 | |
|
|
37 | |
33 | typedef enum psiconv_file_type { |
38 | typedef enum psiconv_file_type { |
34 | psiconv_unknown_file, |
39 | psiconv_unknown_file, |
35 | psiconv_word_file, |
40 | psiconv_word_file, |
36 | psiconv_texted_file, |
41 | psiconv_texted_file, |
37 | psiconv_mfm_file, |
42 | psiconv_mbm_file, |
38 | psiconv_sketch_file |
43 | psiconv_sketch_file, |
|
|
44 | psiconv_clipart_file |
39 | } psiconv_file_type_t; |
45 | } psiconv_file_type_t; |
40 | |
46 | |
41 | /* Length indicators */ |
47 | /* Length indicators */ |
42 | typedef psiconv_u32 psiconv_S_t; |
48 | typedef psiconv_u32 psiconv_S_t; |
43 | typedef psiconv_u32 psiconv_X_t; |
49 | typedef psiconv_u32 psiconv_X_t; |
… | |
… | |
183 | { |
189 | { |
184 | psiconv_u32 uid1; |
190 | psiconv_u32 uid1; |
185 | psiconv_u32 uid2; |
191 | psiconv_u32 uid2; |
186 | psiconv_u32 uid3; |
192 | psiconv_u32 uid3; |
187 | psiconv_u32 checksum; |
193 | psiconv_u32 checksum; |
188 | psiconv_u32 section_table_offset; |
|
|
189 | psiconv_file_type_t file; |
194 | psiconv_file_type_t file; |
190 | } *psiconv_header_section; |
195 | } *psiconv_header_section; |
191 | |
196 | |
192 | typedef struct psiconv_section_table_entry |
197 | typedef struct psiconv_section_table_entry |
193 | { |
198 | { |
… | |
… | |
292 | psiconv_character_layout character; |
297 | psiconv_character_layout character; |
293 | psiconv_paragraph_layout paragraph; |
298 | psiconv_paragraph_layout paragraph; |
294 | psiconv_u8 hotkey; |
299 | psiconv_u8 hotkey; |
295 | psiconv_string_t name; |
300 | psiconv_string_t name; |
296 | psiconv_bool_t built_in; |
301 | psiconv_bool_t built_in; |
|
|
302 | psiconv_u32 outline_level; |
297 | } *psiconv_word_style; |
303 | } *psiconv_word_style; |
298 | |
304 | |
299 | typedef psiconv_list psiconv_word_style_list; /* Of style */ |
305 | typedef psiconv_list psiconv_word_style_list; /* Of style */ |
300 | |
306 | |
301 | typedef struct psiconv_word_styles_section |
307 | typedef struct psiconv_word_styles_section |
… | |
… | |
314 | typedef struct psiconv_texted_f { |
320 | typedef struct psiconv_texted_f { |
315 | psiconv_page_layout_section page_sec; |
321 | psiconv_page_layout_section page_sec; |
316 | psiconv_texted_section texted_sec; |
322 | psiconv_texted_section texted_sec; |
317 | } *psiconv_texted_f; |
323 | } *psiconv_texted_f; |
318 | |
324 | |
|
|
325 | typedef psiconv_list psiconv_jumptable_section; /* of psiconv_u32 */ |
|
|
326 | |
|
|
327 | /* 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] */ |
|
|
329 | typedef struct psiconv_paint_data_section { |
|
|
330 | psiconv_u32 xsize; |
|
|
331 | psiconv_u32 ysize; |
|
|
332 | psiconv_length_t pic_xsize; /* 0 if not specified */ |
|
|
333 | psiconv_length_t pic_ysize; /* 0 if not specified */ |
|
|
334 | float *red; |
|
|
335 | float *green; |
|
|
336 | float *blue; |
|
|
337 | } *psiconv_paint_data_section; |
|
|
338 | |
|
|
339 | typedef psiconv_list psiconv_pictures; |
|
|
340 | /* of struct psiconv_paint_data_section */ |
|
|
341 | |
|
|
342 | typedef struct psiconv_mbm_f { |
|
|
343 | psiconv_pictures sections; |
|
|
344 | } *psiconv_mbm_f; |
|
|
345 | |
|
|
346 | /* 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, |
|
|
348 | and the picture is at offset picture_{x,y}_offset within the form. The |
|
|
349 | 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 |
|
|
351 | cuts everything away. */ |
|
|
352 | typedef struct psiconv_sketch_section { |
|
|
353 | psiconv_u16 form_xsize; |
|
|
354 | psiconv_u16 form_ysize; |
|
|
355 | psiconv_u16 picture_x_offset; |
|
|
356 | psiconv_u16 picture_y_offset; |
|
|
357 | psiconv_u16 picture_xsize; |
|
|
358 | psiconv_u16 picture_ysize; |
|
|
359 | float magnification_x; /* computed relative to first six values */ |
|
|
360 | float magnification_y; /* computed relative to first six values */ |
|
|
361 | float cut_left; /* computed relative to first six values */ |
|
|
362 | float cut_right; /* computed relative to first six values */ |
|
|
363 | float cut_top; /* computed relative to first six values */ |
|
|
364 | float cut_bottom; /* computed relative to first six values */ |
|
|
365 | psiconv_paint_data_section picture; |
|
|
366 | } *psiconv_sketch_section; |
|
|
367 | |
|
|
368 | typedef struct psiconv_sketch_f { |
|
|
369 | psiconv_sketch_section sketch_sec; |
|
|
370 | } *psiconv_sketch_f; |
|
|
371 | |
|
|
372 | typedef struct psiconv_clipart_section { |
|
|
373 | /* Perhaps later on some currently unknown stuff. */ |
|
|
374 | psiconv_paint_data_section picture; |
|
|
375 | } * psiconv_clipart_section; |
|
|
376 | |
|
|
377 | typedef psiconv_list psiconv_cliparts; /* of struct psiconv_clipart_section */ |
|
|
378 | |
|
|
379 | typedef struct psiconv_clipart_f { |
|
|
380 | psiconv_cliparts sections; |
|
|
381 | } *psiconv_clipart_f; |
|
|
382 | |
319 | typedef struct psiconv_file { |
383 | typedef struct psiconv_file { |
320 | psiconv_file_type_t type; |
384 | psiconv_file_type_t type; |
321 | void *file; |
385 | void *file; |
322 | } *psiconv_file; |
386 | } *psiconv_file; |
323 | |
387 | |
324 | |
388 | |
325 | /* UID1 */ |
389 | /* UID1 */ |
326 | #define PSICONV_ID_PSION5 0x10000037 |
390 | #define PSICONV_ID_PSION5 0x10000037 |
|
|
391 | #define PSICONV_ID_CLIPART 0x10000041 |
327 | /* UID2 */ |
392 | /* UID2 */ |
328 | #define PSICONV_ID_DATA_FILE 0x1000006D |
393 | #define PSICONV_ID_DATA_FILE 0x1000006D |
|
|
394 | #define PSICONV_ID_MBM_FILE 0x10000042 |
329 | /* UID3 */ |
395 | /* UID3 */ |
330 | #define PSICONV_ID_WORD 0x1000007F |
396 | #define PSICONV_ID_WORD 0x1000007F |
331 | #define PSICONV_ID_TEXTED 0x10000085 |
397 | #define PSICONV_ID_TEXTED 0x10000085 |
|
|
398 | #define PSICONV_ID_SKETCH 0x1000007D |
332 | |
399 | |
333 | /* Section table ids */ |
400 | /* Section table ids */ |
334 | #define PSICONV_ID_WORD_STATUS_SECTION 0x10000243 |
401 | #define PSICONV_ID_WORD_STATUS_SECTION 0x10000243 |
335 | #define PSICONV_ID_APPL_ID_SECTION 0x10000089 |
402 | #define PSICONV_ID_APPL_ID_SECTION 0x10000089 |
336 | #define PSICONV_ID_TEXT_SECTION 0x10000106 |
403 | #define PSICONV_ID_TEXT_SECTION 0x10000106 |
337 | #define PSICONV_ID_LAYOUT_SECTION 0x10000143 |
404 | #define PSICONV_ID_LAYOUT_SECTION 0x10000143 |
338 | #define PSICONV_ID_WORD_STYLES_SECTION 0x10000104 |
405 | #define PSICONV_ID_WORD_STYLES_SECTION 0x10000104 |
339 | #define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 |
406 | #define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 |
340 | #define PSICONV_ID_PASSWORD_SECTION 0x100000CD |
407 | #define PSICONV_ID_PASSWORD_SECTION 0x100000CD |
|
|
408 | #define PSICONV_ID_SKETCH_SECTION 0x1000007D |
341 | |
409 | |
342 | /* Other ids */ |
410 | /* Other ids */ |
343 | #define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd |
411 | #define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd |
344 | #define PSICONV_ID_TEXTED_BODY 0x1000005c |
412 | #define PSICONV_ID_TEXTED_BODY 0x1000005c |
345 | #define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063 |
413 | #define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063 |
346 | #define PSICONV_ID_TEXTED_UNKNOWN 0x10000065 |
414 | #define PSICONV_ID_TEXTED_UNKNOWN 0x10000065 |
347 | #define PSICONV_ID_TEXTED_LAYOUT 0x10000066 |
415 | #define PSICONV_ID_TEXTED_LAYOUT 0x10000066 |
348 | #define PSICONV_ID_TEXTED_TEXT 0x10000064 |
416 | #define PSICONV_ID_TEXTED_TEXT 0x10000064 |
349 | #define PSICONV_ID_STYLE_REMOVABLE 0x1000004F |
417 | #define PSICONV_ID_STYLE_REMOVABLE 0x1000004F |
350 | #define PSICONV_ID_STYLE_BUILT_IN 0x1000004C |
418 | #define PSICONV_ID_STYLE_BUILT_IN 0x1000004C |
|
|
419 | #define PSICONV_ID_CLIPART_ITEM 0x10000040 |
351 | |
420 | |
352 | |
421 | |
353 | /* Return a clean layout_status. You can modify it at will */ |
422 | /* Return a clean layout_status. You can modify it at will */ |
354 | extern psiconv_character_layout psiconv_basic_character_layout(void); |
423 | extern psiconv_character_layout psiconv_basic_character_layout(void); |
355 | |
424 | |
… | |
… | |
395 | extern void psiconv_free_page_layout_section |
464 | extern void psiconv_free_page_layout_section |
396 | (psiconv_page_layout_section section); |
465 | (psiconv_page_layout_section section); |
397 | extern void psiconv_free_word_status_section |
466 | extern void psiconv_free_word_status_section |
398 | (psiconv_word_status_section section); |
467 | (psiconv_word_status_section section); |
399 | extern void psiconv_free_word_f(psiconv_word_f file); |
468 | extern void psiconv_free_word_f(psiconv_word_f file); |
|
|
469 | extern void psiconv_free_texted_f(psiconv_texted_f file); |
|
|
470 | extern void psiconv_free_paint_data_section(psiconv_paint_data_section section); |
|
|
471 | extern void psiconv_free_pictures(psiconv_pictures section); |
|
|
472 | extern void psiconv_free_jumptable_section |
|
|
473 | (psiconv_jumptable_section section); |
|
|
474 | extern void psiconv_free_mbm_f(psiconv_mbm_f file); |
|
|
475 | extern void psiconv_free_sketch_section(psiconv_sketch_section sec); |
|
|
476 | extern void psiconv_free_sketch_f(psiconv_sketch_f file); |
|
|
477 | extern void psiconv_free_clipart_section(psiconv_clipart_section section); |
|
|
478 | extern void psiconv_free_cliparts(psiconv_cliparts section); |
|
|
479 | extern void psiconv_free_clipart_f(psiconv_clipart_f file); |
|
|
480 | |
|
|
481 | |
400 | extern void psiconv_free_file(psiconv_file file); |
482 | extern void psiconv_free_file(psiconv_file file); |
401 | |
483 | |
|
|
484 | #ifdef __cplusplus |
|
|
485 | } |
|
|
486 | #endif /* __cplusplus */ |
402 | |
487 | |
403 | #endif /* def PSICONV_DATA_H */ |
488 | #endif /* def PSICONV_DATA_H */ |