📄 csapi.pas
字号:
unit CSAPI;
//{$A-}
//* CSAPI.H - API entry header file for CSAPI
//*
//* See Csapi.Doc for details on the CSAPI.
//* Note that the double slash comment // should not be used in this file
//* since THINK_C does not support this format.
//*/
interface
uses
Windows;
///* CSAPILOC.H is not part of the public CSAPI,
// normally CSAPILOC_H shouldn't be defined */
//#ifndef CSAPILOC_H
//#ifdef WIN
//#define Windows(x) x
//#define NotWindows(x)
//#define Dos(x)
//#define NotDos(x) x
//#define Macintosh(x)
//#define NotMacintosh(x) x
//#endif
//#ifdef MAC
//#define Windows(x)
//#define NotWindows(x) x
//#define Dos(x)
//#define NotDos(x) x
//#define Macintosh(x) x
//#define NotMacintosh(x)
//#endif
//#ifdef DOS
//#define Windows(x)
//#define NotWindows(x) x
//#define Dos(x) x
//#define NotDos(x)
//#define Macintosh(x)
//#define NotMacintosh(x) x
//#endif
//#endif /* CSAPILOC_H */
type
//* Typedefs: Note: Also in csapiloc.h (ensure always match) */
//#ifndef CSAPILOC_H
//#ifdef NT
//typedef unsigned MDR; /* main dictionary reference*/
TMDR = Cardinal;
//typedef unsigned UDR; /* user dictionary reference*/
TUDR = Cardinal;
//#else
//typedef unsigned short MDR; /* main dictionary reference*/
//typedef unsigned short UDR; /* user dictionary reference*/
//#endif
//typedef unsigned short SCCC; /* Spell Check Command Code */
TSCCC = Word;
///* SPLID is the replacement for SID due to a conflict with the Windows NT
// header files. References to sid i.e. sidSA are left unchanged for
// the sake of less required code changes. */
//typedef unsigned long SPLID; /* Spell Id type */
TSPLID = Cardinal;
//typedef unsigned short SCIS; /* SpellCheckInputStatus*/
TSCIS = Word;
//typedef unsigned short SCRS; /* SpellCheckReturnStatus */
TSCRS = Word;
//typedef unsigned short LID; /* two byte language identifier code */
TLID = Word;
///* Comment out duplicate definitions as needed */
//typedef unsigned char CHAR;
//typedef unsigned char BYTE;
//typedef unsigned short WORD;
//typedef short BOOL;
///* All undefined or unused chars should be mapped to bIgnore. */
//typedef struct WizSpecChars
//{
// BYTE bIgnore;
// BYTE bHyphenHard;
// BYTE bHyphenSoft;
// BYTE bHyphenNonBreaking;
// BYTE bEmDash;
// BYTE bEnDash;
// BYTE bEllipsis;
// BYTE rgLineBreak[2];
// BYTE rgParaBreak[2];
//}WSC;
TWSC = packed record
bIgnore,
bHyphenHard,
bHyphenSoft,
bHyphenNonBreaking,
bEmDash,
bEnDash,
bEllipsis: Char;
rgLineBreak: array[0..1]of Char;
rgParaBreak: array[0..1]of Char;
end;
//#ifndef FAR
//#ifdef MAC
//#define FAR
//#else
//#define FAR far
//#endif
//#endif
//#endif /* CSAPILOC_H */
///************************** Structure Typedefs *************/
//typedef WORD SEC; /* Spell Error Code. Low byte for major code, High byte for minor.*/
TSEC = Word;
//typedef struct SpellInputBuffer
//{
// unsigned short cch; /* Total characters in buffer area */
// unsigned short cMdr; /* Count of MDR's specified in lrgMdr */
// unsigned short cUdr; /* Should not reference Exclusion UDR's.
// Count of UDR's specified in lrgUdr */
// unsigned short wSpellState; /* State relative to previous SpellCheck() call */
// CHAR FAR *lrgch; /* ptr to buf area of text to be spell checked */
// MDR FAR *lrgMdr; /* List of main dicts to use when spelling the buffer */
// UDR FAR *lrgUdr; /* Should not reference Exclusion UDR's.
// List of user dicts to use when spelling the buffer */
//} SIB;
//typedef SIB FAR * LPSIB;
TSIB = packed record
cch: Word;
cMdr,
cUdr: Word;
wSpellState: Word;
lrgch: PChar;
lrgMdr: ^TMDR;
lrgUdr: ^TUDR;
end;
PSIB = ^TSIB;
//typedef struct SpellReturnBuffer
//{
// /* These fields are set by the SpellCheck() function */
// /* reference word in error or flagged into SIB. */
// unsigned short ichError; /*position in the SIB */
// unsigned short cchError; /*Length of error "word" in SIB.*/
//
// /* These fields are set by the SpellCheck() function. */
// SCRS scrs; /*spell check return status. Set by SC()*/
// unsigned short csz; /*count of sz's put in buffer. Set by SC*/
// unsigned short cchMac; /* Current total of chars in buffer. */
//
//
// /* These fields MUST be set by the app, NULL pointers are invalid */
// unsigned short cch; /* total space in lrgch. Set by App. */
// CHAR FAR *lrgsz; /* ptr to alternatives.
// format: word\0word\0...word\0\0*/
// BYTE FAR *lrgbRating;/* ptr to Rating value for each sugg. returned.
// Parallel to lrgsz array. Allocated by App.*/
// unsigned short cbRate; /* Number of elements in lrgbRating.
// Set by App. lrgbRating must be this long.*/
//} SRB;
//typedef SRB FAR * LPSRB;
TSRB = packed record
ichError: Word;
cchError: Word;
scrs: TSCRS;
csz: Word;
cchMac: Word;
cch: Word;
lrgsz: PChar;
lrgbRating: ^Byte;
cbRate: Word;
end;
PSRB= ^TSRB;
//typedef struct mdrs
//{
// MDR mdr;
// LID lid;
// UDR udrExc;
//} MDRS;
//typedef MDRS FAR * LPMDRS;
TMDRS = packed record
mdr: TMDR;
lid: TLID;
udrExc: TUDR;
end;
PMDRS = ^TMDRS;
//#ifndef MAC
//typedef CHAR FAR * LPSPATH; /* ptr to full Sz path string. */
//#else
//typedef struct spath
// {
// short volRefNum;
// long dirID;
// CHAR *lpszFilePath; /* lpSzFile is local Sz path string for MAC,
// it is the local file path which will be
// used with the volRefNum.
// */
// } SPATH;
//typedef SPATH * LPSPATH;
//#endif /* !MAC */
TLPSPATH = PChar;
const
///*-------------------------------------------------------*/
///* All Defines*/
///* Explicit word delimeters. */
//#define chSpaceSpell 0x20 /* ' ' space. Also used to delimit
// "change always" pairs */
chSpaceSpell = #$20;
//#define chTabSpell 0x09 /* TAB. Can be word delimeter or a
// string delimiter for "change once" lists.*/
chTabSpell = #$09;
///*** Additional Word Delimeters. */
///* [] {} () <> / EmDash EnDash Ellipsis New_Paragraph */
//#define chLParenSpell 0x28
//#define chRParenSpell 0x29
//#define chLBracketSpell 0x7B
//#define chRBracketSpell 0x7D
//#define chLBraceSpell 0x5B
//#define chRBraceSpell 0x5D
//#define chLessThanSpell 0x3C
//#define chGreaterThanSpell 0x3E
//#define chForwardSlashSpell 0x2F
chLParenSpell = #$28;
chRParenSpell = #$29;
chLBracketSpell = #$7B;
chRBracketSpell = #$7D;
chLBraceSpell = #$5B;
chRBraceSpell = #$5D;
chLessThanSpell = #$3C;
chGreaterThanSpell = #$3E;
chForwardSlashSpell = #$2F;
///* Spell Id Engine Defines */
//#define sidSA 1 /* SoftArt */
//#define sidHM 2 /* Houghton-Mifflin (InfoSoft) */
//#define sidML 3 /* MicroLytics */
//#define sidLS 4 /* LanSer Data */
//#define sidCT 5 /* Center of Educational Technology */
//#define sidHS 6 /* HSoft */
//#define sidMO 7 /* MorphoLogic */
//#define sidTI 8 /* TiP */
//#define sidKF 9 /* Korea Foreign Language University */
//#define sidPI 10 /* Priberam Informatica Lince */
//#define sidGS 11 /* Glyph Systems */
//#define sidRA 12 /* Radiar */
//#define sidIN 13 /* Intracom */
sidSA = 1;
sidHM = 2;
sidML = 3;
sidLS = 4;
sidCT = 5;
sidHS = 6;
sidMO = 7;
sidTI = 8;
sidKF = 9;
sidPI = 10;
sidGS = 11;
sidRA = 12;
sidIN = 13;
///* IPG two byte language id's. Returned in LID field. */
//#define lidAmerican 0x0409 /* "AM" American English */
//#define lidAustralian 0x0c09 /* "EA" English Australian */
//#define lidBritish 0x0809 /* "BR" English */
//#define lidCatalan 0x0403 /* "CT" Catalan */
//#define lidDanish 0x0406 /* "DA" Danish */
//#define lidDutch 0x0413 /* "NL" Dutch */
//#define lidFinnish 0x040b /* "FI" Finish */
//#define lidFrench 0x040c /* "FR" French */
//#define lidFrenchCanadian 0x0c0c /* "FC" French Canadian */
//#define lidGerman 0x0407 /* "GE" German */
//#define lidItalian 0x0410 /* "IT" Italian */
//#define lidNorskBokmal 0x0414 /* "NO" Norwegian Bokmal */
//#define lidNorskNynorsk 0x0814 /* "NN" Norwegian Nynorsk */
//#define lidPortBrazil 0x0416 /* "PB" Portuguese Brazil */
//#define lidPortIberian 0x0816 /* "PT" Portuguese Iberian */
//#define lidSpanish 0x040a /* "SP" Spanish */
//#define lidSwedish 0x041d /* "SW" Swedish */
//#define lidRussian 0x0419 /* "RU" Russian */
//#define lidCzech 0x0405 /* "CZ" Czech */
//#define lidHungarian 0x040e /* "HU" Hungarian */
//#define lidPolish 0x0415 /* "PL" Polish */
lidAmerican = $0409;
lidAustralian = $0c09;
lidBritish = $0809;
lidCatalan = $0403;
lidDanish = $0406;
lidDutch = $0413;
lidFinnish = $040b;
lidFrench = $040c;
lidFrenchCanadian = $0c0c;
lidGerman = $0407;
lidItalian = $0410;
lidNorskBokmal = $0414;
lidNorskNynorsk = $0814;
lidPortBrazil = $0416;
lidPortIberian = $0816;
lidSpanish = $040a;
lidSwedish = $041d;
lidRussian = $0419;
lidCzech = $0405;
lidHungarian = $040e;
lidPolish = $0415;
//#define LID_UNKNOWN 0xffff
//#define lidUnknown 0xffff
lidUnknown = $FFFF;
///* Ram Cache User Dictionary Reference. */
//#define udrChangeOnce 0xfffc /* UDR reserved reference for Change Once list */
//#define udrChangeAlways 0xfffd /* UDR reserved reference for Change Always list */
//#define udrIgnoreAlways 0xfffe /* UDR reserved reference for Ingore Always list. */
udrChangeOnce = $FFFC;
udrChangeAlways = $FFFD;
udrIgnoreAlways = $FFFE;
///* Word List property types. Note: Code relies on being == to above udr's! */
//#define ChangeOnceProp udrChangeOnce
//#define ChangeAlwaysProp udrChangeAlways
//#define IgnoreAlwaysProp udrIgnoreAlways
ChangeOnceProp = udrChangeOnce;
ChangeAlwaysProp = udrChangeAlways;
IgnoreAlwaysProp = udrIgnoreAlways;
///* Bitfield definitions for SpellInit() Status */
//#define fscisWildCardSupport 0x0001
//#define fscisMultiDictSupport 0x0002
//#define fscisHyphenationSupport 0x0004
//#define scisNULL 0x0000
fscisWildCardSupport = $0001;
fscisMultiDictSupport = $0002;
fscishyphenationSupport = $0004;
scisNull = $0000;
///* Spell Check Command Definitions */
//#define sccVerifyWord 1
//#define sccVerifyBuffer 2
//#define sccSuggest 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -