66static int Hash (
const char *);
104 if (
stream->editstream->dwError)
129 while (
info->fontList)
131 fp =
info->fontList->rtfNextFont;
136 while (
info->colorList)
138 cp =
info->colorList->rtfNextColor;
142 while (
info->styleList)
144 sp =
info->styleList->rtfNextStyle;
145 eltList =
info->styleList->rtfSSEList;
163 if (
info->rtfTextBuf)
170 while (
info->tableDef)
201 return info->ccb[
class];
221 ERR (
"Cannot allocate text buffers.\n");
224 info->rtfTextBuf[0] =
info->pushedTextBuf[0] =
'\0';
247 info->ansiCodePage = 1252;
248 info->unicodeLength = 1;
249 info->codePage =
info->ansiCodePage;
253 info->pushedClass = -1;
256 info->rtfLineNum = 0;
257 info->rtfLinePos = 0;
261 info->dwCPOutputCount = 0;
262 if (!
info->cpOutputBuffer)
264 info->dwMaxCPOutputCount = 0x1000;
269 info->nestingLevel = 0;
271 info->borderType = 0;
274 info->fmt.cbSize =
sizeof(
info->fmt);
327 ERR(
"Unknown class %d: %s (reader malfunction)\n",
396 return (
info->readHook);
424 && (
info->rtfMajor ==
'\r' ||
info->rtfMajor ==
'\n' ||
info->rtfMajor ==
'\0')))
427 return (
info->rtfClass);
433 if (
info->pushedClass >= 0)
434 ERR (
"cannot unget two tokens\n");
435 if (
info->rtfClass < 0)
436 ERR (
"no token to unget\n");
461 info->rtfTextBuf[
info->rtfTextLen = 0] =
'\0';
471 if (
info->pushedClass >= 0)
479 info->pushedClass = -1;
563 info->rtfTextBuf[
info->rtfTextLen = 0] =
'\0';
569 c =
info->pushedChar;
570 info->rtfTextBuf[
info->rtfTextLen++] =
c;
571 info->rtfTextBuf[
info->rtfTextLen] =
'\0';
638 info->stream->editstream->dwError = -14;
644 if (
c ==
':' ||
c ==
'{' ||
c ==
'}' ||
c ==
'\\')
671 info->rtfTextBuf[
info->rtfTextLen-1] =
'\0';
674 info->rtfTextBuf[
info->rtfTextLen-1] =
c;
693 info->rtfParam =
info->rtfParam * 10 +
c -
'0';
708 info->pushedChar =
c;
709 info->rtfTextBuf[--
info->rtfTextLen] =
'\0';
732 info->rtfTextBuf[
info->rtfTextLen++] =
c;
733 info->rtfTextBuf[
info->rtfTextLen] =
'\0';
737 oldBumpLine =
info->bumpLine;
744 if (
info->prevChar ==
'\r')
751 info->rtfLinePos = 1;
806 ERR (
"cannot determine format\n");
811 ERR (
"missing \"{\"\n");
818 ERR (
"cannot allocate font entry\n");
840 switch (
info->rtfMajor)
844 WARN (
"unknown token \"%s\"\n",
851 switch (
info->rtfMinor)
861 switch (
info->rtfMinor)
894 *bp++ =
info->rtfMajor;
906 ERR (
"cannot allocate font name\n");
914 WARN (
"unknown token \"%s\"\n",
info->rtfTextBuf);
926 ERR (
"missing \"}\"\n");
936 TRACE(
"default font codepage %d\n",
info->codePage);
939 if (!fp || (fp->
rtfFNum == -1))
940 ERR(
"missing font number\n");
991 ERR (
"cannot allocate color entry\n");
994 cp->rtfCNum = cnum++;
995 cp->rtfNextColor =
info->colorList;
998 cp->rtfCRed =
cp->rtfCGreen =
cp->rtfCBlue = -1;
1000 cp->rtfCRed =
cp->rtfCGreen =
cp->rtfCBlue = 0;
1002 switch (
info->rtfMinor)
1004 case rtfRed:
cp->rtfCRed =
info->rtfParam & 0xFF;
break;
1014 ERR (
"malformed entry\n");
1041 ERR (
"cannot allocate stylesheet entry\n");
1047 sp->rtfSAdditive = 0;
1049 sp->rtfSNextPar = -1;
1050 sp->rtfSSEList = sepLast =
NULL;
1051 sp->rtfNextStyle =
info->styleList;
1052 sp->rtfExpanding = 0;
1055 ERR (
"missing \"{\"\n");
1067 ERR(
"skipping optional destination\n");
1076 sp->rtfSNum =
info->rtfParam;
1082 sp->rtfSNum =
info->rtfParam;
1088 sp->rtfSNum =
info->rtfParam;
1094 sp->rtfSBasedOn =
info->rtfParam;
1099 sp->rtfSAdditive = 1;
1104 sp->rtfSNextPar =
info->rtfParam;
1110 ERR (
"cannot allocate style element\n");
1119 ERR (
"cannot allocate style element text\n");
1120 if (sepLast ==
NULL)
1121 sp->rtfSSEList = sep;
1133 ERR(
"skipping begin\n");
1142 if (
info->rtfMajor ==
';')
1148 *bp++ =
info->rtfMajor;
1153 if (
sp->rtfSName ==
NULL)
1154 ERR (
"cannot allocate style name\n");
1159 WARN (
"unknown token \"%s\"\n",
info->rtfTextBuf);
1165 ERR (
"missing \"}\"\n");
1176 if (
sp->rtfSName ==
NULL)
1177 ERR (
"missing style name\n");
1178 if (
sp->rtfSNum < 0)
1182 ERR (
"missing style number\n");
1185 if (
sp->rtfSNextPar == -1)
1186 sp->rtfSNextPar =
sp->rtfSNum;
1227 return (
info->fontList);
1228 for (
f =
info->fontList;
f !=
NULL;
f =
f->rtfNextFont)
1230 if (
f->rtfFNum ==
num)
1242 return (
info->colorList);
1243 for (
c =
info->colorList;
c !=
NULL;
c =
c->rtfNextColor)
1245 if (
c->rtfCNum ==
num)
2262 while ((
c = *
s++) !=
'\0')
2278 return (
info->rtfClass ==
class &&
info->rtfMajor ==
major);
2303 return (
c -
'a' + 10);
2359 switch (
info->rtfMajor)
2396 switch (
info->rtfMinor)
2405 info->codePage =
font->rtfFCodePage;
2407 TRACE(
"font %d codepage %d\n",
info->rtfParam,
info->codePage);
2410 ERR(
"unknown font %d\n",
info->rtfParam);
2413 info->unicodeLength =
info->rtfParam;
2425 switch (
info->rtfMinor)
2428 info->ansiCodePage = 1252;
2431 info->ansiCodePage = 10000;
2434 info->ansiCodePage = 437;
2437 info->ansiCodePage = 850;
2467 TRACE(
"minor %d, param %d\n",
info->rtfMinor,
info->rtfParam);
2469 switch (
info->rtfMinor)
2483 switch (
info->rtfMinor)
2501 for (
i = 0;
i <
info->unicodeLength;
i++)
2506 ERR(
"The token behind \\u is not text, but (%d,%d,%d)\n",
2524 info->fmt.cbSize =
sizeof(
info->fmt);
2583 if (
info->dwOutputCount)
2587 info->dwOutputCount = 0;
2595 if (
info->dwCPOutputCount)
2602 info->dwOutputCount += fit;
2613 int bufferMax =
info->dwCPOutputCount * 2 *
sizeof(
WCHAR);
2619 info->dwCPOutputCount = 0;
2628 if (
info->dwCPOutputCount)
2636 if (
info->dwCPOutputCount)
2638 if (
info->dwOutputCount *
sizeof(
WCHAR) >= (
sizeof info->OutputBuffer - 1 ) )
2640 info->OutputBuffer[
info->dwOutputCount++] =
c;
2648 if (
info->dwCPOutputCount >=
info->dwMaxCPOutputCount)
2650 info->dwMaxCPOutputCount *= 2;
2653 info->cpOutputBuffer[
info->dwCPOutputCount++] =
c;
int strcmp(const char *String1, const char *String2)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#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 *)
static char * RTFStrSave(const char *s)
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) DECLSPEC_HIDDEN
BOOL ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
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
#define CHINESEBIG5_CHARSET
#define VIETNAMESE_CHARSET
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define EASTEUROPE_CHARSET