Browse Source

RTAS mac window position fix. Introjucer fixes for Windows.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
d86d68446c
21 changed files with 112 additions and 61 deletions
  1. +2
    -0
      extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
  2. +4
    -6
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h
  3. +0
    -1
      extras/Introjucer/Source/Project Saving/jucer_ProjectSaver.h
  4. +1
    -1
      extras/Introjucer/Source/Project/jucer_AudioPluginModule.h
  5. +3
    -2
      extras/Introjucer/Source/Project/jucer_Module.cpp
  6. +2
    -0
      extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj
  7. +2
    -0
      extras/static library/Builds/VisualStudio2010/juce.vcxproj
  8. +2
    -0
      extras/the jucer/Builds/VisualStudio2010/Jucer.vcxproj
  9. +4
    -2
      modules/juce_audio_plugin_client/RTAS/juce_RTAS_MacUtilities.mm
  10. +3
    -3
      modules/juce_core/containers/juce_Array.h
  11. +2
    -2
      modules/juce_core/containers/juce_HashMap.h
  12. +31
    -0
      modules/juce_core/containers/juce_NamedValueSet.cpp
  13. +9
    -0
      modules/juce_core/containers/juce_NamedValueSet.h
  14. +5
    -5
      modules/juce_core/containers/juce_ReferenceCountedArray.h
  15. +1
    -1
      modules/juce_core/containers/juce_SparseSet.h
  16. +24
    -11
      modules/juce_core/containers/juce_Variant.cpp
  17. +13
    -11
      modules/juce_core/containers/juce_Variant.h
  18. +1
    -9
      modules/juce_core/memory/juce_ReferenceCountedObject.h
  19. +0
    -4
      modules/juce_core/text/juce_StringPairArray.h
  20. +2
    -1
      modules/juce_data_structures/values/juce_Value.cpp
  21. +1
    -2
      modules/juce_events/native/juce_win32_Messaging.cpp

+ 2
- 0
extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj View File

@@ -63,6 +63,7 @@
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -101,6 +102,7 @@
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>


+ 4
- 6
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h View File

@@ -361,7 +361,7 @@ public:
if (settings.hasType (getValueTreeTypeName()))
return new MSVCProjectExporterVC2008 (project, settings);
return 0;
return nullptr;
}
//==============================================================================
@@ -594,9 +594,6 @@ protected:
linker->setAttribute ("OutputFile", FileHelpers::windowsStylePath (binariesPath + "/" + outputFileName));
linker->setAttribute ("SuppressStartupBanner", "true");
//if (project.getJuceLinkageMode() == Project::useLinkedJuce)
// linker->setAttribute ("AdditionalLibraryDirectories", getJucePathFromTargetFolder().getChildFile ("bin").toWindowsStyle());
linker->setAttribute ("IgnoreDefaultLibraryNames", isDebug ? "libcmt.lib, msvcrt.lib" : "");
linker->setAttribute ("GenerateDebugInformation", isDebug ? "true" : "false");
linker->setAttribute ("ProgramDatabaseFile", FileHelpers::windowsStylePath (intermediatesPath + "/" + binaryName + ".pdb"));
@@ -744,7 +741,7 @@ public:
if (settings.hasType (getValueTreeTypeName()))
return new MSVCProjectExporterVC6 (project, settings);
return 0;
return nullptr;
}
//==============================================================================
@@ -1012,7 +1009,7 @@ public:
if (settings.hasType (getValueTreeTypeName()))
return new MSVCProjectExporterVC2010 (project, settings);
return 0;
return nullptr;
}
//==============================================================================
@@ -1192,6 +1189,7 @@ protected:
cl->createNewChildElement ("ProgramDataBaseFileName")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/"));
cl->createNewChildElement ("WarningLevel")->addTextElement ("Level4");
cl->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true");
cl->createNewChildElement ("MultiProcessorCompilation")->addTextElement ("true");
const String extraFlags (replacePreprocessorTokens (config, getExtraCompilerFlags().toString()).trim());
if (extraFlags.isNotEmpty())


+ 0
- 1
extras/Introjucer/Source/Project Saving/jucer_ProjectSaver.h View File

@@ -435,7 +435,6 @@ private:
if (exporter->getTargetFolder().createDirectory())
{
exporter->addToExtraSearchPaths (RelativePath ("JuceLibraryCode", RelativePath::projectFolder));
//exporter->addToExtraSearchPaths (RelativePath (exporter->getJuceFolder().toString(), RelativePath::projectFolder).getChildFile ("modules"));
generatedFilesGroup.getNode() = originalGeneratedGroup.createCopy();
project.getProjectType().prepareExporter (*exporter);


+ 1
- 1
extras/Introjucer/Source/Project/jucer_AudioPluginModule.h View File

@@ -278,7 +278,7 @@ namespace RTASHelpers
RelativePath rtasFolder (getRTASFolder (exporter).toString(), RelativePath::projectFolder);
exporter.msvcExtraPreprocessorDefs.set ("JucePlugin_WinBag_path", CodeHelpers::addEscapeChars (rtasFolder.getChildFile ("WinBag")
.toWindowsStyle().quoted()));
.toWindowsStyle().quoted()));
String msvcPathToRTASFolder (exporter.getJucePathFromTargetFolder()
.getChildFile ("modules/juce_audio_plugin_client/RTAS")


+ 3
- 2
extras/Introjucer/Source/Project/jucer_Module.cpp View File

@@ -429,14 +429,15 @@ void LibraryModule::findWildcardMatches (const File& localModuleFolder, const St
DirectoryIterator iter (localModuleFolder.getChildFile (path), false, wildCard);
while (iter.next())
tempList.addSorted (sorter, iter.getFile());
if (! iter.getFile().isHidden())
tempList.addSorted (sorter, iter.getFile());
result.addArray (tempList);
}
void LibraryModule::addFileWithGroups (Project::Item& group, const RelativePath& file, const String& path) const
{
const int slash = path.indexOfChar ('/');
const int slash = path.indexOfChar (File::separator);
if (slash >= 0)
{


+ 2
- 0
extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj View File

@@ -63,6 +63,7 @@
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -101,6 +102,7 @@
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>


+ 2
- 0
extras/static library/Builds/VisualStudio2010/juce.vcxproj View File

@@ -63,6 +63,7 @@
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -101,6 +102,7 @@
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>


+ 2
- 0
extras/the jucer/Builds/VisualStudio2010/Jucer.vcxproj View File

@@ -63,6 +63,7 @@
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -101,6 +102,7 @@
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>


+ 4
- 2
modules/juce_audio_plugin_client/RTAS/juce_RTAS_MacUtilities.mm View File

@@ -66,20 +66,22 @@ void* attachSubWindow (void* hostWindowRef, Component* comp)
NSRect hostWindowScreenFrame = [[hostWindow screen] frame];
const int mainScreenHeight = [[[NSScreen screens] objectAtIndex: 0] frame].size.height;
#if WINDOWPOSITION_BODGE
{
Rect winBounds;
GetWindowBounds ((WindowRef) hostWindowRef, kWindowContentRgn, &winBounds);
NSRect w = [hostWindow frame];
w.origin.x = winBounds.left;
w.origin.y = hostWindowScreenFrame.size.height + hostWindowScreenFrame.origin.y - winBounds.bottom;
w.origin.y = mainScreenHeight - winBounds.bottom;
[hostWindow setFrame: w display: NO animate: NO];
}
#endif
NSPoint windowPos = [hostWindow convertBaseToScreen: f.origin];
windowPos.x = windowPos.x + jmax (0.0f, (oldWindowFrame.size.width - f.size.width) / 2.0f);
windowPos.y = hostWindowScreenFrame.size.height + hostWindowScreenFrame.origin.y - (windowPos.y + f.size.height);
windowPos.y = mainScreenHeight - (windowPos.y + f.size.height);
comp->setTopLeftPosition ((int) windowPos.x, (int) windowPos.y);


+ 3
- 3
modules/juce_core/containers/juce_Array.h View File

@@ -225,7 +225,7 @@ public:
@param index the index of the element being requested (0 is the first element in the array)
@see getUnchecked, getFirst, getLast
*/
const ElementType operator[] (const int index) const
ElementType operator[] (const int index) const
{
const ScopedLockType lock (getLock());
return isPositiveAndBelow (index, numUsed) ? data.elements [index]
@@ -241,7 +241,7 @@ public:
@param index the index of the element being requested (0 is the first element in the array)
@see operator[], getFirst, getLast
*/
inline const ElementType getUnchecked (const int index) const
inline ElementType getUnchecked (const int index) const
{
const ScopedLockType lock (getLock());
jassert (isPositiveAndBelow (index, numUsed));
@@ -1022,7 +1022,7 @@ private:
ArrayAllocationBase <ElementType, TypeOfCriticalSectionToUse> data;
int numUsed;
inline void deleteAllElements()
inline void deleteAllElements() noexcept
{
for (int i = 0; i < numUsed; ++i)
data.elements[i].~ElementType();


+ 2
- 2
modules/juce_core/containers/juce_HashMap.h View File

@@ -402,7 +402,7 @@ public:
/** Returns the current item's key.
This should only be called when a call to next() has just returned true.
*/
const KeyType getKey() const
KeyType getKey() const
{
return entry != nullptr ? entry->key : KeyType();
}
@@ -410,7 +410,7 @@ public:
/** Returns the current item's value.
This should only be called when a call to next() has just returned true.
*/
const ValueType getValue() const
ValueType getValue() const
{
return entry != nullptr ? entry->value : ValueType();
}


+ 31
- 0
modules/juce_core/containers/juce_NamedValueSet.cpp View File

@@ -55,6 +55,11 @@ NamedValueSet::NamedValue::NamedValue (NamedValue&& other) noexcept
{
}
inline NamedValueSet::NamedValue::NamedValue (const Identifier& name_, var&& value_)
: name (name_), value (static_cast <var&&> (value_))
{
}
NamedValueSet::NamedValue& NamedValueSet::NamedValue::operator= (NamedValue&& other) noexcept
{
nextListItem = static_cast <LinkedListPointer<NamedValue>&&> (other.nextListItem);
@@ -160,6 +165,32 @@ var* NamedValueSet::getVarPointer (const Identifier& name) const noexcept
return nullptr;
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
bool NamedValueSet::set (const Identifier& name, var&& newValue)
{
LinkedListPointer<NamedValue>* i = &values;
while (i->get() != nullptr)
{
NamedValue* const v = i->get();
if (v->name == name)
{
if (v->value.equalsWithSameType (newValue))
return false;
v->value = static_cast <var&&> (newValue);
return true;
}
i = &(v->nextListItem);
}
i->insertNext (new NamedValue (name, static_cast <var&&> (newValue)));
return true;
}
#endif
bool NamedValueSet::set (const Identifier& name, const var& newValue)
{
LinkedListPointer<NamedValue>* i = &values;


+ 9
- 0
modules/juce_core/containers/juce_NamedValueSet.h View File

@@ -84,6 +84,14 @@ public:
*/
bool set (const Identifier& name, const var& newValue);
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
/** Changes or adds a named value.
@returns true if a value was changed or added; false if the
value was already set the the value passed-in.
*/
bool set (const Identifier& name, var&& newValue);
#endif
/** Returns true if the set contains an item with the specified name. */
bool contains (const Identifier& name) const;
@@ -135,6 +143,7 @@ private:
NamedValue& operator= (const NamedValue&);
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
NamedValue (NamedValue&&) noexcept;
NamedValue (const Identifier& name, var&& value);
NamedValue& operator= (NamedValue&&) noexcept;
#endif
bool operator== (const NamedValue& other) const noexcept;


+ 5
- 5
modules/juce_core/containers/juce_ReferenceCountedArray.h View File

@@ -128,7 +128,7 @@ public:
@see getUnchecked
*/
inline const ObjectClassPtr operator[] (const int index) const noexcept
inline ObjectClassPtr operator[] (const int index) const noexcept
{
const ScopedLockType lock (getLock());
return isPositiveAndBelow (index, numUsed) ? data.elements [index]
@@ -140,7 +140,7 @@ public:
This is a faster and less safe version of operator[] which doesn't check the index passed in, so
it can be used when you're sure the index if always going to be legal.
*/
inline const ObjectClassPtr getUnchecked (const int index) const noexcept
inline ObjectClassPtr getUnchecked (const int index) const noexcept
{
const ScopedLockType lock (getLock());
jassert (isPositiveAndBelow (index, numUsed));
@@ -152,7 +152,7 @@ public:
This will return a null pointer if the array's empty.
@see getLast
*/
inline const ObjectClassPtr getFirst() const noexcept
inline ObjectClassPtr getFirst() const noexcept
{
const ScopedLockType lock (getLock());
return numUsed > 0 ? data.elements [0]
@@ -164,7 +164,7 @@ public:
This will return a null pointer if the array's empty.
@see getFirst
*/
inline const ObjectClassPtr getLast() const noexcept
inline ObjectClassPtr getLast() const noexcept
{
const ScopedLockType lock (getLock());
return numUsed > 0 ? data.elements [numUsed - 1]
@@ -466,7 +466,7 @@ public:
@param indexToRemove the index of the element to remove
@see remove, removeObject, removeRange
*/
const ObjectClassPtr removeAndReturn (const int indexToRemove)
ObjectClassPtr removeAndReturn (const int indexToRemove)
{
ObjectClassPtr removedItem;
const ScopedLockType lock (getLock());


+ 1
- 1
modules/juce_core/containers/juce_SparseSet.h View File

@@ -146,7 +146,7 @@ public:
/** Returns the range between the lowest and highest values in the set.
@see getRange
*/
const Range<Type> getTotalRange() const
Range<Type> getTotalRange() const
{
if (values.size() > 0)
{


+ 24
- 11
modules/juce_core/containers/juce_Variant.cpp View File

@@ -399,17 +399,17 @@ void var::swapWith (var& other) noexcept
std::swap (value, other.value);
}
const var& var::operator= (const var& v) { type->cleanUp (value); type = v.type; type->createCopy (value, v.value); return *this; }
const var& var::operator= (const int v) { type->cleanUp (value); type = &VariantType_Int::instance; value.intValue = v; return *this; }
const var& var::operator= (const int64 v) { type->cleanUp (value); type = &VariantType_Int64::instance; value.int64Value = v; return *this; }
const var& var::operator= (const bool v) { type->cleanUp (value); type = &VariantType_Bool::instance; value.boolValue = v; return *this; }
const var& var::operator= (const double v) { type->cleanUp (value); type = &VariantType_Double::instance; value.doubleValue = v; return *this; }
const var& var::operator= (const char* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
const var& var::operator= (const wchar_t* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
const var& var::operator= (const String& v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
const var& var::operator= (const Array<var>& v) { var v2 (v); swapWith (v2); return *this; }
const var& var::operator= (ReferenceCountedObject* v) { var v2 (v); swapWith (v2); return *this; }
const var& var::operator= (MethodFunction v) { var v2 (v); swapWith (v2); return *this; }
var& var::operator= (const var& v) { type->cleanUp (value); type = v.type; type->createCopy (value, v.value); return *this; }
var& var::operator= (const int v) { type->cleanUp (value); type = &VariantType_Int::instance; value.intValue = v; return *this; }
var& var::operator= (const int64 v) { type->cleanUp (value); type = &VariantType_Int64::instance; value.int64Value = v; return *this; }
var& var::operator= (const bool v) { type->cleanUp (value); type = &VariantType_Bool::instance; value.boolValue = v; return *this; }
var& var::operator= (const double v) { type->cleanUp (value); type = &VariantType_Double::instance; value.doubleValue = v; return *this; }
var& var::operator= (const char* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
var& var::operator= (const wchar_t* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
var& var::operator= (const String& v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
var& var::operator= (const Array<var>& v) { var v2 (v); swapWith (v2); return *this; }
var& var::operator= (ReferenceCountedObject* v) { var v2 (v); swapWith (v2); return *this; }
var& var::operator= (MethodFunction v) { var v2 (v); swapWith (v2); return *this; }
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
var::var (var&& other) noexcept
@@ -424,6 +424,19 @@ var& var::operator= (var&& other) noexcept
swapWith (other);
return *this;
}
var::var (String&& value_) : type (&VariantType_String::instance)
{
new (value.stringValue) String (static_cast<String&&> (value_));
}
var& var::operator= (String&& v)
{
type->cleanUp (value);
type = &VariantType_String::instance;
new (value.stringValue) String (static_cast<String&&> (v));
return *this;
}
#endif
//==============================================================================


+ 13
- 11
modules/juce_core/containers/juce_Variant.h View File

@@ -78,21 +78,23 @@ public:
var (ReferenceCountedObject* object);
var (MethodFunction method) noexcept;
const var& operator= (const var& valueToCopy);
const var& operator= (int value);
const var& operator= (int64 value);
const var& operator= (bool value);
const var& operator= (double value);
const var& operator= (const char* value);
const var& operator= (const wchar_t* value);
const var& operator= (const String& value);
const var& operator= (const Array<var>& value);
const var& operator= (ReferenceCountedObject* object);
const var& operator= (MethodFunction method);
var& operator= (const var& valueToCopy);
var& operator= (int value);
var& operator= (int64 value);
var& operator= (bool value);
var& operator= (double value);
var& operator= (const char* value);
var& operator= (const wchar_t* value);
var& operator= (const String& value);
var& operator= (const Array<var>& value);
var& operator= (ReferenceCountedObject* object);
var& operator= (MethodFunction method);
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
var (var&& other) noexcept;
var (String&& value);
var& operator= (var&& other) noexcept;
var& operator= (String&& value);
#endif
void swapWith (var& other) noexcept;


+ 1
- 9
modules/juce_core/memory/juce_ReferenceCountedObject.h View File

@@ -256,15 +256,7 @@ public:
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
ReferenceCountedObjectPtr& operator= (ReferenceCountedObjectPtr&& other)
{
if (this != &other)
{
if (referencedObject != nullptr)
referencedObject->decReferenceCount();
referencedObject = other.referencedObject;
other.referencedObject = nullptr;
}
std::swap (referencedObject, other.referencedObject);
return *this;
}
#endif


+ 0
- 4
modules/juce_core/text/juce_StringPairArray.h View File

@@ -53,17 +53,13 @@ public:
//==============================================================================
/** Compares two arrays.
Comparisons are case-sensitive.
@returns true only if the other array contains exactly the same strings with the same keys
*/
bool operator== (const StringPairArray& other) const;
/** Compares two arrays.
Comparisons are case-sensitive.
@returns false if the other array contains exactly the same strings with the same keys
*/
bool operator!= (const StringPairArray& other) const;


+ 2
- 1
modules/juce_data_structures/values/juce_Value.cpp View File

@@ -51,7 +51,8 @@ void Value::ValueSource::sendChangeMessage (const bool synchronous)
}
else
{
triggerAsyncUpdate();
if (valuesWithListeners.size() > 0)
triggerAsyncUpdate();
}
}


+ 1
- 2
modules/juce_events/native/juce_win32_Messaging.cpp View File

@@ -142,8 +142,7 @@ bool MessageManager::postMessageToSystemQueue (Message* message)
return PostMessage (juce_messageWindowHandle, WindowsMessageHelpers::specialId, 0, (LPARAM) message) != 0;
}
void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* callback,
void* userData)
void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* callback, void* userData)
{
if (MessageManager::getInstance()->isThisTheMessageThread())
{


Loading…
Cancel
Save