--- psiconv/trunk/lib/psiconv/data.h 1999/10/03 21:10:47 2 +++ psiconv/trunk/lib/psiconv/data.h 2000/12/10 02:17:45 55 @@ -30,12 +30,18 @@ /* All types which end on _t are plain types; all other types are pointers to structs */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + typedef enum psiconv_file_type { psiconv_unknown_file, psiconv_word_file, psiconv_texted_file, - psiconv_mfm_file, - psiconv_sketch_file + psiconv_mbm_file, + psiconv_sketch_file, + psiconv_clipart_file } psiconv_file_type_t; /* Length indicators */ @@ -185,7 +191,6 @@ psiconv_u32 uid2; psiconv_u32 uid3; psiconv_u32 checksum; - psiconv_u32 section_table_offset; psiconv_file_type_t file; } *psiconv_header_section; @@ -294,6 +299,7 @@ psiconv_u8 hotkey; psiconv_string_t name; psiconv_bool_t built_in; + psiconv_u32 outline_level; } *psiconv_word_style; typedef psiconv_list psiconv_word_style_list; /* Of style */ @@ -316,6 +322,64 @@ psiconv_texted_section texted_sec; } *psiconv_texted_f; +typedef psiconv_list psiconv_jumptable_section; /* of psiconv_u32 */ + +/* Normalized values [0..1] for each component + Origin is (x,y)=(0,0), to get pixel at (X,Y) use index [Y*xsize+X] */ +typedef struct psiconv_paint_data_section { + psiconv_u32 xsize; + psiconv_u32 ysize; + psiconv_length_t pic_xsize; /* 0 if not specified */ + psiconv_length_t pic_ysize; /* 0 if not specified */ + float *red; + float *green; + float *blue; +} *psiconv_paint_data_section; + +typedef psiconv_list psiconv_pictures; + /* of struct psiconv_paint_data_section */ + +typedef struct psiconv_mbm_f { + 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. + 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 { + 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_paint_data_section picture; +} *psiconv_sketch_section; + +typedef struct psiconv_sketch_f { + psiconv_sketch_section sketch_sec; +} *psiconv_sketch_f; + +typedef struct psiconv_clipart_section { + /* Perhaps later on some currently unknown stuff. */ + psiconv_paint_data_section picture; +} * psiconv_clipart_section; + +typedef psiconv_list psiconv_cliparts; /* of struct psiconv_clipart_section */ + +typedef struct psiconv_clipart_f { + psiconv_cliparts sections; +} *psiconv_clipart_f; + typedef struct psiconv_file { psiconv_file_type_t type; void *file; @@ -324,11 +388,14 @@ /* UID1 */ #define PSICONV_ID_PSION5 0x10000037 +#define PSICONV_ID_CLIPART 0x10000041 /* UID2 */ #define PSICONV_ID_DATA_FILE 0x1000006D +#define PSICONV_ID_MBM_FILE 0x10000042 /* UID3 */ #define PSICONV_ID_WORD 0x1000007F #define PSICONV_ID_TEXTED 0x10000085 +#define PSICONV_ID_SKETCH 0x1000007D /* Section table ids */ #define PSICONV_ID_WORD_STATUS_SECTION 0x10000243 @@ -338,6 +405,7 @@ #define PSICONV_ID_WORD_STYLES_SECTION 0x10000104 #define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 #define PSICONV_ID_PASSWORD_SECTION 0x100000CD +#define PSICONV_ID_SKETCH_SECTION 0x1000007D /* Other ids */ #define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd @@ -348,6 +416,7 @@ #define PSICONV_ID_TEXTED_TEXT 0x10000064 #define PSICONV_ID_STYLE_REMOVABLE 0x1000004F #define PSICONV_ID_STYLE_BUILT_IN 0x1000004C +#define PSICONV_ID_CLIPART_ITEM 0x10000040 /* Return a clean layout_status. You can modify it at will */ @@ -397,7 +466,23 @@ extern void psiconv_free_word_status_section (psiconv_word_status_section section); extern void psiconv_free_word_f(psiconv_word_f file); +extern void psiconv_free_texted_f(psiconv_texted_f file); +extern void psiconv_free_paint_data_section(psiconv_paint_data_section section); +extern void psiconv_free_pictures(psiconv_pictures section); +extern void psiconv_free_jumptable_section + (psiconv_jumptable_section section); +extern void psiconv_free_mbm_f(psiconv_mbm_f file); +extern void psiconv_free_sketch_section(psiconv_sketch_section sec); +extern void psiconv_free_sketch_f(psiconv_sketch_f file); +extern void psiconv_free_clipart_section(psiconv_clipart_section section); +extern void psiconv_free_cliparts(psiconv_cliparts section); +extern void psiconv_free_clipart_f(psiconv_clipart_f file); + + extern void psiconv_free_file(psiconv_file file); +#ifdef __cplusplus +} +#endif /* __cplusplus */ #endif /* def PSICONV_DATA_H */