/[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 129 Revision 184
31 to structs */ 31 to structs */
32 32
33#ifdef __cplusplus 33#ifdef __cplusplus
34extern "C" { 34extern "C" {
35#endif /* __cplusplus */ 35#endif /* __cplusplus */
36
37/* Forward declaration (for psiconv_embedded_object_section) */
38typedef struct psiconv_file_s *psiconv_file;
36 39
37typedef double psiconv_float_t; 40typedef double psiconv_float_t;
38 41
39typedef enum psiconv_file_type { 42typedef enum psiconv_file_type {
40 psiconv_unknown_file, 43 psiconv_unknown_file,
49/* Length indicators */ 52/* Length indicators */
50typedef psiconv_u32 psiconv_S_t; 53typedef psiconv_u32 psiconv_S_t;
51typedef psiconv_u32 psiconv_X_t; 54typedef psiconv_u32 psiconv_X_t;
52 55
53/* A string */ 56/* A string */
54typedef char *psiconv_string_t; 57typedef psiconv_ucs2 *psiconv_string_t;
55 58
56/* In the Psion file, these are identical; but we translate them to more 59/* In the Psion file, these are identical; but we translate them to more
57 human-readable quantities */ 60 human-readable quantities */
58typedef float psiconv_length_t; /* For offsets in centimeters */ 61typedef float psiconv_length_t; /* For offsets in centimeters */
59typedef float psiconv_size_t; /* For sizes in points */ 62typedef float psiconv_size_t; /* For sizes in points */
119 psiconv_u8 blue; 122 psiconv_u8 blue;
120} * psiconv_color; 123} * psiconv_color;
121 124
122typedef struct psiconv_font_s 125typedef struct psiconv_font_s
123{ 126{
124 char *name; 127 psiconv_string_t name;
125 psiconv_screenfont_t screenfont; 128 psiconv_screenfont_t screenfont;
126} *psiconv_font; 129} *psiconv_font;
127 130
128typedef struct psiconv_border_s 131typedef struct psiconv_border_s
129{ 132{
134 137
135typedef struct psiconv_bullet_s 138typedef struct psiconv_bullet_s
136{ 139{
137 psiconv_bool_t on; 140 psiconv_bool_t on;
138 psiconv_size_t font_size; 141 psiconv_size_t font_size;
139 psiconv_u8 character; 142 psiconv_ucs2 character;
140 psiconv_bool_t indent; 143 psiconv_bool_t indent;
141 psiconv_color color; 144 psiconv_color color;
142 psiconv_font font; 145 psiconv_font font;
143} *psiconv_bullet; 146} *psiconv_bullet;
144 147
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
233typedef 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
240typedef 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
247typedef struct psiconv_embedded_object_section_s
248{
249 psiconv_object_icon_section icon;
250 psiconv_object_display_section display;
251 psiconv_file object;
252} *psiconv_embedded_object_section;
253
230typedef struct psiconv_in_line_layout_s 254typedef 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_embedded_object_section 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
236typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ 264typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */
237 265
238typedef enum psiconv_replacement_type 266typedef enum psiconv_replacement_type
253 281
254typedef psiconv_list psiconv_replacements; /* of struct replacement */ 282typedef psiconv_list psiconv_replacements; /* of struct replacement */
255 283
256typedef struct psiconv_paragraph_s 284typedef struct psiconv_paragraph_s
257{ 285{
258 char *text; 286 psiconv_string_t text;
259 psiconv_character_layout base_character; 287 psiconv_character_layout base_character;
260 psiconv_paragraph_layout base_paragraph; 288 psiconv_paragraph_layout base_paragraph;
261 psiconv_s16 base_style; 289 psiconv_s16 base_style;
262 psiconv_in_line_layouts in_lines; 290 psiconv_in_line_layouts in_lines;
263 psiconv_replacements replacements; 291 psiconv_replacements replacements;
364typedef struct psiconv_mbm_f_s 392typedef struct psiconv_mbm_f_s
365{ 393{
366 psiconv_pictures sections; 394 psiconv_pictures sections;
367} *psiconv_mbm_f; 395} *psiconv_mbm_f;
368 396
369/* This is a little intricated. A picture may be embedded in a larger form. 397/* Read the Psiconv file format documentation for a complete discription.
370 A form is empty, except for the picture. The form has size form_{x,y}size, 398 Basic idea: a picture has a certain display size. Within it, the pixel
371 and the picture is at offset picture_{x,y}_offset within the form. The 399 data begins at a certain offset. Around it, there is an empty form.
372 picture itself has size picture_{x,y}size. 400 The first eight values are before magnification and cuts.
373 Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0 401 Cuts are always <= 1.0; a cut of 0.0 cuts nothing away, a cut of 1.0
374 cuts everything away. */ 402 cuts everything away. */
375typedef struct psiconv_sketch_section_s 403typedef struct psiconv_sketch_section_s
376{ 404{
405 psiconv_u16 displayed_xsize;
406 psiconv_u16 displayed_ysize;
407 psiconv_u16 picture_data_x_offset;
408 psiconv_u16 picture_data_y_offset;
377 psiconv_u16 form_xsize; 409 psiconv_u16 form_xsize;
378 psiconv_u16 form_ysize; 410 psiconv_u16 form_ysize;
379 psiconv_u16 picture_x_offset; 411 psiconv_u16 displayed_size_x_offset;
380 psiconv_u16 picture_y_offset; 412 psiconv_u16 displayed_size_y_offset;
381 psiconv_u16 picture_xsize;
382 psiconv_u16 picture_ysize;
383 float magnification_x; /* computed relative to first six values */ 413 float magnification_x; /* computed relative to first eight values */
384 float magnification_y; /* computed relative to first six values */ 414 float magnification_y; /* computed relative to first eight values */
385 float cut_left; /* computed relative to first six values */ 415 float cut_left; /* computed relative to first eight values */
386 float cut_right; /* computed relative to first six values */ 416 float cut_right; /* computed relative to first eight values */
387 float cut_top; /* computed relative to first six values */ 417 float cut_top; /* computed relative to first eight values */
388 float cut_bottom; /* computed relative to first six values */ 418 float cut_bottom; /* computed relative to first eight values */
389 psiconv_paint_data_section picture; 419 psiconv_paint_data_section picture;
390} *psiconv_sketch_section; 420} *psiconv_sketch_section;
391 421
392typedef struct psiconv_sketch_f_s 422typedef struct psiconv_sketch_f_s
393{ 423{
501 psiconv_u16 row; 531 psiconv_u16 row;
502 psiconv_cell_type_t type; 532 psiconv_cell_type_t type;
503 union { 533 union {
504 psiconv_u32 dat_int; 534 psiconv_u32 dat_int;
505 double dat_float; 535 double dat_float;
506 char *dat_string; 536 psiconv_string_t dat_string;
507 psiconv_bool_t dat_bool; 537 psiconv_bool_t dat_bool;
508 psiconv_sheet_errorcode_t dat_error; 538 psiconv_sheet_errorcode_t dat_error;
509 } data; 539 } data;
510 psiconv_sheet_cell_layout layout; 540 psiconv_sheet_cell_layout layout;
511 psiconv_bool_t calculated; 541 psiconv_bool_t calculated;
673{ 703{
674 psiconv_formula_type_t type; 704 psiconv_formula_type_t type;
675 union { 705 union {
676 psiconv_u32 dat_int; 706 psiconv_u32 dat_int;
677 double dat_float; 707 double dat_float;
678 char *dat_string; 708 psiconv_string_t dat_string;
679 psiconv_sheet_cell_reference_t dat_cellref; 709 psiconv_sheet_cell_reference_t dat_cellref;
680 psiconv_sheet_cell_block_t dat_cellblock; 710 psiconv_sheet_cell_block_t dat_cellblock;
681 psiconv_formula_list fun_operands; 711 psiconv_formula_list fun_operands;
682 psiconv_u32 dat_variable; 712 psiconv_u32 dat_variable;
683 } data; 713 } data;
690} *psiconv_sheet_line; 720} *psiconv_sheet_line;
691 721
692typedef psiconv_list psiconv_sheet_line_list; 722typedef psiconv_list psiconv_sheet_line_list;
693 /* Of struct psiconv_sheet_line_s */ 723 /* Of struct psiconv_sheet_line_s */
694 724
725typedef struct psiconv_sheet_grid_size_s
726{
727 psiconv_u32 line_number;
728 psiconv_length_t size;
729} *psiconv_sheet_grid_size;
730
731typedef psiconv_list psiconv_sheet_grid_size_list;
732 /* Of struct psiconv_sheet_grid_size_s */
733
734typedef psiconv_list psiconv_sheet_grid_break_list; /* of psiconv_u32 */
735
736typedef struct psiconv_sheet_grid_section_s
737{
738 psiconv_bool_t show_column_titles;
739 psiconv_bool_t show_row_titles;
740 psiconv_bool_t show_vertical_grid;
741 psiconv_bool_t show_horizontal_grid;
742 psiconv_bool_t freeze_rows;
743 psiconv_bool_t freeze_columns;
744 psiconv_u32 frozen_rows;
745 psiconv_u32 frozen_columns;
746 psiconv_u32 first_unfrozen_row_displayed;
747 psiconv_u32 first_unfrozen_column_displayed;
748 psiconv_bool_t show_page_breaks;
749 psiconv_u32 first_row;
750 psiconv_u32 first_column;
751 psiconv_u32 last_row;
752 psiconv_u32 last_column;
753 psiconv_length_t default_row_height;
754 psiconv_length_t default_column_width;
755 psiconv_sheet_grid_size_list row_heights;
756 psiconv_sheet_grid_size_list column_heights;
757 psiconv_sheet_grid_break_list row_page_breaks;
758 psiconv_sheet_grid_break_list column_page_breaks;
759} *psiconv_sheet_grid_section;
760
695typedef struct psiconv_sheet_worksheet_s 761typedef struct psiconv_sheet_worksheet_s
696{ 762{
697 psiconv_sheet_cell_layout default_layout; 763 psiconv_sheet_cell_layout default_layout;
698 psiconv_sheet_cell_list cells; 764 psiconv_sheet_cell_list cells;
699 psiconv_bool_t show_zeros; 765 psiconv_bool_t show_zeros;
700 psiconv_sheet_line_list row_default_layouts; 766 psiconv_sheet_line_list row_default_layouts;
701 psiconv_sheet_line_list col_default_layouts; 767 psiconv_sheet_line_list col_default_layouts;
768 psiconv_sheet_grid_section grid;
702} *psiconv_sheet_worksheet; 769} *psiconv_sheet_worksheet;
703 770
704typedef psiconv_list psiconv_sheet_worksheet_list; 771typedef psiconv_list psiconv_sheet_worksheet_list;
705 /* of struct psiconv_sheet_worksheet_s */ 772 /* of struct psiconv_sheet_worksheet_s */
706 773
714} psiconv_variable_type_t; 781} psiconv_variable_type_t;
715 782
716typedef struct psiconv_sheet_variable_s 783typedef struct psiconv_sheet_variable_s
717{ 784{
718 psiconv_u32 number; 785 psiconv_u32 number;
719 char *name; 786 psiconv_string_t name;
720 psiconv_variable_type_t type; 787 psiconv_variable_type_t type;
721 union { 788 union {
722 psiconv_s32 dat_int; 789 psiconv_s32 dat_int;
723 double dat_float; 790 double dat_float;
724 char *dat_string; 791 psiconv_string_t dat_string;
725 psiconv_sheet_cell_reference_t dat_cellref; 792 psiconv_sheet_cell_reference_t dat_cellref;
726 psiconv_sheet_cell_block_t dat_cellblock; 793 psiconv_sheet_cell_block_t dat_cellblock;
727 } data; 794 } data;
728} *psiconv_sheet_variable; 795} *psiconv_sheet_variable;
729 796
730typedef psiconv_list psiconv_sheet_variable_list; 797typedef psiconv_list psiconv_sheet_variable_list;
731 /* of struct psiconv_sheet_variable_s */ 798 /* of struct psiconv_sheet_variable_s */
732 799
733typedef struct psiconv_sheet_name_section_s 800typedef struct psiconv_sheet_name_section_s
734{ 801{
735 char *name; 802 psiconv_string_t name;
736} *psiconv_sheet_name_section; 803} *psiconv_sheet_name_section;
737 804
738typedef struct psiconv_sheet_info_section_s 805typedef struct psiconv_sheet_info_section_s
739{ 806{
740 psiconv_bool_t auto_recalc; 807 psiconv_bool_t auto_recalc;
754 psiconv_page_layout_section page_sec; 821 psiconv_page_layout_section page_sec;
755 psiconv_sheet_status_section status_sec; 822 psiconv_sheet_status_section status_sec;
756 psiconv_sheet_workbook_section workbook_sec; 823 psiconv_sheet_workbook_section workbook_sec;
757} *psiconv_sheet_f; 824} *psiconv_sheet_f;
758 825
826/* NB: psiconv_file is already defined above */
759typedef struct psiconv_file_s 827struct psiconv_file_s
760{ 828{
761 psiconv_file_type_t type; 829 psiconv_file_type_t type;
762 void *file; 830 void *file;
763} *psiconv_file; 831};
764 832
765 833
766/* UID1 */ 834/* UID1 */
767#define PSICONV_ID_PSION5 0x10000037 835#define PSICONV_ID_PSION5 0x10000037
768#define PSICONV_ID_CLIPART 0x10000041 836#define PSICONV_ID_CLIPART 0x10000041
797#define PSICONV_ID_TEXTED_LAYOUT 0x10000066 865#define PSICONV_ID_TEXTED_LAYOUT 0x10000066
798#define PSICONV_ID_TEXTED_TEXT 0x10000064 866#define PSICONV_ID_TEXTED_TEXT 0x10000064
799#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F 867#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F
800#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C 868#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C
801#define PSICONV_ID_CLIPART_ITEM 0x10000040 869#define PSICONV_ID_CLIPART_ITEM 0x10000040
870#define PSICONV_ID_OBJECT 0x10000051
871#define PSICONV_ID_OBJECT_DISPLAY_SECTION 0x10000146
872#define PSICONV_ID_OBJECT_ICON_SECTION 0x1000012A
873#define PSICONV_ID_OBJECT_SECTION_TABLE_SECTION 0x10000144
802 874
803 875
804/* Return a clean layout_status. You can modify it at will. Returns NULL 876/* Return a clean layout_status. You can modify it at will. Returns NULL
805 if there is not enough memory. */ 877 if there is not enough memory. */
806extern psiconv_character_layout psiconv_basic_character_layout(void); 878extern psiconv_character_layout psiconv_basic_character_layout(void);
843extern void psiconv_free_formula(psiconv_formula formula); 915extern void psiconv_free_formula(psiconv_formula formula);
844extern void psiconv_free_formula_list(psiconv_formula_list list); 916extern void psiconv_free_formula_list(psiconv_formula_list list);
845extern void psiconv_free_sheet_status_section 917extern void psiconv_free_sheet_status_section
846 (psiconv_sheet_status_section section); 918 (psiconv_sheet_status_section section);
847extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout); 919extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout);
920extern void psiconv_free_sheet_grid_break_list
921 (psiconv_sheet_grid_break_list list);
922extern void psiconv_free_sheet_grid_size(psiconv_sheet_grid_size s);
923extern void psiconv_free_sheet_grid_size_list
924 (psiconv_sheet_grid_size_list list);
925extern void psiconv_free_sheet_grid_section(psiconv_sheet_grid_section sec);
848extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet); 926extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet);
849extern void psiconv_free_sheet_worksheet_list 927extern void psiconv_free_sheet_worksheet_list
850 (psiconv_sheet_worksheet_list list); 928 (psiconv_sheet_worksheet_list list);
851 929
852extern void psiconv_free_sheet_f(psiconv_sheet_f file); 930extern void psiconv_free_sheet_f(psiconv_sheet_f file);
858extern void psiconv_free_sheet_line(psiconv_sheet_line line); 936extern void psiconv_free_sheet_line(psiconv_sheet_line line);
859extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section); 937extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section);
860extern void psiconv_free_sheet_variable(psiconv_sheet_variable list); 938extern void psiconv_free_sheet_variable(psiconv_sheet_variable list);
861extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list); 939extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list);
862extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section); 940extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section);
941extern void psiconv_free_sheet_workbook_section
942 (psiconv_sheet_workbook_section section);
863extern void psiconv_free_header_section(psiconv_header_section header); 943extern void psiconv_free_header_section(psiconv_header_section header);
864extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); 944extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry);
865extern void psiconv_free_section_table_section 945extern void psiconv_free_section_table_section
866 (psiconv_section_table_section section); 946 (psiconv_section_table_section section);
867extern void psiconv_free_application_id_section 947extern void psiconv_free_application_id_section
868 (psiconv_application_id_section section); 948 (psiconv_application_id_section section);
949extern void psiconv_free_object_display_section
950 (psiconv_object_display_section section);
951extern void psiconv_free_object_icon_section
952 (psiconv_object_icon_section section);
953extern void psiconv_free_embedded_object_section
954 (psiconv_embedded_object_section object);
869extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); 955extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout);
870extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); 956extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts);
871extern void psiconv_free_replacement(psiconv_replacement replacement); 957extern void psiconv_free_replacement(psiconv_replacement replacement);
872extern void psiconv_free_replacements(psiconv_replacements replacements); 958extern void psiconv_free_replacements(psiconv_replacements replacements);
873extern void psiconv_free_paragraph(psiconv_paragraph paragraph); 959extern void psiconv_free_paragraph(psiconv_paragraph paragraph);

Legend:
Removed from v.129  
changed lines
  Added in v.184

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