Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
2e04bab207
74 changed files with 519 additions and 437 deletions
  1. +1
    -1
      build/linux/platform_specific_code/juce_linux_Windowing.cpp
  2. +1
    -1
      build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp
  3. +3
    -3
      build/macosx/platform_specific_code/juce_mac_Windowing.cpp
  4. +9
    -9
      build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp
  5. +2
    -2
      build/win32/platform_specific_code/juce_win32_Files.cpp
  6. +1
    -6
      build/win32/platform_specific_code/juce_win32_Fonts.cpp
  7. +1
    -1
      build/win32/platform_specific_code/juce_win32_Midi.cpp
  8. +1
    -1
      build/win32/platform_specific_code/juce_win32_Misc.cpp
  9. +1
    -1
      build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp
  10. +4
    -4
      build/win32/platform_specific_code/juce_win32_SystemStats.cpp
  11. +2
    -2
      build/win32/platform_specific_code/juce_win32_Threads.cpp
  12. +35
    -21
      build/win32/platform_specific_code/juce_win32_Windowing.cpp
  13. +1
    -0
      docs/JUCE changelist.txt
  14. +5
    -3
      extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp
  15. +1
    -1
      extras/juce demo/src/MainDemoWindow.cpp
  16. +1
    -1
      juce.h
  17. +1
    -1
      src/juce_DefineMacros.h
  18. +1
    -1
      src/juce_appframework/application/juce_Application.cpp
  19. +1
    -1
      src/juce_appframework/application/juce_PropertiesFile.cpp
  20. +21
    -21
      src/juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.cpp
  21. +1
    -1
      src/juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.h
  22. +1
    -1
      src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.cpp
  23. +2
    -2
      src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.h
  24. +2
    -2
      src/juce_appframework/audio/audio_file_formats/juce_AudioFormat.cpp
  25. +1
    -1
      src/juce_appframework/audio/audio_file_formats/juce_AudioFormatManager.cpp
  26. +1
    -1
      src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp
  27. +1
    -1
      src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp
  28. +27
    -23
      src/juce_appframework/audio/audio_file_formats/juce_WavAudioFormat.cpp
  29. +1
    -1
      src/juce_appframework/audio/audio_sources/juce_ResamplingAudioSource.cpp
  30. +2
    -2
      src/juce_appframework/audio/dsp/juce_AudioDataConverters.cpp
  31. +5
    -6
      src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp
  32. +6
    -6
      src/juce_appframework/events/juce_Timer.cpp
  33. +93
    -83
      src/juce_appframework/gui/components/controls/juce_TextEditor.cpp
  34. +83
    -33
      src/juce_appframework/gui/components/controls/juce_TextEditor.h
  35. +2
    -2
      src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp
  36. +1
    -1
      src/juce_appframework/gui/components/filebrowser/juce_FileChooser.cpp
  37. +14
    -12
      src/juce_appframework/gui/components/juce_Component.cpp
  38. +1
    -1
      src/juce_appframework/gui/components/keyboard/juce_KeyPress.cpp
  39. +1
    -1
      src/juce_appframework/gui/components/keyboard/juce_ModifierKeys.cpp
  40. +1
    -1
      src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp
  41. +2
    -2
      src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h
  42. +2
    -2
      src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp
  43. +5
    -5
      src/juce_appframework/gui/graphics/brushes/juce_Brush.cpp
  44. +12
    -12
      src/juce_appframework/gui/graphics/brushes/juce_Brush.h
  45. +10
    -10
      src/juce_appframework/gui/graphics/brushes/juce_GradientBrush.cpp
  46. +10
    -10
      src/juce_appframework/gui/graphics/brushes/juce_GradientBrush.h
  47. +12
    -12
      src/juce_appframework/gui/graphics/brushes/juce_ImageBrush.cpp
  48. +10
    -10
      src/juce_appframework/gui/graphics/brushes/juce_ImageBrush.h
  49. +13
    -13
      src/juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.cpp
  50. +13
    -13
      src/juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.h
  51. +3
    -3
      src/juce_appframework/gui/graphics/colour/juce_ColourGradient.cpp
  52. +2
    -2
      src/juce_appframework/gui/graphics/colour/juce_PixelFormats.h
  53. +2
    -2
      src/juce_appframework/gui/graphics/contexts/juce_EdgeTable.cpp
  54. +7
    -7
      src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp
  55. +18
    -18
      src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp
  56. +8
    -6
      src/juce_appframework/gui/graphics/drawables/juce_DrawablePath.cpp
  57. +1
    -1
      src/juce_appframework/gui/graphics/effects/juce_DropShadowEffect.cpp
  58. +3
    -3
      src/juce_appframework/gui/graphics/fonts/juce_GlyphArrangement.cpp
  59. +1
    -1
      src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp
  60. +8
    -7
      src/juce_appframework/gui/graphics/geometry/juce_RectangleList.cpp
  61. +2
    -2
      src/juce_appframework/gui/graphics/geometry/juce_RectangleList.h
  62. +2
    -2
      src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp
  63. +4
    -2
      src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.cpp
  64. +3
    -3
      src/juce_core/basics/juce_DataConversions.h
  65. +1
    -1
      src/juce_core/basics/juce_FileLogger.cpp
  66. +1
    -1
      src/juce_core/basics/juce_MathsFunctions.h
  67. +1
    -1
      src/juce_core/basics/juce_Memory.h
  68. +3
    -3
      src/juce_core/basics/juce_PlatformDefs.h
  69. +1
    -1
      src/juce_core/basics/juce_SystemStats.cpp
  70. +2
    -2
      src/juce_core/containers/juce_SortedSet.h
  71. +1
    -1
      src/juce_core/io/files/juce_File.cpp
  72. +15
    -15
      src/juce_core/text/juce_CharacterFunctions.cpp
  73. +1
    -1
      src/juce_core/text/juce_String.cpp
  74. +1
    -1
      src/juce_core/threads/juce_CriticalSection.h

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

@@ -1751,7 +1751,7 @@ private:
for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();) for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
image->blitToWindow (peer->windowH, image->blitToWindow (peer->windowH,
r.getX(), r.getY(), r.getWidth(), r.getHeight(), r.getX(), r.getY(), r.getWidth(), r.getHeight(),


+ 1
- 1
build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp View File

@@ -37,7 +37,7 @@
// As well as being for the mac, this file is included by the linux build. // As well as being for the mac, this file is included by the linux build.
#ifdef JUCE_MAC
#if JUCE_MAC
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#else #else
#include <sys/wait.h> #include <sys/wait.h>


+ 3
- 3
build/macosx/platform_specific_code/juce_mac_Windowing.cpp View File

@@ -865,7 +865,7 @@ public:
// stuff away // stuff away
for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();) for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
peer->repaint (r.getX(), r.getY(), r.getWidth(), r.getHeight()); peer->repaint (r.getX(), r.getY(), r.getWidth(), r.getHeight());
} }
} }
@@ -916,7 +916,7 @@ public:
{ {
for (RectangleList::Iterator i (*context.getRawClipRegion()); i.next();) for (RectangleList::Iterator i (*context.getRawClipRegion()); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
image->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); image->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight());
} }
} }
@@ -940,7 +940,7 @@ public:


for (RectangleList::Iterator i (total); i.next();) for (RectangleList::Iterator i (total); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
rects[n].origin.x = (int) r.getX(); rects[n].origin.x = (int) r.getX();
rects[n].origin.y = (int) r.getY(); rects[n].origin.y = (int) r.getY();
rects[n].size.width = roundFloatToInt (r.getWidth()); rects[n].size.width = roundFloatToInt (r.getWidth());


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

@@ -1541,17 +1541,17 @@ static int FindCDDevices (CDDeviceInfo* const list,
{ {
for (BYTE lun = 0; lun < 8; ++lun) for (BYTE lun = 0; lun < 8; ++lun)
{ {
SRB_GDEVBlock s;
zerostruct (s);
SRB_GDEVBlock sb;
zerostruct (sb);
s.SRB_Cmd = SC_GET_DEV_TYPE;
s.SRB_HaID = ha;
s.SRB_Target = tgt;
s.SRB_Lun = lun;
fSendASPI32Command ((LPSRB)&s);
sb.SRB_Cmd = SC_GET_DEV_TYPE;
sb.SRB_HaID = ha;
sb.SRB_Target = tgt;
sb.SRB_Lun = lun;
fSendASPI32Command ((LPSRB) &sb);
if (s.SRB_Status == SS_COMP
&& s.SRB_DeviceType == DTYPE_CROM)
if (sb.SRB_Status == SS_COMP
&& sb.SRB_DeviceType == DTYPE_CROM)
{ {
zeromem (&list[count], sizeof (CDDeviceInfo)); zeromem (&list[count], sizeof (CDDeviceInfo));


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

@@ -355,7 +355,7 @@ static int64 fileTimeToTime (const FILETIME* const ft) throw()
// tell me if this fails! // tell me if this fails!
static_jassert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME)); static_jassert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME));
#ifdef JUCE_GCC
#if JUCE_GCC
return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000LL) / 10000; return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000LL) / 10000;
#else #else
return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000) / 10000; return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000) / 10000;
@@ -364,7 +364,7 @@ static int64 fileTimeToTime (const FILETIME* const ft) throw()
static void timeToFileTime (const int64 time, FILETIME* const ft) throw() static void timeToFileTime (const int64 time, FILETIME* const ft) throw()
{ {
#ifdef JUCE_GCC
#if JUCE_GCC
((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000LL; ((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000LL;
#else #else
((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000; ((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000;


+ 1
- 6
build/win32/platform_specific_code/juce_win32_Fonts.cpp View File

@@ -454,8 +454,6 @@ juce_ImplementSingleton_SingleThreaded (FontDCHolder);
//============================================================================== //==============================================================================
static MAT2 identityMatrix;
static void addGlyphToTypeface (HDC dc, static void addGlyphToTypeface (HDC dc,
juce_wchar character, juce_wchar character,
Typeface& dest, Typeface& dest,
@@ -497,6 +495,7 @@ static void addGlyphToTypeface (HDC dc,
const float scaleX = 1.0f / height; const float scaleX = 1.0f / height;
const float scaleY = -1.0f / height; const float scaleY = -1.0f / height;
static const MAT2 identityMatrix = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } };
int bufSize; int bufSize;
@@ -672,10 +671,6 @@ void Typeface::initialiseTypefaceCharacteristics (const String& fontName,
bool italic, bool italic,
bool addAllGlyphsToFont) throw() bool addAllGlyphsToFont) throw()
{ {
zerostruct (identityMatrix);
identityMatrix.eM11.value = 1;
identityMatrix.eM22.value = 1;
clear(); clear();
HDC dc = FontDCHolder::getInstance()->loadFont (fontName, bold, italic, 0); HDC dc = FontDCHolder::getInstance()->loadFont (fontName, bold, italic, 0);


+ 1
- 1
build/win32/platform_specific_code/juce_win32_Midi.cpp View File

@@ -40,7 +40,7 @@ BEGIN_JUCE_NAMESPACE
#include "../../../src/juce_core/threads/juce_Thread.h" #include "../../../src/juce_core/threads/juce_Thread.h"
#include "../../../src/juce_core/containers/juce_MemoryBlock.h" #include "../../../src/juce_core/containers/juce_MemoryBlock.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (disable: 4312) #pragma warning (disable: 4312)
#endif #endif


+ 1
- 1
build/win32/platform_specific_code/juce_win32_Misc.cpp View File

@@ -64,7 +64,7 @@ void PlatformUtilities::beep()
//============================================================================== //==============================================================================
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (disable : 4127) // "Conditional expression is constant" warning #pragma warning (disable : 4127) // "Conditional expression is constant" warning
#endif #endif


+ 1
- 1
build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp View File

@@ -319,7 +319,7 @@ void PlatformUtilities::setCurrentModuleInstanceHandle (void* newHandle)
void PlatformUtilities::fpuReset() void PlatformUtilities::fpuReset()
{ {
#ifdef JUCE_MSVC
#if JUCE_MSVC
_clearfp(); _clearfp();
#endif #endif
} }


+ 4
- 4
build/win32/platform_specific_code/juce_win32_SystemStats.cpp View File

@@ -142,7 +142,7 @@ static juce_noinline unsigned int getCPUIDWord (int* familyModel = 0, int* extFe
unsigned int ext = 0; unsigned int ext = 0;
unsigned int family = 0; unsigned int family = 0;
#ifdef JUCE_GCC
#if JUCE_GCC
unsigned int dummy = 0; unsigned int dummy = 0;
#endif #endif
@@ -150,7 +150,7 @@ static juce_noinline unsigned int getCPUIDWord (int* familyModel = 0, int* extFe
__try __try
#endif #endif
{ {
#ifdef JUCE_GCC
#if JUCE_GCC
__asm__ ("cpuid" : "=a" (family), "=b" (ext), "=c" (dummy),"=d" (cpu) : "a" (1)); __asm__ ("cpuid" : "=a" (family), "=b" (ext), "=c" (dummy),"=d" (cpu) : "a" (1));
#else #else
__asm __asm
@@ -191,7 +191,7 @@ static void juce_getCpuVendor (char* const v)
__try __try
#endif #endif
{ {
#ifdef JUCE_GCC
#if JUCE_GCC
unsigned int dummy = 0; unsigned int dummy = 0;
__asm__ ("cpuid" : "=a" (dummy), "=b" (vendor[0]), "=c" (vendor[2]),"=d" (vendor[1]) : "a" (0)); __asm__ ("cpuid" : "=a" (dummy), "=b" (vendor[0]), "=c" (vendor[2]),"=d" (vendor[1]) : "a" (0));
#else #else
@@ -371,7 +371,7 @@ void SystemStats::initialiseStats() throw()
timeBeginPeriod (1); timeBeginPeriod (1);
#endif #endif
#if JUCE_DEBUG && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
#if defined (JUCE_DEBUG) && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
_CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif #endif
} }


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

@@ -152,7 +152,7 @@ void juce_killThread (void* handle) throw()
void juce_setCurrentThreadName (const String& name) throw() void juce_setCurrentThreadName (const String& name) throw()
{ {
#if JUCE_DEBUG && JUCE_MSVC
#if defined (JUCE_DEBUG) && JUCE_MSVC
struct struct
{ {
DWORD dwType; DWORD dwType;
@@ -302,7 +302,7 @@ void Process::lowerPrivilege()
void Process::terminate() void Process::terminate()
{ {
#if JUCE_DEBUG && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
#if defined (JUCE_DEBUG) && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
_CrtDumpMemoryLeaks(); _CrtDumpMemoryLeaks();
#endif #endif


+ 35
- 21
build/win32/platform_specific_code/juce_win32_Windowing.cpp View File

@@ -282,17 +282,7 @@ public:
SelectObject (hdc, hBitmap); SelectObject (hdc, hBitmap);
static uint8 needsClearing = 0;
if (needsClearing == 0)
{
if ((SystemStats::getOperatingSystemType() & SystemStats::WindowsNT) != 0)
needsClearing = 2;
else
needsClearing = 1;
}
if (format_ == ARGB && needsClearing == 2 && clearImage)
if (format_ == ARGB && clearImage)
zeromem (bitmapData, abs (h * lineStride)); zeromem (bitmapData, abs (h * lineStride));
imageData = bitmapData - (lineStride * (h - 1)); imageData = bitmapData - (lineStride * (h - 1));
@@ -303,11 +293,11 @@ public:
DeleteDC (hdc); DeleteDC (hdc);
DeleteObject (hBitmap); DeleteObject (hBitmap);
imageData = 0; // to stop the base class freeing this imageData = 0; // to stop the base class freeing this
} }
void blitToWindow (HWND hwnd, HDC dc, const bool transparent, void blitToWindow (HWND hwnd, HDC dc, const bool transparent,
int x, int y, const RectangleList& maskedRegion) throw()
const int x, const int y,
const RectangleList& maskedRegion) throw()
{ {
static HDRAWDIB hdd = 0; static HDRAWDIB hdd = 0;
static bool needToCreateDrawDib = true; static bool needToCreateDrawDib = true;
@@ -371,7 +361,7 @@ public:
{ {
for (RectangleList::Iterator i (maskedRegion); i.next();) for (RectangleList::Iterator i (maskedRegion); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
ExcludeClipRect (hdc, r.getX(), r.getY(), r.getRight(), r.getBottom()); ExcludeClipRect (hdc, r.getX(), r.getY(), r.getRight(), r.getBottom());
} }
} }
@@ -388,7 +378,7 @@ public:
for (RectangleList::Iterator i (maskedRegion); i.next();) for (RectangleList::Iterator i (maskedRegion); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
ExcludeClipRect (dc, r.getX(), r.getY(), r.getRight(), r.getBottom()); ExcludeClipRect (dc, r.getX(), r.getY(), r.getRight(), r.getBottom());
} }
} }
@@ -1355,7 +1345,7 @@ private:
while (i.next()) while (i.next())
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
offscreenImage->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); offscreenImage->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight());
} }
} }
@@ -2057,8 +2047,8 @@ private:
} }
else else
{ {
MouseEvent e (0, 0, ModifierKeys::getCurrentModifiersRealtime(), component,
getMouseEventTime(), 0, 0, getMouseEventTime(), 1, false);
const MouseEvent e (0, 0, ModifierKeys::getCurrentModifiersRealtime(), component,
getMouseEventTime(), 0, 0, getMouseEventTime(), 1, false);
if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN) if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN)
{ {
@@ -2176,6 +2166,9 @@ private:
//case WM_IME_STARTCOMPOSITION; //case WM_IME_STARTCOMPOSITION;
// return 0; // return 0;
case WM_GETDLGCODE:
return DLGC_WANTALLKEYS;
default: default:
break; break;
} }
@@ -2261,7 +2254,7 @@ void Desktop::setMousePosition (int x, int y)
} }
//============================================================================== //==============================================================================
BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo)
static BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo)
{ {
Array <Rectangle>* const monitorCoords = (Array <Rectangle>*) userInfo; Array <Rectangle>* const monitorCoords = (Array <Rectangle>*) userInfo;
@@ -2272,12 +2265,14 @@ BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo)
void juce_updateMultiMonitorInfo (Array <Rectangle>& monitorCoords, const bool clipToWorkArea) throw() void juce_updateMultiMonitorInfo (Array <Rectangle>& monitorCoords, const bool clipToWorkArea) throw()
{ {
DynamicLibraryLoader user32Dll ("user32.dll");
/*DynamicLibraryLoader user32Dll ("user32.dll");
DynamicLibraryImport (EnumDisplayMonitors, enumDisplayMonitors, BOOL, user32Dll, DynamicLibraryImport (EnumDisplayMonitors, enumDisplayMonitors, BOOL, user32Dll,
(HDC hdc, LPCRECT lprcClip, MONITORENUMPROC, LPARAM)) (HDC hdc, LPCRECT lprcClip, MONITORENUMPROC, LPARAM))
if (enumDisplayMonitors != 0) if (enumDisplayMonitors != 0)
enumDisplayMonitors (0, 0, &enumMonitorsProc, (LPARAM) &monitorCoords);
enumDisplayMonitors (0, 0, &enumMonitorsProc, (LPARAM) &monitorCoords);*/
EnumDisplayMonitors (0, 0, &enumMonitorsProc, (LPARAM) &monitorCoords);
// make sure the first in the list is the main monitor // make sure the first in the list is the main monitor
for (int i = 1; i < monitorCoords.size(); ++i) for (int i = 1; i < monitorCoords.size(); ++i)
@@ -2899,6 +2894,7 @@ static HDROP createHDrop (const StringArray& fileNames) throw()
LPDROPFILES pDropFiles = (LPDROPFILES) GlobalLock (hDrop); LPDROPFILES pDropFiles = (LPDROPFILES) GlobalLock (hDrop);
pDropFiles->pFiles = sizeof (DROPFILES); pDropFiles->pFiles = sizeof (DROPFILES);
#if JUCE_ENABLE_WIN98_COMPATIBILITY
pDropFiles->fWide = (SystemStats::getOperatingSystemType() & SystemStats::WindowsNT) != 0; pDropFiles->fWide = (SystemStats::getOperatingSystemType() & SystemStats::WindowsNT) != 0;
if (pDropFiles->fWide) if (pDropFiles->fWide)
@@ -2925,6 +2921,19 @@ static HDROP createHDrop (const StringArray& fileNames) throw()
*fname = 0; *fname = 0;
} }
#else
pDropFiles->fWide = true;
WCHAR* fname = (WCHAR*) (((char*) pDropFiles) + sizeof (DROPFILES));
for (int i = 0; i < fileNames.size(); ++i)
{
fileNames[i].copyToBuffer (fname, 2048);
fname += fileNames[i].length() + 1;
}
*fname = 0;
#endif
GlobalUnlock (hDrop); GlobalUnlock (hDrop);
} }
@@ -2967,6 +2976,7 @@ bool DragAndDropContainer::performExternalDragDropOfText (const String& text)
medium.hGlobal = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, (numChars + 2) * sizeof (WCHAR)); medium.hGlobal = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, (numChars + 2) * sizeof (WCHAR));
char* d = (char*) GlobalLock (medium.hGlobal); char* d = (char*) GlobalLock (medium.hGlobal);
#if JUCE_ENABLE_WIN98_COMPATIBILITY
if ((SystemStats::getOperatingSystemType() & SystemStats::WindowsNT) != 0) if ((SystemStats::getOperatingSystemType() & SystemStats::WindowsNT) != 0)
{ {
text.copyToBuffer ((WCHAR*) d, numChars + 1); text.copyToBuffer ((WCHAR*) d, numChars + 1);
@@ -2976,6 +2986,10 @@ bool DragAndDropContainer::performExternalDragDropOfText (const String& text)
{ {
text.copyToBuffer (d, numChars + 1); text.copyToBuffer (d, numChars + 1);
} }
#else
text.copyToBuffer ((WCHAR*) d, numChars + 1);
format.cfFormat = CF_UNICODETEXT;
#endif
GlobalUnlock (medium.hGlobal); GlobalUnlock (medium.hGlobal);


+ 1
- 0
docs/JUCE changelist.txt View File

@@ -12,6 +12,7 @@ Changelist for version 1.44
- added the JUCE_LOG_ASSERTIONS flag, which can automatically log assertion failures, even in release builds. - added the JUCE_LOG_ASSERTIONS flag, which can automatically log assertion failures, even in release builds.
- new classes DirectoryContentsDisplayComponent and FileTreeComponent, allow a view of a directory as either a list or treeview. I've added a demo of the FileTreeComponent to the treeviews section of the Juce Demo. There's also now an option in the FileBrowserComponent constructor to use a treeview. - new classes DirectoryContentsDisplayComponent and FileTreeComponent, allow a view of a directory as either a list or treeview. I've added a demo of the FileTreeComponent to the treeviews section of the Juce Demo. There's also now an option in the FileBrowserComponent constructor to use a treeview.
- small change to the strictness of the way TreeViews handle their root items. Be careful now to never delete a tree's root item until either the treeview has been deleted, or until you've removed the root from the tree using setRootItem (0). Not doing this can now cause a crash in the tree's destructor, where it expects the root to still be valid. - small change to the strictness of the way TreeViews handle their root items. Be careful now to never delete a tree's root item until either the treeview has been deleted, or until you've removed the root from the tree using setRootItem (0). Not doing this can now cause a crash in the tree's destructor, where it expects the root to still be valid.
- added some virtual methods to TextEditor to allow customisation of its popup menu.




============================================================================== ==============================================================================


+ 5
- 3
extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp View File

@@ -105,10 +105,11 @@ BEGIN_JUCE_NAMESPACE
extern void juce_macDoPendingRepaintsNow(); extern void juce_macDoPendingRepaintsNow();
#elif JUCE_LINUX #elif JUCE_LINUX
extern Display* display; extern Display* display;
extern bool juce_dispatchNextMessageOnSystemQueue (bool);
extern bool juce_postMessageToSystemQueue (void* message);
#endif #endif
END_JUCE_NAMESPACE END_JUCE_NAMESPACE
//============================================================================== //==============================================================================
#if JUCE_WIN32 #if JUCE_WIN32
@@ -173,7 +174,7 @@ public:
const int quitMessageId = 0xfffff321; const int quitMessageId = 0xfffff321;
Message* const m = new Message (quitMessageId, 1, 0, 0); Message* const m = new Message (quitMessageId, 1, 0, 0);
if (! juce_postMessageToSystemQueue (m, true))
if (! juce_postMessageToSystemQueue (m))
delete m; delete m;
clearSingletonInstance(); clearSingletonInstance();
@@ -325,6 +326,7 @@ public:
cEffect.flags |= effFlagsHasEditor; cEffect.flags |= effFlagsHasEditor;
setUniqueID ((int) (JucePlugin_VSTUniqueID)); setUniqueID ((int) (JucePlugin_VSTUniqueID));
getAeffect()->version = (long) (JucePlugin_VersionCode);
#if JucePlugin_WantsMidiInput && ! JUCE_USE_VSTSDK_2_4 #if JucePlugin_WantsMidiInput && ! JUCE_USE_VSTSDK_2_4
wantEvents(); wantEvents();
@@ -541,7 +543,7 @@ public:
if (! isProcessing) if (! isProcessing)
resume(); resume();
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
const int numMidiEventsComingIn = midiEvents.getNumEvents(); const int numMidiEventsComingIn = midiEvents.getNumEvents();
#endif #endif


+ 1
- 1
extras/juce demo/src/MainDemoWindow.cpp View File

@@ -432,7 +432,7 @@ public:
break; break;
case showOpenGL: case showOpenGL:
#ifdef JUCE_OPENGL
#if JUCE_OPENGL
showDemo (createOpenGLDemo(), BinaryData::opengldemo_cpp); showDemo (createOpenGLDemo(), BinaryData::opengldemo_cpp);
currentDemoId = showOpenGL; currentDemoId = showOpenGL;
#endif #endif


+ 1
- 1
juce.h View File

@@ -120,7 +120,7 @@ END_JUCE_NAMESPACE
Note that this can be disabled by defining DONT_AUTOLINK_TO_JUCE_LIBRARY before Note that this can be disabled by defining DONT_AUTOLINK_TO_JUCE_LIBRARY before
including this header file. including this header file.
*/ */
#ifdef JUCE_MSVC
#if JUCE_MSVC
#ifndef DONT_AUTOLINK_TO_JUCE_LIBRARY #ifndef DONT_AUTOLINK_TO_JUCE_LIBRARY


+ 1
- 1
src/juce_DefineMacros.h View File

@@ -51,7 +51,7 @@
// on the Mac, these symbols are defined in the Mac libraries, so // on the Mac, these symbols are defined in the Mac libraries, so
// these macros make it easier to reference them without writing out // these macros make it easier to reference them without writing out
// the namespace every time. // the namespace every time.
#ifdef JUCE_MAC
#if JUCE_MAC
#define Component JUCE_NAMESPACE::Component #define Component JUCE_NAMESPACE::Component
#define MemoryBlock JUCE_NAMESPACE::MemoryBlock #define MemoryBlock JUCE_NAMESPACE::MemoryBlock
#define Point JUCE_NAMESPACE::Point #define Point JUCE_NAMESPACE::Point


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

@@ -31,7 +31,7 @@
#include "../../juce_core/basics/juce_StandardHeader.h" #include "../../juce_core/basics/juce_StandardHeader.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (push) #pragma warning (push)
#pragma warning (disable: 4245 4514 4100) #pragma warning (disable: 4245 4514 4100)
#include <crtdbg.h> #include <crtdbg.h>


+ 1
- 1
src/juce_appframework/application/juce_PropertiesFile.cpp View File

@@ -250,7 +250,7 @@ const File PropertiesFile::getDefaultAppSettingsFile (const String& applicationN
// mustn't have illegal characters in this name.. // mustn't have illegal characters in this name..
jassert (applicationName == File::createLegalFileName (applicationName)); jassert (applicationName == File::createLegalFileName (applicationName));
#ifdef JUCE_MAC
#if JUCE_MAC
File dir (commonToAllUsers ? "/Library/Preferences" File dir (commonToAllUsers ? "/Library/Preferences"
: "~/Library/Preferences"); : "~/Library/Preferences");


+ 21
- 21
src/juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.cpp View File

@@ -200,8 +200,8 @@ public:
right += startOffsetInDestBuffer; right += startOffsetInDestBuffer;
// (keep this a multiple of 3) // (keep this a multiple of 3)
const int tempBufSize = 1440 * 16;
char tempBuffer[tempBufSize];
const int tempBufSize = 1440 * 4;
char tempBuffer [tempBufSize];
while (num > 0) while (num > 0)
{ {
@@ -215,7 +215,7 @@ public:
{ {
if (littleEndian) if (littleEndian)
{ {
const short* src = (const short*)tempBuffer;
const short* src = (const short*) tempBuffer;
if (numChannels > 1) if (numChannels > 1)
{ {
@@ -223,7 +223,7 @@ public:
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*right++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*right++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
++src; ++src;
} }
} }
@@ -232,15 +232,15 @@ public:
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
++src; ++src;
*left++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*left++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
} }
} }
else else
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*right++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*left++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
*right++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
} }
} }
} }
@@ -248,13 +248,13 @@ public:
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*left++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
} }
} }
} }
else else
{ {
const char* src = (const char*)tempBuffer;
const char* src = (const char*) tempBuffer;
if (numChannels > 1) if (numChannels > 1)
{ {
@@ -385,9 +385,9 @@ public:
} }
else if (bitsPerSample == 32) else if (bitsPerSample == 32)
{ {
const unsigned int* src = (const unsigned int*)tempBuffer;
unsigned int* l = (unsigned int*)left;
unsigned int* r = (unsigned int*)right;
const unsigned int* src = (const unsigned int*) tempBuffer;
unsigned int* l = (unsigned int*) left;
unsigned int* r = (unsigned int*) right;
if (littleEndian) if (littleEndian)
{ {
@@ -464,12 +464,12 @@ public:
} }
} }
left = (int*)l;
right = (int*)r;
left = (int*) l;
right = (int*) r;
} }
else if (bitsPerSample == 8) else if (bitsPerSample == 8)
{ {
const char* src = (const char*)tempBuffer;
const char* src = (const char*) tempBuffer;
if (numChannels > 1) if (numChannels > 1)
{ {
@@ -477,7 +477,7 @@ public:
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*right++ = ((int)*src++) << 24;
*right++ = ((int) *src++) << 24;
++src; ++src;
} }
} }
@@ -486,15 +486,15 @@ public:
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
++src; ++src;
*left++ = ((int)*src++) << 24;
*left++ = ((int) *src++) << 24;
} }
} }
else else
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = ((int)*src++) << 24;
*right++ = ((int)*src++) << 24;
*left++ = ((int) *src++) << 24;
*right++ = ((int) *src++) << 24;
} }
} }
} }
@@ -502,7 +502,7 @@ public:
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = ((int)*src++) << 24;
*left++ = ((int) *src++) << 24;
} }
} }
} }
@@ -797,7 +797,7 @@ bool AiffAudioFormat::canDoMono()
return true; return true;
} }
#ifdef JUCE_MAC
#if JUCE_MAC
bool AiffAudioFormat::canHandleFile (const File& f) bool AiffAudioFormat::canHandleFile (const File& f)
{ {
if (AudioFormat::canHandleFile (f)) if (AudioFormat::canHandleFile (f))


+ 1
- 1
src/juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.h View File

@@ -56,7 +56,7 @@ public:
const Array <int> getPossibleBitDepths(); const Array <int> getPossibleBitDepths();
bool canDoStereo(); bool canDoStereo();
bool canDoMono(); bool canDoMono();
#ifdef JUCE_MAC
#if JUCE_MAC
bool canHandleFile (const File& fileToTest); bool canHandleFile (const File& fileToTest);
#endif #endif


+ 1
- 1
src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.cpp View File

@@ -33,7 +33,7 @@
BEGIN_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE
#ifdef JUCE_MAC
#if JUCE_MAC
//============================================================================== //==============================================================================
// Mac version doesn't need any native code because it's all done with files.. // Mac version doesn't need any native code because it's all done with files..


+ 2
- 2
src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.h View File

@@ -34,7 +34,7 @@
#include "juce_AudioFormatReader.h" #include "juce_AudioFormatReader.h"
#include "../../../juce_core/text/juce_StringArray.h" #include "../../../juce_core/text/juce_StringArray.h"
#ifdef JUCE_MAC
#if JUCE_MAC
#include "../../../juce_core/io/files/juce_File.h" #include "../../../juce_core/io/files/juce_File.h"
#endif #endif
@@ -154,7 +154,7 @@ public:
private: private:
#ifdef JUCE_MAC
#if JUCE_MAC
File volumeDir; File volumeDir;
OwnedArray<File> tracks; OwnedArray<File> tracks;
Array <int> trackStartSamples; Array <int> trackStartSamples;


+ 2
- 2
src/juce_appframework/audio/audio_file_formats/juce_AudioFormat.cpp View File

@@ -430,9 +430,9 @@ bool AudioFormatWriter::writeFromAudioSource (AudioSource& source,
int* b = *bufferChan++; int* b = *bufferChan++;
// float -> int // float -> int
for (int i = 0; i < numToDo; ++i)
for (int j = numToDo; --j >= 0;)
{ {
const double samp = *(const float*)b;
const double samp = *(const float*) b;
if (samp <= -1.0) if (samp <= -1.0)
*b++ = INT_MIN; *b++ = INT_MIN;


+ 1
- 1
src/juce_appframework/audio/audio_file_formats/juce_AudioFormatManager.cpp View File

@@ -84,7 +84,7 @@ void AudioFormatManager::registerFormat (AudioFormat* newFormat,
void AudioFormatManager::registerBasicFormats() void AudioFormatManager::registerBasicFormats()
{ {
#ifdef JUCE_MAC
#if JUCE_MAC
registerFormat (new AiffAudioFormat(), true); registerFormat (new AiffAudioFormat(), true);
registerFormat (new WavAudioFormat(), false); registerFormat (new WavAudioFormat(), false);
#else #else


+ 1
- 1
src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp View File

@@ -406,7 +406,7 @@ public:
buffer[10] = (uint8) ((info.sample_rate >> 12) & 0xff); buffer[10] = (uint8) ((info.sample_rate >> 12) & 0xff);
buffer[11] = (uint8) ((info.sample_rate >> 4) & 0xff); buffer[11] = (uint8) ((info.sample_rate >> 4) & 0xff);
buffer[12] = (uint8) (((info.sample_rate & 0x0f) << 4) | (channelsMinus1 << 1) | (bitsMinus1 >> 4)); buffer[12] = (uint8) (((info.sample_rate & 0x0f) << 4) | (channelsMinus1 << 1) | (bitsMinus1 >> 4));
buffer[13] = (FLAC__byte) (((bitsMinus1 & 0x0f) << 4) | ((info.total_samples >> 32) & 0x0f));
buffer[13] = (FLAC__byte) (((bitsMinus1 & 0x0f) << 4) | (unsigned int) ((info.total_samples >> 32) & 0x0f));
packUint32 ((FLAC__uint32) info.total_samples, buffer + 14, 4); packUint32 ((FLAC__uint32) info.total_samples, buffer + 14, 4);
memcpy (buffer + 18, info.md5sum, 16); memcpy (buffer + 18, info.md5sum, 16);


+ 1
- 1
src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp View File

@@ -35,7 +35,7 @@
#include "../../../juce_core/basics/juce_StandardHeader.h" #include "../../../juce_core/basics/juce_StandardHeader.h"
#ifdef JUCE_MAC
#if JUCE_MAC
#define __MACOSX__ 1 #define __MACOSX__ 1
#endif #endif


+ 27
- 23
src/juce_appframework/audio/audio_file_formats/juce_WavAudioFormat.cpp View File

@@ -74,7 +74,7 @@ const StringPairArray WavAudioFormat::createBWAVMetadata (const String& descript
//============================================================================== //==============================================================================
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma pack (push, 1) #pragma pack (push, 1)
#define PACKED #define PACKED
#elif defined (JUCE_GCC) #elif defined (JUCE_GCC)
@@ -150,7 +150,7 @@ struct BWAVChunk
} PACKED; } PACKED;
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma pack (pop) #pragma pack (pop)
#endif #endif
@@ -221,9 +221,13 @@ public:
{ {
// Broadcast-wav extension chunk.. // Broadcast-wav extension chunk..
BWAVChunk* const bwav = (BWAVChunk*) juce_calloc (jmax (length + 1, (int) sizeof (BWAVChunk))); BWAVChunk* const bwav = (BWAVChunk*) juce_calloc (jmax (length + 1, (int) sizeof (BWAVChunk)));
input->read (bwav, length);
bwav->copyTo (metadataValues);
juce_free (bwav);
if (bwav != 0)
{
input->read (bwav, length);
bwav->copyTo (metadataValues);
juce_free (bwav);
}
} }
else if ((hasGotType && hasGotData) || chunkEnd <= input->getPosition()) else if ((hasGotType && hasGotData) || chunkEnd <= input->getPosition())
{ {
@@ -268,7 +272,7 @@ public:
start = 0; start = 0;
} }
int numToDo = (int) jlimit ((int64) 0, (int64) numSamples, lengthInSamples - start);
const int numToDo = (int) jlimit ((int64) 0, (int64) numSamples, lengthInSamples - start);
if (numToDo > 0) if (numToDo > 0)
{ {
@@ -284,8 +288,8 @@ public:
right += startOffsetInDestBuffer; right += startOffsetInDestBuffer;
// (keep this a multiple of 3) // (keep this a multiple of 3)
const int tempBufSize = 1440 * 16;
char tempBuffer[tempBufSize];
const int tempBufSize = 1440 * 4;
char tempBuffer [tempBufSize];
while (num > 0) while (num > 0)
{ {
@@ -297,7 +301,7 @@ public:
if (bitsPerSample == 16) if (bitsPerSample == 16)
{ {
const short* src = (const short*)tempBuffer;
const short* src = (const short*) tempBuffer;
if (numChannels > 1) if (numChannels > 1)
{ {
@@ -306,14 +310,14 @@ public:
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
++src; ++src;
*right++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*right++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
} }
} }
else if (right == 0) else if (right == 0)
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*left++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
++src; ++src;
} }
} }
@@ -321,8 +325,8 @@ public:
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*right++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*left++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
*right++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
} }
} }
} }
@@ -330,13 +334,13 @@ public:
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = (int) swapIfBigEndian ((unsigned short)*src++) << 16;
*left++ = (int) swapIfBigEndian ((unsigned short) *src++) << 16;
} }
} }
} }
else if (bitsPerSample == 24) else if (bitsPerSample == 24)
{ {
const char* src = (const char*)tempBuffer;
const char* src = (const char*) tempBuffer;
if (numChannels > 1) if (numChannels > 1)
{ {
@@ -378,9 +382,9 @@ public:
} }
else if (bitsPerSample == 32) else if (bitsPerSample == 32)
{ {
const unsigned int* src = (const unsigned int*)tempBuffer;
unsigned int* l = (unsigned int*)left;
unsigned int* r = (unsigned int*)right;
const unsigned int* src = (const unsigned int*) tempBuffer;
unsigned int* l = (unsigned int*) left;
unsigned int* r = (unsigned int*) right;
if (numChannels > 1) if (numChannels > 1)
{ {
@@ -422,7 +426,7 @@ public:
} }
else if (bitsPerSample == 8) else if (bitsPerSample == 8)
{ {
const unsigned char* src = (const unsigned char*)tempBuffer;
const unsigned char* src = (const unsigned char*) tempBuffer;
if (numChannels > 1) if (numChannels > 1)
{ {
@@ -431,14 +435,14 @@ public:
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
++src; ++src;
*right++ = ((int)*src++ - 128) << 24;
*right++ = ((int) *src++ - 128) << 24;
} }
} }
else if (right == 0) else if (right == 0)
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = ((int)*src++ - 128) << 24;
*left++ = ((int) *src++ - 128) << 24;
++src; ++src;
} }
} }
@@ -446,8 +450,8 @@ public:
{ {
for (int i = numThisTime; --i >= 0;) for (int i = numThisTime; --i >= 0;)
{ {
*left++ = ((int)*src++ - 128) << 24;
*right++ = ((int)*src++ - 128) << 24;
*left++ = ((int) *src++ - 128) << 24;
*right++ = ((int) *src++ - 128) << 24;
} }
} }
} }


+ 1
- 1
src/juce_appframework/audio/audio_sources/juce_ResamplingAudioSource.cpp View File

@@ -229,7 +229,7 @@ void ResamplingAudioSource::applyFilter (float* samples, int num, FilterState& f
- coefficients[4] * fs.y1 - coefficients[4] * fs.y1
- coefficients[5] * fs.y2; - coefficients[5] * fs.y2;
#ifdef JUCE_INTEL
#if JUCE_INTEL
if (! (out < -1.0e-8 || out > 1.0e-8)) if (! (out < -1.0e-8 || out > 1.0e-8))
out = 0; out = 0;
#endif #endif


+ 2
- 2
src/juce_appframework/audio/dsp/juce_AudioDataConverters.cpp View File

@@ -102,7 +102,7 @@ void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* de
if (source != (const float*) dest) if (source != (const float*) dest)
memcpy (dest, source, numSamples * sizeof (float)); memcpy (dest, source, numSamples * sizeof (float));
#ifdef JUCE_BIG_ENDIAN
#if JUCE_BIG_ENDIAN
uint32* const data = (uint32*) dest; uint32* const data = (uint32*) dest;
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
@@ -115,7 +115,7 @@ void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* de
if (source != (const float*) dest) if (source != (const float*) dest)
memcpy (dest, source, numSamples * sizeof (float)); memcpy (dest, source, numSamples * sizeof (float));
#ifdef JUCE_LITTLE_ENDIAN
#if JUCE_LITTLE_ENDIAN
uint32* const data = (uint32*) dest; uint32* const data = (uint32*) dest;
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)


+ 5
- 6
src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp View File

@@ -502,9 +502,9 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader,
if (! reader->usesFloatingPointData) if (! reader->usesFloatingPointData)
{ {
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
{ {
float* const d = (float*)(chans[i]);
float* const d = (float*) (chans[j]);
if (d != 0) if (d != 0)
{ {
@@ -550,7 +550,6 @@ void AudioSampleBuffer::writeToAudioWriter (AudioFormatWriter* writer,
} }
else else
{ {
int* chans [3];
chans[0] = (int*) juce_malloc (sizeof (int) * numSamples * 2); chans[0] = (int*) juce_malloc (sizeof (int) * numSamples * 2);
if (numChannels > 1) if (numChannels > 1)
@@ -560,13 +559,13 @@ void AudioSampleBuffer::writeToAudioWriter (AudioFormatWriter* writer,
chans[2] = 0; chans[2] = 0;
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
{ {
int* const dest = chans[i];
int* const dest = chans[j];
if (dest != 0) if (dest != 0)
{ {
const float* const src = channels [i] + startSample;
const float* const src = channels [j] + startSample;
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {


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

@@ -315,7 +315,7 @@ void juce_callAnyTimersSynchronously()
} }
//============================================================================== //==============================================================================
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
static SortedSet <Timer*> activeTimers; static SortedSet <Timer*> activeTimers;
#endif #endif
@@ -325,7 +325,7 @@ Timer::Timer() throw()
previous (0), previous (0),
next (0) next (0)
{ {
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
activeTimers.add (this); activeTimers.add (this);
#endif #endif
} }
@@ -336,7 +336,7 @@ Timer::Timer (const Timer&) throw()
previous (0), previous (0),
next (0) next (0)
{ {
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
activeTimers.add (this); activeTimers.add (this);
#endif #endif
} }
@@ -345,7 +345,7 @@ Timer::~Timer()
{ {
stopTimer(); stopTimer();
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
activeTimers.removeValue (this); activeTimers.removeValue (this);
#endif #endif
} }
@@ -354,7 +354,7 @@ void Timer::startTimer (const int interval) throw()
{ {
const ScopedLock sl (InternalTimerThread::lock); const ScopedLock sl (InternalTimerThread::lock);
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
// this isn't a valid object! Your timer might be a dangling pointer or something.. // this isn't a valid object! Your timer might be a dangling pointer or something..
jassert (activeTimers.contains (this)); jassert (activeTimers.contains (this));
#endif #endif
@@ -375,7 +375,7 @@ void Timer::stopTimer() throw()
{ {
const ScopedLock sl (InternalTimerThread::lock); const ScopedLock sl (InternalTimerThread::lock);
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
// this isn't a valid object! Your timer might be a dangling pointer or something.. // this isn't a valid object! Your timer might be a dangling pointer or something..
jassert (activeTimers.contains (this)); jassert (activeTimers.contains (this));
#endif #endif


+ 93
- 83
src/juce_appframework/gui/components/controls/juce_TextEditor.cpp View File

@@ -34,7 +34,6 @@
BEGIN_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE
#include "juce_TextEditor.h" #include "juce_TextEditor.h"
#include "../menus/juce_PopupMenu.h"
#include "../../graphics/fonts/juce_GlyphArrangement.h" #include "../../graphics/fonts/juce_GlyphArrangement.h"
#include "../../../application/juce_SystemClipboard.h" #include "../../../application/juce_SystemClipboard.h"
#include "../../../../juce_core/basics/juce_Time.h" #include "../../../../juce_core/basics/juce_Time.h"
@@ -874,7 +873,6 @@ TextEditor::TextEditor (const String& name,
popupMenuEnabled (true), popupMenuEnabled (true),
selectAllTextWhenFocused (false), selectAllTextWhenFocused (false),
scrollbarVisible (true), scrollbarVisible (true),
menuVisible (false),
wasFocused (false), wasFocused (false),
caretFlashState (true), caretFlashState (true),
keepCursorOnScreen (true), keepCursorOnScreen (true),
@@ -913,7 +911,7 @@ TextEditor::~TextEditor()
} }
//============================================================================== //==============================================================================
void TextEditor::newTransaction()
void TextEditor::newTransaction() throw()
{ {
lastTransactionTime = Time::getApproximateMillisecondCounter(); lastTransactionTime = Time::getApproximateMillisecondCounter();
undoManager.beginNewTransaction(); undoManager.beginNewTransaction();
@@ -1109,7 +1107,7 @@ void TextEditor::setText (const String& newText,
} }
//============================================================================== //==============================================================================
void TextEditor::textChanged()
void TextEditor::textChanged() throw()
{ {
updateTextHolderSize(); updateTextHolderSize();
postCommandMessage (textChangeMessageId); postCommandMessage (textChangeMessageId);
@@ -1198,7 +1196,7 @@ void TextEditor::repaintText (int textStartIndex, int textEndIndex)
} }
//============================================================================== //==============================================================================
void TextEditor::moveCaret (int newCaretPos)
void TextEditor::moveCaret (int newCaretPos) throw()
{ {
if (newCaretPos < 0) if (newCaretPos < 0)
newCaretPos = 0; newCaretPos = 0;
@@ -1216,12 +1214,12 @@ void TextEditor::moveCaret (int newCaretPos)
} }
} }
void TextEditor::setCaretPosition (const int newIndex)
void TextEditor::setCaretPosition (const int newIndex) throw()
{ {
moveCursorTo (newIndex, false); moveCursorTo (newIndex, false);
} }
int TextEditor::getCaretPosition() const
int TextEditor::getCaretPosition() const throw()
{ {
return caretPosition; return caretPosition;
} }
@@ -1233,7 +1231,7 @@ float TextEditor::getWordWrapWidth() const throw()
: 1.0e10f; : 1.0e10f;
} }
void TextEditor::updateTextHolderSize()
void TextEditor::updateTextHolderSize() throw()
{ {
const float wordWrapWidth = getWordWrapWidth(); const float wordWrapWidth = getWordWrapWidth();
@@ -1254,24 +1252,24 @@ void TextEditor::updateTextHolderSize()
} }
} }
int TextEditor::getTextWidth() const
int TextEditor::getTextWidth() const throw()
{ {
return textHolder->getWidth(); return textHolder->getWidth();
} }
int TextEditor::getTextHeight() const
int TextEditor::getTextHeight() const throw()
{ {
return textHolder->getHeight(); return textHolder->getHeight();
} }
void TextEditor::setIndents (const int newLeftIndent, void TextEditor::setIndents (const int newLeftIndent,
const int newTopIndent)
const int newTopIndent) throw()
{ {
leftIndent = newLeftIndent; leftIndent = newLeftIndent;
topIndent = newTopIndent; topIndent = newTopIndent;
} }
void TextEditor::setBorder (const BorderSize& border)
void TextEditor::setBorder (const BorderSize& border) throw()
{ {
borderSize = border; borderSize = border;
resized(); resized();
@@ -1287,7 +1285,7 @@ void TextEditor::setScrollToShowCursor (const bool shouldScrollToShowCursor) thr
keepCursorOnScreen = shouldScrollToShowCursor; keepCursorOnScreen = shouldScrollToShowCursor;
} }
void TextEditor::scrollToMakeSureCursorIsVisible()
void TextEditor::scrollToMakeSureCursorIsVisible() throw()
{ {
cursorHeight = currentFont.getHeight(); // (in case the text is empty and the call below doesn't set this value) cursorHeight = currentFont.getHeight(); // (in case the text is empty and the call below doesn't set this value)
@@ -1337,7 +1335,7 @@ void TextEditor::scrollToMakeSureCursorIsVisible()
} }
void TextEditor::moveCursorTo (const int newPosition, void TextEditor::moveCursorTo (const int newPosition,
const bool isSelecting)
const bool isSelecting) throw()
{ {
if (isSelecting) if (isSelecting)
{ {
@@ -1389,7 +1387,7 @@ void TextEditor::moveCursorTo (const int newPosition,
} }
int TextEditor::getTextIndexAt (const int x, int TextEditor::getTextIndexAt (const int x,
const int y)
const int y) throw()
{ {
return indexAtPosition ((float) (x + viewport->getViewPositionX() - leftIndent), return indexAtPosition ((float) (x + viewport->getViewPositionX() - leftIndent),
(float) (y + viewport->getViewPositionY() - topIndent)); (float) (y + viewport->getViewPositionY() - topIndent));
@@ -1424,7 +1422,7 @@ void TextEditor::insertTextAtCursor (String newText)
textChanged(); textChanged();
} }
void TextEditor::setHighlightedRegion (int startPos, int numChars)
void TextEditor::setHighlightedRegion (int startPos, int numChars) throw()
{ {
moveCursorTo (startPos, false); moveCursorTo (startPos, false);
moveCursorTo (startPos + numChars, true); moveCursorTo (startPos + numChars, true);
@@ -1578,55 +1576,13 @@ void TextEditor::mouseDown (const MouseEvent& e)
} }
else else
{ {
const bool writable = ! isReadOnly();
PopupMenu m; PopupMenu m;
m.addItem (1, TRANS("cut"), writable);
m.addItem (2, TRANS("copy"), selectionStart < selectionEnd);
m.addItem (3, TRANS("paste"), writable);
m.addItem (4, TRANS("delete"), writable);
m.addSeparator();
m.addItem (5, TRANS("select all"));
m.addSeparator();
m.addItem (6, TRANS("undo"), undoManager.canUndo());
m.addItem (7, TRANS("redo"), undoManager.canRedo());
menuVisible = true;
switch (m.show())
{
case 1:
copy();
cut();
break;
case 2:
copy();
break;
case 3:
paste();
break;
case 4:
cut();
break;
addPopupMenuItems (m);
case 5:
moveCursorTo (getTotalNumChars(), false);
moveCursorTo (0, true);
break;
case 6:
doUndoRedo (false);
break;
const int result = m.show();
case 7:
doUndoRedo (true);
break;
}
menuVisible = false;
if (result != 0)
performPopupMenuAction (result);
} }
} }
} }
@@ -1872,13 +1828,9 @@ void TextEditor::keyPressed (const KeyPress& key)
newTransaction(); newTransaction();
if (returnKeyStartsNewLine) if (returnKeyStartsNewLine)
{
insertTextAtCursor (T("\n")); insertTextAtCursor (T("\n"));
}
else else
{
returnPressed(); returnPressed();
}
} }
} }
else if (key.isKeyCode (KeyPress::escapeKey)) else if (key.isKeyCode (KeyPress::escapeKey))
@@ -1907,6 +1859,63 @@ void TextEditor::keyStateChanged()
// (overridden to avoid forwarding key events to the parent) // (overridden to avoid forwarding key events to the parent)
} }
//==============================================================================
const int baseMenuItemID = 0x7fff0000;
void TextEditor::addPopupMenuItems (PopupMenu& m)
{
const bool writable = ! isReadOnly();
m.addItem (baseMenuItemID + 1, TRANS("cut"), writable);
m.addItem (baseMenuItemID + 2, TRANS("copy"), selectionStart < selectionEnd);
m.addItem (baseMenuItemID + 3, TRANS("paste"), writable);
m.addItem (baseMenuItemID + 4, TRANS("delete"), writable);
m.addSeparator();
m.addItem (baseMenuItemID + 5, TRANS("select all"));
m.addSeparator();
m.addItem (baseMenuItemID + 6, TRANS("undo"), undoManager.canUndo());
m.addItem (baseMenuItemID + 7, TRANS("redo"), undoManager.canRedo());
}
void TextEditor::performPopupMenuAction (const int menuItemID)
{
switch (menuItemID)
{
case baseMenuItemID + 1:
copy();
cut();
break;
case baseMenuItemID + 2:
copy();
break;
case baseMenuItemID + 3:
paste();
break;
case baseMenuItemID + 4:
cut();
break;
case baseMenuItemID + 5:
moveCursorTo (getTotalNumChars(), false);
moveCursorTo (0, true);
break;
case baseMenuItemID + 6:
doUndoRedo (false);
break;
case baseMenuItemID + 7:
doUndoRedo (true);
break;
default:
break;
}
}
//============================================================================== //==============================================================================
void TextEditor::focusGained (FocusChangeType) void TextEditor::focusGained (FocusChangeType)
{ {
@@ -1960,7 +1969,7 @@ void TextEditor::resized()
} }
} }
void TextEditor::handleCommandMessage (int commandId)
void TextEditor::handleCommandMessage (const int commandId)
{ {
const ComponentDeletionWatcher deletionChecker (this); const ComponentDeletionWatcher deletionChecker (this);
@@ -2007,7 +2016,7 @@ void TextEditor::enablementChanged()
} }
//============================================================================== //==============================================================================
void TextEditor::clearInternal (UndoManager* const um)
void TextEditor::clearInternal (UndoManager* const um) throw()
{ {
remove (0, getTotalNumChars(), um, caretPosition); remove (0, getTotalNumChars(), um, caretPosition);
} }
@@ -2017,7 +2026,7 @@ void TextEditor::insert (const String& text,
const Font& font, const Font& font,
const Colour& colour, const Colour& colour,
UndoManager* const um, UndoManager* const um,
const int caretPositionToMoveTo)
const int caretPositionToMoveTo) throw()
{ {
if (text.isNotEmpty()) if (text.isNotEmpty())
{ {
@@ -2075,7 +2084,7 @@ void TextEditor::insert (const String& text,
} }
void TextEditor::reinsert (const int insertIndex, void TextEditor::reinsert (const int insertIndex,
const VoidArray sectionsToInsert)
const VoidArray& sectionsToInsert) throw()
{ {
int index = 0; int index = 0;
int nextIndex = 0; int nextIndex = 0;
@@ -2114,10 +2123,10 @@ void TextEditor::reinsert (const int insertIndex,
totalNumChars = -1; totalNumChars = -1;
} }
void TextEditor::remove (int startIndex,
void TextEditor::remove (const int startIndex,
int endIndex, int endIndex,
UndoManager* const um, UndoManager* const um,
const int caretPositionToMoveTo)
const int caretPositionToMoveTo) throw()
{ {
if (endIndex > startIndex) if (endIndex > startIndex)
{ {
@@ -2210,7 +2219,7 @@ void TextEditor::remove (int startIndex,
} }
//============================================================================== //==============================================================================
const String TextEditor::getText() const
const String TextEditor::getText() const throw()
{ {
String t; String t;
@@ -2220,7 +2229,7 @@ const String TextEditor::getText() const
return t; return t;
} }
const String TextEditor::getTextSubstring (const int startCharacter, const int endCharacter) const
const String TextEditor::getTextSubstring (const int startCharacter, const int endCharacter) const throw()
{ {
String t; String t;
int index = 0; int index = 0;
@@ -2251,7 +2260,7 @@ const String TextEditor::getHighlightedText() const throw()
getHighlightedRegionStart() + getHighlightedRegionLength()); getHighlightedRegionStart() + getHighlightedRegionLength());
} }
int TextEditor::getTotalNumChars()
int TextEditor::getTotalNumChars() throw()
{ {
if (totalNumChars < 0) if (totalNumChars < 0)
{ {
@@ -2264,7 +2273,7 @@ int TextEditor::getTotalNumChars()
return totalNumChars; return totalNumChars;
} }
bool TextEditor::isEmpty() const
bool TextEditor::isEmpty() const throw()
{ {
if (totalNumChars != 0) if (totalNumChars != 0)
{ {
@@ -2276,7 +2285,7 @@ bool TextEditor::isEmpty() const
return true; return true;
} }
void TextEditor::getCharPosition (const int index, float& cx, float& cy, float& lineHeight)
void TextEditor::getCharPosition (const int index, float& cx, float& cy, float& lineHeight) const throw()
{ {
const float wordWrapWidth = getWordWrapWidth(); const float wordWrapWidth = getWordWrapWidth();
@@ -2308,7 +2317,7 @@ void TextEditor::getCharPosition (const int index, float& cx, float& cy, float&
lineHeight = currentFont.getHeight(); lineHeight = currentFont.getHeight();
} }
int TextEditor::indexAtPosition (const float x, const float y)
int TextEditor::indexAtPosition (const float x, const float y) throw()
{ {
const float wordWrapWidth = getWordWrapWidth(); const float wordWrapWidth = getWordWrapWidth();
@@ -2341,10 +2350,11 @@ int TextEditor::indexAtPosition (const float x, const float y)
//============================================================================== //==============================================================================
static int getCharacterCategory (const tchar character) throw() static int getCharacterCategory (const tchar character) throw()
{ {
return CharacterFunctions::isLetterOrDigit (character) ? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1);
return CharacterFunctions::isLetterOrDigit (character)
? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1);
} }
int TextEditor::findWordBreakAfter (int position) const
int TextEditor::findWordBreakAfter (int position) const throw()
{ {
const String t (getTextSubstring (position, position + 512)); const String t (getTextSubstring (position, position + 512));
const int totalLength = t.length(); const int totalLength = t.length();
@@ -2375,7 +2385,7 @@ int TextEditor::findWordBreakAfter (int position) const
return position; return position;
} }
int TextEditor::findWordBreakBefore (int position) const
int TextEditor::findWordBreakBefore (int position) const throw()
{ {
if (position > 0) if (position > 0)
{ {
@@ -2408,7 +2418,7 @@ int TextEditor::findWordBreakBefore (int position) const
//============================================================================== //==============================================================================
void TextEditor::splitSection (const int sectionIndex, void TextEditor::splitSection (const int sectionIndex,
const int charToSplitAt)
const int charToSplitAt) throw()
{ {
jassert (sections[sectionIndex] != 0); jassert (sections[sectionIndex] != 0);
@@ -2417,7 +2427,7 @@ void TextEditor::splitSection (const int sectionIndex,
->split (charToSplitAt, passwordCharacter)); ->split (charToSplitAt, passwordCharacter));
} }
void TextEditor::coalesceSimilarSections()
void TextEditor::coalesceSimilarSections() throw()
{ {
for (int i = 0; i < sections.size() - 1; ++i) for (int i = 0; i < sections.size() - 1; ++i)
{ {


+ 83
- 33
src/juce_appframework/gui/components/controls/juce_TextEditor.h View File

@@ -36,6 +36,7 @@
#include "../../../events/juce_Timer.h" #include "../../../events/juce_Timer.h"
#include "../../../documents/juce_UndoManager.h" #include "../../../documents/juce_UndoManager.h"
#include "../layout/juce_Viewport.h" #include "../layout/juce_Viewport.h"
#include "../menus/juce_PopupMenu.h"
class TextEditor; class TextEditor;
class TextHolderComponent; class TextHolderComponent;
@@ -327,16 +328,16 @@ l */
//============================================================================== //==============================================================================
/** Returns the entire contents of the editor. */ /** Returns the entire contents of the editor. */
const String getText() const;
const String getText() const throw();
/** Returns a section of the contents of the editor. */ /** Returns a section of the contents of the editor. */
const String getTextSubstring (const int startCharacter, const int endCharacter) const;
const String getTextSubstring (const int startCharacter, const int endCharacter) const throw();
/** Returns true if there are no characters in the editor. /** Returns true if there are no characters in the editor.
This is more efficient than calling getText().isEmpty(). This is more efficient than calling getText().isEmpty().
*/ */
bool isEmpty() const;
bool isEmpty() const throw();
/** Sets the entire content of the editor. /** Sets the entire content of the editor.
@@ -391,18 +392,18 @@ l */
@see getCaretPosition @see getCaretPosition
*/ */
void setCaretPosition (const int newIndex);
void setCaretPosition (const int newIndex) throw();
/** Returns the current index of the caret. /** Returns the current index of the caret.
@see setCaretPosition @see setCaretPosition
*/ */
int getCaretPosition() const;
int getCaretPosition() const throw();
/** Selects a section of the text. /** Selects a section of the text.
*/ */
void setHighlightedRegion (int startIndex, void setHighlightedRegion (int startIndex,
int numberOfCharactersToHighlight);
int numberOfCharactersToHighlight) throw();
/** Returns the first character that is selected. /** Returns the first character that is selected.
@@ -426,33 +427,33 @@ l */
The co-ordinates are relative to the component's top-left. The co-ordinates are relative to the component's top-left.
*/ */
int getTextIndexAt (const int x, const int y);
int getTextIndexAt (const int x, const int y) throw();
/** Returns the total width of the text, as it is currently laid-out. /** Returns the total width of the text, as it is currently laid-out.
This may be larger than the size of the TextEditor, and can change when This may be larger than the size of the TextEditor, and can change when
the TextEditor is resized or the text changes. the TextEditor is resized or the text changes.
*/ */
int getTextWidth() const;
int getTextWidth() const throw();
/** Returns the maximum height of the text, as it is currently laid-out. /** Returns the maximum height of the text, as it is currently laid-out.
This may be larger than the size of the TextEditor, and can change when This may be larger than the size of the TextEditor, and can change when
the TextEditor is resized or the text changes. the TextEditor is resized or the text changes.
*/ */
int getTextHeight() const;
int getTextHeight() const throw();
/** Changes the size of the gap at the top and left-edge of the editor. /** Changes the size of the gap at the top and left-edge of the editor.
By default there's a gap of 4 pixels. By default there's a gap of 4 pixels.
*/ */
void setIndents (const int newLeftIndent, const int newTopIndent);
void setIndents (const int newLeftIndent, const int newTopIndent) throw();
/** Changes the size of border left around the edge of the component. /** Changes the size of border left around the edge of the component.
@see getBorder @see getBorder
*/ */
void setBorder (const BorderSize& border);
void setBorder (const BorderSize& border) throw();
/** Returns the size of border around the edge of the component. /** Returns the size of border around the edge of the component.
@@ -500,10 +501,65 @@ l */
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator
protected: protected:
void scrollToMakeSureCursorIsVisible();
void moveCaret (int newCaretPos);
void moveCursorTo (const int newPosition, const bool isSelecting);
void textChanged();
/** This adds the items to the popup menu.
By default it adds the cut/copy/paste items, but you can override this if
you need to replace these with your own items.
If you want to add your own items to the existing ones, you can override this,
call the base class's addPopupMenuItems() method, then append your own items.
When the menu has been shown, performPopupMenuAction() will be called to
perform the item that the user has chosen.
The default menu items will be added using item IDs in the range
0x7fff0000 - 0x7fff1000, so you should avoid those values for your own
menu IDs.
@see performPopupMenuAction, setPopupMenuEnabled, isPopupMenuEnabled
*/
virtual void addPopupMenuItems (PopupMenu& menuToAddTo);
/** This is called to perform one of the items that was shown on the popup menu.
If you've overridden addPopupMenuItems(), you should also override this
to perform the actions that you've added.
If you've overridden addPopupMenuItems() but have still left the default items
on the menu, remember to call the superclass's performPopupMenuAction()
so that it can perform the default actions if that's what the user clicked on.
@see addPopupMenuItems, setPopupMenuEnabled, isPopupMenuEnabled
*/
virtual void performPopupMenuAction (const int menuItemID);
/** Scrolls the minimum distance needed to get the caret into view. */
void scrollToMakeSureCursorIsVisible() throw();
/** @internal */
void moveCaret (int newCaretPos) throw();
/** @internal */
void moveCursorTo (const int newPosition, const bool isSelecting) throw();
/** Used internally to dispatch a text-change message. */
void textChanged() throw();
/** Counts the number of characters in the text.
This is quicker than getting the text as a string if you just need to know
the length.
*/
int getTotalNumChars() throw();
/** Begins a new transaction in the UndoManager.
*/
void newTransaction() throw();
/** Used internally to trigger an undo or redo. */
void doUndoRedo (const bool isRedo);
/** @internal */
void handleCommandMessage (int commandId); void handleCommandMessage (int commandId);
virtual void returnPressed(); virtual void returnPressed();
@@ -522,7 +578,6 @@ private:
bool popupMenuEnabled : 1; bool popupMenuEnabled : 1;
bool selectAllTextWhenFocused : 1; bool selectAllTextWhenFocused : 1;
bool scrollbarVisible : 1; bool scrollbarVisible : 1;
bool menuVisible : 1;
bool wasFocused : 1; bool wasFocused : 1;
bool caretFlashState : 1; bool caretFlashState : 1;
bool keepCursorOnScreen : 1; bool keepCursorOnScreen : 1;
@@ -554,45 +609,40 @@ private:
friend class TextEditorInsertAction; friend class TextEditorInsertAction;
friend class TextEditorRemoveAction; friend class TextEditorRemoveAction;
void coalesceSimilarSections();
void splitSection (const int sectionIndex, const int charToSplitAt);
void coalesceSimilarSections() throw();
void splitSection (const int sectionIndex, const int charToSplitAt) throw();
void clearInternal (UndoManager* const um);
void clearInternal (UndoManager* const um) throw();
void insert (const String& text, void insert (const String& text,
const int insertIndex, const int insertIndex,
const Font& font, const Font& font,
const Colour& colour, const Colour& colour,
UndoManager* const um, UndoManager* const um,
const int caretPositionToMoveTo);
const int caretPositionToMoveTo) throw();
void reinsert (const int insertIndex, void reinsert (const int insertIndex,
const VoidArray sections);
const VoidArray& sections) throw();
void remove (int startIndex,
void remove (const int startIndex,
int endIndex, int endIndex,
UndoManager* const um, UndoManager* const um,
const int caretPositionToMoveTo);
int getTotalNumChars();
const int caretPositionToMoveTo) throw();
void getCharPosition (const int index, void getCharPosition (const int index,
float& x, float& y, float& x, float& y,
float& lineHeight);
float& lineHeight) const throw();
int indexAtPosition (const float x, int indexAtPosition (const float x,
const float y);
int findWordBreakAfter (int position) const;
int findWordBreakBefore (int position) const;
const float y) throw();
void newTransaction();
void doUndoRedo (const bool isRedo);
int findWordBreakAfter (int position) const throw();
int findWordBreakBefore (int position) const throw();
friend class TextHolderComponent; friend class TextHolderComponent;
friend class TextEditorViewport; friend class TextEditorViewport;
void drawContent (Graphics& g); void drawContent (Graphics& g);
void updateTextHolderSize();
void updateTextHolderSize() throw();
float getWordWrapWidth() const throw(); float getWordWrapWidth() const throw();
void timerCallbackInt(); void timerCallbackInt();
void repaintCaret(); void repaintCaret();


+ 2
- 2
src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp View File

@@ -485,7 +485,7 @@ const BitArray FileBrowserComponent::getRoots (StringArray& rootNames, StringArr
rootNames.add ("Desktop"); rootNames.add ("Desktop");
#endif #endif
#ifdef JUCE_MAC
#if JUCE_MAC
rootPaths.add (File::getSpecialLocation (File::userHomeDirectory).getFullPathName()); rootPaths.add (File::getSpecialLocation (File::userHomeDirectory).getFullPathName());
rootNames.add ("Home folder"); rootNames.add ("Home folder");
rootPaths.add (File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName()); rootPaths.add (File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName());
@@ -511,7 +511,7 @@ const BitArray FileBrowserComponent::getRoots (StringArray& rootNames, StringArr
} }
#endif #endif
#ifdef JUCE_LINUX
#if JUCE_LINUX
rootPaths.add ("/"); rootPaths.add ("/");
rootNames.add ("/"); rootNames.add ("/");
rootPaths.add (File::getSpecialLocation (File::userHomeDirectory).getFullPathName()); rootPaths.add (File::getSpecialLocation (File::userHomeDirectory).getFullPathName());


+ 1
- 1
src/juce_appframework/gui/components/filebrowser/juce_FileChooser.cpp View File

@@ -50,7 +50,7 @@ FileChooser::FileChooser (const String& chooserBoxTitle,
startingFile (currentFileOrDirectory), startingFile (currentFileOrDirectory),
useNativeDialogBox (useNativeDialogBox_) useNativeDialogBox (useNativeDialogBox_)
{ {
#ifdef JUCE_LINUX
#if JUCE_LINUX
useNativeDialogBox = false; useNativeDialogBox = false;
#endif #endif


+ 14
- 12
src/juce_appframework/gui/components/juce_Component.cpp View File

@@ -462,7 +462,7 @@ void Component::addToDesktop (int desktopWindowStyleFlags, void* nativeWindowToA
{ {
const ComponentDeletionWatcher deletionChecker (this); const ComponentDeletionWatcher deletionChecker (this);
#ifdef JUCE_LINUX
#if JUCE_LINUX
// it's wise to give the component a non-zero size before // it's wise to give the component a non-zero size before
// putting it on the desktop, as X windows get confused by this, and // putting it on the desktop, as X windows get confused by this, and
// a (1, 1) minimum size is enforced here. // a (1, 1) minimum size is enforced here.
@@ -2666,23 +2666,25 @@ void Component::internalMouseUp (const int oldModifiers, int x, int y, const int
} }
} }
const Component* p = parentComponent_;
while (p != 0)
{ {
const ComponentDeletionWatcher parentDeletionChecker (p);
const Component* p = parentComponent_;
for (int i = p->numDeepMouseListeners; --i >= 0;)
while (p != 0)
{ {
((MouseListener*) (p->mouseListeners_->getUnchecked (i)))->mouseUp (me);
const ComponentDeletionWatcher parentDeletionChecker (p);
if (deletionChecker.hasBeenDeleted() || parentDeletionChecker.hasBeenDeleted())
return;
for (int i = p->numDeepMouseListeners; --i >= 0;)
{
((MouseListener*) (p->mouseListeners_->getUnchecked (i)))->mouseUp (me);
i = jmin (i, p->numDeepMouseListeners);
}
if (deletionChecker.hasBeenDeleted() || parentDeletionChecker.hasBeenDeleted())
return;
p = p->parentComponent_;
i = jmin (i, p->numDeepMouseListeners);
}
p = p->parentComponent_;
}
} }
// check for double-click // check for double-click


+ 1
- 1
src/juce_appframework/gui/components/keyboard/juce_KeyPress.cpp View File

@@ -234,7 +234,7 @@ const String KeyPress::getTextDescription() const
if (mods.isShiftDown()) if (mods.isShiftDown())
desc << "shift + "; desc << "shift + ";
#ifdef JUCE_MAC
#if JUCE_MAC
// only do this on the mac, because on Windows ctrl and command are the same, // only do this on the mac, because on Windows ctrl and command are the same,
// and this would get confusing // and this would get confusing
if (mods.isCommandDown()) if (mods.isCommandDown())


+ 1
- 1
src/juce_appframework/gui/components/keyboard/juce_ModifierKeys.cpp View File

@@ -44,7 +44,7 @@ const int ModifierKeys::leftButtonModifier = 16;
const int ModifierKeys::rightButtonModifier = 32; const int ModifierKeys::rightButtonModifier = 32;
const int ModifierKeys::middleButtonModifier = 64; const int ModifierKeys::middleButtonModifier = 64;
#ifdef JUCE_MAC
#if JUCE_MAC
const int ModifierKeys::commandModifier = 8; const int ModifierKeys::commandModifier = 8;
const int ModifierKeys::popupMenuClickModifier = ModifierKeys::rightButtonModifier const int ModifierKeys::popupMenuClickModifier = ModifierKeys::rightButtonModifier
| ModifierKeys::ctrlModifier; | ModifierKeys::ctrlModifier;


+ 1
- 1
src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp View File

@@ -281,7 +281,7 @@ void QuickTimeMovieComponent::paint (Graphics& g)
#endif #endif
//============================================================================== //==============================================================================
#ifdef JUCE_MAC
#if JUCE_MAC
#include "../../../../juce_core/misc/juce_PlatformUtilities.h" #include "../../../../juce_core/misc/juce_PlatformUtilities.h"
#include "../../../events/juce_MessageManager.h" #include "../../../events/juce_MessageManager.h"


+ 2
- 2
src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h View File

@@ -172,7 +172,7 @@ public:
void parentHierarchyChanged(); void parentHierarchyChanged();
/** @internal */ /** @internal */
void visibilityChanged(); void visibilityChanged();
#ifdef JUCE_MAC
#if JUCE_MAC
/** @internal */ /** @internal */
void handleMCEvent (void*); void handleMCEvent (void*);
/** @internal */ /** @internal */
@@ -193,7 +193,7 @@ private:
void* internal; void* internal;
#ifdef JUCE_MAC
#if JUCE_MAC
void* associatedWindow; void* associatedWindow;
Rectangle lastPositionApplied; Rectangle lastPositionApplied;
bool controllerAssignedToWindow, reentrant, looping; bool controllerAssignedToWindow, reentrant, looping;


+ 2
- 2
src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp View File

@@ -48,7 +48,7 @@ DocumentWindow::DocumentWindow (const String& title,
titleBarHeight (26), titleBarHeight (26),
menuBarHeight (24), menuBarHeight (24),
requiredButtons (requiredButtons_), requiredButtons (requiredButtons_),
#ifdef JUCE_MAC
#if JUCE_MAC
positionTitleBarButtonsOnLeft (true), positionTitleBarButtonsOnLeft (true),
#else #else
positionTitleBarButtonsOnLeft (false), positionTitleBarButtonsOnLeft (false),
@@ -296,7 +296,7 @@ void DocumentWindow::lookAndFeelChanged()
if (getCloseButton() != 0) if (getCloseButton() != 0)
{ {
#ifdef JUCE_MAC
#if JUCE_MAC
getCloseButton()->addShortcut (KeyPress (T('w'), ModifierKeys::commandModifier, 0)); getCloseButton()->addShortcut (KeyPress (T('w'), ModifierKeys::commandModifier, 0));
#else #else
getCloseButton()->addShortcut (KeyPress (KeyPress::F4Key, ModifierKeys::altModifier, 0)); getCloseButton()->addShortcut (KeyPress (KeyPress::F4Key, ModifierKeys::altModifier, 0));


+ 5
- 5
src/juce_appframework/gui/graphics/brushes/juce_Brush.cpp View File

@@ -40,16 +40,16 @@ BEGIN_JUCE_NAMESPACE
//============================================================================== //==============================================================================
Brush::Brush()
Brush::Brush() throw()
{ {
} }
Brush::~Brush()
Brush::~Brush() throw()
{ {
} }
void Brush::paintVerticalLine (LowLevelGraphicsContext& context, void Brush::paintVerticalLine (LowLevelGraphicsContext& context,
int x, float y1, float y2)
int x, float y1, float y2) throw()
{ {
Path p; Path p;
p.addRectangle ((float) x, y1, 1.0f, y2 - y1); p.addRectangle ((float) x, y1, 1.0f, y2 - y1);
@@ -57,7 +57,7 @@ void Brush::paintVerticalLine (LowLevelGraphicsContext& context,
} }
void Brush::paintHorizontalLine (LowLevelGraphicsContext& context, void Brush::paintHorizontalLine (LowLevelGraphicsContext& context,
int y, float x1, float x2)
int y, float x1, float x2) throw()
{ {
Path p; Path p;
p.addRectangle (x1, (float) y, x2 - x1, 1.0f); p.addRectangle (x1, (float) y, x2 - x1, 1.0f);
@@ -65,7 +65,7 @@ void Brush::paintHorizontalLine (LowLevelGraphicsContext& context,
} }
void Brush::paintLine (LowLevelGraphicsContext& context, void Brush::paintLine (LowLevelGraphicsContext& context,
float x1, float y1, float x2, float y2)
float x1, float y1, float x2, float y2) throw()
{ {
Path p; Path p;
p.addLineSegment (x1, y1, x2, y2, 1.0f); p.addLineSegment (x1, y1, x2, y2, 1.0f);


+ 12
- 12
src/juce_appframework/gui/graphics/brushes/juce_Brush.h View File

@@ -59,43 +59,43 @@ protected:
(Nothing much happens in the base class). (Nothing much happens in the base class).
*/ */
Brush();
Brush() throw();
public: public:
/** Destructor. */ /** Destructor. */
virtual ~Brush();
virtual ~Brush() throw();
/** Creates a copy of whatever class of Brush this is. */ /** Creates a copy of whatever class of Brush this is. */
virtual Brush* createCopy() const = 0;
virtual Brush* createCopy() const throw() = 0;
/** Does whatever is relevent to transform the geometry of this brush. */ /** Does whatever is relevent to transform the geometry of this brush. */
virtual void applyTransform (const AffineTransform& transform) = 0;
virtual void applyTransform (const AffineTransform& transform) throw() = 0;
/** Does whatever is relevent to change the opacity of this brush. */ /** Does whatever is relevent to change the opacity of this brush. */
virtual void multiplyOpacity (const float multiple) = 0;
virtual void multiplyOpacity (const float multiple) throw() = 0;
/** Must return true if this brush won't draw any pixels. */ /** Must return true if this brush won't draw any pixels. */
virtual bool isInvisible() const = 0;
virtual bool isInvisible() const throw() = 0;
//============================================================================== //==============================================================================
virtual void paintPath (LowLevelGraphicsContext& context, virtual void paintPath (LowLevelGraphicsContext& context,
const Path& path, const AffineTransform& transform) = 0;
const Path& path, const AffineTransform& transform) throw() = 0;
virtual void paintRectangle (LowLevelGraphicsContext& context, virtual void paintRectangle (LowLevelGraphicsContext& context,
int x, int y, int w, int h) = 0;
int x, int y, int w, int h) throw() = 0;
virtual void paintAlphaChannel (LowLevelGraphicsContext& context, virtual void paintAlphaChannel (LowLevelGraphicsContext& context,
const Image& alphaChannelImage, int imageX, int imageY, const Image& alphaChannelImage, int imageX, int imageY,
int x, int y, int w, int h) = 0;
int x, int y, int w, int h) throw() = 0;
virtual void paintVerticalLine (LowLevelGraphicsContext& context, virtual void paintVerticalLine (LowLevelGraphicsContext& context,
int x, float y1, float y2);
int x, float y1, float y2) throw();
virtual void paintHorizontalLine (LowLevelGraphicsContext& context, virtual void paintHorizontalLine (LowLevelGraphicsContext& context,
int y, float x1, float x2);
int y, float x1, float x2) throw();
virtual void paintLine (LowLevelGraphicsContext& context, virtual void paintLine (LowLevelGraphicsContext& context,
float x1, float y1, float x2, float y2);
float x1, float y1, float x2, float y2) throw();
private: private:
//============================================================================== //==============================================================================


+ 10
- 10
src/juce_appframework/gui/graphics/brushes/juce_GradientBrush.cpp View File

@@ -45,58 +45,58 @@ GradientBrush::GradientBrush (const Colour& colour1,
const Colour& colour2, const Colour& colour2,
const float x2, const float x2,
const float y2, const float y2,
const bool isRadial)
const bool isRadial) throw()
: gradient (colour1, x1, y1, : gradient (colour1, x1, y1,
colour2, x2, y2, colour2, x2, y2,
isRadial) isRadial)
{ {
} }
GradientBrush::GradientBrush (const ColourGradient& gradient_)
GradientBrush::GradientBrush (const ColourGradient& gradient_) throw()
: gradient (gradient_) : gradient (gradient_)
{ {
} }
GradientBrush::~GradientBrush()
GradientBrush::~GradientBrush() throw()
{ {
} }
Brush* GradientBrush::createCopy() const
Brush* GradientBrush::createCopy() const throw()
{ {
return new GradientBrush (gradient); return new GradientBrush (gradient);
} }
void GradientBrush::applyTransform (const AffineTransform& transform)
void GradientBrush::applyTransform (const AffineTransform& transform) throw()
{ {
gradient.transform = gradient.transform.followedBy (transform); gradient.transform = gradient.transform.followedBy (transform);
} }
void GradientBrush::multiplyOpacity (const float multiple)
void GradientBrush::multiplyOpacity (const float multiple) throw()
{ {
gradient.multiplyOpacity (multiple); gradient.multiplyOpacity (multiple);
} }
bool GradientBrush::isInvisible() const
bool GradientBrush::isInvisible() const throw()
{ {
return gradient.isInvisible(); return gradient.isInvisible();
} }
//============================================================================== //==============================================================================
void GradientBrush::paintPath (LowLevelGraphicsContext& context, void GradientBrush::paintPath (LowLevelGraphicsContext& context,
const Path& path, const AffineTransform& transform)
const Path& path, const AffineTransform& transform) throw()
{ {
context.fillPathWithGradient (path, transform, gradient, EdgeTable::Oversampling_4times); context.fillPathWithGradient (path, transform, gradient, EdgeTable::Oversampling_4times);
} }
void GradientBrush::paintRectangle (LowLevelGraphicsContext& context, void GradientBrush::paintRectangle (LowLevelGraphicsContext& context,
int x, int y, int w, int h)
int x, int y, int w, int h) throw()
{ {
context.fillRectWithGradient (x, y, w, h, gradient); context.fillRectWithGradient (x, y, w, h, gradient);
} }
void GradientBrush::paintAlphaChannel (LowLevelGraphicsContext& context, void GradientBrush::paintAlphaChannel (LowLevelGraphicsContext& context,
const Image& alphaChannelImage, int imageX, int imageY, const Image& alphaChannelImage, int imageX, int imageY,
int x, int y, int w, int h)
int x, int y, int w, int h) throw()
{ {
context.saveState(); context.saveState();


+ 10
- 10
src/juce_appframework/gui/graphics/brushes/juce_GradientBrush.h View File

@@ -72,33 +72,33 @@ public:
const Colour& colour2, const Colour& colour2,
const float x2, const float x2,
const float y2, const float y2,
const bool isRadial);
const bool isRadial) throw();
/** Creates a gradient brush from a ColourGradient object. /** Creates a gradient brush from a ColourGradient object.
*/ */
GradientBrush (const ColourGradient& gradient);
GradientBrush (const ColourGradient& gradient) throw();
/** Destructor. */ /** Destructor. */
~GradientBrush();
~GradientBrush() throw();
//============================================================================== //==============================================================================
Brush* createCopy() const;
Brush* createCopy() const throw();
void applyTransform (const AffineTransform& transform);
void applyTransform (const AffineTransform& transform) throw();
void multiplyOpacity (const float multiple);
void multiplyOpacity (const float multiple) throw();
bool isInvisible() const;
bool isInvisible() const throw();
void paintPath (LowLevelGraphicsContext& context, void paintPath (LowLevelGraphicsContext& context,
const Path& path, const AffineTransform& transform);
const Path& path, const AffineTransform& transform) throw();
void paintRectangle (LowLevelGraphicsContext& context, void paintRectangle (LowLevelGraphicsContext& context,
int x, int y, int w, int h);
int x, int y, int w, int h) throw();
void paintAlphaChannel (LowLevelGraphicsContext& context, void paintAlphaChannel (LowLevelGraphicsContext& context,
const Image& alphaChannelImage, int imageX, int imageY, const Image& alphaChannelImage, int imageX, int imageY,
int x, int y, int w, int h);
int x, int y, int w, int h) throw();
//============================================================================== //==============================================================================
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator


+ 12
- 12
src/juce_appframework/gui/graphics/brushes/juce_ImageBrush.cpp View File

@@ -42,7 +42,7 @@ BEGIN_JUCE_NAMESPACE
ImageBrush::ImageBrush (Image* const image_, ImageBrush::ImageBrush (Image* const image_,
const int anchorX_, const int anchorX_,
const int anchorY_, const int anchorY_,
const float opacity_)
const float opacity_) throw()
: image (image_), : image (image_),
anchorX (anchorX_), anchorX (anchorX_),
anchorY (anchorY_), anchorY (anchorY_),
@@ -60,31 +60,31 @@ ImageBrush::ImageBrush (Image* const image_,
} }
} }
ImageBrush::~ImageBrush()
ImageBrush::~ImageBrush() throw()
{ {
} }
Brush* ImageBrush::createCopy() const
Brush* ImageBrush::createCopy() const throw()
{ {
return new ImageBrush (image, anchorX, anchorY, opacity); return new ImageBrush (image, anchorX, anchorY, opacity);
} }
void ImageBrush::multiplyOpacity (const float multiple)
void ImageBrush::multiplyOpacity (const float multiple) throw()
{ {
opacity *= multiple; opacity *= multiple;
} }
bool ImageBrush::isInvisible() const
bool ImageBrush::isInvisible() const throw()
{ {
return opacity == 0.0f; return opacity == 0.0f;
} }
void ImageBrush::applyTransform (const AffineTransform& /*transform*/)
void ImageBrush::applyTransform (const AffineTransform& /*transform*/) throw()
{ {
//xxx should probably be smarter and warp the image //xxx should probably be smarter and warp the image
} }
void ImageBrush::getStartXY (int& x, int& y) const
void ImageBrush::getStartXY (int& x, int& y) const throw()
{ {
x -= anchorX; x -= anchorX;
y -= anchorY; y -= anchorY;
@@ -109,7 +109,7 @@ void ImageBrush::getStartXY (int& x, int& y) const
//============================================================================== //==============================================================================
void ImageBrush::paintRectangle (LowLevelGraphicsContext& context, void ImageBrush::paintRectangle (LowLevelGraphicsContext& context,
int x, int y, int w, int h)
int x, int y, int w, int h) throw()
{ {
context.saveState(); context.saveState();
@@ -142,7 +142,7 @@ void ImageBrush::paintRectangle (LowLevelGraphicsContext& context,
} }
void ImageBrush::paintPath (LowLevelGraphicsContext& context, void ImageBrush::paintPath (LowLevelGraphicsContext& context,
const Path& path, const AffineTransform& transform)
const Path& path, const AffineTransform& transform) throw()
{ {
if (image != 0) if (image != 0)
{ {
@@ -186,15 +186,15 @@ void ImageBrush::paintPath (LowLevelGraphicsContext& context,
void ImageBrush::paintAlphaChannel (LowLevelGraphicsContext& context, void ImageBrush::paintAlphaChannel (LowLevelGraphicsContext& context,
const Image& alphaChannelImage, int imageX, int imageY, const Image& alphaChannelImage, int imageX, int imageY,
int x, int y, int w, int h)
int x, int y, int w, int h) throw()
{ {
context.saveState(); context.saveState();
if (image != 0 && context.reduceClipRegion (x, y, w, h)) if (image != 0 && context.reduceClipRegion (x, y, w, h))
{ {
const Rectangle clip (context.getClipBounds()); const Rectangle clip (context.getClipBounds());
int x = clip.getX();
int y = clip.getY();
x = clip.getX();
y = clip.getY();
const int right = clip.getRight(); const int right = clip.getRight();
const int bottom = clip.getBottom(); const int bottom = clip.getBottom();


+ 10
- 10
src/juce_appframework/gui/graphics/brushes/juce_ImageBrush.h View File

@@ -55,30 +55,30 @@ public:
ImageBrush (Image* const image, ImageBrush (Image* const image,
const int anchorX, const int anchorX,
const int anchorY, const int anchorY,
const float opacity);
const float opacity) throw();
/** Destructor. */ /** Destructor. */
~ImageBrush();
~ImageBrush() throw();
//============================================================================== //==============================================================================
Brush* createCopy() const;
Brush* createCopy() const throw();
void applyTransform (const AffineTransform& transform);
void applyTransform (const AffineTransform& transform) throw();
void multiplyOpacity (const float multiple);
void multiplyOpacity (const float multiple) throw();
bool isInvisible() const;
bool isInvisible() const throw();
void paintPath (LowLevelGraphicsContext& context, void paintPath (LowLevelGraphicsContext& context,
const Path& path, const AffineTransform& transform);
const Path& path, const AffineTransform& transform) throw();
void paintRectangle (LowLevelGraphicsContext& context, void paintRectangle (LowLevelGraphicsContext& context,
int x, int y, int w, int h);
int x, int y, int w, int h) throw();
void paintAlphaChannel (LowLevelGraphicsContext& context, void paintAlphaChannel (LowLevelGraphicsContext& context,
const Image& alphaChannelImage, int imageX, int imageY, const Image& alphaChannelImage, int imageX, int imageY,
int x, int y, int w, int h);
int x, int y, int w, int h) throw();
//============================================================================== //==============================================================================
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator
@@ -92,7 +92,7 @@ private:
ImageBrush (const ImageBrush&); ImageBrush (const ImageBrush&);
const ImageBrush& operator= (const ImageBrush&); const ImageBrush& operator= (const ImageBrush&);
void getStartXY (int& x, int& y) const;
void getStartXY (int& x, int& y) const throw();
}; };
#endif // __JUCE_IMAGEBRUSH_JUCEHEADER__ #endif // __JUCE_IMAGEBRUSH_JUCEHEADER__

+ 13
- 13
src/juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.cpp View File

@@ -39,48 +39,48 @@ BEGIN_JUCE_NAMESPACE
//============================================================================== //==============================================================================
SolidColourBrush::SolidColourBrush()
SolidColourBrush::SolidColourBrush() throw()
: colour (0xff000000) : colour (0xff000000)
{ {
} }
SolidColourBrush::SolidColourBrush (const Colour& colour_)
SolidColourBrush::SolidColourBrush (const Colour& colour_) throw()
: colour (colour_) : colour (colour_)
{ {
} }
SolidColourBrush::~SolidColourBrush()
SolidColourBrush::~SolidColourBrush() throw()
{ {
} }
Brush* SolidColourBrush::createCopy() const
Brush* SolidColourBrush::createCopy() const throw()
{ {
return new SolidColourBrush (colour); return new SolidColourBrush (colour);
} }
void SolidColourBrush::applyTransform (const AffineTransform& /*transform*/)
void SolidColourBrush::applyTransform (const AffineTransform& /*transform*/) throw()
{ {
} }
void SolidColourBrush::multiplyOpacity (const float multiple)
void SolidColourBrush::multiplyOpacity (const float multiple) throw()
{ {
colour = colour.withMultipliedAlpha (multiple); colour = colour.withMultipliedAlpha (multiple);
} }
bool SolidColourBrush::isInvisible() const
bool SolidColourBrush::isInvisible() const throw()
{ {
return colour.isTransparent(); return colour.isTransparent();
} }
void SolidColourBrush::paintPath (LowLevelGraphicsContext& context, void SolidColourBrush::paintPath (LowLevelGraphicsContext& context,
const Path& path, const AffineTransform& transform)
const Path& path, const AffineTransform& transform) throw()
{ {
if (! colour.isTransparent()) if (! colour.isTransparent())
context.fillPathWithColour (path, transform, colour, EdgeTable::Oversampling_4times); context.fillPathWithColour (path, transform, colour, EdgeTable::Oversampling_4times);
} }
void SolidColourBrush::paintRectangle (LowLevelGraphicsContext& context, void SolidColourBrush::paintRectangle (LowLevelGraphicsContext& context,
int x, int y, int w, int h)
int x, int y, int w, int h) throw()
{ {
if (! colour.isTransparent()) if (! colour.isTransparent())
context.fillRectWithColour (x, y, w, h, colour, false); context.fillRectWithColour (x, y, w, h, colour, false);
@@ -88,7 +88,7 @@ void SolidColourBrush::paintRectangle (LowLevelGraphicsContext& context,
void SolidColourBrush::paintAlphaChannel (LowLevelGraphicsContext& context, void SolidColourBrush::paintAlphaChannel (LowLevelGraphicsContext& context,
const Image& alphaChannelImage, int imageX, int imageY, const Image& alphaChannelImage, int imageX, int imageY,
int x, int y, int w, int h)
int x, int y, int w, int h) throw()
{ {
if (! colour.isTransparent()) if (! colour.isTransparent())
{ {
@@ -102,19 +102,19 @@ void SolidColourBrush::paintAlphaChannel (LowLevelGraphicsContext& context,
} }
void SolidColourBrush::paintVerticalLine (LowLevelGraphicsContext& context, void SolidColourBrush::paintVerticalLine (LowLevelGraphicsContext& context,
int x, float y1, float y2)
int x, float y1, float y2) throw()
{ {
context.drawVerticalLine (x, y1, y2, colour); context.drawVerticalLine (x, y1, y2, colour);
} }
void SolidColourBrush::paintHorizontalLine (LowLevelGraphicsContext& context, void SolidColourBrush::paintHorizontalLine (LowLevelGraphicsContext& context,
int y, float x1, float x2)
int y, float x1, float x2) throw()
{ {
context.drawHorizontalLine (y, x1, x2, colour); context.drawHorizontalLine (y, x1, x2, colour);
} }
void SolidColourBrush::paintLine (LowLevelGraphicsContext& context, void SolidColourBrush::paintLine (LowLevelGraphicsContext& context,
float x1, float y1, float x2, float y2)
float x1, float y1, float x2, float y2) throw()
{ {
context.drawLine (x1, y1, x2, y2, colour); context.drawLine (x1, y1, x2, y2, colour);
} }


+ 13
- 13
src/juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.h View File

@@ -55,16 +55,16 @@ public:
The colour can be changed later with the setColour() method. The colour can be changed later with the setColour() method.
*/ */
SolidColourBrush (const Colour& colour);
SolidColourBrush (const Colour& colour) throw();
/** Creates a SolidColourBrush set to black. /** Creates a SolidColourBrush set to black.
The colour can be changed later with the setColour() method. The colour can be changed later with the setColour() method.
*/ */
SolidColourBrush();
SolidColourBrush() throw();
/** Destructor. */ /** Destructor. */
~SolidColourBrush();
~SolidColourBrush() throw();
//============================================================================== //==============================================================================
/** Returns the colour currently being used. */ /** Returns the colour currently being used. */
@@ -74,32 +74,32 @@ public:
void setColour (const Colour& newColour) throw() { colour = newColour; } void setColour (const Colour& newColour) throw() { colour = newColour; }
//============================================================================== //==============================================================================
Brush* createCopy() const;
Brush* createCopy() const throw();
void applyTransform (const AffineTransform& transform);
void applyTransform (const AffineTransform& transform) throw();
bool isInvisible() const;
bool isInvisible() const throw();
void multiplyOpacity (const float multiple);
void multiplyOpacity (const float multiple) throw();
void paintPath (LowLevelGraphicsContext& context, void paintPath (LowLevelGraphicsContext& context,
const Path& path, const AffineTransform& transform);
const Path& path, const AffineTransform& transform) throw();
void paintRectangle (LowLevelGraphicsContext& context, void paintRectangle (LowLevelGraphicsContext& context,
int x, int y, int w, int h);
int x, int y, int w, int h) throw();
void paintAlphaChannel (LowLevelGraphicsContext& context, void paintAlphaChannel (LowLevelGraphicsContext& context,
const Image& alphaChannelImage, int imageX, int imageY, const Image& alphaChannelImage, int imageX, int imageY,
int x, int y, int w, int h);
int x, int y, int w, int h) throw();
void paintVerticalLine (LowLevelGraphicsContext& context, void paintVerticalLine (LowLevelGraphicsContext& context,
int x, float y1, float y2);
int x, float y1, float y2) throw();
void paintHorizontalLine (LowLevelGraphicsContext& context, void paintHorizontalLine (LowLevelGraphicsContext& context,
int y, float x1, float x2);
int y, float x1, float x2) throw();
void paintLine (LowLevelGraphicsContext& context, void paintLine (LowLevelGraphicsContext& context,
float x1, float y1, float x2, float y2);
float x1, float y1, float x2, float y2) throw();
//============================================================================== //==============================================================================
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator


+ 3
- 3
src/juce_appframework/gui/graphics/colour/juce_ColourGradient.cpp View File

@@ -148,10 +148,10 @@ PixelARGB* ColourGradient::createLookupTable (int& numEntries) const throw()
PixelARGB pix1 (colours.getUnchecked (1)); PixelARGB pix1 (colours.getUnchecked (1));
int index = 0; int index = 0;
for (int i = 2; i < colours.size(); i += 2)
for (int j = 2; j < colours.size(); j += 2)
{ {
const int numToDo = ((colours.getUnchecked (i) * numEntries) >> 16) - index;
const PixelARGB pix2 (colours.getUnchecked (i + 1));
const int numToDo = ((colours.getUnchecked (j) * numEntries) >> 16) - index;
const PixelARGB pix2 (colours.getUnchecked (j + 1));
for (int i = 0; i < numToDo; ++i) for (int i = 0; i < numToDo; ++i)
{ {


+ 2
- 2
src/juce_appframework/gui/graphics/colour/juce_PixelFormats.h View File

@@ -388,7 +388,7 @@ public:
private: private:
//============================================================================== //==============================================================================
#ifdef JUCE_MAC
#if JUCE_MAC
uint8 r, g, b; uint8 r, g, b;
#else #else
uint8 b, g, r; uint8 b, g, r;
@@ -397,7 +397,7 @@ private:
} PACKED; } PACKED;
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma pack (pop) #pragma pack (pop)
#endif #endif


+ 2
- 2
src/juce_appframework/gui/graphics/contexts/juce_EdgeTable.cpp View File

@@ -91,10 +91,10 @@ void EdgeTable::remapTableForNumEdges (const int newNumEdgesPerLine) throw()
maxEdgesPerLine = newNumEdgesPerLine; maxEdgesPerLine = newNumEdgesPerLine;
const int newLineStrideElements = maxEdgesPerLine * 2 + 1; const int newLineStrideElements = maxEdgesPerLine * 2 + 1;
int* const newTable = (int*) juce_malloc ((height << (int)oversampling)
int* const newTable = (int*) juce_malloc ((height << (int) oversampling)
* newLineStrideElements * sizeof (int)); * newLineStrideElements * sizeof (int));
for (int i = 0; i < (height << (int)oversampling); ++i)
for (int i = 0; i < (height << (int) oversampling); ++i)
{ {
const int* srcLine = table + lineStrideElements * i; const int* srcLine = table + lineStrideElements * i;
int* dstLine = newTable + newLineStrideElements * i; int* dstLine = newTable + newLineStrideElements * i;


+ 7
- 7
src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp View File

@@ -41,7 +41,7 @@ BEGIN_JUCE_NAMESPACE
#include "../geometry/juce_Rectangle.h" #include "../geometry/juce_Rectangle.h"
#include "../../../../juce_core/containers/juce_SparseSet.h" #include "../../../../juce_core/containers/juce_SparseSet.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (disable: 4996) // deprecated sprintf warning #pragma warning (disable: 4996) // deprecated sprintf warning
#endif #endif
@@ -52,7 +52,7 @@ BEGIN_JUCE_NAMESPACE
//============================================================================== //==============================================================================
#if JUCE_DEBUG && WARN_ABOUT_NON_POSTSCRIPT_OPERATIONS
#if defined (JUCE_DEBUG) && WARN_ABOUT_NON_POSTSCRIPT_OPERATIONS
#define notPossibleInPostscriptAssert jassertfalse #define notPossibleInPostscriptAssert jassertfalse
#else #else
#define notPossibleInPostscriptAssert #define notPossibleInPostscriptAssert
@@ -218,7 +218,7 @@ void LowLevelGraphicsPostScriptRenderer::writeClip()
out << '\n'; out << '\n';
} }
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
out << r.getX() << ' ' << -r.getY() << ' ' out << r.getX() << ' ' << -r.getY() << ' '
<< r.getWidth() << ' ' << -r.getHeight() << " pr "; << r.getWidth() << ' ' << -r.getHeight() << " pr ";
@@ -541,10 +541,10 @@ void LowLevelGraphicsPostScriptRenderer::writeImage (const Image& im,
pixel = Colours::transparentWhite; pixel = Colours::transparentWhite;
} }
char data [16];
sprintf (data, "%x%x%x", pixel.getRed(), pixel.getGreen(), pixel.getBlue());
char colourString [16];
sprintf (colourString, "%x%x%x", pixel.getRed(), pixel.getGreen(), pixel.getBlue());
out << (const char*) data;
out << (const char*) colourString;
charsOnLine += 3; charsOnLine += 3;
if (charsOnLine > 100) if (charsOnLine > 100)
@@ -591,7 +591,7 @@ void LowLevelGraphicsPostScriptRenderer::blendImageWarping (const Image& sourceI
itemsOnLine = 0; itemsOnLine = 0;
} }
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
out << r.getX() << ' ' << r.getY() << ' ' << r.getWidth() << ' ' << r.getHeight() << " pr "; out << r.getX() << ' ' << r.getY() << ' ' << r.getWidth() << ' ' << r.getHeight() << " pr ";
} }


+ 18
- 18
src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp View File

@@ -45,7 +45,7 @@ BEGIN_JUCE_NAMESPACE
#define JUCE_USE_SSE_INSTRUCTIONS 1 #define JUCE_USE_SSE_INSTRUCTIONS 1
#endif #endif
#if JUCE_DEBUG && JUCE_MSVC
#if defined (JUCE_DEBUG) && JUCE_MSVC
#pragma warning (disable: 4714) #pragma warning (disable: 4714)
#endif #endif
@@ -158,9 +158,9 @@ static void blendRectRGB (uint8* pixels, const int w, int h, const int stride, c
#if defined (JUCE_USE_SSE_INSTRUCTIONS) && ! JUCE_64BIT #if defined (JUCE_USE_SSE_INSTRUCTIONS) && ! JUCE_64BIT
if (SystemStats::hasSSE()) if (SystemStats::hasSSE())
{ {
int64 rgb0 = ((int64) blendColour.getRed() << 32)
| (blendColour.getGreen() << 16)
| blendColour.getBlue();
int64 rgb0 = (((int64) blendColour.getRed()) << 32)
| (int64) ((blendColour.getGreen() << 16)
| blendColour.getBlue());
const int invAlpha = 0xff - alpha; const int invAlpha = 0xff - alpha;
int64 aaaa = (invAlpha << 16) | invAlpha; int64 aaaa = (invAlpha << 16) | invAlpha;
@@ -1122,7 +1122,7 @@ void LowLevelGraphicsSoftwareRenderer::fillRectWithColour (int x, int y, int w,
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
clippedFillRectWithColour (i.getRectangle(), x, y, w, h, colour, replaceExistingContents);
clippedFillRectWithColour (*i.getRectangle(), x, y, w, h, colour, replaceExistingContents);
} }
} }
@@ -1185,7 +1185,7 @@ void LowLevelGraphicsSoftwareRenderer::fillPathWithColour (const Path& path, con
{ {
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedFillPathWithColour (r.getX(), r.getY(), r.getWidth(), r.getHeight(), path, t, colour, quality); clippedFillPathWithColour (r.getX(), r.getY(), r.getWidth(), r.getHeight(), path, t, colour, quality);
} }
@@ -1233,7 +1233,7 @@ void LowLevelGraphicsSoftwareRenderer::fillPathWithGradient (const Path& path, c
{ {
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedFillPathWithGradient (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedFillPathWithGradient (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
path, t, gradient, quality); path, t, gradient, quality);
@@ -1339,7 +1339,7 @@ void LowLevelGraphicsSoftwareRenderer::fillPathWithImage (const Path& path, cons
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedFillPathWithImage (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedFillPathWithImage (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
path, transform, sourceImage, imageX, imageY, opacity, quality); path, transform, sourceImage, imageX, imageY, opacity, quality);
@@ -1422,7 +1422,7 @@ void LowLevelGraphicsSoftwareRenderer::fillAlphaChannelWithColour (const Image&
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedFillAlphaChannelWithColour (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedFillAlphaChannelWithColour (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
clipImage, x, y, colour); clipImage, x, y, colour);
@@ -1464,7 +1464,7 @@ void LowLevelGraphicsSoftwareRenderer::clippedFillAlphaChannelWithColour (int cl
const uint8* const alphaValues const uint8* const alphaValues
= clipImage.lockPixelDataReadOnly (sx, sy, w, h, alphaStride, pixelStride); = clipImage.lockPixelDataReadOnly (sx, sy, w, h, alphaStride, pixelStride);
#ifdef JUCE_MAC
#if JUCE_MAC
const uint8* const alphas = alphaValues; const uint8* const alphas = alphaValues;
#else #else
const uint8* const alphas = alphaValues + (clipImage.getFormat() == Image::ARGB ? 3 : 0); const uint8* const alphas = alphaValues + (clipImage.getFormat() == Image::ARGB ? 3 : 0);
@@ -1501,7 +1501,7 @@ void LowLevelGraphicsSoftwareRenderer::fillAlphaChannelWithGradient (const Image
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedFillAlphaChannelWithGradient (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedFillAlphaChannelWithGradient (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
alphaChannelImage, imageX, imageY, gradient); alphaChannelImage, imageX, imageY, gradient);
@@ -1541,7 +1541,7 @@ void LowLevelGraphicsSoftwareRenderer::fillAlphaChannelWithImage (const Image& a
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedFillAlphaChannelWithImage (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedFillAlphaChannelWithImage (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
alphaImage, alphaImageX, alphaImageY, alphaImage, alphaImageX, alphaImageY,
@@ -1565,7 +1565,7 @@ void LowLevelGraphicsSoftwareRenderer::clippedFillAlphaChannelWithImage (int x,
const uint8* const alpha const uint8* const alpha
= alphaImage.lockPixelDataReadOnly (x - alphaImageX, y - alphaImageY, w, h, maskStride, maskPixStride); = alphaImage.lockPixelDataReadOnly (x - alphaImageX, y - alphaImageY, w, h, maskStride, maskPixStride);
#ifdef JUCE_MAC
#if JUCE_MAC
const uint8* const alphaValues = alpha; const uint8* const alphaValues = alpha;
#else #else
const uint8* const alphaValues = alpha + (alphaImage.getFormat() == Image::ARGB ? 3 : 0); const uint8* const alphaValues = alpha + (alphaImage.getFormat() == Image::ARGB ? 3 : 0);
@@ -1622,7 +1622,7 @@ void LowLevelGraphicsSoftwareRenderer::blendImage (const Image& sourceImage, int
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedBlendImage (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedBlendImage (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
sourceImage, dx, dy, dw, dh, sx, sy, opacity); sourceImage, dx, dy, dw, dh, sx, sy, opacity);
@@ -1755,7 +1755,7 @@ void LowLevelGraphicsSoftwareRenderer::blendImageWarping (const Image& sourceIma
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedBlendImageWarping (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedBlendImageWarping (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
sourceImage, srcClipX, srcClipY, srcClipW, srcClipH, sourceImage, srcClipX, srcClipY, srcClipW, srcClipH,
@@ -1878,7 +1878,7 @@ void LowLevelGraphicsSoftwareRenderer::drawLine (double x1, double y1, double x2
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedDrawLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedDrawLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
x1, y1, x2, y2, colour); x1, y1, x2, y2, colour);
@@ -1949,7 +1949,7 @@ void LowLevelGraphicsSoftwareRenderer::drawVerticalLine (const int x, double top
{ {
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedDrawVerticalLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedDrawVerticalLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
x + xOffset, top + yOffset, bottom + yOffset, col); x + xOffset, top + yOffset, bottom + yOffset, col);
@@ -1982,7 +1982,7 @@ void LowLevelGraphicsSoftwareRenderer::drawHorizontalLine (const int y, double l
{ {
for (RectangleList::Iterator i (*clip); i.next();) for (RectangleList::Iterator i (*clip); i.next();)
{ {
const Rectangle& r = i.getRectangle();
const Rectangle& r = *i.getRectangle();
clippedDrawHorizontalLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(), clippedDrawHorizontalLine (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
y + yOffset, left + xOffset, right + xOffset, col); y + yOffset, left + xOffset, right + xOffset, col);


+ 8
- 6
src/juce_appframework/gui/graphics/drawables/juce_DrawablePath.cpp View File

@@ -94,14 +94,16 @@ void DrawablePath::draw (Graphics& g, const AffineTransform& transform) const
const Colour oldColour (g.getCurrentColour()); // save this so we can restore it later const Colour oldColour (g.getCurrentColour()); // save this so we can restore it later
const float currentOpacity = oldColour.getFloatAlpha(); const float currentOpacity = oldColour.getFloatAlpha();
Brush* const tempBrush = fillBrush->createCopy();
tempBrush->applyTransform (transform);
tempBrush->multiplyOpacity (currentOpacity);
{
Brush* const tempBrush = fillBrush->createCopy();
tempBrush->applyTransform (transform);
tempBrush->multiplyOpacity (currentOpacity);
g.setBrush (tempBrush);
g.fillPath (path, transform);
g.setBrush (tempBrush);
g.fillPath (path, transform);
delete tempBrush;
delete tempBrush;
}
if (strokeBrush != 0 && strokeType.getStrokeThickness() > 0.0f) if (strokeBrush != 0 && strokeType.getStrokeThickness() > 0.0f)
{ {


+ 1
- 1
src/juce_appframework/gui/graphics/effects/juce_DropShadowEffect.cpp View File

@@ -37,7 +37,7 @@ BEGIN_JUCE_NAMESPACE
#include "../imaging/juce_Image.h" #include "../imaging/juce_Image.h"
#include "../colour/juce_PixelFormats.h" #include "../colour/juce_PixelFormats.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma optimize ("t", on) // try to avoid slowing everything down in debug builds #pragma optimize ("t", on) // try to avoid slowing everything down in debug builds
#endif #endif


+ 3
- 3
src/juce_appframework/gui/graphics/fonts/juce_GlyphArrangement.cpp View File

@@ -1079,19 +1079,19 @@ void GlyphArrangement::justifyGlyphs (const int startIndex,
if (justification.testFlags (Justification::horizontallyJustified)) if (justification.testFlags (Justification::horizontallyJustified))
{ {
int lineStart = 0; int lineStart = 0;
float y = glyphs [startIndex].getBaselineY();
float baseY = glyphs [startIndex].getBaselineY();
int i; int i;
for (i = 0; i < num; ++i) for (i = 0; i < num; ++i)
{ {
const float glyphY = glyphs [startIndex + i].getBaselineY(); const float glyphY = glyphs [startIndex + i].getBaselineY();
if (glyphY != y)
if (glyphY != baseY)
{ {
spreadOutLine (startIndex + lineStart, i - lineStart, width); spreadOutLine (startIndex + lineStart, i - lineStart, width);
lineStart = i; lineStart = i;
y = glyphY;
baseY = glyphY;
} }
} }


+ 1
- 1
src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp View File

@@ -36,7 +36,7 @@ BEGIN_JUCE_NAMESPACE
#include "juce_PathIterator.h" #include "juce_PathIterator.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma optimize ("t", on) #pragma optimize ("t", on)
#endif #endif


+ 8
- 7
src/juce_appframework/gui/graphics/geometry/juce_RectangleList.cpp View File

@@ -86,7 +86,8 @@ bool RectangleList::isEmpty() const throw()
//============================================================================== //==============================================================================
RectangleList::Iterator::Iterator (const RectangleList& list) throw() RectangleList::Iterator::Iterator (const RectangleList& list) throw()
: owner (list),
: current (0),
owner (list),
index (list.rects.size()) index (list.rects.size())
{ {
} }
@@ -99,7 +100,7 @@ bool RectangleList::Iterator::next() throw()
{ {
if (--index >= 0) if (--index >= 0)
{ {
current = owner.rects.getReference (index);
current = & (owner.rects.getReference (index));
return true; return true;
} }
@@ -494,12 +495,12 @@ const Rectangle RectangleList::getBounds() const throw()
for (int i = rects.size(); --i > 0;) for (int i = rects.size(); --i > 0;)
{ {
const Rectangle& r = rects.getReference (i);
const Rectangle& r2 = rects.getReference (i);
minX = jmin (minX, r.x);
minY = jmin (minY, r.y);
maxX = jmax (maxX, r.getRight());
maxY = jmax (maxY, r.getBottom());
minX = jmin (minX, r2.x);
minY = jmin (minY, r2.y);
maxX = jmax (maxX, r2.getRight());
maxY = jmax (maxY, r2.getBottom());
} }
return Rectangle (minX, minY, maxX - minX, maxY - minY); return Rectangle (minX, minY, maxX - minX, maxY - minY);


+ 2
- 2
src/juce_appframework/gui/graphics/geometry/juce_RectangleList.h View File

@@ -234,14 +234,14 @@ public:
bool next() throw(); bool next() throw();
/** Returns the current rectangle. */ /** Returns the current rectangle. */
const Rectangle& getRectangle() const throw() { return current; }
const Rectangle* getRectangle() const throw() { return current; }
//============================================================================== //==============================================================================
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator
private: private:
Rectangle current;
const Rectangle* current;
const RectangleList& owner; const RectangleList& owner;
int index; int index;


+ 2
- 2
src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp View File

@@ -31,7 +31,7 @@
#include "../../../../../juce_core/basics/juce_StandardHeader.h" #include "../../../../../juce_core/basics/juce_StandardHeader.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (push) #pragma warning (push)
#endif #endif
@@ -40,7 +40,7 @@ extern "C"
#include "jpglib/jpeglib.h" #include "jpglib/jpeglib.h"
} }
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (pop) #pragma warning (pop)
#endif #endif


+ 4
- 2
src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.cpp View File

@@ -147,8 +147,10 @@ public:
Image* decodeImage (InputStream& in) Image* decodeImage (InputStream& in)
{ {
GIFLoader loader (in);
return loader.getImage();
GIFLoader* const loader = new GIFLoader (in);
Image* const im = loader->getImage();
delete loader;
return im;
} }
bool writeImageToStream (const Image& /*sourceImage*/, OutputStream& /*destStream*/) bool writeImageToStream (const Image& /*sourceImage*/, OutputStream& /*destStream*/)


+ 3
- 3
src/juce_core/basics/juce_DataConversions.h View File

@@ -44,7 +44,7 @@
/** Swaps the byte-order in an integer from little to big-endianness or vice-versa. */ /** Swaps the byte-order in an integer from little to big-endianness or vice-versa. */
forcedinline uint32 swapByteOrder (uint32 n) throw() forcedinline uint32 swapByteOrder (uint32 n) throw()
{ {
#ifdef JUCE_MAC
#if JUCE_MAC
// Mac version // Mac version
return CFSwapInt32 (n); return CFSwapInt32 (n);
#elif JUCE_GCC #elif JUCE_GCC
@@ -73,7 +73,7 @@ inline uint16 swapByteOrder (const uint16 n) throw()
inline uint64 swapByteOrder (const uint64 value) throw() inline uint64 swapByteOrder (const uint64 value) throw()
{ {
#ifdef JUCE_MAC
#if JUCE_MAC
return CFSwapInt64 (value); return CFSwapInt64 (value);
#else #else
return (((int64) swapByteOrder ((uint32) value)) << 32) return (((int64) swapByteOrder ((uint32) value)) << 32)
@@ -81,7 +81,7 @@ inline uint64 swapByteOrder (const uint64 value) throw()
#endif #endif
} }
#ifdef JUCE_LITTLE_ENDIAN
#if JUCE_LITTLE_ENDIAN
/** Swaps the byte order of a 16-bit int if the CPU is big-endian */ /** Swaps the byte order of a 16-bit int if the CPU is big-endian */
inline uint16 swapIfBigEndian (const uint16 v) throw() { return v; } inline uint16 swapIfBigEndian (const uint16 v) throw() { return v; }
/** Swaps the byte order of a 32-bit int if the CPU is big-endian */ /** Swaps the byte order of a 32-bit int if the CPU is big-endian */


+ 1
- 1
src/juce_core/basics/juce_FileLogger.cpp View File

@@ -119,7 +119,7 @@ FileLogger* FileLogger::createDefaultAppLogger (const String& logFileSubDirector
const String& welcomeMessage, const String& welcomeMessage,
const int maxInitialFileSizeBytes) const int maxInitialFileSizeBytes)
{ {
#ifdef JUCE_MAC
#if JUCE_MAC
File logFile ("~/Library/Logs"); File logFile ("~/Library/Logs");
logFile = logFile.getChildFile (logFileName); logFile = logFile.getChildFile (logFileName);


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

@@ -263,7 +263,7 @@ const float float_Pi = 3.14159265358979323846f;
/** The isfinite() method seems to vary greatly between platforms, so this is a /** The isfinite() method seems to vary greatly between platforms, so this is a
platform-independent macro for it. platform-independent macro for it.
*/ */
#ifdef JUCE_LINUX
#if JUCE_LINUX
#define juce_isfinite(v) std::isfinite(v) #define juce_isfinite(v) std::isfinite(v)
#elif JUCE_MAC #elif JUCE_MAC
#if MACOS_10_2_OR_EARLIER #if MACOS_10_2_OR_EARLIER


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

@@ -38,7 +38,7 @@
preference to the standard calls. preference to the standard calls.
*/ */
#if JUCE_DEBUG && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
#if defined (JUCE_DEBUG) && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
#ifndef JUCE_DLL #ifndef JUCE_DLL
//============================================================================== //==============================================================================
// Win32 debug non-DLL versions.. // Win32 debug non-DLL versions..


+ 3
- 3
src/juce_core/basics/juce_PlatformDefs.h View File

@@ -83,7 +83,7 @@
#endif #endif
//============================================================================== //==============================================================================
#ifdef JUCE_MAC
#if JUCE_MAC
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
@@ -119,7 +119,7 @@
#endif #endif
//============================================================================== //==============================================================================
#ifdef JUCE_LINUX
#if JUCE_LINUX
#ifdef _DEBUG #ifdef _DEBUG
#define JUCE_DEBUG 1 #define JUCE_DEBUG 1
@@ -301,7 +301,7 @@
forcedinline void myfunction (int x) forcedinline void myfunction (int x)
@endcode @endcode
*/ */
#if JUCE_DEBUG
#ifdef JUCE_DEBUG
#define forcedinline __forceinline #define forcedinline __forceinline
#else #else
#define forcedinline inline #define forcedinline inline


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

@@ -117,7 +117,7 @@ void juce_Free (void* const block)
free (block); free (block);
} }
#if JUCE_DEBUG && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
#if defined (JUCE_DEBUG) && JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
void* juce_DebugMalloc (const int size, const char* file, const int line) void* juce_DebugMalloc (const int size, const char* file, const int line)
{ {


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

@@ -35,7 +35,7 @@
#include "juce_ArrayAllocationBase.h" #include "juce_ArrayAllocationBase.h"
#include "../threads/juce_CriticalSection.h" #include "../threads/juce_CriticalSection.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (push) #pragma warning (push)
#pragma warning (disable: 4512) #pragma warning (disable: 4512)
#endif #endif
@@ -639,7 +639,7 @@ private:
} }
}; };
#ifdef JUCE_MSVC
#if JUCE_MSVC
#pragma warning (pop) #pragma warning (pop)
#endif #endif


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

@@ -220,7 +220,7 @@ const File& File::operator= (const File& other) throw()
} }
//============================================================================== //==============================================================================
#ifdef JUCE_LINUX
#if JUCE_LINUX
#define NAMES_ARE_CASE_SENSITIVE 1 #define NAMES_ARE_CASE_SENSITIVE 1
#endif #endif


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

@@ -56,7 +56,7 @@ int CharacterFunctions::length (const char* const s) throw()
int CharacterFunctions::length (const juce_wchar* const s) throw() int CharacterFunctions::length (const juce_wchar* const s) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
int n = 0; int n = 0;
while (s[n] != 0) while (s[n] != 0)
++n; ++n;
@@ -74,7 +74,7 @@ void CharacterFunctions::copy (char* dest, const char* src, const int maxChars)
void CharacterFunctions::copy (juce_wchar* dest, const juce_wchar* src, int maxChars) throw() void CharacterFunctions::copy (juce_wchar* dest, const juce_wchar* src, int maxChars) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
while (--maxChars >= 0 && *src != 0) while (--maxChars >= 0 && *src != 0)
*dest++ = *src++; *dest++ = *src++;
@@ -101,7 +101,7 @@ void CharacterFunctions::append (char* dest, const char* src) throw()
void CharacterFunctions::append (juce_wchar* dest, const juce_wchar* src) throw() void CharacterFunctions::append (juce_wchar* dest, const juce_wchar* src) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
while (*dest != 0) while (*dest != 0)
++dest; ++dest;
@@ -123,7 +123,7 @@ int CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2) thr
{ {
jassert (s1 != 0 && s2 != 0); jassert (s1 != 0 && s2 != 0);
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
for (;;) for (;;)
{ {
if (*s1 != *s2) if (*s1 != *s2)
@@ -157,7 +157,7 @@ int CharacterFunctions::compare (const juce_wchar* s1, const juce_wchar* s2, int
{ {
jassert (s1 != 0 && s2 != 0); jassert (s1 != 0 && s2 != 0);
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
while (--maxChars >= 0) while (--maxChars >= 0)
{ {
if (*s1 != *s2) if (*s1 != *s2)
@@ -258,7 +258,7 @@ const char* CharacterFunctions::find (const char* const haystack, const char* co
const juce_wchar* CharacterFunctions::find (const juce_wchar* haystack, const juce_wchar* const needle) throw() const juce_wchar* CharacterFunctions::find (const juce_wchar* haystack, const juce_wchar* const needle) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
while (*haystack != 0) while (*haystack != 0)
{ {
const juce_wchar* s1 = haystack; const juce_wchar* s1 = haystack;
@@ -425,7 +425,7 @@ int CharacterFunctions::ftime (char* const dest, const int maxChars, const char*
int CharacterFunctions::ftime (juce_wchar* const dest, const int maxChars, const juce_wchar* const format, const struct tm* const tm) throw() int 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
#if MACOS_10_2_OR_EARLIER
const String formatTemp (format); const String formatTemp (format);
size_t num = strftime ((char*) dest, maxChars, (const char*) formatTemp, tm); size_t num = strftime ((char*) dest, maxChars, (const char*) formatTemp, tm);
String temp ((char*) dest); String temp ((char*) dest);
@@ -472,7 +472,7 @@ int CharacterFunctions::getIntValue (const juce_wchar* s) throw()
int64 CharacterFunctions::getInt64Value (const char* s) throw() int64 CharacterFunctions::getInt64Value (const char* s) throw()
{ {
#ifdef JUCE_LINUX
#if JUCE_LINUX
return atoll (s); return atoll (s);
#elif defined (JUCE_WIN32) #elif defined (JUCE_WIN32)
return _atoi64 (s); return _atoi64 (s);
@@ -535,7 +535,7 @@ double CharacterFunctions::getDoubleValue (const char* const s) throw()
double CharacterFunctions::getDoubleValue (const juce_wchar* const s) throw() double CharacterFunctions::getDoubleValue (const juce_wchar* const s) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
String temp (s); String temp (s);
return atof ((const char*) temp); return atof ((const char*) temp);
#else #else
@@ -552,7 +552,7 @@ char CharacterFunctions::toUpperCase (const char character) throw()
juce_wchar CharacterFunctions::toUpperCase (const juce_wchar character) throw() juce_wchar CharacterFunctions::toUpperCase (const juce_wchar character) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
return toupper ((char) character); return toupper ((char) character);
#else #else
return towupper (character); return towupper (character);
@@ -607,7 +607,7 @@ char CharacterFunctions::toLowerCase (const char character) throw()
juce_wchar CharacterFunctions::toLowerCase (const juce_wchar character) throw() juce_wchar CharacterFunctions::toLowerCase (const juce_wchar character) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
return tolower ((char) character); return tolower ((char) character);
#else #else
return towlower (character); return towlower (character);
@@ -662,7 +662,7 @@ bool CharacterFunctions::isWhitespace (const char character) throw()
bool CharacterFunctions::isWhitespace (const juce_wchar character) throw() bool CharacterFunctions::isWhitespace (const juce_wchar character) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
return isWhitespace ((char) character); return isWhitespace ((char) character);
#else #else
return iswspace (character) != 0; return iswspace (character) != 0;
@@ -687,7 +687,7 @@ bool CharacterFunctions::isLetter (const char character) throw()
bool CharacterFunctions::isLetter (const juce_wchar character) throw() bool CharacterFunctions::isLetter (const juce_wchar character) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
return isLetter ((char) character); return isLetter ((char) character);
#else #else
return iswalpha (character) != 0; return iswalpha (character) != 0;
@@ -703,7 +703,7 @@ bool CharacterFunctions::isLetterOrDigit (const char character) throw()
bool CharacterFunctions::isLetterOrDigit (const juce_wchar character) throw() bool CharacterFunctions::isLetterOrDigit (const juce_wchar character) throw()
{ {
#ifdef MACOS_10_2_OR_EARLIER
#if MACOS_10_2_OR_EARLIER
return isLetterOrDigit ((char) character); return isLetterOrDigit ((char) character);
#else #else
return iswalnum (character) != 0; return iswalnum (character) != 0;
@@ -748,7 +748,7 @@ int CharacterFunctions::vprintf (char* const dest, const int maxLength, const ch
int CharacterFunctions::vprintf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, va_list& args) throw() int CharacterFunctions::vprintf (juce_wchar* const dest, const int maxLength, const juce_wchar* const format, va_list& args) throw()
{ {
#ifdef MACOS_10_3_OR_EARLIER
#if MACOS_10_3_OR_EARLIER
const String formatTemp (format); const String formatTemp (format);
size_t num = vprintf ((char*) dest, maxLength, formatTemp, args); size_t num = vprintf ((char*) dest, maxLength, formatTemp, args);
String temp ((char*) dest); String temp ((char*) dest);


+ 1
- 1
src/juce_core/text/juce_String.cpp View File

@@ -36,7 +36,7 @@
#include "../basics/juce_StandardHeader.h" #include "../basics/juce_StandardHeader.h"
#ifdef JUCE_MSVC
#if JUCE_MSVC
#include <float.h> #include <float.h>
#endif #endif


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

@@ -96,7 +96,7 @@ public:
private: private:
//============================================================================== //==============================================================================
#if JUCE_WIN32 #if JUCE_WIN32
#ifdef JUCE_64BIT
#if JUCE_64BIT
// To avoid including windows.h in the public Juce includes, we'll just allocate a // To avoid including windows.h in the public Juce includes, we'll just allocate a
// block of memory here that's big enough to be used internally as a windows critical // block of memory here that's big enough to be used internally as a windows critical
// section object. // section object.


Loading…
Cancel
Save