1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Removed some legacy friend class declarations that are no longer needed with modern compilers

This commit is contained in:
jules 2018-06-13 16:58:36 +01:00
parent 6d55fe78fe
commit 974b4a8351
56 changed files with 64 additions and 179 deletions

View file

@ -103,9 +103,6 @@ private:
#if ! JUCER_ENABLE_GPL_MODE
//==============================================================================
struct ModalCompletionCallback;
friend struct ModalCompletionCallback;
friend struct ContainerDeletePolicy<LicenseThread>;
friend struct LicenseThread;
//==============================================================================

View file

@ -504,8 +504,6 @@ private:
//==============================================================================
class CallbackHandler;
friend class CallbackHandler;
friend struct ContainerDeletePolicy<CallbackHandler>;
std::unique_ptr<CallbackHandler> callbackHandler;
void audioDeviceIOCallbackInt (const float** inputChannelData, int totalNumInputChannels,

View file

@ -38,6 +38,37 @@ namespace
class AlsaClient : public ReferenceCountedObject
{
public:
AlsaClient()
{
jassert (instance == nullptr);
snd_seq_open (&handle, "default", SND_SEQ_OPEN_DUPLEX, 0);
if (handle != nullptr)
{
snd_seq_nonblock (handle, SND_SEQ_NONBLOCK);
snd_seq_set_client_name (handle, JUCE_ALSA_MIDI_NAME);
clientId = snd_seq_client_id (handle);
// It's good idea to pre-allocate a good number of elements
ports.ensureStorageAllocated (32);
}
}
~AlsaClient()
{
jassert (instance != nullptr);
instance = nullptr;
if (handle != nullptr)
snd_seq_close (handle);
jassert (activeCallbacks.get() == 0);
if (inputThread)
inputThread->stopThread (3000);
}
using Ptr = ReferenceCountedObjectPtr<AlsaClient>;
//==============================================================================
@ -251,42 +282,6 @@ private:
static AlsaClient* instance;
//==============================================================================
friend class ReferenceCountedObjectPtr<AlsaClient>;
friend struct ContainerDeletePolicy<AlsaClient>;
AlsaClient()
{
jassert (instance == nullptr);
snd_seq_open (&handle, "default", SND_SEQ_OPEN_DUPLEX, 0);
if (handle != nullptr)
{
snd_seq_nonblock (handle, SND_SEQ_NONBLOCK);
snd_seq_set_client_name (handle, JUCE_ALSA_MIDI_NAME);
clientId = snd_seq_client_id (handle);
// It's good idea to pre-allocate a good number of elements
ports.ensureStorageAllocated (32);
}
}
~AlsaClient()
{
jassert (instance != nullptr);
instance = nullptr;
if (handle != nullptr)
snd_seq_close (handle);
jassert (activeCallbacks.get() == 0);
if (inputThread)
inputThread->stopThread (3000);
}
//==============================================================================
class MidiInputThread : public Thread
{

View file

@ -240,7 +240,6 @@ public:
private:
class Buffer;
friend struct ContainerDeletePolicy<Buffer>;
std::unique_ptr<Buffer> buffer;
};

View file

@ -113,8 +113,6 @@ private:
std::unique_ptr<TableListBoxModel> tableModel;
class Scanner;
friend class Scanner;
friend struct ContainerDeletePolicy<Scanner>;
std::unique_ptr<Scanner> currentScanner;
void scanFinished (const StringArray&);

View file

@ -197,7 +197,6 @@ public:
private:
struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SliderAttachment)
};
@ -226,7 +225,6 @@ public:
private:
struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComboBoxAttachment)
};
@ -250,7 +248,6 @@ public:
private:
struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ButtonAttachment)
};

View file

@ -162,7 +162,6 @@ private:
AudioCDBurner (const int deviceIndex);
class Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioCDBurner)

View file

@ -105,7 +105,6 @@ private:
const bool hideAdvancedOptionsWithButton;
class MidiInputSelectorComponentListBox;
friend struct ContainerDeletePolicy<MidiInputSelectorComponentListBox>;
std::unique_ptr<MidiInputSelectorComponentListBox> midiInputsList;
std::unique_ptr<ComboBox> midiOutputSelector;
std::unique_ptr<Label> midiInputsLabel, midiOutputLabel;

View file

@ -201,13 +201,6 @@ private:
class ThumbData;
class CachedWindow;
friend class LevelDataSource;
friend class ThumbData;
friend class CachedWindow;
friend struct ContainerDeletePolicy<LevelDataSource>;
friend struct ContainerDeletePolicy<ThumbData>;
friend struct ContainerDeletePolicy<CachedWindow>;
std::unique_ptr<LevelDataSource> source;
std::unique_ptr<CachedWindow> window;
OwnedArray<ThumbData> channels;

View file

@ -106,7 +106,6 @@ private:
TimeSliceThread thread;
class ThumbnailCacheEntry;
friend struct ContainerDeletePolicy<ThumbnailCacheEntry>;
OwnedArray<ThumbnailCacheEntry> thumbs;
CriticalSection lock;
int maxNumThumbsToStore;

View file

@ -121,8 +121,6 @@ public:
private:
struct ChannelInfo;
friend struct ChannelInfo;
friend struct ContainerDeletePolicy<ChannelInfo>;
OwnedArray<ChannelInfo> channels;
int numSamples, inputSamplesPerBlock;

View file

@ -286,18 +286,18 @@ public:
private:
//==============================================================================
class VariantType; friend class VariantType;
class VariantType_Void; friend class VariantType_Void;
class VariantType_Undefined; friend class VariantType_Undefined;
class VariantType_Int; friend class VariantType_Int;
class VariantType_Int64; friend class VariantType_Int64;
class VariantType_Double; friend class VariantType_Double;
class VariantType_Bool; friend class VariantType_Bool;
class VariantType_String; friend class VariantType_String;
class VariantType_Object; friend class VariantType_Object;
class VariantType_Array; friend class VariantType_Array;
class VariantType_Binary; friend class VariantType_Binary;
class VariantType_Method; friend class VariantType_Method;
class VariantType;
class VariantType_Void;
class VariantType_Undefined;
class VariantType_Int;
class VariantType_Int64;
class VariantType_Double;
class VariantType_Bool;
class VariantType_String;
class VariantType_Object;
class VariantType_Array;
class VariantType_Binary;
class VariantType_Method;
union ValueUnion
{

View file

@ -118,9 +118,8 @@ public:
private:
//==============================================================================
class NativeIterator
struct NativeIterator
{
public:
NativeIterator (const File& directory, const String& wildCard);
~NativeIterator();
@ -129,16 +128,11 @@ private:
Time* modTime, Time* creationTime, bool* isReadOnly);
class Pimpl;
private:
friend class DirectoryIterator;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NativeIterator)
};
friend struct ContainerDeletePolicy<NativeIterator::Pimpl>;
StringArray wildCards;
NativeIterator fileFinder;
String wildCard, path;

View file

@ -243,10 +243,6 @@ private:
//==============================================================================
class Term;
struct Helpers;
friend class Term;
friend struct Helpers;
friend struct ContainerDeletePolicy<Term>;
friend class ReferenceCountedObjectPtr<Term>;
ReferenceCountedObjectPtr<Term> term;
explicit Expression (Term*);

View file

@ -537,7 +537,6 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Upload)
};
friend struct ContainerDeletePolicy<Upload>;
ReferenceCountedArray<Upload> filesToUpload;
#if JUCE_IOS

View file

@ -191,7 +191,6 @@ private:
StringArray countryCodes;
StringPairArray translations;
std::unique_ptr<LocalisedStrings> fallback;
friend struct ContainerDeletePolicy<LocalisedStrings>;
void loadFromText (const String&, bool ignoreCase);

View file

@ -104,7 +104,6 @@ public:
private:
//==============================================================================
class ActiveProcess;
friend struct ContainerDeletePolicy<ActiveProcess>;
std::unique_ptr<ActiveProcess> activeProcess;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcess)

View file

@ -94,8 +94,6 @@ public:
private:
struct Pimpl;
friend struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HighResolutionTimer)

View file

@ -110,7 +110,6 @@ public:
private:
//==============================================================================
class Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
CriticalSection lock;

View file

@ -322,8 +322,6 @@ private:
struct ThreadPoolThread;
friend class ThreadPoolJob;
friend struct ThreadPoolThread;
friend struct ContainerDeletePolicy<ThreadPoolThread>;
OwnedArray<ThreadPoolThread> threads;
CriticalSection lock;

View file

@ -100,7 +100,6 @@ private:
OptionalScopedPointer<OutputStream> destStream;
class GZIPCompressorHelper;
friend struct ContainerDeletePolicy<GZIPCompressorHelper>;
std::unique_ptr<GZIPCompressorHelper> helper;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GZIPCompressorOutputStream)

View file

@ -90,7 +90,6 @@ private:
HeapBlock<uint8> buffer;
class GZIPDecompressHelper;
friend struct ContainerDeletePolicy<GZIPDecompressHelper>;
std::unique_ptr<GZIPDecompressHelper> helper;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE

View file

@ -224,7 +224,6 @@ public:
//==============================================================================
private:
struct Item;
friend struct ContainerDeletePolicy<Item>;
OwnedArray<Item> items;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Builder)

View file

@ -246,7 +246,6 @@ public:
private:
//==============================================================================
struct ActionSet;
friend struct ContainerDeletePolicy<ActionSet>;
OwnedArray<ActionSet> transactions, stashedFutureTransactions;
String newTransactionName;
int totalUnitsStored = 0, maxNumUnitsToKeep = 0, minimumTransactionsToKeep = 0, nextIndex = 0;

View file

@ -104,8 +104,6 @@ public:
private:
struct Connection;
friend struct Connection;
friend struct ContainerDeletePolicy<Connection>;
std::unique_ptr<Connection> connection;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcessSlave)
@ -194,8 +192,6 @@ private:
std::unique_ptr<ChildProcess> childProcess;
struct Connection;
friend struct Connection;
friend struct ContainerDeletePolicy<Connection>;
std::unique_ptr<Connection> connection;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcessMaster)

View file

@ -197,9 +197,8 @@ private:
int readData (void*, int);
struct ConnectionThread;
friend struct ConnectionThread;
friend struct ContainerDeletePolicy<ConnectionThread>;
std::unique_ptr<ConnectionThread> thread;
void runThread();
int writeData (void*, int);

View file

@ -290,8 +290,6 @@ private:
bool stillInitialising = true;
struct MultipleInstanceHandler;
friend struct MultipleInstanceHandler;
friend struct ContainerDeletePolicy<MultipleInstanceHandler>;
std::unique_ptr<MultipleInstanceHandler> multipleInstanceHandler;
JUCE_DECLARE_NON_COPYABLE (JUCEApplicationBase)

View file

@ -48,7 +48,6 @@ public:
private:
JUCE_PUBLIC_IN_DLL_BUILD (struct Pimpl)
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MountedVolumeListChangeDetector)

View file

@ -155,9 +155,8 @@ protected:
private:
//==============================================================================
class GlyphInfo;
friend struct ContainerDeletePolicy<GlyphInfo>;
OwnedArray<GlyphInfo> glyphs;
short lookupTable [128];
short lookupTable[128];
GlyphInfo* findGlyph (const juce_wchar character, bool loadIfNeeded) noexcept;

View file

@ -153,7 +153,6 @@ protected:
private:
struct HintingParams;
friend struct ContainerDeletePolicy<HintingParams>;
std::unique_ptr<HintingParams> hintingParams;
CriticalSection hintingLock;

View file

@ -208,7 +208,6 @@ public:
}
private:
friend struct ContainerDeletePolicy<CachedGlyphType>;
ReferenceCountedArray<CachedGlyphType> glyphs;
Atomic<int> accessCounter, hits, misses;
CriticalSection lock;

View file

@ -96,8 +96,6 @@ private:
Rectangle<int> bounds;
struct Pimpl;
friend struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Direct2DLowLevelGraphicsContext)

View file

@ -482,8 +482,6 @@ private:
ListenerList<Listener> buttonListeners;
struct CallbackHelper;
friend struct CallbackHelper;
friend struct ContainerDeletePolicy<CallbackHelper>;
std::unique_ptr<CallbackHelper> callbackHelper;
uint32 buttonPressTime = 0, lastRepeatTime = 0;
ApplicationCommandManager* commandManagerToUse = nullptr;

View file

@ -2280,8 +2280,6 @@ private:
std::unique_ptr<CachedComponentImage> cachedImage;
class MouseListenerList;
friend class MouseListenerList;
friend struct ContainerDeletePolicy<MouseListenerList>;
std::unique_ptr<MouseListenerList> mouseListeners;
std::unique_ptr<Array<KeyListener*>> keyListeners;
ListenerList<ComponentListener> componentListeners;

View file

@ -141,10 +141,9 @@ protected:
private:
//==============================================================================
struct ModalItem;
friend class Component;
friend struct ContainerDeletePolicy<ModalItem>;
struct ModalItem;
OwnedArray<ModalItem> stack;
void startModal (Component*, bool autoDelete);

View file

@ -125,11 +125,6 @@ private:
class PanelHolder;
struct PanelSizes;
friend class PanelHolder;
friend struct PanelSizes;
friend struct ContainerDeletePolicy<PanelSizes>;
friend struct ContainerDeletePolicy<PanelHolder>;
std::unique_ptr<PanelSizes> currentSizes;
OwnedArray<PanelHolder> holders;
ComponentAnimator animator;

View file

@ -420,7 +420,6 @@ private:
int initialDelayInMillisecs = 100, repeatDelayInMillisecs = 50, minimumDelayInMillisecs = 10;
bool vertical, isDraggingThumb = false, autohides = true, userVisibilityFlag = false;
class ScrollbarButton;
friend struct ContainerDeletePolicy<ScrollbarButton>;
std::unique_ptr<ScrollbarButton> upButton, downButton;
ListenerList<Listener> listeners;

View file

@ -359,8 +359,6 @@ private:
int currentTabIndex = -1;
class BehindFrontTabComp;
friend class BehindFrontTabComp;
friend struct ContainerDeletePolicy<BehindFrontTabComp>;
std::unique_ptr<BehindFrontTabComp> behindFrontTab;
std::unique_ptr<Button> extraTabsButton;

View file

@ -322,8 +322,6 @@ private:
bool vScrollbarRight = true, hScrollbarBottom = true;
struct DragToScrollListener;
friend struct DragToScrollListener;
friend struct ContainerDeletePolicy<DragToScrollListener>;
std::unique_ptr<DragToScrollListener> dragToScrollListener;
Point<int> viewportPosToCompPos (Point<int>) const;

View file

@ -230,8 +230,6 @@ protected:
private:
//==============================================================================
class DragImageComponent;
friend class DragImageComponent;
friend struct ContainerDeletePolicy<DragImageComponent>;
OwnedArray<DragImageComponent> dragImageComponents;
const MouseInputSource* getMouseInputSourceForDrag (Component* sourceComponent, const MouseInputSource* inputSourceCausingDrag);

View file

@ -977,8 +977,6 @@ public:
private:
//==============================================================================
JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl)
friend class Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
void init (SliderStyle, TextEntryBoxPosition);

View file

@ -900,15 +900,12 @@ public:
void itemDropped (const SourceDetails&) override;
private:
friend class TreeViewItem;
class ContentComponent;
class TreeViewport;
class InsertPointHighlight;
class TargetGroupHighlight;
friend class TreeViewItem;
friend class ContentComponent;
friend struct ContainerDeletePolicy<TreeViewport>;
friend struct ContainerDeletePolicy<InsertPointHighlight>;
friend struct ContainerDeletePolicy<TargetGroupHighlight>;
std::unique_ptr<TreeViewport> viewport;
CriticalSection nodeAlterationLock;

View file

@ -286,7 +286,6 @@ private:
MenuBarModel* menuBarModel = nullptr;
class ButtonListenerProxy;
friend struct ContainerDeletePolicy<ButtonListenerProxy>;
std::unique_ptr<ButtonListenerProxy> buttonListener;
void repaintTitleBar();

View file

@ -382,13 +382,9 @@ private:
ApplicationCommandManager* appCommandManager = nullptr;
class Pimpl;
friend class Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
class GutterComponent;
friend class GutterComponent;
friend struct ContainerDeletePolicy<GutterComponent>;
std::unique_ptr<GutterComponent> gutter;
enum DragType

View file

@ -118,7 +118,6 @@ public:
private:
class Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> control;
bool mouseEventsAllowed = true;

View file

@ -80,7 +80,6 @@ public:
private:
class Pimpl;
friend class Pimpl;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UIViewComponent)

View file

@ -107,7 +107,6 @@ private:
friend unsigned long juce_getCurrentFocusWindow (ComponentPeer*);
class Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
};

View file

@ -142,10 +142,6 @@ private:
class ColourComponentSlider;
class ColourSpaceMarker;
class HueSelectorMarker;
friend class ColourSpaceView;
friend struct ContainerDeletePolicy<ColourSpaceView>;
friend class HueSelectorComp;
friend struct ContainerDeletePolicy<HueSelectorComp>;
Colour colour;
float h, s, v;

View file

@ -125,9 +125,6 @@ private:
class MappingItem;
class CategoryItem;
class ItemComponent;
friend class TopLevelItem;
friend struct ContainerDeletePolicy<ChangeKeyButton>;
friend struct ContainerDeletePolicy<TopLevelItem>;
std::unique_ptr<TopLevelItem> treeItem;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (KeyMappingEditorComponent)

View file

@ -220,8 +220,6 @@ namespace LiveConstantEditor
OwnedArray<CodeDocument> documents;
Array<File> documentFiles;
class EditorWindow;
friend class EditorWindow;
friend struct ContainerDeletePolicy<EditorWindow>;
Component::SafePointer<EditorWindow> editorWindow;
CriticalSection lock;

View file

@ -73,9 +73,21 @@ public:
};
//==============================================================================
class SharedKeyWindow : public ReferenceCountedObject
struct SharedKeyWindow : public ReferenceCountedObject
{
public:
SharedKeyWindow (ComponentPeer* peerToUse)
: keyPeer (peerToUse),
keyProxy (juce_createKeyProxyWindow (keyPeer))
{}
~SharedKeyWindow()
{
juce_deleteKeyProxyWindow (keyPeer);
auto& keyWindows = getKeyWindows();
keyWindows.remove (keyPeer);
}
using Ptr = ReferenceCountedObjectPtr<SharedKeyWindow>;
//==============================================================================
@ -110,21 +122,6 @@ public:
private:
//==============================================================================
friend struct ContainerDeletePolicy<SharedKeyWindow>;
SharedKeyWindow (ComponentPeer* peerToUse)
: keyPeer (peerToUse),
keyProxy (juce_createKeyProxyWindow (keyPeer))
{}
~SharedKeyWindow()
{
juce_deleteKeyProxyWindow (keyPeer);
auto& keyWindows = getKeyWindows();
keyWindows.remove (keyPeer);
}
ComponentPeer* keyPeer;
Window keyProxy;

View file

@ -123,11 +123,9 @@ public:
private:
class Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
class SavedState;
friend struct ContainerDeletePolicy<SavedState>;
std::unique_ptr<SavedState> savedState;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLFrameBuffer)

View file

@ -216,8 +216,6 @@ public:
private:
//==============================================================================
struct Pimpl;
friend struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
friend struct OSCReceiverCallbackMessage;

View file

@ -141,8 +141,6 @@ public:
private:
//==============================================================================
struct Pimpl;
friend struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OSCSender)

View file

@ -220,8 +220,6 @@ private:
String name;
struct Pimpl;
friend struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
struct ViewerComponent;

View file

@ -172,8 +172,6 @@ public:
private:
//==============================================================================
struct Pimpl;
friend struct Pimpl;
friend struct ContainerDeletePolicy<Pimpl>;
std::unique_ptr<Pimpl> pimpl;
void resized() override;