X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e9bafca0f56de34638d4c3fef8cf74fe9351193..9d52aad39a4e3b52c5baa50b9cc55caaf91bb026:/include/wx/stc/stc.h diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 3a1132d020..1217ebace4 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -17,22 +17,18 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __stc_h__ -#define __stc_h__ +#ifndef _WX_STC_STC_H_ +#define _WX_STC_STC_H_ +#include "wx/defs.h" -#include "wx/wx.h" -#include "wx/dnd.h" - +#if wxUSE_STC -#ifdef WXMAKINGDLL_STC - #define WXDLLIMPEXP_STC WXEXPORT -#elif defined(WXUSINGDLL) - #define WXDLLIMPEXP_STC WXIMPORT -#else // not making nor using DLL - #define WXDLLIMPEXP_STC -#endif +#include "wx/control.h" +#include "wx/dnd.h" +#include "wx/stopwatch.h" +class WXDLLIMPEXP_FWD_CORE wxScrollBar; // SWIG can't handle "#if" type of conditionals, only "#ifdef" #ifdef SWIG @@ -120,15 +116,18 @@ #define wxSTC_MASK_FOLDERS 0xFE000000 #define wxSTC_MARGIN_SYMBOL 0 #define wxSTC_MARGIN_NUMBER 1 +#define wxSTC_MARGIN_BACK 2 +#define wxSTC_MARGIN_FORE 3 -// Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles. -// Styles 38 and 39 are for future use. +// Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. +// Style 39 is for future use. #define wxSTC_STYLE_DEFAULT 32 #define wxSTC_STYLE_LINENUMBER 33 #define wxSTC_STYLE_BRACELIGHT 34 #define wxSTC_STYLE_BRACEBAD 35 #define wxSTC_STYLE_CONTROLCHAR 36 #define wxSTC_STYLE_INDENTGUIDE 37 +#define wxSTC_STYLE_CALLTIP 38 #define wxSTC_STYLE_LASTPREDEFINED 39 #define wxSTC_STYLE_MAX 127 @@ -166,6 +165,7 @@ #define wxSTC_INDIC_STRIKE 4 #define wxSTC_INDIC_HIDDEN 5 #define wxSTC_INDIC_BOX 6 +#define wxSTC_INDIC_ROUNDBOX 7 #define wxSTC_INDIC0_MASK 0x20 #define wxSTC_INDIC1_MASK 0x40 #define wxSTC_INDIC2_MASK 0x80 @@ -258,6 +258,9 @@ #define wxSTC_SEL_STREAM 0 #define wxSTC_SEL_RECTANGLE 1 #define wxSTC_SEL_LINES 2 +#define wxSTC_ALPHA_TRANSPARENT 0 +#define wxSTC_ALPHA_OPAQUE 255 +#define wxSTC_ALPHA_NOALPHA 256 // Maximum value of keywordSet parameter of SetKeyWords. #define wxSTC_KEYWORDSET_MAX 8 @@ -381,6 +384,9 @@ #define wxSTC_LEX_FLAGSHIP 73 #define wxSTC_LEX_CSOUND 74 #define wxSTC_LEX_FREEBASIC 75 +#define wxSTC_LEX_INNOSETUP 76 +#define wxSTC_LEX_OPAL 77 +#define wxSTC_LEX_SPICE 78 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -426,6 +432,30 @@ #define wxSTC_C_COMMENTDOCKEYWORDERROR 18 #define wxSTC_C_GLOBALCLASS 19 +// Lexical states for SCLEX_TCL +#define wxSTC_TCL_DEFAULT 0 +#define wxSTC_TCL_COMMENT 1 +#define wxSTC_TCL_COMMENTLINE 2 +#define wxSTC_TCL_NUMBER 3 +#define wxSTC_TCL_WORD_IN_QUOTE 4 +#define wxSTC_TCL_IN_QUOTE 5 +#define wxSTC_TCL_OPERATOR 6 +#define wxSTC_TCL_IDENTIFIER 7 +#define wxSTC_TCL_SUBSTITUTION 8 +#define wxSTC_TCL_SUB_BRACE 9 +#define wxSTC_TCL_MODIFIER 10 +#define wxSTC_TCL_EXPAND 11 +#define wxSTC_TCL_WORD 12 +#define wxSTC_TCL_WORD2 13 +#define wxSTC_TCL_WORD3 14 +#define wxSTC_TCL_WORD4 15 +#define wxSTC_TCL_WORD5 16 +#define wxSTC_TCL_WORD6 17 +#define wxSTC_TCL_WORD7 18 +#define wxSTC_TCL_WORD8 19 +#define wxSTC_TCL_COMMENT_BOX 20 +#define wxSTC_TCL_BLOCK_COMMENT 21 + // Lexical states for SCLEX_HTML, SCLEX_XML #define wxSTC_H_DEFAULT 0 #define wxSTC_H_TAG 1 @@ -660,6 +690,7 @@ #define wxSTC_PROPS_SECTION 2 #define wxSTC_PROPS_ASSIGNMENT 3 #define wxSTC_PROPS_DEFVAL 4 +#define wxSTC_PROPS_KEY 5 // Lexical states for SCLEX_LATEX #define wxSTC_L_DEFAULT 0 @@ -1204,6 +1235,7 @@ #define wxSTC_AU3_SPECIAL 12 #define wxSTC_AU3_EXPAND 13 #define wxSTC_AU3_COMOBJ 14 +#define wxSTC_AU3_UDF 15 // Lexical states for SCLEX_APDL #define wxSTC_APDL_DEFAULT 0 @@ -1442,6 +1474,44 @@ #define wxSTC_CSOUND_GLOBAL_VAR 14 #define wxSTC_CSOUND_STRINGEOL 15 +// Lexical states for SCLEX_INNOSETUP +#define wxSTC_INNO_DEFAULT 0 +#define wxSTC_INNO_COMMENT 1 +#define wxSTC_INNO_KEYWORD 2 +#define wxSTC_INNO_PARAMETER 3 +#define wxSTC_INNO_SECTION 4 +#define wxSTC_INNO_PREPROC 5 +#define wxSTC_INNO_PREPROC_INLINE 6 +#define wxSTC_INNO_COMMENT_PASCAL 7 +#define wxSTC_INNO_KEYWORD_PASCAL 8 +#define wxSTC_INNO_KEYWORD_USER 9 +#define wxSTC_INNO_STRING_DOUBLE 10 +#define wxSTC_INNO_STRING_SINGLE 11 +#define wxSTC_INNO_IDENTIFIER 12 + +// Lexical states for SCLEX_OPAL +#define wxSTC_OPAL_SPACE 0 +#define wxSTC_OPAL_COMMENT_BLOCK 1 +#define wxSTC_OPAL_COMMENT_LINE 2 +#define wxSTC_OPAL_INTEGER 3 +#define wxSTC_OPAL_KEYWORD 4 +#define wxSTC_OPAL_SORT 5 +#define wxSTC_OPAL_STRING 6 +#define wxSTC_OPAL_PAR 7 +#define wxSTC_OPAL_BOOL_CONST 8 +#define wxSTC_OPAL_DEFAULT 32 + +// Lexical states for SCLEX_SPICE +#define wxSTC_SPICE_DEFAULT 0 +#define wxSTC_SPICE_IDENTIFIER 1 +#define wxSTC_SPICE_KEYWORD 2 +#define wxSTC_SPICE_KEYWORD2 3 +#define wxSTC_SPICE_KEYWORD3 4 +#define wxSTC_SPICE_NUMBER 5 +#define wxSTC_SPICE_DELIMITER 6 +#define wxSTC_SPICE_VALUE 7 +#define wxSTC_SPICE_COMMENTLINE 8 + //----------------------------------------- // Commands that can be bound to keystrokes @@ -1727,8 +1797,8 @@ struct SCNotification; #ifndef SWIG extern WXDLLIMPEXP_STC const wxChar* wxSTCNameStr; -class WXDLLIMPEXP_STC wxStyledTextCtrl; -class WXDLLIMPEXP_STC wxStyledTextEvent; +class WXDLLIMPEXP_FWD_STC wxStyledTextCtrl; +class WXDLLIMPEXP_FWD_STC wxStyledTextEvent; #endif //---------------------------------------------------------------------- @@ -1931,6 +2001,9 @@ public: // Add a set of markers to a line. void MarkerAddSet(int line, int set); + // Set the alpha used for a marker that is drawn in the text area, not the margin. + void MarkerSetAlpha(int markerNumber, int alpha); + // Set a margin to be either numeric or symbolic. void SetMarginType(int margin, int marginType); @@ -1997,6 +2070,12 @@ public: // Set the background colour of the selection and whether to use this setting. void SetSelBackground(bool useSetting, const wxColour& back); + // Get the alpha of the selection. + int GetSelAlpha(); + + // Set the alpha of the selection. + void SetSelAlpha(int alpha); + // Set the foreground colour of the caret. void SetCaretForeground(const wxColour& fore); @@ -2074,10 +2153,10 @@ public: void SetCaretLineVisible(bool show); // Get the colour of the background of the line containing the caret. - wxColour GetCaretLineBack(); + wxColour GetCaretLineBackground(); // Set the colour of the background of the line containing the caret. - void SetCaretLineBack(const wxColour& back); + void SetCaretLineBackground(const wxColour& back); // Set a style to be changeable or not (read only). // Experimental feature, currently buggy. @@ -2436,6 +2515,9 @@ public: // Set the foreground colour for the highlighted part of the call tip. void CallTipSetForegroundHighlight(const wxColour& fore); + // Enable use of STYLE_CALLTIP and set call tip tab size in pixels. + void CallTipUseStyle(int tabSize); + // Find the display line of a document line taking hidden lines into account. int VisibleFromDocLine(int line); @@ -3064,6 +3146,12 @@ public: // Duplicate the selection. If selection empty duplicate the line containing the caret. void SelectionDuplicate(); + // Set background alpha of the caret line. + void SetCaretLineBackAlpha(int alpha); + + // Get the background alpha of the caret line. + int GetCaretLineBackAlpha(); + // Start notifying the container of all key presses and commands. void StartRecord(); @@ -3498,32 +3586,6 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); #define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), #endif -//---------------------------------------------------------------------- -// Utility functions used within wxSTC - -#ifndef SWIG -#if wxUSE_UNICODE - -WXDLLIMPEXP_STC wxString stc2wx(const char* str); -WXDLLIMPEXP_STC wxString stc2wx(const char* str, size_t len); -WXDLLIMPEXP_STC const wxWX2MBbuf wx2stc(const wxString& str); - -#else // not UNICODE - -inline wxString stc2wx(const char* str) { - return wxString(str); -} -inline wxString stc2wx(const char* str, size_t len) { - return wxString(str, len); -} -inline const wxWX2MBbuf wx2stc(const wxString& str) { - return str.mbc_str(); -} - -#endif // UNICODE -#endif // SWIG - -//---------------------------------------------------------------------- -#endif - +#endif // wxUSE_STC +#endif // _WX_STC_STC_H_