| @@ -86,29 +86,29 @@ public: | |||||
| void fillWithBackgroundTexture (Graphics&); | void fillWithBackgroundTexture (Graphics&); | ||||
| static void fillWithBackgroundTexture (Component&, Graphics&); | static void fillWithBackgroundTexture (Component&, Graphics&); | ||||
| int getTabButtonOverlap (int tabDepth); | |||||
| int getTabButtonSpaceAroundImage(); | |||||
| int getTabButtonBestWidth (TabBarButton& button, int tabDepth); | |||||
| int getTabButtonOverlap (int tabDepth) override; | |||||
| int getTabButtonSpaceAroundImage() override; | |||||
| int getTabButtonBestWidth (TabBarButton& button, int tabDepth) override; | |||||
| static Colour getTabBackgroundColour (TabBarButton& button); | static Colour getTabBackgroundColour (TabBarButton& button); | ||||
| void drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown); | |||||
| void drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown) override; | |||||
| Rectangle<int> getTabButtonExtraComponentBounds (const TabBarButton& button, Rectangle<int>& textArea, Component& comp); | |||||
| void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int, int) {} | |||||
| Rectangle<int> getTabButtonExtraComponentBounds (const TabBarButton& button, Rectangle<int>& textArea, Component& comp) override; | |||||
| void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int, int) override {} | |||||
| void drawStretchableLayoutResizerBar (Graphics& g, int /*w*/, int /*h*/, bool /*isVerticalBar*/, bool isMouseOver, bool isMouseDragging); | |||||
| Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&); | |||||
| void drawStretchableLayoutResizerBar (Graphics& g, int /*w*/, int /*h*/, bool /*isVerticalBar*/, bool isMouseOver, bool isMouseDragging) override; | |||||
| Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override; | |||||
| bool areScrollbarButtonsVisible() { return false; } | |||||
| bool areScrollbarButtonsVisible() override { return false; } | |||||
| void drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height, bool isScrollbarVertical, | void drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height, bool isScrollbarVertical, | ||||
| int thumbStartPosition, int thumbSize, bool /*isMouseOver*/, bool /*isMouseDown*/); | |||||
| int thumbStartPosition, int thumbSize, bool /*isMouseOver*/, bool /*isMouseDown*/) override; | |||||
| void drawConcertinaPanelHeader (Graphics& g, const Rectangle<int>& area, | void drawConcertinaPanelHeader (Graphics& g, const Rectangle<int>& area, | ||||
| bool isMouseOver, bool isMouseDown, | bool isMouseOver, bool isMouseDown, | ||||
| ConcertinaPanel& concertina, Component& panel); | |||||
| ConcertinaPanel& concertina, Component& panel) override; | |||||
| void drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour, | void drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour, | ||||
| bool isMouseOverButton, bool isButtonDown); | |||||
| bool isMouseOverButton, bool isButtonDown) override; | |||||
| static Colour getScrollbarColourForBackground (Colour background); | static Colour getScrollbarColourForBackground (Colour background); | ||||
| @@ -412,8 +412,8 @@ public: | |||||
| SetImageColourAction (ImageButton* const button, | SetImageColourAction (ImageButton* const button, | ||||
| ComponentLayout& layout_, | ComponentLayout& layout_, | ||||
| const ImageRole role_, | const ImageRole role_, | ||||
| const Colour& newState_) | |||||
| : ComponentUndoableAction <ImageButton> (button, layout_), | |||||
| Colour newState_) | |||||
| : ComponentUndoableAction<ImageButton> (button, layout_), | |||||
| role (role_), | role (role_), | ||||
| newState (newState_), | newState (newState_), | ||||
| layout (layout_) | layout (layout_) | ||||
| @@ -446,7 +446,8 @@ public: | |||||
| return Colour::fromString (button->getProperties().getWithDefault ("imageColour" + String ((int) role), "0").toString()); | return Colour::fromString (button->getProperties().getWithDefault ("imageColour" + String ((int) role), "0").toString()); | ||||
| } | } | ||||
| static void setImageColour (ComponentLayout& layout, ImageButton* button, const ImageRole role, const Colour& colour, const bool undoable) | |||||
| static void setImageColour (ComponentLayout& layout, ImageButton* button, | |||||
| const ImageRole role, Colour colour, const bool undoable) | |||||
| { | { | ||||
| if (undoable) | if (undoable) | ||||
| { | { | ||||
| @@ -479,7 +480,7 @@ public: | |||||
| layout.getDocument()->removeChangeListener (this); | layout.getDocument()->removeChangeListener (this); | ||||
| } | } | ||||
| void setColour (const Colour& newColour) | |||||
| void setColour (Colour newColour) | |||||
| { | { | ||||
| setImageColour (layout, owner, role, newColour, true); | setImageColour (layout, owner, role, newColour, true); | ||||
| } | } | ||||
| @@ -802,7 +802,7 @@ private: | |||||
| document.removeChangeListener (this); | document.removeChangeListener (this); | ||||
| } | } | ||||
| void setColour (const Colour& newColour) | |||||
| void setColour (Colour newColour) override | |||||
| { | { | ||||
| document.getUndoManager().undoCurrentTransactionOnly(); | document.getUndoManager().undoCurrentTransactionOnly(); | ||||
| @@ -810,17 +810,17 @@ private: | |||||
| "Change tab colour"); | "Change tab colour"); | ||||
| } | } | ||||
| Colour getColour() const | |||||
| Colour getColour() const override | |||||
| { | { | ||||
| return component->getTabBackgroundColour (tabIndex); | return component->getTabBackgroundColour (tabIndex); | ||||
| } | } | ||||
| void resetToDefault() | |||||
| void resetToDefault() override | |||||
| { | { | ||||
| jassertfalse; // shouldn't get called | jassertfalse; // shouldn't get called | ||||
| } | } | ||||
| void changeListenerCallback (ChangeBroadcaster*) { refresh(); } | |||||
| void changeListenerCallback (ChangeBroadcaster*) override { refresh(); } | |||||
| private: | private: | ||||
| TabbedComponent* component; | TabbedComponent* component; | ||||
| @@ -830,7 +830,8 @@ private: | |||||
| class TabColourChangeAction : public ComponentUndoableAction <TabbedComponent> | class TabColourChangeAction : public ComponentUndoableAction <TabbedComponent> | ||||
| { | { | ||||
| public: | public: | ||||
| TabColourChangeAction (TabbedComponent* const comp, ComponentLayout& layout, const int tabIndex_, const Colour& newValue_) | |||||
| TabColourChangeAction (TabbedComponent* comp, ComponentLayout& layout, | |||||
| int tabIndex_, Colour newValue_) | |||||
| : ComponentUndoableAction <TabbedComponent> (comp, layout), | : ComponentUndoableAction <TabbedComponent> (comp, layout), | ||||
| tabIndex (tabIndex_), | tabIndex (tabIndex_), | ||||
| newValue (newValue_) | newValue (newValue_) | ||||
| @@ -64,7 +64,7 @@ bool PaintRoutine::perform (UndoableAction* action, const String& actionName) | |||||
| return false; | return false; | ||||
| } | } | ||||
| void PaintRoutine::setBackgroundColour (const Colour& newColour) noexcept | |||||
| void PaintRoutine::setBackgroundColour (Colour newColour) noexcept | |||||
| { | { | ||||
| backgroundColour = newColour; | backgroundColour = newColour; | ||||
| changed(); | changed(); | ||||
| @@ -62,7 +62,7 @@ public: | |||||
| void elementToBack (PaintElement* element, const bool undoable); | void elementToBack (PaintElement* element, const bool undoable); | ||||
| const Colour getBackgroundColour() const noexcept { return backgroundColour; } | const Colour getBackgroundColour() const noexcept { return backgroundColour; } | ||||
| void setBackgroundColour (const Colour& newColour) noexcept; | |||||
| void setBackgroundColour (Colour newColour) noexcept; | |||||
| void fillWithBackground (Graphics& g, const bool drawOpaqueBackground); | void fillWithBackground (Graphics& g, const bool drawOpaqueBackground); | ||||
| void drawElements (Graphics& g, const Rectangle<int>& relativeTo); | void drawElements (Graphics& g, const Rectangle<int>& relativeTo); | ||||
| @@ -110,7 +110,7 @@ public: | |||||
| { | { | ||||
| } | } | ||||
| void setColour (const Colour& newColour) | |||||
| void setColour (Colour newColour) override | |||||
| { | { | ||||
| owner->getDocument()->getUndoManager().undoCurrentTransactionOnly(); | owner->getDocument()->getUndoManager().undoCurrentTransactionOnly(); | ||||
| @@ -131,7 +131,7 @@ public: | |||||
| owner->setStrokeFill (fill, true); | owner->setStrokeFill (fill, true); | ||||
| } | } | ||||
| Colour getColour() const | |||||
| Colour getColour() const override | |||||
| { | { | ||||
| const JucerFillType fill (isForStroke ? owner->getStrokeType().fill | const JucerFillType fill (isForStroke ? owner->getStrokeType().fill | ||||
| : owner->getFillType()); | : owner->getFillType()); | ||||
| @@ -147,7 +147,7 @@ public: | |||||
| return Colours::black; | return Colours::black; | ||||
| } | } | ||||
| void resetToDefault() | |||||
| void resetToDefault() override | |||||
| { | { | ||||
| jassertfalse; // option shouldn't be visible | jassertfalse; // option shouldn't be visible | ||||
| } | } | ||||
| @@ -39,7 +39,7 @@ public: | |||||
| addAndMakeVisible (colourPropEditor); | addAndMakeVisible (colourPropEditor); | ||||
| } | } | ||||
| virtual void setColour (const Colour& newColour) = 0; | |||||
| virtual void setColour (Colour newColour) = 0; | |||||
| virtual Colour getColour() const = 0; | virtual Colour getColour() const = 0; | ||||
| virtual void resetToDefault() = 0; | virtual void resetToDefault() = 0; | ||||
| @@ -73,7 +73,7 @@ public: | |||||
| Justification::centred, 1); | Justification::centred, 1); | ||||
| } | } | ||||
| virtual void setColour (const Colour& newColour) = 0; | |||||
| virtual void setColour (Colour newColour) = 0; | |||||
| virtual void resetToDefault() = 0; | virtual void resetToDefault() = 0; | ||||
| virtual Colour getColour() const = 0; | virtual Colour getColour() const = 0; | ||||
| @@ -155,17 +155,17 @@ public: | |||||
| { | { | ||||
| } | } | ||||
| int getNumSwatches() const | |||||
| int getNumSwatches() const override | |||||
| { | { | ||||
| return getAppSettings().swatchColours.size(); | return getAppSettings().swatchColours.size(); | ||||
| } | } | ||||
| Colour getSwatchColour (int index) const | |||||
| Colour getSwatchColour (int index) const override | |||||
| { | { | ||||
| return getAppSettings().swatchColours [index]; | return getAppSettings().swatchColours [index]; | ||||
| } | } | ||||
| void setSwatchColour (int index, const Colour& newColour) const | |||||
| void setSwatchColour (int index, const Colour& newColour) const override | |||||
| { | { | ||||
| getAppSettings().swatchColours.set (index, newColour); | getAppSettings().swatchColours.set (index, newColour); | ||||
| } | } | ||||
| @@ -192,12 +192,12 @@ public: | |||||
| owner (owner_) | owner (owner_) | ||||
| {} | {} | ||||
| void setColour (const Colour& newColour) | |||||
| void setColour (Colour newColour) override | |||||
| { | { | ||||
| owner->setColour (newColour); | owner->setColour (newColour); | ||||
| } | } | ||||
| Colour getColour() const | |||||
| Colour getColour() const override | |||||
| { | { | ||||
| return owner->getColour(); | return owner->getColour(); | ||||
| } | } | ||||
| @@ -86,7 +86,7 @@ public: | |||||
| return component->findColour (colourId); | return component->findColour (colourId); | ||||
| } | } | ||||
| void setColour (const Colour& newColour) | |||||
| void setColour (Colour newColour) | |||||
| { | { | ||||
| if (component->findColour (colourId) != newColour) | if (component->findColour (colourId) != newColour) | ||||
| { | { | ||||
| @@ -122,9 +122,9 @@ private: | |||||
| ColourChangeAction (Component* const comp, | ColourChangeAction (Component* const comp, | ||||
| ComponentLayout& layout, | ComponentLayout& layout, | ||||
| const int colourId_, | const int colourId_, | ||||
| const Colour& newColour_, | |||||
| Colour newColour_, | |||||
| const bool newColourIsDefault) | const bool newColourIsDefault) | ||||
| : ComponentUndoableAction <Component> (comp, layout), | |||||
| : ComponentUndoableAction<Component> (comp, layout), | |||||
| colourId (colourId_), | colourId (colourId_), | ||||
| newColour (newColour_), | newColour (newColour_), | ||||
| isDefault (newColourIsDefault) | isDefault (newColourIsDefault) | ||||
| @@ -47,15 +47,15 @@ public: | |||||
| document.removeChangeListener (this); | document.removeChangeListener (this); | ||||
| } | } | ||||
| void changeListenerCallback (ChangeBroadcaster*) | |||||
| void changeListenerCallback (ChangeBroadcaster*) override | |||||
| { | { | ||||
| refresh(); | refresh(); | ||||
| } | } | ||||
| void setColour (const Colour& newColour) { routine.setBackgroundColour (newColour); } | |||||
| Colour getColour() const { return routine.getBackgroundColour(); } | |||||
| void setColour (Colour newColour) override { routine.setBackgroundColour (newColour); } | |||||
| Colour getColour() const override { return routine.getBackgroundColour(); } | |||||
| void resetToDefault() | |||||
| void resetToDefault() override | |||||
| { | { | ||||
| jassertfalse; // option shouldn't be visible | jassertfalse; // option shouldn't be visible | ||||
| } | } | ||||
| @@ -123,7 +123,7 @@ Colour JucerTreeViewBase::getContrastingColour (float contrast) const | |||||
| return getBackgroundColour().contrasting (contrast); | return getBackgroundColour().contrasting (contrast); | ||||
| } | } | ||||
| Colour JucerTreeViewBase::getContrastingColour (const Colour& target, float minContrast) const | |||||
| Colour JucerTreeViewBase::getContrastingColour (Colour target, float minContrast) const | |||||
| { | { | ||||
| return getBackgroundColour().contrasting (target, minContrast); | return getBackgroundColour().contrasting (target, minContrast); | ||||
| } | } | ||||
| @@ -99,7 +99,7 @@ protected: | |||||
| Colour getBackgroundColour() const; | Colour getBackgroundColour() const; | ||||
| Colour getContrastingColour (float contrast) const; | Colour getContrastingColour (float contrast) const; | ||||
| Colour getContrastingColour (const Colour& targetColour, float minContrast) const; | |||||
| Colour getContrastingColour (Colour targetColour, float minContrast) const; | |||||
| private: | private: | ||||
| class ItemSelectionTimer; | class ItemSelectionTimer; | ||||
| @@ -58,8 +58,8 @@ bool reinvokeCommandAfterCancellingModalComps (const ApplicationCommandTarget::I | |||||
| struct Icon | struct Icon | ||||
| { | { | ||||
| Icon() : path (nullptr) {} | Icon() : path (nullptr) {} | ||||
| Icon (const Path& p, const Colour& c) : path (&p), colour (c) {} | |||||
| Icon (const Path* p, const Colour& c) : path (p), colour (c) {} | |||||
| Icon (const Path& p, Colour c) : path (&p), colour (c) {} | |||||
| Icon (const Path* p, Colour c) : path (p), colour (c) {} | |||||
| void draw (Graphics& g, const Rectangle<float>& area, bool isCrossedOut) const | void draw (Graphics& g, const Rectangle<float>& area, bool isCrossedOut) const | ||||
| { | { | ||||
| @@ -79,7 +79,7 @@ struct Icon | |||||
| } | } | ||||
| } | } | ||||
| Icon withContrastingColourTo (const Colour& background) const | |||||
| Icon withContrastingColourTo (Colour background) const | |||||
| { | { | ||||
| return Icon (path, background.contrasting (colour, 0.6f)); | return Icon (path, background.contrasting (colour, 0.6f)); | ||||
| } | } | ||||
| @@ -217,7 +217,7 @@ class PopupColourSelector : public Component, | |||||
| { | { | ||||
| public: | public: | ||||
| PopupColourSelector (const Value& colour, | PopupColourSelector (const Value& colour, | ||||
| const Colour& defaultCol, | |||||
| Colour defaultCol, | |||||
| const bool canResetToDefault) | const bool canResetToDefault) | ||||
| : defaultButton ("Reset to Default"), | : defaultButton ("Reset to Default"), | ||||
| colourValue (colour), | colourValue (colour), | ||||
| @@ -260,7 +260,7 @@ public: | |||||
| return Colour::fromString (colourValue.toString()); | return Colour::fromString (colourValue.toString()); | ||||
| } | } | ||||
| void setColour (const Colour& newColour) | |||||
| void setColour (Colour newColour) | |||||
| { | { | ||||
| if (getColour() != newColour) | if (getColour() != newColour) | ||||
| { | { | ||||
| @@ -305,7 +305,7 @@ class ColourEditorComponent : public Component, | |||||
| { | { | ||||
| public: | public: | ||||
| ColourEditorComponent (UndoManager* um, const Value& colour, | ColourEditorComponent (UndoManager* um, const Value& colour, | ||||
| const Colour& defaultCol, const bool canReset) | |||||
| Colour defaultCol, const bool canReset) | |||||
| : undoManager (um), colourValue (colour), defaultColour (defaultCol), | : undoManager (um), colourValue (colour), defaultColour (defaultCol), | ||||
| canResetToDefault (canReset) | canResetToDefault (canReset) | ||||
| { | { | ||||
| @@ -336,7 +336,7 @@ public: | |||||
| return Colour::fromString (colourValue.toString()); | return Colour::fromString (colourValue.toString()); | ||||
| } | } | ||||
| void setColour (const Colour& newColour) | |||||
| void setColour (Colour newColour) | |||||
| { | { | ||||
| if (getColour() != newColour) | if (getColour() != newColour) | ||||
| { | { | ||||
| @@ -394,7 +394,7 @@ class ColourPropertyComponent : public PropertyComponent | |||||
| { | { | ||||
| public: | public: | ||||
| ColourPropertyComponent (UndoManager* undoManager, const String& name, const Value& colour, | ColourPropertyComponent (UndoManager* undoManager, const String& name, const Value& colour, | ||||
| const Colour& defaultColour, bool canResetToDefault) | |||||
| Colour defaultColour, bool canResetToDefault) | |||||
| : PropertyComponent (name), | : PropertyComponent (name), | ||||
| colourEditor (undoManager, colour, defaultColour, canResetToDefault) | colourEditor (undoManager, colour, defaultColour, canResetToDefault) | ||||
| { | { | ||||
| @@ -48,16 +48,16 @@ public: | |||||
| void setLastProjects (const Array<File>& files); | void setLastProjects (const Array<File>& files); | ||||
| //============================================================================== | //============================================================================== | ||||
| Array <Colour> swatchColours; | |||||
| Array<Colour> swatchColours; | |||||
| class ColourSelectorWithSwatches : public ColourSelector | class ColourSelectorWithSwatches : public ColourSelector | ||||
| { | { | ||||
| public: | public: | ||||
| ColourSelectorWithSwatches() {} | ColourSelectorWithSwatches() {} | ||||
| int getNumSwatches() const; | |||||
| Colour getSwatchColour (int index) const; | |||||
| void setSwatchColour (int index, const Colour& newColour) const; | |||||
| int getNumSwatches() const override; | |||||
| Colour getSwatchColour (int index) const override; | |||||
| void setSwatchColour (int index, const Colour& newColour) const override; | |||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -257,8 +257,8 @@ Rectangle<int> MidiKeyboardComponent::getWhiteNotePos (int noteNum) const | |||||
| int MidiKeyboardComponent::getKeyStartPosition (const int midiNoteNumber) const | int MidiKeyboardComponent::getKeyStartPosition (const int midiNoteNumber) const | ||||
| { | { | ||||
| int x, y; | |||||
| getKeyPos (midiNoteNumber, x, y); | |||||
| int x, w; | |||||
| getKeyPos (midiNoteNumber, x, w); | |||||
| return x; | return x; | ||||
| } | } | ||||
| @@ -204,7 +204,7 @@ public: | |||||
| Depending on the keyboard's orientation, this may be a horizontal or vertical | Depending on the keyboard's orientation, this may be a horizontal or vertical | ||||
| distance, in either direction. | distance, in either direction. | ||||
| */ | */ | ||||
| int getKeyStartPosition (const int midiNoteNumber) const; | |||||
| int getKeyStartPosition (int midiNoteNumber) const; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Deletes all key-mappings. | /** Deletes all key-mappings. | ||||
| @@ -387,8 +387,8 @@ private: | |||||
| bool canScroll, useMousePositionForVelocity, shouldCheckMousePos; | bool canScroll, useMousePositionForVelocity, shouldCheckMousePos; | ||||
| ScopedPointer<Button> scrollDown, scrollUp; | ScopedPointer<Button> scrollDown, scrollUp; | ||||
| Array <KeyPress> keyPresses; | |||||
| Array <int> keyPressNotes; | |||||
| Array<KeyPress> keyPresses; | |||||
| Array<int> keyPressNotes; | |||||
| int keyMappingOctave, octaveNumForMiddleC; | int keyMappingOctave, octaveNumForMiddleC; | ||||
| static const uint8 whiteNotes[]; | static const uint8 whiteNotes[]; | ||||
| @@ -122,7 +122,6 @@ public: | |||||
| } | } | ||||
| /** Removes all elements from the set without freeing the array's allocated storage. | /** Removes all elements from the set without freeing the array's allocated storage. | ||||
| @see clear | @see clear | ||||
| */ | */ | ||||
| void clearQuick() noexcept | void clearQuick() noexcept | ||||
| @@ -240,7 +239,8 @@ public: | |||||
| if (halfway == s) | if (halfway == s) | ||||
| return -1; | return -1; | ||||
| else if (elementToLookFor < data.getReference (halfway)) | |||||
| if (elementToLookFor < data.getReference (halfway)) | |||||
| e = halfway; | e = halfway; | ||||
| else | else | ||||
| s = halfway; | s = halfway; | ||||
| @@ -295,7 +295,8 @@ public: | |||||
| break; | break; | ||||
| } | } | ||||
| else if (isBeforeHalfway) | |||||
| if (isBeforeHalfway) | |||||
| e = halfway; | e = halfway; | ||||
| else | else | ||||
| s = halfway; | s = halfway; | ||||
| @@ -483,7 +484,7 @@ public: | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| Array <ElementType, TypeOfCriticalSectionToUse> data; | |||||
| Array<ElementType, TypeOfCriticalSectionToUse> data; | |||||
| }; | }; | ||||
| #if JUCE_MSVC | #if JUCE_MSVC | ||||
| @@ -216,7 +216,7 @@ void LowLevelGraphicsPostScriptRenderer::writeClip() | |||||
| } | } | ||||
| } | } | ||||
| void LowLevelGraphicsPostScriptRenderer::writeColour (const Colour& colour) | |||||
| void LowLevelGraphicsPostScriptRenderer::writeColour (Colour colour) | |||||
| { | { | ||||
| Colour c (Colours::white.overlaidWith (colour)); | Colour c (Colours::white.overlaidWith (colour)); | ||||
| @@ -107,11 +107,11 @@ protected: | |||||
| OwnedArray <SavedState> stateStack; | OwnedArray <SavedState> stateStack; | ||||
| void writeClip(); | void writeClip(); | ||||
| void writeColour (const Colour& colour); | |||||
| void writePath (const Path& path) const; | |||||
| void writeColour (Colour colour); | |||||
| void writePath (const Path&) const; | |||||
| void writeXY (float x, float y) const; | void writeXY (float x, float y) const; | ||||
| void writeTransform (const AffineTransform& trans) const; | |||||
| void writeImage (const Image& im, int sx, int sy, int maxW, int maxH) const; | |||||
| void writeTransform (const AffineTransform&) const; | |||||
| void writeImage (const Image&, int sx, int sy, int maxW, int maxH) const; | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LowLevelGraphicsPostScriptRenderer) | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LowLevelGraphicsPostScriptRenderer) | ||||
| }; | }; | ||||
| @@ -24,10 +24,10 @@ | |||||
| namespace LookAndFeelHelpers | namespace LookAndFeelHelpers | ||||
| { | { | ||||
| static Colour createBaseColour (const Colour& buttonColour, | |||||
| const bool hasKeyboardFocus, | |||||
| const bool isMouseOverButton, | |||||
| const bool isButtonDown) noexcept | |||||
| static Colour createBaseColour (Colour buttonColour, | |||||
| bool hasKeyboardFocus, | |||||
| bool isMouseOverButton, | |||||
| bool isButtonDown) noexcept | |||||
| { | { | ||||
| const float sat = hasKeyboardFocus ? 1.3f : 0.9f; | const float sat = hasKeyboardFocus ? 1.3f : 0.9f; | ||||
| const Colour baseColour (buttonColour.withMultipliedSaturation (sat)); | const Colour baseColour (buttonColour.withMultipliedSaturation (sat)); | ||||
| @@ -38,7 +38,7 @@ namespace LookAndFeelHelpers | |||||
| return baseColour; | return baseColour; | ||||
| } | } | ||||
| static TextLayout layoutTooltipText (const String& text, const Colour& colour) noexcept | |||||
| static TextLayout layoutTooltipText (const String& text, Colour colour) noexcept | |||||
| { | { | ||||
| const float tooltipFontSize = 13.0f; | const float tooltipFontSize = 13.0f; | ||||
| const int maxToolTipWidth = 400; | const int maxToolTipWidth = 400; | ||||
| @@ -221,35 +221,33 @@ LookAndFeel::~LookAndFeel() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| Colour LookAndFeel::findColour (const int colourId) const noexcept | |||||
| Colour LookAndFeel::findColour (int colourID) const noexcept | |||||
| { | { | ||||
| const int index = colourIds.indexOf (colourId); | |||||
| const ColourSetting c = { colourID, Colour() }; | |||||
| const int index = colours.indexOf (c); | |||||
| if (index >= 0) | if (index >= 0) | ||||
| return colours [index]; | |||||
| return colours.getReference (index).colour; | |||||
| jassertfalse; | jassertfalse; | ||||
| return Colours::black; | return Colours::black; | ||||
| } | } | ||||
| void LookAndFeel::setColour (const int colourId, const Colour& colour) noexcept | |||||
| void LookAndFeel::setColour (int colourID, Colour newColour) noexcept | |||||
| { | { | ||||
| const int index = colourIds.indexOf (colourId); | |||||
| const ColourSetting c = { colourID, newColour }; | |||||
| const int index = colours.indexOf (c); | |||||
| if (index >= 0) | if (index >= 0) | ||||
| { | |||||
| colours.set (index, colour); | |||||
| } | |||||
| colours.getReference (index).colour = newColour; | |||||
| else | else | ||||
| { | |||||
| colourIds.add (colourId); | |||||
| colours.add (colour); | |||||
| } | |||||
| colours.add (c); | |||||
| } | } | ||||
| bool LookAndFeel::isColourSpecified (const int colourId) const noexcept | |||||
| bool LookAndFeel::isColourSpecified (const int colourID) const noexcept | |||||
| { | { | ||||
| return colourIds.contains (colourId); | |||||
| const ColourSetting c = { colourID, Colour() }; | |||||
| return colours.contains (c); | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -1371,7 +1369,6 @@ void LookAndFeel::drawLinearSliderBackground (Graphics& g, | |||||
| indent.addRoundedRectangle (x - sliderRadius * 0.5f, iy, | indent.addRoundedRectangle (x - sliderRadius * 0.5f, iy, | ||||
| width + sliderRadius, ih, | width + sliderRadius, ih, | ||||
| 5.0f); | 5.0f); | ||||
| g.fillPath (indent); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -1384,9 +1381,10 @@ void LookAndFeel::drawLinearSliderBackground (Graphics& g, | |||||
| indent.addRoundedRectangle (ix, y - sliderRadius * 0.5f, | indent.addRoundedRectangle (ix, y - sliderRadius * 0.5f, | ||||
| iw, height + sliderRadius, | iw, height + sliderRadius, | ||||
| 5.0f); | 5.0f); | ||||
| g.fillPath (indent); | |||||
| } | } | ||||
| g.fillPath (indent); | |||||
| g.setColour (Colour (0x4c000000)); | g.setColour (Colour (0x4c000000)); | ||||
| g.strokePath (indent, PathStrokeType (0.5f)); | g.strokePath (indent, PathStrokeType (0.5f)); | ||||
| } | } | ||||
| @@ -1848,8 +1846,7 @@ void LookAndFeel::drawDocumentWindowTitleBar (DocumentWindow& window, | |||||
| class LookAndFeel::GlassWindowButton : public Button | class LookAndFeel::GlassWindowButton : public Button | ||||
| { | { | ||||
| public: | public: | ||||
| //============================================================================== | |||||
| GlassWindowButton (const String& name, const Colour& col, | |||||
| GlassWindowButton (const String& name, Colour col, | |||||
| const Path& normalShape_, | const Path& normalShape_, | ||||
| const Path& toggledShape_) noexcept | const Path& toggledShape_) noexcept | ||||
| : Button (name), | : Button (name), | ||||
| @@ -1922,13 +1919,15 @@ Button* LookAndFeel::createDocumentWindowButton (int buttonType) | |||||
| return new GlassWindowButton ("close", Colour (0xffdd1100), shape, shape); | return new GlassWindowButton ("close", Colour (0xffdd1100), shape, shape); | ||||
| } | } | ||||
| else if (buttonType == DocumentWindow::minimiseButton) | |||||
| if (buttonType == DocumentWindow::minimiseButton) | |||||
| { | { | ||||
| shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness); | shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness); | ||||
| return new GlassWindowButton ("minimise", Colour (0xffaa8811), shape, shape); | return new GlassWindowButton ("minimise", Colour (0xffaa8811), shape, shape); | ||||
| } | } | ||||
| else if (buttonType == DocumentWindow::maximiseButton) | |||||
| if (buttonType == DocumentWindow::maximiseButton) | |||||
| { | { | ||||
| shape.addLineSegment (Line<float> (0.5f, 0.0f, 0.5f, 1.0f), crossThickness); | shape.addLineSegment (Line<float> (0.5f, 0.0f, 0.5f, 1.0f), crossThickness); | ||||
| shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness); | shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness); | ||||
| @@ -87,7 +87,7 @@ public: | |||||
| @see findColour, Component::findColour, Component::setColour | @see findColour, Component::findColour, Component::setColour | ||||
| */ | */ | ||||
| void setColour (int colourId, const Colour& colour) noexcept; | |||||
| void setColour (int colourId, Colour colour) noexcept; | |||||
| /** Returns true if the specified colour ID has been explicitly set using the | /** Returns true if the specified colour ID has been explicitly set using the | ||||
| setColour() method. | setColour() method. | ||||
| @@ -618,8 +618,16 @@ private: | |||||
| friend class WeakReference<LookAndFeel>; | friend class WeakReference<LookAndFeel>; | ||||
| WeakReference<LookAndFeel>::Master masterReference; | WeakReference<LookAndFeel>::Master masterReference; | ||||
| Array <int> colourIds; | |||||
| Array <Colour> colours; | |||||
| struct ColourSetting | |||||
| { | |||||
| int colourID; | |||||
| Colour colour; | |||||
| bool operator< (const ColourSetting& other) const noexcept { return colourID < other.colourID; } | |||||
| bool operator== (const ColourSetting& other) const noexcept { return colourID == other.colourID; } | |||||
| }; | |||||
| SortedSet<ColourSetting> colours; | |||||
| // default typeface names | // default typeface names | ||||
| String defaultSans, defaultSerif, defaultFixed; | String defaultSans, defaultSerif, defaultFixed; | ||||
| @@ -372,7 +372,7 @@ Font OldSchoolLookAndFeel::getComboBoxFont (ComboBox& box) | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| static void drawTriangle (Graphics& g, float x1, float y1, float x2, float y2, float x3, float y3, const Colour& fill, const Colour& outline) noexcept | |||||
| static void drawTriangle (Graphics& g, float x1, float y1, float x2, float y2, float x3, float y3, Colour fill, Colour outline) | |||||
| { | { | ||||
| Path p; | Path p; | ||||
| p.addTriangle (x1, y1, x2, y2, x3, y3); | p.addTriangle (x1, y1, x2, y2, x3, y3); | ||||