/[public]/psiconv/trunk/lib/psiconv/data.h
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/data.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2 Revision 25
32 32
33typedef enum psiconv_file_type { 33typedef enum psiconv_file_type {
34 psiconv_unknown_file, 34 psiconv_unknown_file,
35 psiconv_word_file, 35 psiconv_word_file,
36 psiconv_texted_file, 36 psiconv_texted_file,
37 psiconv_mfm_file, 37 psiconv_mbm_file,
38 psiconv_sketch_file 38 psiconv_sketch_file
39} psiconv_file_type_t; 39} psiconv_file_type_t;
40 40
41/* Length indicators */ 41/* Length indicators */
42typedef psiconv_u32 psiconv_S_t; 42typedef psiconv_u32 psiconv_S_t;
183{ 183{
184 psiconv_u32 uid1; 184 psiconv_u32 uid1;
185 psiconv_u32 uid2; 185 psiconv_u32 uid2;
186 psiconv_u32 uid3; 186 psiconv_u32 uid3;
187 psiconv_u32 checksum; 187 psiconv_u32 checksum;
188 psiconv_u32 section_table_offset;
189 psiconv_file_type_t file; 188 psiconv_file_type_t file;
190} *psiconv_header_section; 189} *psiconv_header_section;
191 190
192typedef struct psiconv_section_table_entry 191typedef struct psiconv_section_table_entry
193{ 192{
314typedef struct psiconv_texted_f { 313typedef struct psiconv_texted_f {
315 psiconv_page_layout_section page_sec; 314 psiconv_page_layout_section page_sec;
316 psiconv_texted_section texted_sec; 315 psiconv_texted_section texted_sec;
317} *psiconv_texted_f; 316} *psiconv_texted_f;
318 317
318typedef psiconv_list psiconv_mbm_jumptable_section; /* of psiconv_u32 */
319
320/* Normalized values [0..1] for each component
321 Origin is (x,y)=(0,0), to get pixel at (X,Y) use index [Y*xsize+X] */
322typedef struct psiconv_paint_data_section {
323 psiconv_u32 xsize;
324 psiconv_u32 ysize;
325 psiconv_length_t pic_xsize; /* 0 if not specified */
326 psiconv_length_t pic_ysize; /* 0 if not specified */
327 float *red;
328 float *green;
329 float *blue;
330} *psiconv_paint_data_section;
331
332typedef psiconv_list psiconv_pictures;
333 /* of struct psiconv_paint_data_section */
334
335typedef struct psiconv_mbm_f {
336 psiconv_pictures sections;
337} *psiconv_mbm_f;
338
339/* This is a little intricated. A picture may be embedded in a larger form.
340 A form is empty, except for the picture. The form has size form_{x,y}size,
341 and the picture is at offset picture_{x,y}_offset within the form. The
342 picture itself has size picture_{x,y}size.
343 Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0
344 cuts everything away. */
345typedef struct psiconv_sketch_section {
346 psiconv_u16 form_xsize;
347 psiconv_u16 form_ysize;
348 psiconv_u16 picture_x_offset;
349 psiconv_u16 picture_y_offset;
350 psiconv_u16 picture_xsize;
351 psiconv_u16 picture_ysize;
352 float magnification_x; /* computed relative to first six values */
353 float magnification_y; /* computed relative to first six values */
354 float cut_left; /* computed relative to first six values */
355 float cut_right; /* computed relative to first six values */
356 float cut_top; /* computed relative to first six values */
357 float cut_bottom; /* computed relative to first six values */
358 psiconv_paint_data_section picture;
359} *psiconv_sketch_section;
360
361typedef struct psiconv_sketch_f {
362 psiconv_sketch_section sketch_sec;
363} *psiconv_sketch_f;
364
319typedef struct psiconv_file { 365typedef struct psiconv_file {
320 psiconv_file_type_t type; 366 psiconv_file_type_t type;
321 void *file; 367 void *file;
322} *psiconv_file; 368} *psiconv_file;
323 369
324 370
325/* UID1 */ 371/* UID1 */
326#define PSICONV_ID_PSION5 0x10000037 372#define PSICONV_ID_PSION5 0x10000037
327/* UID2 */ 373/* UID2 */
328#define PSICONV_ID_DATA_FILE 0x1000006D 374#define PSICONV_ID_DATA_FILE 0x1000006D
375#define PSICONV_ID_MBM_FILE 0x10000042
329/* UID3 */ 376/* UID3 */
330#define PSICONV_ID_WORD 0x1000007F 377#define PSICONV_ID_WORD 0x1000007F
331#define PSICONV_ID_TEXTED 0x10000085 378#define PSICONV_ID_TEXTED 0x10000085
379#define PSICONV_ID_SKETCH 0x1000007D
332 380
333/* Section table ids */ 381/* Section table ids */
334#define PSICONV_ID_WORD_STATUS_SECTION 0x10000243 382#define PSICONV_ID_WORD_STATUS_SECTION 0x10000243
335#define PSICONV_ID_APPL_ID_SECTION 0x10000089 383#define PSICONV_ID_APPL_ID_SECTION 0x10000089
336#define PSICONV_ID_TEXT_SECTION 0x10000106 384#define PSICONV_ID_TEXT_SECTION 0x10000106
337#define PSICONV_ID_LAYOUT_SECTION 0x10000143 385#define PSICONV_ID_LAYOUT_SECTION 0x10000143
338#define PSICONV_ID_WORD_STYLES_SECTION 0x10000104 386#define PSICONV_ID_WORD_STYLES_SECTION 0x10000104
339#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 387#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105
340#define PSICONV_ID_PASSWORD_SECTION 0x100000CD 388#define PSICONV_ID_PASSWORD_SECTION 0x100000CD
389#define PSICONV_ID_SKETCH_SECTION 0x1000007D
341 390
342/* Other ids */ 391/* Other ids */
343#define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd 392#define PSICONV_ID_PAGE_DIMENSIONS 0x100000fd
344#define PSICONV_ID_TEXTED_BODY 0x1000005c 393#define PSICONV_ID_TEXTED_BODY 0x1000005c
345#define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063 394#define PSICONV_ID_TEXTED_REPLACEMENT 0x10000063
395extern void psiconv_free_page_layout_section 444extern void psiconv_free_page_layout_section
396 (psiconv_page_layout_section section); 445 (psiconv_page_layout_section section);
397extern void psiconv_free_word_status_section 446extern void psiconv_free_word_status_section
398 (psiconv_word_status_section section); 447 (psiconv_word_status_section section);
399extern void psiconv_free_word_f(psiconv_word_f file); 448extern void psiconv_free_word_f(psiconv_word_f file);
449extern void psiconv_free_texted_f(psiconv_texted_f file);
450extern void psiconv_free_paint_data_section(psiconv_paint_data_section section);
451extern void psiconv_free_pictures(psiconv_pictures section);
452extern void psiconv_free_mbm_jumptable_section
453 (psiconv_mbm_jumptable_section section);
454extern void psiconv_free_mbm_f(psiconv_mbm_f file);
455extern void psiconv_free_sketch_section(psiconv_sketch_section sec);
456extern void psiconv_free_sketch_f(psiconv_sketch_f file);
457
400extern void psiconv_free_file(psiconv_file file); 458extern void psiconv_free_file(psiconv_file file);
401 459
402 460
403#endif /* def PSICONV_DATA_H */ 461#endif /* def PSICONV_DATA_H */

Legend:
Removed from v.2  
changed lines
  Added in v.25

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26