Updated to Scintilla from 1.45 to 1.47

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-09-06 16:59:31 +00:00
parent b38f3ff378
commit a834585d74
88 changed files with 4013 additions and 1848 deletions

View File

@@ -44,7 +44,7 @@
#define wxSTC_OPTIONAL_START 3000
#define wxSTC_LEXER_START 4000
// Redoes the next action on the undo history
// Redoes the next action on the undo history.
#define wxSTC_CMD_REDO 2011
// Select all the text in the document.
@@ -70,7 +70,7 @@
#define wxSTC_MARK_MINUS 7
#define wxSTC_MARK_PLUS 8
// Shapes used for outlining column
// Shapes used for outlining column.
#define wxSTC_MARK_VLINE 9
#define wxSTC_MARK_LCORNER 10
#define wxSTC_MARK_TCORNER 11
@@ -85,11 +85,11 @@
#define wxSTC_MARK_CIRCLEMINUS 20
#define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
// Invisible mark that only sets the line background color
// Invisible mark that only sets the line background color.
#define wxSTC_MARK_BACKGROUND 22
#define wxSTC_MARK_CHARACTER 10000
// Markers used for outlining column
// Markers used for outlining column.
#define wxSTC_MARKNUM_FOLDEREND 25
#define wxSTC_MARKNUM_FOLDEROPENMID 26
#define wxSTC_MARKNUM_FOLDERMIDTAIL 27
@@ -270,8 +270,7 @@
// Delete the selection or if no selection, the character before the caret.
#define wxSTC_CMD_DELETEBACK 2326
// If selection is empty or all on one line replace the selection with a tab
// character.
// If selection is empty or all on one line replace the selection with a tab character.
// If more than one line selected, indent the lines.
#define wxSTC_CMD_TAB 2327
@@ -325,40 +324,46 @@
#define wxSTC_CMD_LINESCROLLUP 2343
// Delete the selection or if no selection, the character before the caret.
// Will not delete the chraacter before at the start of a line.
// Will not delete the character before at the start of a line.
#define wxSTC_CMD_DELETEBACKNOTLINE 2344
#define wxSTC_EDGE_NONE 0
#define wxSTC_EDGE_LINE 1
#define wxSTC_EDGE_BACKGROUND 2
// Show caret within N lines of edge when it's scrolled to view
// If CARET_SLOP not set then centre caret on screen when it's
// scrolled to view
#define wxSTC_CARET_SLOP 0x01
// Value not used
#define wxSTC_CARET_CENTER 0x02
// If CARET_SLOP also set then reposition whenever outside slop border
// If CARET_SLOP not set then recentre even when visible
#define wxSTC_CARET_STRICT 0x04
// If CARET_XEVEN set then both left and right margins are given equal weight
// rather than favouring left following behaviour.
#define wxSTC_CARET_XEVEN 0x08
// If CARET_XJUMPS set then when caret reaches the margin the display jumps
// enough to leave the caret solidly within the display.
#define wxSTC_CARET_XJUMPS 0x10
#define wxSTC_CURSORNORMAL -1
#define wxSTC_CURSORWAIT 3
// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy
// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
#define wxSTC_VISIBLE_SLOP 0x01
#define wxSTC_VISIBLE_STRICT 0x04
// Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
// If CARET_SLOP is set, we can define a slop value: caretSlop.
// This value defines an unwanted zone (UZ) where the caret is... unwanted.
// This zone is defined as a number of pixels near the vertical margins,
// and as a number of lines near the horizontal margins.
// By keeping the caret away from the edges, it is seen within its context,
// so it is likely that the identifier that the caret is on can be completely seen,
// and that the current line is seen with some of the lines following it which are
// often dependent on that line.
#define wxSTC_CARET_SLOP 0x01
// If CARET_STRICT is set, the policy is enforced... strictly.
// The caret is centred on the display if slop is not set,
// and cannot go in the UZ if slop is set.
#define wxSTC_CARET_STRICT 0x04
// If CARET_JUMPS is set, the display is moved more energetically
// so the caret can move in the same direction longer before the policy is applied again.
#define wxSTC_CARET_JUMPS 0x10
// If CARET_EVEN is not set, instead of having symmetrical UZs,
// the left and bottom UZs are extended up to right and top UZs respectively.
// This way, we favour the displaying of useful information: the begining of lines,
// where most code reside, and the lines after the caret, eg. the body of a function.
#define wxSTC_CARET_EVEN 0x08
// Notifications
// Type of modification and the action which caused the modification
// Type of modification and the action which caused the modification.
// These are defined as a bit mask to make it easy to specify which notifications are wanted.
// One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
#define wxSTC_MOD_INSERTTEXT 0x1
@@ -374,9 +379,9 @@
#define wxSTC_MOD_BEFOREDELETE 0x800
#define wxSTC_MODEVENTMASKALL 0xF77
// Symbolic key codes and modifier flags
// ASCII and other printable characters below 256
// Extended keys above 300
// Symbolic key codes and modifier flags.
// ASCII and other printable characters below 256.
// Extended keys above 300.
#define wxSTC_KEY_DOWN 300
#define wxSTC_KEY_UP 301
#define wxSTC_KEY_LEFT 302
@@ -432,6 +437,7 @@
#define wxSTC_LEX_PHP 30
#define wxSTC_LEX_BAAN 31
#define wxSTC_LEX_MATLAB 32
#define wxSTC_LEX_SCRIPTOL 33
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
// value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -474,17 +480,6 @@
#define wxSTC_C_COMMENTDOCKEYWORD 17
#define wxSTC_C_COMMENTDOCKEYWORDERROR 18
// Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
#define wxSTC_B_DEFAULT 0
#define wxSTC_B_COMMENT 1
#define wxSTC_B_NUMBER 2
#define wxSTC_B_KEYWORD 3
#define wxSTC_B_STRING 4
#define wxSTC_B_PREPROCESSOR 5
#define wxSTC_B_OPERATOR 6
#define wxSTC_B_IDENTIFIER 7
#define wxSTC_B_DATE 8
// Lexical states for SCLEX_HTML, SCLEX_XML
#define wxSTC_H_DEFAULT 0
#define wxSTC_H_TAG 1
@@ -651,6 +646,24 @@
#define wxSTC_PL_STRING_QR 29
#define wxSTC_PL_STRING_QW 30
// Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
#define wxSTC_B_DEFAULT 0
#define wxSTC_B_COMMENT 1
#define wxSTC_B_NUMBER 2
#define wxSTC_B_KEYWORD 3
#define wxSTC_B_STRING 4
#define wxSTC_B_PREPROCESSOR 5
#define wxSTC_B_OPERATOR 6
#define wxSTC_B_IDENTIFIER 7
#define wxSTC_B_DATE 8
// Lexical states for SCLEX_PROPERTIES
#define wxSTC_PROPS_DEFAULT 0
#define wxSTC_PROPS_COMMENT 1
#define wxSTC_PROPS_SECTION 2
#define wxSTC_PROPS_ASSIGNMENT 3
#define wxSTC_PROPS_DEFVAL 4
// Lexical states for SCLEX_LATEX
#define wxSTC_L_DEFAULT 0
#define wxSTC_L_COMMAND 1
@@ -688,6 +701,7 @@
#define wxSTC_ERR_PERL 6
#define wxSTC_ERR_NET 7
#define wxSTC_ERR_LUA 8
#define wxSTC_ERR_CTAG 9
#define wxSTC_ERR_DIFF_CHANGED 10
#define wxSTC_ERR_DIFF_ADDITION 11
#define wxSTC_ERR_DIFF_DELETION 12
@@ -712,7 +726,16 @@
#define wxSTC_MAKE_TARGET 5
#define wxSTC_MAKE_IDEOL 9
// Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer)
// Lexical states for SCLEX_DIFF
#define wxSTC_DIFF_DEFAULT 0
#define wxSTC_DIFF_COMMENT 1
#define wxSTC_DIFF_COMMAND 2
#define wxSTC_DIFF_HEADER 3
#define wxSTC_DIFF_POSITION 4
#define wxSTC_DIFF_DELETED 5
#define wxSTC_DIFF_ADDED 6
// Lexical states for SCLEX_CONF (Apache Configuration Files Lexer)
#define wxSTC_CONF_DEFAULT 0
#define wxSTC_CONF_COMMENT 1
#define wxSTC_CONF_NUMBER 2
@@ -724,7 +747,7 @@
#define wxSTC_CONF_IP 8
#define wxSTC_CONF_DIRECTIVE 9
// Avenue
// Lexical states for SCLEX_AVE, Avenue
#define wxSTC_AVE_DEFAULT 0
#define wxSTC_AVE_COMMENT 1
#define wxSTC_AVE_NUMBER 2
@@ -782,7 +805,7 @@
#define wxSTC_EIFFEL_IDENTIFIER 7
#define wxSTC_EIFFEL_STRINGEOL 8
// Lexical states for the SCLEX_NNCRONTAB (nnCron crontab Lexer)
// Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer)
#define wxSTC_NNCRONTAB_DEFAULT 0
#define wxSTC_NNCRONTAB_COMMENT 1
#define wxSTC_NNCRONTAB_TASK 2
@@ -805,6 +828,28 @@
#define wxSTC_MATLAB_OPERATOR 6
#define wxSTC_MATLAB_IDENTIFIER 7
// Lexical states for SCLEX_SCRIPTOL
#define wxSTC_SCRIPTOL_DEFAULT 0
#define wxSTC_SCRIPTOL_COMMENT 1
#define wxSTC_SCRIPTOL_COMMENTLINE 2
#define wxSTC_SCRIPTOL_COMMENTDOC 3
#define wxSTC_SCRIPTOL_NUMBER 4
#define wxSTC_SCRIPTOL_WORD 5
#define wxSTC_SCRIPTOL_STRING 6
#define wxSTC_SCRIPTOL_CHARACTER 7
#define wxSTC_SCRIPTOL_UUID 8
#define wxSTC_SCRIPTOL_PREPROCESSOR 9
#define wxSTC_SCRIPTOL_OPERATOR 10
#define wxSTC_SCRIPTOL_IDENTIFIER 11
#define wxSTC_SCRIPTOL_STRINGEOL 12
#define wxSTC_SCRIPTOL_VERBATIM 13
#define wxSTC_SCRIPTOL_REGEX 14
#define wxSTC_SCRIPTOL_COMMENTLINEDOC 15
#define wxSTC_SCRIPTOL_WORD2 16
#define wxSTC_SCRIPTOL_COMMENTDOCKEYWORD 17
#define wxSTC_SCRIPTOL_COMMENTDOCKEYWORDERROR 18
#define wxSTC_SCRIPTOL_COMMENTBASIC 19
// END of generated section
//----------------------------------------------------------------------
@@ -845,37 +890,37 @@ public:
// and regenerate
// Add text to the document
// Add text to the document.
void AddText(const wxString& text);
// Add array of cells to document
// Add array of cells to document.
void AddStyledText(const wxMemoryBuffer& data);
// Insert string at a position
// Insert string at a position.
void InsertText(int pos, const wxString& text);
// Delete all text in the document
// Delete all text in the document.
void ClearAll();
// Set all style bytes to 0, remove all folding information
// Set all style bytes to 0, remove all folding information.
void ClearDocumentStyle();
// The number of characters in the document
// The number of characters in the document.
int GetLength();
// Returns the character byte at the position
// Returns the character byte at the position.
int GetCharAt(int pos);
// Returns the position of the caret
// Returns the position of the caret.
int GetCurrentPos();
// Returns the position of the opposite end of the selection to the caret
// Returns the position of the opposite end of the selection to the caret.
int GetAnchor();
// Returns the style byte at the position
// Returns the style byte at the position.
int GetStyleAt(int pos);
// Redoes the next action on the undo history
// Redoes the next action on the undo history.
void Redo();
// Choose between collecting actions into the undo
@@ -892,10 +937,10 @@ public:
// Retrieve a buffer of cells.
wxMemoryBuffer GetStyledText(int startPos, int endPos);
// Are there any redoable actions in the undo history.
// Are there any redoable actions in the undo history?
bool CanRedo();
// Retrieve the line number at which a particular marker is located
// Retrieve the line number at which a particular marker is located.
int MarkerLineFromHandle(int handle);
// Delete a marker.
@@ -949,23 +994,21 @@ public:
void SetEOLMode(int eolMode);
// Set the current styling position to pos and the styling mask to mask.
// The styling mask can be used to protect some bits in each styling byte from
// modification.
// The styling mask can be used to protect some bits in each styling byte from modification.
void StartStyling(int pos, int mask);
// Change style from current styling position for length characters to a style
// and move the current styling position to after this newly styled segment.
void SetStyling(int length, int style);
// Is drawing done first into a buffer or direct to the screen.
// Is drawing done first into a buffer or direct to the screen?
bool GetBufferedDraw();
// If drawing is buffered then each line of text is drawn into a bitmap buffer
// before drawing it to the screen to avoid flicker.
void SetBufferedDraw(bool buffered);
// Change the visible size of a tab to be a multiple of the width of a space
// character.
// Change the visible size of a tab to be a multiple of the width of a space character.
void SetTabWidth(int tabWidth);
// Retrieve the visible size of a tab.
@@ -989,10 +1032,10 @@ public:
// Add a marker to a line, returning an ID which can be used to find or delete the marker.
int MarkerAdd(int line, int markerNumber);
// Delete a marker from a line
// Delete a marker from a line.
void MarkerDelete(int line, int markerNumber);
// Delete all markers with a particular number from all lines
// Delete all markers with a particular number from all lines.
void MarkerDeleteAll(int markerNumber);
// Get a bit mask of all the markers set on a line.
@@ -1094,8 +1137,7 @@ public:
// Get the time in milliseconds that the caret is on and off. 0 = steady on.
void SetCaretPeriod(int periodMilliseconds);
// Set the set of characters making up words for when moving or selecting
// by word.
// Set the set of characters making up words for when moving or selecting by word.
void SetWordChars(const wxString& characters);
// Start a sequence of actions that is undone and redone as a unit.
@@ -1117,8 +1159,8 @@ public:
// Retrieve the foreground colour of an indicator.
wxColour IndicatorGetForeground(int indic);
// Divide each styling byte into lexical class bits (default:5) and indicator
// bits (default:3). If a lexer requires more than 32 lexical states, then this
// Divide each styling byte into lexical class bits (default: 5) and indicator
// bits (default: 3). If a lexer requires more than 32 lexical states, then this
// is used to expand the possible states.
void SetStyleBits(int bits);
@@ -1137,7 +1179,7 @@ public:
// Is the background of the line containing the caret in a different colour?
bool GetCaretLineVisible();
// Dsplay the background of the line containing the caret in a different colour.
// Display the background of the line containing the caret in a different colour.
void SetCaretLineVisible(bool show);
// Get the colour of the background of the line containing the caret.
@@ -1161,8 +1203,7 @@ public:
// Is there an auto-completion list visible?
bool AutoCompActive();
// Retrieve the position of the caret when the auto-completion list was
// displayed.
// Retrieve the position of the caret when the auto-completion list was displayed.
int AutoCompPosStart();
// User has selected an item so remove the list and insert the selection.
@@ -1171,8 +1212,8 @@ public:
// Define a set of character that when typed cancel the auto-completion list.
void AutoCompStops(const wxString& characterSet);
// Change the separator character in the string setting up an auto-completion
// list. Default is space but can be changed if items contain space.
// Change the separator character in the string setting up an auto-completion list.
// Default is space but can be changed if items contain space.
void AutoCompSetSeparator(int separatorCharacter);
// Retrieve the auto-completion list separator character.
@@ -1207,16 +1248,18 @@ public:
// Display a list of strings and send notification when user chooses one.
void UserListShow(int listType, const wxString& itemList);
// Set whether or not autocompletion is hidden automatically when nothing matches
// Set whether or not autocompletion is hidden automatically when nothing matches.
void AutoCompSetAutoHide(bool autoHide);
// Retrieve whether or not autocompletion is hidden automatically when nothing matches
// Retrieve whether or not autocompletion is hidden automatically when nothing matches.
bool AutoCompGetAutoHide();
// Set whether or not autocompletion deletes any word characters after the inserted text upon completion
// Set whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
void AutoCompSetDropRestOfWord(bool dropRestOfWord);
// Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion
// Retrieve whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
bool AutoCompGetDropRestOfWord();
// Set the number of spaces used for one level of indentation.
@@ -1305,7 +1348,7 @@ public:
// Find some text in the document.
int FindText(int minPos, int maxPos, const wxString& text, int flags=0);
// On Windows will draw the document into a display context such as a printer.
// On Windows, will draw the document into a display context such as a printer.
int FormatRange(bool doDraw,
int startPos,
int endPos,
@@ -1371,7 +1414,7 @@ public:
// Will a paste succeed?
bool CanPaste();
// Are there any undoable actions in the undo history.
// Are there any undoable actions in the undo history?
bool CanUndo();
// Delete the undo history.
@@ -1401,16 +1444,16 @@ public:
// Retrieve the number of characters in the document.
int GetTextLength();
// Set to overtype (true) or insert mode
// Set to overtype (true) or insert mode.
void SetOvertype(bool overtype);
// Returns true if overtype mode is active otherwise false is returned.
bool GetOvertype();
// Set the width of the insert mode caret
// Set the width of the insert mode caret.
void SetCaretWidth(int pixelWidth);
// Returns the width of the insert mode caret
// Returns the width of the insert mode caret.
int GetCaretWidth();
// Sets the position that starts the target which is used for updating the
@@ -1445,10 +1488,10 @@ public:
// Returns length of range or -1 for failure in which case target is not moved.
int SearchInTarget(const wxString& text);
// Set the search flags used by SearchInTarget
// Set the search flags used by SearchInTarget.
void SetSearchFlags(int flags);
// Get the search flags used by SearchInTarget
// Get the search flags used by SearchInTarget.
int GetSearchFlags();
// Show a call tip containing a definition near position pos.
@@ -1510,53 +1553,76 @@ public:
// Ensure a particular line is visible by expanding any header line hiding it.
void EnsureVisible(int line);
// Set some debugging options for folding
// Set some debugging options for folding.
void SetFoldFlags(int flags);
// Ensure a particular line is visible by expanding any header line hiding it.
// Use the currently set visibility policy to determine which range to display.
void EnsureVisibleEnforcePolicy(int line);
// Sets whether a tab pressed when caret is within indentation indents
// Sets whether a tab pressed when caret is within indentation indents.
void SetTabIndents(bool tabIndents);
// Does a tab pressed when caret is within indentation indent?
bool GetTabIndents();
// Sets whether a backspace pressed when caret is within indentation unindents
// Sets whether a backspace pressed when caret is within indentation unindents.
void SetBackSpaceUnIndents(bool bsUnIndents);
// Does a backspace pressed when caret is within indentation unindent?
bool GetBackSpaceUnIndents();
// Sets the time the mouse must sit still to generate a mouse dwell event
// Sets the time the mouse must sit still to generate a mouse dwell event.
void SetMouseDwellTime(int periodMilliseconds);
// Retrieve the time the mouse must sit still to generate a mouse dwell event
// Retrieve the time the mouse must sit still to generate a mouse dwell event.
int GetMouseDwellTime();
// Get position of start of word
// Get position of start of word.
int WordStartPosition(int pos, bool onlyWordCharacters);
// Get position of end of word
// Get position of end of word.
int WordEndPosition(int pos, bool onlyWordCharacters);
// Sets whether text is word wrapped
// Sets whether text is word wrapped.
void SetWrapMode(int mode);
// Retrieve whether text is word wrapped
// Retrieve whether text is word wrapped.
int GetWrapMode();
// Sets the degree of caching of layout information
// Sets the degree of caching of layout information.
void SetLayoutCache(int mode);
// Retrieve the degree of caching of layout information
// Retrieve the degree of caching of layout information.
int GetLayoutCache();
// Move the caret inside current view if it's not there already
// Sets the document width assumed for scrolling.
void SetScrollWidth(int pixelWidth);
// Retrieve the document width assumed for scrolling.
int GetScrollWidth();
// Measure the pixel width of some text in a particular style.
// Nul terminated text argument.
// Does not handle tab or control characters.
int TextWidth(int style, const wxString& text);
// Sets the scroll range so that maximum scroll position has
// the last line at the bottom of the view (default).
// Setting this to false allows scrolling one page below the last line.
void SetEndAtLastLine(bool endAtLastLine);
// Retrieve whether the maximum scroll position has the last
// line at the bottom of the view.
int GetEndAtLastLine();
// Retrieve the height of a particular line of text in pixels.
int TextHeight(int line);
// Move the caret inside current view if it's not there already.
void MoveCaretInsideView();
// How many characters are on a line, not including end of line characters.
// How many characters are on a line, not including end of line characters?
int LineLength(int line);
// Highlight the characters at two positions.
@@ -1568,10 +1634,10 @@ public:
// Find the position of a matching brace or INVALID_POSITION if no match.
int BraceMatch(int pos);
// Are the end of line characters visible.
// Are the end of line characters visible?
bool GetViewEOL();
// Make the end of line characters visible or invisible
// Make the end of line characters visible or invisible.
void SetViewEOL(bool visible);
// Retrieve a pointer to the document object.
@@ -1614,9 +1680,6 @@ public:
// Does not ensure the selection is visible.
int SearchPrev(int flags, const wxString& text);
// Set the way the line the caret is on is kept visible.
void SetCaretPolicy(int caretPolicy, int caretSlop);
// Retrieves the number of lines completely visible.
int LinesOnScreen();
@@ -1624,7 +1687,7 @@ public:
// the wrong mouse button.
void UsePopUp(bool allowPopUp);
// Is the selection a rectangular. The alternative is the more common stream selection.
// Is the selection rectangular? The alternative is the more common stream selection.
bool SelectionIsRectangle();
// Set the zoom level. This number of points is added to the size of all fonts.
@@ -1647,62 +1710,73 @@ public:
// Get which document modification events are sent to the container.
int GetModEventMask();
// Change internal focus flag
// Change internal focus flag.
void SetSTCFocus(bool focus);
// Get internal focus flag
// Get internal focus flag.
bool GetSTCFocus();
// Change error status - 0 = OK
// Change error status - 0 = OK.
void SetStatus(int statusCode);
// Get error status
// Get error status.
int GetStatus();
// Set whether the mouse is captured when its button is pressed
// Set whether the mouse is captured when its button is pressed.
void SetMouseDownCaptures(bool captures);
// Get whether mouse gets captured
// Get whether mouse gets captured.
bool GetMouseDownCaptures();
// Sets the cursor to one of the SC_CURSOR* values
// Sets the cursor to one of the SC_CURSOR* values.
void SetCursor(int cursorType);
// Get cursor type
// Get cursor type.
int GetCursor();
// Change the way control characters are displayed:
// If symbol is < 32, keep the drawn way, else, use the given character
// If symbol is < 32, keep the drawn way, else, use the given character.
void SetControlCharSymbol(int symbol);
// Get the way control characters are displayed
// Get the way control characters are displayed.
int GetControlCharSymbol();
// Move to the previous change in capitalistion
// Move to the previous change in capitalisation.
void WordPartLeft();
// Move to the previous change in capitalistion extending selection to new caret position.
// Move to the previous change in capitalisation extending selection
// to new caret position.
void WordPartLeftExtend();
// Move to the change next in capitalistion
// Move to the change next in capitalisation.
void WordPartRight();
// Move to the next change in capitalistion extending selection to new caret position.
// Move to the next change in capitalisation extending selection
// to new caret position.
void WordPartRightExtend();
// Set the way the display area is determined when a particular line is to be moved to.
// Set the way the display area is determined when a particular line
// is to be moved to by Find, FindNext, GotoLine, etc.
void SetVisiblePolicy(int visiblePolicy, int visibleSlop);
// Delete back from the current position to the start of the line
// Delete back from the current position to the start of the line.
void DelLineLeft();
// Delete forwards from the current position to the end of the line
// Delete forwards from the current position to the end of the line.
void DelLineRight();
// Get and Set the xOffset (ie, horizonal scroll position)
// Get and Set the xOffset (ie, horizonal scroll position).
void SetXOffset(int newOffset);
int GetXOffset();
// Set the way the caret is kept visible when going sideway.
// The exclusion zone is given in pixels.
void SetXCaretPolicy(int caretPolicy, int caretSlop);
// Set the way the line the caret is on is kept visible.
// The exclusion zone is given in lines.
void SetYCaretPolicy(int caretPolicy, int caretSlop);
// Start notifying the container of all key presses and commands.
void StartRecord();
@@ -1986,6 +2060,7 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, 1669)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
END_DECLARE_EVENT_TYPES()
#else
enum {
@@ -2011,6 +2086,7 @@ END_DECLARE_EVENT_TYPES()
wxEVT_STC_START_DRAG,
wxEVT_STC_DRAG_OVER,
wxEVT_STC_DO_DROP,
wxEVT_STC_ZOOM,
};
#endif
@@ -2041,6 +2117,7 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#endif
//----------------------------------------------------------------------

View File

@@ -906,6 +906,15 @@ long Platform::SendScintilla(WindowID w,
return stc->SendMsg(msg, wParam, lParam);
}
long Platform::SendScintillaPointer(WindowID w,
unsigned int msg,
unsigned long wParam,
void *lParam) {
wxStyledTextCtrl* stc = (wxStyledTextCtrl*)w;
return stc->SendMsg(msg, wParam, (long)lParam);
}
// These are utility functions not really tied to a platform

View File

@@ -19,13 +19,6 @@
#include "wx/stc/stc.h"
#include "PlatWX.h"
//----------------------------------------------------------------------
const int H_SCROLL_MAX = 4000;
const int H_SCROLL_STEP = 20;
const int H_SCROLL_PAGE = 200;
//----------------------------------------------------------------------
// Helper classes
@@ -265,10 +258,12 @@ void ScintillaWX::SetHorizontalScrollPos() {
}
}
const int H_SCROLL_STEP = 20;
bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
bool modified = false;
// Check the vertical scrollbar
if (stc->m_vScrollBar == NULL) { // Use built-in scrollbar
int sbMax = stc->GetScrollRange(wxVERTICAL);
int sbThumb = stc->GetScrollThumb(wxVERTICAL);
@@ -289,24 +284,40 @@ bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
}
if (horizontalScrollBarVisible) {
// Check the horizontal scrollbar
PRectangle rcText = GetTextRectangle();
int horizEnd = scrollWidth;
if (horizEnd < 0)
horizEnd = 0;
if (!horizontalScrollBarVisible || (wrapState != eWrapNone))
horizEnd = 0;
int pageWidth = rcText.Width();
if (stc->m_hScrollBar == NULL) { // Use built-in scrollbar
int sbMax = stc->GetScrollRange(wxHORIZONTAL);
int sbThumb = stc->GetScrollThumb(wxHORIZONTAL);
if ((sbMax != H_SCROLL_MAX) || (sbThumb != H_SCROLL_STEP)) {
stc->SetScrollbar(wxHORIZONTAL, 0, H_SCROLL_STEP, H_SCROLL_MAX);
int sbPos = stc->GetScrollPos(wxHORIZONTAL);
if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) {
stc->SetScrollbar(wxHORIZONTAL, 0, pageWidth, horizEnd);
modified = true;
if (scrollWidth < pageWidth) {
HorizontalScrollTo(0);
}
}
}
else { // otherwise use the one that's been given to us
int sbMax = stc->m_hScrollBar->GetRange();
int sbPage = stc->m_hScrollBar->GetPageSize();
if ((sbMax != H_SCROLL_MAX) || (sbPage != H_SCROLL_STEP)) {
stc->m_hScrollBar->SetScrollbar(0, H_SCROLL_STEP, H_SCROLL_MAX, H_SCROLL_STEP);
int sbThumb = stc->m_hScrollBar->GetPageSize();
int sbPos = stc->m_hScrollBar->GetThumbPosition();
if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) {
stc->m_hScrollBar->SetScrollbar(0, pageWidth, horizEnd, pageWidth);
modified = true;
if (scrollWidth < pageWidth) {
HorizontalScrollTo(0);
}
}
}
return modified;
}
@@ -443,18 +454,24 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
void ScintillaWX::DoHScroll(int type, int pos) {
int xPos = xOffset;
PRectangle rcText = GetTextRectangle();
int pageWidth = rcText.Width() * 2 / 3;
if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP)
xPos -= H_SCROLL_STEP;
else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN)
xPos += H_SCROLL_STEP;
else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP)
xPos -= H_SCROLL_PAGE;
else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN)
xPos += H_SCROLL_PAGE;
xPos -= pageWidth;
else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN) {
xPos += pageWidth;
if (xPos > scrollWidth - rcText.Width()) {
xPos = scrollWidth - rcText.Width();
}
}
else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP)
xPos = 0;
else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM)
xPos = H_SCROLL_MAX;
xPos = scrollWidth;
else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK)
xPos = pos;

View File

@@ -553,6 +553,12 @@ def processIface(iface, h_tmplt, cpp_tmplt, h_dest, cpp_dest):
elif op == 'evt ':
pass
elif op == 'enu ':
pass
elif op == 'lex ':
pass
else:
print '***** Unknown line type: ', line

View File

@@ -3,5 +3,5 @@ scintilla/include directories from the Scintilla/SCiTE source
distribution. All other code needed to implement Scintilla on top of
wxWindows is located in the directory above this one.
The current version of the Scintilla code is 1.45
The current version of the Scintilla code is 1.47

View File

@@ -55,6 +55,7 @@ public:
}
void SetCodePage(int codePage_) { codePage = codePage_; }
virtual bool Match(int pos, const char *s)=0;
virtual char StyleAt(int position)=0;
virtual int GetLine(int position)=0;
virtual int LineStart(int line)=0;

View File

@@ -19,6 +19,7 @@ protected:
int language;
LexerFunction fnLexer;
LexerFunction fnFolder;
const char * const * wordListDescriptions;
static const LexerModule *base;
static int nextLanguage;
@@ -26,8 +27,14 @@ protected:
public:
const char *languageName;
LexerModule(int language_, LexerFunction fnLexer_,
const char *languageName_=0, LexerFunction fnFolder_=0);
const char *languageName_=0, LexerFunction fnFolder_=0,
const char * const wordListDescriptions_[] = NULL);
int GetLanguage() const { return language; }
// -1 is returned if no WordList information is available
int GetNumWordLists() const;
const char *GetWordListDescription(int index) const;
virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler) const;
virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle,

View File

@@ -106,8 +106,8 @@ public:
(rc.top >= top) && (rc.bottom <= bottom);
}
bool Intersects(PRectangle other) {
return (right >= other.left) && (left <= other.right) &&
(bottom >= other.top) && (top <= other.bottom);
return (right > other.left) && (left < other.right) &&
(bottom > other.top) && (top < other.bottom);
}
int Width() { return right - left; }
int Height() { return bottom - top; }
@@ -430,6 +430,8 @@ public:
static bool IsKeyDown(int key);
static long SendScintilla(
WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0);
static long SendScintillaPointer(
WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0);
static bool IsDBCSLeadByte(int codePage, char ch);
// These are utility functions not really tied to a platform

View File

@@ -76,10 +76,6 @@ public:
bool ignoreCase=false, char otherSeparator='\0');
};
inline bool nonFuncChar(char ch) {
return strchr("\t\n\r !\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~", ch) != NULL;
}
inline bool IsAlphabetic(unsigned int ch) {
return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
}

View File

@@ -10,7 +10,7 @@
// These functions are implemented because each platform calls them something different.
int CompareCaseInsensitive(const char *a, const char *b);
int CompareNCaseInsensitive(const char *a, const char *b, int len);
int CompareNCaseInsensitive(const char *a, const char *b, size_t len);
bool EqualCaseInsensitive(const char *a, const char *b);
// Define another string class.
@@ -22,13 +22,13 @@ bool EqualCaseInsensitive(const char *a, const char *b);
*
* Hold the length of the string for quick operations,
* can have a buffer bigger than the string to avoid too many memory allocations and copies.
* May have embedded zeroes as a result of @a substitute, but rely too heavily on C string
* functions to allow reliable manipulations of these strings.
* May have embedded zeroes as a result of @a substitute, but relies too heavily on C string
* functions to allow reliable manipulations of these strings, other than simple appends, etc.
**/
class SString {
public:
/** Type of string lengths (sizes) and positions (indexes). */
typedef unsigned int lenpos_t;
typedef size_t lenpos_t;
/** Out of bounds value indicating that the string argument should be measured. */
enum { measure_length=0xffffffffU};
@@ -63,7 +63,7 @@ private:
}
if (sSize > 0 && sSize_ <= sSize) { // Does not allocate new buffer if the current is big enough
if (s && sSize_) {
strncpy(s, sOther, sSize_);
memcpy(s, sOther, sSize_);
}
s[sSize_] = '\0';
sLen = sSize_;
@@ -92,6 +92,7 @@ public:
sSize = sLen = (s) ? strlen(s) : 0;
}
SString(const char *s_, lenpos_t first, lenpos_t last) : sizeGrowth(sizeGrowthDefault) {
// note: expects the "last" argument to point one beyond the range end (a la STL iterators)
s = StringAllocate(s_ + first, last - first);
sSize = sLen = (s) ? strlen(s) : 0;
}
@@ -188,6 +189,27 @@ public:
else
return '\0';
}
SString substr(lenpos_t subPos, lenpos_t subLen=measure_length) const {
if (subPos >= sLen) {
return SString(); // return a null string if start index is out of bounds
}
if ((subLen == measure_length) || (subPos + subLen > sLen)) {
subLen = sLen - subPos; // can't substr past end of source string
}
return SString(s, subPos, subPos + subLen);
}
SString &lowercase(lenpos_t subPos = 0, lenpos_t subLen=measure_length) {
if ((subLen == measure_length) || (subPos + subLen > sLen)) {
subLen = sLen - subPos; // don't apply past end of string
}
for (lenpos_t i = subPos; i < subPos + subLen; i++) {
if (s[i] < 'A' || s[i] > 'Z')
continue;
else
s[i] = static_cast<char>(s[i] - 'A' + 'a');
}
return *this;
}
SString &append(const char *sOther, lenpos_t sLenOther=measure_length, char sep = '\0') {
if (!sOther) {
return *this;
@@ -206,7 +228,7 @@ public:
s[sLen] = sep;
sLen++;
}
strncpy(&s[sLen], sOther, sLenOther);
memcpy(&s[sLen], sOther, sLenOther);
sLen += sLenOther;
s[sLen] = '\0';
}
@@ -259,6 +281,13 @@ public:
sLen -= len;
}
}
SString &change(lenpos_t pos, char ch) {
if (pos >= sLen) { // character changed must be in string bounds
return *this;
}
*(s + pos) = ch;
return *this;
}
/** Read an integral numeric value from the string. */
int value() const {
if (s)
@@ -266,7 +295,7 @@ public:
else
return 0;
}
int search(const char *sFind, lenpos_t start=0) {
int search(const char *sFind, lenpos_t start=0) const {
if (start < sLen) {
const char *sFound = strstr(s + start, sFind);
if (sFound) {
@@ -325,7 +354,7 @@ public:
}
char *sNew = new char[len + 1];
if (sNew) {
strncpy(sNew, s, len);
memcpy(sNew, s, len);
sNew[len] = '\0';
}
return sNew;

View File

@@ -47,6 +47,7 @@
#define SCLEX_PHP 30
#define SCLEX_BAAN 31
#define SCLEX_MATLAB 32
#define SCLEX_SCRIPTOL 33
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
@@ -81,15 +82,6 @@
#define SCE_C_WORD2 16
#define SCE_C_COMMENTDOCKEYWORD 17
#define SCE_C_COMMENTDOCKEYWORDERROR 18
#define SCE_B_DEFAULT 0
#define SCE_B_COMMENT 1
#define SCE_B_NUMBER 2
#define SCE_B_KEYWORD 3
#define SCE_B_STRING 4
#define SCE_B_PREPROCESSOR 5
#define SCE_B_OPERATOR 6
#define SCE_B_IDENTIFIER 7
#define SCE_B_DATE 8
#define SCE_H_DEFAULT 0
#define SCE_H_TAG 1
#define SCE_H_TAGUNKNOWN 2
@@ -230,6 +222,20 @@
#define SCE_PL_STRING_QX 28
#define SCE_PL_STRING_QR 29
#define SCE_PL_STRING_QW 30
#define SCE_B_DEFAULT 0
#define SCE_B_COMMENT 1
#define SCE_B_NUMBER 2
#define SCE_B_KEYWORD 3
#define SCE_B_STRING 4
#define SCE_B_PREPROCESSOR 5
#define SCE_B_OPERATOR 6
#define SCE_B_IDENTIFIER 7
#define SCE_B_DATE 8
#define SCE_PROPS_DEFAULT 0
#define SCE_PROPS_COMMENT 1
#define SCE_PROPS_SECTION 2
#define SCE_PROPS_ASSIGNMENT 3
#define SCE_PROPS_DEFVAL 4
#define SCE_L_DEFAULT 0
#define SCE_L_COMMAND 1
#define SCE_L_TAG 2
@@ -262,6 +268,7 @@
#define SCE_ERR_PERL 6
#define SCE_ERR_NET 7
#define SCE_ERR_LUA 8
#define SCE_ERR_CTAG 9
#define SCE_ERR_DIFF_CHANGED 10
#define SCE_ERR_DIFF_ADDITION 11
#define SCE_ERR_DIFF_DELETION 12
@@ -281,6 +288,13 @@
#define SCE_MAKE_OPERATOR 4
#define SCE_MAKE_TARGET 5
#define SCE_MAKE_IDEOL 9
#define SCE_DIFF_DEFAULT 0
#define SCE_DIFF_COMMENT 1
#define SCE_DIFF_COMMAND 2
#define SCE_DIFF_HEADER 3
#define SCE_DIFF_POSITION 4
#define SCE_DIFF_DELETED 5
#define SCE_DIFF_ADDED 6
#define SCE_CONF_DEFAULT 0
#define SCE_CONF_COMMENT 1
#define SCE_CONF_NUMBER 2
@@ -358,6 +372,26 @@
#define SCE_MATLAB_STRING 5
#define SCE_MATLAB_OPERATOR 6
#define SCE_MATLAB_IDENTIFIER 7
#define SCE_SCRIPTOL_DEFAULT 0
#define SCE_SCRIPTOL_COMMENT 1
#define SCE_SCRIPTOL_COMMENTLINE 2
#define SCE_SCRIPTOL_COMMENTDOC 3
#define SCE_SCRIPTOL_NUMBER 4
#define SCE_SCRIPTOL_WORD 5
#define SCE_SCRIPTOL_STRING 6
#define SCE_SCRIPTOL_CHARACTER 7
#define SCE_SCRIPTOL_UUID 8
#define SCE_SCRIPTOL_PREPROCESSOR 9
#define SCE_SCRIPTOL_OPERATOR 10
#define SCE_SCRIPTOL_IDENTIFIER 11
#define SCE_SCRIPTOL_STRINGEOL 12
#define SCE_SCRIPTOL_VERBATIM 13
#define SCE_SCRIPTOL_REGEX 14
#define SCE_SCRIPTOL_COMMENTLINEDOC 15
#define SCE_SCRIPTOL_WORD2 16
#define SCE_SCRIPTOL_COMMENTDOCKEYWORD 17
#define SCE_SCRIPTOL_COMMENTDOCKEYWORDERROR 18
#define SCE_SCRIPTOL_COMMENTBASIC 19
//--Autogenerated -- end of section automatically generated from Scintilla.iface
#endif

View File

@@ -21,8 +21,16 @@ int Scintilla_LinkLexers();
// Here should be placed typedefs for uptr_t, an unsigned integer type large enough to
// hold a pointer and sptr_t, a signed integer large enough to hold a pointer.
// May need to be changed for 64 bit platforms.
#if _MSC_VER >= 1300
#include <BaseTsd.h>
#endif
#ifdef MAXULONG_PTR
typedef ULONG_PTR uptr_t;
typedef LONG_PTR sptr_t;
#else
typedef unsigned long uptr_t;
typedef long sptr_t;
#endif
typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
@@ -359,6 +367,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_CACHE_DOCUMENT 3
#define SCI_SETLAYOUTCACHE 2272
#define SCI_GETLAYOUTCACHE 2273
#define SCI_SETSCROLLWIDTH 2274
#define SCI_GETSCROLLWIDTH 2275
#define SCI_TEXTWIDTH 2276
#define SCI_SETENDATLASTLINE 2277
#define SCI_GETENDATLASTLINE 2278
#define SCI_TEXTHEIGHT 2279
#define SCI_LINEDOWN 2300
#define SCI_LINEDOWNEXTEND 2301
#define SCI_LINEUP 2302
@@ -426,12 +440,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SEARCHANCHOR 2366
#define SCI_SEARCHNEXT 2367
#define SCI_SEARCHPREV 2368
#define CARET_SLOP 0x01
#define CARET_CENTER 0x02
#define CARET_STRICT 0x04
#define CARET_XEVEN 0x08
#define CARET_XJUMPS 0x10
#define SCI_SETCARETPOLICY 2369
#define SCI_LINESONSCREEN 2370
#define SCI_USEPOPUP 2371
#define SCI_SELECTIONISRECTANGLE 2372
@@ -465,6 +473,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETXOFFSET 2397
#define SCI_GETXOFFSET 2398
#define SCI_GRABFOCUS 2400
#define CARET_SLOP 0x01
#define CARET_STRICT 0x04
#define CARET_JUMPS 0x10
#define CARET_EVEN 0x08
#define SCI_SETXCARETPOLICY 2402
#define SCI_SETYCARETPOLICY 2403
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
@@ -525,6 +539,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCN_URIDROPPED 2015
#define SCN_DWELLSTART 2016
#define SCN_DWELLEND 2017
#define SCN_ZOOM 2018
//--Autogenerated -- end of section automatically generated from Scintilla.iface
// These structures are defined to be exactly the same shape as the Win32
@@ -598,6 +613,11 @@ struct SCNotification {
#ifdef INCLUDE_DEPRECATED_FEATURES
#define SCI_SETCARETPOLICY 2369
#define CARET_CENTER 0x02
#define CARET_XEVEN 0x08
#define CARET_XJUMPS 0x10
#define SCN_POSCHANGED 2012
#define SCN_CHECKBRACE 2007

View File

@@ -17,6 +17,9 @@
## set -> a property set function
## val -> definition of a constant
## evt -> an event
## enu -> associate an enumeration with a set of vals with a prefix
## lex -> associate a lexer with the lexical classes it produces
##
## All other feature names should be ignored. They may be defined in the future.
## A property may have a set function, a get function or both. Each will have
## "Get" or "Set" in their names and the corresponding name will have the obvious switch.
@@ -31,6 +34,16 @@
## The feature numbers are stable so features will not be renumbered.
## Features may be removed but they will go through a period of deprecation
## before removal which is signalled by moving them into the Deprecated category.
##
## enu has the syntax enu<ws><enumeration>=<prefix>[<ws><prefix>]* where all the val
## features in this file starting with a given <prefix> are considered part of the
## enumeration.
##
## lex has the syntax lex<ws><name>=<lexerVal><ws><prefix>[<ws><prefix>]*
## where name is a reasonably capitalised (Python, XML) identifier or UI name,
## lexerVal is the val used to specify the lexer, and the list of prefixes is similar
## to enu. The name may not be the same as that used within the lexer so the lexerVal
## should be used to tie these entities together.
## Types:
## void
@@ -73,37 +86,37 @@ val SCI_START=2000
val SCI_OPTIONAL_START=3000
val SCI_LEXER_START=4000
# Add text to the document
# Add text to the document.
fun void AddText=2001(int length, string text)
# Add array of cells to document
# Add array of cells to document.
fun void AddStyledText=2002(int length, cells c)
# Insert string at a position
# Insert string at a position.
fun void InsertText=2003(position pos, string text)
# Delete all text in the document
# Delete all text in the document.
fun void ClearAll=2004(,)
# Set all style bytes to 0, remove all folding information
# Set all style bytes to 0, remove all folding information.
fun void ClearDocumentStyle=2005(,)
# The number of characters in the document
# The number of characters in the document.
get int GetLength=2006(,)
# Returns the character byte at the position
# Returns the character byte at the position.
get int GetCharAt=2007(position pos,)
# Returns the position of the caret
# Returns the position of the caret.
get position GetCurrentPos=2008(,)
# Returns the position of the opposite end of the selection to the caret
# Returns the position of the opposite end of the selection to the caret.
get position GetAnchor=2009(,)
# Returns the style byte at the position
# Returns the style byte at the position.
get int GetStyleAt=2010(position pos,)
# Redoes the next action on the undo history
# Redoes the next action on the undo history.
fun void Redo=2011(,)
# Choose between collecting actions into the undo
@@ -121,10 +134,10 @@ fun void SetSavePoint=2014(,)
# Returns the number of bytes in the buffer not including terminating nulls.
fun int GetStyledText=2015(, textrange tr)
# Are there any redoable actions in the undo history.
# Are there any redoable actions in the undo history?
fun bool CanRedo=2016(,)
# Retrieve the line number at which a particular marker is located
# Retrieve the line number at which a particular marker is located.
fun int MarkerLineFromHandle=2017(int handle,)
# Delete a marker.
@@ -133,6 +146,7 @@ fun void MarkerDeleteHandle=2018(int handle,)
# Is undo history being collected?
get bool GetUndoCollection=2019(,)
enu WhiteSpace=SCWS_
val SCWS_INVISIBLE=0
val SCWS_VISIBLEALWAYS=1
val SCWS_VISIBLEAFTERINDENT=2
@@ -168,6 +182,7 @@ fun int GetCurLine=2027(int length, stringresult text)
# Retrieve the position of the last correctly styled character.
get position GetEndStyled=2028(,)
enu EndOfLine=SC_EOL_
val SC_EOL_CRLF=0
val SC_EOL_CR=1
val SC_EOL_LF=2
@@ -182,23 +197,21 @@ get int GetEOLMode=2030(,)
set void SetEOLMode=2031(int eolMode,)
# Set the current styling position to pos and the styling mask to mask.
# The styling mask can be used to protect some bits in each styling byte from
# modification.
# The styling mask can be used to protect some bits in each styling byte from modification.
fun void StartStyling=2032(position pos, int mask)
# Change style from current styling position for length characters to a style
# and move the current styling position to after this newly styled segment.
fun void SetStyling=2033(int length, int style)
# Is drawing done first into a buffer or direct to the screen.
# Is drawing done first into a buffer or direct to the screen?
get bool GetBufferedDraw=2034(,)
# If drawing is buffered then each line of text is drawn into a bitmap buffer
# before drawing it to the screen to avoid flicker.
set void SetBufferedDraw=2035(bool buffered,)
# Change the visible size of a tab to be a multiple of the width of a space
# character.
# Change the visible size of a tab to be a multiple of the width of a space character.
set void SetTabWidth=2036(int tabWidth,)
# Retrieve the visible size of a tab.
@@ -212,10 +225,11 @@ val SC_CP_UTF8=65001
# The SC_CP_UTF8 value can be used to enter Unicode mode.
set void SetCodePage=2037(int codePage,)
# In palette mode, Scintilla uses the environments palette calls to display
# In palette mode, Scintilla uses the environment's palette calls to display
# more colours. This may lead to ugly displays.
set void SetUsePalette=2039(bool usePalette,)
enu MarkerSymbol=SC_MARK_
val MARKER_MAX=31
val SC_MARK_CIRCLE=0
val SC_MARK_ROUNDRECT=1
@@ -227,7 +241,7 @@ val SC_MARK_ARROWDOWN=6
val SC_MARK_MINUS=7
val SC_MARK_PLUS=8
# Shapes used for outlining column
# Shapes used for outlining column.
val SC_MARK_VLINE=9
val SC_MARK_LCORNER=10
val SC_MARK_TCORNER=11
@@ -242,12 +256,13 @@ val SC_MARK_CIRCLEPLUSCONNECTED=19
val SC_MARK_CIRCLEMINUS=20
val SC_MARK_CIRCLEMINUSCONNECTED=21
# Invisible mark that only sets the line background color
# Invisible mark that only sets the line background color.
val SC_MARK_BACKGROUND=22
val SC_MARK_CHARACTER=10000
# Markers used for outlining column
enu MarkerOutline=SC_MARKNUM_
# Markers used for outlining column.
val SC_MARKNUM_FOLDEREND=25
val SC_MARKNUM_FOLDEROPENMID=26
val SC_MARKNUM_FOLDERMIDTAIL=27
@@ -270,10 +285,10 @@ fun void MarkerSetBack=2042(int markerNumber, colour back)
# Add a marker to a line, returning an ID which can be used to find or delete the marker.
fun int MarkerAdd=2043(int line, int markerNumber)
# Delete a marker from a line
# Delete a marker from a line.
fun void MarkerDelete=2044(int line, int markerNumber)
# Delete all markers with a particular number from all lines
# Delete all markers with a particular number from all lines.
fun void MarkerDeleteAll=2045(int markerNumber,)
# Get a bit mask of all the markers set on a line.
@@ -285,6 +300,7 @@ fun int MarkerNext=2047(int lineStart, int markerMask)
# Find the previous line before lineStart that includes a marker in mask.
fun int MarkerPrevious=2048(int lineStart, int markerMask)
enu MarginType=SC_MARGIN_
val SC_MARGIN_SYMBOL=0
val SC_MARGIN_NUMBER=1
@@ -314,6 +330,7 @@ get bool GetMarginSensitiveN=2247(int margin,)
# 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.
enu StylesCommon=STYLE_
val STYLE_DEFAULT=32
val STYLE_LINENUMBER=33
val STYLE_BRACELIGHT=34
@@ -325,6 +342,7 @@ val STYLE_MAX=127
# Character set identifiers are used in StyleSetCharacterSet.
# The values are the same as the Windows *_CHARSET values.
enu CharacterSet=SC_CHARSET_
val SC_CHARSET_ANSI=0
val SC_CHARSET_DEFAULT=1
val SC_CHARSET_BALTIC=186
@@ -375,6 +393,7 @@ fun void StyleResetDefault=2058(,)
# Set a style to be underlined or not.
set void StyleSetUnderline=2059(int style, bool underline)
enu CaseVisible=SC_CASE_
val SC_CASE_MIXED=0
val SC_CASE_UPPER=1
val SC_CASE_LOWER=2
@@ -414,8 +433,7 @@ get int GetCaretPeriod=2075(,)
# Get the time in milliseconds that the caret is on and off. 0 = steady on.
set void SetCaretPeriod=2076(int periodMilliseconds,)
# Set the set of characters making up words for when moving or selecting
# by word.
# Set the set of characters making up words for when moving or selecting by word.
set void SetWordChars=2077(, string characters)
# Start a sequence of actions that is undone and redone as a unit.
@@ -425,6 +443,7 @@ fun void BeginUndoAction=2078(,)
# End a sequence of actions that is undone and redone as a unit.
fun void EndUndoAction=2079(,)
enu IndicatorStyle=INDIC_
val INDIC_MAX=7
val INDIC_PLAIN=0
val INDIC_SQUIGGLE=1
@@ -448,8 +467,8 @@ set void IndicSetFore=2082(int indic, colour fore)
# Retrieve the foreground colour of an indicator.
get colour IndicGetFore=2083(int indic,)
# Divide each styling byte into lexical class bits (default:5) and indicator
# bits (default:3). If a lexer requires more than 32 lexical states, then this
# Divide each styling byte into lexical class bits (default: 5) and indicator
# bits (default: 3). If a lexer requires more than 32 lexical states, then this
# is used to expand the possible states.
set void SetStyleBits=2090(int bits,)
@@ -468,7 +487,7 @@ get int GetMaxLineState=2094(,)
# Is the background of the line containing the caret in a different colour?
get bool GetCaretLineVisible=2095(,)
# Dsplay the background of the line containing the caret in a different colour.
# Display the background of the line containing the caret in a different colour.
set void SetCaretLineVisible=2096(bool show,)
# Get the colour of the background of the line containing the caret.
@@ -492,8 +511,7 @@ fun void AutoCCancel=2101(,)
# Is there an auto-completion list visible?
fun bool AutoCActive=2102(,)
# Retrieve the position of the caret when the auto-completion list was
# displayed.
# Retrieve the position of the caret when the auto-completion list was displayed.
fun position AutoCPosStart=2103(,)
# User has selected an item so remove the list and insert the selection.
@@ -502,8 +520,8 @@ fun void AutoCComplete=2104(,)
# Define a set of character that when typed cancel the auto-completion list.
fun void AutoCStops=2105(, string characterSet)
# Change the separator character in the string setting up an auto-completion
# list. Default is space but can be changed if items contain space.
# Change the separator character in the string setting up an auto-completion list.
# Default is space but can be changed if items contain space.
set void AutoCSetSeparator=2106(int separatorCharacter,)
# Retrieve the auto-completion list separator character.
@@ -538,16 +556,18 @@ get bool AutoCGetIgnoreCase=2116(,)
# Display a list of strings and send notification when user chooses one.
fun void UserListShow=2117(int listType, string itemList)
# Set whether or not autocompletion is hidden automatically when nothing matches
# Set whether or not autocompletion is hidden automatically when nothing matches.
set void AutoCSetAutoHide=2118(bool autoHide,)
# Retrieve whether or not autocompletion is hidden automatically when nothing matches
# Retrieve whether or not autocompletion is hidden automatically when nothing matches.
get bool AutoCGetAutoHide=2119(,)
# Set whether or not autocompletion deletes any word characters after the inserted text upon completion
# Set whether or not autocompletion deletes any word characters
# after the inserted text upon completion.
set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,)
# Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion
# Retrieve whether or not autocompletion deletes any word characters
# after the inserted text upon completion.
get bool AutoCGetDropRestOfWord=2271(,)
# Set the number of spaces used for one level of indentation.
@@ -630,6 +650,7 @@ set void SetPrintMagnification=2146(int magnification,)
# Returns the print magnification.
get int GetPrintMagnification=2147(,)
enu PrintOption=SC_PRINT_
# PrintColourMode - use same colours as screen.
val SC_PRINT_NORMAL=0
# PrintColourMode - invert the light value of each style for printing.
@@ -647,6 +668,7 @@ set void SetPrintColourMode=2148(int mode,)
# Returns the print colour mode.
get int GetPrintColourMode=2149(,)
enu FindOption=SCFIND_
val SCFIND_WHOLEWORD=2
val SCFIND_MATCHCASE=4
val SCFIND_WORDSTART=0x00100000
@@ -655,7 +677,7 @@ val SCFIND_REGEXP=0x00200000
# Find some text in the document.
fun position FindText=2150(int flags, findtext ft)
# On Windows will draw the document into a display context such as a printer.
# On Windows, will draw the document into a display context such as a printer.
fun void FormatRange=2151(bool draw, formatrange fr)
# Retrieve the line at the top of the display.
@@ -727,7 +749,7 @@ fun void Null=2172(,)
# Will a paste succeed?
fun bool CanPaste=2173(,)
# Are there any undoable actions in the undo history.
# Are there any undoable actions in the undo history?
fun bool CanUndo=2174(,)
# Delete the undo history.
@@ -765,16 +787,16 @@ get int GetDirectFunction=2184(,)
# the function returned by GetDirectFunction.
get int GetDirectPointer=2185(,)
# Set to overtype (true) or insert mode
# Set to overtype (true) or insert mode.
set void SetOvertype=2186(bool overtype,)
# Returns true if overtype mode is active otherwise false is returned.
get bool GetOvertype=2187(,)
# Set the width of the insert mode caret
# Set the width of the insert mode caret.
set void SetCaretWidth=2188(int pixelWidth,)
# Returns the width of the insert mode caret
# Returns the width of the insert mode caret.
get int GetCaretWidth=2189(,)
# Sets the position that starts the target which is used for updating the
@@ -809,10 +831,10 @@ fun int ReplaceTargetRE=2195(int length, string text)
# Returns length of range or -1 for failure in which case target is not moved.
fun int SearchInTarget=2197(int length, string text)
# Set the search flags used by SearchInTarget
# Set the search flags used by SearchInTarget.
set void SetSearchFlags=2198(int flags,)
# Get the search flags used by SearchInTarget
# Get the search flags used by SearchInTarget.
get int GetSearchFlags=2199(,)
# Show a call tip containing a definition near position pos.
@@ -839,6 +861,7 @@ fun int VisibleFromDocLine=2220(int line,)
# Find the document line of a display line taking hidden lines into account.
fun int DocLineFromVisible=2221(int lineDisplay,)
enu FoldLevel=SC_FOLDLEVEL
val SC_FOLDLEVELBASE=0x400
val SC_FOLDLEVELWHITEFLAG=0x1000
val SC_FOLDLEVELHEADERFLAG=0x2000
@@ -879,20 +902,20 @@ fun void ToggleFold=2231(int line,)
# Ensure a particular line is visible by expanding any header line hiding it.
fun void EnsureVisible=2232(int line,)
# Set some debugging options for folding
# Set some debugging options for folding.
fun void SetFoldFlags=2233(int flags,)
# Ensure a particular line is visible by expanding any header line hiding it.
# Use the currently set visibility policy to determine which range to display.
fun void EnsureVisibleEnforcePolicy=2234(int line,)
# Sets whether a tab pressed when caret is within indentation indents
# Sets whether a tab pressed when caret is within indentation indents.
set void SetTabIndents=2260(bool tabIndents,)
# Does a tab pressed when caret is within indentation indent?
get bool GetTabIndents=2261(,)
# Sets whether a backspace pressed when caret is within indentation unindents
# Sets whether a backspace pressed when caret is within indentation unindents.
set void SetBackSpaceUnIndents=2262(bool bsUnIndents,)
# Does a backspace pressed when caret is within indentation unindent?
@@ -900,38 +923,63 @@ get bool GetBackSpaceUnIndents=2263(,)
val SC_TIME_FOREVER=10000000
# Sets the time the mouse must sit still to generate a mouse dwell event
# Sets the time the mouse must sit still to generate a mouse dwell event.
set void SetMouseDwellTime=2264(int periodMilliseconds,)
# Retrieve the time the mouse must sit still to generate a mouse dwell event
# Retrieve the time the mouse must sit still to generate a mouse dwell event.
get int GetMouseDwellTime=2265(,)
# Get position of start of word
# Get position of start of word.
fun int WordStartPosition=2266(position pos, bool onlyWordCharacters)
# Get position of end of word
# Get position of end of word.
fun int WordEndPosition=2267(position pos, bool onlyWordCharacters)
enu Wrap=SC_WRAP_
val SC_WRAP_NONE=0
val SC_WRAP_WORD=1
# Sets whether text is word wrapped
# Sets whether text is word wrapped.
set void SetWrapMode=2268(int mode,)
# Retrieve whether text is word wrapped
# Retrieve whether text is word wrapped.
get int GetWrapMode=2269(,)
enu LineCache=SC_CACHE_
val SC_CACHE_NONE=0
val SC_CACHE_CARET=1
val SC_CACHE_PAGE=2
val SC_CACHE_DOCUMENT=3
# Sets the degree of caching of layout information
# Sets the degree of caching of layout information.
set void SetLayoutCache=2272(int mode,)
# Retrieve the degree of caching of layout information
# Retrieve the degree of caching of layout information.
get int GetLayoutCache=2273(,)
# Sets the document width assumed for scrolling.
set void SetScrollWidth=2274(int pixelWidth,)
# Retrieve the document width assumed for scrolling.
get int GetScrollWidth=2275(,)
# Measure the pixel width of some text in a particular style.
# Nul terminated text argument.
# Does not handle tab or control characters.
fun int TextWidth=2276(int style, string text)
# Sets the scroll range so that maximum scroll position has
# the last line at the bottom of the view (default).
# Setting this to false allows scrolling one page below the last line.
set void SetEndAtLastLine=2277(bool endAtLastLine,)
# Retrieve whether the maximum scroll position has the last
# line at the bottom of the view.
get int GetEndAtLastLine=2278(,)
# Retrieve the height of a particular line of text in pixels.
fun int TextHeight=2279(int line,)
## Start of key messages
# Move caret down one line.
fun void LineDown=2300(,)
@@ -1014,8 +1062,7 @@ fun void Cancel=2325(,)
# Delete the selection or if no selection, the character before the caret.
fun void DeleteBack=2326(,)
# If selection is empty or all on one line replace the selection with a tab
# character.
# If selection is empty or all on one line replace the selection with a tab character.
# If more than one line selected, indent the lines.
fun void Tab=2327(,)
@@ -1069,17 +1116,17 @@ fun void LineScrollDown=2342(,)
fun void LineScrollUp=2343(,)
# Delete the selection or if no selection, the character before the caret.
# Will not delete the chraacter before at the start of a line.
# Will not delete the character before at the start of a line.
fun void DeleteBackNotLine=2344(,)
# Move the caret inside current view if it's not there already
# Move the caret inside current view if it's not there already.
fun void MoveCaretInsideView=2401(,)
# How many characters are on a line, not including end of line characters.
# How many characters are on a line, not including end of line characters?
fun int LineLength=2350(int line,)
# Highlight the characters at two positions.
fun void BraceHighlight=2351(position pos1,position pos2)
fun void BraceHighlight=2351(position pos1, position pos2)
# Highlight the character at a position indicating there is no matching brace.
fun void BraceBadLight=2352(position pos,)
@@ -1087,10 +1134,10 @@ fun void BraceBadLight=2352(position pos,)
# Find the position of a matching brace or INVALID_POSITION if no match.
fun position BraceMatch=2353(position pos,)
# Are the end of line characters visible.
# Are the end of line characters visible?
get bool GetViewEOL=2355(,)
# Make the end of line characters visible or invisible
# Make the end of line characters visible or invisible.
set void SetViewEOL=2356(bool visible,)
# Retrieve a pointer to the document object.
@@ -1102,6 +1149,7 @@ set void SetDocPointer=2358(,int pointer)
# Set which document modification events are sent to the container.
set void SetModEventMask=2359(int mask,)
enu EdgeVisualStyle=EDGE_
val EDGE_NONE=0
val EDGE_LINE=1
val EDGE_BACKGROUND=2
@@ -1137,24 +1185,6 @@ fun int SearchNext=2367(int flags, string text)
# Does not ensure the selection is visible.
fun int SearchPrev=2368(int flags, string text)
# Show caret within N lines of edge when it's scrolled to view
# If CARET_SLOP not set then centre caret on screen when it's
# scrolled to view
val CARET_SLOP=0x01
# Value not used
val CARET_CENTER=0x02
# If CARET_SLOP also set then reposition whenever outside slop border
# If CARET_SLOP not set then recentre even when visible
val CARET_STRICT=0x04
# If CARET_XEVEN set then both left and right margins are given equal weight
# rather than favouring left following behaviour.
val CARET_XEVEN=0x08
# If CARET_XJUMPS set then when caret reaches the margin the display jumps
# enough to leave the caret solidly within the display.
val CARET_XJUMPS=0x10
# Set the way the line the caret is on is kept visible.
fun void SetCaretPolicy=2369(int caretPolicy, int caretSlop)
# Retrieves the number of lines completely visible.
get int LinesOnScreen=2370(,)
@@ -1162,7 +1192,7 @@ get int LinesOnScreen=2370(,)
# the wrong mouse button.
fun void UsePopUp=2371(bool allowPopUp,)
# Is the selection a rectangular. The alternative is the more common stream selection.
# Is the selection rectangular? The alternative is the more common stream selection.
get bool SelectionIsRectangle=2372(,)
# Set the zoom level. This number of points is added to the size of all fonts.
@@ -1182,63 +1212,99 @@ fun void ReleaseDocument=2377(, int doc)
# Get which document modification events are sent to the container.
get int GetModEventMask=2378(,)
# Change internal focus flag
# Change internal focus flag.
set void SetFocus=2380(bool focus,)
# Get internal focus flag
# Get internal focus flag.
get bool GetFocus=2381(,)
# Change error status - 0 = OK
# Change error status - 0 = OK.
set void SetStatus=2382(int statusCode,)
# Get error status
# Get error status.
get int GetStatus=2383(,)
# Set whether the mouse is captured when its button is pressed
# Set whether the mouse is captured when its button is pressed.
set void SetMouseDownCaptures=2384(bool captures,)
# Get whether mouse gets captured
# Get whether mouse gets captured.
get bool GetMouseDownCaptures=2385(,)
enu CursorShape=SC_CURSOR
val SC_CURSORNORMAL=-1
val SC_CURSORWAIT=3
# Sets the cursor to one of the SC_CURSOR* values
# Sets the cursor to one of the SC_CURSOR* values.
set void SetCursor=2386(int cursorType,)
# Get cursor type
# Get cursor type.
get int GetCursor=2387(,)
# Change the way control characters are displayed:
# If symbol is < 32, keep the drawn way, else, use the given character
# If symbol is < 32, keep the drawn way, else, use the given character.
set void SetControlCharSymbol=2388(int symbol,)
# Get the way control characters are displayed
# Get the way control characters are displayed.
get int GetControlCharSymbol=2389(,)
# Move to the previous change in capitalistion
# Move to the previous change in capitalisation.
fun void WordPartLeft=2390(,)
# Move to the previous change in capitalistion extending selection to new caret position.
# Move to the previous change in capitalisation extending selection
# to new caret position.
fun void WordPartLeftExtend=2391(,)
# Move to the change next in capitalistion
# Move to the change next in capitalisation.
fun void WordPartRight=2392(,)
# Move to the next change in capitalistion extending selection to new caret position.
# Move to the next change in capitalisation extending selection
# to new caret position.
fun void WordPartRightExtend=2393(,)
# Constants for use with SetVisiblePolicy, similar to SetCaretPolicy
# Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
val VISIBLE_SLOP=0x01
val VISIBLE_STRICT=0x04
# Set the way the display area is determined when a particular line is to be moved to.
# Set the way the display area is determined when a particular line
# is to be moved to by Find, FindNext, GotoLine, etc.
fun void SetVisiblePolicy=2394(int visiblePolicy, int visibleSlop)
# Delete back from the current position to the start of the line
# Delete back from the current position to the start of the line.
fun void DelLineLeft=2395(,)
# Delete forwards from the current position to the end of the line
# Delete forwards from the current position to the end of the line.
fun void DelLineRight=2396(,)
# Get and Set the xOffset (ie, horizonal scroll position)
# Get and Set the xOffset (ie, horizonal scroll position).
set void SetXOffset=2397(int newOffset,)
get int GetXOffset=2398(,)
# Set the focus to this Scintilla widget.
# GTK+ Specific
# GTK+ Specific.
fun void GrabFocus=2400(,)
enu CaretPolicy = CARET_
# Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
# If CARET_SLOP is set, we can define a slop value: caretSlop.
# This value defines an unwanted zone (UZ) where the caret is... unwanted.
# This zone is defined as a number of pixels near the vertical margins,
# and as a number of lines near the horizontal margins.
# By keeping the caret away from the edges, it is seen within its context,
# so it is likely that the identifier that the caret is on can be completely seen,
# and that the current line is seen with some of the lines following it which are
# often dependent on that line.
val CARET_SLOP=0x01
# If CARET_STRICT is set, the policy is enforced... strictly.
# The caret is centred on the display if slop is not set,
# and cannot go in the UZ if slop is set.
val CARET_STRICT=0x04
# If CARET_JUMPS is set, the display is moved more energetically
# so the caret can move in the same direction longer before the policy is applied again.
val CARET_JUMPS=0x10
# If CARET_EVEN is not set, instead of having symmetrical UZs,
# the left and bottom UZs are extended up to right and top UZs respectively.
# This way, we favour the displaying of useful information: the begining of lines,
# where most code reside, and the lines after the caret, eg. the body of a function.
val CARET_EVEN=0x08
# Set the way the caret is kept visible when going sideway.
# The exclusion zone is given in pixels.
fun void SetXCaretPolicy=2402(int caretPolicy, int caretSlop)
# Set the way the line the caret is on is kept visible.
# The exclusion zone is given in lines.
fun void SetYCaretPolicy=2403(int caretPolicy, int caretSlop)
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
@@ -1264,9 +1330,10 @@ set void SetKeyWords=4005(int keywordSet, string keyWords)
set void SetLexerLanguage=4006(, string language)
# Notifications
# Type of modification and the action which caused the modification
# Type of modification and the action which caused the modification.
# These are defined as a bit mask to make it easy to specify which notifications are wanted.
# One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
enu ModificationFlags=SC_MOD_ SC_PERFORMED_ SC_LAST
val SC_MOD_INSERTTEXT=0x1
val SC_MOD_DELETETEXT=0x2
val SC_MOD_CHANGESTYLE=0x4
@@ -1281,15 +1348,18 @@ val SC_MOD_BEFOREDELETE=0x800
val SC_MODEVENTMASKALL=0xF77
# For compatibility, these go through the COMMAND notification rather than NOTIFY
# and have exactly the same values as the EN_* constants.
# and should have had exactly the same values as the EN_* constants.
# Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_*
# As clients depend on these constants, this will not be changed.
val SCEN_CHANGE=768
val SCEN_SETFOCUS=512
val SCEN_KILLFOCUS=256
# Symbolic key codes and modifier flags
# ASCII and other printable characters below 256
# Extended keys above 300
# Symbolic key codes and modifier flags.
# ASCII and other printable characters below 256.
# Extended keys above 300.
enu Keys=SCK_
val SCK_DOWN=300
val SCK_UP=301
val SCK_LEFT=302
@@ -1308,12 +1378,14 @@ val SCK_ADD=310
val SCK_SUBTRACT=311
val SCK_DIVIDE=312
enu KeyMod=SCMOD_
val SCMOD_SHIFT=1
val SCMOD_CTRL=2
val SCMOD_ALT=4
################################################
# For SciLexer.h
enu Lexer=SCLEX_
val SCLEX_CONTAINER=0
val SCLEX_NULL=1
val SCLEX_PYTHON=2
@@ -1347,11 +1419,14 @@ val SCLEX_ASP=29
val SCLEX_PHP=30
val SCLEX_BAAN=31
val SCLEX_MATLAB=32
val SCLEX_SCRIPTOL=33
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
val SCLEX_AUTOMATIC=1000
# Lexical states for SCLEX_PYTHON
lex Python=SCLEX_PYTHON SCE_P_
lex Ruby=SCLEX_RUBY SCE_P_
val SCE_P_DEFAULT=0
val SCE_P_COMMENTLINE=1
val SCE_P_NUMBER=2
@@ -1367,6 +1442,11 @@ val SCE_P_IDENTIFIER=11
val SCE_P_COMMENTBLOCK=12
val SCE_P_STRINGEOL=13
# Lexical states for SCLEX_CPP
lex Cpp=SCLEX_CPP SCE_C_
lex SQL=SCLEX_SQL SCE_C_
lex Pascal=SCLEX_PASCAL SCE_C_
lex TCL=SCLEX_TCL SCE_C_
lex BullAnt=SCLEX_BULLANT SCE_C_
val SCE_C_DEFAULT=0
val SCE_C_COMMENT=1
val SCE_C_COMMENTLINE=2
@@ -1386,17 +1466,11 @@ val SCE_C_COMMENTLINEDOC=15
val SCE_C_WORD2=16
val SCE_C_COMMENTDOCKEYWORD=17
val SCE_C_COMMENTDOCKEYWORDERROR=18
# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
val SCE_B_DEFAULT=0
val SCE_B_COMMENT=1
val SCE_B_NUMBER=2
val SCE_B_KEYWORD=3
val SCE_B_STRING=4
val SCE_B_PREPROCESSOR=5
val SCE_B_OPERATOR=6
val SCE_B_IDENTIFIER=7
val SCE_B_DATE=8
# Lexical states for SCLEX_HTML, SCLEX_XML
lex HTML=SCLEX_HTML SCE_H
lex XML=SCLEX_XML SCE_H
lex ASP=SCLEX_ASP SCE_H
lex PHP=SCLEX_PHP SCE_H
val SCE_H_DEFAULT=0
val SCE_H_TAG=1
val SCE_H_TAGUNKNOWN=2
@@ -1519,6 +1593,7 @@ val SCE_HPHP_COMMENTLINE=125
val SCE_HPHP_HSTRING_VARIABLE=126
val SCE_HPHP_OPERATOR=127
# Lexical states for SCLEX_PERL
lex Perl=SCLEX_PERL SCE_PL_
val SCE_PL_DEFAULT=0
val SCE_PL_ERROR=1
val SCE_PL_COMMENTLINE=2
@@ -1549,13 +1624,34 @@ val SCE_PL_STRING_QQ=27
val SCE_PL_STRING_QX=28
val SCE_PL_STRING_QR=29
val SCE_PL_STRING_QW=30
# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
lex VB=SCLEX_VB SCE_B_
lex VBScript=SCLEX_VBSCRIPT SCE_B_
val SCE_B_DEFAULT=0
val SCE_B_COMMENT=1
val SCE_B_NUMBER=2
val SCE_B_KEYWORD=3
val SCE_B_STRING=4
val SCE_B_PREPROCESSOR=5
val SCE_B_OPERATOR=6
val SCE_B_IDENTIFIER=7
val SCE_B_DATE=8
# Lexical states for SCLEX_PROPERTIES
lex Properties=SCLEX_PROPERTIES SCE_PROPS_
val SCE_PROPS_DEFAULT=0
val SCE_PROPS_COMMENT=1
val SCE_PROPS_SECTION=2
val SCE_PROPS_ASSIGNMENT=3
val SCE_PROPS_DEFVAL=4
# Lexical states for SCLEX_LATEX
lex LaTeX=SCLEX_LATEX SCE_L_
val SCE_L_DEFAULT=0
val SCE_L_COMMAND=1
val SCE_L_TAG=2
val SCE_L_MATH=3
val SCE_L_COMMENT=4
# Lexical states for SCLEX_LUA
lex Lua=SCLEX_LUA SCE_LUA_
val SCE_LUA_DEFAULT=0
val SCE_LUA_COMMENT=1
val SCE_LUA_COMMENTLINE=2
@@ -1575,6 +1671,7 @@ val SCE_LUA_WORD4=15
val SCE_LUA_WORD5=16
val SCE_LUA_WORD6=17
# Lexical states for SCLEX_ERRORLIST
lex ErrorList=SCLEX_ERRORLIST SCE_ERR_
val SCE_ERR_DEFAULT=0
val SCE_ERR_PYTHON=1
val SCE_ERR_GCC=2
@@ -1584,11 +1681,13 @@ val SCE_ERR_BORLAND=5
val SCE_ERR_PERL=6
val SCE_ERR_NET=7
val SCE_ERR_LUA=8
val SCE_ERR_CTAG=9
val SCE_ERR_DIFF_CHANGED=10
val SCE_ERR_DIFF_ADDITION=11
val SCE_ERR_DIFF_DELETION=12
val SCE_ERR_DIFF_MESSAGE=13
# Lexical states for SCLEX_BATCH
lex Batch=SCLEX_BATCH SCE_BAT_
val SCE_BAT_DEFAULT=0
val SCE_BAT_COMMENT=1
val SCE_BAT_WORD=2
@@ -1598,6 +1697,7 @@ val SCE_BAT_COMMAND=5
val SCE_BAT_IDENTIFIER=6
val SCE_BAT_OPERATOR=7
# Lexical states for SCLEX_MAKEFILE
lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_
val SCE_MAKE_DEFAULT=0
val SCE_MAKE_COMMENT=1
val SCE_MAKE_PREPROCESSOR=2
@@ -1605,7 +1705,17 @@ val SCE_MAKE_IDENTIFIER=3
val SCE_MAKE_OPERATOR=4
val SCE_MAKE_TARGET=5
val SCE_MAKE_IDEOL=9
# Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer)
# Lexical states for SCLEX_DIFF
lex Diff=SCLEX_DIFF SCE_DIFF_
val SCE_DIFF_DEFAULT=0
val SCE_DIFF_COMMENT=1
val SCE_DIFF_COMMAND=2
val SCE_DIFF_HEADER=3
val SCE_DIFF_POSITION=4
val SCE_DIFF_DELETED=5
val SCE_DIFF_ADDED=6
# Lexical states for SCLEX_CONF (Apache Configuration Files Lexer)
lex Conf=SCLEX_CONF SCE_CONF_
val SCE_CONF_DEFAULT=0
val SCE_CONF_COMMENT=1
val SCE_CONF_NUMBER=2
@@ -1616,7 +1726,8 @@ val SCE_CONF_STRING=6
val SCE_CONF_OPERATOR=7
val SCE_CONF_IP=8
val SCE_CONF_DIRECTIVE=9
# Avenue
# Lexical states for SCLEX_AVE, Avenue
lex Avenue=SCLEX_AVE SCE_AVE_
val SCE_AVE_DEFAULT=0
val SCE_AVE_COMMENT=1
val SCE_AVE_NUMBER=2
@@ -1629,6 +1740,7 @@ val SCE_AVE_STRINGEOL=8
val SCE_AVE_IDENTIFIER=9
val SCE_AVE_OPERATOR=10
# Lexical states for SCLEX_ADA
lex Ada=SCLEX_ADA SCE_ADA_
val SCE_ADA_DEFAULT=0
val SCE_ADA_COMMENT=1
val SCE_ADA_NUMBER=2
@@ -1639,6 +1751,7 @@ val SCE_ADA_OPERATOR=6
val SCE_ADA_IDENTIFIER=7
val SCE_ADA_STRINGEOL=8
# Lexical states for SCLEX_BAAN
lex Baan=SCLEX_BAAN SCE_BAAN_
val SCE_BAAN_DEFAULT=0
val SCE_BAAN_COMMENT=1
val SCE_BAAN_COMMENTDOC=2
@@ -1651,6 +1764,7 @@ val SCE_BAAN_IDENTIFIER=8
val SCE_BAAN_STRINGEOL=9
val SCE_BAAN_WORD2=10
# Lexical states for SCLEX_LISP
lex Lisp=SCLEX_LISP SCE_LISP_
val SCE_LISP_DEFAULT=0
val SCE_LISP_COMMENT=1
val SCE_LISP_NUMBER=2
@@ -1660,6 +1774,8 @@ val SCE_LISP_STRINGEOL=8
val SCE_LISP_IDENTIFIER=9
val SCE_LISP_OPERATOR=10
# Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW
lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_
lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_
val SCE_EIFFEL_DEFAULT=0
val SCE_EIFFEL_COMMENTLINE=1
val SCE_EIFFEL_NUMBER=2
@@ -1669,7 +1785,8 @@ val SCE_EIFFEL_CHARACTER=5
val SCE_EIFFEL_OPERATOR=6
val SCE_EIFFEL_IDENTIFIER=7
val SCE_EIFFEL_STRINGEOL=8
# Lexical states for the SCLEX_NNCRONTAB (nnCron crontab Lexer)
# Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer)
lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_
val SCE_NNCRONTAB_DEFAULT=0
val SCE_NNCRONTAB_COMMENT=1
val SCE_NNCRONTAB_TASK=2
@@ -1682,6 +1799,7 @@ val SCE_NNCRONTAB_STRING=8
val SCE_NNCRONTAB_ENVIRONMENT=9
val SCE_NNCRONTAB_IDENTIFIER=10
# Lexical states for SCLEX_MATLAB
lex MatLab=SCLEX_MATLAB SCE_MATLAB_
val SCE_MATLAB_DEFAULT=0
val SCE_MATLAB_COMMENT=1
val SCE_MATLAB_COMMAND=2
@@ -1690,6 +1808,28 @@ val SCE_MATLAB_KEYWORD=4
val SCE_MATLAB_STRING=5
val SCE_MATLAB_OPERATOR=6
val SCE_MATLAB_IDENTIFIER=7
# Lexical states for SCLEX_SCRIPTOL
lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_
val SCE_SCRIPTOL_DEFAULT=0
val SCE_SCRIPTOL_COMMENT=1
val SCE_SCRIPTOL_COMMENTLINE=2
val SCE_SCRIPTOL_COMMENTDOC=3
val SCE_SCRIPTOL_NUMBER=4
val SCE_SCRIPTOL_WORD=5
val SCE_SCRIPTOL_STRING=6
val SCE_SCRIPTOL_CHARACTER=7
val SCE_SCRIPTOL_UUID=8
val SCE_SCRIPTOL_PREPROCESSOR=9
val SCE_SCRIPTOL_OPERATOR=10
val SCE_SCRIPTOL_IDENTIFIER=11
val SCE_SCRIPTOL_STRINGEOL=12
val SCE_SCRIPTOL_VERBATIM=13
val SCE_SCRIPTOL_REGEX=14
val SCE_SCRIPTOL_COMMENTLINEDOC=15
val SCE_SCRIPTOL_WORD2=16
val SCE_SCRIPTOL_COMMENTDOCKEYWORD=17
val SCE_SCRIPTOL_COMMENTDOCKEYWORDERROR=18
val SCE_SCRIPTOL_COMMENTBASIC=19
# Events
@@ -1711,9 +1851,17 @@ evt void UserListSelection=2014(int listType, string text)
evt void URIDropped=2015(string text)
evt void DwellStart=2016(int position)
evt void DwellEnd=2017(int position)
evt void Zoom=2018(void)
cat Deprecated
# CARET_POLICY changed in 1.47
fun void SetCaretPolicy=2369(int caretPolicy, int caretSlop)
val CARET_CENTER=0x02
val CARET_XEVEN=0x08
val CARET_XJUMPS=0x10
# The old name for SCN_UPDATEUI
val SCN_CHECKBRACE=2007
evt void PosChanged=2012(int position)

View File

@@ -28,7 +28,7 @@ struct _ScintillaObject {
};
struct _ScintillaClass {
GtkFixedClass parent_class;
GtkContainerClass parent_class;
void (* command) (ScintillaObject *ttt);
void (* notify) (ScintillaObject *ttt);
@@ -39,6 +39,12 @@ GtkWidget* scintilla_new (void);
void scintilla_set_id (ScintillaObject *sci,int id);
sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);
#if GTK_MAJOR_VERSION < 2
#define SCINTILLA_NOTIFY "notify"
#else
#define SCINTILLA_NOTIFY "sci-notify"
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -31,6 +31,7 @@ public:
lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {
}
~WindowAccessor();
bool Match(int pos, const char *s);
char StyleAt(int position);
int GetLine(int position);
int LineStart(int line);

View File

@@ -118,7 +118,7 @@ void AutoComplete::Move(int delta) {
}
void AutoComplete::Select(const char *word) {
int lenWord = strlen(word);
size_t lenWord = strlen(word);
int location = -1;
const int maxItemLen=1000;
char item[maxItemLen];

View File

@@ -148,7 +148,7 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
look = newline + 1;
numLines++;
}
int lastWidth = surfaceMeasure->WidthText(font, look, strlen(look));
int lastWidth = surfaceMeasure->WidthText(font, look, static_cast<int>(strlen(look)));
width = Platform::Maximum(width, lastWidth) + 10;
int lineHeight = surfaceMeasure->Height(font);
// Extra line for border and an empty line at top and bottom

View File

@@ -958,10 +958,13 @@ void CellBuffer::BasicDeleteChars(int position, int deleteLength) {
//Platform::DebugPrintf("Removing cr end of line\n");
lv.Remove(lineRemove);
}
} else if ((ch == '\n') && !ignoreNL) {
} else if (ch == '\n') {
if (ignoreNL) {
ignoreNL = false; // Further \n are real deletions
} else {
//Platform::DebugPrintf("Removing lf end of line\n");
lv.Remove(lineRemove);
ignoreNL = false; // Further \n are not real deletions
}
}
ch = chNext;

View File

@@ -344,17 +344,19 @@ void Document::ModifiedAt(int pos) {
// SetStyleAt does not change the persistent state of a document
// Unlike Undo, Redo, and InsertStyledString, the pos argument is a cell number not a char number
void Document::DeleteChars(int pos, int len) {
bool Document::DeleteChars(int pos, int len) {
if (len == 0)
return;
return false;
if ((pos + len) > Length())
return;
return false;
if (cb.IsReadOnly() && enteredReadOnlyCount == 0) {
enteredReadOnlyCount++;
NotifyModifyAttempt();
enteredReadOnlyCount--;
}
if (enteredCount == 0) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
if (!cb.IsReadOnly()) {
NotifyModified(
@@ -379,15 +381,18 @@ void Document::DeleteChars(int pos, int len) {
}
enteredCount--;
}
return !cb.IsReadOnly();
}
void Document::InsertStyledString(int position, char *s, int insertLength) {
bool Document::InsertStyledString(int position, char *s, int insertLength) {
if (cb.IsReadOnly() && enteredReadOnlyCount == 0) {
enteredReadOnlyCount++;
NotifyModifyAttempt();
enteredReadOnlyCount--;
}
if (enteredCount == 0) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
if (!cb.IsReadOnly()) {
NotifyModified(
@@ -409,6 +414,7 @@ void Document::InsertStyledString(int position, char *s, int insertLength) {
}
enteredCount--;
}
return !cb.IsReadOnly();
}
int Document::Undo() {
@@ -497,29 +503,32 @@ int Document::Redo() {
return newPos;
}
void Document::InsertChar(int pos, char ch) {
bool Document::InsertChar(int pos, char ch) {
char chs[2];
chs[0] = ch;
chs[1] = 0;
InsertStyledString(pos*2, chs, 2);
return InsertStyledString(pos*2, chs, 2);
}
// Insert a null terminated string
void Document::InsertString(int position, const char *s) {
InsertString(position, s, strlen(s));
bool Document::InsertString(int position, const char *s) {
return InsertString(position, s, strlen(s));
}
// Insert a string with a length
void Document::InsertString(int position, const char *s, int insertLength) {
bool Document::InsertString(int position, const char *s, size_t insertLength) {
bool changed = false;
char *sWithStyle = new char[insertLength * 2];
if (sWithStyle) {
for (int i = 0; i < insertLength; i++) {
for (size_t i = 0; i < insertLength; i++) {
sWithStyle[i*2] = s[i];
sWithStyle[i*2 + 1] = 0;
}
InsertStyledString(position*2, sWithStyle, insertLength*2);
changed = InsertStyledString(position*2, sWithStyle,
static_cast<int>(insertLength*2));
delete []sWithStyle;
}
return changed;
}
void Document::ChangeChar(int pos, char ch) {
@@ -531,22 +540,18 @@ void Document::DelChar(int pos) {
DeleteChars(pos, LenChar(pos));
}
int Document::DelCharBack(int pos) {
void Document::DelCharBack(int pos) {
if (pos <= 0) {
return pos;
return;
} else if (IsCrLf(pos - 2)) {
DeleteChars(pos - 2, 2);
return pos - 2;
} else if (SC_CP_UTF8 == dbcsCodePage) {
int startChar = MovePositionOutsideChar(pos - 1, -1, false);
DeleteChars(startChar, pos - startChar);
return startChar;
} else if (IsDBCS(pos - 1)) {
DeleteChars(pos - 2, 2);
return pos - 2;
} else {
DeleteChars(pos - 1, 1);
return pos - 1;
}
}
@@ -822,8 +827,9 @@ class DocumentIndexer : public CharacterIndexer {
Document *pdoc;
int end;
public:
DocumentIndexer(Document *pdoc_, int end_) :
pdoc(pdoc_), end(end_) {}
DocumentIndexer(Document *pdoc_, int end_) :
pdoc(pdoc_), end(end_) {
}
virtual char CharAt(int index) {
if (index < 0 || index >= end)
@@ -928,7 +934,7 @@ long Document::FindText(int minPos, int maxPos, const char *s,
// Compute actual search ranges needed
int lengthFind = *length;
if (lengthFind == -1)
lengthFind = strlen(s);
lengthFind = static_cast<int>(strlen(s));
int endSearch = endPos;
if (startPos <= endPos) {
endSearch = endPos - lengthFind + 1;
@@ -1081,8 +1087,10 @@ void Document::StartStyling(int position, char mask) {
endStyled = position;
}
void Document::SetStyleFor(int length, char style) {
if (enteredCount == 0) {
bool Document::SetStyleFor(int length, char style) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
int prevEndStyled = endStyled;
if (cb.SetStyleFor(endStyled, length, style, stylingMask)) {
@@ -1092,26 +1100,32 @@ void Document::SetStyleFor(int length, char style) {
}
endStyled += length;
enteredCount--;
return true;
}
}
void Document::SetStyles(int length, char *styles) {
if (enteredCount == 0) {
bool Document::SetStyles(int length, char *styles) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
int prevEndStyled = endStyled;
bool didChange = false;
int lastChange = 0;
for (int iPos = 0; iPos < length; iPos++, endStyled++) {
PLATFORM_ASSERT(endStyled < Length());
if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) {
didChange = true;
lastChange = iPos;
}
}
if (didChange) {
DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
prevEndStyled, endStyled - prevEndStyled);
prevEndStyled, lastChange);
NotifyModified(mh);
}
enteredCount--;
return true;
}
}
@@ -1121,10 +1135,11 @@ bool Document::EnsureStyledTo(int pos) {
if (styleClock > 0x100000) {
styleClock = 0;
}
}
// Ask the watchers to style, and stop as soon as one responds.
for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++)
for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) {
watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos);
}
}
return pos <= GetEndStyled();
}

View File

@@ -132,8 +132,8 @@ public:
int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true);
// Gateways to modifying document
void DeleteChars(int pos, int len);
void InsertStyledString(int position, char *s, int insertLength);
bool DeleteChars(int pos, int len);
bool InsertStyledString(int position, char *s, int insertLength);
int Undo();
int Redo();
bool CanUndo() { return cb.CanUndo(); }
@@ -158,12 +158,12 @@ public:
void SetReadOnly(bool set) { cb.SetReadOnly(set); }
bool IsReadOnly() { return cb.IsReadOnly(); }
void InsertChar(int pos, char ch);
void InsertString(int position, const char *s);
void InsertString(int position, const char *s, int insertLength);
bool InsertChar(int pos, char ch);
bool InsertString(int position, const char *s);
bool InsertString(int position, const char *s, size_t insertLength);
void ChangeChar(int pos, char ch);
void DelChar(int pos);
int DelCharBack(int pos);
void DelCharBack(int pos);
char CharAt(int position) { return cb.CharAt(position); }
void GetCharRange(char *buffer, int position, int lengthRetrieve) {
@@ -202,8 +202,8 @@ public:
void SetWordChars(unsigned char *chars);
void SetStylingBits(int bits);
void StartStyling(int position, char mask);
void SetStyleFor(int length, char style);
void SetStyles(int length, char *styles);
bool SetStyleFor(int length, char style);
bool SetStyles(int length, char *styles);
int GetEndStyled() { return endStyled; }
bool EnsureStyledTo(int pos);
int GetStyleClock() { return styleClock; }

View File

@@ -48,6 +48,15 @@ void DocumentAccessor::Fill(int position) {
buf[endPos-startPos] = '\0';
}
bool DocumentAccessor::Match(int pos, const char *s) {
for (int i=0; *s; i++) {
if (*s != SafeGetCharAt(pos+i))
return false;
s++;
}
return true;
}
char DocumentAccessor::StyleAt(int position) {
return pdoc->StyleAt(position);
}

View File

@@ -38,6 +38,7 @@ public:
startSeg(0), startPosStyling(0) {
}
~DocumentAccessor();
bool Match(int pos, const char *s);
char StyleAt(int position);
int GetLine(int position);
int LineStart(int line);

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,7 @@ public:
enum { wrapWidthInfinite = 0x7ffffff };
int maxLineLength;
int numCharsInLine;
enum validLevel { llInvalid, llPositions, llLines } validity;
enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity;
int xHighlightGuide;
bool highlightColumn;
int selStart;
@@ -200,6 +200,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
int xOffset; ///< Horizontal scrolled amount in pixels
int xCaretMargin; ///< Ensure this many pixels visible on both sides of caret
bool horizontalScrollBarVisible;
int scrollWidth;
bool endAtLastLine;
Surface *pixmapLine;
Surface *pixmapSelMargin;
@@ -257,8 +259,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
int xEndSelect;
bool primarySelection;
int caretPolicy;
int caretSlop;
int caretXPolicy;
int caretXSlop; ///< Ensure this many pixels visible on both sides of caret
int caretYPolicy;
int caretYSlop; ///< Ensure this many lines visible on both sides of caret
int visiblePolicy;
int visibleSlop;
@@ -302,6 +307,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
int LineFromLocation(Point pt);
void SetTopLine(int topLineNew);
bool AbandonPaint();
void RedrawRect(PRectangle rc);
void Redraw();
void RedrawSelMargin();
@@ -342,6 +348,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
PRectangle rcLine, LineLayout *ll, int subLine=0);
void Paint(Surface *surfaceWindow, PRectangle rcArea);
long FormatRange(bool draw, RangeToFormat *pfr);
int TextWidth(int style, const char *text);
virtual void SetVerticalScrollPos() = 0;
virtual void SetHorizontalScrollPos() = 0;
@@ -383,6 +390,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);
void NotifyNeedShown(int pos, int len);
void NotifyDwelling(Point pt, bool state);
void NotifyZoom();
void NotifyModifyAttempt(Document *document, void *userData);
void NotifySavePoint(Document *document, void *userData, bool atSavePoint);
@@ -390,12 +398,14 @@ protected: // ScintillaBase subclass needs access to much of Editor
void NotifyModified(Document *document, DocModification mh, void *userData);
void NotifyDeleted(Document *document, void *userData);
void NotifyStyleNeeded(Document *doc, void *userData, int endPos);
void NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long lParam);
void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
void PageMove(int direction, bool extend=false);
void ChangeCaseOfSelection(bool makeUpperCase);
void LineTranspose();
virtual void CancelModes();
void NewLine();
void CursorUpOrDown(int direction, bool extend=false);
virtual int KeyCommand(unsigned int iMessage);
virtual int KeyDefault(int /* key */, int /*modifiers*/);
int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0);
@@ -405,9 +415,9 @@ protected: // ScintillaBase subclass needs access to much of Editor
void Indent(bool forwards);
long FindText(unsigned long wParam, long lParam);
long FindText(uptr_t wParam, sptr_t lParam);
void SearchAnchor();
long SearchText(unsigned int iMessage, unsigned long wParam, long lParam);
long SearchText(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
long SearchInTarget(const char *text, int length);
void GoToLine(int lineNo);

View File

@@ -23,10 +23,12 @@ const LexerModule *LexerModule::base = 0;
int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1;
LexerModule::LexerModule(int language_, LexerFunction fnLexer_,
const char *languageName_, LexerFunction fnFolder_) :
const char *languageName_, LexerFunction fnFolder_,
const char * const wordListDescriptions_[]) :
language(language_),
fnLexer(fnLexer_),
fnFolder(fnFolder_),
wordListDescriptions(wordListDescriptions_),
languageName(languageName_) {
next = base;
base = this;
@@ -36,6 +38,31 @@ LexerModule::LexerModule(int language_, LexerFunction fnLexer_,
}
}
int LexerModule::GetNumWordLists() const {
if (wordListDescriptions == NULL) {
return -1;
} else {
int numWordLists = 0;
while (wordListDescriptions[numWordLists]) {
++numWordLists;
}
return numWordLists;
}
}
const char * LexerModule::GetWordListDescription(int index) const {
static const char *emptyStr = "";
PLATFORM_ASSERT(index < GetNumWordLists());
if (index >= GetNumWordLists()) {
return emptyStr;
} else {
return wordListDescriptions[index];
}
}
const LexerModule *LexerModule::Find(int language) {
const LexerModule *lm = base;
while (lm) {
@@ -97,83 +124,55 @@ static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[
LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
#ifdef __vms
#define LINK_LEXERS
#endif
#ifdef LINK_LEXERS
// The following code forces a reference to all of the Scintilla lexers.
// If we don't do something like this, then the linker tends to "optimize"
// them away. (eric@sourcegear.com)
// Taken from wxWindow's stc.cpp. Walter.
// Alternative historical name for Scintilla_LinkLexers
int wxForceScintillaLexers(void) {
return Scintilla_LinkLexers();
}
int Scintilla_LinkLexers() {
extern LexerModule lmAda;
extern LexerModule lmAVE;
extern LexerModule lmBaan;
extern LexerModule lmBatch;
extern LexerModule lmConf;
extern LexerModule lmCPP;
extern LexerModule lmDiff;
extern LexerModule lmEiffel;
extern LexerModule lmEiffelkw;
extern LexerModule lmErrorList;
extern LexerModule lmHTML;
extern LexerModule lmLatex;
extern LexerModule lmLISP;
extern LexerModule lmLua;
extern LexerModule lmMake;
extern LexerModule lmMatlab;
extern LexerModule lmPascal;
extern LexerModule lmPerl;
extern LexerModule lmProps;
extern LexerModule lmPython;
extern LexerModule lmRuby;
extern LexerModule lmSQL;
extern LexerModule lmVB;
extern LexerModule lmXML;
extern LexerModule lmBullant;
// To add or remove a lexer, add or remove its file and run LexGen.py.
// Force a reference to all of the Scintilla lexers so that the linker will
// not remove the code of the lexers.
int Scintilla_LinkLexers() {
static int forcer = 0;
// Shorten the code that declares a lexer and ensures it is linked in by calling a method.
#define LINK_LEXER(lexer) extern LexerModule lexer; forcer += lexer.GetLanguage();
//++Autogenerated -- run src/LexGen.py to regenerate
//**\(\tLINK_LEXER(\*);\n\)
LINK_LEXER(lmAda);
LINK_LEXER(lmAVE);
LINK_LEXER(lmBaan);
LINK_LEXER(lmBullant);
LINK_LEXER(lmConf);
LINK_LEXER(lmCPP);
LINK_LEXER(lmTCL);
LINK_LEXER(lmNncrontab);
LINK_LEXER(lmEiffel);
LINK_LEXER(lmEiffelkw);
LINK_LEXER(lmHTML);
LINK_LEXER(lmXML);
LINK_LEXER(lmASP);
LINK_LEXER(lmPHP);
LINK_LEXER(lmLISP);
LINK_LEXER(lmLua);
LINK_LEXER(lmMatlab);
LINK_LEXER(lmBatch);
LINK_LEXER(lmDiff);
LINK_LEXER(lmProps);
LINK_LEXER(lmMake);
LINK_LEXER(lmErrorList);
LINK_LEXER(lmLatex);
LINK_LEXER(lmPascal);
LINK_LEXER(lmPerl);
LINK_LEXER(lmPython);
LINK_LEXER(lmRuby);
LINK_LEXER(lmSQL);
LINK_LEXER(lmVB);
LINK_LEXER(lmVBScript);
//--Autogenerated -- end of automatically generated section
if (
&lmAda
&& &lmAVE
&& &lmBaan
&& &lmConf
&& &lmDiff
&& &lmLatex
&& &lmPascal
&& &lmCPP
&& &lmHTML
&& &lmXML
&& &lmProps
&& &lmErrorList
&& &lmMake
&& &lmMatlab
&& &lmBatch
&& &lmPerl
&& &lmPython
&& &lmSQL
&& &lmVB
&& &lmRuby
&& &lmEiffel
&& &lmEiffelkw
&& &lmLISP
&& &lmLua
&& &lmNull
&& &lmBullant
)
{
return 1;
}
else
{
return 0;
}
}
#endif

View File

@@ -72,17 +72,18 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart && (sc.state == SCE_C_STRING)) {
// Prevent SCE_C_STRINGEOL from leaking back to previous line
sc.SetState(SCE_C_STRING);
}
// Handle line continuation generically.
if (sc.ch == '\\') {
if (sc.Match("\\\n")) {
if (sc.chNext == '\n' || sc.chNext == '\r') {
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
sc.Forward();
continue;
}
if (sc.Match("\\\r\n")) {
sc.Forward();
sc.Forward();
sc.Forward();
continue;
}
}
@@ -260,9 +261,17 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
sc.Complete();
}
static bool IsStreamCommentStyle(int style) {
return style == SCE_C_COMMENT ||
style == SCE_C_COMMENTDOC ||
style == SCE_C_COMMENTDOCKEYWORD ||
style == SCE_C_COMMENTDOCKEYWORDERROR;
}
static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[],
Accessor &styler) {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0;
@@ -279,15 +288,37 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (foldComment &&
(style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC)) {
if (style != stylePrev) {
if (foldComment && IsStreamCommentStyle(style)) {
if (!IsStreamCommentStyle(stylePrev)) {
levelCurrent++;
} else if ((style != styleNext) && !atEOL) {
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
// Comments don't end at end of line and the next character may be unstyled.
levelCurrent--;
}
}
if (foldComment && (style == SCE_C_COMMENTLINE)) {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
levelCurrent++;
} else if (chNext2 == '}') {
levelCurrent--;
}
}
}
if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
if (ch == '#') {
unsigned int j=i+1;
while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
j++;
}
if (styler.Match(j, "region") || styler.Match(j, "if")) {
levelCurrent++;
} else if (styler.Match(j, "end")) {
levelCurrent--;
}
}
}
if (style == SCE_C_OPERATOR) {
if (ch == '{') {
levelCurrent++;
@@ -316,5 +347,12 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
LexerModule lmCPP(SCLEX_CPP, ColouriseCppDoc, "cpp", FoldCppDoc);
LexerModule lmTCL(SCLEX_TCL, ColouriseCppDoc, "tcl", FoldCppDoc);
static const char * const cppWordLists[] = {
"Primary keywords and identifiers",
"Secondary keywords and identifiers",
"Documentation comment keywords",
0,
};
LexerModule lmCPP(SCLEX_CPP, ColouriseCppDoc, "cpp", FoldCppDoc, cppWordLists);
LexerModule lmTCL(SCLEX_TCL, ColouriseCppDoc, "tcl", FoldCppDoc, cppWordLists);

View File

@@ -2,7 +2,7 @@
/** @file LexCrontab.cxx
** Lexer to use with extended crontab files used by a powerful
** Windows scheduler/event monitor/automation manager nnCron.
** (http://nemtsev.virtualave.net/)
** (http://nemtsev.eserv.ru/)
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
@@ -62,7 +62,8 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
state = SCE_NNCRONTAB_TASK;
styler.ColourTo(i,SCE_NNCRONTAB_TASK);
}
else if( ch == '\\' && styler.SafeGetCharAt(i+1) == ' ') {
else if( ch == '\\' && (styler.SafeGetCharAt(i+1) == ' ' ||
styler.SafeGetCharAt(i+1) == '\t')) {
// signals the start of an extended comment...
state = SCE_NNCRONTAB_COMMENT;
styler.ColourTo(i,SCE_NNCRONTAB_COMMENT);
@@ -81,6 +82,10 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
// signals environment variables
state = SCE_NNCRONTAB_ENVIRONMENT;
styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
} else if( ch == '<' && styler.SafeGetCharAt(i+1) == '%') {
// signals environment variables
state = SCE_NNCRONTAB_ENVIRONMENT;
styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
} else if( ch == '*' ) {
// signals an asterisk
// no state jump necessary for this simple case...
@@ -148,7 +153,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
break;
}
if( (ch == '%' && styler.SafeGetCharAt(i-1)!='\\')
|| (ch == '\n') || (ch == '\r') ) {
|| (ch == '\n') || (ch == '\r') || (ch == '>') ) {
state = SCE_NNCRONTAB_DEFAULT;
styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
break;
@@ -159,7 +164,8 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
case SCE_NNCRONTAB_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
if( isalnum(ch) || (ch == '_') || (ch == '-') || (ch == '/') ||
(ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') ) {
(ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') ||
(ch == '@') ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_NNCRONTAB_DEFAULT;

View File

@@ -220,9 +220,11 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
isScript = 0 == strcmp(s, "script");
}
}
if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords)
if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords) {
// No keywords -> all are known
chAttr = SCE_H_TAG;
isScript = 0 == strcmp(s, "script");
}
styler.ColourTo(end, chAttr);
return isScript ? SCE_H_SCRIPT : chAttr;
}
@@ -555,6 +557,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
//case SCE_HJ_COMMENTLINE:
case SCE_HJ_DOUBLESTRING:
case SCE_HJ_SINGLESTRING:
case SCE_HJ_REGEX:
case SCE_HB_STRING:
case SCE_HP_STRING:
case SCE_HP_TRIPLE:
@@ -1851,7 +1854,17 @@ static void ColourisePHPDoc(unsigned int startPos, int length, int initStyle, Wo
sc.Complete();
}
LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext");
LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml");
LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp");
LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php");
static const char * const htmlWordListDesc[] = {
"HTML elements and attributes",
"JavaScript keywords",
"VBScript keywords",
"Python keywords",
"PHP keywords",
"SGML and DTD keywords",
0,
};
LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext", 0, htmlWordListDesc);
LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml", 0, htmlWordListDesc);
LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc);
LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc);

View File

@@ -4,7 +4,7 @@
**
** Written by Paul Winwood.
** Folder by Alexey Yutkin.
** Modified by Marcos E. Wurzius
** Modified by Marcos E. Wurzius & Philippe Lhoste
**/
#include <stdlib.h>
@@ -23,6 +23,7 @@
#include "Scintilla.h"
#include "SciLexer.h"
#define SCE_LUA_LAST_STYLE SCE_LUA_WORD6
static inline bool IsAWordChar(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
@@ -32,7 +33,6 @@ inline bool IsAWordStart(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_');
}
inline bool isLuaOperator(char ch) {
if (isalnum(ch))
return false;
@@ -47,8 +47,11 @@ inline bool isLuaOperator(char ch) {
return false;
}
static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
static void ColouriseLuaDoc(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
@@ -57,28 +60,40 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
int literalString = 0;
int literalStringFlag =0;
// Must initialize the literal string nesting level, if we are inside such a string.
int literalStringLevel = 0;
if (initStyle == SCE_LUA_LITERALSTRING) {
literalStringLevel = 1;
}
// We use states above the last one to indicate nesting level of literal strings
if (initStyle > SCE_LUA_LAST_STYLE) {
literalStringLevel = initStyle - SCE_LUA_LAST_STYLE + 1;
}
// Do not leak onto next line
if (initStyle == SCE_LUA_STRINGEOL)
if (initStyle == SCE_LUA_STRINGEOL) {
initStyle = SCE_LUA_DEFAULT;
}
StyleContext sc(startPos, length, initStyle, styler);
if(startPos == 0 && sc.ch == '#') sc.SetState(SCE_LUA_COMMENTLINE);
for (; sc.More(); sc.Forward()) {
// Handle line continuation generically.
if (sc.ch == '\\') {
if (sc.Match("\\\n")) {
sc.Forward();
sc.Forward();
continue;
if (startPos == 0 && sc.ch == '#') {
sc.SetState(SCE_LUA_COMMENTLINE);
}
if (sc.Match("\\\r\n")) {
sc.Forward();
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart && (sc.state == SCE_LUA_STRING)) {
// Prevent SCE_LUA_STRINGEOL from leaking back to previous line
sc.SetState(SCE_LUA_STRING);
}
// Handle string line continuation
if ((sc.state == SCE_LUA_STRING || sc.state == SCE_LUA_CHARACTER) &&
sc.ch == '\\') {
if (sc.chNext == '\n' || sc.chNext == '\r') {
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
sc.Forward();
}
continue;
}
}
@@ -109,12 +124,14 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
}
sc.SetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_COMMENTLINE ) {
if (sc.atLineEnd) {
sc.SetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_PREPROCESSOR ) {
if (sc.atLineEnd) {
sc.SetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_STRING) {
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
@@ -126,7 +143,6 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
sc.ChangeState(SCE_LUA_STRINGEOL);
sc.ForwardSetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_CHARACTER) {
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
@@ -138,33 +154,41 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
sc.ChangeState(SCE_LUA_STRINGEOL);
sc.ForwardSetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_LITERALSTRING) {
if (sc.chPrev == '[' && sc.ch == '[' && literalStringFlag != 1) {
literalString++;
literalStringFlag = 1;
}
else if (sc.chPrev == ']' && sc.ch == ']' && literalStringFlag != 2 ) {
if((--literalString == 1))
} else if (sc.state == SCE_LUA_LITERALSTRING || sc.state > SCE_LUA_LAST_STYLE) {
if (sc.Match('[', '[')) {
literalStringLevel++;
sc.SetState(SCE_LUA_LAST_STYLE + literalStringLevel - 1);
} else if (sc.Match(']', ']') && literalStringLevel > 0) {
literalStringLevel--;
sc.Forward();
if (literalStringLevel == 0) {
sc.ForwardSetState(SCE_LUA_DEFAULT);
literalStringFlag = 2;
} else if (literalStringLevel == 1) {
sc.ForwardSetState(SCE_LUA_LITERALSTRING);
} else {
sc.ForwardSetState(SCE_LUA_LAST_STYLE + literalStringLevel - 1);
}
}
else literalStringFlag = 0;
}
// Determine if a new state should be entered.
if (sc.state == SCE_LUA_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_LUA_NUMBER);
} else if (IsAWordStart(sc.ch) || (sc.ch == '@')) {
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_LUA_IDENTIFIER);
} else if (sc.ch == '\"') {
} else if (sc.Match('\"')) {
sc.SetState(SCE_LUA_STRING);
} else if (sc.ch == '\'') {
} else if (sc.Match('\'')) {
sc.SetState(SCE_LUA_CHARACTER);
} else if (sc.ch == '[' && sc.chNext == '[') {
} else if (sc.Match('[', '[')) {
literalStringLevel = 1;
sc.SetState(SCE_LUA_LITERALSTRING);
literalString = 1;
} else if (sc.ch == '-' && sc.chNext == '-') {
sc.Forward();
} else if (sc.Match('-', '-')) {
sc.SetState(SCE_LUA_COMMENTLINE);
sc.Forward();
} else if (sc.Match('$') && sc.atLineStart) {
sc.SetState(SCE_LUA_PREPROCESSOR); // Obsolete since Lua 4.0, but still in old code
} else if (isLuaOperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_LUA_OPERATOR);
}
@@ -185,6 +209,7 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
char s[10];
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
@@ -192,36 +217,38 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (style == SCE_LUA_WORD) {
if ( ch == 'i' || ch == 'e' || ch == 't' || ch == 'd' || ch == 'f') {
if (ch == 'i' || ch == 'd' || ch == 'f' || ch == 'e') {
for (unsigned int j = 0; j < 8; j++) {
if (!iswordchar(styler[i + j]))
if (!iswordchar(styler[i + j])) {
break;
}
s[j] = styler[i + j];
s[j + 1] = '\0';
}
if ((strcmp(s, "if") == 0) || (strcmp(s, "do") == 0)
|| (strcmp(s, "function") == 0))
if ((strcmp(s, "if") == 0) || (strcmp(s, "do") == 0) || (strcmp(s, "function") == 0)) {
levelCurrent++;
if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0))
}
if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0)) {
levelCurrent--;
}
}
else if (style == SCE_LUA_OPERATOR)
{
if(ch == '{' || ch == '(')
} else if (style == SCE_LUA_OPERATOR) {
if (ch == '{' || ch == '(') {
levelCurrent++;
else if(ch == '}' || ch == ')')
} else if (ch == '}' || ch == ')') {
levelCurrent--;
}
}
if (atEOL) {
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
if (visibleChars == 0 && foldCompact) {
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
}
if ((levelCurrent > levelPrev) && (visibleChars > 0)) {
lev |= SC_FOLDLEVELHEADERFLAG;
}
if (lev != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, lev);
}
@@ -229,9 +256,10 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
levelPrev = levelCurrent;
visibleChars = 0;
}
if (!isspacechar(ch))
if (!isspacechar(ch)) {
visibleChars++;
}
}
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;

View File

@@ -159,21 +159,23 @@ static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
// difference starts then each line starting with ' ' is a whitespace
// otherwise it is considered a comment (Only in..., Binary file...)
if (0 == strncmp(lineBuffer, "diff ", 3)) {
styler.ColourTo(endLine, 2);
styler.ColourTo(endLine, SCE_DIFF_COMMAND);
} else if (0 == strncmp(lineBuffer, "--- ", 3)) {
styler.ColourTo(endLine, 3);
styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (0 == strncmp(lineBuffer, "+++ ", 3)) {
styler.ColourTo(endLine, 3);
styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (0 == strncmp(lineBuffer, "***", 3)) {
styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (lineBuffer[0] == '@') {
styler.ColourTo(endLine, 4);
styler.ColourTo(endLine, SCE_DIFF_POSITION);
} else if (lineBuffer[0] == '-') {
styler.ColourTo(endLine, 5);
styler.ColourTo(endLine, SCE_DIFF_DELETED);
} else if (lineBuffer[0] == '+') {
styler.ColourTo(endLine, 6);
styler.ColourTo(endLine, SCE_DIFF_ADDED);
} else if (lineBuffer[0] != ' ') {
styler.ColourTo(endLine, 1);
styler.ColourTo(endLine, SCE_DIFF_COMMENT);
} else {
styler.ColourTo(endLine, 0);
styler.ColourTo(endLine, SCE_DIFF_DEFAULT);
}
}
@@ -208,28 +210,28 @@ static void ColourisePropsLine(
i++;
if (i < lengthLine) {
if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') {
styler.ColourTo(endPos, 1);
styler.ColourTo(endPos, SCE_PROPS_COMMENT);
} else if (lineBuffer[i] == '[') {
styler.ColourTo(endPos, 2);
styler.ColourTo(endPos, SCE_PROPS_SECTION);
} else if (lineBuffer[i] == '@') {
styler.ColourTo(startLine + i, 4);
styler.ColourTo(startLine + i, SCE_PROPS_DEFVAL);
if (lineBuffer[++i] == '=')
styler.ColourTo(startLine + i, 3);
styler.ColourTo(endPos, 0);
styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
} else {
// Search for the '=' character
while ((i < lengthLine) && (lineBuffer[i] != '='))
i++;
if ((i < lengthLine) && (lineBuffer[i] == '=')) {
styler.ColourTo(startLine + i - 1, 0);
styler.ColourTo(startLine + i - 1, SCE_PROPS_DEFAULT);
styler.ColourTo(startLine + i, 3);
styler.ColourTo(endPos, 0);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
} else {
styler.ColourTo(endPos, 0);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
}
}
} else {
styler.ColourTo(endPos, 0);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
}
}
@@ -386,6 +388,8 @@ static void ColouriseErrorListLine(
state = 1;
} else if ((state == 0) && (lineBuffer[i] == '(')) {
state = 10;
} else if ((state == 0) && (lineBuffer[i] == '\t')) {
state = 20;
} else if ((state == 1) && isdigit(lineBuffer[i])) {
state = 2;
} else if ((state == 2) && (lineBuffer[i] == ':')) {
@@ -406,12 +410,22 @@ static void ColouriseErrorListLine(
break;
} else if (((state == 11) || (state == 14)) && !((lineBuffer[i] == ' ') || isdigit(lineBuffer[i]))) {
state = 99;
} else if ((state == 20) && isdigit(lineBuffer[i])) {
state = 24;
break;
} else if ((state == 20) && ((lineBuffer[i] == '/') && (lineBuffer[i+1] == '^'))) {
state = 21;
} else if ((state == 21) && ((lineBuffer[i] == '$') && (lineBuffer[i+1] == '/'))) {
state = 22;
break;
}
}
if (state == 3) {
styler.ColourTo(endPos, SCE_ERR_GCC);
} else if ((state == 13) || (state == 14) || (state == 15)) {
styler.ColourTo(endPos, SCE_ERR_MS);
} else if (((state == 22) || (state == 24)) && (lineBuffer[0] != '\t')) {
styler.ColourTo(endPos, SCE_ERR_CTAG);
} else {
styler.ColourTo(endPos, SCE_ERR_DEFAULT);
}

View File

@@ -659,4 +659,9 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(lengthDoc - 1, state);
}
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl");
static const char * const perlWordListDesc[] = {
"Perl keywords",
0
};
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl", 0, perlWordListDesc);

View File

@@ -408,4 +408,10 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
//styler.SetLevel(lineCurrent, indentCurrent);
}
LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc, "python", FoldPyDoc);
static const char * const pythonWordListDesc[] = {
"Python keywords",
0
};
LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc, "python", FoldPyDoc,
pythonWordListDesc);

View File

@@ -45,7 +45,7 @@ int CompareCaseInsensitive(const char *a, const char *b) {
return *a - *b;
}
int CompareNCaseInsensitive(const char *a, const char *b, int len) {
int CompareNCaseInsensitive(const char *a, const char *b, size_t len) {
while (*a && *b && len) {
if (*a != *b) {
char upperA = MakeUpperCase(*a);
@@ -68,7 +68,7 @@ bool EqualCaseInsensitive(const char *a, const char *b) {
return 0 == CompareCaseInsensitive(a, b);
}
inline unsigned int HashString(const char *s, int len) {
inline unsigned int HashString(const char *s, size_t len) {
unsigned int ret = 0;
while (len--) {
ret <<= 4;
@@ -93,9 +93,9 @@ void PropSet::Set(const char *key, const char *val, int lenKey, int lenVal) {
if (!*key) // Empty keys are not supported
return;
if (lenKey == -1)
lenKey = strlen(key);
lenKey = static_cast<int>(strlen(key));
if (lenVal == -1)
lenVal = strlen(val);
lenVal = static_cast<int>(strlen(val));
unsigned int hash = HashString(key, lenKey);
for (Property *p = props[hash % hashRoots]; p; p = p->next) {
if ((hash == p->hash) &&
@@ -187,7 +187,7 @@ SString PropSet::Expand(const char *withVars) {
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
char *var = StringDup(cpvar + 2, lenvar);
SString val = GetExpanded(var);
int newlenbase = strlen(base) + val.length() - lenvar;
size_t newlenbase = strlen(base) + val.length() - lenvar;
char *newbase = new char[newlenbase];
strncpy(newbase, base, cpvar - base);
strcpy(newbase + (cpvar - base), val.c_str());
@@ -224,11 +224,11 @@ bool isprefix(const char *target, const char *prefix) {
}
static bool IsSuffixCaseInsensitive(const char *target, const char *suffix) {
int lentarget = strlen(target);
int lensuffix = strlen(suffix);
size_t lentarget = strlen(target);
size_t lensuffix = strlen(suffix);
if (lensuffix > lentarget)
return false;
for (int i = lensuffix - 1; i >= 0; i--) {
for (int i = static_cast<int>(lensuffix) - 1; i >= 0; i--) {
if (MakeUpperCase(target[i + lentarget - lensuffix]) !=
MakeUpperCase(suffix[i]))
return false;
@@ -306,7 +306,7 @@ SString PropSet::GetNewExpand(const char *keybase, const char *filename) {
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
char *var = StringDup(cpvar + 2, lenvar);
SString val = GetWild(var, filename);
int newlenbase = strlen(base) + val.length() - lenvar;
size_t newlenbase = strlen(base) + val.length() - lenvar;
char *newbase = new char[newlenbase];
strncpy(newbase, base, cpvar - base);
strcpy(newbase + (cpvar - base), val.c_str());
@@ -340,7 +340,7 @@ void PropSet::Clear() {
}
char *PropSet::ToString() {
unsigned int len=0;
size_t len=0;
for (int r = 0; r < hashRoots; r++) {
for (Property *p = props[r]; p; p = p->next) {
len += strlen(p->key) + 1;
@@ -435,8 +435,8 @@ static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = fa
if (keywords) {
words = 0;
prev = '\0';
int slen = strlen(wordlist);
for (int k = 0; k < slen; k++) {
size_t slen = strlen(wordlist);
for (size_t k = 0; k < slen; k++) {
if (!iswordsep(wordlist[k], onlyLineEnds)) {
if (!prev) {
keywords[words] = &wordlist[k];

View File

@@ -30,8 +30,8 @@
* Modification history:
*
* $Log$
* Revision 1.3 2002/03/18 22:31:00 RD
* Updated wxSTC from Scintilla 1.40 to Scintilla 1.45
* Revision 1.4 2002/09/06 16:58:12 RD
* Updated to Scintilla from 1.45 to 1.47
*
* Revision 1.6 2001/04/29 13:32:10 nyamatongwe
* Addition of new target methods - versions of ReplaceTarget that take counted

View File

@@ -64,11 +64,18 @@ void ScintillaBase::RefreshColourPalette(Palette &pal, bool want) {
}
void ScintillaBase::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
bool acActiveBeforeCharAdded = ac.Active();
if (!acActiveBeforeCharAdded || !ac.IsFillUpChar(*s))
bool isFillUp = ac.Active() && ac.IsFillUpChar(*s);
if (!isFillUp) {
Editor::AddCharUTF(s, len, treatAsDBCS);
if (acActiveBeforeCharAdded)
}
if (ac.Active()) {
AutoCompleteChanged(s[0]);
// For fill ups add the character after the autocompletion has
// triggered so containers see the key so can display a calltip.
if (isFillUp) {
Editor::AddCharUTF(s, len, treatAsDBCS);
}
}
}
void ScintillaBase::Command(int cmdId) {
@@ -278,7 +285,7 @@ void ScintillaBase::AutoCompleteMoveToCurrentWord() {
void ScintillaBase::AutoCompleteChanged(char ch) {
if (ac.IsFillUpChar(ch)) {
AutoCompleteCompleted(ch);
AutoCompleteCompleted();
} else if (currentPos <= ac.posStart - ac.startLen) {
ac.Cancel();
} else if (ac.cancelAtStartPos && currentPos <= ac.posStart) {
@@ -290,7 +297,7 @@ void ScintillaBase::AutoCompleteChanged(char ch) {
}
}
void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
void ScintillaBase::AutoCompleteCompleted() {
int item = ac.lb.GetSelection();
char selected[1000];
if (item != -1) {
@@ -323,8 +330,6 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
SetEmptySelection(ac.posStart);
if (item != -1) {
SString piece = selected;
if (fillUp)
piece += fillUp;
pdoc->InsertString(firstPos, piece.c_str());
SetEmptySelection(firstPos + piece.length());
}
@@ -332,6 +337,7 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
}
void ScintillaBase::ContextMenu(Point pt) {
if (displayPopupMenu) {
bool writable = !WndProc(SCI_GETREADONLY, 0, 0);
popup.CreatePopUp();
AddToPopUp("Undo", idcmdUndo, writable && pdoc->CanUndo());
@@ -344,6 +350,7 @@ void ScintillaBase::ContextMenu(Point pt) {
AddToPopUp("");
AddToPopUp("Select All", idcmdSelectAll);
popup.Show(pt, wMain);
}
}
void ScintillaBase::CancelModes() {

View File

@@ -66,7 +66,7 @@ protected:
void AutoCompleteCancel();
void AutoCompleteMove(int delta);
void AutoCompleteChanged(char ch=0);
void AutoCompleteCompleted(char fillUp='\0');
void AutoCompleteCompleted();
void AutoCompleteMoveToCurrentWord();
static void AutoCompleteDoubleClick(void* p);

View File

@@ -144,6 +144,10 @@ inline bool IsASpace(unsigned int ch) {
return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
}
inline bool IsASpaceOrTab(unsigned int ch) {
return (ch == ' ') || (ch == '\t');
}
inline bool IsADigit(unsigned int ch) {
return (ch >= '0') && (ch <= '9');
}

View File

@@ -42,7 +42,16 @@ void WindowAccessor::Fill(int position) {
endPos = lenDoc;
TextRange tr = {{startPos, endPos}, buf};
Platform::SendScintilla(id, SCI_GETTEXTRANGE, 0, reinterpret_cast<long>(&tr));
Platform::SendScintillaPointer(id, SCI_GETTEXTRANGE, 0, &tr);
}
bool WindowAccessor::Match(int pos, const char *s) {
for (int i=0; *s; i++) {
if (*s != SafeGetCharAt(pos+i))
return false;
s++;
}
return true;
}
char WindowAccessor::StyleAt(int position) {
@@ -116,8 +125,8 @@ void WindowAccessor::Flush() {
startPos = extremePosition;
lenDoc = -1;
if (validLen > 0) {
Platform::SendScintilla(id, SCI_SETSTYLINGEX, validLen,
reinterpret_cast<long>(styleBuf));
Platform::SendScintillaPointer(id, SCI_SETSTYLINGEX, validLen,
styleBuf);
validLen = 0;
}
}

View File

@@ -81,6 +81,7 @@ DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
@@ -117,7 +118,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent, wxCommandEvent)
#ifdef LINK_LEXERS
// forces the linking of the lexer modules
int wxForceScintillaLexers();
int Scintilla_LinkLexers();
#endif
//----------------------------------------------------------------------
@@ -134,7 +135,7 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
wxDefaultValidator, name)
{
#ifdef LINK_LEXERS
wxForceScintillaLexers();
Scintilla_LinkLexers();
#endif
m_swx = new ScintillaWX(this);
m_stopWatch.Start();
@@ -168,58 +169,58 @@ long wxStyledTextCtrl::SendMsg(int msg, long wp, long lp) {
// this file. Edit stc.cpp.in or gen_iface.py instead and regenerate.
// Add text to the document
// Add text to the document.
void wxStyledTextCtrl::AddText(const wxString& text) {
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
SendMsg(2001, strlen(buf), (long)(const char*)buf);
}
// Add array of cells to document
// Add array of cells to document.
void wxStyledTextCtrl::AddStyledText(const wxMemoryBuffer& data) {
SendMsg(2002, data.GetDataLen(), (long)data.GetData());
}
// Insert string at a position
// Insert string at a position.
void wxStyledTextCtrl::InsertText(int pos, const wxString& text) {
SendMsg(2003, pos, (long)(const char*)wx2stc(text));
}
// Delete all text in the document
// Delete all text in the document.
void wxStyledTextCtrl::ClearAll() {
SendMsg(2004, 0, 0);
}
// Set all style bytes to 0, remove all folding information
// Set all style bytes to 0, remove all folding information.
void wxStyledTextCtrl::ClearDocumentStyle() {
SendMsg(2005, 0, 0);
}
// The number of characters in the document
// The number of characters in the document.
int wxStyledTextCtrl::GetLength() {
return SendMsg(2006, 0, 0);
}
// Returns the character byte at the position
// Returns the character byte at the position.
int wxStyledTextCtrl::GetCharAt(int pos) {
return (unsigned char)SendMsg(2007, pos, 0);
}
// Returns the position of the caret
// Returns the position of the caret.
int wxStyledTextCtrl::GetCurrentPos() {
return SendMsg(2008, 0, 0);
}
// Returns the position of the opposite end of the selection to the caret
// Returns the position of the opposite end of the selection to the caret.
int wxStyledTextCtrl::GetAnchor() {
return SendMsg(2009, 0, 0);
}
// Returns the style byte at the position
// Returns the style byte at the position.
int wxStyledTextCtrl::GetStyleAt(int pos) {
return (unsigned char)SendMsg(2010, pos, 0);
}
// Redoes the next action on the undo history
// Redoes the next action on the undo history.
void wxStyledTextCtrl::Redo() {
SendMsg(2011, 0, 0);
}
@@ -260,12 +261,12 @@ wxMemoryBuffer wxStyledTextCtrl::GetStyledText(int startPos, int endPos) {
return buf;
}
// Are there any redoable actions in the undo history.
// Are there any redoable actions in the undo history?
bool wxStyledTextCtrl::CanRedo() {
return SendMsg(2016, 0, 0) != 0;
}
// Retrieve the line number at which a particular marker is located
// Retrieve the line number at which a particular marker is located.
int wxStyledTextCtrl::MarkerLineFromHandle(int handle) {
return SendMsg(2017, handle, 0);
}
@@ -358,8 +359,7 @@ void wxStyledTextCtrl::SetEOLMode(int eolMode) {
}
// Set the current styling position to pos and the styling mask to mask.
// The styling mask can be used to protect some bits in each styling byte from
// modification.
// The styling mask can be used to protect some bits in each styling byte from modification.
void wxStyledTextCtrl::StartStyling(int pos, int mask) {
SendMsg(2032, pos, mask);
}
@@ -370,7 +370,7 @@ void wxStyledTextCtrl::SetStyling(int length, int style) {
SendMsg(2033, length, style);
}
// Is drawing done first into a buffer or direct to the screen.
// Is drawing done first into a buffer or direct to the screen?
bool wxStyledTextCtrl::GetBufferedDraw() {
return SendMsg(2034, 0, 0) != 0;
}
@@ -381,8 +381,7 @@ void wxStyledTextCtrl::SetBufferedDraw(bool buffered) {
SendMsg(2035, buffered, 0);
}
// Change the visible size of a tab to be a multiple of the width of a space
// character.
// Change the visible size of a tab to be a multiple of the width of a space character.
void wxStyledTextCtrl::SetTabWidth(int tabWidth) {
SendMsg(2036, tabWidth, 0);
}
@@ -432,12 +431,12 @@ int wxStyledTextCtrl::MarkerAdd(int line, int markerNumber) {
return SendMsg(2043, line, markerNumber);
}
// Delete a marker from a line
// Delete a marker from a line.
void wxStyledTextCtrl::MarkerDelete(int line, int markerNumber) {
SendMsg(2044, line, markerNumber);
}
// Delete all markers with a particular number from all lines
// Delete all markers with a particular number from all lines.
void wxStyledTextCtrl::MarkerDeleteAll(int markerNumber) {
SendMsg(2045, markerNumber, 0);
}
@@ -607,8 +606,7 @@ void wxStyledTextCtrl::SetCaretPeriod(int periodMilliseconds) {
SendMsg(2076, periodMilliseconds, 0);
}
// Set the set of characters making up words for when moving or selecting
// by word.
// Set the set of characters making up words for when moving or selecting by word.
void wxStyledTextCtrl::SetWordChars(const wxString& characters) {
SendMsg(2077, 0, (long)(const char*)wx2stc(characters));
}
@@ -645,8 +643,8 @@ wxColour wxStyledTextCtrl::IndicatorGetForeground(int indic) {
return wxColourFromLong(c);
}
// Divide each styling byte into lexical class bits (default:5) and indicator
// bits (default:3). If a lexer requires more than 32 lexical states, then this
// Divide each styling byte into lexical class bits (default: 5) and indicator
// bits (default: 3). If a lexer requires more than 32 lexical states, then this
// is used to expand the possible states.
void wxStyledTextCtrl::SetStyleBits(int bits) {
SendMsg(2090, bits, 0);
@@ -677,7 +675,7 @@ bool wxStyledTextCtrl::GetCaretLineVisible() {
return SendMsg(2095, 0, 0) != 0;
}
// Dsplay the background of the line containing the caret in a different colour.
// Display the background of the line containing the caret in a different colour.
void wxStyledTextCtrl::SetCaretLineVisible(bool show) {
SendMsg(2096, show, 0);
}
@@ -716,8 +714,7 @@ bool wxStyledTextCtrl::AutoCompActive() {
return SendMsg(2102, 0, 0) != 0;
}
// Retrieve the position of the caret when the auto-completion list was
// displayed.
// Retrieve the position of the caret when the auto-completion list was displayed.
int wxStyledTextCtrl::AutoCompPosStart() {
return SendMsg(2103, 0, 0);
}
@@ -732,8 +729,8 @@ void wxStyledTextCtrl::AutoCompStops(const wxString& characterSet) {
SendMsg(2105, 0, (long)(const char*)wx2stc(characterSet));
}
// Change the separator character in the string setting up an auto-completion
// list. Default is space but can be changed if items contain space.
// Change the separator character in the string setting up an auto-completion list.
// Default is space but can be changed if items contain space.
void wxStyledTextCtrl::AutoCompSetSeparator(int separatorCharacter) {
SendMsg(2106, separatorCharacter, 0);
}
@@ -790,22 +787,24 @@ void wxStyledTextCtrl::UserListShow(int listType, const wxString& itemList) {
SendMsg(2117, listType, (long)(const char*)wx2stc(itemList));
}
// Set whether or not autocompletion is hidden automatically when nothing matches
// Set whether or not autocompletion is hidden automatically when nothing matches.
void wxStyledTextCtrl::AutoCompSetAutoHide(bool autoHide) {
SendMsg(2118, autoHide, 0);
}
// Retrieve whether or not autocompletion is hidden automatically when nothing matches
// Retrieve whether or not autocompletion is hidden automatically when nothing matches.
bool wxStyledTextCtrl::AutoCompGetAutoHide() {
return SendMsg(2119, 0, 0) != 0;
}
// Set whether or not autocompletion deletes any word characters after the inserted text upon completion
// Set whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
void wxStyledTextCtrl::AutoCompSetDropRestOfWord(bool dropRestOfWord) {
SendMsg(2270, dropRestOfWord, 0);
}
// Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion
// Retrieve whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
bool wxStyledTextCtrl::AutoCompGetDropRestOfWord() {
return SendMsg(2271, 0, 0) != 0;
}
@@ -961,7 +960,7 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos,
return SendMsg(2150, flags, (long)&ft);
}
// On Windows will draw the document into a display context such as a printer.
// On Windows, will draw the document into a display context such as a printer.
int wxStyledTextCtrl::FormatRange(bool doDraw,
int startPos,
int endPos,
@@ -1123,7 +1122,7 @@ bool wxStyledTextCtrl::CanPaste() {
return SendMsg(2173, 0, 0) != 0;
}
// Are there any undoable actions in the undo history.
// Are there any undoable actions in the undo history?
bool wxStyledTextCtrl::CanUndo() {
return SendMsg(2174, 0, 0) != 0;
}
@@ -1179,7 +1178,7 @@ int wxStyledTextCtrl::GetTextLength() {
return SendMsg(2183, 0, 0);
}
// Set to overtype (true) or insert mode
// Set to overtype (true) or insert mode.
void wxStyledTextCtrl::SetOvertype(bool overtype) {
SendMsg(2186, overtype, 0);
}
@@ -1189,12 +1188,12 @@ bool wxStyledTextCtrl::GetOvertype() {
return SendMsg(2187, 0, 0) != 0;
}
// Set the width of the insert mode caret
// Set the width of the insert mode caret.
void wxStyledTextCtrl::SetCaretWidth(int pixelWidth) {
SendMsg(2188, pixelWidth, 0);
}
// Returns the width of the insert mode caret
// Returns the width of the insert mode caret.
int wxStyledTextCtrl::GetCaretWidth() {
return SendMsg(2189, 0, 0);
}
@@ -1251,12 +1250,12 @@ int wxStyledTextCtrl::GetTargetEnd() {
return SendMsg(2197, strlen(buf), (long)(const char*)buf);
}
// Set the search flags used by SearchInTarget
// Set the search flags used by SearchInTarget.
void wxStyledTextCtrl::SetSearchFlags(int flags) {
SendMsg(2198, flags, 0);
}
// Get the search flags used by SearchInTarget
// Get the search flags used by SearchInTarget.
int wxStyledTextCtrl::GetSearchFlags() {
return SendMsg(2199, 0, 0);
}
@@ -1358,7 +1357,7 @@ void wxStyledTextCtrl::EnsureVisible(int line) {
SendMsg(2232, line, 0);
}
// Set some debugging options for folding
// Set some debugging options for folding.
void wxStyledTextCtrl::SetFoldFlags(int flags) {
SendMsg(2233, flags, 0);
}
@@ -1369,7 +1368,7 @@ void wxStyledTextCtrl::EnsureVisibleEnforcePolicy(int line) {
SendMsg(2234, line, 0);
}
// Sets whether a tab pressed when caret is within indentation indents
// Sets whether a tab pressed when caret is within indentation indents.
void wxStyledTextCtrl::SetTabIndents(bool tabIndents) {
SendMsg(2260, tabIndents, 0);
}
@@ -1379,7 +1378,7 @@ bool wxStyledTextCtrl::GetTabIndents() {
return SendMsg(2261, 0, 0) != 0;
}
// Sets whether a backspace pressed when caret is within indentation unindents
// Sets whether a backspace pressed when caret is within indentation unindents.
void wxStyledTextCtrl::SetBackSpaceUnIndents(bool bsUnIndents) {
SendMsg(2262, bsUnIndents, 0);
}
@@ -1389,52 +1388,87 @@ bool wxStyledTextCtrl::GetBackSpaceUnIndents() {
return SendMsg(2263, 0, 0) != 0;
}
// Sets the time the mouse must sit still to generate a mouse dwell event
// Sets the time the mouse must sit still to generate a mouse dwell event.
void wxStyledTextCtrl::SetMouseDwellTime(int periodMilliseconds) {
SendMsg(2264, periodMilliseconds, 0);
}
// Retrieve the time the mouse must sit still to generate a mouse dwell event
// Retrieve the time the mouse must sit still to generate a mouse dwell event.
int wxStyledTextCtrl::GetMouseDwellTime() {
return SendMsg(2265, 0, 0);
}
// Get position of start of word
// Get position of start of word.
int wxStyledTextCtrl::WordStartPosition(int pos, bool onlyWordCharacters) {
return SendMsg(2266, pos, onlyWordCharacters);
}
// Get position of end of word
// Get position of end of word.
int wxStyledTextCtrl::WordEndPosition(int pos, bool onlyWordCharacters) {
return SendMsg(2267, pos, onlyWordCharacters);
}
// Sets whether text is word wrapped
// Sets whether text is word wrapped.
void wxStyledTextCtrl::SetWrapMode(int mode) {
SendMsg(2268, mode, 0);
}
// Retrieve whether text is word wrapped
// Retrieve whether text is word wrapped.
int wxStyledTextCtrl::GetWrapMode() {
return SendMsg(2269, 0, 0);
}
// Sets the degree of caching of layout information
// Sets the degree of caching of layout information.
void wxStyledTextCtrl::SetLayoutCache(int mode) {
SendMsg(2272, mode, 0);
}
// Retrieve the degree of caching of layout information
// Retrieve the degree of caching of layout information.
int wxStyledTextCtrl::GetLayoutCache() {
return SendMsg(2273, 0, 0);
}
// Move the caret inside current view if it's not there already
// Sets the document width assumed for scrolling.
void wxStyledTextCtrl::SetScrollWidth(int pixelWidth) {
SendMsg(2274, pixelWidth, 0);
}
// Retrieve the document width assumed for scrolling.
int wxStyledTextCtrl::GetScrollWidth() {
return SendMsg(2275, 0, 0);
}
// Measure the pixel width of some text in a particular style.
// Nul terminated text argument.
// Does not handle tab or control characters.
int wxStyledTextCtrl::TextWidth(int style, const wxString& text) {
return SendMsg(2276, style, (long)(const char*)wx2stc(text));
}
// Sets the scroll range so that maximum scroll position has
// the last line at the bottom of the view (default).
// Setting this to false allows scrolling one page below the last line.
void wxStyledTextCtrl::SetEndAtLastLine(bool endAtLastLine) {
SendMsg(2277, endAtLastLine, 0);
}
// Retrieve whether the maximum scroll position has the last
// line at the bottom of the view.
int wxStyledTextCtrl::GetEndAtLastLine() {
return SendMsg(2278, 0, 0);
}
// Retrieve the height of a particular line of text in pixels.
int wxStyledTextCtrl::TextHeight(int line) {
return SendMsg(2279, line, 0);
}
// Move the caret inside current view if it's not there already.
void wxStyledTextCtrl::MoveCaretInsideView() {
SendMsg(2401, 0, 0);
}
// How many characters are on a line, not including end of line characters.
// How many characters are on a line, not including end of line characters?
int wxStyledTextCtrl::LineLength(int line) {
return SendMsg(2350, line, 0);
}
@@ -1454,12 +1488,12 @@ int wxStyledTextCtrl::BraceMatch(int pos) {
return SendMsg(2353, pos, 0);
}
// Are the end of line characters visible.
// Are the end of line characters visible?
bool wxStyledTextCtrl::GetViewEOL() {
return SendMsg(2355, 0, 0) != 0;
}
// Make the end of line characters visible or invisible
// Make the end of line characters visible or invisible.
void wxStyledTextCtrl::SetViewEOL(bool visible) {
SendMsg(2356, visible, 0);
}
@@ -1529,11 +1563,6 @@ int wxStyledTextCtrl::SearchPrev(int flags, const wxString& text) {
return SendMsg(2368, flags, (long)(const char*)wx2stc(text));
}
// Set the way the line the caret is on is kept visible.
void wxStyledTextCtrl::SetCaretPolicy(int caretPolicy, int caretSlop) {
SendMsg(2369, caretPolicy, caretSlop);
}
// Retrieves the number of lines completely visible.
int wxStyledTextCtrl::LinesOnScreen() {
return SendMsg(2370, 0, 0);
@@ -1545,7 +1574,7 @@ void wxStyledTextCtrl::UsePopUp(bool allowPopUp) {
SendMsg(2371, allowPopUp, 0);
}
// Is the selection a rectangular. The alternative is the more common stream selection.
// Is the selection rectangular? The alternative is the more common stream selection.
bool wxStyledTextCtrl::SelectionIsRectangle() {
return SendMsg(2372, 0, 0) != 0;
}
@@ -1582,93 +1611,96 @@ int wxStyledTextCtrl::GetModEventMask() {
return SendMsg(2378, 0, 0);
}
// Change internal focus flag
// Change internal focus flag.
void wxStyledTextCtrl::SetSTCFocus(bool focus) {
SendMsg(2380, focus, 0);
}
// Get internal focus flag
// Get internal focus flag.
bool wxStyledTextCtrl::GetSTCFocus() {
return SendMsg(2381, 0, 0) != 0;
}
// Change error status - 0 = OK
// Change error status - 0 = OK.
void wxStyledTextCtrl::SetStatus(int statusCode) {
SendMsg(2382, statusCode, 0);
}
// Get error status
// Get error status.
int wxStyledTextCtrl::GetStatus() {
return SendMsg(2383, 0, 0);
}
// Set whether the mouse is captured when its button is pressed
// Set whether the mouse is captured when its button is pressed.
void wxStyledTextCtrl::SetMouseDownCaptures(bool captures) {
SendMsg(2384, captures, 0);
}
// Get whether mouse gets captured
// Get whether mouse gets captured.
bool wxStyledTextCtrl::GetMouseDownCaptures() {
return SendMsg(2385, 0, 0) != 0;
}
// Sets the cursor to one of the SC_CURSOR* values
// Sets the cursor to one of the SC_CURSOR* values.
void wxStyledTextCtrl::SetCursor(int cursorType) {
SendMsg(2386, cursorType, 0);
}
// Get cursor type
// Get cursor type.
int wxStyledTextCtrl::GetCursor() {
return SendMsg(2387, 0, 0);
}
// Change the way control characters are displayed:
// If symbol is < 32, keep the drawn way, else, use the given character
// If symbol is < 32, keep the drawn way, else, use the given character.
void wxStyledTextCtrl::SetControlCharSymbol(int symbol) {
SendMsg(2388, symbol, 0);
}
// Get the way control characters are displayed
// Get the way control characters are displayed.
int wxStyledTextCtrl::GetControlCharSymbol() {
return SendMsg(2389, 0, 0);
}
// Move to the previous change in capitalistion
// Move to the previous change in capitalisation.
void wxStyledTextCtrl::WordPartLeft() {
SendMsg(2390, 0, 0);
}
// Move to the previous change in capitalistion extending selection to new caret position.
// Move to the previous change in capitalisation extending selection
// to new caret position.
void wxStyledTextCtrl::WordPartLeftExtend() {
SendMsg(2391, 0, 0);
}
// Move to the change next in capitalistion
// Move to the change next in capitalisation.
void wxStyledTextCtrl::WordPartRight() {
SendMsg(2392, 0, 0);
}
// Move to the next change in capitalistion extending selection to new caret position.
// Move to the next change in capitalisation extending selection
// to new caret position.
void wxStyledTextCtrl::WordPartRightExtend() {
SendMsg(2393, 0, 0);
}
// Set the way the display area is determined when a particular line is to be moved to.
// Set the way the display area is determined when a particular line
// is to be moved to by Find, FindNext, GotoLine, etc.
void wxStyledTextCtrl::SetVisiblePolicy(int visiblePolicy, int visibleSlop) {
SendMsg(2394, visiblePolicy, visibleSlop);
}
// Delete back from the current position to the start of the line
// Delete back from the current position to the start of the line.
void wxStyledTextCtrl::DelLineLeft() {
SendMsg(2395, 0, 0);
}
// Delete forwards from the current position to the end of the line
// Delete forwards from the current position to the end of the line.
void wxStyledTextCtrl::DelLineRight() {
SendMsg(2396, 0, 0);
}
// Get and Set the xOffset (ie, horizonal scroll position)
// Get and Set the xOffset (ie, horizonal scroll position).
void wxStyledTextCtrl::SetXOffset(int newOffset) {
SendMsg(2397, newOffset, 0);
}
@@ -1676,6 +1708,18 @@ int wxStyledTextCtrl::GetXOffset() {
return SendMsg(2398, 0, 0);
}
// Set the way the caret is kept visible when going sideway.
// The exclusion zone is given in pixels.
void wxStyledTextCtrl::SetXCaretPolicy(int caretPolicy, int caretSlop) {
SendMsg(2402, caretPolicy, caretSlop);
}
// Set the way the line the caret is on is kept visible.
// The exclusion zone is given in lines.
void wxStyledTextCtrl::SetYCaretPolicy(int caretPolicy, int caretSlop) {
SendMsg(2403, caretPolicy, caretSlop);
}
// Start notifying the container of all key presses and commands.
void wxStyledTextCtrl::StartRecord() {
SendMsg(3001, 0, 0);
@@ -2104,6 +2148,10 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
evt.SetY(scn.y);
break;
case SCN_ZOOM:
evt.SetEventType(wxEVT_STC_ZOOM);
break;
default:
return;
}

View File

@@ -81,6 +81,7 @@ DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
@@ -117,7 +118,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent, wxCommandEvent)
#ifdef LINK_LEXERS
// forces the linking of the lexer modules
int wxForceScintillaLexers();
int Scintilla_LinkLexers();
#endif
//----------------------------------------------------------------------
@@ -134,7 +135,7 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
wxDefaultValidator, name)
{
#ifdef LINK_LEXERS
wxForceScintillaLexers();
Scintilla_LinkLexers();
#endif
m_swx = new ScintillaWX(this);
m_stopWatch.Start();
@@ -557,6 +558,10 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
evt.SetY(scn.y);
break;
case SCN_ZOOM:
evt.SetEventType(wxEVT_STC_ZOOM);
break;
default:
return;
}

View File

@@ -338,6 +338,7 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, 1669)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
END_DECLARE_EVENT_TYPES()
#else
enum {
@@ -363,6 +364,7 @@ END_DECLARE_EVENT_TYPES()
wxEVT_STC_START_DRAG,
wxEVT_STC_DRAG_OVER,
wxEVT_STC_DO_DROP,
wxEVT_STC_ZOOM,
};
#endif
@@ -393,6 +395,7 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#endif
//----------------------------------------------------------------------

View File

@@ -44,7 +44,7 @@
#define wxSTC_OPTIONAL_START 3000
#define wxSTC_LEXER_START 4000
// Redoes the next action on the undo history
// Redoes the next action on the undo history.
#define wxSTC_CMD_REDO 2011
// Select all the text in the document.
@@ -70,7 +70,7 @@
#define wxSTC_MARK_MINUS 7
#define wxSTC_MARK_PLUS 8
// Shapes used for outlining column
// Shapes used for outlining column.
#define wxSTC_MARK_VLINE 9
#define wxSTC_MARK_LCORNER 10
#define wxSTC_MARK_TCORNER 11
@@ -85,11 +85,11 @@
#define wxSTC_MARK_CIRCLEMINUS 20
#define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
// Invisible mark that only sets the line background color
// Invisible mark that only sets the line background color.
#define wxSTC_MARK_BACKGROUND 22
#define wxSTC_MARK_CHARACTER 10000
// Markers used for outlining column
// Markers used for outlining column.
#define wxSTC_MARKNUM_FOLDEREND 25
#define wxSTC_MARKNUM_FOLDEROPENMID 26
#define wxSTC_MARKNUM_FOLDERMIDTAIL 27
@@ -270,8 +270,7 @@
// Delete the selection or if no selection, the character before the caret.
#define wxSTC_CMD_DELETEBACK 2326
// If selection is empty or all on one line replace the selection with a tab
// character.
// If selection is empty or all on one line replace the selection with a tab character.
// If more than one line selected, indent the lines.
#define wxSTC_CMD_TAB 2327
@@ -325,40 +324,46 @@
#define wxSTC_CMD_LINESCROLLUP 2343
// Delete the selection or if no selection, the character before the caret.
// Will not delete the chraacter before at the start of a line.
// Will not delete the character before at the start of a line.
#define wxSTC_CMD_DELETEBACKNOTLINE 2344
#define wxSTC_EDGE_NONE 0
#define wxSTC_EDGE_LINE 1
#define wxSTC_EDGE_BACKGROUND 2
// Show caret within N lines of edge when it's scrolled to view
// If CARET_SLOP not set then centre caret on screen when it's
// scrolled to view
#define wxSTC_CARET_SLOP 0x01
// Value not used
#define wxSTC_CARET_CENTER 0x02
// If CARET_SLOP also set then reposition whenever outside slop border
// If CARET_SLOP not set then recentre even when visible
#define wxSTC_CARET_STRICT 0x04
// If CARET_XEVEN set then both left and right margins are given equal weight
// rather than favouring left following behaviour.
#define wxSTC_CARET_XEVEN 0x08
// If CARET_XJUMPS set then when caret reaches the margin the display jumps
// enough to leave the caret solidly within the display.
#define wxSTC_CARET_XJUMPS 0x10
#define wxSTC_CURSORNORMAL -1
#define wxSTC_CURSORWAIT 3
// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy
// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
#define wxSTC_VISIBLE_SLOP 0x01
#define wxSTC_VISIBLE_STRICT 0x04
// Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
// If CARET_SLOP is set, we can define a slop value: caretSlop.
// This value defines an unwanted zone (UZ) where the caret is... unwanted.
// This zone is defined as a number of pixels near the vertical margins,
// and as a number of lines near the horizontal margins.
// By keeping the caret away from the edges, it is seen within its context,
// so it is likely that the identifier that the caret is on can be completely seen,
// and that the current line is seen with some of the lines following it which are
// often dependent on that line.
#define wxSTC_CARET_SLOP 0x01
// If CARET_STRICT is set, the policy is enforced... strictly.
// The caret is centred on the display if slop is not set,
// and cannot go in the UZ if slop is set.
#define wxSTC_CARET_STRICT 0x04
// If CARET_JUMPS is set, the display is moved more energetically
// so the caret can move in the same direction longer before the policy is applied again.
#define wxSTC_CARET_JUMPS 0x10
// If CARET_EVEN is not set, instead of having symmetrical UZs,
// the left and bottom UZs are extended up to right and top UZs respectively.
// This way, we favour the displaying of useful information: the begining of lines,
// where most code reside, and the lines after the caret, eg. the body of a function.
#define wxSTC_CARET_EVEN 0x08
// Notifications
// Type of modification and the action which caused the modification
// Type of modification and the action which caused the modification.
// These are defined as a bit mask to make it easy to specify which notifications are wanted.
// One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
#define wxSTC_MOD_INSERTTEXT 0x1
@@ -374,9 +379,9 @@
#define wxSTC_MOD_BEFOREDELETE 0x800
#define wxSTC_MODEVENTMASKALL 0xF77
// Symbolic key codes and modifier flags
// ASCII and other printable characters below 256
// Extended keys above 300
// Symbolic key codes and modifier flags.
// ASCII and other printable characters below 256.
// Extended keys above 300.
#define wxSTC_KEY_DOWN 300
#define wxSTC_KEY_UP 301
#define wxSTC_KEY_LEFT 302
@@ -432,6 +437,7 @@
#define wxSTC_LEX_PHP 30
#define wxSTC_LEX_BAAN 31
#define wxSTC_LEX_MATLAB 32
#define wxSTC_LEX_SCRIPTOL 33
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
// value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -474,17 +480,6 @@
#define wxSTC_C_COMMENTDOCKEYWORD 17
#define wxSTC_C_COMMENTDOCKEYWORDERROR 18
// Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
#define wxSTC_B_DEFAULT 0
#define wxSTC_B_COMMENT 1
#define wxSTC_B_NUMBER 2
#define wxSTC_B_KEYWORD 3
#define wxSTC_B_STRING 4
#define wxSTC_B_PREPROCESSOR 5
#define wxSTC_B_OPERATOR 6
#define wxSTC_B_IDENTIFIER 7
#define wxSTC_B_DATE 8
// Lexical states for SCLEX_HTML, SCLEX_XML
#define wxSTC_H_DEFAULT 0
#define wxSTC_H_TAG 1
@@ -651,6 +646,24 @@
#define wxSTC_PL_STRING_QR 29
#define wxSTC_PL_STRING_QW 30
// Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
#define wxSTC_B_DEFAULT 0
#define wxSTC_B_COMMENT 1
#define wxSTC_B_NUMBER 2
#define wxSTC_B_KEYWORD 3
#define wxSTC_B_STRING 4
#define wxSTC_B_PREPROCESSOR 5
#define wxSTC_B_OPERATOR 6
#define wxSTC_B_IDENTIFIER 7
#define wxSTC_B_DATE 8
// Lexical states for SCLEX_PROPERTIES
#define wxSTC_PROPS_DEFAULT 0
#define wxSTC_PROPS_COMMENT 1
#define wxSTC_PROPS_SECTION 2
#define wxSTC_PROPS_ASSIGNMENT 3
#define wxSTC_PROPS_DEFVAL 4
// Lexical states for SCLEX_LATEX
#define wxSTC_L_DEFAULT 0
#define wxSTC_L_COMMAND 1
@@ -688,6 +701,7 @@
#define wxSTC_ERR_PERL 6
#define wxSTC_ERR_NET 7
#define wxSTC_ERR_LUA 8
#define wxSTC_ERR_CTAG 9
#define wxSTC_ERR_DIFF_CHANGED 10
#define wxSTC_ERR_DIFF_ADDITION 11
#define wxSTC_ERR_DIFF_DELETION 12
@@ -712,7 +726,16 @@
#define wxSTC_MAKE_TARGET 5
#define wxSTC_MAKE_IDEOL 9
// Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer)
// Lexical states for SCLEX_DIFF
#define wxSTC_DIFF_DEFAULT 0
#define wxSTC_DIFF_COMMENT 1
#define wxSTC_DIFF_COMMAND 2
#define wxSTC_DIFF_HEADER 3
#define wxSTC_DIFF_POSITION 4
#define wxSTC_DIFF_DELETED 5
#define wxSTC_DIFF_ADDED 6
// Lexical states for SCLEX_CONF (Apache Configuration Files Lexer)
#define wxSTC_CONF_DEFAULT 0
#define wxSTC_CONF_COMMENT 1
#define wxSTC_CONF_NUMBER 2
@@ -724,7 +747,7 @@
#define wxSTC_CONF_IP 8
#define wxSTC_CONF_DIRECTIVE 9
// Avenue
// Lexical states for SCLEX_AVE, Avenue
#define wxSTC_AVE_DEFAULT 0
#define wxSTC_AVE_COMMENT 1
#define wxSTC_AVE_NUMBER 2
@@ -782,7 +805,7 @@
#define wxSTC_EIFFEL_IDENTIFIER 7
#define wxSTC_EIFFEL_STRINGEOL 8
// Lexical states for the SCLEX_NNCRONTAB (nnCron crontab Lexer)
// Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer)
#define wxSTC_NNCRONTAB_DEFAULT 0
#define wxSTC_NNCRONTAB_COMMENT 1
#define wxSTC_NNCRONTAB_TASK 2
@@ -805,6 +828,28 @@
#define wxSTC_MATLAB_OPERATOR 6
#define wxSTC_MATLAB_IDENTIFIER 7
// Lexical states for SCLEX_SCRIPTOL
#define wxSTC_SCRIPTOL_DEFAULT 0
#define wxSTC_SCRIPTOL_COMMENT 1
#define wxSTC_SCRIPTOL_COMMENTLINE 2
#define wxSTC_SCRIPTOL_COMMENTDOC 3
#define wxSTC_SCRIPTOL_NUMBER 4
#define wxSTC_SCRIPTOL_WORD 5
#define wxSTC_SCRIPTOL_STRING 6
#define wxSTC_SCRIPTOL_CHARACTER 7
#define wxSTC_SCRIPTOL_UUID 8
#define wxSTC_SCRIPTOL_PREPROCESSOR 9
#define wxSTC_SCRIPTOL_OPERATOR 10
#define wxSTC_SCRIPTOL_IDENTIFIER 11
#define wxSTC_SCRIPTOL_STRINGEOL 12
#define wxSTC_SCRIPTOL_VERBATIM 13
#define wxSTC_SCRIPTOL_REGEX 14
#define wxSTC_SCRIPTOL_COMMENTLINEDOC 15
#define wxSTC_SCRIPTOL_WORD2 16
#define wxSTC_SCRIPTOL_COMMENTDOCKEYWORD 17
#define wxSTC_SCRIPTOL_COMMENTDOCKEYWORDERROR 18
#define wxSTC_SCRIPTOL_COMMENTBASIC 19
// END of generated section
//----------------------------------------------------------------------
@@ -845,37 +890,37 @@ public:
// and regenerate
// Add text to the document
// Add text to the document.
void AddText(const wxString& text);
// Add array of cells to document
// Add array of cells to document.
void AddStyledText(const wxMemoryBuffer& data);
// Insert string at a position
// Insert string at a position.
void InsertText(int pos, const wxString& text);
// Delete all text in the document
// Delete all text in the document.
void ClearAll();
// Set all style bytes to 0, remove all folding information
// Set all style bytes to 0, remove all folding information.
void ClearDocumentStyle();
// The number of characters in the document
// The number of characters in the document.
int GetLength();
// Returns the character byte at the position
// Returns the character byte at the position.
int GetCharAt(int pos);
// Returns the position of the caret
// Returns the position of the caret.
int GetCurrentPos();
// Returns the position of the opposite end of the selection to the caret
// Returns the position of the opposite end of the selection to the caret.
int GetAnchor();
// Returns the style byte at the position
// Returns the style byte at the position.
int GetStyleAt(int pos);
// Redoes the next action on the undo history
// Redoes the next action on the undo history.
void Redo();
// Choose between collecting actions into the undo
@@ -892,10 +937,10 @@ public:
// Retrieve a buffer of cells.
wxMemoryBuffer GetStyledText(int startPos, int endPos);
// Are there any redoable actions in the undo history.
// Are there any redoable actions in the undo history?
bool CanRedo();
// Retrieve the line number at which a particular marker is located
// Retrieve the line number at which a particular marker is located.
int MarkerLineFromHandle(int handle);
// Delete a marker.
@@ -949,23 +994,21 @@ public:
void SetEOLMode(int eolMode);
// Set the current styling position to pos and the styling mask to mask.
// The styling mask can be used to protect some bits in each styling byte from
// modification.
// The styling mask can be used to protect some bits in each styling byte from modification.
void StartStyling(int pos, int mask);
// Change style from current styling position for length characters to a style
// and move the current styling position to after this newly styled segment.
void SetStyling(int length, int style);
// Is drawing done first into a buffer or direct to the screen.
// Is drawing done first into a buffer or direct to the screen?
bool GetBufferedDraw();
// If drawing is buffered then each line of text is drawn into a bitmap buffer
// before drawing it to the screen to avoid flicker.
void SetBufferedDraw(bool buffered);
// Change the visible size of a tab to be a multiple of the width of a space
// character.
// Change the visible size of a tab to be a multiple of the width of a space character.
void SetTabWidth(int tabWidth);
// Retrieve the visible size of a tab.
@@ -989,10 +1032,10 @@ public:
// Add a marker to a line, returning an ID which can be used to find or delete the marker.
int MarkerAdd(int line, int markerNumber);
// Delete a marker from a line
// Delete a marker from a line.
void MarkerDelete(int line, int markerNumber);
// Delete all markers with a particular number from all lines
// Delete all markers with a particular number from all lines.
void MarkerDeleteAll(int markerNumber);
// Get a bit mask of all the markers set on a line.
@@ -1094,8 +1137,7 @@ public:
// Get the time in milliseconds that the caret is on and off. 0 = steady on.
void SetCaretPeriod(int periodMilliseconds);
// Set the set of characters making up words for when moving or selecting
// by word.
// Set the set of characters making up words for when moving or selecting by word.
void SetWordChars(const wxString& characters);
// Start a sequence of actions that is undone and redone as a unit.
@@ -1117,8 +1159,8 @@ public:
// Retrieve the foreground colour of an indicator.
wxColour IndicatorGetForeground(int indic);
// Divide each styling byte into lexical class bits (default:5) and indicator
// bits (default:3). If a lexer requires more than 32 lexical states, then this
// Divide each styling byte into lexical class bits (default: 5) and indicator
// bits (default: 3). If a lexer requires more than 32 lexical states, then this
// is used to expand the possible states.
void SetStyleBits(int bits);
@@ -1137,7 +1179,7 @@ public:
// Is the background of the line containing the caret in a different colour?
bool GetCaretLineVisible();
// Dsplay the background of the line containing the caret in a different colour.
// Display the background of the line containing the caret in a different colour.
void SetCaretLineVisible(bool show);
// Get the colour of the background of the line containing the caret.
@@ -1161,8 +1203,7 @@ public:
// Is there an auto-completion list visible?
bool AutoCompActive();
// Retrieve the position of the caret when the auto-completion list was
// displayed.
// Retrieve the position of the caret when the auto-completion list was displayed.
int AutoCompPosStart();
// User has selected an item so remove the list and insert the selection.
@@ -1171,8 +1212,8 @@ public:
// Define a set of character that when typed cancel the auto-completion list.
void AutoCompStops(const wxString& characterSet);
// Change the separator character in the string setting up an auto-completion
// list. Default is space but can be changed if items contain space.
// Change the separator character in the string setting up an auto-completion list.
// Default is space but can be changed if items contain space.
void AutoCompSetSeparator(int separatorCharacter);
// Retrieve the auto-completion list separator character.
@@ -1207,16 +1248,18 @@ public:
// Display a list of strings and send notification when user chooses one.
void UserListShow(int listType, const wxString& itemList);
// Set whether or not autocompletion is hidden automatically when nothing matches
// Set whether or not autocompletion is hidden automatically when nothing matches.
void AutoCompSetAutoHide(bool autoHide);
// Retrieve whether or not autocompletion is hidden automatically when nothing matches
// Retrieve whether or not autocompletion is hidden automatically when nothing matches.
bool AutoCompGetAutoHide();
// Set whether or not autocompletion deletes any word characters after the inserted text upon completion
// Set whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
void AutoCompSetDropRestOfWord(bool dropRestOfWord);
// Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion
// Retrieve whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
bool AutoCompGetDropRestOfWord();
// Set the number of spaces used for one level of indentation.
@@ -1305,7 +1348,7 @@ public:
// Find some text in the document.
int FindText(int minPos, int maxPos, const wxString& text, int flags=0);
// On Windows will draw the document into a display context such as a printer.
// On Windows, will draw the document into a display context such as a printer.
int FormatRange(bool doDraw,
int startPos,
int endPos,
@@ -1371,7 +1414,7 @@ public:
// Will a paste succeed?
bool CanPaste();
// Are there any undoable actions in the undo history.
// Are there any undoable actions in the undo history?
bool CanUndo();
// Delete the undo history.
@@ -1401,16 +1444,16 @@ public:
// Retrieve the number of characters in the document.
int GetTextLength();
// Set to overtype (true) or insert mode
// Set to overtype (true) or insert mode.
void SetOvertype(bool overtype);
// Returns true if overtype mode is active otherwise false is returned.
bool GetOvertype();
// Set the width of the insert mode caret
// Set the width of the insert mode caret.
void SetCaretWidth(int pixelWidth);
// Returns the width of the insert mode caret
// Returns the width of the insert mode caret.
int GetCaretWidth();
// Sets the position that starts the target which is used for updating the
@@ -1445,10 +1488,10 @@ public:
// Returns length of range or -1 for failure in which case target is not moved.
int SearchInTarget(const wxString& text);
// Set the search flags used by SearchInTarget
// Set the search flags used by SearchInTarget.
void SetSearchFlags(int flags);
// Get the search flags used by SearchInTarget
// Get the search flags used by SearchInTarget.
int GetSearchFlags();
// Show a call tip containing a definition near position pos.
@@ -1510,53 +1553,76 @@ public:
// Ensure a particular line is visible by expanding any header line hiding it.
void EnsureVisible(int line);
// Set some debugging options for folding
// Set some debugging options for folding.
void SetFoldFlags(int flags);
// Ensure a particular line is visible by expanding any header line hiding it.
// Use the currently set visibility policy to determine which range to display.
void EnsureVisibleEnforcePolicy(int line);
// Sets whether a tab pressed when caret is within indentation indents
// Sets whether a tab pressed when caret is within indentation indents.
void SetTabIndents(bool tabIndents);
// Does a tab pressed when caret is within indentation indent?
bool GetTabIndents();
// Sets whether a backspace pressed when caret is within indentation unindents
// Sets whether a backspace pressed when caret is within indentation unindents.
void SetBackSpaceUnIndents(bool bsUnIndents);
// Does a backspace pressed when caret is within indentation unindent?
bool GetBackSpaceUnIndents();
// Sets the time the mouse must sit still to generate a mouse dwell event
// Sets the time the mouse must sit still to generate a mouse dwell event.
void SetMouseDwellTime(int periodMilliseconds);
// Retrieve the time the mouse must sit still to generate a mouse dwell event
// Retrieve the time the mouse must sit still to generate a mouse dwell event.
int GetMouseDwellTime();
// Get position of start of word
// Get position of start of word.
int WordStartPosition(int pos, bool onlyWordCharacters);
// Get position of end of word
// Get position of end of word.
int WordEndPosition(int pos, bool onlyWordCharacters);
// Sets whether text is word wrapped
// Sets whether text is word wrapped.
void SetWrapMode(int mode);
// Retrieve whether text is word wrapped
// Retrieve whether text is word wrapped.
int GetWrapMode();
// Sets the degree of caching of layout information
// Sets the degree of caching of layout information.
void SetLayoutCache(int mode);
// Retrieve the degree of caching of layout information
// Retrieve the degree of caching of layout information.
int GetLayoutCache();
// Move the caret inside current view if it's not there already
// Sets the document width assumed for scrolling.
void SetScrollWidth(int pixelWidth);
// Retrieve the document width assumed for scrolling.
int GetScrollWidth();
// Measure the pixel width of some text in a particular style.
// Nul terminated text argument.
// Does not handle tab or control characters.
int TextWidth(int style, const wxString& text);
// Sets the scroll range so that maximum scroll position has
// the last line at the bottom of the view (default).
// Setting this to false allows scrolling one page below the last line.
void SetEndAtLastLine(bool endAtLastLine);
// Retrieve whether the maximum scroll position has the last
// line at the bottom of the view.
int GetEndAtLastLine();
// Retrieve the height of a particular line of text in pixels.
int TextHeight(int line);
// Move the caret inside current view if it's not there already.
void MoveCaretInsideView();
// How many characters are on a line, not including end of line characters.
// How many characters are on a line, not including end of line characters?
int LineLength(int line);
// Highlight the characters at two positions.
@@ -1568,10 +1634,10 @@ public:
// Find the position of a matching brace or INVALID_POSITION if no match.
int BraceMatch(int pos);
// Are the end of line characters visible.
// Are the end of line characters visible?
bool GetViewEOL();
// Make the end of line characters visible or invisible
// Make the end of line characters visible or invisible.
void SetViewEOL(bool visible);
// Retrieve a pointer to the document object.
@@ -1614,9 +1680,6 @@ public:
// Does not ensure the selection is visible.
int SearchPrev(int flags, const wxString& text);
// Set the way the line the caret is on is kept visible.
void SetCaretPolicy(int caretPolicy, int caretSlop);
// Retrieves the number of lines completely visible.
int LinesOnScreen();
@@ -1624,7 +1687,7 @@ public:
// the wrong mouse button.
void UsePopUp(bool allowPopUp);
// Is the selection a rectangular. The alternative is the more common stream selection.
// Is the selection rectangular? The alternative is the more common stream selection.
bool SelectionIsRectangle();
// Set the zoom level. This number of points is added to the size of all fonts.
@@ -1647,62 +1710,73 @@ public:
// Get which document modification events are sent to the container.
int GetModEventMask();
// Change internal focus flag
// Change internal focus flag.
void SetSTCFocus(bool focus);
// Get internal focus flag
// Get internal focus flag.
bool GetSTCFocus();
// Change error status - 0 = OK
// Change error status - 0 = OK.
void SetStatus(int statusCode);
// Get error status
// Get error status.
int GetStatus();
// Set whether the mouse is captured when its button is pressed
// Set whether the mouse is captured when its button is pressed.
void SetMouseDownCaptures(bool captures);
// Get whether mouse gets captured
// Get whether mouse gets captured.
bool GetMouseDownCaptures();
// Sets the cursor to one of the SC_CURSOR* values
// Sets the cursor to one of the SC_CURSOR* values.
void SetCursor(int cursorType);
// Get cursor type
// Get cursor type.
int GetCursor();
// Change the way control characters are displayed:
// If symbol is < 32, keep the drawn way, else, use the given character
// If symbol is < 32, keep the drawn way, else, use the given character.
void SetControlCharSymbol(int symbol);
// Get the way control characters are displayed
// Get the way control characters are displayed.
int GetControlCharSymbol();
// Move to the previous change in capitalistion
// Move to the previous change in capitalisation.
void WordPartLeft();
// Move to the previous change in capitalistion extending selection to new caret position.
// Move to the previous change in capitalisation extending selection
// to new caret position.
void WordPartLeftExtend();
// Move to the change next in capitalistion
// Move to the change next in capitalisation.
void WordPartRight();
// Move to the next change in capitalistion extending selection to new caret position.
// Move to the next change in capitalisation extending selection
// to new caret position.
void WordPartRightExtend();
// Set the way the display area is determined when a particular line is to be moved to.
// Set the way the display area is determined when a particular line
// is to be moved to by Find, FindNext, GotoLine, etc.
void SetVisiblePolicy(int visiblePolicy, int visibleSlop);
// Delete back from the current position to the start of the line
// Delete back from the current position to the start of the line.
void DelLineLeft();
// Delete forwards from the current position to the end of the line
// Delete forwards from the current position to the end of the line.
void DelLineRight();
// Get and Set the xOffset (ie, horizonal scroll position)
// Get and Set the xOffset (ie, horizonal scroll position).
void SetXOffset(int newOffset);
int GetXOffset();
// Set the way the caret is kept visible when going sideway.
// The exclusion zone is given in pixels.
void SetXCaretPolicy(int caretPolicy, int caretSlop);
// Set the way the line the caret is on is kept visible.
// The exclusion zone is given in lines.
void SetYCaretPolicy(int caretPolicy, int caretSlop);
// Start notifying the container of all key presses and commands.
void StartRecord();
@@ -1986,6 +2060,7 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, 1669)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
END_DECLARE_EVENT_TYPES()
#else
enum {
@@ -2011,6 +2086,7 @@ END_DECLARE_EVENT_TYPES()
wxEVT_STC_START_DRAG,
wxEVT_STC_DRAG_OVER,
wxEVT_STC_DO_DROP,
wxEVT_STC_ZOOM,
};
#endif
@@ -2041,6 +2117,7 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#endif
//----------------------------------------------------------------------

View File

@@ -906,6 +906,15 @@ long Platform::SendScintilla(WindowID w,
return stc->SendMsg(msg, wParam, lParam);
}
long Platform::SendScintillaPointer(WindowID w,
unsigned int msg,
unsigned long wParam,
void *lParam) {
wxStyledTextCtrl* stc = (wxStyledTextCtrl*)w;
return stc->SendMsg(msg, wParam, (long)lParam);
}
// These are utility functions not really tied to a platform

View File

@@ -19,13 +19,6 @@
#include "wx/stc/stc.h"
#include "PlatWX.h"
//----------------------------------------------------------------------
const int H_SCROLL_MAX = 4000;
const int H_SCROLL_STEP = 20;
const int H_SCROLL_PAGE = 200;
//----------------------------------------------------------------------
// Helper classes
@@ -265,10 +258,12 @@ void ScintillaWX::SetHorizontalScrollPos() {
}
}
const int H_SCROLL_STEP = 20;
bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
bool modified = false;
// Check the vertical scrollbar
if (stc->m_vScrollBar == NULL) { // Use built-in scrollbar
int sbMax = stc->GetScrollRange(wxVERTICAL);
int sbThumb = stc->GetScrollThumb(wxVERTICAL);
@@ -289,24 +284,40 @@ bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
}
if (horizontalScrollBarVisible) {
// Check the horizontal scrollbar
PRectangle rcText = GetTextRectangle();
int horizEnd = scrollWidth;
if (horizEnd < 0)
horizEnd = 0;
if (!horizontalScrollBarVisible || (wrapState != eWrapNone))
horizEnd = 0;
int pageWidth = rcText.Width();
if (stc->m_hScrollBar == NULL) { // Use built-in scrollbar
int sbMax = stc->GetScrollRange(wxHORIZONTAL);
int sbThumb = stc->GetScrollThumb(wxHORIZONTAL);
if ((sbMax != H_SCROLL_MAX) || (sbThumb != H_SCROLL_STEP)) {
stc->SetScrollbar(wxHORIZONTAL, 0, H_SCROLL_STEP, H_SCROLL_MAX);
int sbPos = stc->GetScrollPos(wxHORIZONTAL);
if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) {
stc->SetScrollbar(wxHORIZONTAL, 0, pageWidth, horizEnd);
modified = true;
if (scrollWidth < pageWidth) {
HorizontalScrollTo(0);
}
}
}
else { // otherwise use the one that's been given to us
int sbMax = stc->m_hScrollBar->GetRange();
int sbPage = stc->m_hScrollBar->GetPageSize();
if ((sbMax != H_SCROLL_MAX) || (sbPage != H_SCROLL_STEP)) {
stc->m_hScrollBar->SetScrollbar(0, H_SCROLL_STEP, H_SCROLL_MAX, H_SCROLL_STEP);
int sbThumb = stc->m_hScrollBar->GetPageSize();
int sbPos = stc->m_hScrollBar->GetThumbPosition();
if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) {
stc->m_hScrollBar->SetScrollbar(0, pageWidth, horizEnd, pageWidth);
modified = true;
if (scrollWidth < pageWidth) {
HorizontalScrollTo(0);
}
}
}
return modified;
}
@@ -443,18 +454,24 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
void ScintillaWX::DoHScroll(int type, int pos) {
int xPos = xOffset;
PRectangle rcText = GetTextRectangle();
int pageWidth = rcText.Width() * 2 / 3;
if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP)
xPos -= H_SCROLL_STEP;
else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN)
xPos += H_SCROLL_STEP;
else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP)
xPos -= H_SCROLL_PAGE;
else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN)
xPos += H_SCROLL_PAGE;
xPos -= pageWidth;
else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN) {
xPos += pageWidth;
if (xPos > scrollWidth - rcText.Width()) {
xPos = scrollWidth - rcText.Width();
}
}
else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP)
xPos = 0;
else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM)
xPos = H_SCROLL_MAX;
xPos = scrollWidth;
else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK)
xPos = pos;

View File

@@ -553,6 +553,12 @@ def processIface(iface, h_tmplt, cpp_tmplt, h_dest, cpp_dest):
elif op == 'evt ':
pass
elif op == 'enu ':
pass
elif op == 'lex ':
pass
else:
print '***** Unknown line type: ', line

View File

@@ -3,5 +3,5 @@ scintilla/include directories from the Scintilla/SCiTE source
distribution. All other code needed to implement Scintilla on top of
wxWindows is located in the directory above this one.
The current version of the Scintilla code is 1.45
The current version of the Scintilla code is 1.47

View File

@@ -55,6 +55,7 @@ public:
}
void SetCodePage(int codePage_) { codePage = codePage_; }
virtual bool Match(int pos, const char *s)=0;
virtual char StyleAt(int position)=0;
virtual int GetLine(int position)=0;
virtual int LineStart(int line)=0;

View File

@@ -19,6 +19,7 @@ protected:
int language;
LexerFunction fnLexer;
LexerFunction fnFolder;
const char * const * wordListDescriptions;
static const LexerModule *base;
static int nextLanguage;
@@ -26,8 +27,14 @@ protected:
public:
const char *languageName;
LexerModule(int language_, LexerFunction fnLexer_,
const char *languageName_=0, LexerFunction fnFolder_=0);
const char *languageName_=0, LexerFunction fnFolder_=0,
const char * const wordListDescriptions_[] = NULL);
int GetLanguage() const { return language; }
// -1 is returned if no WordList information is available
int GetNumWordLists() const;
const char *GetWordListDescription(int index) const;
virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler) const;
virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle,

View File

@@ -106,8 +106,8 @@ public:
(rc.top >= top) && (rc.bottom <= bottom);
}
bool Intersects(PRectangle other) {
return (right >= other.left) && (left <= other.right) &&
(bottom >= other.top) && (top <= other.bottom);
return (right > other.left) && (left < other.right) &&
(bottom > other.top) && (top < other.bottom);
}
int Width() { return right - left; }
int Height() { return bottom - top; }
@@ -430,6 +430,8 @@ public:
static bool IsKeyDown(int key);
static long SendScintilla(
WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0);
static long SendScintillaPointer(
WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0);
static bool IsDBCSLeadByte(int codePage, char ch);
// These are utility functions not really tied to a platform

View File

@@ -76,10 +76,6 @@ public:
bool ignoreCase=false, char otherSeparator='\0');
};
inline bool nonFuncChar(char ch) {
return strchr("\t\n\r !\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~", ch) != NULL;
}
inline bool IsAlphabetic(unsigned int ch) {
return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
}

View File

@@ -10,7 +10,7 @@
// These functions are implemented because each platform calls them something different.
int CompareCaseInsensitive(const char *a, const char *b);
int CompareNCaseInsensitive(const char *a, const char *b, int len);
int CompareNCaseInsensitive(const char *a, const char *b, size_t len);
bool EqualCaseInsensitive(const char *a, const char *b);
// Define another string class.
@@ -22,13 +22,13 @@ bool EqualCaseInsensitive(const char *a, const char *b);
*
* Hold the length of the string for quick operations,
* can have a buffer bigger than the string to avoid too many memory allocations and copies.
* May have embedded zeroes as a result of @a substitute, but rely too heavily on C string
* functions to allow reliable manipulations of these strings.
* May have embedded zeroes as a result of @a substitute, but relies too heavily on C string
* functions to allow reliable manipulations of these strings, other than simple appends, etc.
**/
class SString {
public:
/** Type of string lengths (sizes) and positions (indexes). */
typedef unsigned int lenpos_t;
typedef size_t lenpos_t;
/** Out of bounds value indicating that the string argument should be measured. */
enum { measure_length=0xffffffffU};
@@ -63,7 +63,7 @@ private:
}
if (sSize > 0 && sSize_ <= sSize) { // Does not allocate new buffer if the current is big enough
if (s && sSize_) {
strncpy(s, sOther, sSize_);
memcpy(s, sOther, sSize_);
}
s[sSize_] = '\0';
sLen = sSize_;
@@ -92,6 +92,7 @@ public:
sSize = sLen = (s) ? strlen(s) : 0;
}
SString(const char *s_, lenpos_t first, lenpos_t last) : sizeGrowth(sizeGrowthDefault) {
// note: expects the "last" argument to point one beyond the range end (a la STL iterators)
s = StringAllocate(s_ + first, last - first);
sSize = sLen = (s) ? strlen(s) : 0;
}
@@ -188,6 +189,27 @@ public:
else
return '\0';
}
SString substr(lenpos_t subPos, lenpos_t subLen=measure_length) const {
if (subPos >= sLen) {
return SString(); // return a null string if start index is out of bounds
}
if ((subLen == measure_length) || (subPos + subLen > sLen)) {
subLen = sLen - subPos; // can't substr past end of source string
}
return SString(s, subPos, subPos + subLen);
}
SString &lowercase(lenpos_t subPos = 0, lenpos_t subLen=measure_length) {
if ((subLen == measure_length) || (subPos + subLen > sLen)) {
subLen = sLen - subPos; // don't apply past end of string
}
for (lenpos_t i = subPos; i < subPos + subLen; i++) {
if (s[i] < 'A' || s[i] > 'Z')
continue;
else
s[i] = static_cast<char>(s[i] - 'A' + 'a');
}
return *this;
}
SString &append(const char *sOther, lenpos_t sLenOther=measure_length, char sep = '\0') {
if (!sOther) {
return *this;
@@ -206,7 +228,7 @@ public:
s[sLen] = sep;
sLen++;
}
strncpy(&s[sLen], sOther, sLenOther);
memcpy(&s[sLen], sOther, sLenOther);
sLen += sLenOther;
s[sLen] = '\0';
}
@@ -259,6 +281,13 @@ public:
sLen -= len;
}
}
SString &change(lenpos_t pos, char ch) {
if (pos >= sLen) { // character changed must be in string bounds
return *this;
}
*(s + pos) = ch;
return *this;
}
/** Read an integral numeric value from the string. */
int value() const {
if (s)
@@ -266,7 +295,7 @@ public:
else
return 0;
}
int search(const char *sFind, lenpos_t start=0) {
int search(const char *sFind, lenpos_t start=0) const {
if (start < sLen) {
const char *sFound = strstr(s + start, sFind);
if (sFound) {
@@ -325,7 +354,7 @@ public:
}
char *sNew = new char[len + 1];
if (sNew) {
strncpy(sNew, s, len);
memcpy(sNew, s, len);
sNew[len] = '\0';
}
return sNew;

View File

@@ -47,6 +47,7 @@
#define SCLEX_PHP 30
#define SCLEX_BAAN 31
#define SCLEX_MATLAB 32
#define SCLEX_SCRIPTOL 33
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
@@ -81,15 +82,6 @@
#define SCE_C_WORD2 16
#define SCE_C_COMMENTDOCKEYWORD 17
#define SCE_C_COMMENTDOCKEYWORDERROR 18
#define SCE_B_DEFAULT 0
#define SCE_B_COMMENT 1
#define SCE_B_NUMBER 2
#define SCE_B_KEYWORD 3
#define SCE_B_STRING 4
#define SCE_B_PREPROCESSOR 5
#define SCE_B_OPERATOR 6
#define SCE_B_IDENTIFIER 7
#define SCE_B_DATE 8
#define SCE_H_DEFAULT 0
#define SCE_H_TAG 1
#define SCE_H_TAGUNKNOWN 2
@@ -230,6 +222,20 @@
#define SCE_PL_STRING_QX 28
#define SCE_PL_STRING_QR 29
#define SCE_PL_STRING_QW 30
#define SCE_B_DEFAULT 0
#define SCE_B_COMMENT 1
#define SCE_B_NUMBER 2
#define SCE_B_KEYWORD 3
#define SCE_B_STRING 4
#define SCE_B_PREPROCESSOR 5
#define SCE_B_OPERATOR 6
#define SCE_B_IDENTIFIER 7
#define SCE_B_DATE 8
#define SCE_PROPS_DEFAULT 0
#define SCE_PROPS_COMMENT 1
#define SCE_PROPS_SECTION 2
#define SCE_PROPS_ASSIGNMENT 3
#define SCE_PROPS_DEFVAL 4
#define SCE_L_DEFAULT 0
#define SCE_L_COMMAND 1
#define SCE_L_TAG 2
@@ -262,6 +268,7 @@
#define SCE_ERR_PERL 6
#define SCE_ERR_NET 7
#define SCE_ERR_LUA 8
#define SCE_ERR_CTAG 9
#define SCE_ERR_DIFF_CHANGED 10
#define SCE_ERR_DIFF_ADDITION 11
#define SCE_ERR_DIFF_DELETION 12
@@ -281,6 +288,13 @@
#define SCE_MAKE_OPERATOR 4
#define SCE_MAKE_TARGET 5
#define SCE_MAKE_IDEOL 9
#define SCE_DIFF_DEFAULT 0
#define SCE_DIFF_COMMENT 1
#define SCE_DIFF_COMMAND 2
#define SCE_DIFF_HEADER 3
#define SCE_DIFF_POSITION 4
#define SCE_DIFF_DELETED 5
#define SCE_DIFF_ADDED 6
#define SCE_CONF_DEFAULT 0
#define SCE_CONF_COMMENT 1
#define SCE_CONF_NUMBER 2
@@ -358,6 +372,26 @@
#define SCE_MATLAB_STRING 5
#define SCE_MATLAB_OPERATOR 6
#define SCE_MATLAB_IDENTIFIER 7
#define SCE_SCRIPTOL_DEFAULT 0
#define SCE_SCRIPTOL_COMMENT 1
#define SCE_SCRIPTOL_COMMENTLINE 2
#define SCE_SCRIPTOL_COMMENTDOC 3
#define SCE_SCRIPTOL_NUMBER 4
#define SCE_SCRIPTOL_WORD 5
#define SCE_SCRIPTOL_STRING 6
#define SCE_SCRIPTOL_CHARACTER 7
#define SCE_SCRIPTOL_UUID 8
#define SCE_SCRIPTOL_PREPROCESSOR 9
#define SCE_SCRIPTOL_OPERATOR 10
#define SCE_SCRIPTOL_IDENTIFIER 11
#define SCE_SCRIPTOL_STRINGEOL 12
#define SCE_SCRIPTOL_VERBATIM 13
#define SCE_SCRIPTOL_REGEX 14
#define SCE_SCRIPTOL_COMMENTLINEDOC 15
#define SCE_SCRIPTOL_WORD2 16
#define SCE_SCRIPTOL_COMMENTDOCKEYWORD 17
#define SCE_SCRIPTOL_COMMENTDOCKEYWORDERROR 18
#define SCE_SCRIPTOL_COMMENTBASIC 19
//--Autogenerated -- end of section automatically generated from Scintilla.iface
#endif

View File

@@ -21,8 +21,16 @@ int Scintilla_LinkLexers();
// Here should be placed typedefs for uptr_t, an unsigned integer type large enough to
// hold a pointer and sptr_t, a signed integer large enough to hold a pointer.
// May need to be changed for 64 bit platforms.
#if _MSC_VER >= 1300
#include <BaseTsd.h>
#endif
#ifdef MAXULONG_PTR
typedef ULONG_PTR uptr_t;
typedef LONG_PTR sptr_t;
#else
typedef unsigned long uptr_t;
typedef long sptr_t;
#endif
typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
@@ -359,6 +367,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_CACHE_DOCUMENT 3
#define SCI_SETLAYOUTCACHE 2272
#define SCI_GETLAYOUTCACHE 2273
#define SCI_SETSCROLLWIDTH 2274
#define SCI_GETSCROLLWIDTH 2275
#define SCI_TEXTWIDTH 2276
#define SCI_SETENDATLASTLINE 2277
#define SCI_GETENDATLASTLINE 2278
#define SCI_TEXTHEIGHT 2279
#define SCI_LINEDOWN 2300
#define SCI_LINEDOWNEXTEND 2301
#define SCI_LINEUP 2302
@@ -426,12 +440,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SEARCHANCHOR 2366
#define SCI_SEARCHNEXT 2367
#define SCI_SEARCHPREV 2368
#define CARET_SLOP 0x01
#define CARET_CENTER 0x02
#define CARET_STRICT 0x04
#define CARET_XEVEN 0x08
#define CARET_XJUMPS 0x10
#define SCI_SETCARETPOLICY 2369
#define SCI_LINESONSCREEN 2370
#define SCI_USEPOPUP 2371
#define SCI_SELECTIONISRECTANGLE 2372
@@ -465,6 +473,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETXOFFSET 2397
#define SCI_GETXOFFSET 2398
#define SCI_GRABFOCUS 2400
#define CARET_SLOP 0x01
#define CARET_STRICT 0x04
#define CARET_JUMPS 0x10
#define CARET_EVEN 0x08
#define SCI_SETXCARETPOLICY 2402
#define SCI_SETYCARETPOLICY 2403
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
@@ -525,6 +539,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCN_URIDROPPED 2015
#define SCN_DWELLSTART 2016
#define SCN_DWELLEND 2017
#define SCN_ZOOM 2018
//--Autogenerated -- end of section automatically generated from Scintilla.iface
// These structures are defined to be exactly the same shape as the Win32
@@ -598,6 +613,11 @@ struct SCNotification {
#ifdef INCLUDE_DEPRECATED_FEATURES
#define SCI_SETCARETPOLICY 2369
#define CARET_CENTER 0x02
#define CARET_XEVEN 0x08
#define CARET_XJUMPS 0x10
#define SCN_POSCHANGED 2012
#define SCN_CHECKBRACE 2007

View File

@@ -17,6 +17,9 @@
## set -> a property set function
## val -> definition of a constant
## evt -> an event
## enu -> associate an enumeration with a set of vals with a prefix
## lex -> associate a lexer with the lexical classes it produces
##
## All other feature names should be ignored. They may be defined in the future.
## A property may have a set function, a get function or both. Each will have
## "Get" or "Set" in their names and the corresponding name will have the obvious switch.
@@ -31,6 +34,16 @@
## The feature numbers are stable so features will not be renumbered.
## Features may be removed but they will go through a period of deprecation
## before removal which is signalled by moving them into the Deprecated category.
##
## enu has the syntax enu<ws><enumeration>=<prefix>[<ws><prefix>]* where all the val
## features in this file starting with a given <prefix> are considered part of the
## enumeration.
##
## lex has the syntax lex<ws><name>=<lexerVal><ws><prefix>[<ws><prefix>]*
## where name is a reasonably capitalised (Python, XML) identifier or UI name,
## lexerVal is the val used to specify the lexer, and the list of prefixes is similar
## to enu. The name may not be the same as that used within the lexer so the lexerVal
## should be used to tie these entities together.
## Types:
## void
@@ -73,37 +86,37 @@ val SCI_START=2000
val SCI_OPTIONAL_START=3000
val SCI_LEXER_START=4000
# Add text to the document
# Add text to the document.
fun void AddText=2001(int length, string text)
# Add array of cells to document
# Add array of cells to document.
fun void AddStyledText=2002(int length, cells c)
# Insert string at a position
# Insert string at a position.
fun void InsertText=2003(position pos, string text)
# Delete all text in the document
# Delete all text in the document.
fun void ClearAll=2004(,)
# Set all style bytes to 0, remove all folding information
# Set all style bytes to 0, remove all folding information.
fun void ClearDocumentStyle=2005(,)
# The number of characters in the document
# The number of characters in the document.
get int GetLength=2006(,)
# Returns the character byte at the position
# Returns the character byte at the position.
get int GetCharAt=2007(position pos,)
# Returns the position of the caret
# Returns the position of the caret.
get position GetCurrentPos=2008(,)
# Returns the position of the opposite end of the selection to the caret
# Returns the position of the opposite end of the selection to the caret.
get position GetAnchor=2009(,)
# Returns the style byte at the position
# Returns the style byte at the position.
get int GetStyleAt=2010(position pos,)
# Redoes the next action on the undo history
# Redoes the next action on the undo history.
fun void Redo=2011(,)
# Choose between collecting actions into the undo
@@ -121,10 +134,10 @@ fun void SetSavePoint=2014(,)
# Returns the number of bytes in the buffer not including terminating nulls.
fun int GetStyledText=2015(, textrange tr)
# Are there any redoable actions in the undo history.
# Are there any redoable actions in the undo history?
fun bool CanRedo=2016(,)
# Retrieve the line number at which a particular marker is located
# Retrieve the line number at which a particular marker is located.
fun int MarkerLineFromHandle=2017(int handle,)
# Delete a marker.
@@ -133,6 +146,7 @@ fun void MarkerDeleteHandle=2018(int handle,)
# Is undo history being collected?
get bool GetUndoCollection=2019(,)
enu WhiteSpace=SCWS_
val SCWS_INVISIBLE=0
val SCWS_VISIBLEALWAYS=1
val SCWS_VISIBLEAFTERINDENT=2
@@ -168,6 +182,7 @@ fun int GetCurLine=2027(int length, stringresult text)
# Retrieve the position of the last correctly styled character.
get position GetEndStyled=2028(,)
enu EndOfLine=SC_EOL_
val SC_EOL_CRLF=0
val SC_EOL_CR=1
val SC_EOL_LF=2
@@ -182,23 +197,21 @@ get int GetEOLMode=2030(,)
set void SetEOLMode=2031(int eolMode,)
# Set the current styling position to pos and the styling mask to mask.
# The styling mask can be used to protect some bits in each styling byte from
# modification.
# The styling mask can be used to protect some bits in each styling byte from modification.
fun void StartStyling=2032(position pos, int mask)
# Change style from current styling position for length characters to a style
# and move the current styling position to after this newly styled segment.
fun void SetStyling=2033(int length, int style)
# Is drawing done first into a buffer or direct to the screen.
# Is drawing done first into a buffer or direct to the screen?
get bool GetBufferedDraw=2034(,)
# If drawing is buffered then each line of text is drawn into a bitmap buffer
# before drawing it to the screen to avoid flicker.
set void SetBufferedDraw=2035(bool buffered,)
# Change the visible size of a tab to be a multiple of the width of a space
# character.
# Change the visible size of a tab to be a multiple of the width of a space character.
set void SetTabWidth=2036(int tabWidth,)
# Retrieve the visible size of a tab.
@@ -212,10 +225,11 @@ val SC_CP_UTF8=65001
# The SC_CP_UTF8 value can be used to enter Unicode mode.
set void SetCodePage=2037(int codePage,)
# In palette mode, Scintilla uses the environments palette calls to display
# In palette mode, Scintilla uses the environment's palette calls to display
# more colours. This may lead to ugly displays.
set void SetUsePalette=2039(bool usePalette,)
enu MarkerSymbol=SC_MARK_
val MARKER_MAX=31
val SC_MARK_CIRCLE=0
val SC_MARK_ROUNDRECT=1
@@ -227,7 +241,7 @@ val SC_MARK_ARROWDOWN=6
val SC_MARK_MINUS=7
val SC_MARK_PLUS=8
# Shapes used for outlining column
# Shapes used for outlining column.
val SC_MARK_VLINE=9
val SC_MARK_LCORNER=10
val SC_MARK_TCORNER=11
@@ -242,12 +256,13 @@ val SC_MARK_CIRCLEPLUSCONNECTED=19
val SC_MARK_CIRCLEMINUS=20
val SC_MARK_CIRCLEMINUSCONNECTED=21
# Invisible mark that only sets the line background color
# Invisible mark that only sets the line background color.
val SC_MARK_BACKGROUND=22
val SC_MARK_CHARACTER=10000
# Markers used for outlining column
enu MarkerOutline=SC_MARKNUM_
# Markers used for outlining column.
val SC_MARKNUM_FOLDEREND=25
val SC_MARKNUM_FOLDEROPENMID=26
val SC_MARKNUM_FOLDERMIDTAIL=27
@@ -270,10 +285,10 @@ fun void MarkerSetBack=2042(int markerNumber, colour back)
# Add a marker to a line, returning an ID which can be used to find or delete the marker.
fun int MarkerAdd=2043(int line, int markerNumber)
# Delete a marker from a line
# Delete a marker from a line.
fun void MarkerDelete=2044(int line, int markerNumber)
# Delete all markers with a particular number from all lines
# Delete all markers with a particular number from all lines.
fun void MarkerDeleteAll=2045(int markerNumber,)
# Get a bit mask of all the markers set on a line.
@@ -285,6 +300,7 @@ fun int MarkerNext=2047(int lineStart, int markerMask)
# Find the previous line before lineStart that includes a marker in mask.
fun int MarkerPrevious=2048(int lineStart, int markerMask)
enu MarginType=SC_MARGIN_
val SC_MARGIN_SYMBOL=0
val SC_MARGIN_NUMBER=1
@@ -314,6 +330,7 @@ get bool GetMarginSensitiveN=2247(int margin,)
# 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.
enu StylesCommon=STYLE_
val STYLE_DEFAULT=32
val STYLE_LINENUMBER=33
val STYLE_BRACELIGHT=34
@@ -325,6 +342,7 @@ val STYLE_MAX=127
# Character set identifiers are used in StyleSetCharacterSet.
# The values are the same as the Windows *_CHARSET values.
enu CharacterSet=SC_CHARSET_
val SC_CHARSET_ANSI=0
val SC_CHARSET_DEFAULT=1
val SC_CHARSET_BALTIC=186
@@ -375,6 +393,7 @@ fun void StyleResetDefault=2058(,)
# Set a style to be underlined or not.
set void StyleSetUnderline=2059(int style, bool underline)
enu CaseVisible=SC_CASE_
val SC_CASE_MIXED=0
val SC_CASE_UPPER=1
val SC_CASE_LOWER=2
@@ -414,8 +433,7 @@ get int GetCaretPeriod=2075(,)
# Get the time in milliseconds that the caret is on and off. 0 = steady on.
set void SetCaretPeriod=2076(int periodMilliseconds,)
# Set the set of characters making up words for when moving or selecting
# by word.
# Set the set of characters making up words for when moving or selecting by word.
set void SetWordChars=2077(, string characters)
# Start a sequence of actions that is undone and redone as a unit.
@@ -425,6 +443,7 @@ fun void BeginUndoAction=2078(,)
# End a sequence of actions that is undone and redone as a unit.
fun void EndUndoAction=2079(,)
enu IndicatorStyle=INDIC_
val INDIC_MAX=7
val INDIC_PLAIN=0
val INDIC_SQUIGGLE=1
@@ -448,8 +467,8 @@ set void IndicSetFore=2082(int indic, colour fore)
# Retrieve the foreground colour of an indicator.
get colour IndicGetFore=2083(int indic,)
# Divide each styling byte into lexical class bits (default:5) and indicator
# bits (default:3). If a lexer requires more than 32 lexical states, then this
# Divide each styling byte into lexical class bits (default: 5) and indicator
# bits (default: 3). If a lexer requires more than 32 lexical states, then this
# is used to expand the possible states.
set void SetStyleBits=2090(int bits,)
@@ -468,7 +487,7 @@ get int GetMaxLineState=2094(,)
# Is the background of the line containing the caret in a different colour?
get bool GetCaretLineVisible=2095(,)
# Dsplay the background of the line containing the caret in a different colour.
# Display the background of the line containing the caret in a different colour.
set void SetCaretLineVisible=2096(bool show,)
# Get the colour of the background of the line containing the caret.
@@ -492,8 +511,7 @@ fun void AutoCCancel=2101(,)
# Is there an auto-completion list visible?
fun bool AutoCActive=2102(,)
# Retrieve the position of the caret when the auto-completion list was
# displayed.
# Retrieve the position of the caret when the auto-completion list was displayed.
fun position AutoCPosStart=2103(,)
# User has selected an item so remove the list and insert the selection.
@@ -502,8 +520,8 @@ fun void AutoCComplete=2104(,)
# Define a set of character that when typed cancel the auto-completion list.
fun void AutoCStops=2105(, string characterSet)
# Change the separator character in the string setting up an auto-completion
# list. Default is space but can be changed if items contain space.
# Change the separator character in the string setting up an auto-completion list.
# Default is space but can be changed if items contain space.
set void AutoCSetSeparator=2106(int separatorCharacter,)
# Retrieve the auto-completion list separator character.
@@ -538,16 +556,18 @@ get bool AutoCGetIgnoreCase=2116(,)
# Display a list of strings and send notification when user chooses one.
fun void UserListShow=2117(int listType, string itemList)
# Set whether or not autocompletion is hidden automatically when nothing matches
# Set whether or not autocompletion is hidden automatically when nothing matches.
set void AutoCSetAutoHide=2118(bool autoHide,)
# Retrieve whether or not autocompletion is hidden automatically when nothing matches
# Retrieve whether or not autocompletion is hidden automatically when nothing matches.
get bool AutoCGetAutoHide=2119(,)
# Set whether or not autocompletion deletes any word characters after the inserted text upon completion
# Set whether or not autocompletion deletes any word characters
# after the inserted text upon completion.
set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,)
# Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion
# Retrieve whether or not autocompletion deletes any word characters
# after the inserted text upon completion.
get bool AutoCGetDropRestOfWord=2271(,)
# Set the number of spaces used for one level of indentation.
@@ -630,6 +650,7 @@ set void SetPrintMagnification=2146(int magnification,)
# Returns the print magnification.
get int GetPrintMagnification=2147(,)
enu PrintOption=SC_PRINT_
# PrintColourMode - use same colours as screen.
val SC_PRINT_NORMAL=0
# PrintColourMode - invert the light value of each style for printing.
@@ -647,6 +668,7 @@ set void SetPrintColourMode=2148(int mode,)
# Returns the print colour mode.
get int GetPrintColourMode=2149(,)
enu FindOption=SCFIND_
val SCFIND_WHOLEWORD=2
val SCFIND_MATCHCASE=4
val SCFIND_WORDSTART=0x00100000
@@ -655,7 +677,7 @@ val SCFIND_REGEXP=0x00200000
# Find some text in the document.
fun position FindText=2150(int flags, findtext ft)
# On Windows will draw the document into a display context such as a printer.
# On Windows, will draw the document into a display context such as a printer.
fun void FormatRange=2151(bool draw, formatrange fr)
# Retrieve the line at the top of the display.
@@ -727,7 +749,7 @@ fun void Null=2172(,)
# Will a paste succeed?
fun bool CanPaste=2173(,)
# Are there any undoable actions in the undo history.
# Are there any undoable actions in the undo history?
fun bool CanUndo=2174(,)
# Delete the undo history.
@@ -765,16 +787,16 @@ get int GetDirectFunction=2184(,)
# the function returned by GetDirectFunction.
get int GetDirectPointer=2185(,)
# Set to overtype (true) or insert mode
# Set to overtype (true) or insert mode.
set void SetOvertype=2186(bool overtype,)
# Returns true if overtype mode is active otherwise false is returned.
get bool GetOvertype=2187(,)
# Set the width of the insert mode caret
# Set the width of the insert mode caret.
set void SetCaretWidth=2188(int pixelWidth,)
# Returns the width of the insert mode caret
# Returns the width of the insert mode caret.
get int GetCaretWidth=2189(,)
# Sets the position that starts the target which is used for updating the
@@ -809,10 +831,10 @@ fun int ReplaceTargetRE=2195(int length, string text)
# Returns length of range or -1 for failure in which case target is not moved.
fun int SearchInTarget=2197(int length, string text)
# Set the search flags used by SearchInTarget
# Set the search flags used by SearchInTarget.
set void SetSearchFlags=2198(int flags,)
# Get the search flags used by SearchInTarget
# Get the search flags used by SearchInTarget.
get int GetSearchFlags=2199(,)
# Show a call tip containing a definition near position pos.
@@ -839,6 +861,7 @@ fun int VisibleFromDocLine=2220(int line,)
# Find the document line of a display line taking hidden lines into account.
fun int DocLineFromVisible=2221(int lineDisplay,)
enu FoldLevel=SC_FOLDLEVEL
val SC_FOLDLEVELBASE=0x400
val SC_FOLDLEVELWHITEFLAG=0x1000
val SC_FOLDLEVELHEADERFLAG=0x2000
@@ -879,20 +902,20 @@ fun void ToggleFold=2231(int line,)
# Ensure a particular line is visible by expanding any header line hiding it.
fun void EnsureVisible=2232(int line,)
# Set some debugging options for folding
# Set some debugging options for folding.
fun void SetFoldFlags=2233(int flags,)
# Ensure a particular line is visible by expanding any header line hiding it.
# Use the currently set visibility policy to determine which range to display.
fun void EnsureVisibleEnforcePolicy=2234(int line,)
# Sets whether a tab pressed when caret is within indentation indents
# Sets whether a tab pressed when caret is within indentation indents.
set void SetTabIndents=2260(bool tabIndents,)
# Does a tab pressed when caret is within indentation indent?
get bool GetTabIndents=2261(,)
# Sets whether a backspace pressed when caret is within indentation unindents
# Sets whether a backspace pressed when caret is within indentation unindents.
set void SetBackSpaceUnIndents=2262(bool bsUnIndents,)
# Does a backspace pressed when caret is within indentation unindent?
@@ -900,38 +923,63 @@ get bool GetBackSpaceUnIndents=2263(,)
val SC_TIME_FOREVER=10000000
# Sets the time the mouse must sit still to generate a mouse dwell event
# Sets the time the mouse must sit still to generate a mouse dwell event.
set void SetMouseDwellTime=2264(int periodMilliseconds,)
# Retrieve the time the mouse must sit still to generate a mouse dwell event
# Retrieve the time the mouse must sit still to generate a mouse dwell event.
get int GetMouseDwellTime=2265(,)
# Get position of start of word
# Get position of start of word.
fun int WordStartPosition=2266(position pos, bool onlyWordCharacters)
# Get position of end of word
# Get position of end of word.
fun int WordEndPosition=2267(position pos, bool onlyWordCharacters)
enu Wrap=SC_WRAP_
val SC_WRAP_NONE=0
val SC_WRAP_WORD=1
# Sets whether text is word wrapped
# Sets whether text is word wrapped.
set void SetWrapMode=2268(int mode,)
# Retrieve whether text is word wrapped
# Retrieve whether text is word wrapped.
get int GetWrapMode=2269(,)
enu LineCache=SC_CACHE_
val SC_CACHE_NONE=0
val SC_CACHE_CARET=1
val SC_CACHE_PAGE=2
val SC_CACHE_DOCUMENT=3
# Sets the degree of caching of layout information
# Sets the degree of caching of layout information.
set void SetLayoutCache=2272(int mode,)
# Retrieve the degree of caching of layout information
# Retrieve the degree of caching of layout information.
get int GetLayoutCache=2273(,)
# Sets the document width assumed for scrolling.
set void SetScrollWidth=2274(int pixelWidth,)
# Retrieve the document width assumed for scrolling.
get int GetScrollWidth=2275(,)
# Measure the pixel width of some text in a particular style.
# Nul terminated text argument.
# Does not handle tab or control characters.
fun int TextWidth=2276(int style, string text)
# Sets the scroll range so that maximum scroll position has
# the last line at the bottom of the view (default).
# Setting this to false allows scrolling one page below the last line.
set void SetEndAtLastLine=2277(bool endAtLastLine,)
# Retrieve whether the maximum scroll position has the last
# line at the bottom of the view.
get int GetEndAtLastLine=2278(,)
# Retrieve the height of a particular line of text in pixels.
fun int TextHeight=2279(int line,)
## Start of key messages
# Move caret down one line.
fun void LineDown=2300(,)
@@ -1014,8 +1062,7 @@ fun void Cancel=2325(,)
# Delete the selection or if no selection, the character before the caret.
fun void DeleteBack=2326(,)
# If selection is empty or all on one line replace the selection with a tab
# character.
# If selection is empty or all on one line replace the selection with a tab character.
# If more than one line selected, indent the lines.
fun void Tab=2327(,)
@@ -1069,17 +1116,17 @@ fun void LineScrollDown=2342(,)
fun void LineScrollUp=2343(,)
# Delete the selection or if no selection, the character before the caret.
# Will not delete the chraacter before at the start of a line.
# Will not delete the character before at the start of a line.
fun void DeleteBackNotLine=2344(,)
# Move the caret inside current view if it's not there already
# Move the caret inside current view if it's not there already.
fun void MoveCaretInsideView=2401(,)
# How many characters are on a line, not including end of line characters.
# How many characters are on a line, not including end of line characters?
fun int LineLength=2350(int line,)
# Highlight the characters at two positions.
fun void BraceHighlight=2351(position pos1,position pos2)
fun void BraceHighlight=2351(position pos1, position pos2)
# Highlight the character at a position indicating there is no matching brace.
fun void BraceBadLight=2352(position pos,)
@@ -1087,10 +1134,10 @@ fun void BraceBadLight=2352(position pos,)
# Find the position of a matching brace or INVALID_POSITION if no match.
fun position BraceMatch=2353(position pos,)
# Are the end of line characters visible.
# Are the end of line characters visible?
get bool GetViewEOL=2355(,)
# Make the end of line characters visible or invisible
# Make the end of line characters visible or invisible.
set void SetViewEOL=2356(bool visible,)
# Retrieve a pointer to the document object.
@@ -1102,6 +1149,7 @@ set void SetDocPointer=2358(,int pointer)
# Set which document modification events are sent to the container.
set void SetModEventMask=2359(int mask,)
enu EdgeVisualStyle=EDGE_
val EDGE_NONE=0
val EDGE_LINE=1
val EDGE_BACKGROUND=2
@@ -1137,24 +1185,6 @@ fun int SearchNext=2367(int flags, string text)
# Does not ensure the selection is visible.
fun int SearchPrev=2368(int flags, string text)
# Show caret within N lines of edge when it's scrolled to view
# If CARET_SLOP not set then centre caret on screen when it's
# scrolled to view
val CARET_SLOP=0x01
# Value not used
val CARET_CENTER=0x02
# If CARET_SLOP also set then reposition whenever outside slop border
# If CARET_SLOP not set then recentre even when visible
val CARET_STRICT=0x04
# If CARET_XEVEN set then both left and right margins are given equal weight
# rather than favouring left following behaviour.
val CARET_XEVEN=0x08
# If CARET_XJUMPS set then when caret reaches the margin the display jumps
# enough to leave the caret solidly within the display.
val CARET_XJUMPS=0x10
# Set the way the line the caret is on is kept visible.
fun void SetCaretPolicy=2369(int caretPolicy, int caretSlop)
# Retrieves the number of lines completely visible.
get int LinesOnScreen=2370(,)
@@ -1162,7 +1192,7 @@ get int LinesOnScreen=2370(,)
# the wrong mouse button.
fun void UsePopUp=2371(bool allowPopUp,)
# Is the selection a rectangular. The alternative is the more common stream selection.
# Is the selection rectangular? The alternative is the more common stream selection.
get bool SelectionIsRectangle=2372(,)
# Set the zoom level. This number of points is added to the size of all fonts.
@@ -1182,63 +1212,99 @@ fun void ReleaseDocument=2377(, int doc)
# Get which document modification events are sent to the container.
get int GetModEventMask=2378(,)
# Change internal focus flag
# Change internal focus flag.
set void SetFocus=2380(bool focus,)
# Get internal focus flag
# Get internal focus flag.
get bool GetFocus=2381(,)
# Change error status - 0 = OK
# Change error status - 0 = OK.
set void SetStatus=2382(int statusCode,)
# Get error status
# Get error status.
get int GetStatus=2383(,)
# Set whether the mouse is captured when its button is pressed
# Set whether the mouse is captured when its button is pressed.
set void SetMouseDownCaptures=2384(bool captures,)
# Get whether mouse gets captured
# Get whether mouse gets captured.
get bool GetMouseDownCaptures=2385(,)
enu CursorShape=SC_CURSOR
val SC_CURSORNORMAL=-1
val SC_CURSORWAIT=3
# Sets the cursor to one of the SC_CURSOR* values
# Sets the cursor to one of the SC_CURSOR* values.
set void SetCursor=2386(int cursorType,)
# Get cursor type
# Get cursor type.
get int GetCursor=2387(,)
# Change the way control characters are displayed:
# If symbol is < 32, keep the drawn way, else, use the given character
# If symbol is < 32, keep the drawn way, else, use the given character.
set void SetControlCharSymbol=2388(int symbol,)
# Get the way control characters are displayed
# Get the way control characters are displayed.
get int GetControlCharSymbol=2389(,)
# Move to the previous change in capitalistion
# Move to the previous change in capitalisation.
fun void WordPartLeft=2390(,)
# Move to the previous change in capitalistion extending selection to new caret position.
# Move to the previous change in capitalisation extending selection
# to new caret position.
fun void WordPartLeftExtend=2391(,)
# Move to the change next in capitalistion
# Move to the change next in capitalisation.
fun void WordPartRight=2392(,)
# Move to the next change in capitalistion extending selection to new caret position.
# Move to the next change in capitalisation extending selection
# to new caret position.
fun void WordPartRightExtend=2393(,)
# Constants for use with SetVisiblePolicy, similar to SetCaretPolicy
# Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
val VISIBLE_SLOP=0x01
val VISIBLE_STRICT=0x04
# Set the way the display area is determined when a particular line is to be moved to.
# Set the way the display area is determined when a particular line
# is to be moved to by Find, FindNext, GotoLine, etc.
fun void SetVisiblePolicy=2394(int visiblePolicy, int visibleSlop)
# Delete back from the current position to the start of the line
# Delete back from the current position to the start of the line.
fun void DelLineLeft=2395(,)
# Delete forwards from the current position to the end of the line
# Delete forwards from the current position to the end of the line.
fun void DelLineRight=2396(,)
# Get and Set the xOffset (ie, horizonal scroll position)
# Get and Set the xOffset (ie, horizonal scroll position).
set void SetXOffset=2397(int newOffset,)
get int GetXOffset=2398(,)
# Set the focus to this Scintilla widget.
# GTK+ Specific
# GTK+ Specific.
fun void GrabFocus=2400(,)
enu CaretPolicy = CARET_
# Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
# If CARET_SLOP is set, we can define a slop value: caretSlop.
# This value defines an unwanted zone (UZ) where the caret is... unwanted.
# This zone is defined as a number of pixels near the vertical margins,
# and as a number of lines near the horizontal margins.
# By keeping the caret away from the edges, it is seen within its context,
# so it is likely that the identifier that the caret is on can be completely seen,
# and that the current line is seen with some of the lines following it which are
# often dependent on that line.
val CARET_SLOP=0x01
# If CARET_STRICT is set, the policy is enforced... strictly.
# The caret is centred on the display if slop is not set,
# and cannot go in the UZ if slop is set.
val CARET_STRICT=0x04
# If CARET_JUMPS is set, the display is moved more energetically
# so the caret can move in the same direction longer before the policy is applied again.
val CARET_JUMPS=0x10
# If CARET_EVEN is not set, instead of having symmetrical UZs,
# the left and bottom UZs are extended up to right and top UZs respectively.
# This way, we favour the displaying of useful information: the begining of lines,
# where most code reside, and the lines after the caret, eg. the body of a function.
val CARET_EVEN=0x08
# Set the way the caret is kept visible when going sideway.
# The exclusion zone is given in pixels.
fun void SetXCaretPolicy=2402(int caretPolicy, int caretSlop)
# Set the way the line the caret is on is kept visible.
# The exclusion zone is given in lines.
fun void SetYCaretPolicy=2403(int caretPolicy, int caretSlop)
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
@@ -1264,9 +1330,10 @@ set void SetKeyWords=4005(int keywordSet, string keyWords)
set void SetLexerLanguage=4006(, string language)
# Notifications
# Type of modification and the action which caused the modification
# Type of modification and the action which caused the modification.
# These are defined as a bit mask to make it easy to specify which notifications are wanted.
# One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
enu ModificationFlags=SC_MOD_ SC_PERFORMED_ SC_LAST
val SC_MOD_INSERTTEXT=0x1
val SC_MOD_DELETETEXT=0x2
val SC_MOD_CHANGESTYLE=0x4
@@ -1281,15 +1348,18 @@ val SC_MOD_BEFOREDELETE=0x800
val SC_MODEVENTMASKALL=0xF77
# For compatibility, these go through the COMMAND notification rather than NOTIFY
# and have exactly the same values as the EN_* constants.
# and should have had exactly the same values as the EN_* constants.
# Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_*
# As clients depend on these constants, this will not be changed.
val SCEN_CHANGE=768
val SCEN_SETFOCUS=512
val SCEN_KILLFOCUS=256
# Symbolic key codes and modifier flags
# ASCII and other printable characters below 256
# Extended keys above 300
# Symbolic key codes and modifier flags.
# ASCII and other printable characters below 256.
# Extended keys above 300.
enu Keys=SCK_
val SCK_DOWN=300
val SCK_UP=301
val SCK_LEFT=302
@@ -1308,12 +1378,14 @@ val SCK_ADD=310
val SCK_SUBTRACT=311
val SCK_DIVIDE=312
enu KeyMod=SCMOD_
val SCMOD_SHIFT=1
val SCMOD_CTRL=2
val SCMOD_ALT=4
################################################
# For SciLexer.h
enu Lexer=SCLEX_
val SCLEX_CONTAINER=0
val SCLEX_NULL=1
val SCLEX_PYTHON=2
@@ -1347,11 +1419,14 @@ val SCLEX_ASP=29
val SCLEX_PHP=30
val SCLEX_BAAN=31
val SCLEX_MATLAB=32
val SCLEX_SCRIPTOL=33
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
val SCLEX_AUTOMATIC=1000
# Lexical states for SCLEX_PYTHON
lex Python=SCLEX_PYTHON SCE_P_
lex Ruby=SCLEX_RUBY SCE_P_
val SCE_P_DEFAULT=0
val SCE_P_COMMENTLINE=1
val SCE_P_NUMBER=2
@@ -1367,6 +1442,11 @@ val SCE_P_IDENTIFIER=11
val SCE_P_COMMENTBLOCK=12
val SCE_P_STRINGEOL=13
# Lexical states for SCLEX_CPP
lex Cpp=SCLEX_CPP SCE_C_
lex SQL=SCLEX_SQL SCE_C_
lex Pascal=SCLEX_PASCAL SCE_C_
lex TCL=SCLEX_TCL SCE_C_
lex BullAnt=SCLEX_BULLANT SCE_C_
val SCE_C_DEFAULT=0
val SCE_C_COMMENT=1
val SCE_C_COMMENTLINE=2
@@ -1386,17 +1466,11 @@ val SCE_C_COMMENTLINEDOC=15
val SCE_C_WORD2=16
val SCE_C_COMMENTDOCKEYWORD=17
val SCE_C_COMMENTDOCKEYWORDERROR=18
# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
val SCE_B_DEFAULT=0
val SCE_B_COMMENT=1
val SCE_B_NUMBER=2
val SCE_B_KEYWORD=3
val SCE_B_STRING=4
val SCE_B_PREPROCESSOR=5
val SCE_B_OPERATOR=6
val SCE_B_IDENTIFIER=7
val SCE_B_DATE=8
# Lexical states for SCLEX_HTML, SCLEX_XML
lex HTML=SCLEX_HTML SCE_H
lex XML=SCLEX_XML SCE_H
lex ASP=SCLEX_ASP SCE_H
lex PHP=SCLEX_PHP SCE_H
val SCE_H_DEFAULT=0
val SCE_H_TAG=1
val SCE_H_TAGUNKNOWN=2
@@ -1519,6 +1593,7 @@ val SCE_HPHP_COMMENTLINE=125
val SCE_HPHP_HSTRING_VARIABLE=126
val SCE_HPHP_OPERATOR=127
# Lexical states for SCLEX_PERL
lex Perl=SCLEX_PERL SCE_PL_
val SCE_PL_DEFAULT=0
val SCE_PL_ERROR=1
val SCE_PL_COMMENTLINE=2
@@ -1549,13 +1624,34 @@ val SCE_PL_STRING_QQ=27
val SCE_PL_STRING_QX=28
val SCE_PL_STRING_QR=29
val SCE_PL_STRING_QW=30
# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
lex VB=SCLEX_VB SCE_B_
lex VBScript=SCLEX_VBSCRIPT SCE_B_
val SCE_B_DEFAULT=0
val SCE_B_COMMENT=1
val SCE_B_NUMBER=2
val SCE_B_KEYWORD=3
val SCE_B_STRING=4
val SCE_B_PREPROCESSOR=5
val SCE_B_OPERATOR=6
val SCE_B_IDENTIFIER=7
val SCE_B_DATE=8
# Lexical states for SCLEX_PROPERTIES
lex Properties=SCLEX_PROPERTIES SCE_PROPS_
val SCE_PROPS_DEFAULT=0
val SCE_PROPS_COMMENT=1
val SCE_PROPS_SECTION=2
val SCE_PROPS_ASSIGNMENT=3
val SCE_PROPS_DEFVAL=4
# Lexical states for SCLEX_LATEX
lex LaTeX=SCLEX_LATEX SCE_L_
val SCE_L_DEFAULT=0
val SCE_L_COMMAND=1
val SCE_L_TAG=2
val SCE_L_MATH=3
val SCE_L_COMMENT=4
# Lexical states for SCLEX_LUA
lex Lua=SCLEX_LUA SCE_LUA_
val SCE_LUA_DEFAULT=0
val SCE_LUA_COMMENT=1
val SCE_LUA_COMMENTLINE=2
@@ -1575,6 +1671,7 @@ val SCE_LUA_WORD4=15
val SCE_LUA_WORD5=16
val SCE_LUA_WORD6=17
# Lexical states for SCLEX_ERRORLIST
lex ErrorList=SCLEX_ERRORLIST SCE_ERR_
val SCE_ERR_DEFAULT=0
val SCE_ERR_PYTHON=1
val SCE_ERR_GCC=2
@@ -1584,11 +1681,13 @@ val SCE_ERR_BORLAND=5
val SCE_ERR_PERL=6
val SCE_ERR_NET=7
val SCE_ERR_LUA=8
val SCE_ERR_CTAG=9
val SCE_ERR_DIFF_CHANGED=10
val SCE_ERR_DIFF_ADDITION=11
val SCE_ERR_DIFF_DELETION=12
val SCE_ERR_DIFF_MESSAGE=13
# Lexical states for SCLEX_BATCH
lex Batch=SCLEX_BATCH SCE_BAT_
val SCE_BAT_DEFAULT=0
val SCE_BAT_COMMENT=1
val SCE_BAT_WORD=2
@@ -1598,6 +1697,7 @@ val SCE_BAT_COMMAND=5
val SCE_BAT_IDENTIFIER=6
val SCE_BAT_OPERATOR=7
# Lexical states for SCLEX_MAKEFILE
lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_
val SCE_MAKE_DEFAULT=0
val SCE_MAKE_COMMENT=1
val SCE_MAKE_PREPROCESSOR=2
@@ -1605,7 +1705,17 @@ val SCE_MAKE_IDENTIFIER=3
val SCE_MAKE_OPERATOR=4
val SCE_MAKE_TARGET=5
val SCE_MAKE_IDEOL=9
# Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer)
# Lexical states for SCLEX_DIFF
lex Diff=SCLEX_DIFF SCE_DIFF_
val SCE_DIFF_DEFAULT=0
val SCE_DIFF_COMMENT=1
val SCE_DIFF_COMMAND=2
val SCE_DIFF_HEADER=3
val SCE_DIFF_POSITION=4
val SCE_DIFF_DELETED=5
val SCE_DIFF_ADDED=6
# Lexical states for SCLEX_CONF (Apache Configuration Files Lexer)
lex Conf=SCLEX_CONF SCE_CONF_
val SCE_CONF_DEFAULT=0
val SCE_CONF_COMMENT=1
val SCE_CONF_NUMBER=2
@@ -1616,7 +1726,8 @@ val SCE_CONF_STRING=6
val SCE_CONF_OPERATOR=7
val SCE_CONF_IP=8
val SCE_CONF_DIRECTIVE=9
# Avenue
# Lexical states for SCLEX_AVE, Avenue
lex Avenue=SCLEX_AVE SCE_AVE_
val SCE_AVE_DEFAULT=0
val SCE_AVE_COMMENT=1
val SCE_AVE_NUMBER=2
@@ -1629,6 +1740,7 @@ val SCE_AVE_STRINGEOL=8
val SCE_AVE_IDENTIFIER=9
val SCE_AVE_OPERATOR=10
# Lexical states for SCLEX_ADA
lex Ada=SCLEX_ADA SCE_ADA_
val SCE_ADA_DEFAULT=0
val SCE_ADA_COMMENT=1
val SCE_ADA_NUMBER=2
@@ -1639,6 +1751,7 @@ val SCE_ADA_OPERATOR=6
val SCE_ADA_IDENTIFIER=7
val SCE_ADA_STRINGEOL=8
# Lexical states for SCLEX_BAAN
lex Baan=SCLEX_BAAN SCE_BAAN_
val SCE_BAAN_DEFAULT=0
val SCE_BAAN_COMMENT=1
val SCE_BAAN_COMMENTDOC=2
@@ -1651,6 +1764,7 @@ val SCE_BAAN_IDENTIFIER=8
val SCE_BAAN_STRINGEOL=9
val SCE_BAAN_WORD2=10
# Lexical states for SCLEX_LISP
lex Lisp=SCLEX_LISP SCE_LISP_
val SCE_LISP_DEFAULT=0
val SCE_LISP_COMMENT=1
val SCE_LISP_NUMBER=2
@@ -1660,6 +1774,8 @@ val SCE_LISP_STRINGEOL=8
val SCE_LISP_IDENTIFIER=9
val SCE_LISP_OPERATOR=10
# Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW
lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_
lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_
val SCE_EIFFEL_DEFAULT=0
val SCE_EIFFEL_COMMENTLINE=1
val SCE_EIFFEL_NUMBER=2
@@ -1669,7 +1785,8 @@ val SCE_EIFFEL_CHARACTER=5
val SCE_EIFFEL_OPERATOR=6
val SCE_EIFFEL_IDENTIFIER=7
val SCE_EIFFEL_STRINGEOL=8
# Lexical states for the SCLEX_NNCRONTAB (nnCron crontab Lexer)
# Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer)
lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_
val SCE_NNCRONTAB_DEFAULT=0
val SCE_NNCRONTAB_COMMENT=1
val SCE_NNCRONTAB_TASK=2
@@ -1682,6 +1799,7 @@ val SCE_NNCRONTAB_STRING=8
val SCE_NNCRONTAB_ENVIRONMENT=9
val SCE_NNCRONTAB_IDENTIFIER=10
# Lexical states for SCLEX_MATLAB
lex MatLab=SCLEX_MATLAB SCE_MATLAB_
val SCE_MATLAB_DEFAULT=0
val SCE_MATLAB_COMMENT=1
val SCE_MATLAB_COMMAND=2
@@ -1690,6 +1808,28 @@ val SCE_MATLAB_KEYWORD=4
val SCE_MATLAB_STRING=5
val SCE_MATLAB_OPERATOR=6
val SCE_MATLAB_IDENTIFIER=7
# Lexical states for SCLEX_SCRIPTOL
lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_
val SCE_SCRIPTOL_DEFAULT=0
val SCE_SCRIPTOL_COMMENT=1
val SCE_SCRIPTOL_COMMENTLINE=2
val SCE_SCRIPTOL_COMMENTDOC=3
val SCE_SCRIPTOL_NUMBER=4
val SCE_SCRIPTOL_WORD=5
val SCE_SCRIPTOL_STRING=6
val SCE_SCRIPTOL_CHARACTER=7
val SCE_SCRIPTOL_UUID=8
val SCE_SCRIPTOL_PREPROCESSOR=9
val SCE_SCRIPTOL_OPERATOR=10
val SCE_SCRIPTOL_IDENTIFIER=11
val SCE_SCRIPTOL_STRINGEOL=12
val SCE_SCRIPTOL_VERBATIM=13
val SCE_SCRIPTOL_REGEX=14
val SCE_SCRIPTOL_COMMENTLINEDOC=15
val SCE_SCRIPTOL_WORD2=16
val SCE_SCRIPTOL_COMMENTDOCKEYWORD=17
val SCE_SCRIPTOL_COMMENTDOCKEYWORDERROR=18
val SCE_SCRIPTOL_COMMENTBASIC=19
# Events
@@ -1711,9 +1851,17 @@ evt void UserListSelection=2014(int listType, string text)
evt void URIDropped=2015(string text)
evt void DwellStart=2016(int position)
evt void DwellEnd=2017(int position)
evt void Zoom=2018(void)
cat Deprecated
# CARET_POLICY changed in 1.47
fun void SetCaretPolicy=2369(int caretPolicy, int caretSlop)
val CARET_CENTER=0x02
val CARET_XEVEN=0x08
val CARET_XJUMPS=0x10
# The old name for SCN_UPDATEUI
val SCN_CHECKBRACE=2007
evt void PosChanged=2012(int position)

View File

@@ -28,7 +28,7 @@ struct _ScintillaObject {
};
struct _ScintillaClass {
GtkFixedClass parent_class;
GtkContainerClass parent_class;
void (* command) (ScintillaObject *ttt);
void (* notify) (ScintillaObject *ttt);
@@ -39,6 +39,12 @@ GtkWidget* scintilla_new (void);
void scintilla_set_id (ScintillaObject *sci,int id);
sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);
#if GTK_MAJOR_VERSION < 2
#define SCINTILLA_NOTIFY "notify"
#else
#define SCINTILLA_NOTIFY "sci-notify"
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -31,6 +31,7 @@ public:
lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {
}
~WindowAccessor();
bool Match(int pos, const char *s);
char StyleAt(int position);
int GetLine(int position);
int LineStart(int line);

View File

@@ -118,7 +118,7 @@ void AutoComplete::Move(int delta) {
}
void AutoComplete::Select(const char *word) {
int lenWord = strlen(word);
size_t lenWord = strlen(word);
int location = -1;
const int maxItemLen=1000;
char item[maxItemLen];

View File

@@ -148,7 +148,7 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
look = newline + 1;
numLines++;
}
int lastWidth = surfaceMeasure->WidthText(font, look, strlen(look));
int lastWidth = surfaceMeasure->WidthText(font, look, static_cast<int>(strlen(look)));
width = Platform::Maximum(width, lastWidth) + 10;
int lineHeight = surfaceMeasure->Height(font);
// Extra line for border and an empty line at top and bottom

View File

@@ -958,10 +958,13 @@ void CellBuffer::BasicDeleteChars(int position, int deleteLength) {
//Platform::DebugPrintf("Removing cr end of line\n");
lv.Remove(lineRemove);
}
} else if ((ch == '\n') && !ignoreNL) {
} else if (ch == '\n') {
if (ignoreNL) {
ignoreNL = false; // Further \n are real deletions
} else {
//Platform::DebugPrintf("Removing lf end of line\n");
lv.Remove(lineRemove);
ignoreNL = false; // Further \n are not real deletions
}
}
ch = chNext;

View File

@@ -344,17 +344,19 @@ void Document::ModifiedAt(int pos) {
// SetStyleAt does not change the persistent state of a document
// Unlike Undo, Redo, and InsertStyledString, the pos argument is a cell number not a char number
void Document::DeleteChars(int pos, int len) {
bool Document::DeleteChars(int pos, int len) {
if (len == 0)
return;
return false;
if ((pos + len) > Length())
return;
return false;
if (cb.IsReadOnly() && enteredReadOnlyCount == 0) {
enteredReadOnlyCount++;
NotifyModifyAttempt();
enteredReadOnlyCount--;
}
if (enteredCount == 0) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
if (!cb.IsReadOnly()) {
NotifyModified(
@@ -379,15 +381,18 @@ void Document::DeleteChars(int pos, int len) {
}
enteredCount--;
}
return !cb.IsReadOnly();
}
void Document::InsertStyledString(int position, char *s, int insertLength) {
bool Document::InsertStyledString(int position, char *s, int insertLength) {
if (cb.IsReadOnly() && enteredReadOnlyCount == 0) {
enteredReadOnlyCount++;
NotifyModifyAttempt();
enteredReadOnlyCount--;
}
if (enteredCount == 0) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
if (!cb.IsReadOnly()) {
NotifyModified(
@@ -409,6 +414,7 @@ void Document::InsertStyledString(int position, char *s, int insertLength) {
}
enteredCount--;
}
return !cb.IsReadOnly();
}
int Document::Undo() {
@@ -497,29 +503,32 @@ int Document::Redo() {
return newPos;
}
void Document::InsertChar(int pos, char ch) {
bool Document::InsertChar(int pos, char ch) {
char chs[2];
chs[0] = ch;
chs[1] = 0;
InsertStyledString(pos*2, chs, 2);
return InsertStyledString(pos*2, chs, 2);
}
// Insert a null terminated string
void Document::InsertString(int position, const char *s) {
InsertString(position, s, strlen(s));
bool Document::InsertString(int position, const char *s) {
return InsertString(position, s, strlen(s));
}
// Insert a string with a length
void Document::InsertString(int position, const char *s, int insertLength) {
bool Document::InsertString(int position, const char *s, size_t insertLength) {
bool changed = false;
char *sWithStyle = new char[insertLength * 2];
if (sWithStyle) {
for (int i = 0; i < insertLength; i++) {
for (size_t i = 0; i < insertLength; i++) {
sWithStyle[i*2] = s[i];
sWithStyle[i*2 + 1] = 0;
}
InsertStyledString(position*2, sWithStyle, insertLength*2);
changed = InsertStyledString(position*2, sWithStyle,
static_cast<int>(insertLength*2));
delete []sWithStyle;
}
return changed;
}
void Document::ChangeChar(int pos, char ch) {
@@ -531,22 +540,18 @@ void Document::DelChar(int pos) {
DeleteChars(pos, LenChar(pos));
}
int Document::DelCharBack(int pos) {
void Document::DelCharBack(int pos) {
if (pos <= 0) {
return pos;
return;
} else if (IsCrLf(pos - 2)) {
DeleteChars(pos - 2, 2);
return pos - 2;
} else if (SC_CP_UTF8 == dbcsCodePage) {
int startChar = MovePositionOutsideChar(pos - 1, -1, false);
DeleteChars(startChar, pos - startChar);
return startChar;
} else if (IsDBCS(pos - 1)) {
DeleteChars(pos - 2, 2);
return pos - 2;
} else {
DeleteChars(pos - 1, 1);
return pos - 1;
}
}
@@ -822,8 +827,9 @@ class DocumentIndexer : public CharacterIndexer {
Document *pdoc;
int end;
public:
DocumentIndexer(Document *pdoc_, int end_) :
pdoc(pdoc_), end(end_) {}
DocumentIndexer(Document *pdoc_, int end_) :
pdoc(pdoc_), end(end_) {
}
virtual char CharAt(int index) {
if (index < 0 || index >= end)
@@ -928,7 +934,7 @@ long Document::FindText(int minPos, int maxPos, const char *s,
// Compute actual search ranges needed
int lengthFind = *length;
if (lengthFind == -1)
lengthFind = strlen(s);
lengthFind = static_cast<int>(strlen(s));
int endSearch = endPos;
if (startPos <= endPos) {
endSearch = endPos - lengthFind + 1;
@@ -1081,8 +1087,10 @@ void Document::StartStyling(int position, char mask) {
endStyled = position;
}
void Document::SetStyleFor(int length, char style) {
if (enteredCount == 0) {
bool Document::SetStyleFor(int length, char style) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
int prevEndStyled = endStyled;
if (cb.SetStyleFor(endStyled, length, style, stylingMask)) {
@@ -1092,26 +1100,32 @@ void Document::SetStyleFor(int length, char style) {
}
endStyled += length;
enteredCount--;
return true;
}
}
void Document::SetStyles(int length, char *styles) {
if (enteredCount == 0) {
bool Document::SetStyles(int length, char *styles) {
if (enteredCount != 0) {
return false;
} else {
enteredCount++;
int prevEndStyled = endStyled;
bool didChange = false;
int lastChange = 0;
for (int iPos = 0; iPos < length; iPos++, endStyled++) {
PLATFORM_ASSERT(endStyled < Length());
if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) {
didChange = true;
lastChange = iPos;
}
}
if (didChange) {
DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
prevEndStyled, endStyled - prevEndStyled);
prevEndStyled, lastChange);
NotifyModified(mh);
}
enteredCount--;
return true;
}
}
@@ -1121,10 +1135,11 @@ bool Document::EnsureStyledTo(int pos) {
if (styleClock > 0x100000) {
styleClock = 0;
}
}
// Ask the watchers to style, and stop as soon as one responds.
for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++)
for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) {
watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos);
}
}
return pos <= GetEndStyled();
}

View File

@@ -132,8 +132,8 @@ public:
int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true);
// Gateways to modifying document
void DeleteChars(int pos, int len);
void InsertStyledString(int position, char *s, int insertLength);
bool DeleteChars(int pos, int len);
bool InsertStyledString(int position, char *s, int insertLength);
int Undo();
int Redo();
bool CanUndo() { return cb.CanUndo(); }
@@ -158,12 +158,12 @@ public:
void SetReadOnly(bool set) { cb.SetReadOnly(set); }
bool IsReadOnly() { return cb.IsReadOnly(); }
void InsertChar(int pos, char ch);
void InsertString(int position, const char *s);
void InsertString(int position, const char *s, int insertLength);
bool InsertChar(int pos, char ch);
bool InsertString(int position, const char *s);
bool InsertString(int position, const char *s, size_t insertLength);
void ChangeChar(int pos, char ch);
void DelChar(int pos);
int DelCharBack(int pos);
void DelCharBack(int pos);
char CharAt(int position) { return cb.CharAt(position); }
void GetCharRange(char *buffer, int position, int lengthRetrieve) {
@@ -202,8 +202,8 @@ public:
void SetWordChars(unsigned char *chars);
void SetStylingBits(int bits);
void StartStyling(int position, char mask);
void SetStyleFor(int length, char style);
void SetStyles(int length, char *styles);
bool SetStyleFor(int length, char style);
bool SetStyles(int length, char *styles);
int GetEndStyled() { return endStyled; }
bool EnsureStyledTo(int pos);
int GetStyleClock() { return styleClock; }

View File

@@ -48,6 +48,15 @@ void DocumentAccessor::Fill(int position) {
buf[endPos-startPos] = '\0';
}
bool DocumentAccessor::Match(int pos, const char *s) {
for (int i=0; *s; i++) {
if (*s != SafeGetCharAt(pos+i))
return false;
s++;
}
return true;
}
char DocumentAccessor::StyleAt(int position) {
return pdoc->StyleAt(position);
}

View File

@@ -38,6 +38,7 @@ public:
startSeg(0), startPosStyling(0) {
}
~DocumentAccessor();
bool Match(int pos, const char *s);
char StyleAt(int position);
int GetLine(int position);
int LineStart(int line);

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,7 @@ public:
enum { wrapWidthInfinite = 0x7ffffff };
int maxLineLength;
int numCharsInLine;
enum validLevel { llInvalid, llPositions, llLines } validity;
enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity;
int xHighlightGuide;
bool highlightColumn;
int selStart;
@@ -200,6 +200,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
int xOffset; ///< Horizontal scrolled amount in pixels
int xCaretMargin; ///< Ensure this many pixels visible on both sides of caret
bool horizontalScrollBarVisible;
int scrollWidth;
bool endAtLastLine;
Surface *pixmapLine;
Surface *pixmapSelMargin;
@@ -257,8 +259,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
int xEndSelect;
bool primarySelection;
int caretPolicy;
int caretSlop;
int caretXPolicy;
int caretXSlop; ///< Ensure this many pixels visible on both sides of caret
int caretYPolicy;
int caretYSlop; ///< Ensure this many lines visible on both sides of caret
int visiblePolicy;
int visibleSlop;
@@ -302,6 +307,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
int LineFromLocation(Point pt);
void SetTopLine(int topLineNew);
bool AbandonPaint();
void RedrawRect(PRectangle rc);
void Redraw();
void RedrawSelMargin();
@@ -342,6 +348,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
PRectangle rcLine, LineLayout *ll, int subLine=0);
void Paint(Surface *surfaceWindow, PRectangle rcArea);
long FormatRange(bool draw, RangeToFormat *pfr);
int TextWidth(int style, const char *text);
virtual void SetVerticalScrollPos() = 0;
virtual void SetHorizontalScrollPos() = 0;
@@ -383,6 +390,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);
void NotifyNeedShown(int pos, int len);
void NotifyDwelling(Point pt, bool state);
void NotifyZoom();
void NotifyModifyAttempt(Document *document, void *userData);
void NotifySavePoint(Document *document, void *userData, bool atSavePoint);
@@ -390,12 +398,14 @@ protected: // ScintillaBase subclass needs access to much of Editor
void NotifyModified(Document *document, DocModification mh, void *userData);
void NotifyDeleted(Document *document, void *userData);
void NotifyStyleNeeded(Document *doc, void *userData, int endPos);
void NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long lParam);
void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
void PageMove(int direction, bool extend=false);
void ChangeCaseOfSelection(bool makeUpperCase);
void LineTranspose();
virtual void CancelModes();
void NewLine();
void CursorUpOrDown(int direction, bool extend=false);
virtual int KeyCommand(unsigned int iMessage);
virtual int KeyDefault(int /* key */, int /*modifiers*/);
int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0);
@@ -405,9 +415,9 @@ protected: // ScintillaBase subclass needs access to much of Editor
void Indent(bool forwards);
long FindText(unsigned long wParam, long lParam);
long FindText(uptr_t wParam, sptr_t lParam);
void SearchAnchor();
long SearchText(unsigned int iMessage, unsigned long wParam, long lParam);
long SearchText(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
long SearchInTarget(const char *text, int length);
void GoToLine(int lineNo);

View File

@@ -23,10 +23,12 @@ const LexerModule *LexerModule::base = 0;
int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1;
LexerModule::LexerModule(int language_, LexerFunction fnLexer_,
const char *languageName_, LexerFunction fnFolder_) :
const char *languageName_, LexerFunction fnFolder_,
const char * const wordListDescriptions_[]) :
language(language_),
fnLexer(fnLexer_),
fnFolder(fnFolder_),
wordListDescriptions(wordListDescriptions_),
languageName(languageName_) {
next = base;
base = this;
@@ -36,6 +38,31 @@ LexerModule::LexerModule(int language_, LexerFunction fnLexer_,
}
}
int LexerModule::GetNumWordLists() const {
if (wordListDescriptions == NULL) {
return -1;
} else {
int numWordLists = 0;
while (wordListDescriptions[numWordLists]) {
++numWordLists;
}
return numWordLists;
}
}
const char * LexerModule::GetWordListDescription(int index) const {
static const char *emptyStr = "";
PLATFORM_ASSERT(index < GetNumWordLists());
if (index >= GetNumWordLists()) {
return emptyStr;
} else {
return wordListDescriptions[index];
}
}
const LexerModule *LexerModule::Find(int language) {
const LexerModule *lm = base;
while (lm) {
@@ -97,83 +124,55 @@ static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[
LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
#ifdef __vms
#define LINK_LEXERS
#endif
#ifdef LINK_LEXERS
// The following code forces a reference to all of the Scintilla lexers.
// If we don't do something like this, then the linker tends to "optimize"
// them away. (eric@sourcegear.com)
// Taken from wxWindow's stc.cpp. Walter.
// Alternative historical name for Scintilla_LinkLexers
int wxForceScintillaLexers(void) {
return Scintilla_LinkLexers();
}
int Scintilla_LinkLexers() {
extern LexerModule lmAda;
extern LexerModule lmAVE;
extern LexerModule lmBaan;
extern LexerModule lmBatch;
extern LexerModule lmConf;
extern LexerModule lmCPP;
extern LexerModule lmDiff;
extern LexerModule lmEiffel;
extern LexerModule lmEiffelkw;
extern LexerModule lmErrorList;
extern LexerModule lmHTML;
extern LexerModule lmLatex;
extern LexerModule lmLISP;
extern LexerModule lmLua;
extern LexerModule lmMake;
extern LexerModule lmMatlab;
extern LexerModule lmPascal;
extern LexerModule lmPerl;
extern LexerModule lmProps;
extern LexerModule lmPython;
extern LexerModule lmRuby;
extern LexerModule lmSQL;
extern LexerModule lmVB;
extern LexerModule lmXML;
extern LexerModule lmBullant;
// To add or remove a lexer, add or remove its file and run LexGen.py.
// Force a reference to all of the Scintilla lexers so that the linker will
// not remove the code of the lexers.
int Scintilla_LinkLexers() {
static int forcer = 0;
// Shorten the code that declares a lexer and ensures it is linked in by calling a method.
#define LINK_LEXER(lexer) extern LexerModule lexer; forcer += lexer.GetLanguage();
//++Autogenerated -- run src/LexGen.py to regenerate
//**\(\tLINK_LEXER(\*);\n\)
LINK_LEXER(lmAda);
LINK_LEXER(lmAVE);
LINK_LEXER(lmBaan);
LINK_LEXER(lmBullant);
LINK_LEXER(lmConf);
LINK_LEXER(lmCPP);
LINK_LEXER(lmTCL);
LINK_LEXER(lmNncrontab);
LINK_LEXER(lmEiffel);
LINK_LEXER(lmEiffelkw);
LINK_LEXER(lmHTML);
LINK_LEXER(lmXML);
LINK_LEXER(lmASP);
LINK_LEXER(lmPHP);
LINK_LEXER(lmLISP);
LINK_LEXER(lmLua);
LINK_LEXER(lmMatlab);
LINK_LEXER(lmBatch);
LINK_LEXER(lmDiff);
LINK_LEXER(lmProps);
LINK_LEXER(lmMake);
LINK_LEXER(lmErrorList);
LINK_LEXER(lmLatex);
LINK_LEXER(lmPascal);
LINK_LEXER(lmPerl);
LINK_LEXER(lmPython);
LINK_LEXER(lmRuby);
LINK_LEXER(lmSQL);
LINK_LEXER(lmVB);
LINK_LEXER(lmVBScript);
//--Autogenerated -- end of automatically generated section
if (
&lmAda
&& &lmAVE
&& &lmBaan
&& &lmConf
&& &lmDiff
&& &lmLatex
&& &lmPascal
&& &lmCPP
&& &lmHTML
&& &lmXML
&& &lmProps
&& &lmErrorList
&& &lmMake
&& &lmMatlab
&& &lmBatch
&& &lmPerl
&& &lmPython
&& &lmSQL
&& &lmVB
&& &lmRuby
&& &lmEiffel
&& &lmEiffelkw
&& &lmLISP
&& &lmLua
&& &lmNull
&& &lmBullant
)
{
return 1;
}
else
{
return 0;
}
}
#endif

View File

@@ -72,17 +72,18 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart && (sc.state == SCE_C_STRING)) {
// Prevent SCE_C_STRINGEOL from leaking back to previous line
sc.SetState(SCE_C_STRING);
}
// Handle line continuation generically.
if (sc.ch == '\\') {
if (sc.Match("\\\n")) {
if (sc.chNext == '\n' || sc.chNext == '\r') {
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
sc.Forward();
continue;
}
if (sc.Match("\\\r\n")) {
sc.Forward();
sc.Forward();
sc.Forward();
continue;
}
}
@@ -260,9 +261,17 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
sc.Complete();
}
static bool IsStreamCommentStyle(int style) {
return style == SCE_C_COMMENT ||
style == SCE_C_COMMENTDOC ||
style == SCE_C_COMMENTDOCKEYWORD ||
style == SCE_C_COMMENTDOCKEYWORDERROR;
}
static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[],
Accessor &styler) {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0;
@@ -279,15 +288,37 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (foldComment &&
(style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC)) {
if (style != stylePrev) {
if (foldComment && IsStreamCommentStyle(style)) {
if (!IsStreamCommentStyle(stylePrev)) {
levelCurrent++;
} else if ((style != styleNext) && !atEOL) {
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
// Comments don't end at end of line and the next character may be unstyled.
levelCurrent--;
}
}
if (foldComment && (style == SCE_C_COMMENTLINE)) {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
levelCurrent++;
} else if (chNext2 == '}') {
levelCurrent--;
}
}
}
if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
if (ch == '#') {
unsigned int j=i+1;
while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
j++;
}
if (styler.Match(j, "region") || styler.Match(j, "if")) {
levelCurrent++;
} else if (styler.Match(j, "end")) {
levelCurrent--;
}
}
}
if (style == SCE_C_OPERATOR) {
if (ch == '{') {
levelCurrent++;
@@ -316,5 +347,12 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
LexerModule lmCPP(SCLEX_CPP, ColouriseCppDoc, "cpp", FoldCppDoc);
LexerModule lmTCL(SCLEX_TCL, ColouriseCppDoc, "tcl", FoldCppDoc);
static const char * const cppWordLists[] = {
"Primary keywords and identifiers",
"Secondary keywords and identifiers",
"Documentation comment keywords",
0,
};
LexerModule lmCPP(SCLEX_CPP, ColouriseCppDoc, "cpp", FoldCppDoc, cppWordLists);
LexerModule lmTCL(SCLEX_TCL, ColouriseCppDoc, "tcl", FoldCppDoc, cppWordLists);

View File

@@ -2,7 +2,7 @@
/** @file LexCrontab.cxx
** Lexer to use with extended crontab files used by a powerful
** Windows scheduler/event monitor/automation manager nnCron.
** (http://nemtsev.virtualave.net/)
** (http://nemtsev.eserv.ru/)
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
@@ -62,7 +62,8 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
state = SCE_NNCRONTAB_TASK;
styler.ColourTo(i,SCE_NNCRONTAB_TASK);
}
else if( ch == '\\' && styler.SafeGetCharAt(i+1) == ' ') {
else if( ch == '\\' && (styler.SafeGetCharAt(i+1) == ' ' ||
styler.SafeGetCharAt(i+1) == '\t')) {
// signals the start of an extended comment...
state = SCE_NNCRONTAB_COMMENT;
styler.ColourTo(i,SCE_NNCRONTAB_COMMENT);
@@ -81,6 +82,10 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
// signals environment variables
state = SCE_NNCRONTAB_ENVIRONMENT;
styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
} else if( ch == '<' && styler.SafeGetCharAt(i+1) == '%') {
// signals environment variables
state = SCE_NNCRONTAB_ENVIRONMENT;
styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
} else if( ch == '*' ) {
// signals an asterisk
// no state jump necessary for this simple case...
@@ -148,7 +153,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
break;
}
if( (ch == '%' && styler.SafeGetCharAt(i-1)!='\\')
|| (ch == '\n') || (ch == '\r') ) {
|| (ch == '\n') || (ch == '\r') || (ch == '>') ) {
state = SCE_NNCRONTAB_DEFAULT;
styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
break;
@@ -159,7 +164,8 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
case SCE_NNCRONTAB_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
if( isalnum(ch) || (ch == '_') || (ch == '-') || (ch == '/') ||
(ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') ) {
(ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') ||
(ch == '@') ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_NNCRONTAB_DEFAULT;

View File

@@ -220,9 +220,11 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
isScript = 0 == strcmp(s, "script");
}
}
if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords)
if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords) {
// No keywords -> all are known
chAttr = SCE_H_TAG;
isScript = 0 == strcmp(s, "script");
}
styler.ColourTo(end, chAttr);
return isScript ? SCE_H_SCRIPT : chAttr;
}
@@ -555,6 +557,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
//case SCE_HJ_COMMENTLINE:
case SCE_HJ_DOUBLESTRING:
case SCE_HJ_SINGLESTRING:
case SCE_HJ_REGEX:
case SCE_HB_STRING:
case SCE_HP_STRING:
case SCE_HP_TRIPLE:
@@ -1851,7 +1854,17 @@ static void ColourisePHPDoc(unsigned int startPos, int length, int initStyle, Wo
sc.Complete();
}
LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext");
LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml");
LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp");
LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php");
static const char * const htmlWordListDesc[] = {
"HTML elements and attributes",
"JavaScript keywords",
"VBScript keywords",
"Python keywords",
"PHP keywords",
"SGML and DTD keywords",
0,
};
LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext", 0, htmlWordListDesc);
LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml", 0, htmlWordListDesc);
LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc);
LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc);

View File

@@ -4,7 +4,7 @@
**
** Written by Paul Winwood.
** Folder by Alexey Yutkin.
** Modified by Marcos E. Wurzius
** Modified by Marcos E. Wurzius & Philippe Lhoste
**/
#include <stdlib.h>
@@ -23,6 +23,7 @@
#include "Scintilla.h"
#include "SciLexer.h"
#define SCE_LUA_LAST_STYLE SCE_LUA_WORD6
static inline bool IsAWordChar(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
@@ -32,7 +33,6 @@ inline bool IsAWordStart(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_');
}
inline bool isLuaOperator(char ch) {
if (isalnum(ch))
return false;
@@ -47,8 +47,11 @@ inline bool isLuaOperator(char ch) {
return false;
}
static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
static void ColouriseLuaDoc(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
@@ -57,28 +60,40 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
int literalString = 0;
int literalStringFlag =0;
// Must initialize the literal string nesting level, if we are inside such a string.
int literalStringLevel = 0;
if (initStyle == SCE_LUA_LITERALSTRING) {
literalStringLevel = 1;
}
// We use states above the last one to indicate nesting level of literal strings
if (initStyle > SCE_LUA_LAST_STYLE) {
literalStringLevel = initStyle - SCE_LUA_LAST_STYLE + 1;
}
// Do not leak onto next line
if (initStyle == SCE_LUA_STRINGEOL)
if (initStyle == SCE_LUA_STRINGEOL) {
initStyle = SCE_LUA_DEFAULT;
}
StyleContext sc(startPos, length, initStyle, styler);
if(startPos == 0 && sc.ch == '#') sc.SetState(SCE_LUA_COMMENTLINE);
for (; sc.More(); sc.Forward()) {
// Handle line continuation generically.
if (sc.ch == '\\') {
if (sc.Match("\\\n")) {
sc.Forward();
sc.Forward();
continue;
if (startPos == 0 && sc.ch == '#') {
sc.SetState(SCE_LUA_COMMENTLINE);
}
if (sc.Match("\\\r\n")) {
sc.Forward();
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart && (sc.state == SCE_LUA_STRING)) {
// Prevent SCE_LUA_STRINGEOL from leaking back to previous line
sc.SetState(SCE_LUA_STRING);
}
// Handle string line continuation
if ((sc.state == SCE_LUA_STRING || sc.state == SCE_LUA_CHARACTER) &&
sc.ch == '\\') {
if (sc.chNext == '\n' || sc.chNext == '\r') {
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
sc.Forward();
}
continue;
}
}
@@ -109,12 +124,14 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
}
sc.SetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_COMMENTLINE ) {
if (sc.atLineEnd) {
sc.SetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_PREPROCESSOR ) {
if (sc.atLineEnd) {
sc.SetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_STRING) {
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
@@ -126,7 +143,6 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
sc.ChangeState(SCE_LUA_STRINGEOL);
sc.ForwardSetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_CHARACTER) {
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
@@ -138,33 +154,41 @@ static void ColouriseLuaDoc(unsigned int startPos, int length, int initStyle, Wo
sc.ChangeState(SCE_LUA_STRINGEOL);
sc.ForwardSetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_LITERALSTRING) {
if (sc.chPrev == '[' && sc.ch == '[' && literalStringFlag != 1) {
literalString++;
literalStringFlag = 1;
}
else if (sc.chPrev == ']' && sc.ch == ']' && literalStringFlag != 2 ) {
if((--literalString == 1))
} else if (sc.state == SCE_LUA_LITERALSTRING || sc.state > SCE_LUA_LAST_STYLE) {
if (sc.Match('[', '[')) {
literalStringLevel++;
sc.SetState(SCE_LUA_LAST_STYLE + literalStringLevel - 1);
} else if (sc.Match(']', ']') && literalStringLevel > 0) {
literalStringLevel--;
sc.Forward();
if (literalStringLevel == 0) {
sc.ForwardSetState(SCE_LUA_DEFAULT);
literalStringFlag = 2;
} else if (literalStringLevel == 1) {
sc.ForwardSetState(SCE_LUA_LITERALSTRING);
} else {
sc.ForwardSetState(SCE_LUA_LAST_STYLE + literalStringLevel - 1);
}
}
else literalStringFlag = 0;
}
// Determine if a new state should be entered.
if (sc.state == SCE_LUA_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_LUA_NUMBER);
} else if (IsAWordStart(sc.ch) || (sc.ch == '@')) {
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_LUA_IDENTIFIER);
} else if (sc.ch == '\"') {
} else if (sc.Match('\"')) {
sc.SetState(SCE_LUA_STRING);
} else if (sc.ch == '\'') {
} else if (sc.Match('\'')) {
sc.SetState(SCE_LUA_CHARACTER);
} else if (sc.ch == '[' && sc.chNext == '[') {
} else if (sc.Match('[', '[')) {
literalStringLevel = 1;
sc.SetState(SCE_LUA_LITERALSTRING);
literalString = 1;
} else if (sc.ch == '-' && sc.chNext == '-') {
sc.Forward();
} else if (sc.Match('-', '-')) {
sc.SetState(SCE_LUA_COMMENTLINE);
sc.Forward();
} else if (sc.Match('$') && sc.atLineStart) {
sc.SetState(SCE_LUA_PREPROCESSOR); // Obsolete since Lua 4.0, but still in old code
} else if (isLuaOperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_LUA_OPERATOR);
}
@@ -185,6 +209,7 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
char s[10];
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
@@ -192,36 +217,38 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (style == SCE_LUA_WORD) {
if ( ch == 'i' || ch == 'e' || ch == 't' || ch == 'd' || ch == 'f') {
if (ch == 'i' || ch == 'd' || ch == 'f' || ch == 'e') {
for (unsigned int j = 0; j < 8; j++) {
if (!iswordchar(styler[i + j]))
if (!iswordchar(styler[i + j])) {
break;
}
s[j] = styler[i + j];
s[j + 1] = '\0';
}
if ((strcmp(s, "if") == 0) || (strcmp(s, "do") == 0)
|| (strcmp(s, "function") == 0))
if ((strcmp(s, "if") == 0) || (strcmp(s, "do") == 0) || (strcmp(s, "function") == 0)) {
levelCurrent++;
if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0))
}
if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0)) {
levelCurrent--;
}
}
else if (style == SCE_LUA_OPERATOR)
{
if(ch == '{' || ch == '(')
} else if (style == SCE_LUA_OPERATOR) {
if (ch == '{' || ch == '(') {
levelCurrent++;
else if(ch == '}' || ch == ')')
} else if (ch == '}' || ch == ')') {
levelCurrent--;
}
}
if (atEOL) {
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
if (visibleChars == 0 && foldCompact) {
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
}
if ((levelCurrent > levelPrev) && (visibleChars > 0)) {
lev |= SC_FOLDLEVELHEADERFLAG;
}
if (lev != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, lev);
}
@@ -229,9 +256,10 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
levelPrev = levelCurrent;
visibleChars = 0;
}
if (!isspacechar(ch))
if (!isspacechar(ch)) {
visibleChars++;
}
}
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;

View File

@@ -159,21 +159,23 @@ static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
// difference starts then each line starting with ' ' is a whitespace
// otherwise it is considered a comment (Only in..., Binary file...)
if (0 == strncmp(lineBuffer, "diff ", 3)) {
styler.ColourTo(endLine, 2);
styler.ColourTo(endLine, SCE_DIFF_COMMAND);
} else if (0 == strncmp(lineBuffer, "--- ", 3)) {
styler.ColourTo(endLine, 3);
styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (0 == strncmp(lineBuffer, "+++ ", 3)) {
styler.ColourTo(endLine, 3);
styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (0 == strncmp(lineBuffer, "***", 3)) {
styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (lineBuffer[0] == '@') {
styler.ColourTo(endLine, 4);
styler.ColourTo(endLine, SCE_DIFF_POSITION);
} else if (lineBuffer[0] == '-') {
styler.ColourTo(endLine, 5);
styler.ColourTo(endLine, SCE_DIFF_DELETED);
} else if (lineBuffer[0] == '+') {
styler.ColourTo(endLine, 6);
styler.ColourTo(endLine, SCE_DIFF_ADDED);
} else if (lineBuffer[0] != ' ') {
styler.ColourTo(endLine, 1);
styler.ColourTo(endLine, SCE_DIFF_COMMENT);
} else {
styler.ColourTo(endLine, 0);
styler.ColourTo(endLine, SCE_DIFF_DEFAULT);
}
}
@@ -208,28 +210,28 @@ static void ColourisePropsLine(
i++;
if (i < lengthLine) {
if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') {
styler.ColourTo(endPos, 1);
styler.ColourTo(endPos, SCE_PROPS_COMMENT);
} else if (lineBuffer[i] == '[') {
styler.ColourTo(endPos, 2);
styler.ColourTo(endPos, SCE_PROPS_SECTION);
} else if (lineBuffer[i] == '@') {
styler.ColourTo(startLine + i, 4);
styler.ColourTo(startLine + i, SCE_PROPS_DEFVAL);
if (lineBuffer[++i] == '=')
styler.ColourTo(startLine + i, 3);
styler.ColourTo(endPos, 0);
styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
} else {
// Search for the '=' character
while ((i < lengthLine) && (lineBuffer[i] != '='))
i++;
if ((i < lengthLine) && (lineBuffer[i] == '=')) {
styler.ColourTo(startLine + i - 1, 0);
styler.ColourTo(startLine + i - 1, SCE_PROPS_DEFAULT);
styler.ColourTo(startLine + i, 3);
styler.ColourTo(endPos, 0);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
} else {
styler.ColourTo(endPos, 0);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
}
}
} else {
styler.ColourTo(endPos, 0);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
}
}
@@ -386,6 +388,8 @@ static void ColouriseErrorListLine(
state = 1;
} else if ((state == 0) && (lineBuffer[i] == '(')) {
state = 10;
} else if ((state == 0) && (lineBuffer[i] == '\t')) {
state = 20;
} else if ((state == 1) && isdigit(lineBuffer[i])) {
state = 2;
} else if ((state == 2) && (lineBuffer[i] == ':')) {
@@ -406,12 +410,22 @@ static void ColouriseErrorListLine(
break;
} else if (((state == 11) || (state == 14)) && !((lineBuffer[i] == ' ') || isdigit(lineBuffer[i]))) {
state = 99;
} else if ((state == 20) && isdigit(lineBuffer[i])) {
state = 24;
break;
} else if ((state == 20) && ((lineBuffer[i] == '/') && (lineBuffer[i+1] == '^'))) {
state = 21;
} else if ((state == 21) && ((lineBuffer[i] == '$') && (lineBuffer[i+1] == '/'))) {
state = 22;
break;
}
}
if (state == 3) {
styler.ColourTo(endPos, SCE_ERR_GCC);
} else if ((state == 13) || (state == 14) || (state == 15)) {
styler.ColourTo(endPos, SCE_ERR_MS);
} else if (((state == 22) || (state == 24)) && (lineBuffer[0] != '\t')) {
styler.ColourTo(endPos, SCE_ERR_CTAG);
} else {
styler.ColourTo(endPos, SCE_ERR_DEFAULT);
}

View File

@@ -659,4 +659,9 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(lengthDoc - 1, state);
}
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl");
static const char * const perlWordListDesc[] = {
"Perl keywords",
0
};
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl", 0, perlWordListDesc);

View File

@@ -408,4 +408,10 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
//styler.SetLevel(lineCurrent, indentCurrent);
}
LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc, "python", FoldPyDoc);
static const char * const pythonWordListDesc[] = {
"Python keywords",
0
};
LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc, "python", FoldPyDoc,
pythonWordListDesc);

View File

@@ -45,7 +45,7 @@ int CompareCaseInsensitive(const char *a, const char *b) {
return *a - *b;
}
int CompareNCaseInsensitive(const char *a, const char *b, int len) {
int CompareNCaseInsensitive(const char *a, const char *b, size_t len) {
while (*a && *b && len) {
if (*a != *b) {
char upperA = MakeUpperCase(*a);
@@ -68,7 +68,7 @@ bool EqualCaseInsensitive(const char *a, const char *b) {
return 0 == CompareCaseInsensitive(a, b);
}
inline unsigned int HashString(const char *s, int len) {
inline unsigned int HashString(const char *s, size_t len) {
unsigned int ret = 0;
while (len--) {
ret <<= 4;
@@ -93,9 +93,9 @@ void PropSet::Set(const char *key, const char *val, int lenKey, int lenVal) {
if (!*key) // Empty keys are not supported
return;
if (lenKey == -1)
lenKey = strlen(key);
lenKey = static_cast<int>(strlen(key));
if (lenVal == -1)
lenVal = strlen(val);
lenVal = static_cast<int>(strlen(val));
unsigned int hash = HashString(key, lenKey);
for (Property *p = props[hash % hashRoots]; p; p = p->next) {
if ((hash == p->hash) &&
@@ -187,7 +187,7 @@ SString PropSet::Expand(const char *withVars) {
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
char *var = StringDup(cpvar + 2, lenvar);
SString val = GetExpanded(var);
int newlenbase = strlen(base) + val.length() - lenvar;
size_t newlenbase = strlen(base) + val.length() - lenvar;
char *newbase = new char[newlenbase];
strncpy(newbase, base, cpvar - base);
strcpy(newbase + (cpvar - base), val.c_str());
@@ -224,11 +224,11 @@ bool isprefix(const char *target, const char *prefix) {
}
static bool IsSuffixCaseInsensitive(const char *target, const char *suffix) {
int lentarget = strlen(target);
int lensuffix = strlen(suffix);
size_t lentarget = strlen(target);
size_t lensuffix = strlen(suffix);
if (lensuffix > lentarget)
return false;
for (int i = lensuffix - 1; i >= 0; i--) {
for (int i = static_cast<int>(lensuffix) - 1; i >= 0; i--) {
if (MakeUpperCase(target[i + lentarget - lensuffix]) !=
MakeUpperCase(suffix[i]))
return false;
@@ -306,7 +306,7 @@ SString PropSet::GetNewExpand(const char *keybase, const char *filename) {
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
char *var = StringDup(cpvar + 2, lenvar);
SString val = GetWild(var, filename);
int newlenbase = strlen(base) + val.length() - lenvar;
size_t newlenbase = strlen(base) + val.length() - lenvar;
char *newbase = new char[newlenbase];
strncpy(newbase, base, cpvar - base);
strcpy(newbase + (cpvar - base), val.c_str());
@@ -340,7 +340,7 @@ void PropSet::Clear() {
}
char *PropSet::ToString() {
unsigned int len=0;
size_t len=0;
for (int r = 0; r < hashRoots; r++) {
for (Property *p = props[r]; p; p = p->next) {
len += strlen(p->key) + 1;
@@ -435,8 +435,8 @@ static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = fa
if (keywords) {
words = 0;
prev = '\0';
int slen = strlen(wordlist);
for (int k = 0; k < slen; k++) {
size_t slen = strlen(wordlist);
for (size_t k = 0; k < slen; k++) {
if (!iswordsep(wordlist[k], onlyLineEnds)) {
if (!prev) {
keywords[words] = &wordlist[k];

View File

@@ -30,8 +30,8 @@
* Modification history:
*
* $Log$
* Revision 1.3 2002/03/18 22:31:00 RD
* Updated wxSTC from Scintilla 1.40 to Scintilla 1.45
* Revision 1.4 2002/09/06 16:58:12 RD
* Updated to Scintilla from 1.45 to 1.47
*
* Revision 1.6 2001/04/29 13:32:10 nyamatongwe
* Addition of new target methods - versions of ReplaceTarget that take counted

View File

@@ -64,11 +64,18 @@ void ScintillaBase::RefreshColourPalette(Palette &pal, bool want) {
}
void ScintillaBase::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
bool acActiveBeforeCharAdded = ac.Active();
if (!acActiveBeforeCharAdded || !ac.IsFillUpChar(*s))
bool isFillUp = ac.Active() && ac.IsFillUpChar(*s);
if (!isFillUp) {
Editor::AddCharUTF(s, len, treatAsDBCS);
if (acActiveBeforeCharAdded)
}
if (ac.Active()) {
AutoCompleteChanged(s[0]);
// For fill ups add the character after the autocompletion has
// triggered so containers see the key so can display a calltip.
if (isFillUp) {
Editor::AddCharUTF(s, len, treatAsDBCS);
}
}
}
void ScintillaBase::Command(int cmdId) {
@@ -278,7 +285,7 @@ void ScintillaBase::AutoCompleteMoveToCurrentWord() {
void ScintillaBase::AutoCompleteChanged(char ch) {
if (ac.IsFillUpChar(ch)) {
AutoCompleteCompleted(ch);
AutoCompleteCompleted();
} else if (currentPos <= ac.posStart - ac.startLen) {
ac.Cancel();
} else if (ac.cancelAtStartPos && currentPos <= ac.posStart) {
@@ -290,7 +297,7 @@ void ScintillaBase::AutoCompleteChanged(char ch) {
}
}
void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
void ScintillaBase::AutoCompleteCompleted() {
int item = ac.lb.GetSelection();
char selected[1000];
if (item != -1) {
@@ -323,8 +330,6 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
SetEmptySelection(ac.posStart);
if (item != -1) {
SString piece = selected;
if (fillUp)
piece += fillUp;
pdoc->InsertString(firstPos, piece.c_str());
SetEmptySelection(firstPos + piece.length());
}
@@ -332,6 +337,7 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
}
void ScintillaBase::ContextMenu(Point pt) {
if (displayPopupMenu) {
bool writable = !WndProc(SCI_GETREADONLY, 0, 0);
popup.CreatePopUp();
AddToPopUp("Undo", idcmdUndo, writable && pdoc->CanUndo());
@@ -344,6 +350,7 @@ void ScintillaBase::ContextMenu(Point pt) {
AddToPopUp("");
AddToPopUp("Select All", idcmdSelectAll);
popup.Show(pt, wMain);
}
}
void ScintillaBase::CancelModes() {

View File

@@ -66,7 +66,7 @@ protected:
void AutoCompleteCancel();
void AutoCompleteMove(int delta);
void AutoCompleteChanged(char ch=0);
void AutoCompleteCompleted(char fillUp='\0');
void AutoCompleteCompleted();
void AutoCompleteMoveToCurrentWord();
static void AutoCompleteDoubleClick(void* p);

View File

@@ -144,6 +144,10 @@ inline bool IsASpace(unsigned int ch) {
return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
}
inline bool IsASpaceOrTab(unsigned int ch) {
return (ch == ' ') || (ch == '\t');
}
inline bool IsADigit(unsigned int ch) {
return (ch >= '0') && (ch <= '9');
}

View File

@@ -42,7 +42,16 @@ void WindowAccessor::Fill(int position) {
endPos = lenDoc;
TextRange tr = {{startPos, endPos}, buf};
Platform::SendScintilla(id, SCI_GETTEXTRANGE, 0, reinterpret_cast<long>(&tr));
Platform::SendScintillaPointer(id, SCI_GETTEXTRANGE, 0, &tr);
}
bool WindowAccessor::Match(int pos, const char *s) {
for (int i=0; *s; i++) {
if (*s != SafeGetCharAt(pos+i))
return false;
s++;
}
return true;
}
char WindowAccessor::StyleAt(int position) {
@@ -116,8 +125,8 @@ void WindowAccessor::Flush() {
startPos = extremePosition;
lenDoc = -1;
if (validLen > 0) {
Platform::SendScintilla(id, SCI_SETSTYLINGEX, validLen,
reinterpret_cast<long>(styleBuf));
Platform::SendScintillaPointer(id, SCI_SETSTYLINGEX, validLen,
styleBuf);
validLen = 0;
}
}

View File

@@ -81,6 +81,7 @@ DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
@@ -117,7 +118,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent, wxCommandEvent)
#ifdef LINK_LEXERS
// forces the linking of the lexer modules
int wxForceScintillaLexers();
int Scintilla_LinkLexers();
#endif
//----------------------------------------------------------------------
@@ -134,7 +135,7 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
wxDefaultValidator, name)
{
#ifdef LINK_LEXERS
wxForceScintillaLexers();
Scintilla_LinkLexers();
#endif
m_swx = new ScintillaWX(this);
m_stopWatch.Start();
@@ -168,58 +169,58 @@ long wxStyledTextCtrl::SendMsg(int msg, long wp, long lp) {
// this file. Edit stc.cpp.in or gen_iface.py instead and regenerate.
// Add text to the document
// Add text to the document.
void wxStyledTextCtrl::AddText(const wxString& text) {
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
SendMsg(2001, strlen(buf), (long)(const char*)buf);
}
// Add array of cells to document
// Add array of cells to document.
void wxStyledTextCtrl::AddStyledText(const wxMemoryBuffer& data) {
SendMsg(2002, data.GetDataLen(), (long)data.GetData());
}
// Insert string at a position
// Insert string at a position.
void wxStyledTextCtrl::InsertText(int pos, const wxString& text) {
SendMsg(2003, pos, (long)(const char*)wx2stc(text));
}
// Delete all text in the document
// Delete all text in the document.
void wxStyledTextCtrl::ClearAll() {
SendMsg(2004, 0, 0);
}
// Set all style bytes to 0, remove all folding information
// Set all style bytes to 0, remove all folding information.
void wxStyledTextCtrl::ClearDocumentStyle() {
SendMsg(2005, 0, 0);
}
// The number of characters in the document
// The number of characters in the document.
int wxStyledTextCtrl::GetLength() {
return SendMsg(2006, 0, 0);
}
// Returns the character byte at the position
// Returns the character byte at the position.
int wxStyledTextCtrl::GetCharAt(int pos) {
return (unsigned char)SendMsg(2007, pos, 0);
}
// Returns the position of the caret
// Returns the position of the caret.
int wxStyledTextCtrl::GetCurrentPos() {
return SendMsg(2008, 0, 0);
}
// Returns the position of the opposite end of the selection to the caret
// Returns the position of the opposite end of the selection to the caret.
int wxStyledTextCtrl::GetAnchor() {
return SendMsg(2009, 0, 0);
}
// Returns the style byte at the position
// Returns the style byte at the position.
int wxStyledTextCtrl::GetStyleAt(int pos) {
return (unsigned char)SendMsg(2010, pos, 0);
}
// Redoes the next action on the undo history
// Redoes the next action on the undo history.
void wxStyledTextCtrl::Redo() {
SendMsg(2011, 0, 0);
}
@@ -260,12 +261,12 @@ wxMemoryBuffer wxStyledTextCtrl::GetStyledText(int startPos, int endPos) {
return buf;
}
// Are there any redoable actions in the undo history.
// Are there any redoable actions in the undo history?
bool wxStyledTextCtrl::CanRedo() {
return SendMsg(2016, 0, 0) != 0;
}
// Retrieve the line number at which a particular marker is located
// Retrieve the line number at which a particular marker is located.
int wxStyledTextCtrl::MarkerLineFromHandle(int handle) {
return SendMsg(2017, handle, 0);
}
@@ -358,8 +359,7 @@ void wxStyledTextCtrl::SetEOLMode(int eolMode) {
}
// Set the current styling position to pos and the styling mask to mask.
// The styling mask can be used to protect some bits in each styling byte from
// modification.
// The styling mask can be used to protect some bits in each styling byte from modification.
void wxStyledTextCtrl::StartStyling(int pos, int mask) {
SendMsg(2032, pos, mask);
}
@@ -370,7 +370,7 @@ void wxStyledTextCtrl::SetStyling(int length, int style) {
SendMsg(2033, length, style);
}
// Is drawing done first into a buffer or direct to the screen.
// Is drawing done first into a buffer or direct to the screen?
bool wxStyledTextCtrl::GetBufferedDraw() {
return SendMsg(2034, 0, 0) != 0;
}
@@ -381,8 +381,7 @@ void wxStyledTextCtrl::SetBufferedDraw(bool buffered) {
SendMsg(2035, buffered, 0);
}
// Change the visible size of a tab to be a multiple of the width of a space
// character.
// Change the visible size of a tab to be a multiple of the width of a space character.
void wxStyledTextCtrl::SetTabWidth(int tabWidth) {
SendMsg(2036, tabWidth, 0);
}
@@ -432,12 +431,12 @@ int wxStyledTextCtrl::MarkerAdd(int line, int markerNumber) {
return SendMsg(2043, line, markerNumber);
}
// Delete a marker from a line
// Delete a marker from a line.
void wxStyledTextCtrl::MarkerDelete(int line, int markerNumber) {
SendMsg(2044, line, markerNumber);
}
// Delete all markers with a particular number from all lines
// Delete all markers with a particular number from all lines.
void wxStyledTextCtrl::MarkerDeleteAll(int markerNumber) {
SendMsg(2045, markerNumber, 0);
}
@@ -607,8 +606,7 @@ void wxStyledTextCtrl::SetCaretPeriod(int periodMilliseconds) {
SendMsg(2076, periodMilliseconds, 0);
}
// Set the set of characters making up words for when moving or selecting
// by word.
// Set the set of characters making up words for when moving or selecting by word.
void wxStyledTextCtrl::SetWordChars(const wxString& characters) {
SendMsg(2077, 0, (long)(const char*)wx2stc(characters));
}
@@ -645,8 +643,8 @@ wxColour wxStyledTextCtrl::IndicatorGetForeground(int indic) {
return wxColourFromLong(c);
}
// Divide each styling byte into lexical class bits (default:5) and indicator
// bits (default:3). If a lexer requires more than 32 lexical states, then this
// Divide each styling byte into lexical class bits (default: 5) and indicator
// bits (default: 3). If a lexer requires more than 32 lexical states, then this
// is used to expand the possible states.
void wxStyledTextCtrl::SetStyleBits(int bits) {
SendMsg(2090, bits, 0);
@@ -677,7 +675,7 @@ bool wxStyledTextCtrl::GetCaretLineVisible() {
return SendMsg(2095, 0, 0) != 0;
}
// Dsplay the background of the line containing the caret in a different colour.
// Display the background of the line containing the caret in a different colour.
void wxStyledTextCtrl::SetCaretLineVisible(bool show) {
SendMsg(2096, show, 0);
}
@@ -716,8 +714,7 @@ bool wxStyledTextCtrl::AutoCompActive() {
return SendMsg(2102, 0, 0) != 0;
}
// Retrieve the position of the caret when the auto-completion list was
// displayed.
// Retrieve the position of the caret when the auto-completion list was displayed.
int wxStyledTextCtrl::AutoCompPosStart() {
return SendMsg(2103, 0, 0);
}
@@ -732,8 +729,8 @@ void wxStyledTextCtrl::AutoCompStops(const wxString& characterSet) {
SendMsg(2105, 0, (long)(const char*)wx2stc(characterSet));
}
// Change the separator character in the string setting up an auto-completion
// list. Default is space but can be changed if items contain space.
// Change the separator character in the string setting up an auto-completion list.
// Default is space but can be changed if items contain space.
void wxStyledTextCtrl::AutoCompSetSeparator(int separatorCharacter) {
SendMsg(2106, separatorCharacter, 0);
}
@@ -790,22 +787,24 @@ void wxStyledTextCtrl::UserListShow(int listType, const wxString& itemList) {
SendMsg(2117, listType, (long)(const char*)wx2stc(itemList));
}
// Set whether or not autocompletion is hidden automatically when nothing matches
// Set whether or not autocompletion is hidden automatically when nothing matches.
void wxStyledTextCtrl::AutoCompSetAutoHide(bool autoHide) {
SendMsg(2118, autoHide, 0);
}
// Retrieve whether or not autocompletion is hidden automatically when nothing matches
// Retrieve whether or not autocompletion is hidden automatically when nothing matches.
bool wxStyledTextCtrl::AutoCompGetAutoHide() {
return SendMsg(2119, 0, 0) != 0;
}
// Set whether or not autocompletion deletes any word characters after the inserted text upon completion
// Set whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
void wxStyledTextCtrl::AutoCompSetDropRestOfWord(bool dropRestOfWord) {
SendMsg(2270, dropRestOfWord, 0);
}
// Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion
// Retrieve whether or not autocompletion deletes any word characters
// after the inserted text upon completion.
bool wxStyledTextCtrl::AutoCompGetDropRestOfWord() {
return SendMsg(2271, 0, 0) != 0;
}
@@ -961,7 +960,7 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos,
return SendMsg(2150, flags, (long)&ft);
}
// On Windows will draw the document into a display context such as a printer.
// On Windows, will draw the document into a display context such as a printer.
int wxStyledTextCtrl::FormatRange(bool doDraw,
int startPos,
int endPos,
@@ -1123,7 +1122,7 @@ bool wxStyledTextCtrl::CanPaste() {
return SendMsg(2173, 0, 0) != 0;
}
// Are there any undoable actions in the undo history.
// Are there any undoable actions in the undo history?
bool wxStyledTextCtrl::CanUndo() {
return SendMsg(2174, 0, 0) != 0;
}
@@ -1179,7 +1178,7 @@ int wxStyledTextCtrl::GetTextLength() {
return SendMsg(2183, 0, 0);
}
// Set to overtype (true) or insert mode
// Set to overtype (true) or insert mode.
void wxStyledTextCtrl::SetOvertype(bool overtype) {
SendMsg(2186, overtype, 0);
}
@@ -1189,12 +1188,12 @@ bool wxStyledTextCtrl::GetOvertype() {
return SendMsg(2187, 0, 0) != 0;
}
// Set the width of the insert mode caret
// Set the width of the insert mode caret.
void wxStyledTextCtrl::SetCaretWidth(int pixelWidth) {
SendMsg(2188, pixelWidth, 0);
}
// Returns the width of the insert mode caret
// Returns the width of the insert mode caret.
int wxStyledTextCtrl::GetCaretWidth() {
return SendMsg(2189, 0, 0);
}
@@ -1251,12 +1250,12 @@ int wxStyledTextCtrl::GetTargetEnd() {
return SendMsg(2197, strlen(buf), (long)(const char*)buf);
}
// Set the search flags used by SearchInTarget
// Set the search flags used by SearchInTarget.
void wxStyledTextCtrl::SetSearchFlags(int flags) {
SendMsg(2198, flags, 0);
}
// Get the search flags used by SearchInTarget
// Get the search flags used by SearchInTarget.
int wxStyledTextCtrl::GetSearchFlags() {
return SendMsg(2199, 0, 0);
}
@@ -1358,7 +1357,7 @@ void wxStyledTextCtrl::EnsureVisible(int line) {
SendMsg(2232, line, 0);
}
// Set some debugging options for folding
// Set some debugging options for folding.
void wxStyledTextCtrl::SetFoldFlags(int flags) {
SendMsg(2233, flags, 0);
}
@@ -1369,7 +1368,7 @@ void wxStyledTextCtrl::EnsureVisibleEnforcePolicy(int line) {
SendMsg(2234, line, 0);
}
// Sets whether a tab pressed when caret is within indentation indents
// Sets whether a tab pressed when caret is within indentation indents.
void wxStyledTextCtrl::SetTabIndents(bool tabIndents) {
SendMsg(2260, tabIndents, 0);
}
@@ -1379,7 +1378,7 @@ bool wxStyledTextCtrl::GetTabIndents() {
return SendMsg(2261, 0, 0) != 0;
}
// Sets whether a backspace pressed when caret is within indentation unindents
// Sets whether a backspace pressed when caret is within indentation unindents.
void wxStyledTextCtrl::SetBackSpaceUnIndents(bool bsUnIndents) {
SendMsg(2262, bsUnIndents, 0);
}
@@ -1389,52 +1388,87 @@ bool wxStyledTextCtrl::GetBackSpaceUnIndents() {
return SendMsg(2263, 0, 0) != 0;
}
// Sets the time the mouse must sit still to generate a mouse dwell event
// Sets the time the mouse must sit still to generate a mouse dwell event.
void wxStyledTextCtrl::SetMouseDwellTime(int periodMilliseconds) {
SendMsg(2264, periodMilliseconds, 0);
}
// Retrieve the time the mouse must sit still to generate a mouse dwell event
// Retrieve the time the mouse must sit still to generate a mouse dwell event.
int wxStyledTextCtrl::GetMouseDwellTime() {
return SendMsg(2265, 0, 0);
}
// Get position of start of word
// Get position of start of word.
int wxStyledTextCtrl::WordStartPosition(int pos, bool onlyWordCharacters) {
return SendMsg(2266, pos, onlyWordCharacters);
}
// Get position of end of word
// Get position of end of word.
int wxStyledTextCtrl::WordEndPosition(int pos, bool onlyWordCharacters) {
return SendMsg(2267, pos, onlyWordCharacters);
}
// Sets whether text is word wrapped
// Sets whether text is word wrapped.
void wxStyledTextCtrl::SetWrapMode(int mode) {
SendMsg(2268, mode, 0);
}
// Retrieve whether text is word wrapped
// Retrieve whether text is word wrapped.
int wxStyledTextCtrl::GetWrapMode() {
return SendMsg(2269, 0, 0);
}
// Sets the degree of caching of layout information
// Sets the degree of caching of layout information.
void wxStyledTextCtrl::SetLayoutCache(int mode) {
SendMsg(2272, mode, 0);
}
// Retrieve the degree of caching of layout information
// Retrieve the degree of caching of layout information.
int wxStyledTextCtrl::GetLayoutCache() {
return SendMsg(2273, 0, 0);
}
// Move the caret inside current view if it's not there already
// Sets the document width assumed for scrolling.
void wxStyledTextCtrl::SetScrollWidth(int pixelWidth) {
SendMsg(2274, pixelWidth, 0);
}
// Retrieve the document width assumed for scrolling.
int wxStyledTextCtrl::GetScrollWidth() {
return SendMsg(2275, 0, 0);
}
// Measure the pixel width of some text in a particular style.
// Nul terminated text argument.
// Does not handle tab or control characters.
int wxStyledTextCtrl::TextWidth(int style, const wxString& text) {
return SendMsg(2276, style, (long)(const char*)wx2stc(text));
}
// Sets the scroll range so that maximum scroll position has
// the last line at the bottom of the view (default).
// Setting this to false allows scrolling one page below the last line.
void wxStyledTextCtrl::SetEndAtLastLine(bool endAtLastLine) {
SendMsg(2277, endAtLastLine, 0);
}
// Retrieve whether the maximum scroll position has the last
// line at the bottom of the view.
int wxStyledTextCtrl::GetEndAtLastLine() {
return SendMsg(2278, 0, 0);
}
// Retrieve the height of a particular line of text in pixels.
int wxStyledTextCtrl::TextHeight(int line) {
return SendMsg(2279, line, 0);
}
// Move the caret inside current view if it's not there already.
void wxStyledTextCtrl::MoveCaretInsideView() {
SendMsg(2401, 0, 0);
}
// How many characters are on a line, not including end of line characters.
// How many characters are on a line, not including end of line characters?
int wxStyledTextCtrl::LineLength(int line) {
return SendMsg(2350, line, 0);
}
@@ -1454,12 +1488,12 @@ int wxStyledTextCtrl::BraceMatch(int pos) {
return SendMsg(2353, pos, 0);
}
// Are the end of line characters visible.
// Are the end of line characters visible?
bool wxStyledTextCtrl::GetViewEOL() {
return SendMsg(2355, 0, 0) != 0;
}
// Make the end of line characters visible or invisible
// Make the end of line characters visible or invisible.
void wxStyledTextCtrl::SetViewEOL(bool visible) {
SendMsg(2356, visible, 0);
}
@@ -1529,11 +1563,6 @@ int wxStyledTextCtrl::SearchPrev(int flags, const wxString& text) {
return SendMsg(2368, flags, (long)(const char*)wx2stc(text));
}
// Set the way the line the caret is on is kept visible.
void wxStyledTextCtrl::SetCaretPolicy(int caretPolicy, int caretSlop) {
SendMsg(2369, caretPolicy, caretSlop);
}
// Retrieves the number of lines completely visible.
int wxStyledTextCtrl::LinesOnScreen() {
return SendMsg(2370, 0, 0);
@@ -1545,7 +1574,7 @@ void wxStyledTextCtrl::UsePopUp(bool allowPopUp) {
SendMsg(2371, allowPopUp, 0);
}
// Is the selection a rectangular. The alternative is the more common stream selection.
// Is the selection rectangular? The alternative is the more common stream selection.
bool wxStyledTextCtrl::SelectionIsRectangle() {
return SendMsg(2372, 0, 0) != 0;
}
@@ -1582,93 +1611,96 @@ int wxStyledTextCtrl::GetModEventMask() {
return SendMsg(2378, 0, 0);
}
// Change internal focus flag
// Change internal focus flag.
void wxStyledTextCtrl::SetSTCFocus(bool focus) {
SendMsg(2380, focus, 0);
}
// Get internal focus flag
// Get internal focus flag.
bool wxStyledTextCtrl::GetSTCFocus() {
return SendMsg(2381, 0, 0) != 0;
}
// Change error status - 0 = OK
// Change error status - 0 = OK.
void wxStyledTextCtrl::SetStatus(int statusCode) {
SendMsg(2382, statusCode, 0);
}
// Get error status
// Get error status.
int wxStyledTextCtrl::GetStatus() {
return SendMsg(2383, 0, 0);
}
// Set whether the mouse is captured when its button is pressed
// Set whether the mouse is captured when its button is pressed.
void wxStyledTextCtrl::SetMouseDownCaptures(bool captures) {
SendMsg(2384, captures, 0);
}
// Get whether mouse gets captured
// Get whether mouse gets captured.
bool wxStyledTextCtrl::GetMouseDownCaptures() {
return SendMsg(2385, 0, 0) != 0;
}
// Sets the cursor to one of the SC_CURSOR* values
// Sets the cursor to one of the SC_CURSOR* values.
void wxStyledTextCtrl::SetCursor(int cursorType) {
SendMsg(2386, cursorType, 0);
}
// Get cursor type
// Get cursor type.
int wxStyledTextCtrl::GetCursor() {
return SendMsg(2387, 0, 0);
}
// Change the way control characters are displayed:
// If symbol is < 32, keep the drawn way, else, use the given character
// If symbol is < 32, keep the drawn way, else, use the given character.
void wxStyledTextCtrl::SetControlCharSymbol(int symbol) {
SendMsg(2388, symbol, 0);
}
// Get the way control characters are displayed
// Get the way control characters are displayed.
int wxStyledTextCtrl::GetControlCharSymbol() {
return SendMsg(2389, 0, 0);
}
// Move to the previous change in capitalistion
// Move to the previous change in capitalisation.
void wxStyledTextCtrl::WordPartLeft() {
SendMsg(2390, 0, 0);
}
// Move to the previous change in capitalistion extending selection to new caret position.
// Move to the previous change in capitalisation extending selection
// to new caret position.
void wxStyledTextCtrl::WordPartLeftExtend() {
SendMsg(2391, 0, 0);
}
// Move to the change next in capitalistion
// Move to the change next in capitalisation.
void wxStyledTextCtrl::WordPartRight() {
SendMsg(2392, 0, 0);
}
// Move to the next change in capitalistion extending selection to new caret position.
// Move to the next change in capitalisation extending selection
// to new caret position.
void wxStyledTextCtrl::WordPartRightExtend() {
SendMsg(2393, 0, 0);
}
// Set the way the display area is determined when a particular line is to be moved to.
// Set the way the display area is determined when a particular line
// is to be moved to by Find, FindNext, GotoLine, etc.
void wxStyledTextCtrl::SetVisiblePolicy(int visiblePolicy, int visibleSlop) {
SendMsg(2394, visiblePolicy, visibleSlop);
}
// Delete back from the current position to the start of the line
// Delete back from the current position to the start of the line.
void wxStyledTextCtrl::DelLineLeft() {
SendMsg(2395, 0, 0);
}
// Delete forwards from the current position to the end of the line
// Delete forwards from the current position to the end of the line.
void wxStyledTextCtrl::DelLineRight() {
SendMsg(2396, 0, 0);
}
// Get and Set the xOffset (ie, horizonal scroll position)
// Get and Set the xOffset (ie, horizonal scroll position).
void wxStyledTextCtrl::SetXOffset(int newOffset) {
SendMsg(2397, newOffset, 0);
}
@@ -1676,6 +1708,18 @@ int wxStyledTextCtrl::GetXOffset() {
return SendMsg(2398, 0, 0);
}
// Set the way the caret is kept visible when going sideway.
// The exclusion zone is given in pixels.
void wxStyledTextCtrl::SetXCaretPolicy(int caretPolicy, int caretSlop) {
SendMsg(2402, caretPolicy, caretSlop);
}
// Set the way the line the caret is on is kept visible.
// The exclusion zone is given in lines.
void wxStyledTextCtrl::SetYCaretPolicy(int caretPolicy, int caretSlop) {
SendMsg(2403, caretPolicy, caretSlop);
}
// Start notifying the container of all key presses and commands.
void wxStyledTextCtrl::StartRecord() {
SendMsg(3001, 0, 0);
@@ -2104,6 +2148,10 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
evt.SetY(scn.y);
break;
case SCN_ZOOM:
evt.SetEventType(wxEVT_STC_ZOOM);
break;
default:
return;
}

View File

@@ -81,6 +81,7 @@ DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
@@ -117,7 +118,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent, wxCommandEvent)
#ifdef LINK_LEXERS
// forces the linking of the lexer modules
int wxForceScintillaLexers();
int Scintilla_LinkLexers();
#endif
//----------------------------------------------------------------------
@@ -134,7 +135,7 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
wxDefaultValidator, name)
{
#ifdef LINK_LEXERS
wxForceScintillaLexers();
Scintilla_LinkLexers();
#endif
m_swx = new ScintillaWX(this);
m_stopWatch.Start();
@@ -557,6 +558,10 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
evt.SetY(scn.y);
break;
case SCN_ZOOM:
evt.SetEventType(wxEVT_STC_ZOOM);
break;
default:
return;
}

View File

@@ -338,6 +338,7 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, 1669)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
END_DECLARE_EVENT_TYPES()
#else
enum {
@@ -363,6 +364,7 @@ END_DECLARE_EVENT_TYPES()
wxEVT_STC_START_DRAG,
wxEVT_STC_DRAG_OVER,
wxEVT_STC_DO_DROP,
wxEVT_STC_ZOOM,
};
#endif
@@ -393,6 +395,7 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#endif
//----------------------------------------------------------------------

View File

@@ -33,7 +33,8 @@ Updated XRCed from Roman Rolinsky
Added wxBufferedDC.
Upgraded wxSTC from Scintilla 1.40 to Scintilla 1.45
Upgraded wxSTC from Scintilla 1.40 to Scintilla 1.45, and then again
to version 1.47.
UNICODE!
wxWindows/wxPython can be compiled with unicode support enabled or

View File

@@ -6947,6 +6947,191 @@ static PyObject *_wrap_wxStyledTextCtrl_GetLayoutCache(PyObject *self, PyObject
return _resultobj;
}
#define wxStyledTextCtrl_SetScrollWidth(_swigobj,_swigarg0) (_swigobj->SetScrollWidth(_swigarg0))
static PyObject *_wrap_wxStyledTextCtrl_SetScrollWidth(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxStyledTextCtrl * _arg0;
int _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","pixelWidth", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxStyledTextCtrl_SetScrollWidth",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetScrollWidth. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxStyledTextCtrl_SetScrollWidth(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxStyledTextCtrl_GetScrollWidth(_swigobj) (_swigobj->GetScrollWidth())
static PyObject *_wrap_wxStyledTextCtrl_GetScrollWidth(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
int _result;
wxStyledTextCtrl * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStyledTextCtrl_GetScrollWidth",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_GetScrollWidth. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (int )wxStyledTextCtrl_GetScrollWidth(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxStyledTextCtrl_TextWidth(_swigobj,_swigarg0,_swigarg1) (_swigobj->TextWidth(_swigarg0,_swigarg1))
static PyObject *_wrap_wxStyledTextCtrl_TextWidth(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
int _result;
wxStyledTextCtrl * _arg0;
int _arg1;
wxString * _arg2;
PyObject * _argo0 = 0;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","style","text", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_TextWidth",_kwnames,&_argo0,&_arg1,&_obj2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_TextWidth. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
_arg2 = wxString_in_helper(_obj2);
if (_arg2 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (int )wxStyledTextCtrl_TextWidth(_arg0,_arg1,*_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
{
if (_obj2)
delete _arg2;
}
return _resultobj;
}
#define wxStyledTextCtrl_SetEndAtLastLine(_swigobj,_swigarg0) (_swigobj->SetEndAtLastLine(_swigarg0))
static PyObject *_wrap_wxStyledTextCtrl_SetEndAtLastLine(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxStyledTextCtrl * _arg0;
bool _arg1;
PyObject * _argo0 = 0;
int tempbool1;
char *_kwnames[] = { "self","endAtLastLine", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxStyledTextCtrl_SetEndAtLastLine",_kwnames,&_argo0,&tempbool1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetEndAtLastLine. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxStyledTextCtrl_SetEndAtLastLine(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxStyledTextCtrl_GetEndAtLastLine(_swigobj) (_swigobj->GetEndAtLastLine())
static PyObject *_wrap_wxStyledTextCtrl_GetEndAtLastLine(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
int _result;
wxStyledTextCtrl * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStyledTextCtrl_GetEndAtLastLine",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_GetEndAtLastLine. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (int )wxStyledTextCtrl_GetEndAtLastLine(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxStyledTextCtrl_TextHeight(_swigobj,_swigarg0) (_swigobj->TextHeight(_swigarg0))
static PyObject *_wrap_wxStyledTextCtrl_TextHeight(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
int _result;
wxStyledTextCtrl * _arg0;
int _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","line", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxStyledTextCtrl_TextHeight",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_TextHeight. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (int )wxStyledTextCtrl_TextHeight(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxStyledTextCtrl_MoveCaretInsideView(_swigobj) (_swigobj->MoveCaretInsideView())
static PyObject *_wrap_wxStyledTextCtrl_MoveCaretInsideView(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -7540,36 +7725,6 @@ static PyObject *_wrap_wxStyledTextCtrl_SearchPrev(PyObject *self, PyObject *arg
return _resultobj;
}
#define wxStyledTextCtrl_SetCaretPolicy(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetCaretPolicy(_swigarg0,_swigarg1))
static PyObject *_wrap_wxStyledTextCtrl_SetCaretPolicy(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxStyledTextCtrl * _arg0;
int _arg1;
int _arg2;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","caretPolicy","caretSlop", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxStyledTextCtrl_SetCaretPolicy",_kwnames,&_argo0,&_arg1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetCaretPolicy. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxStyledTextCtrl_SetCaretPolicy(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxStyledTextCtrl_LinesOnScreen(_swigobj) (_swigobj->LinesOnScreen())
static PyObject *_wrap_wxStyledTextCtrl_LinesOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -8395,6 +8550,66 @@ static PyObject *_wrap_wxStyledTextCtrl_GetXOffset(PyObject *self, PyObject *arg
return _resultobj;
}
#define wxStyledTextCtrl_SetXCaretPolicy(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetXCaretPolicy(_swigarg0,_swigarg1))
static PyObject *_wrap_wxStyledTextCtrl_SetXCaretPolicy(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxStyledTextCtrl * _arg0;
int _arg1;
int _arg2;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","caretPolicy","caretSlop", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxStyledTextCtrl_SetXCaretPolicy",_kwnames,&_argo0,&_arg1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetXCaretPolicy. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxStyledTextCtrl_SetXCaretPolicy(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxStyledTextCtrl_SetYCaretPolicy(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetYCaretPolicy(_swigarg0,_swigarg1))
static PyObject *_wrap_wxStyledTextCtrl_SetYCaretPolicy(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxStyledTextCtrl * _arg0;
int _arg1;
int _arg2;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","caretPolicy","caretSlop", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxStyledTextCtrl_SetYCaretPolicy",_kwnames,&_argo0,&_arg1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetYCaretPolicy. Expected _wxStyledTextCtrl_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxStyledTextCtrl_SetYCaretPolicy(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxStyledTextCtrl_StartRecord(_swigobj) (_swigobj->StartRecord())
static PyObject *_wrap_wxStyledTextCtrl_StartRecord(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -10632,6 +10847,8 @@ static PyMethodDef stc_cMethods[] = {
{ "wxStyledTextCtrl_SetLexer", (PyCFunction) _wrap_wxStyledTextCtrl_SetLexer, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_StopRecord", (PyCFunction) _wrap_wxStyledTextCtrl_StopRecord, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_StartRecord", (PyCFunction) _wrap_wxStyledTextCtrl_StartRecord, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SetYCaretPolicy", (PyCFunction) _wrap_wxStyledTextCtrl_SetYCaretPolicy, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SetXCaretPolicy", (PyCFunction) _wrap_wxStyledTextCtrl_SetXCaretPolicy, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_GetXOffset", (PyCFunction) _wrap_wxStyledTextCtrl_GetXOffset, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SetXOffset", (PyCFunction) _wrap_wxStyledTextCtrl_SetXOffset, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_DelLineRight", (PyCFunction) _wrap_wxStyledTextCtrl_DelLineRight, METH_VARARGS | METH_KEYWORDS },
@@ -10660,7 +10877,6 @@ static PyMethodDef stc_cMethods[] = {
{ "wxStyledTextCtrl_SelectionIsRectangle", (PyCFunction) _wrap_wxStyledTextCtrl_SelectionIsRectangle, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_UsePopUp", (PyCFunction) _wrap_wxStyledTextCtrl_UsePopUp, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_LinesOnScreen", (PyCFunction) _wrap_wxStyledTextCtrl_LinesOnScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SetCaretPolicy", (PyCFunction) _wrap_wxStyledTextCtrl_SetCaretPolicy, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SearchPrev", (PyCFunction) _wrap_wxStyledTextCtrl_SearchPrev, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SearchNext", (PyCFunction) _wrap_wxStyledTextCtrl_SearchNext, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SearchAnchor", (PyCFunction) _wrap_wxStyledTextCtrl_SearchAnchor, METH_VARARGS | METH_KEYWORDS },
@@ -10680,6 +10896,12 @@ static PyMethodDef stc_cMethods[] = {
{ "wxStyledTextCtrl_BraceHighlight", (PyCFunction) _wrap_wxStyledTextCtrl_BraceHighlight, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_LineLength", (PyCFunction) _wrap_wxStyledTextCtrl_LineLength, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_MoveCaretInsideView", (PyCFunction) _wrap_wxStyledTextCtrl_MoveCaretInsideView, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_TextHeight", (PyCFunction) _wrap_wxStyledTextCtrl_TextHeight, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_GetEndAtLastLine", (PyCFunction) _wrap_wxStyledTextCtrl_GetEndAtLastLine, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SetEndAtLastLine", (PyCFunction) _wrap_wxStyledTextCtrl_SetEndAtLastLine, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_TextWidth", (PyCFunction) _wrap_wxStyledTextCtrl_TextWidth, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_GetScrollWidth", (PyCFunction) _wrap_wxStyledTextCtrl_GetScrollWidth, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SetScrollWidth", (PyCFunction) _wrap_wxStyledTextCtrl_SetScrollWidth, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_GetLayoutCache", (PyCFunction) _wrap_wxStyledTextCtrl_GetLayoutCache, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_SetLayoutCache", (PyCFunction) _wrap_wxStyledTextCtrl_SetLayoutCache, METH_VARARGS | METH_KEYWORDS },
{ "wxStyledTextCtrl_GetWrapMode", (PyCFunction) _wrap_wxStyledTextCtrl_GetWrapMode, METH_VARARGS | METH_KEYWORDS },
@@ -11188,15 +11410,14 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_EDGE_NONE", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_EDGE_LINE", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_EDGE_BACKGROUND", PyInt_FromLong((long) 2));
PyDict_SetItemString(d,"wxSTC_CARET_SLOP", PyInt_FromLong((long) 0x01));
PyDict_SetItemString(d,"wxSTC_CARET_CENTER", PyInt_FromLong((long) 0x02));
PyDict_SetItemString(d,"wxSTC_CARET_STRICT", PyInt_FromLong((long) 0x04));
PyDict_SetItemString(d,"wxSTC_CARET_XEVEN", PyInt_FromLong((long) 0x08));
PyDict_SetItemString(d,"wxSTC_CARET_XJUMPS", PyInt_FromLong((long) 0x10));
PyDict_SetItemString(d,"wxSTC_CURSORNORMAL", PyInt_FromLong((long) -1));
PyDict_SetItemString(d,"wxSTC_CURSORWAIT", PyInt_FromLong((long) 3));
PyDict_SetItemString(d,"wxSTC_VISIBLE_SLOP", PyInt_FromLong((long) 0x01));
PyDict_SetItemString(d,"wxSTC_VISIBLE_STRICT", PyInt_FromLong((long) 0x04));
PyDict_SetItemString(d,"wxSTC_CARET_SLOP", PyInt_FromLong((long) 0x01));
PyDict_SetItemString(d,"wxSTC_CARET_STRICT", PyInt_FromLong((long) 0x04));
PyDict_SetItemString(d,"wxSTC_CARET_JUMPS", PyInt_FromLong((long) 0x10));
PyDict_SetItemString(d,"wxSTC_CARET_EVEN", PyInt_FromLong((long) 0x08));
PyDict_SetItemString(d,"wxSTC_MOD_INSERTTEXT", PyInt_FromLong((long) 0x1));
PyDict_SetItemString(d,"wxSTC_MOD_DELETETEXT", PyInt_FromLong((long) 0x2));
PyDict_SetItemString(d,"wxSTC_MOD_CHANGESTYLE", PyInt_FromLong((long) 0x4));
@@ -11262,6 +11483,7 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_LEX_PHP", PyInt_FromLong((long) 30));
PyDict_SetItemString(d,"wxSTC_LEX_BAAN", PyInt_FromLong((long) 31));
PyDict_SetItemString(d,"wxSTC_LEX_MATLAB", PyInt_FromLong((long) 32));
PyDict_SetItemString(d,"wxSTC_LEX_SCRIPTOL", PyInt_FromLong((long) 33));
PyDict_SetItemString(d,"wxSTC_LEX_AUTOMATIC", PyInt_FromLong((long) 1000));
PyDict_SetItemString(d,"wxSTC_P_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_P_COMMENTLINE", PyInt_FromLong((long) 1));
@@ -11296,15 +11518,6 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_C_WORD2", PyInt_FromLong((long) 16));
PyDict_SetItemString(d,"wxSTC_C_COMMENTDOCKEYWORD", PyInt_FromLong((long) 17));
PyDict_SetItemString(d,"wxSTC_C_COMMENTDOCKEYWORDERROR", PyInt_FromLong((long) 18));
PyDict_SetItemString(d,"wxSTC_B_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_B_COMMENT", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_B_NUMBER", PyInt_FromLong((long) 2));
PyDict_SetItemString(d,"wxSTC_B_KEYWORD", PyInt_FromLong((long) 3));
PyDict_SetItemString(d,"wxSTC_B_STRING", PyInt_FromLong((long) 4));
PyDict_SetItemString(d,"wxSTC_B_PREPROCESSOR", PyInt_FromLong((long) 5));
PyDict_SetItemString(d,"wxSTC_B_OPERATOR", PyInt_FromLong((long) 6));
PyDict_SetItemString(d,"wxSTC_B_IDENTIFIER", PyInt_FromLong((long) 7));
PyDict_SetItemString(d,"wxSTC_B_DATE", PyInt_FromLong((long) 8));
PyDict_SetItemString(d,"wxSTC_H_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_H_TAG", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_H_TAGUNKNOWN", PyInt_FromLong((long) 2));
@@ -11445,6 +11658,20 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_PL_STRING_QX", PyInt_FromLong((long) 28));
PyDict_SetItemString(d,"wxSTC_PL_STRING_QR", PyInt_FromLong((long) 29));
PyDict_SetItemString(d,"wxSTC_PL_STRING_QW", PyInt_FromLong((long) 30));
PyDict_SetItemString(d,"wxSTC_B_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_B_COMMENT", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_B_NUMBER", PyInt_FromLong((long) 2));
PyDict_SetItemString(d,"wxSTC_B_KEYWORD", PyInt_FromLong((long) 3));
PyDict_SetItemString(d,"wxSTC_B_STRING", PyInt_FromLong((long) 4));
PyDict_SetItemString(d,"wxSTC_B_PREPROCESSOR", PyInt_FromLong((long) 5));
PyDict_SetItemString(d,"wxSTC_B_OPERATOR", PyInt_FromLong((long) 6));
PyDict_SetItemString(d,"wxSTC_B_IDENTIFIER", PyInt_FromLong((long) 7));
PyDict_SetItemString(d,"wxSTC_B_DATE", PyInt_FromLong((long) 8));
PyDict_SetItemString(d,"wxSTC_PROPS_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_PROPS_COMMENT", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_PROPS_SECTION", PyInt_FromLong((long) 2));
PyDict_SetItemString(d,"wxSTC_PROPS_ASSIGNMENT", PyInt_FromLong((long) 3));
PyDict_SetItemString(d,"wxSTC_PROPS_DEFVAL", PyInt_FromLong((long) 4));
PyDict_SetItemString(d,"wxSTC_L_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_L_COMMAND", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_L_TAG", PyInt_FromLong((long) 2));
@@ -11477,6 +11704,7 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_ERR_PERL", PyInt_FromLong((long) 6));
PyDict_SetItemString(d,"wxSTC_ERR_NET", PyInt_FromLong((long) 7));
PyDict_SetItemString(d,"wxSTC_ERR_LUA", PyInt_FromLong((long) 8));
PyDict_SetItemString(d,"wxSTC_ERR_CTAG", PyInt_FromLong((long) 9));
PyDict_SetItemString(d,"wxSTC_ERR_DIFF_CHANGED", PyInt_FromLong((long) 10));
PyDict_SetItemString(d,"wxSTC_ERR_DIFF_ADDITION", PyInt_FromLong((long) 11));
PyDict_SetItemString(d,"wxSTC_ERR_DIFF_DELETION", PyInt_FromLong((long) 12));
@@ -11496,6 +11724,13 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_MAKE_OPERATOR", PyInt_FromLong((long) 4));
PyDict_SetItemString(d,"wxSTC_MAKE_TARGET", PyInt_FromLong((long) 5));
PyDict_SetItemString(d,"wxSTC_MAKE_IDEOL", PyInt_FromLong((long) 9));
PyDict_SetItemString(d,"wxSTC_DIFF_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_DIFF_COMMENT", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_DIFF_COMMAND", PyInt_FromLong((long) 2));
PyDict_SetItemString(d,"wxSTC_DIFF_HEADER", PyInt_FromLong((long) 3));
PyDict_SetItemString(d,"wxSTC_DIFF_POSITION", PyInt_FromLong((long) 4));
PyDict_SetItemString(d,"wxSTC_DIFF_DELETED", PyInt_FromLong((long) 5));
PyDict_SetItemString(d,"wxSTC_DIFF_ADDED", PyInt_FromLong((long) 6));
PyDict_SetItemString(d,"wxSTC_CONF_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_CONF_COMMENT", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_CONF_NUMBER", PyInt_FromLong((long) 2));
@@ -11573,6 +11808,26 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_MATLAB_STRING", PyInt_FromLong((long) 5));
PyDict_SetItemString(d,"wxSTC_MATLAB_OPERATOR", PyInt_FromLong((long) 6));
PyDict_SetItemString(d,"wxSTC_MATLAB_IDENTIFIER", PyInt_FromLong((long) 7));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_DEFAULT", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_COMMENT", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_COMMENTLINE", PyInt_FromLong((long) 2));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_COMMENTDOC", PyInt_FromLong((long) 3));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_NUMBER", PyInt_FromLong((long) 4));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_WORD", PyInt_FromLong((long) 5));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_STRING", PyInt_FromLong((long) 6));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_CHARACTER", PyInt_FromLong((long) 7));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_UUID", PyInt_FromLong((long) 8));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_PREPROCESSOR", PyInt_FromLong((long) 9));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_OPERATOR", PyInt_FromLong((long) 10));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_IDENTIFIER", PyInt_FromLong((long) 11));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_STRINGEOL", PyInt_FromLong((long) 12));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_VERBATIM", PyInt_FromLong((long) 13));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_REGEX", PyInt_FromLong((long) 14));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_COMMENTLINEDOC", PyInt_FromLong((long) 15));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_WORD2", PyInt_FromLong((long) 16));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_COMMENTDOCKEYWORD", PyInt_FromLong((long) 17));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_COMMENTDOCKEYWORDERROR", PyInt_FromLong((long) 18));
PyDict_SetItemString(d,"wxSTC_SCRIPTOL_COMMENTBASIC", PyInt_FromLong((long) 19));
PyDict_SetItemString(d,"wxSTCNameStr", PyString_FromString("wxSTCNameStr"));
PyDict_SetItemString(d,"STC_USE_DND", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxEVT_STC_CHANGE", PyInt_FromLong((long) wxEVT_STC_CHANGE));
@@ -11597,6 +11852,7 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxEVT_STC_START_DRAG", PyInt_FromLong((long) wxEVT_STC_START_DRAG));
PyDict_SetItemString(d,"wxEVT_STC_DRAG_OVER", PyInt_FromLong((long) wxEVT_STC_DRAG_OVER));
PyDict_SetItemString(d,"wxEVT_STC_DO_DROP", PyInt_FromLong((long) wxEVT_STC_DO_DROP));
PyDict_SetItemString(d,"wxEVT_STC_ZOOM", PyInt_FromLong((long) wxEVT_STC_ZOOM));
wxClassInfo::CleanUpClasses();

View File

@@ -109,6 +109,9 @@ def EVT_STC_DRAG_OVER(win, id, func):
def EVT_STC_DO_DROP(win, id, func):
win.Connect(id, -1, wxEVT_STC_DO_DROP, func)
def EVT_STC_ZOOM(win, id, func):
win.Connect(id, -1, wxEVT_STC_ZOOM, func)
class wxStyledTextCtrlPtr(wxControlPtr):
def __init__(self,this):
@@ -774,6 +777,24 @@ class wxStyledTextCtrlPtr(wxControlPtr):
def GetLayoutCache(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_GetLayoutCache,(self,) + _args, _kwargs)
return val
def SetScrollWidth(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_SetScrollWidth,(self,) + _args, _kwargs)
return val
def GetScrollWidth(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_GetScrollWidth,(self,) + _args, _kwargs)
return val
def TextWidth(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_TextWidth,(self,) + _args, _kwargs)
return val
def SetEndAtLastLine(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_SetEndAtLastLine,(self,) + _args, _kwargs)
return val
def GetEndAtLastLine(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_GetEndAtLastLine,(self,) + _args, _kwargs)
return val
def TextHeight(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_TextHeight,(self,) + _args, _kwargs)
return val
def MoveCaretInsideView(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_MoveCaretInsideView,(self,) + _args, _kwargs)
return val
@@ -832,9 +853,6 @@ class wxStyledTextCtrlPtr(wxControlPtr):
def SearchPrev(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_SearchPrev,(self,) + _args, _kwargs)
return val
def SetCaretPolicy(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_SetCaretPolicy,(self,) + _args, _kwargs)
return val
def LinesOnScreen(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_LinesOnScreen,(self,) + _args, _kwargs)
return val
@@ -919,6 +937,12 @@ class wxStyledTextCtrlPtr(wxControlPtr):
def GetXOffset(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_GetXOffset,(self,) + _args, _kwargs)
return val
def SetXCaretPolicy(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_SetXCaretPolicy,(self,) + _args, _kwargs)
return val
def SetYCaretPolicy(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_SetYCaretPolicy,(self,) + _args, _kwargs)
return val
def StartRecord(self, *_args, **_kwargs):
val = apply(stc_c.wxStyledTextCtrl_StartRecord,(self,) + _args, _kwargs)
return val
@@ -1319,15 +1343,14 @@ wxSTC_CMD_DELETEBACKNOTLINE = stc_c.wxSTC_CMD_DELETEBACKNOTLINE
wxSTC_EDGE_NONE = stc_c.wxSTC_EDGE_NONE
wxSTC_EDGE_LINE = stc_c.wxSTC_EDGE_LINE
wxSTC_EDGE_BACKGROUND = stc_c.wxSTC_EDGE_BACKGROUND
wxSTC_CARET_SLOP = stc_c.wxSTC_CARET_SLOP
wxSTC_CARET_CENTER = stc_c.wxSTC_CARET_CENTER
wxSTC_CARET_STRICT = stc_c.wxSTC_CARET_STRICT
wxSTC_CARET_XEVEN = stc_c.wxSTC_CARET_XEVEN
wxSTC_CARET_XJUMPS = stc_c.wxSTC_CARET_XJUMPS
wxSTC_CURSORNORMAL = stc_c.wxSTC_CURSORNORMAL
wxSTC_CURSORWAIT = stc_c.wxSTC_CURSORWAIT
wxSTC_VISIBLE_SLOP = stc_c.wxSTC_VISIBLE_SLOP
wxSTC_VISIBLE_STRICT = stc_c.wxSTC_VISIBLE_STRICT
wxSTC_CARET_SLOP = stc_c.wxSTC_CARET_SLOP
wxSTC_CARET_STRICT = stc_c.wxSTC_CARET_STRICT
wxSTC_CARET_JUMPS = stc_c.wxSTC_CARET_JUMPS
wxSTC_CARET_EVEN = stc_c.wxSTC_CARET_EVEN
wxSTC_MOD_INSERTTEXT = stc_c.wxSTC_MOD_INSERTTEXT
wxSTC_MOD_DELETETEXT = stc_c.wxSTC_MOD_DELETETEXT
wxSTC_MOD_CHANGESTYLE = stc_c.wxSTC_MOD_CHANGESTYLE
@@ -1393,6 +1416,7 @@ wxSTC_LEX_ASP = stc_c.wxSTC_LEX_ASP
wxSTC_LEX_PHP = stc_c.wxSTC_LEX_PHP
wxSTC_LEX_BAAN = stc_c.wxSTC_LEX_BAAN
wxSTC_LEX_MATLAB = stc_c.wxSTC_LEX_MATLAB
wxSTC_LEX_SCRIPTOL = stc_c.wxSTC_LEX_SCRIPTOL
wxSTC_LEX_AUTOMATIC = stc_c.wxSTC_LEX_AUTOMATIC
wxSTC_P_DEFAULT = stc_c.wxSTC_P_DEFAULT
wxSTC_P_COMMENTLINE = stc_c.wxSTC_P_COMMENTLINE
@@ -1427,15 +1451,6 @@ wxSTC_C_COMMENTLINEDOC = stc_c.wxSTC_C_COMMENTLINEDOC
wxSTC_C_WORD2 = stc_c.wxSTC_C_WORD2
wxSTC_C_COMMENTDOCKEYWORD = stc_c.wxSTC_C_COMMENTDOCKEYWORD
wxSTC_C_COMMENTDOCKEYWORDERROR = stc_c.wxSTC_C_COMMENTDOCKEYWORDERROR
wxSTC_B_DEFAULT = stc_c.wxSTC_B_DEFAULT
wxSTC_B_COMMENT = stc_c.wxSTC_B_COMMENT
wxSTC_B_NUMBER = stc_c.wxSTC_B_NUMBER
wxSTC_B_KEYWORD = stc_c.wxSTC_B_KEYWORD
wxSTC_B_STRING = stc_c.wxSTC_B_STRING
wxSTC_B_PREPROCESSOR = stc_c.wxSTC_B_PREPROCESSOR
wxSTC_B_OPERATOR = stc_c.wxSTC_B_OPERATOR
wxSTC_B_IDENTIFIER = stc_c.wxSTC_B_IDENTIFIER
wxSTC_B_DATE = stc_c.wxSTC_B_DATE
wxSTC_H_DEFAULT = stc_c.wxSTC_H_DEFAULT
wxSTC_H_TAG = stc_c.wxSTC_H_TAG
wxSTC_H_TAGUNKNOWN = stc_c.wxSTC_H_TAGUNKNOWN
@@ -1576,6 +1591,20 @@ wxSTC_PL_STRING_QQ = stc_c.wxSTC_PL_STRING_QQ
wxSTC_PL_STRING_QX = stc_c.wxSTC_PL_STRING_QX
wxSTC_PL_STRING_QR = stc_c.wxSTC_PL_STRING_QR
wxSTC_PL_STRING_QW = stc_c.wxSTC_PL_STRING_QW
wxSTC_B_DEFAULT = stc_c.wxSTC_B_DEFAULT
wxSTC_B_COMMENT = stc_c.wxSTC_B_COMMENT
wxSTC_B_NUMBER = stc_c.wxSTC_B_NUMBER
wxSTC_B_KEYWORD = stc_c.wxSTC_B_KEYWORD
wxSTC_B_STRING = stc_c.wxSTC_B_STRING
wxSTC_B_PREPROCESSOR = stc_c.wxSTC_B_PREPROCESSOR
wxSTC_B_OPERATOR = stc_c.wxSTC_B_OPERATOR
wxSTC_B_IDENTIFIER = stc_c.wxSTC_B_IDENTIFIER
wxSTC_B_DATE = stc_c.wxSTC_B_DATE
wxSTC_PROPS_DEFAULT = stc_c.wxSTC_PROPS_DEFAULT
wxSTC_PROPS_COMMENT = stc_c.wxSTC_PROPS_COMMENT
wxSTC_PROPS_SECTION = stc_c.wxSTC_PROPS_SECTION
wxSTC_PROPS_ASSIGNMENT = stc_c.wxSTC_PROPS_ASSIGNMENT
wxSTC_PROPS_DEFVAL = stc_c.wxSTC_PROPS_DEFVAL
wxSTC_L_DEFAULT = stc_c.wxSTC_L_DEFAULT
wxSTC_L_COMMAND = stc_c.wxSTC_L_COMMAND
wxSTC_L_TAG = stc_c.wxSTC_L_TAG
@@ -1608,6 +1637,7 @@ wxSTC_ERR_BORLAND = stc_c.wxSTC_ERR_BORLAND
wxSTC_ERR_PERL = stc_c.wxSTC_ERR_PERL
wxSTC_ERR_NET = stc_c.wxSTC_ERR_NET
wxSTC_ERR_LUA = stc_c.wxSTC_ERR_LUA
wxSTC_ERR_CTAG = stc_c.wxSTC_ERR_CTAG
wxSTC_ERR_DIFF_CHANGED = stc_c.wxSTC_ERR_DIFF_CHANGED
wxSTC_ERR_DIFF_ADDITION = stc_c.wxSTC_ERR_DIFF_ADDITION
wxSTC_ERR_DIFF_DELETION = stc_c.wxSTC_ERR_DIFF_DELETION
@@ -1627,6 +1657,13 @@ wxSTC_MAKE_IDENTIFIER = stc_c.wxSTC_MAKE_IDENTIFIER
wxSTC_MAKE_OPERATOR = stc_c.wxSTC_MAKE_OPERATOR
wxSTC_MAKE_TARGET = stc_c.wxSTC_MAKE_TARGET
wxSTC_MAKE_IDEOL = stc_c.wxSTC_MAKE_IDEOL
wxSTC_DIFF_DEFAULT = stc_c.wxSTC_DIFF_DEFAULT
wxSTC_DIFF_COMMENT = stc_c.wxSTC_DIFF_COMMENT
wxSTC_DIFF_COMMAND = stc_c.wxSTC_DIFF_COMMAND
wxSTC_DIFF_HEADER = stc_c.wxSTC_DIFF_HEADER
wxSTC_DIFF_POSITION = stc_c.wxSTC_DIFF_POSITION
wxSTC_DIFF_DELETED = stc_c.wxSTC_DIFF_DELETED
wxSTC_DIFF_ADDED = stc_c.wxSTC_DIFF_ADDED
wxSTC_CONF_DEFAULT = stc_c.wxSTC_CONF_DEFAULT
wxSTC_CONF_COMMENT = stc_c.wxSTC_CONF_COMMENT
wxSTC_CONF_NUMBER = stc_c.wxSTC_CONF_NUMBER
@@ -1704,6 +1741,26 @@ wxSTC_MATLAB_KEYWORD = stc_c.wxSTC_MATLAB_KEYWORD
wxSTC_MATLAB_STRING = stc_c.wxSTC_MATLAB_STRING
wxSTC_MATLAB_OPERATOR = stc_c.wxSTC_MATLAB_OPERATOR
wxSTC_MATLAB_IDENTIFIER = stc_c.wxSTC_MATLAB_IDENTIFIER
wxSTC_SCRIPTOL_DEFAULT = stc_c.wxSTC_SCRIPTOL_DEFAULT
wxSTC_SCRIPTOL_COMMENT = stc_c.wxSTC_SCRIPTOL_COMMENT
wxSTC_SCRIPTOL_COMMENTLINE = stc_c.wxSTC_SCRIPTOL_COMMENTLINE
wxSTC_SCRIPTOL_COMMENTDOC = stc_c.wxSTC_SCRIPTOL_COMMENTDOC
wxSTC_SCRIPTOL_NUMBER = stc_c.wxSTC_SCRIPTOL_NUMBER
wxSTC_SCRIPTOL_WORD = stc_c.wxSTC_SCRIPTOL_WORD
wxSTC_SCRIPTOL_STRING = stc_c.wxSTC_SCRIPTOL_STRING
wxSTC_SCRIPTOL_CHARACTER = stc_c.wxSTC_SCRIPTOL_CHARACTER
wxSTC_SCRIPTOL_UUID = stc_c.wxSTC_SCRIPTOL_UUID
wxSTC_SCRIPTOL_PREPROCESSOR = stc_c.wxSTC_SCRIPTOL_PREPROCESSOR
wxSTC_SCRIPTOL_OPERATOR = stc_c.wxSTC_SCRIPTOL_OPERATOR
wxSTC_SCRIPTOL_IDENTIFIER = stc_c.wxSTC_SCRIPTOL_IDENTIFIER
wxSTC_SCRIPTOL_STRINGEOL = stc_c.wxSTC_SCRIPTOL_STRINGEOL
wxSTC_SCRIPTOL_VERBATIM = stc_c.wxSTC_SCRIPTOL_VERBATIM
wxSTC_SCRIPTOL_REGEX = stc_c.wxSTC_SCRIPTOL_REGEX
wxSTC_SCRIPTOL_COMMENTLINEDOC = stc_c.wxSTC_SCRIPTOL_COMMENTLINEDOC
wxSTC_SCRIPTOL_WORD2 = stc_c.wxSTC_SCRIPTOL_WORD2
wxSTC_SCRIPTOL_COMMENTDOCKEYWORD = stc_c.wxSTC_SCRIPTOL_COMMENTDOCKEYWORD
wxSTC_SCRIPTOL_COMMENTDOCKEYWORDERROR = stc_c.wxSTC_SCRIPTOL_COMMENTDOCKEYWORDERROR
wxSTC_SCRIPTOL_COMMENTBASIC = stc_c.wxSTC_SCRIPTOL_COMMENTBASIC
wxSTCNameStr = stc_c.wxSTCNameStr
STC_USE_DND = stc_c.STC_USE_DND
wxEVT_STC_CHANGE = stc_c.wxEVT_STC_CHANGE
@@ -1728,6 +1785,7 @@ wxEVT_STC_DWELLEND = stc_c.wxEVT_STC_DWELLEND
wxEVT_STC_START_DRAG = stc_c.wxEVT_STC_START_DRAG
wxEVT_STC_DRAG_OVER = stc_c.wxEVT_STC_DRAG_OVER
wxEVT_STC_DO_DROP = stc_c.wxEVT_STC_DO_DROP
wxEVT_STC_ZOOM = stc_c.wxEVT_STC_ZOOM
#-------------- USER INCLUDE -----------------------

View File

@@ -111,6 +111,9 @@ def EVT_STC_DRAG_OVER(win, id, func):
def EVT_STC_DO_DROP(win, id, func):
win.Connect(id, -1, wxEVT_STC_DO_DROP, func)
def EVT_STC_ZOOM(win, id, func):
win.Connect(id, -1, wxEVT_STC_ZOOM, func)
"
//----------------------------------------------------------------------

View File

@@ -18,7 +18,7 @@ class TestView(wxStyledTextCtrl):
wxFont(10, wxMODERN, wxNORMAL, wxNORMAL))
EVT_DYNAMIC_SASH_SPLIT(self, -1, self.OnSplit)
EVT_DYNAMIC_SASH_UNIFY(self, -1, self.OnUnify)
#self.SetScrollWidth(500)
def SetupScrollBars(self):
# hook the scrollbars provided by the wxDynamicSashWindow

View File

@@ -162,8 +162,11 @@ def runTest(frame, nb, log):
p.SetAutoLayout(true)
## ed.SetBufferedDraw(false)
## ed.StyleClearAll()
#ed.SetBufferedDraw(false)
#ed.StyleClearAll()
#ed.SetScrollWidth(800)
#ed.SetWrapMode(true)
ed.SetText(demoText)
if wxUSE_UNICODE:
import codecs