diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Scintilla.h | 118 | ||||
-rw-r--r-- | include/WinDefs.h | 37 |
2 files changed, 133 insertions, 22 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h index d79441309..4a812fc0e 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -9,10 +9,6 @@ // Compile-time configuration options #define MACRO_SUPPORT 1 // Comment out to remove macro hooks -#if PLAT_WX || PLAT_GTK -#include "WinDefs.h" -#endif - #if PLAT_WIN #ifdef STATIC_BUILD void Scintilla_RegisterClasses(HINSTANCE hInstance); @@ -371,8 +367,8 @@ void Scintilla_RegisterClasses(HINSTANCE hInstance); // Optional module for macro recording #ifdef MACRO_SUPPORT -typedef void (tMacroRecorder)(UINT iMessage, WPARAM wParam, LPARAM lParam, - void *userData); +typedef void (tMacroRecorder)(unsigned int iMessage, unsigned long wParam, + long lParam, void *userData); #define SCI_STARTRECORD SCI_OPTIONAL_START + 1 #define SCI_STOPRECORD SCI_OPTIONAL_START + 2 #endif @@ -421,10 +417,49 @@ typedef void (tMacroRecorder)(UINT iMessage, WPARAM wParam, LPARAM lParam, #define SCN_MARGINCLICK 2010 #define SCN_NEEDSHOWN 2011 +// For compatibility, these go through the COMMAND notification rather than NOTIFY +#define SCEN_CHANGE 768 +#define SCEN_SETFOCUS 512 +#define SCEN_KILLFOCUS 256 + // End of definitions that could be generated from Scintilla.iface +// These structures are defined to be exactly the same shape as the Win32 +// CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. +// So older code that treats Scintilla as a RichEdit will work. + +struct CharacterRange { + long cpMin; + long cpMax; +}; + +struct TextRange { + CharacterRange chrg; + char *lpstrText; +}; + +struct TextToFind { + CharacterRange chrg; + char *lpstrText; + CharacterRange chrgText; +}; + +struct RangeToFormat { + SurfaceID hdc; + SurfaceID hdcTarget; + PRectangle rc; + PRectangle rcPage; + CharacterRange chrg; +}; + +struct NotifyHeader { + WindowID hwndFrom; + unsigned int idFrom; + unsigned int code; +}; + struct SCNotification { - NMHDR nmhdr; + NotifyHeader nmhdr; int position; // SCN_STYLENEEDED, SCN_MODIFIED int ch; // SCN_CHARADDED, SCN_KEY int modifiers; // SCN_KEY @@ -445,6 +480,75 @@ struct SCNotification { #define SC_MASK_FOLDERS ((1<<SC_MARKNUM_FOLDER) | (1<<SC_MARKNUM_FOLDEROPEN)) +// Moving from WM_* and EM_* +#define SCI_CANPASTE 5000 +#define SCI_CANUNDO 5001 +#define SCI_POINTXFROMPOSITION 5034 +#define SCI_POINTYFROMPOSITION 5035 +#define SCI_EMPTYUNDOBUFFER 5003 +#define SCI_GETSEL 5004 +#define SCI_SETSEL 5005 +#define SCI_LINEFROMPOSITION 5006 +#define SCI_FINDTEXT 5036 +#define SCI_FORMATRANGE 5037 +#define SCI_GETFIRSTVISIBLELINE 5007 +#define SCI_GETLINE 5028 +#define SCI_GETLINECOUNT 5008 +//#define SCI_GETMARGINS (212) +#define SCI_GETMARGINLEFT 5030 +#define SCI_GETMARGINRIGHT 5031 +#define SCI_SETMARGINLEFT 5032 +#define SCI_SETMARGINRIGHT 5033 +#define SCI_GETMODIFY 5009 +#define SCI_GETSELTEXT 5010 +#define SCI_GETTEXTRANGE 5011 +#define SCI_HIDESELECTION 5012 +#define SCI_POSITIONFROMLINE 5013 +#define SCI_LINESCROLL 5014 +#define SCI_REPLACESEL 5015 +#define SCI_SCROLLCARET 5016 +#define SCI_SETMARGINS 5017 +#define SCI_SETREADONLY 5018 +#define SCI_UNDO 5019 + +#define SCI_NULL 5020 +#define SCI_CLEAR 5021 +#define SCI_COPY 5022 +#define SCI_CUT 5023 +#define SCI_GETTEXT 5024 +#define SCI_GETTEXTLENGTH 5025 +#define SCI_PASTE 5026 +#define SCI_SETTEXT 5027 + +#define SCFIND_MATCHCASE 4 +#define SCFIND_WHOLEWORD 2 +#define SCFIND_DOWN 1 + +// Symbolic key codes + +#define SCK_DOWN 40 +#define SCK_UP 38 +#define SCK_LEFT 37 +#define SCK_RIGHT 39 +#define SCK_HOME 36 +#define SCK_END 35 +#define SCK_PRIOR 33 +#define SCK_NEXT 34 +#define SCK_DELETE 46 +#define SCK_INSERT 45 +#define SCK_ESCAPE 27 +#define SCK_BACK 8 +#define SCK_TAB 9 +#define SCK_RETURN 13 +#define SCK_ADD 107 +#define SCK_SUBTRACT 109 +#define SCK_DIVIDE 111 + +#define SCMOD_SHIFT 16 +#define SCMOD_CTRL 8 +#define SCMOD_ALT 2 + + // Deprecation section listing all API features that are deprecated and will // will be removed completely in a future version. // To enable these features define INCLUDE_DEPRECATED_FEATURES diff --git a/include/WinDefs.h b/include/WinDefs.h index d1c25a595..c56f02d81 100644 --- a/include/WinDefs.h +++ b/include/WinDefs.h @@ -16,6 +16,7 @@ #define LPSTR char * #define LONG long +//#if 0 /* RTF control */ #define EM_CANPASTE (1074) #define EM_CANUNDO (198) @@ -52,12 +53,10 @@ #define WM_NULL (0) #define WM_CLEAR (771) -#define WM_COMMAND (273) #define WM_COPY (769) #define WM_CUT (768) #define WM_GETTEXT (13) #define WM_GETTEXTLENGTH (14) -#define WM_NOTIFY (78) #define WM_PASTE (770) #define WM_SETTEXT (12) #define WM_UNDO (772) @@ -70,6 +69,9 @@ #define EC_RIGHTMARGIN 2 #define EC_USEFONTINFO 0xffff +//#endif + +#if 0 #if PLAT_GTK #define VK_DOWN GDK_Down #define VK_UP GDK_Up @@ -109,12 +111,16 @@ #define VK_SUBTRACT WXK_SUBTRACT //TODO: #define VK_DIVIDE WXK_DIVIDE +#endif + +#define SHIFT_PRESSED 1 +#define LEFT_CTRL_PRESSED 2 +#define LEFT_ALT_PRESSED 4 // Are these needed any more #define LPSTR char * #define LONG long #define LPDWORD (long *) -#endif /* SELCHANGE structure */ #define SEL_EMPTY (0) @@ -123,15 +129,6 @@ #define SEL_MULTICHAR (4) #define SEL_MULTIOBJECT (8) -/* FINDREPLACE structure */ -#define FR_MATCHCASE (0x4) -#define FR_WHOLEWORD (0x2) -#define FR_DOWN (0x1) - -#define SHIFT_PRESSED 1 -#define LEFT_CTRL_PRESSED 2 -#define LEFT_ALT_PRESSED 4 - struct RECT { LONG left; LONG top; @@ -139,6 +136,15 @@ struct RECT { LONG bottom; }; +/* FINDREPLACE structure */ + +#define FR_MATCHCASE (0x4) +#define FR_WHOLEWORD (0x2) +#define FR_DOWN (0x1) + +#endif + +#if 0 struct CHARRANGE { LONG cpMin; LONG cpMax; @@ -168,9 +174,10 @@ struct FORMATRANGE { RECT rcPage; CHARRANGE chrg; }; +#endif -#define MAKELONG(a, b) ((a) | ((b) << 16)) -#define LOWORD(x) (x & 0xffff) -#define HIWORD(x) (x >> 16) +//#define MAKELONG(a, b) ((a) | ((b) << 16)) +//#define LOWORD(x) (x & 0xffff) +//#define HIWORD(x) (x >> 16) #endif |