📄 rtf.h
字号:
# define rtfDrawTextBox 18 /* new in 1.10 */
# define rtfDrawOffsetX 19 /* new in 1.10 */
# define rtfDrawSizeX 20 /* new in 1.10 */
# define rtfDrawOffsetY 21 /* new in 1.10 */
# define rtfDrawSizeY 22 /* new in 1.10 */
# define rtfCOAngle 23 /* new in 1.10 */
# define rtfCOAccentBar 24 /* new in 1.10 */
# define rtfCOBestFit 25 /* new in 1.10 */
# define rtfCOBorder 26 /* new in 1.10 */
# define rtfCOAttachAbsDist 27 /* new in 1.10 */
# define rtfCOAttachBottom 28 /* new in 1.10 */
# define rtfCOAttachCenter 29 /* new in 1.10 */
# define rtfCOAttachTop 30 /* new in 1.10 */
# define rtfCOLength 31 /* new in 1.10 */
# define rtfCONegXQuadrant 32 /* new in 1.10 */
# define rtfCONegYQuadrant 33 /* new in 1.10 */
# define rtfCOOffset 34 /* new in 1.10 */
# define rtfCOAttachSmart 35 /* new in 1.10 */
# define rtfCODoubleLine 36 /* new in 1.10 */
# define rtfCORightAngle 37 /* new in 1.10 */
# define rtfCOSingleLine 38 /* new in 1.10 */
# define rtfCOTripleLine 39 /* new in 1.10 */
# define rtfDrawTextBoxMargin 40 /* new in 1.10 */
# define rtfDrawTextBoxText 41 /* new in 1.10 */
# define rtfDrawRoundRect 42 /* new in 1.10 */
# define rtfDrawPointX 43 /* new in 1.10 */
# define rtfDrawPointY 44 /* new in 1.10 */
# define rtfDrawPolyCount 45 /* new in 1.10 */
# define rtfDrawArcFlipX 46 /* new in 1.10 */
# define rtfDrawArcFlipY 47 /* new in 1.10 */
# define rtfDrawLineBlue 48 /* new in 1.10 */
# define rtfDrawLineGreen 49 /* new in 1.10 */
# define rtfDrawLineRed 50 /* new in 1.10 */
# define rtfDrawLinePalette 51 /* new in 1.10 */
# define rtfDrawLineDashDot 52 /* new in 1.10 */
# define rtfDrawLineDashDotDot 53 /* new in 1.10 */
# define rtfDrawLineDash 54 /* new in 1.10 */
# define rtfDrawLineDot 55 /* new in 1.10 */
# define rtfDrawLineGray 56 /* new in 1.10 */
# define rtfDrawLineHollow 57 /* new in 1.10 */
# define rtfDrawLineSolid 58 /* new in 1.10 */
# define rtfDrawLineWidth 59 /* new in 1.10 */
# define rtfDrawHollowEndArrow 60 /* new in 1.10 */
# define rtfDrawEndArrowLength 61 /* new in 1.10 */
# define rtfDrawSolidEndArrow 62 /* new in 1.10 */
# define rtfDrawEndArrowWidth 63 /* new in 1.10 */
# define rtfDrawHollowStartArrow 64 /* new in 1.10 */
# define rtfDrawStartArrowLength 65 /* new in 1.10 */
# define rtfDrawSolidStartArrow 66 /* new in 1.10 */
# define rtfDrawStartArrowWidth 67 /* new in 1.10 */
# define rtfDrawBgFillBlue 68 /* new in 1.10 */
# define rtfDrawBgFillGreen 69 /* new in 1.10 */
# define rtfDrawBgFillRed 70 /* new in 1.10 */
# define rtfDrawBgFillPalette 71 /* new in 1.10 */
# define rtfDrawBgFillGray 72 /* new in 1.10 */
# define rtfDrawFgFillBlue 73 /* new in 1.10 */
# define rtfDrawFgFillGreen 74 /* new in 1.10 */
# define rtfDrawFgFillRed 75 /* new in 1.10 */
# define rtfDrawFgFillPalette 76 /* new in 1.10 */
# define rtfDrawFgFillGray 77 /* new in 1.10 */
# define rtfDrawFillPatIndex 78 /* new in 1.10 */
# define rtfDrawShadow 79 /* new in 1.10 */
# define rtfDrawShadowXOffset 80 /* new in 1.10 */
# define rtfDrawShadowYOffset 81 /* new in 1.10 */
/*
* index entry attributes
*/
# define rtfIndexAttr 27 /* new in 1.10 */
# define rtfIndexNumber 0 /* new in 1.10 */
# define rtfIndexBold 1 /* reclassified in 1.10 */
# define rtfIndexItalic 2 /* reclassified in 1.10 */
/*
* \wmetafile argument values
*/
# define rtfWmMmText 1
# define rtfWmMmLometric 2
# define rtfWmMmHimetric 3
# define rtfWmMmLoenglish 4
# define rtfWmMmHienglish 5
# define rtfWmMmTwips 6
# define rtfWmMmIsotropic 7
# define rtfWmMmAnisotropic 8
/*
* \pmmetafile argument values
*/
# define rtfPmPuArbitrary 4
# define rtfPmPuPels 8
# define rtfPmPuLometric 12
# define rtfPmPuHimetric 16
# define rtfPmPuLoenglish 20
# define rtfPmPuHienglish 24
# define rtfPmPuTwips 28
/*
* \lang argument values
*/
# define rtfLangNoLang 0x0400
# define rtfLangAlbanian 0x041c
# define rtfLangArabic 0x0401
# define rtfLangBahasa 0x0421
# define rtfLangBelgianDutch 0x0813
# define rtfLangBelgianFrench 0x080c
# define rtfLangBrazilianPortuguese 0x0416
# define rtfLangBulgarian 0x0402
# define rtfLangCatalan 0x0403
# define rtfLangLatinCroatoSerbian 0x041a
# define rtfLangCzech 0x0405
# define rtfLangDanish 0x0406
# define rtfLangDutch 0x0413
# define rtfLangAustralianEnglish 0x0c09
# define rtfLangUKEnglish 0x0809
# define rtfLangUSEnglish 0x0409
# define rtfLangFinnish 0x040b
# define rtfLangFrench 0x040c
# define rtfLangCanadianFrench 0x0c0c
# define rtfLangGerman 0x0407
# define rtfLangGreek 0x0408
# define rtfLangHebrew 0x040d
# define rtfLangHungarian 0x040e
# define rtfLangIcelandic 0x040f
# define rtfLangItalian 0x0410
# define rtfLangJapanese 0x0411
# define rtfLangKorean 0x0412
# define rtfLangBokmalNorwegian 0x0414
# define rtfLangNynorskNorwegian 0x0814
# define rtfLangPolish 0x0415
# define rtfLangPortuguese 0x0816
# define rtfLangRhaetoRomanic 0x0417
# define rtfLangRomanian 0x0418
# define rtfLangRussian 0x0419
# define rtfLangCyrillicSerboCroatian 0x081a
# define rtfLangSimplifiedChinese 0x0804
# define rtfLangSlovak 0x041b
# define rtfLangCastilianSpanish 0x040a
# define rtfLangMexicanSpanish 0x080a
# define rtfLangSwedish 0x041d
# define rtfLangSwissFrench 0x100c
# define rtfLangSwissGerman 0x0807
# define rtfLangSwissItalian 0x0810
# define rtfLangThai 0x041e
# define rtfLangTraditionalChinese 0x0404
# define rtfLangTurkish 0x041f
# define rtfLangUrdu 0x0420
/*
* Style types
*/
# define rtfParStyle 0 /* the default */
# define rtfCharStyle 1
# define rtfSectStyle 2
/*
* RTF font, color and style structures. Used for font table,
* color table, and stylesheet processing.
*/
typedef struct RTFFont RTFFont;
typedef struct RTFColor RTFColor;
typedef struct RTFStyle RTFStyle;
typedef struct RTFStyleElt RTFStyleElt;
struct RTFFont
{
char *rtfFName; /* font name */
char *rtfFAltName; /* font alternate name */
int rtfFNum; /* font number */
int rtfFFamily; /* font family */
int rtfFCharSet; /* font charset */
int rtfFPitch; /* font pitch */
int rtfFType; /* font type */
int rtfFCodePage; /* font code page */
RTFFont *rtfNextFont; /* next font in list */
};
/*
* Color values are -1 if the default color for the the color
* number should be used. The default color is writer-dependent.
*/
struct RTFColor
{
int rtfCNum; /* color number */
int rtfCRed; /* red value */
int rtfCGreen; /* green value */
int rtfCBlue; /* blue value */
RTFColor *rtfNextColor; /* next color in list */
};
struct RTFStyle
{
char *rtfSName; /* style name */
int rtfSType; /* style type */
int rtfSAdditive; /* whether or not style is additive */
int rtfSNum; /* style number */
int rtfSBasedOn; /* style this one's based on */
int rtfSNextPar; /* style next paragraph style */
RTFStyleElt *rtfSSEList; /* list of style words */
int rtfExpanding; /* non-zero = being expanded */
RTFStyle *rtfNextStyle; /* next style in style list */
};
struct RTFStyleElt
{
int rtfSEClass; /* token class */
int rtfSEMajor; /* token major number */
int rtfSEMinor; /* token minor number */
int rtfSEParam; /* control symbol parameter */
char *rtfSEText; /* text of symbol */
RTFStyleElt *rtfNextSE; /* next element in style */
};
/*
* Return pointer to new element of type t, or NULL
* if no memory available.
*/
# define New(t) ((t *) RTFAlloc ((int) sizeof (t)))
/* Parser stack size */
# define maxStack 32
struct _RTF_Info;
typedef struct _RTF_Info RTF_Info;
typedef void (*RTFFuncPtr) (RTF_Info *); /* generic function pointer */
/* RTF parser stack element */
struct tagRTFState {
CHARFORMAT2W fmt;
int codePage;
int unicodeLength;
};
typedef struct tagRTFState RTFState;
struct _RTF_Info {
/*
* Public variables (listed in rtf.h)
*/
/*
* Information pertaining to last token read by RTFToken. The
* text is exactly as it occurs in the input file, e.g., "\{"
* will be found in rtfTextBuf as "\{", even though it means "{".
* These variables are also set when styles are reprocessed.
*/
int rtfClass;
int rtfMajor;
int rtfMinor;
int rtfParam;
int rtfFormat;
char *rtfTextBuf;
int rtfTextLen;
long rtfLineNum;
int rtfLinePos;
/*
* Private stuff
*/
int pushedChar; /* pushback char if read too far */
int pushedClass; /* pushed token info for RTFUngetToken() */
int pushedMajor;
int pushedMinor;
int pushedParam;
char *pushedTextBuf;
int prevChar;
int bumpLine;
/* Document-wide attributes */
RTFFont *fontList; /* these lists MUST be */
RTFColor *colorList; /* initialized to NULL */
RTFStyle *styleList;
int ansiCodePage; /* ANSI codepage used in conversion to Unicode */
int defFont;
/* Character attributes */
int unicodeLength; /* The length of ANSI representation of Unicode characters */
int codePage; /* Current codepage for text conversion */
char *inputName;
char *outputName;
ME_InStream *stream;
/* edit window to output to */
HWND hwndEdit;
ME_TextEditor *editor;
ME_Style *style;
RTFFuncPtr ccb[rtfMaxClass]; /* class callbacks */
RTFFuncPtr dcb[rtfMaxDestination]; /* destination callbacks */
RTFFuncPtr readHook;
DWORD dwOutputCount;
WCHAR OutputBuffer[0x1000];
DWORD dwCPOutputCount;
DWORD dwMaxCPOutputCount;
char *cpOutputBuffer;
RTFState stack[maxStack];
int stackTop;
BOOL styleChanged;
};
/*
* Public RTF reader routines
*/
void RTFInit (RTF_Info *);
void RTFDestroy(RTF_Info *info);
void RTFSetInputName (RTF_Info *, char *);
char *RTFGetInputName (RTF_Info *);
void RTFSetOutputName (RTF_Info *, char *);
char *RTFGetOutputName (RTF_Info *);
void RTFSetClassCallback (RTF_Info *, int, RTFFuncPtr);
RTFFuncPtr RTFGetClassCallback (RTF_Info *, int);
void RTFSetDestinationCallback (RTF_Info *, int, RTFFuncPtr);
RTFFuncPtr RTFGetDestinationCallback (RTF_Info *, int);
void RTFRead (RTF_Info *);
int RTFGetToken (RTF_Info *); /* writer should rarely need this */
void RTFUngetToken (RTF_Info *);
int RTFPeekToken (RTF_Info *);
void RTFSetToken (RTF_Info *, int, int, int, int, const char *);
void RTFSetReadHook (RTF_Info *, RTFFuncPtr);
RTFFuncPtr RTFGetReadHook (RTF_Info *);
void RTFRouteToken (RTF_Info *);
void RTFSkipGroup (RTF_Info *);
void RTFExpandStyle (RTF_Info *, int);
int RTFCheckCM (RTF_Info *, int, int);
int RTFCheckCMM (RTF_Info *, int, int, int);
int RTFCheckMM (RTF_Info *, int, int);
RTFFont *RTFGetFont (RTF_Info *, int);
RTFColor *RTFGetColor (RTF_Info *, int);
RTFStyle *RTFGetStyle (RTF_Info *, int);
int RTFCharToHex ( char);
int RTFHexToChar ( int );
void RTFFlushOutputBuffer( RTF_Info *info );
void RTFSetEditStream(RTF_Info *info, ME_InStream *stream);
void WriterInit (RTF_Info *);
int BeginFile (RTF_Info *);
int RTFCharSetToCodePage(RTF_Info *info, int charset);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -