1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-09 04:30:09 +00:00

misc tinkering

This commit is contained in:
jules 2007-06-19 19:45:28 +00:00
parent 9b86c13266
commit c762fb243f
67 changed files with 1812 additions and 1815 deletions

View file

@ -38,24 +38,24 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
JUCE_CALLTYPE ChangeBroadcaster::ChangeBroadcaster() throw()
ChangeBroadcaster::ChangeBroadcaster() throw()
{
// are you trying to create this object before or after juce has been intialised??
jassert (MessageManager::instance != 0);
}
JUCE_CALLTYPE ChangeBroadcaster::~ChangeBroadcaster()
ChangeBroadcaster::~ChangeBroadcaster()
{
// all event-based objects must be deleted BEFORE juce is shut down!
jassert (MessageManager::instance != 0);
}
void JUCE_CALLTYPE ChangeBroadcaster::addChangeListener (ChangeListener* const listener) throw()
void ChangeBroadcaster::addChangeListener (ChangeListener* const listener) throw()
{
changeListenerList.addChangeListener (listener);
}
void JUCE_CALLTYPE ChangeBroadcaster::removeChangeListener (ChangeListener* const listener) throw()
void ChangeBroadcaster::removeChangeListener (ChangeListener* const listener) throw()
{
jassert (changeListenerList.isValidMessageListener());
@ -63,22 +63,22 @@ void JUCE_CALLTYPE ChangeBroadcaster::removeChangeListener (ChangeListener* cons
changeListenerList.removeChangeListener (listener);
}
void JUCE_CALLTYPE ChangeBroadcaster::removeAllChangeListeners() throw()
void ChangeBroadcaster::removeAllChangeListeners() throw()
{
changeListenerList.removeAllChangeListeners();
}
void JUCE_CALLTYPE ChangeBroadcaster::sendChangeMessage (void* objectThatHasChanged) throw()
void ChangeBroadcaster::sendChangeMessage (void* objectThatHasChanged) throw()
{
changeListenerList.sendChangeMessage (objectThatHasChanged);
}
void JUCE_CALLTYPE ChangeBroadcaster::sendSynchronousChangeMessage (void* objectThatHasChanged)
void ChangeBroadcaster::sendSynchronousChangeMessage (void* objectThatHasChanged)
{
changeListenerList.sendSynchronousChangeMessage (objectThatHasChanged);
}
void JUCE_CALLTYPE ChangeBroadcaster::dispatchPendingMessages()
void ChangeBroadcaster::dispatchPendingMessages()
{
changeListenerList.dispatchPendingMessages();
}

View file

@ -48,7 +48,7 @@ class JUCE_API ChangeBroadcaster
public:
//==============================================================================
/** Creates an ChangeBroadcaster. */
JUCE_CALLTYPE ChangeBroadcaster() throw();
ChangeBroadcaster() throw();
/** Destructor. */
virtual ~ChangeBroadcaster();
@ -58,16 +58,16 @@ public:
(Trying to add a listener that's already on the list will have no effect).
*/
void JUCE_CALLTYPE addChangeListener (ChangeListener* const listener) throw();
void addChangeListener (ChangeListener* const listener) throw();
/** Removes a listener from the list.
If the listener isn't on the list, this won't have any effect.
*/
void JUCE_CALLTYPE removeChangeListener (ChangeListener* const listener) throw();
void removeChangeListener (ChangeListener* const listener) throw();
/** Removes all listeners from the list. */
void JUCE_CALLTYPE removeAllChangeListeners() throw();
void removeAllChangeListeners() throw();
//==============================================================================
/** Broadcasts a change message to all the registered listeners.
@ -78,18 +78,18 @@ public:
@see ChangeListenerList::sendActionMessage
*/
void JUCE_CALLTYPE sendChangeMessage (void* objectThatHasChanged) throw();
void sendChangeMessage (void* objectThatHasChanged) throw();
/** Sends a synchronous change message to all the registered listeners.
@see ChangeListenerList::sendSynchronousChangeMessage
*/
void JUCE_CALLTYPE sendSynchronousChangeMessage (void* objectThatHasChanged);
void sendSynchronousChangeMessage (void* objectThatHasChanged);
/** If a change message has been sent but not yet dispatched, this will
use sendSynchronousChangeMessage() to make the callback immediately.
*/
void JUCE_CALLTYPE dispatchPendingMessages();
void dispatchPendingMessages();
private:

View file

@ -37,17 +37,17 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
JUCE_CALLTYPE ChangeListenerList::ChangeListenerList() throw()
ChangeListenerList::ChangeListenerList() throw()
: lastChangedObject (0),
messagePending (false)
{
}
JUCE_CALLTYPE ChangeListenerList::~ChangeListenerList() throw()
ChangeListenerList::~ChangeListenerList() throw()
{
}
void JUCE_CALLTYPE ChangeListenerList::addChangeListener (ChangeListener* const listener) throw()
void ChangeListenerList::addChangeListener (ChangeListener* const listener) throw()
{
const ScopedLock sl (lock);
@ -57,19 +57,19 @@ void JUCE_CALLTYPE ChangeListenerList::addChangeListener (ChangeListener* const
listeners.add (listener);
}
void JUCE_CALLTYPE ChangeListenerList::removeChangeListener (ChangeListener* const listener) throw()
void ChangeListenerList::removeChangeListener (ChangeListener* const listener) throw()
{
const ScopedLock sl (lock);
listeners.removeValue (listener);
}
void JUCE_CALLTYPE ChangeListenerList::removeAllChangeListeners() throw()
void ChangeListenerList::removeAllChangeListeners() throw()
{
const ScopedLock sl (lock);
listeners.clear();
}
void JUCE_CALLTYPE ChangeListenerList::sendChangeMessage (void* objectThatHasChanged) throw()
void ChangeListenerList::sendChangeMessage (void* objectThatHasChanged) throw()
{
const ScopedLock sl (lock);
@ -86,7 +86,7 @@ void ChangeListenerList::handleMessage (const Message& message)
sendSynchronousChangeMessage (message.pointerParameter);
}
void JUCE_CALLTYPE ChangeListenerList::sendSynchronousChangeMessage (void* objectThatHasChanged)
void ChangeListenerList::sendSynchronousChangeMessage (void* objectThatHasChanged)
{
const ScopedLock sl (lock);
messagePending = false;
@ -104,7 +104,7 @@ void JUCE_CALLTYPE ChangeListenerList::sendSynchronousChangeMessage (void* objec
}
}
void JUCE_CALLTYPE ChangeListenerList::dispatchPendingMessages()
void ChangeListenerList::dispatchPendingMessages()
{
if (messagePending)
sendSynchronousChangeMessage (lastChangedObject);

View file

@ -52,26 +52,26 @@ class JUCE_API ChangeListenerList : public MessageListener
public:
//==============================================================================
/** Creates an empty list. */
JUCE_CALLTYPE ChangeListenerList() throw();
ChangeListenerList() throw();
/** Destructor. */
JUCE_CALLTYPE ~ChangeListenerList() throw();
~ChangeListenerList() throw();
//==============================================================================
/** Adds a listener to the list.
(Trying to add a listener that's already on the list will have no effect).
*/
void JUCE_CALLTYPE addChangeListener (ChangeListener* const listener) throw();
void addChangeListener (ChangeListener* const listener) throw();
/** Removes a listener from the list.
If the listener isn't on the list, this won't have any effect.
*/
void JUCE_CALLTYPE removeChangeListener (ChangeListener* const listener) throw();
void removeChangeListener (ChangeListener* const listener) throw();
/** Removes all listeners from the list. */
void JUCE_CALLTYPE removeAllChangeListeners() throw();
void removeAllChangeListeners() throw();
//==============================================================================
/** Posts an asynchronous change message to all the listeners.
@ -91,19 +91,19 @@ public:
and can be any value the application needs
@see sendSynchronousChangeMessage
*/
void JUCE_CALLTYPE sendChangeMessage (void* objectThatHasChanged) throw();
void sendChangeMessage (void* objectThatHasChanged) throw();
/** This will synchronously callback all the ChangeListeners.
Use this if you need to synchronously force a call to all the
listeners' ChangeListener::changeListenerCallback() methods.
*/
void JUCE_CALLTYPE sendSynchronousChangeMessage (void* objectThatHasChanged);
void sendSynchronousChangeMessage (void* objectThatHasChanged);
/** If a change message has been sent but not yet dispatched, this will
use sendSynchronousChangeMessage() to make the callback immediately.
*/
void JUCE_CALLTYPE dispatchPendingMessages();
void dispatchPendingMessages();
//==============================================================================
/** @internal */

View file

@ -37,7 +37,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
JUCE_CALLTYPE MessageListener::MessageListener() throw()
MessageListener::MessageListener() throw()
{
// are you trying to create a messagelistener before or after juce has been intialised??
jassert (MessageManager::instance != 0);
@ -46,13 +46,13 @@ JUCE_CALLTYPE MessageListener::MessageListener() throw()
MessageManager::instance->messageListeners.add (this);
}
JUCE_CALLTYPE MessageListener::~MessageListener()
MessageListener::~MessageListener()
{
if (MessageManager::instance != 0)
MessageManager::instance->messageListeners.removeValue (this);
}
void JUCE_CALLTYPE MessageListener::postMessage (Message* const message) const throw()
void MessageListener::postMessage (Message* const message) const throw()
{
message->messageRecipient = const_cast <MessageListener*> (this);
@ -62,7 +62,7 @@ void JUCE_CALLTYPE MessageListener::postMessage (Message* const message) const t
MessageManager::instance->postMessageToQueue (message);
}
bool JUCE_CALLTYPE MessageListener::isValidMessageListener() const throw()
bool MessageListener::isValidMessageListener() const throw()
{
return (MessageManager::instance != 0)
&& MessageManager::instance->messageListeners.contains (this);

View file

@ -46,7 +46,7 @@ class JUCE_API MessageListener
protected:
//==============================================================================
/** Creates a MessageListener. */
JUCE_CALLTYPE MessageListener() throw();
MessageListener() throw();
public:
//==============================================================================
@ -56,7 +56,7 @@ public:
of registered listeners, so that the isValidMessageListener() method
will no longer return true.
*/
virtual JUCE_CALLTYPE ~MessageListener();
virtual ~MessageListener();
//==============================================================================
/** This is the callback method that receives incoming messages.
@ -78,7 +78,7 @@ public:
references to it after calling this method.
@see handleMessage
*/
void JUCE_CALLTYPE postMessage (Message* const message) const throw();
void postMessage (Message* const message) const throw();
//==============================================================================
/** Checks whether this MessageListener has been deleted.
@ -92,7 +92,7 @@ public:
exact same memory location, but I can't think of a good way of avoiding
this.
*/
bool JUCE_CALLTYPE isValidMessageListener() const throw();
bool isValidMessageListener() const throw();
};

View file

@ -52,7 +52,7 @@ MessageManager* MessageManager::instance = 0;
static const int quitMessageId = 0xfffff321;
JUCE_CALLTYPE MessageManager::MessageManager() throw()
MessageManager::MessageManager() throw()
: broadcastListeners (0),
quitMessagePosted (false),
quitMessageReceived (false),
@ -67,7 +67,7 @@ JUCE_CALLTYPE MessageManager::MessageManager() throw()
currentLockingThreadId = messageThreadId = Thread::getCurrentThreadId();
}
JUCE_CALLTYPE MessageManager::~MessageManager() throw()
MessageManager::~MessageManager() throw()
{
jassert (instance == this);
instance = 0;
@ -76,7 +76,7 @@ JUCE_CALLTYPE MessageManager::~MessageManager() throw()
doPlatformSpecificShutdown();
}
MessageManager* JUCE_CALLTYPE MessageManager::getInstance() throw()
MessageManager* MessageManager::getInstance() throw()
{
if (instance == 0)
{
@ -89,7 +89,7 @@ MessageManager* JUCE_CALLTYPE MessageManager::getInstance() throw()
return instance;
}
void JUCE_CALLTYPE MessageManager::postMessageToQueue (Message* const message)
void MessageManager::postMessageToQueue (Message* const message)
{
if (quitMessagePosted || ! juce_postMessageToSystemQueue (message))
delete message;
@ -97,7 +97,7 @@ void JUCE_CALLTYPE MessageManager::postMessageToQueue (Message* const message)
//==============================================================================
// not for public use..
void JUCE_CALLTYPE MessageManager::deliverMessage (void* message)
void MessageManager::deliverMessage (void* message)
{
const MessageManagerLock lock;
@ -130,8 +130,8 @@ void JUCE_CALLTYPE MessageManager::deliverMessage (void* message)
}
//==============================================================================
bool JUCE_CALLTYPE MessageManager::dispatchNextMessage (const bool returnImmediatelyIfNoMessages,
bool* const wasAMessageDispatched)
bool MessageManager::dispatchNextMessage (const bool returnImmediatelyIfNoMessages,
bool* const wasAMessageDispatched)
{
if (quitMessageReceived)
{
@ -163,7 +163,7 @@ bool JUCE_CALLTYPE MessageManager::dispatchNextMessage (const bool returnImmedia
return result || ! returnImmediatelyIfNoMessages;
}
void JUCE_CALLTYPE MessageManager::dispatchPendingMessages (int maxNumberOfMessagesToDispatch)
void MessageManager::dispatchPendingMessages (int maxNumberOfMessagesToDispatch)
{
jassert (isThisTheMessageThread()); // must only be called by the message thread
@ -187,7 +187,7 @@ void JUCE_CALLTYPE MessageManager::dispatchPendingMessages (int maxNumberOfMessa
}
}
bool JUCE_CALLTYPE MessageManager::runDispatchLoop()
bool MessageManager::runDispatchLoop()
{
jassert (isThisTheMessageThread()); // must only be called by the message thread
@ -199,7 +199,7 @@ bool JUCE_CALLTYPE MessageManager::runDispatchLoop()
}
//==============================================================================
void JUCE_CALLTYPE MessageManager::postQuitMessage (const bool useMaximumForce)
void MessageManager::postQuitMessage (const bool useMaximumForce)
{
if (! quitMessagePosted)
{
@ -213,13 +213,13 @@ void JUCE_CALLTYPE MessageManager::postQuitMessage (const bool useMaximumForce)
}
}
bool JUCE_CALLTYPE MessageManager::hasQuitMessageBeenPosted() const
bool MessageManager::hasQuitMessageBeenPosted() const
{
return quitMessagePosted;
}
//==============================================================================
void JUCE_CALLTYPE MessageManager::deliverBroadcastMessage (const String& value)
void MessageManager::deliverBroadcastMessage (const String& value)
{
if (broadcastListeners == 0)
broadcastListeners = new ActionListenerList();
@ -227,7 +227,7 @@ void JUCE_CALLTYPE MessageManager::deliverBroadcastMessage (const String& value)
broadcastListeners->sendActionMessage (value);
}
void JUCE_CALLTYPE MessageManager::registerBroadcastListener (ActionListener* listener)
void MessageManager::registerBroadcastListener (ActionListener* listener)
{
if (broadcastListeners == 0)
broadcastListeners = new ActionListenerList();
@ -235,7 +235,7 @@ void JUCE_CALLTYPE MessageManager::registerBroadcastListener (ActionListener* li
broadcastListeners->addActionListener (listener);
}
void JUCE_CALLTYPE MessageManager::deregisterBroadcastListener (ActionListener* listener)
void MessageManager::deregisterBroadcastListener (ActionListener* listener)
{
if (broadcastListeners == 0)
broadcastListeners = new ActionListenerList();
@ -246,13 +246,13 @@ void JUCE_CALLTYPE MessageManager::deregisterBroadcastListener (ActionListener*
//==============================================================================
// This gets called occasionally by the timer thread (to save using an extra thread
// for it).
void JUCE_CALLTYPE MessageManager::inactivityCheckCallback()
void MessageManager::inactivityCheckCallback()
{
if (instance != 0)
instance->inactivityCheckCallbackInt();
}
void JUCE_CALLTYPE MessageManager::inactivityCheckCallbackInt()
void MessageManager::inactivityCheckCallbackInt()
{
const unsigned int now = Time::getApproximateMillisecondCounter();
@ -277,7 +277,7 @@ void JUCE_CALLTYPE MessageManager::inactivityCheckCallbackInt()
}
}
void JUCE_CALLTYPE MessageManager::delayWaitCursor()
void MessageManager::delayWaitCursor()
{
if (instance != 0)
{
@ -291,7 +291,7 @@ void JUCE_CALLTYPE MessageManager::delayWaitCursor()
}
}
void JUCE_CALLTYPE MessageManager::setTimeBeforeShowingWaitCursor (const int millisecs)
void MessageManager::setTimeBeforeShowingWaitCursor (const int millisecs)
{
// if this is a bit too small you'll get a lot of unwanted hourglass cursors..
jassert (millisecs <= 0 || millisecs > 200);
@ -311,28 +311,28 @@ void MessageManager::timerCallback()
++messageCounter;
}
int JUCE_CALLTYPE MessageManager::getTimeBeforeShowingWaitCursor() const
int MessageManager::getTimeBeforeShowingWaitCursor() const
{
return timeBeforeWaitCursor;
}
bool JUCE_CALLTYPE MessageManager::isThisTheMessageThread() const
bool MessageManager::isThisTheMessageThread() const
{
return Thread::getCurrentThreadId() == messageThreadId;
}
void JUCE_CALLTYPE MessageManager::setCurrentMessageThread (const int threadId)
void MessageManager::setCurrentMessageThread (const int threadId)
{
messageThreadId = threadId;
}
bool JUCE_CALLTYPE MessageManager::currentThreadHasLockedMessageManager() const
bool MessageManager::currentThreadHasLockedMessageManager() const
{
return Thread::getCurrentThreadId() == currentLockingThreadId;
}
//==============================================================================
JUCE_CALLTYPE MessageManagerLock::MessageManagerLock()
MessageManagerLock::MessageManagerLock()
{
if (MessageManager::instance != 0)
{
@ -342,7 +342,7 @@ JUCE_CALLTYPE MessageManagerLock::MessageManagerLock()
}
}
JUCE_CALLTYPE MessageManagerLock::~MessageManagerLock()
MessageManagerLock::~MessageManagerLock()
{
if (MessageManager::instance != 0)
{

View file

@ -56,7 +56,7 @@ class JUCE_API MessageManager : private DeletedAtShutdown,
public:
//==============================================================================
/** Returns the global instance of the MessageManager. */
static MessageManager* JUCE_CALLTYPE getInstance() throw();
static MessageManager* getInstance() throw();
//==============================================================================
/** Synchronously dispatches up to a certain number of messages from the queue.
@ -64,7 +64,7 @@ public:
This will return when the queue becomes empty, or when the given number of
messages has been sent.
*/
void JUCE_CALLTYPE dispatchPendingMessages (int maxNumberOfMessagesToDispatch = 1000);
void dispatchPendingMessages (int maxNumberOfMessagesToDispatch = 1000);
/** Synchronously sends the next pending message.
@ -79,8 +79,8 @@ public:
@returns false if the thing that's calling it should stop calling - i.e. if the
app is trying to quit.
*/
bool JUCE_CALLTYPE dispatchNextMessage (const bool returnImmediatelyIfNoMessages = false,
bool* const wasAMessageDispatched = 0);
bool dispatchNextMessage (const bool returnImmediatelyIfNoMessages = false,
bool* const wasAMessageDispatched = 0);
//==============================================================================
/** Calls a function using the message-thread.
@ -101,25 +101,25 @@ public:
@returns the value that the callback function returns.
@see MessageManagerLock
*/
void* JUCE_CALLTYPE callFunctionOnMessageThread (MessageCallbackFunction* callback,
void* userData);
void* callFunctionOnMessageThread (MessageCallbackFunction* callback,
void* userData);
/** Returns true if the caller-thread is the message thread. */
bool JUCE_CALLTYPE isThisTheMessageThread() const;
bool isThisTheMessageThread() const;
/** Called to tell the manager which thread is the one that's running the dispatch loop.
(Best to ignore this method unless you really know what you're doing..)
@see getCurrentMessageThread
*/
void JUCE_CALLTYPE setCurrentMessageThread (const int threadId);
void setCurrentMessageThread (const int threadId);
/** Returns the ID of the current message thread, as set by setCurrentMessageThread().
(Best to ignore this method unless you really know what you're doing..)
@see setCurrentMessageThread
*/
int JUCE_CALLTYPE getCurrentMessageThread() const throw() { return messageThreadId; }
int getCurrentMessageThread() const throw() { return messageThreadId; }
/** Returns true if the caller thread has currenltly got the message manager locked.
@ -128,7 +128,7 @@ public:
This will be true if the caller is the message thread, because that automatically
gains a lock while a message is being dispatched.
*/
bool JUCE_CALLTYPE currentThreadHasLockedMessageManager() const;
bool currentThreadHasLockedMessageManager() const;
//==============================================================================
/** Sends a message to all other JUCE applications that are running.
@ -137,7 +137,7 @@ public:
method of the broadcast listeners in the other app.
@see registerBroadcastListener, ActionListener
*/
static void JUCE_CALLTYPE broadcastMessage (const String& messageText);
static void broadcastMessage (const String& messageText);
/** Registers a listener to get told about broadcast messages.
@ -146,10 +146,10 @@ public:
@see broadcastMessage
*/
void JUCE_CALLTYPE registerBroadcastListener (ActionListener* listener);
void registerBroadcastListener (ActionListener* listener);
/** Deregisters a broadcast listener. */
void JUCE_CALLTYPE deregisterBroadcastListener (ActionListener* listener);
void deregisterBroadcastListener (ActionListener* listener);
//==============================================================================
/** Sets a time-limit for the app to be 'busy' before an hourglass cursor will be shown.
@ -159,30 +159,30 @@ public:
Mac the system might still decide to show it after a while).
@see MouseCursor::showWaitCursor
*/
void JUCE_CALLTYPE setTimeBeforeShowingWaitCursor (const int millisecs);
void setTimeBeforeShowingWaitCursor (const int millisecs);
/** Returns the time-out before the 'busy' cursor is shown when the app is busy.
@see setTimeBeforeShowingWaitCursor, MouseCursor::showWaitCursor
*/
int JUCE_CALLTYPE getTimeBeforeShowingWaitCursor() const;
int getTimeBeforeShowingWaitCursor() const;
/** Tells the message manager that the system isn't locked-up, even if the message
loop isn't active.
Used internally, this is handy when an OS enters its own modal loop.
*/
static void JUCE_CALLTYPE delayWaitCursor();
static void delayWaitCursor();
//==============================================================================
/** Returns true if JUCEApplication::quit() has been called. */
bool JUCE_CALLTYPE hasQuitMessageBeenPosted() const;
bool hasQuitMessageBeenPosted() const;
//==============================================================================
/** @internal */
void JUCE_CALLTYPE deliverMessage (void*);
void deliverMessage (void*);
/** @internal */
void JUCE_CALLTYPE deliverBroadcastMessage (const String&);
void deliverBroadcastMessage (const String&);
/** @internal */
void timerCallback();
@ -210,16 +210,16 @@ private:
int volatile timeBeforeWaitCursor;
unsigned int lastActivityCheckOkTime;
bool JUCE_CALLTYPE runDispatchLoop();
void JUCE_CALLTYPE postMessageToQueue (Message* const message);
void JUCE_CALLTYPE postQuitMessage (const bool useMaximumForce);
bool runDispatchLoop();
void postMessageToQueue (Message* const message);
void postQuitMessage (const bool useMaximumForce);
static void doPlatformSpecificInitialisation();
static void doPlatformSpecificShutdown();
friend class InternalTimerThread;
static void JUCE_CALLTYPE inactivityCheckCallback();
void JUCE_CALLTYPE inactivityCheckCallbackInt();
static void inactivityCheckCallback();
void inactivityCheckCallbackInt();
friend class MessageManagerLock;
CriticalSection messageDispatchLock;
@ -274,14 +274,14 @@ public:
If the current thread already has the lock, nothing will be done, so it's perfectly
safe to create these locks recursively.
*/
JUCE_CALLTYPE MessageManagerLock();
MessageManagerLock();
/** Releases the current thread's lock on the message manager.
Make sure this object is created and deleted by the same thread,
otherwise there are no guarantees what will happen!
*/
JUCE_CALLTYPE ~MessageManagerLock();
~MessageManagerLock();
private:
int lastLockingThreadId;

View file

@ -61,7 +61,7 @@ private:
InternalTimerThread (const InternalTimerThread&);
const InternalTimerThread& operator= (const InternalTimerThread&);
void JUCE_CALLTYPE addTimer (Timer* const t) throw()
void addTimer (Timer* const t) throw()
{
#ifdef JUCE_DEBUG
Timer* tt = firstTimer;
@ -106,7 +106,7 @@ private:
notify();
}
void JUCE_CALLTYPE removeTimer (Timer* const t) throw()
void removeTimer (Timer* const t) throw()
{
#ifdef JUCE_DEBUG
Timer* tt = firstTimer;
@ -319,7 +319,7 @@ void juce_callAnyTimersSynchronously()
static SortedSet <Timer*> activeTimers;
#endif
JUCE_CALLTYPE Timer::Timer() throw()
Timer::Timer() throw()
: countdownMs (0),
periodMs (0),
previous (0),
@ -330,7 +330,7 @@ JUCE_CALLTYPE Timer::Timer() throw()
#endif
}
JUCE_CALLTYPE Timer::Timer (const Timer&) throw()
Timer::Timer (const Timer&) throw()
: countdownMs (0),
periodMs (0),
previous (0),
@ -341,7 +341,7 @@ JUCE_CALLTYPE Timer::Timer (const Timer&) throw()
#endif
}
JUCE_CALLTYPE Timer::~Timer()
Timer::~Timer()
{
stopTimer();
@ -350,7 +350,7 @@ JUCE_CALLTYPE Timer::~Timer()
#endif
}
void JUCE_CALLTYPE Timer::startTimer (const int interval) throw()
void Timer::startTimer (const int interval) throw()
{
const ScopedLock sl (InternalTimerThread::lock);
@ -371,7 +371,7 @@ void JUCE_CALLTYPE Timer::startTimer (const int interval) throw()
}
}
void JUCE_CALLTYPE Timer::stopTimer() throw()
void Timer::stopTimer() throw()
{
const ScopedLock sl (InternalTimerThread::lock);

View file

@ -65,19 +65,19 @@ protected:
When created, the timer is stopped, so use startTimer() to get it going.
*/
JUCE_CALLTYPE Timer() throw();
Timer() throw();
/** Creates a copy of another timer.
Note that this timer won't be started, even if the one you're copying
is running.
*/
JUCE_CALLTYPE Timer (const Timer& other) throw();
Timer (const Timer& other) throw();
public:
//==============================================================================
/** Destructor. */
virtual JUCE_CALLTYPE ~Timer();
virtual ~Timer();
//==============================================================================
/** The user-defined callback routine that actually gets called periodically.
@ -97,7 +97,7 @@ public:
@param intervalInMilliseconds the interval to use (any values less than 1 will be
rounded up to 1)
*/
void JUCE_CALLTYPE startTimer (const int intervalInMilliseconds) throw();
void startTimer (const int intervalInMilliseconds) throw();
/** Stops the timer.
@ -107,20 +107,20 @@ public:
be currently executing may be allowed to finish before the method
returns.
*/
void JUCE_CALLTYPE stopTimer() throw();
void stopTimer() throw();
//==============================================================================
/** Checks if the timer has been started.
@returns true if the timer is running.
*/
bool JUCE_CALLTYPE isTimerRunning() const throw() { return periodMs > 0; }
bool isTimerRunning() const throw() { return periodMs > 0; }
/** Returns the timer's interval.
@returns the timer's interval in milliseconds if it's running, or 0 if it's not.
*/
int JUCE_CALLTYPE getTimerInterval() const throw() { return periodMs; }
int getTimerInterval() const throw() { return periodMs; }
//==============================================================================

View file

@ -82,7 +82,7 @@ bool ComboBox::isTextEditable() const throw()
return label->isEditableOnDoubleClick() || label->isEditableOnSingleClick();
}
void ComboBox::setJustificationType (const Justification& justification)
void ComboBox::setJustificationType (const Justification& justification) throw()
{
label->setJustificationType (justification);
}
@ -100,7 +100,7 @@ void ComboBox::setTooltip (const String& newTooltip)
//==============================================================================
void ComboBox::addItem (const String& newItemText,
const int newItemId)
const int newItemId) throw()
{
// you can't add empty strings to the list..
jassert (newItemText.isNotEmpty());
@ -133,12 +133,12 @@ void ComboBox::addItem (const String& newItemText,
}
}
void ComboBox::addSeparator()
void ComboBox::addSeparator() throw()
{
separatorPending = (items.size() > 0);
}
void ComboBox::addSectionHeading (const String& headingName)
void ComboBox::addSectionHeading (const String& headingName) throw()
{
// you can't add empty strings to the list..
jassert (headingName.isNotEmpty());
@ -166,7 +166,7 @@ void ComboBox::addSectionHeading (const String& headingName)
}
void ComboBox::setItemEnabled (const int itemId,
const bool isEnabled)
const bool isEnabled) throw()
{
ItemInfo* const item = getItemForId (itemId);
@ -175,7 +175,7 @@ void ComboBox::setItemEnabled (const int itemId,
}
void ComboBox::changeItemText (const int itemId,
const String& newText)
const String& newText) throw()
{
ItemInfo* const item = getItemForId (itemId);
@ -195,7 +195,7 @@ void ComboBox::clear()
}
//==============================================================================
ComboBox::ItemInfo* ComboBox::getItemForId (const int id) const
ComboBox::ItemInfo* ComboBox::getItemForId (const int id) const throw()
{
jassert (id != 0);
@ -209,7 +209,7 @@ ComboBox::ItemInfo* ComboBox::getItemForId (const int id) const
return 0;
}
ComboBox::ItemInfo* ComboBox::getItemForIndex (const int index) const
ComboBox::ItemInfo* ComboBox::getItemForIndex (const int index) const throw()
{
int n = 0;
@ -227,7 +227,7 @@ ComboBox::ItemInfo* ComboBox::getItemForIndex (const int index) const
return 0;
}
int ComboBox::getNumItems() const
int ComboBox::getNumItems() const throw()
{
int n = 0;
@ -242,7 +242,7 @@ int ComboBox::getNumItems() const
return n;
}
const String ComboBox::getItemText (const int index) const
const String ComboBox::getItemText (const int index) const throw()
{
ItemInfo* const item = getItemForIndex (index);
@ -252,7 +252,7 @@ const String ComboBox::getItemText (const int index) const
return String::empty;
}
int ComboBox::getItemId (const int index) const
int ComboBox::getItemId (const int index) const throw()
{
ItemInfo* const item = getItemForIndex (index);
@ -272,7 +272,7 @@ bool ComboBox::ItemInfo::isRealItem() const throw()
}
//==============================================================================
int ComboBox::getSelectedItemIndex() const
int ComboBox::getSelectedItemIndex() const throw()
{
return (currentIndex >= 0 && getText() == getItemText (currentIndex))
? currentIndex
@ -309,7 +309,7 @@ void ComboBox::setSelectedId (const int newItemId,
}
}
int ComboBox::getSelectedId() const
int ComboBox::getSelectedId() const throw()
{
const ItemInfo* const item = getItemForIndex (currentIndex);
@ -341,7 +341,7 @@ void ComboBox::handleAsyncUpdate()
}
//==============================================================================
const String ComboBox::getText() const
const String ComboBox::getText() const throw()
{
return label->getText();
}
@ -375,7 +375,7 @@ void ComboBox::setText (const String& newText,
}
//==============================================================================
void ComboBox::setTextWhenNothingSelected (const String& newMessage)
void ComboBox::setTextWhenNothingSelected (const String& newMessage) throw()
{
textWhenNothingSelected = newMessage;
repaint();
@ -386,7 +386,7 @@ const String ComboBox::getTextWhenNothingSelected() const throw()
return textWhenNothingSelected;
}
void ComboBox::setTextWhenNoChoicesAvailable (const String& newMessage)
void ComboBox::setTextWhenNoChoicesAvailable (const String& newMessage) throw()
{
noChoicesMessage = newMessage;
}

View file

@ -111,7 +111,7 @@ public:
The default is Justification::centredLeft. The text is displayed using a
Label component inside the ComboBox.
*/
void setJustificationType (const Justification& justification);
void setJustificationType (const Justification& justification) throw();
/** Returns the current justification for the text box.
@see setJustificationType
@ -127,13 +127,13 @@ public:
@see setItemEnabled, addSeparator, addSectionHeading, removeItem, getNumItems, getItemText, getItemId
*/
void addItem (const String& newItemText,
const int newItemId);
const int newItemId) throw();
/** Adds a separator line to the drop-down list.
This is like adding a separator to a popup menu. See PopupMenu::addSeparator().
*/
void addSeparator();
void addSeparator() throw();
/** Adds a heading to the drop-down list, so that you can group the items into
different sections.
@ -144,7 +144,7 @@ public:
@see addItem, addSeparator
*/
void addSectionHeading (const String& headingName);
void addSectionHeading (const String& headingName) throw();
/** This allows items in the drop-down list to be selectively disabled.
@ -155,12 +155,12 @@ public:
current selection - it just stops the user choosing that item from the list.
*/
void setItemEnabled (const int itemId,
const bool isEnabled);
const bool isEnabled) throw();
/** Changes the text for an existing item.
*/
void changeItemText (const int itemId,
const String& newText);
const String& newText) throw();
/** Removes all the items from the drop-down list.
@ -172,7 +172,7 @@ public:
Note that this doesn't include headers or separators.
*/
int getNumItems() const;
int getNumItems() const throw();
/** Returns the text for one of the items in the list.
@ -180,7 +180,7 @@ public:
@param index the item's index from 0 to (getNumItems() - 1)
*/
const String getItemText (const int index) const;
const String getItemText (const int index) const throw();
/** Returns the ID for one of the items in the list.
@ -188,7 +188,7 @@ public:
@param index the item's index from 0 to (getNumItems() - 1)
*/
int getItemId (const int index) const;
int getItemId (const int index) const throw();
//==============================================================================
/** Returns the ID of the item that's currently shown in the box.
@ -199,7 +199,7 @@ public:
@see setSelectedId, getSelectedItemIndex, getText
*/
int getSelectedId() const;
int getSelectedId() const throw();
/** Sets one of the items to be the current selection.
@ -223,7 +223,7 @@ public:
@see setSelectedItemIndex, getSelectedId, getText
*/
int getSelectedItemIndex() const;
int getSelectedItemIndex() const throw();
/** Sets one of the items to be the current selection.
@ -247,7 +247,7 @@ public:
@see setText, getSelectedId, getSelectedItemIndex
*/
const String getText() const;
const String getText() const throw();
/** Sets the contents of the combo-box's text field.
@ -276,7 +276,7 @@ public:
@see getTextWhenNothingSelected
*/
void setTextWhenNothingSelected (const String& newMessage);
void setTextWhenNothingSelected (const String& newMessage) throw();
/** Returns the text that is shown when no item is selected.
@ -291,7 +291,7 @@ public:
By default it just says "no choices", but this lets you change it to something more
meaningful.
*/
void setTextWhenNoChoicesAvailable (const String& newMessage);
void setTextWhenNoChoicesAvailable (const String& newMessage) throw();
/** Returns the text shown when no items have been added to the list.
@see setTextWhenNoChoicesAvailable
@ -371,8 +371,8 @@ private:
void showPopup();
ItemInfo* getItemForId (const int id) const;
ItemInfo* getItemForIndex (const int index) const;
ItemInfo* getItemForId (const int id) const throw();
ItemInfo* getItemForIndex (const int index) const throw();
ComboBox (const ComboBox&);
const ComboBox& operator= (const ComboBox&);

View file

@ -87,27 +87,27 @@ void Label::setText (const String& newText,
}
}
const String Label::getText (const bool returnActiveEditorContents) const
const String Label::getText (const bool returnActiveEditorContents) const throw()
{
return (returnActiveEditorContents && isBeingEdited())
? editor->getText()
: text;
}
void Label::setFont (const Font& newFont)
void Label::setFont (const Font& newFont) throw()
{
font = newFont;
repaint();
}
const Font Label::getFont() const
const Font& Label::getFont() const throw()
{
return font;
}
void Label::setEditable (const bool editOnSingleClick,
const bool editOnDoubleClick,
const bool lossOfFocusDiscardsChanges_)
const bool lossOfFocusDiscardsChanges_) throw()
{
editSingleClick = editOnSingleClick;
editDoubleClick = editOnDoubleClick;
@ -117,7 +117,7 @@ void Label::setEditable (const bool editOnSingleClick,
setFocusContainer (editOnSingleClick || editOnDoubleClick);
}
void Label::setJustificationType (const Justification& justification_)
void Label::setJustificationType (const Justification& justification_) throw()
{
justification = justification_;
repaint();
@ -250,7 +250,7 @@ void Label::inputAttemptWhenModal()
}
}
bool Label::isBeingEdited() const
bool Label::isBeingEdited() const throw()
{
return editor != 0;
}

View file

@ -104,20 +104,20 @@ public:
the user has finished typing and pressed the return
key.
*/
const String getText (const bool returnActiveEditorContents = false) const;
const String getText (const bool returnActiveEditorContents = false) const throw();
//==============================================================================
/** Changes the font to use to draw the text.
@see getFont
*/
void setFont (const Font& newFont);
void setFont (const Font& newFont) throw();
/** Returns the font currently being used.
@see setFont
*/
const Font getFont() const;
const Font& getFont() const throw();
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the label.
@ -143,7 +143,7 @@ public:
(The default is Justification::centredLeft)
*/
void setJustificationType (const Justification& justification);
void setJustificationType (const Justification& justification) throw();
/** Returns the type of justification, as set in setJustificationType(). */
const Justification getJustificationType() const throw() { return justification; }
@ -204,7 +204,7 @@ public:
*/
void setEditable (const bool editOnSingleClick,
const bool editOnDoubleClick = false,
const bool lossOfFocusDiscardsChanges = false);
const bool lossOfFocusDiscardsChanges = false) throw();
/** Returns true if this option was set using setEditable(). */
bool isEditableOnSingleClick() const throw() { return editSingleClick; }
@ -235,7 +235,7 @@ public:
void hideEditor (const bool discardCurrentEditorContents);
/** Returns true if the editor is currently focused and active. */
bool isBeingEdited() const;
bool isBeingEdited() const throw();
//==============================================================================
juce_UseDebuggingNewOperator

View file

@ -948,7 +948,7 @@ void TextEditor::setMultiLine (const bool shouldBeMultiLine,
scrollToMakeSureCursorIsVisible();
}
bool TextEditor::isMultiLine() const
bool TextEditor::isMultiLine() const throw()
{
return multiline;
}

View file

@ -113,7 +113,7 @@ public:
/** Returns true if the editor is in multi-line mode.
*/
bool isMultiLine() const;
bool isMultiLine() const throw();
//==============================================================================
/** Changes the behaviour of the return key.

View file

@ -79,15 +79,15 @@ class FileListItemComponent : public Component,
{
public:
//==============================================================================
JUCE_CALLTYPE FileListItemComponent (FileListComponent& owner_,
TimeSliceThread& thread_) throw()
FileListItemComponent (FileListComponent& owner_,
TimeSliceThread& thread_) throw()
: owner (owner_),
thread (thread_),
icon (0)
{
}
JUCE_CALLTYPE ~FileListItemComponent() throw()
~FileListItemComponent() throw()
{
thread.removeTimeSliceClient (this);
@ -115,10 +115,10 @@ public:
owner.sendDoubleClickMessage (file);
}
void JUCE_CALLTYPE update (const File& root,
const DirectoryContentsList::FileInfo* const fileInfo,
const int index_,
const bool highlighted_) throw()
void update (const File& root,
const DirectoryContentsList::FileInfo* const fileInfo,
const int index_,
const bool highlighted_) throw()
{
thread.removeTimeSliceClient (this);
@ -190,13 +190,13 @@ private:
Image* icon;
bool isDirectory;
void JUCE_CALLTYPE clearIcon() throw()
void clearIcon() throw()
{
ImageCache::release (icon);
icon = 0;
}
void JUCE_CALLTYPE updateIcon (const bool onlyUpdateIfCached) throw()
void updateIcon (const bool onlyUpdateIfCached) throw()
{
if (icon == 0)
{

View file

@ -49,11 +49,11 @@ class FileListTreeItem : public TreeViewItem,
{
public:
//==============================================================================
JUCE_CALLTYPE FileListTreeItem (FileTreeComponent& owner_,
DirectoryContentsList* const parentContentsList_,
const int indexInContentsList_,
const File& file_,
TimeSliceThread& thread_) throw()
FileListTreeItem (FileTreeComponent& owner_,
DirectoryContentsList* const parentContentsList_,
const int indexInContentsList_,
const File& file_,
TimeSliceThread& thread_) throw()
: file (file_),
owner (owner_),
parentContentsList (parentContentsList_),
@ -120,7 +120,7 @@ public:
}
}
void JUCE_CALLTYPE setSubContentsList (DirectoryContentsList* newList) throw()
void setSubContentsList (DirectoryContentsList* newList) throw()
{
jassert (subContentsList == 0);
subContentsList = newList;
@ -206,7 +206,7 @@ private:
String fileSize;
String modTime;
void JUCE_CALLTYPE updateIcon (const bool onlyUpdateIfCached) throw()
void updateIcon (const bool onlyUpdateIfCached) throw()
{
if (icon == 0)
{

View file

@ -68,7 +68,7 @@ int juce_LastMousePosY = 0;
int juce_MouseClickCounter = 0;
bool juce_MouseHasMovedSignificantlySincePressed = false;
static int countMouseClicks()
static int countMouseClicks() throw()
{
int numClicks = 0;
@ -424,7 +424,7 @@ bool Component::isValidComponent() const throw()
return (this != 0) && isValidMessageListener();
}
void* Component::getWindowHandle() const
void* Component::getWindowHandle() const throw()
{
const ComponentPeer* const peer = getPeer();
@ -538,7 +538,7 @@ void Component::removeFromDesktop()
}
}
bool Component::isOnDesktop() const
bool Component::isOnDesktop() const throw()
{
return flags.hasHeavyweightPeerFlag;
}
@ -560,7 +560,7 @@ void Component::minimisationStateChanged (bool)
}
//==============================================================================
void Component::setOpaque (const bool shouldBeOpaque)
void Component::setOpaque (const bool shouldBeOpaque) throw()
{
if (shouldBeOpaque != flags.opaqueFlag)
{
@ -587,7 +587,7 @@ bool Component::isOpaque() const throw()
}
//==============================================================================
void Component::setBufferedToImage (const bool shouldBeBuffered)
void Component::setBufferedToImage (const bool shouldBeBuffered) throw()
{
if (shouldBeBuffered != flags.bufferToImageFlag)
{
@ -763,7 +763,7 @@ void Component::setAlwaysOnTop (const bool shouldStayOnTop)
}
}
bool Component::isAlwaysOnTop() const
bool Component::isAlwaysOnTop() const throw()
{
return flags.alwaysOnTopFlag;
}
@ -820,7 +820,7 @@ int Component::getScreenY() const throw()
: compY_);
}
void Component::relativePositionToGlobal (int& x, int& y) const
void Component::relativePositionToGlobal (int& x, int& y) const throw()
{
const Component* c = this;
@ -839,7 +839,7 @@ void Component::relativePositionToGlobal (int& x, int& y) const
while (c != 0);
}
void Component::globalPositionToRelative (int& x, int& y) const
void Component::globalPositionToRelative (int& x, int& y) const throw()
{
if (flags.hasHeavyweightPeerFlag)
{
@ -855,7 +855,7 @@ void Component::globalPositionToRelative (int& x, int& y) const
}
}
void Component::relativePositionToOtherComponent (const Component* const targetComponent, int& x, int& y) const
void Component::relativePositionToOtherComponent (const Component* const targetComponent, int& x, int& y) const throw()
{
if (targetComponent != 0)
{
@ -1111,14 +1111,14 @@ bool Component::hitTest (int x, int y)
}
void Component::setInterceptsMouseClicks (const bool allowClicks,
const bool allowClicksOnChildComponents)
const bool allowClicksOnChildComponents) throw()
{
flags.ignoresMouseClicksFlag = ! allowClicks;
flags.allowChildMouseClicksFlag = allowClicksOnChildComponents;
}
void Component::getInterceptsMouseClicks (bool& allowsClicksOnThisComponent,
bool& allowsClicksOnChildComponents)
bool& allowsClicksOnChildComponents) const throw()
{
allowsClicksOnThisComponent = ! flags.ignoresMouseClicksFlag;
allowsClicksOnChildComponents = flags.allowChildMouseClicksFlag;
@ -1146,8 +1146,7 @@ bool Component::contains (const int x, const int y)
return false;
}
bool Component::reallyContains (int x, int y,
const bool returnTrueIfWithinAChild)
bool Component::reallyContains (int x, int y, const bool returnTrueIfWithinAChild)
{
if (! contains (x, y))
return false;
@ -1191,8 +1190,7 @@ Component* Component::getComponentAt (const int x, const int y)
}
//==============================================================================
void Component::addChildComponent (Component* const child,
int zOrder)
void Component::addChildComponent (Component* const child, int zOrder)
{
// 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.
@ -1231,8 +1229,7 @@ void Component::addChildComponent (Component* const child,
}
}
void Component::addAndMakeVisible (Component* const child,
int zOrder)
void Component::addAndMakeVisible (Component* const child, int zOrder)
{
if (child != 0)
{
@ -1318,12 +1315,12 @@ Component* Component::getChildComponent (const int index) const throw()
return childComponentList_ [index];
}
int Component::getIndexOfChildComponent (const Component* const child) const
int Component::getIndexOfChildComponent (const Component* const child) const throw()
{
return childComponentList_.indexOf (const_cast <Component*> (child));
}
Component* Component::getTopLevelComponent() const
Component* Component::getTopLevelComponent() const throw()
{
const Component* comp = this;
@ -1333,7 +1330,7 @@ Component* Component::getTopLevelComponent() const
return (Component*) comp;
}
bool Component::isParentOf (const Component* possibleChild) const
bool Component::isParentOf (const Component* possibleChild) const throw()
{
while (possibleChild->isValidComponent())
{
@ -1539,13 +1536,13 @@ void Component::exitModalState (const int returnValue)
}
}
bool Component::isCurrentlyModal() const
bool Component::isCurrentlyModal() const throw()
{
return flags.currentlyModalFlag
&& getCurrentlyModalComponent() == this;
}
bool Component::isCurrentlyBlockedByAnotherModalComponent() const
bool Component::isCurrentlyBlockedByAnotherModalComponent() const throw()
{
Component* const mc = getCurrentlyModalComponent();
@ -1555,7 +1552,7 @@ bool Component::isCurrentlyBlockedByAnotherModalComponent() const
&& ! mc->canModalEventBeSentToComponent (this);
}
Component* Component::getCurrentlyModalComponent()
Component* Component::getCurrentlyModalComponent() throw()
{
Component* const c = (Component*) modalComponentStack.getLast();
@ -1563,7 +1560,7 @@ Component* Component::getCurrentlyModalComponent()
}
//==============================================================================
void Component::setBroughtToFrontOnMouseClick (const bool shouldBeBroughtToFront)
void Component::setBroughtToFrontOnMouseClick (const bool shouldBeBroughtToFront) throw()
{
flags.bringToFrontOnClickFlag = shouldBeBroughtToFront;
}
@ -1574,7 +1571,7 @@ bool Component::isBroughtToFrontOnMouseClick() const throw()
}
//==============================================================================
void Component::setMouseCursor (const MouseCursor& cursor)
void Component::setMouseCursor (const MouseCursor& cursor) throw()
{
cursor_ = cursor;
@ -1595,12 +1592,12 @@ const MouseCursor Component::getMouseCursor()
return cursor_;
}
void Component::updateMouseCursor() const
void Component::updateMouseCursor() const throw()
{
sendFakeMouseMove();
}
void Component::internalUpdateMouseCursor (const bool forcedUpdate)
void Component::internalUpdateMouseCursor (const bool forcedUpdate) throw()
{
ComponentPeer* const peer = getPeer();
@ -1626,13 +1623,13 @@ void Component::internalUpdateMouseCursor (const bool forcedUpdate)
}
//==============================================================================
void Component::setRepaintsOnMouseActivity (const bool shouldRepaint)
void Component::setRepaintsOnMouseActivity (const bool shouldRepaint) throw()
{
flags.repaintOnMouseActivityFlag = shouldRepaint;
}
//==============================================================================
void Component::repaintParent()
void Component::repaintParent() throw()
{
if (flags.visibleFlag)
internalRepaint (0, 0, compW_, compH_);
@ -1972,7 +1969,7 @@ const Rectangle Component::getUnclippedArea() const
}
void Component::clipObscuredRegions (Graphics& g, const Rectangle& clipRect,
const int deltaX, const int deltaY) const
const int deltaX, const int deltaY) const throw()
{
for (int i = childComponentList_.size(); --i >= 0;)
{
@ -2034,7 +2031,7 @@ void Component::subtractObscuredRegions (RectangleList& result,
const int deltaX,
const int deltaY,
const Rectangle& clipRect,
const Component* const compToAvoid) const
const Component* const compToAvoid) const throw()
{
for (int i = childComponentList_.size(); --i >= 0;)
{
@ -2196,7 +2193,7 @@ void Component::handleMessage (const Message& message)
}
//==============================================================================
void Component::postCommandMessage (const int commandId)
void Component::postCommandMessage (const int commandId) throw()
{
postMessage (new Message (customCommandMessage, commandId, 0, 0));
}
@ -2208,7 +2205,7 @@ void Component::handleCommandMessage (int)
//==============================================================================
void Component::addMouseListener (MouseListener* const newListener,
const bool wantsEventsForAllNestedChildComponents)
const bool wantsEventsForAllNestedChildComponents) throw()
{
// 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.
@ -2231,7 +2228,7 @@ void Component::addMouseListener (MouseListener* const newListener,
}
}
void Component::removeMouseListener (MouseListener* const listenerToRemove)
void Component::removeMouseListener (MouseListener* const listenerToRemove) throw()
{
// 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.
@ -3137,7 +3134,7 @@ void Component::internalChildFocusChange (FocusChangeType cause)
}
//==============================================================================
bool Component::isEnabled() const
bool Component::isEnabled() const throw()
{
return (! flags.isDisabledFlag)
&& (parentComponent_ == 0 || parentComponent_->isEnabled());
@ -3184,7 +3181,7 @@ void Component::enablementChanged()
}
//==============================================================================
void Component::setWantsKeyboardFocus (const bool wantsFocus)
void Component::setWantsKeyboardFocus (const bool wantsFocus) throw()
{
flags.wantsFocusFlag = wantsFocus;
}
@ -3410,7 +3407,7 @@ bool Component::isMouseButtonDownAnywhere() throw()
return ModifierKeys::getCurrentModifiers().isAnyMouseButtonDown();
}
void Component::getMouseXYRelative (int& mx, int& my) const
void Component::getMouseXYRelative (int& mx, int& my) const throw()
{
Desktop::getMousePosition (mx, my);
globalPositionToRelative (mx, my);
@ -3420,7 +3417,7 @@ void Component::getMouseXYRelative (int& mx, int& my) const
}
void Component::enableUnboundedMouseMovement (bool enable,
bool keepCursorVisibleUntilOffscreen)
bool keepCursorVisibleUntilOffscreen) throw()
{
enable = enable && isMouseButtonDown();
isCursorVisibleUntilOffscreen = keepCursorVisibleUntilOffscreen;
@ -3468,7 +3465,7 @@ const Rectangle Component::getParentMonitorArea() const throw()
}
//==============================================================================
void Component::addKeyListener (KeyListener* const newListener)
void Component::addKeyListener (KeyListener* const newListener) throw()
{
if (keyListeners_ == 0)
keyListeners_ = new VoidArray (4);
@ -3476,7 +3473,7 @@ void Component::addKeyListener (KeyListener* const newListener)
keyListeners_->addIfNotAlreadyThere (newListener);
}
void Component::removeKeyListener (KeyListener* const listenerToRemove)
void Component::removeKeyListener (KeyListener* const listenerToRemove) throw()
{
if (keyListeners_ != 0)
keyListeners_->removeValue (listenerToRemove);
@ -3602,7 +3599,7 @@ void Component::internalFilesDropped (const int x,
}
}
ComponentPeer* Component::getPeer() const
ComponentPeer* Component::getPeer() const throw()
{
if (flags.hasHeavyweightPeerFlag)
return ComponentPeer::getPeerFor (this);

View file

@ -202,7 +202,8 @@ public:
getPeer, ComponentPeer::setMinimised, ComponentPeer::StyleFlags,
ComponentPeer::getStyleFlags, ComponentPeer::setFullScreen
*/
virtual void addToDesktop (int windowStyleFlags, void* nativeWindowToAttachTo = 0);
virtual void addToDesktop (int windowStyleFlags,
void* nativeWindowToAttachTo = 0);
/** If the component is currently showing on the desktop, this will hide it.
@ -217,7 +218,7 @@ public:
@see addToDesktop, removeFromDesktop
*/
bool isOnDesktop() const;
bool isOnDesktop() const throw();
/** Returns the heavyweight window that contains this component.
@ -229,7 +230,7 @@ public:
@see addToDesktop, isOnDesktop
*/
ComponentPeer* getPeer() const;
ComponentPeer* getPeer() const throw();
/** For components on the desktop, this is called if the system wants to close the window.
@ -286,7 +287,7 @@ public:
@see setAlwaysOnTop
*/
bool isAlwaysOnTop() const;
bool isAlwaysOnTop() const throw();
//==============================================================================
/** Returns the x co-ordinate of the component's left edge.
@ -357,13 +358,13 @@ public:
@see globalPositionToRelative, relativePositionToOtherComponent
*/
void relativePositionToGlobal (int& x, int& y) const;
void relativePositionToGlobal (int& x, int& y) const throw();
/** Converts a screen co-ordinate into a position relative to this component's top-left.
@see relativePositionToGlobal, relativePositionToOtherComponent
*/
void globalPositionToRelative (int& x, int& y) const;
void globalPositionToRelative (int& x, int& y) const throw();
/** Converts a position relative to this component's top-left into a position
relative to another component's top-left.
@ -371,7 +372,7 @@ public:
@see relativePositionToGlobal, globalPositionToRelative
*/
void relativePositionToOtherComponent (const Component* const targetComponent,
int& x, int& y) const;
int& x, int& y) const throw();
//==============================================================================
/** Moves the component to a new position.
@ -535,7 +536,7 @@ public:
@see getNumChildComponents, getChildComponent, addChildComponent, toFront, toBack, toBehind
*/
int getIndexOfChildComponent (const Component* const child) const;
int getIndexOfChildComponent (const Component* const child) const throw();
/** Adds a child component to this one.
@ -597,7 +598,7 @@ public:
If this is the highest-level component or hasn't yet been added to
a parent, this will return null.
*/
Component* getParentComponent() const throw() { return parentComponent_; }
Component* getParentComponent() const throw() { return parentComponent_; }
/** Searches the parent components for a component of a specified class.
@ -630,14 +631,14 @@ public:
finds the highest one that doesn't have a parent (i.e. is on the desktop or
not yet added to a parent), and will return that.
*/
Component* getTopLevelComponent() const;
Component* getTopLevelComponent() const throw();
/** Checks whether a component is anywhere inside this component or its children.
This will recursively check through this components children to see if the
given component is anywhere inside.
*/
bool isParentOf (const Component* possibleChild) const;
bool isParentOf (const Component* possibleChild) const throw();
//==============================================================================
/** Called to indicate that the component's parents have changed.
@ -715,7 +716,7 @@ public:
@see hitTest, getInterceptsMouseClicks
*/
void setInterceptsMouseClicks (const bool allowClicksOnThisComponent,
const bool allowClicksOnChildComponents);
const bool allowClicksOnChildComponents) throw();
/** Retrieves the current state of the mouse-click interception flags.
@ -725,7 +726,7 @@ public:
@see setInterceptsMouseClicks
*/
void getInterceptsMouseClicks (bool& allowsClicksOnThisComponent,
bool& allowsClicksOnChildComponents);
bool& allowsClicksOnChildComponents) const throw();
/** Returns true if a given point lies within this component or one of its children.
@ -821,7 +822,7 @@ public:
@see repaint, paint, createComponentSnapshot
*/
void setBufferedToImage (const bool shouldBeBuffered);
void setBufferedToImage (const bool shouldBeBuffered) throw();
/** Generates a snapshot of part of this component.
@ -879,7 +880,7 @@ public:
@see setComponentEffect
*/
ImageEffectFilter* getComponentEffect() const throw() { return effect_; }
ImageEffectFilter* getComponentEffect() const throw() { return effect_; }
//==============================================================================
/** Finds the appropriate look-and-feel to use for this component.
@ -943,7 +944,7 @@ public:
@see isOpaque, getVisibleArea
*/
void setOpaque (const bool shouldBeOpaque);
void setOpaque (const bool shouldBeOpaque) throw();
/** Returns true if no parts of this component are transparent.
@ -965,7 +966,7 @@ public:
@see setMouseClickGrabsKeyboardFocus
*/
void setBroughtToFrontOnMouseClick (const bool shouldBeBroughtToFront);
void setBroughtToFrontOnMouseClick (const bool shouldBeBroughtToFront) throw();
/** Indicates whether the component should be brought to the front when clicked-on.
@ -986,7 +987,7 @@ public:
@see grabKeyboardFocus, getWantsKeyboardFocus
*/
void setWantsKeyboardFocus (const bool wantsFocus);
void setWantsKeyboardFocus (const bool wantsFocus) throw();
/** Returns true if the component is interested in getting keyboard focus.
@ -1096,7 +1097,7 @@ public:
@see setEnabled, enablementChanged
*/
bool isEnabled() const;
bool isEnabled() const throw();
/** Enables or disables this component.
@ -1130,7 +1131,7 @@ public:
@see MouseCursor
*/
void setMouseCursor (const MouseCursor& cursorType);
void setMouseCursor (const MouseCursor& cursorType) throw();
/** Returns the mouse cursor shape to use when the mouse is over this component.
@ -1151,7 +1152,7 @@ public:
This isn't needed if you're only using setMouseCursor().
*/
void updateMouseCursor() const;
void updateMouseCursor() const throw();
//==============================================================================
/** Components can override this method to draw their content.
@ -1351,7 +1352,7 @@ public:
@see mouseEnter, mouseExit, mouseDown, mouseUp
*/
void setRepaintsOnMouseActivity (const bool shouldRepaint);
void setRepaintsOnMouseActivity (const bool shouldRepaint) throw();
/** Registers a listener to be told when mouse events occur in this component.
@ -1371,13 +1372,13 @@ public:
@see MouseListener, removeMouseListener
*/
void addMouseListener (MouseListener* const newListener,
const bool wantsEventsForAllNestedChildComponents);
const bool wantsEventsForAllNestedChildComponents) throw();
/** Deregisters a mouse listener.
@see addMouseListener, MouseListener
*/
void removeMouseListener (MouseListener* const listenerToRemove);
void removeMouseListener (MouseListener* const listenerToRemove) throw();
//==============================================================================
/** Adds a listener that wants to hear about keypresses that this component receives.
@ -1390,13 +1391,13 @@ public:
@see keyPressed, keyStateChanged, removeKeyListener
*/
void addKeyListener (KeyListener* const newListener);
void addKeyListener (KeyListener* const newListener) throw();
/** Removes a previously-registered key listener.
@see addKeyListener
*/
void removeKeyListener (KeyListener* const listenerToRemove);
void removeKeyListener (KeyListener* const listenerToRemove) throw();
/** Called when a key is pressed.
@ -1534,7 +1535,7 @@ public:
The co-ordinates are relative to the component's top-left corner.
*/
void getMouseXYRelative (int& x, int& y) const;
void getMouseXYRelative (int& x, int& y) const throw();
/** Returns the component that's currently underneath the mouse.
@ -1562,7 +1563,7 @@ public:
is moved beyond the edge of the screen
*/
void enableUnboundedMouseMovement (bool shouldUnboundedMovementBeEnabled,
bool keepCursorVisibleUntilOffscreen = false);
bool keepCursorVisibleUntilOffscreen = false) throw();
//==============================================================================
/** Called when this component's size has been changed.
@ -1671,7 +1672,7 @@ public:
@see handleCommandMessage
*/
void postCommandMessage (const int commandId);
void postCommandMessage (const int commandId) throw();
/** Called to handle a command that was sent by postCommandMessage().
@ -1732,14 +1733,14 @@ public:
@see getCurrentlyModalComponent
*/
bool isCurrentlyModal() const;
bool isCurrentlyModal() const throw();
/** Returns the component that is currently modal.
@returns the modal component, or null if no components are modal
@see runModalLoop, isCurrentlyModal
*/
static Component* getCurrentlyModalComponent();
static Component* getCurrentlyModalComponent() throw();
/** Checks whether there's a modal component somewhere that's stopping this one
from receiving messages.
@ -1749,7 +1750,7 @@ public:
@see runModalLoop, getCurrentlyModalComponent
*/
bool isCurrentlyBlockedByAnotherModalComponent() const;
bool isCurrentlyBlockedByAnotherModalComponent() const throw();
/** When a component is modal, this callback allows it to choose which other
components can still receive events.
@ -1895,7 +1896,7 @@ public:
@see getComponentProperty, setComponentProperty
*/
PropertySet* getComponentProperties() const throw() { return propertySet_; }
PropertySet* getComponentProperties() const throw() { return propertySet_; }
//==============================================================================
/** Looks for a colour that has been registered with the given colour ID number.
@ -1952,7 +1953,7 @@ public:
This is platform-dependent and strictly for power-users only!
*/
void* getWindowHandle() const;
void* getWindowHandle() const throw();
/** When created, each component is given a number to uniquely identify it.
@ -1960,7 +1961,7 @@ public:
unique way of identifying a component than using its memory location (which
may be reused after the component is deleted, of course).
*/
uint32 getComponentUID() const throw() { return componentUID; }
uint32 getComponentUID() const throw() { return componentUID; }
//==============================================================================
juce_UseDebuggingNewOperator
@ -2036,9 +2037,9 @@ private:
void internalChildrenChanged();
void internalHierarchyChanged();
void internalFilesDropped (const int x, const int y, const StringArray& files);
void internalUpdateMouseCursor (const bool forcedUpdate);
void internalUpdateMouseCursor (const bool forcedUpdate) throw();
void sendMovedResizedMessages (const bool wasMoved, const bool wasResized);
void repaintParent();
void repaintParent() throw();
void sendFakeMouseMove() const;
void takeKeyboardFocus (FocusChangeType cause);
void grabFocusInternal (FocusChangeType cause, const bool canTryParent = true);
@ -2048,9 +2049,9 @@ private:
void subtractObscuredRegions (RectangleList& result,
const int deltaX, const int deltaY,
const Rectangle& clipRect,
const Component* const compToAvoid) const;
const Component* const compToAvoid) const throw();
void clipObscuredRegions (Graphics& g, const Rectangle& clipRect,
const int deltaX, const int deltaY) const;
const int deltaX, const int deltaY) const throw();
// how much of the component is not off the edges of its parents
const Rectangle getUnclippedArea() const;

View file

@ -70,7 +70,7 @@ public:
//==============================================================================
/** There's only one dektop object, and this method will return it.
*/
static Desktop& JUCE_CALLTYPE getInstance();
static Desktop& getInstance();
//==============================================================================
/** Returns a list of the positions of all the monitors available.

View file

@ -45,7 +45,7 @@ public:
int direction;
ScrollbarButton (const int direction_,
ScrollBar& owner_)
ScrollBar& owner_) throw()
: Button (String::empty),
direction (direction_),
owner (owner_)
@ -131,7 +131,7 @@ void ScrollBar::setRangeLimits (const double newMinimum,
}
void ScrollBar::setCurrentRange (double newStart,
double newSize)
double newSize) throw()
{
newSize = jlimit (0.0, maximum - minimum, newSize);
newStart = jlimit (minimum, maximum - newSize, newStart);
@ -147,39 +147,39 @@ void ScrollBar::setCurrentRange (double newStart,
}
}
void ScrollBar::setCurrentRangeStart (double newStart)
void ScrollBar::setCurrentRangeStart (double newStart) throw()
{
setCurrentRange (newStart, rangeSize);
}
void ScrollBar::setSingleStepSize (const double newSingleStepSize)
void ScrollBar::setSingleStepSize (const double newSingleStepSize) throw()
{
singleStepSize = newSingleStepSize;
}
void ScrollBar::moveScrollbarInSteps (const int howManySteps)
void ScrollBar::moveScrollbarInSteps (const int howManySteps) throw()
{
setCurrentRangeStart (rangeStart + howManySteps * singleStepSize);
}
void ScrollBar::moveScrollbarInPages (const int howManyPages)
void ScrollBar::moveScrollbarInPages (const int howManyPages) throw()
{
setCurrentRangeStart (rangeStart + howManyPages * rangeSize);
}
void ScrollBar::scrollToTop()
void ScrollBar::scrollToTop() throw()
{
setCurrentRangeStart (minimum);
}
void ScrollBar::scrollToBottom()
void ScrollBar::scrollToBottom() throw()
{
setCurrentRangeStart (maximum - rangeSize);
}
void ScrollBar::setButtonRepeatSpeed (const int initialDelayInMillisecs_,
const int repeatDelayInMillisecs_,
const int minimumDelayInMillisecs_)
const int minimumDelayInMillisecs_) throw()
{
initialDelayInMillisecs = initialDelayInMillisecs_;
repeatDelayInMillisecs = repeatDelayInMillisecs_;
@ -217,7 +217,7 @@ void ScrollBar::handleAsyncUpdate()
}
//==============================================================================
void ScrollBar::updateThumbPosition()
void ScrollBar::updateThumbPosition() throw()
{
int newThumbSize = roundDoubleToInt ((maximum > minimum) ? (rangeSize * thumbAreaSize) / (maximum - minimum)
: thumbAreaSize);
@ -251,7 +251,7 @@ void ScrollBar::updateThumbPosition()
}
}
void ScrollBar::setOrientation (const bool shouldBeVertical)
void ScrollBar::setOrientation (const bool shouldBeVertical) throw()
{
if (vertical != shouldBeVertical)
{

View file

@ -102,7 +102,7 @@ public:
//==============================================================================
/** Returns true if the scrollbar is vertical, false if it's horizontal. */
bool isVertical() const { return vertical; }
bool isVertical() const throw() { return vertical; }
/** Changes the scrollbar's direction.
@ -111,7 +111,7 @@ public:
@param shouldBeVertical true makes it vertical; false makes it horizontal.
*/
void setOrientation (const bool shouldBeVertical);
void setOrientation (const bool shouldBeVertical) throw();
/** Shows or hides the scrollbar's buttons. */
void setButtonVisibility (const bool buttonsAreVisible);
@ -131,13 +131,13 @@ public:
This is the value set by setRangeLimits().
*/
double getMinimumRangeLimit() const { return minimum; }
double getMinimumRangeLimit() const throw() { return minimum; }
/** Returns the upper value that the thumb can be set to.
This is the value set by setRangeLimits().
*/
double getMaximumRangeLimit() const { return maximum; }
double getMaximumRangeLimit() const throw() { return maximum; }
//==============================================================================
/** Changes the position of the scrollbar's 'thumb'.
@ -158,7 +158,7 @@ public:
@see setCurrentRangeStart, getCurrentRangeStart, getCurrentRangeSize
*/
void setCurrentRange (double newStart,
double newSize);
double newSize) throw();
/** Moves the bar's thumb position.
@ -171,19 +171,19 @@ public:
@see setCurrentRange
*/
void setCurrentRangeStart (double newStart);
void setCurrentRangeStart (double newStart) throw();
/** Returns the position of the top of the thumb.
@see setCurrentRangeStart
*/
double getCurrentRangeStart() const { return rangeStart; }
double getCurrentRangeStart() const throw() { return rangeStart; }
/** Returns the current size of the thumb.
@see setCurrentRange
*/
double getCurrentRangeSize() const { return rangeSize; }
double getCurrentRangeSize() const throw() { return rangeSize; }
//==============================================================================
/** Sets the amount by which the up and down buttons will move the bar.
@ -191,7 +191,7 @@ public:
The value here is in terms of the total range, and is added or subtracted
from the thumb position when the user clicks an up/down (or left/right) button.
*/
void setSingleStepSize (const double newSingleStepSize);
void setSingleStepSize (const double newSingleStepSize) throw();
/** Moves the scrollbar by a number of single-steps.
@ -201,7 +201,7 @@ public:
A positive value here will move the bar down or to the right, a negative
value moves it up or to the left.
*/
void moveScrollbarInSteps (const int howManySteps);
void moveScrollbarInSteps (const int howManySteps) throw();
/** Moves the scroll bar up or down in pages.
@ -211,19 +211,19 @@ public:
A positive value here will move the bar down or to the right, a negative
value moves it up or to the left.
*/
void moveScrollbarInPages (const int howManyPages);
void moveScrollbarInPages (const int howManyPages) throw();
/** Scrolls to the top (or left).
This is the same as calling setCurrentRangeStart (getMinimumRangeLimit());
*/
void scrollToTop();
void scrollToTop() throw();
/** Scrolls to the bottom (or right).
This is the same as calling setCurrentRangeStart (getMaximumRangeLimit() - getCurrentRangeSize());
*/
void scrollToBottom();
void scrollToBottom() throw();
/** Changes the delay before the up and down buttons autorepeat when they are held
down.
@ -234,7 +234,7 @@ public:
*/
void setButtonRepeatSpeed (const int initialDelayInMillisecs,
const int repeatDelayInMillisecs,
const int minimumDelayInMillisecs = -1);
const int minimumDelayInMillisecs = -1) throw();
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the component.
@ -292,7 +292,7 @@ private:
Button* downButton;
SortedSet <void*> listeners;
void updateThumbPosition();
void updateThumbPosition() throw();
void timerCallback();
ScrollBar (const ScrollBar&);

View file

@ -104,12 +104,12 @@ void Viewport::setViewedComponent (Component* const newViewedComponent)
}
}
int Viewport::getMaximumVisibleWidth() const
int Viewport::getMaximumVisibleWidth() const throw()
{
return jmax (0, getWidth() - (verticalScrollBar->isVisible() ? getScrollBarThickness() : 0));
}
int Viewport::getMaximumVisibleHeight() const
int Viewport::getMaximumVisibleHeight() const throw()
{
return jmax (0, getHeight() - (horizontalScrollBar->isVisible() ? getScrollBarThickness() : 0));
}
@ -250,7 +250,7 @@ void Viewport::setScrollBarThickness (const int thickness)
updateVisibleRegion();
}
int Viewport::getScrollBarThickness() const
int Viewport::getScrollBarThickness() const throw()
{
return (scrollBarThickness > 0) ? scrollBarThickness
: getLookAndFeel().getDefaultScrollbarWidth();

View file

@ -139,14 +139,14 @@ public:
This will be the width of the viewport component minus the width of a
vertical scrollbar (if visible).
*/
int getMaximumVisibleWidth() const;
int getMaximumVisibleWidth() const throw();
/** Returns the height available within this component for the contents.
This will be the height of the viewport component minus the space taken up
by a horizontal scrollbar (if visible).
*/
int getMaximumVisibleHeight() const;
int getMaximumVisibleHeight() const throw();
//==============================================================================
/** Callback method that is called when the visible area changes.
@ -188,7 +188,7 @@ public:
@see setScrollBarThickness
*/
int getScrollBarThickness() const;
int getScrollBarThickness() const throw();
/** Changes the distance that a single-step click on a scrollbar button
will move the viewport.

View file

@ -37,7 +37,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
static forcedinline uint8 JUCE_CALLTYPE floatAlphaToInt (const float alpha)
static forcedinline uint8 floatAlphaToInt (const float alpha)
{
return (uint8) jlimit (0, 0xff, roundFloatToInt (alpha * 255.0f));
}
@ -46,57 +46,57 @@ static const float oneOver255 = 1.0f / 255.0f;
//==============================================================================
JUCE_CALLTYPE Colour::Colour() throw()
Colour::Colour() throw()
: argb (0)
{
}
JUCE_CALLTYPE Colour::Colour (const Colour& other) throw()
Colour::Colour (const Colour& other) throw()
: argb (other.argb)
{
}
const Colour& JUCE_CALLTYPE Colour::operator= (const Colour& other) throw()
const Colour& Colour::operator= (const Colour& other) throw()
{
argb = other.argb;
return *this;
}
bool JUCE_CALLTYPE Colour::operator== (const Colour& other) const throw()
bool Colour::operator== (const Colour& other) const throw()
{
return argb.getARGB() == other.argb.getARGB();
}
bool JUCE_CALLTYPE Colour::operator!= (const Colour& other) const throw()
bool Colour::operator!= (const Colour& other) const throw()
{
return argb.getARGB() != other.argb.getARGB();
}
//==============================================================================
JUCE_CALLTYPE Colour::Colour (const uint32 argb_) throw()
Colour::Colour (const uint32 argb_) throw()
: argb (argb_)
{
}
JUCE_CALLTYPE Colour::Colour (const uint8 red,
const uint8 green,
const uint8 blue) throw()
Colour::Colour (const uint8 red,
const uint8 green,
const uint8 blue) throw()
{
argb.setARGB (0xff, red, green, blue);
}
JUCE_CALLTYPE Colour::Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const uint8 alpha) throw()
Colour::Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const uint8 alpha) throw()
{
argb.setARGB (alpha, red, green, blue);
}
JUCE_CALLTYPE Colour::Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const float alpha) throw()
Colour::Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const float alpha) throw()
{
argb.setARGB (floatAlphaToInt (alpha), red, green, blue);
}
@ -168,10 +168,10 @@ static void convertHSBtoRGB (float h, const float s, float v,
}
}
JUCE_CALLTYPE Colour::Colour (const float hue,
const float saturation,
const float brightness,
const float alpha) throw()
Colour::Colour (const float hue,
const float saturation,
const float brightness,
const float alpha) throw()
{
uint8 r = getRed(), g = getGreen(), b = getBlue();
convertHSBtoRGB (hue, saturation, brightness, r, g, b);
@ -179,10 +179,10 @@ JUCE_CALLTYPE Colour::Colour (const float hue,
argb.setARGB (floatAlphaToInt (alpha), r, g, b);
}
JUCE_CALLTYPE Colour::Colour (const float hue,
const float saturation,
const float brightness,
const uint8 alpha) throw()
Colour::Colour (const float hue,
const float saturation,
const float brightness,
const uint8 alpha) throw()
{
uint8 r = getRed(), g = getGreen(), b = getBlue();
convertHSBtoRGB (hue, saturation, brightness, r, g, b);
@ -190,51 +190,51 @@ JUCE_CALLTYPE Colour::Colour (const float hue,
argb.setARGB (alpha, r, g, b);
}
JUCE_CALLTYPE Colour::~Colour() throw()
Colour::~Colour() throw()
{
}
//==============================================================================
const PixelARGB JUCE_CALLTYPE Colour::getPixelARGB() const throw()
const PixelARGB Colour::getPixelARGB() const throw()
{
PixelARGB p (argb);
p.premultiply();
return p;
}
uint32 JUCE_CALLTYPE Colour::getARGB() const throw()
uint32 Colour::getARGB() const throw()
{
return argb.getARGB();
}
//==============================================================================
bool JUCE_CALLTYPE Colour::isTransparent() const throw()
bool Colour::isTransparent() const throw()
{
return getAlpha() == 0;
}
bool JUCE_CALLTYPE Colour::isOpaque() const throw()
bool Colour::isOpaque() const throw()
{
return getAlpha() == 0xff;
}
const Colour JUCE_CALLTYPE Colour::withAlpha (const uint8 newAlpha) const throw()
const Colour Colour::withAlpha (const uint8 newAlpha) const throw()
{
return Colour (getRed(), getGreen(), getBlue(), newAlpha);
}
const Colour JUCE_CALLTYPE Colour::withAlpha (const float newAlpha) const throw()
const Colour Colour::withAlpha (const float newAlpha) const throw()
{
return withAlpha (floatAlphaToInt (newAlpha));
}
const Colour JUCE_CALLTYPE Colour::withMultipliedAlpha (const float alphaMultiplier) const throw()
const Colour Colour::withMultipliedAlpha (const float alphaMultiplier) const throw()
{
return withAlpha ((uint8) jlimit (0, 0xff, roundFloatToInt (alphaMultiplier * getAlpha())));
}
//==============================================================================
const Colour JUCE_CALLTYPE Colour::overlaidWith (const Colour& src) const throw()
const Colour Colour::overlaidWith (const Colour& src) const throw()
{
const int destAlpha = getAlpha();
@ -262,28 +262,28 @@ const Colour JUCE_CALLTYPE Colour::overlaidWith (const Colour& src) const throw(
}
//==============================================================================
float JUCE_CALLTYPE Colour::getFloatRed() const throw()
float Colour::getFloatRed() const throw()
{
return getRed() * oneOver255;
}
float JUCE_CALLTYPE Colour::getFloatGreen() const throw()
float Colour::getFloatGreen() const throw()
{
return getGreen() * oneOver255;
}
float JUCE_CALLTYPE Colour::getFloatBlue() const throw()
float Colour::getFloatBlue() const throw()
{
return getBlue() * oneOver255;
}
float JUCE_CALLTYPE Colour::getFloatAlpha() const throw()
float Colour::getFloatAlpha() const throw()
{
return getAlpha() * oneOver255;
}
//==============================================================================
void JUCE_CALLTYPE Colour::getHSB (float& h, float& s, float& v) const throw()
void Colour::getHSB (float& h, float& s, float& v) const throw()
{
const int r = getRed();
const int g = getGreen();
@ -331,14 +331,14 @@ void JUCE_CALLTYPE Colour::getHSB (float& h, float& s, float& v) const throw()
}
//==============================================================================
float JUCE_CALLTYPE Colour::getHue() const throw()
float Colour::getHue() const throw()
{
float h, s, b;
getHSB (h, s, b);
return h;
}
const Colour JUCE_CALLTYPE Colour::withHue (const float hue) const throw()
const Colour Colour::withHue (const float hue) const throw()
{
float h, s, b;
getHSB (h, s, b);
@ -346,7 +346,7 @@ const Colour JUCE_CALLTYPE Colour::withHue (const float hue) const throw()
return Colour (hue, s, b, getAlpha());
}
const Colour JUCE_CALLTYPE Colour::withRotatedHue (const float amountToRotate) const throw()
const Colour Colour::withRotatedHue (const float amountToRotate) const throw()
{
float h, s, b;
getHSB (h, s, b);
@ -358,14 +358,14 @@ const Colour JUCE_CALLTYPE Colour::withRotatedHue (const float amountToRotate) c
}
//==============================================================================
float JUCE_CALLTYPE Colour::getSaturation() const throw()
float Colour::getSaturation() const throw()
{
float h, s, b;
getHSB (h, s, b);
return s;
}
const Colour JUCE_CALLTYPE Colour::withSaturation (const float saturation) const throw()
const Colour Colour::withSaturation (const float saturation) const throw()
{
float h, s, b;
getHSB (h, s, b);
@ -373,7 +373,7 @@ const Colour JUCE_CALLTYPE Colour::withSaturation (const float saturation) const
return Colour (h, saturation, b, getAlpha());
}
const Colour JUCE_CALLTYPE Colour::withMultipliedSaturation (const float amount) const throw()
const Colour Colour::withMultipliedSaturation (const float amount) const throw()
{
float h, s, b;
getHSB (h, s, b);
@ -382,14 +382,14 @@ const Colour JUCE_CALLTYPE Colour::withMultipliedSaturation (const float amount)
}
//==============================================================================
float JUCE_CALLTYPE Colour::getBrightness() const throw()
float Colour::getBrightness() const throw()
{
float h, s, b;
getHSB (h, s, b);
return b;
}
const Colour JUCE_CALLTYPE Colour::withBrightness (const float brightness) const throw()
const Colour Colour::withBrightness (const float brightness) const throw()
{
float h, s, b;
getHSB (h, s, b);
@ -397,7 +397,7 @@ const Colour JUCE_CALLTYPE Colour::withBrightness (const float brightness) const
return Colour (h, s, brightness, getAlpha());
}
const Colour JUCE_CALLTYPE Colour::withMultipliedBrightness (const float amount) const throw()
const Colour Colour::withMultipliedBrightness (const float amount) const throw()
{
float h, s, b;
getHSB (h, s, b);
@ -411,7 +411,7 @@ const Colour JUCE_CALLTYPE Colour::withMultipliedBrightness (const float amount)
}
//==============================================================================
const Colour JUCE_CALLTYPE Colour::brighter (float amount) const throw()
const Colour Colour::brighter (float amount) const throw()
{
amount = 1.0f / (1.0f + amount);
@ -421,7 +421,7 @@ const Colour JUCE_CALLTYPE Colour::brighter (float amount) const throw()
getAlpha());
}
const Colour JUCE_CALLTYPE Colour::darker (float amount) const throw()
const Colour Colour::darker (float amount) const throw()
{
amount = 1.0f / (1.0f + amount);
@ -432,7 +432,7 @@ const Colour JUCE_CALLTYPE Colour::darker (float amount) const throw()
}
//==============================================================================
const Colour JUCE_CALLTYPE Colour::greyLevel (const float brightness) throw()
const Colour Colour::greyLevel (const float brightness) throw()
{
const uint8 level
= (uint8) jlimit (0x00, 0xff, roundFloatToInt (brightness * 255.0f));
@ -441,15 +441,15 @@ const Colour JUCE_CALLTYPE Colour::greyLevel (const float brightness) throw()
}
//==============================================================================
const Colour JUCE_CALLTYPE Colour::contrasting (const float amount) const throw()
const Colour Colour::contrasting (const float amount) const throw()
{
return overlaidWith ((((int) getRed() + (int) getGreen() + (int) getBlue() >= 3 * 128)
? Colours::black
: Colours::white).withAlpha (amount));
}
const Colour JUCE_CALLTYPE Colour::contrasting (const Colour& colour1,
const Colour& colour2) throw()
const Colour Colour::contrasting (const Colour& colour1,
const Colour& colour2) throw()
{
const float b1 = colour1.getBrightness();
const float b2 = colour2.getBrightness();
@ -474,12 +474,12 @@ const Colour JUCE_CALLTYPE Colour::contrasting (const Colour& colour1,
}
//==============================================================================
const String JUCE_CALLTYPE Colour::toString() const throw()
const String Colour::toString() const throw()
{
return String::toHexString ((int) argb.getARGB());
}
const Colour JUCE_CALLTYPE Colour::fromString (const String& encodedColourString)
const Colour Colour::fromString (const String& encodedColourString)
{
return Colour ((uint32) encodedColourString.getHexValue32());
}

View file

@ -46,10 +46,10 @@ class JUCE_API Colour
public:
//==============================================================================
/** Creates a transparent black colour. */
JUCE_CALLTYPE Colour() throw();
Colour() throw();
/** Creates a copy of another Colour object. */
JUCE_CALLTYPE Colour (const Colour& other) throw();
Colour (const Colour& other) throw();
/** Creates a colour from a 32-bit ARGB value.
@ -61,28 +61,28 @@ public:
@see getPixelARGB
*/
explicit JUCE_CALLTYPE Colour (const uint32 argb) throw();
explicit Colour (const uint32 argb) throw();
/** Creates an opaque colour using 8-bit red, green and blue values */
JUCE_CALLTYPE Colour (const uint8 red,
const uint8 green,
const uint8 blue) throw();
Colour (const uint8 red,
const uint8 green,
const uint8 blue) throw();
/** Creates a colour using 8-bit red, green, blue and alpha values. */
JUCE_CALLTYPE Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const uint8 alpha) throw();
Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const uint8 alpha) throw();
/** Creates a colour from 8-bit red, green, and blue values, and a floating-point alpha.
Alpha of 0.0 is transparent, alpha of 1.0f is opaque.
Values outside the valid range will be clipped.
*/
JUCE_CALLTYPE Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const float alpha) throw();
Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const float alpha) throw();
/** Creates a colour using floating point hue, saturation and brightness values, and an 8-bit alpha.
@ -90,116 +90,116 @@ public:
An alpha of 0x00 is completely transparent, alpha of 0xff is opaque.
Values outside the valid range will be clipped.
*/
JUCE_CALLTYPE Colour (const float hue,
const float saturation,
const float brightness,
const uint8 alpha) throw();
Colour (const float hue,
const float saturation,
const float brightness,
const uint8 alpha) throw();
/** Creates a colour using floating point hue, saturation, brightness and alpha values.
All values must be between 0.0 and 1.0.
Numbers outside the valid range will be clipped.
*/
JUCE_CALLTYPE Colour (const float hue,
const float saturation,
const float brightness,
const float alpha) throw();
Colour (const float hue,
const float saturation,
const float brightness,
const float alpha) throw();
/** Destructor. */
JUCE_CALLTYPE ~Colour() throw();
~Colour() throw();
/** Copies another Colour object. */
const Colour& JUCE_CALLTYPE operator= (const Colour& other) throw();
const Colour& operator= (const Colour& other) throw();
/** Compares two colours. */
bool JUCE_CALLTYPE operator== (const Colour& other) const throw();
bool operator== (const Colour& other) const throw();
/** Compares two colours. */
bool JUCE_CALLTYPE operator!= (const Colour& other) const throw();
bool operator!= (const Colour& other) const throw();
//==============================================================================
/** Returns the red component of this colour.
@returns a value between 0x00 and 0xff.
*/
uint8 JUCE_CALLTYPE getRed() const throw() { return argb.getRed(); }
uint8 getRed() const throw() { return argb.getRed(); }
/** Returns the green component of this colour.
@returns a value between 0x00 and 0xff.
*/
uint8 JUCE_CALLTYPE getGreen() const throw() { return argb.getGreen(); }
uint8 getGreen() const throw() { return argb.getGreen(); }
/** Returns the blue component of this colour.
@returns a value between 0x00 and 0xff.
*/
uint8 JUCE_CALLTYPE getBlue() const throw() { return argb.getBlue(); }
uint8 getBlue() const throw() { return argb.getBlue(); }
/** Returns the red component of this colour as a floating point value.
@returns a value between 0.0 and 1.0
*/
float JUCE_CALLTYPE getFloatRed() const throw();
float getFloatRed() const throw();
/** Returns the green component of this colour as a floating point value.
@returns a value between 0.0 and 1.0
*/
float JUCE_CALLTYPE getFloatGreen() const throw();
float getFloatGreen() const throw();
/** Returns the blue component of this colour as a floating point value.
@returns a value between 0.0 and 1.0
*/
float JUCE_CALLTYPE getFloatBlue() const throw();
float getFloatBlue() const throw();
/** Returns a premultiplied ARGB pixel object that represents this colour.
*/
const PixelARGB JUCE_CALLTYPE getPixelARGB() const throw();
const PixelARGB getPixelARGB() const throw();
/** Returns a 32-bit integer that represents this colour.
The format of this number is:
((alpha << 24) | (red << 16) | (green << 16) | blue).
*/
uint32 JUCE_CALLTYPE getARGB() const throw();
uint32 getARGB() const throw();
//==============================================================================
/** Returns the colour's alpha (opacity).
Alpha of 0x00 is completely transparent, 0xff is completely opaque.
*/
uint8 JUCE_CALLTYPE getAlpha() const throw() { return argb.getAlpha(); }
uint8 getAlpha() const throw() { return argb.getAlpha(); }
/** Returns the colour's alpha (opacity) as a floating point value.
Alpha of 0.0 is completely transparent, 1.0 is completely opaque.
*/
float JUCE_CALLTYPE getFloatAlpha() const throw();
float getFloatAlpha() const throw();
/** Returns true if this colour is completely opaque.
Equivalent to (getAlpha() == 0xff).
*/
bool JUCE_CALLTYPE isOpaque() const throw();
bool isOpaque() const throw();
/** Returns true if this colour is completely transparent.
Equivalent to (getAlpha() == 0x00).
*/
bool JUCE_CALLTYPE isTransparent() const throw();
bool isTransparent() const throw();
/** Returns a colour that's the same colour as this one, but with a new alpha value. */
const Colour JUCE_CALLTYPE withAlpha (const uint8 newAlpha) const throw();
const Colour withAlpha (const uint8 newAlpha) const throw();
/** Returns a colour that's the same colour as this one, but with a new alpha value. */
const Colour JUCE_CALLTYPE withAlpha (const float newAlpha) const throw();
const Colour withAlpha (const float newAlpha) const throw();
/** Returns a colour that's the same colour as this one, but with a modified alpha value.
The new colour's alpha will be this object's alpha multiplied by the value passed-in.
*/
const Colour JUCE_CALLTYPE withMultipliedAlpha (const float alphaMultiplier) const throw();
const Colour withMultipliedAlpha (const float alphaMultiplier) const throw();
//==============================================================================
/** Returns a colour that is the result of alpha-compositing a new colour over this one.
@ -207,42 +207,42 @@ public:
If the foreground colour is semi-transparent, it is blended onto this colour
accordingly.
*/
const Colour JUCE_CALLTYPE overlaidWith (const Colour& foregroundColour) const throw();
const Colour overlaidWith (const Colour& foregroundColour) const throw();
//==============================================================================
/** Returns the colour's hue component.
The value returned is in the range 0.0 to 1.0
*/
float JUCE_CALLTYPE getHue() const throw();
float getHue() const throw();
/** Returns the colour's saturation component.
The value returned is in the range 0.0 to 1.0
*/
float JUCE_CALLTYPE getSaturation() const throw();
float getSaturation() const throw();
/** Returns the colour's brightness component.
The value returned is in the range 0.0 to 1.0
*/
float JUCE_CALLTYPE getBrightness() const throw();
float getBrightness() const throw();
/** Returns the colour's hue, saturation and brightness components all at once.
The values returned are in the range 0.0 to 1.0
*/
void JUCE_CALLTYPE getHSB (float& hue,
float& saturation,
float& brightness) const throw();
void getHSB (float& hue,
float& saturation,
float& brightness) const throw();
//==============================================================================
/** Returns a copy of this colour with a different hue. */
const Colour JUCE_CALLTYPE withHue (const float newHue) const throw();
const Colour withHue (const float newHue) const throw();
/** Returns a copy of this colour with a different saturation. */
const Colour JUCE_CALLTYPE withSaturation (const float newSaturation) const throw();
const Colour withSaturation (const float newSaturation) const throw();
/** Returns a copy of this colour with a different brightness.
@see brighter, darker, withMultipliedBrightness
*/
const Colour JUCE_CALLTYPE withBrightness (const float newBrightness) const throw();
const Colour withBrightness (const float newBrightness) const throw();
/** Returns a copy of this colour with it hue rotated.
@ -250,21 +250,21 @@ public:
@see brighter, darker, withMultipliedBrightness
*/
const Colour JUCE_CALLTYPE withRotatedHue (const float amountToRotate) const throw();
const Colour withRotatedHue (const float amountToRotate) const throw();
/** Returns a copy of this colour with its saturation multiplied by the given value.
The new colour's saturation is (this->getSaturation() * multiplier)
(the result is clipped to legal limits).
*/
const Colour JUCE_CALLTYPE withMultipliedSaturation (const float multiplier) const throw();
const Colour withMultipliedSaturation (const float multiplier) const throw();
/** Returns a copy of this colour with its brightness multiplied by the given value.
The new colour's saturation is (this->getBrightness() * multiplier)
(the result is clipped to legal limits).
*/
const Colour JUCE_CALLTYPE withMultipliedBrightness (const float amount) const throw();
const Colour withMultipliedBrightness (const float amount) const throw();
//==============================================================================
/** Returns a brighter version of this colour.
@ -273,7 +273,7 @@ public:
unchanged, and higher values make it brighter
@see withMultipliedBrightness
*/
const Colour JUCE_CALLTYPE brighter (float amountBrighter = 0.4f) const throw();
const Colour brighter (float amountBrighter = 0.4f) const throw();
/** Returns a darker version of this colour.
@ -281,7 +281,7 @@ public:
unchanged, and higher values make it darker
@see withMultipliedBrightness
*/
const Colour JUCE_CALLTYPE darker (float amountDarker = 0.4f) const throw();
const Colour darker (float amountDarker = 0.4f) const throw();
//==============================================================================
/** Returns a colour that will be clearly visible against this colour.
@ -291,7 +291,7 @@ public:
that's just a little bit lighter; Colours::black.contrasting (1.0f) will
return white; Colours::white.contrasting (1.0f) will return black, etc.
*/
const Colour JUCE_CALLTYPE contrasting (const float amount = 1.0f) const throw();
const Colour contrasting (const float amount = 1.0f) const throw();
/** Returns a colour that contrasts against two colours.
@ -299,26 +299,26 @@ public:
Handy for things like choosing a highlight colour in text editors, etc.
*/
static const Colour JUCE_CALLTYPE contrasting (const Colour& colour1,
const Colour& colour2) throw();
static const Colour contrasting (const Colour& colour1,
const Colour& colour2) throw();
//==============================================================================
/** Returns an opaque shade of grey.
@param brightness the level of grey to return - 0 is black, 1.0 is white
*/
static const Colour JUCE_CALLTYPE greyLevel (const float brightness) throw();
static const Colour greyLevel (const float brightness) throw();
//==============================================================================
/** Returns a stringified version of this colour.
The string can be turned back into a colour using the fromString() method.
*/
const String JUCE_CALLTYPE toString() const throw();
const String toString() const throw();
/** Reads the colour from a string that was created with toString().
*/
static const Colour JUCE_CALLTYPE fromString (const String& encodedColourString);
static const Colour fromString (const String& encodedColourString);
//==============================================================================
juce_UseDebuggingNewOperator

View file

@ -53,7 +53,7 @@ LowLevelGraphicsContext::~LowLevelGraphicsContext()
}
//==============================================================================
JUCE_CALLTYPE Graphics::Graphics (Image& imageToDrawOnto) throw()
Graphics::Graphics (Image& imageToDrawOnto) throw()
: context (imageToDrawOnto.createLowLevelContext()),
ownsContext (true),
state (new GraphicsState()),
@ -61,7 +61,7 @@ JUCE_CALLTYPE Graphics::Graphics (Image& imageToDrawOnto) throw()
{
}
JUCE_CALLTYPE Graphics::Graphics (LowLevelGraphicsContext* const internalContext) throw()
Graphics::Graphics (LowLevelGraphicsContext* const internalContext) throw()
: context (internalContext),
ownsContext (false),
state (new GraphicsState()),
@ -69,7 +69,7 @@ JUCE_CALLTYPE Graphics::Graphics (LowLevelGraphicsContext* const internalContext
{
}
JUCE_CALLTYPE Graphics::~Graphics() throw()
Graphics::~Graphics() throw()
{
delete state;
@ -78,55 +78,55 @@ JUCE_CALLTYPE Graphics::~Graphics() throw()
}
//==============================================================================
void JUCE_CALLTYPE Graphics::resetToDefaultState() throw()
void Graphics::resetToDefaultState() throw()
{
setColour (Colours::black);
state->font.resetToDefaultState();
state->quality = defaultQuality;
}
bool JUCE_CALLTYPE Graphics::isVectorDevice() const throw()
bool Graphics::isVectorDevice() const throw()
{
return context->isVectorDevice();
}
bool JUCE_CALLTYPE Graphics::reduceClipRegion (const int x, const int y,
const int w, const int h) throw()
bool Graphics::reduceClipRegion (const int x, const int y,
const int w, const int h) throw()
{
saveStateIfPending();
return context->reduceClipRegion (x, y, w, h);
}
bool JUCE_CALLTYPE Graphics::reduceClipRegion (const RectangleList& clipRegion) throw()
bool Graphics::reduceClipRegion (const RectangleList& clipRegion) throw()
{
saveStateIfPending();
return context->reduceClipRegion (clipRegion);
}
void JUCE_CALLTYPE Graphics::excludeClipRegion (const int x, const int y,
const int w, const int h) throw()
void Graphics::excludeClipRegion (const int x, const int y,
const int w, const int h) throw()
{
saveStateIfPending();
context->excludeClipRegion (x, y, w, h);
}
bool JUCE_CALLTYPE Graphics::isClipEmpty() const throw()
bool Graphics::isClipEmpty() const throw()
{
return context->isClipEmpty();
}
const Rectangle JUCE_CALLTYPE Graphics::getClipBounds() const throw()
const Rectangle Graphics::getClipBounds() const throw()
{
return context->getClipBounds();
}
void JUCE_CALLTYPE Graphics::saveState() throw()
void Graphics::saveState() throw()
{
saveStateIfPending();
saveStatePending = true;
}
void JUCE_CALLTYPE Graphics::restoreState() throw()
void Graphics::restoreState() throw()
{
if (saveStatePending)
{
@ -154,7 +154,7 @@ void JUCE_CALLTYPE Graphics::restoreState() throw()
}
}
void JUCE_CALLTYPE Graphics::saveStateIfPending() throw()
void Graphics::saveStateIfPending() throw()
{
if (saveStatePending)
{
@ -165,39 +165,39 @@ void JUCE_CALLTYPE Graphics::saveStateIfPending() throw()
}
}
void JUCE_CALLTYPE Graphics::setOrigin (const int newOriginX,
const int newOriginY) throw()
void Graphics::setOrigin (const int newOriginX,
const int newOriginY) throw()
{
saveStateIfPending();
context->setOrigin (newOriginX, newOriginY);
}
bool JUCE_CALLTYPE Graphics::clipRegionIntersects (const int x, const int y,
const int w, const int h) const throw()
bool Graphics::clipRegionIntersects (const int x, const int y,
const int w, const int h) const throw()
{
return context->clipRegionIntersects (x, y, w, h);
}
//==============================================================================
void JUCE_CALLTYPE Graphics::setColour (const Colour& newColour) throw()
void Graphics::setColour (const Colour& newColour) throw()
{
saveStateIfPending();
state->colour = newColour;
deleteAndZero (state->brush);
}
const Colour& JUCE_CALLTYPE Graphics::getCurrentColour() const throw()
const Colour& Graphics::getCurrentColour() const throw()
{
return state->colour;
}
void JUCE_CALLTYPE Graphics::setOpacity (const float newOpacity) throw()
void Graphics::setOpacity (const float newOpacity) throw()
{
saveStateIfPending();
state->colour = state->colour.withAlpha (newOpacity);
}
void JUCE_CALLTYPE Graphics::setBrush (const Brush* const newBrush) throw()
void Graphics::setBrush (const Brush* const newBrush) throw()
{
saveStateIfPending();
delete state->brush;
@ -209,14 +209,14 @@ void JUCE_CALLTYPE Graphics::setBrush (const Brush* const newBrush) throw()
}
//==============================================================================
JUCE_CALLTYPE Graphics::GraphicsState::GraphicsState() throw()
Graphics::GraphicsState::GraphicsState() throw()
: colour (Colours::black),
brush (0),
quality (defaultQuality)
{
}
JUCE_CALLTYPE Graphics::GraphicsState::GraphicsState (const GraphicsState& other) throw()
Graphics::GraphicsState::GraphicsState (const GraphicsState& other) throw()
: colour (other.colour),
brush (other.brush != 0 ? other.brush->createCopy() : 0),
font (other.font),
@ -224,34 +224,34 @@ JUCE_CALLTYPE Graphics::GraphicsState::GraphicsState (const GraphicsState& other
{
}
JUCE_CALLTYPE Graphics::GraphicsState::~GraphicsState() throw()
Graphics::GraphicsState::~GraphicsState() throw()
{
delete brush;
}
//==============================================================================
void JUCE_CALLTYPE Graphics::setFont (const Font& newFont) throw()
void Graphics::setFont (const Font& newFont) throw()
{
saveStateIfPending();
state->font = newFont;
}
void JUCE_CALLTYPE Graphics::setFont (const float newFontHeight,
const int newFontStyleFlags) throw()
void Graphics::setFont (const float newFontHeight,
const int newFontStyleFlags) throw()
{
saveStateIfPending();
state->font.setSizeAndStyle (newFontHeight, newFontStyleFlags, 1.0f, 0.0f);
}
const Font& JUCE_CALLTYPE Graphics::getCurrentFont() const throw()
const Font& Graphics::getCurrentFont() const throw()
{
return state->font;
}
//==============================================================================
void JUCE_CALLTYPE Graphics::drawSingleLineText (const String& text,
const int startX,
const int baselineY) const throw()
void Graphics::drawSingleLineText (const String& text,
const int startX,
const int baselineY) const throw()
{
if (text.isNotEmpty()
&& startX < context->getClipBounds().getRight())
@ -262,8 +262,8 @@ void JUCE_CALLTYPE Graphics::drawSingleLineText (const String& text,
}
}
void JUCE_CALLTYPE Graphics::drawTextAsPath (const String& text,
const AffineTransform& transform) const throw()
void Graphics::drawTextAsPath (const String& text,
const AffineTransform& transform) const throw()
{
if (text.isNotEmpty())
{
@ -273,10 +273,10 @@ void JUCE_CALLTYPE Graphics::drawTextAsPath (const String& text,
}
}
void JUCE_CALLTYPE Graphics::drawMultiLineText (const String& text,
const int startX,
const int baselineY,
const int maximumLineWidth) const throw()
void Graphics::drawMultiLineText (const String& text,
const int startX,
const int baselineY,
const int maximumLineWidth) const throw()
{
if (text.isNotEmpty()
&& startX < context->getClipBounds().getRight())
@ -289,13 +289,13 @@ void JUCE_CALLTYPE Graphics::drawMultiLineText (const String& text,
}
}
void JUCE_CALLTYPE Graphics::drawText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justificationType,
const bool useEllipsesIfTooBig) const throw()
void Graphics::drawText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justificationType,
const bool useEllipsesIfTooBig) const throw()
{
if (text.isNotEmpty() && context->clipRegionIntersects (x, y, width, height))
{
@ -313,14 +313,14 @@ void JUCE_CALLTYPE Graphics::drawText (const String& text,
}
}
void JUCE_CALLTYPE Graphics::drawFittedText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justification,
const int maximumNumberOfLines,
const float minimumHorizontalScale) const throw()
void Graphics::drawFittedText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justification,
const int maximumNumberOfLines,
const float minimumHorizontalScale) const throw()
{
if (text.isNotEmpty()
&& width > 0 && height > 0
@ -340,16 +340,16 @@ void JUCE_CALLTYPE Graphics::drawFittedText (const String& text,
}
//==============================================================================
void JUCE_CALLTYPE Graphics::fillRect (int x,
int y,
int width,
int height) const throw()
void Graphics::fillRect (int x,
int y,
int width,
int height) const throw()
{
SolidColourBrush colourBrush (state->colour);
(state->brush != 0 ? *(state->brush) : (Brush&) colourBrush).paintRectangle (*context, x, y, width, height);
}
void JUCE_CALLTYPE Graphics::fillRect (const Rectangle& r) const throw()
void Graphics::fillRect (const Rectangle& r) const throw()
{
fillRect (r.getX(),
r.getY(),
@ -357,17 +357,17 @@ void JUCE_CALLTYPE Graphics::fillRect (const Rectangle& r) const throw()
r.getHeight());
}
void JUCE_CALLTYPE Graphics::fillRect (const float x,
const float y,
const float width,
const float height) const throw()
void Graphics::fillRect (const float x,
const float y,
const float width,
const float height) const throw()
{
Path p;
p.addRectangle (x, y, width, height);
fillPath (p);
}
void JUCE_CALLTYPE Graphics::setPixel (int x, int y) const throw()
void Graphics::setPixel (int x, int y) const throw()
{
if (context->clipRegionIntersects (x, y, 1, 1))
{
@ -376,12 +376,12 @@ void JUCE_CALLTYPE Graphics::setPixel (int x, int y) const throw()
}
}
void JUCE_CALLTYPE Graphics::fillAll() const throw()
void Graphics::fillAll() const throw()
{
fillRect (context->getClipBounds());
}
void JUCE_CALLTYPE Graphics::fillAll (const Colour& colourToUse) const throw()
void Graphics::fillAll (const Colour& colourToUse) const throw()
{
if (! colourToUse.isTransparent())
{
@ -394,8 +394,8 @@ void JUCE_CALLTYPE Graphics::fillAll (const Colour& colourToUse) const throw()
//==============================================================================
void JUCE_CALLTYPE Graphics::fillPath (const Path& path,
const AffineTransform& transform) const throw()
void Graphics::fillPath (const Path& path,
const AffineTransform& transform) const throw()
{
if ((! context->isClipEmpty()) && ! path.isEmpty())
{
@ -404,9 +404,9 @@ void JUCE_CALLTYPE Graphics::fillPath (const Path& path,
}
}
void JUCE_CALLTYPE Graphics::strokePath (const Path& path,
const PathStrokeType& strokeType,
const AffineTransform& transform) const throw()
void Graphics::strokePath (const Path& path,
const PathStrokeType& strokeType,
const AffineTransform& transform) const throw()
{
if (! state->colour.isTransparent())
{
@ -417,11 +417,11 @@ void JUCE_CALLTYPE Graphics::strokePath (const Path& path,
}
//==============================================================================
void JUCE_CALLTYPE Graphics::drawRect (const int x,
const int y,
const int width,
const int height,
const int lineThickness) const throw()
void Graphics::drawRect (const int x,
const int y,
const int width,
const int height,
const int lineThickness) const throw()
{
SolidColourBrush colourBrush (state->colour);
Brush& b = (state->brush != 0 ? *(state->brush) : (Brush&) colourBrush);
@ -432,14 +432,14 @@ void JUCE_CALLTYPE Graphics::drawRect (const int x,
b.paintRectangle (*context, x, y + height - lineThickness, width, lineThickness);
}
void JUCE_CALLTYPE Graphics::drawBevel (const int x,
const int y,
const int width,
const int height,
const int bevelThickness,
const Colour& topLeftColour,
const Colour& bottomRightColour,
const bool useGradient) const throw()
void Graphics::drawBevel (const int x,
const int y,
const int width,
const int height,
const int bevelThickness,
const Colour& topLeftColour,
const Colour& bottomRightColour,
const bool useGradient) const throw()
{
if (clipRegionIntersects (x, y, width, height))
{
@ -460,57 +460,57 @@ void JUCE_CALLTYPE Graphics::drawBevel (const int x,
}
//==============================================================================
void JUCE_CALLTYPE Graphics::fillEllipse (const float x,
const float y,
const float width,
const float height) const throw()
void Graphics::fillEllipse (const float x,
const float y,
const float width,
const float height) const throw()
{
Path p;
p.addEllipse (x, y, width, height);
fillPath (p);
}
void JUCE_CALLTYPE Graphics::drawEllipse (const float x,
const float y,
const float width,
const float height,
const float lineThickness) const throw()
void Graphics::drawEllipse (const float x,
const float y,
const float width,
const float height,
const float lineThickness) const throw()
{
Path p;
p.addEllipse (x, y, width, height);
strokePath (p, PathStrokeType (lineThickness));
}
void JUCE_CALLTYPE Graphics::fillRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize) const throw()
void Graphics::fillRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize) const throw()
{
Path p;
p.addRoundedRectangle (x, y, width, height, cornerSize);
fillPath (p);
}
void JUCE_CALLTYPE Graphics::drawRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize,
const float lineThickness) const throw()
void Graphics::drawRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize,
const float lineThickness) const throw()
{
Path p;
p.addRoundedRectangle (x, y, width, height, cornerSize);
strokePath (p, PathStrokeType (lineThickness));
}
void JUCE_CALLTYPE Graphics::drawArrow (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness,
const float arrowheadWidth,
const float arrowheadLength) const throw()
void Graphics::drawArrow (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness,
const float arrowheadWidth,
const float arrowheadLength) const throw()
{
Path p;
p.addArrow (startX, startY, endX, endY,
@ -518,12 +518,12 @@ void JUCE_CALLTYPE Graphics::drawArrow (const float startX,
fillPath (p);
}
void JUCE_CALLTYPE Graphics::fillCheckerBoard (int x, int y,
int width, int height,
const int checkWidth,
const int checkHeight,
const Colour& colour1,
const Colour& colour2) const throw()
void Graphics::fillCheckerBoard (int x, int y,
int width, int height,
const int checkWidth,
const int checkHeight,
const Colour& colour1,
const Colour& colour2) const throw()
{
jassert (checkWidth > 0 && checkHeight > 0); // can't be zero or less!
@ -560,20 +560,20 @@ void JUCE_CALLTYPE Graphics::fillCheckerBoard (int x, int y,
}
//==============================================================================
void JUCE_CALLTYPE Graphics::drawVerticalLine (const int x, float top, float bottom) const throw()
void Graphics::drawVerticalLine (const int x, float top, float bottom) const throw()
{
SolidColourBrush colourBrush (state->colour);
(state->brush != 0 ? *(state->brush) : (Brush&) colourBrush).paintVerticalLine (*context, x, top, bottom);
}
void JUCE_CALLTYPE Graphics::drawHorizontalLine (const int y, float left, float right) const throw()
void Graphics::drawHorizontalLine (const int y, float left, float right) const throw()
{
SolidColourBrush colourBrush (state->colour);
(state->brush != 0 ? *(state->brush) : (Brush&) colourBrush).paintHorizontalLine (*context, y, left, right);
}
void JUCE_CALLTYPE Graphics::drawLine (float x1, float y1,
float x2, float y2) const throw()
void Graphics::drawLine (float x1, float y1,
float x2, float y2) const throw()
{
if (! context->isClipEmpty())
{
@ -582,35 +582,35 @@ void JUCE_CALLTYPE Graphics::drawLine (float x1, float y1,
}
}
void JUCE_CALLTYPE Graphics::drawLine (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness) const throw()
void Graphics::drawLine (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness) const throw()
{
Path p;
p.addLineSegment (startX, startY, endX, endY, lineThickness);
fillPath (p);
}
void JUCE_CALLTYPE Graphics::drawLine (const Line& line) const throw()
void Graphics::drawLine (const Line& line) const throw()
{
drawLine (line.getStartX(), line.getStartY(), line.getEndX(), line.getEndY());
}
void JUCE_CALLTYPE Graphics::drawLine (const Line& line,
const float lineThickness) const throw()
void Graphics::drawLine (const Line& line,
const float lineThickness) const throw()
{
drawLine (line.getStartX(), line.getStartY(), line.getEndX(), line.getEndY(), lineThickness);
}
void JUCE_CALLTYPE Graphics::drawDashedLine (const float startX,
const float startY,
const float endX,
const float endY,
const float* const dashLengths,
const int numDashLengths,
const float lineThickness) const throw()
void Graphics::drawDashedLine (const float startX,
const float startY,
const float endX,
const float endY,
const float* const dashLengths,
const int numDashLengths,
const float lineThickness) const throw()
{
const double dx = endX - startX;
const double dy = endY - startY;
@ -648,17 +648,17 @@ void JUCE_CALLTYPE Graphics::drawDashedLine (const float startX,
}
//==============================================================================
void JUCE_CALLTYPE Graphics::setImageResamplingQuality (const Graphics::ResamplingQuality newQuality) throw()
void Graphics::setImageResamplingQuality (const Graphics::ResamplingQuality newQuality) throw()
{
saveStateIfPending();
state->quality = newQuality;
}
//==============================================================================
void JUCE_CALLTYPE Graphics::drawImageAt (const Image* const imageToDraw,
const int topLeftX,
const int topLeftY,
const bool fillAlphaChannelWithCurrentBrush) const throw()
void Graphics::drawImageAt (const Image* const imageToDraw,
const int topLeftX,
const int topLeftY,
const bool fillAlphaChannelWithCurrentBrush) const throw()
{
if (imageToDraw != 0)
{
@ -672,13 +672,13 @@ void JUCE_CALLTYPE Graphics::drawImageAt (const Image* const imageToDraw,
}
}
void JUCE_CALLTYPE Graphics::drawImageWithin (const Image* const imageToDraw,
const int destX,
const int destY,
const int destW,
const int destH,
const RectanglePlacement& placementWithinTarget,
const bool fillAlphaChannelWithCurrentBrush) const throw()
void Graphics::drawImageWithin (const Image* const imageToDraw,
const int destX,
const int destY,
const int destW,
const int destH,
const RectanglePlacement& placementWithinTarget,
const bool fillAlphaChannelWithCurrentBrush) const throw()
{
if (imageToDraw != 0)
{
@ -706,10 +706,10 @@ void JUCE_CALLTYPE Graphics::drawImageWithin (const Image* const imageToDraw,
}
}
void JUCE_CALLTYPE Graphics::drawImage (const Image* const imageToDraw,
int dx, int dy, int dw, int dh,
int sx, int sy, int sw, int sh,
const bool fillAlphaChannelWithCurrentBrush) const throw()
void Graphics::drawImage (const Image* const imageToDraw,
int dx, int dy, int dw, int dh,
int sx, int sy, int sw, int sh,
const bool fillAlphaChannelWithCurrentBrush) const throw()
{
if (imageToDraw == 0 || ! context->clipRegionIntersects (dx, dy, dw, dh))
return;
@ -812,13 +812,13 @@ void JUCE_CALLTYPE Graphics::drawImage (const Image* const imageToDraw,
}
}
void JUCE_CALLTYPE Graphics::drawImageTransformed (const Image* const imageToDraw,
int sourceClipX,
int sourceClipY,
int sourceClipWidth,
int sourceClipHeight,
const AffineTransform& transform,
const bool fillAlphaChannelWithCurrentBrush) const throw()
void Graphics::drawImageTransformed (const Image* const imageToDraw,
int sourceClipX,
int sourceClipY,
int sourceClipWidth,
int sourceClipHeight,
const AffineTransform& transform,
const bool fillAlphaChannelWithCurrentBrush) const throw()
{
if (imageToDraw != 0
&& (! context->isClipEmpty())

View file

@ -70,10 +70,10 @@ public:
Obviously you shouldn't delete the image before this context is deleted.
*/
JUCE_CALLTYPE Graphics (Image& imageToDrawOnto) throw();
Graphics (Image& imageToDrawOnto) throw();
/** Destructor. */
JUCE_CALLTYPE ~Graphics() throw();
~Graphics() throw();
//==============================================================================
/** Changes the current drawing colour.
@ -86,7 +86,7 @@ public:
@see setOpacity, setBrush, getColour
*/
void JUCE_CALLTYPE setColour (const Colour& newColour) throw();
void setColour (const Colour& newColour) throw();
/** Returns the colour that's currently being used.
@ -95,7 +95,7 @@ public:
@see setColour
*/
const Colour& JUCE_CALLTYPE getCurrentColour() const throw();
const Colour& getCurrentColour() const throw();
/** Changes the opacity to use with the current colour.
@ -104,7 +104,7 @@ public:
A value of 0.0 is completely transparent, 1.0 is completely opaque.
*/
void JUCE_CALLTYPE setOpacity (const float newOpacity) throw();
void setOpacity (const float newOpacity) throw();
/** Changes the current brush to use for drawing.
@ -116,7 +116,7 @@ public:
@see SolidColourBrush, GradientBrush, ImageBrush, Brush
*/
void JUCE_CALLTYPE setBrush (const Brush* const newBrush) throw();
void setBrush (const Brush* const newBrush) throw();
//==============================================================================
/** Changes the font to use for subsequent text-drawing functions.
@ -126,7 +126,7 @@ public:
@see drawSingleLineText, drawMultiLineText, drawTextAsPath, drawText, drawFittedText
*/
void JUCE_CALLTYPE setFont (const Font& newFont) throw();
void setFont (const Font& newFont) throw();
/** Changes the size and style of the currently-selected font.
@ -135,14 +135,14 @@ public:
@see Font
*/
void JUCE_CALLTYPE setFont (const float newFontHeight,
const int fontStyleFlags = Font::plain) throw();
void setFont (const float newFontHeight,
const int fontStyleFlags = Font::plain) throw();
/** Returns the font that's currently being used for text operations.
@see setFont
*/
const Font& JUCE_CALLTYPE getCurrentFont() const throw();
const Font& getCurrentFont() const throw();
/** Draws a one-line text string.
@ -154,9 +154,9 @@ public:
@param baselineY the position of the text's baseline
@see drawMultiLineText, drawText, drawFittedText, GlyphArrangement::addLineOfText
*/
void JUCE_CALLTYPE drawSingleLineText (const String& text,
const int startX,
const int baselineY) const throw();
void drawSingleLineText (const String& text,
const int startX,
const int baselineY) const throw();
/** Draws text across multiple lines.
@ -166,10 +166,10 @@ public:
@see setFont, drawSingleLineText, drawFittedText, GlyphArrangement::addJustifiedText
*/
void JUCE_CALLTYPE drawMultiLineText (const String& text,
const int startX,
const int baselineY,
const int maximumLineWidth) const throw();
void drawMultiLineText (const String& text,
const int startX,
const int baselineY,
const int maximumLineWidth) const throw();
/** Renders a string of text as a vector path.
@ -179,8 +179,8 @@ public:
@see setFont
*/
void JUCE_CALLTYPE drawTextAsPath (const String& text,
const AffineTransform& transform) const throw();
void drawTextAsPath (const String& text,
const AffineTransform& transform) const throw();
/** Draws a line of text within a specified rectangle.
@ -191,13 +191,13 @@ public:
@see drawSingleLineText, drawFittedText, drawMultiLineText, GlyphArrangement::addJustifiedText
*/
void JUCE_CALLTYPE drawText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justificationType,
const bool useEllipsesIfTooBig) const throw();
void drawText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justificationType,
const bool useEllipsesIfTooBig) const throw();
/** Tries to draw a text string inside a given space.
@ -218,14 +218,14 @@ public:
@see GlyphArrangement::addFittedText
*/
void JUCE_CALLTYPE drawFittedText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justificationFlags,
const int maximumNumberOfLines,
const float minimumHorizontalScale = 0.7f) const throw();
void drawFittedText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justificationFlags,
const int maximumNumberOfLines,
const float minimumHorizontalScale = 0.7f) const throw();
//==============================================================================
/** Fills the context's entire clip region with the current colour or brush.
@ -233,56 +233,56 @@ public:
(See also the fillAll (const Colour&) method which is a quick way of filling
it with a given colour).
*/
void JUCE_CALLTYPE fillAll() const throw();
void fillAll() const throw();
/** Fills the context's entire clip region with a given colour.
This leaves the context's current colour and brush unchanged, it just
uses the specified colour temporarily.
*/
void JUCE_CALLTYPE fillAll (const Colour& colourToUse) const throw();
void fillAll (const Colour& colourToUse) const throw();
//==============================================================================
/** Fills a rectangle with the current colour or brush.
@see drawRect, fillRoundedRectangle
*/
void JUCE_CALLTYPE fillRect (int x,
int y,
int width,
int height) const throw();
void fillRect (int x,
int y,
int width,
int height) const throw();
/** Fills a rectangle with the current colour or brush. */
void JUCE_CALLTYPE fillRect (const Rectangle& rectangle) const throw();
void fillRect (const Rectangle& rectangle) const throw();
/** Fills a rectangle with the current colour or brush.
This uses sub-pixel positioning so is slower than the fillRect method which
takes integer co-ordinates.
*/
void JUCE_CALLTYPE fillRect (const float x,
const float y,
const float width,
const float height) const throw();
void fillRect (const float x,
const float y,
const float width,
const float height) const throw();
/** Uses the current colour or brush to fill a rectangle with rounded corners.
@see drawRoundedRectangle, Path::addRoundedRectangle
*/
void JUCE_CALLTYPE fillRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize) const throw();
void fillRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize) const throw();
/** Fills a rectangle with a checkerboard pattern, alternating between two colours.
*/
void JUCE_CALLTYPE fillCheckerBoard (int x, int y,
int width, int height,
const int checkWidth,
const int checkHeight,
const Colour& colour1,
const Colour& colour2) const throw();
void fillCheckerBoard (int x, int y,
int width, int height,
const int checkWidth,
const int checkHeight,
const Colour& colour1,
const Colour& colour2) const throw();
/** Draws four lines to form a rectangular outline, using the current colour or brush.
@ -291,22 +291,22 @@ public:
@see fillRect
*/
void JUCE_CALLTYPE drawRect (const int x,
const int y,
const int width,
const int height,
const int lineThickness = 1) const throw();
void drawRect (const int x,
const int y,
const int width,
const int height,
const int lineThickness = 1) const throw();
/** Uses the current colour or brush to draw the outline of a rectangle with rounded corners.
@see fillRoundedRectangle, Path::addRoundedRectangle
*/
void JUCE_CALLTYPE drawRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize,
const float lineThickness) const throw();
void drawRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize,
const float lineThickness) const throw();
/** Draws a 3D raised (or indented) bevel using two colours.
@ -317,18 +317,18 @@ public:
bevel; the bottom-right colour is used for the bottom- and right-hand
edges.
*/
void JUCE_CALLTYPE drawBevel (const int x,
const int y,
const int width,
const int height,
const int bevelThickness,
const Colour& topLeftColour = Colours::white,
const Colour& bottomRightColour = Colours::black,
const bool useGradient = true) const throw();
void drawBevel (const int x,
const int y,
const int width,
const int height,
const int bevelThickness,
const Colour& topLeftColour = Colours::white,
const Colour& bottomRightColour = Colours::black,
const bool useGradient = true) const throw();
/** Draws a pixel using the current colour or brush.
*/
void JUCE_CALLTYPE setPixel (int x, int y) const throw();
void setPixel (int x, int y) const throw();
//==============================================================================
/** Fills an ellipse with the current colour or brush.
@ -337,53 +337,53 @@ public:
@see drawEllipse, Path::addEllipse
*/
void JUCE_CALLTYPE fillEllipse (const float x,
const float y,
const float width,
const float height) const throw();
void fillEllipse (const float x,
const float y,
const float width,
const float height) const throw();
/** Draws an elliptical stroke using the current colour or brush.
@see fillEllipse, Path::addEllipse
*/
void JUCE_CALLTYPE drawEllipse (const float x,
const float y,
const float width,
const float height,
const float lineThickness) const throw();
void drawEllipse (const float x,
const float y,
const float width,
const float height,
const float lineThickness) const throw();
//==============================================================================
/** Draws a line between two points.
The line is 1 pixel wide and drawn with the current colour or brush.
*/
void JUCE_CALLTYPE drawLine (float startX,
float startY,
float endX,
float endY) const throw();
void drawLine (float startX,
float startY,
float endX,
float endY) const throw();
/** Draws a line between two points with a given thickness.
@see Path::addLineSegment
*/
void JUCE_CALLTYPE drawLine (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness) const throw();
void drawLine (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness) const throw();
/** Draws a line between two points.
The line is 1 pixel wide and drawn with the current colour or brush.
*/
void JUCE_CALLTYPE drawLine (const Line& line) const throw();
void drawLine (const Line& line) const throw();
/** Draws a line between two points with a given thickness.
@see Path::addLineSegment
*/
void JUCE_CALLTYPE drawLine (const Line& line,
const float lineThickness) const throw();
void drawLine (const Line& line,
const float lineThickness) const throw();
/** Draws a dashed line using a custom set of dash-lengths.
@ -398,39 +398,39 @@ public:
@param lineThickness the thickness of the line to draw
@see PathStrokeType::createDashedStroke
*/
void JUCE_CALLTYPE drawDashedLine (const float startX,
const float startY,
const float endX,
const float endY,
const float* const dashLengths,
const int numDashLengths,
const float lineThickness = 1.0f) const throw();
void drawDashedLine (const float startX,
const float startY,
const float endX,
const float endY,
const float* const dashLengths,
const int numDashLengths,
const float lineThickness = 1.0f) const throw();
/** Draws a vertical line of pixels at a given x position.
The x position is an integer, but the top and bottom of the line can be sub-pixel
positions, and these will be anti-aliased if necessary.
*/
void JUCE_CALLTYPE drawVerticalLine (const int x, float top, float bottom) const throw();
void drawVerticalLine (const int x, float top, float bottom) const throw();
/** Draws a horizontal line of pixels at a given y position.
The y position is an integer, but the left and right ends of the line can be sub-pixel
positions, and these will be anti-aliased if necessary.
*/
void JUCE_CALLTYPE drawHorizontalLine (const int y, float left, float right) const throw();
void drawHorizontalLine (const int y, float left, float right) const throw();
//==============================================================================
/** Fills a path using the currently selected colour or brush.
*/
void JUCE_CALLTYPE fillPath (const Path& path,
const AffineTransform& transform = AffineTransform::identity) const throw();
void fillPath (const Path& path,
const AffineTransform& transform = AffineTransform::identity) const throw();
/** Draws a path's outline using the currently selected colour or brush.
*/
void JUCE_CALLTYPE strokePath (const Path& path,
const PathStrokeType& strokeType,
const AffineTransform& transform = AffineTransform::identity) const throw();
void strokePath (const Path& path,
const PathStrokeType& strokeType,
const AffineTransform& transform = AffineTransform::identity) const throw();
/** Draws a line with an arrowhead.
@ -442,13 +442,13 @@ public:
@param arrowheadWidth the width of the arrow head (perpendicular to the line)
@param arrowheadLength the length of the arrow head (along the length of the line)
*/
void JUCE_CALLTYPE drawArrow (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness,
const float arrowheadWidth,
const float arrowheadLength) const throw();
void drawArrow (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness,
const float arrowheadWidth,
const float arrowheadLength) const throw();
//==============================================================================
@ -469,7 +469,7 @@ public:
@see Graphics::drawImage, Graphics::drawImageTransformed, Graphics::drawImageWithin
*/
void JUCE_CALLTYPE setImageResamplingQuality (const ResamplingQuality newQuality) throw();
void setImageResamplingQuality (const ResamplingQuality newQuality) throw();
/** Draws an image.
@ -482,10 +482,10 @@ public:
don't want it to be drawn semi-transparently, be sure to call setOpacity (1.0f)
(or setColour() with an opaque colour) before drawing images.
*/
void JUCE_CALLTYPE drawImageAt (const Image* const imageToDraw,
const int topLeftX,
const int topLeftY,
const bool fillAlphaChannelWithCurrentBrush = false) const throw();
void drawImageAt (const Image* const imageToDraw,
const int topLeftX,
const int topLeftY,
const bool fillAlphaChannelWithCurrentBrush = false) const throw();
/** Draws part of an image, rescaling it to fit in a given target region.
@ -512,16 +512,16 @@ public:
it will just fill the target with a solid rectangle)
@see setImageResamplingQuality, drawImageAt, drawImageWithin, fillAlphaMap
*/
void JUCE_CALLTYPE drawImage (const Image* const imageToDraw,
int destX,
int destY,
int destWidth,
int destHeight,
int sourceX,
int sourceY,
int sourceWidth,
int sourceHeight,
const bool fillAlphaChannelWithCurrentBrush = false) const throw();
void drawImage (const Image* const imageToDraw,
int destX,
int destY,
int destWidth,
int destHeight,
int sourceX,
int sourceY,
int sourceWidth,
int sourceHeight,
const bool fillAlphaChannelWithCurrentBrush = false) const throw();
/** Draws part of an image, having applied an affine transform to it.
@ -540,13 +540,13 @@ public:
@see setImageResamplingQuality, drawImage
*/
void JUCE_CALLTYPE drawImageTransformed (const Image* const imageToDraw,
int sourceClipX,
int sourceClipY,
int sourceClipWidth,
int sourceClipHeight,
const AffineTransform& transform,
const bool fillAlphaChannelWithCurrentBrush) const throw();
void drawImageTransformed (const Image* const imageToDraw,
int sourceClipX,
int sourceClipY,
int sourceClipWidth,
int sourceClipHeight,
const AffineTransform& transform,
const bool fillAlphaChannelWithCurrentBrush) const throw();
/** Draws an image to fit within a designated rectangle.
@ -569,13 +569,13 @@ public:
similar to fillAlphaMap(), and see also drawImage()
@see setImageResamplingQuality, drawImage, drawImageTransformed, drawImageAt, RectanglePlacement
*/
void JUCE_CALLTYPE drawImageWithin (const Image* const imageToDraw,
const int destX,
const int destY,
const int destWidth,
const int destHeight,
const RectanglePlacement& placementWithinTarget,
const bool fillAlphaChannelWithCurrentBrush) const throw();
void drawImageWithin (const Image* const imageToDraw,
const int destX,
const int destY,
const int destWidth,
const int destHeight,
const RectanglePlacement& placementWithinTarget,
const bool fillAlphaChannelWithCurrentBrush) const throw();
//==============================================================================
@ -583,7 +583,7 @@ public:
@see getClipRegion, clipRegionIntersects
*/
const Rectangle JUCE_CALLTYPE getClipBounds() const throw();
const Rectangle getClipBounds() const throw();
/** Checks whether a rectangle overlaps the context's clipping region.
@ -591,39 +591,39 @@ public:
method can be used to optimise a component's paint() method, by letting it
avoid drawing complex objects that aren't within the region being repainted.
*/
bool JUCE_CALLTYPE clipRegionIntersects (const int x, const int y, const int width, const int height) const throw();
bool clipRegionIntersects (const int x, const int y, const int width, const int height) const throw();
/** Intersects the current clipping region with another region.
@returns true if the resulting clipping region is non-zero in size
@see setOrigin, clipRegionIntersects, getClipLeft, getClipRight, getClipWidth, getClipHeight
*/
bool JUCE_CALLTYPE reduceClipRegion (const int x, const int y,
const int width, const int height) throw();
bool reduceClipRegion (const int x, const int y,
const int width, const int height) throw();
/** Intersects the current clipping region with a rectangle list region.
@returns true if the resulting clipping region is non-zero in size
@see setOrigin, clipRegionIntersects, getClipLeft, getClipRight, getClipWidth, getClipHeight
*/
bool JUCE_CALLTYPE reduceClipRegion (const RectangleList& clipRegion) throw();
bool reduceClipRegion (const RectangleList& clipRegion) throw();
/** Excludes a rectangle to stop it being drawn into. */
void JUCE_CALLTYPE excludeClipRegion (const int x, const int y,
const int width, const int height) throw();
void excludeClipRegion (const int x, const int y,
const int width, const int height) throw();
/** Returns true if no drawing can be done because the clip region is zero. */
bool JUCE_CALLTYPE isClipEmpty() const throw();
bool isClipEmpty() const throw();
/** Saves the current graphics state on an internal stack.
To restore the state, use restoreState().
*/
void JUCE_CALLTYPE saveState() throw();
void saveState() throw();
/** Restores a graphics state that was previously saved with saveState().
*/
void JUCE_CALLTYPE restoreState() throw();
void restoreState() throw();
/** Moves the position of the context's origin.
@ -635,14 +635,14 @@ public:
@see reduceClipRegion
*/
void JUCE_CALLTYPE setOrigin (const int newOriginX,
const int newOriginY) throw();
void setOrigin (const int newOriginX,
const int newOriginY) throw();
/** Resets the current colour, brush, and font to default settings. */
void JUCE_CALLTYPE resetToDefaultState() throw();
void resetToDefaultState() throw();
/** Returns true if this context is drawing to a vector-based device, such as a printer. */
bool JUCE_CALLTYPE isVectorDevice() const throw();
bool isVectorDevice() const throw();
//==============================================================================
juce_UseDebuggingNewOperator
@ -653,10 +653,10 @@ public:
NB. The context will NOT be deleted by this object when it is deleted.
*/
JUCE_CALLTYPE Graphics (LowLevelGraphicsContext* const internalContext) throw();
Graphics (LowLevelGraphicsContext* const internalContext) throw();
/** @internal */
LowLevelGraphicsContext* JUCE_CALLTYPE getInternalContext() const throw() { return context; }
LowLevelGraphicsContext* getInternalContext() const throw() { return context; }
private:
//==============================================================================
@ -665,9 +665,9 @@ private:
struct GraphicsState
{
JUCE_CALLTYPE GraphicsState() throw();
JUCE_CALLTYPE GraphicsState (const GraphicsState&) throw();
JUCE_CALLTYPE ~GraphicsState() throw();
GraphicsState() throw();
GraphicsState (const GraphicsState&) throw();
~GraphicsState() throw();
Colour colour;
Brush* brush;
@ -679,7 +679,7 @@ private:
OwnedArray <GraphicsState> stateStack;
bool saveStatePending;
void JUCE_CALLTYPE saveStateIfPending() throw();
void saveStateIfPending() throw();
const Graphics& operator= (const Graphics& other);
Graphics (const Graphics&);

View file

@ -49,7 +49,7 @@ public:
TextLayoutToken (const String& t,
const Font& f,
const bool isWhitespace_)
const bool isWhitespace_) throw()
: text (t),
font (f),
x(0),
@ -61,7 +61,7 @@ public:
isNewLine = t.containsAnyOf (T("\r\n"));
}
TextLayoutToken (const TextLayoutToken& other)
TextLayoutToken (const TextLayoutToken& other) throw()
: text (other.text),
font (other.font),
x (other.x),
@ -75,13 +75,13 @@ public:
{
}
~TextLayoutToken()
~TextLayoutToken() throw()
{
}
void draw (Graphics& g,
const int xOffset,
const int yOffset)
const int yOffset) throw()
{
if (! isWhitespace)
{
@ -98,28 +98,28 @@ public:
//==============================================================================
TextLayout::TextLayout()
TextLayout::TextLayout() throw()
: tokens (64),
totalLines (0)
{
}
TextLayout::TextLayout (const String& text,
const Font& font)
const Font& font) throw()
: tokens (64),
totalLines (0)
{
appendText (text, font);
}
TextLayout::TextLayout (const TextLayout& other)
TextLayout::TextLayout (const TextLayout& other) throw()
: tokens (64),
totalLines (0)
{
*this = other;
}
const TextLayout& TextLayout::operator= (const TextLayout& other)
const TextLayout& TextLayout::operator= (const TextLayout& other) throw()
{
if (this != &other)
{
@ -134,13 +134,13 @@ const TextLayout& TextLayout::operator= (const TextLayout& other)
return *this;
}
TextLayout::~TextLayout()
TextLayout::~TextLayout() throw()
{
clear();
}
//==============================================================================
void TextLayout::clear()
void TextLayout::clear() throw()
{
for (int i = tokens.size(); --i >= 0;)
{
@ -153,7 +153,7 @@ void TextLayout::clear()
}
void TextLayout::appendText (const String& text,
const Font& font)
const Font& font) throw()
{
const tchar* t = text;
String currentString;
@ -206,7 +206,7 @@ void TextLayout::appendText (const String& text,
lastCharType == 2));
}
void TextLayout::setText (const String& text, const Font& font)
void TextLayout::setText (const String& text, const Font& font) throw()
{
clear();
appendText (text, font);
@ -215,7 +215,7 @@ void TextLayout::setText (const String& text, const Font& font)
//==============================================================================
void TextLayout::layout (int maxWidth,
const Justification& justification,
const bool attemptToBalanceLineLengths)
const bool attemptToBalanceLineLengths) throw()
{
if (attemptToBalanceLineLengths)
{
@ -331,7 +331,7 @@ void TextLayout::layout (int maxWidth,
}
//==============================================================================
int TextLayout::getLineWidth (const int lineNumber) const
int TextLayout::getLineWidth (const int lineNumber) const throw()
{
int maxW = 0;
@ -346,7 +346,7 @@ int TextLayout::getLineWidth (const int lineNumber) const
return maxW;
}
int TextLayout::getWidth() const
int TextLayout::getWidth() const throw()
{
int maxW = 0;
@ -360,7 +360,7 @@ int TextLayout::getWidth() const
return maxW;
}
int TextLayout::getHeight() const
int TextLayout::getHeight() const throw()
{
int maxH = 0;
@ -378,7 +378,7 @@ int TextLayout::getHeight() const
//==============================================================================
void TextLayout::draw (Graphics& g,
const int xOffset,
const int yOffset) const
const int yOffset) const throw()
{
for (int i = tokens.size(); --i >= 0;)
((TextLayoutToken*) tokens.getUnchecked(i))->draw (g, xOffset, yOffset);
@ -386,7 +386,7 @@ void TextLayout::draw (Graphics& g,
void TextLayout::drawWithin (Graphics& g,
int x, int y, int w, int h,
const Justification& justification) const
const Justification& justification) const throw()
{
justification.applyToRectangle (x, y, getWidth(), getHeight(),
x, y, w, h);
@ -394,4 +394,5 @@ void TextLayout::drawWithin (Graphics& g,
draw (g, x, y);
}
END_JUCE_NAMESPACE

View file

@ -59,23 +59,23 @@ public:
Text can then be appended using the appendText() method.
*/
TextLayout();
TextLayout() throw();
/** Creates a copy of another layout object. */
TextLayout (const TextLayout& other);
TextLayout (const TextLayout& other) throw();
/** Creates a text layout from an initial string and font. */
TextLayout (const String& text, const Font& font);
TextLayout (const String& text, const Font& font) throw();
/** Destructor. */
~TextLayout();
~TextLayout() throw();
/** Copies another layout onto this one. */
const TextLayout& operator= (const TextLayout& layoutToCopy);
const TextLayout& operator= (const TextLayout& layoutToCopy) throw();
//==============================================================================
/** Clears the layout, removing all its text. */
void clear();
void clear() throw();
/** Adds a string to the end of the arrangement.
@ -84,14 +84,14 @@ public:
to wrap long lines into a paragraph and justify it.
*/
void appendText (const String& textToAppend,
const Font& fontToUse);
const Font& fontToUse) throw();
/** Replaces all the text with a new string.
This is equivalent to calling clear() followed by appendText().
*/
void setText (const String& newText,
const Font& fontToUse);
const Font& fontToUse) throw();
//==============================================================================
/** Breaks the text up to form a paragraph with the given width.
@ -108,15 +108,15 @@ public:
*/
void layout (int maximumWidth,
const Justification& justification,
const bool attemptToBalanceLineLengths);
const bool attemptToBalanceLineLengths) throw();
//==============================================================================
/** Returns the overall width of the entire text layout. */
int getWidth() const;
int getWidth() const throw();
/** Returns the overall height of the entire text layout. */
int getHeight() const;
int getHeight() const throw();
/** Returns the total number of lines of text. */
int getNumLines() const throw() { return totalLines; }
@ -125,14 +125,14 @@ public:
@param lineNumber the line, from 0 to (getNumLines() - 1)
*/
int getLineWidth (const int lineNumber) const;
int getLineWidth (const int lineNumber) const throw();
//==============================================================================
/** Renders the text at a specified position using a graphics context.
*/
void draw (Graphics& g,
const int topLeftX,
const int topLeftY) const;
const int topLeftY) const throw();
/** Renders the text within a specified rectangle using a graphics context.
@ -141,7 +141,7 @@ public:
*/
void drawWithin (Graphics& g,
int x, int y, int w, int h,
const Justification& layoutFlags) const;
const Justification& layoutFlags) const throw();
//==============================================================================

View file

@ -46,7 +46,7 @@ BEGIN_JUCE_NAMESPACE
TypefaceGlyphInfo::TypefaceGlyphInfo (const juce_wchar character_,
const Path& shape,
const float horizontalSeparation,
Typeface* const typeface_)
Typeface* const typeface_) throw()
: character (character_),
path (shape),
width (horizontalSeparation),
@ -54,11 +54,11 @@ TypefaceGlyphInfo::TypefaceGlyphInfo (const juce_wchar character_,
{
}
TypefaceGlyphInfo::~TypefaceGlyphInfo()
TypefaceGlyphInfo::~TypefaceGlyphInfo() throw()
{
}
float TypefaceGlyphInfo::getHorizontalSpacing (const juce_wchar subsequentCharacter) const
float TypefaceGlyphInfo::getHorizontalSpacing (const juce_wchar subsequentCharacter) const throw()
{
if (subsequentCharacter != 0)
{
@ -74,7 +74,7 @@ float TypefaceGlyphInfo::getHorizontalSpacing (const juce_wchar subsequentCharac
}
void TypefaceGlyphInfo::addKerningPair (const juce_wchar subsequentCharacter,
const float extraKerningAmount)
const float extraKerningAmount) throw()
{
const int numPairs = getNumKerningPairs();
kerningPairs.setSize ((numPairs + 1) * sizeof (KerningPair));
@ -84,19 +84,19 @@ void TypefaceGlyphInfo::addKerningPair (const juce_wchar subsequentCharacter,
p.kerningAmount = extraKerningAmount;
}
TypefaceGlyphInfo::KerningPair& TypefaceGlyphInfo::getKerningPair (const int index) const
TypefaceGlyphInfo::KerningPair& TypefaceGlyphInfo::getKerningPair (const int index) const throw()
{
return ((KerningPair*) kerningPairs.getData()) [index];
}
int TypefaceGlyphInfo::getNumKerningPairs() const
int TypefaceGlyphInfo::getNumKerningPairs() const throw()
{
return kerningPairs.getSize() / sizeof (KerningPair);
}
//==============================================================================
Typeface::Typeface()
Typeface::Typeface() throw()
: hash (0),
isFullyPopulated (false)
{
@ -136,7 +136,7 @@ Typeface::~Typeface()
clear();
}
const Typeface& Typeface::operator= (const Typeface& other)
const Typeface& Typeface::operator= (const Typeface& other) throw()
{
if (this != &other)
{
@ -158,7 +158,7 @@ const Typeface& Typeface::operator= (const Typeface& other)
return *this;
}
void Typeface::updateHashCode()
void Typeface::updateHashCode() throw()
{
hash = typefaceName.hashCode();
@ -169,7 +169,7 @@ void Typeface::updateHashCode()
hash ^= 0xffff0000;
}
void Typeface::clear()
void Typeface::clear() throw()
{
zeromem (lookupTable, sizeof (lookupTable));
typefaceName = String::empty;
@ -265,7 +265,7 @@ void Typeface::serialise (OutputStream& outputStream)
}
}
const Path* Typeface::getOutlineForGlyph (const juce_wchar character)
const Path* Typeface::getOutlineForGlyph (const juce_wchar character) throw()
{
const TypefaceGlyphInfo* const g = (const TypefaceGlyphInfo*) getGlyph (character);
@ -275,7 +275,7 @@ const Path* Typeface::getOutlineForGlyph (const juce_wchar character)
return 0;
}
const TypefaceGlyphInfo* Typeface::getGlyph (const juce_wchar character)
const TypefaceGlyphInfo* Typeface::getGlyph (const juce_wchar character) throw()
{
if (character > 0 && character < 128 && lookupTable [character] > 0)
return (const TypefaceGlyphInfo*) glyphs [(int)lookupTable [character]];
@ -325,7 +325,7 @@ const TypefaceGlyphInfo* Typeface::getGlyph (const juce_wchar character)
void Typeface::addGlyph (const juce_wchar character,
const Path& path,
const float horizontalSpacing)
const float horizontalSpacing) throw()
{
if (character > 0 && character < 128)
lookupTable [character] = (short) glyphs.size();
@ -336,7 +336,7 @@ void Typeface::addGlyph (const juce_wchar character,
this));
}
void Typeface::addGlyphCopy (const TypefaceGlyphInfo* const glyphInfoToCopy)
void Typeface::addGlyphCopy (const TypefaceGlyphInfo* const glyphInfoToCopy) throw()
{
if (glyphInfoToCopy != 0)
{
@ -356,7 +356,7 @@ void Typeface::addGlyphCopy (const TypefaceGlyphInfo* const glyphInfoToCopy)
void Typeface::addKerningPair (const juce_wchar char1,
const juce_wchar char2,
const float extraAmount)
const float extraAmount) throw()
{
TypefaceGlyphInfo* const g = (TypefaceGlyphInfo*) getGlyph (char1);
@ -444,7 +444,7 @@ public:
}
//==============================================================================
static TypefaceCache* getInstance()
static TypefaceCache* getInstance() throw()
{
if (typefaceCacheInstance == 0)
typefaceCacheInstance = new TypefaceCache();
@ -453,7 +453,7 @@ public:
}
//==============================================================================
const Typeface::Ptr findTypefaceFor (const Font& font)
const Typeface::Ptr findTypefaceFor (const Font& font) throw()
{
const int flags = font.getStyleFlags() & (Font::bold | Font::italic);
@ -497,7 +497,7 @@ public:
}
};
const Typeface::Ptr Typeface::getTypefaceFor (const Font& font)
const Typeface::Ptr Typeface::getTypefaceFor (const Font& font) throw()
{
return TypefaceCache::getInstance()->findTypefaceFor (font);
}

View file

@ -67,7 +67,7 @@ public:
The value returned is expressed as a proportion of the font's height.
*/
float getHorizontalSpacing (const juce_wchar subsequentCharacter) const;
float getHorizontalSpacing (const juce_wchar subsequentCharacter) const throw();
/** Returns the typeface that this glyph belongs to. */
Typeface* getTypeface() const throw() { return typeface; }
@ -92,14 +92,14 @@ private:
TypefaceGlyphInfo (const juce_wchar character,
const Path& shape,
const float horizontalSeparation,
Typeface* const typeface);
~TypefaceGlyphInfo();
Typeface* const typeface) throw();
~TypefaceGlyphInfo() throw();
KerningPair& getKerningPair (const int index) const;
int getNumKerningPairs() const;
KerningPair& getKerningPair (const int index) const throw();
int getNumKerningPairs() const throw();
void addKerningPair (const juce_wchar subsequentCharacter,
const float extraKerningAmount);
const float extraKerningAmount) throw();
const TypefaceGlyphInfo& operator= (const TypefaceGlyphInfo&);
};
@ -136,7 +136,7 @@ public:
~Typeface();
/** Copies another typeface over this one. */
const Typeface& operator= (const Typeface& other);
const Typeface& operator= (const Typeface& other) throw();
/** Returns a unique ID for the typeface.
@ -167,7 +167,7 @@ public:
that is asked for is not found, it will first try to return a default
character instead.
*/
const Path* getOutlineForGlyph (const juce_wchar character);
const Path* getOutlineForGlyph (const juce_wchar character) throw();
/** Tries to find the information describing a glyph for this character.
@ -175,11 +175,11 @@ public:
a default glyph instead; if the typeface is empty, it may return a null
pointer.
*/
const TypefaceGlyphInfo* getGlyph (const juce_wchar character);
const TypefaceGlyphInfo* getGlyph (const juce_wchar character) throw();
//==============================================================================
/** Deletes all the glyphs and kerning data fom the typeface. */
void clear();
void clear() throw();
/** Adds a glyph to the typeface.
@ -188,7 +188,7 @@ public:
*/
void addGlyph (const juce_wchar character,
const Path& path,
const float horizontalSpacing);
const float horizontalSpacing) throw();
/** Adds a kerning distance to the typeface.
@ -200,7 +200,7 @@ public:
*/
void addKerningPair (const juce_wchar firstChar,
const juce_wchar secondChar,
const float extraAmount);
const float extraAmount) throw();
/** Sets the typeface's name.
@ -277,14 +277,14 @@ private:
bool bold, italic, isFullyPopulated;
juce_wchar defaultCharacter; // the char to use if a matching glyph can't be found.
Typeface();
void addGlyphCopy (const TypefaceGlyphInfo* const glyphInfoToCopy);
Typeface() throw();
void addGlyphCopy (const TypefaceGlyphInfo* const glyphInfoToCopy) throw();
friend class Font;
friend class TypefaceCache;
friend class FontGlyphAlphaMap;
static const Ptr getTypefaceFor (const Font& font);
static const Ptr getTypefaceFor (const Font& font) throw();
// this is a platform-dependent method that will look for the given typeface
// and set up its kerning tables, etc. accordingly.
@ -292,12 +292,12 @@ private:
// to the typeface immediately, rather than having to add them later on-demand.
void initialiseTypefaceCharacteristics (const String& fontName,
bool bold, bool italic,
bool addAllGlyphsToFont);
bool addAllGlyphsToFont) throw();
// platform-specific routine to look up and add a glyph to this typeface
void findAndAddSystemGlyph (juce_wchar character);
void findAndAddSystemGlyph (juce_wchar character) throw();
void updateHashCode();
void updateHashCode() throw();
};

View file

@ -42,21 +42,21 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
PathStrokeType::PathStrokeType (const float strokeThickness,
const JointStyle jointStyle_,
const EndCapStyle endStyle_)
const EndCapStyle endStyle_) throw()
: thickness (strokeThickness),
jointStyle (jointStyle_),
endStyle (endStyle_)
{
}
PathStrokeType::PathStrokeType (const PathStrokeType& other)
PathStrokeType::PathStrokeType (const PathStrokeType& other) throw()
: thickness (other.thickness),
jointStyle (other.jointStyle),
endStyle (other.endStyle)
{
}
const PathStrokeType& PathStrokeType::operator= (const PathStrokeType& other)
const PathStrokeType& PathStrokeType::operator= (const PathStrokeType& other) throw()
{
thickness = other.thickness;
jointStyle = other.jointStyle;
@ -64,7 +64,7 @@ const PathStrokeType& PathStrokeType::operator= (const PathStrokeType& other)
return *this;
}
PathStrokeType::~PathStrokeType()
PathStrokeType::~PathStrokeType() throw()
{
}
@ -87,7 +87,7 @@ static bool lineIntersection (const float x1, const float y1,
const float x4, const float y4,
float& intersectionX,
float& intersectionY,
float& distanceBeyondLine1EndSquared)
float& distanceBeyondLine1EndSquared) throw()
{
if (x2 != x3 || y2 != y3)
{
@ -206,7 +206,7 @@ static void addEdgeAndJoint (Path& destPath,
const float x2, const float y2,
const float x3, const float y3,
const float x4, const float y4,
const float midX, const float midY)
const float midX, const float midY) throw()
{
if (style == PathStrokeType::beveled
|| (x3 == x4 && y3 == y4)
@ -271,7 +271,7 @@ static inline void addLineEnd (Path& destPath,
const PathStrokeType::EndCapStyle style,
const float x1, const float y1,
const float x2, const float y2,
const float width)
const float width) throw()
{
if (style == PathStrokeType::butt)
{
@ -339,7 +339,7 @@ struct LineSection
static void addSubPath (Path& destPath, const Array <LineSection>& subPath,
const bool isClosed,
const float width, const float maxMiterExtensionSquared,
const PathStrokeType::JointStyle jointStyle, const PathStrokeType::EndCapStyle endStyle)
const PathStrokeType::JointStyle jointStyle, const PathStrokeType::EndCapStyle endStyle) throw()
{
jassert (subPath.size() > 0);
@ -447,7 +447,7 @@ static void addSubPath (Path& destPath, const Array <LineSection>& subPath,
void PathStrokeType::createStrokedPath (Path& destPath,
const Path& source,
const AffineTransform& transform,
const float extraAccuracy) const
const float extraAccuracy) const throw()
{
if (thickness <= 0)
{
@ -556,7 +556,7 @@ void PathStrokeType::createDashedStroke (Path& destPath,
const float* dashLengths,
int numDashLengths,
const AffineTransform& transform,
const float extraAccuracy) const
const float extraAccuracy) const throw()
{
if (thickness <= 0)
return;

View file

@ -80,16 +80,16 @@ public:
*/
PathStrokeType (const float strokeThickness,
const JointStyle jointStyle = mitered,
const EndCapStyle endStyle = butt);
const EndCapStyle endStyle = butt) throw();
/** Createes a copy of another stroke type. */
PathStrokeType (const PathStrokeType& other);
PathStrokeType (const PathStrokeType& other) throw();
/** Copies another stroke onto this one. */
const PathStrokeType& operator= (const PathStrokeType& other);
const PathStrokeType& operator= (const PathStrokeType& other) throw();
/** Destructor. */
~PathStrokeType();
~PathStrokeType() throw();
//==============================================================================
/** Applies this stroke type to a path and returns the resultant stroke as another Path.
@ -110,7 +110,7 @@ public:
void createStrokedPath (Path& destPath,
const Path& sourcePath,
const AffineTransform& transform = AffineTransform::identity,
const float extraAccuracy = 1.0f) const;
const float extraAccuracy = 1.0f) const throw();
//==============================================================================
@ -141,7 +141,7 @@ public:
const float* dashLengths,
int numDashLengths,
const AffineTransform& transform = AffineTransform::identity,
const float extraAccuracy = 1.0f) const;
const float extraAccuracy = 1.0f) const throw();
//==============================================================================
/** Returns the stroke thickness. */

View file

@ -39,8 +39,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
static inline int makeWord (unsigned char a,
unsigned char b)
static inline int makeWord (const unsigned char a, const unsigned char b) throw()
{
return (b << 8) | a;
}

View file

@ -95,7 +95,7 @@ static boolean jpegFill (j_decompress_ptr) throw()
}
//==============================================================================
Image* juce_loadJPEGImageFromStream (InputStream& in)
Image* juce_loadJPEGImageFromStream (InputStream& in) throw()
{
MemoryBlock mb;
in.readIntoMemoryBlock (mb);
@ -207,7 +207,7 @@ static boolean jpegWriteFlush (j_compress_ptr cinfo) throw()
//==============================================================================
bool juce_writeJPEGImageToStream (const Image& image,
OutputStream& out,
float quality)
float quality) throw()
{
if (image.hasAlphaChannel())
{

View file

@ -51,14 +51,14 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
static void pngReadCallback (png_structp pngReadStruct, png_bytep data, png_size_t length)
static void pngReadCallback (png_structp pngReadStruct, png_bytep data, png_size_t length) throw()
{
InputStream* const in = (InputStream*) png_get_io_ptr (pngReadStruct);
in->read (data, (int) length);
}
//==============================================================================
Image* juce_loadPNGImageFromStream (InputStream& in)
Image* juce_loadPNGImageFromStream (InputStream& in) throw()
{
Image* image = 0;
@ -169,7 +169,7 @@ Image* juce_loadPNGImageFromStream (InputStream& in)
}
//==============================================================================
static void pngWriteDataCallback (png_structp png_ptr, png_bytep data, png_size_t length)
static void pngWriteDataCallback (png_structp png_ptr, png_bytep data, png_size_t length) throw()
{
OutputStream* const out = (OutputStream*) png_ptr->io_ptr;
@ -179,8 +179,7 @@ static void pngWriteDataCallback (png_structp png_ptr, png_bytep data, png_size_
jassert (ok);
}
bool juce_writePNGImageToStream (const Image& image,
OutputStream& out)
bool juce_writePNGImageToStream (const Image& image, OutputStream& out) throw()
{
const int width = image.getWidth();
const int height = image.getHeight();

View file

@ -40,8 +40,8 @@ BEGIN_JUCE_NAMESPACE
#include "image_file_formats/juce_GIFLoader.h"
//==============================================================================
Image* juce_loadPNGImageFromStream (InputStream& inputStream);
bool juce_writePNGImageToStream (const Image& image, OutputStream& out);
Image* juce_loadPNGImageFromStream (InputStream& inputStream) throw();
bool juce_writePNGImageToStream (const Image& image, OutputStream& out) throw();
PNGImageFormat::PNGImageFormat() throw() {}
PNGImageFormat::~PNGImageFormat() throw() {}
@ -74,8 +74,8 @@ bool PNGImageFormat::writeImageToStream (const Image& sourceImage,
}
//==============================================================================
Image* juce_loadJPEGImageFromStream (InputStream& inputStream);
bool juce_writeJPEGImageToStream (const Image& image, OutputStream& out, float quality);
Image* juce_loadJPEGImageFromStream (InputStream& inputStream) throw();
bool juce_writeJPEGImageToStream (const Image& image, OutputStream& out, float quality) throw();
JPEGImageFormat::JPEGImageFormat() throw()
: quality (-1.0f)