Browse Source

More minor nullptr stuff.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
0271fdf167
19 changed files with 116 additions and 108 deletions
  1. +50
    -50
      juce_amalgamated.cpp
  2. +8
    -4
      juce_amalgamated.h
  3. +2
    -2
      src/audio/midi/juce_MidiMessage.cpp
  4. +6
    -6
      src/gui/components/juce_Component.cpp
  5. +2
    -2
      src/gui/components/juce_Desktop.cpp
  6. +1
    -1
      src/gui/components/lookandfeel/juce_LookAndFeel.h
  7. +1
    -1
      src/gui/components/menus/juce_MenuBarComponent.h
  8. +2
    -2
      src/gui/components/menus/juce_PopupMenu.cpp
  9. +4
    -4
      src/gui/components/mouse/juce_DragAndDropContainer.cpp
  10. +16
    -16
      src/gui/components/mouse/juce_MouseInputSource.cpp
  11. +1
    -1
      src/gui/components/windows/juce_TooltipWindow.cpp
  12. +1
    -1
      src/gui/components/windows/juce_TopLevelWindow.cpp
  13. +1
    -1
      src/io/files/juce_DirectoryIterator.cpp
  14. +6
    -2
      src/io/files/juce_DirectoryIterator.h
  15. +1
    -1
      src/io/files/juce_FileInputStream.cpp
  16. +1
    -1
      src/io/files/juce_FileOutputStream.cpp
  17. +4
    -4
      src/io/streams/juce_OutputStream.cpp
  18. +5
    -5
      src/text/juce_XmlElement.cpp
  19. +4
    -4
      src/threads/juce_Thread.cpp

+ 50
- 50
juce_amalgamated.cpp View File

@@ -7084,16 +7084,16 @@ void juce_CheckForDanglingStreams()
OutputStream::OutputStream()
: newLineString (NewLine::getDefault())
{
#if JUCE_DEBUG
#if JUCE_DEBUG
activeStreams.add (this);
#endif
#endif
}

OutputStream::~OutputStream()
{
#if JUCE_DEBUG
#if JUCE_DEBUG
activeStreams.removeValue (this);
#endif
#endif
}

void OutputStream::writeBool (const bool b)
@@ -7370,7 +7370,7 @@ DirectoryIterator::~DirectoryIterator()

bool DirectoryIterator::next()
{
return next (0, 0, 0, 0, 0, 0);
return next (nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
}

bool DirectoryIterator::next (bool* const isDirResult, bool* const isHiddenResult, int64* const fileSize,
@@ -8458,7 +8458,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos);

FileInputStream::FileInputStream (const File& f)
: file (f),
fileHandle (0),
fileHandle (nullptr),
currentPosition (0),
totalSize (0),
needToSeek (true)
@@ -8523,7 +8523,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos);

FileOutputStream::FileOutputStream (const File& f, const int bufferSize_)
: file (f),
fileHandle (0),
fileHandle (nullptr),
currentPosition (0),
bufferSize (bufferSize_),
bytesInBuffer (0),
@@ -15323,11 +15323,11 @@ XmlElement::XmlAttributeNode::XmlAttributeNode (const String& name_, const Strin
: name (name_),
value (value_)
{
#if JUCE_DEBUG
#if JUCE_DEBUG
// this checks whether the attribute name string contains any illegal characters..
for (String::CharPointerType t (name.getCharPointer()); ! t.isEmpty(); ++t)
jassert (t.isLetterOrDigit() || *t == '_' || *t == '-' || *t == ':');
#endif
#endif
}

inline bool XmlElement::XmlAttributeNode::hasName (const String& nameToMatch) const noexcept
@@ -15640,7 +15640,7 @@ bool XmlElement::writeToFile (const File& file,

bool XmlElement::hasTagName (const String& tagNameWanted) const noexcept
{
#if JUCE_DEBUG
#if JUCE_DEBUG
// if debugging, check that the case is actually the same, because
// valid xml is case-sensitive, and although this lets it pass, it's
// better not to..
@@ -15653,9 +15653,9 @@ bool XmlElement::hasTagName (const String& tagNameWanted) const noexcept
{
return false;
}
#else
#else
return tagName.equalsIgnoreCase (tagNameWanted);
#endif
#endif
}

XmlElement* XmlElement::getNextElementWithTagName (const String& requiredTagName) const
@@ -16413,7 +16413,7 @@ void Thread::startThread()

threadShouldExit_ = false;

if (threadHandle_ == 0)
if (threadHandle_ == nullptr)
{
launchThread();
setThreadPriority (threadHandle_, threadPriority_);
@@ -16425,7 +16425,7 @@ void Thread::startThread (const int priority)
{
const ScopedLock sl (startStopLock);

if (threadHandle_ == 0)
if (threadHandle_ == nullptr)
{
threadPriority_ = priority;
startThread();
@@ -16438,7 +16438,7 @@ void Thread::startThread (const int priority)

bool Thread::isThreadRunning() const
{
return threadHandle_ != 0;
return threadHandle_ != nullptr;
}

void Thread::signalThreadShouldExit()
@@ -16491,7 +16491,7 @@ void Thread::stopThread (const int timeOutMilliseconds)
killThread();

RunningThreadsList::getInstance().remove (this);
threadHandle_ = 0;
threadHandle_ = nullptr;
threadId_ = 0;
}
}
@@ -29428,7 +29428,7 @@ const String MidiMessage::getRhythmInstrumentName (const int n)
"Mute Triangle", "Open Triangle"
};

return (n >= 35 && n <= 81) ? names [n - 35] : (const char*) 0;
return (n >= 35 && n <= 81) ? names [n - 35] : (const char*) nullptr;
}

const String MidiMessage::getControllerName (const int n)
@@ -29459,7 +29459,7 @@ const String MidiMessage::getControllerName (const int n)
"Poly Operation"
};

return isPositiveAndBelow (n, (int) 128) ? names[n] : (const char*) 0;
return isPositiveAndBelow (n, (int) 128) ? names[n] : (const char*) nullptr;
}

END_JUCE_NAMESPACE
@@ -40246,12 +40246,12 @@ const Rectangle<int> Component::getLocalArea (const Component* source, const Rec

const Point<int> Component::localPointToGlobal (const Point<int>& point) const
{
return ComponentHelpers::convertCoordinate (0, this, point);
return ComponentHelpers::convertCoordinate (nullptr, this, point);
}

const Rectangle<int> Component::localAreaToGlobal (const Rectangle<int>& area) const
{
return ComponentHelpers::convertCoordinate (0, this, area);
return ComponentHelpers::convertCoordinate (nullptr, this, area);
}

/* Deprecated methods... */
@@ -40262,7 +40262,7 @@ const Point<int> Component::relativePositionToGlobal (const Point<int>& relative

const Point<int> Component::globalPositionToRelative (const Point<int>& screenPosition) const
{
return getLocalPoint (0, screenPosition);
return getLocalPoint (nullptr, screenPosition);
}

const Point<int> Component::relativePositionToOtherComponent (const Component* const targetComponent, const Point<int>& positionRelativeToThis) const
@@ -41741,7 +41741,7 @@ void Component::internalMouseUp (MouseInputSource& source, const Point<int>& rel

const MouseEvent me (source, relativePos,
oldModifiers, this, this, time,
getLocalPoint (0, source.getLastMouseDownPosition()),
getLocalPoint (nullptr, source.getLastMouseDownPosition()),
source.getLastMouseDownTime(),
source.getNumberOfMultipleClicks(),
source.hasMouseMovedSignificantlySincePressed());
@@ -41784,7 +41784,7 @@ void Component::internalMouseDrag (MouseInputSource& source, const Point<int>& r

const MouseEvent me (source, relativePos,
source.getCurrentModifiers(), this, this, time,
getLocalPoint (0, source.getLastMouseDownPosition()),
getLocalPoint (nullptr, source.getLastMouseDownPosition()),
source.getLastMouseDownTime(),
source.getNumberOfMultipleClicks(),
source.hasMouseMovedSignificantlySincePressed());
@@ -42232,7 +42232,7 @@ bool JUCE_CALLTYPE Component::isMouseButtonDownAnywhere() noexcept

const Point<int> Component::getMouseXYRelative() const
{
return getLocalPoint (0, Desktop::getMousePosition());
return getLocalPoint (nullptr, Desktop::getMousePosition());
}

const Rectangle<int> Component::getParentMonitorArea() const
@@ -42440,7 +42440,7 @@ Component* Desktop::findComponentAt (const Point<int>& screenPosition) const

if (c->isVisible())
{
const Point<int> relative (c->getLocalPoint (0, screenPosition));
const Point<int> relative (c->getLocalPoint (nullptr, screenPosition));

if (c->contains (relative))
return c->getComponentAt (relative);
@@ -42632,7 +42632,7 @@ void Desktop::sendMouseMove()
if (target != nullptr)
{
Component::BailOutChecker checker (target);
const Point<int> pos (target->getLocalPoint (0, lastFakeMouseMove));
const Point<int> pos (target->getLocalPoint (nullptr, lastFakeMouseMove));
const Time now (Time::getCurrentTime());

const MouseEvent me (getMainMouseSource(), pos, ModifierKeys::getCurrentModifiers(),
@@ -69560,7 +69560,7 @@ public:
// move rather than a real timer callback

const Point<int> globalMousePos (Desktop::getMousePosition());
const Point<int> localMousePos (getLocalPoint (0, globalMousePos));
const Point<int> localMousePos (getLocalPoint (nullptr, globalMousePos));

const uint32 now = Time::getMillisecondCounter();

@@ -69721,7 +69721,7 @@ private:

void updateMouseOverStatus (const Point<int>& globalMousePos)
{
const Point<int> relPos (getLocalPoint (0, globalMousePos));
const Point<int> relPos (getLocalPoint (nullptr, globalMousePos));
isOver = reallyContains (relPos, true);

if (activeSubMenu != nullptr)
@@ -70869,7 +70869,7 @@ public:
}
else
{
const Point<int> relPos (hit->getLocalPoint (0, screenPos));
const Point<int> relPos (hit->getLocalPoint (nullptr, screenPos));
hit = hit->getComponentAt (relPos.getX(), relPos.getY());
}

@@ -70883,7 +70883,7 @@ public:

if (ddt != nullptr && ddt->isInterestedInDragSource (dragDescLocal, source))
{
relativePos = hit->getLocalPoint (0, screenPos);
relativePos = hit->getLocalPoint (nullptr, screenPos);
return ddt;
}

@@ -70958,7 +70958,7 @@ public:
Point<int> newPos (screenPos + imageOffset);

if (getParentComponent() != nullptr)
newPos = getParentComponent()->getLocalPoint (0, newPos);
newPos = getParentComponent()->getLocalPoint (nullptr, newPos);

//if (newX != getX() || newY != getY())
{
@@ -71101,7 +71101,7 @@ void DragAndDropContainer::startDragging (const String& sourceDescription,
const int lo = 150;
const int hi = 400;

Point<int> relPos (sourceComponent->getLocalPoint (0, lastMouseDown));
Point<int> relPos (sourceComponent->getLocalPoint (nullptr, lastMouseDown));
Point<int> clipped (dragImage.getBounds().getConstrainedPoint (relPos));

for (int y = dragImage.getHeight(); --y >= 0;)
@@ -71565,7 +71565,7 @@ public:
if (peer != nullptr)
{
Component* const comp = peer->getComponent();
const Point<int> relativePos (comp->getLocalPoint (0, screenPos));
const Point<int> relativePos (comp->getLocalPoint (nullptr, screenPos));

// (the contains() call is needed to test for overlapping desktop windows)
if (comp->contains (relativePos))
@@ -71585,44 +71585,44 @@ public:

void sendMouseEnter (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " enter: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseEnter (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " enter: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseEnter (source, comp->getLocalPoint (nullptr, screenPos), time);
}

void sendMouseExit (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " exit: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseExit (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " exit: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseExit (source, comp->getLocalPoint (nullptr, screenPos), time);
}

void sendMouseMove (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " move: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseMove (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " move: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseMove (source, comp->getLocalPoint (nullptr, screenPos), time);
}

void sendMouseDown (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " down: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDown (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " down: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDown (source, comp->getLocalPoint (nullptr, screenPos), time);
}

void sendMouseDrag (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " drag: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDrag (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " drag: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDrag (source, comp->getLocalPoint (nullptr, screenPos), time);
}

void sendMouseUp (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " up: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseUp (source, comp->getLocalPoint (0, screenPos), time, getCurrentModifiers());
//DBG ("Mouse " + String (source.getIndex()) + " up: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseUp (source, comp->getLocalPoint (nullptr, screenPos), time, getCurrentModifiers());
}

void sendMouseWheel (Component* const comp, const Point<int>& screenPos, const Time& time, float x, float y)
{
//DBG ("Mouse " + String (source.getIndex()) + " wheel: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseWheel (source, comp->getLocalPoint (0, screenPos), time, x, y);
//DBG ("Mouse " + String (source.getIndex()) + " wheel: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseWheel (source, comp->getLocalPoint (nullptr, screenPos), time, x, y);
}

// (returns true if the button change caused a modal event loop)
@@ -71703,7 +71703,7 @@ public:

if (newPeer != lastPeer)
{
setComponentUnderMouse (0, screenPos, time);
setComponentUnderMouse (nullptr, screenPos, time);
lastPeer = newPeer;
setComponentUnderMouse (findComponentAt (screenPos), screenPos, time);
}
@@ -79042,7 +79042,7 @@ void TooltipWindow::showFor (const String& tip)
Point<int> mousePos (Desktop::getMousePosition());

if (getParentComponent() != nullptr)
mousePos = getParentComponent()->getLocalPoint (0, mousePos);
mousePos = getParentComponent()->getLocalPoint (nullptr, mousePos);

int x, y, w, h;
getLookAndFeel().getTooltipSize (tip, w, h);
@@ -79408,7 +79408,7 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const

if (getParentComponent() != nullptr)
{
targetCentre = getParentComponent()->getLocalPoint (0, targetCentre);
targetCentre = getParentComponent()->getLocalPoint (nullptr, targetCentre);
parentArea = getParentComponent()->getLocalBounds();
}



+ 8
- 4
juce_amalgamated.h View File

@@ -18986,8 +18986,12 @@ public:
false if there are no more matching files. If it returns false, then none of the
parameters will be filled-in.
*/
bool next (bool* isDirectory, bool* isHidden, int64* fileSize,
Time* modTime, Time* creationTime, bool* isReadOnly);
bool next (bool* isDirectory,
bool* isHidden,
int64* fileSize,
Time* modTime,
Time* creationTime,
bool* isReadOnly);

/** Returns the file that the iterator is currently pointing at.

@@ -60278,7 +60282,7 @@ public:
/** Changes the default look-and-feel.

@param newDefaultLookAndFeel the new look-and-feel object to use - if this is
set to 0, it will revert to using the default one. The
set to null, it will revert to using the default one. The
object passed-in must be deleted by the caller when
it's no longer needed.
@see getDefaultLookAndFeel
@@ -60992,7 +60996,7 @@ public:

/** Changes the model object to use to control the bar.

This can be 0, in which case the bar will be empty. Don't delete the object
This can be a null pointer, in which case the bar will be empty. Don't delete the object
that is passed-in while it's still being used by this MenuBar.
*/
void setModel (MenuBarModel* newModel);


+ 2
- 2
src/audio/midi/juce_MidiMessage.cpp View File

@@ -1059,7 +1059,7 @@ const String MidiMessage::getRhythmInstrumentName (const int n)
"Mute Triangle", "Open Triangle"
};
return (n >= 35 && n <= 81) ? names [n - 35] : (const char*) 0;
return (n >= 35 && n <= 81) ? names [n - 35] : (const char*) nullptr;
}
const String MidiMessage::getControllerName (const int n)
@@ -1090,7 +1090,7 @@ const String MidiMessage::getControllerName (const int n)
"Poly Operation"
};
return isPositiveAndBelow (n, (int) 128) ? names[n] : (const char*) 0;
return isPositiveAndBelow (n, (int) 128) ? names[n] : (const char*) nullptr;
}
END_JUCE_NAMESPACE

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

@@ -947,12 +947,12 @@ const Rectangle<int> Component::getLocalArea (const Component* source, const Rec
const Point<int> Component::localPointToGlobal (const Point<int>& point) const
{
return ComponentHelpers::convertCoordinate (0, this, point);
return ComponentHelpers::convertCoordinate (nullptr, this, point);
}
const Rectangle<int> Component::localAreaToGlobal (const Rectangle<int>& area) const
{
return ComponentHelpers::convertCoordinate (0, this, area);
return ComponentHelpers::convertCoordinate (nullptr, this, area);
}
/* Deprecated methods... */
@@ -963,7 +963,7 @@ const Point<int> Component::relativePositionToGlobal (const Point<int>& relative
const Point<int> Component::globalPositionToRelative (const Point<int>& screenPosition) const
{
return getLocalPoint (0, screenPosition);
return getLocalPoint (nullptr, screenPosition);
}
const Point<int> Component::relativePositionToOtherComponent (const Component* const targetComponent, const Point<int>& positionRelativeToThis) const
@@ -2473,7 +2473,7 @@ void Component::internalMouseUp (MouseInputSource& source, const Point<int>& rel
const MouseEvent me (source, relativePos,
oldModifiers, this, this, time,
getLocalPoint (0, source.getLastMouseDownPosition()),
getLocalPoint (nullptr, source.getLastMouseDownPosition()),
source.getLastMouseDownTime(),
source.getNumberOfMultipleClicks(),
source.hasMouseMovedSignificantlySincePressed());
@@ -2516,7 +2516,7 @@ void Component::internalMouseDrag (MouseInputSource& source, const Point<int>& r
const MouseEvent me (source, relativePos,
source.getCurrentModifiers(), this, this, time,
getLocalPoint (0, source.getLastMouseDownPosition()),
getLocalPoint (nullptr, source.getLastMouseDownPosition()),
source.getLastMouseDownTime(),
source.getNumberOfMultipleClicks(),
source.hasMouseMovedSignificantlySincePressed());
@@ -2967,7 +2967,7 @@ bool JUCE_CALLTYPE Component::isMouseButtonDownAnywhere() noexcept
const Point<int> Component::getMouseXYRelative() const
{
return getLocalPoint (0, Desktop::getMousePosition());
return getLocalPoint (nullptr, Desktop::getMousePosition());
}
//==============================================================================


+ 2
- 2
src/gui/components/juce_Desktop.cpp View File

@@ -156,7 +156,7 @@ Component* Desktop::findComponentAt (const Point<int>& screenPosition) const
if (c->isVisible())
{
const Point<int> relative (c->getLocalPoint (0, screenPosition));
const Point<int> relative (c->getLocalPoint (nullptr, screenPosition));
if (c->contains (relative))
return c->getComponentAt (relative);
@@ -353,7 +353,7 @@ void Desktop::sendMouseMove()
if (target != nullptr)
{
Component::BailOutChecker checker (target);
const Point<int> pos (target->getLocalPoint (0, lastFakeMouseMove));
const Point<int> pos (target->getLocalPoint (nullptr, lastFakeMouseMove));
const Time now (Time::getCurrentTime());
const MouseEvent me (getMainMouseSource(), pos, ModifierKeys::getCurrentModifiers(),


+ 1
- 1
src/gui/components/lookandfeel/juce_LookAndFeel.h View File

@@ -88,7 +88,7 @@ public:
/** Changes the default look-and-feel.
@param newDefaultLookAndFeel the new look-and-feel object to use - if this is
set to 0, it will revert to using the default one. The
set to null, it will revert to using the default one. The
object passed-in must be deleted by the caller when
it's no longer needed.
@see getDefaultLookAndFeel


+ 1
- 1
src/gui/components/menus/juce_MenuBarComponent.h View File

@@ -55,7 +55,7 @@ public:
//==============================================================================
/** Changes the model object to use to control the bar.
This can be 0, in which case the bar will be empty. Don't delete the object
This can be a null pointer, in which case the bar will be empty. Don't delete the object
that is passed-in while it's still being used by this MenuBar.
*/
void setModel (MenuBarModel* newModel);


+ 2
- 2
src/gui/components/menus/juce_PopupMenu.cpp View File

@@ -538,7 +538,7 @@ public:
// move rather than a real timer callback
const Point<int> globalMousePos (Desktop::getMousePosition());
const Point<int> localMousePos (getLocalPoint (0, globalMousePos));
const Point<int> localMousePos (getLocalPoint (nullptr, globalMousePos));
const uint32 now = Time::getMillisecondCounter();
@@ -701,7 +701,7 @@ private:
void updateMouseOverStatus (const Point<int>& globalMousePos)
{
const Point<int> relPos (getLocalPoint (0, globalMousePos));
const Point<int> relPos (getLocalPoint (nullptr, globalMousePos));
isOver = reallyContains (relPos, true);
if (activeSubMenu != nullptr)


+ 4
- 4
src/gui/components/mouse/juce_DragAndDropContainer.cpp View File

@@ -110,7 +110,7 @@ public:
}
else
{
const Point<int> relPos (hit->getLocalPoint (0, screenPos));
const Point<int> relPos (hit->getLocalPoint (nullptr, screenPos));
hit = hit->getComponentAt (relPos.getX(), relPos.getY());
}
@@ -124,7 +124,7 @@ public:
if (ddt != nullptr && ddt->isInterestedInDragSource (dragDescLocal, source))
{
relativePos = hit->getLocalPoint (0, screenPos);
relativePos = hit->getLocalPoint (nullptr, screenPos);
return ddt;
}
@@ -199,7 +199,7 @@ public:
Point<int> newPos (screenPos + imageOffset);
if (getParentComponent() != nullptr)
newPos = getParentComponent()->getLocalPoint (0, newPos);
newPos = getParentComponent()->getLocalPoint (nullptr, newPos);
//if (newX != getX() || newY != getY())
{
@@ -344,7 +344,7 @@ void DragAndDropContainer::startDragging (const String& sourceDescription,
const int lo = 150;
const int hi = 400;
Point<int> relPos (sourceComponent->getLocalPoint (0, lastMouseDown));
Point<int> relPos (sourceComponent->getLocalPoint (nullptr, lastMouseDown));
Point<int> clipped (dragImage.getBounds().getConstrainedPoint (relPos));
for (int y = dragImage.getHeight(); --y >= 0;)


+ 16
- 16
src/gui/components/mouse/juce_MouseInputSource.cpp View File

@@ -79,7 +79,7 @@ public:
if (peer != nullptr)
{
Component* const comp = peer->getComponent();
const Point<int> relativePos (comp->getLocalPoint (0, screenPos));
const Point<int> relativePos (comp->getLocalPoint (nullptr, screenPos));
// (the contains() call is needed to test for overlapping desktop windows)
if (comp->contains (relativePos))
@@ -100,44 +100,44 @@ public:
//==============================================================================
void sendMouseEnter (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " enter: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseEnter (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " enter: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseEnter (source, comp->getLocalPoint (nullptr, screenPos), time);
}
void sendMouseExit (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " exit: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseExit (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " exit: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseExit (source, comp->getLocalPoint (nullptr, screenPos), time);
}
void sendMouseMove (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " move: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseMove (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " move: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseMove (source, comp->getLocalPoint (nullptr, screenPos), time);
}
void sendMouseDown (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " down: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDown (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " down: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDown (source, comp->getLocalPoint (nullptr, screenPos), time);
}
void sendMouseDrag (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " drag: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDrag (source, comp->getLocalPoint (0, screenPos), time);
//DBG ("Mouse " + String (source.getIndex()) + " drag: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseDrag (source, comp->getLocalPoint (nullptr, screenPos), time);
}
void sendMouseUp (Component* const comp, const Point<int>& screenPos, const Time& time)
{
//DBG ("Mouse " + String (source.getIndex()) + " up: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseUp (source, comp->getLocalPoint (0, screenPos), time, getCurrentModifiers());
//DBG ("Mouse " + String (source.getIndex()) + " up: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseUp (source, comp->getLocalPoint (nullptr, screenPos), time, getCurrentModifiers());
}
void sendMouseWheel (Component* const comp, const Point<int>& screenPos, const Time& time, float x, float y)
{
//DBG ("Mouse " + String (source.getIndex()) + " wheel: " + comp->getLocalPoint (0, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseWheel (source, comp->getLocalPoint (0, screenPos), time, x, y);
//DBG ("Mouse " + String (source.getIndex()) + " wheel: " + comp->getLocalPoint (nullptr, screenPos).toString() + " - Comp: " + String::toHexString ((int) comp));
comp->internalMouseWheel (source, comp->getLocalPoint (nullptr, screenPos), time, x, y);
}
//==============================================================================
@@ -219,7 +219,7 @@ public:
if (newPeer != lastPeer)
{
setComponentUnderMouse (0, screenPos, time);
setComponentUnderMouse (nullptr, screenPos, time);
lastPeer = newPeer;
setComponentUnderMouse (findComponentAt (screenPos), screenPos, time);
}


+ 1
- 1
src/gui/components/windows/juce_TooltipWindow.cpp View File

@@ -87,7 +87,7 @@ void TooltipWindow::showFor (const String& tip)
Point<int> mousePos (Desktop::getMousePosition());
if (getParentComponent() != nullptr)
mousePos = getParentComponent()->getLocalPoint (0, mousePos);
mousePos = getParentComponent()->getLocalPoint (nullptr, mousePos);
int x, y, w, h;
getLookAndFeel().getTooltipSize (tip, w, h);


+ 1
- 1
src/gui/components/windows/juce_TopLevelWindow.cpp View File

@@ -298,7 +298,7 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const
if (getParentComponent() != nullptr)
{
targetCentre = getParentComponent()->getLocalPoint (0, targetCentre);
targetCentre = getParentComponent()->getLocalPoint (nullptr, targetCentre);
parentArea = getParentComponent()->getLocalBounds();
}


+ 1
- 1
src/io/files/juce_DirectoryIterator.cpp View File

@@ -55,7 +55,7 @@ DirectoryIterator::~DirectoryIterator()
bool DirectoryIterator::next()
{
return next (0, 0, 0, 0, 0, 0);
return next (nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
}
bool DirectoryIterator::next (bool* const isDirResult, bool* const isHiddenResult, int64* const fileSize,


+ 6
- 2
src/io/files/juce_DirectoryIterator.h View File

@@ -95,8 +95,12 @@ public:
false if there are no more matching files. If it returns false, then none of the
parameters will be filled-in.
*/
bool next (bool* isDirectory, bool* isHidden, int64* fileSize,
Time* modTime, Time* creationTime, bool* isReadOnly);
bool next (bool* isDirectory,
bool* isHidden,
int64* fileSize,
Time* modTime,
Time* creationTime,
bool* isReadOnly);
/** Returns the file that the iterator is currently pointing at.


+ 1
- 1
src/io/files/juce_FileInputStream.cpp View File

@@ -37,7 +37,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos);
//==============================================================================
FileInputStream::FileInputStream (const File& f)
: file (f),
fileHandle (0),
fileHandle (nullptr),
currentPosition (0),
totalSize (0),
needToSeek (true)


+ 1
- 1
src/io/files/juce_FileOutputStream.cpp View File

@@ -35,7 +35,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos);
//==============================================================================
FileOutputStream::FileOutputStream (const File& f, const int bufferSize_)
: file (f),
fileHandle (0),
fileHandle (nullptr),
currentPosition (0),
bufferSize (bufferSize_),
bytesInBuffer (0),


+ 4
- 4
src/io/streams/juce_OutputStream.cpp View File

@@ -53,16 +53,16 @@ void juce_CheckForDanglingStreams()
OutputStream::OutputStream()
: newLineString (NewLine::getDefault())
{
#if JUCE_DEBUG
#if JUCE_DEBUG
activeStreams.add (this);
#endif
#endif
}
OutputStream::~OutputStream()
{
#if JUCE_DEBUG
#if JUCE_DEBUG
activeStreams.removeValue (this);
#endif
#endif
}
//==============================================================================


+ 5
- 5
src/text/juce_XmlElement.cpp View File

@@ -45,11 +45,11 @@ XmlElement::XmlAttributeNode::XmlAttributeNode (const String& name_, const Strin
: name (name_),
value (value_)
{
#if JUCE_DEBUG
#if JUCE_DEBUG
// this checks whether the attribute name string contains any illegal characters..
for (String::CharPointerType t (name.getCharPointer()); ! t.isEmpty(); ++t)
jassert (t.isLetterOrDigit() || *t == '_' || *t == '-' || *t == ':');
#endif
#endif
}
inline bool XmlElement::XmlAttributeNode::hasName (const String& nameToMatch) const noexcept
@@ -365,7 +365,7 @@ bool XmlElement::writeToFile (const File& file,
//==============================================================================
bool XmlElement::hasTagName (const String& tagNameWanted) const noexcept
{
#if JUCE_DEBUG
#if JUCE_DEBUG
// if debugging, check that the case is actually the same, because
// valid xml is case-sensitive, and although this lets it pass, it's
// better not to..
@@ -378,9 +378,9 @@ bool XmlElement::hasTagName (const String& tagNameWanted) const noexcept
{
return false;
}
#else
#else
return tagName.equalsIgnoreCase (tagNameWanted);
#endif
#endif
}
XmlElement* XmlElement::getNextElementWithTagName (const String& requiredTagName) const


+ 4
- 4
src/threads/juce_Thread.cpp View File

@@ -180,7 +180,7 @@ void Thread::startThread()
threadShouldExit_ = false;
if (threadHandle_ == 0)
if (threadHandle_ == nullptr)
{
launchThread();
setThreadPriority (threadHandle_, threadPriority_);
@@ -192,7 +192,7 @@ void Thread::startThread (const int priority)
{
const ScopedLock sl (startStopLock);
if (threadHandle_ == 0)
if (threadHandle_ == nullptr)
{
threadPriority_ = priority;
startThread();
@@ -205,7 +205,7 @@ void Thread::startThread (const int priority)
bool Thread::isThreadRunning() const
{
return threadHandle_ != 0;
return threadHandle_ != nullptr;
}
//==============================================================================
@@ -259,7 +259,7 @@ void Thread::stopThread (const int timeOutMilliseconds)
killThread();
RunningThreadsList::getInstance().remove (this);
threadHandle_ = 0;
threadHandle_ = nullptr;
threadId_ = 0;
}
}


Loading…
Cancel
Save