forked from Gargaj/Bonzomatic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShaderEditor.h
112 lines (98 loc) · 2.78 KB
/
ShaderEditor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include <stdexcept>
#include <new>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <Scintilla.h>
#include <Platform.h>
#include <ILexer.h>
#ifdef SCI_LEXER
#include <SciLexer.h>
#endif
#include <StringCopy.h>
#ifdef SCI_LEXER
#include <LexerModule.h>
#endif
#include <SplitVector.h>
#include <Partitioning.h>
#include <RunStyles.h>
#include <ContractionState.h>
#include <CellBuffer.h>
#include <CallTip.h>
#include <KeyMap.h>
#include <Indicator.h>
#include <XPM.h>
#include <LineMarker.h>
#include <Style.h>
#include <ViewStyle.h>
#include <CharClassify.h>
#include <Decoration.h>
#include <CaseFolder.h>
#include <Document.h>
#include <CaseConvert.h>
#include <UniConversion.h>
#include <Selection.h>
#include <PositionCache.h>
#include <EditModel.h>
#include <MarginView.h>
#include <EditView.h>
#include <Editor.h>
#include <AutoComplete.h>
#include <ScintillaBase.h>
#ifdef SCI_LEXER
#include <ExternalLexer.h>
#endif
struct SHADEREDITOR_OPTIONS {
std::string sFontPath;
int nFontSize;
Scintilla::PRectangle rect;
unsigned char nOpacity;
bool bUseSpacesForTabs;
int nTabSize;
bool bVisibleWhitespace;
};
class ShaderEditor : public Scintilla::Editor
{
Scintilla::Surface *surfaceWindow;
Scintilla::LexState * lexState;
bool bReadOnly;
bool bHasMouseCapture;
std::string sFontFile;
int nFontSize;
unsigned char nOpacity;
bool bUseSpacesForTabs;
int nTabSize;
bool bVisibleWhitespace;
public:
ShaderEditor(Scintilla::Surface *surfaceWindow);
void Initialise();
void Initialise(SHADEREDITOR_OPTIONS &options);
void SetPosition( Scintilla::PRectangle rect );
void SetVerticalScrollPos();
void SetHorizontalScrollPos();
bool ModifyScrollBars(int nMax, int nPage);
void Copy();
void Paste();
void ClaimSelection();
void NotifyChange();
void NotifyParent(Scintilla::SCNotification scn);
void CopyToClipboard(const Scintilla::SelectionText &selectedText);
void SetMouseCapture(bool on);
bool HaveMouseCapture();
sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
void SetTicking(bool on);
void SetText( char * buf );
void GetText( char * buf, int len );
void Paint();
void SetAStyle(int style, Scintilla::ColourDesired fore, Scintilla::ColourDesired back=0xFFFFFFFF, int size=-1, const char *face=0);
void Tick();
int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed);
void ButtonDown( Scintilla::Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt );
void ButtonMovePublic( Scintilla::Point pt );
void ButtonUp( Scintilla::Point pt, unsigned int curTime, bool ctrl );
void AddCharUTF( const char *s, unsigned int len, bool treatAsDBCS=false );
void NotifyStyleToNeeded(int endStyleNeeded);
void SetReadOnly( bool );
Scintilla::Font * GetTextFont();
};