diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-24 19:31:06 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-24 19:31:06 +1000 |
commit | 92290868cf9753d2df0d494cb44e2ff62a570b58 (patch) | |
tree | 001e6cfce84372a03997de3138d630751ee8d38a /include/ScintillaStructures.h | |
parent | ee1886079d0a5cd350ee8e3379be347943ba93ae (diff) | |
download | scintilla-mirror-92290868cf9753d2df0d494cb44e2ff62a570b58.tar.gz |
Define C++ version of the Scintilla API in ScintillaTypes.h, ScintillaMessages.h
and ScintillaStructures.h using scoped enumerations.
Use these headers instead of Scintilla.h internally.
External definitions go in the Scintilla namespace and internal definitio0ns in
Scintilla::Internal.
Diffstat (limited to 'include/ScintillaStructures.h')
-rw-r--r-- | include/ScintillaStructures.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/include/ScintillaStructures.h b/include/ScintillaStructures.h new file mode 100644 index 000000000..6bd16e8c1 --- /dev/null +++ b/include/ScintillaStructures.h @@ -0,0 +1,103 @@ +// Scintilla source code edit control +/** @file ScintillaStructures.h + ** Structures used to communicate with Scintilla. + ** The same structures are defined for C in Scintilla.h. + ** Uses definitions from ScintillaTypes.h. + **/ +// Copyright 2021 by Neil Hodgson <neilh@scintilla.org> +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef SCINTILLASTRUCTURES_H +#define SCINTILLASTRUCTURES_H + +namespace Scintilla { + +using PositionCR = long; + +struct CharacterRange { + PositionCR cpMin; + PositionCR cpMax; +}; + +struct TextRange { + CharacterRange chrg; + char *lpstrText; +}; + +struct TextToFind { + CharacterRange chrg; + const char *lpstrText; + CharacterRange chrgText; +}; + +using SurfaceID = void *; + +struct Rectangle { + int left; + int top; + int right; + int bottom; +}; + +/* This structure is used in printing. Not needed by most client code. */ + +struct RangeToFormat { + SurfaceID hdc; + SurfaceID hdcTarget; + Rectangle rc; + Rectangle rcPage; + CharacterRange chrg; +}; + +struct NotifyHeader { + /* Compatible with Windows NMHDR. + * hwndFrom is really an environment specific window handle or pointer + * but most clients of Scintilla.h do not have this type visible. */ + void *hwndFrom; + uptr_t idFrom; + Notification code; +}; + +struct NotificationData { + NotifyHeader nmhdr; + Position position; + /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ + /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ + /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */ + /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ + /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ + + int ch; + /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */ + /* SCN_USERLISTSELECTION */ + KeyMod modifiers; + /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ + /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ + + ModificationFlags modificationType; /* SCN_MODIFIED */ + const char *text; + /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ + + Position length; /* SCN_MODIFIED */ + Position linesAdded; /* SCN_MODIFIED */ + Message message; /* SCN_MACRORECORD */ + uptr_t wParam; /* SCN_MACRORECORD */ + sptr_t lParam; /* SCN_MACRORECORD */ + Position line; /* SCN_MODIFIED */ + FoldLevel foldLevelNow; /* SCN_MODIFIED */ + FoldLevel foldLevelPrev; /* SCN_MODIFIED */ + int margin; /* SCN_MARGINCLICK */ + int listType; /* SCN_USERLISTSELECTION */ + int x; /* SCN_DWELLSTART, SCN_DWELLEND */ + int y; /* SCN_DWELLSTART, SCN_DWELLEND */ + int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ + Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ + Update updated; /* SCN_UPDATEUI */ + CompletionMethods listCompletionMethod; + /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */ + CharacterSource characterSource; /* SCN_CHARADDED */ +}; + +} + +#endif |