… | |
… | |
31 | to structs */ |
31 | to structs */ |
32 | |
32 | |
33 | #ifdef __cplusplus |
33 | #ifdef __cplusplus |
34 | extern "C" { |
34 | extern "C" { |
35 | #endif /* __cplusplus */ |
35 | #endif /* __cplusplus */ |
|
|
36 | |
|
|
37 | /* Forward declaration (for psiconv_embedded_object_section) */ |
|
|
38 | typedef struct psiconv_file_s *psiconv_file; |
36 | |
39 | |
37 | typedef double psiconv_float_t; |
40 | typedef double psiconv_float_t; |
38 | |
41 | |
39 | typedef enum psiconv_file_type { |
42 | typedef enum psiconv_file_type { |
40 | psiconv_unknown_file, |
43 | psiconv_unknown_file, |
… | |
… | |
119 | psiconv_u8 blue; |
122 | psiconv_u8 blue; |
120 | } * psiconv_color; |
123 | } * psiconv_color; |
121 | |
124 | |
122 | typedef struct psiconv_font_s |
125 | typedef struct psiconv_font_s |
123 | { |
126 | { |
124 | char *name; |
127 | psiconv_string_t name; |
125 | psiconv_screenfont_t screenfont; |
128 | psiconv_screenfont_t screenfont; |
126 | } *psiconv_font; |
129 | } *psiconv_font; |
127 | |
130 | |
128 | typedef struct psiconv_border_s |
131 | typedef struct psiconv_border_s |
129 | { |
132 | { |
… | |
… | |
225 | { |
228 | { |
226 | psiconv_u32 id; |
229 | psiconv_u32 id; |
227 | psiconv_string_t name; |
230 | psiconv_string_t name; |
228 | } *psiconv_application_id_section; |
231 | } *psiconv_application_id_section; |
229 | |
232 | |
|
|
233 | typedef struct psiconv_object_icon_section_s |
|
|
234 | { |
|
|
235 | psiconv_length_t icon_width; |
|
|
236 | psiconv_length_t icon_height; |
|
|
237 | psiconv_string_t icon_name; |
|
|
238 | } *psiconv_object_icon_section; |
|
|
239 | |
|
|
240 | typedef struct psiconv_object_display_section_s |
|
|
241 | { |
|
|
242 | psiconv_bool_t show_icon; |
|
|
243 | psiconv_length_t width; |
|
|
244 | psiconv_length_t height; |
|
|
245 | } *psiconv_object_display_section; |
|
|
246 | |
|
|
247 | typedef struct psiconv_embedded_object_section_s |
|
|
248 | { |
|
|
249 | psiconv_object_icon_section icon; |
|
|
250 | psiconv_object_display_section display; |
|
|
251 | psiconv_file object; |
|
|
252 | } *psiconv_embedded_object_section; |
|
|
253 | |
230 | typedef struct psiconv_in_line_layout_s |
254 | typedef struct psiconv_in_line_layout_s |
231 | { |
255 | { |
232 | psiconv_character_layout layout; |
256 | psiconv_character_layout layout; |
233 | int length; |
257 | int length; |
|
|
258 | /* If object is NULL, this does not apply to an object */ |
|
|
259 | psiconv_embedded_object_section object; |
|
|
260 | psiconv_length_t object_width; |
|
|
261 | psiconv_length_t object_height; |
234 | } *psiconv_in_line_layout; |
262 | } *psiconv_in_line_layout; |
235 | |
263 | |
236 | typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ |
264 | typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ |
237 | |
265 | |
238 | typedef enum psiconv_replacement_type |
266 | typedef enum psiconv_replacement_type |
… | |
… | |
364 | typedef struct psiconv_mbm_f_s |
392 | typedef struct psiconv_mbm_f_s |
365 | { |
393 | { |
366 | psiconv_pictures sections; |
394 | psiconv_pictures sections; |
367 | } *psiconv_mbm_f; |
395 | } *psiconv_mbm_f; |
368 | |
396 | |
369 | /* This is a little intricated. A picture may be embedded in a larger form. |
397 | /* Read the Psiconv file format documentation for a complete discription. |
370 | A form is empty, except for the picture. The form has size form_{x,y}size, |
398 | Basic idea: a picture has a certain display size. Within it, the pixel |
371 | and the picture is at offset picture_{x,y}_offset within the form. The |
399 | data begins at a certain offset. Around it, there is an empty form. |
372 | picture itself has size picture_{x,y}size. |
400 | The first eight values are before magnification and cuts. |
373 | Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0 |
401 | Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0 |
374 | cuts everything away. */ |
402 | cuts everything away. */ |
375 | typedef struct psiconv_sketch_section_s |
403 | typedef struct psiconv_sketch_section_s |
376 | { |
404 | { |
|
|
405 | psiconv_u16 displayed_xsize; |
|
|
406 | psiconv_u16 displayed_ysize; |
|
|
407 | psiconv_u16 picture_data_x_offset; |
|
|
408 | psiconv_u16 picture_data_y_offset; |
377 | psiconv_u16 form_xsize; |
409 | psiconv_u16 form_xsize; |
378 | psiconv_u16 form_ysize; |
410 | psiconv_u16 form_ysize; |
379 | psiconv_u16 picture_x_offset; |
411 | psiconv_u16 displayed_size_x_offset; |
380 | psiconv_u16 picture_y_offset; |
412 | psiconv_u16 displayed_size_y_offset; |
381 | psiconv_u16 picture_xsize; |
|
|
382 | psiconv_u16 picture_ysize; |
|
|
383 | float magnification_x; /* computed relative to first six values */ |
413 | float magnification_x; /* computed relative to first eight values */ |
384 | float magnification_y; /* computed relative to first six values */ |
414 | float magnification_y; /* computed relative to first eight values */ |
385 | float cut_left; /* computed relative to first six values */ |
415 | float cut_left; /* computed relative to first eight values */ |
386 | float cut_right; /* computed relative to first six values */ |
416 | float cut_right; /* computed relative to first eight values */ |
387 | float cut_top; /* computed relative to first six values */ |
417 | float cut_top; /* computed relative to first eight values */ |
388 | float cut_bottom; /* computed relative to first six values */ |
418 | float cut_bottom; /* computed relative to first eight values */ |
389 | psiconv_paint_data_section picture; |
419 | psiconv_paint_data_section picture; |
390 | } *psiconv_sketch_section; |
420 | } *psiconv_sketch_section; |
391 | |
421 | |
392 | typedef struct psiconv_sketch_f_s |
422 | typedef struct psiconv_sketch_f_s |
393 | { |
423 | { |
… | |
… | |
791 | psiconv_page_layout_section page_sec; |
821 | psiconv_page_layout_section page_sec; |
792 | psiconv_sheet_status_section status_sec; |
822 | psiconv_sheet_status_section status_sec; |
793 | psiconv_sheet_workbook_section workbook_sec; |
823 | psiconv_sheet_workbook_section workbook_sec; |
794 | } *psiconv_sheet_f; |
824 | } *psiconv_sheet_f; |
795 | |
825 | |
|
|
826 | /* NB: psiconv_file is already defined above */ |
796 | typedef struct psiconv_file_s |
827 | struct psiconv_file_s |
797 | { |
828 | { |
798 | psiconv_file_type_t type; |
829 | psiconv_file_type_t type; |
799 | void *file; |
830 | void *file; |
800 | } *psiconv_file; |
831 | }; |
801 | |
832 | |
802 | |
833 | |
803 | /* UID1 */ |
834 | /* UID1 */ |
804 | #define PSICONV_ID_PSION5 0x10000037 |
835 | #define PSICONV_ID_PSION5 0x10000037 |
805 | #define PSICONV_ID_CLIPART 0x10000041 |
836 | #define PSICONV_ID_CLIPART 0x10000041 |
… | |
… | |
834 | #define PSICONV_ID_TEXTED_LAYOUT 0x10000066 |
865 | #define PSICONV_ID_TEXTED_LAYOUT 0x10000066 |
835 | #define PSICONV_ID_TEXTED_TEXT 0x10000064 |
866 | #define PSICONV_ID_TEXTED_TEXT 0x10000064 |
836 | #define PSICONV_ID_STYLE_REMOVABLE 0x1000004F |
867 | #define PSICONV_ID_STYLE_REMOVABLE 0x1000004F |
837 | #define PSICONV_ID_STYLE_BUILT_IN 0x1000004C |
868 | #define PSICONV_ID_STYLE_BUILT_IN 0x1000004C |
838 | #define PSICONV_ID_CLIPART_ITEM 0x10000040 |
869 | #define PSICONV_ID_CLIPART_ITEM 0x10000040 |
|
|
870 | #define PSICONV_ID_OBJECT 0x10000051 |
|
|
871 | #define PSICONV_ID_OBJECT_DISPLAY_SECTION 0x10000146 |
|
|
872 | #define PSICONV_ID_OBJECT_ICON_SECTION 0x1000012A |
|
|
873 | #define PSICONV_ID_OBJECT_SECTION_TABLE_SECTION 0x10000144 |
839 | |
874 | |
840 | |
875 | |
841 | /* Return a clean layout_status. You can modify it at will. Returns NULL |
876 | /* Return a clean layout_status. You can modify it at will. Returns NULL |
842 | if there is not enough memory. */ |
877 | if there is not enough memory. */ |
843 | extern psiconv_character_layout psiconv_basic_character_layout(void); |
878 | extern psiconv_character_layout psiconv_basic_character_layout(void); |
… | |
… | |
901 | extern void psiconv_free_sheet_line(psiconv_sheet_line line); |
936 | extern void psiconv_free_sheet_line(psiconv_sheet_line line); |
902 | extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section); |
937 | extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section); |
903 | extern void psiconv_free_sheet_variable(psiconv_sheet_variable list); |
938 | extern void psiconv_free_sheet_variable(psiconv_sheet_variable list); |
904 | extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list); |
939 | extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list); |
905 | extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section); |
940 | extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section); |
|
|
941 | extern void psiconv_free_sheet_workbook_section |
|
|
942 | (psiconv_sheet_workbook_section section); |
906 | extern void psiconv_free_header_section(psiconv_header_section header); |
943 | extern void psiconv_free_header_section(psiconv_header_section header); |
907 | extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); |
944 | extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); |
908 | extern void psiconv_free_section_table_section |
945 | extern void psiconv_free_section_table_section |
909 | (psiconv_section_table_section section); |
946 | (psiconv_section_table_section section); |
910 | extern void psiconv_free_application_id_section |
947 | extern void psiconv_free_application_id_section |
911 | (psiconv_application_id_section section); |
948 | (psiconv_application_id_section section); |
|
|
949 | extern void psiconv_free_object_display_section |
|
|
950 | (psiconv_object_display_section section); |
|
|
951 | extern void psiconv_free_object_icon_section |
|
|
952 | (psiconv_object_icon_section section); |
|
|
953 | extern void psiconv_free_embedded_object_section |
|
|
954 | (psiconv_embedded_object_section object); |
912 | extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); |
955 | extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); |
913 | extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); |
956 | extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); |
914 | extern void psiconv_free_replacement(psiconv_replacement replacement); |
957 | extern void psiconv_free_replacement(psiconv_replacement replacement); |
915 | extern void psiconv_free_replacements(psiconv_replacements replacements); |
958 | extern void psiconv_free_replacements(psiconv_replacements replacements); |
916 | extern void psiconv_free_paragraph(psiconv_paragraph paragraph); |
959 | extern void psiconv_free_paragraph(psiconv_paragraph paragraph); |