1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-25 02:04:23 +00:00

Minor code style tweaks.

This commit is contained in:
Julian Storer 2010-03-21 12:06:36 +00:00
parent 148e9f8d25
commit 7bc8db2ff4
85 changed files with 1289 additions and 1351 deletions

View file

@ -61,7 +61,7 @@ public:
//==============================================================================
int readNextToken (CodeDocument::Iterator& source);
const StringArray getTokenTypes();
const Colour getDefaultColour (const int tokenType);
const Colour getDefaultColour (int tokenType);
//==============================================================================
juce_UseDebuggingNewOperator

View file

@ -82,8 +82,8 @@ public:
Lines are numbered from zero, and if the line or index are beyond the bounds of the document,
they will be adjusted to keep them within its limits.
*/
Position (const CodeDocument* const ownerDocument,
const int line, const int indexInLine) throw();
Position (const CodeDocument* ownerDocument,
int line, int indexInLine) throw();
/** Creates a position based on a character index in a document.
This position is placed at the specified number of characters from the start of the
@ -92,8 +92,8 @@ public:
If the position is beyond the range of the document, it'll be adjusted to keep it
inside.
*/
Position (const CodeDocument* const ownerDocument,
const int charactersFromStartOfDocument) throw();
Position (const CodeDocument* ownerDocument,
int charactersFromStartOfDocument) throw();
/** Creates a copy of another position.
@ -115,7 +115,7 @@ public:
inside.
@see getPosition, setLineAndIndex
*/
void setPosition (const int charactersFromStartOfDocument) throw();
void setPosition (int charactersFromStartOfDocument) throw();
/** Returns the position as the number of characters from the start of the document.
@see setPosition, getLineNumber, getIndexInLine
@ -131,7 +131,7 @@ public:
Lines are numbered from zero, and if the line or index are beyond the bounds of the document,
they will be adjusted to keep them within its limits.
*/
void setLineAndIndex (const int newLine, const int newIndexInLine) throw();
void setLineAndIndex (int newLine, int newIndexInLine) throw();
/** Returns the line number of this position.
The first line in the document is numbered zero, not one!
@ -152,7 +152,7 @@ public:
when the document has text inserted or deleted, this position will be automatically
moved to keep it at the same position in the text.
*/
void setPositionMaintained (const bool isMaintained) throw();
void setPositionMaintained (bool isMaintained) throw();
//==============================================================================
/** Moves the position forwards or backwards by the specified number of characters.
@ -164,13 +164,13 @@ public:
characters.
@see moveBy
*/
const Position movedBy (const int characterDelta) const throw();
const Position movedBy (int characterDelta) const throw();
/** Returns a position which is the same as this one, moved up or down by the specified
number of lines.
@see movedBy
*/
const Position movedByLines (const int deltaLines) const throw();
const Position movedByLines (int deltaLines) const throw();
/** Returns the character in the document at this position.
@see getLineText
@ -197,7 +197,7 @@ public:
const String getTextBetween (const Position& start, const Position& end) const throw();
/** Returns a line from the document. */
const String getLine (const int lineIndex) const throw();
const String getLine (int lineIndex) const throw();
/** Returns the number of characters in the document. */
int getNumCharacters() const throw();
@ -321,12 +321,12 @@ public:
If the listener is already registered, this method has no effect.
@see removeListener
*/
void addListener (Listener* const listener) throw();
void addListener (Listener* listener) throw();
/** Deregisters a listener.
@see addListener
*/
void removeListener (Listener* const listener) throw();
void removeListener (Listener* listener) throw();
//==============================================================================
/** Iterates the text in a CodeDocument.
@ -339,7 +339,7 @@ public:
class Iterator
{
public:
Iterator (CodeDocument* const document);
Iterator (CodeDocument* document);
Iterator (const Iterator& other);
Iterator& operator= (const Iterator& other) throw();
~Iterator() throw();
@ -395,10 +395,10 @@ private:
VoidArray listeners;
String newLineChars;
void sendListenerChangeMessage (const int startLine, const int endLine);
void sendListenerChangeMessage (int startLine, int endLine);
void insert (const String& text, const int insertPos, const bool undoable);
void remove (const int startPos, const int endPos, const bool undoable);
void insert (const String& text, int insertPos, bool undoable);
void remove (int startPos, int endPos, bool undoable);
void checkLastLineStatus();
CodeDocument (const CodeDocument&);

View file

@ -58,7 +58,7 @@ public:
@see CodeDocument
*/
CodeEditorComponent (CodeDocument& document,
CodeTokeniser* const codeTokeniser);
CodeTokeniser* codeTokeniser);
/** Destructor. */
~CodeEditorComponent();
@ -99,7 +99,7 @@ public:
caret position and the new one will become selected. If false, any currently
selected region will be deselected.
*/
void moveCaretTo (const CodeDocument::Position& newPos, const bool selecting);
void moveCaretTo (const CodeDocument::Position& newPos, bool selecting);
/** Returns the on-screen position of a character in the document.
The rectangle returned is relative to this component's top-left origin.
@ -112,13 +112,13 @@ public:
const CodeDocument::Position getPositionAt (int x, int y);
//==============================================================================
void cursorLeft (const bool moveInWholeWordSteps, const bool selecting);
void cursorRight (const bool moveInWholeWordSteps, const bool selecting);
void cursorDown (const bool selecting);
void cursorUp (const bool selecting);
void cursorLeft (bool moveInWholeWordSteps, bool selecting);
void cursorRight (bool moveInWholeWordSteps, bool selecting);
void cursorDown (bool selecting);
void cursorUp (bool selecting);
void pageDown (const bool selecting);
void pageUp (const bool selecting);
void pageDown (bool selecting);
void pageUp (bool selecting);
void scrollDown();
void scrollUp();
@ -127,10 +127,10 @@ public:
void scrollToColumn (int newFirstColumnOnScreen);
void scrollToKeepCaretOnScreen();
void goToStartOfDocument (const bool selecting);
void goToStartOfLine (const bool selecting);
void goToEndOfDocument (const bool selecting);
void goToEndOfLine (const bool selecting);
void goToStartOfDocument (bool selecting);
void goToStartOfLine (bool selecting);
void goToEndOfDocument (bool selecting);
void goToEndOfLine (bool selecting);
void deselectAll();
void selectAll();
@ -141,8 +141,8 @@ public:
void copy();
void copyThenCut();
void paste();
void backspace (const bool moveInWholeWordSteps);
void deleteForward (const bool moveInWholeWordSteps);
void backspace (bool moveInWholeWordSteps);
void deleteForward (bool moveInWholeWordSteps);
void undo();
void redo();
@ -157,8 +157,8 @@ public:
This lets you change the tab size and whether pressing the tab key inserts a
tab character, or its equivalent number of spaces.
*/
void setTabSize (const int numSpacesPerTab,
const bool insertSpacesInsteadOfTabCharacters) throw();
void setTabSize (int numSpacesPerTab,
bool insertSpacesInsteadOfTabCharacters) throw();
/** Returns the current number of spaces per tab.
@see setTabSize
@ -186,14 +186,14 @@ public:
CodeTokeniser::getTokenTypes() to get a list of the token types.
@see getColourForTokenType
*/
void setColourForTokenType (const int tokenType, const Colour& colour);
void setColourForTokenType (int tokenType, const Colour& colour);
/** Returns one of the syntax highlighting colours.
The token type values are dependent on the tokeniser being used - use
CodeTokeniser::getTokenTypes() to get a list of the token types.
@see setColourForTokenType
*/
const Colour getColourForTokenType (const int tokenType) const throw();
const Colour getColourForTokenType (int tokenType) const throw();
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the editor.
@ -215,7 +215,7 @@ public:
//==============================================================================
/** Changes the size of the scrollbars. */
void setScrollbarThickness (const int thickness) throw();
void setScrollbarThickness (int thickness) throw();
//==============================================================================
/** @internal */
@ -282,10 +282,10 @@ private:
void rebuildLineTokens();
OwnedArray <CodeDocument::Iterator> cachedIterators;
void clearCachedIterators (const int firstLineToBeInvalid) throw();
void clearCachedIterators (int firstLineToBeInvalid) throw();
void updateCachedIterators (int maxLineNum);
void getIteratorForPosition (int position, CodeDocument::Iterator& result);
void moveLineDelta (const int delta, const bool selecting);
void moveLineDelta (int delta, bool selecting);
//==============================================================================
void updateScrollBars();

View file

@ -60,7 +60,7 @@ public:
/** Returns a suggested syntax highlighting colour for a specified
token type.
*/
virtual const Colour getDefaultColour (const int tokenType) = 0;
virtual const Colour getDefaultColour (int tokenType) = 0;
//==============================================================================