| 1 | // Scintilla source code edit control | 
| 2 | /** @file ScintillaStructures.h | 
| 3 |  ** Structures used to communicate with Scintilla. | 
| 4 |  ** The same structures are defined for C in Scintilla.h. | 
| 5 |  ** Uses definitions from ScintillaTypes.h. | 
| 6 |  **/ | 
| 7 | // Copyright 2021 by Neil Hodgson <neilh@scintilla.org> | 
| 8 | // The License.txt file describes the conditions under which this software may be distributed. | 
| 9 |  | 
| 10 | #ifndef SCINTILLASTRUCTURES_H | 
| 11 | #define SCINTILLASTRUCTURES_H | 
| 12 |  | 
| 13 | namespace Scintilla { | 
| 14 |  | 
| 15 | using PositionCR = long; | 
| 16 |  | 
| 17 | struct CharacterRange { | 
| 18 | 	PositionCR cpMin; | 
| 19 | 	PositionCR cpMax; | 
| 20 | }; | 
| 21 |  | 
| 22 | struct  { | 
| 23 | 	CharacterRange ; | 
| 24 | 	char *; | 
| 25 | }; | 
| 26 |  | 
| 27 | struct TextToFind { | 
| 28 | 	CharacterRange chrg; | 
| 29 | 	const char *lpstrText; | 
| 30 | 	CharacterRange chrgText; | 
| 31 | }; | 
| 32 |  | 
| 33 | using SurfaceID = void *; | 
| 34 |  | 
| 35 | struct Rectangle { | 
| 36 | 	int left; | 
| 37 | 	int top; | 
| 38 | 	int right; | 
| 39 | 	int bottom; | 
| 40 | }; | 
| 41 |  | 
| 42 | /* This structure is used in printing. Not needed by most client code. */ | 
| 43 |  | 
| 44 | struct RangeToFormat { | 
| 45 | 	SurfaceID hdc; | 
| 46 | 	SurfaceID hdcTarget; | 
| 47 | 	Rectangle rc; | 
| 48 | 	Rectangle rcPage; | 
| 49 | 	CharacterRange chrg; | 
| 50 | }; | 
| 51 |  | 
| 52 | struct  { | 
| 53 | 	/* Compatible with Windows NMHDR. | 
| 54 | 	 * hwndFrom is really an environment specific window handle or pointer | 
| 55 | 	 * but most clients of Scintilla.h do not have this type visible. */ | 
| 56 | 	void *; | 
| 57 | 	uptr_t ; | 
| 58 | 	Notification ; | 
| 59 | }; | 
| 60 |  | 
| 61 | struct NotificationData { | 
| 62 | 	NotifyHeader nmhdr; | 
| 63 | 	Position position; | 
| 64 | 	/* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ | 
| 65 | 	/* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ | 
| 66 | 	/* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */ | 
| 67 | 	/* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ | 
| 68 | 	/* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ | 
| 69 |  | 
| 70 | 	int ch; | 
| 71 | 	/* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */ | 
| 72 | 	/* SCN_USERLISTSELECTION */ | 
| 73 | 	KeyMod modifiers; | 
| 74 | 	/* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ | 
| 75 | 	/* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ | 
| 76 |  | 
| 77 | 	ModificationFlags modificationType;	/* SCN_MODIFIED */ | 
| 78 | 	const char *text; | 
| 79 | 	/* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ | 
| 80 |  | 
| 81 | 	Position length;		/* SCN_MODIFIED */ | 
| 82 | 	Position linesAdded;	/* SCN_MODIFIED */ | 
| 83 | 	Message message;	/* SCN_MACRORECORD */ | 
| 84 | 	uptr_t wParam;	/* SCN_MACRORECORD */ | 
| 85 | 	sptr_t lParam;	/* SCN_MACRORECORD */ | 
| 86 | 	Position line;		/* SCN_MODIFIED */ | 
| 87 | 	FoldLevel foldLevelNow;	/* SCN_MODIFIED */ | 
| 88 | 	FoldLevel foldLevelPrev;	/* SCN_MODIFIED */ | 
| 89 | 	int margin;		/* SCN_MARGINCLICK */ | 
| 90 | 	int listType;	/* SCN_USERLISTSELECTION */ | 
| 91 | 	int x;			/* SCN_DWELLSTART, SCN_DWELLEND */ | 
| 92 | 	int y;		/* SCN_DWELLSTART, SCN_DWELLEND */ | 
| 93 | 	int token;		/* SCN_MODIFIED with SC_MOD_CONTAINER */ | 
| 94 | 	Position annotationLinesAdded;	/* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ | 
| 95 | 	Update updated;	/* SCN_UPDATEUI */ | 
| 96 | 	CompletionMethods listCompletionMethod; | 
| 97 | 	/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */ | 
| 98 | 	CharacterSource characterSource;	/* SCN_CHARADDED */ | 
| 99 | }; | 
| 100 |  | 
| 101 | } | 
| 102 |  | 
| 103 | #endif | 
| 104 |  |