Browse Source

For for Component::beginDragAutoRepeat(). Fix for ppc atomics compilation. Fix for jucer image code generation.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
bd4df346bc
9 changed files with 31 additions and 49 deletions
  1. +4
    -0
      extras/Jucer (experimental)/Source/Utility/jucer_PresetIDs.h
  2. +1
    -1
      extras/the jucer/src/model/paintelements/jucer_FillType.cpp
  3. +2
    -13
      juce_amalgamated.cpp
  4. +11
    -11
      juce_amalgamated.h
  5. +10
    -10
      src/core/juce_Atomic.h
  6. +1
    -1
      src/core/juce_StandardHeader.h
  7. +1
    -1
      src/gui/components/controls/juce_TreeView.cpp
  8. +1
    -2
      src/gui/components/mouse/juce_MouseInputSource.cpp
  9. +0
    -10
      src/native/linux/juce_linux_Threads.cpp

+ 4
- 0
extras/Jucer (experimental)/Source/Utility/jucer_PresetIDs.h View File

@@ -101,6 +101,10 @@ namespace Ids
DECLARE_ID (classDesc);
DECLARE_ID (controlPoint);
DECLARE_ID (createCallback);
DECLARE_ID (parentClasses);
DECLARE_ID (constructorParams);
DECLARE_ID (memberInitialisers);
DECLARE_ID (lossOfFocusDiscardsChanges);
const Identifier class_ ("class");
const Identifier id_ ("id");


+ 1
- 1
extras/the jucer/src/model/paintelements/jucer_FillType.cpp View File

@@ -171,7 +171,7 @@ void JucerFillType::fillInGeneratedCode (GeneratedCode& code, String& paintMetho
String x, y, w, h;
positionToCode (imageAnchor, code.document->getComponentLayout(), x, y, w, h);
s << "g.setTiledImageFill (*";
s << "g.setTiledImageFill (";
const String indent (String::repeatedString (T(" "), s.length()));


+ 2
- 13
juce_amalgamated.cpp View File

@@ -55920,7 +55920,7 @@ private:

void TreeView::showDragHighlight (TreeViewItem* item, int insertIndex, int x, int y) throw()
{
beginDragAutoRepeat (1000 / 30);
beginDragAutoRepeat (100);

if (dragInsertPointHighlight == 0)
{
@@ -70671,8 +70671,7 @@ public:

void handleAsyncUpdate()
{
if (! isDragging())
setScreenPos (Desktop::getMousePosition(), jmax (lastTime, Time::currentTimeMillis()), true);
setScreenPos (Desktop::getMousePosition(), jmax (lastTime, Time::currentTimeMillis()), true);
}

void enableUnboundedMouseMovement (bool enable, bool keepCursorVisibleUntilOffscreen)
@@ -254602,16 +254601,6 @@ bool juce_setThreadPriority (void* handle, int priority)
if (pthread_getschedparam ((pthread_t) handle, &policy, &param) == 0
&& policy != SCHED_OTHER)
{
int minp = sched_get_priority_min (policy);
int maxp = sched_get_priority_max (policy);

int pri = ((maxp - minp) / 2) * (priority - 1) / 9;

if (param.sched_priority >= (minp + (maxp - minp) / 2))
param.sched_priority = minp + ((maxp - minp) / 2) + pri; // (realtime)
else
param.sched_priority = minp + pri; // (high)

param.sched_priority = jlimit (1, 127, 1 + (priority * 126) / 11);
return pthread_setschedparam ((pthread_t) handle, policy, &param) == 0;
}


+ 11
- 11
juce_amalgamated.h View File

@@ -64,7 +64,7 @@
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 52
#define JUCE_BUILDNUMBER 42
#define JUCE_BUILDNUMBER 43

/** Current Juce version number.

@@ -5929,8 +5929,8 @@ template <typename Type>
inline Type Atomic<Type>::get() const throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier (0, (int32_t*) &value))
: castFrom64Bit ((int64) OSAtomicAdd64Barrier (0, (int64_t*) &value));
return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier (0, (volatile int32_t*) &value))
: castFrom64Bit ((int64) OSAtomicAdd64Barrier (0, (volatile int64_t*) &value));
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchangeAdd ((volatile long*) &value, (long) 0))
: castFrom64Bit ((int64) juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0));
@@ -5957,8 +5957,8 @@ template <typename Type>
inline Type Atomic<Type>::operator+= (const Type amountToAdd) throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) amountToAdd, (int32_t*) &value)
: (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (int64_t*) &value);
return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) amountToAdd, (volatile int32_t*) &value)
: (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? (Type) (juce_InterlockedExchangeAdd ((volatile long*) &value, (long) amountToAdd) + (long) amountToAdd)
: (Type) (juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) amountToAdd) + (__int64) amountToAdd);
@@ -5977,8 +5977,8 @@ template <typename Type>
inline Type Atomic<Type>::operator++() throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? (Type) OSAtomicIncrement32Barrier ((int32_t*) &value)
: (Type) OSAtomicIncrement64Barrier ((int64_t*) &value);
return sizeof (Type) == 4 ? (Type) OSAtomicIncrement32Barrier ((volatile int32_t*) &value)
: (Type) OSAtomicIncrement64Barrier ((volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? (Type) juce_InterlockedIncrement ((volatile long*) &value)
: (Type) juce_InterlockedIncrement64 ((volatile __int64*) &value);
@@ -5991,8 +5991,8 @@ template <typename Type>
inline Type Atomic<Type>::operator--() throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? (Type) OSAtomicDecrement32Barrier ((int32_t*) &value)
: (Type) OSAtomicDecrement64Barrier ((int64_t*) &value);
return sizeof (Type) == 4 ? (Type) OSAtomicDecrement32Barrier ((volatile int32_t*) &value)
: (Type) OSAtomicDecrement64Barrier ((volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? (Type) juce_InterlockedDecrement ((volatile long*) &value)
: (Type) juce_InterlockedDecrement64 ((volatile __int64*) &value);
@@ -6005,8 +6005,8 @@ template <typename Type>
inline bool Atomic<Type>::compareAndSetBool (const Type newValue, const Type valueToCompare) throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? OSAtomicCompareAndSwap32Barrier ((int32_t) castTo32Bit (valueToCompare), (int32_t) castTo32Bit (newValue), (int32_t*) &value)
: OSAtomicCompareAndSwap64Barrier ((int64_t) castTo64Bit (valueToCompare), (int64_t) castTo64Bit (newValue), (int64_t*) &value);
return sizeof (Type) == 4 ? OSAtomicCompareAndSwap32Barrier ((int32_t) castTo32Bit (valueToCompare), (int32_t) castTo32Bit (newValue), (volatile int32_t*) &value)
: OSAtomicCompareAndSwap64Barrier ((int64_t) castTo64Bit (valueToCompare), (int64_t) castTo64Bit (newValue), (volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return compareAndSetValue (newValue, valueToCompare) == valueToCompare;
#elif JUCE_ATOMICS_GCC


+ 10
- 10
src/core/juce_Atomic.h View File

@@ -230,8 +230,8 @@ template <typename Type>
inline Type Atomic<Type>::get() const throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier (0, (int32_t*) &value))
: castFrom64Bit ((int64) OSAtomicAdd64Barrier (0, (int64_t*) &value));
return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier (0, (volatile int32_t*) &value))
: castFrom64Bit ((int64) OSAtomicAdd64Barrier (0, (volatile int64_t*) &value));
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchangeAdd ((volatile long*) &value, (long) 0))
: castFrom64Bit ((int64) juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0));
@@ -258,8 +258,8 @@ template <typename Type>
inline Type Atomic<Type>::operator+= (const Type amountToAdd) throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) amountToAdd, (int32_t*) &value)
: (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (int64_t*) &value);
return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) amountToAdd, (volatile int32_t*) &value)
: (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? (Type) (juce_InterlockedExchangeAdd ((volatile long*) &value, (long) amountToAdd) + (long) amountToAdd)
: (Type) (juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) amountToAdd) + (__int64) amountToAdd);
@@ -278,8 +278,8 @@ template <typename Type>
inline Type Atomic<Type>::operator++() throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? (Type) OSAtomicIncrement32Barrier ((int32_t*) &value)
: (Type) OSAtomicIncrement64Barrier ((int64_t*) &value);
return sizeof (Type) == 4 ? (Type) OSAtomicIncrement32Barrier ((volatile int32_t*) &value)
: (Type) OSAtomicIncrement64Barrier ((volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? (Type) juce_InterlockedIncrement ((volatile long*) &value)
: (Type) juce_InterlockedIncrement64 ((volatile __int64*) &value);
@@ -292,8 +292,8 @@ template <typename Type>
inline Type Atomic<Type>::operator--() throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? (Type) OSAtomicDecrement32Barrier ((int32_t*) &value)
: (Type) OSAtomicDecrement64Barrier ((int64_t*) &value);
return sizeof (Type) == 4 ? (Type) OSAtomicDecrement32Barrier ((volatile int32_t*) &value)
: (Type) OSAtomicDecrement64Barrier ((volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? (Type) juce_InterlockedDecrement ((volatile long*) &value)
: (Type) juce_InterlockedDecrement64 ((volatile __int64*) &value);
@@ -306,8 +306,8 @@ template <typename Type>
inline bool Atomic<Type>::compareAndSetBool (const Type newValue, const Type valueToCompare) throw()
{
#if JUCE_ATOMICS_MAC
return sizeof (Type) == 4 ? OSAtomicCompareAndSwap32Barrier ((int32_t) castTo32Bit (valueToCompare), (int32_t) castTo32Bit (newValue), (int32_t*) &value)
: OSAtomicCompareAndSwap64Barrier ((int64_t) castTo64Bit (valueToCompare), (int64_t) castTo64Bit (newValue), (int64_t*) &value);
return sizeof (Type) == 4 ? OSAtomicCompareAndSwap32Barrier ((int32_t) castTo32Bit (valueToCompare), (int32_t) castTo32Bit (newValue), (volatile int32_t*) &value)
: OSAtomicCompareAndSwap64Barrier ((int64_t) castTo64Bit (valueToCompare), (int64_t) castTo64Bit (newValue), (volatile int64_t*) &value);
#elif JUCE_ATOMICS_WINDOWS
return compareAndSetValue (newValue, valueToCompare) == valueToCompare;
#elif JUCE_ATOMICS_GCC


+ 1
- 1
src/core/juce_StandardHeader.h View File

@@ -33,7 +33,7 @@
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 52
#define JUCE_BUILDNUMBER 42
#define JUCE_BUILDNUMBER 43
/** Current Juce version number.


+ 1
- 1
src/gui/components/controls/juce_TreeView.cpp View File

@@ -919,7 +919,7 @@ private:
//==============================================================================
void TreeView::showDragHighlight (TreeViewItem* item, int insertIndex, int x, int y) throw()
{
beginDragAutoRepeat (1000 / 30);
beginDragAutoRepeat (100);
if (dragInsertPointHighlight == 0)
{


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

@@ -358,8 +358,7 @@ public:
void handleAsyncUpdate()
{
if (! isDragging())
setScreenPos (Desktop::getMousePosition(), jmax (lastTime, Time::currentTimeMillis()), true);
setScreenPos (Desktop::getMousePosition(), jmax (lastTime, Time::currentTimeMillis()), true);
}
//==============================================================================


+ 0
- 10
src/native/linux/juce_linux_Threads.cpp View File

@@ -95,16 +95,6 @@ bool juce_setThreadPriority (void* handle, int priority)
if (pthread_getschedparam ((pthread_t) handle, &policy, &param) == 0
&& policy != SCHED_OTHER)
{
int minp = sched_get_priority_min (policy);
int maxp = sched_get_priority_max (policy);
int pri = ((maxp - minp) / 2) * (priority - 1) / 9;
if (param.sched_priority >= (minp + (maxp - minp) / 2))
param.sched_priority = minp + ((maxp - minp) / 2) + pri; // (realtime)
else
param.sched_priority = minp + pri; // (high)
param.sched_priority = jlimit (1, 127, 1 + (priority * 126) / 11);
return pthread_setschedparam ((pthread_t) handle, policy, &param) == 0;
}


Loading…
Cancel
Save