upgrade to JUCE 5.4.3. Remove (probably) unused JUCE modules. Remove VST2 target (it's been end-of-life'd by Steinberg and by JUCE)

This commit is contained in:
Alex Birch
2019-06-22 20:41:38 +01:00
parent d22c2cd4fa
commit 9ee566b251
1140 changed files with 67534 additions and 105952 deletions

View File

@ -43,10 +43,10 @@ struct CustomMenuBarItemHolder : public Component
if (newComponent != custom)
{
if (custom != nullptr)
removeChildComponent (custom);
removeChildComponent (custom.get());
custom = newComponent;
addAndMakeVisible (custom);
addAndMakeVisible (*custom);
resized();
}
}

View File

@ -54,7 +54,7 @@ public:
BurgerMenuComponent (MenuBarModel* model = nullptr);
/** Destructor. */
~BurgerMenuComponent();
~BurgerMenuComponent() override;
//==============================================================================
/** Changes the model object to use to control the burger menu.

View File

@ -50,7 +50,7 @@ public:
MenuBarComponent (MenuBarModel* model = nullptr);
/** Destructor. */
~MenuBarComponent();
~MenuBarComponent() override;
//==============================================================================
/** Changes the model object to use to control the bar.

View File

@ -43,7 +43,7 @@ void MenuBarModel::menuItemsChanged()
triggerAsyncUpdate();
}
void MenuBarModel::setApplicationCommandManagerToWatch (ApplicationCommandManager* const newManager) noexcept
void MenuBarModel::setApplicationCommandManagerToWatch (ApplicationCommandManager* newManager)
{
if (manager != newManager)
{
@ -57,12 +57,12 @@ void MenuBarModel::setApplicationCommandManagerToWatch (ApplicationCommandManage
}
}
void MenuBarModel::addListener (Listener* const newListener) noexcept
void MenuBarModel::addListener (Listener* newListener)
{
listeners.add (newListener);
}
void MenuBarModel::removeListener (Listener* const listenerToRemove) noexcept
void MenuBarModel::removeListener (Listener* listenerToRemove)
{
// Trying to remove a listener that isn't on the list!
// If this assertion happens because this object is a dangling pointer, make sure you've not

View File

@ -46,7 +46,7 @@ public:
MenuBarModel() noexcept;
/** Destructor. */
virtual ~MenuBarModel();
~MenuBarModel() override;
//==============================================================================
/** Call this when some of your menu items have changed.
@ -69,7 +69,7 @@ public:
This will also allow it to flash a menu name when a command from that menu
is invoked using a keystroke.
*/
void setApplicationCommandManagerToWatch (ApplicationCommandManager* manager) noexcept;
void setApplicationCommandManagerToWatch (ApplicationCommandManager* manager);
//==============================================================================
/** A class to receive callbacks when a MenuBarModel changes.
@ -80,7 +80,7 @@ public:
{
public:
/** Destructor. */
virtual ~Listener() {}
virtual ~Listener() = default;
//==============================================================================
/** This callback is made when items are changed in the menu bar model. */
@ -104,12 +104,12 @@ public:
@see removeListener
*/
void addListener (Listener* listenerToAdd) noexcept;
void addListener (Listener* listenerToAdd);
/** Removes a listener.
@see addListener
*/
void removeListener (Listener* listenerToRemove) noexcept;
void removeListener (Listener* listenerToRemove);
//==============================================================================
/** This method must return a list of the names of the menus. */

View File

@ -40,7 +40,7 @@ struct PopupMenu::HelperClasses
{
class MouseSourceState;
class MenuWindow;
struct MenuWindow;
static bool canBeTriggered (const PopupMenu::Item& item) noexcept { return item.isEnabled && item.itemID != 0 && ! item.isSectionHeader; }
static bool hasActiveSubMenu (const PopupMenu::Item& item) noexcept { return item.isEnabled && item.subMenu != nullptr && item.subMenu->items.size() > 0; }
@ -77,9 +77,10 @@ struct ItemComponent : public Component
: item (i), customComp (i.customComponent)
{
if (item.isSectionHeader)
customComp = new HeaderItemComponent (item.text);
customComp = *new HeaderItemComponent (item.text);
addAndMakeVisible (customComp);
if (customComp != nullptr)
addAndMakeVisible (*customComp);
parent.addAndMakeVisible (this);
@ -93,9 +94,9 @@ struct ItemComponent : public Component
addMouseListener (&parent, false);
}
~ItemComponent()
~ItemComponent() override
{
removeChildComponent (customComp);
removeChildComponent (customComp.get());
}
void getIdealSize (int& idealWidth, int& idealHeight, const int standardItemHeight)
@ -188,9 +189,8 @@ private:
};
//==============================================================================
class MenuWindow : public Component
struct MenuWindow : public Component
{
public:
MenuWindow (const PopupMenu& menu, MenuWindow* parentWindow,
const Options& opts, bool alignToRectangle, bool shouldDismissOnMouseUp,
ApplicationCommandManager** manager, float parentScaleFactor = 1.0f)
@ -211,10 +211,10 @@ public:
setLookAndFeel (parent != nullptr ? &(parent->getLookAndFeel())
: menu.lookAndFeel.get());
auto& lf = getLookAndFeel();
parentComponent = lf.getParentComponentForMenuOptions (options);
const_cast<Options&>(options) = options.withParentComponent (parentComponent);
if (parentComponent == nullptr && parentWindow == nullptr && lf.shouldPopupMenuScaleWithTargetComponent (options))
if (auto* targetComponent = options.getTargetComponent())
@ -267,7 +267,7 @@ public:
getMouseState (Desktop::getInstance().getMainMouseSource()); // forces creation of a mouse source watcher for the main mouse
}
~MenuWindow()
~MenuWindow() override
{
getActiveWindows().removeFirstMatchingValue (this);
Desktop::getInstance().removeGlobalMouseListener (this);
@ -592,10 +592,13 @@ public:
}
//==============================================================================
Rectangle<int> getParentArea (Point<int> targetPoint)
Rectangle<int> getParentArea (Point<int> targetPoint, Component* relativeTo = nullptr)
{
auto parentArea = Desktop::getInstance().getDisplays().getDisplayContaining (targetPoint)
#if JUCE_MAC
if (relativeTo != nullptr)
targetPoint = relativeTo->localPointToGlobal (targetPoint);
auto parentArea = Desktop::getInstance().getDisplays().findDisplayForPoint (targetPoint)
#if JUCE_MAC || JUCE_ANDROID
.userArea;
#else
.totalArea; // on windows, don't stop the menu overlapping the taskbar
@ -789,7 +792,7 @@ public:
windowPos.getHeight() - (PopupMenuSettings::scrollZone + m->getHeight())),
currentY);
auto parentArea = getParentArea (windowPos.getPosition()) / scaleFactor;
auto parentArea = getParentArea (windowPos.getPosition(), parentComponent) / scaleFactor;
auto deltaY = wantedY - currentY;
windowPos.setSize (jmin (windowPos.getWidth(), parentArea.getWidth()),
@ -909,7 +912,8 @@ public:
activeSubMenu.reset (new HelperClasses::MenuWindow (*(childComp->item.subMenu), this,
options.withTargetScreenArea (childComp->getScreenBounds())
.withMinimumWidth (0)
.withTargetComponent (nullptr),
.withTargetComponent (nullptr)
.withParentComponent (parentComponent),
false, dismissOnMouseUp, managerOfChosenCommand, scaleFactor));
activeSubMenu->setVisible (true); // (must be called before enterModalState on Windows to avoid DropShadower confusion)
@ -1085,7 +1089,7 @@ private:
{
PopupMenuSettings::menuWasHiddenBecauseOfAppChange = true;
window.dismissMenu (nullptr);
// Note: this object may have been deleted by the previous call..
// Note: This object may have been deleted by the previous call.
}
}
else if (wasDown && timeNow > window.windowCreationTime + 250
@ -1096,7 +1100,7 @@ private:
else if ((window.hasBeenOver || ! window.dismissOnMouseUp) && ! isOverAny)
window.dismissMenu (nullptr);
// Note: this object may have been deleted by the previous call..
// Note: This object may have been deleted by the previous call.
}
else
{
@ -1738,8 +1742,13 @@ bool JUCE_CALLTYPE PopupMenu::dismissAllActiveMenus()
auto numWindows = windows.size();
for (int i = numWindows; --i >= 0;)
{
if (auto* pmw = windows[i])
{
pmw->setLookAndFeel (nullptr);
pmw->dismissMenu (nullptr);
}
}
return numWindows > 0;
}
@ -1853,7 +1862,9 @@ bool PopupMenu::MenuItemIterator::next()
menus.add (currentItem->subMenu.get());
}
else
{
index.setUnchecked (index.size() - 1, index.getLast() + 1);
}
while (index.size() > 0 && index.getLast() >= menus.getLast()->items.size())
{

View File

@ -624,7 +624,7 @@ public:
CustomComponent (bool isTriggeredAutomatically = true);
/** Destructor. */
~CustomComponent();
~CustomComponent() override;
/** Returns a rectangle with the size that this component would like to have.
@ -666,7 +666,7 @@ public:
{
public:
CustomCallback();
~CustomCallback();
~CustomCallback() override;
/** Callback to indicate this item has been triggered.
@returns true if the itemID should be sent to the exitModalState method, or
@ -684,7 +684,7 @@ public:
*/
struct JUCE_API LookAndFeelMethods
{
virtual ~LookAndFeelMethods() {}
virtual ~LookAndFeelMethods() = default;
/** Fills the background of a popup menu component. */
virtual void drawPopupMenuBackground (Graphics&, int width, int height) = 0;