ReactOS 0.4.16-dev-1305-ge26ad0d
reader.c
Go to the documentation of this file.
1/*
2 * WINE RTF file reader
3 *
4 * Portions Copyright 2004 Mike McCormack for CodeWeavers
5 * Portions Copyright 2006 by Phil Krylov
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22/*
23 * Derived from RTF Tools by Paul DuBois (dubois@primate.wisc.edu)
24 * Homepage: http://www.snake.net/software/RTF/
25 * Original license follows:
26 */
27
28/*
29 * reader.c - RTF file reader. Release 1.10.
30 *
31 * ....
32 *
33 * Author: Paul DuBois dubois@primate.wisc.edu
34 *
35 * This software may be redistributed without restriction and used for
36 * any purpose whatsoever.
37 */
38
39#include <stdio.h>
40#include <ctype.h>
41#include <string.h>
42#include <stdarg.h>
43#include <stdlib.h>
44#include <assert.h>
45
46#include "windef.h"
47#include "winbase.h"
48#include "wine/debug.h"
49
50#include "editor.h"
51#include "rtf.h"
52
54
55static int _RTFGetChar(RTF_Info *);
56static void _RTFGetToken (RTF_Info *);
57static void _RTFGetToken2 (RTF_Info *);
58static int GetChar (RTF_Info *);
59static void ReadFontTbl (RTF_Info *);
60static void ReadColorTbl (RTF_Info *);
61static void ReadStyleSheet (RTF_Info *);
62static void ReadInfoGroup (RTF_Info *);
63static void ReadPictGroup (RTF_Info *);
64static void ReadObjGroup (RTF_Info *);
65static void Lookup (RTF_Info *, char *);
66static int Hash (const char *);
67
68static void CharAttr(RTF_Info *info);
69static void CharSet(RTF_Info *info);
70static void DocAttr(RTF_Info *info);
71
73static void RTFPutCodePageChar(RTF_Info *info, int c);
74
75/* ---------------------------------------------------------------------- */
76
77
79{
80 int ch;
81 ME_InStream *stream = info->stream;
82
83 if (stream->dwSize <= stream->dwUsed)
84 {
86 /* if error, it's EOF */
87 if (stream->editstream->dwError)
88 return EOF;
89 /* if no bytes read, it's EOF */
90 if (stream->dwSize == 0)
91 return EOF;
92 }
93 ch = (unsigned char)stream->buffer[stream->dwUsed++];
94 if (!ch)
95 return ' ';
96 return ch;
97}
98
100{
101 info->stream = stream;
102}
103
104static void
106{
107 RTFColor *cp;
108 RTFFont *fp;
109 RTFStyle *sp;
110 RTFStyleElt *eltList, *ep;
111
112 while (info->fontList)
113 {
114 fp = info->fontList->rtfNextFont;
115 free (info->fontList->rtfFName);
116 free (info->fontList);
117 info->fontList = fp;
118 }
119 while (info->colorList)
120 {
121 cp = info->colorList->rtfNextColor;
122 free (info->colorList);
123 info->colorList = cp;
124 }
125 while (info->styleList)
126 {
127 sp = info->styleList->rtfNextStyle;
128 eltList = info->styleList->rtfSSEList;
129 while (eltList)
130 {
131 ep = eltList->rtfNextSE;
132 free (eltList->rtfSEText);
133 free (eltList);
134 eltList = ep;
135 }
136 free (info->styleList->rtfSName);
137 free (info->styleList);
138 info->styleList = sp;
139 }
140}
141
142
143void
145{
146 if (info->rtfTextBuf)
147 {
148 free(info->rtfTextBuf);
149 free(info->pushedTextBuf);
150 }
152 free(info->cpOutputBuffer);
153 while (info->tableDef)
154 {
155 RTFTable *tableDef = info->tableDef;
156 info->tableDef = tableDef->parent;
157 free(tableDef);
158 }
159}
160
161
162
163/* ---------------------------------------------------------------------- */
164
165/*
166 * Callback table manipulation routines
167 */
168
169
170/*
171 * Install or return a writer callback for a token class
172 */
173
175{
176 if (class >= 0 && class < rtfMaxClass)
177 info->ccb[class] = callback;
178}
179
180
182{
183 if (class >= 0 && class < rtfMaxClass)
184 return info->ccb[class];
185 return NULL;
186}
187
188
189/*
190 * Initialize the reader. This may be called multiple times,
191 * to read multiple files. The only thing not reset is the input
192 * stream; that must be done with RTFSetStream().
193 */
194
196{
197 int i;
198
199 if (info->rtfTextBuf == NULL) /* initialize the text buffers */
200 {
201 info->rtfTextBuf = malloc (rtfBufSiz);
202 info->pushedTextBuf = malloc (rtfBufSiz);
203 if (info->rtfTextBuf == NULL || info->pushedTextBuf == NULL) {
204 ERR ("Cannot allocate text buffers.\n");
205 return;
206 }
207 info->rtfTextBuf[0] = info->pushedTextBuf[0] = '\0';
208 }
209
210 for (i = 0; i < rtfMaxClass; i++)
212 for (i = 0; i < rtfMaxDestination; i++)
214
215 /* install built-in destination readers */
222
223
225
226 /* dump old lists if necessary */
227
229
230 info->ansiCodePage = 1252; /* Latin-1; actually unused */
231 info->unicodeLength = 1; /* \uc1 is the default */
232 info->codePage = info->ansiCodePage;
233 info->defFont = 0;
234
235 info->rtfClass = -1;
236 info->pushedClass = -1;
237 info->pushedChar = EOF;
238
239 info->rtfLineNum = 0;
240 info->rtfLinePos = 0;
241 info->prevChar = EOF;
242 info->bumpLine = FALSE;
243
244 info->dwCPOutputCount = 0;
245 if (!info->cpOutputBuffer)
246 {
247 info->dwMaxCPOutputCount = 0x1000;
248 info->cpOutputBuffer = malloc (info->dwMaxCPOutputCount);
249 }
250
251 info->tableDef = NULL;
252 info->nestingLevel = 0;
253 info->canInheritInTbl = FALSE;
254 info->borderType = 0;
255
256 memset(&info->fmt, 0, sizeof(info->fmt));
257 info->fmt.cbSize = sizeof(info->fmt);
258}
259
260/*
261 * Install or return a writer callback for a destination type
262 */
263
265{
266 if (dest >= 0 && dest < rtfMaxDestination)
267 info->dcb[dest] = callback;
268}
269
270
272{
273 if (dest >= 0 && dest < rtfMaxDestination)
274 return info->dcb[dest];
275 return NULL;
276}
277
278
279/* ---------------------------------------------------------------------- */
280
281/*
282 * Token reading routines
283 */
284
285
286/*
287 * Read the input stream, invoking the writer's callbacks
288 * where appropriate.
289 */
290
292{
293 while (RTFGetToken (info) != rtfEOF)
295}
296
297
298/*
299 * Route a token. If it's a destination for which a reader is
300 * installed, process the destination internally, otherwise
301 * pass the token to the writer's class callback.
302 */
303
305{
307
308 if (info->rtfClass < 0 || info->rtfClass >= rtfMaxClass) /* watchdog */
309 {
310 ERR( "Unknown class %d: %s (reader malfunction)\n",
311 info->rtfClass, info->rtfTextBuf);
312 }
314 {
315 /* invoke destination-specific callback if there is one */
316 p = RTFGetDestinationCallback (info, info->rtfMinor);
317 if (p != NULL)
318 {
319 (*p) (info);
320 return;
321 }
322 }
323 /* invoke class callback if there is one */
324 p = RTFGetClassCallback (info, info->rtfClass);
325 if (p != NULL)
326 (*p) (info);
327}
328
329
330/*
331 * Skip to the end of the current group. When this returns,
332 * writers that maintain a state stack may want to call their
333 * state unstacker; global vars will still be set to the group's
334 * closing brace.
335 */
336
338{
339 int level = 1;
340
341 while (RTFGetToken (info) != rtfEOF)
342 {
343 if (info->rtfClass == rtfGroup)
344 {
345 if (info->rtfMajor == rtfBeginGroup)
346 ++level;
347 else if (info->rtfMajor == rtfEndGroup)
348 {
349 if (--level < 1)
350 break; /* end of initial group */
351 }
352 }
353 }
354}
355
356/*
357 * Do no special processing on the group.
358 *
359 * This acts as a placeholder for a callback in order to indicate that it
360 * shouldn't be ignored. Instead it will fallback on the loop in RTFRead.
361 */
363{
364}
365
366
367/*
368 * Install or return a token reader hook.
369 */
370
372{
373 info->readHook = f;
374}
375
376
378{
379 return (info->readHook);
380}
381
382
383/*
384 * Read one token. Call the read hook if there is one. The
385 * token class is the return value. Returns rtfEOF when there
386 * are no more tokens.
387 */
388
390{
392
393 /* don't try to return anything once EOF is reached */
394 if (info->rtfClass == rtfEOF) {
395 return rtfEOF;
396 }
397
398 for (;;)
399 {
402 if (p != NULL)
403 (*p) (info); /* give read hook a look at token */
404
405 /* Silently discard newlines, carriage returns, nulls. */
406 if (!(info->rtfClass == rtfText && info->rtfFormat != SF_TEXT
407 && (info->rtfMajor == '\r' || info->rtfMajor == '\n' || info->rtfMajor == '\0')))
408 break;
409 }
410 return (info->rtfClass);
411}
412
413
415{
416 if (info->pushedClass >= 0) /* there's already an ungotten token */
417 ERR ("cannot unget two tokens\n");
418 if (info->rtfClass < 0)
419 ERR ("no token to unget\n");
420 info->pushedClass = info->rtfClass;
421 info->pushedMajor = info->rtfMajor;
422 info->pushedMinor = info->rtfMinor;
423 info->pushedParam = info->rtfParam;
424 lstrcpyA (info->pushedTextBuf, info->rtfTextBuf);
425 /* The read hook decrements stackTop on rtfEndGroup, so
426 * increment the value to compensate for it being decremented
427 * twice due to the RTFUngetToken. */
429 {
430 info->stack[info->stackTop].style = info->style;
431 ME_AddRefStyle(info->style);
432 info->stackTop++;
433 }
434}
435
436
438{
439 if (info->rtfFormat == SF_TEXT)
440 {
441 info->rtfMajor = GetChar (info);
442 info->rtfMinor = 0;
443 info->rtfParam = rtfNoParam;
444 info->rtfTextBuf[info->rtfTextLen = 0] = '\0';
445 if (info->rtfMajor == EOF)
446 info->rtfClass = rtfEOF;
447 else
448 info->rtfClass = rtfText;
449 return;
450 }
451
452 /* first check for pushed token from RTFUngetToken() */
453
454 if (info->pushedClass >= 0)
455 {
456 info->rtfClass = info->pushedClass;
457 info->rtfMajor = info->pushedMajor;
458 info->rtfMinor = info->pushedMinor;
459 info->rtfParam = info->pushedParam;
460 lstrcpyA (info->rtfTextBuf, info->pushedTextBuf);
461 info->rtfTextLen = lstrlenA(info->rtfTextBuf);
462 info->pushedClass = -1;
463 return;
464 }
465
466 /*
467 * Beyond this point, no token is ever seen twice, which is
468 * important, e.g., for making sure no "}" pops the font stack twice.
469 */
470
472}
473
474
475int
477{
478 switch (charset)
479 {
480 case ANSI_CHARSET:
481 return 1252;
482 case DEFAULT_CHARSET:
483 return CP_ACP;
484 case SYMBOL_CHARSET:
485 return CP_SYMBOL;
486 case MAC_CHARSET:
487 return CP_MACCP;
488 case SHIFTJIS_CHARSET:
489 return 932;
490 case HANGEUL_CHARSET:
491 return 949;
492 case JOHAB_CHARSET:
493 return 1361;
494 case GB2312_CHARSET:
495 return 936;
497 return 950;
498 case GREEK_CHARSET:
499 return 1253;
500 case TURKISH_CHARSET:
501 return 1254;
503 return 1258;
504 case HEBREW_CHARSET:
505 return 1255;
506 case ARABIC_CHARSET:
507 return 1256;
508 case BALTIC_CHARSET:
509 return 1257;
510 case RUSSIAN_CHARSET:
511 return 1251;
512 case THAI_CHARSET:
513 return 874;
515 return 1250;
516 case OEM_CHARSET:
517 return CP_OEMCP;
518 default:
519 {
520 CHARSETINFO csi;
521 DWORD n = charset;
522
523 /* FIXME: TranslateCharsetInfo does not work as good as it
524 * should, so let's use it only when all else fails */
526 ERR("unknown charset %d\n", charset);
527 else
528 return csi.ciACP;
529 }
530 }
531 return 0;
532}
533
534
535/* this shouldn't be called anywhere but from _RTFGetToken() */
536
538{
539 int sign;
540 int c;
541
542 /* initialize token vars */
543
544 info->rtfClass = rtfUnknown;
545 info->rtfParam = rtfNoParam;
546 info->rtfTextBuf[info->rtfTextLen = 0] = '\0';
547
548 /* get first character, which may be a pushback from previous token */
549
550 if (info->pushedChar != EOF)
551 {
552 c = info->pushedChar;
553 info->rtfTextBuf[info->rtfTextLen++] = c;
554 info->rtfTextBuf[info->rtfTextLen] = '\0';
555 info->pushedChar = EOF;
556 }
557 else if ((c = GetChar (info)) == EOF)
558 {
559 info->rtfClass = rtfEOF;
560 return;
561 }
562
563 if (c == '{')
564 {
565 info->rtfClass = rtfGroup;
566 info->rtfMajor = rtfBeginGroup;
567 return;
568 }
569 if (c == '}')
570 {
571 info->rtfClass = rtfGroup;
572 info->rtfMajor = rtfEndGroup;
573 return;
574 }
575 if (c != '\\')
576 {
577 /*
578 * Two possibilities here:
579 * 1) ASCII 9, effectively like \tab control symbol
580 * 2) literal text char
581 */
582 if (c == '\t') /* ASCII 9 */
583 {
584 info->rtfClass = rtfControl;
585 info->rtfMajor = rtfSpecialChar;
586 info->rtfMinor = rtfTab;
587 }
588 else
589 {
590 info->rtfClass = rtfText;
591 info->rtfMajor = c;
592 }
593 return;
594 }
595 if ((c = GetChar (info)) == EOF)
596 {
597 /* early eof, whoops (class is rtfUnknown) */
598 return;
599 }
600 if (!isalpha (c))
601 {
602 /*
603 * Three possibilities here:
604 * 1) hex encoded text char, e.g., \'d5, \'d3
605 * 2) special escaped text char, e.g., \{, \}
606 * 3) control symbol, e.g., \_, \-, \|, <10>
607 */
608 if (c == '\'') /* hex char */
609 {
610 int c2;
611
612 if ((c = GetChar (info)) != EOF && (c2 = GetChar (info)) != EOF
613 && isxdigit(c) && isxdigit(c2))
614 {
615 info->rtfClass = rtfText;
616 info->rtfMajor = RTFCharToHex (c) * 16 + RTFCharToHex (c2);
617 return;
618 }
619 /* early eof, whoops */
620 info->rtfClass = rtfEOF;
621 info->stream->editstream->dwError = -14;
622 return;
623 }
624
625 /* escaped char */
626 /*if (index (":{}\\", c) != NULL)*/ /* escaped char */
627 if (c == ':' || c == '{' || c == '}' || c == '\\')
628 {
629 info->rtfClass = rtfText;
630 info->rtfMajor = c;
631 return;
632 }
633
634 /* control symbol */
635 Lookup (info, info->rtfTextBuf); /* sets class, major, minor */
636 return;
637 }
638 /* control word */
639 while (isalpha (c))
640 {
641 if ((c = GetChar (info)) == EOF)
642 break;
643 }
644
645 /*
646 * At this point, the control word is all collected, so the
647 * major/minor numbers are determined before the parameter
648 * (if any) is scanned. There will be one too many characters
649 * in the buffer, though, so fix up before and restore after
650 * looking up.
651 */
652
653 if (c != EOF)
654 info->rtfTextBuf[info->rtfTextLen-1] = '\0';
655 Lookup (info, info->rtfTextBuf); /* sets class, major, minor */
656 if (c != EOF)
657 info->rtfTextBuf[info->rtfTextLen-1] = c;
658
659 /*
660 * Should be looking at first digit of parameter if there
661 * is one, unless it's negative. In that case, next char
662 * is '-', so need to gobble next char, and remember sign.
663 */
664
665 sign = 1;
666 if (c == '-')
667 {
668 sign = -1;
669 c = GetChar (info);
670 }
671 if (c != EOF && isdigit (c))
672 {
673 info->rtfParam = 0;
674 while (isdigit (c)) /* gobble parameter */
675 {
676 info->rtfParam = info->rtfParam * 10 + c - '0';
677 if ((c = GetChar (info)) == EOF)
678 break;
679 }
680 info->rtfParam *= sign;
681 }
682 /*
683 * If control symbol delimiter was a blank, gobble it.
684 * Otherwise the character is first char of next token, so
685 * push it back for next call. In either case, delete the
686 * delimiter from the token buffer.
687 */
688 if (c != EOF)
689 {
690 if (c != ' ')
691 info->pushedChar = c;
692 info->rtfTextBuf[--info->rtfTextLen] = '\0';
693 }
694}
695
696
697/*
698 * Read the next character from the input. This handles setting the
699 * current line and position-within-line variables. Those variables are
700 * set correctly whether lines end with CR, LF, or CRLF (the last being
701 * the tricky case).
702 *
703 * bumpLine indicates whether the line number should be incremented on
704 * the *next* input character.
705 */
706
707
709{
710 int c;
711 BOOL oldBumpLine;
712
713 if ((c = _RTFGetChar(info)) != EOF)
714 {
715 info->rtfTextBuf[info->rtfTextLen++] = c;
716 info->rtfTextBuf[info->rtfTextLen] = '\0';
717 }
718 if (info->prevChar == EOF)
719 info->bumpLine = TRUE;
720 oldBumpLine = info->bumpLine; /* TRUE if prev char was line ending */
721 info->bumpLine = FALSE;
722 if (c == '\r')
723 info->bumpLine = TRUE;
724 else if (c == '\n')
725 {
726 info->bumpLine = TRUE;
727 if (info->prevChar == '\r') /* oops, previous \r wasn't */
728 oldBumpLine = FALSE; /* really a line ending */
729 }
730 ++info->rtfLinePos;
731 if (oldBumpLine) /* were we supposed to increment the */
732 { /* line count on this char? */
733 ++info->rtfLineNum;
734 info->rtfLinePos = 1;
735 }
736 info->prevChar = c;
737 return (c);
738}
739
740
741/* ---------------------------------------------------------------------- */
742
743/*
744 * Special destination readers. They gobble the destination so the
745 * writer doesn't have to deal with them. That's wrong for any
746 * translator that wants to process any of these itself. In that
747 * case, these readers should be overridden by installing a different
748 * destination callback.
749 *
750 * NOTE: The last token read by each of these reader will be the
751 * destination's terminating '}', which will then be the current token.
752 * That '}' token is passed to RTFRouteToken() - the writer has already
753 * seen the '{' that began the destination group, and may have pushed a
754 * state; it also needs to know at the end of the group that a state
755 * should be popped.
756 *
757 * It's important that rtf.h and the control token lookup table list
758 * as many symbols as possible, because these destination readers
759 * unfortunately make strict assumptions about the input they expect,
760 * and a token of class rtfUnknown will throw them off easily.
761 */
762
763
764/*
765 * Read { \fonttbl ... } destination. Old font tables don't have
766 * braces around each table entry; try to adjust for that.
767 */
768
770{
771 RTFFont *fp = NULL;
772 char buf[rtfBufSiz], *bp;
773 int old = -1;
774
775 for (;;)
776 {
778 if (info->rtfClass == rtfEOF)
779 break;
781 break;
782 if (old < 0) /* first entry - determine tbl type */
783 {
785 old = 1; /* no brace */
787 old = 0; /* brace */
788 else /* can't tell! */
789 ERR ("cannot determine format\n");
790 }
791 if (old == 0) /* need to find "{" here */
792 {
794 ERR ("missing \"{\"\n");
795 RTFGetToken (info); /* yes, skip to next token */
796 if (info->rtfClass == rtfEOF)
797 break;
798 }
799 fp = malloc (sizeof(*fp));
800 if (fp == NULL) {
801 ERR ("cannot allocate font entry\n");
802 break;
803 }
804
805 fp->rtfNextFont = info->fontList;
806 info->fontList = fp;
807
808 fp->rtfFName = NULL;
809 fp->rtfFAltName = NULL;
810 fp->rtfFNum = -1;
812 fp->rtfFCharSet = DEFAULT_CHARSET; /* 1 */
814 fp->rtfFType = 0;
815 fp->rtfFCodePage = CP_ACP;
816
817 while (info->rtfClass != rtfEOF
818 && !RTFCheckCM (info, rtfText, ';')
820 {
821 if (info->rtfClass == rtfControl)
822 {
823 switch (info->rtfMajor)
824 {
825 default:
826 /* ignore token but announce it */
827 WARN ("unknown token \"%s\"\n",
828 info->rtfTextBuf);
829 break;
830 case rtfFontFamily:
831 fp->rtfFFamily = info->rtfMinor;
832 break;
833 case rtfCharAttr:
834 switch (info->rtfMinor)
835 {
836 default:
837 break; /* ignore unknown? */
838 case rtfFontNum:
839 fp->rtfFNum = info->rtfParam;
840 break;
841 }
842 break;
843 case rtfFontAttr:
844 switch (info->rtfMinor)
845 {
846 default:
847 break; /* ignore unknown? */
848 case rtfFontCharSet:
849 fp->rtfFCharSet = info->rtfParam;
850 if (!fp->rtfFCodePage)
851 fp->rtfFCodePage = RTFCharSetToCodePage(info, info->rtfParam);
852 break;
853 case rtfFontPitch:
854 fp->rtfFPitch = info->rtfParam;
855 break;
856 case rtfFontCodePage:
857 fp->rtfFCodePage = info->rtfParam;
858 break;
859 case rtfFTypeNil:
860 case rtfFTypeTrueType:
861 fp->rtfFType = info->rtfParam;
862 break;
863 }
864 break;
865 }
866 }
867 else if (RTFCheckCM (info, rtfGroup, rtfBeginGroup)) /* dest */
868 {
869 RTFSkipGroup (info); /* ignore for now */
870 }
871 else if (info->rtfClass == rtfText) /* font name */
872 {
873 bp = buf;
874 while (info->rtfClass == rtfText
875 && !RTFCheckCM (info, rtfText, ';'))
876 {
877 *bp++ = info->rtfMajor;
879 }
880
881 /* FIX: in some cases the <fontinfo> isn't finished with a semi-column */
883 {
885 }
886 *bp = '\0';
887 fp->rtfFName = strdup (buf);
888 if (fp->rtfFName == NULL)
889 ERR ("cannot allocate font name\n");
890 /* already have next token; don't read one */
891 /* at bottom of loop */
892 continue;
893 }
894 else
895 {
896 /* ignore token but announce it */
897 WARN ("unknown token \"%s\"\n", info->rtfTextBuf);
898 }
900 if (info->rtfClass == rtfEOF)
901 break;
902 }
903 if (info->rtfClass == rtfEOF)
904 break;
905 if (old == 0) /* need to see "}" here */
906 {
909 ERR ("missing \"}\"\n");
910 if (info->rtfClass == rtfEOF)
911 break;
912 }
913
914 /* Apply the real properties of the default font */
915 if (fp->rtfFNum == info->defFont)
916 {
917 if (info->ansiCodePage != CP_UTF8)
918 info->codePage = fp->rtfFCodePage;
919 TRACE("default font codepage %d\n", info->codePage);
920 }
921 }
922 if (!fp || (fp->rtfFNum == -1))
923 ERR("missing font number\n");
924/*
925 * Could check other pieces of structure here, too, I suppose.
926 */
927 RTFRouteToken (info); /* feed "}" back to router */
928
929 /* Set default font */
930 info->rtfClass = rtfControl;
931 info->rtfMajor = rtfCharAttr;
932 info->rtfMinor = rtfFontNum;
933 info->rtfParam = info->defFont;
934 lstrcpyA(info->rtfTextBuf, "f");
936}
937
938
939/*
940 * The color table entries have color values of -1 if
941 * the default color should be used for the entry (only
942 * a semi-colon is given in the definition, no color values).
943 * There will be a problem if a partial entry (1 or 2 but
944 * not 3 color values) is given. The possibility is ignored
945 * here.
946 */
947
949{
950 RTFColor *cp;
951 int cnum = 0;
952 int group_level = 1;
953
954 for (;;)
955 {
957 if (info->rtfClass == rtfEOF)
958 break;
960 {
961 group_level--;
962 if (!group_level)
963 break;
964 continue;
965 }
967 {
968 group_level++;
969 continue;
970 }
971
972 cp = malloc (sizeof(*cp));
973 if (cp == NULL) {
974 ERR ("cannot allocate color entry\n");
975 break;
976 }
977 cp->rtfCNum = cnum++;
978 cp->rtfNextColor = info->colorList;
979 info->colorList = cp;
981 cp->rtfCRed = cp->rtfCGreen = cp->rtfCBlue = -1;
982 else {
983 cp->rtfCRed = cp->rtfCGreen = cp->rtfCBlue = 0;
984 do {
985 switch (info->rtfMinor)
986 {
987 case rtfRed: cp->rtfCRed = info->rtfParam & 0xFF; break;
988 case rtfGreen: cp->rtfCGreen = info->rtfParam & 0xFF; break;
989 case rtfBlue: cp->rtfCBlue = info->rtfParam & 0xFF; break;
990 }
993 }
994 if (info->rtfClass == rtfEOF)
995 break;
996 if (!RTFCheckCM (info, rtfText, ';'))
997 ERR ("malformed entry\n");
998 }
999 RTFRouteToken (info); /* feed "}" back to router */
1000}
1001
1002
1003/*
1004 * The "Normal" style definition doesn't contain any style number,
1005 * all others do. Normal style is given style rtfNormalStyleNum.
1006 */
1007
1009{
1010 RTFStyle *sp;
1011 RTFStyleElt *sep, *sepLast;
1012 char buf[rtfBufSiz], *bp;
1013 int real_style;
1014
1015 for (;;)
1016 {
1017 RTFGetToken (info);
1018 if (info->rtfClass == rtfEOF)
1019 break;
1021 break;
1022 sp = malloc (sizeof(*sp));
1023 if (sp == NULL) {
1024 ERR ("cannot allocate stylesheet entry\n");
1025 break;
1026 }
1027 sp->rtfSName = NULL;
1028 sp->rtfSNum = -1;
1029 sp->rtfSType = rtfParStyle;
1030 sp->rtfSAdditive = 0;
1031 sp->rtfSBasedOn = rtfNoStyleNum;
1032 sp->rtfSNextPar = -1;
1033 sp->rtfSSEList = sepLast = NULL;
1034 sp->rtfNextStyle = info->styleList;
1035 sp->rtfExpanding = 0;
1036 info->styleList = sp;
1038 ERR ("missing \"{\"\n");
1039 real_style = TRUE;
1040 for (;;)
1041 {
1042 RTFGetToken (info);
1043 if (info->rtfClass == rtfEOF
1044 || RTFCheckCM (info, rtfText, ';'))
1045 break;
1046 if (info->rtfClass == rtfControl)
1047 {
1050 ERR("skipping optional destination\n");
1052 info->rtfClass = rtfGroup;
1053 info->rtfMajor = rtfEndGroup;
1054 real_style = FALSE;
1055 break; /* ignore "\*" */
1056 }
1058 {
1059 sp->rtfSNum = info->rtfParam;
1060 sp->rtfSType = rtfParStyle;
1061 continue;
1062 }
1064 {
1065 sp->rtfSNum = info->rtfParam;
1066 sp->rtfSType = rtfCharStyle;
1067 continue;
1068 }
1070 {
1071 sp->rtfSNum = info->rtfParam;
1072 sp->rtfSType = rtfSectStyle;
1073 continue;
1074 }
1076 {
1077 sp->rtfSBasedOn = info->rtfParam;
1078 continue;
1079 }
1081 {
1082 sp->rtfSAdditive = 1;
1083 continue;
1084 }
1086 {
1087 sp->rtfSNextPar = info->rtfParam;
1088 continue;
1089 }
1090 sep = malloc (sizeof(*sep));
1091 if (sep == NULL)
1092 {
1093 ERR ("cannot allocate style element\n");
1094 break;
1095 }
1096 sep->rtfSEClass = info->rtfClass;
1097 sep->rtfSEMajor = info->rtfMajor;
1098 sep->rtfSEMinor = info->rtfMinor;
1099 sep->rtfSEParam = info->rtfParam;
1100 sep->rtfSEText = strdup (info->rtfTextBuf);
1101 if (sep->rtfSEText == NULL)
1102 ERR ("cannot allocate style element text\n");
1103 if (sepLast == NULL)
1104 sp->rtfSSEList = sep; /* first element */
1105 else /* add to end */
1106 sepLast->rtfNextSE = sep;
1107 sep->rtfNextSE = NULL;
1108 sepLast = sep;
1109 }
1111 {
1112 /*
1113 * This passes over "{\*\keycode ... }, among
1114 * other things. A temporary (perhaps) hack.
1115 */
1116 ERR("skipping begin\n");
1118 continue;
1119 }
1120 else if (info->rtfClass == rtfText) /* style name */
1121 {
1122 bp = buf;
1123 while (info->rtfClass == rtfText)
1124 {
1125 if (info->rtfMajor == ';')
1126 {
1127 /* put back for "for" loop */
1129 break;
1130 }
1131 *bp++ = info->rtfMajor;
1132 RTFGetToken (info);
1133 }
1134 *bp = '\0';
1135 sp->rtfSName = strdup (buf);
1136 if (sp->rtfSName == NULL)
1137 ERR ("cannot allocate style name\n");
1138 }
1139 else /* unrecognized */
1140 {
1141 /* ignore token but announce it */
1142 WARN ("unknown token \"%s\"\n", info->rtfTextBuf);
1143 }
1144 }
1145 if (real_style) {
1146 RTFGetToken (info);
1148 ERR ("missing \"}\"\n");
1149 /*
1150 * Check over the style structure. A name is a must.
1151 * If no style number was specified, check whether it's the
1152 * Normal style (in which case it's given style number
1153 * rtfNormalStyleNum). Note that some "normal" style names
1154 * just begin with "Normal" and can have other stuff following,
1155 * e.g., "Normal,Times 10 point". Ugh.
1156 *
1157 * Some German RTF writers use "Standard" instead of "Normal".
1158 */
1159 if (sp->rtfSName == NULL)
1160 ERR ("missing style name\n");
1161 if (sp->rtfSNum < 0)
1162 {
1163 if (strncmp (buf, "Normal", 6) != 0
1164 && strncmp (buf, "Standard", 8) != 0)
1165 ERR ("missing style number\n");
1166 sp->rtfSNum = rtfNormalStyleNum;
1167 }
1168 if (sp->rtfSNextPar == -1) /* if \snext not given, */
1169 sp->rtfSNextPar = sp->rtfSNum; /* next is itself */
1170 }
1171 /* otherwise we're just dealing with fake end group from skipped group */
1172 }
1173 RTFRouteToken (info); /* feed "}" back to router */
1174}
1175
1176
1178{
1180 RTFRouteToken (info); /* feed "}" back to router */
1181}
1182
1183
1185{
1187 RTFRouteToken (info); /* feed "}" back to router */
1188}
1189
1190
1192{
1194 RTFRouteToken (info); /* feed "}" back to router */
1195}
1196
1197
1198/* ---------------------------------------------------------------------- */
1199
1200/*
1201 * Routines to return pieces of stylesheet, or font or color tables.
1202 * References to style 0 are mapped onto the Normal style.
1203 */
1204
1206{
1207 RTFFont *f;
1208
1209 if (num == -1)
1210 return (info->fontList);
1211 for (f = info->fontList; f != NULL; f = f->rtfNextFont)
1212 {
1213 if (f->rtfFNum == num)
1214 break;
1215 }
1216 return (f); /* NULL if not found */
1217}
1218
1219
1221{
1222 RTFColor *c;
1223
1224 if (num == -1)
1225 return (info->colorList);
1226 for (c = info->colorList; c != NULL; c = c->rtfNextColor)
1227 {
1228 if (c->rtfCNum == num)
1229 break;
1230 }
1231 return (c); /* NULL if not found */
1232}
1233
1234
1235/* ---------------------------------------------------------------------- */
1236
1237/*
1238 * Control symbol lookup routines
1239 */
1240
1241
1242typedef struct RTFKey RTFKey;
1243
1245{
1246 int rtfKMajor; /* major number */
1247 int rtfKMinor; /* minor number */
1248 const char *rtfKStr; /* symbol name */
1249 int rtfKHash; /* symbol name hash value */
1250};
1251
1252/*
1253 * A minor number of -1 means the token has no minor number
1254 * (all valid minor numbers are >= 0).
1255 */
1256
1257static RTFKey rtfKey[] =
1258{
1259 /*
1260 * Special characters
1261 */
1262
1263 { rtfSpecialChar, rtfIIntVersion, "vern", 0 },
1264 { rtfSpecialChar, rtfICreateTime, "creatim", 0 },
1265 { rtfSpecialChar, rtfIRevisionTime, "revtim", 0 },
1266 { rtfSpecialChar, rtfIPrintTime, "printim", 0 },
1267 { rtfSpecialChar, rtfIBackupTime, "buptim", 0 },
1268 { rtfSpecialChar, rtfIEditTime, "edmins", 0 },
1269 { rtfSpecialChar, rtfIYear, "yr", 0 },
1270 { rtfSpecialChar, rtfIMonth, "mo", 0 },
1271 { rtfSpecialChar, rtfIDay, "dy", 0 },
1272 { rtfSpecialChar, rtfIHour, "hr", 0 },
1273 { rtfSpecialChar, rtfIMinute, "min", 0 },
1274 { rtfSpecialChar, rtfISecond, "sec", 0 },
1275 { rtfSpecialChar, rtfINPages, "nofpages", 0 },
1276 { rtfSpecialChar, rtfINWords, "nofwords", 0 },
1277 { rtfSpecialChar, rtfINChars, "nofchars", 0 },
1278 { rtfSpecialChar, rtfIIntID, "id", 0 },
1279
1280 { rtfSpecialChar, rtfCurHeadDate, "chdate", 0 },
1281 { rtfSpecialChar, rtfCurHeadDateLong, "chdpl", 0 },
1282 { rtfSpecialChar, rtfCurHeadDateAbbrev, "chdpa", 0 },
1283 { rtfSpecialChar, rtfCurHeadTime, "chtime", 0 },
1284 { rtfSpecialChar, rtfCurHeadPage, "chpgn", 0 },
1285 { rtfSpecialChar, rtfSectNum, "sectnum", 0 },
1286 { rtfSpecialChar, rtfCurFNote, "chftn", 0 },
1287 { rtfSpecialChar, rtfCurAnnotRef, "chatn", 0 },
1288 { rtfSpecialChar, rtfFNoteSep, "chftnsep", 0 },
1289 { rtfSpecialChar, rtfFNoteCont, "chftnsepc", 0 },
1290 { rtfSpecialChar, rtfCell, "cell", 0 },
1291 { rtfSpecialChar, rtfRow, "row", 0 },
1292 { rtfSpecialChar, rtfPar, "par", 0 },
1293 /* newline and carriage return are synonyms for */
1294 /* \par when they are preceded by a \ character */
1295 { rtfSpecialChar, rtfPar, "\n", 0 },
1296 { rtfSpecialChar, rtfPar, "\r", 0 },
1297 { rtfSpecialChar, rtfSect, "sect", 0 },
1298 { rtfSpecialChar, rtfPage, "page", 0 },
1299 { rtfSpecialChar, rtfColumn, "column", 0 },
1300 { rtfSpecialChar, rtfLine, "line", 0 },
1301 { rtfSpecialChar, rtfSoftPage, "softpage", 0 },
1302 { rtfSpecialChar, rtfSoftColumn, "softcol", 0 },
1303 { rtfSpecialChar, rtfSoftLine, "softline", 0 },
1304 { rtfSpecialChar, rtfSoftLineHt, "softlheight", 0 },
1305 { rtfSpecialChar, rtfTab, "tab", 0 },
1306 { rtfSpecialChar, rtfEmDash, "emdash", 0 },
1307 { rtfSpecialChar, rtfEnDash, "endash", 0 },
1308 { rtfSpecialChar, rtfEmSpace, "emspace", 0 },
1309 { rtfSpecialChar, rtfEnSpace, "enspace", 0 },
1310 { rtfSpecialChar, rtfBullet, "bullet", 0 },
1311 { rtfSpecialChar, rtfLQuote, "lquote", 0 },
1312 { rtfSpecialChar, rtfRQuote, "rquote", 0 },
1313 { rtfSpecialChar, rtfLDblQuote, "ldblquote", 0 },
1314 { rtfSpecialChar, rtfRDblQuote, "rdblquote", 0 },
1315 { rtfSpecialChar, rtfFormula, "|", 0 },
1316 { rtfSpecialChar, rtfNoBrkSpace, "~", 0 },
1317 { rtfSpecialChar, rtfNoReqHyphen, "-", 0 },
1318 { rtfSpecialChar, rtfNoBrkHyphen, "_", 0 },
1319 { rtfSpecialChar, rtfOptDest, "*", 0 },
1320 { rtfSpecialChar, rtfLTRMark, "ltrmark", 0 },
1321 { rtfSpecialChar, rtfRTLMark, "rtlmark", 0 },
1322 { rtfSpecialChar, rtfNoWidthJoiner, "zwj", 0 },
1323 { rtfSpecialChar, rtfNoWidthNonJoiner, "zwnj", 0 },
1324 /* is this valid? */
1325 { rtfSpecialChar, rtfCurHeadPict, "chpict", 0 },
1326 { rtfSpecialChar, rtfUnicode, "u", 0 },
1327 { rtfSpecialChar, rtfNestCell, "nestcell", 0 },
1328 { rtfSpecialChar, rtfNestRow, "nestrow", 0 },
1329
1330 /*
1331 * Character formatting attributes
1332 */
1333
1334 { rtfCharAttr, rtfPlain, "plain", 0 },
1335 { rtfCharAttr, rtfBold, "b", 0 },
1336 { rtfCharAttr, rtfAllCaps, "caps", 0 },
1337 { rtfCharAttr, rtfDeleted, "deleted", 0 },
1338 { rtfCharAttr, rtfSubScript, "dn", 0 },
1339 { rtfCharAttr, rtfSubScrShrink, "sub", 0 },
1340 { rtfCharAttr, rtfNoSuperSub, "nosupersub", 0 },
1341 { rtfCharAttr, rtfExpand, "expnd", 0 },
1342 { rtfCharAttr, rtfExpandTwips, "expndtw", 0 },
1343 { rtfCharAttr, rtfKerning, "kerning", 0 },
1344 { rtfCharAttr, rtfFontNum, "f", 0 },
1345 { rtfCharAttr, rtfFontSize, "fs", 0 },
1346 { rtfCharAttr, rtfItalic, "i", 0 },
1347 { rtfCharAttr, rtfOutline, "outl", 0 },
1348 { rtfCharAttr, rtfRevised, "revised", 0 },
1349 { rtfCharAttr, rtfRevAuthor, "revauth", 0 },
1350 { rtfCharAttr, rtfRevDTTM, "revdttm", 0 },
1351 { rtfCharAttr, rtfSmallCaps, "scaps", 0 },
1352 { rtfCharAttr, rtfShadow, "shad", 0 },
1353 { rtfCharAttr, rtfStrikeThru, "strike", 0 },
1354 { rtfCharAttr, rtfUnderline, "ul", 0 },
1355 { rtfCharAttr, rtfDotUnderline, "uld", 0 },
1356 { rtfCharAttr, rtfDbUnderline, "uldb", 0 },
1357 { rtfCharAttr, rtfNoUnderline, "ulnone", 0 },
1358 { rtfCharAttr, rtfWordUnderline, "ulw", 0 },
1359 { rtfCharAttr, rtfSuperScript, "up", 0 },
1360 { rtfCharAttr, rtfSuperScrShrink, "super", 0 },
1361 { rtfCharAttr, rtfInvisible, "v", 0 },
1362 { rtfCharAttr, rtfForeColor, "cf", 0 },
1363 { rtfCharAttr, rtfBackColor, "highlight", 0 },
1364 { rtfCharAttr, rtfRTLChar, "rtlch", 0 },
1365 { rtfCharAttr, rtfLTRChar, "ltrch", 0 },
1366 { rtfCharAttr, rtfCharStyleNum, "cs", 0 },
1367 { rtfCharAttr, rtfCharCharSet, "cchs", 0 },
1368 { rtfCharAttr, rtfLanguage, "lang", 0 },
1369 /* this has disappeared from spec 1.2 */
1370 { rtfCharAttr, rtfGray, "gray", 0 },
1371 { rtfCharAttr, rtfUnicodeLength, "uc", 0 },
1372
1373 /*
1374 * Paragraph formatting attributes
1375 */
1376
1377 { rtfParAttr, rtfParDef, "pard", 0 },
1378 { rtfParAttr, rtfStyleNum, "s", 0 },
1379 { rtfParAttr, rtfHyphenate, "hyphpar", 0 },
1380 { rtfParAttr, rtfInTable, "intbl", 0 },
1381 { rtfParAttr, rtfKeep, "keep", 0 },
1382 { rtfParAttr, rtfNoWidowControl, "nowidctlpar", 0 },
1383 { rtfParAttr, rtfKeepNext, "keepn", 0 },
1384 { rtfParAttr, rtfOutlineLevel, "level", 0 },
1385 { rtfParAttr, rtfNoLineNum, "noline", 0 },
1386 { rtfParAttr, rtfPBBefore, "pagebb", 0 },
1387 { rtfParAttr, rtfSideBySide, "sbys", 0 },
1388 { rtfParAttr, rtfQuadLeft, "ql", 0 },
1389 { rtfParAttr, rtfQuadRight, "qr", 0 },
1390 { rtfParAttr, rtfQuadJust, "qj", 0 },
1391 { rtfParAttr, rtfQuadCenter, "qc", 0 },
1392 { rtfParAttr, rtfFirstIndent, "fi", 0 },
1393 { rtfParAttr, rtfLeftIndent, "li", 0 },
1394 { rtfParAttr, rtfRightIndent, "ri", 0 },
1395 { rtfParAttr, rtfSpaceBefore, "sb", 0 },
1396 { rtfParAttr, rtfSpaceAfter, "sa", 0 },
1397 { rtfParAttr, rtfSpaceBetween, "sl", 0 },
1398 { rtfParAttr, rtfSpaceMultiply, "slmult", 0 },
1399
1400 { rtfParAttr, rtfSubDocument, "subdocument", 0 },
1401
1402 { rtfParAttr, rtfRTLPar, "rtlpar", 0 },
1403 { rtfParAttr, rtfLTRPar, "ltrpar", 0 },
1404
1405 { rtfParAttr, rtfTabPos, "tx", 0 },
1406 /*
1407 * FrameMaker writes \tql (to mean left-justified tab, apparently)
1408 * although it's not in the spec. It's also redundant, since lj
1409 * tabs are the default.
1410 */
1411 { rtfParAttr, rtfTabLeft, "tql", 0 },
1412 { rtfParAttr, rtfTabRight, "tqr", 0 },
1413 { rtfParAttr, rtfTabCenter, "tqc", 0 },
1414 { rtfParAttr, rtfTabDecimal, "tqdec", 0 },
1415 { rtfParAttr, rtfTabBar, "tb", 0 },
1416 { rtfParAttr, rtfLeaderDot, "tldot", 0 },
1417 { rtfParAttr, rtfLeaderHyphen, "tlhyph", 0 },
1418 { rtfParAttr, rtfLeaderUnder, "tlul", 0 },
1419 { rtfParAttr, rtfLeaderThick, "tlth", 0 },
1420 { rtfParAttr, rtfLeaderEqual, "tleq", 0 },
1421
1422 { rtfParAttr, rtfParLevel, "pnlvl", 0 },
1423 { rtfParAttr, rtfParBullet, "pnlvlblt", 0 },
1424 { rtfParAttr, rtfParSimple, "pnlvlbody", 0 },
1425 { rtfParAttr, rtfParNumCont, "pnlvlcont", 0 },
1426 { rtfParAttr, rtfParNumOnce, "pnnumonce", 0 },
1427 { rtfParAttr, rtfParNumAcross, "pnacross", 0 },
1428 { rtfParAttr, rtfParHangIndent, "pnhang", 0 },
1429 { rtfParAttr, rtfParNumRestart, "pnrestart", 0 },
1430 { rtfParAttr, rtfParNumCardinal, "pncard", 0 },
1431 { rtfParAttr, rtfParNumDecimal, "pndec", 0 },
1432 { rtfParAttr, rtfParNumULetter, "pnucltr", 0 },
1433 { rtfParAttr, rtfParNumURoman, "pnucrm", 0 },
1434 { rtfParAttr, rtfParNumLLetter, "pnlcltr", 0 },
1435 { rtfParAttr, rtfParNumLRoman, "pnlcrm", 0 },
1436 { rtfParAttr, rtfParNumOrdinal, "pnord", 0 },
1437 { rtfParAttr, rtfParNumOrdinalText, "pnordt", 0 },
1438 { rtfParAttr, rtfParNumBold, "pnb", 0 },
1439 { rtfParAttr, rtfParNumItalic, "pni", 0 },
1440 { rtfParAttr, rtfParNumAllCaps, "pncaps", 0 },
1441 { rtfParAttr, rtfParNumSmallCaps, "pnscaps", 0 },
1442 { rtfParAttr, rtfParNumUnder, "pnul", 0 },
1443 { rtfParAttr, rtfParNumDotUnder, "pnuld", 0 },
1444 { rtfParAttr, rtfParNumDbUnder, "pnuldb", 0 },
1445 { rtfParAttr, rtfParNumNoUnder, "pnulnone", 0 },
1446 { rtfParAttr, rtfParNumWordUnder, "pnulw", 0 },
1447 { rtfParAttr, rtfParNumStrikethru, "pnstrike", 0 },
1448 { rtfParAttr, rtfParNumForeColor, "pncf", 0 },
1449 { rtfParAttr, rtfParNumFont, "pnf", 0 },
1450 { rtfParAttr, rtfParNumFontSize, "pnfs", 0 },
1451 { rtfParAttr, rtfParNumIndent, "pnindent", 0 },
1452 { rtfParAttr, rtfParNumSpacing, "pnsp", 0 },
1453 { rtfParAttr, rtfParNumInclPrev, "pnprev", 0 },
1454 { rtfParAttr, rtfParNumCenter, "pnqc", 0 },
1455 { rtfParAttr, rtfParNumLeft, "pnql", 0 },
1456 { rtfParAttr, rtfParNumRight, "pnqr", 0 },
1457 { rtfParAttr, rtfParNumStartAt, "pnstart", 0 },
1458
1459 { rtfParAttr, rtfBorderTop, "brdrt", 0 },
1460 { rtfParAttr, rtfBorderBottom, "brdrb", 0 },
1461 { rtfParAttr, rtfBorderLeft, "brdrl", 0 },
1462 { rtfParAttr, rtfBorderRight, "brdrr", 0 },
1463 { rtfParAttr, rtfBorderBetween, "brdrbtw", 0 },
1464 { rtfParAttr, rtfBorderBar, "brdrbar", 0 },
1465 { rtfParAttr, rtfBorderBox, "box", 0 },
1466 { rtfParAttr, rtfBorderSingle, "brdrs", 0 },
1467 { rtfParAttr, rtfBorderThick, "brdrth", 0 },
1468 { rtfParAttr, rtfBorderShadow, "brdrsh", 0 },
1469 { rtfParAttr, rtfBorderDouble, "brdrdb", 0 },
1470 { rtfParAttr, rtfBorderDot, "brdrdot", 0 },
1471 { rtfParAttr, rtfBorderDot, "brdrdash", 0 },
1472 { rtfParAttr, rtfBorderHair, "brdrhair", 0 },
1473 { rtfParAttr, rtfBorderWidth, "brdrw", 0 },
1474 { rtfParAttr, rtfBorderColor, "brdrcf", 0 },
1475 { rtfParAttr, rtfBorderSpace, "brsp", 0 },
1476
1477 { rtfParAttr, rtfShading, "shading", 0 },
1478 { rtfParAttr, rtfBgPatH, "bghoriz", 0 },
1479 { rtfParAttr, rtfBgPatV, "bgvert", 0 },
1480 { rtfParAttr, rtfFwdDiagBgPat, "bgfdiag", 0 },
1481 { rtfParAttr, rtfBwdDiagBgPat, "bgbdiag", 0 },
1482 { rtfParAttr, rtfHatchBgPat, "bgcross", 0 },
1483 { rtfParAttr, rtfDiagHatchBgPat, "bgdcross", 0 },
1484 { rtfParAttr, rtfDarkBgPatH, "bgdkhoriz", 0 },
1485 { rtfParAttr, rtfDarkBgPatV, "bgdkvert", 0 },
1486 { rtfParAttr, rtfFwdDarkBgPat, "bgdkfdiag", 0 },
1487 { rtfParAttr, rtfBwdDarkBgPat, "bgdkbdiag", 0 },
1488 { rtfParAttr, rtfDarkHatchBgPat, "bgdkcross", 0 },
1489 { rtfParAttr, rtfDarkDiagHatchBgPat, "bgdkdcross", 0 },
1490 { rtfParAttr, rtfBgPatLineColor, "cfpat", 0 },
1491 { rtfParAttr, rtfBgPatColor, "cbpat", 0 },
1492 { rtfParAttr, rtfNestLevel, "itap", 0 },
1493
1494 /*
1495 * Section formatting attributes
1496 */
1497
1498 { rtfSectAttr, rtfSectDef, "sectd", 0 },
1499 { rtfSectAttr, rtfENoteHere, "endnhere", 0 },
1500 { rtfSectAttr, rtfPrtBinFirst, "binfsxn", 0 },
1501 { rtfSectAttr, rtfPrtBin, "binsxn", 0 },
1502 { rtfSectAttr, rtfSectStyleNum, "ds", 0 },
1503
1504 { rtfSectAttr, rtfNoBreak, "sbknone", 0 },
1505 { rtfSectAttr, rtfColBreak, "sbkcol", 0 },
1506 { rtfSectAttr, rtfPageBreak, "sbkpage", 0 },
1507 { rtfSectAttr, rtfEvenBreak, "sbkeven", 0 },
1508 { rtfSectAttr, rtfOddBreak, "sbkodd", 0 },
1509
1510 { rtfSectAttr, rtfColumns, "cols", 0 },
1511 { rtfSectAttr, rtfColumnSpace, "colsx", 0 },
1512 { rtfSectAttr, rtfColumnNumber, "colno", 0 },
1513 { rtfSectAttr, rtfColumnSpRight, "colsr", 0 },
1514 { rtfSectAttr, rtfColumnWidth, "colw", 0 },
1515 { rtfSectAttr, rtfColumnLine, "linebetcol", 0 },
1516
1517 { rtfSectAttr, rtfLineModulus, "linemod", 0 },
1518 { rtfSectAttr, rtfLineDist, "linex", 0 },
1519 { rtfSectAttr, rtfLineStarts, "linestarts", 0 },
1520 { rtfSectAttr, rtfLineRestart, "linerestart", 0 },
1521 { rtfSectAttr, rtfLineRestartPg, "lineppage", 0 },
1522 { rtfSectAttr, rtfLineCont, "linecont", 0 },
1523
1524 { rtfSectAttr, rtfSectPageWid, "pgwsxn", 0 },
1525 { rtfSectAttr, rtfSectPageHt, "pghsxn", 0 },
1526 { rtfSectAttr, rtfSectMarginLeft, "marglsxn", 0 },
1527 { rtfSectAttr, rtfSectMarginRight, "margrsxn", 0 },
1528 { rtfSectAttr, rtfSectMarginTop, "margtsxn", 0 },
1529 { rtfSectAttr, rtfSectMarginBottom, "margbsxn", 0 },
1530 { rtfSectAttr, rtfSectMarginGutter, "guttersxn", 0 },
1531 { rtfSectAttr, rtfSectLandscape, "lndscpsxn", 0 },
1532 { rtfSectAttr, rtfTitleSpecial, "titlepg", 0 },
1533 { rtfSectAttr, rtfHeaderY, "headery", 0 },
1534 { rtfSectAttr, rtfFooterY, "footery", 0 },
1535
1536 { rtfSectAttr, rtfPageStarts, "pgnstarts", 0 },
1537 { rtfSectAttr, rtfPageCont, "pgncont", 0 },
1538 { rtfSectAttr, rtfPageRestart, "pgnrestart", 0 },
1539 { rtfSectAttr, rtfPageNumRight, "pgnx", 0 },
1540 { rtfSectAttr, rtfPageNumTop, "pgny", 0 },
1541 { rtfSectAttr, rtfPageDecimal, "pgndec", 0 },
1542 { rtfSectAttr, rtfPageURoman, "pgnucrm", 0 },
1543 { rtfSectAttr, rtfPageLRoman, "pgnlcrm", 0 },
1544 { rtfSectAttr, rtfPageULetter, "pgnucltr", 0 },
1545 { rtfSectAttr, rtfPageLLetter, "pgnlcltr", 0 },
1546 { rtfSectAttr, rtfPageNumHyphSep, "pgnhnsh", 0 },
1547 { rtfSectAttr, rtfPageNumSpaceSep, "pgnhnsp", 0 },
1548 { rtfSectAttr, rtfPageNumColonSep, "pgnhnsc", 0 },
1549 { rtfSectAttr, rtfPageNumEmdashSep, "pgnhnsm", 0 },
1550 { rtfSectAttr, rtfPageNumEndashSep, "pgnhnsn", 0 },
1551
1552 { rtfSectAttr, rtfTopVAlign, "vertalt", 0 },
1553 /* misspelled as "vertal" in specification 1.0 */
1554 { rtfSectAttr, rtfBottomVAlign, "vertalb", 0 },
1555 { rtfSectAttr, rtfCenterVAlign, "vertalc", 0 },
1556 { rtfSectAttr, rtfJustVAlign, "vertalj", 0 },
1557
1558 { rtfSectAttr, rtfRTLSect, "rtlsect", 0 },
1559 { rtfSectAttr, rtfLTRSect, "ltrsect", 0 },
1560
1561 /* I've seen these in an old spec, but not in real files... */
1562 /*rtfSectAttr, rtfNoBreak, "nobreak", 0,*/
1563 /*rtfSectAttr, rtfColBreak, "colbreak", 0,*/
1564 /*rtfSectAttr, rtfPageBreak, "pagebreak", 0,*/
1565 /*rtfSectAttr, rtfEvenBreak, "evenbreak", 0,*/
1566 /*rtfSectAttr, rtfOddBreak, "oddbreak", 0,*/
1567
1568 /*
1569 * Document formatting attributes
1570 */
1571
1572 { rtfDocAttr, rtfDefTab, "deftab", 0 },
1573 { rtfDocAttr, rtfHyphHotZone, "hyphhotz", 0 },
1574 { rtfDocAttr, rtfHyphConsecLines, "hyphconsec", 0 },
1575 { rtfDocAttr, rtfHyphCaps, "hyphcaps", 0 },
1576 { rtfDocAttr, rtfHyphAuto, "hyphauto", 0 },
1577 { rtfDocAttr, rtfLineStart, "linestart", 0 },
1578 { rtfDocAttr, rtfFracWidth, "fracwidth", 0 },
1579 /* \makeback was given in old version of spec, it's now */
1580 /* listed as \makebackup */
1581 { rtfDocAttr, rtfMakeBackup, "makeback", 0 },
1582 { rtfDocAttr, rtfMakeBackup, "makebackup", 0 },
1583 { rtfDocAttr, rtfRTFDefault, "defformat", 0 },
1584 { rtfDocAttr, rtfPSOverlay, "psover", 0 },
1585 { rtfDocAttr, rtfDocTemplate, "doctemp", 0 },
1586 { rtfDocAttr, rtfDefLanguage, "deflang", 0 },
1587
1588 { rtfDocAttr, rtfFENoteType, "fet", 0 },
1589 { rtfDocAttr, rtfFNoteEndSect, "endnotes", 0 },
1590 { rtfDocAttr, rtfFNoteEndDoc, "enddoc", 0 },
1591 { rtfDocAttr, rtfFNoteText, "ftntj", 0 },
1592 { rtfDocAttr, rtfFNoteBottom, "ftnbj", 0 },
1593 { rtfDocAttr, rtfENoteEndSect, "aendnotes", 0 },
1594 { rtfDocAttr, rtfENoteEndDoc, "aenddoc", 0 },
1595 { rtfDocAttr, rtfENoteText, "aftntj", 0 },
1596 { rtfDocAttr, rtfENoteBottom, "aftnbj", 0 },
1597 { rtfDocAttr, rtfFNoteStart, "ftnstart", 0 },
1598 { rtfDocAttr, rtfENoteStart, "aftnstart", 0 },
1599 { rtfDocAttr, rtfFNoteRestartPage, "ftnrstpg", 0 },
1600 { rtfDocAttr, rtfFNoteRestart, "ftnrestart", 0 },
1601 { rtfDocAttr, rtfFNoteRestartCont, "ftnrstcont", 0 },
1602 { rtfDocAttr, rtfENoteRestart, "aftnrestart", 0 },
1603 { rtfDocAttr, rtfENoteRestartCont, "aftnrstcont", 0 },
1604 { rtfDocAttr, rtfFNoteNumArabic, "ftnnar", 0 },
1605 { rtfDocAttr, rtfFNoteNumLLetter, "ftnnalc", 0 },
1606 { rtfDocAttr, rtfFNoteNumULetter, "ftnnauc", 0 },
1607 { rtfDocAttr, rtfFNoteNumLRoman, "ftnnrlc", 0 },
1608 { rtfDocAttr, rtfFNoteNumURoman, "ftnnruc", 0 },
1609 { rtfDocAttr, rtfFNoteNumChicago, "ftnnchi", 0 },
1610 { rtfDocAttr, rtfENoteNumArabic, "aftnnar", 0 },
1611 { rtfDocAttr, rtfENoteNumLLetter, "aftnnalc", 0 },
1612 { rtfDocAttr, rtfENoteNumULetter, "aftnnauc", 0 },
1613 { rtfDocAttr, rtfENoteNumLRoman, "aftnnrlc", 0 },
1614 { rtfDocAttr, rtfENoteNumURoman, "aftnnruc", 0 },
1615 { rtfDocAttr, rtfENoteNumChicago, "aftnnchi", 0 },
1616
1617 { rtfDocAttr, rtfPaperWidth, "paperw", 0 },
1618 { rtfDocAttr, rtfPaperHeight, "paperh", 0 },
1619 { rtfDocAttr, rtfPaperSize, "psz", 0 },
1620 { rtfDocAttr, rtfLeftMargin, "margl", 0 },
1621 { rtfDocAttr, rtfRightMargin, "margr", 0 },
1622 { rtfDocAttr, rtfTopMargin, "margt", 0 },
1623 { rtfDocAttr, rtfBottomMargin, "margb", 0 },
1624 { rtfDocAttr, rtfFacingPage, "facingp", 0 },
1625 { rtfDocAttr, rtfGutterWid, "gutter", 0 },
1626 { rtfDocAttr, rtfMirrorMargin, "margmirror", 0 },
1627 { rtfDocAttr, rtfLandscape, "landscape", 0 },
1628 { rtfDocAttr, rtfPageStart, "pgnstart", 0 },
1629 { rtfDocAttr, rtfWidowCtrl, "widowctrl", 0 },
1630
1631 { rtfDocAttr, rtfLinkStyles, "linkstyles", 0 },
1632
1633 { rtfDocAttr, rtfNoAutoTabIndent, "notabind", 0 },
1634 { rtfDocAttr, rtfWrapSpaces, "wraptrsp", 0 },
1635 { rtfDocAttr, rtfPrintColorsBlack, "prcolbl", 0 },
1636 { rtfDocAttr, rtfNoExtraSpaceRL, "noextrasprl", 0 },
1637 { rtfDocAttr, rtfNoColumnBalance, "nocolbal", 0 },
1638 { rtfDocAttr, rtfCvtMailMergeQuote, "cvmme", 0 },
1639 { rtfDocAttr, rtfSuppressTopSpace, "sprstsp", 0 },
1640 { rtfDocAttr, rtfSuppressPreParSpace, "sprsspbf", 0 },
1641 { rtfDocAttr, rtfCombineTblBorders, "otblrul", 0 },
1642 { rtfDocAttr, rtfTranspMetafiles, "transmf", 0 },
1643 { rtfDocAttr, rtfSwapBorders, "swpbdr", 0 },
1644 { rtfDocAttr, rtfShowHardBreaks, "brkfrm", 0 },
1645
1646 { rtfDocAttr, rtfFormProtected, "formprot", 0 },
1647 { rtfDocAttr, rtfAllProtected, "allprot", 0 },
1648 { rtfDocAttr, rtfFormShading, "formshade", 0 },
1649 { rtfDocAttr, rtfFormDisplay, "formdisp", 0 },
1650 { rtfDocAttr, rtfPrintData, "printdata", 0 },
1651
1652 { rtfDocAttr, rtfRevProtected, "revprot", 0 },
1653 { rtfDocAttr, rtfRevisions, "revisions", 0 },
1654 { rtfDocAttr, rtfRevDisplay, "revprop", 0 },
1655 { rtfDocAttr, rtfRevBar, "revbar", 0 },
1656
1657 { rtfDocAttr, rtfAnnotProtected, "annotprot", 0 },
1658
1659 { rtfDocAttr, rtfRTLDoc, "rtldoc", 0 },
1660 { rtfDocAttr, rtfLTRDoc, "ltrdoc", 0 },
1661
1662 { rtfDocAttr, rtfAnsiCodePage, "ansicpg", 0 },
1663 { rtfDocAttr, rtfUTF8RTF, "urtf", 0 },
1664
1665 /*
1666 * Style attributes
1667 */
1668
1669 { rtfStyleAttr, rtfAdditive, "additive", 0 },
1670 { rtfStyleAttr, rtfBasedOn, "sbasedon", 0 },
1671 { rtfStyleAttr, rtfNext, "snext", 0 },
1672
1673 /*
1674 * Picture attributes
1675 */
1676
1677 { rtfPictAttr, rtfMacQD, "macpict", 0 },
1678 { rtfPictAttr, rtfPMMetafile, "pmmetafile", 0 },
1679 { rtfPictAttr, rtfWinMetafile, "wmetafile", 0 },
1680 { rtfPictAttr, rtfDevIndBitmap, "dibitmap", 0 },
1681 { rtfPictAttr, rtfWinBitmap, "wbitmap", 0 },
1682 { rtfPictAttr, rtfEmfBlip, "emfblip", 0 },
1683 { rtfPictAttr, rtfPixelBits, "wbmbitspixel", 0 },
1684 { rtfPictAttr, rtfBitmapPlanes, "wbmplanes", 0 },
1685 { rtfPictAttr, rtfBitmapWid, "wbmwidthbytes", 0 },
1686
1687 { rtfPictAttr, rtfPicWid, "picw", 0 },
1688 { rtfPictAttr, rtfPicHt, "pich", 0 },
1689 { rtfPictAttr, rtfPicGoalWid, "picwgoal", 0 },
1690 { rtfPictAttr, rtfPicGoalHt, "pichgoal", 0 },
1691 /* these two aren't in the spec, but some writers emit them */
1692 { rtfPictAttr, rtfPicGoalWid, "picwGoal", 0 },
1693 { rtfPictAttr, rtfPicGoalHt, "pichGoal", 0 },
1694 { rtfPictAttr, rtfPicScaleX, "picscalex", 0 },
1695 { rtfPictAttr, rtfPicScaleY, "picscaley", 0 },
1696 { rtfPictAttr, rtfPicScaled, "picscaled", 0 },
1697 { rtfPictAttr, rtfPicCropTop, "piccropt", 0 },
1698 { rtfPictAttr, rtfPicCropBottom, "piccropb", 0 },
1699 { rtfPictAttr, rtfPicCropLeft, "piccropl", 0 },
1700 { rtfPictAttr, rtfPicCropRight, "piccropr", 0 },
1701
1702 { rtfPictAttr, rtfPicMFHasBitmap, "picbmp", 0 },
1703 { rtfPictAttr, rtfPicMFBitsPerPixel, "picbpp", 0 },
1704
1705 { rtfPictAttr, rtfPicBinary, "bin", 0 },
1706
1707 /*
1708 * NeXT graphic attributes
1709 */
1710
1711 { rtfNeXTGrAttr, rtfNeXTGWidth, "width", 0 },
1712 { rtfNeXTGrAttr, rtfNeXTGHeight, "height", 0 },
1713
1714 /*
1715 * Destinations
1716 */
1717
1718 { rtfDestination, rtfFontTbl, "fonttbl", 0 },
1719 { rtfDestination, rtfFontAltName, "falt", 0 },
1720 { rtfDestination, rtfEmbeddedFont, "fonteb", 0 },
1721 { rtfDestination, rtfFontFile, "fontfile", 0 },
1722 { rtfDestination, rtfFileTbl, "filetbl", 0 },
1723 { rtfDestination, rtfFileInfo, "file", 0 },
1724 { rtfDestination, rtfColorTbl, "colortbl", 0 },
1725 { rtfDestination, rtfStyleSheet, "stylesheet", 0 },
1726 { rtfDestination, rtfKeyCode, "keycode", 0 },
1727 { rtfDestination, rtfRevisionTbl, "revtbl", 0 },
1728 { rtfDestination, rtfGenerator, "generator", 0 },
1729 { rtfDestination, rtfInfo, "info", 0 },
1730 { rtfDestination, rtfITitle, "title", 0 },
1731 { rtfDestination, rtfISubject, "subject", 0 },
1732 { rtfDestination, rtfIAuthor, "author", 0 },
1733 { rtfDestination, rtfIOperator, "operator", 0 },
1734 { rtfDestination, rtfIKeywords, "keywords", 0 },
1735 { rtfDestination, rtfIComment, "comment", 0 },
1736 { rtfDestination, rtfIVersion, "version", 0 },
1737 { rtfDestination, rtfIDoccomm, "doccomm", 0 },
1738 /* \verscomm may not exist -- was seen in earlier spec version */
1739 { rtfDestination, rtfIVerscomm, "verscomm", 0 },
1740 { rtfDestination, rtfNextFile, "nextfile", 0 },
1741 { rtfDestination, rtfTemplate, "template", 0 },
1742 { rtfDestination, rtfFNSep, "ftnsep", 0 },
1743 { rtfDestination, rtfFNContSep, "ftnsepc", 0 },
1744 { rtfDestination, rtfFNContNotice, "ftncn", 0 },
1745 { rtfDestination, rtfENSep, "aftnsep", 0 },
1746 { rtfDestination, rtfENContSep, "aftnsepc", 0 },
1747 { rtfDestination, rtfENContNotice, "aftncn", 0 },
1748 { rtfDestination, rtfPageNumLevel, "pgnhn", 0 },
1749 { rtfDestination, rtfParNumLevelStyle, "pnseclvl", 0 },
1750 { rtfDestination, rtfHeader, "header", 0 },
1751 { rtfDestination, rtfFooter, "footer", 0 },
1752 { rtfDestination, rtfHeaderLeft, "headerl", 0 },
1753 { rtfDestination, rtfHeaderRight, "headerr", 0 },
1754 { rtfDestination, rtfHeaderFirst, "headerf", 0 },
1755 { rtfDestination, rtfFooterLeft, "footerl", 0 },
1756 { rtfDestination, rtfFooterRight, "footerr", 0 },
1757 { rtfDestination, rtfFooterFirst, "footerf", 0 },
1758 { rtfDestination, rtfParNumText, "pntext", 0 },
1759 { rtfDestination, rtfParNumbering, "pn", 0 },
1760 { rtfDestination, rtfParNumTextAfter, "pntxta", 0 },
1761 { rtfDestination, rtfParNumTextBefore, "pntxtb", 0 },
1762 { rtfDestination, rtfBookmarkStart, "bkmkstart", 0 },
1763 { rtfDestination, rtfBookmarkEnd, "bkmkend", 0 },
1764 { rtfDestination, rtfPict, "pict", 0 },
1765 { rtfDestination, rtfObject, "object", 0 },
1766 { rtfDestination, rtfObjClass, "objclass", 0 },
1767 { rtfDestination, rtfObjName, "objname", 0 },
1768 { rtfObjAttr, rtfObjTime, "objtime", 0 },
1769 { rtfDestination, rtfObjData, "objdata", 0 },
1770 { rtfDestination, rtfObjAlias, "objalias", 0 },
1771 { rtfDestination, rtfObjSection, "objsect", 0 },
1772 /* objitem and objtopic aren't documented in the spec! */
1773 { rtfDestination, rtfObjItem, "objitem", 0 },
1774 { rtfDestination, rtfObjTopic, "objtopic", 0 },
1775 { rtfDestination, rtfObjResult, "result", 0 },
1776 { rtfDestination, rtfDrawObject, "do", 0 },
1777 { rtfDestination, rtfFootnote, "footnote", 0 },
1778 { rtfDestination, rtfAnnotRefStart, "atrfstart", 0 },
1779 { rtfDestination, rtfAnnotRefEnd, "atrfend", 0 },
1780 { rtfDestination, rtfAnnotID, "atnid", 0 },
1781 { rtfDestination, rtfAnnotAuthor, "atnauthor", 0 },
1782 { rtfDestination, rtfAnnotation, "annotation", 0 },
1783 { rtfDestination, rtfAnnotRef, "atnref", 0 },
1784 { rtfDestination, rtfAnnotTime, "atntime", 0 },
1785 { rtfDestination, rtfAnnotIcon, "atnicn", 0 },
1786 { rtfDestination, rtfField, "field", 0 },
1787 { rtfDestination, rtfFieldInst, "fldinst", 0 },
1788 { rtfDestination, rtfFieldResult, "fldrslt", 0 },
1789 { rtfDestination, rtfDataField, "datafield", 0 },
1790 { rtfDestination, rtfIndex, "xe", 0 },
1791 { rtfDestination, rtfIndexText, "txe", 0 },
1792 { rtfDestination, rtfIndexRange, "rxe", 0 },
1793 { rtfDestination, rtfTOC, "tc", 0 },
1794 { rtfDestination, rtfNeXTGraphic, "NeXTGraphic", 0 },
1795 { rtfDestination, rtfNestTableProps, "nesttableprops", 0 },
1796 { rtfDestination, rtfNoNestTables, "nonesttables", 0 },
1797 { rtfDestination, rtfShpPict, "shppict", 0 },
1798 { rtfDestination, rtfNonShpPict, "nonshppict", 0 },
1799
1800 /*
1801 * Font families
1802 */
1803
1804 { rtfFontFamily, rtfFFNil, "fnil", 0 },
1805 { rtfFontFamily, rtfFFRoman, "froman", 0 },
1806 { rtfFontFamily, rtfFFSwiss, "fswiss", 0 },
1807 { rtfFontFamily, rtfFFModern, "fmodern", 0 },
1808 { rtfFontFamily, rtfFFScript, "fscript", 0 },
1809 { rtfFontFamily, rtfFFDecor, "fdecor", 0 },
1810 { rtfFontFamily, rtfFFTech, "ftech", 0 },
1811 { rtfFontFamily, rtfFFBidirectional, "fbidi", 0 },
1812
1813 /*
1814 * Font attributes
1815 */
1816
1817 { rtfFontAttr, rtfFontCharSet, "fcharset", 0 },
1818 { rtfFontAttr, rtfFontPitch, "fprq", 0 },
1819 { rtfFontAttr, rtfFontCodePage, "cpg", 0 },
1820 { rtfFontAttr, rtfFTypeNil, "ftnil", 0 },
1821 { rtfFontAttr, rtfFTypeTrueType, "fttruetype", 0 },
1822
1823 /*
1824 * File table attributes
1825 */
1826
1827 { rtfFileAttr, rtfFileNum, "fid", 0 },
1828 { rtfFileAttr, rtfFileRelPath, "frelative", 0 },
1829 { rtfFileAttr, rtfFileOSNum, "fosnum", 0 },
1830
1831 /*
1832 * File sources
1833 */
1834
1835 { rtfFileSource, rtfSrcMacintosh, "fvalidmac", 0 },
1836 { rtfFileSource, rtfSrcDOS, "fvaliddos", 0 },
1837 { rtfFileSource, rtfSrcNTFS, "fvalidntfs", 0 },
1838 { rtfFileSource, rtfSrcHPFS, "fvalidhpfs", 0 },
1839 { rtfFileSource, rtfSrcNetwork, "fnetwork", 0 },
1840
1841 /*
1842 * Color names
1843 */
1844
1845 { rtfColorName, rtfRed, "red", 0 },
1846 { rtfColorName, rtfGreen, "green", 0 },
1847 { rtfColorName, rtfBlue, "blue", 0 },
1848
1849 /*
1850 * Charset names
1851 */
1852
1853 { rtfCharSet, rtfMacCharSet, "mac", 0 },
1854 { rtfCharSet, rtfAnsiCharSet, "ansi", 0 },
1855 { rtfCharSet, rtfPcCharSet, "pc", 0 },
1856 { rtfCharSet, rtfPcaCharSet, "pca", 0 },
1857
1858 /*
1859 * Table attributes
1860 */
1861
1862 { rtfTblAttr, rtfRowDef, "trowd", 0 },
1863 { rtfTblAttr, rtfRowGapH, "trgaph", 0 },
1864 { rtfTblAttr, rtfCellPos, "cellx", 0 },
1865 { rtfTblAttr, rtfMergeRngFirst, "clmgf", 0 },
1866 { rtfTblAttr, rtfMergePrevious, "clmrg", 0 },
1867
1868 { rtfTblAttr, rtfRowLeft, "trql", 0 },
1869 { rtfTblAttr, rtfRowRight, "trqr", 0 },
1870 { rtfTblAttr, rtfRowCenter, "trqc", 0 },
1871 { rtfTblAttr, rtfRowLeftEdge, "trleft", 0 },
1872 { rtfTblAttr, rtfRowHt, "trrh", 0 },
1873 { rtfTblAttr, rtfRowHeader, "trhdr", 0 },
1874 { rtfTblAttr, rtfRowKeep, "trkeep", 0 },
1875
1876 { rtfTblAttr, rtfRTLRow, "rtlrow", 0 },
1877 { rtfTblAttr, rtfLTRRow, "ltrrow", 0 },
1878
1879 { rtfTblAttr, rtfRowBordTop, "trbrdrt", 0 },
1880 { rtfTblAttr, rtfRowBordLeft, "trbrdrl", 0 },
1881 { rtfTblAttr, rtfRowBordBottom, "trbrdrb", 0 },
1882 { rtfTblAttr, rtfRowBordRight, "trbrdrr", 0 },
1883 { rtfTblAttr, rtfRowBordHoriz, "trbrdrh", 0 },
1884 { rtfTblAttr, rtfRowBordVert, "trbrdrv", 0 },
1885
1886 { rtfTblAttr, rtfCellBordBottom, "clbrdrb", 0 },
1887 { rtfTblAttr, rtfCellBordTop, "clbrdrt", 0 },
1888 { rtfTblAttr, rtfCellBordLeft, "clbrdrl", 0 },
1889 { rtfTblAttr, rtfCellBordRight, "clbrdrr", 0 },
1890
1891 { rtfTblAttr, rtfCellShading, "clshdng", 0 },
1892 { rtfTblAttr, rtfCellBgPatH, "clbghoriz", 0 },
1893 { rtfTblAttr, rtfCellBgPatV, "clbgvert", 0 },
1894 { rtfTblAttr, rtfCellFwdDiagBgPat, "clbgfdiag", 0 },
1895 { rtfTblAttr, rtfCellBwdDiagBgPat, "clbgbdiag", 0 },
1896 { rtfTblAttr, rtfCellHatchBgPat, "clbgcross", 0 },
1897 { rtfTblAttr, rtfCellDiagHatchBgPat, "clbgdcross", 0 },
1898 /*
1899 * The spec lists "clbgdkhor", but the corresponding non-cell
1900 * control is "bgdkhoriz". At any rate Macintosh Word seems
1901 * to accept both "clbgdkhor" and "clbgdkhoriz".
1902 */
1903 { rtfTblAttr, rtfCellDarkBgPatH, "clbgdkhoriz", 0 },
1904 { rtfTblAttr, rtfCellDarkBgPatH, "clbgdkhor", 0 },
1905 { rtfTblAttr, rtfCellDarkBgPatV, "clbgdkvert", 0 },
1906 { rtfTblAttr, rtfCellFwdDarkBgPat, "clbgdkfdiag", 0 },
1907 { rtfTblAttr, rtfCellBwdDarkBgPat, "clbgdkbdiag", 0 },
1908 { rtfTblAttr, rtfCellDarkHatchBgPat, "clbgdkcross", 0 },
1909 { rtfTblAttr, rtfCellDarkDiagHatchBgPat, "clbgdkdcross", 0 },
1910 { rtfTblAttr, rtfCellBgPatLineColor, "clcfpat", 0 },
1911 { rtfTblAttr, rtfCellBgPatColor, "clcbpat", 0 },
1912
1913 /*
1914 * Field attributes
1915 */
1916
1917 { rtfFieldAttr, rtfFieldDirty, "flddirty", 0 },
1918 { rtfFieldAttr, rtfFieldEdited, "fldedit", 0 },
1919 { rtfFieldAttr, rtfFieldLocked, "fldlock", 0 },
1920 { rtfFieldAttr, rtfFieldPrivate, "fldpriv", 0 },
1921 { rtfFieldAttr, rtfFieldAlt, "fldalt", 0 },
1922
1923 /*
1924 * Positioning attributes
1925 */
1926
1927 { rtfPosAttr, rtfAbsWid, "absw", 0 },
1928 { rtfPosAttr, rtfAbsHt, "absh", 0 },
1929
1930 { rtfPosAttr, rtfRPosMargH, "phmrg", 0 },
1931 { rtfPosAttr, rtfRPosPageH, "phpg", 0 },
1932 { rtfPosAttr, rtfRPosColH, "phcol", 0 },
1933 { rtfPosAttr, rtfPosX, "posx", 0 },
1934 { rtfPosAttr, rtfPosNegX, "posnegx", 0 },
1935 { rtfPosAttr, rtfPosXCenter, "posxc", 0 },
1936 { rtfPosAttr, rtfPosXInside, "posxi", 0 },
1937 { rtfPosAttr, rtfPosXOutSide, "posxo", 0 },
1938 { rtfPosAttr, rtfPosXRight, "posxr", 0 },
1939 { rtfPosAttr, rtfPosXLeft, "posxl", 0 },
1940
1941 { rtfPosAttr, rtfRPosMargV, "pvmrg", 0 },
1942 { rtfPosAttr, rtfRPosPageV, "pvpg", 0 },
1943 { rtfPosAttr, rtfRPosParaV, "pvpara", 0 },
1944 { rtfPosAttr, rtfPosY, "posy", 0 },
1945 { rtfPosAttr, rtfPosNegY, "posnegy", 0 },
1946 { rtfPosAttr, rtfPosYInline, "posyil", 0 },
1947 { rtfPosAttr, rtfPosYTop, "posyt", 0 },
1948 { rtfPosAttr, rtfPosYCenter, "posyc", 0 },
1949 { rtfPosAttr, rtfPosYBottom, "posyb", 0 },
1950
1951 { rtfPosAttr, rtfNoWrap, "nowrap", 0 },
1952 { rtfPosAttr, rtfDistFromTextAll, "dxfrtext", 0 },
1953 { rtfPosAttr, rtfDistFromTextX, "dfrmtxtx", 0 },
1954 { rtfPosAttr, rtfDistFromTextY, "dfrmtxty", 0 },
1955 /* \dyfrtext no longer exists in spec 1.2, apparently */
1956 /* replaced by \dfrmtextx and \dfrmtexty. */
1957 { rtfPosAttr, rtfTextDistY, "dyfrtext", 0 },
1958
1959 { rtfPosAttr, rtfDropCapLines, "dropcapli", 0 },
1960 { rtfPosAttr, rtfDropCapType, "dropcapt", 0 },
1961
1962 /*
1963 * Object controls
1964 */
1965
1966 { rtfObjAttr, rtfObjEmb, "objemb", 0 },
1967 { rtfObjAttr, rtfObjLink, "objlink", 0 },
1968 { rtfObjAttr, rtfObjAutoLink, "objautlink", 0 },
1969 { rtfObjAttr, rtfObjSubscriber, "objsub", 0 },
1970 { rtfObjAttr, rtfObjPublisher, "objpub", 0 },
1971 { rtfObjAttr, rtfObjICEmb, "objicemb", 0 },
1972
1973 { rtfObjAttr, rtfObjLinkSelf, "linkself", 0 },
1974 { rtfObjAttr, rtfObjLock, "objupdate", 0 },
1975 { rtfObjAttr, rtfObjUpdate, "objlock", 0 },
1976
1977 { rtfObjAttr, rtfObjHt, "objh", 0 },
1978 { rtfObjAttr, rtfObjWid, "objw", 0 },
1979 { rtfObjAttr, rtfObjSetSize, "objsetsize", 0 },
1980 { rtfObjAttr, rtfObjAlign, "objalign", 0 },
1981 { rtfObjAttr, rtfObjTransposeY, "objtransy", 0 },
1982 { rtfObjAttr, rtfObjCropTop, "objcropt", 0 },
1983 { rtfObjAttr, rtfObjCropBottom, "objcropb", 0 },
1984 { rtfObjAttr, rtfObjCropLeft, "objcropl", 0 },
1985 { rtfObjAttr, rtfObjCropRight, "objcropr", 0 },
1986 { rtfObjAttr, rtfObjScaleX, "objscalex", 0 },
1987 { rtfObjAttr, rtfObjScaleY, "objscaley", 0 },
1988
1989 { rtfObjAttr, rtfObjResRTF, "rsltrtf", 0 },
1990 { rtfObjAttr, rtfObjResPict, "rsltpict", 0 },
1991 { rtfObjAttr, rtfObjResBitmap, "rsltbmp", 0 },
1992 { rtfObjAttr, rtfObjResText, "rslttxt", 0 },
1993 { rtfObjAttr, rtfObjResMerge, "rsltmerge", 0 },
1994
1995 { rtfObjAttr, rtfObjBookmarkPubObj, "bkmkpub", 0 },
1996 { rtfObjAttr, rtfObjPubAutoUpdate, "pubauto", 0 },
1997
1998 /*
1999 * Associated character formatting attributes
2000 */
2001
2002 { rtfACharAttr, rtfACBold, "ab", 0 },
2003 { rtfACharAttr, rtfACAllCaps, "caps", 0 },
2004 { rtfACharAttr, rtfACForeColor, "acf", 0 },
2005 { rtfACharAttr, rtfACSubScript, "adn", 0 },
2006 { rtfACharAttr, rtfACExpand, "aexpnd", 0 },
2007 { rtfACharAttr, rtfACFontNum, "af", 0 },
2008 { rtfACharAttr, rtfACFontSize, "afs", 0 },
2009 { rtfACharAttr, rtfACItalic, "ai", 0 },
2010 { rtfACharAttr, rtfACLanguage, "alang", 0 },
2011 { rtfACharAttr, rtfACOutline, "aoutl", 0 },
2012 { rtfACharAttr, rtfACSmallCaps, "ascaps", 0 },
2013 { rtfACharAttr, rtfACShadow, "ashad", 0 },
2014 { rtfACharAttr, rtfACStrikeThru, "astrike", 0 },
2015 { rtfACharAttr, rtfACUnderline, "aul", 0 },
2016 { rtfACharAttr, rtfACDotUnderline, "auld", 0 },
2017 { rtfACharAttr, rtfACDbUnderline, "auldb", 0 },
2018 { rtfACharAttr, rtfACNoUnderline, "aulnone", 0 },
2019 { rtfACharAttr, rtfACWordUnderline, "aulw", 0 },
2020 { rtfACharAttr, rtfACSuperScript, "aup", 0 },
2021
2022 /*
2023 * Footnote attributes
2024 */
2025
2026 { rtfFNoteAttr, rtfFNAlt, "ftnalt", 0 },
2027
2028 /*
2029 * Key code attributes
2030 */
2031
2032 { rtfKeyCodeAttr, rtfAltKey, "alt", 0 },
2033 { rtfKeyCodeAttr, rtfShiftKey, "shift", 0 },
2034 { rtfKeyCodeAttr, rtfControlKey, "ctrl", 0 },
2035 { rtfKeyCodeAttr, rtfFunctionKey, "fn", 0 },
2036
2037 /*
2038 * Bookmark attributes
2039 */
2040
2041 { rtfBookmarkAttr, rtfBookmarkFirstCol, "bkmkcolf", 0 },
2042 { rtfBookmarkAttr, rtfBookmarkLastCol, "bkmkcoll", 0 },
2043
2044 /*
2045 * Index entry attributes
2046 */
2047
2048 { rtfIndexAttr, rtfIndexNumber, "xef", 0 },
2049 { rtfIndexAttr, rtfIndexBold, "bxe", 0 },
2050 { rtfIndexAttr, rtfIndexItalic, "ixe", 0 },
2051
2052 /*
2053 * Table of contents attributes
2054 */
2055
2056 { rtfTOCAttr, rtfTOCType, "tcf", 0 },
2057 { rtfTOCAttr, rtfTOCLevel, "tcl", 0 },
2058
2059 /*
2060 * Drawing object attributes
2061 */
2062
2063 { rtfDrawAttr, rtfDrawLock, "dolock", 0 },
2064 { rtfDrawAttr, rtfDrawPageRelX, "doxpage", 0 },
2065 { rtfDrawAttr, rtfDrawColumnRelX, "dobxcolumn", 0 },
2066 { rtfDrawAttr, rtfDrawMarginRelX, "dobxmargin", 0 },
2067 { rtfDrawAttr, rtfDrawPageRelY, "dobypage", 0 },
2068 { rtfDrawAttr, rtfDrawColumnRelY, "dobycolumn", 0 },
2069 { rtfDrawAttr, rtfDrawMarginRelY, "dobymargin", 0 },
2070 { rtfDrawAttr, rtfDrawHeight, "dobhgt", 0 },
2071
2072 { rtfDrawAttr, rtfDrawBeginGroup, "dpgroup", 0 },
2073 { rtfDrawAttr, rtfDrawGroupCount, "dpcount", 0 },
2074 { rtfDrawAttr, rtfDrawEndGroup, "dpendgroup", 0 },
2075 { rtfDrawAttr, rtfDrawArc, "dparc", 0 },
2076 { rtfDrawAttr, rtfDrawCallout, "dpcallout", 0 },
2077 { rtfDrawAttr, rtfDrawEllipse, "dpellipse", 0 },
2078 { rtfDrawAttr, rtfDrawLine, "dpline", 0 },
2079 { rtfDrawAttr, rtfDrawPolygon, "dppolygon", 0 },
2080 { rtfDrawAttr, rtfDrawPolyLine, "dppolyline", 0 },
2081 { rtfDrawAttr, rtfDrawRect, "dprect", 0 },
2082 { rtfDrawAttr, rtfDrawTextBox, "dptxbx", 0 },
2083
2084 { rtfDrawAttr, rtfDrawOffsetX, "dpx", 0 },
2085 { rtfDrawAttr, rtfDrawSizeX, "dpxsize", 0 },
2086 { rtfDrawAttr, rtfDrawOffsetY, "dpy", 0 },
2087 { rtfDrawAttr, rtfDrawSizeY, "dpysize", 0 },
2088
2089 { rtfDrawAttr, rtfCOAngle, "dpcoa", 0 },
2090 { rtfDrawAttr, rtfCOAccentBar, "dpcoaccent", 0 },
2091 { rtfDrawAttr, rtfCOBestFit, "dpcobestfit", 0 },
2092 { rtfDrawAttr, rtfCOBorder, "dpcoborder", 0 },
2093 { rtfDrawAttr, rtfCOAttachAbsDist, "dpcodabs", 0 },
2094 { rtfDrawAttr, rtfCOAttachBottom, "dpcodbottom", 0 },
2095 { rtfDrawAttr, rtfCOAttachCenter, "dpcodcenter", 0 },
2096 { rtfDrawAttr, rtfCOAttachTop, "dpcodtop", 0 },
2097 { rtfDrawAttr, rtfCOLength, "dpcolength", 0 },
2098 { rtfDrawAttr, rtfCONegXQuadrant, "dpcominusx", 0 },
2099 { rtfDrawAttr, rtfCONegYQuadrant, "dpcominusy", 0 },
2100 { rtfDrawAttr, rtfCOOffset, "dpcooffset", 0 },
2101 { rtfDrawAttr, rtfCOAttachSmart, "dpcosmarta", 0 },
2102 { rtfDrawAttr, rtfCODoubleLine, "dpcotdouble", 0 },
2103 { rtfDrawAttr, rtfCORightAngle, "dpcotright", 0 },
2104 { rtfDrawAttr, rtfCOSingleLine, "dpcotsingle", 0 },
2105 { rtfDrawAttr, rtfCOTripleLine, "dpcottriple", 0 },
2106
2107 { rtfDrawAttr, rtfDrawTextBoxMargin, "dptxbxmar", 0 },
2108 { rtfDrawAttr, rtfDrawTextBoxText, "dptxbxtext", 0 },
2109 { rtfDrawAttr, rtfDrawRoundRect, "dproundr", 0 },
2110
2111 { rtfDrawAttr, rtfDrawPointX, "dpptx", 0 },
2112 { rtfDrawAttr, rtfDrawPointY, "dppty", 0 },
2113 { rtfDrawAttr, rtfDrawPolyCount, "dppolycount", 0 },
2114
2115 { rtfDrawAttr, rtfDrawArcFlipX, "dparcflipx", 0 },
2116 { rtfDrawAttr, rtfDrawArcFlipY, "dparcflipy", 0 },
2117
2118 { rtfDrawAttr, rtfDrawLineBlue, "dplinecob", 0 },
2119 { rtfDrawAttr, rtfDrawLineGreen, "dplinecog", 0 },
2120 { rtfDrawAttr, rtfDrawLineRed, "dplinecor", 0 },
2121 { rtfDrawAttr, rtfDrawLinePalette, "dplinepal", 0 },
2122 { rtfDrawAttr, rtfDrawLineDashDot, "dplinedado", 0 },
2123 { rtfDrawAttr, rtfDrawLineDashDotDot, "dplinedadodo", 0 },
2124 { rtfDrawAttr, rtfDrawLineDash, "dplinedash", 0 },
2125 { rtfDrawAttr, rtfDrawLineDot, "dplinedot", 0 },
2126 { rtfDrawAttr, rtfDrawLineGray, "dplinegray", 0 },
2127 { rtfDrawAttr, rtfDrawLineHollow, "dplinehollow", 0 },
2128 { rtfDrawAttr, rtfDrawLineSolid, "dplinesolid", 0 },
2129 { rtfDrawAttr, rtfDrawLineWidth, "dplinew", 0 },
2130
2131 { rtfDrawAttr, rtfDrawHollowEndArrow, "dpaendhol", 0 },
2132 { rtfDrawAttr, rtfDrawEndArrowLength, "dpaendl", 0 },
2133 { rtfDrawAttr, rtfDrawSolidEndArrow, "dpaendsol", 0 },
2134 { rtfDrawAttr, rtfDrawEndArrowWidth, "dpaendw", 0 },
2135 { rtfDrawAttr, rtfDrawHollowStartArrow,"dpastarthol", 0 },
2136 { rtfDrawAttr, rtfDrawStartArrowLength,"dpastartl", 0 },
2137 { rtfDrawAttr, rtfDrawSolidStartArrow, "dpastartsol", 0 },
2138 { rtfDrawAttr, rtfDrawStartArrowWidth, "dpastartw", 0 },
2139
2140 { rtfDrawAttr, rtfDrawBgFillBlue, "dpfillbgcb", 0 },
2141 { rtfDrawAttr, rtfDrawBgFillGreen, "dpfillbgcg", 0 },
2142 { rtfDrawAttr, rtfDrawBgFillRed, "dpfillbgcr", 0 },
2143 { rtfDrawAttr, rtfDrawBgFillPalette, "dpfillbgpal", 0 },
2144 { rtfDrawAttr, rtfDrawBgFillGray, "dpfillbggray", 0 },
2145 { rtfDrawAttr, rtfDrawFgFillBlue, "dpfillfgcb", 0 },
2146 { rtfDrawAttr, rtfDrawFgFillGreen, "dpfillfgcg", 0 },
2147 { rtfDrawAttr, rtfDrawFgFillRed, "dpfillfgcr", 0 },
2148 { rtfDrawAttr, rtfDrawFgFillPalette, "dpfillfgpal", 0 },
2149 { rtfDrawAttr, rtfDrawFgFillGray, "dpfillfggray", 0 },
2150 { rtfDrawAttr, rtfDrawFillPatIndex, "dpfillpat", 0 },
2151
2152 { rtfDrawAttr, rtfDrawShadow, "dpshadow", 0 },
2153 { rtfDrawAttr, rtfDrawShadowXOffset, "dpshadx", 0 },
2154 { rtfDrawAttr, rtfDrawShadowYOffset, "dpshady", 0 },
2155
2156 { rtfVersion, -1, "rtf", 0 },
2157 { rtfDefFont, -1, "deff", 0 },
2158
2159 { 0, -1, NULL, 0 }
2160};
2161
2162typedef struct tagRTFHashTableEntry {
2166
2168
2169
2170/*
2171 * Initialize lookup table hash values. Only need to do this once.
2172 */
2173
2174void LookupInit(void)
2175{
2176 RTFKey *rp;
2177
2178 memset(rtfHashTable, 0, sizeof rtfHashTable);
2179 for (rp = rtfKey; rp->rtfKStr != NULL; rp++)
2180 {
2181 int index;
2182
2183 rp->rtfKHash = Hash (rp->rtfKStr);
2184 index = rp->rtfKHash % (ARRAY_SIZE(rtfKey) * 2);
2187 }
2188}
2189
2191{
2192 unsigned int i;
2193
2194 for (i = 0; i < ARRAY_SIZE(rtfKey) * 2; i++)
2195 {
2198 rtfHashTable[i].count = 0;
2199 }
2200}
2201
2202
2203/*
2204 * Determine major and minor number of control token. If it's
2205 * not found, the class turns into rtfUnknown.
2206 */
2207
2208static void Lookup(RTF_Info *info, char *s)
2209{
2210 RTFKey *rp;
2211 int hash;
2213 int i;
2214
2215 ++s; /* skip over the leading \ character */
2216 hash = Hash (s);
2218 for (i = 0; i < entry->count; i++)
2219 {
2220 rp = entry->value[i];
2221 if (hash == rp->rtfKHash && strcmp (s, rp->rtfKStr) == 0)
2222 {
2223 info->rtfClass = rtfControl;
2224 info->rtfMajor = rp->rtfKMajor;
2225 info->rtfMinor = rp->rtfKMinor;
2226 return;
2227 }
2228 }
2229 info->rtfClass = rtfUnknown;
2230}
2231
2232
2233/*
2234 * Compute hash value of symbol
2235 */
2236
2237static int Hash(const char *s)
2238{
2239 char c;
2240 int val = 0;
2241
2242 while ((c = *s++) != '\0')
2243 val += c;
2244 return (val);
2245}
2246
2247
2248
2249/* ---------------------------------------------------------------------- */
2250
2251
2252/*
2253 * Token comparison routines
2254 */
2255
2256int RTFCheckCM(const RTF_Info *info, int class, int major)
2257{
2258 return (info->rtfClass == class && info->rtfMajor == major);
2259}
2260
2261
2262int RTFCheckCMM(const RTF_Info *info, int class, int major, int minor)
2263{
2264 return (info->rtfClass == class && info->rtfMajor == major && info->rtfMinor == minor);
2265}
2266
2267
2268int RTFCheckMM(const RTF_Info *info, int major, int minor)
2269{
2270 return (info->rtfMajor == major && info->rtfMinor == minor);
2271}
2272
2273
2274/* ---------------------------------------------------------------------- */
2275
2276
2278{
2279 if (isupper (c))
2280 c = tolower (c);
2281 if (isdigit (c))
2282 return (c - '0'); /* '0'..'9' */
2283 return (c - 'a' + 10); /* 'a'..'f' */
2284}
2285
2286
2287/* ---------------------------------------------------------------------- */
2288
2289/*
2290 * originally from RTF tools' text-writer.c
2291 *
2292 * text-writer -- RTF-to-text translation writer code.
2293 *
2294 * Read RTF input, write text of document (text extraction).
2295 */
2296
2297static void TextClass (RTF_Info *info);
2298static void ControlClass (RTF_Info *info);
2299static void DefFont(RTF_Info *info);
2300static void Destination (RTF_Info *info);
2301static void SpecialChar (RTF_Info *info);
2302static void RTFPutUnicodeChar (RTF_Info *info, int c);
2303
2304/*
2305 * Initialize the writer.
2306 */
2307
2308void
2310{
2311}
2312
2313
2314int
2316{
2317 /* install class callbacks */
2318
2321
2322 return (1);
2323}
2324
2325/*
2326 * Write out a character.
2327 */
2328
2329static void
2331{
2332 RTFPutCodePageChar(info, info->rtfMajor);
2333}
2334
2335
2336static void
2338{
2339 switch (info->rtfMajor)
2340 {
2341 case rtfCharAttr:
2342 CharAttr(info);
2344 break;
2345 case rtfParAttr:
2347 break;
2348 case rtfTblAttr:
2350 break;
2351 case rtfCharSet:
2352 CharSet(info);
2353 break;
2354 case rtfDefFont:
2355 DefFont(info);
2356 break;
2357 case rtfDestination:
2358 Destination (info);
2359 break;
2360 case rtfDocAttr:
2361 DocAttr(info);
2362 break;
2363 case rtfSpecialChar:
2364 SpecialChar (info);
2366 break;
2367 }
2368}
2369
2370
2371static void
2373{
2374 RTFFont *font;
2375
2376 switch (info->rtfMinor)
2377 {
2378 case rtfFontNum:
2379 font = RTFGetFont(info, info->rtfParam);
2380 if (font)
2381 {
2382 if (info->ansiCodePage != CP_UTF8 && info->codePage != font->rtfFCodePage)
2383 {
2385 info->codePage = font->rtfFCodePage;
2386 }
2387 TRACE("font %d codepage %d\n", info->rtfParam, info->codePage);
2388 }
2389 else
2390 ERR( "unknown font %d\n", info->rtfParam);
2391 break;
2392 case rtfUnicodeLength:
2393 info->unicodeLength = info->rtfParam;
2394 break;
2395 }
2396}
2397
2398
2399static void
2401{
2402 if (info->ansiCodePage == CP_UTF8)
2403 return;
2404
2405 switch (info->rtfMinor)
2406 {
2407 case rtfAnsiCharSet:
2408 info->ansiCodePage = 1252; /* Latin-1 */
2409 break;
2410 case rtfMacCharSet:
2411 info->ansiCodePage = 10000; /* MacRoman */
2412 break;
2413 case rtfPcCharSet:
2414 info->ansiCodePage = 437;
2415 break;
2416 case rtfPcaCharSet:
2417 info->ansiCodePage = 850;
2418 break;
2419 }
2420}
2421
2422/*
2423 * This function notices destinations that aren't explicitly handled
2424 * and skips to their ends. This keeps, for instance, picture
2425 * data from being considered as plain text.
2426 */
2427
2428static void
2430{
2431 if (!RTFGetDestinationCallback(info, info->rtfMinor))
2432 RTFSkipGroup (info);
2433}
2434
2435
2436static void
2438{
2439 TRACE("%d\n", info->rtfParam);
2440 info->defFont = info->rtfParam;
2441}
2442
2443
2444static void
2446{
2447 TRACE("minor %d, param %d\n", info->rtfMinor, info->rtfParam);
2448
2449 switch (info->rtfMinor)
2450 {
2451 case rtfAnsiCodePage:
2452 info->codePage = info->ansiCodePage = info->rtfParam;
2453 break;
2454 case rtfUTF8RTF:
2455 info->codePage = info->ansiCodePage = CP_UTF8;
2456 break;
2457 }
2458}
2459
2460
2462{
2463 switch (info->rtfMinor)
2464 {
2465 case rtfOptDest:
2466 /* the next token determines destination, if it's unknown, skip the group */
2467 /* this way we filter out the garbage coming from unknown destinations */
2468 RTFGetToken(info);
2469 if (info->rtfClass != rtfDestination)
2471 else
2472 RTFRouteToken(info); /* "\*" is ignored with known destinations */
2473 break;
2474 case rtfUnicode:
2475 {
2476 int i;
2477
2478 RTFPutUnicodeChar(info, info->rtfParam);
2479
2480 /* After \u we must skip number of character tokens set by \ucN */
2481 for (i = 0; i < info->unicodeLength; i++)
2482 {
2484 if (info->rtfClass != rtfText)
2485 {
2486 ERR("The token behind \\u is not text, but (%d,%d,%d)\n",
2487 info->rtfClass, info->rtfMajor, info->rtfMinor);
2489 break;
2490 }
2491 }
2492 break;
2493 }
2494 case rtfLine:
2496 ME_InsertEndRowFromCursor(info->editor, 0);
2497 break;
2498 case rtfPage:
2499 case rtfSect:
2500 case rtfPar:
2502 editor_set_selection_para_fmt( info->editor, &info->fmt );
2503 memset(&info->fmt, 0, sizeof(info->fmt));
2504 info->fmt.cbSize = sizeof(info->fmt);
2505 RTFPutUnicodeChar (info, '\r');
2506 if (info->editor->bEmulateVersion10) RTFPutUnicodeChar (info, '\n');
2507 break;
2508 case rtfNoBrkSpace:
2509 RTFPutUnicodeChar (info, 0x00A0);
2510 break;
2511 case rtfTab:
2512 RTFPutUnicodeChar (info, '\t');
2513 break;
2514 case rtfNoBrkHyphen:
2515 RTFPutUnicodeChar (info, 0x2011);
2516 break;
2517 case rtfBullet:
2518 RTFPutUnicodeChar (info, 0x2022);
2519 break;
2520 case rtfEmDash:
2521 RTFPutUnicodeChar (info, 0x2014);
2522 break;
2523 case rtfEnDash:
2524 RTFPutUnicodeChar (info, 0x2013);
2525 break;
2526 case rtfEmSpace:
2527 RTFPutUnicodeChar (info, ' ');
2528 break;
2529 case rtfEnSpace:
2530 RTFPutUnicodeChar (info, ' ');
2531 break;
2532 case rtfLQuote:
2533 RTFPutUnicodeChar (info, 0x2018);
2534 break;
2535 case rtfRQuote:
2536 RTFPutUnicodeChar (info, 0x2019);
2537 break;
2538 case rtfLDblQuote:
2539 RTFPutUnicodeChar (info, 0x201C);
2540 break;
2541 case rtfRDblQuote:
2542 RTFPutUnicodeChar (info, 0x201D);
2543 break;
2544 case rtfLTRMark:
2545 RTFPutUnicodeChar (info, 0x200E);
2546 break;
2547 case rtfRTLMark:
2548 RTFPutUnicodeChar (info, 0x200F);
2549 break;
2550 case rtfNoWidthJoiner:
2551 RTFPutUnicodeChar (info, 0x200D);
2552 break;
2554 RTFPutUnicodeChar (info, 0x200C);
2555 break;
2556 }
2557}
2558
2559
2560static void
2562{
2563 if (info->dwOutputCount)
2564 {
2565 ME_InsertTextFromCursor(info->editor, 0, info->OutputBuffer,
2566 info->dwOutputCount, info->style);
2567 info->dwOutputCount = 0;
2568 }
2569}
2570
2571
2572static void
2574{
2575 if (info->dwCPOutputCount)
2577 while (length)
2578 {
2579 int fit = min(length, ARRAY_SIZE(info->OutputBuffer) - info->dwOutputCount);
2580
2581 memmove(info->OutputBuffer + info->dwOutputCount, string, fit * sizeof(WCHAR));
2582 info->dwOutputCount += fit;
2583 length -= fit;
2584 string += fit;
2585 if (ARRAY_SIZE(info->OutputBuffer) == info->dwOutputCount)
2587 }
2588}
2589
2590static void
2592{
2593 int bufferMax = info->dwCPOutputCount * 2 * sizeof(WCHAR);
2594 WCHAR *buffer = malloc(bufferMax);
2595 int length;
2596
2597 length = MultiByteToWideChar(info->codePage, 0, info->cpOutputBuffer,
2598 info->dwCPOutputCount, buffer, bufferMax/sizeof(WCHAR));
2599 info->dwCPOutputCount = 0;
2600
2602 free(buffer);
2603}
2604
2605void
2607{
2608 if (info->dwCPOutputCount)
2611}
2612
2613static void
2615{
2616 if (info->dwCPOutputCount)
2618 if (info->dwOutputCount * sizeof(WCHAR) >= ( sizeof info->OutputBuffer - 1 ) )
2620 info->OutputBuffer[info->dwOutputCount++] = c;
2621}
2622
2623static void
2625{
2626 /* Use dynamic buffer here because it's the best way to handle
2627 * MBCS codepages without having to worry about partial chars */
2628 if (info->dwCPOutputCount >= info->dwMaxCPOutputCount)
2629 {
2630 info->dwMaxCPOutputCount *= 2;
2631 info->cpOutputBuffer = realloc(info->cpOutputBuffer, info->dwMaxCPOutputCount);
2632 }
2633 info->cpOutputBuffer[info->dwCPOutputCount++] = c;
2634}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define isalpha(c)
Definition: acclib.h:74
#define isdigit(c)
Definition: acclib.h:68
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define isxdigit(c)
Definition: acclib.h:70
#define isupper(c)
Definition: acclib.h:71
int tolower(int c)
Definition: utclib.c:902
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
CFF_Charset charset
Definition: cffcmap.c:138
static const WCHAR ControlClass[]
Definition: cfgmgr.c:38
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor)
Definition: caret.c:568
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
Definition: caret.c:584
void ME_StreamInFill(ME_InStream *stream)
Definition: editor.c:1562
void ME_RTFTblAttrHook(RTF_Info *info)
Definition: editor.c:869
void ME_RTFCharAttrHook(RTF_Info *info)
Definition: editor.c:425
void ME_RTFSpecialCharHook(RTF_Info *info)
Definition: editor.c:943
void ME_RTFParAttrHook(RTF_Info *info)
Definition: editor.c:556
int RTFCheckCM(const RTF_Info *info, int class, int major)
Definition: reader.c:2256
static void Lookup(RTF_Info *, char *)
Definition: reader.c:2208
void RTFDestroy(RTF_Info *info)
Definition: reader.c:144
static void RTFPutCodePageChar(RTF_Info *info, int c)
Definition: reader.c:2624
int RTFCharSetToCodePage(RTF_Info *info, int charset)
Definition: reader.c:476
static void RTFSetClassCallback(RTF_Info *info, int class, RTFFuncPtr callback)
Definition: reader.c:174
static void CharAttr(RTF_Info *info)
Definition: reader.c:2372
static void _RTFGetToken(RTF_Info *)
Definition: reader.c:437
static void SpecialChar(RTF_Info *info)
Definition: reader.c:2461
static void RTFFlushCPOutputBuffer(RTF_Info *info)
Definition: reader.c:2591
static void ReadInfoGroup(RTF_Info *)
Definition: reader.c:1177
static RTFHashTableEntry rtfHashTable[ARRAY_SIZE(rtfKey) *2]
Definition: reader.c:2167
void RTFSetEditStream(RTF_Info *info, ME_InStream *stream)
Definition: reader.c:99
static void RTFDestroyAttrs(RTF_Info *info)
Definition: reader.c:105
static RTFFuncPtr RTFGetReadHook(const RTF_Info *info)
Definition: reader.c:377
int RTFCharToHex(char c)
Definition: reader.c:2277
static void RTFUngetToken(RTF_Info *info)
Definition: reader.c:414
static void RTFPutUnicodeChar(RTF_Info *info, int c)
Definition: reader.c:2614
int BeginFile(RTF_Info *info)
Definition: reader.c:2315
static void _RTFGetToken2(RTF_Info *)
Definition: reader.c:537
static void ReadFontTbl(RTF_Info *)
Definition: reader.c:769
int RTFGetToken(RTF_Info *info)
Definition: reader.c:389
static void ReadColorTbl(RTF_Info *)
Definition: reader.c:948
static void CharSet(RTF_Info *info)
Definition: reader.c:2400
void RTFRead(RTF_Info *info)
Definition: reader.c:291
static RTFFuncPtr RTFGetDestinationCallback(const RTF_Info *info, int dest)
Definition: reader.c:271
static void RTFPutUnicodeString(RTF_Info *info, const WCHAR *string, int length)
Definition: reader.c:2573
static void ReadPictGroup(RTF_Info *)
Definition: reader.c:1184
static int GetChar(RTF_Info *)
Definition: reader.c:708
static void ReadStyleSheet(RTF_Info *)
Definition: reader.c:1008
RTFFont * RTFGetFont(const RTF_Info *info, int num)
Definition: reader.c:1205
void RTFRouteToken(RTF_Info *info)
Definition: reader.c:304
static int Hash(const char *)
Definition: reader.c:2237
void RTFInit(RTF_Info *info)
Definition: reader.c:195
int RTFCheckMM(const RTF_Info *info, int major, int minor)
Definition: reader.c:2268
static RTFFuncPtr RTFGetClassCallback(const RTF_Info *info, int class)
Definition: reader.c:181
void RTFFlushOutputBuffer(RTF_Info *info)
Definition: reader.c:2606
RTFColor * RTFGetColor(const RTF_Info *info, int num)
Definition: reader.c:1220
static void TextClass(RTF_Info *info)
Definition: reader.c:2330
void RTFSetReadHook(RTF_Info *info, RTFFuncPtr f)
Definition: reader.c:371
void LookupCleanup(void)
Definition: reader.c:2190
struct tagRTFHashTableEntry RTFHashTableEntry
void RTFSkipGroup(RTF_Info *info)
Definition: reader.c:337
static void RTFFlushUnicodeOutputBuffer(RTF_Info *info)
Definition: reader.c:2561
void LookupInit(void)
Definition: reader.c:2174
static void ReadObjGroup(RTF_Info *)
Definition: reader.c:1191
static void DocAttr(RTF_Info *info)
Definition: reader.c:2445
void RTFSetDestinationCallback(RTF_Info *info, int dest, RTFFuncPtr callback)
Definition: reader.c:264
static void DefFont(RTF_Info *info)
Definition: reader.c:2437
int RTFCheckCMM(const RTF_Info *info, int class, int major, int minor)
Definition: reader.c:2262
static RTFKey rtfKey[]
Definition: reader.c:1257
static int _RTFGetChar(RTF_Info *)
Definition: reader.c:78
void WriterInit(RTF_Info *info)
Definition: reader.c:2309
void RTFReadGroup(RTF_Info *info)
Definition: reader.c:362
unsigned char
Definition: typeof.h:29
void ME_AddRefStyle(ME_Style *item)
Definition: style.c:454
BOOL editor_set_selection_para_fmt(ME_TextEditor *editor, const PARAFORMAT2 *fmt)
Definition: para.c:873
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint level
Definition: gl.h:1546
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLfloat f
Definition: glext.h:7540
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
GLuint GLuint num
Definition: glext.h:9618
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define EOF
Definition: stdio.h:24
uint32_t entry
Definition: isohybrid.c:63
#define f
Definition: ke_i.h:83
#define c
Definition: ke_i.h:80
if(dx< 0)
Definition: linetemp.h:194
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
POINT cp
Definition: magnifier.c:59
#define sign(x)
Definition: mapdesc.cc:613
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static IPrintDialogCallback callback
Definition: printdlg.c:326
static const WCHAR sp[]
Definition: suminfo.c:287
static char * dest
Definition: rtl.c:135
#define min(a, b)
Definition: monoChain.cc:55
Definition: mk_font.cpp:20
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3043
#define SF_TEXT
Definition: richedit.h:720
#define rtfFwdDarkBgPat
Definition: rtf.h:554
#define rtfPrintColorsBlack
Definition: rtf.h:333
#define rtfFileOSNum
Definition: rtf.h:744
#define rtfPosAttr
Definition: rtf.h:645
#define rtfACBold
Definition: rtf.h:714
#define rtfFieldInst
Definition: rtf.h:176
#define rtfParNumFont
Definition: rtf.h:519
#define rtfBullet
Definition: rtf.h:251
#define rtfACNoUnderline
Definition: rtf.h:730
#define rtfMacQD
Definition: rtf.h:602
#define rtfHyphConsecLines
Definition: rtf.h:279
#define rtfEvenBreak
Definition: rtf.h:367
#define rtfFNoteSep
Definition: rtf.h:233
#define rtfStyleAttr
Definition: rtf.h:271
#define rtfCellDarkBgPatV
Definition: rtf.h:447
#define rtfPicCropLeft
Definition: rtf.h:620
#define rtfPar
Definition: rtf.h:237
#define rtfColumnLine
Definition: rtf.h:374
#define rtfACStrikeThru
Definition: rtf.h:726
#define rtfRTLDoc
Definition: rtf.h:353
#define rtfDrawFgFillGreen
Definition: rtf.h:841
#define rtfCvtMailMergeQuote
Definition: rtf.h:336
#define rtfObjUpdate
Definition: rtf.h:684
#define rtfBgPatLineColor
Definition: rtf.h:558
#define rtfDrawLineHollow
Definition: rtf.h:822
#define rtfAbsWid
Definition: rtf.h:646
#define rtfRowCenter
Definition: rtf.h:422
#define rtfRQuote
Definition: rtf.h:253
#define rtfDrawPointY
Definition: rtf.h:807
#define rtfFacingPage
Definition: rtf.h:324
#define rtfAbsHt
Definition: rtf.h:647
#define rtfPicScaled
Definition: rtf.h:617
#define rtfAnsiCodePage
Definition: rtf.h:355
#define rtfBorderWidth
Definition: rtf.h:542
#define rtfNonShpPict
Definition: rtf.h:188
#define rtfNeXTGrAttr
Definition: rtf.h:630
#define rtfBorderDouble
Definition: rtf.h:538
#define rtfKeepNext
Definition: rtf.h:462
#define rtfPageRestart
Definition: rtf.h:394
#define rtfParNumOnce
Definition: rtf.h:496
#define rtfNeXTGHeight
Definition: rtf.h:632
#define rtfColorName
Definition: rtf.h:201
#define rtfParNumbering
Definition: rtf.h:149
#define rtfPMMetafile
Definition: rtf.h:603
#define rtfIndexRange
Definition: rtf.h:181
#define rtfDrawBgFillBlue
Definition: rtf.h:835
#define rtfColumn
Definition: rtf.h:240
#define rtfObjSetSize
Definition: rtf.h:687
#define rtfPosNegX
Definition: rtf.h:652
#define rtfFNContSep
Definition: rtf.h:133
#define rtfField
Definition: rtf.h:175
#define rtfNoLineNum
Definition: rtf.h:464
#define rtfBgPatV
Definition: rtf.h:547
#define rtfDrawLineGray
Definition: rtf.h:821
#define rtfIndexText
Definition: rtf.h:180
#define rtfQuadLeft
Definition: rtf.h:467
#define rtfDrawHollowEndArrow
Definition: rtf.h:826
#define rtfFooter
Definition: rtf.h:141
#define rtfPageNumColonSep
Definition: rtf.h:404
#define rtfSectAttr
Definition: rtf.h:358
#define rtfFileSource
Definition: rtf.h:746
#define rtfFootnote
Definition: rtf.h:166
#define rtfUnderline
Definition: rtf.h:583
#define rtfSuperScrShrink
Definition: rtf.h:589
#define rtfParNumTextBefore
Definition: rtf.h:151
#define rtfRevDTTM
Definition: rtf.h:579
#define rtfDrawAttr
Definition: rtf.h:757
#define rtfQuadRight
Definition: rtf.h:468
#define rtfFormProtected
Definition: rtf.h:343
#define rtfACSubScript
Definition: rtf.h:717
#define rtfCurHeadDateLong
Definition: rtf.h:226
#define rtfFNSep
Definition: rtf.h:132
#define rtfParNumLeft
Definition: rtf.h:525
#define rtfObjHt
Definition: rtf.h:685
#define rtfRowGapH
Definition: rtf.h:416
#define rtfRTFDefault
Definition: rtf.h:285
#define rtfAnnotAuthor
Definition: rtf.h:170
#define rtfENoteEndDoc
Definition: rtf.h:295
#define rtfHeaderLeft
Definition: rtf.h:142
#define rtfPageULetter
Definition: rtf.h:400
#define rtfBorderRight
Definition: rtf.h:531
#define rtfPageLLetter
Definition: rtf.h:401
#define rtfBeginGroup
Definition: rtf.h:89
#define rtfAnnotIcon
Definition: rtf.h:174
#define rtfColumns
Definition: rtf.h:369
#define rtfRPosColH
Definition: rtf.h:650
#define rtfFNContNotice
Definition: rtf.h:134
#define rtfFieldAttr
Definition: rtf.h:634
#define rtfBorderBar
Definition: rtf.h:533
#define rtfRDblQuote
Definition: rtf.h:255
#define rtfITitle
Definition: rtf.h:121
#define rtfPicMFHasBitmap
Definition: rtf.h:622
#define rtfFileInfo
Definition: rtf.h:115
#define rtfFNoteNumURoman
Definition: rtf.h:309
#define rtfPosY
Definition: rtf.h:661
#define rtfRowBordLeft
Definition: rtf.h:430
#define rtfDrawPolyLine
Definition: rtf.h:775
#define rtfGreen
Definition: rtf.h:203
#define rtfPageNumTop
Definition: rtf.h:396
#define rtfLTRRow
Definition: rtf.h:428
#define rtfDrawLineGreen
Definition: rtf.h:814
#define rtfHyphenate
Definition: rtf.h:458
#define rtfFFTech
Definition: rtf.h:198
#define rtfDrawShadowXOffset
Definition: rtf.h:848
#define rtfCellShading
Definition: rtf.h:439
#define rtfCurHeadTime
Definition: rtf.h:228
#define rtfNoWidowControl
Definition: rtf.h:461
#define rtfFileNum
Definition: rtf.h:742
#define rtfINPages
Definition: rtf.h:220
#define rtfIndex
Definition: rtf.h:179
#define rtfFFModern
Definition: rtf.h:195
#define rtfDrawBgFillGray
Definition: rtf.h:839
#define rtfCurHeadPict
Definition: rtf.h:265
#define rtfWordUnderline
Definition: rtf.h:587
#define rtfDrawTextBoxMargin
Definition: rtf.h:802
#define rtfLTRPar
Definition: rtf.h:480
#define rtfObjAutoLink
Definition: rtf.h:678
#define rtfParNumTextAfter
Definition: rtf.h:150
#define rtfPage
Definition: rtf.h:239
#define rtfMergePrevious
Definition: rtf.h:419
#define rtfRowBordTop
Definition: rtf.h:429
#define rtfFontFamily
Definition: rtf.h:191
#define rtfParNumLevelStyle
Definition: rtf.h:139
#define rtfWinMetafile
Definition: rtf.h:604
#define rtfParNumAcross
Definition: rtf.h:497
#define rtfPageLRoman
Definition: rtf.h:399
#define rtfCellBgPatColor
Definition: rtf.h:453
#define rtfBorderShadow
Definition: rtf.h:537
#define rtfParBullet
Definition: rtf.h:493
#define rtfDrawBeginGroup
Definition: rtf.h:767
#define rtfControlKey
Definition: rtf.h:710
#define rtfCellDarkHatchBgPat
Definition: rtf.h:450
#define rtfBookmarkFirstCol
Definition: rtf.h:627
#define rtfEndGroup
Definition: rtf.h:90
#define rtfRowRight
Definition: rtf.h:421
#define rtfCOAttachSmart
Definition: rtf.h:796
#define rtfCellHatchBgPat
Definition: rtf.h:444
#define rtfPageStarts
Definition: rtf.h:392
#define rtfObjName
Definition: rtf.h:157
#define rtfGray
Definition: rtf.h:598
#define rtfKeep
Definition: rtf.h:460
#define rtfDrawLineDashDot
Definition: rtf.h:817
#define rtfDropCapLines
Definition: rtf.h:672
#define rtfDbUnderline
Definition: rtf.h:585
#define rtfCurHeadPage
Definition: rtf.h:229
#define rtfRTLRow
Definition: rtf.h:427
#define rtfEmfBlip
Definition: rtf.h:607
#define rtfFontAttr
Definition: rtf.h:734
#define rtfIVersion
Definition: rtf.h:127
#define rtfSuppressPreParSpace
Definition: rtf.h:338
#define rtfNestTableProps
Definition: rtf.h:185
#define rtfTopMargin
Definition: rtf.h:322
#define rtfFTypeTrueType
Definition: rtf.h:739
#define rtfBufSiz
Definition: rtf.h:30
#define rtfDrawHeight
Definition: rtf.h:765
#define rtfCOOffset
Definition: rtf.h:795
#define rtfPageNumSpaceSep
Definition: rtf.h:403
#define rtfAnnotRefEnd
Definition: rtf.h:168
#define rtfBorderSingle
Definition: rtf.h:535
#define rtfPosXCenter
Definition: rtf.h:653
#define rtfAdditive
Definition: rtf.h:272
#define rtfPosYTop
Definition: rtf.h:664
#define rtfPosX
Definition: rtf.h:651
#define rtfObjTime
Definition: rtf.h:158
#define rtfCharCharSet
Definition: rtf.h:596
#define rtfObjLinkSelf
Definition: rtf.h:682
#define rtfSideBySide
Definition: rtf.h:466
#define rtfDistFromTextY
Definition: rtf.h:670
#define rtfParLevel
Definition: rtf.h:492
#define rtfSectMarginBottom
Definition: rtf.h:386
#define rtfBgPatColor
Definition: rtf.h:559
#define rtfCOSingleLine
Definition: rtf.h:799
#define rtfAnnotRefStart
Definition: rtf.h:167
#define rtfFNoteAttr
Definition: rtf.h:704
#define rtfVersion
Definition: rtf.h:96
#define rtfUnicode
Definition: rtf.h:267
#define rtfParNumNoUnder
Definition: rtf.h:515
#define rtfDrawGroupCount
Definition: rtf.h:768
#define rtfPageCont
Definition: rtf.h:393
#define rtfNoWidthNonJoiner
Definition: rtf.h:264
#define rtfQuadCenter
Definition: rtf.h:470
#define rtfDefTab
Definition: rtf.h:277
#define rtfUnicodeLength
Definition: rtf.h:599
#define rtfENoteNumLRoman
Definition: rtf.h:314
#define rtfBgPatH
Definition: rtf.h:546
#define rtfDrawFgFillRed
Definition: rtf.h:842
#define rtfACWordUnderline
Definition: rtf.h:731
#define rtfLeaderDot
Definition: rtf.h:487
#define rtfFNoteText
Definition: rtf.h:292
#define rtfCurAnnotRef
Definition: rtf.h:232
#define rtfDrawRect
Definition: rtf.h:776
#define rtfACExpand
Definition: rtf.h:718
#define rtfACSuperScript
Definition: rtf.h:732
#define rtfDrawStartArrowLength
Definition: rtf.h:831
#define rtfParNumItalic
Definition: rtf.h:509
#define rtfCORightAngle
Definition: rtf.h:798
#define rtfCellBordBottom
Definition: rtf.h:435
#define rtfParNumText
Definition: rtf.h:148
#define rtfRTLChar
Definition: rtf.h:593
#define rtfSubScrShrink
Definition: rtf.h:568
#define rtfShadow
Definition: rtf.h:581
#define rtfLine
Definition: rtf.h:241
#define rtfDocTemplate
Definition: rtf.h:287
#define rtfSoftLine
Definition: rtf.h:244
#define rtfLineCont
Definition: rtf.h:380
#define rtfIDoccomm
Definition: rtf.h:128
#define rtfParNumCont
Definition: rtf.h:495
#define rtfPcCharSet
Definition: rtf.h:103
#define rtfShpPict
Definition: rtf.h:187
#define rtfWinBitmap
Definition: rtf.h:606
#define rtfENContNotice
Definition: rtf.h:137
#define rtfBorderBottom
Definition: rtf.h:529
#define rtfSubDocument
Definition: rtf.h:478
#define rtfColumnNumber
Definition: rtf.h:371
#define rtfFFBidirectional
Definition: rtf.h:199
#define rtfPrintData
Definition: rtf.h:347
#define rtfDrawShadow
Definition: rtf.h:847
#define rtfDrawSolidEndArrow
Definition: rtf.h:828
#define rtfFontCodePage
Definition: rtf.h:737
#define rtfGutterWid
Definition: rtf.h:325
#define rtfLeaderHyphen
Definition: rtf.h:488
#define rtfParHangIndent
Definition: rtf.h:498
#define rtfENoteNumURoman
Definition: rtf.h:315
#define rtfBitmapPlanes
Definition: rtf.h:609
#define rtfNext
Definition: rtf.h:274
#define rtfRowKeep
Definition: rtf.h:426
#define rtfPageNumLevel
Definition: rtf.h:138
#define rtfTranspMetafiles
Definition: rtf.h:340
#define rtfLineStart
Definition: rtf.h:282
#define rtfParNumFontSize
Definition: rtf.h:520
#define rtfDrawTextBoxText
Definition: rtf.h:803
#define rtfSectMarginTop
Definition: rtf.h:385
#define rtfDistFromTextAll
Definition: rtf.h:668
#define rtfPosXRight
Definition: rtf.h:656
#define rtfPaperWidth
Definition: rtf.h:317
#define rtfENoteBottom
Definition: rtf.h:297
#define rtfPicGoalWid
Definition: rtf.h:613
#define rtfPaperSize
Definition: rtf.h:319
#define rtfSuperScript
Definition: rtf.h:588
#define rtfSectDef
Definition: rtf.h:359
#define rtfPrtBin
Definition: rtf.h:362
#define rtfObjCropBottom
Definition: rtf.h:691
#define rtfAnnotation
Definition: rtf.h:171
#define rtfPosYInline
Definition: rtf.h:663
#define rtfINChars
Definition: rtf.h:222
#define rtfFooterFirst
Definition: rtf.h:147
#define rtfFNoteCont
Definition: rtf.h:234
#define rtfFieldAlt
Definition: rtf.h:639
#define rtfRowBordBottom
Definition: rtf.h:431
#define rtfFontTbl
Definition: rtf.h:110
#define rtfFieldEdited
Definition: rtf.h:636
#define rtfINWords
Definition: rtf.h:221
#define rtfBookmarkLastCol
Definition: rtf.h:628
#define rtfNoUnderline
Definition: rtf.h:586
#define rtfENContSep
Definition: rtf.h:136
#define rtfDrawArc
Definition: rtf.h:770
#define rtfObjPubAutoUpdate
Definition: rtf.h:702
#define rtfSuppressTopSpace
Definition: rtf.h:337
#define rtfFNoteNumULetter
Definition: rtf.h:307
#define rtfSectLandscape
Definition: rtf.h:388
#define rtfTextDistY
Definition: rtf.h:671
#define rtfFTypeNil
Definition: rtf.h:738
#define rtfFontCharSet
Definition: rtf.h:735
#define rtfObjResMerge
Definition: rtf.h:700
#define rtfBottomMargin
Definition: rtf.h:323
#define rtfDrawShadowYOffset
Definition: rtf.h:849
#define rtfISecond
Definition: rtf.h:219
#define rtfENoteNumChicago
Definition: rtf.h:316
#define rtfFNoteStart
Definition: rtf.h:298
#define rtfDrawBgFillRed
Definition: rtf.h:837
#define rtfIBackupTime
Definition: rtf.h:212
#define rtfNormalStyleNum
Definition: rtf.h:71
#define rtfMakeBackup
Definition: rtf.h:284
#define rtfBorderLeft
Definition: rtf.h:530
#define rtfPageNumHyphSep
Definition: rtf.h:402
#define rtfFNoteEndDoc
Definition: rtf.h:291
#define rtfFENoteType
Definition: rtf.h:289
#define rtfStrikeThru
Definition: rtf.h:582
#define rtfTblAttr
Definition: rtf.h:414
#define rtfDrawLineWidth
Definition: rtf.h:824
#define rtfLinkStyles
Definition: rtf.h:330
#define rtfSpecialChar
Definition: rtf.h:206
#define rtfPosYBottom
Definition: rtf.h:666
#define rtfLineDist
Definition: rtf.h:376
#define rtfPicMFBitsPerPixel
Definition: rtf.h:623
#define rtfDefLanguage
Definition: rtf.h:288
#define rtfRowLeft
Definition: rtf.h:420
#define rtfTabDecimal
Definition: rtf.h:485
#define rtfNoBreak
Definition: rtf.h:364
#define rtfFormShading
Definition: rtf.h:345
#define rtfFFRoman
Definition: rtf.h:193
#define rtfParNumUnder
Definition: rtf.h:512
#define rtfSrcMacintosh
Definition: rtf.h:747
#define rtfParNumBold
Definition: rtf.h:508
#define rtfDrawColumnRelY
Definition: rtf.h:763
#define rtfObjScaleX
Definition: rtf.h:694
#define rtfItalic
Definition: rtf.h:575
#define rtfIVerscomm
Definition: rtf.h:129
#define rtfQuadJust
Definition: rtf.h:469
#define rtfRowDef
Definition: rtf.h:415
#define rtfACUnderline
Definition: rtf.h:727
#define rtfNextFile
Definition: rtf.h:130
#define rtfBasedOn
Definition: rtf.h:273
#define rtfPicGoalHt
Definition: rtf.h:614
#define rtfBlue
Definition: rtf.h:204
#define rtfDrawArcFlipY
Definition: rtf.h:811
#define rtfEOF
Definition: rtf.h:82
#define rtfParDef
Definition: rtf.h:456
#define rtfParNumLRoman
Definition: rtf.h:505
#define rtfOddBreak
Definition: rtf.h:368
#define rtfColBreak
Definition: rtf.h:365
#define rtfFontPitch
Definition: rtf.h:736
#define rtfBookmarkStart
Definition: rtf.h:152
#define rtfObjPublisher
Definition: rtf.h:680
#define rtfObjTransposeY
Definition: rtf.h:689
#define rtfCellDiagHatchBgPat
Definition: rtf.h:445
#define rtfCOLength
Definition: rtf.h:792
#define rtfRowHeader
Definition: rtf.h:425
#define rtfTabRight
Definition: rtf.h:483
#define rtfCellBgPatV
Definition: rtf.h:441
#define rtfRowLeftEdge
Definition: rtf.h:423
#define rtfCOAttachAbsDist
Definition: rtf.h:788
#define rtfFunctionKey
Definition: rtf.h:711
#define rtfIComment
Definition: rtf.h:126
#define rtfExpandTwips
Definition: rtf.h:571
#define rtfENoteEndSect
Definition: rtf.h:294
#define rtfParNumCenter
Definition: rtf.h:524
#define rtfENoteNumArabic
Definition: rtf.h:311
#define rtfRPosMargV
Definition: rtf.h:658
#define rtfDrawLineRed
Definition: rtf.h:815
#define rtfMirrorMargin
Definition: rtf.h:326
#define rtfDrawColumnRelX
Definition: rtf.h:760
#define rtfIIntID
Definition: rtf.h:223
#define rtfParNumStartAt
Definition: rtf.h:527
#define rtfGenerator
Definition: rtf.h:184
#define rtfBorderColor
Definition: rtf.h:543
#define rtfPosXInside
Definition: rtf.h:654
#define rtfAnnotProtected
Definition: rtf.h:352
#define rtfObjResult
Definition: rtf.h:162
#define rtfEmbeddedFont
Definition: rtf.h:112
#define rtfCellBordRight
Definition: rtf.h:438
#define rtfFormula
Definition: rtf.h:256
#define rtfOutline
Definition: rtf.h:576
#define rtfBottomVAlign
Definition: rtf.h:408
#define rtfPSOverlay
Definition: rtf.h:286
#define rtfDrawOffsetY
Definition: rtf.h:781
#define rtfObjWid
Definition: rtf.h:686
#define rtfSpaceMultiply
Definition: rtf.h:477
#define rtfRowBordHoriz
Definition: rtf.h:433
#define rtfPageURoman
Definition: rtf.h:398
#define rtfDarkDiagHatchBgPat
Definition: rtf.h:557
#define rtfTOC
Definition: rtf.h:182
#define rtfObjICEmb
Definition: rtf.h:681
#define rtfParNumULetter
Definition: rtf.h:502
#define rtfDrawFillPatIndex
Definition: rtf.h:845
#define rtfParNumDbUnder
Definition: rtf.h:514
#define rtfDrawLock
Definition: rtf.h:758
#define rtfWidowCtrl
Definition: rtf.h:329
#define rtfRevised
Definition: rtf.h:577
#define rtfPrtBinFirst
Definition: rtf.h:361
#define rtfDarkBgPatH
Definition: rtf.h:552
#define rtfObjCropTop
Definition: rtf.h:690
#define rtfObject
Definition: rtf.h:155
#define rtfDrawEndArrowLength
Definition: rtf.h:827
#define rtfSectNum
Definition: rtf.h:230
#define rtfStyleSheet
Definition: rtf.h:117
#define rtfLandscape
Definition: rtf.h:327
#define rtfFNoteNumLLetter
Definition: rtf.h:306
#define rtfFieldResult
Definition: rtf.h:177
#define rtfParSimple
Definition: rtf.h:494
#define rtfDropCapType
Definition: rtf.h:673
#define rtfObjLink
Definition: rtf.h:677
#define rtfSectPageWid
Definition: rtf.h:381
#define rtfDrawBgFillPalette
Definition: rtf.h:838
#define rtfNestLevel
Definition: rtf.h:560
#define rtfACFontNum
Definition: rtf.h:719
void(* RTFFuncPtr)(RTF_Info *)
Definition: rtf.h:1088
#define rtfCOAngle
Definition: rtf.h:784
#define rtfCell
Definition: rtf.h:235
#define rtfACharAttr
Definition: rtf.h:713
#define rtfFileAttr
Definition: rtf.h:741
#define rtfPictAttr
Definition: rtf.h:601
#define rtfFNoteRestartCont
Definition: rtf.h:302
#define rtfSectStyle
Definition: rtf.h:944
#define rtfObjEmb
Definition: rtf.h:676
#define rtfDrawLineSolid
Definition: rtf.h:823
#define rtfNoStyleNum
Definition: rtf.h:70
#define rtfRed
Definition: rtf.h:202
#define rtfFormDisplay
Definition: rtf.h:346
#define rtfColumnSpace
Definition: rtf.h:370
#define rtfIYear
Definition: rtf.h:214
#define rtfPlain
Definition: rtf.h:563
#define rtfDrawFgFillBlue
Definition: rtf.h:840
#define rtfTOCType
Definition: rtf.h:642
#define rtfICreateTime
Definition: rtf.h:209
#define rtfCenterVAlign
Definition: rtf.h:409
#define rtfFieldPrivate
Definition: rtf.h:638
#define rtfPixelBits
Definition: rtf.h:608
#define rtfMergeRngFirst
Definition: rtf.h:418
#define rtfNoReqHyphen
Definition: rtf.h:258
#define rtfSrcHPFS
Definition: rtf.h:750
#define rtfFwdDiagBgPat
Definition: rtf.h:548
#define rtfDataField
Definition: rtf.h:178
#define rtfRightIndent
Definition: rtf.h:473
#define rtfForeColor
Definition: rtf.h:591
#define rtfACSmallCaps
Definition: rtf.h:724
#define rtfFNoteNumLRoman
Definition: rtf.h:308
#define rtfENoteStart
Definition: rtf.h:299
#define rtfFNoteEndSect
Definition: rtf.h:290
#define rtfHyphHotZone
Definition: rtf.h:278
#define rtfDeleted
Definition: rtf.h:566
#define rtfNoWidthJoiner
Definition: rtf.h:263
#define rtfEmSpace
Definition: rtf.h:249
#define rtfDrawLineDash
Definition: rtf.h:819
#define rtfENoteRestartCont
Definition: rtf.h:304
#define rtfTemplate
Definition: rtf.h:131
#define rtfPosNegY
Definition: rtf.h:662
#define rtfCellBwdDiagBgPat
Definition: rtf.h:443
#define rtfRTLSect
Definition: rtf.h:411
#define rtfCellBgPatH
Definition: rtf.h:440
#define rtfCONegXQuadrant
Definition: rtf.h:793
#define rtfSubScript
Definition: rtf.h:567
#define rtfRowHt
Definition: rtf.h:424
#define rtfMaxDestination
Definition: rtf.h:189
#define rtfCellBordLeft
Definition: rtf.h:437
#define rtfCharAttr
Definition: rtf.h:562
#define rtfACDotUnderline
Definition: rtf.h:728
#define rtfLanguage
Definition: rtf.h:597
#define rtfSoftColumn
Definition: rtf.h:243
#define rtfFNAlt
Definition: rtf.h:705
#define rtfDrawPolygon
Definition: rtf.h:774
#define rtfIRevisionTime
Definition: rtf.h:210
#define rtfBookmarkAttr
Definition: rtf.h:626
#define rtfENoteHere
Definition: rtf.h:360
#define rtfAllCaps
Definition: rtf.h:565
#define rtfSmallCaps
Definition: rtf.h:580
#define rtfCOAttachCenter
Definition: rtf.h:790
#define rtfHyphCaps
Definition: rtf.h:280
#define rtfCOAccentBar
Definition: rtf.h:785
#define rtfCOBorder
Definition: rtf.h:787
#define rtfParNumLLetter
Definition: rtf.h:504
#define rtfDiagHatchBgPat
Definition: rtf.h:551
#define rtfDefFont
Definition: rtf.h:98
#define rtfObjResRTF
Definition: rtf.h:696
#define rtfPBBefore
Definition: rtf.h:465
#define rtfNoParam
Definition: rtf.h:62
#define rtfAnnotRef
Definition: rtf.h:172
#define rtfBorderHair
Definition: rtf.h:541
#define rtfText
Definition: rtf.h:80
#define rtfLeftMargin
Definition: rtf.h:320
#define rtfObjTopic
Definition: rtf.h:164
#define rtfTOCAttr
Definition: rtf.h:641
#define rtfAltKey
Definition: rtf.h:708
#define rtfCOTripleLine
Definition: rtf.h:800
#define rtfParNumRestart
Definition: rtf.h:499
#define rtfSect
Definition: rtf.h:238
#define rtfHeaderFirst
Definition: rtf.h:144
#define rtfObjScaleY
Definition: rtf.h:695
#define rtfPosXLeft
Definition: rtf.h:657
#define rtfDrawLineDot
Definition: rtf.h:820
#define rtfRTLPar
Definition: rtf.h:479
#define rtfRow
Definition: rtf.h:236
#define rtfParNumStrikethru
Definition: rtf.h:517
#define rtfShading
Definition: rtf.h:545
#define rtfInfo
Definition: rtf.h:120
#define rtfFNoteBottom
Definition: rtf.h:293
#define rtfSrcNTFS
Definition: rtf.h:749
#define rtfPosXOutSide
Definition: rtf.h:655
#define rtfParNumInclPrev
Definition: rtf.h:523
#define rtfUTF8RTF
Definition: rtf.h:356
#define rtfTab
Definition: rtf.h:246
#define rtfDrawFgFillGray
Definition: rtf.h:844
#define rtfNoBrkHyphen
Definition: rtf.h:259
#define rtfDrawLine
Definition: rtf.h:773
#define rtfCellPos
Definition: rtf.h:417
#define rtfObjCropRight
Definition: rtf.h:693
#define rtfHeaderRight
Definition: rtf.h:143
#define rtfRevBar
Definition: rtf.h:351
#define rtfSectPageHt
Definition: rtf.h:382
#define rtfLeaderUnder
Definition: rtf.h:489
#define rtfFieldDirty
Definition: rtf.h:635
#define rtfExpand
Definition: rtf.h:570
#define rtfENoteNumULetter
Definition: rtf.h:313
#define rtfCONegYQuadrant
Definition: rtf.h:794
#define rtfDistFromTextX
Definition: rtf.h:669
#define rtfSpaceBetween
Definition: rtf.h:476
#define rtfPageStart
Definition: rtf.h:328
#define rtfCOBestFit
Definition: rtf.h:786
#define rtfCurHeadDateAbbrev
Definition: rtf.h:227
#define rtfNestRow
Definition: rtf.h:269
#define rtfHatchBgPat
Definition: rtf.h:550
#define rtfShowHardBreaks
Definition: rtf.h:342
#define rtfObjSection
Definition: rtf.h:161
#define rtfParAttr
Definition: rtf.h:455
#define rtfParNumCardinal
Definition: rtf.h:500
#define rtfShiftKey
Definition: rtf.h:709
#define rtfObjClass
Definition: rtf.h:156
#define rtfISubject
Definition: rtf.h:122
#define rtfSectStyleNum
Definition: rtf.h:363
#define rtfCellFwdDiagBgPat
Definition: rtf.h:442
#define rtfDrawMarginRelY
Definition: rtf.h:764
#define rtfRightMargin
Definition: rtf.h:321
#define rtfNestCell
Definition: rtf.h:268
#define rtfSpaceBefore
Definition: rtf.h:474
#define rtfACAllCaps
Definition: rtf.h:715
#define rtfBold
Definition: rtf.h:564
#define rtfPict
Definition: rtf.h:154
#define rtfColumnSpRight
Definition: rtf.h:372
#define rtfIMinute
Definition: rtf.h:218
#define rtfBorderTop
Definition: rtf.h:528
#define rtfCellBwdDarkBgPat
Definition: rtf.h:449
#define rtfACLanguage
Definition: rtf.h:722
#define rtfSrcDOS
Definition: rtf.h:748
#define rtfDrawEndArrowWidth
Definition: rtf.h:829
#define rtfMaxClass
Definition: rtf.h:83
#define rtfRPosPageH
Definition: rtf.h:649
#define rtfIAuthor
Definition: rtf.h:123
#define rtfDrawSizeY
Definition: rtf.h:782
#define rtfFFDecor
Definition: rtf.h:197
#define rtfAllProtected
Definition: rtf.h:344
#define rtfPosYCenter
Definition: rtf.h:665
#define rtfFFScript
Definition: rtf.h:196
#define rtfNoExtraSpaceRL
Definition: rtf.h:334
#define rtfFooterY
Definition: rtf.h:391
#define rtfDrawLineDashDotDot
Definition: rtf.h:818
#define rtfObjResBitmap
Definition: rtf.h:698
#define rtfRevisionTbl
Definition: rtf.h:119
#define rtfInTable
Definition: rtf.h:459
#define rtfDrawEllipse
Definition: rtf.h:772
#define rtfENoteNumLLetter
Definition: rtf.h:312
#define rtfDrawObject
Definition: rtf.h:165
#define rtfCurHeadDate
Definition: rtf.h:225
#define rtfFFSwiss
Definition: rtf.h:194
#define rtfAnnotTime
Definition: rtf.h:173
#define rtfCellDarkDiagHatchBgPat
Definition: rtf.h:451
#define rtfKeyCodeAttr
Definition: rtf.h:707
#define rtfNeXTGWidth
Definition: rtf.h:631
#define rtfFFNil
Definition: rtf.h:192
#define rtfFontFile
Definition: rtf.h:113
#define rtfDrawCallout
Definition: rtf.h:771
#define rtfObjData
Definition: rtf.h:159
#define rtfSoftPage
Definition: rtf.h:242
#define rtfPageNumEndashSep
Definition: rtf.h:406
#define rtfRevProtected
Definition: rtf.h:348
#define rtfNoNestTables
Definition: rtf.h:186
#define rtfObjAlias
Definition: rtf.h:160
#define rtfFooterRight
Definition: rtf.h:146
#define rtfFNoteRestartPage
Definition: rtf.h:300
#define rtfCharSet
Definition: rtf.h:100
#define rtfSectMarginGutter
Definition: rtf.h:387
#define rtfDrawBgFillGreen
Definition: rtf.h:836
#define rtfParNumForeColor
Definition: rtf.h:518
#define rtfPicHt
Definition: rtf.h:612
#define rtfTOCLevel
Definition: rtf.h:643
#define rtfCODoubleLine
Definition: rtf.h:797
#define rtfCombineTblBorders
Definition: rtf.h:339
#define rtfObjAlign
Definition: rtf.h:688
#define rtfLineModulus
Definition: rtf.h:375
#define rtfControl
Definition: rtf.h:81
#define rtfBorderThick
Definition: rtf.h:536
#define rtfLDblQuote
Definition: rtf.h:254
#define rtfDrawStartArrowWidth
Definition: rtf.h:833
#define rtfDrawHollowStartArrow
Definition: rtf.h:830
#define rtfTopVAlign
Definition: rtf.h:407
#define rtfFirstIndent
Definition: rtf.h:471
#define rtfIndexItalic
Definition: rtf.h:858
#define rtfFieldLocked
Definition: rtf.h:637
#define rtfObjResPict
Definition: rtf.h:697
#define rtfOutlineLevel
Definition: rtf.h:463
#define rtfLTRMark
Definition: rtf.h:261
#define rtfFontSize
Definition: rtf.h:574
#define rtfFooterLeft
Definition: rtf.h:145
#define rtfBorderDot
Definition: rtf.h:539
#define rtfObjCropLeft
Definition: rtf.h:692
#define rtfIndexBold
Definition: rtf.h:857
#define rtfIIntVersion
Definition: rtf.h:208
#define rtfRevDisplay
Definition: rtf.h:350
#define rtfBookmarkEnd
Definition: rtf.h:153
#define rtfParStyle
Definition: rtf.h:942
#define rtfCellDarkBgPatH
Definition: rtf.h:446
#define rtfObjResText
Definition: rtf.h:699
#define rtfDrawLineBlue
Definition: rtf.h:813
#define rtfDrawTextBox
Definition: rtf.h:777
#define rtfDrawRoundRect
Definition: rtf.h:804
#define rtfBwdDiagBgPat
Definition: rtf.h:549
#define rtfHeaderY
Definition: rtf.h:390
#define rtfBwdDarkBgPat
Definition: rtf.h:555
#define rtfLTRSect
Definition: rtf.h:412
#define rtfIMonth
Definition: rtf.h:215
#define rtfPicWid
Definition: rtf.h:611
#define rtfObjItem
Definition: rtf.h:163
#define rtfRevAuthor
Definition: rtf.h:578
#define rtfFNoteNumArabic
Definition: rtf.h:305
#define rtfIHour
Definition: rtf.h:217
#define rtfJustVAlign
Definition: rtf.h:410
#define rtfBackColor
Definition: rtf.h:592
#define rtfCharStyle
Definition: rtf.h:943
#define rtfHeader
Definition: rtf.h:140
#define rtfTabBar
Definition: rtf.h:486
#define rtfFracWidth
Definition: rtf.h:283
#define rtfDarkBgPatV
Definition: rtf.h:553
#define rtfENoteRestart
Definition: rtf.h:303
#define rtfEnDash
Definition: rtf.h:248
#define rtfTabPos
Definition: rtf.h:481
#define rtfCellFwdDarkBgPat
Definition: rtf.h:448
#define rtfFileRelPath
Definition: rtf.h:743
#define rtfHyphAuto
Definition: rtf.h:281
#define rtfNoAutoTabIndent
Definition: rtf.h:331
#define rtfPageNumEmdashSep
Definition: rtf.h:405
#define rtfMacCharSet
Definition: rtf.h:102
#define rtfLineRestart
Definition: rtf.h:378
#define rtfIndexAttr
Definition: rtf.h:855
#define rtfParNumIndent
Definition: rtf.h:521
#define rtfNoColumnBalance
Definition: rtf.h:335
#define rtfDocAttr
Definition: rtf.h:276
#define rtfOptDest
Definition: rtf.h:260
#define rtfPicCropTop
Definition: rtf.h:618
#define rtfStyleNum
Definition: rtf.h:457
#define rtfBitmapWid
Definition: rtf.h:610
#define rtfObjLock
Definition: rtf.h:683
#define rtfSwapBorders
Definition: rtf.h:341
#define rtfSectMarginLeft
Definition: rtf.h:383
#define rtfLTRDoc
Definition: rtf.h:354
#define rtfIPrintTime
Definition: rtf.h:211
#define rtfDrawEndGroup
Definition: rtf.h:769
#define rtfNoBrkSpace
Definition: rtf.h:257
#define rtfGroup
Definition: rtf.h:79
#define rtfDrawPageRelY
Definition: rtf.h:762
#define rtfPaperHeight
Definition: rtf.h:318
#define rtfParNumRight
Definition: rtf.h:526
#define rtfPageBreak
Definition: rtf.h:366
#define rtfAnnotID
Definition: rtf.h:169
#define rtfEmDash
Definition: rtf.h:247
#define rtfLTRChar
Definition: rtf.h:594
#define rtfSrcNetwork
Definition: rtf.h:751
#define rtfCOAttachBottom
Definition: rtf.h:789
#define rtfRTLMark
Definition: rtf.h:262
#define rtfColumnWidth
Definition: rtf.h:373
#define rtfRPosPageV
Definition: rtf.h:659
#define rtfACDbUnderline
Definition: rtf.h:729
#define rtfRPosMargH
Definition: rtf.h:648
#define rtfIKeywords
Definition: rtf.h:125
#define rtfCurFNote
Definition: rtf.h:231
#define rtfSpaceAfter
Definition: rtf.h:475
#define rtfPicScaleY
Definition: rtf.h:616
#define rtfDrawMarginRelX
Definition: rtf.h:761
#define rtfParNumWordUnder
Definition: rtf.h:516
#define rtfColorTbl
Definition: rtf.h:116
#define rtfBorderBetween
Definition: rtf.h:532
#define rtfDrawPageRelX
Definition: rtf.h:759
#define rtfACShadow
Definition: rtf.h:725
#define rtfParNumDotUnder
Definition: rtf.h:513
#define rtfFontAltName
Definition: rtf.h:111
#define rtfDrawLinePalette
Definition: rtf.h:816
#define rtfDrawSizeX
Definition: rtf.h:780
#define rtfTabLeft
Definition: rtf.h:482
#define rtfDrawPolyCount
Definition: rtf.h:808
#define rtfCharStyleNum
Definition: rtf.h:595
#define rtfNoSuperSub
Definition: rtf.h:569
#define rtfCOAttachTop
Definition: rtf.h:791
#define rtfDestination
Definition: rtf.h:109
#define rtfDrawFgFillPalette
Definition: rtf.h:843
#define rtfLineStarts
Definition: rtf.h:377
#define rtfInvisible
Definition: rtf.h:590
#define rtfWrapSpaces
Definition: rtf.h:332
#define rtfFNoteNumChicago
Definition: rtf.h:310
#define rtfFontNum
Definition: rtf.h:573
#define rtfKerning
Definition: rtf.h:572
#define rtfObjSubscriber
Definition: rtf.h:679
#define rtfENoteText
Definition: rtf.h:296
#define rtfObjBookmarkPubObj
Definition: rtf.h:701
#define rtfSoftLineHt
Definition: rtf.h:245
#define rtfRowBordVert
Definition: rtf.h:434
#define rtfTitleSpecial
Definition: rtf.h:389
#define rtfDrawArcFlipX
Definition: rtf.h:810
#define rtfACItalic
Definition: rtf.h:721
#define rtfLeaderThick
Definition: rtf.h:490
#define rtfENSep
Definition: rtf.h:135
#define rtfKeyCode
Definition: rtf.h:118
#define rtfPageDecimal
Definition: rtf.h:397
#define rtfIDay
Definition: rtf.h:216
#define rtfDrawPointX
Definition: rtf.h:806
#define rtfNoWrap
Definition: rtf.h:667
#define rtfUnknown
Definition: rtf.h:78
#define rtfDevIndBitmap
Definition: rtf.h:605
#define rtfCellBordTop
Definition: rtf.h:436
#define rtfPicScaleX
Definition: rtf.h:615
#define rtfFileTbl
Definition: rtf.h:114
#define rtfParNumURoman
Definition: rtf.h:503
#define rtfIndexNumber
Definition: rtf.h:856
#define rtfParNumDecimal
Definition: rtf.h:501
#define rtfLeaderEqual
Definition: rtf.h:491
#define rtfPageNumRight
Definition: rtf.h:395
#define rtfAnsiCharSet
Definition: rtf.h:101
#define rtfRevisions
Definition: rtf.h:349
#define rtfParNumSpacing
Definition: rtf.h:522
#define rtfBorderBox
Definition: rtf.h:534
#define rtfRPosParaV
Definition: rtf.h:660
#define rtfLineRestartPg
Definition: rtf.h:379
#define rtfIEditTime
Definition: rtf.h:213
#define rtfPicBinary
Definition: rtf.h:624
#define rtfParNumOrdinal
Definition: rtf.h:506
#define rtfACForeColor
Definition: rtf.h:716
#define rtfParNumSmallCaps
Definition: rtf.h:511
#define rtfLQuote
Definition: rtf.h:252
#define rtfDarkHatchBgPat
Definition: rtf.h:556
#define rtfRowBordRight
Definition: rtf.h:432
#define rtfDrawSolidStartArrow
Definition: rtf.h:832
#define rtfBorderSpace
Definition: rtf.h:544
#define rtfACFontSize
Definition: rtf.h:720
#define rtfACOutline
Definition: rtf.h:723
#define rtfNeXTGraphic
Definition: rtf.h:183
#define rtfDrawOffsetX
Definition: rtf.h:779
#define rtfCellBgPatLineColor
Definition: rtf.h:452
#define rtfObjAttr
Definition: rtf.h:675
#define rtfFNoteRestart
Definition: rtf.h:301
#define rtfPcaCharSet
Definition: rtf.h:104
#define rtfPicCropBottom
Definition: rtf.h:619
#define rtfIOperator
Definition: rtf.h:124
#define rtfSectMarginRight
Definition: rtf.h:384
#define rtfDotUnderline
Definition: rtf.h:584
#define rtfEnSpace
Definition: rtf.h:250
#define rtfTabCenter
Definition: rtf.h:484
#define rtfLeftIndent
Definition: rtf.h:472
#define rtfPicCropRight
Definition: rtf.h:621
#define rtfParNumAllCaps
Definition: rtf.h:510
#define rtfParNumOrdinalText
Definition: rtf.h:507
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
#define CP_UTF8
Definition: nls.h:20
#define memset(x, y, z)
Definition: compat.h:39
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
#define TRACE(s)
Definition: solgame.cpp:4
Definition: rtf.h:979
Definition: rtf.h:960
int rtfFNum
Definition: rtf.h:963
int rtfFType
Definition: rtf.h:967
int rtfFPitch
Definition: rtf.h:966
int rtfFFamily
Definition: rtf.h:964
RTFFont * rtfNextFont
Definition: rtf.h:969
char * rtfFName
Definition: rtf.h:961
int rtfFCodePage
Definition: rtf.h:968
int rtfFCharSet
Definition: rtf.h:965
char * rtfFAltName
Definition: rtf.h:962
int rtfKMajor
Definition: reader.c:1246
const char * rtfKStr
Definition: reader.c:1248
int rtfKMinor
Definition: reader.c:1247
int rtfKHash
Definition: reader.c:1249
int rtfSEMinor
Definition: rtf.h:1006
char * rtfSEText
Definition: rtf.h:1008
int rtfSEParam
Definition: rtf.h:1007
RTFStyleElt * rtfNextSE
Definition: rtf.h:1009
int rtfSEClass
Definition: rtf.h:1004
int rtfSEMajor
Definition: rtf.h:1005
Definition: rtf.h:989
Definition: rtf.h:1026
RTFTable * parent
Definition: rtf.h:1044
Definition: _hash_fun.h:40
Definition: parse.h:23
RTFKey ** value
Definition: reader.c:2164
Definition: pdh_main.c:96
#define DEFAULT_PITCH
Definition: wingdi.h:443
#define RUSSIAN_CHARSET
Definition: wingdi.h:396
#define FF_DONTCARE
Definition: wingdi.h:448
#define ARABIC_CHARSET
Definition: wingdi.h:394
#define HANGEUL_CHARSET
Definition: wingdi.h:387
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define THAI_CHARSET
Definition: wingdi.h:397
#define GREEK_CHARSET
Definition: wingdi.h:391
#define JOHAB_CHARSET
Definition: wingdi.h:401
#define CHINESEBIG5_CHARSET
Definition: wingdi.h:390
#define ANSI_CHARSET
Definition: wingdi.h:383
#define TCI_SRCCHARSET
Definition: wingdi.h:961
#define OEM_CHARSET
Definition: wingdi.h:400
#define VIETNAMESE_CHARSET
Definition: wingdi.h:402
#define MAC_CHARSET
Definition: wingdi.h:403
#define HEBREW_CHARSET
Definition: wingdi.h:393
#define SHIFTJIS_CHARSET
Definition: wingdi.h:386
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define SYMBOL_CHARSET
Definition: wingdi.h:385
#define EASTEUROPE_CHARSET
Definition: wingdi.h:399
#define GB2312_CHARSET
Definition: wingdi.h:389
#define BALTIC_CHARSET
Definition: wingdi.h:395
#define TURKISH_CHARSET
Definition: wingdi.h:392
#define CP_OEMCP
Definition: winnls.h:249
#define CP_SYMBOL
Definition: winnls.h:252
#define CP_MACCP
Definition: winnls.h:250
__wchar_t WCHAR
Definition: xmlstorage.h:180