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

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

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

Revision 20 Revision 56
32static psiconv_all_tabs clone_all_tabs(psiconv_all_tabs all_tabs); 32static psiconv_all_tabs clone_all_tabs(psiconv_all_tabs all_tabs);
33static void psiconv_free_style_aux(void *style); 33static void psiconv_free_style_aux(void *style);
34static void psiconv_free_in_line_layout_aux(void * layout); 34static void psiconv_free_in_line_layout_aux(void * layout);
35static void psiconv_free_paragraph_aux(void * paragraph); 35static void psiconv_free_paragraph_aux(void * paragraph);
36static void psiconv_free_paint_data_section_aux(void * section); 36static void psiconv_free_paint_data_section_aux(void * section);
37static void psiconv_free_clipart_section_aux(void * section);
37 38
38psiconv_character_layout psiconv_basic_character_layout(void) 39psiconv_character_layout psiconv_basic_character_layout(void)
39{ 40{
40 /* Make the structures static, to oblige IRIX */ 41 /* Make the structures static, to oblige IRIX */
41 static struct psiconv_color black = 42 static struct psiconv_color_s black =
42 { 43 {
43 0x00, /* red */ 44 0x00, /* red */
44 0x00, /* green */ 45 0x00, /* green */
45 0x00, /* blue */ 46 0x00, /* blue */
46 }; 47 };
47 static struct psiconv_color white = 48 static struct psiconv_color_s white =
48 { 49 {
49 0xff, /* red */ 50 0xff, /* red */
50 0xff, /* green */ 51 0xff, /* green */
51 0xff, /* blue */ 52 0xff, /* blue */
52 }; 53 };
53 static struct psiconv_font font = 54 static struct psiconv_font_s font =
54 { 55 {
55 "Times New Roman", /* name */ 56 "Times New Roman", /* name */
56 3 /* screenfont */ 57 3 /* screenfont */
57 }; 58 };
58 struct psiconv_character_layout cl = 59 struct psiconv_character_layout_s cl =
59 { 60 {
60 &black, /* color */ 61 &black, /* color */
61 &white, /* back_color */ 62 &white, /* back_color */
62 10.0, /* font_size */ 63 10.0, /* font_size */
63 psiconv_bool_false, /* italic */ 64 psiconv_bool_false, /* italic */
64 psiconv_bool_false, /* bold */ 65 psiconv_bool_false, /* bold */
65 psiconv_normalscript, /* super_sub */ 66 psiconv_normalscript, /* super_sub */
66 psiconv_bool_false, /* underline */ 67 psiconv_bool_false, /* underline */
67 psiconv_bool_false, /* strike_out */ 68 psiconv_bool_false, /* strike_out */
68 NULL, /* font */ 69 &font, /* font */
69 }; 70 };
70 71
71 return psiconv_clone_character_layout(&cl); 72 return psiconv_clone_character_layout(&cl);
72} 73}
73 74
74psiconv_paragraph_layout psiconv_basic_paragraph_layout(void) 75psiconv_paragraph_layout psiconv_basic_paragraph_layout(void)
75{ 76{
76 static struct psiconv_font font = 77 static struct psiconv_font_s font =
77 { 78 {
78 "Times New Roman", /* name */ 79 "Times New Roman", /* name */
79 2 /* screenfont */ 80 2 /* screenfont */
80 }; 81 };
81 static struct psiconv_color black = 82 static struct psiconv_color_s black =
82 { 83 {
83 0x00, /* red */ 84 0x00, /* red */
84 0x00, /* green */ 85 0x00, /* green */
85 0x00, /* blue */ 86 0x00, /* blue */
86 }; 87 };
87 static struct psiconv_color white = 88 static struct psiconv_color_s white =
88 { 89 {
89 0xff, /* red */ 90 0xff, /* red */
90 0xff, /* green */ 91 0xff, /* green */
91 0xff, /* blue */ 92 0xff, /* blue */
92 }; 93 };
93 static struct psiconv_border no_border = 94 static struct psiconv_border_s no_border =
94 { 95 {
95 psiconv_border_none, /* kind */ 96 psiconv_border_none, /* kind */
96 1, /* thickness */ 97 1, /* thickness */
97 &black /* color */ 98 &black /* color */
98 }; 99 };
99 static struct psiconv_bullet bullet = 100 static struct psiconv_bullet_s bullet =
100 { 101 {
101 psiconv_bool_false, /* on */ 102 psiconv_bool_false, /* on */
102 10.0, /* font_size */ 103 10.0, /* font_size */
103 0x95, /* character */ 104 0x95, /* character */
104 psiconv_bool_true, /* indent */ 105 psiconv_bool_true, /* indent */
105 &black, /* color */ 106 &black, /* color */
106 &font, /* font */ 107 &font, /* font */
107 }; 108 };
108 static struct psiconv_all_tabs tabs = 109 static struct psiconv_all_tabs_s tabs =
109 { 110 {
110 0.64, /* normal */ 111 0.64, /* normal */
111 NULL /* kind */ 112 NULL /* kind */
112 }; 113 };
113 struct psiconv_paragraph_layout pl = 114 struct psiconv_paragraph_layout_s pl =
114 { 115 {
115 &white, /* back_color */ 116 &white, /* back_color */
116 0.0, /* indent_left */ 117 0.0, /* indent_left */
117 0.0, /* indent_right */ 118 0.0, /* indent_right */
118 0.0, /* indent_first */ 119 0.0, /* indent_first */
134 &no_border, /* bottom_border */ 135 &no_border, /* bottom_border */
135 &tabs, /* tabs */ 136 &tabs, /* tabs */
136 }; 137 };
137 psiconv_paragraph_layout res; 138 psiconv_paragraph_layout res;
138 139
139 pl.tabs->extras = psiconv_list_new(sizeof(struct psiconv_tab)); 140 pl.tabs->extras = psiconv_list_new(sizeof(struct psiconv_tab_s));
140 res = psiconv_clone_paragraph_layout(&pl); 141 res = psiconv_clone_paragraph_layout(&pl);
141 psiconv_list_free(pl.tabs->extras); 142 psiconv_list_free(pl.tabs->extras);
142 return res; 143 return res;
143} 144}
144 145
481{ 482{
482 if (section) 483 if (section)
483 psiconv_list_free_el(section,&psiconv_free_paint_data_section_aux); 484 psiconv_list_free_el(section,&psiconv_free_paint_data_section_aux);
484} 485}
485 486
486void psiconv_free_mbm_jumptable_section (psiconv_mbm_jumptable_section section) 487void psiconv_free_jumptable_section (psiconv_jumptable_section section)
487{ 488{
488 if (section) 489 if (section)
489 psiconv_list_free(section); 490 psiconv_list_free(section);
490} 491}
491 492
492void psiconv_free_mbm_f(psiconv_mbm_f file) 493void psiconv_free_mbm_f(psiconv_mbm_f file)
493{ 494{
494 if (file) { 495 if (file) {
495 psiconv_free_pictures(file->sections); 496 psiconv_free_pictures(file->sections);
497 free(file);
498 }
499}
500
501void psiconv_free_sketch_section(psiconv_sketch_section sec)
502{
503 if (sec) {
504 psiconv_free_paint_data_section(sec->picture);
505 free(sec);
506 }
507}
508
509void psiconv_free_sketch_f(psiconv_sketch_f file)
510{
511 if (file) {
512 psiconv_free_sketch_section(file->sketch_sec);
513 free(file);
514 }
515}
516
517void psiconv_free_clipart_section_aux(void *section)
518{
519 if (section)
520 free(((psiconv_clipart_section ) section)->picture);
521}
522
523void psiconv_free_clipart_section(psiconv_clipart_section section)
524{
525 if (section) {
526 psiconv_free_clipart_section_aux(section);
527 free(section);
528 }
529}
530
531void psiconv_free_cliparts(psiconv_cliparts section)
532{
533 if (section)
534 psiconv_list_free_el(section,&psiconv_free_clipart_section_aux);
535}
536
537void psiconv_free_clipart_f(psiconv_clipart_f file)
538{
539 if (file) {
540 psiconv_free_cliparts(file->sections);
496 free(file); 541 free(file);
497 } 542 }
498} 543}
499 544
500void psiconv_free_file(psiconv_file file) 545void psiconv_free_file(psiconv_file file)
504 psiconv_free_word_f((psiconv_word_f) file->file); 549 psiconv_free_word_f((psiconv_word_f) file->file);
505 else if (file->type == psiconv_texted_file) 550 else if (file->type == psiconv_texted_file)
506 psiconv_free_texted_f((psiconv_texted_f) file->file); 551 psiconv_free_texted_f((psiconv_texted_f) file->file);
507 else if (file->type == psiconv_mbm_file) 552 else if (file->type == psiconv_mbm_file)
508 psiconv_free_mbm_f((psiconv_mbm_f) file->file); 553 psiconv_free_mbm_f((psiconv_mbm_f) file->file);
554 else if (file->type == psiconv_sketch_file)
555 psiconv_free_sketch_f((psiconv_sketch_f) file->file);
556 else if (file->type == psiconv_clipart_file)
557 psiconv_free_clipart_f((psiconv_clipart_f) file->file);
509 free(file); 558 free(file);
510 } 559 }
511} 560}

Legend:
Removed from v.20  
changed lines
  Added in v.56

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