X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ee1d7604b1867c9aaf4c13a92a304c82acf6ebd..324eeecb3cdc9522e136af6670443148772b412a:/include/wx/stc/stc.h diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index e8f6a9cbbf..b636753aa5 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -363,6 +363,8 @@ #define wxSTC_LEX_AU3 60 #define wxSTC_LEX_APDL 61 #define wxSTC_LEX_BASH 62 +#define wxSTC_LEX_ASN1 63 +#define wxSTC_LEX_VHDL 64 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -649,6 +651,7 @@ #define wxSTC_ERR_IFORT 17 #define wxSTC_ERR_ABSF 18 #define wxSTC_ERR_TIDY 19 +#define wxSTC_ERR_JAVA_STACK 20 // Lexical states for SCLEX_BATCH #define wxSTC_BAT_DEFAULT 0 @@ -863,6 +866,7 @@ #define wxSTC_CSS_DIRECTIVE 12 #define wxSTC_CSS_DOUBLESTRING 13 #define wxSTC_CSS_SINGLESTRING 14 +#define wxSTC_CSS_IDENTIFIER2 15 // Lexical states for SCLEX_POV #define wxSTC_POV_DEFAULT 0 @@ -1126,6 +1130,7 @@ #define wxSTC_AU3_VARIABLE 9 #define wxSTC_AU3_SENT 10 #define wxSTC_AU3_PREPROCESSOR 11 +#define wxSTC_AU3_SPECIAL 12 // Lexical states for SCLEX_APDL #define wxSTC_APDL_DEFAULT 0 @@ -1133,10 +1138,14 @@ #define wxSTC_APDL_COMMENTBLOCK 2 #define wxSTC_APDL_NUMBER 3 #define wxSTC_APDL_STRING 4 -#define wxSTC_APDL_WORD 5 -#define wxSTC_APDL_COMMAND 6 +#define wxSTC_APDL_OPERATOR 5 +#define wxSTC_APDL_WORD 6 #define wxSTC_APDL_PROCESSOR 7 -#define wxSTC_APDL_FUNCTION 8 +#define wxSTC_APDL_COMMAND 8 +#define wxSTC_APDL_SLASHCOMMAND 9 +#define wxSTC_APDL_STARCOMMAND 10 +#define wxSTC_APDL_ARGUMENT 11 +#define wxSTC_APDL_FUNCTION 12 // Lexical states for SCLEX_BASH #define wxSTC_SH_DEFAULT 0 @@ -1154,6 +1163,36 @@ #define wxSTC_SH_HERE_DELIM 12 #define wxSTC_SH_HERE_Q 13 +// Lexical states for SCLEX_ASN1 +#define wxSTC_ASN1_DEFAULT 0 +#define wxSTC_ASN1_COMMENT 1 +#define wxSTC_ASN1_IDENTIFIER 2 +#define wxSTC_ASN1_STRING 3 +#define wxSTC_ASN1_OID 4 +#define wxSTC_ASN1_SCALAR 5 +#define wxSTC_ASN1_KEYWORD 6 +#define wxSTC_ASN1_ATTRIBUTE 7 +#define wxSTC_ASN1_DESCRIPTOR 8 +#define wxSTC_ASN1_TYPE 9 +#define wxSTC_ASN1_OPERATOR 10 + +// Lexical states for SCLEX_VHDL +#define wxSTC_VHDL_DEFAULT 0 +#define wxSTC_VHDL_COMMENT 1 +#define wxSTC_VHDL_COMMENTLINEBANG 2 +#define wxSTC_VHDL_NUMBER 3 +#define wxSTC_VHDL_STRING 4 +#define wxSTC_VHDL_OPERATOR 5 +#define wxSTC_VHDL_IDENTIFIER 6 +#define wxSTC_VHDL_STRINGEOL 7 +#define wxSTC_VHDL_KEYWORD 8 +#define wxSTC_VHDL_STDOPERATOR 9 +#define wxSTC_VHDL_ATTRIBUTE 10 +#define wxSTC_VHDL_STDFUNCTION 11 +#define wxSTC_VHDL_STDPACKAGE 12 +#define wxSTC_VHDL_STDTYPE 13 +#define wxSTC_VHDL_USERWORD 14 + //----------------------------------------- // Commands that can be bound to keystrokes @@ -1456,8 +1495,8 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPySTCNameStr); - %name(PreStyledTextCtrl) wxStyledTextCtrl(); - + %RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl()); + #else wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, @@ -1465,7 +1504,7 @@ public: const wxString& name = wxSTCNameStr); wxStyledTextCtrl() { m_swx = NULL; } ~wxStyledTextCtrl(); - + #endif void Create(wxWindow *parent, wxWindowID id=wxID_ANY, @@ -2737,6 +2776,10 @@ public: // Enlarge the document to a particular size of text bytes. void Allocate(int bytes); + // Find the position of a column on a line taking into account tabs and + // multi-byte characters. If beyond end of line, return line end position. + int FindColumn(int line, int column); + // Start notifying the container of all key presses and commands. void StartRecord(); @@ -2832,11 +2875,11 @@ public: // Set the vertical scrollbar to use instead of the ont that's built-in. - void SetVScrollBar(wxScrollBar* bar) { m_vScrollBar = bar; } + void SetVScrollBar(wxScrollBar* bar); // Set the horizontal scrollbar to use instead of the ont that's built-in. - void SetHScrollBar(wxScrollBar* bar) { m_hScrollBar = bar; } + void SetHScrollBar(wxScrollBar* bar); // Can be used to prevent the EVT_CHAR handler from adding the char bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; } @@ -2850,7 +2893,7 @@ public: #ifdef STC_USE_DND // Allow for simulating a DnD DragOver - wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); + wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); // Allow for simulating a DnD DropText bool DoDropText(long x, long y, const wxString& data); @@ -2863,7 +2906,7 @@ public: // Returns the current UseAntiAliasing setting. bool GetUseAntiAliasing(); - + //---------------------------------------------------------------------- @@ -2891,7 +2934,7 @@ private: void OnMenu(wxCommandEvent& evt); void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); - + virtual wxSize DoGetBestSize() const; // Turn notifications from Scintilla into events @@ -3077,31 +3120,31 @@ END_DECLARE_EVENT_TYPES() #ifndef SWIG typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); -#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), #endif @@ -3109,36 +3152,26 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); // Utility functions used within wxSTC #ifndef SWIG +#if wxUSE_UNICODE + +wxString stc2wx(const char* str); +wxString stc2wx(const char* str, size_t len); +const wxWX2MBbuf wx2stc(const wxString& str); + +#else // not UNICODE inline wxString stc2wx(const char* str) { -#if wxUSE_UNICODE - return wxString(str, wxConvUTF8); -#else return wxString(str); -#endif } - -#if wxUSE_UNICODE -wxString stc2wx(const char* str, size_t len); -#else inline wxString stc2wx(const char* str, size_t len) { return wxString(str, len); } -#endif - - -#if wxUSE_UNICODE -inline const wxWX2MBbuf wx2stc(const wxString& str) { - return str.mb_str(wxConvUTF8); -} -#else inline const wxWX2MBbuf wx2stc(const wxString& str) { return str.mbc_str(); } -#endif - -#endif +#endif // UNICODE +#endif // SWIG //---------------------------------------------------------------------- #endif