/[public]/psiconv/trunk/program/psiconv/gen_rtf.c
ViewVC logotype

Diff of /psiconv/trunk/program/psiconv/gen_rtf.c

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

Revision 14 Revision 34
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20 20
21#include "config.h" 21#include "config.h"
22#include "compat.h"
22#include <stdio.h> 23#include <stdio.h>
23#include <string.h> 24#include <string.h>
24#include "data.h" 25#include "data.h"
25#include "list.h" 26#include "list.h"
26#include "gen.h" 27#include "gen.h"
28#include "psiconv.h"
27 29
28 30
29/* 31/*
30 * Various string tables for RTF settings 32 * Various string tables for RTF settings
31 */ 33 */
325static psiconv_character_layout 327static psiconv_character_layout
326 gen_base_char(psiconv_list colors, psiconv_list fonts) 328 gen_base_char(psiconv_list colors, psiconv_list fonts)
327{ 329{
328 struct psiconv_color white = { 0,0,0 }; 330 struct psiconv_color white = { 0,0,0 };
329 struct psiconv_color black = { 0xff,0xff,0xff }; 331 struct psiconv_color black = { 0xff,0xff,0xff };
330 struct psiconv_font font = { strdup(""),-1 }; /* Pseudo - not added! */ 332 struct psiconv_font font = { NULL,-1 }; /* Pseudo - not added! */
331 333
332 struct psiconv_character_layout base_char_struct = 334 struct psiconv_character_layout base_char_struct =
333 { 335 {
334 &black, /* color */ 336 &black, /* color */
335 &white, /* back_color */ 337 &white, /* back_color */
340 psiconv_bool_false, /* underline */ 342 psiconv_bool_false, /* underline */
341 psiconv_bool_false, /* strike_out */ 343 psiconv_bool_false, /* strike_out */
342 &font, /* font */ 344 &font, /* font */
343 }; 345 };
344 346
347 font.name = strdup("");
345 add_color(colors,&white); 348 add_color(colors,&white);
346 add_color(colors,&black); 349 add_color(colors,&black);
347 350
348 return psiconv_clone_character_layout(&base_char_struct); 351 return psiconv_clone_character_layout(&base_char_struct);
349} 352}
350 353
351void diff_char(FILE *of,psiconv_list colors, psiconv_list fonts, 354static void diff_char(FILE *of,psiconv_list colors, psiconv_list fonts,
352 const psiconv_character_layout old, 355 const psiconv_character_layout old,
353 const psiconv_character_layout new) 356 const psiconv_character_layout new)
354{ 357{
355 if ((old->font->screenfont != new->font->screenfont) || 358 if ((old->font->screenfont != new->font->screenfont) ||
356 strcmp(old->font->name,new->font->name)) 359 strcmp(old->font->name,new->font->name))
517 520
518 psiconv_list_free(fonts); 521 psiconv_list_free(fonts);
519 psiconv_list_free(colors); 522 psiconv_list_free(colors);
520} 523}
521 524
522void psiconv_gen_rtf(FILE * of, psiconv_file file) 525static int psiconv_gen_rtf(FILE * of, const psiconv_file file, const char *dest)
523{ 526{
524 if (file->type == psiconv_word_file) 527 if (file->type == psiconv_word_file) {
525 psiconv_gen_rtf_word(of,(psiconv_word_f) file->file); 528 psiconv_gen_rtf_word(of,(psiconv_word_f) file->file);
529 return 0;
526 else if (file->type == psiconv_texted_file) 530 } else if (file->type == psiconv_texted_file) {
527 psiconv_gen_rtf_texted(of,(psiconv_texted_f) file->file); 531 psiconv_gen_rtf_texted(of,(psiconv_texted_f) file->file);
528 else
529 return; 532 return 0;
533 } else
534 return -1;
530} 535}
531 536
537static struct psiconv_fileformat ff =
538{
539 "RTF",
540 "Rich Text Format (not functional yet!)",
541 psiconv_gen_rtf
542};
543
544void init_rtf(void)
545{
546 psiconv_list_add(fileformat_list,&ff);
547}
548

Legend:
Removed from v.14  
changed lines
  Added in v.34

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