… | |
… | |
32 | static void psiconv_free_in_line_layout_aux(void * layout); |
32 | static void psiconv_free_in_line_layout_aux(void * layout); |
33 | static void psiconv_free_paragraph_aux(void * paragraph); |
33 | static void psiconv_free_paragraph_aux(void * paragraph); |
34 | static void psiconv_free_paint_data_section_aux(void * section); |
34 | static void psiconv_free_paint_data_section_aux(void * section); |
35 | static void psiconv_free_clipart_section_aux(void * section); |
35 | static void psiconv_free_clipart_section_aux(void * section); |
36 | |
36 | |
|
|
37 | /* Note: these defaults seem to be hard-coded somewhere outside the |
|
|
38 | files themself. */ |
37 | psiconv_character_layout psiconv_basic_character_layout(void) |
39 | psiconv_character_layout psiconv_basic_character_layout(void) |
38 | { |
40 | { |
39 | /* Make the structures static, to oblige IRIX */ |
41 | /* Make the structures static, to oblige IRIX */ |
40 | static struct psiconv_color_s black = |
42 | static struct psiconv_color_s black = |
41 | { |
43 | { |
… | |
… | |
61 | 10.0, /* font_size */ |
63 | 10.0, /* font_size */ |
62 | psiconv_bool_false, /* italic */ |
64 | psiconv_bool_false, /* italic */ |
63 | psiconv_bool_false, /* bold */ |
65 | psiconv_bool_false, /* bold */ |
64 | psiconv_normalscript, /* super_sub */ |
66 | psiconv_normalscript, /* super_sub */ |
65 | psiconv_bool_false, /* underline */ |
67 | psiconv_bool_false, /* underline */ |
66 | psiconv_bool_false, /* strike_out */ |
68 | psiconv_bool_false, /* strikethrough */ |
67 | &font, /* font */ |
69 | &font, /* font */ |
68 | }; |
70 | }; |
69 | |
71 | |
70 | return psiconv_clone_character_layout(&cl); |
72 | return psiconv_clone_character_layout(&cl); |
71 | } |
73 | } |
72 | |
74 | |
|
|
75 | /* Note: these defaults seem to be hard-coded somewhere outside the |
|
|
76 | files themself. */ |
73 | psiconv_paragraph_layout psiconv_basic_paragraph_layout(void) |
77 | psiconv_paragraph_layout psiconv_basic_paragraph_layout(void) |
74 | { |
78 | { |
75 | static struct psiconv_font_s font = |
79 | static struct psiconv_font_s font = |
76 | { |
80 | { |
77 | "Times New Roman", /* name */ |
81 | "Times New Roman", /* name */ |
… | |
… | |
115 | 0.0, /* indent_left */ |
119 | 0.0, /* indent_left */ |
116 | 0.0, /* indent_right */ |
120 | 0.0, /* indent_right */ |
117 | 0.0, /* indent_first */ |
121 | 0.0, /* indent_first */ |
118 | psiconv_justify_left, /* justify_hor */ |
122 | psiconv_justify_left, /* justify_hor */ |
119 | psiconv_justify_middle,/* justify_ver */ |
123 | psiconv_justify_middle,/* justify_ver */ |
120 | 0.0, /* interline */ |
124 | 10.0, /* linespacing */ |
121 | psiconv_bool_false, /* interline_exact */ |
125 | psiconv_bool_false, /* linespacing_exact */ |
122 | 0.0, /* top_space */ |
126 | 0.0, /* space_above */ |
123 | 0.0, /* bottom_space */ |
127 | 0.0, /* space_below */ |
124 | psiconv_bool_false, /* on_one_page */ |
|
|
125 | psiconv_bool_false, /* together_with */ |
128 | psiconv_bool_false, /* keep_together */ |
|
|
129 | psiconv_bool_false, /* keep_with_next */ |
126 | psiconv_bool_false, /* on_next_page */ |
130 | psiconv_bool_false, /* on_next_page */ |
127 | psiconv_bool_false, /* no_widow_protection */ |
131 | psiconv_bool_false, /* no_widow_protection */ |
128 | 0.0, /* left_margin */ |
132 | 0.0, /* left_margin */ |
129 | &bullet, /* bullet */ |
133 | &bullet, /* bullet */ |
130 | &no_border, /* left_border */ |
134 | &no_border, /* left_border */ |
… | |
… | |
619 | else if (file->type == psiconv_clipart_file) |
623 | else if (file->type == psiconv_clipart_file) |
620 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
624 | psiconv_free_clipart_f((psiconv_clipart_f) file->file); |
621 | free(file); |
625 | free(file); |
622 | } |
626 | } |
623 | } |
627 | } |
|
|
628 | |
|
|
629 | int psiconv_compare_color(const psiconv_color value1, |
|
|
630 | const psiconv_color value2) |
|
|
631 | { |
|
|
632 | if (!value1 || !value2) |
|
|
633 | return 1; |
|
|
634 | if ((value1->red == value2->red) && |
|
|
635 | (value1->green == value2->green) && |
|
|
636 | (value1->blue == value2->blue)) |
|
|
637 | return 0; |
|
|
638 | else |
|
|
639 | return 1; |
|
|
640 | } |
|
|
641 | |
|
|
642 | int psiconv_compare_font(const psiconv_font value1, |
|
|
643 | const psiconv_font value2) |
|
|
644 | { |
|
|
645 | if (!value1 || !value2 || !value1->name || !value2->name) |
|
|
646 | return 1; |
|
|
647 | if ((value1->screenfont == value2->screenfont) && |
|
|
648 | !strcmp(value1->name,value2->name)) |
|
|
649 | return 0; |
|
|
650 | else |
|
|
651 | return 1; |
|
|
652 | } |
|
|
653 | |
|
|
654 | int psiconv_compare_border(const psiconv_border value1, |
|
|
655 | const psiconv_border value2) |
|
|
656 | { |
|
|
657 | if (!value1 || !value2) |
|
|
658 | return 1; |
|
|
659 | if ((value1->kind == value2->kind) && |
|
|
660 | (value1->thickness == value2->thickness) && |
|
|
661 | !psiconv_compare_color(value1->color,value2->color)) |
|
|
662 | return 0; |
|
|
663 | else |
|
|
664 | return 1; |
|
|
665 | } |
|
|
666 | |
|
|
667 | int psiconv_compare_bullet(const psiconv_bullet value1, |
|
|
668 | const psiconv_bullet value2) |
|
|
669 | { |
|
|
670 | if (!value1 || !value2) |
|
|
671 | return 1; |
|
|
672 | if ((value1->on == value2->on) && |
|
|
673 | (value1->font_size == value2->font_size) && |
|
|
674 | (value1->character == value2->character) && |
|
|
675 | (value1->indent == value2->indent) && |
|
|
676 | !psiconv_compare_color(value1->color,value2->color) && |
|
|
677 | !psiconv_compare_font(value1->font,value2->font)) |
|
|
678 | return 0; |
|
|
679 | else |
|
|
680 | return 1; |
|
|
681 | } |
|
|
682 | |
|
|
683 | int psiconv_compare_tab(const psiconv_tab value1, const psiconv_tab value2) |
|
|
684 | { |
|
|
685 | if (!value1 || !value2) |
|
|
686 | return 1; |
|
|
687 | if ((value1->location == value2->location) && |
|
|
688 | (value1->kind == value2->kind)) |
|
|
689 | return 0; |
|
|
690 | else |
|
|
691 | return 1; |
|
|
692 | } |
|
|
693 | |
|
|
694 | int psiconv_compare_all_tabs(const psiconv_all_tabs value1, |
|
|
695 | const psiconv_all_tabs value2) |
|
|
696 | { |
|
|
697 | int i; |
|
|
698 | |
|
|
699 | if (!value1 || !value2 || !value1->extras || !value2->extras) |
|
|
700 | return 1; |
|
|
701 | |
|
|
702 | if ((value1->normal != value2->normal) || |
|
|
703 | psiconv_list_length(value1->extras) != |
|
|
704 | psiconv_list_length(value2->extras)) |
|
|
705 | return 1; |
|
|
706 | for (i = 0; i < psiconv_list_length(value1->extras); i++) |
|
|
707 | if (psiconv_compare_tab(psiconv_list_get(value1->extras,i), |
|
|
708 | psiconv_list_get(value2->extras,i))) |
|
|
709 | |
|
|
710 | return 1; |
|
|
711 | return 0; |
|
|
712 | } |
|
|
713 | |
|
|
714 | int psiconv_compare_paragraph_layout(const psiconv_paragraph_layout value1, |
|
|
715 | const psiconv_paragraph_layout value2) |
|
|
716 | { |
|
|
717 | if (!value1 || !value2) |
|
|
718 | return 1; |
|
|
719 | if ((value1->indent_left == value2->indent_left) && |
|
|
720 | (value1->indent_right == value2->indent_right) && |
|
|
721 | (value1->indent_first == value2->indent_first) && |
|
|
722 | (value1->justify_hor == value2->justify_hor) && |
|
|
723 | (value1->justify_ver == value2->justify_ver) && |
|
|
724 | (value1->linespacing == value2->linespacing) && |
|
|
725 | (value1->space_above == value2->space_above) && |
|
|
726 | (value1->space_below == value2->space_below) && |
|
|
727 | (value1->keep_together == value2->keep_together) && |
|
|
728 | (value1->keep_with_next == value2->keep_with_next) && |
|
|
729 | (value1->on_next_page == value2->on_next_page) && |
|
|
730 | (value1->no_widow_protection == value2->no_widow_protection) && |
|
|
731 | (value1->border_distance == value2->border_distance) && |
|
|
732 | !psiconv_compare_color(value1->back_color,value2->back_color) && |
|
|
733 | !psiconv_compare_bullet(value1->bullet,value2->bullet) && |
|
|
734 | !psiconv_compare_border(value1->left_border,value2->left_border) && |
|
|
735 | !psiconv_compare_border(value1->right_border,value2->right_border) && |
|
|
736 | !psiconv_compare_border(value1->top_border,value2->top_border) && |
|
|
737 | !psiconv_compare_border(value1->bottom_border,value2->bottom_border) && |
|
|
738 | !psiconv_compare_all_tabs(value1->tabs,value2->tabs)) |
|
|
739 | return 0; |
|
|
740 | else |
|
|
741 | return 1; |
|
|
742 | } |
|
|
743 | |
|
|
744 | |
|
|
745 | int psiconv_compare_character_layout(const psiconv_character_layout value1, |
|
|
746 | const psiconv_character_layout value2) |
|
|
747 | { |
|
|
748 | if (!value1 || !value2) |
|
|
749 | return 1; |
|
|
750 | if ((value1->font_size == value2->font_size) && |
|
|
751 | (value1->italic == value2->italic) && |
|
|
752 | (value1->bold == value2->bold) && |
|
|
753 | (value1->super_sub == value2->super_sub) && |
|
|
754 | (value1->underline == value2->underline) && |
|
|
755 | (value1->strikethrough == value2->strikethrough) && |
|
|
756 | !psiconv_compare_color(value1->color,value2->color) && |
|
|
757 | !psiconv_compare_color(value1->back_color,value2->back_color) && |
|
|
758 | !psiconv_compare_font(value1->font,value2->font)) |
|
|
759 | return 0; |
|
|
760 | else |
|
|
761 | return 1; |
|
|
762 | } |