@@ -1285,10 +1285,10 @@ public: | |||
case audioMasterSizeWindow: | |||
if (AudioProcessorEditor* ed = getActiveEditor()) | |||
{ | |||
#if JUCE_LINUX | |||
#if JUCE_LINUX | |||
const MessageManagerLock mmLock; | |||
#endif | |||
ed->setSize (index, (int) value); | |||
#endif | |||
ed->setSize (index, (int) value); | |||
} | |||
return 1; | |||
@@ -1978,7 +1978,10 @@ public: | |||
#elif JUCE_LINUX | |||
if (pluginWindow != 0) | |||
{ | |||
XMoveResizeWindow (display, pluginWindow, pos.getX(), pos.getY(), getWidth(), getHeight()); | |||
XMoveResizeWindow (display, pluginWindow, | |||
pos.getX(), pos.getY(), | |||
(unsigned int) getWidth(), | |||
(unsigned int) getHeight()); | |||
XMapRaised (display, pluginWindow); | |||
XFlush (display); | |||
} | |||
@@ -112,10 +112,10 @@ public: | |||
{ | |||
const LockType::ScopedLockType sl (lock); | |||
while (firstTimer != nullptr && firstTimer->countdownMs <= 0) | |||
while (firstTimer != nullptr && firstTimer->timerCountdownMs <= 0) | |||
{ | |||
Timer* const t = firstTimer; | |||
t->countdownMs = t->periodMs; | |||
t->timerCountdownMs = t->timerPeriodMs; | |||
removeTimer (t); | |||
addTimer (t); | |||
@@ -169,11 +169,11 @@ public: | |||
{ | |||
if (instance != nullptr) | |||
{ | |||
tim->countdownMs = newCounter; | |||
tim->periodMs = newCounter; | |||
tim->timerCountdownMs = newCounter; | |||
tim->timerPeriodMs = newCounter; | |||
if ((tim->next != nullptr && tim->next->countdownMs < tim->countdownMs) | |||
|| (tim->previous != nullptr && tim->previous->countdownMs > tim->countdownMs)) | |||
if ((tim->nextTimer != nullptr && tim->nextTimer->timerCountdownMs < tim->timerCountdownMs) | |||
|| (tim->previousTimer != nullptr && tim->previousTimer->timerCountdownMs > tim->timerCountdownMs)) | |||
{ | |||
instance->removeTimer (tim); | |||
instance->addTimer (tim); | |||
@@ -210,28 +210,28 @@ private: | |||
Timer* i = firstTimer; | |||
if (i == nullptr || i->countdownMs > t->countdownMs) | |||
if (i == nullptr || i->timerCountdownMs > t->timerCountdownMs) | |||
{ | |||
t->next = firstTimer; | |||
t->nextTimer = firstTimer; | |||
firstTimer = t; | |||
} | |||
else | |||
{ | |||
while (i->next != nullptr && i->next->countdownMs <= t->countdownMs) | |||
i = i->next; | |||
while (i->nextTimer != nullptr && i->nextTimer->timerCountdownMs <= t->timerCountdownMs) | |||
i = i->nextTimer; | |||
jassert (i != nullptr); | |||
t->next = i->next; | |||
t->previous = i; | |||
i->next = t; | |||
t->nextTimer = i->nextTimer; | |||
t->previousTimer = i; | |||
i->nextTimer = t; | |||
} | |||
if (t->next != nullptr) | |||
t->next->previous = t; | |||
if (t->nextTimer != nullptr) | |||
t->nextTimer->previousTimer = t; | |||
jassert ((t->next == nullptr || t->next->countdownMs >= t->countdownMs) | |||
&& (t->previous == nullptr || t->previous->countdownMs <= t->countdownMs)); | |||
jassert ((t->nextTimer == nullptr || t->nextTimer->timerCountdownMs >= t->timerCountdownMs) | |||
&& (t->previousTimer == nullptr || t->previousTimer->timerCountdownMs <= t->timerCountdownMs)); | |||
notify(); | |||
} | |||
@@ -244,32 +244,32 @@ private: | |||
jassert (timerExists (t)); | |||
#endif | |||
if (t->previous != nullptr) | |||
if (t->previousTimer != nullptr) | |||
{ | |||
jassert (firstTimer != t); | |||
t->previous->next = t->next; | |||
t->previousTimer->nextTimer = t->nextTimer; | |||
} | |||
else | |||
{ | |||
jassert (firstTimer == t); | |||
firstTimer = t->next; | |||
firstTimer = t->nextTimer; | |||
} | |||
if (t->next != nullptr) | |||
t->next->previous = t->previous; | |||
if (t->nextTimer != nullptr) | |||
t->nextTimer->previousTimer = t->previousTimer; | |||
t->next = nullptr; | |||
t->previous = nullptr; | |||
t->nextTimer = nullptr; | |||
t->previousTimer = nullptr; | |||
} | |||
int getTimeUntilFirstTimer (const int numMillisecsElapsed) const | |||
{ | |||
const LockType::ScopedLockType sl (lock); | |||
for (Timer* t = firstTimer; t != nullptr; t = t->next) | |||
t->countdownMs -= numMillisecsElapsed; | |||
for (Timer* t = firstTimer; t != nullptr; t = t->nextTimer) | |||
t->timerCountdownMs -= numMillisecsElapsed; | |||
return firstTimer != nullptr ? firstTimer->countdownMs : 1000; | |||
return firstTimer != nullptr ? firstTimer->timerCountdownMs : 1000; | |||
} | |||
void handleAsyncUpdate() override | |||
@@ -280,7 +280,7 @@ private: | |||
#if JUCE_DEBUG | |||
bool timerExists (Timer* const t) const noexcept | |||
{ | |||
for (Timer* tt = firstTimer; tt != nullptr; tt = tt->next) | |||
for (Timer* tt = firstTimer; tt != nullptr; tt = tt->nextTimer) | |||
if (tt == t) | |||
return true; | |||
@@ -296,18 +296,18 @@ Timer::TimerThread::LockType Timer::TimerThread::lock; | |||
//============================================================================== | |||
Timer::Timer() noexcept | |||
: countdownMs (0), | |||
periodMs (0), | |||
previous (nullptr), | |||
next (nullptr) | |||
: timerCountdownMs (0), | |||
timerPeriodMs (0), | |||
previousTimer (nullptr), | |||
nextTimer (nullptr) | |||
{ | |||
} | |||
Timer::Timer (const Timer&) noexcept | |||
: countdownMs (0), | |||
periodMs (0), | |||
previous (nullptr), | |||
next (nullptr) | |||
: timerCountdownMs (0), | |||
timerPeriodMs (0), | |||
previousTimer (nullptr), | |||
nextTimer (nullptr) | |||
{ | |||
} | |||
@@ -320,10 +320,10 @@ void Timer::startTimer (const int interval) noexcept | |||
{ | |||
const TimerThread::LockType::ScopedLockType sl (TimerThread::lock); | |||
if (periodMs == 0) | |||
if (timerPeriodMs == 0) | |||
{ | |||
countdownMs = interval; | |||
periodMs = jmax (1, interval); | |||
timerCountdownMs = interval; | |||
timerPeriodMs = jmax (1, interval); | |||
TimerThread::add (this); | |||
} | |||
else | |||
@@ -344,10 +344,10 @@ void Timer::stopTimer() noexcept | |||
{ | |||
const TimerThread::LockType::ScopedLockType sl (TimerThread::lock); | |||
if (periodMs > 0) | |||
if (timerPeriodMs > 0) | |||
{ | |||
TimerThread::remove (this); | |||
periodMs = 0; | |||
timerPeriodMs = 0; | |||
} | |||
} | |||
@@ -54,7 +54,6 @@ class JUCE_API Timer | |||
protected: | |||
//============================================================================== | |||
/** Creates a Timer. | |||
When created, the timer is stopped, so use startTimer() to get it going. | |||
*/ | |||
Timer() noexcept; | |||
@@ -64,7 +63,7 @@ protected: | |||
Note that this timer won't be started, even if the one you're copying | |||
is running. | |||
*/ | |||
Timer (const Timer& other) noexcept; | |||
Timer (const Timer&) noexcept; | |||
public: | |||
//============================================================================== | |||
@@ -86,8 +85,8 @@ public: | |||
time between calling this method and the next timer callback | |||
will not be less than the interval length passed in. | |||
@param intervalInMilliseconds the interval to use (any values less than 1 will be | |||
rounded up to 1) | |||
@param intervalInMilliseconds the interval to use (any value less | |||
than 1 will be rounded up to 1) | |||
*/ | |||
void startTimer (int intervalInMilliseconds) noexcept; | |||
@@ -108,12 +107,12 @@ public: | |||
//============================================================================== | |||
/** Returns true if the timer is currently running. */ | |||
bool isTimerRunning() const noexcept { return periodMs > 0; } | |||
bool isTimerRunning() const noexcept { return timerPeriodMs > 0; } | |||
/** Returns the timer's interval. | |||
@returns the timer's interval in milliseconds if it's running, or 0 if it's not. | |||
*/ | |||
int getTimerInterval() const noexcept { return periodMs; } | |||
int getTimerInterval() const noexcept { return timerPeriodMs; } | |||
//============================================================================== | |||
@@ -125,11 +124,10 @@ public: | |||
private: | |||
class TimerThread; | |||
friend class TimerThread; | |||
int countdownMs, periodMs; | |||
Timer* previous; | |||
Timer* next; | |||
int timerCountdownMs, timerPeriodMs; // NB: these member variable names are a little verbose | |||
Timer* previousTimer, *nextTimer; // to reduce risk of name-clashes with user subclasses | |||
Timer& operator= (const Timer&); | |||
Timer& operator= (const Timer&) JUCE_DELETED_FUNCTION; | |||
}; | |||
#endif // JUCE_TIMER_H_INCLUDED |
@@ -154,7 +154,7 @@ private: | |||
bool shouldBailOut() const noexcept | |||
{ | |||
return checker.shouldBailOut() || safePointer == 0; | |||
return checker.shouldBailOut() || safePointer == nullptr; | |||
} | |||
private: | |||
@@ -22,8 +22,8 @@ | |||
============================================================================== | |||
*/ | |||
extern Display* display; | |||
extern Window juce_messageWindowHandle; | |||
extern ::Display* display; | |||
extern ::Window juce_messageWindowHandle; | |||
namespace ClipboardHelpers | |||
{ | |||
@@ -22,7 +22,7 @@ | |||
============================================================================== | |||
*/ | |||
extern Display* display; | |||
extern ::Display* display; | |||
extern XContext windowHandleXContext; | |||
typedef void (*WindowMessageReceiveCallback) (XEvent&); | |||
extern WindowMessageReceiveCallback dispatchWindowMessage; | |||
@@ -775,7 +775,7 @@ class DisplayGeometry | |||
{ | |||
private: | |||
//============================================================================== | |||
DisplayGeometry (::Display *dpy, double masterScale) | |||
DisplayGeometry (::Display* dpy, double masterScale) | |||
{ | |||
jassert (instance == nullptr); | |||
instance = this; | |||
@@ -912,19 +912,20 @@ public: | |||
} | |||
//============================================================================== | |||
static DisplayGeometry& getInstance () | |||
static DisplayGeometry& getInstance() | |||
{ | |||
jassert (instance != nullptr); | |||
return *instance; | |||
} | |||
static DisplayGeometry& getOrCreateInstance (::Display *dpy, double masterScale) | |||
static DisplayGeometry& getOrCreateInstance (::Display* dpy, double masterScale) | |||
{ | |||
if (instance == nullptr) | |||
new DisplayGeometry (dpy, masterScale); | |||
return getInstance(); | |||
} | |||
private: | |||
//============================================================================== | |||
static DisplayGeometry* instance; | |||
@@ -1027,7 +1028,7 @@ private: | |||
} | |||
//============================================================================== | |||
XRRScreenResources* getScreenResources (::Display *dpy, ::Window window) | |||
XRRScreenResources* getScreenResources (::Display* dpy, ::Window window) | |||
{ | |||
if (getScreenResourcesPtr != nullptr) | |||
return getScreenResourcesPtr (dpy, window); | |||
@@ -1035,7 +1036,7 @@ private: | |||
return nullptr; | |||
} | |||
XRROutputInfo* getOutputInfo (::Display *dpy, XRRScreenResources *resources, RROutput output) | |||
XRROutputInfo* getOutputInfo (::Display* dpy, XRRScreenResources* resources, RROutput output) | |||
{ | |||
if (getOutputInfoPtr != nullptr) | |||
return getOutputInfoPtr (dpy, resources, output); | |||
@@ -1043,7 +1044,7 @@ private: | |||
return nullptr; | |||
} | |||
XRRCrtcInfo* getCrtcInfo (::Display *dpy, XRRScreenResources *resources, RRCrtc crtc) | |||
XRRCrtcInfo* getCrtcInfo (::Display* dpy, XRRScreenResources* resources, RRCrtc crtc) | |||
{ | |||
if (getCrtcInfoPtr != nullptr) | |||
return getCrtcInfoPtr (dpy, resources, crtc); | |||
@@ -1051,13 +1052,14 @@ private: | |||
return nullptr; | |||
} | |||
RROutput getOutputPrimary (::Display *dpy, ::Window window) | |||
RROutput getOutputPrimary (::Display* dpy, ::Window window) | |||
{ | |||
if (getOutputPrimaryPtr != nullptr) | |||
return getOutputPrimaryPtr (dpy, window); | |||
return 0; | |||
} | |||
private: | |||
//============================================================================== | |||
friend class ContainerDeletePolicy<XRRScreenResources>; | |||
@@ -1084,13 +1086,13 @@ private: | |||
private: | |||
static XRandrWrapper* instance; | |||
typedef XRRScreenResources* (*tXRRGetScreenResources) (::Display *dpy, ::Window window); | |||
typedef void (*tXRRFreeScreenResources) (XRRScreenResources *resources); | |||
typedef XRROutputInfo* (*tXRRGetOutputInfo) (::Display *dpy, XRRScreenResources *resources, RROutput output); | |||
typedef void (*tXRRFreeOutputInfo) (XRROutputInfo *outputInfo); | |||
typedef XRRCrtcInfo* (*tXRRGetCrtcInfo) (::Display *dpy, XRRScreenResources *resources, RRCrtc crtc); | |||
typedef void (*tXRRFreeCrtcInfo) (XRRCrtcInfo *crtcInfo); | |||
typedef RROutput (*tXRRGetOutputPrimary) (::Display *dpy, ::Window window); | |||
typedef XRRScreenResources* (*tXRRGetScreenResources) (::Display*, ::Window); | |||
typedef void (*tXRRFreeScreenResources) (XRRScreenResources*); | |||
typedef XRROutputInfo* (*tXRRGetOutputInfo) (::Display*, XRRScreenResources*, RROutput); | |||
typedef void (*tXRRFreeOutputInfo) (XRROutputInfo*); | |||
typedef XRRCrtcInfo* (*tXRRGetCrtcInfo) (::Display*, XRRScreenResources*, RRCrtc); | |||
typedef void (*tXRRFreeCrtcInfo) (XRRCrtcInfo*); | |||
typedef RROutput (*tXRRGetOutputPrimary) (::Display*, ::Window); | |||
void* libXrandr; | |||
tXRRGetScreenResources getScreenResourcesPtr; | |||
@@ -1172,7 +1174,7 @@ private: | |||
} | |||
//============================================================================== | |||
void queryDisplayInfos (::Display *dpy, double masterScale) noexcept | |||
void queryDisplayInfos (::Display* dpy, double masterScale) noexcept | |||
{ | |||
ScopedXLock xlock; | |||
@@ -22,7 +22,7 @@ | |||
============================================================================== | |||
*/ | |||
extern Display* display; | |||
extern ::Display* display; | |||
//============================================================================== | |||
class SystemTrayIconComponent::Pimpl | |||