… | |
… | |
32 | |
32 | |
33 | typedef enum psiconv_file_type { |
33 | typedef enum psiconv_file_type { |
34 | psiconv_unknown_file, |
34 | psiconv_unknown_file, |
35 | psiconv_word_file, |
35 | psiconv_word_file, |
36 | psiconv_texted_file, |
36 | psiconv_texted_file, |
37 | psiconv_mfm_file, |
37 | psiconv_mbm_file, |
38 | psiconv_sketch_file |
38 | psiconv_sketch_file |
39 | } psiconv_file_type_t; |
39 | } psiconv_file_type_t; |
40 | |
40 | |
41 | /* Length indicators */ |
41 | /* Length indicators */ |
42 | typedef psiconv_u32 psiconv_S_t; |
42 | typedef psiconv_u32 psiconv_S_t; |
… | |
… | |
183 | { |
183 | { |
184 | psiconv_u32 uid1; |
184 | psiconv_u32 uid1; |
185 | psiconv_u32 uid2; |
185 | psiconv_u32 uid2; |
186 | psiconv_u32 uid3; |
186 | psiconv_u32 uid3; |
187 | psiconv_u32 checksum; |
187 | psiconv_u32 checksum; |
188 | psiconv_u32 section_table_offset; |
|
|
189 | psiconv_file_type_t file; |
188 | psiconv_file_type_t file; |
190 | } *psiconv_header_section; |
189 | } *psiconv_header_section; |
191 | |
190 | |
192 | typedef struct psiconv_section_table_entry |
191 | typedef struct psiconv_section_table_entry |
193 | { |
192 | { |
… | |
… | |
292 | psiconv_character_layout character; |
291 | psiconv_character_layout character; |
293 | psiconv_paragraph_layout paragraph; |
292 | psiconv_paragraph_layout paragraph; |
294 | psiconv_u8 hotkey; |
293 | psiconv_u8 hotkey; |
295 | psiconv_string_t name; |
294 | psiconv_string_t name; |
296 | psiconv_bool_t built_in; |
295 | psiconv_bool_t built_in; |
|
|
296 | psiconv_u32 outline_level; |
297 | } *psiconv_word_style; |
297 | } *psiconv_word_style; |
298 | |
298 | |
299 | typedef psiconv_list psiconv_word_style_list; /* Of style */ |
299 | typedef psiconv_list psiconv_word_style_list; /* Of style */ |
300 | |
300 | |
301 | typedef struct psiconv_word_styles_section |
301 | typedef struct psiconv_word_styles_section |
… | |
… | |
314 | typedef struct psiconv_texted_f { |
314 | typedef struct psiconv_texted_f { |
315 | psiconv_page_layout_section page_sec; |
315 | psiconv_page_layout_section page_sec; |
316 | psiconv_texted_section texted_sec; |
316 | psiconv_texted_section texted_sec; |
317 | } *psiconv_texted_f; |
317 | } *psiconv_texted_f; |
318 | |
318 | |
|
|
319 | typedef psiconv_list psiconv_mbm_jumptable_section; /* of psiconv_u32 */ |
|
|
320 | |
319 | /* Normalized values [0..1] for each component |
321 | /* Normalized values [0..1] for each component |
320 | Origin is (x,y)=(0,0), to get pixel at (X,Y) use index [Y*xsize+X] */ |
322 | Origin is (x,y)=(0,0), to get pixel at (X,Y) use index [Y*xsize+X] */ |
321 | typedef struct psiconv_paint_data_section { |
323 | typedef struct psiconv_paint_data_section { |
322 | psiconv_u32 xsize; |
324 | psiconv_u32 xsize; |
323 | psiconv_u32 ysize; |
325 | psiconv_u32 ysize; |
|
|
326 | psiconv_length_t pic_xsize; /* 0 if not specified */ |
|
|
327 | psiconv_length_t pic_ysize; /* 0 if not specified */ |
324 | float *red; |
328 | float *red; |
325 | float *green; |
329 | float *green; |
326 | float *blue; |
330 | float *blue; |
327 | } *psiconv_paint_data_section; |
331 | } *psiconv_paint_data_section; |
328 | |
332 | |
|
|
333 | typedef psiconv_list psiconv_pictures; |
|
|
334 | /* of struct psiconv_paint_data_section */ |
|
|
335 | |
|
|
336 | typedef struct psiconv_mbm_f { |
|
|
337 | psiconv_pictures sections; |
|
|
338 | } *psiconv_mbm_f; |
|
|
339 | |
|
|
340 | /* This is a little intricated. A picture may be embedded in a larger form. |
|
|
341 | A form is empty, except for the picture. The form has size form_{x,y}size, |
|
|
342 | and the picture is at offset picture_{x,y}_offset within the form. The |
|
|
343 | picture itself has size picture_{x,y}size. |
|
|
344 | Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0 |
|
|
345 | cuts everything away. */ |
|
|
346 | typedef struct psiconv_sketch_section { |
|
|
347 | psiconv_u16 form_xsize; |
|
|
348 | psiconv_u16 form_ysize; |
|
|
349 | psiconv_u16 picture_x_offset; |
|
|
350 | psiconv_u16 picture_y_offset; |
|
|
351 | psiconv_u16 picture_xsize; |
|
|
352 | psiconv_u16 picture_ysize; |
|
|
353 | float magnification_x; /* computed relative to first six values */ |
|
|
354 | float magnification_y; /* computed relative to first six values */ |
|
|
355 | float cut_left; /* computed relative to first six values */ |
|
|
356 | float cut_right; /* computed relative to first six values */ |
|
|
357 | float cut_top; /* computed relative to first six values */ |
|
|
358 | float cut_bottom; /* computed relative to first six values */ |
|
|
359 | psiconv_paint_data_section picture; |
|
|
360 | } *psiconv_sketch_section; |
|
|
361 | |
|
|
362 | typedef struct psiconv_sketch_f { |
|
|
363 | psiconv_sketch_section sketch_sec; |
|
|
364 | } *psiconv_sketch_f; |
|
|
365 | |
329 | typedef struct psiconv_file { |
366 | typedef struct psiconv_file { |
330 | psiconv_file_type_t type; |
367 | psiconv_file_type_t type; |
331 | void *file; |
368 | void *file; |
332 | } *psiconv_file; |
369 | } *psiconv_file; |
333 | |
370 | |
334 | |
371 | |
335 | /* UID1 */ |
372 | /* UID1 */ |
336 | #define PSICONV_ID_PSION5 0x10000037 |
373 | #define PSICONV_ID_PSION5 0x10000037 |
337 | /* UID2 */ |
374 | /* UID2 */ |
338 | #define PSICONV_ID_DATA_FILE 0x1000006D |
375 | #define PSICONV_ID_DATA_FILE 0x1000006D |
|
|
376 | #define PSICONV_ID_MBM_FILE 0x10000042 |
339 | /* UID3 */ |
377 | /* UID3 */ |
340 | #define PSICONV_ID_WORD 0x1000007F |
378 | #define PSICONV_ID_WORD 0x1000007F |
341 | #define PSICONV_ID_TEXTED 0x10000085 |
379 | #define PSICONV_ID_TEXTED 0x10000085 |
|
|
380 | #define PSICONV_ID_SKETCH 0x1000007D |
342 | |
381 | |
343 | /* Section table ids */ |
382 | /* Section table ids */ |
344 | #define PSICONV_ID_WORD_STATUS_SECTION 0x10000243 |
383 | #define PSICONV_ID_WORD_STATUS_SECTION 0x10000243 |
345 | #define PSICONV_ID_APPL_ID_SECTION 0x10000089 |
384 | #define PSICONV_ID_APPL_ID_SECTION 0x10000089 |
346 | #define PSICONV_ID_TEXT_SECTION 0x10000106 |
385 | #define PSICONV_ID_TEXT_SECTION 0x10000106 |
347 | #define PSICONV_ID_LAYOUT_SECTION 0x10000143 |
386 | #define PSICONV_ID_LAYOUT_SECTION 0x10000143 |
348 | #define PSICONV_ID_WORD_STYLES_SECTION 0x10000104 |
387 | #define PSICONV_ID_WORD_STYLES_SECTION 0x10000104 |
349 | #define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 |
388 | #define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 |
350 | #define PSICONV_ID_PASSWORD_SECTION 0x100000CD |
389 | #define PSICONV_ID_PASSWORD_SECTION 0x100000CD |
|
|
390 | #define PSICONV_ID_SKETCH_SECTION 0x1000007D |
351 | |
391 | |
352 | /* Other ids */ |
392 | /* Other ids */ |
353 | #define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd |
393 | #define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd |
354 | #define PSICONV_ID_TEXTED_BODY 0x1000005c |
394 | #define PSICONV_ID_TEXTED_BODY 0x1000005c |
355 | #define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063 |
395 | #define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063 |
… | |
… | |
405 | extern void psiconv_free_page_layout_section |
445 | extern void psiconv_free_page_layout_section |
406 | (psiconv_page_layout_section section); |
446 | (psiconv_page_layout_section section); |
407 | extern void psiconv_free_word_status_section |
447 | extern void psiconv_free_word_status_section |
408 | (psiconv_word_status_section section); |
448 | (psiconv_word_status_section section); |
409 | extern void psiconv_free_word_f(psiconv_word_f file); |
449 | extern void psiconv_free_word_f(psiconv_word_f file); |
|
|
450 | extern void psiconv_free_texted_f(psiconv_texted_f file); |
|
|
451 | extern void psiconv_free_paint_data_section(psiconv_paint_data_section section); |
|
|
452 | extern void psiconv_free_pictures(psiconv_pictures section); |
|
|
453 | extern void psiconv_free_mbm_jumptable_section |
|
|
454 | (psiconv_mbm_jumptable_section section); |
|
|
455 | extern void psiconv_free_mbm_f(psiconv_mbm_f file); |
|
|
456 | extern void psiconv_free_sketch_section(psiconv_sketch_section sec); |
|
|
457 | extern void psiconv_free_sketch_f(psiconv_sketch_f file); |
|
|
458 | |
410 | extern void psiconv_free_file(psiconv_file file); |
459 | extern void psiconv_free_file(psiconv_file file); |
411 | |
460 | |
412 | |
461 | |
413 | #endif /* def PSICONV_DATA_H */ |
462 | #endif /* def PSICONV_DATA_H */ |