1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Changed some return types from being const objects to non-const objects (for better c++11 compliance in future). This may mean that you need to remove the 'const' from your own code if you override the virtual methods that have changed.

This commit is contained in:
Julian Storer 2011-08-19 21:34:34 +01:00
parent dab3472756
commit 2c328dfedc
79 changed files with 126 additions and 128 deletions

View file

@ -64,7 +64,7 @@ public:
ColourSelectorWithSwatches() {}
int getNumSwatches() const { return StoredSettings::getInstance()->swatchColours.size(); }
const Colour getSwatchColour (int index) const { return StoredSettings::getInstance()->swatchColours [index]; }
Colour getSwatchColour (int index) const { return StoredSettings::getInstance()->swatchColours [index]; }
void setSwatchColour (int index, const Colour& newColour) const { StoredSettings::getInstance()->swatchColours.set (index, newColour); }
};

View file

@ -193,7 +193,7 @@ private:
"Change button text");
}
const String getText() const
String getText() const
{
return component->getButtonText();
}
@ -290,7 +290,7 @@ private:
"Change radio group ID");
}
const String getText() const
String getText() const
{
return String (component->getRadioGroupId());
}

View file

@ -301,7 +301,7 @@ private:
"Change combo box items");
}
const String getText() const
String getText() const
{
return component->getProperties() ["items"];
}
@ -354,7 +354,7 @@ private:
"Change combo box text when nothing selected");
}
const String getText() const
String getText() const
{
return component->getTextWhenNothingSelected();
}
@ -405,7 +405,7 @@ private:
"Change combo box 'no items' text");
}
const String getText() const
String getText() const
{
return component->getTextWhenNoChoicesAvailable();
}

View file

@ -53,7 +53,7 @@ public:
"Change component name");
}
const String getText() const
String getText() const
{
return component->getName();
}
@ -113,7 +113,7 @@ public:
"Change component member name");
}
const String getText() const
String getText() const
{
return document.getComponentLayout()->getComponentMemberVariableName (component);
}
@ -172,7 +172,7 @@ public:
"Change component virtual class name");
}
const String getText() const
String getText() const
{
return document.getComponentLayout()->getComponentVirtualClassName (component);
}

View file

@ -268,7 +268,7 @@ public:
{
}
const String getText() const
String getText() const
{
SettableTooltipClient* ttc = dynamic_cast <SettableTooltipClient*> (component);
return ttc->getTooltip();
@ -372,7 +372,7 @@ public:
{
}
const String getText() const
String getText() const
{
return String (component->getExplicitFocusOrder());
}

View file

@ -156,7 +156,7 @@ private:
"Change generic component class");
}
const String getText() const
String getText() const
{
return component->actualClassName;
}
@ -206,7 +206,7 @@ private:
"Change generic component class");
}
const String getText() const
String getText() const
{
return component->constructorParams;
}

View file

@ -133,7 +133,7 @@ private:
"Change group title");
}
const String getText() const
String getText() const
{
return component->getText();
}

View file

@ -119,7 +119,7 @@ private:
"Change hyperlink URL");
}
const String getText() const
String getText() const
{
return component->getURL().toString (false);
}

View file

@ -501,7 +501,7 @@ public:
setImageColour (layout, owner, role, newColour, true);
}
const Colour getColour() const
Colour getColour() const
{
return getImageColour (owner, role);
}

View file

@ -217,7 +217,7 @@ private:
mw->openFile (component->findFile());
}
const String getButtonText() const
String getButtonText() const
{
return "Open file for editing";
}
@ -241,7 +241,7 @@ private:
"Change Viewport content constructor params");
}
const String getText() const
String getText() const
{
return component->getConstructorParams();
}

View file

@ -213,7 +213,7 @@ private:
"Change Label text");
}
const String getText() const
String getText() const
{
return component->getText();
}
@ -314,8 +314,7 @@ private:
class LabelLossOfFocusProperty : public ComponentChoiceProperty <Label>
{
public:
LabelLossOfFocusProperty (Label* component_,
JucerDocument& document_)
LabelLossOfFocusProperty (Label* component_, JucerDocument& document_)
: ComponentChoiceProperty <Label> ("focus", component_, document_)
{
choices.add ("loss of focus discards changes");
@ -438,8 +437,7 @@ private:
public ChangeListener
{
public:
FontNameProperty (Label* const label_,
JucerDocument& document_)
FontNameProperty (Label* const label_, JucerDocument& document_)
: FontPropertyComponent ("font"),
label (label_),
document (document_)
@ -458,7 +456,7 @@ private:
"Change Label typeface");
}
const String getTypefaceName() const
String getTypefaceName() const
{
return label->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont);
}

View file

@ -421,7 +421,7 @@ private:
"Change Slider textbox size");
}
const String getText() const
String getText() const
{
return String (isWidth ? component->getTextBoxWidth()
: component->getTextBoxHeight());
@ -507,7 +507,7 @@ private:
"Change Slider range");
}
const String getText() const
String getText() const
{
Slider* s = dynamic_cast <Slider*> (component);
jassert (s != 0);
@ -586,7 +586,7 @@ private:
"Change Slider skew");
}
const String getText() const
String getText() const
{
Slider* s = dynamic_cast <Slider*> (component);
jassert (s != 0);

View file

@ -653,7 +653,7 @@ private:
"Add a new tab");
}
const String getButtonText() const
String getButtonText() const
{
return "Create a new tab";
}
@ -719,7 +719,7 @@ private:
}
}
const String getButtonText() const
String getButtonText() const
{
return "Delete a tab...";
}
@ -780,7 +780,7 @@ private:
"Change tab name");
}
const String getText() const
String getText() const
{
return component->getTabNames() [tabIndex];
}
@ -848,7 +848,7 @@ private:
"Change tab colour");
}
const Colour getColour() const
Colour getColour() const
{
return component->getTabBackgroundColour (tabIndex);
}
@ -1047,7 +1047,7 @@ private:
"Change TabbedComponent content class");
}
const String getText() const
String getText() const
{
return getTabClassName (component, tabIndex);
}
@ -1105,7 +1105,7 @@ private:
"Change TabbedComponent content constructor param");
}
const String getText() const
String getText() const
{
return getTabConstructorParams (component, tabIndex);
}
@ -1177,7 +1177,7 @@ private:
}
}
const String getButtonText() const
String getButtonText() const
{
return "Move this tab...";
}

View file

@ -400,7 +400,7 @@ private:
"Change TextEditor initial text");
}
const String getText() const
String getText() const
{
return component->getProperties() ["initialText"];
}

View file

@ -576,7 +576,7 @@ private:
"Change Viewport content class");
}
const String getText() const
String getText() const
{
return getViewportGenericComponentClass (component);
}
@ -629,7 +629,7 @@ private:
"Change Viewport content constructor params");
}
const String getText() const
String getText() const
{
return getViewportConstructorParams (component);
}

View file

@ -179,7 +179,7 @@ public:
owner->setStrokeFill (fill, true);
}
const Colour getColour() const
Colour getColour() const
{
const JucerFillType fill (isForStroke ? owner->getStrokeType().fill
: owner->getFillType());

View file

@ -153,7 +153,7 @@ private:
element->convertToPath();
}
const String getButtonText() const
String getButtonText() const
{
return "convert to a path";
}

View file

@ -240,7 +240,7 @@ private:
element->ungroup (true);
}
const String getButtonText() const
String getButtonText() const
{
return "Ungroup";
}

View file

@ -514,7 +514,7 @@ private:
element->resetToImageSize();
}
const String getButtonText() const { return "reset to image size"; }
String getButtonText() const { return "reset to image size"; }
private:
PaintElementImage* const element;

View file

@ -1379,7 +1379,7 @@ public:
owner->addPoint (index, true);
}
const String getButtonText() const { return "Add new point"; }
String getButtonText() const { return "Add new point"; }
private:
PaintElementPath* const owner;

View file

@ -160,7 +160,7 @@ private:
element->convertToPath();
}
const String getButtonText() const
String getButtonText() const
{
return "convert to a path";
}

View file

@ -247,7 +247,7 @@ private:
element->convertToPath();
}
const String getButtonText() const
String getButtonText() const
{
return "convert to a path";
}

View file

@ -284,7 +284,7 @@ public:
}
}
const String getTypefaceName() const throw() { return typefaceName; }
String getTypefaceName() const throw() { return typefaceName; }
//==============================================================================
const Justification& getJustification() const throw() { return justification; }
@ -382,7 +382,7 @@ private:
}
void setText (const String& newText) { element->setText (newText, true); }
const String getText() const { return element->getText(); }
String getText() const { return element->getText(); }
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
@ -408,7 +408,7 @@ private:
}
void setTypefaceName (const String& newFontName) { element->setTypefaceName (newFontName, true); }
const String getTypefaceName() const { return element->getTypefaceName(); }
String getTypefaceName() const { return element->getTypefaceName(); }
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
@ -552,7 +552,7 @@ private:
element->convertToPath();
}
const String getButtonText() const
String getButtonText() const
{
return "convert text to a path";
}

View file

@ -50,7 +50,7 @@ public:
//==============================================================================
virtual void setColour (const Colour& newColour) = 0;
virtual const Colour getColour() const = 0;
virtual Colour getColour() const = 0;
virtual void resetToDefault() = 0;
void refresh()
@ -77,7 +77,7 @@ private:
owner->setColour (newColour);
}
const Colour getColour() const
Colour getColour() const
{
return owner->getColour();
}

View file

@ -86,7 +86,7 @@ public:
}
//==============================================================================
const Colour getColour() const
Colour getColour() const
{
return component->findColour (colourId);
}

View file

@ -45,7 +45,7 @@ public:
static void preloadAllFonts();
virtual void setTypefaceName (const String& newFontName) = 0;
virtual const String getTypefaceName() const = 0;
virtual String getTypefaceName() const = 0;
static const Font applyNameToFont (const String& typefaceName, const Font& font);
static const String getTypefaceNameCode (const String& typefaceName);

View file

@ -72,7 +72,7 @@ public:
deleteAllChildren();
}
const String getText() const
String getText() const
{
RelativePositionedRectangle rpr (getPosition());
PositionedRectangle& p = rpr.rect;

View file

@ -194,7 +194,7 @@ private:
{}
void setText (const String& newText) { document.setClassName (newText); }
const String getText() const { return document.getClassName(); }
String getText() const { return document.getClassName(); }
};
//==============================================================================
@ -206,7 +206,7 @@ private:
{}
void setText (const String& newText) { document.setComponentName (newText); }
const String getText() const { return document.getComponentName(); }
String getText() const { return document.getComponentName(); }
};
//==============================================================================
@ -218,7 +218,7 @@ private:
{}
void setText (const String& newText) { document.setParentClasses (newText); }
const String getText() const { return document.getParentClassString(); }
String getText() const { return document.getParentClassString(); }
};
//==============================================================================
@ -230,7 +230,7 @@ private:
{}
void setText (const String& newText) { document.setConstructorParams (newText); }
const String getText() const { return document.getConstructorParams(); }
String getText() const { return document.getConstructorParams(); }
};
//==============================================================================
@ -244,7 +244,7 @@ private:
}
void setText (const String& newText) { document.setVariableInitialisers (newText); }
const String getText() const { return document.getVariableInitialisers(); }
String getText() const { return document.getVariableInitialisers(); }
};
@ -266,7 +266,7 @@ private:
document.setInitialSize (document.getInitialWidth(), newText.getIntValue());
}
const String getText() const
String getText() const
{
return String (isWidth ? document.getInitialWidth()
: document.getInitialHeight());

View file

@ -54,7 +54,7 @@ public:
}
void setColour (const Colour& newColour) { routine.setBackgroundColour (newColour); }
const Colour getColour() const { return routine.getBackgroundColour(); }
Colour getColour() const { return routine.getBackgroundColour(); }
void resetToDefault()
{

View file

@ -59,7 +59,7 @@ public:
virtual void setColour (const Colour& newColour) = 0;
virtual void resetToDefault() = 0;
virtual const Colour getColour() const = 0;
virtual Colour getColour() const = 0;
void refresh()
{
@ -148,7 +148,7 @@ private:
return StoredSettings::getInstance()->swatchColours.size();
}
const Colour getSwatchColour (int index) const
Colour getSwatchColour (int index) const
{
return StoredSettings::getInstance()->swatchColours [index];
}

View file

@ -527,7 +527,7 @@ void MidiKeyboardComponent::setOctaveForMiddleC (const int octaveNumForMiddleC_)
repaint();
}
const String MidiKeyboardComponent::getWhiteNoteText (const int midiNoteNumber)
String MidiKeyboardComponent::getWhiteNoteText (const int midiNoteNumber)
{
if (keyWidth > 14.0f && midiNoteNumber % 12 == 0)
return MidiMessage::getMidiNoteName (midiNoteNumber, true, true, octaveNumForMiddleC);

View file

@ -333,7 +333,7 @@ protected:
@see setOctaveForMiddleC
*/
virtual const String getWhiteNoteText (const int midiNoteNumber);
virtual String getWhiteNoteText (const int midiNoteNumber);
/** Draws the up and down buttons that change the base note. */
virtual void drawUpDownButton (Graphics& g, int w, int h,

View file

@ -123,7 +123,7 @@ bool Graphics::isClipEmpty() const
return context->isClipEmpty();
}
const Rectangle<int> Graphics::getClipBounds() const
Rectangle<int> Graphics::getClipBounds() const
{
return context->getClipBounds();
}

View file

@ -547,7 +547,7 @@ public:
@see getClipRegion, clipRegionIntersects
*/
const Rectangle<int> getClipBounds() const;
Rectangle<int> getClipBounds() const;
/** Checks whether a rectangle overlaps the context's clipping region.

View file

@ -76,7 +76,7 @@ public:
virtual void clipToImageAlpha (const Image& sourceImage, const AffineTransform& transform) = 0;
virtual bool clipRegionIntersects (const Rectangle<int>& r) = 0;
virtual const Rectangle<int> getClipBounds() const = 0;
virtual Rectangle<int> getClipBounds() const = 0;
virtual bool isClipEmpty() const = 0;
virtual void saveState() = 0;

View file

@ -153,7 +153,7 @@ bool LowLevelGraphicsPostScriptRenderer::clipRegionIntersects (const Rectangle<i
return stateStack.getLast()->clip.intersectsRectangle (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset));
}
const Rectangle<int> LowLevelGraphicsPostScriptRenderer::getClipBounds() const
Rectangle<int> LowLevelGraphicsPostScriptRenderer::getClipBounds() const
{
return stateStack.getLast()->clip.getBounds().translated (-stateStack.getLast()->xOffset,
-stateStack.getLast()->yOffset);

View file

@ -65,7 +65,7 @@ public:
void endTransparencyLayer();
bool clipRegionIntersects (const Rectangle<int>& r);
const Rectangle<int> getClipBounds() const;
Rectangle<int> getClipBounds() const;
bool isClipEmpty() const;
//==============================================================================

View file

@ -2281,7 +2281,7 @@ bool LowLevelGraphicsSoftwareRenderer::clipRegionIntersects (const Rectangle<int
return currentState->clipRegionIntersects (r);
}
const Rectangle<int> LowLevelGraphicsSoftwareRenderer::getClipBounds() const
Rectangle<int> LowLevelGraphicsSoftwareRenderer::getClipBounds() const
{
return currentState->getClipBounds();
}

View file

@ -59,7 +59,7 @@ public:
void clipToImageAlpha (const Image& sourceImage, const AffineTransform& transform);
bool clipRegionIntersects (const Rectangle<int>& r);
const Rectangle<int> getClipBounds() const;
Rectangle<int> getClipBounds() const;
bool isClipEmpty() const;
void saveState();

View file

@ -410,7 +410,7 @@ public:
static SharedImage* createNativeImage (PixelFormat format, int width, int height, bool clearImage);
static SharedImage* createSoftwareImage (PixelFormat format, int width, int height, bool clearImage);
const PixelFormat getPixelFormat() const noexcept { return format; }
PixelFormat getPixelFormat() const noexcept { return format; }
int getWidth() const noexcept { return width; }
int getHeight() const noexcept { return height; }

View file

@ -400,7 +400,7 @@ public:
return getClipBounds().intersects (r);
}
const Rectangle<int> getClipBounds() const
Rectangle<int> getClipBounds() const
{
JNIEnv* env = getEnv();
jobject rect = getCanvas().callObjectMethod (Canvas.getClipBounds2);

View file

@ -45,7 +45,7 @@ public:
void clipToPath (const Path& path, const AffineTransform& transform);
void clipToImageAlpha (const Image& sourceImage, const AffineTransform& transform);
bool clipRegionIntersects (const Rectangle<int>& r);
const Rectangle<int> getClipBounds() const;
Rectangle<int> getClipBounds() const;
bool isClipEmpty() const;
//==============================================================================

View file

@ -272,7 +272,7 @@ bool CoreGraphicsContext::clipRegionIntersects (const Rectangle<int>& r)
return getClipBounds().intersects (r);
}
const Rectangle<int> CoreGraphicsContext::getClipBounds() const
Rectangle<int> CoreGraphicsContext::getClipBounds() const
{
if (! lastClipRectIsValid)
{

View file

@ -160,7 +160,7 @@ public:
return currentState->clipRect.intersects (r2);
}
const Rectangle<int> getClipBounds() const
Rectangle<int> getClipBounds() const
{
// xxx could this take into account complex clip regions?
return currentState->clipRect - currentState->origin;

View file

@ -1646,7 +1646,7 @@ void Component::setMouseCursor (const MouseCursor& newCursor)
}
}
const MouseCursor Component::getMouseCursor()
MouseCursor Component::getMouseCursor()
{
return cursor;
}

View file

@ -1406,7 +1406,7 @@ public:
@see MouseCursor
*/
virtual const MouseCursor getMouseCursor();
virtual MouseCursor getMouseCursor();
/** Forces the current mouse cursor to be updated.

View file

@ -57,7 +57,7 @@ public:
The index should be in the range 0 to (getNumSelectedFiles() - 1).
@see getNumSelectedFiles
*/
virtual const File getSelectedFile (int index) const = 0;
virtual File getSelectedFile (int index) const = 0;
/** Deselects any selected files. */
virtual void deselectAllFiles() = 0;

View file

@ -47,7 +47,7 @@ int FileListComponent::getNumSelectedFiles() const
return getNumSelectedRows();
}
const File FileListComponent::getSelectedFile (int index) const
File FileListComponent::getSelectedFile (int index) const
{
return fileList.getFile (getSelectedRow (index));
}

View file

@ -68,7 +68,7 @@ public:
The index should be in the range 0 to (getNumSelectedFiles() - 1).
@see getNumSelectedFiles
*/
const File getSelectedFile (int index = 0) const;
File getSelectedFile (int index = 0) const;
/** Deselects any files that are currently selected. */
void deselectAllFiles();

View file

@ -227,7 +227,7 @@ FileTreeComponent::~FileTreeComponent()
}
//==============================================================================
const File FileTreeComponent::getSelectedFile (const int index) const
File FileTreeComponent::getSelectedFile (const int index) const
{
const FileListTreeItem* const item = dynamic_cast <const FileListTreeItem*> (getSelectedItem (index));

View file

@ -64,7 +64,7 @@ public:
The index should be in the range 0 to (getNumSelectedFiles() - 1).
@see getNumSelectedFiles
*/
const File getSelectedFile (int index = 0) const;
File getSelectedFile (int index = 0) const;
/** Deselects any files that are currently selected. */
void deselectAllFiles();

View file

@ -54,7 +54,7 @@ public:
/** Returns the extents of the selected text region, or an empty range if
nothing is selected,
*/
virtual const Range<int> getHighlightedRegion() const = 0;
virtual Range<int> getHighlightedRegion() const = 0;
/** Sets the currently-selected text region. */
virtual void setHighlightedRegion (const Range<int>& newRange) = 0;
@ -65,13 +65,13 @@ public:
virtual void setTemporaryUnderlining (const Array <Range<int> >& underlinedRegions) = 0;
/** Returns a specified sub-section of the text. */
virtual const String getTextInRange (const Range<int>& range) const = 0;
virtual String getTextInRange (const Range<int>& range) const = 0;
/** Inserts some text, overwriting the selected text region, if there is one. */
virtual void insertTextAtCaret (const String& textToInsert) = 0;
/** Returns the position of the caret, relative to the component's origin. */
virtual const Rectangle<int> getCaretRectangle() = 0;
virtual Rectangle<int> getCaretRectangle() = 0;
};

View file

@ -68,7 +68,7 @@ const ResizableBorderComponent::Zone ResizableBorderComponent::Zone::fromPositio
return Zone (z);
}
const MouseCursor ResizableBorderComponent::Zone::getMouseCursor() const noexcept
MouseCursor ResizableBorderComponent::Zone::getMouseCursor() const noexcept
{
MouseCursor::StandardCursorType mc = MouseCursor::NormalCursor;

View file

@ -122,7 +122,7 @@ public:
const Point<int>& position);
/** Returns an appropriate mouse-cursor for this resize zone. */
const MouseCursor getMouseCursor() const noexcept;
MouseCursor getMouseCursor() const noexcept;
/** Returns true if dragging this zone will move the enire object without resizing it. */
bool isDraggingWholeObject() const noexcept { return zone == centre; }

View file

@ -327,7 +327,7 @@ void LookAndFeel::setDefaultSansSerifTypefaceName (const String& newName)
}
//==============================================================================
const MouseCursor LookAndFeel::getMouseCursorFor (Component& component)
MouseCursor LookAndFeel::getMouseCursorFor (Component& component)
{
return component.getMouseCursor();
}

View file

@ -142,7 +142,7 @@ public:
/** Override this to get the chance to swap a component's mouse cursor for a
customised one.
*/
virtual const MouseCursor getMouseCursorFor (Component& component);
virtual MouseCursor getMouseCursorFor (Component& component);
//==============================================================================
/** Draws the lozenge-shaped background for a standard button. */

View file

@ -64,7 +64,7 @@ public:
If you need to change this string, call refresh() to update the component.
*/
virtual const String getButtonText() const = 0;
virtual String getButtonText() const = 0;
//==============================================================================
/** @internal */

View file

@ -96,7 +96,7 @@ void TextPropertyComponent::setText (const String& newText)
textEditor->setText (newText, true);
}
const String TextPropertyComponent::getText() const
String TextPropertyComponent::getText() const
{
return textEditor->getText();
}

View file

@ -77,7 +77,7 @@ public:
/** Returns the text that should be shown in the text editor.
*/
virtual const String getText() const;
virtual String getText() const;
//==============================================================================

View file

@ -861,7 +861,7 @@ void ListBox::repaintRow (const int rowNumber) noexcept
repaint (getRowPosition (rowNumber, true));
}
const Image ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY)
Image ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY)
{
Rectangle<int> imageArea;
const int firstRow = getRowContainingPosition (0, 0);

View file

@ -524,7 +524,7 @@ public:
@see Component::createComponentSnapshot
*/
virtual const Image createSnapshotOfSelectedRows (int& x, int& y);
virtual Image createSnapshotOfSelectedRows (int& x, int& y);
/** Returns the viewport that this ListBox uses.

View file

@ -779,7 +779,7 @@ void TableHeaderComponent::mouseUp (const MouseEvent& e)
dragOverlayComp = nullptr;
}
const MouseCursor TableHeaderComponent::getMouseCursor()
MouseCursor TableHeaderComponent::getMouseCursor()
{
if (columnIdBeingResized != 0 || (getResizeDraggerAt (getMouseXYRelative().getX()) != 0 && ! isMouseButtonDown()))
return MouseCursor (MouseCursor::LeftRightResizeCursor);

View file

@ -389,7 +389,7 @@ public:
/** @internal */
void mouseUp (const MouseEvent&);
/** @internal */
const MouseCursor getMouseCursor();
MouseCursor getMouseCursor();
/** Can be overridden for more control over the pop-up menu behaviour. */
virtual void showColumnChooserMenu (int columnIdClicked);

View file

@ -892,7 +892,7 @@ public:
owner.timerCallbackInt();
}
const MouseCursor getMouseCursor()
MouseCursor getMouseCursor()
{
return owner.getMouseCursor();
}
@ -1417,7 +1417,7 @@ void TextEditor::scrollEditorToPositionCaret (const int desiredCaretX,
viewport->setViewPosition (vx, vy);
}
const Rectangle<int> TextEditor::getCaretRectangle()
Rectangle<int> TextEditor::getCaretRectangle()
{
float cursorX, cursorY;
float cursorHeight = currentFont.getHeight(); // (in case the text is empty and the call below doesn't set this value)
@ -2462,7 +2462,7 @@ String TextEditor::getText() const
return mo.toString();
}
const String TextEditor::getTextInRange (const Range<int>& range) const
String TextEditor::getTextInRange (const Range<int>& range) const
{
if (range.isEmpty())
return String::empty;

View file

@ -335,7 +335,7 @@ public:
String getText() const;
/** Returns a section of the contents of the editor. */
const String getTextInRange (const Range<int>& textRange) const;
String getTextInRange (const Range<int>& textRange) const;
/** Returns true if there are no characters in the editor.
@ -428,7 +428,7 @@ public:
The rectangle returned is relative to the component's top-left corner.
@see scrollEditorToPositionCaret
*/
const Rectangle<int> getCaretRectangle();
Rectangle<int> getCaretRectangle();
/** Selects a section of the text. */
void setHighlightedRegion (const Range<int>& newSelection);
@ -437,7 +437,7 @@ public:
If nothing is selected, this will return an empty range.
@see setHighlightedRegion
*/
const Range<int> getHighlightedRegion() const { return selection; }
Range<int> getHighlightedRegion() const { return selection; }
/** Returns the section of text that is currently selected. */
String getHighlightedText() const;

View file

@ -582,7 +582,7 @@ StringArray CPlusPlusCodeTokeniser::getTokenTypes()
return StringArray (types);
}
const Colour CPlusPlusCodeTokeniser::getDefaultColour (const int tokenType)
Colour CPlusPlusCodeTokeniser::getDefaultColour (const int tokenType)
{
const uint32 colours[] =
{

View file

@ -61,7 +61,7 @@ public:
//==============================================================================
int readNextToken (CodeDocument::Iterator& source);
StringArray getTokenTypes();
const Colour getDefaultColour (int tokenType);
Colour getDefaultColour (int tokenType);
/** This is a handy method for checking whether a string is a c++ reserved keyword. */
static bool isReservedKeyword (const String& token) noexcept;

View file

@ -306,7 +306,7 @@ void CodeEditorComponent::setTemporaryUnderlining (const Array <Range<int> >&)
jassertfalse; // TODO Windows IME not yet supported for this comp..
}
const Rectangle<int> CodeEditorComponent::getCaretRectangle()
Rectangle<int> CodeEditorComponent::getCaretRectangle()
{
return getLocalArea (caret, caret->getLocalBounds());
}
@ -568,7 +568,7 @@ void CodeEditorComponent::scrollToKeepCaretOnScreen()
scrollToColumn (column);
}
const Rectangle<int> CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const
Rectangle<int> CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const
{
return Rectangle<int> (roundToInt ((gutter - xOffset * charWidth) + indexToColumn (pos.getLineNumber(), pos.getIndexInLine()) * charWidth),
(pos.getLineNumber() - firstLineOnScreen) * lineHeight,
@ -576,7 +576,7 @@ const Rectangle<int> CodeEditorComponent::getCharacterBounds (const CodeDocument
lineHeight);
}
const CodeDocument::Position CodeEditorComponent::getPositionAt (int x, int y)
CodeDocument::Position CodeEditorComponent::getPositionAt (int x, int y)
{
const int line = y / lineHeight + firstLineOnScreen;
const int column = roundToInt ((x - (gutter - xOffset * charWidth)) / charWidth);
@ -879,7 +879,7 @@ void CodeEditorComponent::timerCallback()
}
//==============================================================================
const Range<int> CodeEditorComponent::getHighlightedRegion() const
Range<int> CodeEditorComponent::getHighlightedRegion() const
{
return Range<int> (selectionStart.getPosition(), selectionEnd.getPosition());
}
@ -890,7 +890,7 @@ void CodeEditorComponent::setHighlightedRegion (const Range<int>& newRange)
moveCaretTo (CodeDocument::Position (&document, newRange.getEnd()), true);
}
const String CodeEditorComponent::getTextInRange (const Range<int>& range) const
String CodeEditorComponent::getTextInRange (const Range<int>& range) const
{
return document.getTextBetween (CodeDocument::Position (&document, range.getStart()),
CodeDocument::Position (&document, range.getEnd()));

View file

@ -89,10 +89,10 @@ public:
int getNumColumnsOnScreen() const noexcept { return columnsOnScreen; }
/** Returns the current caret position. */
const CodeDocument::Position getCaretPos() const { return caretPos; }
CodeDocument::Position getCaretPos() const { return caretPos; }
/** Returns the position of the caret, relative to the editor's origin. */
const Rectangle<int> getCaretRectangle();
Rectangle<int> getCaretRectangle();
/** Moves the caret.
If selecting is true, the section of the document between the current
@ -104,12 +104,12 @@ public:
/** Returns the on-screen position of a character in the document.
The rectangle returned is relative to this component's top-left origin.
*/
const Rectangle<int> getCharacterBounds (const CodeDocument::Position& pos) const;
Rectangle<int> getCharacterBounds (const CodeDocument::Position& pos) const;
/** Finds the character at a given on-screen position.
The co-ordinates are relative to this component's top-left origin.
*/
const CodeDocument::Position getPositionAt (int x, int y);
CodeDocument::Position getPositionAt (int x, int y);
//==============================================================================
bool moveCaretLeft (bool moveInWholeWordSteps, bool selecting);
@ -144,9 +144,9 @@ public:
void insertTabAtCaret();
//==============================================================================
const Range<int> getHighlightedRegion() const;
Range<int> getHighlightedRegion() const;
void setHighlightedRegion (const Range<int>& newRange);
const String getTextInRange (const Range<int>& range) const;
String getTextInRange (const Range<int>& range) const;
//==============================================================================
/** Changes the current tab settings.

View file

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

View file

@ -360,7 +360,7 @@ ColourSelector::~ColourSelector()
}
//==============================================================================
const Colour ColourSelector::getCurrentColour() const
Colour ColourSelector::getCurrentColour() const
{
return ((flags & showAlphaChannel) != 0) ? colour
: colour.withAlpha ((uint8) 0xff);
@ -570,7 +570,7 @@ int ColourSelector::getNumSwatches() const
return 0;
}
const Colour ColourSelector::getSwatchColour (const int) const
Colour ColourSelector::getSwatchColour (const int) const
{
jassertfalse; // if you've overridden getNumSwatches(), you also need to implement this method
return Colours::black;

View file

@ -78,7 +78,7 @@ public:
@see setCurrentColour
*/
const Colour getCurrentColour() const;
Colour getCurrentColour() const;
/** Changes the colour that is currently being shown.
*/
@ -101,7 +101,7 @@ public:
setSwatchColour(), to return the number of colours you want, and to set and retrieve
their values.
*/
virtual const Colour getSwatchColour (int index) const;
virtual Colour getSwatchColour (int index) const;
/** Called by the selector when the user puts a new colour into one of the swatches.

View file

@ -112,7 +112,7 @@ public:
return [EAGLContext currentContext] == context;
}
const OpenGLPixelFormat getPixelFormat() const { return pixelFormat; }
OpenGLPixelFormat getPixelFormat() const { return pixelFormat; }
void* getRawContext() const noexcept { return glLayer; }
void updateWindowPosition (const Rectangle<int>& bounds)

View file

@ -132,7 +132,7 @@ public:
return glXGetCurrentContext() == renderContext;
}
const OpenGLPixelFormat getPixelFormat() const
OpenGLPixelFormat getPixelFormat() const
{
return pixelFormat;
}

View file

@ -205,7 +205,7 @@ public:
return [NSOpenGLContext currentContext] == renderContext;
}
const OpenGLPixelFormat getPixelFormat() const { return pixelFormat; }
OpenGLPixelFormat getPixelFormat() const { return pixelFormat; }
void* getRawContext() const noexcept { return renderContext; }
void updateWindowPosition (const Rectangle<int>&) {}

View file

@ -143,7 +143,7 @@ public:
return wglGetCurrentContext() == renderContext;
}
const OpenGLPixelFormat getPixelFormat() const
OpenGLPixelFormat getPixelFormat() const
{
OpenGLPixelFormat pf;

View file

@ -241,7 +241,7 @@ OpenGLComponent::~OpenGLComponent()
componentWatcher = nullptr;
}
const OpenGLPixelFormat OpenGLComponent::getPixelFormat() const
OpenGLPixelFormat OpenGLComponent::getPixelFormat() const
{
OpenGLPixelFormat pf;

View file

@ -78,7 +78,7 @@ public:
void setPixelFormat (const OpenGLPixelFormat& formatToUse);
/** Returns the pixel format that this component is currently using. */
const OpenGLPixelFormat getPixelFormat() const;
OpenGLPixelFormat getPixelFormat() const;
/** Specifies an OpenGL context which should be shared with the one that this
component is using.

View file

@ -70,7 +70,7 @@ public:
//==============================================================================
/** Returns the pixel format being used by this context. */
virtual const OpenGLPixelFormat getPixelFormat() const = 0;
virtual OpenGLPixelFormat getPixelFormat() const = 0;
/** For windowed contexts, this moves the context within the bounds of
its parent window.