Browse Source

Minor plugin code fix + clean-ups.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
19c332a144
5 changed files with 125 additions and 126 deletions
  1. +1
    -1
      extras/audio plugins/wrapper/juce_PluginHostType.h
  2. +32
    -32
      juce_amalgamated.cpp
  3. +30
    -30
      juce_amalgamated.h
  4. +32
    -32
      src/gui/components/juce_Component.cpp
  5. +30
    -31
      src/gui/components/juce_Component.h

+ 1
- 1
extras/audio plugins/wrapper/juce_PluginHostType.h View File

@@ -133,7 +133,7 @@ private:
buffer.calloc (size + 8); buffer.calloc (size + 8);
#if JUCE_WINDOWS #if JUCE_WINDOWS
WCHAR* w = reinterpret_cast <const WCHAR*> (buffer.getData());
WCHAR* w = reinterpret_cast <WCHAR*> (buffer.getData());
GetModuleFileNameW (0, w, size / sizeof (WCHAR)); GetModuleFileNameW (0, w, size / sizeof (WCHAR));
return String (w, size); return String (w, size);
#elif JUCE_MAC #elif JUCE_MAC


+ 32
- 32
juce_amalgamated.cpp View File

@@ -38504,7 +38504,7 @@ enum ComponentMessageNumbers


static uint32 nextComponentUID = 0; static uint32 nextComponentUID = 0;


Component::Component() throw()
Component::Component()
: parentComponent_ (0), : parentComponent_ (0),
componentUID (++nextComponentUID), componentUID (++nextComponentUID),
numDeepMouseListeners (0), numDeepMouseListeners (0),
@@ -38517,7 +38517,7 @@ Component::Component() throw()
{ {
} }


Component::Component (const String& name) throw()
Component::Component (const String& name)
: componentName_ (name), : componentName_ (name),
parentComponent_ (0), parentComponent_ (0),
componentUID (++nextComponentUID), componentUID (++nextComponentUID),
@@ -38640,7 +38640,7 @@ void Component::sendVisibilityChangeMessage()
componentListeners.callChecked (checker, &ComponentListener::componentVisibilityChanged, *this); componentListeners.callChecked (checker, &ComponentListener::componentVisibilityChanged, *this);
} }


bool Component::isShowing() const throw()
bool Component::isShowing() const
{ {
if (flags.visibleFlag) if (flags.visibleFlag)
{ {
@@ -38770,12 +38770,12 @@ void Component::fadeOutComponent (const int millisecondsToFade,
setVisible (false); setVisible (false);
} }


bool Component::isValidComponent() const throw()
bool Component::isValidComponent() const
{ {
return (this != 0) && isValidMessageListener(); return (this != 0) && isValidMessageListener();
} }


void* Component::getWindowHandle() const throw()
void* Component::getWindowHandle() const
{ {
const ComponentPeer* const peer = getPeer(); const ComponentPeer* const peer = getPeer();


@@ -38913,7 +38913,7 @@ void Component::minimisationStateChanged (bool)
{ {
} }


void Component::setOpaque (const bool shouldBeOpaque) throw()
void Component::setOpaque (const bool shouldBeOpaque)
{ {
if (shouldBeOpaque != flags.opaqueFlag) if (shouldBeOpaque != flags.opaqueFlag)
{ {
@@ -38939,7 +38939,7 @@ bool Component::isOpaque() const throw()
return flags.opaqueFlag; return flags.opaqueFlag;
} }


void Component::setBufferedToImage (const bool shouldBeBuffered) throw()
void Component::setBufferedToImage (const bool shouldBeBuffered)
{ {
if (shouldBeBuffered != flags.bufferToImageFlag) if (shouldBeBuffered != flags.bufferToImageFlag)
{ {
@@ -39665,7 +39665,7 @@ Component* Component::getTopLevelComponent() const throw()
while (comp->parentComponent_ != 0) while (comp->parentComponent_ != 0)
comp = comp->parentComponent_; comp = comp->parentComponent_;


return (Component*) comp;
return const_cast <Component*> (comp);
} }


bool Component::isParentOf (const Component* possibleChild) const throw() bool Component::isParentOf (const Component* possibleChild) const throw()
@@ -39865,7 +39865,7 @@ bool Component::isCurrentlyModal() const throw()
&& getCurrentlyModalComponent() == this; && getCurrentlyModalComponent() == this;
} }


bool Component::isCurrentlyBlockedByAnotherModalComponent() const throw()
bool Component::isCurrentlyBlockedByAnotherModalComponent() const
{ {
Component* const mc = getCurrentlyModalComponent(); Component* const mc = getCurrentlyModalComponent();


@@ -39882,7 +39882,7 @@ int JUCE_CALLTYPE Component::getNumCurrentlyModalComponents() throw()


Component* JUCE_CALLTYPE Component::getCurrentlyModalComponent (int index) throw() Component* JUCE_CALLTYPE Component::getCurrentlyModalComponent (int index) throw()
{ {
Component* const c = (Component*) (modalComponentStack [modalComponentStack.size() - index - 1]);
Component* const c = static_cast <Component*> (modalComponentStack [modalComponentStack.size() - index - 1]);


return c->isValidComponent() ? c : 0; return c->isValidComponent() ? c : 0;
} }
@@ -39925,7 +39925,7 @@ bool Component::isBroughtToFrontOnMouseClick() const throw()
return flags.bringToFrontOnClickFlag; return flags.bringToFrontOnClickFlag;
} }


void Component::setMouseCursor (const MouseCursor& cursor) throw()
void Component::setMouseCursor (const MouseCursor& cursor)
{ {
cursor_ = cursor; cursor_ = cursor;


@@ -39938,7 +39938,7 @@ const MouseCursor Component::getMouseCursor()
return cursor_; return cursor_;
} }


void Component::updateMouseCursor() const throw()
void Component::updateMouseCursor() const
{ {
sendFakeMouseMove(); sendFakeMouseMove();
} }
@@ -39948,19 +39948,19 @@ void Component::setRepaintsOnMouseActivity (const bool shouldRepaint) throw()
flags.repaintOnMouseActivityFlag = shouldRepaint; flags.repaintOnMouseActivityFlag = shouldRepaint;
} }


void Component::repaintParent() throw()
void Component::repaintParent()
{ {
if (flags.visibleFlag) if (flags.visibleFlag)
internalRepaint (0, 0, getWidth(), getHeight()); internalRepaint (0, 0, getWidth(), getHeight());
} }


void Component::repaint() throw()
void Component::repaint()
{ {
repaint (0, 0, getWidth(), getHeight()); repaint (0, 0, getWidth(), getHeight());
} }


void Component::repaint (const int x, const int y, void Component::repaint (const int x, const int y,
const int w, const int h) throw()
const int w, const int h)
{ {
deleteAndZero (bufferedImage_); deleteAndZero (bufferedImage_);


@@ -40201,7 +40201,7 @@ static const var::identifier getColourPropertyId (const int colourId)
return s; return s;
} }


const Colour Component::findColour (const int colourId, const bool inheritFromParent) const throw()
const Colour Component::findColour (const int colourId, const bool inheritFromParent) const
{ {
var* v = properties.getItem (getColourPropertyId (colourId)); var* v = properties.getItem (getColourPropertyId (colourId));


@@ -40214,7 +40214,7 @@ const Colour Component::findColour (const int colourId, const bool inheritFromPa
return getLookAndFeel().findColour (colourId); return getLookAndFeel().findColour (colourId);
} }


bool Component::isColourSpecified (const int colourId) const throw()
bool Component::isColourSpecified (const int colourId) const
{ {
return properties.contains (getColourPropertyId (colourId)); return properties.contains (getColourPropertyId (colourId));
} }
@@ -40231,7 +40231,7 @@ void Component::setColour (const int colourId, const Colour& colour)
colourChanged(); colourChanged();
} }


void Component::copyAllExplicitColoursTo (Component& target) const throw()
void Component::copyAllExplicitColoursTo (Component& target) const
{ {
bool changed = false; bool changed = false;


@@ -40274,7 +40274,7 @@ const Rectangle<int> Component::getUnclippedArea() const
} }


void Component::clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect, void Component::clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect,
const int deltaX, const int deltaY) const throw()
const int deltaX, const int deltaY) const
{ {
for (int i = childComponentList_.size(); --i >= 0;) for (int i = childComponentList_.size(); --i >= 0;)
{ {
@@ -40328,7 +40328,7 @@ void Component::getVisibleArea (RectangleList& result,
void Component::subtractObscuredRegions (RectangleList& result, void Component::subtractObscuredRegions (RectangleList& result,
const Point<int>& delta, const Point<int>& delta,
const Rectangle<int>& clipRect, const Rectangle<int>& clipRect,
const Component* const compToAvoid) const throw()
const Component* const compToAvoid) const
{ {
for (int i = childComponentList_.size(); --i >= 0;) for (int i = childComponentList_.size(); --i >= 0;)
{ {
@@ -40419,12 +40419,12 @@ void Component::parentSizeChanged()
// base class does nothing // base class does nothing
} }


void Component::addComponentListener (ComponentListener* const newListener) throw()
void Component::addComponentListener (ComponentListener* const newListener)
{ {
componentListeners.add (newListener); componentListeners.add (newListener);
} }


void Component::removeComponentListener (ComponentListener* const listenerToRemove) throw()
void Component::removeComponentListener (ComponentListener* const listenerToRemove)
{ {
jassert (isValidComponent()); jassert (isValidComponent());


@@ -40474,7 +40474,7 @@ void Component::handleMessage (const Message& message)
} }
} }


void Component::postCommandMessage (const int commandId) throw()
void Component::postCommandMessage (const int commandId)
{ {
postMessage (new Message (customCommandMessage, commandId, 0, 0)); postMessage (new Message (customCommandMessage, commandId, 0, 0));
} }
@@ -40485,7 +40485,7 @@ void Component::handleCommandMessage (int)
} }


void Component::addMouseListener (MouseListener* const newListener, void Component::addMouseListener (MouseListener* const newListener,
const bool wantsEventsForAllNestedChildComponents) throw()
const bool wantsEventsForAllNestedChildComponents)
{ {
// if component methods are being called from threads other than the message // if component methods are being called from threads other than the message
// thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe. // thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe.
@@ -40508,7 +40508,7 @@ void Component::addMouseListener (MouseListener* const newListener,
} }
} }


void Component::removeMouseListener (MouseListener* const listenerToRemove) throw()
void Component::removeMouseListener (MouseListener* const listenerToRemove)
{ {
// if component methods are being called from threads other than the message // if component methods are being called from threads other than the message
// thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe. // thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe.
@@ -41319,12 +41319,12 @@ bool Component::isFocusContainer() const throw()
return flags.isFocusContainerFlag; return flags.isFocusContainerFlag;
} }


int Component::getExplicitFocusOrder() const throw()
int Component::getExplicitFocusOrder() const
{ {
return properties ["_jexfo"]; return properties ["_jexfo"];
} }


void Component::setExplicitFocusOrder (const int newFocusOrderIndex) throw()
void Component::setExplicitFocusOrder (const int newFocusOrderIndex)
{ {
properties.set ("_jexfo", newFocusOrderIndex); properties.set ("_jexfo", newFocusOrderIndex);
} }
@@ -41481,7 +41481,7 @@ void Component::moveKeyboardFocusToSibling (const bool moveToNext)
} }
} }


bool Component::hasKeyboardFocus (const bool trueIfChildIsFocused) const throw()
bool Component::hasKeyboardFocus (const bool trueIfChildIsFocused) const
{ {
return (currentlyFocusedComponent == this) return (currentlyFocusedComponent == this)
|| (trueIfChildIsFocused && isParentOf (currentlyFocusedComponent)); || (trueIfChildIsFocused && isParentOf (currentlyFocusedComponent));
@@ -41528,14 +41528,14 @@ const Point<int> Component::getMouseXYRelative() const
return globalPositionToRelative (Desktop::getMousePosition()); return globalPositionToRelative (Desktop::getMousePosition());
} }


const Rectangle<int> Component::getParentMonitorArea() const throw()
const Rectangle<int> Component::getParentMonitorArea() const
{ {
return Desktop::getInstance() return Desktop::getInstance()
.getMonitorAreaContaining (relativePositionToGlobal (Point<int> (getWidth() / 2, .getMonitorAreaContaining (relativePositionToGlobal (Point<int> (getWidth() / 2,
getHeight() / 2))); getHeight() / 2)));
} }


void Component::addKeyListener (KeyListener* const newListener) throw()
void Component::addKeyListener (KeyListener* const newListener)
{ {
if (keyListeners_ == 0) if (keyListeners_ == 0)
keyListeners_ = new VoidArray(); keyListeners_ = new VoidArray();
@@ -41543,7 +41543,7 @@ void Component::addKeyListener (KeyListener* const newListener) throw()
keyListeners_->addIfNotAlreadyThere (newListener); keyListeners_->addIfNotAlreadyThere (newListener);
} }


void Component::removeKeyListener (KeyListener* const listenerToRemove) throw()
void Component::removeKeyListener (KeyListener* const listenerToRemove)
{ {
if (keyListeners_ != 0) if (keyListeners_ != 0)
keyListeners_->removeValue (listenerToRemove); keyListeners_->removeValue (listenerToRemove);
@@ -41572,7 +41572,7 @@ void Component::internalModifierKeysChanged()
modifierKeysChanged (ModifierKeys::getCurrentModifiers()); modifierKeysChanged (ModifierKeys::getCurrentModifiers());
} }


ComponentPeer* Component::getPeer() const throw()
ComponentPeer* Component::getPeer() const
{ {
if (flags.hasHeavyweightPeerFlag) if (flags.hasHeavyweightPeerFlag)
return ComponentPeer::getPeerFor (this); return ComponentPeer::getPeerFor (this);


+ 30
- 30
juce_amalgamated.h View File

@@ -12194,17 +12194,17 @@ class JUCE_API Component : public MouseListener,
{ {
public: public:


Component() throw();
Component();


virtual ~Component(); virtual ~Component();


Component (const String& componentName) throw();
Component (const String& componentName);


const String& getName() const throw() { return componentName_; } const String& getName() const throw() { return componentName_; }


virtual void setName (const String& newName); virtual void setName (const String& newName);


bool isValidComponent() const throw();
bool isValidComponent() const;


virtual void setVisible (bool shouldBeVisible); virtual void setVisible (bool shouldBeVisible);


@@ -12212,7 +12212,7 @@ public:


virtual void visibilityChanged(); virtual void visibilityChanged();


bool isShowing() const throw();
bool isShowing() const;


void fadeOutComponent (const int lengthOfFadeOutInMilliseconds, void fadeOutComponent (const int lengthOfFadeOutInMilliseconds,
const int deltaXToMove = 0, const int deltaXToMove = 0,
@@ -12226,7 +12226,7 @@ public:


bool isOnDesktop() const throw(); bool isOnDesktop() const throw();


ComponentPeer* getPeer() const throw();
ComponentPeer* getPeer() const;


virtual void userTriedToCloseWindow(); virtual void userTriedToCloseWindow();


@@ -12309,7 +12309,7 @@ public:


int getParentHeight() const throw(); int getParentHeight() const throw();


const Rectangle<int> getParentMonitorArea() const throw();
const Rectangle<int> getParentMonitorArea() const;


int getNumChildComponents() const throw(); int getNumChildComponents() const throw();


@@ -12375,12 +12375,12 @@ public:


Component* getComponentAt (const Point<int>& position); Component* getComponentAt (const Point<int>& position);


void repaint() throw();
void repaint();


void repaint (const int x, const int y, void repaint (const int x, const int y,
const int width, const int height) throw();
const int width, const int height);


void setBufferedToImage (const bool shouldBeBuffered) throw();
void setBufferedToImage (const bool shouldBeBuffered);


Image* createComponentSnapshot (const Rectangle<int>& areaToGrab, Image* createComponentSnapshot (const Rectangle<int>& areaToGrab,
const bool clipImageToComponentBounds = true); const bool clipImageToComponentBounds = true);
@@ -12399,7 +12399,7 @@ public:


void sendLookAndFeelChange(); void sendLookAndFeelChange();


void setOpaque (const bool shouldBeOpaque) throw();
void setOpaque (const bool shouldBeOpaque);


bool isOpaque() const throw(); bool isOpaque() const throw();


@@ -12419,7 +12419,7 @@ public:


void grabKeyboardFocus(); void grabKeyboardFocus();


bool hasKeyboardFocus (const bool trueIfChildIsFocused) const throw();
bool hasKeyboardFocus (const bool trueIfChildIsFocused) const;


static Component* JUCE_CALLTYPE getCurrentlyFocusedComponent() throw(); static Component* JUCE_CALLTYPE getCurrentlyFocusedComponent() throw();


@@ -12427,9 +12427,9 @@ public:


virtual KeyboardFocusTraverser* createFocusTraverser(); virtual KeyboardFocusTraverser* createFocusTraverser();


int getExplicitFocusOrder() const throw();
int getExplicitFocusOrder() const;


void setExplicitFocusOrder (const int newFocusOrderIndex) throw();
void setExplicitFocusOrder (const int newFocusOrderIndex);


void setFocusContainer (const bool shouldBeFocusContainer) throw(); void setFocusContainer (const bool shouldBeFocusContainer) throw();


@@ -12441,11 +12441,11 @@ public:


virtual void enablementChanged(); virtual void enablementChanged();


void setMouseCursor (const MouseCursor& cursorType) throw();
void setMouseCursor (const MouseCursor& cursorType);


virtual const MouseCursor getMouseCursor(); virtual const MouseCursor getMouseCursor();


void updateMouseCursor() const throw();
void updateMouseCursor() const;


virtual void paint (Graphics& g); virtual void paint (Graphics& g);


@@ -12474,13 +12474,13 @@ public:
void setRepaintsOnMouseActivity (const bool shouldRepaint) throw(); void setRepaintsOnMouseActivity (const bool shouldRepaint) throw();


void addMouseListener (MouseListener* const newListener, void addMouseListener (MouseListener* const newListener,
const bool wantsEventsForAllNestedChildComponents) throw();
const bool wantsEventsForAllNestedChildComponents);


void removeMouseListener (MouseListener* const listenerToRemove) throw();
void removeMouseListener (MouseListener* const listenerToRemove);


void addKeyListener (KeyListener* const newListener) throw();
void addKeyListener (KeyListener* const newListener);


void removeKeyListener (KeyListener* const listenerToRemove) throw();
void removeKeyListener (KeyListener* const listenerToRemove);


virtual bool keyPressed (const KeyPress& key); virtual bool keyPressed (const KeyPress& key);


@@ -12521,11 +12521,11 @@ public:


virtual void broughtToFront(); virtual void broughtToFront();


void addComponentListener (ComponentListener* const newListener) throw();
void addComponentListener (ComponentListener* const newListener);


void removeComponentListener (ComponentListener* const listenerToRemove) throw();
void removeComponentListener (ComponentListener* const listenerToRemove);


void postCommandMessage (const int commandId) throw();
void postCommandMessage (const int commandId);


virtual void handleCommandMessage (int commandId); virtual void handleCommandMessage (int commandId);


@@ -12541,7 +12541,7 @@ public:


static Component* JUCE_CALLTYPE getCurrentlyModalComponent (int index = 0) throw(); static Component* JUCE_CALLTYPE getCurrentlyModalComponent (int index = 0) throw();


bool isCurrentlyBlockedByAnotherModalComponent() const throw();
bool isCurrentlyBlockedByAnotherModalComponent() const;


virtual bool canModalEventBeSentToComponent (const Component* targetComponent); virtual bool canModalEventBeSentToComponent (const Component* targetComponent);


@@ -12551,19 +12551,19 @@ public:


const NamedValueSet& getProperties() const throw() { return properties; } const NamedValueSet& getProperties() const throw() { return properties; }


const Colour findColour (const int colourId, const bool inheritFromParent = false) const throw();
const Colour findColour (const int colourId, const bool inheritFromParent = false) const;


void setColour (const int colourId, const Colour& colour); void setColour (const int colourId, const Colour& colour);


void removeColour (const int colourId); void removeColour (const int colourId);


bool isColourSpecified (const int colourId) const throw();
bool isColourSpecified (const int colourId) const;


void copyAllExplicitColoursTo (Component& target) const throw();
void copyAllExplicitColoursTo (Component& target) const;


virtual void colourChanged(); virtual void colourChanged();


void* getWindowHandle() const throw();
void* getWindowHandle() const;


uint32 getComponentUID() const throw() { return componentUID; } uint32 getComponentUID() const throw() { return componentUID; }


@@ -12697,7 +12697,7 @@ private:
void internalHierarchyChanged(); void internalHierarchyChanged();
void renderComponent (Graphics& context); void renderComponent (Graphics& context);
void sendMovedResizedMessages (const bool wasMoved, const bool wasResized); void sendMovedResizedMessages (const bool wasMoved, const bool wasResized);
void repaintParent() throw();
void repaintParent();
void sendFakeMouseMove() const; void sendFakeMouseMove() const;
void takeKeyboardFocus (const FocusChangeType cause); void takeKeyboardFocus (const FocusChangeType cause);
void grabFocusInternal (const FocusChangeType cause, const bool canTryParent = true); void grabFocusInternal (const FocusChangeType cause, const bool canTryParent = true);
@@ -12707,9 +12707,9 @@ private:
static void bringModalComponentToFront(); static void bringModalComponentToFront();
void subtractObscuredRegions (RectangleList& result, const Point<int>& delta, void subtractObscuredRegions (RectangleList& result, const Point<int>& delta,
const Rectangle<int>& clipRect, const Rectangle<int>& clipRect,
const Component* const compToAvoid) const throw();
const Component* const compToAvoid) const;
void clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect, void clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect,
const int deltaX, const int deltaY) const throw();
const int deltaX, const int deltaY) const;


// how much of the component is not off the edges of its parents // how much of the component is not off the edges of its parents
const Rectangle<int> getUnclippedArea() const; const Rectangle<int> getUnclippedArea() const;


+ 32
- 32
src/gui/components/juce_Component.cpp View File

@@ -62,7 +62,7 @@ static uint32 nextComponentUID = 0;
//============================================================================== //==============================================================================
Component::Component() throw()
Component::Component()
: parentComponent_ (0), : parentComponent_ (0),
componentUID (++nextComponentUID), componentUID (++nextComponentUID),
numDeepMouseListeners (0), numDeepMouseListeners (0),
@@ -75,7 +75,7 @@ Component::Component() throw()
{ {
} }
Component::Component (const String& name) throw()
Component::Component (const String& name)
: componentName_ (name), : componentName_ (name),
parentComponent_ (0), parentComponent_ (0),
componentUID (++nextComponentUID), componentUID (++nextComponentUID),
@@ -199,7 +199,7 @@ void Component::sendVisibilityChangeMessage()
componentListeners.callChecked (checker, &ComponentListener::componentVisibilityChanged, *this); componentListeners.callChecked (checker, &ComponentListener::componentVisibilityChanged, *this);
} }
bool Component::isShowing() const throw()
bool Component::isShowing() const
{ {
if (flags.visibleFlag) if (flags.visibleFlag)
{ {
@@ -332,12 +332,12 @@ void Component::fadeOutComponent (const int millisecondsToFade,
//============================================================================== //==============================================================================
bool Component::isValidComponent() const throw()
bool Component::isValidComponent() const
{ {
return (this != 0) && isValidMessageListener(); return (this != 0) && isValidMessageListener();
} }
void* Component::getWindowHandle() const throw()
void* Component::getWindowHandle() const
{ {
const ComponentPeer* const peer = getPeer(); const ComponentPeer* const peer = getPeer();
@@ -477,7 +477,7 @@ void Component::minimisationStateChanged (bool)
} }
//============================================================================== //==============================================================================
void Component::setOpaque (const bool shouldBeOpaque) throw()
void Component::setOpaque (const bool shouldBeOpaque)
{ {
if (shouldBeOpaque != flags.opaqueFlag) if (shouldBeOpaque != flags.opaqueFlag)
{ {
@@ -504,7 +504,7 @@ bool Component::isOpaque() const throw()
} }
//============================================================================== //==============================================================================
void Component::setBufferedToImage (const bool shouldBeBuffered) throw()
void Component::setBufferedToImage (const bool shouldBeBuffered)
{ {
if (shouldBeBuffered != flags.bufferToImageFlag) if (shouldBeBuffered != flags.bufferToImageFlag)
{ {
@@ -1237,7 +1237,7 @@ Component* Component::getTopLevelComponent() const throw()
while (comp->parentComponent_ != 0) while (comp->parentComponent_ != 0)
comp = comp->parentComponent_; comp = comp->parentComponent_;
return (Component*) comp;
return const_cast <Component*> (comp);
} }
bool Component::isParentOf (const Component* possibleChild) const throw() bool Component::isParentOf (const Component* possibleChild) const throw()
@@ -1439,7 +1439,7 @@ bool Component::isCurrentlyModal() const throw()
&& getCurrentlyModalComponent() == this; && getCurrentlyModalComponent() == this;
} }
bool Component::isCurrentlyBlockedByAnotherModalComponent() const throw()
bool Component::isCurrentlyBlockedByAnotherModalComponent() const
{ {
Component* const mc = getCurrentlyModalComponent(); Component* const mc = getCurrentlyModalComponent();
@@ -1456,7 +1456,7 @@ int JUCE_CALLTYPE Component::getNumCurrentlyModalComponents() throw()
Component* JUCE_CALLTYPE Component::getCurrentlyModalComponent (int index) throw() Component* JUCE_CALLTYPE Component::getCurrentlyModalComponent (int index) throw()
{ {
Component* const c = (Component*) (modalComponentStack [modalComponentStack.size() - index - 1]);
Component* const c = static_cast <Component*> (modalComponentStack [modalComponentStack.size() - index - 1]);
return c->isValidComponent() ? c : 0; return c->isValidComponent() ? c : 0;
} }
@@ -1501,7 +1501,7 @@ bool Component::isBroughtToFrontOnMouseClick() const throw()
} }
//============================================================================== //==============================================================================
void Component::setMouseCursor (const MouseCursor& cursor) throw()
void Component::setMouseCursor (const MouseCursor& cursor)
{ {
cursor_ = cursor; cursor_ = cursor;
@@ -1514,7 +1514,7 @@ const MouseCursor Component::getMouseCursor()
return cursor_; return cursor_;
} }
void Component::updateMouseCursor() const throw()
void Component::updateMouseCursor() const
{ {
sendFakeMouseMove(); sendFakeMouseMove();
} }
@@ -1526,19 +1526,19 @@ void Component::setRepaintsOnMouseActivity (const bool shouldRepaint) throw()
} }
//============================================================================== //==============================================================================
void Component::repaintParent() throw()
void Component::repaintParent()
{ {
if (flags.visibleFlag) if (flags.visibleFlag)
internalRepaint (0, 0, getWidth(), getHeight()); internalRepaint (0, 0, getWidth(), getHeight());
} }
void Component::repaint() throw()
void Component::repaint()
{ {
repaint (0, 0, getWidth(), getHeight()); repaint (0, 0, getWidth(), getHeight());
} }
void Component::repaint (const int x, const int y, void Component::repaint (const int x, const int y,
const int w, const int h) throw()
const int w, const int h)
{ {
deleteAndZero (bufferedImage_); deleteAndZero (bufferedImage_);
@@ -1782,7 +1782,7 @@ static const var::identifier getColourPropertyId (const int colourId)
return s; return s;
} }
const Colour Component::findColour (const int colourId, const bool inheritFromParent) const throw()
const Colour Component::findColour (const int colourId, const bool inheritFromParent) const
{ {
var* v = properties.getItem (getColourPropertyId (colourId)); var* v = properties.getItem (getColourPropertyId (colourId));
@@ -1795,7 +1795,7 @@ const Colour Component::findColour (const int colourId, const bool inheritFromPa
return getLookAndFeel().findColour (colourId); return getLookAndFeel().findColour (colourId);
} }
bool Component::isColourSpecified (const int colourId) const throw()
bool Component::isColourSpecified (const int colourId) const
{ {
return properties.contains (getColourPropertyId (colourId)); return properties.contains (getColourPropertyId (colourId));
} }
@@ -1812,7 +1812,7 @@ void Component::setColour (const int colourId, const Colour& colour)
colourChanged(); colourChanged();
} }
void Component::copyAllExplicitColoursTo (Component& target) const throw()
void Component::copyAllExplicitColoursTo (Component& target) const
{ {
bool changed = false; bool changed = false;
@@ -1856,7 +1856,7 @@ const Rectangle<int> Component::getUnclippedArea() const
} }
void Component::clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect, void Component::clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect,
const int deltaX, const int deltaY) const throw()
const int deltaX, const int deltaY) const
{ {
for (int i = childComponentList_.size(); --i >= 0;) for (int i = childComponentList_.size(); --i >= 0;)
{ {
@@ -1910,7 +1910,7 @@ void Component::getVisibleArea (RectangleList& result,
void Component::subtractObscuredRegions (RectangleList& result, void Component::subtractObscuredRegions (RectangleList& result,
const Point<int>& delta, const Point<int>& delta,
const Rectangle<int>& clipRect, const Rectangle<int>& clipRect,
const Component* const compToAvoid) const throw()
const Component* const compToAvoid) const
{ {
for (int i = childComponentList_.size(); --i >= 0;) for (int i = childComponentList_.size(); --i >= 0;)
{ {
@@ -2004,12 +2004,12 @@ void Component::parentSizeChanged()
// base class does nothing // base class does nothing
} }
void Component::addComponentListener (ComponentListener* const newListener) throw()
void Component::addComponentListener (ComponentListener* const newListener)
{ {
componentListeners.add (newListener); componentListeners.add (newListener);
} }
void Component::removeComponentListener (ComponentListener* const listenerToRemove) throw()
void Component::removeComponentListener (ComponentListener* const listenerToRemove)
{ {
jassert (isValidComponent()); jassert (isValidComponent());
@@ -2064,7 +2064,7 @@ void Component::handleMessage (const Message& message)
} }
//============================================================================== //==============================================================================
void Component::postCommandMessage (const int commandId) throw()
void Component::postCommandMessage (const int commandId)
{ {
postMessage (new Message (customCommandMessage, commandId, 0, 0)); postMessage (new Message (customCommandMessage, commandId, 0, 0));
} }
@@ -2076,7 +2076,7 @@ void Component::handleCommandMessage (int)
//============================================================================== //==============================================================================
void Component::addMouseListener (MouseListener* const newListener, void Component::addMouseListener (MouseListener* const newListener,
const bool wantsEventsForAllNestedChildComponents) throw()
const bool wantsEventsForAllNestedChildComponents)
{ {
// if component methods are being called from threads other than the message // if component methods are being called from threads other than the message
// thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe. // thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe.
@@ -2099,7 +2099,7 @@ void Component::addMouseListener (MouseListener* const newListener,
} }
} }
void Component::removeMouseListener (MouseListener* const listenerToRemove) throw()
void Component::removeMouseListener (MouseListener* const listenerToRemove)
{ {
// if component methods are being called from threads other than the message // if component methods are being called from threads other than the message
// thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe. // thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe.
@@ -2917,12 +2917,12 @@ bool Component::isFocusContainer() const throw()
return flags.isFocusContainerFlag; return flags.isFocusContainerFlag;
} }
int Component::getExplicitFocusOrder() const throw()
int Component::getExplicitFocusOrder() const
{ {
return properties ["_jexfo"]; return properties ["_jexfo"];
} }
void Component::setExplicitFocusOrder (const int newFocusOrderIndex) throw()
void Component::setExplicitFocusOrder (const int newFocusOrderIndex)
{ {
properties.set ("_jexfo", newFocusOrderIndex); properties.set ("_jexfo", newFocusOrderIndex);
} }
@@ -3079,7 +3079,7 @@ void Component::moveKeyboardFocusToSibling (const bool moveToNext)
} }
} }
bool Component::hasKeyboardFocus (const bool trueIfChildIsFocused) const throw()
bool Component::hasKeyboardFocus (const bool trueIfChildIsFocused) const
{ {
return (currentlyFocusedComponent == this) return (currentlyFocusedComponent == this)
|| (trueIfChildIsFocused && isParentOf (currentlyFocusedComponent)); || (trueIfChildIsFocused && isParentOf (currentlyFocusedComponent));
@@ -3128,7 +3128,7 @@ const Point<int> Component::getMouseXYRelative() const
} }
//============================================================================== //==============================================================================
const Rectangle<int> Component::getParentMonitorArea() const throw()
const Rectangle<int> Component::getParentMonitorArea() const
{ {
return Desktop::getInstance() return Desktop::getInstance()
.getMonitorAreaContaining (relativePositionToGlobal (Point<int> (getWidth() / 2, .getMonitorAreaContaining (relativePositionToGlobal (Point<int> (getWidth() / 2,
@@ -3136,7 +3136,7 @@ const Rectangle<int> Component::getParentMonitorArea() const throw()
} }
//============================================================================== //==============================================================================
void Component::addKeyListener (KeyListener* const newListener) throw()
void Component::addKeyListener (KeyListener* const newListener)
{ {
if (keyListeners_ == 0) if (keyListeners_ == 0)
keyListeners_ = new VoidArray(); keyListeners_ = new VoidArray();
@@ -3144,7 +3144,7 @@ void Component::addKeyListener (KeyListener* const newListener) throw()
keyListeners_->addIfNotAlreadyThere (newListener); keyListeners_->addIfNotAlreadyThere (newListener);
} }
void Component::removeKeyListener (KeyListener* const listenerToRemove) throw()
void Component::removeKeyListener (KeyListener* const listenerToRemove)
{ {
if (keyListeners_ != 0) if (keyListeners_ != 0)
keyListeners_->removeValue (listenerToRemove); keyListeners_->removeValue (listenerToRemove);
@@ -3174,7 +3174,7 @@ void Component::internalModifierKeysChanged()
} }
//============================================================================== //==============================================================================
ComponentPeer* Component::getPeer() const throw()
ComponentPeer* Component::getPeer() const
{ {
if (flags.hasHeavyweightPeerFlag) if (flags.hasHeavyweightPeerFlag)
return ComponentPeer::getPeerFor (this); return ComponentPeer::getPeerFor (this);


+ 30
- 31
src/gui/components/juce_Component.h View File

@@ -67,7 +67,7 @@ public:
subclass of Component or use one of the other types of component from subclass of Component or use one of the other types of component from
the library. the library.
*/ */
Component() throw();
Component();
/** Destructor. /** Destructor.
@@ -81,7 +81,7 @@ public:
@see getName, setName @see getName, setName
*/ */
Component (const String& componentName) throw();
Component (const String& componentName);
/** Returns the name of this component. /** Returns the name of this component.
@@ -109,7 +109,7 @@ public:
same memory address which this one occupied, this methods can return a same memory address which this one occupied, this methods can return a
false positive. false positive.
*/ */
bool isValidComponent() const throw();
bool isValidComponent() const;
//============================================================================== //==============================================================================
/** Makes the component visible or invisible. /** Makes the component visible or invisible.
@@ -148,7 +148,7 @@ public:
@returns true only if this component and all its parents are visible. @returns true only if this component and all its parents are visible.
@see isVisible @see isVisible
*/ */
bool isShowing() const throw();
bool isShowing() const;
/** Makes a component invisible using a groovy fade-out and animated zoom effect. /** Makes a component invisible using a groovy fade-out and animated zoom effect.
@@ -227,7 +227,7 @@ public:
@see addToDesktop, isOnDesktop @see addToDesktop, isOnDesktop
*/ */
ComponentPeer* getPeer() const throw();
ComponentPeer* getPeer() const;
/** For components on the desktop, this is called if the system wants to close the window. /** For components on the desktop, this is called if the system wants to close the window.
@@ -515,7 +515,7 @@ public:
monitors, it will return the area of the monitor that contains the component's monitors, it will return the area of the monitor that contains the component's
centre. centre.
*/ */
const Rectangle<int> getParentMonitorArea() const throw();
const Rectangle<int> getParentMonitorArea() const;
//============================================================================== //==============================================================================
/** Returns the number of child components that this component contains. /** Returns the number of child components that this component contains.
@@ -805,7 +805,7 @@ public:
@see paint @see paint
*/ */
void repaint() throw();
void repaint();
/** Marks a subsection of this component as needing to be redrawn. /** Marks a subsection of this component as needing to be redrawn.
@@ -821,7 +821,7 @@ public:
@see repaint() @see repaint()
*/ */
void repaint (const int x, const int y, void repaint (const int x, const int y,
const int width, const int height) throw();
const int width, const int height);
//============================================================================== //==============================================================================
/** Makes the component use an internal buffer to optimise its redrawing. /** Makes the component use an internal buffer to optimise its redrawing.
@@ -841,7 +841,7 @@ public:
@see repaint, paint, createComponentSnapshot @see repaint, paint, createComponentSnapshot
*/ */
void setBufferedToImage (const bool shouldBeBuffered) throw();
void setBufferedToImage (const bool shouldBeBuffered);
/** Generates a snapshot of part of this component. /** Generates a snapshot of part of this component.
@@ -963,7 +963,7 @@ public:
@see isOpaque, getVisibleArea @see isOpaque, getVisibleArea
*/ */
void setOpaque (const bool shouldBeOpaque) throw();
void setOpaque (const bool shouldBeOpaque);
/** Returns true if no parts of this component are transparent. /** Returns true if no parts of this component are transparent.
@@ -1064,7 +1064,7 @@ public:
@see grabKeyboardFocus, setWantsKeyboardFocus, getCurrentlyFocusedComponent, @see grabKeyboardFocus, setWantsKeyboardFocus, getCurrentlyFocusedComponent,
focusGained, focusLost focusGained, focusLost
*/ */
bool hasKeyboardFocus (const bool trueIfChildIsFocused) const throw();
bool hasKeyboardFocus (const bool trueIfChildIsFocused) const;
/** Returns the component that currently has the keyboard focus. /** Returns the component that currently has the keyboard focus.
@@ -1117,7 +1117,7 @@ public:
@see moveKeyboardFocusToSibling, createFocusTraverser, KeyboardFocusTraverser @see moveKeyboardFocusToSibling, createFocusTraverser, KeyboardFocusTraverser
*/ */
int getExplicitFocusOrder() const throw();
int getExplicitFocusOrder() const;
/** Sets the index used in determining the order in which focusable components /** Sets the index used in determining the order in which focusable components
should be traversed. should be traversed.
@@ -1127,7 +1127,7 @@ public:
@see getExplicitFocusOrder, moveKeyboardFocusToSibling @see getExplicitFocusOrder, moveKeyboardFocusToSibling
*/ */
void setExplicitFocusOrder (const int newFocusOrderIndex) throw();
void setExplicitFocusOrder (const int newFocusOrderIndex);
/** Indicates whether this component is a parent for components that can have /** Indicates whether this component is a parent for components that can have
their focus traversed. their focus traversed.
@@ -1197,7 +1197,7 @@ public:
@see MouseCursor @see MouseCursor
*/ */
void setMouseCursor (const MouseCursor& cursorType) throw();
void setMouseCursor (const MouseCursor& cursorType);
/** Returns the mouse cursor shape to use when the mouse is over this component. /** Returns the mouse cursor shape to use when the mouse is over this component.
@@ -1218,7 +1218,7 @@ public:
This isn't needed if you're only using setMouseCursor(). This isn't needed if you're only using setMouseCursor().
*/ */
void updateMouseCursor() const throw();
void updateMouseCursor() const;
//============================================================================== //==============================================================================
/** Components can override this method to draw their content. /** Components can override this method to draw their content.
@@ -1438,13 +1438,12 @@ public:
@see MouseListener, removeMouseListener @see MouseListener, removeMouseListener
*/ */
void addMouseListener (MouseListener* const newListener, void addMouseListener (MouseListener* const newListener,
const bool wantsEventsForAllNestedChildComponents) throw();
const bool wantsEventsForAllNestedChildComponents);
/** Deregisters a mouse listener. /** Deregisters a mouse listener.
@see addMouseListener, MouseListener @see addMouseListener, MouseListener
*/ */
void removeMouseListener (MouseListener* const listenerToRemove) throw();
void removeMouseListener (MouseListener* const listenerToRemove);
//============================================================================== //==============================================================================
/** Adds a listener that wants to hear about keypresses that this component receives. /** Adds a listener that wants to hear about keypresses that this component receives.
@@ -1457,13 +1456,13 @@ public:
@see keyPressed, keyStateChanged, removeKeyListener @see keyPressed, keyStateChanged, removeKeyListener
*/ */
void addKeyListener (KeyListener* const newListener) throw();
void addKeyListener (KeyListener* const newListener);
/** Removes a previously-registered key listener. /** Removes a previously-registered key listener.
@see addKeyListener @see addKeyListener
*/ */
void removeKeyListener (KeyListener* const listenerToRemove) throw();
void removeKeyListener (KeyListener* const listenerToRemove);
/** Called when a key is pressed. /** Called when a key is pressed.
@@ -1673,13 +1672,13 @@ public:
will be ignored. will be ignored.
@see ComponentListener, removeComponentListener @see ComponentListener, removeComponentListener
*/ */
void addComponentListener (ComponentListener* const newListener) throw();
void addComponentListener (ComponentListener* const newListener);
/** Removes a component listener. /** Removes a component listener.
@see addComponentListener @see addComponentListener
*/ */
void removeComponentListener (ComponentListener* const listenerToRemove) throw();
void removeComponentListener (ComponentListener* const listenerToRemove);
//============================================================================== //==============================================================================
/** Dispatches a numbered message to this component. /** Dispatches a numbered message to this component.
@@ -1693,7 +1692,7 @@ public:
@see handleCommandMessage @see handleCommandMessage
*/ */
void postCommandMessage (const int commandId) throw();
void postCommandMessage (const int commandId);
/** Called to handle a command that was sent by postCommandMessage(). /** Called to handle a command that was sent by postCommandMessage().
@@ -1782,7 +1781,7 @@ public:
@see runModalLoop, getCurrentlyModalComponent @see runModalLoop, getCurrentlyModalComponent
*/ */
bool isCurrentlyBlockedByAnotherModalComponent() const throw();
bool isCurrentlyBlockedByAnotherModalComponent() const;
/** When a component is modal, this callback allows it to choose which other /** When a component is modal, this callback allows it to choose which other
components can still receive events. components can still receive events.
@@ -1838,7 +1837,7 @@ public:
@see setColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour @see setColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour
*/ */
const Colour findColour (const int colourId, const bool inheritFromParent = false) const throw();
const Colour findColour (const int colourId, const bool inheritFromParent = false) const;
/** Registers a colour to be used for a particular purpose. /** Registers a colour to be used for a particular purpose.
@@ -1861,12 +1860,12 @@ public:
/** Returns true if the specified colour ID has been explicitly set for this /** Returns true if the specified colour ID has been explicitly set for this
component using the setColour() method. component using the setColour() method.
*/ */
bool isColourSpecified (const int colourId) const throw();
bool isColourSpecified (const int colourId) const;
/** This looks for any colours that have been specified for this component, /** This looks for any colours that have been specified for this component,
and copies them to the specified target component. and copies them to the specified target component.
*/ */
void copyAllExplicitColoursTo (Component& target) const throw();
void copyAllExplicitColoursTo (Component& target) const;
/** This method is called when a colour is changed by the setColour() method. /** This method is called when a colour is changed by the setColour() method.
@@ -1879,7 +1878,7 @@ public:
This is platform-dependent and strictly for power-users only! This is platform-dependent and strictly for power-users only!
*/ */
void* getWindowHandle() const throw();
void* getWindowHandle() const;
/** When created, each component is given a number to uniquely identify it. /** When created, each component is given a number to uniquely identify it.
@@ -2057,7 +2056,7 @@ private:
void internalHierarchyChanged(); void internalHierarchyChanged();
void renderComponent (Graphics& context); void renderComponent (Graphics& context);
void sendMovedResizedMessages (const bool wasMoved, const bool wasResized); void sendMovedResizedMessages (const bool wasMoved, const bool wasResized);
void repaintParent() throw();
void repaintParent();
void sendFakeMouseMove() const; void sendFakeMouseMove() const;
void takeKeyboardFocus (const FocusChangeType cause); void takeKeyboardFocus (const FocusChangeType cause);
void grabFocusInternal (const FocusChangeType cause, const bool canTryParent = true); void grabFocusInternal (const FocusChangeType cause, const bool canTryParent = true);
@@ -2067,9 +2066,9 @@ private:
static void bringModalComponentToFront(); static void bringModalComponentToFront();
void subtractObscuredRegions (RectangleList& result, const Point<int>& delta, void subtractObscuredRegions (RectangleList& result, const Point<int>& delta,
const Rectangle<int>& clipRect, const Rectangle<int>& clipRect,
const Component* const compToAvoid) const throw();
const Component* const compToAvoid) const;
void clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect, void clipObscuredRegions (Graphics& g, const Rectangle<int>& clipRect,
const int deltaX, const int deltaY) const throw();
const int deltaX, const int deltaY) const;
// how much of the component is not off the edges of its parents // how much of the component is not off the edges of its parents
const Rectangle<int> getUnclippedArea() const; const Rectangle<int> getUnclippedArea() const;


Loading…
Cancel
Save