/[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 102 Revision 171
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,
191 psiconv_size_t space_below; 194 psiconv_size_t space_below;
192 psiconv_bool_t keep_together; 195 psiconv_bool_t keep_together;
193 psiconv_bool_t keep_with_next; 196 psiconv_bool_t keep_with_next;
194 psiconv_bool_t on_next_page; 197 psiconv_bool_t on_next_page;
195 psiconv_bool_t no_widow_protection; 198 psiconv_bool_t no_widow_protection;
199 psiconv_bool_t wrap_to_fit_cell;
196 psiconv_length_t border_distance; 200 psiconv_length_t border_distance;
197 psiconv_bullet bullet; 201 psiconv_bullet bullet;
198 psiconv_border left_border; 202 psiconv_border left_border;
199 psiconv_border right_border; 203 psiconv_border right_border;
200 psiconv_border top_border; 204 psiconv_border top_border;
224{ 228{
225 psiconv_u32 id; 229 psiconv_u32 id;
226 psiconv_string_t name; 230 psiconv_string_t name;
227} *psiconv_application_id_section; 231} *psiconv_application_id_section;
228 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
229typedef struct psiconv_in_line_layout_s 254typedef struct psiconv_in_line_layout_s
230{ 255{
231 psiconv_character_layout layout; 256 psiconv_character_layout layout;
232 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;
233} *psiconv_in_line_layout; 262} *psiconv_in_line_layout;
234 263
235typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ 264typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */
236 265
237typedef enum psiconv_replacement_type 266typedef enum psiconv_replacement_type
363typedef struct psiconv_mbm_f_s 392typedef struct psiconv_mbm_f_s
364{ 393{
365 psiconv_pictures sections; 394 psiconv_pictures sections;
366} *psiconv_mbm_f; 395} *psiconv_mbm_f;
367 396
368/* 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.
369 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
370 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.
371 picture itself has size picture_{x,y}size. 400 The first eight values are before magnification and cuts.
372 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
373 cuts everything away. */ 402 cuts everything away. */
374typedef struct psiconv_sketch_section_s 403typedef struct psiconv_sketch_section_s
375{ 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;
376 psiconv_u16 form_xsize; 409 psiconv_u16 form_xsize;
377 psiconv_u16 form_ysize; 410 psiconv_u16 form_ysize;
378 psiconv_u16 picture_x_offset; 411 psiconv_u16 displayed_size_x_offset;
379 psiconv_u16 picture_y_offset; 412 psiconv_u16 displayed_size_y_offset;
380 psiconv_u16 picture_xsize;
381 psiconv_u16 picture_ysize;
382 float magnification_x; /* computed relative to first six values */ 413 float magnification_x; /* computed relative to first eight values */
383 float magnification_y; /* computed relative to first six values */ 414 float magnification_y; /* computed relative to first eight values */
384 float cut_left; /* computed relative to first six values */ 415 float cut_left; /* computed relative to first eight values */
385 float cut_right; /* computed relative to first six values */ 416 float cut_right; /* computed relative to first eight values */
386 float cut_top; /* computed relative to first six values */ 417 float cut_top; /* computed relative to first eight values */
387 float cut_bottom; /* computed relative to first six values */ 418 float cut_bottom; /* computed relative to first eight values */
388 psiconv_paint_data_section picture; 419 psiconv_paint_data_section picture;
389} *psiconv_sketch_section; 420} *psiconv_sketch_section;
390 421
391typedef struct psiconv_sketch_f_s 422typedef struct psiconv_sketch_f_s
392{ 423{
421typedef struct psiconv_sheet_cell_block_s 452typedef struct psiconv_sheet_cell_block_s
422{ 453{
423 psiconv_sheet_cell_reference_t first; 454 psiconv_sheet_cell_reference_t first;
424 psiconv_sheet_cell_reference_t last; 455 psiconv_sheet_cell_reference_t last;
425} psiconv_sheet_cell_block_t; 456} psiconv_sheet_cell_block_t;
457
458typedef enum psiconv_cell_type
459{
460 psiconv_cell_blank,
461 psiconv_cell_int,
462 psiconv_cell_bool,
463 psiconv_cell_error,
464 psiconv_cell_float,
465 psiconv_cell_string
466} psiconv_cell_type_t;
467
468typedef enum psiconv_sheet_errorcode
469{
470 psiconv_sheet_error_none,
471 psiconv_sheet_error_null,
472 psiconv_sheet_error_divzero,
473 psiconv_sheet_error_value,
474 psiconv_sheet_error_reference,
475 psiconv_sheet_error_name,
476 psiconv_sheet_error_number,
477 psiconv_sheet_error_notavail
478} psiconv_sheet_errorcode_t;
479
480typedef enum psiconv_sheet_numberformat_code
481{
482 psiconv_numberformat_general,
483 psiconv_numberformat_fixeddecimal,
484 psiconv_numberformat_scientific,
485 psiconv_numberformat_currency,
486 psiconv_numberformat_percent,
487 psiconv_numberformat_triads,
488 psiconv_numberformat_boolean,
489 psiconv_numberformat_text,
490 psiconv_numberformat_date_dmm,
491 psiconv_numberformat_date_mmd,
492 psiconv_numberformat_date_ddmmyy,
493 psiconv_numberformat_date_mmddyy,
494 psiconv_numberformat_date_yymmdd,
495 psiconv_numberformat_date_dmmm,
496 psiconv_numberformat_date_dmmmyy,
497 psiconv_numberformat_date_ddmmmyy,
498 psiconv_numberformat_date_mmm,
499 psiconv_numberformat_date_monthname,
500 psiconv_numberformat_date_mmmyy,
501 psiconv_numberformat_date_monthnameyy,
502 psiconv_numberformat_date_monthnamedyyyy,
503 psiconv_numberformat_datetime_ddmmyyyyhhii,
504 psiconv_numberformat_datetime_ddmmyyyyHHii,
505 psiconv_numberformat_datetime_mmddyyyyhhii,
506 psiconv_numberformat_datetime_mmddyyyyHHii,
507 psiconv_numberformat_datetime_yyyymmddhhii,
508 psiconv_numberformat_datetime_yyyymmddHHii,
509 psiconv_numberformat_time_hhii,
510 psiconv_numberformat_time_hhiiss,
511 psiconv_numberformat_time_HHii,
512 psiconv_numberformat_time_HHiiss
513} psiconv_sheet_numberformat_code_t;
514
515typedef struct psiconv_sheet_numberformat_s
516{
517 psiconv_sheet_numberformat_code_t code;
518 psiconv_u8 decimal;
519} *psiconv_sheet_numberformat;
520
521typedef struct psiconv_sheet_cell_layout_s
522{
523 psiconv_character_layout character;
524 psiconv_paragraph_layout paragraph;
525 psiconv_sheet_numberformat numberformat;
526} * psiconv_sheet_cell_layout;
527
528typedef struct psiconv_sheet_cell_s
529{
530 psiconv_u16 column;
531 psiconv_u16 row;
532 psiconv_cell_type_t type;
533 union {
534 psiconv_u32 dat_int;
535 double dat_float;
536 char *dat_string;
537 psiconv_bool_t dat_bool;
538 psiconv_sheet_errorcode_t dat_error;
539 } data;
540 psiconv_sheet_cell_layout layout;
541 psiconv_bool_t calculated;
542 psiconv_u32 ref_formula;
543} *psiconv_sheet_cell;
544
545typedef psiconv_list psiconv_sheet_cell_list;
426 546
427typedef struct psiconv_sheet_status_section_s 547typedef struct psiconv_sheet_status_section_s
428{ 548{
429 psiconv_bool_t show_graph; 549 psiconv_bool_t show_graph;
430 psiconv_u32 cursor_row; 550 psiconv_u32 cursor_row;
453 psiconv_formula_op_mul, 573 psiconv_formula_op_mul,
454 psiconv_formula_op_div, 574 psiconv_formula_op_div,
455 psiconv_formula_op_pow, 575 psiconv_formula_op_pow,
456 psiconv_formula_op_pos, 576 psiconv_formula_op_pos,
457 psiconv_formula_op_neg, 577 psiconv_formula_op_neg,
578 psiconv_formula_op_not,
579 psiconv_formula_op_and,
580 psiconv_formula_op_or,
458 psiconv_formula_op_con, 581 psiconv_formula_op_con,
459 psiconv_formula_op_bra, 582 psiconv_formula_op_bra,
460 psiconv_formula_mark_eof, 583 psiconv_formula_mark_eof,
461 psiconv_formula_dat_float, 584 psiconv_formula_dat_float,
462 psiconv_formula_dat_int, 585 psiconv_formula_dat_int,
584 double dat_float; 707 double dat_float;
585 char *dat_string; 708 char *dat_string;
586 psiconv_sheet_cell_reference_t dat_cellref; 709 psiconv_sheet_cell_reference_t dat_cellref;
587 psiconv_sheet_cell_block_t dat_cellblock; 710 psiconv_sheet_cell_block_t dat_cellblock;
588 psiconv_formula_list fun_operands; 711 psiconv_formula_list fun_operands;
712 psiconv_u32 dat_variable;
589 } data; 713 } data;
590} *psiconv_formula; 714} *psiconv_formula;
591 715
716typedef struct psiconv_sheet_line_s
717{
718 psiconv_u32 position;
719 psiconv_sheet_cell_layout layout;
720} *psiconv_sheet_line;
721
722typedef psiconv_list psiconv_sheet_line_list;
723 /* Of struct psiconv_sheet_line_s */
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
761typedef struct psiconv_sheet_worksheet_s
762{
763 psiconv_sheet_cell_layout default_layout;
764 psiconv_sheet_cell_list cells;
765 psiconv_bool_t show_zeros;
766 psiconv_sheet_line_list row_default_layouts;
767 psiconv_sheet_line_list col_default_layouts;
768 psiconv_sheet_grid_section grid;
769} *psiconv_sheet_worksheet;
770
771typedef psiconv_list psiconv_sheet_worksheet_list;
772 /* of struct psiconv_sheet_worksheet_s */
773
774typedef enum psiconv_variable_type
775{
776 psiconv_var_int,
777 psiconv_var_float,
778 psiconv_var_string,
779 psiconv_var_cellref,
780 psiconv_var_cellblock
781} psiconv_variable_type_t;
782
783typedef struct psiconv_sheet_variable_s
784{
785 psiconv_u32 number;
786 char *name;
787 psiconv_variable_type_t type;
788 union {
789 psiconv_s32 dat_int;
790 double dat_float;
791 char *dat_string;
792 psiconv_sheet_cell_reference_t dat_cellref;
793 psiconv_sheet_cell_block_t dat_cellblock;
794 } data;
795} *psiconv_sheet_variable;
796
797typedef psiconv_list psiconv_sheet_variable_list;
798 /* of struct psiconv_sheet_variable_s */
799
800typedef struct psiconv_sheet_name_section_s
801{
802 char *name;
803} *psiconv_sheet_name_section;
804
805typedef struct psiconv_sheet_info_section_s
806{
807 psiconv_bool_t auto_recalc;
808} *psiconv_sheet_info_section;
809
592typedef struct psiconv_sheet_workbook_section_s 810typedef struct psiconv_sheet_workbook_section_s
593{ 811{
594 psiconv_formula_list formulas; 812 psiconv_formula_list formulas;
813 psiconv_sheet_worksheet_list worksheets;
814 psiconv_sheet_variable_list variables;
815 psiconv_sheet_info_section info;
816 psiconv_sheet_name_section name;
595} *psiconv_sheet_workbook_section; 817} *psiconv_sheet_workbook_section;
596 818
597typedef struct psiconv_sheet_f_s 819typedef struct psiconv_sheet_f_s
598{ 820{
599 psiconv_page_layout_section page_sec; 821 psiconv_page_layout_section page_sec;
600 psiconv_sheet_status_section status_sec; 822 psiconv_sheet_status_section status_sec;
601 psiconv_sheet_workbook_section workbook_sec; 823 psiconv_sheet_workbook_section workbook_sec;
602} *psiconv_sheet_f; 824} *psiconv_sheet_f;
603 825
826/* NB: psiconv_file is already defined above */
604typedef struct psiconv_file_s 827struct psiconv_file_s
605{ 828{
606 psiconv_file_type_t type; 829 psiconv_file_type_t type;
607 void *file; 830 void *file;
608} *psiconv_file; 831};
609 832
610 833
611/* UID1 */ 834/* UID1 */
612#define PSICONV_ID_PSION5 0x10000037 835#define PSICONV_ID_PSION5 0x10000037
613#define PSICONV_ID_CLIPART 0x10000041 836#define PSICONV_ID_CLIPART 0x10000041
629#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 852#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105
630#define PSICONV_ID_PASSWORD_SECTION 0x100000CD 853#define PSICONV_ID_PASSWORD_SECTION 0x100000CD
631#define PSICONV_ID_SKETCH_SECTION 0x1000007D 854#define PSICONV_ID_SKETCH_SECTION 0x1000007D
632#define PSICONV_ID_SHEET_STATUS_SECTION 0x1000011F 855#define PSICONV_ID_SHEET_STATUS_SECTION 0x1000011F
633#define PSICONV_ID_SHEET_WORKBOOK_SECTION 0x1000011D 856#define PSICONV_ID_SHEET_WORKBOOK_SECTION 0x1000011D
857#define PSICONV_ID_SHEET_GRAPH_SECTION 0x10000121
634 858
635/* Other ids */ 859/* Other ids */
636#define PSICONV_ID_PAGE_DIMENSIONS1 0x100000fd 860#define PSICONV_ID_PAGE_DIMENSIONS1 0x100000fd
637#define PSICONV_ID_PAGE_DIMENSIONS2 0x1000010e 861#define PSICONV_ID_PAGE_DIMENSIONS2 0x1000010e
638#define PSICONV_ID_TEXTED_BODY 0x1000005c 862#define PSICONV_ID_TEXTED_BODY 0x1000005c
641#define PSICONV_ID_TEXTED_LAYOUT 0x10000066 865#define PSICONV_ID_TEXTED_LAYOUT 0x10000066
642#define PSICONV_ID_TEXTED_TEXT 0x10000064 866#define PSICONV_ID_TEXTED_TEXT 0x10000064
643#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F 867#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F
644#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C 868#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C
645#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
646 874
647 875
648/* 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
649 if there is not enough memory. */ 877 if there is not enough memory. */
650extern psiconv_character_layout psiconv_basic_character_layout(void); 878extern psiconv_character_layout psiconv_basic_character_layout(void);
661extern psiconv_character_layout psiconv_clone_character_layout 889extern psiconv_character_layout psiconv_clone_character_layout
662 (psiconv_character_layout ls); 890 (psiconv_character_layout ls);
663 891
664/* Get a numbered style. Returns NULL if the style is unknown. */ 892/* Get a numbered style. Returns NULL if the style is unknown. */
665extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); 893extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr);
894/* Get a numbered formula. Returns NULL if the style is unknown. */
895extern psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr);
896
897/* Return the default layout */
898extern psiconv_sheet_cell_layout psiconv_get_default_layout
899 (psiconv_sheet_line_list row_defaults,
900 psiconv_sheet_line_list col_defaults,
901 psiconv_sheet_cell_layout cell_default,
902 int row,int col);
666 903
667extern void psiconv_free_color(psiconv_color color); 904extern void psiconv_free_color(psiconv_color color);
668extern void psiconv_free_border(psiconv_border border); 905extern void psiconv_free_border(psiconv_border border);
669extern void psiconv_free_bullet(psiconv_bullet bullet); 906extern void psiconv_free_bullet(psiconv_bullet bullet);
670extern void psiconv_free_font(psiconv_font font); 907extern void psiconv_free_font(psiconv_font font);
677 (psiconv_word_styles_section styles); 914 (psiconv_word_styles_section styles);
678extern void psiconv_free_formula(psiconv_formula formula); 915extern void psiconv_free_formula(psiconv_formula formula);
679extern void psiconv_free_formula_list(psiconv_formula_list list); 916extern void psiconv_free_formula_list(psiconv_formula_list list);
680extern void psiconv_free_sheet_status_section 917extern void psiconv_free_sheet_status_section
681 (psiconv_sheet_status_section section); 918 (psiconv_sheet_status_section section);
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);
926extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet);
927extern void psiconv_free_sheet_worksheet_list
928 (psiconv_sheet_worksheet_list list);
929
682extern void psiconv_free_sheet_f(psiconv_sheet_f file); 930extern void psiconv_free_sheet_f(psiconv_sheet_f file);
931extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell);
932extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list);
933extern void psiconv_free_sheet_numberformat
934 (psiconv_sheet_numberformat numberformat);
935extern void psiconv_free_sheet_line_list(psiconv_sheet_line_list list);
936extern void psiconv_free_sheet_line(psiconv_sheet_line line);
937extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section);
938extern void psiconv_free_sheet_variable(psiconv_sheet_variable list);
939extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list);
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);
683extern void psiconv_free_header_section(psiconv_header_section header); 943extern void psiconv_free_header_section(psiconv_header_section header);
684extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); 944extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry);
685extern void psiconv_free_section_table_section 945extern void psiconv_free_section_table_section
686 (psiconv_section_table_section section); 946 (psiconv_section_table_section section);
687extern void psiconv_free_application_id_section 947extern void psiconv_free_application_id_section
688 (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);
689extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); 955extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout);
690extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); 956extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts);
691extern void psiconv_free_replacement(psiconv_replacement replacement); 957extern void psiconv_free_replacement(psiconv_replacement replacement);
692extern void psiconv_free_replacements(psiconv_replacements replacements); 958extern void psiconv_free_replacements(psiconv_replacements replacements);
693extern void psiconv_free_paragraph(psiconv_paragraph paragraph); 959extern void psiconv_free_paragraph(psiconv_paragraph paragraph);

Legend:
Removed from v.102  
changed lines
  Added in v.171

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