Browse Source

misc optimisations

tags/2021-05-28
jules 18 years ago
parent
commit
bfdb48d4bc
53 changed files with 1855 additions and 1880 deletions
  1. +26
    -26
      build/linux/platform_specific_code/juce_linux_Files.cpp
  2. +1
    -1
      build/linux/platform_specific_code/juce_linux_Network.cpp
  3. +21
    -21
      build/linux/platform_specific_code/juce_linux_SystemStats.cpp
  4. +8
    -8
      build/linux/platform_specific_code/juce_linux_Threads.cpp
  5. +5
    -5
      build/linux/platform_specific_code/juce_linux_Windowing.cpp
  6. +33
    -33
      build/macosx/platform_specific_code/juce_mac_Files.cpp
  7. +126
    -138
      build/macosx/platform_specific_code/juce_mac_Network.cpp
  8. +21
    -21
      build/macosx/platform_specific_code/juce_mac_SystemStats.cpp
  9. +8
    -8
      build/macosx/platform_specific_code/juce_mac_Threads.cpp
  10. +6
    -8
      build/macosx/platform_specific_code/juce_mac_Windowing.cpp
  11. +28
    -28
      build/win32/platform_specific_code/juce_win32_Files.cpp
  12. +36
    -50
      build/win32/platform_specific_code/juce_win32_SystemStats.cpp
  13. +9
    -9
      build/win32/platform_specific_code/juce_win32_Threads.cpp
  14. +40
    -40
      build/win32/platform_specific_code/juce_win32_Windowing.cpp
  15. +1
    -1
      extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.cpp
  16. +1
    -0
      extras/the jucer/build/vc8/jucer.vcproj
  17. +4
    -4
      src/juce_appframework/application/juce_Application.cpp
  18. +4
    -4
      src/juce_appframework/events/juce_MessageListener.cpp
  19. +4
    -4
      src/juce_appframework/events/juce_MessageListener.h
  20. +24
    -24
      src/juce_appframework/events/juce_MessageManager.cpp
  21. +26
    -26
      src/juce_appframework/events/juce_MessageManager.h
  22. +7
    -7
      src/juce_appframework/events/juce_Timer.cpp
  23. +7
    -7
      src/juce_appframework/events/juce_Timer.h
  24. +15
    -13
      src/juce_appframework/gui/components/mouse/juce_MouseCursor.cpp
  25. +3
    -3
      src/juce_appframework/gui/components/mouse/juce_MouseCursor.h
  26. +57
    -57
      src/juce_appframework/gui/graphics/colour/juce_Colour.cpp
  27. +62
    -62
      src/juce_appframework/gui/graphics/colour/juce_Colour.h
  28. +159
    -159
      src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp
  29. +168
    -168
      src/juce_appframework/gui/graphics/contexts/juce_Graphics.h
  30. +2
    -2
      src/juce_core/basics/juce_Logger.h
  31. +29
    -29
      src/juce_core/basics/juce_MathsFunctions.h
  32. +8
    -8
      src/juce_core/basics/juce_Singleton.h
  33. +1
    -1
      src/juce_core/basics/juce_StandardHeader.h
  34. +3
    -3
      src/juce_core/basics/juce_SystemStats.cpp
  35. +18
    -18
      src/juce_core/basics/juce_SystemStats.h
  36. +16
    -16
      src/juce_core/basics/juce_Time.cpp
  37. +17
    -17
      src/juce_core/basics/juce_Time.h
  38. +57
    -57
      src/juce_core/containers/juce_Array.h
  39. +4
    -4
      src/juce_core/containers/juce_ArrayAllocationBase.h
  40. +14
    -14
      src/juce_core/containers/juce_ElementComparator.h
  41. +39
    -39
      src/juce_core/containers/juce_OwnedArray.h
  42. +37
    -37
      src/juce_core/containers/juce_ReferenceCountedArray.h
  43. +15
    -15
      src/juce_core/containers/juce_ReferenceCountedObject.h
  44. +29
    -29
      src/juce_core/containers/juce_SortedSet.h
  45. +101
    -101
      src/juce_core/io/files/juce_File.cpp
  46. +83
    -83
      src/juce_core/io/files/juce_File.h
  47. +57
    -57
      src/juce_core/text/juce_CharacterFunctions.cpp
  48. +57
    -57
      src/juce_core/text/juce_CharacterFunctions.h
  49. +172
    -172
      src/juce_core/text/juce_String.cpp
  50. +174
    -174
      src/juce_core/text/juce_String.h
  51. +1
    -1
      src/juce_core/threads/juce_Process.h
  52. +6
    -6
      src/juce_core/threads/juce_Thread.cpp
  53. +5
    -5
      src/juce_core/threads/juce_Thread.h

+ 26
- 26
build/linux/platform_specific_code/juce_linux_Files.cpp View File

@@ -62,7 +62,7 @@ static File executableFile;
//==============================================================================
bool juce_isDirectory (const String& fileName)
bool juce_isDirectory (const String& fileName) throw()
{
if (fileName.isEmpty())
return true;
@@ -75,7 +75,7 @@ bool juce_isDirectory (const String& fileName)
return false;
}
bool juce_fileExists (const String& fileName, const bool dontCountDirectories)
bool juce_fileExists (const String& fileName, const bool dontCountDirectories) throw()
{
if (fileName.isEmpty())
return false;
@@ -88,7 +88,7 @@ bool juce_fileExists (const String& fileName, const bool dontCountDirectories)
return exists;
}
int64 juce_getFileSize (const String& fileName)
int64 juce_getFileSize (const String& fileName) throw()
{
struct stat info;
const int res = stat (fileName.toUTF8(), &info);
@@ -102,7 +102,7 @@ int64 juce_getFileSize (const String& fileName)
void juce_getFileTimes (const String& fileName,
int64& modificationTime,
int64& accessTime,
int64& creationTime)
int64& creationTime) throw()
{
modificationTime = 0;
accessTime = 0;
@@ -125,7 +125,7 @@ void juce_getFileTimes (const String& fileName,
bool juce_setFileTimes (const String& fileName,
int64 modificationTime,
int64 accessTime,
int64 creationTime)
int64 creationTime) throw()
{
struct utimbuf times;
times.actime = (time_t) (accessTime / 1000);
@@ -134,12 +134,12 @@ bool juce_setFileTimes (const String& fileName,
return utime (fileName.toUTF8(), &times) == 0;
}
bool juce_canWriteToFile (const String& fileName)
bool juce_canWriteToFile (const String& fileName) throw()
{
return access (fileName.toUTF8(), W_OK) == 0;
}
bool juce_setFileReadOnly (const String& fileName, bool isReadOnly)
bool juce_setFileReadOnly (const String& fileName, bool isReadOnly) throw()
{
struct stat info;
const int res = stat (fileName.toUTF8(), &info);
@@ -157,7 +157,7 @@ bool juce_setFileReadOnly (const String& fileName, bool isReadOnly)
return chmod (fileName.toUTF8(), info.st_mode) == 0;
}
bool juce_deleteFile (const String& fileName)
bool juce_deleteFile (const String& fileName) throw()
{
if (juce_isDirectory (fileName))
return rmdir (fileName.toUTF8()) == 0;
@@ -165,7 +165,7 @@ bool juce_deleteFile (const String& fileName)
return remove (fileName.toUTF8()) == 0;
}
bool juce_copyFile (const String& s, const String& d)
bool juce_copyFile (const String& s, const String& d) throw()
{
const File source (s), dest (d);
@@ -196,7 +196,7 @@ bool juce_copyFile (const String& s, const String& d)
return ok;
}
bool juce_moveFile (const String& source, const String& dest)
bool juce_moveFile (const String& source, const String& dest) throw()
{
if (rename (source.toUTF8(), dest.toUTF8()) == 0)
return true;
@@ -215,12 +215,12 @@ bool juce_moveFile (const String& source, const String& dest)
return false;
}
void juce_createDirectory (const String& fileName)
void juce_createDirectory (const String& fileName) throw()
{
mkdir (fileName.toUTF8(), 0777);
}
void* juce_fileOpen (const String& fileName, bool forWriting)
void* juce_fileOpen (const String& fileName, bool forWriting) throw()
{
const char* mode = "rb";
@@ -243,13 +243,13 @@ void* juce_fileOpen (const String& fileName, bool forWriting)
return (void*)fopen (fileName.toUTF8(), mode);
}
void juce_fileClose (void* handle)
void juce_fileClose (void* handle) throw()
{
if (handle != 0)
fclose ((FILE*) handle);
}
int juce_fileRead (void* handle, void* buffer, int size)
int juce_fileRead (void* handle, void* buffer, int size) throw()
{
if (handle != 0)
return fread (buffer, 1, size, (FILE*) handle);
@@ -257,7 +257,7 @@ int juce_fileRead (void* handle, void* buffer, int size)
return 0;
}
int juce_fileWrite (void* handle, const void* buffer, int size)
int juce_fileWrite (void* handle, const void* buffer, int size) throw()
{
if (handle != 0)
return fwrite (buffer, 1, size, (FILE*) handle);
@@ -265,7 +265,7 @@ int juce_fileWrite (void* handle, const void* buffer, int size)
return 0;
}
int64 juce_fileSetPosition (void* handle, int64 pos)
int64 juce_fileSetPosition (void* handle, int64 pos) throw()
{
if (handle != 0 && fseek ((FILE*) handle, (long) pos, SEEK_SET) == 0)
return pos;
@@ -273,7 +273,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos)
return -1;
}
int64 juce_fileGetPosition (void* handle)
int64 juce_fileGetPosition (void* handle) throw()
{
if (handle != 0)
return ftell ((FILE*) handle);
@@ -281,13 +281,13 @@ int64 juce_fileGetPosition (void* handle)
return -1;
}
void juce_fileFlush (void* handle)
void juce_fileFlush (void* handle) throw()
{
if (handle != 0)
fflush ((FILE*) handle);
}
const StringArray juce_getFileSystemRoots()
const StringArray juce_getFileSystemRoots() throw()
{
StringArray s;
s.add (T("/"));
@@ -295,7 +295,7 @@ const StringArray juce_getFileSystemRoots()
}
const String juce_getVolumeLabel (const String& filenameOnVolume,
int& volumeSerialNumber)
int& volumeSerialNumber) throw()
{
// There is no equivalent on Linux
volumeSerialNumber = 0;
@@ -421,7 +421,7 @@ const File File::getSpecialLocation (const SpecialLocationType type)
}
//==============================================================================
void juce_setCurrentExecutableFileName (const String& filename)
void juce_setCurrentExecutableFileName (const String& filename) throw()
{
executableFile = File::getCurrentWorkingDirectory().getChildFile (filename);
}
@@ -450,7 +450,7 @@ struct FindFileStruct
DIR* dir;
bool getNextMatch (String& result, bool* const isDir, bool* const isHidden, int64* const fileSize,
Time* const modTime, Time* const creationTime, bool* const isReadOnly)
Time* const modTime, Time* const creationTime, bool* const isReadOnly) throw()
{
const char* const wildcardUTF8 = wildCard.toUTF8();
@@ -507,7 +507,7 @@ struct FindFileStruct
// returns 0 on failure
void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile,
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly)
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly) throw()
{
DIR* d = opendir (directory.toUTF8());
@@ -543,7 +543,7 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin
}
bool juce_findFileNext (void* handle, String& resultFile,
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly)
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly) throw()
{
FindFileStruct* const ff = (FindFileStruct*) handle;
@@ -553,7 +553,7 @@ bool juce_findFileNext (void* handle, String& resultFile,
return false;
}
void juce_findFileClose (void* handle)
void juce_findFileClose (void* handle) throw()
{
FindFileStruct* const ff = (FindFileStruct*) handle;
@@ -565,7 +565,7 @@ void juce_findFileClose (void* handle)
}
bool juce_launchFile (const String& fileName,
const String& parameters)
const String& parameters) throw()
{
String cmdString (fileName);
cmdString << " " << parameters;


+ 1
- 1
build/linux/platform_specific_code/juce_linux_Network.cpp View File

@@ -50,7 +50,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
int SystemStats::getMACAddresses (int64* addresses, int maxNum)
int SystemStats::getMACAddresses (int64* addresses, int maxNum) throw()
{
// xxx todo
return 0;


+ 21
- 21
build/linux/platform_specific_code/juce_linux_SystemStats.cpp View File

@@ -57,7 +57,7 @@ static struct _LogicalCpuInfo
} logicalCpuInfo;
//==============================================================================
static juce_noinline unsigned int getCPUIDWord (int* familyModel, int* extFeatures)
static juce_noinline unsigned int getCPUIDWord (int* familyModel, int* extFeatures) throw()
{
unsigned int cpu = 0;
unsigned int ext = 0;
@@ -77,7 +77,7 @@ static juce_noinline unsigned int getCPUIDWord (int* familyModel, int* extFeatur
return cpu;
}
void juce_initLogicalCpuInfo()
void juce_initLogicalCpuInfo() throw()
{
int familyModelWord, extFeaturesWord;
int featuresWord = getCPUIDWord (&familyModelWord, &extFeaturesWord);
@@ -182,13 +182,13 @@ void juce_initLogicalCpuInfo()
}
//==============================================================================
void Logger::outputDebugString (const String& text)
void Logger::outputDebugString (const String& text) throw()
{
fprintf (stdout, text.toUTF8());
fprintf (stdout, "\n");
}
void Logger::outputDebugPrintf (const tchar* format, ...)
void Logger::outputDebugPrintf (const tchar* format, ...) throw()
{
String text;
va_list args;
@@ -197,17 +197,17 @@ void Logger::outputDebugPrintf (const tchar* format, ...)
outputDebugString(text);
}
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw()
{
return Linux;
}
const String SystemStats::getOperatingSystemName()
const String SystemStats::getOperatingSystemName() throw()
{
return T("Linux");
}
static const String getCpuInfo (const char* key, bool lastOne = false)
static const String getCpuInfo (const char* key, bool lastOne = false) throw()
{
String info;
char buf [256];
@@ -243,44 +243,44 @@ static const String getCpuInfo (const char* key, bool lastOne = false)
return info;
}
bool SystemStats::hasMMX()
bool SystemStats::hasMMX() throw()
{
return getCpuInfo ("flags").contains (T("mmx"));
}
bool SystemStats::hasSSE()
bool SystemStats::hasSSE() throw()
{
return getCpuInfo ("flags").contains (T("sse"));
}
bool SystemStats::hasSSE2()
bool SystemStats::hasSSE2() throw()
{
return getCpuInfo ("flags").contains (T("sse2"));
}
bool SystemStats::has3DNow()
bool SystemStats::has3DNow() throw()
{
return getCpuInfo ("flags").contains (T("3dnow"));
}
const String SystemStats::getCpuVendor()
const String SystemStats::getCpuVendor() throw()
{
return getCpuInfo ("vendor_id");
}
int SystemStats::getCpuSpeedInMegaherz()
int SystemStats::getCpuSpeedInMegaherz() throw()
{
const String speed (getCpuInfo ("cpu MHz"));
return (int) (speed.getFloatValue() + 0.5f);
}
bool SystemStats::hasHyperThreading()
bool SystemStats::hasHyperThreading() throw()
{
return logicalCpuInfo.htAvailable;
}
int SystemStats::getMemorySizeInMegabytes()
int SystemStats::getMemorySizeInMegabytes() throw()
{
struct sysinfo sysi;
@@ -336,7 +336,7 @@ int64 Time::getHighResolutionTicksPerSecond() throw()
return 1000000;
}
bool Time::setSystemTimeToThisTime() const
bool Time::setSystemTimeToThisTime() const throw()
{
timeval t;
t.tv_sec = millisSinceEpoch % 1000000;
@@ -345,7 +345,7 @@ bool Time::setSystemTimeToThisTime() const
return settimeofday (&t, NULL) ? false : true;
}
int SystemStats::getPageSize()
int SystemStats::getPageSize() throw()
{
static int systemPageSize = 0;
@@ -355,7 +355,7 @@ int SystemStats::getPageSize()
return systemPageSize;
}
int SystemStats::getNumPhysicalCpus()
int SystemStats::getNumPhysicalCpus() throw()
{
if (logicalCpuInfo.numPackages)
return logicalCpuInfo.numPackages;
@@ -363,14 +363,14 @@ int SystemStats::getNumPhysicalCpus()
return getNumLogicalCpus();
}
int SystemStats::getNumLogicalCpus()
int SystemStats::getNumLogicalCpus() throw()
{
const int lastCpu = getCpuInfo ("processor", true).getIntValue();
return lastCpu + 1;
}
uint32 SystemStats::getPhysicalAffinityMask()
uint32 SystemStats::getPhysicalAffinityMask() throw()
{
#if SUPPORT_AFFINITIES
return logicalCpuInfo.physicalAffinityMask;
@@ -385,7 +385,7 @@ uint32 SystemStats::getPhysicalAffinityMask()
}
//==============================================================================
void SystemStats::initialiseStats()
void SystemStats::initialiseStats() throw()
{
// Process starts off as root when running suid
Process::lowerPrivilege();


+ 8
- 8
build/linux/platform_specific_code/juce_linux_Threads.cpp View File

@@ -51,7 +51,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
void JUCE_API juce_threadEntryPoint (void*);
void* threadEntryProc (void* value)
void* threadEntryProc (void* value) throw()
{
// New threads start off as root when running suid
Process::lowerPrivilege();
@@ -60,7 +60,7 @@ void* threadEntryProc (void* value)
return 0;
}
void* juce_createThread (void* userData)
void* juce_createThread (void* userData) throw()
{
pthread_t handle = 0;
@@ -73,17 +73,17 @@ void* juce_createThread (void* userData)
return 0;
}
void juce_killThread (void* handle)
void juce_killThread (void* handle) throw()
{
if (handle != 0)
pthread_cancel ((pthread_t)handle);
}
void juce_setCurrentThreadName (const String& /*name*/)
void juce_setCurrentThreadName (const String& /*name*/) throw()
{
}
int Thread::getCurrentThreadId()
int Thread::getCurrentThreadId() throw()
{
return (int) pthread_self();
}
@@ -104,7 +104,7 @@ int Thread::getCurrentThreadId()
// priority 1 to 10 where 5=normal, 1=low. If the handle is 0, sets the
// priority of the current thread
void juce_setThreadPriority (void* handle, int priority)
void juce_setThreadPriority (void* handle, int priority) throw()
{
struct sched_param param;
int policy, maxp, minp, pri;
@@ -162,12 +162,12 @@ void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask)
#endif
}
void Thread::yield()
void Thread::yield() throw()
{
sched_yield();
}
void Thread::sleep (int millisecs)
void Thread::sleep (int millisecs) throw()
{
struct timespec time;
time.tv_sec = millisecs / 1000;


+ 5
- 5
build/linux/platform_specific_code/juce_linux_Windowing.cpp View File

@@ -151,7 +151,7 @@ static bool untrapErrors()
//==============================================================================
static bool isActiveApplication = false;
bool Process::isForegroundProcess()
bool Process::isForegroundProcess() throw()
{
return isActiveApplication;
}
@@ -2541,7 +2541,7 @@ void Desktop::setMousePosition (int x, int y)
}
//==============================================================================
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY)
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw()
{
Window root = RootWindow (display, DefaultScreen (display));
const unsigned int imageW = image.getWidth();
@@ -2609,13 +2609,13 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot
return result;
}
void juce_deleteMouseCursor (void* cursorHandle, bool)
void juce_deleteMouseCursor (void* const cursorHandle, const bool) throw()
{
if (cursorHandle != None)
XFreeCursor (display, (Cursor)cursorHandle);
XFreeCursor (display, (Cursor) cursorHandle);
}
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type)
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw()
{
unsigned int shape;


+ 33
- 33
build/macosx/platform_specific_code/juce_mac_Files.cpp View File

@@ -193,14 +193,14 @@ const String PlatformUtilities::convertToPrecomposedUnicode (const String& s)
}
//==============================================================================
static bool juce_stat (const String& fileName, struct stat& info)
static bool juce_stat (const String& fileName, struct stat& info) throw()
{
return fileName.isNotEmpty()
&& (stat (fileName.toUTF8(), &info) == 0);
}
//==============================================================================
bool juce_isDirectory (const String& fileName)
bool juce_isDirectory (const String& fileName) throw()
{
if (fileName.isEmpty())
return true;
@@ -211,7 +211,7 @@ bool juce_isDirectory (const String& fileName)
&& ((info.st_mode & S_IFDIR) != 0);
}
bool juce_fileExists (const String& fileName, const bool dontCountDirectories)
bool juce_fileExists (const String& fileName, const bool dontCountDirectories) throw()
{
if (fileName.isEmpty())
return false;
@@ -231,7 +231,7 @@ bool juce_fileExists (const String& fileName, const bool dontCountDirectories)
return exists;
}
int64 juce_getFileSize (const String& fileName)
int64 juce_getFileSize (const String& fileName) throw()
{
struct stat info;
@@ -243,7 +243,7 @@ int64 juce_getFileSize (const String& fileName)
const unsigned int macTimeToUnixTimeDiff = 0x7c25be90;
static uint64 utcDateTimeToUnixTime (const UTCDateTime& d)
static uint64 utcDateTimeToUnixTime (const UTCDateTime& d) throw()
{
if (d.highSeconds == 0 && d.lowSeconds == 0 && d.fraction == 0)
return 0;
@@ -253,7 +253,7 @@ static uint64 utcDateTimeToUnixTime (const UTCDateTime& d)
- 2082844800000ll;
}
static void unixTimeToUtcDateTime (uint64 t, UTCDateTime& d)
static void unixTimeToUtcDateTime (uint64 t, UTCDateTime& d) throw()
{
if (t != 0)
t += 2082844800000ll;
@@ -266,7 +266,7 @@ static void unixTimeToUtcDateTime (uint64 t, UTCDateTime& d)
void juce_getFileTimes (const String& fileName,
int64& modificationTime,
int64& accessTime,
int64& creationTime)
int64& creationTime) throw()
{
modificationTime = 0;
accessTime = 0;
@@ -296,7 +296,7 @@ void juce_getFileTimes (const String& fileName,
bool juce_setFileTimes (const String& fileName,
int64 modificationTime,
int64 accessTime,
int64 creationTime)
int64 creationTime) throw()
{
FSRef fileRef;
if (PlatformUtilities::makeFSRefFromPath (&fileRef, fileName))
@@ -328,12 +328,12 @@ bool juce_setFileTimes (const String& fileName,
return false;
}
bool juce_canWriteToFile (const String& fileName)
bool juce_canWriteToFile (const String& fileName) throw()
{
return access (fileName.toUTF8(), W_OK) == 0;
}
bool juce_setFileReadOnly (const String& fileName, bool isReadOnly)
bool juce_setFileReadOnly (const String& fileName, bool isReadOnly) throw()
{
const char* const fileNameUTF8 = fileName.toUTF8();
@@ -358,7 +358,7 @@ bool juce_setFileReadOnly (const String& fileName, bool isReadOnly)
return ok;
}
bool juce_deleteFile (const String& fileName)
bool juce_deleteFile (const String& fileName) throw()
{
const char* const fileNameUTF8 = fileName.toUTF8();
@@ -368,7 +368,7 @@ bool juce_deleteFile (const String& fileName)
return remove (fileNameUTF8) == 0;
}
bool juce_copyFile (const String& src, const String& dst)
bool juce_copyFile (const String& src, const String& dst) throw()
{
const File destFile (dst);
@@ -446,7 +446,7 @@ bool juce_copyFile (const String& src, const String& dst)
return false;
}
bool juce_moveFile (const String& source, const String& dest)
bool juce_moveFile (const String& source, const String& dest) throw()
{
if (rename (source.toUTF8(), dest.toUTF8()) == 0)
return true;
@@ -463,12 +463,12 @@ bool juce_moveFile (const String& source, const String& dest)
return false;
}
void juce_createDirectory (const String& fileName)
void juce_createDirectory (const String& fileName) throw()
{
mkdir (fileName.toUTF8(), 0777);
}
void* juce_fileOpen (const String& fileName, bool forWriting)
void* juce_fileOpen (const String& fileName, bool forWriting) throw()
{
const char* const fileNameUTF8 = fileName.toUTF8();
const char* mode = "rb";
@@ -493,13 +493,13 @@ void* juce_fileOpen (const String& fileName, bool forWriting)
return (void*) fopen (fileNameUTF8, mode);
}
void juce_fileClose (void* handle)
void juce_fileClose (void* handle) throw()
{
if (handle != 0)
fclose ((FILE*) handle);
}
int juce_fileRead (void* handle, void* buffer, int size)
int juce_fileRead (void* handle, void* buffer, int size) throw()
{
if (handle != 0)
return fread (buffer, 1, size, (FILE*) handle);
@@ -507,7 +507,7 @@ int juce_fileRead (void* handle, void* buffer, int size)
return 0;
}
int juce_fileWrite (void* handle, const void* buffer, int size)
int juce_fileWrite (void* handle, const void* buffer, int size) throw()
{
if (handle != 0)
return fwrite (buffer, 1, size, (FILE*) handle);
@@ -515,7 +515,7 @@ int juce_fileWrite (void* handle, const void* buffer, int size)
return 0;
}
int64 juce_fileSetPosition (void* handle, int64 pos)
int64 juce_fileSetPosition (void* handle, int64 pos) throw()
{
if (handle != 0 && fseek ((FILE*) handle, pos, SEEK_SET) == 0)
return pos;
@@ -523,7 +523,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos)
return -1;
}
int64 juce_fileGetPosition (void* handle)
int64 juce_fileGetPosition (void* handle) throw()
{
if (handle != 0)
return ftell ((FILE*) handle);
@@ -531,27 +531,27 @@ int64 juce_fileGetPosition (void* handle)
return -1;
}
void juce_fileFlush (void* handle)
void juce_fileFlush (void* handle) throw()
{
if (handle != 0)
fflush ((FILE*) handle);
}
const StringArray juce_getFileSystemRoots()
const StringArray juce_getFileSystemRoots() throw()
{
StringArray s;
s.add (T("/"));
return s;
}
const String juce_getVolumeLabel (const String& filenameOnVolume, int& volumeSerialNumber)
const String juce_getVolumeLabel (const String& filenameOnVolume, int& volumeSerialNumber) throw()
{
volumeSerialNumber = 0;
return String::empty;
}
// if this file doesn't exist, find a parent of it that does..
static bool doStatFS (const File* file, struct statfs& result)
static bool doStatFS (const File* file, struct statfs& result) throw()
{
File f (*file);
@@ -579,7 +579,7 @@ int64 File::getBytesFreeOnVolume() const throw()
}
//==============================================================================
static bool isFileOnDriveType (const File* const f, const char** types)
static bool isFileOnDriveType (const File* const f, const char** types) throw()
{
struct statfs buf;
@@ -671,13 +671,13 @@ const File File::getSpecialLocation (const SpecialLocationType type)
return File::nonexistent;
}
void juce_setCurrentExecutableFileName (const String& filename)
void juce_setCurrentExecutableFileName (const String& filename) throw()
{
executableFile = File::getCurrentWorkingDirectory()
.getChildFile (PlatformUtilities::convertToPrecomposedUnicode (filename));
}
void juce_setCurrentExecutableFileNameFromBundleId (const String& bundleId)
void juce_setCurrentExecutableFileNameFromBundleId (const String& bundleId) throw()
{
CFStringRef bundleIdStringRef = PlatformUtilities::juceStringToCFString (bundleId);
CFBundleRef bundleRef = CFBundleGetBundleWithIdentifier (bundleIdStringRef);
@@ -722,7 +722,7 @@ struct FindFileStruct
DIR* dir;
bool getNextMatch (String& result, bool* const isDir, bool* const isHidden, int64* const fileSize,
Time* const modTime, Time* const creationTime, bool* const isReadOnly)
Time* const modTime, Time* const creationTime, bool* const isReadOnly) throw()
{
const char* const wildCardUTF8 = wildCard.toUTF8();
@@ -779,7 +779,7 @@ struct FindFileStruct
// returns 0 on failure
void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile,
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly)
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly) throw()
{
DIR* const d = opendir (directory.toUTF8());
@@ -811,7 +811,7 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin
}
bool juce_findFileNext (void* handle, String& resultFile,
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly)
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly) throw()
{
FindFileStruct* const ff = (FindFileStruct*) handle;
@@ -821,7 +821,7 @@ bool juce_findFileNext (void* handle, String& resultFile,
return false;
}
void juce_findFileClose (void* handle)
void juce_findFileClose (void* handle) throw()
{
FindFileStruct* const ff = (FindFileStruct*)handle;
@@ -833,7 +833,7 @@ void juce_findFileClose (void* handle)
}
//==============================================================================
bool juce_launchExecutable (const String& pathAndArguments)
bool juce_launchExecutable (const String& pathAndArguments) throw()
{
char* const argv[4] = { "/bin/sh", "-c", (char*) (const char*) pathAndArguments, 0 };
@@ -855,7 +855,7 @@ bool juce_launchExecutable (const String& pathAndArguments)
}
bool juce_launchFile (const String& fileName,
const String& parameters)
const String& parameters) throw()
{
bool ok = false;


+ 126
- 138
build/macosx/platform_specific_code/juce_mac_Network.cpp View File

@@ -1,138 +1,126 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#include "../../../src/juce_core/basics/juce_StandardHeader.h"
#include <IOKit/IOKitLib.h>
#include <IOKit/network/IOEthernetInterface.h>
#include <IOKit/network/IONetworkInterface.h>
#include <IOKit/network/IOEthernetController.h>
#include <Carbon/Carbon.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
BEGIN_JUCE_NAMESPACE
#include "../../../src/juce_core/text/juce_String.h"
#include "../../../src/juce_core/basics/juce_Time.h"
#include "../../../src/juce_core/basics/juce_SystemStats.h"
#include "../../../src/juce_core/containers/juce_MemoryBlock.h"
#include "../../../src/juce_core/text/juce_StringArray.h"
#include "juce_mac_HTTPStream.h"
//==============================================================================
static bool GetEthernetIterator (io_iterator_t* matchingServices)
{
mach_port_t masterPort;
if (IOMasterPort (MACH_PORT_NULL, &masterPort) == KERN_SUCCESS)
{
CFMutableDictionaryRef dict = IOServiceMatching (kIOEthernetInterfaceClass);
if (dict != 0)
{
CFMutableDictionaryRef propDict = CFDictionaryCreateMutable (kCFAllocatorDefault,
0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
if (propDict != 0)
{
CFDictionarySetValue (propDict, CFSTR (kIOPrimaryInterface), kCFBooleanTrue);
CFDictionarySetValue (dict, CFSTR (kIOPropertyMatchKey), propDict);
CFRelease (propDict);
}
}
return IOServiceGetMatchingServices (masterPort, dict, matchingServices) == KERN_SUCCESS;
}
return false;
}
int SystemStats::getMACAddresses (int64* addresses, int maxNum)
{
int numResults = 0;
io_iterator_t it;
if (GetEthernetIterator (&it))
{
io_object_t i;
while ((i = IOIteratorNext (it)) != 0)
{
io_object_t controller;
if (IORegistryEntryGetParentEntry (i, kIOServicePlane, &controller) == KERN_SUCCESS)
{
CFTypeRef data = IORegistryEntryCreateCFProperty (controller,
CFSTR (kIOMACAddress),
kCFAllocatorDefault,
0);
if (data != 0)
{
UInt8 addr [kIOEthernetAddressSize];
zeromem (addr, sizeof (addr));
CFDataGetBytes ((CFDataRef)data, CFRangeMake (0, sizeof (addr)), addr);
CFRelease (data);
int64 a = 0;
for (int i = 6; --i >= 0;)
a = (a << 8) | addr[i];
if (numResults < maxNum)
{
*addresses++ = a;
++numResults;
}
}
IOObjectRelease (controller);
}
IOObjectRelease (i);
}
IOObjectRelease (it);
}
return numResults;
}
END_JUCE_NAMESPACE
/*
==============================================================================

This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.

------------------------------------------------------------------------------

JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.

JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA

------------------------------------------------------------------------------

If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.

==============================================================================
*/

#include "../../../src/juce_core/basics/juce_StandardHeader.h"
#include <IOKit/IOKitLib.h>
#include <IOKit/network/IOEthernetInterface.h>
#include <IOKit/network/IONetworkInterface.h>
#include <IOKit/network/IOEthernetController.h>
#include <Carbon/Carbon.h>


BEGIN_JUCE_NAMESPACE

#include "../../../src/juce_core/basics/juce_SystemStats.h"


//==============================================================================
static bool GetEthernetIterator (io_iterator_t* matchingServices) throw()
{
mach_port_t masterPort;

if (IOMasterPort (MACH_PORT_NULL, &masterPort) == KERN_SUCCESS)
{
CFMutableDictionaryRef dict = IOServiceMatching (kIOEthernetInterfaceClass);

if (dict != 0)
{
CFMutableDictionaryRef propDict = CFDictionaryCreateMutable (kCFAllocatorDefault,
0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);

if (propDict != 0)
{
CFDictionarySetValue (propDict, CFSTR (kIOPrimaryInterface), kCFBooleanTrue);

CFDictionarySetValue (dict, CFSTR (kIOPropertyMatchKey), propDict);
CFRelease (propDict);
}
}

return IOServiceGetMatchingServices (masterPort, dict, matchingServices) == KERN_SUCCESS;
}

return false;
}

int SystemStats::getMACAddresses (int64* addresses, int maxNum) throw()
{
int numResults = 0;
io_iterator_t it;

if (GetEthernetIterator (&it))
{
io_object_t i;

while ((i = IOIteratorNext (it)) != 0)
{
io_object_t controller;

if (IORegistryEntryGetParentEntry (i, kIOServicePlane, &controller) == KERN_SUCCESS)
{
CFTypeRef data = IORegistryEntryCreateCFProperty (controller,
CFSTR (kIOMACAddress),
kCFAllocatorDefault,
0);
if (data != 0)
{
UInt8 addr [kIOEthernetAddressSize];
zeromem (addr, sizeof (addr));

CFDataGetBytes ((CFDataRef) data, CFRangeMake (0, sizeof (addr)), addr);
CFRelease (data);

int64 a = 0;
for (int i = 6; --i >= 0;)
a = (a << 8) | addr[i];

if (numResults < maxNum)
{
*addresses++ = a;
++numResults;
}
}

IOObjectRelease (controller);
}

IOObjectRelease (i);
}

IOObjectRelease (it);
}

return numResults;
}

END_JUCE_NAMESPACE

+ 21
- 21
build/macosx/platform_specific_code/juce_mac_SystemStats.cpp View File

@@ -46,7 +46,7 @@ static int64 highResTimerFrequency;
#if JUCE_INTEL
static void juce_getCpuVendor (char* const v)
static void juce_getCpuVendor (char* const v) throw()
{
int vendor[4];
zerostruct (vendor);
@@ -60,7 +60,7 @@ static void juce_getCpuVendor (char* const v)
memcpy (v, vendor, 16);
}
static unsigned int getCPUIDWord (unsigned int& familyModel, unsigned int& extFeatures)
static unsigned int getCPUIDWord (unsigned int& familyModel, unsigned int& extFeatures) throw()
{
unsigned int cpu = 0;
unsigned int ext = 0;
@@ -91,14 +91,14 @@ static CPUFlags cpuFlags;
#endif
//==============================================================================
void Logger::outputDebugString (const String& text)
void Logger::outputDebugString (const String& text) throw()
{
String withLineFeed (text + T("\n"));
const char* const utf8 = withLineFeed.toUTF8();
fwrite (utf8, strlen (utf8), 1, stdout);
}
void Logger::outputDebugPrintf (const tchar* format, ...)
void Logger::outputDebugPrintf (const tchar* format, ...) throw()
{
String text;
va_list args;
@@ -107,7 +107,7 @@ void Logger::outputDebugPrintf (const tchar* format, ...)
outputDebugString (text);
}
int SystemStats::getMemorySizeInMegabytes()
int SystemStats::getMemorySizeInMegabytes() throw()
{
long bytes;
if (Gestalt (gestaltPhysicalRAMSize, &bytes) == noErr)
@@ -117,18 +117,18 @@ int SystemStats::getMemorySizeInMegabytes()
}
//==============================================================================
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw()
{
return MacOSX;
}
const String SystemStats::getOperatingSystemName()
const String SystemStats::getOperatingSystemName() throw()
{
return T("Mac OS X");
}
//==============================================================================
void SystemStats::initialiseStats()
void SystemStats::initialiseStats() throw()
{
static bool initialised = false;
@@ -165,7 +165,7 @@ void SystemStats::initialiseStats()
}
}
bool SystemStats::hasMMX()
bool SystemStats::hasMMX() throw()
{
#if JUCE_INTEL
return cpuFlags.hasMMX;
@@ -174,7 +174,7 @@ bool SystemStats::hasMMX()
#endif
}
bool SystemStats::hasSSE()
bool SystemStats::hasSSE() throw()
{
#if JUCE_INTEL
return cpuFlags.hasSSE;
@@ -183,7 +183,7 @@ bool SystemStats::hasSSE()
#endif
}
bool SystemStats::hasSSE2()
bool SystemStats::hasSSE2() throw()
{
#if JUCE_INTEL
return cpuFlags.hasSSE2;
@@ -192,7 +192,7 @@ bool SystemStats::hasSSE2()
#endif
}
bool SystemStats::has3DNow()
bool SystemStats::has3DNow() throw()
{
#if JUCE_INTEL
return cpuFlags.has3DNow;
@@ -201,7 +201,7 @@ bool SystemStats::has3DNow()
#endif
}
bool SystemStats::hasHyperThreading()
bool SystemStats::hasHyperThreading() throw()
{
#if JUCE_INTEL
return cpuFlags.hasHT;
@@ -210,7 +210,7 @@ bool SystemStats::hasHyperThreading()
#endif
}
const String SystemStats::getCpuVendor()
const String SystemStats::getCpuVendor() throw()
{
#if JUCE_INTEL
char v [16];
@@ -221,22 +221,22 @@ const String SystemStats::getCpuVendor()
#endif
}
int SystemStats::getCpuSpeedInMegaherz()
int SystemStats::getCpuSpeedInMegaherz() throw()
{
return GetCPUSpeed();
}
int SystemStats::getNumPhysicalCpus()
int SystemStats::getNumPhysicalCpus() throw()
{
return MPProcessors();
}
int SystemStats::getNumLogicalCpus()
int SystemStats::getNumLogicalCpus() throw()
{
return getNumPhysicalCpus();
}
uint32 SystemStats::getPhysicalAffinityMask()
uint32 SystemStats::getPhysicalAffinityMask() throw()
{
jassertfalse
return 0;
@@ -271,20 +271,20 @@ int64 Time::getHighResolutionTicksPerSecond() throw()
return highResTimerFrequency;
}
int64 SystemStats::getClockCycleCounter()
int64 SystemStats::getClockCycleCounter() throw()
{
jassertfalse
return 0;
}
bool Time::setSystemTimeToThisTime() const
bool Time::setSystemTimeToThisTime() const throw()
{
jassertfalse
return false;
}
//==============================================================================
int SystemStats::getPageSize()
int SystemStats::getPageSize() throw()
{
jassertfalse
return 512; //xxx


+ 8
- 8
build/macosx/platform_specific_code/juce_mac_Threads.cpp View File

@@ -156,13 +156,13 @@ void WaitableEvent::reset() const throw()
//==============================================================================
void JUCE_API juce_threadEntryPoint (void*);
void* threadEntryProc (void* userData)
void* threadEntryProc (void* userData) throw()
{
juce_threadEntryPoint (userData);
return 0;
}
void* juce_createThread (void* userData)
void* juce_createThread (void* userData) throw()
{
pthread_t handle = 0;
@@ -175,22 +175,22 @@ void* juce_createThread (void* userData)
return 0;
}
void juce_killThread (void* handle)
void juce_killThread (void* handle) throw()
{
if (handle != 0)
pthread_cancel ((pthread_t) handle);
}
void juce_setCurrentThreadName (const String& /*name*/)
void juce_setCurrentThreadName (const String& /*name*/) throw()
{
}
int Thread::getCurrentThreadId()
int Thread::getCurrentThreadId() throw()
{
return (int) pthread_self();
}
void juce_setThreadPriority (void* handle, int priority)
void juce_setThreadPriority (void* handle, int priority) throw()
{
if (handle == 0)
handle = (void*) pthread_self();
@@ -202,7 +202,7 @@ void juce_setThreadPriority (void* handle, int priority)
pthread_setschedparam ((pthread_t) handle, policy, &param);
}
void Thread::yield()
void Thread::yield() throw()
{
sched_yield();
}
@@ -213,7 +213,7 @@ void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask)
jassertfalse
}
void Thread::sleep (int millisecs)
void Thread::sleep (int millisecs) throw()
{
struct timespec time;
time.tv_sec = millisecs / 1000;


+ 6
- 8
build/macosx/platform_specific_code/juce_mac_Windowing.cpp View File

@@ -2185,7 +2185,7 @@ bool DragAndDropContainer::performExternalDragDropOfText (const String& text)
//==============================================================================
bool Process::isForegroundProcess()
bool Process::isForegroundProcess() throw()
{
ProcessSerialNumber psn, front;
GetCurrentProcess (&psn);
@@ -2298,7 +2298,7 @@ struct CursorWrapper
ThemeCursor themeCursor;
};
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY)
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw()
{
const int maxW = 16;
const int maxH = 16;
@@ -2360,7 +2360,7 @@ static void* cursorFromData (const unsigned char* data, const int size, int hx,
const unsigned int kSpecialNoCursor = 'nocr';
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type)
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw()
{
ThemeCursor id = kThemeArrowCursor;
@@ -2481,15 +2481,13 @@ void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type)
return (void*) cw;
}
void juce_deleteMouseCursor (void* cursorHandle, bool isStandard)
void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw()
{
CursorWrapper* cw = (CursorWrapper*)cursorHandle;
CursorWrapper* const cw = (CursorWrapper*) cursorHandle;
if (cw != 0)
{
if (cw->cursor != 0)
delete cw->cursor;
delete cw->cursor;
delete cw;
}
}


+ 28
- 28
build/win32/platform_specific_code/juce_win32_Files.cpp View File

@@ -78,7 +78,7 @@ UNICODE_FUNCTION (SetCurrentDirectoryW, BOOL, (LPCWSTR))
UNICODE_FUNCTION (FindFirstFileW, HANDLE, (LPCWSTR, LPWIN32_FIND_DATAW))
UNICODE_FUNCTION (FindNextFileW, BOOL, (HANDLE, LPWIN32_FIND_DATAW))
void juce_initialiseUnicodeFileFunctions()
void juce_initialiseUnicodeFileFunctions() throw()
{
if ((SystemStats::getOperatingSystemType() & SystemStats::WindowsNT) != 0)
{
@@ -108,7 +108,7 @@ void juce_initialiseUnicodeFileFunctions()
//==============================================================================
bool juce_fileExists (const String& fileName,
const bool dontCountDirectories)
const bool dontCountDirectories) throw()
{
if (fileName.isEmpty())
return false;
@@ -120,7 +120,7 @@ bool juce_fileExists (const String& fileName,
: (attr != 0xffffffff);
}
bool juce_isDirectory (const String& fileName)
bool juce_isDirectory (const String& fileName) throw()
{
const DWORD attr = (wGetFileAttributesW != 0) ? wGetFileAttributesW (fileName)
: GetFileAttributes (fileName);
@@ -129,7 +129,7 @@ bool juce_isDirectory (const String& fileName)
&& ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0);
}
bool juce_canWriteToFile (const String& fileName)
bool juce_canWriteToFile (const String& fileName) throw()
{
const DWORD attr = (wGetFileAttributesW != 0) ? wGetFileAttributesW (fileName)
: GetFileAttributes (fileName);
@@ -161,7 +161,7 @@ bool juce_setFileReadOnly (const String& fileName,
}
//==============================================================================
bool juce_deleteFile (const String& fileName)
bool juce_deleteFile (const String& fileName) throw()
{
if (juce_isDirectory (fileName))
return (wRemoveDirectoryW != 0) ? wRemoveDirectoryW (fileName) != 0
@@ -171,19 +171,19 @@ bool juce_deleteFile (const String& fileName)
: DeleteFile (fileName) != 0;
}
bool juce_moveFile (const String& source, const String& dest)
bool juce_moveFile (const String& source, const String& dest) throw()
{
return (wMoveFileW != 0) ? wMoveFileW (source, dest) != 0
: MoveFile (source, dest) != 0;
}
bool juce_copyFile (const String& source, const String& dest)
bool juce_copyFile (const String& source, const String& dest) throw()
{
return (wCopyFileW != 0) ? wCopyFileW (source, dest, false) != 0
: CopyFile (source, dest, false) != 0;
}
void juce_createDirectory (const String& fileName)
void juce_createDirectory (const String& fileName) throw()
{
if (! juce_fileExists (fileName, true))
{
@@ -196,7 +196,7 @@ void juce_createDirectory (const String& fileName)
//==============================================================================
// return 0 if not possible
void* juce_fileOpen (const String& fileName, bool forWriting)
void* juce_fileOpen (const String& fileName, bool forWriting) throw()
{
HANDLE h;
@@ -230,20 +230,20 @@ void* juce_fileOpen (const String& fileName, bool forWriting)
return (void*) h;
}
void juce_fileClose (void* handle)
void juce_fileClose (void* handle) throw()
{
CloseHandle (handle);
}
//==============================================================================
int juce_fileRead (void* handle, void* buffer, int size)
int juce_fileRead (void* handle, void* buffer, int size) throw()
{
DWORD num = 0;
ReadFile ((HANDLE) handle, buffer, size, &num, 0);
return num;
}
int juce_fileWrite (void* handle, const void* buffer, int size)
int juce_fileWrite (void* handle, const void* buffer, int size) throw()
{
DWORD num;
@@ -254,7 +254,7 @@ int juce_fileWrite (void* handle, const void* buffer, int size)
return num;
}
int64 juce_fileSetPosition (void* handle, int64 pos)
int64 juce_fileSetPosition (void* handle, int64 pos) throw()
{
LARGE_INTEGER li;
li.QuadPart = pos;
@@ -266,7 +266,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos)
return li.QuadPart;
}
int64 juce_fileGetPosition (void* handle)
int64 juce_fileGetPosition (void* handle) throw()
{
LARGE_INTEGER li;
li.QuadPart = 0;
@@ -277,12 +277,12 @@ int64 juce_fileGetPosition (void* handle)
return jmax ((int64) 0, li.QuadPart);
}
void juce_fileFlush (void* handle)
void juce_fileFlush (void* handle) throw()
{
FlushFileBuffers ((HANDLE) handle);
}
int64 juce_getFileSize (const String& fileName)
int64 juce_getFileSize (const String& fileName) throw()
{
void* const handle = juce_fileOpen (fileName, false);
@@ -324,7 +324,7 @@ static void timeToFileTime (const int64 time, FILETIME* const ft) throw()
void juce_getFileTimes (const String& fileName,
int64& modificationTime,
int64& accessTime,
int64& creationTime)
int64& creationTime) throw()
{
creationTime = accessTime = modificationTime = 0;
void* const h = juce_fileOpen (fileName, false);
@@ -347,7 +347,7 @@ void juce_getFileTimes (const String& fileName,
bool juce_setFileTimes (const String& fileName,
int64 modificationTime,
int64 accessTime,
int64 creationTime)
int64 creationTime) throw()
{
FILETIME m, a, c;
@@ -377,7 +377,7 @@ bool juce_setFileTimes (const String& fileName,
//==============================================================================
// return '\0' separated list of strings
const StringArray juce_getFileSystemRoots()
const StringArray juce_getFileSystemRoots() throw()
{
TCHAR buffer [2048];
buffer[0] = 0;
@@ -402,7 +402,7 @@ const StringArray juce_getFileSystemRoots()
//==============================================================================
const String juce_getVolumeLabel (const String& filenameOnVolume,
int& volumeSerialNumber)
int& volumeSerialNumber) throw()
{
TCHAR n [4];
n[0] = *(const TCHAR*) filenameOnVolume;
@@ -440,7 +440,7 @@ int64 File::getBytesFreeOnVolume() const throw()
}
//==============================================================================
static unsigned int getWindowsDriveType (const String& fileName)
static unsigned int getWindowsDriveType (const String& fileName) throw()
{
TCHAR n[4];
n[0] = *(const TCHAR*) fileName;
@@ -490,7 +490,7 @@ bool File::isOnRemovableDrive() const throw()
//==============================================================================
#define MAX_PATH_CHARS (MAX_PATH + 256)
static const File juce_getSpecialFolderPath (int type)
static const File juce_getSpecialFolderPath (int type) throw()
{
if (wSHGetSpecialFolderPathW != 0)
{
@@ -577,7 +577,7 @@ const File File::getSpecialLocation (const SpecialLocationType type)
}
void juce_setCurrentExecutableFileName (const String&)
void juce_setCurrentExecutableFileName (const String&) throw()
{
// n/a on windows
}
@@ -612,7 +612,7 @@ template <class FindDataType>
static void getFindFileInfo (FindDataType& findData,
String& filename, bool* const isDir, bool* const isHidden,
int64* const fileSize, Time* const modTime, Time* const creationTime,
bool* const isReadOnly)
bool* const isReadOnly) throw()
{
filename = findData.cFileName;
@@ -638,7 +638,7 @@ static void getFindFileInfo (FindDataType& findData,
void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResult,
bool* isDir, bool* isHidden, int64* fileSize,
Time* modTime, Time* creationTime, bool* isReadOnly)
Time* modTime, Time* creationTime, bool* isReadOnly) throw()
{
String wc (directory);
@@ -676,7 +676,7 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin
bool juce_findFileNext (void* handle, String& resultFile,
bool* isDir, bool* isHidden, int64* fileSize,
Time* modTime, Time* creationTime, bool* isReadOnly)
Time* modTime, Time* creationTime, bool* isReadOnly) throw()
{
if (wFindNextFileW != 0)
{
@@ -703,14 +703,14 @@ bool juce_findFileNext (void* handle, String& resultFile,
return false;
}
void juce_findFileClose (void* handle)
void juce_findFileClose (void* handle) throw()
{
FindClose (handle);
}
//==============================================================================
bool juce_launchFile (const String& fileName,
const String& parameters)
const String& parameters) throw()
{
HINSTANCE hInstance = 0;


+ 36
- 50
build/win32/platform_specific_code/juce_win32_SystemStats.cpp View File

@@ -66,12 +66,12 @@ BEGIN_JUCE_NAMESPACE
extern void juce_updateMultiMonitorInfo(); // from WindowDriver
//==============================================================================
void Logger::outputDebugString (const String& text)
void Logger::outputDebugString (const String& text) throw()
{
OutputDebugString (text + T("\n"));
}
void Logger::outputDebugPrintf (const tchar* format, ...)
void Logger::outputDebugPrintf (const tchar* format, ...) throw()
{
String text;
va_list args;
@@ -103,7 +103,7 @@ static struct _LogicalCpuInfo
#pragma intrinsic (__cpuid)
#pragma intrinsic (__rdtsc)
static unsigned int getCPUIDWord (int* familyModel = 0, int* extFeatures = 0)
static unsigned int getCPUIDWord (int* familyModel = 0, int* extFeatures = 0) throw()
{
int info [4];
__cpuid (info, 1);
@@ -117,7 +117,7 @@ static unsigned int getCPUIDWord (int* familyModel = 0, int* extFeatures = 0)
return info[3];
}
const String SystemStats::getCpuVendor()
const String SystemStats::getCpuVendor() throw()
{
int info [4];
__cpuid (info, 0);
@@ -223,7 +223,7 @@ const String SystemStats::getCpuVendor()
}
#endif
static void initLogicalCpuInfo()
static void initLogicalCpuInfo() throw()
{
int familyModelWord, extFeaturesWord;
int featuresWord = getCPUIDWord (&familyModelWord, &extFeaturesWord);
@@ -305,35 +305,35 @@ static void initLogicalCpuInfo()
}
//==============================================================================
void juce_initialiseThreadEvents();
void juce_initialiseUnicodeFileFunctions();
void juce_initialiseThreadEvents() throw();
void juce_initialiseUnicodeFileFunctions() throw();
static struct JuceCpuProps
{
bool hasMMX : 1, hasSSE : 1, hasSSE2 : 1, has3DNow : 1;
} juce_CpuProps;
bool SystemStats::hasMMX()
bool SystemStats::hasMMX() throw()
{
return juce_CpuProps.hasMMX;
}
bool SystemStats::hasSSE()
bool SystemStats::hasSSE() throw()
{
return juce_CpuProps.hasSSE;
}
bool SystemStats::hasSSE2()
bool SystemStats::hasSSE2() throw()
{
return juce_CpuProps.hasSSE2;
}
bool SystemStats::has3DNow()
bool SystemStats::has3DNow() throw()
{
return juce_CpuProps.has3DNow;
}
void SystemStats::initialiseStats()
void SystemStats::initialiseStats() throw()
{
juce_initialiseUnicodeFileFunctions();
juce_initialiseThreadEvents();
@@ -370,7 +370,7 @@ void SystemStats::initialiseStats()
}
//==============================================================================
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw()
{
OSVERSIONINFO info;
info.dwOSVersionInfoSize = sizeof (info);
@@ -380,12 +380,6 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
{
switch (info.dwMajorVersion)
{
case 3:
return WinNT351;
case 4:
return WinNT40;
case 5:
return (info.dwMinorVersion == 0) ? Win2000 : WinXP;
@@ -393,52 +387,44 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
return WinVista;
default:
jassertfalse // !! not a supported OS!
break;
}
}
else if (info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
return (info.dwMinorVersion == 0) ? Win95 : Win98;
jassert (info.dwMinorVersion != 0); // !! still running on Windows 95??
return Win98;
}
return UnknownOS;
}
const String SystemStats::getOperatingSystemName()
const String SystemStats::getOperatingSystemName() throw()
{
const tchar* name = T("Unknown OS");
const char* name = "Unknown OS";
switch (getOperatingSystemType())
{
case WinVista:
name = "Windows Vista";
break;
case WinXP:
name = T("Windows XP");
name = "Windows XP";
break;
case Win2000:
name = T("Windows 2000");
name = "Windows 2000";
break;
case Win98:
name = T("Windows 98");
break;
case Win95:
name = T("Windows 95");
break;
case WinNT351:
name = T("Windows NT 3.51");
break;
case WinNT40:
name = T("Windows NT4");
break;
case WinVista:
name = T("Windows Vista");
name = "Windows 98";
break;
default:
jassertfalse // !! new type of OS?
break;
}
@@ -446,19 +432,19 @@ const String SystemStats::getOperatingSystemName()
}
//==============================================================================
int SystemStats::getMemorySizeInMegabytes()
int SystemStats::getMemorySizeInMegabytes() throw()
{
MEMORYSTATUS mem;
GlobalMemoryStatus (&mem);
return (int) (mem.dwTotalPhys / (1024 * 1024)) + 1;
}
bool SystemStats::hasHyperThreading()
bool SystemStats::hasHyperThreading() throw()
{
return logicalCpuInfo.htAvailable;
}
int SystemStats::getNumPhysicalCpus()
int SystemStats::getNumPhysicalCpus() throw()
{
if (logicalCpuInfo.numPackages)
return logicalCpuInfo.numPackages;
@@ -466,12 +452,12 @@ int SystemStats::getNumPhysicalCpus()
return getNumLogicalCpus();
}
int SystemStats::getNumLogicalCpus()
int SystemStats::getNumLogicalCpus() throw()
{
return systemInfo.dwNumberOfProcessors;
}
uint32 SystemStats::getPhysicalAffinityMask()
uint32 SystemStats::getPhysicalAffinityMask() throw()
{
return logicalCpuInfo.physicalAffinityMask;
}
@@ -511,7 +497,7 @@ int64 Time::getHighResolutionTicksPerSecond() throw()
return hiResTicksPerSecond;
}
int64 SystemStats::getClockCycleCounter()
int64 SystemStats::getClockCycleCounter() throw()
{
#if JUCE_USE_INTRINSICS
// MS intrinsics version...
@@ -550,7 +536,7 @@ int64 SystemStats::getClockCycleCounter()
#endif
}
int SystemStats::getCpuSpeedInMegaherz()
int SystemStats::getCpuSpeedInMegaherz() throw()
{
const int64 cycles = SystemStats::getClockCycleCounter();
const uint32 millis = Time::getMillisecondCounter();
@@ -578,7 +564,7 @@ int SystemStats::getCpuSpeedInMegaherz()
//==============================================================================
bool Time::setSystemTimeToThisTime() const
bool Time::setSystemTimeToThisTime() const throw()
{
SYSTEMTIME st;
@@ -597,7 +583,7 @@ bool Time::setSystemTimeToThisTime() const
&& SetLocalTime (&st) != 0;
}
int SystemStats::getPageSize()
int SystemStats::getPageSize() throw()
{
return systemInfo.dwPageSize;
}


+ 9
- 9
build/win32/platform_specific_code/juce_win32_Threads.cpp View File

@@ -118,7 +118,7 @@ void WaitableEvent::reset() const throw()
//==============================================================================
void JUCE_API juce_threadEntryPoint (void*);
static unsigned int __stdcall threadEntryProc (void* userData)
static unsigned int __stdcall threadEntryProc (void* userData) throw()
{
AttachThreadInput (GetWindowThreadProcessId (juce_messageWindowHandle, 0),
GetCurrentThreadId(), TRUE);
@@ -129,7 +129,7 @@ static unsigned int __stdcall threadEntryProc (void* userData)
return 0;
}
void* juce_createThread (void* userData)
void* juce_createThread (void* userData) throw()
{
unsigned int threadId;
@@ -139,7 +139,7 @@ void* juce_createThread (void* userData)
0, &threadId);
}
void juce_killThread (void* handle)
void juce_killThread (void* handle) throw()
{
if (handle != 0)
{
@@ -150,7 +150,7 @@ void juce_killThread (void* handle)
}
}
void juce_setCurrentThreadName (const String& name)
void juce_setCurrentThreadName (const String& name) throw()
{
#if JUCE_DEBUG && JUCE_MSVC
struct
@@ -179,13 +179,13 @@ void juce_setCurrentThreadName (const String& name)
#endif
}
int Thread::getCurrentThreadId()
int Thread::getCurrentThreadId() throw()
{
return (int) GetCurrentThreadId();
}
// priority 1 to 10 where 5=normal, 1=low
void juce_setThreadPriority (void* threadHandle, int priority)
void juce_setThreadPriority (void* threadHandle, int priority) throw()
{
int pri = THREAD_PRIORITY_TIME_CRITICAL;
@@ -215,17 +215,17 @@ void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask)
static HANDLE sleepEvent = 0;
void juce_initialiseThreadEvents()
void juce_initialiseThreadEvents() throw()
{
sleepEvent = CreateEvent (0, 0, 0, 0);
}
void Thread::yield()
void Thread::yield() throw()
{
Sleep (0);
}
void Thread::sleep (int millisecs)
void Thread::sleep (const int millisecs) throw()
{
if (millisecs >= 10)
{


+ 40
- 40
build/win32/platform_specific_code/juce_win32_Windowing.cpp View File

@@ -110,7 +110,7 @@ static HPALETTE palette = 0;
static bool createPaletteIfNeeded = true;
static bool shouldDeactivateTitleBar = true;
static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY);
static HICON JUCE_CALLTYPE createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY);
#define WM_TRAYNOTIFY WM_USER + 100
//==============================================================================
@@ -232,8 +232,8 @@ public:
unsigned char* bitmapData;
//==============================================================================
WindowsBitmapImage (const PixelFormat format_,
const int w, const int h, const bool clearImage)
JUCE_CALLTYPE WindowsBitmapImage (const PixelFormat format_,
const int w, const int h, const bool clearImage)
: Image (format_, w, h)
{
jassert (format_ == RGB || format_ == ARGB);
@@ -292,7 +292,7 @@ public:
imageData = bitmapData - (lineStride * (h - 1));
}
~WindowsBitmapImage()
JUCE_CALLTYPE ~WindowsBitmapImage()
{
DeleteDC (hdc);
DeleteObject (hBitmap);
@@ -300,8 +300,8 @@ public:
}
void blitToWindow (HWND hwnd, HDC dc, const bool transparent,
int x, int y, const RectangleList& maskedRegion)
void JUCE_CALLTYPE blitToWindow (HWND hwnd, HDC dc, const bool transparent,
int x, int y, const RectangleList& maskedRegion) throw()
{
static HDRAWDIB hdd = 0;
static bool needToCreateDrawDib = true;
@@ -424,7 +424,7 @@ long improbableWindowNumber = 0xf965aa01; // also referenced by messaging.cpp
//==============================================================================
static int currentModifiers = 0;
static void updateKeyModifiers()
static void JUCE_CALLTYPE updateKeyModifiers()
{
currentModifiers &= ~(ModifierKeys::shiftModifier
| ModifierKeys::ctrlModifier
@@ -489,7 +489,7 @@ const ModifierKeys ModifierKeys::getCurrentModifiersRealtime()
return ModifierKeys (currentModifiers);
}
static int64 getMouseEventTime()
static int64 JUCE_CALLTYPE getMouseEventTime()
{
static int64 eventTimeOffset = 0;
static DWORD lastMessageTime = 0;
@@ -510,8 +510,8 @@ class Win32ComponentPeer : public ComponentPeer
{
public:
//==============================================================================
Win32ComponentPeer (Component* const component,
const int windowStyleFlags)
JUCE_CALLTYPE Win32ComponentPeer (Component* const component,
const int windowStyleFlags)
: ComponentPeer (component, windowStyleFlags),
dontRepaint (false),
fullScreen (false),
@@ -862,7 +862,7 @@ public:
}
//==============================================================================
static Win32ComponentPeer* getOwnerOfWindow (HWND h)
static Win32ComponentPeer* JUCE_CALLTYPE getOwnerOfWindow (HWND h)
{
if (h != 0 && GetWindowLongPtr (h, GWLP_USERDATA) == improbableWindowNumber)
return (Win32ComponentPeer*) GetWindowLongPtr (h, 8);
@@ -941,18 +941,18 @@ private:
{
public:
//==============================================================================
TemporaryImage()
JUCE_CALLTYPE TemporaryImage()
: image (0)
{
}
~TemporaryImage()
JUCE_CALLTYPE ~TemporaryImage()
{
delete image;
}
//==============================================================================
WindowsBitmapImage* getImage (const bool transparent, const int w, const int h)
WindowsBitmapImage* JUCE_CALLTYPE getImage (const bool transparent, const int w, const int h)
{
const Image::PixelFormat format = transparent ? Image::ARGB : Image::RGB;
@@ -992,7 +992,7 @@ private:
class WindowClassHolder : public DeletedAtShutdown
{
public:
WindowClassHolder()
JUCE_CALLTYPE WindowClassHolder()
: windowClassName (T("JUCE_"))
{
// this name has to be different for each app/dll instance because otherwise
@@ -1047,7 +1047,7 @@ private:
}
}
~WindowClassHolder()
JUCE_CALLTYPE ~WindowClassHolder()
{
if (ComponentPeer::getNumPeers() == 0)
UnregisterClass (windowClassName, (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle());
@@ -1056,7 +1056,7 @@ private:
String windowClassName;
};
void createWindow()
void JUCE_CALLTYPE createWindow()
{
DWORD exstyle = WS_EX_ACCEPTFILES;
DWORD type = WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
@@ -1202,7 +1202,7 @@ private:
}
//==============================================================================
void handlePaintMessage()
void JUCE_CALLTYPE handlePaintMessage()
{
#if DEBUG_REPAINT_TIMES
const double paintStart = Time::getMillisecondCounterHiRes();
@@ -1352,7 +1352,7 @@ private:
}
//==============================================================================
void doMouseMove (const int x, const int y)
void JUCE_CALLTYPE doMouseMove (const int x, const int y)
{
static uint32 lastMouseTime = 0;
// this can be set to throttle the mouse-messages to less than a
@@ -1417,7 +1417,7 @@ private:
}
}
void doMouseDown (const int x, const int y, const WPARAM wParam)
void JUCE_CALLTYPE doMouseDown (const int x, const int y, const WPARAM wParam)
{
if (GetCapture() != hwnd)
SetCapture (hwnd);
@@ -1441,7 +1441,7 @@ private:
handleMouseDown (x, y, getMouseEventTime());
}
void doMouseUp (const int x, const int y, const WPARAM wParam)
void JUCE_CALLTYPE doMouseUp (const int x, const int y, const WPARAM wParam)
{
int numButtons = 0;
@@ -1479,7 +1479,7 @@ private:
handleMouseUp (oldModifiers, x, y, getMouseEventTime());
}
void doCaptureChanged()
void JUCE_CALLTYPE doCaptureChanged()
{
if (isDragging)
{
@@ -1494,7 +1494,7 @@ private:
}
}
void doMouseExit()
void JUCE_CALLTYPE doMouseExit()
{
if (isMouseOver)
{
@@ -1510,7 +1510,7 @@ private:
}
}
void doMouseWheel (const WPARAM wParam, const bool isVertical)
void JUCE_CALLTYPE doMouseWheel (const WPARAM wParam, const bool isVertical)
{
updateKeyModifiers();
@@ -1522,7 +1522,7 @@ private:
}
//==============================================================================
void doKeyUp (const WPARAM key)
void JUCE_CALLTYPE doKeyUp (const WPARAM key)
{
updateKeyModifiers();
@@ -1549,7 +1549,7 @@ private:
handleKeyUpOrDown();
}
void doKeyDown (const WPARAM key)
void JUCE_CALLTYPE doKeyDown (const WPARAM key)
{
updateKeyModifiers();
@@ -1637,7 +1637,7 @@ private:
}
}
void doKeyChar (int key, const LPARAM flags)
void JUCE_CALLTYPE doKeyChar (int key, const LPARAM flags)
{
updateKeyModifiers();
@@ -1685,7 +1685,7 @@ private:
handleKeyPress (key, textChar);
}
bool doAppCommand (const LPARAM lParam)
bool JUCE_CALLTYPE doAppCommand (const LPARAM lParam)
{
int key = 0;
@@ -1723,7 +1723,7 @@ private:
}
//==============================================================================
void doDroppedFiles (HDROP hdrop)
void JUCE_CALLTYPE doDroppedFiles (HDROP hdrop)
{
POINT p;
DragQueryPoint (hdrop, &p);
@@ -1754,7 +1754,7 @@ private:
handleFilesDropped (p.x, p.y, files);
}
void doSettingChange()
void JUCE_CALLTYPE doSettingChange()
{
Desktop::getInstance().refreshMonitorSizes();
@@ -1781,7 +1781,7 @@ public:
}
private:
LRESULT peerWindowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT JUCE_CALLTYPE peerWindowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
{
{
const MessageManagerLock messLock;
@@ -2183,7 +2183,7 @@ void juce_setWindowStyleBit (HWND h, int styleType, int feature, bool bitIsSet)
//==============================================================================
bool Process::isForegroundProcess()
bool Process::isForegroundProcess() throw()
{
HWND fg = GetForegroundWindow();
@@ -2259,7 +2259,7 @@ void juce_updateMultiMonitorInfo (Array <Rectangle>& monitorCoords, const bool c
}
//==============================================================================
static Image* createImageFromHBITMAP (HBITMAP bitmap)
static Image* JUCE_CALLTYPE createImageFromHBITMAP (HBITMAP bitmap)
{
Image* im = 0;
@@ -2297,7 +2297,7 @@ static Image* createImageFromHBITMAP (HBITMAP bitmap)
return im;
}
static Image* createImageFromHICON (HICON icon)
static Image* JUCE_CALLTYPE createImageFromHICON (HICON icon)
{
ICONINFO info;
@@ -2331,7 +2331,7 @@ static Image* createImageFromHICON (HICON icon)
return 0;
}
static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY)
static HICON JUCE_CALLTYPE createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY)
{
HBITMAP mask = CreateBitmap (image.getWidth(), image.getHeight(), 1, 1, 0);
@@ -2404,7 +2404,7 @@ Image* juce_createIconForFile (const File& file)
}
//==============================================================================
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY)
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw()
{
const int maxW = GetSystemMetrics (SM_CXCURSOR);
const int maxH = GetSystemMetrics (SM_CYCURSOR);
@@ -2462,13 +2462,13 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot
return cursorH;
}
void juce_deleteMouseCursor (void* cursorHandle, bool isStandard)
void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw()
{
if (cursorHandle != 0 && ! isStandard)
DestroyCursor ((HCURSOR) cursorHandle);
}
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type)
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw()
{
LPCTSTR cursorName = IDC_ARROW;
@@ -2834,7 +2834,7 @@ public:
HRESULT __stdcall EnumDAdvise (IEnumSTATDATA __RPC_FAR *__RPC_FAR *) { return OLE_E_ADVISENOTSUPPORTED; }
};
static HDROP createHDrop (const StringArray& fileNames)
static HDROP JUCE_CALLTYPE createHDrop (const StringArray& fileNames)
{
int totalChars = 0;
for (int i = fileNames.size(); --i >= 0;)
@@ -2882,7 +2882,7 @@ static HDROP createHDrop (const StringArray& fileNames)
return hDrop;
}
static bool performDragDrop (FORMATETC* format, STGMEDIUM* medium, const DWORD whatToDo)
static bool JUCE_CALLTYPE performDragDrop (FORMATETC* format, STGMEDIUM* medium, const DWORD whatToDo)
{
JuceDropSource* const source = new JuceDropSource();
JuceDataObject* const data = new JuceDataObject (source, format, medium, 1);


+ 1
- 1
extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.cpp View File

@@ -44,7 +44,7 @@ static const short channelConfigs[][2] = { JucePlugin_PreferredChannelConfigurat
static const int numChannelConfigs = numElementsInArray (channelConfigs);
BEGIN_JUCE_NAMESPACE
extern void juce_setCurrentExecutableFileNameFromBundleId (const String& bundleId);
extern void juce_setCurrentExecutableFileNameFromBundleId (const String& bundleId) throw();
END_JUCE_NAMESPACE


+ 1
- 0
extras/the jucer/build/vc8/jucer.vcproj View File

@@ -83,6 +83,7 @@
AdditionalLibraryDirectories="../../../juce/bin"
ProgramDatabaseFile=".\Release/jucer.pdb"
SubSystem="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>


+ 4
- 4
src/juce_appframework/application/juce_Application.cpp View File

@@ -52,8 +52,8 @@ BEGIN_JUCE_NAMESPACE
#include "../../juce_core/threads/juce_Process.h"
#include "../../juce_core/threads/juce_InterProcessLock.h"
void juce_setCurrentExecutableFileName (const String& filename);
void juce_setCurrentThreadName (const String& name);
void juce_setCurrentExecutableFileName (const String& filename) throw();
void juce_setCurrentThreadName (const String& name) throw();
static JUCEApplication* appInstance = 0;
@@ -302,7 +302,7 @@ int JUCEApplication::main (int argc, char* argv[],
static bool juceInitialisedGUI = false;
void JUCE_API initialiseJuce_GUI()
void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI()
{
if (! juceInitialisedGUI)
{
@@ -335,7 +335,7 @@ void JUCE_API initialiseJuce_GUI()
}
}
void JUCE_API shutdownJuce_GUI()
void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI()
{
if (juceInitialisedGUI)
{


+ 4
- 4
src/juce_appframework/events/juce_MessageListener.cpp View File

@@ -37,7 +37,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
MessageListener::MessageListener() throw()
JUCE_CALLTYPE 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 @@ MessageListener::MessageListener() throw()
MessageManager::instance->messageListeners.add (this);
}
MessageListener::~MessageListener()
JUCE_CALLTYPE MessageListener::~MessageListener()
{
if (MessageManager::instance != 0)
MessageManager::instance->messageListeners.removeValue (this);
}
void MessageListener::postMessage (Message* const message) const throw()
void JUCE_CALLTYPE MessageListener::postMessage (Message* const message) const throw()
{
message->messageRecipient = const_cast <MessageListener*> (this);
@@ -62,7 +62,7 @@ void MessageListener::postMessage (Message* const message) const throw()
MessageManager::instance->postMessageToQueue (message);
}
bool MessageListener::isValidMessageListener() const throw()
bool JUCE_CALLTYPE MessageListener::isValidMessageListener() const throw()
{
return (MessageManager::instance != 0)
&& MessageManager::instance->messageListeners.contains (this);


+ 4
- 4
src/juce_appframework/events/juce_MessageListener.h View File

@@ -46,7 +46,7 @@ class JUCE_API MessageListener
protected:
//==============================================================================
/** Creates a MessageListener. */
MessageListener() throw();
JUCE_CALLTYPE MessageListener() throw();
public:
//==============================================================================
@@ -56,7 +56,7 @@ public:
of registered listeners, so that the isValidMessageListener() method
will no longer return true.
*/
virtual ~MessageListener();
virtual JUCE_CALLTYPE ~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 postMessage (Message* const message) const throw();
void JUCE_CALLTYPE 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 isValidMessageListener() const throw();
bool JUCE_CALLTYPE isValidMessageListener() const throw();
};


+ 24
- 24
src/juce_appframework/events/juce_MessageManager.cpp View File

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


+ 26
- 26
src/juce_appframework/events/juce_MessageManager.h View File

@@ -56,7 +56,7 @@ class JUCE_API MessageManager : private DeletedAtShutdown,
public:
//==============================================================================
/** Returns the global instance of the MessageManager. */
static MessageManager* getInstance() throw();
static MessageManager* JUCE_CALLTYPE 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 dispatchPendingMessages (int maxNumberOfMessagesToDispatch = 1000);
void JUCE_CALLTYPE 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 dispatchNextMessage (const bool returnImmediatelyIfNoMessages = false,
bool* const wasAMessageDispatched = 0);
bool JUCE_CALLTYPE 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* callFunctionOnMessageThread (MessageCallbackFunction* callback,
void* userData);
void* JUCE_CALLTYPE callFunctionOnMessageThread (MessageCallbackFunction* callback,
void* userData);
/** Returns true if the caller-thread is the message thread. */
bool isThisTheMessageThread() const;
bool JUCE_CALLTYPE 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 setCurrentMessageThread (const int threadId);
void JUCE_CALLTYPE 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 getCurrentMessageThread() const throw() { return messageThreadId; }
int JUCE_CALLTYPE 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 currentThreadHasLockedMessageManager() const;
bool JUCE_CALLTYPE 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 broadcastMessage (const String& messageText);
static void JUCE_CALLTYPE broadcastMessage (const String& messageText);
/** Registers a listener to get told about broadcast messages.
@@ -146,10 +146,10 @@ public:
@see broadcastMessage
*/
void registerBroadcastListener (ActionListener* listener);
void JUCE_CALLTYPE registerBroadcastListener (ActionListener* listener);
/** Deregisters a broadcast listener. */
void deregisterBroadcastListener (ActionListener* listener);
void JUCE_CALLTYPE 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 setTimeBeforeShowingWaitCursor (const int millisecs);
void JUCE_CALLTYPE setTimeBeforeShowingWaitCursor (const int millisecs);
/** Returns the time-out before the 'busy' cursor is shown when the app is busy.
@see setTimeBeforeShowingWaitCursor, MouseCursor::showWaitCursor
*/
int getTimeBeforeShowingWaitCursor() const;
int JUCE_CALLTYPE 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 delayWaitCursor();
static void JUCE_CALLTYPE delayWaitCursor();
//==============================================================================
/** Returns true if JUCEApplication::quit() has been called. */
bool hasQuitMessageBeenPosted() const;
bool JUCE_CALLTYPE hasQuitMessageBeenPosted() const;
//==============================================================================
/** @internal */
void deliverMessage (void*);
void JUCE_CALLTYPE deliverMessage (void*);
/** @internal */
void deliverBroadcastMessage (const String&);
void JUCE_CALLTYPE deliverBroadcastMessage (const String&);
/** @internal */
void timerCallback();
@@ -210,16 +210,16 @@ private:
int volatile timeBeforeWaitCursor;
unsigned int lastActivityCheckOkTime;
bool runDispatchLoop();
void postMessageToQueue (Message* const message);
void postQuitMessage (const bool useMaximumForce);
bool JUCE_CALLTYPE runDispatchLoop();
void JUCE_CALLTYPE postMessageToQueue (Message* const message);
void JUCE_CALLTYPE postQuitMessage (const bool useMaximumForce);
static void doPlatformSpecificInitialisation();
static void doPlatformSpecificShutdown();
friend class InternalTimerThread;
static void inactivityCheckCallback();
void inactivityCheckCallbackInt();
static void JUCE_CALLTYPE inactivityCheckCallback();
void JUCE_CALLTYPE 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.
*/
MessageManagerLock();
JUCE_CALLTYPE 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!
*/
~MessageManagerLock();
JUCE_CALLTYPE ~MessageManagerLock();
private:
int lastLockingThreadId;


+ 7
- 7
src/juce_appframework/events/juce_Timer.cpp View File

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


+ 7
- 7
src/juce_appframework/events/juce_Timer.h View File

@@ -65,19 +65,19 @@ protected:
When created, the timer is stopped, so use startTimer() to get it going.
*/
Timer() throw();
JUCE_CALLTYPE 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.
*/
Timer (const Timer& other) throw();
JUCE_CALLTYPE Timer (const Timer& other) throw();
public:
//==============================================================================
/** Destructor. */
virtual ~Timer();
virtual JUCE_CALLTYPE ~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 startTimer (const int intervalInMilliseconds) throw();
void JUCE_CALLTYPE 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 stopTimer() throw();
void JUCE_CALLTYPE stopTimer() throw();
//==============================================================================
/** Checks if the timer has been started.
@returns true if the timer is running.
*/
bool isTimerRunning() const throw() { return periodMs > 0; }
bool JUCE_CALLTYPE 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 getTimerInterval() const throw() { return periodMs; }
int JUCE_CALLTYPE getTimerInterval() const throw() { return periodMs; }
//==============================================================================


+ 15
- 13
src/juce_appframework/gui/components/mouse/juce_MouseCursor.cpp View File

@@ -37,10 +37,10 @@ BEGIN_JUCE_NAMESPACE
#include "../juce_Component.h"
#include "../../../../juce_core/threads/juce_ScopedLock.h"
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY);
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type);
void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw();
void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw();
// isStandard set depending on which interface was used to create the cursor
void juce_deleteMouseCursor (void* cursorHandle, bool isStandard);
void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw();
//==============================================================================
@@ -51,7 +51,7 @@ static VoidArray standardCursors (2);
class RefCountedMouseCursor
{
public:
RefCountedMouseCursor (MouseCursor::StandardCursorType t)
RefCountedMouseCursor (const MouseCursor::StandardCursorType t) throw()
: refCount (1),
standardType (t),
isStandard (true)
@@ -62,7 +62,7 @@ public:
RefCountedMouseCursor (Image& image,
const int hotSpotX,
const int hotSpotY)
const int hotSpotY) throw()
: refCount (1),
standardType (MouseCursor::NormalCursor),
isStandard (false)
@@ -70,13 +70,13 @@ public:
handle = juce_createMouseCursorFromImage (image, hotSpotX, hotSpotY);
}
~RefCountedMouseCursor()
~RefCountedMouseCursor() throw()
{
juce_deleteMouseCursor (handle, isStandard);
standardCursors.removeValue (this);
}
void decRef()
void decRef() throw()
{
if (--refCount == 0)
delete this;
@@ -92,7 +92,7 @@ public:
return handle;
}
static RefCountedMouseCursor* findInstance (MouseCursor::StandardCursorType type)
static RefCountedMouseCursor* findInstance (MouseCursor::StandardCursorType type) throw()
{
const ScopedLock sl (mouseCursorLock);
@@ -116,8 +116,10 @@ public:
private:
void* handle;
int refCount;
MouseCursor::StandardCursorType standardType;
bool isStandard;
const MouseCursor::StandardCursorType standardType;
const bool isStandard;
const RefCountedMouseCursor& operator= (const RefCountedMouseCursor&);
};
@@ -134,7 +136,7 @@ MouseCursor::MouseCursor (const StandardCursorType type) throw()
MouseCursor::MouseCursor (Image& image,
const int hotSpotX,
const int hotSpotY)
const int hotSpotY) throw()
{
cursorHandle = new RefCountedMouseCursor (image, hotSpotX, hotSpotY);
}
@@ -181,13 +183,13 @@ void* MouseCursor::getHandle() const throw()
return cursorHandle->getHandle();
}
void MouseCursor::showWaitCursor()
void MouseCursor::showWaitCursor() throw()
{
MouseCursor mc (MouseCursor::WaitCursor);
mc.showInAllWindows();
}
void MouseCursor::hideWaitCursor()
void MouseCursor::hideWaitCursor() throw()
{
if (Component::getComponentUnderMouse()->isValidComponent())
{


+ 3
- 3
src/juce_appframework/gui/components/mouse/juce_MouseCursor.h View File

@@ -96,7 +96,7 @@ public:
*/
MouseCursor (Image& image,
const int hotSpotX,
const int hotSpotY);
const int hotSpotY) throw();
//==============================================================================
/** Creates a copy of another cursor object. */
@@ -135,7 +135,7 @@ public:
@see MessageManager::setTimeBeforeShowingWaitCursor
*/
static void showWaitCursor();
static void showWaitCursor() throw();
/** If showWaitCursor has been called, this will return the mouse to its
normal state.
@@ -145,7 +145,7 @@ public:
@see showWaitCursor
*/
static void hideWaitCursor();
static void hideWaitCursor() throw();
//==============================================================================


+ 57
- 57
src/juce_appframework/gui/graphics/colour/juce_Colour.cpp View File

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


+ 62
- 62
src/juce_appframework/gui/graphics/colour/juce_Colour.h View File

@@ -46,10 +46,10 @@ class JUCE_API Colour
public:
//==============================================================================
/** Creates a transparent black colour. */
Colour() throw();
JUCE_CALLTYPE Colour() throw();
/** Creates a copy of another Colour object. */
Colour (const Colour& other) throw();
JUCE_CALLTYPE Colour (const Colour& other) throw();
/** Creates a colour from a 32-bit ARGB value.
@@ -61,28 +61,28 @@ public:
@see getPixelARGB
*/
explicit Colour (const uint32 argb) throw();
explicit JUCE_CALLTYPE Colour (const uint32 argb) throw();
/** Creates an opaque colour using 8-bit red, green and blue values */
Colour (const uint8 red,
const uint8 green,
const uint8 blue) throw();
JUCE_CALLTYPE Colour (const uint8 red,
const uint8 green,
const uint8 blue) throw();
/** Creates a colour using 8-bit red, green, blue and alpha values. */
Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const uint8 alpha) throw();
JUCE_CALLTYPE 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.
*/
Colour (const uint8 red,
const uint8 green,
const uint8 blue,
const float alpha) throw();
JUCE_CALLTYPE 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.
*/
Colour (const float hue,
const float saturation,
const float brightness,
const uint8 alpha) throw();
JUCE_CALLTYPE 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.
*/
Colour (const float hue,
const float saturation,
const float brightness,
const float alpha) throw();
JUCE_CALLTYPE Colour (const float hue,
const float saturation,
const float brightness,
const float alpha) throw();
/** Destructor. */
~Colour() throw();
JUCE_CALLTYPE ~Colour() throw();
/** Copies another Colour object. */
const Colour& operator= (const Colour& other) throw();
const Colour& JUCE_CALLTYPE operator= (const Colour& other) throw();
/** Compares two colours. */
bool operator== (const Colour& other) const throw();
bool JUCE_CALLTYPE operator== (const Colour& other) const throw();
/** Compares two colours. */
bool operator!= (const Colour& other) const throw();
bool JUCE_CALLTYPE operator!= (const Colour& other) const throw();
//==============================================================================
/** Returns the red component of this colour.
@returns a value between 0x00 and 0xff.
*/
uint8 getRed() const throw() { return argb.getRed(); }
uint8 JUCE_CALLTYPE getRed() const throw() { return argb.getRed(); }
/** Returns the green component of this colour.
@returns a value between 0x00 and 0xff.
*/
uint8 getGreen() const throw() { return argb.getGreen(); }
uint8 JUCE_CALLTYPE getGreen() const throw() { return argb.getGreen(); }
/** Returns the blue component of this colour.
@returns a value between 0x00 and 0xff.
*/
uint8 getBlue() const throw() { return argb.getBlue(); }
uint8 JUCE_CALLTYPE 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 getFloatRed() const throw();
float JUCE_CALLTYPE 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 getFloatGreen() const throw();
float JUCE_CALLTYPE 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 getFloatBlue() const throw();
float JUCE_CALLTYPE getFloatBlue() const throw();
/** Returns a premultiplied ARGB pixel object that represents this colour.
*/
const PixelARGB getPixelARGB() const throw();
const PixelARGB JUCE_CALLTYPE 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 getARGB() const throw();
uint32 JUCE_CALLTYPE getARGB() const throw();
//==============================================================================
/** Returns the colour's alpha (opacity).
Alpha of 0x00 is completely transparent, 0xff is completely opaque.
*/
uint8 getAlpha() const throw() { return argb.getAlpha(); }
uint8 JUCE_CALLTYPE 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 getFloatAlpha() const throw();
float JUCE_CALLTYPE getFloatAlpha() const throw();
/** Returns true if this colour is completely opaque.
Equivalent to (getAlpha() == 0xff).
*/
bool isOpaque() const throw();
bool JUCE_CALLTYPE isOpaque() const throw();
/** Returns true if this colour is completely transparent.
Equivalent to (getAlpha() == 0x00).
*/
bool isTransparent() const throw();
bool JUCE_CALLTYPE isTransparent() const throw();
/** Returns a colour that's the same colour as this one, but with a new alpha value. */
const Colour withAlpha (const uint8 newAlpha) const throw();
const Colour JUCE_CALLTYPE 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 withAlpha (const float newAlpha) const throw();
const Colour JUCE_CALLTYPE 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 withMultipliedAlpha (const float alphaMultiplier) const throw();
const Colour JUCE_CALLTYPE 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 overlaidWith (const Colour& foregroundColour) const throw();
const Colour JUCE_CALLTYPE 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 getHue() const throw();
float JUCE_CALLTYPE getHue() const throw();
/** Returns the colour's saturation component.
The value returned is in the range 0.0 to 1.0
*/
float getSaturation() const throw();
float JUCE_CALLTYPE getSaturation() const throw();
/** Returns the colour's brightness component.
The value returned is in the range 0.0 to 1.0
*/
float getBrightness() const throw();
float JUCE_CALLTYPE 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 getHSB (float& hue,
float& saturation,
float& brightness) const throw();
void JUCE_CALLTYPE getHSB (float& hue,
float& saturation,
float& brightness) const throw();
//==============================================================================
/** Returns a copy of this colour with a different hue. */
const Colour withHue (const float newHue) const throw();
const Colour JUCE_CALLTYPE withHue (const float newHue) const throw();
/** Returns a copy of this colour with a different saturation. */
const Colour withSaturation (const float newSaturation) const throw();
const Colour JUCE_CALLTYPE withSaturation (const float newSaturation) const throw();
/** Returns a copy of this colour with a different brightness.
@see brighter, darker, withMultipliedBrightness
*/
const Colour withBrightness (const float newBrightness) const throw();
const Colour JUCE_CALLTYPE 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 withRotatedHue (const float amountToRotate) const throw();
const Colour JUCE_CALLTYPE 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 withMultipliedSaturation (const float multiplier) const throw();
const Colour JUCE_CALLTYPE 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 withMultipliedBrightness (const float amount) const throw();
const Colour JUCE_CALLTYPE 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 brighter (float amountBrighter = 0.4f) const throw();
const Colour JUCE_CALLTYPE 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 darker (float amountDarker = 0.4f) const throw();
const Colour JUCE_CALLTYPE 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 contrasting (const float amount = 1.0f) const throw();
const Colour JUCE_CALLTYPE 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 contrasting (const Colour& colour1,
const Colour& colour2) throw();
static const Colour JUCE_CALLTYPE 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 greyLevel (const float brightness) throw();
static const Colour JUCE_CALLTYPE 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 toString() const throw();
const String JUCE_CALLTYPE toString() const throw();
/** Reads the colour from a string that was created with toString().
*/
static const Colour fromString (const String& encodedColourString);
static const Colour JUCE_CALLTYPE fromString (const String& encodedColourString);
//==============================================================================
juce_UseDebuggingNewOperator


+ 159
- 159
src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp View File

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


+ 168
- 168
src/juce_appframework/gui/graphics/contexts/juce_Graphics.h View File

@@ -70,10 +70,10 @@ public:
Obviously you shouldn't delete the image before this context is deleted.
*/
Graphics (Image& imageToDrawOnto);
JUCE_CALLTYPE Graphics (Image& imageToDrawOnto) throw();
/** Destructor. */
~Graphics() throw();
JUCE_CALLTYPE ~Graphics() throw();
//==============================================================================
/** Changes the current drawing colour.
@@ -86,7 +86,7 @@ public:
@see setOpacity, setBrush, getColour
*/
void setColour (const Colour& newColour) throw();
void JUCE_CALLTYPE setColour (const Colour& newColour) throw();
/** Returns the colour that's currently being used.
@@ -95,7 +95,7 @@ public:
@see setColour
*/
const Colour& getCurrentColour() const throw();
const Colour& JUCE_CALLTYPE 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 setOpacity (const float newOpacity) throw();
void JUCE_CALLTYPE setOpacity (const float newOpacity) throw();
/** Changes the current brush to use for drawing.
@@ -116,7 +116,7 @@ public:
@see SolidColourBrush, GradientBrush, ImageBrush, Brush
*/
void setBrush (const Brush* const newBrush);
void JUCE_CALLTYPE 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 setFont (const Font& newFont) throw();
void JUCE_CALLTYPE setFont (const Font& newFont) throw();
/** Changes the size and style of the currently-selected font.
@@ -135,14 +135,14 @@ public:
@see Font
*/
void setFont (const float newFontHeight,
const int fontStyleFlags = Font::plain) throw();
void JUCE_CALLTYPE 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& getCurrentFont() const;
const Font& JUCE_CALLTYPE 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 drawSingleLineText (const String& text,
const int startX,
const int baselineY) const;
void JUCE_CALLTYPE 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 drawMultiLineText (const String& text,
const int startX,
const int baselineY,
const int maximumLineWidth) const;
void JUCE_CALLTYPE 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 drawTextAsPath (const String& text,
const AffineTransform& transform) const;
void JUCE_CALLTYPE 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 drawText (const String& text,
const int x,
const int y,
const int width,
const int height,
const Justification& justificationType,
const bool useEllipsesIfTooBig) const;
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();
/** Tries to draw a text string inside a given space.
@@ -218,14 +218,14 @@ public:
@see GlyphArrangement::addFittedText
*/
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;
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();
//==============================================================================
/** 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 fillAll() const;
void JUCE_CALLTYPE 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 fillAll (const Colour& colourToUse) const;
void JUCE_CALLTYPE fillAll (const Colour& colourToUse) const throw();
//==============================================================================
/** Fills a rectangle with the current colour or brush.
@see drawRect, fillRoundedRectangle
*/
void fillRect (int x,
int y,
int width,
int height) const;
void JUCE_CALLTYPE fillRect (int x,
int y,
int width,
int height) const throw();
/** Fills a rectangle with the current colour or brush. */
void fillRect (const Rectangle& rectangle) const;
void JUCE_CALLTYPE 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 fillRect (const float x,
const float y,
const float width,
const float height) const;
void JUCE_CALLTYPE 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 fillRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize) const;
void JUCE_CALLTYPE 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 fillCheckerBoard (int x, int y,
int width, int height,
const int checkWidth,
const int checkHeight,
const Colour& colour1,
const Colour& colour2) const;
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();
/** Draws four lines to form a rectangular outline, using the current colour or brush.
@@ -291,22 +291,22 @@ public:
@see fillRect
*/
void drawRect (const int x,
const int y,
const int width,
const int height,
const int lineThickness = 1) const;
void JUCE_CALLTYPE 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 drawRoundedRectangle (const float x,
const float y,
const float width,
const float height,
const float cornerSize,
const float lineThickness) const;
void JUCE_CALLTYPE 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 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;
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();
/** Draws a pixel using the current colour or brush.
*/
void setPixel (int x, int y) const;
void JUCE_CALLTYPE 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 fillEllipse (const float x,
const float y,
const float width,
const float height) const;
void JUCE_CALLTYPE 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 drawEllipse (const float x,
const float y,
const float width,
const float height,
const float lineThickness) const;
void JUCE_CALLTYPE 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 drawLine (float startX,
float startY,
float endX,
float endY) const;
void JUCE_CALLTYPE 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 drawLine (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness) const;
void JUCE_CALLTYPE 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 drawLine (const Line& line) const;
void JUCE_CALLTYPE drawLine (const Line& line) const throw();
/** Draws a line between two points with a given thickness.
@see Path::addLineSegment
*/
void drawLine (const Line& line,
const float lineThickness) const;
void JUCE_CALLTYPE 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 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;
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();
/** 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 drawVerticalLine (const int x, float top, float bottom) const;
void JUCE_CALLTYPE 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 drawHorizontalLine (const int y, float left, float right) const;
void JUCE_CALLTYPE drawHorizontalLine (const int y, float left, float right) const throw();
//==============================================================================
/** Fills a path using the currently selected colour or brush.
*/
void fillPath (const Path& path,
const AffineTransform& transform = AffineTransform::identity) const;
void JUCE_CALLTYPE fillPath (const Path& path,
const AffineTransform& transform = AffineTransform::identity) const throw();
/** Draws a path's outline using the currently selected colour or brush.
*/
void strokePath (const Path& path,
const PathStrokeType& strokeType,
const AffineTransform& transform = AffineTransform::identity) const;
void JUCE_CALLTYPE 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 drawArrow (const float startX,
const float startY,
const float endX,
const float endY,
const float lineThickness,
const float arrowheadWidth,
const float arrowheadLength) const;
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();
//==============================================================================
@@ -469,7 +469,7 @@ public:
@see Graphics::drawImage, Graphics::drawImageTransformed, Graphics::drawImageWithin
*/
void setImageResamplingQuality (const ResamplingQuality newQuality);
void JUCE_CALLTYPE 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 drawImageAt (const Image* const imageToDraw,
const int topLeftX,
const int topLeftY,
const bool fillAlphaChannelWithCurrentBrush = false) const;
void JUCE_CALLTYPE 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 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;
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();
/** Draws part of an image, having applied an affine transform to it.
@@ -540,13 +540,13 @@ public:
@see setImageResamplingQuality, drawImage
*/
void drawImageTransformed (const Image* const imageToDraw,
int sourceClipX,
int sourceClipY,
int sourceClipWidth,
int sourceClipHeight,
const AffineTransform& transform,
const bool fillAlphaChannelWithCurrentBrush) const;
void JUCE_CALLTYPE 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 drawImageWithin (const Image* const imageToDraw,
const int destX,
const int destY,
const int destWidth,
const int destHeight,
const RectanglePlacement& placementWithinTarget,
const bool fillAlphaChannelWithCurrentBrush) const;
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();
//==============================================================================
@@ -583,7 +583,7 @@ public:
@see getClipRegion, clipRegionIntersects
*/
const Rectangle getClipBounds() const;
const Rectangle JUCE_CALLTYPE 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 clipRegionIntersects (const int x, const int y, const int width, const int height) const throw();
bool JUCE_CALLTYPE 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 reduceClipRegion (const int x, const int y,
const int width, const int height);
bool JUCE_CALLTYPE 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 reduceClipRegion (const RectangleList& clipRegion);
bool JUCE_CALLTYPE reduceClipRegion (const RectangleList& clipRegion) throw();
/** Excludes a rectangle to stop it being drawn into. */
void excludeClipRegion (const int x, const int y,
const int width, const int height);
void JUCE_CALLTYPE 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 isClipEmpty() const;
bool JUCE_CALLTYPE isClipEmpty() const throw();
/** Saves the current graphics state on an internal stack.
To restore the state, use restoreState().
*/
void saveState();
void JUCE_CALLTYPE saveState() throw();
/** Restores a graphics state that was previously saved with saveState().
*/
void restoreState();
void JUCE_CALLTYPE restoreState() throw();
/** Moves the position of the context's origin.
@@ -635,14 +635,14 @@ public:
@see reduceClipRegion
*/
void setOrigin (const int newOriginX,
const int newOriginY);
void JUCE_CALLTYPE setOrigin (const int newOriginX,
const int newOriginY) throw();
/** Resets the current colour, brush, and font to default settings. */
void resetToDefaultState();
void JUCE_CALLTYPE resetToDefaultState() throw();
/** Returns true if this context is drawing to a vector-based device, such as a printer. */
bool isVectorDevice() const;
bool JUCE_CALLTYPE isVectorDevice() const throw();
//==============================================================================
juce_UseDebuggingNewOperator
@@ -653,10 +653,10 @@ public:
NB. The context will NOT be deleted by this object when it is deleted.
*/
Graphics (LowLevelGraphicsContext* const internalContext);
JUCE_CALLTYPE Graphics (LowLevelGraphicsContext* const internalContext) throw();
/** @internal */
LowLevelGraphicsContext* getInternalContext() const throw() { return context; }
LowLevelGraphicsContext* JUCE_CALLTYPE getInternalContext() const throw() { return context; }
private:
//==============================================================================
@@ -665,9 +665,9 @@ private:
struct GraphicsState
{
GraphicsState();
GraphicsState (const GraphicsState&);
~GraphicsState();
JUCE_CALLTYPE GraphicsState() throw();
JUCE_CALLTYPE GraphicsState (const GraphicsState&) throw();
JUCE_CALLTYPE ~GraphicsState() throw();
Colour colour;
Brush* brush;
@@ -679,7 +679,7 @@ private:
OwnedArray <GraphicsState> stateStack;
bool saveStatePending;
void saveStateIfPending();
void JUCE_CALLTYPE saveStateIfPending() throw();
const Graphics& operator= (const Graphics& other);
Graphics (const Graphics&);


+ 2
- 2
src/juce_core/basics/juce_Logger.h View File

@@ -82,14 +82,14 @@ public:
This can be called directly, or by using the DBG() macro in
juce_PlatformDefs.h (which will avoid calling the method in non-debug builds).
*/
static void JUCE_CALLTYPE outputDebugString (const String& text);
static void JUCE_CALLTYPE outputDebugString (const String& text) throw();
/** Writes a message to the standard error stream.
This can be called directly, or by using the DBG_PRINTF() macro in
juce_PlatformDefs.h (which will avoid calling the method in non-debug builds).
*/
static void JUCE_CALLTYPE outputDebugPrintf (const tchar* format, ...);
static void JUCE_CALLTYPE outputDebugPrintf (const tchar* format, ...) throw();
protected:


+ 29
- 29
src/juce_core/basics/juce_MathsFunctions.h View File

@@ -105,58 +105,58 @@ typedef wchar_t juce_wchar;
// Some indispensible min/max functions
/** Returns the larger of two values. */
forcedinline int jmax (const int a, const int b) throw() { return (a < b) ? b : a; }
forcedinline int JUCE_CALLTYPE jmax (const int a, const int b) throw() { return (a < b) ? b : a; }
/** Returns the larger of two values. */
forcedinline int64 jmax (const int64 a, const int64 b) throw() { return (a < b) ? b : a; }
forcedinline int64 JUCE_CALLTYPE jmax (const int64 a, const int64 b) throw() { return (a < b) ? b : a; }
/** Returns the larger of two values. */
forcedinline float jmax (const float a, const float b) throw() { return (a < b) ? b : a; }
forcedinline float JUCE_CALLTYPE jmax (const float a, const float b) throw() { return (a < b) ? b : a; }
/** Returns the larger of two values. */
forcedinline double jmax (const double a, const double b) throw() { return (a < b) ? b : a; }
forcedinline double JUCE_CALLTYPE jmax (const double a, const double b) throw() { return (a < b) ? b : a; }
/** Returns the larger of three values. */
inline int jmax (const int a, const int b, const int c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
inline int JUCE_CALLTYPE jmax (const int a, const int b, const int c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
/** Returns the larger of three values. */
inline int64 jmax (const int64 a, const int64 b, const int64 c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
inline int64 JUCE_CALLTYPE jmax (const int64 a, const int64 b, const int64 c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
/** Returns the larger of three values. */
inline float jmax (const float a, const float b, const float c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
inline float JUCE_CALLTYPE jmax (const float a, const float b, const float c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
/** Returns the larger of three values. */
inline double jmax (const double a, const double b, const double c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
inline double JUCE_CALLTYPE jmax (const double a, const double b, const double c) throw() { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
/** Returns the larger of four values. */
inline int jmax (const int a, const int b, const int c, const int d) throw() { return jmax (a, jmax (b, c, d)); }
inline int JUCE_CALLTYPE jmax (const int a, const int b, const int c, const int d) throw() { return jmax (a, jmax (b, c, d)); }
/** Returns the larger of four values. */
inline int64 jmax (const int64 a, const int64 b, const int64 c, const int64 d) throw() { return jmax (a, jmax (b, c, d)); }
inline int64 JUCE_CALLTYPE jmax (const int64 a, const int64 b, const int64 c, const int64 d) throw() { return jmax (a, jmax (b, c, d)); }
/** Returns the larger of four values. */
inline float jmax (const float a, const float b, const float c, const float d) throw() { return jmax (a, jmax (b, c, d)); }
inline float JUCE_CALLTYPE jmax (const float a, const float b, const float c, const float d) throw() { return jmax (a, jmax (b, c, d)); }
/** Returns the larger of four values. */
inline double jmax (const double a, const double b, const double c, const double d) throw() { return jmax (a, jmax (b, c, d)); }
inline double JUCE_CALLTYPE jmax (const double a, const double b, const double c, const double d) throw() { return jmax (a, jmax (b, c, d)); }
/** Returns the smaller of two values. */
inline int jmin (const int a, const int b) throw() { return (a > b) ? b : a; }
inline int JUCE_CALLTYPE jmin (const int a, const int b) throw() { return (a > b) ? b : a; }
/** Returns the smaller of two values. */
inline int64 jmin (const int64 a, const int64 b) throw() { return (a > b) ? b : a; }
inline int64 JUCE_CALLTYPE jmin (const int64 a, const int64 b) throw() { return (a > b) ? b : a; }
/** Returns the smaller of two values. */
inline float jmin (const float a, const float b) throw() { return (a > b) ? b : a; }
inline float JUCE_CALLTYPE jmin (const float a, const float b) throw() { return (a > b) ? b : a; }
/** Returns the smaller of two values. */
inline double jmin (const double a, const double b) throw() { return (a > b) ? b : a; }
inline double JUCE_CALLTYPE jmin (const double a, const double b) throw() { return (a > b) ? b : a; }
/** Returns the smaller of three values. */
inline int jmin (const int a, const int b, const int c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
inline int JUCE_CALLTYPE jmin (const int a, const int b, const int c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
/** Returns the smaller of three values. */
inline int64 jmin (const int64 a, const int64 b, const int64 c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
inline int64 JUCE_CALLTYPE jmin (const int64 a, const int64 b, const int64 c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
/** Returns the smaller of three values. */
inline float jmin (const float a, const float b, const float c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
inline float JUCE_CALLTYPE jmin (const float a, const float b, const float c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
/** Returns the smaller of three values. */
inline double jmin (const double a, const double b, const double c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
inline double JUCE_CALLTYPE jmin (const double a, const double b, const double c) throw() { return (a > b) ? ((b > c) ? c : b) : ((a > c) ? c : a); }
/** Returns the smaller of four values. */
inline int jmin (const int a, const int b, const int c, const int d) throw() { return jmin (a, jmin (b, c, d)); }
inline int JUCE_CALLTYPE jmin (const int a, const int b, const int c, const int d) throw() { return jmin (a, jmin (b, c, d)); }
/** Returns the smaller of four values. */
inline int64 jmin (const int64 a, const int64 b, const int64 c, const int64 d) throw() { return jmin (a, jmin (b, c, d)); }
inline int64 JUCE_CALLTYPE jmin (const int64 a, const int64 b, const int64 c, const int64 d) throw() { return jmin (a, jmin (b, c, d)); }
/** Returns the smaller of four values. */
inline float jmin (const float a, const float b, const float c, const float d) throw() { return jmin (a, jmin (b, c, d)); }
inline float JUCE_CALLTYPE jmin (const float a, const float b, const float c, const float d) throw() { return jmin (a, jmin (b, c, d)); }
/** Returns the smaller of four values. */
inline double jmin (const double a, const double b, const double c, const double d) throw() { return jmin (a, jmin (b, c, d)); }
inline double JUCE_CALLTYPE jmin (const double a, const double b, const double c, const double d) throw() { return jmin (a, jmin (b, c, d)); }
//==============================================================================
@@ -172,9 +172,9 @@ inline double jmin (const double a, const double b, const double c, const double
and upperLimit (inclusive)
*/
template <class Type>
inline Type jlimit (const Type lowerLimit,
const Type upperLimit,
const Type valueToConstrain) throw()
inline Type JUCE_CALLTYPE jlimit (const Type lowerLimit,
const Type upperLimit,
const Type valueToConstrain) throw()
{
jassert (lowerLimit <= upperLimit); // if these are in the wrong order, results are unpredictable..
@@ -187,7 +187,7 @@ inline Type jlimit (const Type lowerLimit,
/** Handy function to swap two values over.
*/
template <class Type>
inline void swapVariables (Type& variable1, Type& variable2)
inline void JUCE_CALLTYPE swapVariables (Type& variable1, Type& variable2) throw()
{
const Type tempVal = variable1;
variable1 = variable2;
@@ -242,7 +242,7 @@ inline void swapVariables (Type& variable1, Type& variable2)
forcedinline float juce_hypotf (float a, float b) { return hypotf (a, b); }
#endif
inline int64 abs64 (const int64 n) { return (n >= 0) ? n : -n; }
inline int64 abs64 (const int64 n) throw() { return (n >= 0) ? n : -n; }
//==============================================================================


+ 8
- 8
src/juce_core/basics/juce_Singleton.h View File

@@ -97,7 +97,7 @@
static classname* _singletonInstance; \
static CriticalSection _singletonLock; \
\
static classname* getInstance() \
static classname* JUCE_CALLTYPE getInstance() \
{ \
if (_singletonInstance == 0) \
{\
@@ -125,12 +125,12 @@
return _singletonInstance; \
} \
\
static inline classname* getInstanceWithoutCreating() throw() \
static inline classname* JUCE_CALLTYPE getInstanceWithoutCreating() throw() \
{ \
return _singletonInstance; \
} \
\
static void deleteInstance() \
static void JUCE_CALLTYPE deleteInstance() \
{ \
const ScopedLock sl (_singletonLock); \
if (_singletonInstance != 0) \
@@ -141,7 +141,7 @@
} \
} \
\
void clearSingletonInstance() throw() \
void JUCE_CALLTYPE clearSingletonInstance() throw() \
{ \
if (_singletonInstance == this) \
_singletonInstance = 0; \
@@ -179,7 +179,7 @@
\
static classname* _singletonInstance; \
\
static classname* getInstance() \
static classname* JUCE_CALLTYPE getInstance() \
{ \
if (_singletonInstance == 0) \
{ \
@@ -202,12 +202,12 @@
return _singletonInstance; \
} \
\
static inline classname* getInstanceWithoutCreating() throw() \
static inline classname* JUCE_CALLTYPE getInstanceWithoutCreating() throw() \
{ \
return _singletonInstance; \
} \
\
static void deleteInstance() \
static void JUCE_CALLTYPE deleteInstance() \
{ \
if (_singletonInstance != 0) \
{ \
@@ -217,7 +217,7 @@
} \
} \
\
void clearSingletonInstance() throw() \
void JUCE_CALLTYPE clearSingletonInstance() throw() \
{ \
if (_singletonInstance == this) \
_singletonInstance = 0; \


+ 1
- 1
src/juce_core/basics/juce_StandardHeader.h View File

@@ -121,7 +121,7 @@
/** This macro defines the C calling convention used as the standard for Juce calls. */
#if JUCE_MSVC
#define JUCE_CALLTYPE __cdecl
#define JUCE_CALLTYPE __stdcall
#else
#define JUCE_CALLTYPE
#endif


+ 3
- 3
src/juce_core/basics/juce_SystemStats.cpp View File

@@ -43,7 +43,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
const String SystemStats::getJUCEVersion()
const String SystemStats::getJUCEVersion() throw()
{
return T("JUCE v") + String (JUCE_MAJOR_VERSION) + T(".") + String (JUCE_MINOR_VERSION);
}
@@ -52,7 +52,7 @@ const String SystemStats::getJUCEVersion()
//==============================================================================
static bool juceInitialisedNonGUI = false;
void JUCE_API initialiseJuce_NonGUI()
void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI()
{
if (! juceInitialisedNonGUI)
{
@@ -83,7 +83,7 @@ void JUCE_API initialiseJuce_NonGUI()
}
}
void JUCE_API shutdownJuce_NonGUI()
void JUCE_PUBLIC_FUNCTION shutdownJuce_NonGUI()
{
if (juceInitialisedNonGUI)
{


+ 18
- 18
src/juce_core/basics/juce_SystemStats.h View File

@@ -47,7 +47,7 @@ public:
See also the JUCE_VERSION, JUCE_MAJOR_VERSION and JUCE_MINOR_VERSION macros.
*/
static const String getJUCEVersion();
static const String getJUCEVersion() throw();
//==============================================================================
/** The set of possible results of the getOperatingSystemType() method.
@@ -78,14 +78,14 @@ public:
@returns one of the values from the OSType enum.
@see getOperatingSystemName
*/
static OperatingSystemType getOperatingSystemType();
static OperatingSystemType getOperatingSystemType() throw();
/** Returns the name of the type of operating system we're running on.
@returns a string describing the OS type.
@see getOperatingSystemType
*/
static const String getOperatingSystemName();
static const String getOperatingSystemName() throw();
//==============================================================================
// CPU and memory information..
@@ -95,43 +95,43 @@ public:
@returns the speed in megahertz, e.g. 1500, 2500, 32000 (depending on
what year you're reading this...)
*/
static int getCpuSpeedInMegaherz();
static int getCpuSpeedInMegaherz() throw();
/** Returns a string to indicate the CPU vendor.
Might not be known on some systems.
*/
static const String getCpuVendor();
static const String getCpuVendor() throw();
/** Checks whether Intel MMX instructions are available. */
static bool hasMMX();
static bool hasMMX() throw();
/** Checks whether Intel SSE instructions are available. */
static bool hasSSE();
static bool hasSSE() throw();
/** Checks whether Intel SSE2 instructions are available. */
static bool hasSSE2();
static bool hasSSE2() throw();
/** Checks whether AMD 3DNOW instructions are available. */
static bool has3DNow();
static bool has3DNow() throw();
/** True if the chip has hyperthreading.
Probably only uber-geeks will care less about this.
*/
static bool hasHyperThreading();
static bool hasHyperThreading() throw();
/** Checks whether there are multiple processors in the box.
@see getNumLogicalCpus
*/
static int getNumPhysicalCpus();
static int getNumPhysicalCpus() throw();
/** Counts the number of logical processors.
May give a different result to getNumPhysicalCpus()...
*/
static int getNumLogicalCpus();
static int getNumLogicalCpus() throw();
/** Returns a bitmask for the physical processors.
@@ -139,7 +139,7 @@ public:
@see Thread::setAffinityMask
*/
static uint32 getPhysicalAffinityMask();
static uint32 getPhysicalAffinityMask() throw();
/** Returns a clock-cycle tick counter, if available.
@@ -149,7 +149,7 @@ public:
@returns the tick count, or zero if not available.
*/
static int64 getClockCycleCounter();
static int64 getClockCycleCounter() throw();
//==============================================================================
/** Finds out how much RAM is in the machine.
@@ -157,13 +157,13 @@ public:
@returns the approximate number of megabytes of memory, or zero if
something goes wrong when finding out.
*/
static int getMemorySizeInMegabytes();
static int getMemorySizeInMegabytes() throw();
/** Returns the system page-size.
This is only used by programmers with beards.
*/
static int getPageSize();
static int getPageSize() throw();
//==============================================================================
/** Returns a list of MAC addresses found on this machine.
@@ -172,12 +172,12 @@ public:
@param maxNum the number of elements in this array
@returns the number of MAC addresses that were found
*/
static int getMACAddresses (int64* addresses, int maxNum);
static int getMACAddresses (int64* addresses, int maxNum) throw();
//==============================================================================
// not-for-public-use platform-specific method gets called at startup to initialise things.
static void initialiseStats();
static void initialiseStats() throw();
};


+ 16
- 16
src/juce_core/basics/juce_Time.cpp View File

@@ -250,7 +250,7 @@ const Time Time::getCurrentTime() throw()
const String Time::toString (const bool includeDate,
const bool includeTime,
const bool includeSeconds,
const bool use24HourClock) const
const bool use24HourClock) const throw()
{
String result;
@@ -289,7 +289,7 @@ const String Time::toString (const bool includeDate,
return result.trimEnd();
}
const String Time::formatted (const tchar* const format) const
const String Time::formatted (const tchar* const format) const throw()
{
tchar buffer[80];
@@ -316,42 +316,42 @@ const String Time::formatted (const tchar* const format) const
}
//==============================================================================
int Time::getYear() const
int Time::getYear() const throw()
{
struct tm t;
millisToLocal (millisSinceEpoch, t);
return t.tm_year + 1900;
}
int Time::getMonth() const
int Time::getMonth() const throw()
{
struct tm t;
millisToLocal (millisSinceEpoch, t);
return t.tm_mon;
}
int Time::getDayOfMonth() const
int Time::getDayOfMonth() const throw()
{
struct tm t;
millisToLocal (millisSinceEpoch, t);
return t.tm_mday;
}
int Time::getDayOfWeek() const
int Time::getDayOfWeek() const throw()
{
struct tm t;
millisToLocal (millisSinceEpoch, t);
return t.tm_wday;
}
int Time::getHours() const
int Time::getHours() const throw()
{
struct tm t;
millisToLocal (millisSinceEpoch, t);
return t.tm_hour;
}
int Time::getHoursInAmPmFormat() const
int Time::getHoursInAmPmFormat() const throw()
{
const int hours = getHours();
@@ -363,34 +363,34 @@ int Time::getHoursInAmPmFormat() const
return hours - 12;
}
bool Time::isAfternoon() const
bool Time::isAfternoon() const throw()
{
return getHours() >= 12;
}
int Time::getMinutes() const
int Time::getMinutes() const throw()
{
return (int) ((millisSinceEpoch / 60000) % 60);
}
int Time::getSeconds() const
int Time::getSeconds() const throw()
{
return (int) ((millisSinceEpoch / 1000) % 60);
}
int Time::getMilliseconds() const
int Time::getMilliseconds() const throw()
{
return (int) (millisSinceEpoch % 1000);
}
bool Time::isDaylightSavingTime() const
bool Time::isDaylightSavingTime() const throw()
{
struct tm t;
millisToLocal (millisSinceEpoch, t);
return t.tm_isdst != 0;
}
const String Time::getTimeZone() const
const String Time::getTimeZone() const throw()
{
String zone[2];
@@ -434,12 +434,12 @@ const String Time::getTimeZone() const
return zone[0].substring (0, 3);
}
const String Time::getMonthName (const bool threeLetterVersion) const
const String Time::getMonthName (const bool threeLetterVersion) const throw()
{
return getMonthName (getMonth(), threeLetterVersion);
}
const String Time::getWeekdayName (const bool threeLetterVersion) const
const String Time::getWeekdayName (const bool threeLetterVersion) const throw()
{
return getWeekdayName (getDayOfWeek(), threeLetterVersion);
}


+ 17
- 17
src/juce_core/basics/juce_Time.h View File

@@ -117,14 +117,14 @@ public:
A 4-digit format is used, e.g. 2004.
*/
int getYear() const;
int getYear() const throw();
/** Returns the number of the month.
The value returned is in the range 0 to 11.
@see getMonthName
*/
int getMonth() const;
int getMonth() const throw();
/** Returns the name of the month.
@@ -132,26 +132,26 @@ public:
it'll return the long form, e.g. "January"
@see getMonth
*/
const String getMonthName (const bool threeLetterVersion) const;
const String getMonthName (const bool threeLetterVersion) const throw();
/** Returns the day of the month.
The value returned is in the range 1 to 31.
*/
int getDayOfMonth() const;
int getDayOfMonth() const throw();
/** Returns the number of the day of the week.
The value returned is in the range 0 to 6 (0 = sunday, 1 = monday, etc).
*/
int getDayOfWeek() const;
int getDayOfWeek() const throw();
/** Returns the name of the weekday.
@param threeLetterVersion if true, it'll return a 3-letter abbreviation, e.g. "Tue"; if
false, it'll return the full version, e.g. "Tuesday".
*/
const String getWeekdayName (const bool threeLetterVersion) const;
const String getWeekdayName (const bool threeLetterVersion) const throw();
/** Returns the number of hours since midnight.
@@ -159,7 +159,7 @@ public:
@see getHoursInAmPmFormat, isAfternoon
*/
int getHours() const;
int getHours() const throw();
/** Returns true if the time is in the afternoon.
@@ -167,7 +167,7 @@ public:
@see getHoursInAmPmFormat, getHours
*/
bool isAfternoon() const;
bool isAfternoon() const throw();
/** Returns the hours in 12-hour clock format.
@@ -176,13 +176,13 @@ public:
@see getHours, isAfternoon
*/
int getHoursInAmPmFormat() const;
int getHoursInAmPmFormat() const throw();
/** Returns the number of minutes, 0 to 59. */
int getMinutes() const;
int getMinutes() const throw();
/** Returns the number of seconds, 0 to 59. */
int getSeconds() const;
int getSeconds() const throw();
/** Returns the number of milliseconds, 0 to 999.
@@ -191,13 +191,13 @@ public:
@see toMilliseconds
*/
int getMilliseconds() const;
int getMilliseconds() const throw();
/** Returns true if the local timezone uses a daylight saving correction. */
bool isDaylightSavingTime() const;
bool isDaylightSavingTime() const throw();
/** Returns a 3-character string to indicate the local timezone. */
const String getTimeZone() const;
const String getTimeZone() const throw();
//==============================================================================
/** Quick way of getting a string version of a date and time.
@@ -215,7 +215,7 @@ public:
const String toString (const bool includeDate,
const bool includeTime,
const bool includeSeconds = true,
const bool use24HourClock = false) const;
const bool use24HourClock = false) const throw();
/** Converts this date/time to a string with a user-defined format.
@@ -248,7 +248,7 @@ public:
@see toString
*/
const String formatted (const tchar* const format) const;
const String formatted (const tchar* const format) const throw();
//==============================================================================
/** Adds a RelativeTime to this time and returns the result. */
@@ -284,7 +284,7 @@ public:
@returns true if this succeeds, although depending on the system, the
application might not have sufficient privileges to do this.
*/
bool setSystemTimeToThisTime() const;
bool setSystemTimeToThisTime() const throw();
//==============================================================================
/** Returns the name of a day of the week.


+ 57
- 57
src/juce_core/containers/juce_Array.h View File

@@ -66,7 +66,7 @@ public:
@see ArrayAllocationBase
*/
Array (const int granularity = juceDefaultArrayGranularity) throw()
JUCE_CALLTYPE Array (const int granularity = juceDefaultArrayGranularity) throw()
: ArrayAllocationBase <ElementType> (granularity),
numUsed (0)
{
@@ -75,7 +75,7 @@ public:
/** Creates a copy of another array.
@param other the array to copy
*/
Array (const Array<ElementType, TypeOfCriticalSectionToUse>& other) throw()
JUCE_CALLTYPE Array (const Array<ElementType, TypeOfCriticalSectionToUse>& other) throw()
: ArrayAllocationBase <ElementType> (other.granularity)
{
other.lockArray();
@@ -89,7 +89,7 @@ public:
@param values the array to copy from
*/
Array (const ElementType* values) throw()
JUCE_CALLTYPE Array (const ElementType* values) throw()
: ArrayAllocationBase <ElementType> (juceDefaultArrayGranularity),
numUsed (0)
{
@@ -102,7 +102,7 @@ public:
@param values the array to copy from
@param numValues the number of values in the array
*/
Array (const ElementType* values, int numValues) throw()
JUCE_CALLTYPE Array (const ElementType* values, int numValues) throw()
: ArrayAllocationBase <ElementType> (juceDefaultArrayGranularity),
numUsed (numValues)
{
@@ -111,14 +111,14 @@ public:
}
/** Destructor. */
~Array() throw()
JUCE_CALLTYPE ~Array() throw()
{
}
/** Copies another array.
@param other the array to copy
*/
const Array <ElementType, TypeOfCriticalSectionToUse>& operator= (const Array <ElementType, TypeOfCriticalSectionToUse>& other) throw()
const Array <ElementType, TypeOfCriticalSectionToUse>& JUCE_CALLTYPE operator= (const Array <ElementType, TypeOfCriticalSectionToUse>& other) throw()
{
if (this != &other)
{
@@ -145,7 +145,7 @@ public:
@param other the other array to compare with
*/
template <class OtherArrayType>
bool operator== (const OtherArrayType& other) const throw()
bool JUCE_CALLTYPE operator== (const OtherArrayType& other) const throw()
{
lock.enter();
@@ -174,7 +174,7 @@ public:
@param other the other array to compare with
*/
template <class OtherArrayType>
bool operator!= (const OtherArrayType& other) const throw()
bool JUCE_CALLTYPE operator!= (const OtherArrayType& other) const throw()
{
return ! operator== (other);
}
@@ -187,7 +187,7 @@ public:
@see clearQuick
*/
void clear() throw()
void JUCE_CALLTYPE clear() throw()
{
lock.enter();
this->setAllocatedSize (0);
@@ -199,7 +199,7 @@ public:
@see clear
*/
void clearQuick() throw()
void JUCE_CALLTYPE clearQuick() throw()
{
lock.enter();
numUsed = 0;
@@ -209,7 +209,7 @@ public:
//==============================================================================
/** Returns the current number of elements in the array.
*/
inline int size() const throw()
inline int JUCE_CALLTYPE size() const throw()
{
return numUsed;
}
@@ -224,7 +224,7 @@ public:
@param index the index of the element being requested (0 is the first element in the array)
@see getUnchecked, getFirst, getLast
*/
inline ElementType operator[] (const int index) const throw()
inline ElementType JUCE_CALLTYPE operator[] (const int index) const throw()
{
lock.enter();
const ElementType result = (index >= 0 && index < numUsed) ? this->elements [index]
@@ -243,7 +243,7 @@ public:
@param index the index of the element being requested (0 is the first element in the array)
@see operator[], getFirst, getLast
*/
inline ElementType getUnchecked (const int index) const throw()
inline ElementType JUCE_CALLTYPE getUnchecked (const int index) const throw()
{
lock.enter();
jassert (index >= 0 && index < numUsed);
@@ -262,7 +262,7 @@ public:
@param index the index of the element being requested (0 is the first element in the array)
@see operator[], getFirst, getLast
*/
inline ElementType& getReference (const int index) const throw()
inline ElementType& JUCE_CALLTYPE getReference (const int index) const throw()
{
jassert (index >= 0 && index < numUsed);
return this->elements [index];
@@ -272,7 +272,7 @@ public:
@see operator[], getUnchecked, getLast
*/
inline ElementType getFirst() const throw()
inline ElementType JUCE_CALLTYPE getFirst() const throw()
{
lock.enter();
const ElementType result = (numUsed > 0) ? this->elements [0]
@@ -286,7 +286,7 @@ public:
@see operator[], getUnchecked, getFirst
*/
inline ElementType getLast() const throw()
inline ElementType JUCE_CALLTYPE getLast() const throw()
{
lock.enter();
const ElementType result = (numUsed > 0) ? this->elements [numUsed - 1]
@@ -305,7 +305,7 @@ public:
@param elementToLookFor the value or object to look for
@returns the index of the object, or -1 if it's not found
*/
int indexOf (const ElementType elementToLookFor) const throw()
int JUCE_CALLTYPE indexOf (const ElementType elementToLookFor) const throw()
{
lock.enter();
const ElementType* e = this->elements;
@@ -330,7 +330,7 @@ public:
@param elementToLookFor the value or object to look for
@returns true if the item is found
*/
bool contains (const ElementType elementToLookFor) const throw()
bool JUCE_CALLTYPE contains (const ElementType elementToLookFor) const throw()
{
lock.enter();
@@ -374,7 +374,7 @@ public:
@param newElement the new object to add to the array
@see set, insert, addIfNotAlreadyThere, addSorted, addArray
*/
void add (const ElementType newElement) throw()
void JUCE_CALLTYPE add (const ElementType newElement) throw()
{
lock.enter();
this->ensureAllocatedSize (numUsed + 1);
@@ -394,7 +394,7 @@ public:
@param newElement the new object to add to the array
@see add, addSorted, set
*/
void insert (int indexToInsertAt, const ElementType newElement) throw()
void JUCE_CALLTYPE insert (int indexToInsertAt, const ElementType newElement) throw()
{
lock.enter();
this->ensureAllocatedSize (numUsed + 1);
@@ -433,8 +433,8 @@ public:
@param numberOfTimesToInsertIt how many copies of the value to insert
@see insert, add, addSorted, set
*/
void insertMultiple (int indexToInsertAt, const ElementType newElement,
int numberOfTimesToInsertIt) throw()
void JUCE_CALLTYPE insertMultiple (int indexToInsertAt, const ElementType newElement,
int numberOfTimesToInsertIt) throw()
{
if (numberOfTimesToInsertIt > 0)
{
@@ -474,9 +474,9 @@ public:
@param numberOfElements how many items are in the array
@see insert, add, addSorted, set
*/
void insertArray (int indexToInsertAt,
const ElementType* newElements,
int numberOfElements) throw()
void JUCE_CALLTYPE insertArray (int indexToInsertAt,
const ElementType* newElements,
int numberOfElements) throw()
{
if (numberOfElements > 0)
{
@@ -512,7 +512,7 @@ public:
@param newElement the new object to add to the array
*/
void addIfNotAlreadyThere (const ElementType newElement) throw()
void JUCE_CALLTYPE addIfNotAlreadyThere (const ElementType newElement) throw()
{
lock.enter();
@@ -531,8 +531,8 @@ public:
@param newValue the new value to set for this index.
@see add, insert
*/
void set (const int indexToChange,
const ElementType newValue) throw()
void JUCE_CALLTYPE set (const int indexToChange,
const ElementType newValue) throw()
{
jassert (indexToChange >= 0);
@@ -563,8 +563,8 @@ public:
@param newValue the new value to set for this index.
@see set, getUnchecked
*/
void setUnchecked (const int indexToChange,
const ElementType newValue) throw()
void JUCE_CALLTYPE setUnchecked (const int indexToChange,
const ElementType newValue) throw()
{
lock.enter();
jassert (indexToChange >= 0 && indexToChange < numUsed);
@@ -578,8 +578,8 @@ public:
@param numElementsToAdd how many elements are in this other array
@see add
*/
void addArray (const ElementType* elementsToAdd,
int numElementsToAdd) throw()
void JUCE_CALLTYPE addArray (const ElementType* elementsToAdd,
int numElementsToAdd) throw()
{
lock.enter();
@@ -600,7 +600,7 @@ public:
because it just swaps their internal pointers.
*/
template <class OtherArrayType>
void swapWithArray (OtherArrayType& otherArray) throw()
void JUCE_CALLTYPE swapWithArray (OtherArrayType& otherArray) throw()
{
lock.enter();
otherArray.lock.enter();
@@ -621,9 +621,9 @@ public:
@see add
*/
template <class OtherArrayType>
void addArray (const OtherArrayType& arrayToAddFrom,
int startIndex = 0,
int numElementsToAdd = -1) throw()
void JUCE_CALLTYPE addArray (const OtherArrayType& arrayToAddFrom,
int startIndex = 0,
int numElementsToAdd = -1) throw()
{
arrayToAddFrom.lockArray();
lock.enter();
@@ -656,8 +656,8 @@ public:
@see add, sort
*/
template <class ElementComparator>
void addSorted (ElementComparator& comparator,
const ElementType newElement) throw()
void JUCE_CALLTYPE addSorted (ElementComparator& comparator,
const ElementType newElement) throw()
{
lock.enter();
insert (findInsertIndexInSortedArray (comparator, this->elements, newElement, 0, numUsed), newElement);
@@ -677,8 +677,8 @@ public:
@see addSorted, sort
*/
template <class ElementComparator>
int indexOfSorted (ElementComparator& comparator,
const ElementType elementToLookFor) const throw()
int JUCE_CALLTYPE indexOfSorted (ElementComparator& comparator,
const ElementType elementToLookFor) const throw()
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
@@ -727,7 +727,7 @@ public:
@returns the element that has been removed
@see removeValue, removeRange
*/
ElementType remove (const int indexToRemove) throw()
ElementType JUCE_CALLTYPE remove (const int indexToRemove) throw()
{
lock.enter();
@@ -763,7 +763,7 @@ public:
@param valueToRemove the object to try to remove
@see remove, removeRange
*/
void removeValue (const ElementType valueToRemove) throw()
void JUCE_CALLTYPE removeValue (const ElementType valueToRemove) throw()
{
lock.enter();
ElementType* e = this->elements;
@@ -794,8 +794,8 @@ public:
@param numberToRemove how many elements should be removed
@see remove, removeValue
*/
void removeRange (int startIndex,
const int numberToRemove) throw()
void JUCE_CALLTYPE removeRange (int startIndex,
const int numberToRemove) throw()
{
lock.enter();
const int endIndex = jlimit (0, numUsed, startIndex + numberToRemove);
@@ -826,7 +826,7 @@ public:
@param howManyToRemove how many elements to remove from the end of the array
@see remove, removeValue, removeRange
*/
void removeLast (int howManyToRemove = 1) throw()
void JUCE_CALLTYPE removeLast (int howManyToRemove = 1) throw()
{
lock.enter();
numUsed = jmax (0, numUsed - howManyToRemove);
@@ -843,7 +843,7 @@ public:
@see removeValuesNotIn, remove, removeValue, removeRange
*/
template <class OtherArrayType>
void removeValuesIn (const OtherArrayType& otherArray) throw()
void JUCE_CALLTYPE removeValuesIn (const OtherArrayType& otherArray) throw()
{
otherArray.lockArray();
lock.enter();
@@ -874,7 +874,7 @@ public:
@see removeValuesIn, remove, removeValue, removeRange
*/
template <class OtherArrayType>
void removeValuesNotIn (const OtherArrayType& otherArray) throw()
void JUCE_CALLTYPE removeValuesNotIn (const OtherArrayType& otherArray) throw()
{
otherArray.lockArray();
lock.enter();
@@ -905,8 +905,8 @@ public:
@param index1 index of one of the elements to swap
@param index2 index of the other element to swap
*/
void swap (const int index1,
const int index2) throw()
void JUCE_CALLTYPE swap (const int index1,
const int index2) throw()
{
lock.enter();
@@ -934,8 +934,8 @@ public:
is less than zero, the value will be moved to the end
of the array
*/
void move (const int currentIndex,
int newIndex) throw()
void JUCE_CALLTYPE move (const int currentIndex,
int newIndex) throw()
{
if (currentIndex != newIndex)
{
@@ -975,7 +975,7 @@ public:
removing elements, they may have quite a lot of unused space allocated.
This method will reduce the amount of allocated storage to a minimum.
*/
void minimiseStorageOverheads() throw()
void JUCE_CALLTYPE minimiseStorageOverheads() throw()
{
lock.enter();
@@ -1000,7 +1000,7 @@ public:
the array won't have to keep dynamically resizing itself as the elements
are added, and it'll therefore be more efficient.
*/
void ensureStorageAllocated (const int minNumElements) throw()
void JUCE_CALLTYPE ensureStorageAllocated (const int minNumElements) throw()
{
this->ensureAllocatedSize (minNumElements);
}
@@ -1033,8 +1033,8 @@ public:
@see addSorted, indexOfSorted, sortArray
*/
template <class ElementComparator>
void sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const throw()
void JUCE_CALLTYPE sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const throw()
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
@@ -1051,7 +1051,7 @@ public:
@see unlockArray
*/
void lockArray() const throw()
void JUCE_CALLTYPE lockArray() const throw()
{
lock.enter();
}
@@ -1063,7 +1063,7 @@ public:
@see lockArray
*/
void unlockArray() const throw()
void JUCE_CALLTYPE unlockArray() const throw()
{
lock.exit();
}


+ 4
- 4
src/juce_core/containers/juce_ArrayAllocationBase.h View File

@@ -60,7 +60,7 @@ protected:
@param granularity_ this is the size of increment by which the internal storage
will be increased.
*/
ArrayAllocationBase (const int granularity_) throw()
JUCE_CALLTYPE ArrayAllocationBase (const int granularity_) throw()
: elements (0),
numAllocated (0),
granularity (granularity_)
@@ -68,7 +68,7 @@ protected:
}
/** Destructor. */
~ArrayAllocationBase() throw()
JUCE_CALLTYPE ~ArrayAllocationBase() throw()
{
if (elements != 0)
juce_free (elements);
@@ -82,7 +82,7 @@ protected:
@param numElements the number of elements that are needed
*/
void setAllocatedSize (const int numElements) throw()
void JUCE_CALLTYPE setAllocatedSize (const int numElements) throw()
{
if (numAllocated != numElements)
{
@@ -114,7 +114,7 @@ protected:
@param minNumElements the minimum number of elements that are needed
*/
void ensureAllocatedSize (int minNumElements) throw()
void JUCE_CALLTYPE ensureAllocatedSize (int minNumElements) throw()
{
if (minNumElements > numAllocated)
{


+ 14
- 14
src/juce_core/containers/juce_ElementComparator.h View File

@@ -62,11 +62,11 @@
@see sortArrayRetainingOrder
*/
template <class ElementType, class ElementComparator>
static void sortArray (ElementComparator& comparator,
ElementType* const array,
int firstElement,
int lastElement,
const bool retainOrderOfEquivalentItems)
static void JUCE_CALLTYPE sortArray (ElementComparator& comparator,
ElementType* const array,
int firstElement,
int lastElement,
const bool retainOrderOfEquivalentItems)
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
@@ -216,11 +216,11 @@ static void sortArray (ElementComparator& comparator,
@param lastElement the index of the last element in the range (this is non-inclusive)
*/
template <class ElementType, class ElementComparator>
static int findInsertIndexInSortedArray (ElementComparator& comparator,
ElementType* const array,
const ElementType newElement,
int firstElement,
int lastElement)
static int JUCE_CALLTYPE findInsertIndexInSortedArray (ElementComparator& comparator,
ElementType* const array,
const ElementType newElement,
int firstElement,
int lastElement)
{
jassert (firstElement <= lastElement);
@@ -279,8 +279,8 @@ template <class ElementType>
class IntegerElementComparator
{
public:
static int compareElements (const ElementType first,
const ElementType second) throw()
static int JUCE_CALLTYPE compareElements (const ElementType first,
const ElementType second) throw()
{
return first - second;
}
@@ -307,8 +307,8 @@ template <class ElementType>
class FloatElementComparator
{
public:
static int compareElements (const ElementType first,
const ElementType second) throw()
static int JUCE_CALLTYPE compareElements (const ElementType first,
const ElementType second) throw()
{
return (first < second) ? -1
: ((first == second) ? 0


+ 39
- 39
src/juce_core/containers/juce_OwnedArray.h View File

@@ -71,7 +71,7 @@ public:
@see ArrayAllocationBase
*/
OwnedArray (const int granularity = juceDefaultArrayGranularity) throw()
JUCE_CALLTYPE OwnedArray (const int granularity = juceDefaultArrayGranularity) throw()
: ArrayAllocationBase <ObjectClass*> (granularity),
numUsed (0)
{
@@ -82,14 +82,14 @@ public:
To get rid of the array without deleting its objects, use its
clear (false) method before deleting it.
*/
~OwnedArray()
JUCE_CALLTYPE ~OwnedArray()
{
clear (true);
}
//==============================================================================
/** Clears the array, optionally deleting the objects inside it first. */
void clear (const bool deleteObjects = true)
void JUCE_CALLTYPE clear (const bool deleteObjects = true)
{
lock.enter();
@@ -108,7 +108,7 @@ public:
/** Returns the number of items currently in the array.
@see operator[]
*/
inline int size() const throw()
inline int JUCE_CALLTYPE size() const throw()
{
return numUsed;
}
@@ -121,7 +121,7 @@ public:
@see getUnchecked
*/
inline ObjectClass* operator[] (const int index) const throw()
inline ObjectClass* JUCE_CALLTYPE operator[] (const int index) const throw()
{
lock.enter();
ObjectClass* const result = (index >= 0 && index < numUsed) ? this->elements [index]
@@ -136,7 +136,7 @@ public:
This is a faster and less safe version of operator[] which doesn't check the index passed in, so
it can be used when you're sure the index if always going to be legal.
*/
inline ObjectClass* getUnchecked (const int index) const throw()
inline ObjectClass* JUCE_CALLTYPE getUnchecked (const int index) const throw()
{
lock.enter();
jassert (index >= 0 && index < numUsed);
@@ -151,7 +151,7 @@ public:
This will return a null pointer if the array's empty.
@see getLast
*/
inline ObjectClass* getFirst() const throw()
inline ObjectClass* JUCE_CALLTYPE getFirst() const throw()
{
lock.enter();
ObjectClass* const result = (numUsed > 0) ? this->elements [0]
@@ -165,7 +165,7 @@ public:
This will return a null pointer if the array's empty.
@see getFirst
*/
inline ObjectClass* getLast() const throw()
inline ObjectClass* JUCE_CALLTYPE getLast() const throw()
{
lock.enter();
ObjectClass* const result = (numUsed > 0) ? this->elements [numUsed - 1]
@@ -181,7 +181,7 @@ public:
@param objectToLookFor the object to look for
@returns the index at which the object was found, or -1 if it's not found
*/
int indexOf (const ObjectClass* const objectToLookFor) const throw()
int JUCE_CALLTYPE indexOf (const ObjectClass* const objectToLookFor) const throw()
{
lock.enter();
ObjectClass* const* e = this->elements;
@@ -206,7 +206,7 @@ public:
@param objectToLookFor the object to look for
@returns true if the object is in the array
*/
bool contains (const ObjectClass* const objectToLookFor) const throw()
bool JUCE_CALLTYPE contains (const ObjectClass* const objectToLookFor) const throw()
{
lock.enter();
@@ -256,7 +256,7 @@ public:
@param newObject the new object to add to the array
@see set, insert, addIfNotAlreadyThere, addSorted
*/
void add (const ObjectClass* const newObject) throw()
void JUCE_CALLTYPE add (const ObjectClass* const newObject) throw()
{
lock.enter();
this->ensureAllocatedSize (numUsed + 1);
@@ -281,8 +281,8 @@ public:
@param newObject the new object to add to the array
@see add, addSorted, addIfNotAlreadyThere, set
*/
void insert (int indexToInsertAt,
const ObjectClass* const newObject) throw()
void JUCE_CALLTYPE insert (int indexToInsertAt,
const ObjectClass* const newObject) throw()
{
if (indexToInsertAt >= 0)
{
@@ -317,7 +317,7 @@ public:
@param newObject the new object to add to the array
*/
void addIfNotAlreadyThere (const ObjectClass* const newObject) throw()
void JUCE_CALLTYPE addIfNotAlreadyThere (const ObjectClass* const newObject) throw()
{
lock.enter();
@@ -340,9 +340,9 @@ public:
@param deleteOldElement whether to delete the object that's being replaced with the new one
@see add, insert, remove
*/
void set (const int indexToChange,
const ObjectClass* const newObject,
const bool deleteOldElement = true)
void JUCE_CALLTYPE set (const int indexToChange,
const ObjectClass* const newObject,
const bool deleteOldElement = true)
{
if (indexToChange >= 0)
{
@@ -383,8 +383,8 @@ public:
@see add, sort
*/
template <class ElementComparator>
void addSorted (ElementComparator& comparator,
ObjectClass* const newObject) throw()
void JUCE_CALLTYPE addSorted (ElementComparator& comparator,
ObjectClass* const newObject) throw()
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
@@ -404,8 +404,8 @@ public:
@param deleteObject whether to delete the object that is removed
@see removeObject, removeRange
*/
void remove (const int indexToRemove,
const bool deleteObject = true)
void JUCE_CALLTYPE remove (const int indexToRemove,
const bool deleteObject = true)
{
lock.enter();
ObjectClass* toDelete = 0;
@@ -440,8 +440,8 @@ public:
@param deleteObject whether to delete the object (if it's found)
@see remove, removeRange
*/
void removeObject (const ObjectClass* const objectToRemove,
const bool deleteObject = true)
void JUCE_CALLTYPE removeObject (const ObjectClass* const objectToRemove,
const bool deleteObject = true)
{
lock.enter();
ObjectClass** e = this->elements;
@@ -473,9 +473,9 @@ public:
@param deleteObjects whether to delete the objects that get removed
@see remove, removeObject
*/
void removeRange (int startIndex,
const int numberToRemove,
const bool deleteObjects = true)
void JUCE_CALLTYPE removeRange (int startIndex,
const int numberToRemove,
const bool deleteObjects = true)
{
lock.enter();
const int endIndex = jlimit (0, numUsed, startIndex + numberToRemove);
@@ -516,8 +516,8 @@ public:
@param deleteObjects whether to also delete the objects that are removed
@see remove, removeObject, removeRange
*/
void removeLast (int howManyToRemove = 1,
const bool deleteObjects = true)
void JUCE_CALLTYPE removeLast (int howManyToRemove = 1,
const bool deleteObjects = true)
{
lock.enter();
@@ -539,8 +539,8 @@ public:
If either of the indexes passed in is out-of-range, nothing will happen,
otherwise the two objects at these positions will be exchanged.
*/
void swap (const int index1,
const int index2) throw()
void JUCE_CALLTYPE swap (const int index1,
const int index2) throw()
{
lock.enter();
@@ -567,8 +567,8 @@ public:
@param newIndex the index at which you'd like this object to end up. If this
is less than zero, it will be moved to the end of the array
*/
void move (const int currentIndex,
int newIndex) throw()
void JUCE_CALLTYPE move (const int currentIndex,
int newIndex) throw()
{
if (currentIndex != newIndex)
{
@@ -607,7 +607,7 @@ public:
because it just swaps their internal pointers.
*/
template <class OtherArrayType>
void swapWithArray (OtherArrayType& otherArray) throw()
void JUCE_CALLTYPE swapWithArray (OtherArrayType& otherArray) throw()
{
lock.enter();
otherArray.lock.enter();
@@ -625,7 +625,7 @@ public:
removing elements, they may have quite a lot of unused space allocated.
This method will reduce the amount of allocated storage to a minimum.
*/
void minimiseStorageOverheads() throw()
void JUCE_CALLTYPE minimiseStorageOverheads() throw()
{
lock.enter();
@@ -650,7 +650,7 @@ public:
the array won't have to keep dynamically resizing itself as the elements
are added, and it'll therefore be more efficient.
*/
void ensureStorageAllocated (const int minNumElements) throw()
void JUCE_CALLTYPE ensureStorageAllocated (const int minNumElements) throw()
{
this->ensureAllocatedSize (minNumElements);
}
@@ -682,8 +682,8 @@ public:
@see sortArray
*/
template <class ElementComparator>
void sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const throw()
void JUCE_CALLTYPE sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const throw()
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
@@ -701,7 +701,7 @@ public:
@see unlockArray
*/
void lockArray() const throw()
void JUCE_CALLTYPE lockArray() const throw()
{
lock.enter();
}
@@ -713,7 +713,7 @@ public:
@see lockArray
*/
void unlockArray() const throw()
void JUCE_CALLTYPE unlockArray() const throw()
{
lock.exit();
}


+ 37
- 37
src/juce_core/containers/juce_ReferenceCountedArray.h View File

@@ -61,14 +61,14 @@ public:
@see ReferenceCountedObject, ArrayAllocationBase, Array, OwnedArray
*/
ReferenceCountedArray (const int granularity = juceDefaultArrayGranularity) throw()
JUCE_CALLTYPE ReferenceCountedArray (const int granularity = juceDefaultArrayGranularity) throw()
: ArrayAllocationBase <ObjectClass*> (granularity),
numUsed (0)
{
}
/** Creates a copy of another array */
ReferenceCountedArray (const ReferenceCountedArray<ObjectClass>& other) throw()
JUCE_CALLTYPE ReferenceCountedArray (const ReferenceCountedArray<ObjectClass>& other) throw()
: ArrayAllocationBase <ObjectClass*> (other.granularity),
numUsed (other.numUsed)
{
@@ -84,7 +84,7 @@ public:
Any existing objects in this array will first be released.
*/
const ReferenceCountedArray<ObjectClass>& operator= (const ReferenceCountedArray<ObjectClass>& other) throw()
const ReferenceCountedArray<ObjectClass>& JUCE_CALLTYPE operator= (const ReferenceCountedArray<ObjectClass>& other) throw()
{
if (this != &other)
{
@@ -108,7 +108,7 @@ public:
Any objects in the array will be released, and may be deleted if not referenced from elsewhere.
*/
~ReferenceCountedArray()
JUCE_CALLTYPE ~ReferenceCountedArray()
{
clear();
}
@@ -118,7 +118,7 @@ public:
Any objects in the array that are not referenced from elsewhere will be deleted.
*/
void clear()
void JUCE_CALLTYPE clear()
{
while (numUsed > 0)
if (this->elements [--numUsed] != 0)
@@ -129,7 +129,7 @@ public:
}
/** Returns the current number of objects in the array. */
inline int size() const throw()
inline int JUCE_CALLTYPE size() const throw()
{
return numUsed;
}
@@ -142,7 +142,7 @@ public:
@see getUnchecked
*/
inline ObjectClass* operator[] (const int index) const throw()
inline ObjectClass* JUCE_CALLTYPE operator[] (const int index) const throw()
{
return (index >= 0 && index < numUsed) ? this->elements [index]
: (ObjectClass*) 0;
@@ -153,7 +153,7 @@ public:
This is a faster and less safe version of operator[] which doesn't check the index passed in, so
it can be used when you're sure the index if always going to be legal.
*/
inline ObjectClass* getUnchecked (const int index) const throw()
inline ObjectClass* JUCE_CALLTYPE getUnchecked (const int index) const throw()
{
jassert (index >= 0 && index < numUsed);
return this->elements [index];
@@ -164,7 +164,7 @@ public:
This will return a null pointer if the array's empty.
@see getLast
*/
inline ObjectClass* getFirst() const throw()
inline ObjectClass* JUCE_CALLTYPE getFirst() const throw()
{
return (numUsed > 0) ? this->elements [0]
: (ObjectClass*) 0;
@@ -175,7 +175,7 @@ public:
This will return a null pointer if the array's empty.
@see getFirst
*/
inline ObjectClass* getLast() const throw()
inline ObjectClass* JUCE_CALLTYPE getLast() const throw()
{
return (numUsed > 0) ? this->elements [numUsed - 1]
: (ObjectClass*) 0;
@@ -187,7 +187,7 @@ public:
@param objectToLookFor the object to look for
@returns the index at which the object was found, or -1 if it's not found
*/
int indexOf (const ObjectClass* const objectToLookFor) const throw()
int JUCE_CALLTYPE indexOf (const ObjectClass* const objectToLookFor) const throw()
{
ObjectClass** e = this->elements;
@@ -207,7 +207,7 @@ public:
@param objectToLookFor the object to look for
@returns true if the object is in the array
*/
bool contains (const ObjectClass* const objectToLookFor) const throw()
bool JUCE_CALLTYPE contains (const ObjectClass* const objectToLookFor) const throw()
{
ObjectClass** e = this->elements;
@@ -229,7 +229,7 @@ public:
@param newObject the new object to add to the array
@see set, insert, addIfNotAlreadyThere, addSorted, addArray
*/
void add (ObjectClass* const newObject) throw()
void JUCE_CALLTYPE add (ObjectClass* const newObject) throw()
{
this->ensureAllocatedSize (numUsed + 1);
this->elements [numUsed++] = newObject;
@@ -251,8 +251,8 @@ public:
@param newObject the new object to add to the array
@see add, addSorted, addIfNotAlreadyThere, set
*/
void insert (int indexToInsertAt,
ObjectClass* const newObject) throw()
void JUCE_CALLTYPE insert (int indexToInsertAt,
ObjectClass* const newObject) throw()
{
if (indexToInsertAt >= 0)
{
@@ -287,7 +287,7 @@ public:
@param newObject the new object to add to the array
*/
void addIfNotAlreadyThere (ObjectClass* const newObject) throw()
void JUCE_CALLTYPE addIfNotAlreadyThere (ObjectClass* const newObject) throw()
{
if (! contains (newObject))
add (newObject);
@@ -305,8 +305,8 @@ public:
@param newObject the new value to set for this index.
@see add, insert, remove
*/
void set (const int indexToChange,
ObjectClass* const newObject)
void JUCE_CALLTYPE set (const int indexToChange,
ObjectClass* const newObject)
{
if (indexToChange >= 0)
{
@@ -337,9 +337,9 @@ public:
all available elements will be copied.
@see add
*/
void addArray (const ReferenceCountedArray<ObjectClass>& arrayToAddFrom,
int startIndex = 0,
int numElementsToAdd = -1) throw()
void JUCE_CALLTYPE addArray (const ReferenceCountedArray<ObjectClass>& arrayToAddFrom,
int startIndex = 0,
int numElementsToAdd = -1) throw()
{
if (startIndex < 0)
{
@@ -371,8 +371,8 @@ public:
@see add, sort
*/
template <class ElementComparator>
void addSorted (ElementComparator& comparator,
ObjectClass* newObject) throw()
void JUCE_CALLTYPE addSorted (ElementComparator& comparator,
ObjectClass* newObject) throw()
{
insert (findInsertIndexInSortedArray (comparator, this->elements, newObject, 0, numUsed), newObject);
}
@@ -391,7 +391,7 @@ public:
@param indexToRemove the index of the element to remove
@see removeObject, removeRange
*/
void remove (const int indexToRemove)
void JUCE_CALLTYPE remove (const int indexToRemove)
{
if (indexToRemove >= 0 && indexToRemove < numUsed)
{
@@ -419,7 +419,7 @@ public:
@param objectToRemove the object to try to remove
@see remove, removeRange
*/
void removeObject (ObjectClass* const objectToRemove)
void JUCE_CALLTYPE removeObject (ObjectClass* const objectToRemove)
{
remove (indexOf (objectToRemove));
}
@@ -439,8 +439,8 @@ public:
@param numberToRemove how many objects should be removed
@see remove, removeObject
*/
void removeRange (const int startIndex,
const int numberToRemove)
void JUCE_CALLTYPE removeRange (const int startIndex,
const int numberToRemove)
{
const int start = jlimit (0, numUsed, startIndex);
const int end = jlimit (0, numUsed, startIndex + numberToRemove);
@@ -481,7 +481,7 @@ public:
@param howManyToRemove how many objects to remove from the end of the array
@see remove, removeObject, removeRange
*/
void removeLast (int howManyToRemove = 1)
void JUCE_CALLTYPE removeLast (int howManyToRemove = 1)
{
if (howManyToRemove > numUsed)
howManyToRemove = numUsed;
@@ -495,8 +495,8 @@ public:
If either of the indexes passed in is out-of-range, nothing will happen,
otherwise the two objects at these positions will be exchanged.
*/
void swap (const int index1,
const int index2) throw()
void JUCE_CALLTYPE swap (const int index1,
const int index2) throw()
{
if (index1 >= 0 && index1 < numUsed
&& index2 >= 0 && index2 < numUsed)
@@ -519,8 +519,8 @@ public:
@param newIndex the index at which you'd like this object to end up. If this
is less than zero, it will be moved to the end of the array
*/
void move (const int currentIndex,
int newIndex) throw()
void JUCE_CALLTYPE move (const int currentIndex,
int newIndex) throw()
{
if (currentIndex != newIndex)
{
@@ -554,7 +554,7 @@ public:
@returns true only if the other array contains the same objects in the same order
*/
bool operator== (const ReferenceCountedArray<ObjectClass>& other) const throw()
bool JUCE_CALLTYPE operator== (const ReferenceCountedArray<ObjectClass>& other) const throw()
{
if (numUsed != other.numUsed)
return false;
@@ -570,7 +570,7 @@ public:
@see operator==
*/
bool operator!= (const ReferenceCountedArray<ObjectClass>& other) const throw()
bool JUCE_CALLTYPE operator!= (const ReferenceCountedArray<ObjectClass>& other) const throw()
{
return ! operator== (other);
}
@@ -603,8 +603,8 @@ public:
@see sortArray
*/
template <class ElementComparator>
void sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const throw()
void JUCE_CALLTYPE sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const throw()
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
@@ -618,7 +618,7 @@ public:
removing elements, they may have quite a lot of unused space allocated.
This method will reduce the amount of allocated storage to a minimum.
*/
void minimiseStorageOverheads() throw()
void JUCE_CALLTYPE minimiseStorageOverheads() throw()
{
if (numUsed == 0)
{


+ 15
- 15
src/juce_core/containers/juce_ReferenceCountedObject.h View File

@@ -72,7 +72,7 @@ public:
This is done automatically by the smart pointer, but is public just
in case it's needed for nefarious purposes.
*/
inline void incReferenceCount() throw()
inline void JUCE_CALLTYPE incReferenceCount() throw()
{
atomicIncrement (refCounts);
@@ -83,7 +83,7 @@ public:
If the count gets to zero, the object will be deleted.
*/
inline void decReferenceCount() throw()
inline void JUCE_CALLTYPE decReferenceCount() throw()
{
jassert (refCounts > 0);
@@ -92,7 +92,7 @@ public:
}
/** Returns the object's current reference count. */
inline int getReferenceCount() const throw()
inline int JUCE_CALLTYPE getReferenceCount() const throw()
{
return refCounts;
}
@@ -101,13 +101,13 @@ public:
protected:
//==============================================================================
/** Creates the reference-counted object (with an initial ref count of zero). */
ReferenceCountedObject()
JUCE_CALLTYPE ReferenceCountedObject()
: refCounts (0)
{
}
/** Destructor. */
virtual ~ReferenceCountedObject()
virtual JUCE_CALLTYPE ~ReferenceCountedObject()
{
// it's dangerous to delete an object that's still referenced by something else!
jassert (refCounts == 0);
@@ -137,7 +137,7 @@ class ReferenceCountedObjectPtr
public:
//==============================================================================
/** Creates a pointer to a null object. */
inline ReferenceCountedObjectPtr() throw()
inline JUCE_CALLTYPE ReferenceCountedObjectPtr() throw()
: referencedObject (0)
{
}
@@ -146,7 +146,7 @@ public:
This will increment the object's reference-count if it is non-null.
*/
inline ReferenceCountedObjectPtr (ReferenceCountedObjectClass* const refCountedObject) throw()
inline JUCE_CALLTYPE ReferenceCountedObjectPtr (ReferenceCountedObjectClass* const refCountedObject) throw()
: referencedObject (refCountedObject)
{
if (refCountedObject != 0)
@@ -157,7 +157,7 @@ public:
This will increment the object's reference-count (if it is non-null).
*/
inline ReferenceCountedObjectPtr (const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& other) throw()
inline JUCE_CALLTYPE ReferenceCountedObjectPtr (const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& other) throw()
: referencedObject (other.referencedObject)
{
if (referencedObject != 0)
@@ -169,7 +169,7 @@ public:
The reference count of the old object is decremented, and it might be
deleted if it hits zero. The new object's count is incremented.
*/
const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& operator= (const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& other)
const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& JUCE_CALLTYPE operator= (const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& other)
{
ReferenceCountedObjectClass* const newObject = other.referencedObject;
@@ -192,7 +192,7 @@ public:
The reference count of the old object is decremented, and it might be
deleted if it hits zero. The new object's count is incremented.
*/
const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& operator= (ReferenceCountedObjectClass* const newObject)
const ReferenceCountedObjectPtr<ReferenceCountedObjectClass>& JUCE_CALLTYPE operator= (ReferenceCountedObjectClass* const newObject)
{
if (referencedObject != newObject)
{
@@ -213,7 +213,7 @@ public:
This will decrement the object's reference-count, and may delete it if it
gets to zero.
*/
inline ~ReferenceCountedObjectPtr()
inline JUCE_CALLTYPE ~ReferenceCountedObjectPtr()
{
if (referencedObject != 0)
referencedObject->decReferenceCount();
@@ -223,25 +223,25 @@ public:
The pointer returned may be zero, of course.
*/
inline operator ReferenceCountedObjectClass*() const throw()
inline JUCE_CALLTYPE operator ReferenceCountedObjectClass*() const throw()
{
return referencedObject;
}
/** Returns true if this pointer refers to the given object. */
inline bool operator== (ReferenceCountedObjectClass* const object) const throw()
inline bool JUCE_CALLTYPE operator== (ReferenceCountedObjectClass* const object) const throw()
{
return referencedObject == object;
}
/** Returns true if this pointer doesn't refer to the given object. */
inline bool operator!= (ReferenceCountedObjectClass* const object) const throw()
inline bool JUCE_CALLTYPE operator!= (ReferenceCountedObjectClass* const object) const throw()
{
return referencedObject != object;
}
// the -> operator is called on the referenced object
inline ReferenceCountedObjectClass* operator->() const throw()
inline ReferenceCountedObjectClass* JUCE_CALLTYPE operator->() const throw()
{
return referencedObject;
}


+ 29
- 29
src/juce_core/containers/juce_SortedSet.h View File

@@ -72,7 +72,7 @@ public:
@see ArrayAllocationBase
*/
SortedSet (const int granularity = juceDefaultArrayGranularity) throw()
JUCE_CALLTYPE SortedSet (const int granularity = juceDefaultArrayGranularity) throw()
: ArrayAllocationBase <ElementType> (granularity),
numUsed (0)
{
@@ -81,7 +81,7 @@ public:
/** Creates a copy of another set.
@param other the set to copy
*/
SortedSet (const SortedSet<ElementType, TypeOfCriticalSectionToUse>& other) throw()
JUCE_CALLTYPE SortedSet (const SortedSet<ElementType, TypeOfCriticalSectionToUse>& other) throw()
: ArrayAllocationBase <ElementType> (other.granularity)
{
other.lockSet();
@@ -92,14 +92,14 @@ public:
}
/** Destructor. */
~SortedSet() throw()
JUCE_CALLTYPE ~SortedSet() throw()
{
}
/** Copies another set over this one.
@param other the set to copy
*/
const SortedSet <ElementType, TypeOfCriticalSectionToUse>& operator= (const SortedSet <ElementType, TypeOfCriticalSectionToUse>& other) throw()
const SortedSet <ElementType, TypeOfCriticalSectionToUse>& JUCE_CALLTYPE operator= (const SortedSet <ElementType, TypeOfCriticalSectionToUse>& other) throw()
{
if (this != &other)
{
@@ -127,7 +127,7 @@ public:
@param other the other set to compare with
*/
bool operator== (const SortedSet<ElementType>& other) const throw()
bool JUCE_CALLTYPE operator== (const SortedSet<ElementType>& other) const throw()
{
lock.enter();
@@ -157,7 +157,7 @@ public:
@param other the other set to compare with
*/
bool operator!= (const SortedSet<ElementType>& other) const throw()
bool JUCE_CALLTYPE operator!= (const SortedSet<ElementType>& other) const throw()
{
return ! operator== (other);
}
@@ -171,7 +171,7 @@ public:
@see clearQuick
*/
void clear() throw()
void JUCE_CALLTYPE clear() throw()
{
lock.enter();
this->setAllocatedSize (0);
@@ -183,7 +183,7 @@ public:
@see clear
*/
void clearQuick() throw()
void JUCE_CALLTYPE clearQuick() throw()
{
lock.enter();
numUsed = 0;
@@ -193,7 +193,7 @@ public:
//==============================================================================
/** Returns the current number of elements in the set.
*/
inline int size() const throw()
inline int JUCE_CALLTYPE size() const throw()
{
return numUsed;
}
@@ -209,7 +209,7 @@ public:
@param index the index of the element being requested (0 is the first element in the set)
@see getUnchecked, getFirst, getLast
*/
inline ElementType operator[] (const int index) const throw()
inline ElementType JUCE_CALLTYPE operator[] (const int index) const throw()
{
lock.enter();
const ElementType result = (index >= 0 && index < numUsed) ? this->elements [index]
@@ -227,7 +227,7 @@ public:
@param index the index of the element being requested (0 is the first element in the set)
@see operator[], getFirst, getLast
*/
inline ElementType getUnchecked (const int index) const throw()
inline ElementType JUCE_CALLTYPE getUnchecked (const int index) const throw()
{
lock.enter();
jassert (index >= 0 && index < numUsed);
@@ -241,7 +241,7 @@ public:
@see operator[], getUnchecked, getLast
*/
inline ElementType getFirst() const throw()
inline ElementType JUCE_CALLTYPE getFirst() const throw()
{
lock.enter();
const ElementType result = (numUsed > 0) ? this->elements [0]
@@ -255,7 +255,7 @@ public:
@see operator[], getUnchecked, getFirst
*/
inline ElementType getLast() const throw()
inline ElementType JUCE_CALLTYPE getLast() const throw()
{
lock.enter();
const ElementType result = (numUsed > 0) ? this->elements [numUsed - 1]
@@ -274,7 +274,7 @@ public:
@param elementToLookFor the value or object to look for
@returns the index of the object, or -1 if it's not found
*/
int indexOf (const ElementType elementToLookFor) const throw()
int JUCE_CALLTYPE indexOf (const ElementType elementToLookFor) const throw()
{
lock.enter();
@@ -315,7 +315,7 @@ public:
@param elementToLookFor the value or object to look for
@returns true if the item is found
*/
bool contains (const ElementType elementToLookFor) const throw()
bool JUCE_CALLTYPE contains (const ElementType elementToLookFor) const throw()
{
lock.enter();
@@ -357,7 +357,7 @@ public:
@param newElement the new object to add to the set
@see set, insert, addIfNotAlreadyThere, addSorted, addSet, addArray
*/
void add (const ElementType newElement) throw()
void JUCE_CALLTYPE add (const ElementType newElement) throw()
{
lock.enter();
@@ -405,8 +405,8 @@ public:
@param numElementsToAdd how many elements are in this other array
@see add
*/
void addArray (const ElementType* elementsToAdd,
int numElementsToAdd) throw()
void JUCE_CALLTYPE addArray (const ElementType* elementsToAdd,
int numElementsToAdd) throw()
{
lock.enter();
@@ -426,9 +426,9 @@ public:
@see add
*/
template <class OtherSetType>
void addSet (const OtherSetType& setToAddFrom,
int startIndex = 0,
int numElementsToAdd = -1) throw()
void JUCE_CALLTYPE addSet (const OtherSetType& setToAddFrom,
int startIndex = 0,
int numElementsToAdd = -1) throw()
{
setToAddFrom.lockSet();
lock.enter();
@@ -463,7 +463,7 @@ public:
@returns the element that has been removed
@see removeValue, removeRange
*/
ElementType remove (const int indexToRemove) throw()
ElementType JUCE_CALLTYPE remove (const int indexToRemove) throw()
{
lock.enter();
@@ -498,7 +498,7 @@ public:
@param valueToRemove the object to try to remove
@see remove, removeRange
*/
void removeValue (const ElementType valueToRemove) throw()
void JUCE_CALLTYPE removeValue (const ElementType valueToRemove) throw()
{
lock.enter();
remove (indexOf (valueToRemove));
@@ -511,7 +511,7 @@ public:
@see removeValuesNotIn, remove, removeValue, removeRange
*/
template <class OtherSetType>
void removeValuesIn (const OtherSetType& otherSet) throw()
void JUCE_CALLTYPE removeValuesIn (const OtherSetType& otherSet) throw()
{
otherSet.lockSet();
lock.enter();
@@ -542,7 +542,7 @@ public:
@see removeValuesIn, remove, removeValue, removeRange
*/
template <class OtherSetType>
void removeValuesNotIn (const OtherSetType& otherSet) throw()
void JUCE_CALLTYPE removeValuesNotIn (const OtherSetType& otherSet) throw()
{
otherSet.lockSet();
lock.enter();
@@ -572,7 +572,7 @@ public:
removing elements, they may have quite a lot of unused space allocated.
This method will reduce the amount of allocated storage to a minimum.
*/
void minimiseStorageOverheads() throw()
void JUCE_CALLTYPE minimiseStorageOverheads() throw()
{
lock.enter();
@@ -599,7 +599,7 @@ public:
@see unlockSet
*/
void lockSet() const throw()
void JUCE_CALLTYPE lockSet() const throw()
{
lock.enter();
}
@@ -611,7 +611,7 @@ public:
@see lockSet
*/
void unlockSet() const throw()
void JUCE_CALLTYPE unlockSet() const throw()
{
lock.exit();
}
@@ -624,7 +624,7 @@ private:
int numUsed;
TypeOfCriticalSectionToUse lock;
void insertInternal (const int indexToInsertAt, const ElementType newElement) throw()
void JUCE_CALLTYPE insertInternal (const int indexToInsertAt, const ElementType newElement) throw()
{
this->ensureAllocatedSize (numUsed + 1);


+ 101
- 101
src/juce_core/io/files/juce_File.cpp View File

@@ -53,50 +53,50 @@ BEGIN_JUCE_NAMESPACE
#endif
//==============================================================================
void* juce_fileOpen (const String& path, bool forWriting);
void juce_fileClose (void* handle);
int juce_fileWrite (void* handle, void* buffer, int size);
int64 juce_fileGetPosition (void* handle);
int64 juce_fileSetPosition (void* handle, int64 pos);
void juce_fileFlush (void* handle);
bool juce_fileExists (const String& fileName, const bool dontCountDirectories);
bool juce_isDirectory (const String& fileName);
int64 juce_getFileSize (const String& fileName);
bool juce_canWriteToFile (const String& fileName);
bool juce_setFileReadOnly (const String& fileName, bool isReadOnly);
void juce_getFileTimes (const String& fileName, int64& modificationTime, int64& accessTime, int64& creationTime);
bool juce_setFileTimes (const String& fileName, int64 modificationTime, int64 accessTime, int64 creationTime);
bool juce_deleteFile (const String& fileName);
bool juce_copyFile (const String& source, const String& dest);
bool juce_moveFile (const String& source, const String& dest);
void* juce_fileOpen (const String& path, bool forWriting) throw();
void juce_fileClose (void* handle) throw();
int juce_fileWrite (void* handle, void* buffer, int size) throw();
int64 juce_fileGetPosition (void* handle) throw();
int64 juce_fileSetPosition (void* handle, int64 pos) throw();
void juce_fileFlush (void* handle) throw();
bool juce_fileExists (const String& fileName, const bool dontCountDirectories) throw();
bool juce_isDirectory (const String& fileName) throw();
int64 juce_getFileSize (const String& fileName) throw();
bool juce_canWriteToFile (const String& fileName) throw();
bool juce_setFileReadOnly (const String& fileName, bool isReadOnly) throw();
void juce_getFileTimes (const String& fileName, int64& modificationTime, int64& accessTime, int64& creationTime) throw();
bool juce_setFileTimes (const String& fileName, int64 modificationTime, int64 accessTime, int64 creationTime) throw();
bool juce_deleteFile (const String& fileName) throw();
bool juce_copyFile (const String& source, const String& dest) throw();
bool juce_moveFile (const String& source, const String& dest) throw();
// this must also create all paths involved in the directory.
void juce_createDirectory (const String& fileName);
void juce_createDirectory (const String& fileName) throw();
bool juce_launchFile (const String& fileName, const String& parameters);
bool juce_launchFile (const String& fileName, const String& parameters) throw();
const StringArray juce_getFileSystemRoots();
const String juce_getVolumeLabel (const String& filenameOnVolume, int& volumeSerialNumber);
const StringArray juce_getFileSystemRoots() throw();
const String juce_getVolumeLabel (const String& filenameOnVolume, int& volumeSerialNumber) throw();
// starts a directory search operation with a wildcard, returning a handle for
// use in calls to juce_findFileNext.
// juce_firstResultFile gets the name of the file (not the whole pathname) and
// the other pointers, if non-null, are set based on the properties of the file.
void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile,
bool* isDirectory, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly);
bool* isDirectory, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly) throw();
// returns false when no more files are found
bool juce_findFileNext (void* handle, String& resultFile,
bool* isDirectory, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly);
bool* isDirectory, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly) throw();
void juce_findFileClose (void* handle);
void juce_findFileClose (void* handle) throw();
//==============================================================================
static const String parseAbsolutePath (String path) throw()
static const String JUCE_CALLTYPE parseAbsolutePath (String path) throw()
{
if (path.isEmpty())
return String::empty;
@@ -192,28 +192,28 @@ const File File::nonexistent;
//==============================================================================
File::File (const String& fullPathName) throw()
JUCE_CALLTYPE File::File (const String& fullPathName) throw()
: fullPath (parseAbsolutePath (fullPathName))
{
}
File::File (const String& path, int) throw()
JUCE_CALLTYPE File::File (const String& path, int) throw()
: fullPath (path)
{
}
File::File (const File& other) throw()
JUCE_CALLTYPE File::File (const File& other) throw()
: fullPath (other.fullPath)
{
}
const File& File::operator= (const String& newPath) throw()
const File& JUCE_CALLTYPE File::operator= (const String& newPath) throw()
{
fullPath = parseAbsolutePath (newPath);
return *this;
}
const File& File::operator= (const File& other) throw()
const File& JUCE_CALLTYPE File::operator= (const File& other) throw()
{
fullPath = other.fullPath;
return *this;
@@ -224,7 +224,7 @@ const File& File::operator= (const File& other) throw()
#define NAMES_ARE_CASE_SENSITIVE 1
#endif
bool File::areFileNamesCaseSensitive()
bool JUCE_CALLTYPE File::areFileNamesCaseSensitive()
{
#if NAMES_ARE_CASE_SENSITIVE
return true;
@@ -233,7 +233,7 @@ bool File::areFileNamesCaseSensitive()
#endif
}
bool File::operator== (const File& other) const throw()
bool JUCE_CALLTYPE File::operator== (const File& other) const throw()
{
// case-insensitive on Windows, but not on linux.
#if NAMES_ARE_CASE_SENSITIVE
@@ -243,28 +243,28 @@ bool File::operator== (const File& other) const throw()
#endif
}
bool File::operator!= (const File& other) const throw()
bool JUCE_CALLTYPE File::operator!= (const File& other) const throw()
{
return ! operator== (other);
}
//==============================================================================
bool File::exists() const throw()
bool JUCE_CALLTYPE File::exists() const throw()
{
return juce_fileExists (fullPath, false);
}
bool File::existsAsFile() const throw()
bool JUCE_CALLTYPE File::existsAsFile() const throw()
{
return juce_fileExists (fullPath, true);
}
bool File::isDirectory() const throw()
bool JUCE_CALLTYPE File::isDirectory() const throw()
{
return juce_isDirectory (fullPath);
}
bool File::hasWriteAccess() const throw()
bool JUCE_CALLTYPE File::hasWriteAccess() const throw()
{
if (exists())
return juce_canWriteToFile (fullPath);
@@ -282,8 +282,8 @@ bool File::hasWriteAccess() const throw()
#endif
}
bool File::setReadOnly (const bool shouldBeReadOnly,
const bool applyRecursively) const throw()
bool JUCE_CALLTYPE File::setReadOnly (const bool shouldBeReadOnly,
const bool applyRecursively) const throw()
{
bool worked = true;
@@ -299,13 +299,13 @@ bool File::setReadOnly (const bool shouldBeReadOnly,
return juce_setFileReadOnly (fullPath, shouldBeReadOnly) && worked;
}
bool File::deleteFile() const throw()
bool JUCE_CALLTYPE File::deleteFile() const throw()
{
return (! exists())
|| juce_deleteFile (fullPath);
}
bool File::deleteRecursively() const throw()
bool JUCE_CALLTYPE File::deleteRecursively() const throw()
{
bool worked = true;
@@ -321,7 +321,7 @@ bool File::deleteRecursively() const throw()
return deleteFile() && worked;
}
bool File::moveFileTo (const File& newFile) const throw()
bool JUCE_CALLTYPE File::moveFileTo (const File& newFile) const throw()
{
if (newFile.fullPath == fullPath)
return true;
@@ -335,7 +335,7 @@ bool File::moveFileTo (const File& newFile) const throw()
return juce_moveFile (fullPath, newFile.fullPath);
}
bool File::copyFileTo (const File& newFile) const throw()
bool JUCE_CALLTYPE File::copyFileTo (const File& newFile) const throw()
{
if (*this == newFile)
return true;
@@ -346,7 +346,7 @@ bool File::copyFileTo (const File& newFile) const throw()
return juce_copyFile (fullPath, newFile.fullPath);
}
bool File::copyDirectoryTo (const File& newDirectory) const throw()
bool JUCE_CALLTYPE File::copyDirectoryTo (const File& newDirectory) const throw()
{
if (isDirectory() && newDirectory.createDirectory())
{
@@ -372,7 +372,7 @@ bool File::copyDirectoryTo (const File& newDirectory) const throw()
}
//==============================================================================
const String File::getPathUpToLastSlash() const throw()
const String JUCE_CALLTYPE File::getPathUpToLastSlash() const throw()
{
const int lastSlash = fullPath.lastIndexOfChar (separator);
@@ -384,28 +384,28 @@ const String File::getPathUpToLastSlash() const throw()
return fullPath;
}
const File File::getParentDirectory() const throw()
const File JUCE_CALLTYPE File::getParentDirectory() const throw()
{
return File (getPathUpToLastSlash());
}
//==============================================================================
const String File::getFileName() const throw()
const String JUCE_CALLTYPE File::getFileName() const throw()
{
return fullPath.substring (fullPath.lastIndexOfChar (separator) + 1);
}
int File::hashCode() const throw()
int JUCE_CALLTYPE File::hashCode() const throw()
{
return fullPath.hashCode();
}
int64 File::hashCode64() const throw()
int64 JUCE_CALLTYPE File::hashCode64() const throw()
{
return fullPath.hashCode64();
}
const String File::getFileNameWithoutExtension() const throw()
const String JUCE_CALLTYPE File::getFileNameWithoutExtension() const throw()
{
const int lastSlash = fullPath.lastIndexOfChar (separator) + 1;
const int lastDot = fullPath.lastIndexOfChar (T('.'));
@@ -416,7 +416,7 @@ const String File::getFileNameWithoutExtension() const throw()
return fullPath.substring (lastSlash);
}
bool File::isAChildOf (const File& potentialParent) const throw()
bool JUCE_CALLTYPE File::isAChildOf (const File& potentialParent) const throw()
{
const String ourPath (getPathUpToLastSlash());
@@ -439,7 +439,7 @@ bool File::isAChildOf (const File& potentialParent) const throw()
}
//==============================================================================
const File File::getChildFile (String relativePath) const throw()
const File JUCE_CALLTYPE File::getChildFile (String relativePath) const throw()
{
if (relativePath.startsWithChar (T('/'))
|| relativePath.startsWithChar (T('\\'))
@@ -499,18 +499,18 @@ const File File::getChildFile (String relativePath) const throw()
}
}
const File File::getSiblingFile (const String& fileName) const throw()
const File JUCE_CALLTYPE File::getSiblingFile (const String& fileName) const throw()
{
return getParentDirectory().getChildFile (fileName);
}
//==============================================================================
int64 File::getSize() const throw()
int64 JUCE_CALLTYPE File::getSize() const throw()
{
return juce_getFileSize (fullPath);
}
const String File::descriptionOfSizeInBytes (const int64 bytes)
const String JUCE_CALLTYPE File::descriptionOfSizeInBytes (const int64 bytes)
{
if (bytes == 1)
{
@@ -535,7 +535,7 @@ const String File::descriptionOfSizeInBytes (const int64 bytes)
}
//==============================================================================
bool File::create() const throw()
bool JUCE_CALLTYPE File::create() const throw()
{
if (! exists())
{
@@ -555,7 +555,7 @@ bool File::create() const throw()
return true;
}
bool File::createDirectory() const throw()
bool JUCE_CALLTYPE File::createDirectory() const throw()
{
if (! isDirectory())
{
@@ -578,44 +578,44 @@ bool File::createDirectory() const throw()
}
//==============================================================================
const Time File::getCreationTime() const throw()
const Time JUCE_CALLTYPE File::getCreationTime() const throw()
{
int64 m, a, c;
juce_getFileTimes (fullPath, m, a, c);
return Time (c);
}
bool File::setCreationTime (const Time& t) const throw()
bool JUCE_CALLTYPE File::setCreationTime (const Time& t) const throw()
{
return juce_setFileTimes (fullPath, 0, 0, t.toMilliseconds());
}
const Time File::getLastModificationTime() const throw()
const Time JUCE_CALLTYPE File::getLastModificationTime() const throw()
{
int64 m, a, c;
juce_getFileTimes (fullPath, m, a, c);
return Time (m);
}
bool File::setLastModificationTime (const Time& t) const throw()
bool JUCE_CALLTYPE File::setLastModificationTime (const Time& t) const throw()
{
return juce_setFileTimes (fullPath, t.toMilliseconds(), 0, 0);
}
const Time File::getLastAccessTime() const throw()
const Time JUCE_CALLTYPE File::getLastAccessTime() const throw()
{
int64 m, a, c;
juce_getFileTimes (fullPath, m, a, c);
return Time (a);
}
bool File::setLastAccessTime (const Time& t) const throw()
bool JUCE_CALLTYPE File::setLastAccessTime (const Time& t) const throw()
{
return juce_setFileTimes (fullPath, 0, t.toMilliseconds(), 0);
}
//==============================================================================
bool File::loadFileAsData (MemoryBlock& destBlock) const throw()
bool JUCE_CALLTYPE File::loadFileAsData (MemoryBlock& destBlock) const throw()
{
if (! existsAsFile())
return false;
@@ -624,7 +624,7 @@ bool File::loadFileAsData (MemoryBlock& destBlock) const throw()
return getSize() == in.readIntoMemoryBlock (destBlock);
}
const String File::loadFileAsString() const throw()
const String JUCE_CALLTYPE File::loadFileAsString() const throw()
{
if (! existsAsFile())
return String::empty;
@@ -644,10 +644,10 @@ static inline bool fileTypeMatches (const int whatToLookFor,
|| (whatToLookFor & File::ignoreHiddenFiles) == 0);
}
int File::findChildFiles (OwnedArray<File>& results,
const int whatToLookFor,
const bool searchRecursively,
const String& wildCardPattern) const throw()
int JUCE_CALLTYPE File::findChildFiles (OwnedArray<File>& results,
const int whatToLookFor,
const bool searchRecursively,
const String& wildCardPattern) const throw()
{
// you have to specify the type of files you're looking for!
jassert (whatToLookFor > 0 && whatToLookFor <= 3);
@@ -711,8 +711,8 @@ int File::findChildFiles (OwnedArray<File>& results,
return total;
}
int File::getNumberOfChildFiles (const int whatToLookFor,
const String& wildCardPattern) const throw()
int JUCE_CALLTYPE File::getNumberOfChildFiles (const int whatToLookFor,
const String& wildCardPattern) const throw()
{
// you have to specify the type of files you're looking for!
jassert (whatToLookFor > 0 && whatToLookFor <= 3);
@@ -755,9 +755,9 @@ int File::getNumberOfChildFiles (const int whatToLookFor,
}
//==============================================================================
const File File::getNonexistentChildFile (const String& prefix_,
const String& suffix,
bool putNumbersInBrackets) const throw()
const File JUCE_CALLTYPE File::getNonexistentChildFile (const String& prefix_,
const String& suffix,
bool putNumbersInBrackets) const throw()
{
File f (getChildFile (prefix_ + suffix));
@@ -800,7 +800,7 @@ const File File::getNonexistentChildFile (const String& prefix_,
return f;
}
const File File::getNonexistentSibling (const bool putNumbersInBrackets) const throw()
const File JUCE_CALLTYPE File::getNonexistentSibling (const bool putNumbersInBrackets) const throw()
{
if (exists())
{
@@ -816,7 +816,7 @@ const File File::getNonexistentSibling (const bool putNumbersInBrackets) const t
}
//==============================================================================
const String File::getFileExtension() const throw()
const String JUCE_CALLTYPE File::getFileExtension() const throw()
{
String ext;
@@ -831,7 +831,7 @@ const String File::getFileExtension() const throw()
return ext;
}
bool File::hasFileExtension (const String& possibleSuffix) const throw()
bool JUCE_CALLTYPE File::hasFileExtension (const String& possibleSuffix) const throw()
{
if (possibleSuffix.isEmpty())
return fullPath.lastIndexOfChar (T('.')) <= fullPath.lastIndexOfChar (separator);
@@ -850,7 +850,7 @@ bool File::hasFileExtension (const String& possibleSuffix) const throw()
return false;
}
const File File::withFileExtension (const String& newExtension) const throw()
const File JUCE_CALLTYPE File::withFileExtension (const String& newExtension) const throw()
{
if (fullPath.isEmpty())
return File::nonexistent;
@@ -870,14 +870,14 @@ const File File::withFileExtension (const String& newExtension) const throw()
}
//==============================================================================
bool File::startAsProcess (const String& parameters) const throw()
bool JUCE_CALLTYPE File::startAsProcess (const String& parameters) const throw()
{
return exists()
&& juce_launchFile (fullPath, parameters);
}
//==============================================================================
FileInputStream* File::createInputStream() const throw()
FileInputStream* JUCE_CALLTYPE File::createInputStream() const throw()
{
if (existsAsFile())
return new FileInputStream (*this);
@@ -885,7 +885,7 @@ FileInputStream* File::createInputStream() const throw()
return 0;
}
FileOutputStream* File::createOutputStream (const int bufferSize) const throw()
FileOutputStream* JUCE_CALLTYPE File::createOutputStream (const int bufferSize) const throw()
{
FileOutputStream* const out = new FileOutputStream (*this, bufferSize);
@@ -901,8 +901,8 @@ FileOutputStream* File::createOutputStream (const int bufferSize) const throw()
}
//==============================================================================
bool File::appendData (const void* const dataToAppend,
const int numberOfBytes) const throw()
bool JUCE_CALLTYPE File::appendData (const void* const dataToAppend,
const int numberOfBytes) const throw()
{
if (numberOfBytes > 0)
{
@@ -918,8 +918,8 @@ bool File::appendData (const void* const dataToAppend,
return true;
}
bool File::replaceWithData (const void* const dataToWrite,
const int numberOfBytes) const throw()
bool JUCE_CALLTYPE File::replaceWithData (const void* const dataToWrite,
const int numberOfBytes) const throw()
{
jassert (numberOfBytes >= 0); // a negative number of bytes??
@@ -938,9 +938,9 @@ bool File::replaceWithData (const void* const dataToWrite,
return false;
}
bool File::appendText (const String& text,
const bool asUnicode,
const bool writeUnicodeHeaderBytes) const throw()
bool JUCE_CALLTYPE File::appendText (const String& text,
const bool asUnicode,
const bool writeUnicodeHeaderBytes) const throw()
{
FileOutputStream* const out = createOutputStream();
@@ -955,7 +955,7 @@ bool File::appendText (const String& text,
return false;
}
bool File::printf (const tchar* pf, ...) const throw()
bool JUCE_CALLTYPE File::printf (const tchar* pf, ...) const throw()
{
va_list list;
va_start (list, pf);
@@ -966,9 +966,9 @@ bool File::printf (const tchar* pf, ...) const throw()
return appendData ((const char*) text, text.length());
}
bool File::replaceWithText (const String& textToWrite,
const bool asUnicode,
const bool writeUnicodeHeaderBytes) const throw()
bool JUCE_CALLTYPE File::replaceWithText (const String& textToWrite,
const bool asUnicode,
const bool writeUnicodeHeaderBytes) const throw()
{
const File tempFile (getSiblingFile (T(".") + getFileName()).getNonexistentSibling (false));
@@ -983,7 +983,7 @@ bool File::replaceWithText (const String& textToWrite,
}
//==============================================================================
const String File::createLegalPathName (const String& original) throw()
const String JUCE_CALLTYPE File::createLegalPathName (const String& original) throw()
{
String s (original);
String start;
@@ -998,7 +998,7 @@ const String File::createLegalPathName (const String& original) throw()
.substring (0, 1024);
}
const String File::createLegalFileName (const String& original) throw()
const String JUCE_CALLTYPE File::createLegalFileName (const String& original) throw()
{
String s (original.removeCharacters (T("\"#@,;:<>*^|?\\/")));
@@ -1024,7 +1024,7 @@ const String File::createLegalFileName (const String& original) throw()
}
//==============================================================================
const String File::getRelativePathFrom (const File& dir) const throw()
const String JUCE_CALLTYPE File::getRelativePathFrom (const File& dir) const throw()
{
String thisPath (fullPath);
@@ -1087,7 +1087,7 @@ const String File::getRelativePathFrom (const File& dir) const throw()
}
//==============================================================================
void File::findFileSystemRoots (OwnedArray<File>& destArray) throw()
void JUCE_CALLTYPE File::findFileSystemRoots (OwnedArray<File>& destArray) throw()
{
const StringArray roots (juce_getFileSystemRoots());
@@ -1095,13 +1095,13 @@ void File::findFileSystemRoots (OwnedArray<File>& destArray) throw()
destArray.add (new File (roots[i]));
}
const String File::getVolumeLabel() const throw()
const String JUCE_CALLTYPE File::getVolumeLabel() const throw()
{
int serialNum;
return juce_getVolumeLabel (fullPath, serialNum);
}
int File::getVolumeSerialNumber() const throw()
int JUCE_CALLTYPE File::getVolumeSerialNumber() const throw()
{
int serialNum;
juce_getVolumeLabel (fullPath, serialNum);
@@ -1110,7 +1110,7 @@ int File::getVolumeSerialNumber() const throw()
}
//==============================================================================
const File File::createTempFile (const String& fileNameEnding) throw()
const File JUCE_CALLTYPE File::createTempFile (const String& fileNameEnding) throw()
{
String tempName (T("temp"));
static int tempNum = 0;


+ 83
- 83
src/juce_core/io/files/juce_File.h View File

@@ -64,7 +64,7 @@ public:
You can use its operator= method to point it at a proper file.
*/
File() throw() {}
JUCE_CALLTYPE File() throw() {}
/** Creates a file from an absolute path.
@@ -76,13 +76,13 @@ public:
On the Mac/Linux, the path can include "~" notation for referring to
user home directories.
*/
File (const String& path) throw();
JUCE_CALLTYPE File (const String& path) throw();
/** Creates a copy of another file object. */
File (const File& other) throw();
JUCE_CALLTYPE File (const File& other) throw();
/** Destructor. */
~File() throw() {}
JUCE_CALLTYPE ~File() throw() {}
/** Sets the file based on an absolute pathname.
@@ -94,10 +94,10 @@ public:
On the Mac/Linux, the path can include "~" notation for referring to
user home directories.
*/
const File& operator= (const String& newFilePath) throw();
const File& JUCE_CALLTYPE operator= (const String& newFilePath) throw();
/** Copies from another file object. */
const File& operator= (const File& otherFile) throw();
const File& JUCE_CALLTYPE operator= (const File& otherFile) throw();
//==============================================================================
/** This static constant is used for referring to an 'invalid' file. */
@@ -109,7 +109,7 @@ public:
@returns true if the file exists, either as a file or a directory.
@see existsAsFile, isDirectory
*/
bool exists() const throw();
bool JUCE_CALLTYPE exists() const throw();
/** Checks whether the file exists and is a file rather than a directory.
@@ -117,7 +117,7 @@ public:
or doesn't exist
@see exists, isDirectory
*/
bool existsAsFile() const throw();
bool JUCE_CALLTYPE existsAsFile() const throw();
/** Checks whether the file is a directory that exists.
@@ -125,20 +125,20 @@ public:
false if it's a file or doesn't exist at all
@see exists, existsAsFile
*/
bool isDirectory() const throw();
bool JUCE_CALLTYPE isDirectory() const throw();
/** Returns the size of the file in bytes.
@returns the number of bytes in the file, or 0 if it doesn't exist.
*/
int64 getSize() const throw();
int64 JUCE_CALLTYPE getSize() const throw();
/** Utility function to convert a file size in bytes to a neat string description.
So for example 100 would return "100 bytes", 2000 would return "2 KB",
2000000 would produce "2 MB", etc.
*/
static const String descriptionOfSizeInBytes (const int64 bytes);
static const String JUCE_CALLTYPE descriptionOfSizeInBytes (const int64 bytes);
//==============================================================================
/** Returns the complete, absolute path of this file.
@@ -152,7 +152,7 @@ public:
@see getFileName, getRelativePathFrom
*/
const String& getFullPathName() const throw() { return fullPath; }
const String& JUCE_CALLTYPE getFullPathName() const throw() { return fullPath; }
/** Returns the last section of the pathname.
@@ -167,7 +167,7 @@ public:
@see getFullPathName, getFileNameWithoutExtension
*/
const String getFileName() const throw();
const String JUCE_CALLTYPE getFileName() const throw();
/** Creates a relative path that refers to a file relatively to a given directory.
@@ -184,7 +184,7 @@ public:
If it doesn't exist, it's assumed to be a directory.
@see getChildFile
*/
const String getRelativePathFrom (const File& directoryToBeRelativeTo) const throw();
const String JUCE_CALLTYPE getRelativePathFrom (const File& directoryToBeRelativeTo) const throw();
//==============================================================================
/** Returns the file's extension.
@@ -195,7 +195,7 @@ public:
@see hasFileExtension, withFileExtension, getFileNameWithoutExtension
*/
const String getFileExtension() const throw();
const String JUCE_CALLTYPE getFileExtension() const throw();
/** Checks whether the file has a given extension.
@@ -206,7 +206,7 @@ public:
@see getFileExtension, withFileExtension, getFileNameWithoutExtension
*/
bool hasFileExtension (const String& extensionToTest) const throw();
bool JUCE_CALLTYPE hasFileExtension (const String& extensionToTest) const throw();
/** Returns a version of this file with a different file extension.
@@ -218,7 +218,7 @@ public:
@see getFileName, getFileExtension, hasFileExtension, getFileNameWithoutExtension
*/
const File withFileExtension (const String& newExtension) const throw();
const File JUCE_CALLTYPE withFileExtension (const String& newExtension) const throw();
/** Returns the last part of the filename, without its file extension.
@@ -226,7 +226,7 @@ public:
@see getFileName, getFileExtension, hasFileExtension, withFileExtension
*/
const String getFileNameWithoutExtension() const throw();
const String JUCE_CALLTYPE getFileNameWithoutExtension() const throw();
//==============================================================================
/** Returns a 32-bit hash-code that identifies this file.
@@ -234,14 +234,14 @@ public:
This is based on the filename. Obviously it's possible, although unlikely, that
two files will have the same hash-code.
*/
int hashCode() const throw();
int JUCE_CALLTYPE hashCode() const throw();
/** Returns a 64-bit hash-code that identifies this file.
This is based on the filename. Obviously it's possible, although unlikely, that
two files will have the same hash-code.
*/
int64 hashCode64() const throw();
int64 JUCE_CALLTYPE hashCode64() const throw();
//==============================================================================
/** Returns a file based on a relative path.
@@ -257,7 +257,7 @@ public:
@see getSiblingFile, getParentDirectory, getRelativePathFrom, isAChildOf
*/
const File getChildFile (String relativePath) const throw();
const File JUCE_CALLTYPE getChildFile (String relativePath) const throw();
/** Returns a file which is in the same directory as this one.
@@ -265,14 +265,14 @@ public:
@see getChildFile, getParentDirectory
*/
const File getSiblingFile (const String& siblingFileName) const throw();
const File JUCE_CALLTYPE getSiblingFile (const String& siblingFileName) const throw();
//==============================================================================
/** Returns the directory that contains this file or directory.
e.g. for "/moose/fish/foo.txt" this will return "/moose/fish".
*/
const File getParentDirectory() const throw();
const File JUCE_CALLTYPE getParentDirectory() const throw();
/** Checks whether a file is somewhere inside a directory.
@@ -283,7 +283,7 @@ public:
e.g. File ("/moose/fish/foo.txt").isAChildOf ("/moose") is true.
File ("/moose/fish/foo.txt").isAChildOf ("/moose/fish") is also true.
*/
bool isAChildOf (const File& potentialParentDirectory) const throw();
bool JUCE_CALLTYPE isAChildOf (const File& potentialParentDirectory) const throw();
//==============================================================================
/** Chooses a filename relative to this one that doesn't already exist.
@@ -303,9 +303,9 @@ public:
format "prefix(number)suffix", if false, it will leave the
brackets out.
*/
const File getNonexistentChildFile (const String& prefix,
const String& suffix,
bool putNumbersInBrackets = true) const throw();
const File JUCE_CALLTYPE getNonexistentChildFile (const String& prefix,
const String& suffix,
bool putNumbersInBrackets = true) const throw();
/** Chooses a filename for a sibling file to this one that doesn't already exist.
@@ -316,13 +316,13 @@ public:
@param putNumbersInBrackets whether to add brackets around the numbers that
get appended to the new filename.
*/
const File getNonexistentSibling (const bool putNumbersInBrackets = true) const throw();
const File JUCE_CALLTYPE getNonexistentSibling (const bool putNumbersInBrackets = true) const throw();
//==============================================================================
/** Compares the pathnames for two files. */
bool operator== (const File& otherFile) const throw();
bool JUCE_CALLTYPE operator== (const File& otherFile) const throw();
/** Compares the pathnames for two files. */
bool operator!= (const File& otherFile) const throw();
bool JUCE_CALLTYPE operator!= (const File& otherFile) const throw();
//==============================================================================
/** Checks whether a file can be created or written to.
@@ -332,7 +332,7 @@ public:
see if writing is allowed.
@see setReadOnly
*/
bool hasWriteAccess() const throw();
bool JUCE_CALLTYPE hasWriteAccess() const throw();
/** Changes the write-permission of a file or directory.
@@ -343,8 +343,8 @@ public:
@returns true if it manages to change the file's permissions.
@see hasWriteAccess
*/
bool setReadOnly (const bool shouldBeReadOnly,
const bool applyRecursively = false) const throw();
bool JUCE_CALLTYPE setReadOnly (const bool shouldBeReadOnly,
const bool applyRecursively = false) const throw();
//==============================================================================
/** Returns the last modification time of this file.
@@ -352,21 +352,21 @@ public:
@returns the time, or an invalid time if the file doesn't exist.
@see setLastModificationTime, getLastAccessTime, getCreationTime
*/
const Time getLastModificationTime() const throw();
const Time JUCE_CALLTYPE getLastModificationTime() const throw();
/** Returns the last time this file was accessed.
@returns the time, or an invalid time if the file doesn't exist.
@see setLastAccessTime, getLastModificationTime, getCreationTime
*/
const Time getLastAccessTime() const throw();
const Time JUCE_CALLTYPE getLastAccessTime() const throw();
/** Returns the time that this file was created.
@returns the time, or an invalid time if the file doesn't exist.
@see getLastModificationTime, getLastAccessTime
*/
const Time getCreationTime() const throw();
const Time JUCE_CALLTYPE getCreationTime() const throw();
/** Changes the modification time for this file.
@@ -374,7 +374,7 @@ public:
@returns true if it manages to change the file's time.
@see getLastModificationTime, setLastAccessTime, setCreationTime
*/
bool setLastModificationTime (const Time& newTime) const throw();
bool JUCE_CALLTYPE setLastModificationTime (const Time& newTime) const throw();
/** Changes the last-access time for this file.
@@ -382,7 +382,7 @@ public:
@returns true if it manages to change the file's time.
@see getLastAccessTime, setLastModificationTime, setCreationTime
*/
bool setLastAccessTime (const Time& newTime) const throw();
bool JUCE_CALLTYPE setLastAccessTime (const Time& newTime) const throw();
/** Changes the creation date for this file.
@@ -390,7 +390,7 @@ public:
@returns true if it manages to change the file's time.
@see getCreationTime, setLastModificationTime, setLastAccessTime
*/
bool setCreationTime (const Time& newTime) const throw();
bool JUCE_CALLTYPE setCreationTime (const Time& newTime) const throw();
//==============================================================================
/** Creates an empty file if it doesn't already exist.
@@ -403,7 +403,7 @@ public:
@returns true if the file has been created (or if it already existed).
@see createDirectory
*/
bool create() const throw();
bool JUCE_CALLTYPE create() const throw();
/** Creates a new directory for this filename.
@@ -414,7 +414,7 @@ public:
already existed beforehand).
@see create
*/
bool createDirectory() const throw();
bool JUCE_CALLTYPE createDirectory() const throw();
/** Deletes a file.
@@ -425,7 +425,7 @@ public:
begin with).
@see deleteRecursively
*/
bool deleteFile() const throw();
bool JUCE_CALLTYPE deleteFile() const throw();
/** Deletes a file or directory and all its subdirectories.
@@ -436,7 +436,7 @@ public:
(or if it didn't exist to begin with).
@see deleteFile
*/
bool deleteRecursively() const throw();
bool JUCE_CALLTYPE deleteRecursively() const throw();
/** Moves or renames a file.
@@ -446,7 +446,7 @@ public:
@returns true if the operation succeeds
*/
bool moveFileTo (const File& targetLocation) const throw();
bool JUCE_CALLTYPE moveFileTo (const File& targetLocation) const throw();
/** Copies a file.
@@ -456,7 +456,7 @@ public:
@returns true if the operation succeeds
*/
bool copyFileTo (const File& targetLocation) const throw();
bool JUCE_CALLTYPE copyFileTo (const File& targetLocation) const throw();
/** Copies a directory.
@@ -471,7 +471,7 @@ public:
write privileges to create it if it doesn't exist. Any files inside
it will be overwritten by similarly named ones that are copied.
*/
bool copyDirectoryTo (const File& newDirectory) const throw();
bool JUCE_CALLTYPE copyDirectoryTo (const File& newDirectory) const throw();
//==============================================================================
/** Used in file searching, to specify whether to return files, directories, or both.
@@ -501,10 +501,10 @@ public:
@see getNumberOfChildFiles, DirectoryIterator
*/
int findChildFiles (OwnedArray<File>& results,
const int whatToLookFor,
const bool searchRecursively,
const String& wildCardPattern = JUCE_T("*")) const throw();
int JUCE_CALLTYPE findChildFiles (OwnedArray<File>& results,
const int whatToLookFor,
const bool searchRecursively,
const String& wildCardPattern = JUCE_T("*")) const throw();
/** Searches inside a directory and counts how many files match a wildcard pattern.
@@ -522,8 +522,8 @@ public:
@returns the number of matches found
@see findChildFiles, DirectoryIterator
*/
int getNumberOfChildFiles (const int whatToLookFor,
const String& wildCardPattern = JUCE_T("*")) const throw();
int JUCE_CALLTYPE getNumberOfChildFiles (const int whatToLookFor,
const String& wildCardPattern = JUCE_T("*")) const throw();
//==============================================================================
/** Creates a stream to read from this file.
@@ -532,7 +532,7 @@ public:
start of the file), or 0 if the file can't be opened for some reason
@see createOutputStream, loadFileAsData
*/
FileInputStream* createInputStream() const throw();
FileInputStream* JUCE_CALLTYPE createInputStream() const throw();
/** Creates a stream to write to this file.
@@ -544,7 +544,7 @@ public:
end of the file), or 0 if the file can't be opened for some reason
@see createInputStream, printf, appendData, appendText
*/
FileOutputStream* createOutputStream (const int bufferSize = 0x8000) const throw();
FileOutputStream* JUCE_CALLTYPE createOutputStream (const int bufferSize = 0x8000) const throw();
//==============================================================================
/** Loads a file's contents into memory as a block of binary data.
@@ -557,7 +557,7 @@ public:
might want to clear it first
@returns true if the file could all be read into memory
*/
bool loadFileAsData (MemoryBlock& result) const throw();
bool JUCE_CALLTYPE loadFileAsData (MemoryBlock& result) const throw();
/** Reads a file into memory as a string.
@@ -566,7 +566,7 @@ public:
This makes use of InputStream::readEntireStreamAsString, which should
automatically cope with unicode/acsii file formats.
*/
const String loadFileAsString() const throw();
const String JUCE_CALLTYPE loadFileAsString() const throw();
//==============================================================================
/** Writes text to the end of the file.
@@ -575,7 +575,7 @@ public:
@returns false if it can't write to the file for some reason
*/
bool printf (const tchar* format, ...) const throw();
bool JUCE_CALLTYPE printf (const tchar* format, ...) const throw();
/** Appends a block of binary data to the end of the file.
@@ -583,8 +583,8 @@ public:
@returns false if it can't write to the file for some reason
*/
bool appendData (const void* const dataToAppend,
const int numberOfBytes) const throw();
bool JUCE_CALLTYPE appendData (const void* const dataToAppend,
const int numberOfBytes) const throw();
/** Replaces this file's contents with a given block of data.
@@ -600,8 +600,8 @@ public:
@see appendText
*/
bool replaceWithData (const void* const dataToWrite,
const int numberOfBytes) const throw();
bool JUCE_CALLTYPE replaceWithData (const void* const dataToWrite,
const int numberOfBytes) const throw();
/** Appends a string to the end of the file.
@@ -615,9 +615,9 @@ public:
@see replaceWithText
*/
bool appendText (const String& textToAppend,
const bool asUnicode = false,
const bool writeUnicodeHeaderBytes = false) const throw();
bool JUCE_CALLTYPE appendText (const String& textToAppend,
const bool asUnicode = false,
const bool writeUnicodeHeaderBytes = false) const throw();
/** Replaces this file's contents with a given text string.
@@ -635,9 +635,9 @@ public:
@see appendText
*/
bool replaceWithText (const String& textToWrite,
const bool asUnicode = false,
const bool writeUnicodeHeaderBytes = false) const throw();
bool JUCE_CALLTYPE replaceWithText (const String& textToWrite,
const bool asUnicode = false,
const bool writeUnicodeHeaderBytes = false) const throw();
//==============================================================================
/** Creates a set of files to represent each file root.
@@ -646,41 +646,41 @@ public:
to which ones are available. On the Mac/Linux, this will probably
just add a single entry for "/".
*/
static void findFileSystemRoots (OwnedArray<File>& results) throw();
static void JUCE_CALLTYPE findFileSystemRoots (OwnedArray<File>& results) throw();
/** Finds the name of the drive on which this file lives.
@returns the volume label of the drive, or an empty string if this isn't possible
*/
const String getVolumeLabel() const throw();
const String JUCE_CALLTYPE getVolumeLabel() const throw();
/** Returns the serial number of the volume on which this file lives.
@returns the serial number, or zero if there's a problem doing this
*/
int getVolumeSerialNumber() const throw();
int JUCE_CALLTYPE getVolumeSerialNumber() const throw();
/** Returns the number of bytes free on the drive that this file lives on.
@returns the number of bytes free, or 0 if there's a problem finding this out
*/
int64 getBytesFreeOnVolume() const throw();
int64 JUCE_CALLTYPE getBytesFreeOnVolume() const throw();
/** Returns true if this file is on a CD or DVD drive. */
bool isOnCDRomDrive() const throw();
bool JUCE_CALLTYPE isOnCDRomDrive() const throw();
/** Returns true if this file is on a hard disk.
This will fail if it's a network drive, but will still be true for
removable hard-disks.
*/
bool isOnHardDisk() const throw();
bool JUCE_CALLTYPE isOnHardDisk() const throw();
/** Returns true if this file is on a removable disk drive.
This might be a usb-drive, a CD-rom, or maybe a network drive.
*/
bool isOnRemovableDrive() const throw();
bool JUCE_CALLTYPE isOnRemovableDrive() const throw();
//==============================================================================
/** Launches the file as a process.
@@ -692,7 +692,7 @@ public:
- if it's a folder, it will be opened in Explorer, Finder, or equivalent.
*/
bool startAsProcess (const String& parameters = String::empty) const throw();
bool JUCE_CALLTYPE startAsProcess (const String& parameters = String::empty) const throw();
//==============================================================================
/** A set of types of location that can be passed to the getSpecialLocation() method.
@@ -767,7 +767,7 @@ public:
@see SpecialLocationType
*/
static const File getSpecialLocation (const SpecialLocationType type);
static const File JUCE_CALLTYPE getSpecialLocation (const SpecialLocationType type);
//==============================================================================
/** Returns a temporary file in the system's temp directory.
@@ -776,7 +776,7 @@ public:
To get the temp folder, you can use getSpecialLocation (File::tempDirectory).
*/
static const File createTempFile (const String& fileNameEnding) throw();
static const File JUCE_CALLTYPE createTempFile (const String& fileNameEnding) throw();
//==============================================================================
@@ -784,7 +784,7 @@ public:
@see setAsCurrentWorkingDirectory
*/
static const File getCurrentWorkingDirectory() throw();
static const File JUCE_CALLTYPE getCurrentWorkingDirectory() throw();
/** Sets the current working directory to be this file.
@@ -793,7 +793,7 @@ public:
@returns true if the current directory has been changed.
@see getCurrentWorkingDirectory
*/
bool setAsCurrentWorkingDirectory() const throw();
bool JUCE_CALLTYPE setAsCurrentWorkingDirectory() const throw();
//==============================================================================
/** The system-specific file separator character.
@@ -819,7 +819,7 @@ public:
@see createLegalPathName
*/
static const String createLegalFileName (const String& fileNameToFix) throw();
static const String JUCE_CALLTYPE createLegalFileName (const String& fileNameToFix) throw();
/** Removes illegal characters from a pathname.
@@ -828,11 +828,11 @@ public:
@see createLegalFileName
*/
static const String createLegalPathName (const String& pathNameToFix) throw();
static const String JUCE_CALLTYPE createLegalPathName (const String& pathNameToFix) throw();
/** Indicates whether filenames are case-sensitive on the current operating system.
*/
static bool areFileNamesCaseSensitive();
static bool JUCE_CALLTYPE areFileNamesCaseSensitive();
//==============================================================================
juce_UseDebuggingNewOperator
@@ -844,7 +844,7 @@ private:
// internal way of contructing a file without checking the path
friend class DirectoryIterator;
File (const String&, int) throw();
const String getPathUpToLastSlash() const throw();
const String JUCE_CALLTYPE getPathUpToLastSlash() const throw();
};
#endif // __JUCE_FILE_JUCEHEADER__

+ 57
- 57
src/juce_core/text/juce_CharacterFunctions.cpp View File

@@ -49,12 +49,12 @@ BEGIN_JUCE_NAMESPACE
#include "juce_String.h"
//==============================================================================
int CharacterFunctions::length (const char* const s) throw()
int JUCE_CALLTYPE CharacterFunctions::length (const char* const s) throw()
{
return (int) strlen (s);
}
int CharacterFunctions::length (const juce_wchar* const s) throw()
int JUCE_CALLTYPE CharacterFunctions::length (const juce_wchar* const s) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
int n = 0;
@@ -67,12 +67,12 @@ int CharacterFunctions::length (const juce_wchar* const s) throw()
#endif
}
void CharacterFunctions::copy (char* dest, const char* src, const int maxChars) throw()
void JUCE_CALLTYPE CharacterFunctions::copy (char* dest, const char* src, const int maxChars) throw()
{
strncpy (dest, src, maxChars);
}
void CharacterFunctions::copy (juce_wchar* dest, const juce_wchar* src, int maxChars) throw()
void JUCE_CALLTYPE CharacterFunctions::copy (juce_wchar* dest, const juce_wchar* src, int maxChars) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
while (--maxChars >= 0 && *src != 0)
@@ -84,22 +84,22 @@ void CharacterFunctions::copy (juce_wchar* dest, const juce_wchar* src, int maxC
#endif
}
void CharacterFunctions::copy (juce_wchar* dest, const char* src, const int maxChars) throw()
void JUCE_CALLTYPE CharacterFunctions::copy (juce_wchar* dest, const char* src, const int maxChars) throw()
{
mbstowcs (dest, src, maxChars);
}
void CharacterFunctions::copy (char* dest, const juce_wchar* src, const int maxChars) throw()
void JUCE_CALLTYPE CharacterFunctions::copy (char* dest, const juce_wchar* src, const int maxChars) throw()
{
wcstombs (dest, src, maxChars);
}
void CharacterFunctions::append (char* dest, const char* src) throw()
void JUCE_CALLTYPE CharacterFunctions::append (char* dest, const char* src) throw()
{
strcat (dest, src);
}
void CharacterFunctions::append (juce_wchar* dest, const juce_wchar* src) throw()
void JUCE_CALLTYPE CharacterFunctions::append (juce_wchar* dest, const juce_wchar* src) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
while (*dest != 0)
@@ -114,12 +114,12 @@ void CharacterFunctions::append (juce_wchar* dest, const juce_wchar* src) throw(
#endif
}
int CharacterFunctions::compare (const char* const s1, const char* const s2) throw()
int JUCE_CALLTYPE CharacterFunctions::compare (const char* const s1, const char* const s2) throw()
{
return strcmp (s1, s2);
}
int CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2) throw()
int JUCE_CALLTYPE CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2) throw()
{
jassert (s1 != 0 && s2 != 0);
@@ -146,14 +146,14 @@ int CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2) thr
#endif
}
int CharacterFunctions::compare (const char* const s1, const char* const s2, const int maxChars) throw()
int JUCE_CALLTYPE CharacterFunctions::compare (const char* const s1, const char* const s2, const int maxChars) throw()
{
jassert (s1 != 0 && s2 != 0);
return strncmp (s1, s2, maxChars);
}
int CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw()
int JUCE_CALLTYPE CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw()
{
jassert (s1 != 0 && s2 != 0);
@@ -175,7 +175,7 @@ int CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2, int
#endif
}
int CharacterFunctions::compareIgnoreCase (const char* const s1, const char* const s2) throw()
int JUCE_CALLTYPE CharacterFunctions::compareIgnoreCase (const char* const s1, const char* const s2) throw()
{
jassert (s1 != 0 && s2 != 0);
@@ -186,7 +186,7 @@ int CharacterFunctions::compareIgnoreCase (const char* const s1, const char* con
#endif
}
int CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2) throw()
int JUCE_CALLTYPE CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2) throw()
{
jassert (s1 != 0 && s2 != 0);
@@ -213,7 +213,7 @@ int CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const juce_wcha
#endif
}
int CharacterFunctions::compareIgnoreCase (const char* const s1, const char* const s2, const int maxChars) throw()
int JUCE_CALLTYPE CharacterFunctions::compareIgnoreCase (const char* const s1, const char* const s2, const int maxChars) throw()
{
jassert (s1 != 0 && s2 != 0);
@@ -224,7 +224,7 @@ int CharacterFunctions::compareIgnoreCase (const char* const s1, const char* con
#endif
}
int CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw()
int JUCE_CALLTYPE CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw()
{
jassert (s1 != 0 && s2 != 0);
@@ -251,12 +251,12 @@ int CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const juce_wcha
#endif
}
const char* CharacterFunctions::find (const char* const haystack, const char* const needle) throw()
const char* JUCE_CALLTYPE CharacterFunctions::find (const char* const haystack, const char* const needle) throw()
{
return strstr (haystack, needle);
}
const juce_wchar* CharacterFunctions::find (const juce_wchar* haystack, const juce_wchar* const needle) throw()
const juce_wchar* JUCE_CALLTYPE CharacterFunctions::find (const juce_wchar* haystack, const juce_wchar* const needle) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
while (*haystack != 0)
@@ -285,7 +285,7 @@ const juce_wchar* CharacterFunctions::find (const juce_wchar* haystack, const ju
#endif
}
int CharacterFunctions::indexOfChar (const char* const haystack, const char needle, const bool ignoreCase) throw()
int JUCE_CALLTYPE CharacterFunctions::indexOfChar (const char* const haystack, const char needle, const bool ignoreCase) throw()
{
if (haystack != 0)
{
@@ -324,7 +324,7 @@ int CharacterFunctions::indexOfChar (const char* const haystack, const char need
return -1;
}
int CharacterFunctions::indexOfChar (const juce_wchar* const haystack, const juce_wchar needle, const bool ignoreCase) throw()
int JUCE_CALLTYPE CharacterFunctions::indexOfChar (const juce_wchar* const haystack, const juce_wchar needle, const bool ignoreCase) throw()
{
if (haystack != 0)
{
@@ -363,7 +363,7 @@ int CharacterFunctions::indexOfChar (const juce_wchar* const haystack, const juc
return -1;
}
int CharacterFunctions::indexOfCharFast (const char* const haystack, const char needle) throw()
int JUCE_CALLTYPE CharacterFunctions::indexOfCharFast (const char* const haystack, const char needle) throw()
{
jassert (haystack != 0);
@@ -379,7 +379,7 @@ int CharacterFunctions::indexOfCharFast (const char* const haystack, const char
return -1;
}
int CharacterFunctions::indexOfCharFast (const juce_wchar* const haystack, const juce_wchar needle) throw()
int JUCE_CALLTYPE CharacterFunctions::indexOfCharFast (const juce_wchar* const haystack, const juce_wchar needle) throw()
{
jassert (haystack != 0);
@@ -395,12 +395,12 @@ int CharacterFunctions::indexOfCharFast (const juce_wchar* const haystack, const
return -1;
}
int CharacterFunctions::getIntialSectionContainingOnly (const char* const text, const char* const allowedChars) throw()
int JUCE_CALLTYPE CharacterFunctions::getIntialSectionContainingOnly (const char* const text, const char* const allowedChars) throw()
{
return allowedChars == 0 ? 0 : (int) strspn (text, allowedChars);
}
int CharacterFunctions::getIntialSectionContainingOnly (const juce_wchar* const text, const juce_wchar* const allowedChars) throw()
int JUCE_CALLTYPE CharacterFunctions::getIntialSectionContainingOnly (const juce_wchar* const text, const juce_wchar* const allowedChars) throw()
{
if (allowedChars == 0)
return 0;
@@ -418,12 +418,12 @@ int CharacterFunctions::getIntialSectionContainingOnly (const juce_wchar* const
return i;
}
int CharacterFunctions::ftime (char* const dest, const int maxChars, const char* const format, const struct tm* const tm) throw()
int JUCE_CALLTYPE CharacterFunctions::ftime (char* const dest, const int maxChars, const char* const format, const struct tm* const tm) throw()
{
return (int) strftime (dest, maxChars, format, tm);
}
int CharacterFunctions::ftime (juce_wchar* const dest, const int maxChars, const juce_wchar* const format, const struct tm* const tm) throw()
int JUCE_CALLTYPE CharacterFunctions::ftime (juce_wchar* const dest, const int maxChars, const juce_wchar* const format, const struct tm* const tm) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
const String formatTemp (format);
@@ -437,12 +437,12 @@ int CharacterFunctions::ftime (juce_wchar* const dest, const int maxChars, const
#endif
}
int CharacterFunctions::getIntValue (const char* const s) throw()
int JUCE_CALLTYPE CharacterFunctions::getIntValue (const char* const s) throw()
{
return atoi (s);
}
int CharacterFunctions::getIntValue (const juce_wchar* s) throw()
int JUCE_CALLTYPE CharacterFunctions::getIntValue (const juce_wchar* s) throw()
{
#if JUCE_WIN32
return _wtoi (s);
@@ -470,7 +470,7 @@ int CharacterFunctions::getIntValue (const juce_wchar* s) throw()
#endif
}
int64 CharacterFunctions::getInt64Value (const char* s) throw()
int64 JUCE_CALLTYPE CharacterFunctions::getInt64Value (const char* s) throw()
{
#ifdef JUCE_LINUX
return atoll (s);
@@ -500,7 +500,7 @@ int64 CharacterFunctions::getInt64Value (const char* s) throw()
#endif
}
int64 CharacterFunctions::getInt64Value (const juce_wchar* s) throw()
int64 JUCE_CALLTYPE CharacterFunctions::getInt64Value (const juce_wchar* s) throw()
{
#if JUCE_WIN32
return _wtoi64 (s);
@@ -528,12 +528,12 @@ int64 CharacterFunctions::getInt64Value (const juce_wchar* s) throw()
#endif
}
double CharacterFunctions::getDoubleValue (const char* const s) throw()
double JUCE_CALLTYPE CharacterFunctions::getDoubleValue (const char* const s) throw()
{
return atof (s);
}
double CharacterFunctions::getDoubleValue (const juce_wchar* const s) throw()
double JUCE_CALLTYPE CharacterFunctions::getDoubleValue (const juce_wchar* const s) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
String temp (s);
@@ -545,12 +545,12 @@ double CharacterFunctions::getDoubleValue (const juce_wchar* const s) throw()
}
//==============================================================================
char CharacterFunctions::toUpperCase (const char character) throw()
char JUCE_CALLTYPE CharacterFunctions::toUpperCase (const char character) throw()
{
return (char) toupper (character);
}
juce_wchar CharacterFunctions::toUpperCase (const juce_wchar character) throw()
juce_wchar JUCE_CALLTYPE CharacterFunctions::toUpperCase (const juce_wchar character) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
return toupper ((char) character);
@@ -559,7 +559,7 @@ juce_wchar CharacterFunctions::toUpperCase (const juce_wchar character) throw()
#endif
}
void CharacterFunctions::toUpperCase (char* s) throw()
void JUCE_CALLTYPE CharacterFunctions::toUpperCase (char* s) throw()
{
#if JUCE_WIN32
strupr (s);
@@ -572,7 +572,7 @@ void CharacterFunctions::toUpperCase (char* s) throw()
#endif
}
void CharacterFunctions::toUpperCase (juce_wchar* s) throw()
void JUCE_CALLTYPE CharacterFunctions::toUpperCase (juce_wchar* s) throw()
{
#if JUCE_WIN32
_wcsupr (s);
@@ -585,12 +585,12 @@ void CharacterFunctions::toUpperCase (juce_wchar* s) throw()
#endif
}
bool CharacterFunctions::isUpperCase (const char character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isUpperCase (const char character) throw()
{
return isupper (character) != 0;
}
bool CharacterFunctions::isUpperCase (const juce_wchar character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isUpperCase (const juce_wchar character) throw()
{
#if JUCE_WIN32
return iswupper (character) != 0;
@@ -600,12 +600,12 @@ bool CharacterFunctions::isUpperCase (const juce_wchar character) throw()
}
//==============================================================================
char CharacterFunctions::toLowerCase (const char character) throw()
char JUCE_CALLTYPE CharacterFunctions::toLowerCase (const char character) throw()
{
return (char) tolower (character);
}
juce_wchar CharacterFunctions::toLowerCase (const juce_wchar character) throw()
juce_wchar JUCE_CALLTYPE CharacterFunctions::toLowerCase (const juce_wchar character) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
return tolower ((char) character);
@@ -614,7 +614,7 @@ juce_wchar CharacterFunctions::toLowerCase (const juce_wchar character) throw()
#endif
}
void CharacterFunctions::toLowerCase (char* s) throw()
void JUCE_CALLTYPE CharacterFunctions::toLowerCase (char* s) throw()
{
#if JUCE_WIN32
strlwr (s);
@@ -627,7 +627,7 @@ void CharacterFunctions::toLowerCase (char* s) throw()
#endif
}
void CharacterFunctions::toLowerCase (juce_wchar* s) throw()
void JUCE_CALLTYPE CharacterFunctions::toLowerCase (juce_wchar* s) throw()
{
#if JUCE_WIN32
_wcslwr (s);
@@ -640,12 +640,12 @@ void CharacterFunctions::toLowerCase (juce_wchar* s) throw()
#endif
}
bool CharacterFunctions::isLowerCase (const char character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isLowerCase (const char character) throw()
{
return islower (character) != 0;
}
bool CharacterFunctions::isLowerCase (const juce_wchar character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isLowerCase (const juce_wchar character) throw()
{
#if JUCE_WIN32
return iswlower (character) != 0;
@@ -655,12 +655,12 @@ bool CharacterFunctions::isLowerCase (const juce_wchar character) throw()
}
//==============================================================================
bool CharacterFunctions::isWhitespace (const char character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isWhitespace (const char character) throw()
{
return character == T(' ') || (character <= 13 && character >= 9);
}
bool CharacterFunctions::isWhitespace (const juce_wchar character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isWhitespace (const juce_wchar character) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
return isWhitespace ((char) character);
@@ -669,23 +669,23 @@ bool CharacterFunctions::isWhitespace (const juce_wchar character) throw()
#endif
}
bool CharacterFunctions::isDigit (const char character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isDigit (const char character) throw()
{
return (character >= '0' && character <= '9');
}
bool CharacterFunctions::isDigit (const juce_wchar character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isDigit (const juce_wchar character) throw()
{
return isdigit (character) != 0;
}
bool CharacterFunctions::isLetter (const char character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isLetter (const char character) throw()
{
return (character >= 'a' && character <= 'z')
|| (character >= 'A' && character <= 'Z');
}
bool CharacterFunctions::isLetter (const juce_wchar character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isLetter (const juce_wchar character) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
return isLetter ((char) character);
@@ -694,14 +694,14 @@ bool CharacterFunctions::isLetter (const juce_wchar character) throw()
#endif
}
bool CharacterFunctions::isLetterOrDigit (const char character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isLetterOrDigit (const char character) throw()
{
return (character >= 'a' && character <= 'z')
|| (character >= 'A' && character <= 'Z')
|| (character >= '0' && character <= '9');
}
bool CharacterFunctions::isLetterOrDigit (const juce_wchar character) throw()
bool JUCE_CALLTYPE CharacterFunctions::isLetterOrDigit (const juce_wchar character) throw()
{
#ifdef MACOS_10_2_OR_EARLIER
return isLetterOrDigit ((char) character);
@@ -710,7 +710,7 @@ bool CharacterFunctions::isLetterOrDigit (const juce_wchar character) throw()
#endif
}
int CharacterFunctions::getHexDigitValue (const tchar digit) throw()
int JUCE_CALLTYPE CharacterFunctions::getHexDigitValue (const tchar digit) throw()
{
if (digit >= T('0') && digit <= T('9'))
return digit - T('0');
@@ -723,21 +723,21 @@ int CharacterFunctions::getHexDigitValue (const tchar digit) throw()
}
//==============================================================================
int CharacterFunctions::printf (char* const dest, const int maxLength, const char* const format, ...) throw()
int JUCE_CALLTYPE CharacterFunctions::printf (char* const dest, const int maxLength, const char* const format, ...) throw()
{
va_list list;
va_start (list, format);
return vprintf (dest, maxLength, format, list);
}
int CharacterFunctions::printf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, ...) throw()
int JUCE_CALLTYPE CharacterFunctions::printf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, ...) throw()
{
va_list list;
va_start (list, format);
return vprintf (dest, maxLength, format, list);
}
int CharacterFunctions::vprintf (char* const dest, const int maxLength, const char* const format, va_list& args) throw()
int JUCE_CALLTYPE CharacterFunctions::vprintf (char* const dest, const int maxLength, const char* const format, va_list& args) throw()
{
#if JUCE_WIN32
return (int) _vsnprintf (dest, maxLength, format, args);
@@ -746,7 +746,7 @@ int CharacterFunctions::vprintf (char* const dest, const int maxLength, const ch
#endif
}
int CharacterFunctions::vprintf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, va_list& args) throw()
int JUCE_CALLTYPE CharacterFunctions::vprintf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, va_list& args) throw()
{
#ifdef MACOS_10_3_OR_EARLIER
const String formatTemp (format);


+ 57
- 57
src/juce_core/text/juce_CharacterFunctions.h View File

@@ -88,94 +88,94 @@
class JUCE_API CharacterFunctions
{
public:
static int length (const char* const s) throw();
static int length (const juce_wchar* const s) throw();
static int JUCE_CALLTYPE length (const char* const s) throw();
static int JUCE_CALLTYPE length (const juce_wchar* const s) throw();
static void copy (char* dest, const char* src, const int maxChars) throw();
static void copy (juce_wchar* dest, const juce_wchar* src, const int maxChars) throw();
static void JUCE_CALLTYPE copy (char* dest, const char* src, const int maxChars) throw();
static void JUCE_CALLTYPE copy (juce_wchar* dest, const juce_wchar* src, const int maxChars) throw();
static void copy (juce_wchar* dest, const char* src, const int maxChars) throw();
static void copy (char* dest, const juce_wchar* src, const int maxChars) throw();
static void JUCE_CALLTYPE copy (juce_wchar* dest, const char* src, const int maxChars) throw();
static void JUCE_CALLTYPE copy (char* dest, const juce_wchar* src, const int maxChars) throw();
static void append (char* dest, const char* src) throw();
static void append (juce_wchar* dest, const juce_wchar* src) throw();
static void JUCE_CALLTYPE append (char* dest, const char* src) throw();
static void JUCE_CALLTYPE append (juce_wchar* dest, const juce_wchar* src) throw();
static int compare (const char* const s1, const char* const s2) throw();
static int compare (const juce_wchar* s1, const juce_wchar* s2) throw();
static int JUCE_CALLTYPE compare (const char* const s1, const char* const s2) throw();
static int JUCE_CALLTYPE compare (const juce_wchar* s1, const juce_wchar* s2) throw();
static int compare (const char* const s1, const char* const s2, const int maxChars) throw();
static int compare (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw();
static int JUCE_CALLTYPE compare (const char* const s1, const char* const s2, const int maxChars) throw();
static int JUCE_CALLTYPE compare (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw();
static int compareIgnoreCase (const char* const s1, const char* const s2) throw();
static int compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2) throw();
static int JUCE_CALLTYPE compareIgnoreCase (const char* const s1, const char* const s2) throw();
static int JUCE_CALLTYPE compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2) throw();
static int compareIgnoreCase (const char* const s1, const char* const s2, const int maxChars) throw();
static int compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw();
static int JUCE_CALLTYPE compareIgnoreCase (const char* const s1, const char* const s2, const int maxChars) throw();
static int JUCE_CALLTYPE compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw();
static const char* find (const char* const haystack, const char* const needle) throw();
static const juce_wchar* find (const juce_wchar* haystack, const juce_wchar* const needle) throw();
static const char* JUCE_CALLTYPE find (const char* const haystack, const char* const needle) throw();
static const juce_wchar* JUCE_CALLTYPE find (const juce_wchar* haystack, const juce_wchar* const needle) throw();
static int indexOfChar (const char* const haystack, const char needle, const bool ignoreCase) throw();
static int indexOfChar (const juce_wchar* const haystack, const juce_wchar needle, const bool ignoreCase) throw();
static int JUCE_CALLTYPE indexOfChar (const char* const haystack, const char needle, const bool ignoreCase) throw();
static int JUCE_CALLTYPE indexOfChar (const juce_wchar* const haystack, const juce_wchar needle, const bool ignoreCase) throw();
static int indexOfCharFast (const char* const haystack, const char needle) throw();
static int indexOfCharFast (const juce_wchar* const haystack, const juce_wchar needle) throw();
static int JUCE_CALLTYPE indexOfCharFast (const char* const haystack, const char needle) throw();
static int JUCE_CALLTYPE indexOfCharFast (const juce_wchar* const haystack, const juce_wchar needle) throw();
static int getIntialSectionContainingOnly (const char* const text, const char* const allowedChars) throw();
static int getIntialSectionContainingOnly (const juce_wchar* const text, const juce_wchar* const allowedChars) throw();
static int JUCE_CALLTYPE getIntialSectionContainingOnly (const char* const text, const char* const allowedChars) throw();
static int JUCE_CALLTYPE getIntialSectionContainingOnly (const juce_wchar* const text, const juce_wchar* const allowedChars) throw();
static int ftime (char* const dest, const int maxChars, const char* const format, const struct tm* const tm) throw();
static int ftime (juce_wchar* const dest, const int maxChars, const juce_wchar* const format, const struct tm* const tm) throw();
static int JUCE_CALLTYPE ftime (char* const dest, const int maxChars, const char* const format, const struct tm* const tm) throw();
static int JUCE_CALLTYPE ftime (juce_wchar* const dest, const int maxChars, const juce_wchar* const format, const struct tm* const tm) throw();
static int getIntValue (const char* const s) throw();
static int getIntValue (const juce_wchar* s) throw();
static int JUCE_CALLTYPE getIntValue (const char* const s) throw();
static int JUCE_CALLTYPE getIntValue (const juce_wchar* s) throw();
static int64 getInt64Value (const char* s) throw();
static int64 getInt64Value (const juce_wchar* s) throw();
static int64 JUCE_CALLTYPE getInt64Value (const char* s) throw();
static int64 JUCE_CALLTYPE getInt64Value (const juce_wchar* s) throw();
static double getDoubleValue (const char* const s) throw();
static double getDoubleValue (const juce_wchar* const s) throw();
static double JUCE_CALLTYPE getDoubleValue (const char* const s) throw();
static double JUCE_CALLTYPE getDoubleValue (const juce_wchar* const s) throw();
//==============================================================================
static char toUpperCase (const char character) throw();
static juce_wchar toUpperCase (const juce_wchar character) throw();
static void toUpperCase (char* s) throw();
static char JUCE_CALLTYPE toUpperCase (const char character) throw();
static juce_wchar JUCE_CALLTYPE toUpperCase (const juce_wchar character) throw();
static void JUCE_CALLTYPE toUpperCase (char* s) throw();
static void toUpperCase (juce_wchar* s) throw();
static bool isUpperCase (const char character) throw();
static bool isUpperCase (const juce_wchar character) throw();
static void JUCE_CALLTYPE toUpperCase (juce_wchar* s) throw();
static bool JUCE_CALLTYPE isUpperCase (const char character) throw();
static bool JUCE_CALLTYPE isUpperCase (const juce_wchar character) throw();
static char toLowerCase (const char character) throw();
static juce_wchar toLowerCase (const juce_wchar character) throw();
static void toLowerCase (char* s) throw();
static void toLowerCase (juce_wchar* s) throw();
static bool isLowerCase (const char character) throw();
static bool isLowerCase (const juce_wchar character) throw();
static char JUCE_CALLTYPE toLowerCase (const char character) throw();
static juce_wchar JUCE_CALLTYPE toLowerCase (const juce_wchar character) throw();
static void JUCE_CALLTYPE toLowerCase (char* s) throw();
static void JUCE_CALLTYPE toLowerCase (juce_wchar* s) throw();
static bool JUCE_CALLTYPE isLowerCase (const char character) throw();
static bool JUCE_CALLTYPE isLowerCase (const juce_wchar character) throw();
//==============================================================================
static bool isWhitespace (const char character) throw();
static bool isWhitespace (const juce_wchar character) throw();
static bool JUCE_CALLTYPE isWhitespace (const char character) throw();
static bool JUCE_CALLTYPE isWhitespace (const juce_wchar character) throw();
static bool isDigit (const char character) throw();
static bool isDigit (const juce_wchar character) throw();
static bool JUCE_CALLTYPE isDigit (const char character) throw();
static bool JUCE_CALLTYPE isDigit (const juce_wchar character) throw();
static bool isLetter (const char character) throw();
static bool isLetter (const juce_wchar character) throw();
static bool JUCE_CALLTYPE isLetter (const char character) throw();
static bool JUCE_CALLTYPE isLetter (const juce_wchar character) throw();
static bool isLetterOrDigit (const char character) throw();
static bool isLetterOrDigit (const juce_wchar character) throw();
static bool JUCE_CALLTYPE isLetterOrDigit (const char character) throw();
static bool JUCE_CALLTYPE isLetterOrDigit (const juce_wchar character) throw();
/** Returns 0 to 16 for '0' to 'F", or -1 for characters that aren't a legel
hex digit.
*/
static int getHexDigitValue (const tchar digit) throw();
static int JUCE_CALLTYPE getHexDigitValue (const tchar digit) throw();
//==============================================================================
static int printf (char* const dest, const int maxLength, const char* const format, ...) throw();
static int printf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, ...) throw();
static int JUCE_CALLTYPE printf (char* const dest, const int maxLength, const char* const format, ...) throw();
static int JUCE_CALLTYPE printf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, ...) throw();
static int vprintf (char* const dest, const int maxLength, const char* const format, va_list& args) throw();
static int vprintf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, va_list& args) throw();
static int JUCE_CALLTYPE vprintf (char* const dest, const int maxLength, const char* const format, va_list& args) throw();
static int JUCE_CALLTYPE vprintf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, va_list& args) throw();
};
#endif // __JUCE_CHARACTERFUNCTIONS_JUCEHEADER__

+ 172
- 172
src/juce_core/text/juce_String.cpp
File diff suppressed because it is too large
View File


+ 174
- 174
src/juce_core/text/juce_String.h
File diff suppressed because it is too large
View File


+ 1
- 1
src/juce_core/threads/juce_Process.h View File

@@ -76,7 +76,7 @@ public:
/** Returns true if this application process is the one that the user is
currently using.
*/
static bool isForegroundProcess();
static bool isForegroundProcess() throw();
//==============================================================================
/** Raises the current process's privilege level.


+ 6
- 6
src/juce_core/threads/juce_Thread.cpp View File

@@ -40,10 +40,10 @@ BEGIN_JUCE_NAMESPACE
#include "../containers/juce_VoidArray.h"
// these functions are implemented in the platform-specific code.
void* juce_createThread (void* userData);
void juce_killThread (void* handle);
void juce_setThreadPriority (void* handle, int priority);
void juce_setCurrentThreadName (const String& name);
void* juce_createThread (void* userData) throw();
void juce_killThread (void* handle) throw();
void juce_setThreadPriority (void* handle, int priority) throw();
void juce_setCurrentThreadName (const String& name) throw();
//==============================================================================
static VoidArray runningThreads (4);
@@ -220,12 +220,12 @@ int Thread::getThreadId() const throw()
}
//==============================================================================
bool Thread::wait (const int timeOutMilliseconds) const
bool Thread::wait (const int timeOutMilliseconds) const throw()
{
return defaultEvent_.wait (timeOutMilliseconds);
}
void Thread::notify() const
void Thread::notify() const throw()
{
defaultEvent_.signal();
}


+ 5
- 5
src/juce_core/threads/juce_Thread.h View File

@@ -192,10 +192,10 @@ public:
//==============================================================================
// this can be called from any thread that needs to pause..
static void sleep (int milliseconds);
static void sleep (int milliseconds) throw();
/** Yields the calling thread's current time-slot. */
static void yield();
static void yield() throw();
//==============================================================================
/** Makes the thread wait for a notification.
@@ -205,7 +205,7 @@ public:
@returns true if the event has been signalled, false if the timeout expires.
*/
bool wait (const int timeOutMilliseconds) const;
bool wait (const int timeOutMilliseconds) const throw();
/** Wakes up the thread.
@@ -213,7 +213,7 @@ public:
@see wait
*/
void notify() const;
void notify() const throw();
//==============================================================================
/** Returns an id that identifies the caller thread.
@@ -223,7 +223,7 @@ public:
@returns a unique identifier that identifies the calling thread.
@see getThreadId
*/
static int getCurrentThreadId();
static int getCurrentThreadId() throw();
/** Returns the ID of this thread.


Loading…
Cancel
Save