--- psiconv/trunk/lib/psiconv/data.h 2001/07/25 11:49:59 134 +++ psiconv/trunk/lib/psiconv/data.h 2003/11/26 20:56:17 171 @@ -34,6 +34,9 @@ extern "C" { #endif /* __cplusplus */ +/* Forward declaration (for psiconv_embedded_object_section) */ +typedef struct psiconv_file_s *psiconv_file; + typedef double psiconv_float_t; typedef enum psiconv_file_type { @@ -227,10 +230,35 @@ psiconv_string_t name; } *psiconv_application_id_section; +typedef struct psiconv_object_icon_section_s +{ + psiconv_length_t icon_width; + psiconv_length_t icon_height; + psiconv_string_t icon_name; +} *psiconv_object_icon_section; + +typedef struct psiconv_object_display_section_s +{ + psiconv_bool_t show_icon; + psiconv_length_t width; + psiconv_length_t height; +} *psiconv_object_display_section; + +typedef struct psiconv_embedded_object_section_s +{ + psiconv_object_icon_section icon; + psiconv_object_display_section display; + psiconv_file 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_embedded_object_section object; + psiconv_length_t object_width; + psiconv_length_t object_height; } *psiconv_in_line_layout; typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ @@ -366,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; @@ -793,11 +823,12 @@ psiconv_sheet_workbook_section workbook_sec; } *psiconv_sheet_f; -typedef struct psiconv_file_s +/* NB: psiconv_file is already defined above */ +struct psiconv_file_s { psiconv_file_type_t type; void *file; -} *psiconv_file; +}; /* UID1 */ @@ -836,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 @@ -903,12 +938,20 @@ 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 (psiconv_section_table_section section); extern void psiconv_free_application_id_section (psiconv_application_id_section section); +extern void psiconv_free_object_display_section + (psiconv_object_display_section section); +extern void psiconv_free_object_icon_section + (psiconv_object_icon_section section); +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);