]> git.saurik.com Git - wxWidgets.git/blame - wxPython/contrib/stc/stc.i
fixes to wint_t and wchar_t handling in unichar.h (fixes FreeBSD compilation and...
[wxWidgets.git] / wxPython / contrib / stc / stc.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: stc.i
3// Purpose: Wrappers for the wxStyledTextCtrl.
4//
5// Author: Robin Dunn
6//
7// Created: 12-Oct-1999
8// RCS-ID: $Id$
9// Copyright: (c) 2000 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
c8fac2b6
RD
13%define DOCSTRING
14"The `StyledTextCtrl` provides a text editor that can used as a syntax
15highlighting source code editor, or similar. Lexers for several programming
16languages are built-in."
17%enddef
b2eb030f
RD
18
19%module(package="wx", docstring=DOCSTRING) stc
d14a1e28
RD
20
21
22%{
23#include "wx/wxPython/wxPython.h"
24#include "wx/wxPython/pyclasses.h"
25#include <wx/stc/stc.h>
d14a1e28
RD
26%}
27
28//---------------------------------------------------------------------------
29
30%import core.i
96b3fa7c 31%import misc.i // for DnD
3727c043
RD
32//%import gdi.i // for wxFontEncoding
33
54f9ee45 34%pythoncode { wx = _core }
99109c0f 35%pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
d14a1e28 36
b2dc1044
RD
37MAKE_CONST_WXSTRING(STCNameStr);
38
39
f2ccce28 40%include _stc_docstrings.i
d14a1e28 41
3727c043
RD
42enum wxFontEncoding; // forward declare
43
be698f50 44MustHaveApp(wxStyledTextCtrl);
d14a1e28
RD
45
46//---------------------------------------------------------------------------
47// Get all our defs from the REAL header file.
48
a7c987f9
RD
49#define wxUSE_STC 1
50#define WXDLLIMPEXP_STC
51#define WXDLLIMPEXP_CORE
d14a1e28
RD
52%include stc.h
53
a7c987f9 54
a15585e0 55%extend wxStyledTextCtrl {
3030ae49
RD
56 %pythoncode {
57 GetCaretLineBack = GetCaretLineBackground
58 SetCaretLineBack = SetCaretLineBackground
59 }
e70b4d2d
RD
60
61
62 %property(Anchor, GetAnchor, SetAnchor, doc="See `GetAnchor` and `SetAnchor`");
63 %property(BackSpaceUnIndents, GetBackSpaceUnIndents, SetBackSpaceUnIndents, doc="See `GetBackSpaceUnIndents` and `SetBackSpaceUnIndents`");
64 %property(BufferedDraw, GetBufferedDraw, SetBufferedDraw, doc="See `GetBufferedDraw` and `SetBufferedDraw`");
65 %property(CaretForeground, GetCaretForeground, SetCaretForeground, doc="See `GetCaretForeground` and `SetCaretForeground`");
66 %property(CaretLineBack, GetCaretLineBack, SetCaretLineBack, doc="See `GetCaretLineBack` and `SetCaretLineBack`");
67 %property(CaretLineBackAlpha, GetCaretLineBackAlpha, SetCaretLineBackAlpha, doc="See `GetCaretLineBackAlpha` and `SetCaretLineBackAlpha`");
68 %property(CaretLineBackground, GetCaretLineBackground, SetCaretLineBackground, doc="See `GetCaretLineBackground` and `SetCaretLineBackground`");
69 %property(CaretLineVisible, GetCaretLineVisible, SetCaretLineVisible, doc="See `GetCaretLineVisible` and `SetCaretLineVisible`");
70 %property(CaretPeriod, GetCaretPeriod, SetCaretPeriod, doc="See `GetCaretPeriod` and `SetCaretPeriod`");
71 %property(CaretSticky, GetCaretSticky, SetCaretSticky, doc="See `GetCaretSticky` and `SetCaretSticky`");
72 %property(CaretWidth, GetCaretWidth, SetCaretWidth, doc="See `GetCaretWidth` and `SetCaretWidth`");
73 %property(CodePage, GetCodePage, SetCodePage, doc="See `GetCodePage` and `SetCodePage`");
74 %property(ControlCharSymbol, GetControlCharSymbol, SetControlCharSymbol, doc="See `GetControlCharSymbol` and `SetControlCharSymbol`");
75 %property(CurLine, GetCurLine, doc="See `GetCurLine`");
76 %property(CurLineRaw, GetCurLineRaw, doc="See `GetCurLineRaw`");
77 %property(CurLineUTF8, GetCurLineUTF8, doc="See `GetCurLineUTF8`");
78 %property(CurrentLine, GetCurrentLine, doc="See `GetCurrentLine`");
79 %property(CurrentPos, GetCurrentPos, SetCurrentPos, doc="See `GetCurrentPos` and `SetCurrentPos`");
80 %property(DocPointer, GetDocPointer, SetDocPointer, doc="See `GetDocPointer` and `SetDocPointer`");
81 %property(EOLMode, GetEOLMode, SetEOLMode, doc="See `GetEOLMode` and `SetEOLMode`");
82 %property(EdgeColour, GetEdgeColour, SetEdgeColour, doc="See `GetEdgeColour` and `SetEdgeColour`");
83 %property(EdgeColumn, GetEdgeColumn, SetEdgeColumn, doc="See `GetEdgeColumn` and `SetEdgeColumn`");
84 %property(EdgeMode, GetEdgeMode, SetEdgeMode, doc="See `GetEdgeMode` and `SetEdgeMode`");
85 %property(EndAtLastLine, GetEndAtLastLine, SetEndAtLastLine, doc="See `GetEndAtLastLine` and `SetEndAtLastLine`");
86 %property(EndStyled, GetEndStyled, doc="See `GetEndStyled`");
87 %property(FirstVisibleLine, GetFirstVisibleLine, doc="See `GetFirstVisibleLine`");
88 %property(HighlightGuide, GetHighlightGuide, SetHighlightGuide, doc="See `GetHighlightGuide` and `SetHighlightGuide`");
89 %property(Indent, GetIndent, SetIndent, doc="See `GetIndent` and `SetIndent`");
90 %property(IndentationGuides, GetIndentationGuides, SetIndentationGuides, doc="See `GetIndentationGuides` and `SetIndentationGuides`");
91 %property(LastKeydownProcessed, GetLastKeydownProcessed, SetLastKeydownProcessed, doc="See `GetLastKeydownProcessed` and `SetLastKeydownProcessed`");
92 %property(LayoutCache, GetLayoutCache, SetLayoutCache, doc="See `GetLayoutCache` and `SetLayoutCache`");
93 %property(Length, GetLength, doc="See `GetLength`");
94 %property(Lexer, GetLexer, SetLexer, doc="See `GetLexer` and `SetLexer`");
95 %property(LineCount, GetLineCount, doc="See `GetLineCount`");
96 %property(MarginLeft, GetMarginLeft, SetMarginLeft, doc="See `GetMarginLeft` and `SetMarginLeft`");
97 %property(MarginRight, GetMarginRight, SetMarginRight, doc="See `GetMarginRight` and `SetMarginRight`");
98 %property(MaxLineState, GetMaxLineState, doc="See `GetMaxLineState`");
99 %property(ModEventMask, GetModEventMask, SetModEventMask, doc="See `GetModEventMask` and `SetModEventMask`");
100 %property(Modify, GetModify, doc="See `GetModify`");
101 %property(MouseDownCaptures, GetMouseDownCaptures, SetMouseDownCaptures, doc="See `GetMouseDownCaptures` and `SetMouseDownCaptures`");
102 %property(MouseDwellTime, GetMouseDwellTime, SetMouseDwellTime, doc="See `GetMouseDwellTime` and `SetMouseDwellTime`");
103 %property(Overtype, GetOvertype, SetOvertype, doc="See `GetOvertype` and `SetOvertype`");
104 %property(PasteConvertEndings, GetPasteConvertEndings, SetPasteConvertEndings, doc="See `GetPasteConvertEndings` and `SetPasteConvertEndings`");
105 %property(PrintColourMode, GetPrintColourMode, SetPrintColourMode, doc="See `GetPrintColourMode` and `SetPrintColourMode`");
106 %property(PrintMagnification, GetPrintMagnification, SetPrintMagnification, doc="See `GetPrintMagnification` and `SetPrintMagnification`");
107 %property(PrintWrapMode, GetPrintWrapMode, SetPrintWrapMode, doc="See `GetPrintWrapMode` and `SetPrintWrapMode`");
108 %property(ReadOnly, GetReadOnly, SetReadOnly, doc="See `GetReadOnly` and `SetReadOnly`");
109 %property(STCCursor, GetSTCCursor, SetSTCCursor, doc="See `GetSTCCursor` and `SetSTCCursor`");
110 %property(STCFocus, GetSTCFocus, SetSTCFocus, doc="See `GetSTCFocus` and `SetSTCFocus`");
111 %property(ScrollWidth, GetScrollWidth, SetScrollWidth, doc="See `GetScrollWidth` and `SetScrollWidth`");
112 %property(SearchFlags, GetSearchFlags, SetSearchFlags, doc="See `GetSearchFlags` and `SetSearchFlags`");
113 %property(SelAlpha, GetSelAlpha, SetSelAlpha, doc="See `GetSelAlpha` and `SetSelAlpha`");
114 %property(SelectedText, GetSelectedText, doc="See `GetSelectedText`");
115 %property(SelectedTextRaw, GetSelectedTextRaw, doc="See `GetSelectedTextRaw`");
116 %property(SelectedTextUTF8, GetSelectedTextUTF8, doc="See `GetSelectedTextUTF8`");
7f3e07a8
RD
117
118 //%property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`");
119 %property(Selection, GetSelection, doc="See `GetSelection`");
120
e70b4d2d
RD
121 %property(SelectionEnd, GetSelectionEnd, SetSelectionEnd, doc="See `GetSelectionEnd` and `SetSelectionEnd`");
122 %property(SelectionMode, GetSelectionMode, SetSelectionMode, doc="See `GetSelectionMode` and `SetSelectionMode`");
123 %property(SelectionStart, GetSelectionStart, SetSelectionStart, doc="See `GetSelectionStart` and `SetSelectionStart`");
124 %property(Status, GetStatus, SetStatus, doc="See `GetStatus` and `SetStatus`");
125 %property(StyleBits, GetStyleBits, SetStyleBits, doc="See `GetStyleBits` and `SetStyleBits`");
126 %property(StyleBitsNeeded, GetStyleBitsNeeded, doc="See `GetStyleBitsNeeded`");
127 %property(TabIndents, GetTabIndents, SetTabIndents, doc="See `GetTabIndents` and `SetTabIndents`");
128 %property(TabWidth, GetTabWidth, SetTabWidth, doc="See `GetTabWidth` and `SetTabWidth`");
129 %property(TargetEnd, GetTargetEnd, SetTargetEnd, doc="See `GetTargetEnd` and `SetTargetEnd`");
130 %property(TargetStart, GetTargetStart, SetTargetStart, doc="See `GetTargetStart` and `SetTargetStart`");
131 %property(Text, GetText, SetText, doc="See `GetText` and `SetText`");
132 %property(TextLength, GetTextLength, doc="See `GetTextLength`");
133 %property(TextRaw, GetTextRaw, SetTextRaw, doc="See `GetTextRaw` and `SetTextRaw`");
134 %property(TextUTF8, GetTextUTF8, SetTextUTF8, doc="See `GetTextUTF8` and `SetTextUTF8`");
135 %property(TwoPhaseDraw, GetTwoPhaseDraw, SetTwoPhaseDraw, doc="See `GetTwoPhaseDraw` and `SetTwoPhaseDraw`");
136 %property(UndoCollection, GetUndoCollection, SetUndoCollection, doc="See `GetUndoCollection` and `SetUndoCollection`");
137 %property(UseAntiAliasing, GetUseAntiAliasing, SetUseAntiAliasing, doc="See `GetUseAntiAliasing` and `SetUseAntiAliasing`");
138 %property(UseHorizontalScrollBar, GetUseHorizontalScrollBar, SetUseHorizontalScrollBar, doc="See `GetUseHorizontalScrollBar` and `SetUseHorizontalScrollBar`");
139 %property(UseTabs, GetUseTabs, SetUseTabs, doc="See `GetUseTabs` and `SetUseTabs`");
140 %property(UseVerticalScrollBar, GetUseVerticalScrollBar, SetUseVerticalScrollBar, doc="See `GetUseVerticalScrollBar` and `SetUseVerticalScrollBar`");
141 %property(ViewEOL, GetViewEOL, SetViewEOL, doc="See `GetViewEOL` and `SetViewEOL`");
142 %property(ViewWhiteSpace, GetViewWhiteSpace, SetViewWhiteSpace, doc="See `GetViewWhiteSpace` and `SetViewWhiteSpace`");
143 %property(WrapMode, GetWrapMode, SetWrapMode, doc="See `GetWrapMode` and `SetWrapMode`");
144 %property(WrapStartIndent, GetWrapStartIndent, SetWrapStartIndent, doc="See `GetWrapStartIndent` and `SetWrapStartIndent`");
145 %property(WrapVisualFlags, GetWrapVisualFlags, SetWrapVisualFlags, doc="See `GetWrapVisualFlags` and `SetWrapVisualFlags`");
146 %property(WrapVisualFlagsLocation, GetWrapVisualFlagsLocation, SetWrapVisualFlagsLocation, doc="See `GetWrapVisualFlagsLocation` and `SetWrapVisualFlagsLocation`");
147 %property(XOffset, GetXOffset, SetXOffset, doc="See `GetXOffset` and `SetXOffset`");
148 %property(Zoom, GetZoom, SetZoom, doc="See `GetZoom` and `SetZoom`");
149}
150
151
152%extend wxStyledTextEvent {
153 %property(Alt, GetAlt, doc="See `GetAlt`");
154 %property(Control, GetControl, doc="See `GetControl`");
155 %property(DragAllowMove, GetDragAllowMove, SetDragAllowMove, doc="See `GetDragAllowMove` and `SetDragAllowMove`");
156 %property(DragResult, GetDragResult, SetDragResult, doc="See `GetDragResult` and `SetDragResult`");
157 %property(DragText, GetDragText, SetDragText, doc="See `GetDragText` and `SetDragText`");
158 %property(FoldLevelNow, GetFoldLevelNow, SetFoldLevelNow, doc="See `GetFoldLevelNow` and `SetFoldLevelNow`");
159 %property(FoldLevelPrev, GetFoldLevelPrev, SetFoldLevelPrev, doc="See `GetFoldLevelPrev` and `SetFoldLevelPrev`");
160 %property(Key, GetKey, SetKey, doc="See `GetKey` and `SetKey`");
161 %property(LParam, GetLParam, SetLParam, doc="See `GetLParam` and `SetLParam`");
162 %property(Length, GetLength, SetLength, doc="See `GetLength` and `SetLength`");
163 %property(Line, GetLine, SetLine, doc="See `GetLine` and `SetLine`");
164 %property(LinesAdded, GetLinesAdded, SetLinesAdded, doc="See `GetLinesAdded` and `SetLinesAdded`");
165 %property(ListType, GetListType, SetListType, doc="See `GetListType` and `SetListType`");
166 %property(Margin, GetMargin, SetMargin, doc="See `GetMargin` and `SetMargin`");
167 %property(Message, GetMessage, SetMessage, doc="See `GetMessage` and `SetMessage`");
168 %property(ModificationType, GetModificationType, SetModificationType, doc="See `GetModificationType` and `SetModificationType`");
169 %property(Modifiers, GetModifiers, SetModifiers, doc="See `GetModifiers` and `SetModifiers`");
170 %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
171 %property(Shift, GetShift, doc="See `GetShift`");
172 %property(Text, GetText, SetText, doc="See `GetText` and `SetText`");
173 %property(WParam, GetWParam, SetWParam, doc="See `GetWParam` and `SetWParam`");
174 %property(X, GetX, SetX, doc="See `GetX` and `SetX`");
175 %property(Y, GetY, SetY, doc="See `GetY` and `SetY`");
3030ae49
RD
176}
177
d14a1e28
RD
178//---------------------------------------------------------------------------
179// Python functions to act like the event macros
180
181%pythoncode {
182EVT_STC_CHANGE = wx.PyEventBinder( wxEVT_STC_CHANGE, 1 )
183EVT_STC_STYLENEEDED = wx.PyEventBinder( wxEVT_STC_STYLENEEDED, 1 )
184EVT_STC_CHARADDED = wx.PyEventBinder( wxEVT_STC_CHARADDED, 1 )
185EVT_STC_SAVEPOINTREACHED = wx.PyEventBinder( wxEVT_STC_SAVEPOINTREACHED, 1 )
186EVT_STC_SAVEPOINTLEFT = wx.PyEventBinder( wxEVT_STC_SAVEPOINTLEFT, 1 )
187EVT_STC_ROMODIFYATTEMPT = wx.PyEventBinder( wxEVT_STC_ROMODIFYATTEMPT, 1 )
188EVT_STC_KEY = wx.PyEventBinder( wxEVT_STC_KEY, 1 )
189EVT_STC_DOUBLECLICK = wx.PyEventBinder( wxEVT_STC_DOUBLECLICK, 1 )
190EVT_STC_UPDATEUI = wx.PyEventBinder( wxEVT_STC_UPDATEUI, 1 )
191EVT_STC_MODIFIED = wx.PyEventBinder( wxEVT_STC_MODIFIED, 1 )
192EVT_STC_MACRORECORD = wx.PyEventBinder( wxEVT_STC_MACRORECORD, 1 )
193EVT_STC_MARGINCLICK = wx.PyEventBinder( wxEVT_STC_MARGINCLICK, 1 )
194EVT_STC_NEEDSHOWN = wx.PyEventBinder( wxEVT_STC_NEEDSHOWN, 1 )
d14a1e28
RD
195EVT_STC_PAINTED = wx.PyEventBinder( wxEVT_STC_PAINTED, 1 )
196EVT_STC_USERLISTSELECTION = wx.PyEventBinder( wxEVT_STC_USERLISTSELECTION, 1 )
197EVT_STC_URIDROPPED = wx.PyEventBinder( wxEVT_STC_URIDROPPED, 1 )
198EVT_STC_DWELLSTART = wx.PyEventBinder( wxEVT_STC_DWELLSTART, 1 )
199EVT_STC_DWELLEND = wx.PyEventBinder( wxEVT_STC_DWELLEND, 1 )
200EVT_STC_START_DRAG = wx.PyEventBinder( wxEVT_STC_START_DRAG, 1 )
201EVT_STC_DRAG_OVER = wx.PyEventBinder( wxEVT_STC_DRAG_OVER, 1 )
202EVT_STC_DO_DROP = wx.PyEventBinder( wxEVT_STC_DO_DROP, 1 )
203EVT_STC_ZOOM = wx.PyEventBinder( wxEVT_STC_ZOOM, 1 )
204EVT_STC_HOTSPOT_CLICK = wx.PyEventBinder( wxEVT_STC_HOTSPOT_CLICK, 1 )
205EVT_STC_HOTSPOT_DCLICK = wx.PyEventBinder( wxEVT_STC_HOTSPOT_DCLICK, 1 )
206EVT_STC_CALLTIP_CLICK = wx.PyEventBinder( wxEVT_STC_CALLTIP_CLICK, 1 )
1e9bafca 207EVT_STC_AUTOCOMP_SELECTION = wx.PyEventBinder( wxEVT_STC_AUTOCOMP_SELECTION, 1 )
d14a1e28
RD
208}
209
210//---------------------------------------------------------------------------
211
212%init %{
213%}
214
215
216//---------------------------------------------------------------------------
217