66static int Hash (
const char *);
87 if (
stream->editstream->dwError)
112 while (
info->fontList)
114 fp =
info->fontList->rtfNextFont;
119 while (
info->colorList)
121 cp =
info->colorList->rtfNextColor;
125 while (
info->styleList)
127 sp =
info->styleList->rtfNextStyle;
128 eltList =
info->styleList->rtfSSEList;
146 if (
info->rtfTextBuf)
153 while (
info->tableDef)
184 return info->ccb[
class];
204 ERR (
"Cannot allocate text buffers.\n");
207 info->rtfTextBuf[0] =
info->pushedTextBuf[0] =
'\0';
230 info->ansiCodePage = 1252;
231 info->unicodeLength = 1;
232 info->codePage =
info->ansiCodePage;
236 info->pushedClass = -1;
239 info->rtfLineNum = 0;
240 info->rtfLinePos = 0;
244 info->dwCPOutputCount = 0;
245 if (!
info->cpOutputBuffer)
247 info->dwMaxCPOutputCount = 0x1000;
252 info->nestingLevel = 0;
254 info->borderType = 0;
257 info->fmt.cbSize =
sizeof(
info->fmt);
310 ERR(
"Unknown class %d: %s (reader malfunction)\n",
379 return (
info->readHook);
407 && (
info->rtfMajor ==
'\r' ||
info->rtfMajor ==
'\n' ||
info->rtfMajor ==
'\0')))
410 return (
info->rtfClass);
416 if (
info->pushedClass >= 0)
417 ERR (
"cannot unget two tokens\n");
418 if (
info->rtfClass < 0)
419 ERR (
"no token to unget\n");
444 info->rtfTextBuf[
info->rtfTextLen = 0] =
'\0';
454 if (
info->pushedClass >= 0)
462 info->pushedClass = -1;
546 info->rtfTextBuf[
info->rtfTextLen = 0] =
'\0';
552 c =
info->pushedChar;
553 info->rtfTextBuf[
info->rtfTextLen++] =
c;
554 info->rtfTextBuf[
info->rtfTextLen] =
'\0';
621 info->stream->editstream->dwError = -14;
627 if (
c ==
':' ||
c ==
'{' ||
c ==
'}' ||
c ==
'\\')
654 info->rtfTextBuf[
info->rtfTextLen-1] =
'\0';
657 info->rtfTextBuf[
info->rtfTextLen-1] =
c;
676 info->rtfParam =
info->rtfParam * 10 +
c -
'0';
691 info->pushedChar =
c;
692 info->rtfTextBuf[--
info->rtfTextLen] =
'\0';
715 info->rtfTextBuf[
info->rtfTextLen++] =
c;
716 info->rtfTextBuf[
info->rtfTextLen] =
'\0';
720 oldBumpLine =
info->bumpLine;
727 if (
info->prevChar ==
'\r')
734 info->rtfLinePos = 1;
789 ERR (
"cannot determine format\n");
794 ERR (
"missing \"{\"\n");
799 fp =
malloc (
sizeof(*fp));
801 ERR (
"cannot allocate font entry\n");
823 switch (
info->rtfMajor)
827 WARN (
"unknown token \"%s\"\n",
834 switch (
info->rtfMinor)
844 switch (
info->rtfMinor)
877 *bp++ =
info->rtfMajor;
889 ERR (
"cannot allocate font name\n");
897 WARN (
"unknown token \"%s\"\n",
info->rtfTextBuf);
909 ERR (
"missing \"}\"\n");
919 TRACE(
"default font codepage %d\n",
info->codePage);
922 if (!fp || (fp->
rtfFNum == -1))
923 ERR(
"missing font number\n");
974 ERR (
"cannot allocate color entry\n");
977 cp->rtfCNum = cnum++;
978 cp->rtfNextColor =
info->colorList;
981 cp->rtfCRed =
cp->rtfCGreen =
cp->rtfCBlue = -1;
983 cp->rtfCRed =
cp->rtfCGreen =
cp->rtfCBlue = 0;
985 switch (
info->rtfMinor)
987 case rtfRed:
cp->rtfCRed =
info->rtfParam & 0xFF;
break;
997 ERR (
"malformed entry\n");
1024 ERR (
"cannot allocate stylesheet entry\n");
1030 sp->rtfSAdditive = 0;
1032 sp->rtfSNextPar = -1;
1033 sp->rtfSSEList = sepLast =
NULL;
1034 sp->rtfNextStyle =
info->styleList;
1035 sp->rtfExpanding = 0;
1038 ERR (
"missing \"{\"\n");
1050 ERR(
"skipping optional destination\n");
1059 sp->rtfSNum =
info->rtfParam;
1065 sp->rtfSNum =
info->rtfParam;
1071 sp->rtfSNum =
info->rtfParam;
1077 sp->rtfSBasedOn =
info->rtfParam;
1082 sp->rtfSAdditive = 1;
1087 sp->rtfSNextPar =
info->rtfParam;
1090 sep =
malloc (
sizeof(*sep));
1093 ERR (
"cannot allocate style element\n");
1102 ERR (
"cannot allocate style element text\n");
1103 if (sepLast ==
NULL)
1104 sp->rtfSSEList = sep;
1116 ERR(
"skipping begin\n");
1125 if (
info->rtfMajor ==
';')
1131 *bp++ =
info->rtfMajor;
1136 if (
sp->rtfSName ==
NULL)
1137 ERR (
"cannot allocate style name\n");
1142 WARN (
"unknown token \"%s\"\n",
info->rtfTextBuf);
1148 ERR (
"missing \"}\"\n");
1159 if (
sp->rtfSName ==
NULL)
1160 ERR (
"missing style name\n");
1161 if (
sp->rtfSNum < 0)
1165 ERR (
"missing style number\n");
1168 if (
sp->rtfSNextPar == -1)
1169 sp->rtfSNextPar =
sp->rtfSNum;
1210 return (
info->fontList);
1211 for (
f =
info->fontList;
f !=
NULL;
f =
f->rtfNextFont)
1213 if (
f->rtfFNum ==
num)
1225 return (
info->colorList);
1226 for (
c =
info->colorList;
c !=
NULL;
c =
c->rtfNextColor)
1228 if (
c->rtfCNum ==
num)
2242 while ((
c = *
s++) !=
'\0')
2258 return (
info->rtfClass ==
class &&
info->rtfMajor ==
major);
2283 return (
c -
'a' + 10);
2339 switch (
info->rtfMajor)
2376 switch (
info->rtfMinor)
2385 info->codePage =
font->rtfFCodePage;
2387 TRACE(
"font %d codepage %d\n",
info->rtfParam,
info->codePage);
2390 ERR(
"unknown font %d\n",
info->rtfParam);
2393 info->unicodeLength =
info->rtfParam;
2405 switch (
info->rtfMinor)
2408 info->ansiCodePage = 1252;
2411 info->ansiCodePage = 10000;
2414 info->ansiCodePage = 437;
2417 info->ansiCodePage = 850;
2447 TRACE(
"minor %d, param %d\n",
info->rtfMinor,
info->rtfParam);
2449 switch (
info->rtfMinor)
2463 switch (
info->rtfMinor)
2481 for (
i = 0;
i <
info->unicodeLength;
i++)
2486 ERR(
"The token behind \\u is not text, but (%d,%d,%d)\n",
2504 info->fmt.cbSize =
sizeof(
info->fmt);
2563 if (
info->dwOutputCount)
2567 info->dwOutputCount = 0;
2575 if (
info->dwCPOutputCount)
2582 info->dwOutputCount += fit;
2593 int bufferMax =
info->dwCPOutputCount * 2 *
sizeof(
WCHAR);
2599 info->dwCPOutputCount = 0;
2608 if (
info->dwCPOutputCount)
2616 if (
info->dwCPOutputCount)
2618 if (
info->dwOutputCount *
sizeof(
WCHAR) >= (
sizeof info->OutputBuffer - 1 ) )
2620 info->OutputBuffer[
info->dwOutputCount++] =
c;
2628 if (
info->dwCPOutputCount >=
info->dwMaxCPOutputCount)
2630 info->dwMaxCPOutputCount *= 2;
2633 info->cpOutputBuffer[
info->dwCPOutputCount++] =
c;
int strcmp(const char *String1, const char *String2)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static const WCHAR ControlClass[]
#define MultiByteToWideChar
void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor)
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
void ME_StreamInFill(ME_InStream *stream)
void ME_RTFTblAttrHook(RTF_Info *info)
void ME_RTFCharAttrHook(RTF_Info *info)
void ME_RTFSpecialCharHook(RTF_Info *info)
void ME_RTFParAttrHook(RTF_Info *info)
int RTFCheckCM(const RTF_Info *info, int class, int major)
static void Lookup(RTF_Info *, char *)
void RTFDestroy(RTF_Info *info)
static void RTFPutCodePageChar(RTF_Info *info, int c)
int RTFCharSetToCodePage(RTF_Info *info, int charset)
static void RTFSetClassCallback(RTF_Info *info, int class, RTFFuncPtr callback)
static void CharAttr(RTF_Info *info)
static void _RTFGetToken(RTF_Info *)
static void SpecialChar(RTF_Info *info)
static void RTFFlushCPOutputBuffer(RTF_Info *info)
static void ReadInfoGroup(RTF_Info *)
static RTFHashTableEntry rtfHashTable[ARRAY_SIZE(rtfKey) *2]
void RTFSetEditStream(RTF_Info *info, ME_InStream *stream)
static void RTFDestroyAttrs(RTF_Info *info)
static RTFFuncPtr RTFGetReadHook(const RTF_Info *info)
static void RTFUngetToken(RTF_Info *info)
static void RTFPutUnicodeChar(RTF_Info *info, int c)
int BeginFile(RTF_Info *info)
static void _RTFGetToken2(RTF_Info *)
static void ReadFontTbl(RTF_Info *)
int RTFGetToken(RTF_Info *info)
static void ReadColorTbl(RTF_Info *)
static void CharSet(RTF_Info *info)
void RTFRead(RTF_Info *info)
static RTFFuncPtr RTFGetDestinationCallback(const RTF_Info *info, int dest)
static void RTFPutUnicodeString(RTF_Info *info, const WCHAR *string, int length)
static void ReadPictGroup(RTF_Info *)
static int GetChar(RTF_Info *)
static void ReadStyleSheet(RTF_Info *)
RTFFont * RTFGetFont(const RTF_Info *info, int num)
void RTFRouteToken(RTF_Info *info)
static int Hash(const char *)
void RTFInit(RTF_Info *info)
int RTFCheckMM(const RTF_Info *info, int major, int minor)
static RTFFuncPtr RTFGetClassCallback(const RTF_Info *info, int class)
void RTFFlushOutputBuffer(RTF_Info *info)
RTFColor * RTFGetColor(const RTF_Info *info, int num)
static void TextClass(RTF_Info *info)
void RTFSetReadHook(RTF_Info *info, RTFFuncPtr f)
struct tagRTFHashTableEntry RTFHashTableEntry
void RTFSkipGroup(RTF_Info *info)
static void RTFFlushUnicodeOutputBuffer(RTF_Info *info)
static void ReadObjGroup(RTF_Info *)
static void DocAttr(RTF_Info *info)
void RTFSetDestinationCallback(RTF_Info *info, int dest, RTFFuncPtr callback)
static void DefFont(RTF_Info *info)
int RTFCheckCMM(const RTF_Info *info, int class, int major, int minor)
static int _RTFGetChar(RTF_Info *)
void WriterInit(RTF_Info *info)
void RTFReadGroup(RTF_Info *info)
void ME_AddRefStyle(ME_Style *item)
BOOL editor_set_selection_para_fmt(ME_TextEditor *editor, const PARAFORMAT2 *fmt)
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
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
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define memmove(s1, s2, n)
static IPrintDialogCallback callback
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
#define rtfPrintColorsBlack
#define rtfHyphConsecLines
#define rtfCellDarkBgPatV
#define rtfDrawFgFillGreen
#define rtfCvtMailMergeQuote
#define rtfBgPatLineColor
#define rtfDrawLineHollow
#define rtfDrawBgFillBlue
#define rtfDrawHollowEndArrow
#define rtfPageNumColonSep
#define rtfSuperScrShrink
#define rtfParNumTextBefore
#define rtfCurHeadDateLong
#define rtfPicMFHasBitmap
#define rtfFNoteNumURoman
#define rtfDrawShadowXOffset
#define rtfNoWidowControl
#define rtfDrawBgFillGray
#define rtfDrawTextBoxMargin
#define rtfParNumTextAfter
#define rtfParNumLevelStyle
#define rtfCellBgPatColor
#define rtfDrawBeginGroup
#define rtfCellDarkHatchBgPat
#define rtfBookmarkFirstCol
#define rtfCellHatchBgPat
#define rtfDrawLineDashDot
#define rtfSuppressPreParSpace
#define rtfNestTableProps
#define rtfPageNumSpaceSep
#define rtfSectMarginBottom
#define rtfDrawGroupCount
#define rtfNoWidthNonJoiner
#define rtfENoteNumLRoman
#define rtfACWordUnderline
#define rtfDrawStartArrowLength
#define rtfCellBordBottom
#define rtfFFBidirectional
#define rtfDrawSolidEndArrow
#define rtfENoteNumURoman
#define rtfTranspMetafiles
#define rtfParNumFontSize
#define rtfDrawTextBoxText
#define rtfDistFromTextAll
#define rtfBookmarkLastCol
#define rtfObjPubAutoUpdate
#define rtfSuppressTopSpace
#define rtfFNoteNumULetter
#define rtfDrawShadowYOffset
#define rtfENoteNumChicago
#define rtfNormalStyleNum
#define rtfPageNumHyphSep
#define rtfPicMFBitsPerPixel
#define rtfDrawColumnRelY
#define rtfCellDiagHatchBgPat
#define rtfCOAttachAbsDist
#define rtfENoteNumArabic
#define rtfDrawColumnRelX
#define rtfAnnotProtected
#define rtfDarkDiagHatchBgPat
#define rtfDrawFillPatIndex
#define rtfDrawEndArrowLength
#define rtfFNoteNumLLetter
#define rtfDrawBgFillPalette
void(* RTFFuncPtr)(RTF_Info *)
#define rtfFNoteRestartCont
#define rtfDrawFgFillBlue
#define rtfFNoteNumLRoman
#define rtfENoteRestartCont
#define rtfCellBwdDiagBgPat
#define rtfCONegXQuadrant
#define rtfMaxDestination
#define rtfACDotUnderline
#define rtfCOAttachCenter
#define rtfDiagHatchBgPat
#define rtfParNumStrikethru
#define rtfParNumInclPrev
#define rtfDrawFgFillGray
#define rtfENoteNumULetter
#define rtfCONegYQuadrant
#define rtfCurHeadDateAbbrev
#define rtfShowHardBreaks
#define rtfParNumCardinal
#define rtfCellFwdDiagBgPat
#define rtfDrawMarginRelY
#define rtfCellBwdDarkBgPat
#define rtfDrawEndArrowWidth
#define rtfNoExtraSpaceRL
#define rtfDrawLineDashDotDot
#define rtfENoteNumLLetter
#define rtfCellDarkDiagHatchBgPat
#define rtfPageNumEndashSep
#define rtfFNoteRestartPage
#define rtfSectMarginGutter
#define rtfDrawBgFillGreen
#define rtfParNumForeColor
#define rtfCombineTblBorders
#define rtfDrawStartArrowWidth
#define rtfDrawHollowStartArrow
#define rtfCellDarkBgPatH
#define rtfFNoteNumArabic
#define rtfCellFwdDarkBgPat
#define rtfNoAutoTabIndent
#define rtfPageNumEmdashSep
#define rtfNoColumnBalance
#define rtfSectMarginLeft
#define rtfCOAttachBottom
#define rtfDrawMarginRelX
#define rtfParNumWordUnder
#define rtfParNumDotUnder
#define rtfDrawLinePalette
#define rtfDrawFgFillPalette
#define rtfFNoteNumChicago
#define rtfObjBookmarkPubObj
#define rtfParNumSmallCaps
#define rtfDarkHatchBgPat
#define rtfDrawSolidStartArrow
#define rtfCellBgPatLineColor
#define rtfSectMarginRight
#define rtfParNumOrdinalText
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
#define CHINESEBIG5_CHARSET
#define VIETNAMESE_CHARSET
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define EASTEUROPE_CHARSET