--- psiconv/trunk/lib/psiconv/data.h 2003/11/19 21:04:06 159 +++ psiconv/trunk/lib/psiconv/data.h 2004/01/04 22:20:43 183 @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ -/* Forward declaration (for psiconv_object) */ +/* Forward declaration (for psiconv_embedded_object_section) */ typedef struct psiconv_file_s *psiconv_file; typedef double psiconv_float_t; @@ -124,7 +124,7 @@ typedef struct psiconv_font_s { - char *name; + psiconv_string_t name; psiconv_screenfont_t screenfont; } *psiconv_font; @@ -244,19 +244,19 @@ psiconv_length_t height; } *psiconv_object_display_section; -typedef struct psiconv_object_s +typedef struct psiconv_embedded_object_section_s { psiconv_object_icon_section icon; psiconv_object_display_section display; psiconv_file object; -} *psiconv_object; +} *psiconv_embedded_object_section; typedef struct psiconv_in_line_layout_s { psiconv_character_layout layout; int length; /* If object is NULL, this does not apply to an object */ - psiconv_object object; + psiconv_embedded_object_section object; psiconv_length_t object_width; psiconv_length_t object_height; } *psiconv_in_line_layout; @@ -283,7 +283,7 @@ typedef struct psiconv_paragraph_s { - char *text; + psiconv_string_t text; psiconv_character_layout base_character; psiconv_paragraph_layout base_paragraph; psiconv_s16 base_style; @@ -394,26 +394,28 @@ psiconv_pictures sections; } *psiconv_mbm_f; -/* This is a little intricated. A picture may be embedded in a larger form. - A form is empty, except for the picture. The form has size form_{x,y}size, - and the picture is at offset picture_{x,y}_offset within the form. The - picture itself has size picture_{x,y}size. +/* Read the Psiconv file format documentation for a complete discription. + Basic idea: a picture has a certain display size. Within it, the pixel + data begins at a certain offset. Around it, there is an empty form. + The first eight values are before magnification and cuts. Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0 cuts everything away. */ typedef struct psiconv_sketch_section_s { + psiconv_u16 displayed_xsize; + psiconv_u16 displayed_ysize; + psiconv_u16 picture_data_x_offset; + psiconv_u16 picture_data_y_offset; psiconv_u16 form_xsize; psiconv_u16 form_ysize; - psiconv_u16 picture_x_offset; - psiconv_u16 picture_y_offset; - psiconv_u16 picture_xsize; - psiconv_u16 picture_ysize; - float magnification_x; /* computed relative to first six values */ - float magnification_y; /* computed relative to first six values */ - float cut_left; /* computed relative to first six values */ - float cut_right; /* computed relative to first six values */ - float cut_top; /* computed relative to first six values */ - float cut_bottom; /* computed relative to first six values */ + psiconv_u16 displayed_size_x_offset; + psiconv_u16 displayed_size_y_offset; + float magnification_x; /* computed relative to first eight values */ + float magnification_y; /* computed relative to first eight values */ + float cut_left; /* computed relative to first eight values */ + float cut_right; /* computed relative to first eight values */ + float cut_top; /* computed relative to first eight values */ + float cut_bottom; /* computed relative to first eight values */ psiconv_paint_data_section picture; } *psiconv_sketch_section; @@ -531,7 +533,7 @@ union { psiconv_u32 dat_int; double dat_float; - char *dat_string; + psiconv_string_t dat_string; psiconv_bool_t dat_bool; psiconv_sheet_errorcode_t dat_error; } data; @@ -703,7 +705,7 @@ union { psiconv_u32 dat_int; double dat_float; - char *dat_string; + psiconv_string_t dat_string; psiconv_sheet_cell_reference_t dat_cellref; psiconv_sheet_cell_block_t dat_cellblock; psiconv_formula_list fun_operands; @@ -781,12 +783,12 @@ typedef struct psiconv_sheet_variable_s { psiconv_u32 number; - char *name; + psiconv_string_t name; psiconv_variable_type_t type; union { psiconv_s32 dat_int; double dat_float; - char *dat_string; + psiconv_string_t dat_string; psiconv_sheet_cell_reference_t dat_cellref; psiconv_sheet_cell_block_t dat_cellblock; } data; @@ -797,7 +799,7 @@ typedef struct psiconv_sheet_name_section_s { - char *name; + psiconv_string_t name; } *psiconv_sheet_name_section; typedef struct psiconv_sheet_info_section_s @@ -865,6 +867,10 @@ #define PSICONV_ID_STYLE_REMOVABLE 0x1000004F #define PSICONV_ID_STYLE_BUILT_IN 0x1000004C #define PSICONV_ID_CLIPART_ITEM 0x10000040 +#define PSICONV_ID_OBJECT 0x10000051 +#define PSICONV_ID_OBJECT_DISPLAY_SECTION 0x10000146 +#define PSICONV_ID_OBJECT_ICON_SECTION 0x1000012A +#define PSICONV_ID_OBJECT_SECTION_TABLE_SECTION 0x10000144 /* Return a clean layout_status. You can modify it at will. Returns NULL @@ -932,6 +938,8 @@ extern void psiconv_free_sheet_variable(psiconv_sheet_variable list); extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list); extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section); +extern void psiconv_free_sheet_workbook_section + (psiconv_sheet_workbook_section section); extern void psiconv_free_header_section(psiconv_header_section header); extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); extern void psiconv_free_section_table_section @@ -942,7 +950,8 @@ (psiconv_object_display_section section); extern void psiconv_free_object_icon_section (psiconv_object_icon_section section); -extern void psiconv_free_object(psiconv_object object); +extern void psiconv_free_embedded_object_section + (psiconv_embedded_object_section object); extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); extern void psiconv_free_replacement(psiconv_replacement replacement);