… | |
… | |
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_object) */ |
|
|
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, |
… | |
… | |
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_object_s |
|
|
248 | { |
|
|
249 | psiconv_object_icon_section icon; |
|
|
250 | psiconv_object_display_section display; |
|
|
251 | psiconv_file object; |
|
|
252 | } *psiconv_object; |
|
|
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_object 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 |
… | |
… | |
502 | psiconv_cell_type_t type; |
530 | psiconv_cell_type_t type; |
503 | union { |
531 | union { |
504 | psiconv_u32 dat_int; |
532 | psiconv_u32 dat_int; |
505 | double dat_float; |
533 | double dat_float; |
506 | char *dat_string; |
534 | char *dat_string; |
507 | psiconv_bool_t dat_bool; |
535 | psiconv_bool_t dat_bool; |
508 | psiconv_sheet_errorcode_t dat_error; |
536 | psiconv_sheet_errorcode_t dat_error; |
509 | } data; |
537 | } data; |
510 | psiconv_sheet_cell_layout layout; |
538 | psiconv_sheet_cell_layout layout; |
511 | psiconv_bool_t calculated; |
539 | psiconv_bool_t calculated; |
512 | psiconv_u32 ref_formula; |
540 | psiconv_u32 ref_formula; |
513 | } *psiconv_sheet_cell; |
541 | } *psiconv_sheet_cell; |
514 | |
542 | |
515 | typedef psiconv_list psiconv_sheet_cell_list; |
543 | typedef psiconv_list psiconv_sheet_cell_list; |
516 | /* Of struct psiconv_sheet_cell_s */ |
|
|
517 | |
544 | |
518 | typedef struct psiconv_sheet_status_section_s |
545 | typedef struct psiconv_sheet_status_section_s |
519 | { |
546 | { |
520 | psiconv_bool_t show_graph; |
547 | psiconv_bool_t show_graph; |
521 | psiconv_u32 cursor_row; |
548 | psiconv_u32 cursor_row; |
… | |
… | |
678 | double dat_float; |
705 | double dat_float; |
679 | char *dat_string; |
706 | char *dat_string; |
680 | psiconv_sheet_cell_reference_t dat_cellref; |
707 | psiconv_sheet_cell_reference_t dat_cellref; |
681 | psiconv_sheet_cell_block_t dat_cellblock; |
708 | psiconv_sheet_cell_block_t dat_cellblock; |
682 | psiconv_formula_list fun_operands; |
709 | psiconv_formula_list fun_operands; |
|
|
710 | psiconv_u32 dat_variable; |
683 | } data; |
711 | } data; |
684 | } *psiconv_formula; |
712 | } *psiconv_formula; |
|
|
713 | |
|
|
714 | typedef struct psiconv_sheet_line_s |
|
|
715 | { |
|
|
716 | psiconv_u32 position; |
|
|
717 | psiconv_sheet_cell_layout layout; |
|
|
718 | } *psiconv_sheet_line; |
|
|
719 | |
|
|
720 | typedef psiconv_list psiconv_sheet_line_list; |
|
|
721 | /* Of struct psiconv_sheet_line_s */ |
|
|
722 | |
|
|
723 | typedef struct psiconv_sheet_grid_size_s |
|
|
724 | { |
|
|
725 | psiconv_u32 line_number; |
|
|
726 | psiconv_length_t size; |
|
|
727 | } *psiconv_sheet_grid_size; |
|
|
728 | |
|
|
729 | typedef psiconv_list psiconv_sheet_grid_size_list; |
|
|
730 | /* Of struct psiconv_sheet_grid_size_s */ |
|
|
731 | |
|
|
732 | typedef psiconv_list psiconv_sheet_grid_break_list; /* of psiconv_u32 */ |
|
|
733 | |
|
|
734 | typedef struct psiconv_sheet_grid_section_s |
|
|
735 | { |
|
|
736 | psiconv_bool_t show_column_titles; |
|
|
737 | psiconv_bool_t show_row_titles; |
|
|
738 | psiconv_bool_t show_vertical_grid; |
|
|
739 | psiconv_bool_t show_horizontal_grid; |
|
|
740 | psiconv_bool_t freeze_rows; |
|
|
741 | psiconv_bool_t freeze_columns; |
|
|
742 | psiconv_u32 frozen_rows; |
|
|
743 | psiconv_u32 frozen_columns; |
|
|
744 | psiconv_u32 first_unfrozen_row_displayed; |
|
|
745 | psiconv_u32 first_unfrozen_column_displayed; |
|
|
746 | psiconv_bool_t show_page_breaks; |
|
|
747 | psiconv_u32 first_row; |
|
|
748 | psiconv_u32 first_column; |
|
|
749 | psiconv_u32 last_row; |
|
|
750 | psiconv_u32 last_column; |
|
|
751 | psiconv_length_t default_row_height; |
|
|
752 | psiconv_length_t default_column_width; |
|
|
753 | psiconv_sheet_grid_size_list row_heights; |
|
|
754 | psiconv_sheet_grid_size_list column_heights; |
|
|
755 | psiconv_sheet_grid_break_list row_page_breaks; |
|
|
756 | psiconv_sheet_grid_break_list column_page_breaks; |
|
|
757 | } *psiconv_sheet_grid_section; |
685 | |
758 | |
686 | typedef struct psiconv_sheet_worksheet_s |
759 | typedef struct psiconv_sheet_worksheet_s |
687 | { |
760 | { |
688 | psiconv_sheet_cell_layout default_layout; |
761 | psiconv_sheet_cell_layout default_layout; |
689 | psiconv_sheet_cell_list cells; |
762 | psiconv_sheet_cell_list cells; |
690 | psiconv_bool_t show_zeros; |
763 | psiconv_bool_t show_zeros; |
|
|
764 | psiconv_sheet_line_list row_default_layouts; |
|
|
765 | psiconv_sheet_line_list col_default_layouts; |
|
|
766 | psiconv_sheet_grid_section grid; |
691 | } *psiconv_sheet_worksheet; |
767 | } *psiconv_sheet_worksheet; |
692 | |
768 | |
693 | typedef psiconv_list psiconv_sheet_worksheet_list; |
769 | typedef psiconv_list psiconv_sheet_worksheet_list; |
694 | /* of struct psiconv_sheet_worksheet */ |
770 | /* of struct psiconv_sheet_worksheet_s */ |
|
|
771 | |
|
|
772 | typedef enum psiconv_variable_type |
|
|
773 | { |
|
|
774 | psiconv_var_int, |
|
|
775 | psiconv_var_float, |
|
|
776 | psiconv_var_string, |
|
|
777 | psiconv_var_cellref, |
|
|
778 | psiconv_var_cellblock |
|
|
779 | } psiconv_variable_type_t; |
|
|
780 | |
|
|
781 | typedef struct psiconv_sheet_variable_s |
|
|
782 | { |
|
|
783 | psiconv_u32 number; |
|
|
784 | char *name; |
|
|
785 | psiconv_variable_type_t type; |
|
|
786 | union { |
|
|
787 | psiconv_s32 dat_int; |
|
|
788 | double dat_float; |
|
|
789 | char *dat_string; |
|
|
790 | psiconv_sheet_cell_reference_t dat_cellref; |
|
|
791 | psiconv_sheet_cell_block_t dat_cellblock; |
|
|
792 | } data; |
|
|
793 | } *psiconv_sheet_variable; |
|
|
794 | |
|
|
795 | typedef psiconv_list psiconv_sheet_variable_list; |
|
|
796 | /* of struct psiconv_sheet_variable_s */ |
|
|
797 | |
|
|
798 | typedef struct psiconv_sheet_name_section_s |
|
|
799 | { |
|
|
800 | char *name; |
|
|
801 | } *psiconv_sheet_name_section; |
|
|
802 | |
|
|
803 | typedef struct psiconv_sheet_info_section_s |
|
|
804 | { |
|
|
805 | psiconv_bool_t auto_recalc; |
|
|
806 | } *psiconv_sheet_info_section; |
695 | |
807 | |
696 | typedef struct psiconv_sheet_workbook_section_s |
808 | typedef struct psiconv_sheet_workbook_section_s |
697 | { |
809 | { |
698 | psiconv_formula_list formulas; |
810 | psiconv_formula_list formulas; |
699 | psiconv_sheet_worksheet_list worksheets; |
811 | psiconv_sheet_worksheet_list worksheets; |
|
|
812 | psiconv_sheet_variable_list variables; |
|
|
813 | psiconv_sheet_info_section info; |
|
|
814 | psiconv_sheet_name_section name; |
700 | } *psiconv_sheet_workbook_section; |
815 | } *psiconv_sheet_workbook_section; |
701 | |
816 | |
702 | typedef struct psiconv_sheet_f_s |
817 | typedef struct psiconv_sheet_f_s |
703 | { |
818 | { |
704 | psiconv_page_layout_section page_sec; |
819 | psiconv_page_layout_section page_sec; |
705 | psiconv_sheet_status_section status_sec; |
820 | psiconv_sheet_status_section status_sec; |
706 | psiconv_sheet_workbook_section workbook_sec; |
821 | psiconv_sheet_workbook_section workbook_sec; |
707 | } *psiconv_sheet_f; |
822 | } *psiconv_sheet_f; |
708 | |
823 | |
|
|
824 | /* NB: psiconv_file is already defined above */ |
709 | typedef struct psiconv_file_s |
825 | struct psiconv_file_s |
710 | { |
826 | { |
711 | psiconv_file_type_t type; |
827 | psiconv_file_type_t type; |
712 | void *file; |
828 | void *file; |
713 | } *psiconv_file; |
829 | }; |
714 | |
830 | |
715 | |
831 | |
716 | /* UID1 */ |
832 | /* UID1 */ |
717 | #define PSICONV_ID_PSION5 0x10000037 |
833 | #define PSICONV_ID_PSION5 0x10000037 |
718 | #define PSICONV_ID_CLIPART 0x10000041 |
834 | #define PSICONV_ID_CLIPART 0x10000041 |
… | |
… | |
767 | extern psiconv_character_layout psiconv_clone_character_layout |
883 | extern psiconv_character_layout psiconv_clone_character_layout |
768 | (psiconv_character_layout ls); |
884 | (psiconv_character_layout ls); |
769 | |
885 | |
770 | /* Get a numbered style. Returns NULL if the style is unknown. */ |
886 | /* Get a numbered style. Returns NULL if the style is unknown. */ |
771 | extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); |
887 | extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); |
|
|
888 | /* Get a numbered formula. Returns NULL if the style is unknown. */ |
772 | extern psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr); |
889 | extern psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr); |
|
|
890 | |
|
|
891 | /* Return the default layout */ |
|
|
892 | extern psiconv_sheet_cell_layout psiconv_get_default_layout |
|
|
893 | (psiconv_sheet_line_list row_defaults, |
|
|
894 | psiconv_sheet_line_list col_defaults, |
|
|
895 | psiconv_sheet_cell_layout cell_default, |
|
|
896 | int row,int col); |
773 | |
897 | |
774 | extern void psiconv_free_color(psiconv_color color); |
898 | extern void psiconv_free_color(psiconv_color color); |
775 | extern void psiconv_free_border(psiconv_border border); |
899 | extern void psiconv_free_border(psiconv_border border); |
776 | extern void psiconv_free_bullet(psiconv_bullet bullet); |
900 | extern void psiconv_free_bullet(psiconv_bullet bullet); |
777 | extern void psiconv_free_font(psiconv_font font); |
901 | extern void psiconv_free_font(psiconv_font font); |
… | |
… | |
785 | extern void psiconv_free_formula(psiconv_formula formula); |
909 | extern void psiconv_free_formula(psiconv_formula formula); |
786 | extern void psiconv_free_formula_list(psiconv_formula_list list); |
910 | extern void psiconv_free_formula_list(psiconv_formula_list list); |
787 | extern void psiconv_free_sheet_status_section |
911 | extern void psiconv_free_sheet_status_section |
788 | (psiconv_sheet_status_section section); |
912 | (psiconv_sheet_status_section section); |
789 | extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout); |
913 | extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout); |
|
|
914 | extern void psiconv_free_sheet_grid_break_list |
|
|
915 | (psiconv_sheet_grid_break_list list); |
|
|
916 | extern void psiconv_free_sheet_grid_size(psiconv_sheet_grid_size s); |
|
|
917 | extern void psiconv_free_sheet_grid_size_list |
|
|
918 | (psiconv_sheet_grid_size_list list); |
|
|
919 | extern void psiconv_free_sheet_grid_section(psiconv_sheet_grid_section sec); |
790 | extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet); |
920 | extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet); |
791 | extern void psiconv_free_sheet_worksheet_list |
921 | extern void psiconv_free_sheet_worksheet_list |
792 | (psiconv_sheet_worksheet_list list); |
922 | (psiconv_sheet_worksheet_list list); |
793 | |
923 | |
794 | extern void psiconv_free_sheet_f(psiconv_sheet_f file); |
924 | extern void psiconv_free_sheet_f(psiconv_sheet_f file); |
795 | extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell); |
925 | extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell); |
796 | extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list); |
926 | extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list); |
797 | extern void psiconv_free_sheet_numberformat |
927 | extern void psiconv_free_sheet_numberformat |
798 | (psiconv_sheet_numberformat numberformat); |
928 | (psiconv_sheet_numberformat numberformat); |
|
|
929 | extern void psiconv_free_sheet_line_list(psiconv_sheet_line_list list); |
|
|
930 | extern void psiconv_free_sheet_line(psiconv_sheet_line line); |
|
|
931 | extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section); |
|
|
932 | extern void psiconv_free_sheet_variable(psiconv_sheet_variable list); |
|
|
933 | extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list); |
|
|
934 | extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section); |
799 | extern void psiconv_free_header_section(psiconv_header_section header); |
935 | extern void psiconv_free_header_section(psiconv_header_section header); |
800 | extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); |
936 | extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); |
801 | extern void psiconv_free_section_table_section |
937 | extern void psiconv_free_section_table_section |
802 | (psiconv_section_table_section section); |
938 | (psiconv_section_table_section section); |
803 | extern void psiconv_free_application_id_section |
939 | extern void psiconv_free_application_id_section |
804 | (psiconv_application_id_section section); |
940 | (psiconv_application_id_section section); |
|
|
941 | extern void psiconv_free_object_display_section |
|
|
942 | (psiconv_object_display_section section); |
|
|
943 | extern void psiconv_free_object_icon_section |
|
|
944 | (psiconv_object_icon_section section); |
|
|
945 | extern void psiconv_free_object(psiconv_object object); |
805 | extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); |
946 | extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); |
806 | extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); |
947 | extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); |
807 | extern void psiconv_free_replacement(psiconv_replacement replacement); |
948 | extern void psiconv_free_replacement(psiconv_replacement replacement); |
808 | extern void psiconv_free_replacements(psiconv_replacements replacements); |
949 | extern void psiconv_free_replacements(psiconv_replacements replacements); |
809 | extern void psiconv_free_paragraph(psiconv_paragraph paragraph); |
950 | extern void psiconv_free_paragraph(psiconv_paragraph paragraph); |