Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. /*=============================================================================
  3.    GNU UnRTF, a command-line program to convert RTF documents to other formats.
  4.    Copyright (C) 2000,2001 Zachary Thayer Smith
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2 of the License, or
  9.    (at your option) any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  
  20.    The author is reachable by electronic mail at tuorfa@yahoo.com.
  21. =============================================================================*/
  22.  
  23.  
  24. /*----------------------------------------------------------------------
  25.  * Module name:    output
  26.  * Author name:    Zach Smith
  27.  * Create date:    18 Sep 01
  28.  * Purpose:        Definitions for the generalized output module
  29.  *----------------------------------------------------------------------
  30.  * Changes:
  31.  *--------------------------------------------------------------------*/
  32.  
  33.  
  34. #ifndef _OUTPUT
  35.  
  36.  
  37. typedef struct {
  38.         char *comment_begin;
  39.         char *comment_end;
  40.  
  41.         char *document_begin;
  42.         char *document_end;
  43.  
  44.         char *header_begin;
  45.         char *header_end;
  46.  
  47.         char *document_title_begin;
  48.         char *document_title_end;
  49.  
  50.         char *document_keywords_begin;
  51.         char *document_keywords_end;
  52.  
  53.         char *document_author_begin;
  54.         char *document_author_end;
  55.  
  56.         char *document_changedate_begin;
  57.         char *document_changedate_end;
  58.  
  59.         char *body_begin;
  60.         char *body_end;
  61.  
  62.         char *word_begin;
  63.         char *word_end;
  64.  
  65.         char *paragraph_begin;
  66.         char *paragraph_end;
  67.  
  68.         char *center_begin;
  69.         char *center_end;
  70.  
  71.         char *align_left_begin;
  72.         char *align_left_end;
  73.  
  74.         char *align_right_begin;
  75.         char *align_right_end;
  76.  
  77.         char *justify_begin;
  78.         char *justify_end;
  79.  
  80.         char *forced_space;
  81.         char *line_break;
  82.         char *page_break;
  83.  
  84.         char *hyperlink_begin;
  85.         char *hyperlink_end;
  86.  
  87.         char *imagelink_begin;
  88.         char *imagelink_end;
  89.  
  90.         char *table_begin;
  91.         char *table_end;
  92.  
  93.         char *table_row_begin;
  94.         char *table_row_end;
  95.  
  96.         char *table_cell_begin;
  97.         char *table_cell_end;
  98.  
  99.         /* Character attributes */
  100.         char *font_begin;
  101.         char *font_end;
  102.  
  103.         char *fontsize_begin;
  104.         char *fontsize_end;
  105.  
  106.         /* standard font sizes are optional */
  107.         char *fontsize8_begin;
  108.         char *fontsize8_end;
  109.  
  110.         char *fontsize10_begin;
  111.         char *fontsize10_end;
  112.  
  113.         char *fontsize12_begin;
  114.         char *fontsize12_end;
  115.  
  116.         char *fontsize14_begin;
  117.         char *fontsize14_end;
  118.  
  119.         char *fontsize18_begin;
  120.         char *fontsize18_end;
  121.  
  122.         char *fontsize24_begin;
  123.         char *fontsize24_end;
  124.  
  125.         char *fontsize36_begin;
  126.         char *fontsize36_end;
  127.  
  128.         char *fontsize48_begin;
  129.         char *fontsize48_end;
  130.  
  131.         char *smaller_begin;
  132.         char *smaller_end;
  133.  
  134.         char *bigger_begin;
  135.         char *bigger_end;
  136.  
  137.         char *foreground_begin;
  138.         char *foreground_end;
  139.  
  140.         char *background_begin;
  141.         char *background_end;
  142.  
  143.         char *bold_begin;
  144.         char *bold_end;
  145.  
  146.         char *italic_begin;
  147.         char *italic_end;
  148.  
  149.         char *underline_begin;
  150.         char *underline_end;
  151.  
  152.         char *dbl_underline_begin;
  153.         char *dbl_underline_end;
  154.  
  155.         char *superscript_begin;
  156.         char *superscript_end;
  157.  
  158.         char *subscript_begin;
  159.         char *subscript_end;
  160.  
  161.         char *strikethru_begin;
  162.         char *strikethru_end;
  163.  
  164.         char *dbl_strikethru_begin;
  165.         char *dbl_strikethru_end;
  166.  
  167.         char *emboss_begin;
  168.         char *emboss_end;
  169.  
  170.         char *engrave_begin;
  171.         char *engrave_end;
  172.  
  173.         char *shadow_begin;
  174.         char *shadow_end;
  175.  
  176.         char *outline_begin;
  177.         char *outline_end;
  178.  
  179.         char *small_caps_begin;
  180.         char *small_caps_end;
  181.  
  182.         char *pointlist_begin;
  183.         char *pointlist_end;
  184.  
  185.         char *pointlist_item_begin;
  186.         char *pointlist_item_end;
  187.  
  188.         char *numericlist_begin;
  189.         char *numericlist_end;
  190.  
  191.         char *numericlist_item_begin;
  192.         char *numericlist_item_end;
  193.  
  194.         char *expand_begin;
  195.         char *expand_end;
  196.  
  197.         char *toc_entry_begin;
  198.         char *toc_entry_end;
  199.  
  200.         char *index_entry_begin;
  201.         char *index_entry_end;
  202.  
  203.         /* XX These should really be replaced by references
  204.          * to one of the charsets.
  205.          */
  206.         struct {
  207.                 char *bullet;
  208.                 char *left_quote;
  209.                 char *right_quote;
  210.                 char *left_dbl_quote;
  211.                 char *right_dbl_quote;
  212.                 char *nonbreaking_space;
  213.                 char *emdash;
  214.                 char *endash;
  215.                 char *lessthan;
  216.                 char *greaterthan;
  217.                 char *amp;
  218.                 char *copyright;
  219.                 char *trademark;
  220.                 char *nonbreaking_hyphen;
  221.                 char *optional_hyphen;
  222.         } chars;
  223.  
  224.         char **ascii_translation_table;
  225.  
  226.         int simulate_small_caps : 1;
  227.         int simulate_all_caps : 1;
  228.         int simulate_word_underline : 1;
  229.  
  230.         char **ansi_translation_table;
  231.         short ansi_first_char;
  232.         short ansi_last_char;
  233.         char **cp437_translation_table;
  234.         short cp437_first_char;
  235.         short cp437_last_char;
  236.         char **cp850_translation_table;
  237.         short cp850_first_char;
  238.         short cp850_last_char;
  239.         char **mac_translation_table;
  240.         short mac_first_char;
  241.         short mac_last_char;
  242.  
  243.         void (*write_set_foreground) (int,int,int);
  244. }
  245. OutputPersonality;
  246.  
  247.  
  248. extern OutputPersonality* op_create(void);
  249. extern void op_free (OutputPersonality*);
  250. extern char* op_translate_char (OutputPersonality*,int,int);
  251.  
  252. extern void op_begin_std_fontsize (OutputPersonality*, int);
  253. extern void op_end_std_fontsize (OutputPersonality*, int);
  254.  
  255.  
  256. #define _OUTPUT
  257. #endif
  258.  
  259.