Browse Source

Cleaned-up class inheritance visibilities and encapsulation for some internal classes.

tags/2021-05-28
jules 13 years ago
parent
commit
df729be74a
72 changed files with 365 additions and 367 deletions
  1. +1
    -1
      extras/Introjucer/Source/Application/jucer_Application.h
  2. +0
    -3
      extras/Introjucer/Source/Project/jucer_NewFileWizard.cpp
  3. +1
    -3
      extras/Introjucer/Source/Project/jucer_NewFileWizard.h
  4. +2
    -2
      extras/Introjucer/Source/Project/jucer_TreeViewTypes.cpp
  5. +1
    -1
      extras/JuceDemo/Source/demos/RenderingTestComponent.cpp
  6. +1
    -1
      extras/the jucer/src/properties/jucer_FontPropertyComponent.cpp
  7. +1
    -1
      modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp
  8. +2
    -2
      modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp
  9. +1
    -1
      modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h
  10. +2
    -5
      modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h
  11. +2
    -2
      modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp
  12. +5
    -5
      modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp
  13. +4
    -6
      modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h
  14. +3
    -3
      modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp
  15. +2
    -2
      modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp
  16. +6
    -1
      modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h
  17. +1
    -1
      modules/juce_data_structures/values/juce_Value.h
  18. +6
    -6
      modules/juce_data_structures/values/juce_ValueTree.cpp
  19. +1
    -1
      modules/juce_events/interprocess/juce_InterprocessConnection.h
  20. +97
    -98
      modules/juce_graphics/colour/juce_Colour.cpp
  21. +1
    -1
      modules/juce_graphics/fonts/juce_Font.cpp
  22. +2
    -2
      modules/juce_graphics/images/juce_ImageCache.cpp
  23. +1
    -1
      modules/juce_graphics/native/juce_linux_Fonts.cpp
  24. +1
    -1
      modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h
  25. +4
    -3
      modules/juce_gui_basics/components/juce_Desktop.cpp
  26. +2
    -2
      modules/juce_gui_basics/components/juce_ModalComponentManager.h
  27. +2
    -3
      modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h
  28. +8
    -15
      modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h
  29. +9
    -9
      modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp
  30. +6
    -11
      modules/juce_gui_basics/filebrowser/juce_FileListComponent.h
  31. +3
    -3
      modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp
  32. +3
    -3
      modules/juce_gui_basics/keyboard/juce_CaretComponent.h
  33. +3
    -3
      modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp
  34. +2
    -2
      modules/juce_gui_basics/layout/juce_MultiDocumentPanel.h
  35. +2
    -6
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp
  36. +3
    -0
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h
  37. +2
    -2
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp
  38. +2
    -0
      modules/juce_gui_basics/menus/juce_PopupMenu.h
  39. +1
    -1
      modules/juce_gui_basics/misc/juce_DropShadower.cpp
  40. +2
    -0
      modules/juce_gui_basics/misc/juce_DropShadower.h
  41. +2
    -2
      modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp
  42. +1
    -0
      modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h
  43. +1
    -1
      modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp
  44. +1
    -1
      modules/juce_gui_basics/native/juce_mac_Windowing.mm
  45. +1
    -1
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp
  46. +5
    -8
      modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp
  47. +17
    -17
      modules/juce_gui_basics/properties/juce_PropertyPanel.cpp
  48. +2
    -0
      modules/juce_gui_basics/properties/juce_PropertyPanel.h
  49. +4
    -4
      modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp
  50. +5
    -4
      modules/juce_gui_basics/properties/juce_TextPropertyComponent.h
  51. +10
    -10
      modules/juce_gui_basics/widgets/juce_ListBox.cpp
  52. +1
    -0
      modules/juce_gui_basics/widgets/juce_ListBox.h
  53. +1
    -1
      modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp
  54. +1
    -0
      modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h
  55. +12
    -12
      modules/juce_gui_basics/widgets/juce_TableListBox.cpp
  56. +3
    -0
      modules/juce_gui_basics/widgets/juce_TableListBox.h
  57. +1
    -1
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  58. +14
    -14
      modules/juce_gui_basics/widgets/juce_Toolbar.cpp
  59. +5
    -5
      modules/juce_gui_basics/widgets/juce_Toolbar.h
  60. +1
    -1
      modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.cpp
  61. +1
    -0
      modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.h
  62. +10
    -10
      modules/juce_gui_basics/widgets/juce_TreeView.cpp
  63. +6
    -5
      modules/juce_gui_basics/widgets/juce_TreeView.h
  64. +23
    -9
      modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp
  65. +15
    -24
      modules/juce_gui_extra/misc/juce_ColourSelector.cpp
  66. +3
    -0
      modules/juce_gui_extra/misc/juce_ColourSelector.h
  67. +2
    -2
      modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp
  68. +4
    -4
      modules/juce_gui_extra/misc/juce_SplashScreen.h
  69. +2
    -5
      modules/juce_gui_extra/misc/juce_WebBrowserComponent.h
  70. +4
    -4
      modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm
  71. +8
    -8
      modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp
  72. +1
    -1
      modules/juce_video/native/juce_win32_DirectShowComponent.cpp

+ 1
- 1
extras/Introjucer/Source/Application/jucer_Application.h View File

@@ -488,7 +488,7 @@ public:
ScopedPointer<Component> appearanceEditorWindow;
private:
class AsyncQuitRetrier : public Timer
class AsyncQuitRetrier : private Timer
{
public:
AsyncQuitRetrier() { startTimer (500); }


+ 0
- 3
extras/Introjucer/Source/Project/jucer_NewFileWizard.cpp View File

@@ -155,11 +155,8 @@ NewFileWizard::NewFileWizard()
NewFileWizard::~NewFileWizard()
{
clearSingletonInstance();
}
juce_ImplementSingleton_SingleThreaded (NewFileWizard)
void NewFileWizard::addWizardsToMenu (PopupMenu& m) const
{
for (int i = 0; i < wizards.size(); ++i)


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

@@ -31,15 +31,13 @@
//==============================================================================
class NewFileWizard : public DeletedAtShutdown
class NewFileWizard : private DeletedAtShutdown
{
public:
//==============================================================================
NewFileWizard();
~NewFileWizard();
juce_DeclareSingleton_SingleThreaded_Minimal (NewFileWizard);
//==============================================================================
class Type
{


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

@@ -135,7 +135,7 @@ void GroupTreeViewItem::addCreateFileMenuItems (PopupMenu& m)
m.addItem (1002, "Add Existing Files...");
m.addSeparator();
NewFileWizard::getInstance()->addWizardsToMenu (m);
NewFileWizard().addWizardsToMenu (m);
}
void GroupTreeViewItem::processCreateFileMenuItem (int menuID)
@@ -146,7 +146,7 @@ void GroupTreeViewItem::processCreateFileMenuItem (int menuID)
case 1002: browseToAddExistingFiles(); break;
default:
NewFileWizard::getInstance()->runWizardFromMenu (menuID, item);
NewFileWizard().runWizardFromMenu (menuID, item);
break;
}
}


+ 1
- 1
extras/JuceDemo/Source/demos/RenderingTestComponent.cpp View File

@@ -27,7 +27,7 @@
//[MiscUserDefs] You can add your own user definitions and misc code here...
class RenderingTestCanvas : public Component,
public Timer
private Timer
{
public:
RenderingTestCanvas (RenderingTestComponent& owner_)


+ 1
- 1
extras/the jucer/src/properties/jucer_FontPropertyComponent.cpp View File

@@ -28,7 +28,7 @@
//==============================================================================
class FontList : public DeletedAtShutdown
class FontList : private DeletedAtShutdown
{
public:
FontList()


+ 1
- 1
modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp View File

@@ -30,7 +30,7 @@
#endif
//==============================================================================
class CoreAudioInternal : public Timer
class CoreAudioInternal : private Timer
{
public:
//==============================================================================


+ 2
- 2
modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp View File

@@ -166,8 +166,8 @@ bool AudioFormatWriter::writeFromAudioSampleBuffer (const AudioSampleBuffer& sou
}
//==============================================================================
class AudioFormatWriter::ThreadedWriter::Buffer : public TimeSliceClient,
public AbstractFifo
class AudioFormatWriter::ThreadedWriter::Buffer : public AbstractFifo,
private TimeSliceClient
{
public:
Buffer (TimeSliceThread& timeSliceThread_, AudioFormatWriter* writer_, int numChannels, int bufferSize_)


+ 1
- 1
modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h View File

@@ -30,7 +30,7 @@
//==============================================================================
// Helper class to workaround carbon windows not getting mouse-moves..
class FakeMouseMoveGenerator : public Timer
class FakeMouseMoveGenerator : private Timer
{
public:
FakeMouseMoveGenerator()


+ 2
- 5
modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h View File

@@ -46,7 +46,7 @@
AudioProcessorPlayer object.
*/
class JUCE_API AudioProcessorGraph : public AudioProcessor,
public AsyncUpdater
private AsyncUpdater
{
public:
//==============================================================================
@@ -395,9 +395,6 @@ public:
void getStateInformation (juce::MemoryBlock& destData);
void setStateInformation (const void* data, int sizeInBytes);
/** @internal */
void handleAsyncUpdate();
private:
//==============================================================================
ReferenceCountedArray <Node> nodes;
@@ -415,9 +412,9 @@ private:
MidiBuffer* currentMidiInputBuffer;
MidiBuffer currentMidiOutputBuffer;
void handleAsyncUpdate();
void clearRenderingSequence();
void buildRenderingSequence();
bool isAnInputTo (uint32 possibleInputId, uint32 possibleDestinationId, int recursionCheck) const;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessorGraph);


+ 2
- 2
modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp View File

@@ -24,8 +24,8 @@
*/
class ProcessorParameterPropertyComp : public PropertyComponent,
public AudioProcessorListener,
public Timer
private AudioProcessorListener,
private Timer
{
public:
ProcessorParameterPropertyComp (const String& name, AudioProcessor& owner_, const int index_)


+ 5
- 5
modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp View File

@@ -67,7 +67,7 @@ private:
//==============================================================================
class AudioDeviceSelectorComponent::MidiInputSelectorComponentListBox : public ListBox,
public ListBoxModel
private ListBoxModel
{
public:
//==============================================================================
@@ -196,9 +196,9 @@ struct AudioDeviceSetupDetails
//==============================================================================
class AudioDeviceSettingsPanel : public Component,
public ChangeListener,
public ComboBoxListener, // (can't use ComboBox::Listener due to idiotic VC2005 bug)
public ButtonListener
private ChangeListener,
private ComboBoxListener, // (can't use ComboBox::Listener due to idiotic VC2005 bug)
private ButtonListener
{
public:
AudioDeviceSettingsPanel (AudioIODeviceType* type_,
@@ -661,7 +661,7 @@ private:
public:
//==============================================================================
class ChannelSelectorListBox : public ListBox,
public ListBoxModel
private ListBoxModel
{
public:
enum BoxType


+ 4
- 6
modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h View File

@@ -37,8 +37,8 @@
@see AudioDeviceManager
*/
class JUCE_API AudioDeviceSelectorComponent : public Component,
public ComboBoxListener, // (can't use ComboBox::Listener due to idiotic VC2005 bug)
public ChangeListener
private ComboBoxListener, // (can't use ComboBox::Listener due to idiotic VC2005 bug)
private ChangeListener
{
public:
//==============================================================================
@@ -78,10 +78,6 @@ public:
/** @internal */
void resized();
/** @internal */
void comboBoxChanged (ComboBox*);
/** @internal */
void changeListenerCallback (ChangeBroadcaster*);
/** @internal */
void childBoundsChanged (Component*);
private:
@@ -101,6 +97,8 @@ private:
ScopedPointer<ComboBox> midiOutputSelector;
ScopedPointer<Label> midiInputsLabel, midiOutputLabel;
void comboBoxChanged (ComboBox*);
void changeListenerCallback (ChangeBroadcaster*);
void updateAllControls();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDeviceSelectorComponent);


+ 3
- 3
modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp View File

@@ -90,7 +90,7 @@ public:
~LevelDataSource()
{
owner.cache.removeTimeSliceClient (this);
owner.cache.getTimeSliceThread().removeTimeSliceClient (this);
}
enum { timeBeforeDeletingReader = 3000 };
@@ -112,7 +112,7 @@ public:
if (lengthInSamples <= 0 || isFullyLoaded())
reader = nullptr;
else
owner.cache.addTimeSliceClient (this);
owner.cache.getTimeSliceThread().addTimeSliceClient (this);
}
}
@@ -127,7 +127,7 @@ public:
if (reader != nullptr)
{
lastReaderUseTime = Time::getMillisecondCounter();
owner.cache.addTimeSliceClient (this);
owner.cache.getTimeSliceThread().addTimeSliceClient (this);
}
}


+ 2
- 2
modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp View File

@@ -57,11 +57,11 @@ private:
//==============================================================================
AudioThumbnailCache::AudioThumbnailCache (const int maxNumThumbsToStore_)
: TimeSliceThread ("thumb cache"),
: thread ("thumb cache"),
maxNumThumbsToStore (maxNumThumbsToStore_)
{
jassert (maxNumThumbsToStore > 0);
startThread (2);
thread.startThread (2);
}
AudioThumbnailCache::~AudioThumbnailCache()


+ 6
- 1
modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h View File

@@ -39,7 +39,7 @@
@see AudioThumbnail
*/
class JUCE_API AudioThumbnailCache : public TimeSliceThread
class JUCE_API AudioThumbnailCache
{
public:
//==============================================================================
@@ -85,8 +85,13 @@ public:
*/
void writeToStream (OutputStream& stream);
/** Returns the thread that client thumbnails can use. */
TimeSliceThread& getTimeSliceThread() noexcept { return thread; }
private:
//==============================================================================
TimeSliceThread thread;
class ThumbnailCacheEntry;
friend class OwnedArray<ThumbnailCacheEntry>;
OwnedArray<ThumbnailCacheEntry> thumbs;


+ 1
- 1
modules/juce_data_structures/values/juce_Value.h View File

@@ -170,7 +170,7 @@ public:
ValueSource classes to allow Value objects to represent your own custom data items.
*/
class JUCE_API ValueSource : public SingleThreadedReferenceCountedObject,
public AsyncUpdater
private AsyncUpdater
{
public:
ValueSource();


+ 6
- 6
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -785,7 +785,7 @@ Identifier ValueTree::getPropertyName (const int index) const
//==============================================================================
class ValueTreePropertyValueSource : public Value::ValueSource,
public ValueTree::Listener
private ValueTree::Listener
{
public:
ValueTreePropertyValueSource (const ValueTree& tree_, const Identifier& property_,
@@ -803,6 +803,11 @@ public:
var getValue() const { return tree [property]; }
void setValue (const var& newValue) { tree.setProperty (property, newValue, undoManager); }
private:
ValueTree tree;
const Identifier property;
UndoManager* const undoManager;
void valueTreePropertyChanged (ValueTree& treeWhosePropertyHasChanged,
const Identifier& changedProperty)
{
@@ -815,11 +820,6 @@ public:
void valueTreeChildOrderChanged (ValueTree&) {}
void valueTreeParentChanged (ValueTree&) {}
private:
ValueTree tree;
const Identifier property;
UndoManager* const undoManager;
JUCE_DECLARE_NON_COPYABLE (ValueTreePropertyValueSource);
};


+ 1
- 1
modules/juce_events/interprocess/juce_InterprocessConnection.h View File

@@ -48,7 +48,7 @@ class MemoryBlock;
@see InterprocessConnectionServer, Socket, NamedPipe
*/
class JUCE_API InterprocessConnection : public Thread
class JUCE_API InterprocessConnection : private Thread
{
public:
//==============================================================================


+ 97
- 98
modules/juce_graphics/colour/juce_Colour.cpp View File

@@ -42,112 +42,111 @@ namespace ColourHelpers
+ g * g * 0.691f
+ b * b * 0.068f);
}
}
//==============================================================================
struct HSB
{
HSB (const Colour& col) noexcept
//==============================================================================
struct HSB
{
const int r = col.getRed();
const int g = col.getGreen();
const int b = col.getBlue();
const int hi = jmax (r, g, b);
const int lo = jmin (r, g, b);
if (hi != 0)
HSB (const Colour& col) noexcept
{
saturation = (hi - lo) / (float) hi;
const int r = col.getRed();
const int g = col.getGreen();
const int b = col.getBlue();
if (saturation > 0)
const int hi = jmax (r, g, b);
const int lo = jmin (r, g, b);
if (hi != 0)
{
const float invDiff = 1.0f / (hi - lo);
saturation = (hi - lo) / (float) hi;
const float red = (hi - r) * invDiff;
const float green = (hi - g) * invDiff;
const float blue = (hi - b) * invDiff;
if (saturation > 0)
{
const float invDiff = 1.0f / (hi - lo);
if (r == hi)
hue = blue - green;
else if (g == hi)
hue = 2.0f + red - blue;
else
hue = 4.0f + green - red;
const float red = (hi - r) * invDiff;
const float green = (hi - g) * invDiff;
const float blue = (hi - b) * invDiff;
hue *= 1.0f / 6.0f;
if (r == hi)
hue = blue - green;
else if (g == hi)
hue = 2.0f + red - blue;
else
hue = 4.0f + green - red;
if (hue < 0)
++hue;
hue *= 1.0f / 6.0f;
if (hue < 0)
++hue;
}
else
{
hue = 0;
}
}
else
{
hue = 0;
saturation = hue = 0;
}
brightness = hi / 255.0f;
}
else
Colour toColour (const Colour& original) const noexcept
{
saturation = hue = 0;
return Colour (hue, saturation, brightness, original.getAlpha());
}
brightness = hi / 255.0f;
}
Colour toColour (const Colour& original) const noexcept
{
return Colour (hue, saturation, brightness, original.getAlpha());
}
static PixelARGB toRGB (float h, float s, float v, const uint8 alpha) noexcept
{
v = jlimit (0.0f, 255.0f, v * 255.0f);
const uint8 intV = (uint8) roundToInt (v);
if (s <= 0)
return PixelARGB (alpha, intV, intV, intV);
s = jmin (1.0f, s);
h = (h - std::floor (h)) * 6.0f + 0.00001f; // need a small adjustment to compensate for rounding errors
const float f = h - std::floor (h);
const uint8 x = (uint8) roundToInt (v * (1.0f - s));
if (h < 1.0f) return PixelARGB (alpha, intV, (uint8) roundToInt (v * (1.0f - (s * (1.0f - f)))), x);
if (h < 2.0f) return PixelARGB (alpha, (uint8) roundToInt (v * (1.0f - s * f)), intV, x);
if (h < 3.0f) return PixelARGB (alpha, x, intV, (uint8) roundToInt (v * (1.0f - (s * (1.0f - f)))));
if (h < 4.0f) return PixelARGB (alpha, x, (uint8) roundToInt (v * (1.0f - s * f)), intV);
if (h < 5.0f) return PixelARGB (alpha, (uint8) roundToInt (v * (1.0f - (s * (1.0f - f)))), x, intV);
else return PixelARGB (alpha, intV, x, (uint8) roundToInt (v * (1.0f - s * f)));
}
float hue, saturation, brightness;
};
//==============================================================================
struct YIQ
{
YIQ (const Colour& c) noexcept
{
const float r = c.getFloatRed();
const float g = c.getFloatGreen();
const float b = c.getFloatBlue();
static PixelARGB toRGB (float h, float s, float v, const uint8 alpha) noexcept
{
v = jlimit (0.0f, 255.0f, v * 255.0f);
const uint8 intV = (uint8) roundToInt (v);
if (s <= 0)
return PixelARGB (alpha, intV, intV, intV);
s = jmin (1.0f, s);
h = (h - std::floor (h)) * 6.0f + 0.00001f; // need a small adjustment to compensate for rounding errors
const float f = h - std::floor (h);
const uint8 x = (uint8) roundToInt (v * (1.0f - s));
if (h < 1.0f) return PixelARGB (alpha, intV, (uint8) roundToInt (v * (1.0f - (s * (1.0f - f)))), x);
if (h < 2.0f) return PixelARGB (alpha, (uint8) roundToInt (v * (1.0f - s * f)), intV, x);
if (h < 3.0f) return PixelARGB (alpha, x, intV, (uint8) roundToInt (v * (1.0f - (s * (1.0f - f)))));
if (h < 4.0f) return PixelARGB (alpha, x, (uint8) roundToInt (v * (1.0f - s * f)), intV);
if (h < 5.0f) return PixelARGB (alpha, (uint8) roundToInt (v * (1.0f - (s * (1.0f - f)))), x, intV);
else return PixelARGB (alpha, intV, x, (uint8) roundToInt (v * (1.0f - s * f)));
}
y = 0.299900f * r + 0.587000f * g + 0.114000f * b;
i = 0.595716f * r - 0.274453f * g - 0.321264f * b;
q = 0.211456f * r - 0.522591f * g - 0.311350f * b;
alpha = c.getFloatAlpha();
}
float hue, saturation, brightness;
};
Colour toColour() const noexcept
//==============================================================================
struct YIQ
{
return Colour::fromFloatRGBA (y + 0.9563f * i + 0.6210f * q,
y - 0.2721f * i - 0.6474f * q,
y - 1.1070f * i + 1.7046f * q,
alpha);
}
YIQ (const Colour& c) noexcept
{
const float r = c.getFloatRed();
const float g = c.getFloatGreen();
const float b = c.getFloatBlue();
y = 0.2999f * r + 0.5870f * g + 0.1140f * b;
i = 0.5957f * r - 0.2744f * g - 0.3212f * b;
q = 0.2114f * r - 0.5225f * g - 0.3113f * b;
alpha = c.getFloatAlpha();
}
float y, i, q, alpha;
};
Colour toColour() const noexcept
{
return Colour::fromFloatRGBA (y + 0.9563f * i + 0.6210f * q,
y - 0.2721f * i - 0.6474f * q,
y - 1.1070f * i + 1.7046f * q,
alpha);
}
float y, i, q, alpha;
};
}
//==============================================================================
Colour::Colour() noexcept
@@ -206,7 +205,7 @@ Colour Colour::fromFloatRGBA (const float red, const float green, const float bl
}
Colour::Colour (const float hue, const float saturation, const float brightness, const float alpha) noexcept
: argb (HSB::toRGB (hue, saturation, brightness, ColourHelpers::floatToUInt8 (alpha)))
: argb (ColourHelpers::HSB::toRGB (hue, saturation, brightness, ColourHelpers::floatToUInt8 (alpha)))
{
}
@@ -216,7 +215,7 @@ Colour Colour::fromHSV (const float hue, const float saturation, const float bri
}
Colour::Colour (const float hue, const float saturation, const float brightness, const uint8 alpha) noexcept
: argb (HSB::toRGB (hue, saturation, brightness, alpha))
: argb (ColourHelpers::HSB::toRGB (hue, saturation, brightness, alpha))
{
}
@@ -320,38 +319,38 @@ float Colour::getFloatAlpha() const noexcept { return getAlpha() / 255.0f; }
//==============================================================================
void Colour::getHSB (float& h, float& s, float& v) const noexcept
{
const HSB hsb (*this);
const ColourHelpers::HSB hsb (*this);
h = hsb.hue;
s = hsb.saturation;
v = hsb.brightness;
}
float Colour::getHue() const noexcept { return HSB (*this).hue; }
float Colour::getSaturation() const noexcept { return HSB (*this).saturation; }
float Colour::getBrightness() const noexcept { return HSB (*this).brightness; }
float Colour::getHue() const noexcept { return ColourHelpers::HSB (*this).hue; }
float Colour::getSaturation() const noexcept { return ColourHelpers::HSB (*this).saturation; }
float Colour::getBrightness() const noexcept { return ColourHelpers::HSB (*this).brightness; }
Colour Colour::withHue (float h) const noexcept { HSB hsb (*this); hsb.hue = h; return hsb.toColour (*this); }
Colour Colour::withSaturation (float s) const noexcept { HSB hsb (*this); hsb.saturation = s; return hsb.toColour (*this); }
Colour Colour::withBrightness (float v) const noexcept { HSB hsb (*this); hsb.brightness = v; return hsb.toColour (*this); }
Colour Colour::withHue (float h) const noexcept { ColourHelpers::HSB hsb (*this); hsb.hue = h; return hsb.toColour (*this); }
Colour Colour::withSaturation (float s) const noexcept { ColourHelpers::HSB hsb (*this); hsb.saturation = s; return hsb.toColour (*this); }
Colour Colour::withBrightness (float v) const noexcept { ColourHelpers::HSB hsb (*this); hsb.brightness = v; return hsb.toColour (*this); }
//==============================================================================
Colour Colour::withRotatedHue (const float amountToRotate) const noexcept
{
HSB hsb (*this);
ColourHelpers::HSB hsb (*this);
hsb.hue += amountToRotate;
return hsb.toColour (*this);
}
Colour Colour::withMultipliedSaturation (const float amount) const noexcept
{
HSB hsb (*this);
ColourHelpers::HSB hsb (*this);
hsb.saturation = jmin (1.0f, hsb.saturation * amount);
return hsb.toColour (*this);
}
Colour Colour::withMultipliedBrightness (const float amount) const noexcept
{
HSB hsb (*this);
ColourHelpers::HSB hsb (*this);
hsb.brightness = jmin (1.0f, hsb.brightness * amount);
return hsb.toColour (*this);
}
@@ -394,8 +393,8 @@ Colour Colour::contrasting (const float amount) const noexcept
Colour Colour::contrasting (const Colour& target, float minContrast) const noexcept
{
const YIQ bg (*this);
YIQ fg (target);
const ColourHelpers::YIQ bg (*this);
ColourHelpers::YIQ fg (target);
if (fabs (bg.y - fg.y) >= minContrast)
return target;


+ 1
- 1
modules/juce_graphics/fonts/juce_Font.cpp View File

@@ -39,7 +39,7 @@ typedef Typeface::Ptr (*GetTypefaceForFont) (const Font&);
GetTypefaceForFont juce_getTypefaceForFont = nullptr;
//==============================================================================
class TypefaceCache : public DeletedAtShutdown
class TypefaceCache : private DeletedAtShutdown
{
public:
TypefaceCache()


+ 2
- 2
modules/juce_graphics/images/juce_ImageCache.cpp View File

@@ -23,8 +23,8 @@
==============================================================================
*/
class ImageCache::Pimpl : public Timer,
public DeletedAtShutdown
class ImageCache::Pimpl : private Timer,
private DeletedAtShutdown
{
public:
Pimpl()


+ 1
- 1
modules/juce_graphics/native/juce_linux_Fonts.cpp View File

@@ -127,7 +127,7 @@ private:
};
//==============================================================================
class FTTypefaceList : public DeletedAtShutdown
class FTTypefaceList : private DeletedAtShutdown
{
public:
FTTypefaceList()


+ 1
- 1
modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h View File

@@ -87,7 +87,7 @@
*/
class JUCE_API KeyPressMappingSet : public KeyListener,
public ChangeBroadcaster,
public FocusChangeListener
private FocusChangeListener
{
public:
//==============================================================================


+ 4
- 3
modules/juce_gui_basics/components/juce_Desktop.cpp View File

@@ -208,10 +208,11 @@ public:
for (int i = desktop.getNumMouseSources(); --i >= 0;)
{
MouseInputSource* const source = desktop.getMouseSource(i);
if (source->isDragging())
MouseInputSource& source = *desktop.getMouseSource(i);
if (source.isDragging())
{
source->triggerFakeMove();
source.triggerFakeMove();
++numMiceDown;
}
}


+ 2
- 2
modules/juce_gui_basics/components/juce_ModalComponentManager.h View File

@@ -38,8 +38,8 @@
@see Component::enterModalState, Component::exitModalState, Component::isCurrentlyModal,
Component::getCurrentlyModalComponent, Component::isCurrentlyBlockedByAnotherModalComponent
*/
class JUCE_API ModalComponentManager : public AsyncUpdater,
public DeletedAtShutdown
class JUCE_API ModalComponentManager : private AsyncUpdater,
private DeletedAtShutdown
{
public:
//==============================================================================


+ 2
- 3
modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h View File

@@ -40,7 +40,7 @@
@see FileListComponent, FileBrowserComponent
*/
class JUCE_API DirectoryContentsList : public ChangeBroadcaster,
public TimeSliceClient
private TimeSliceClient
{
public:
//==============================================================================
@@ -184,8 +184,6 @@ public:
//==============================================================================
/** @internal */
int useTimeSlice();
/** @internal */
TimeSliceThread& getTimeSliceThread() { return thread; }
/** @internal */
static int compareElements (const DirectoryContentsList::FileInfo* first,
@@ -203,6 +201,7 @@ private:
ScopedPointer <DirectoryIterator> fileFindHandle;
bool volatile shouldStop;
int useTimeSlice();
void stopSearching();
void changed();
bool checkNextFile (bool& hasChanged);


+ 8
- 15
modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h View File

@@ -68,8 +68,8 @@
@see FileChooser
*/
class JUCE_API FileChooserDialogBox : public ResizableWindow,
public ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug)
public FileBrowserListener
private ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug)
private FileBrowserListener
{
public:
//==============================================================================
@@ -121,7 +121,7 @@ public:
/** Sets the size of this dialog box to its default and positions it either in the
centre of the screen, or centred around a component that is provided.
*/
void centreWithDefaultSize (Component* componentToCentreAround = 0);
void centreWithDefaultSize (Component* componentToCentreAround = nullptr);
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the box.
@@ -136,25 +136,18 @@ public:
titleTextColourId = 0x1000850, /**< The colour to use to draw the box's title. */
};
//==============================================================================
/** @internal */
private:
class ContentComponent;
ContentComponent* content;
const bool warnAboutOverwritingExistingFiles;
void buttonClicked (Button*);
/** @internal */
void closeButtonPressed();
/** @internal */
void selectionChanged();
/** @internal */
void fileClicked (const File&, const MouseEvent&);
/** @internal */
void fileDoubleClicked (const File&);
/** @internal */
void browserRootChanged (const File&);
private:
class ContentComponent;
ContentComponent* content;
const bool warnAboutOverwritingExistingFiles;
void okButtonPressed();
void createNewFolder();
void createNewFolderConfirmed (const String& name);


+ 9
- 9
modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp View File

@@ -87,17 +87,17 @@ void FileListComponent::changeListenerCallback (ChangeBroadcaster*)
}
//==============================================================================
class FileListItemComponent : public Component,
public TimeSliceClient,
public AsyncUpdater
class FileListComponent::ItemComponent : public Component,
private TimeSliceClient,
private AsyncUpdater
{
public:
FileListItemComponent (FileListComponent& owner_, TimeSliceThread& thread_)
ItemComponent (FileListComponent& owner_, TimeSliceThread& thread_)
: owner (owner_), thread (thread_), index (0), highlighted (false)
{
}
~FileListItemComponent()
~ItemComponent()
{
thread.removeTimeSliceClient (this);
}
@@ -213,7 +213,7 @@ private:
}
}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileListItemComponent);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ItemComponent);
};
//==============================================================================
@@ -228,12 +228,12 @@ void FileListComponent::paintListBoxItem (int, Graphics&, int, int, bool)
Component* FileListComponent::refreshComponentForRow (int row, bool isSelected, Component* existingComponentToUpdate)
{
jassert (existingComponentToUpdate == nullptr || dynamic_cast <FileListItemComponent*> (existingComponentToUpdate) != nullptr);
jassert (existingComponentToUpdate == nullptr || dynamic_cast <ItemComponent*> (existingComponentToUpdate) != nullptr);
FileListItemComponent* comp = static_cast <FileListItemComponent*> (existingComponentToUpdate);
ItemComponent* comp = static_cast <ItemComponent*> (existingComponentToUpdate);
if (comp == nullptr)
comp = new FileListItemComponent (*this, fileList.getTimeSliceThread());
comp = new ItemComponent (*this, fileList.getTimeSliceThread());
DirectoryContentsList::FileInfo fileInfo;
comp->update (fileList.getDirectory(),


+ 6
- 11
modules/juce_gui_basics/filebrowser/juce_FileListComponent.h View File

@@ -80,26 +80,21 @@ public:
(and if the file isn't in the list, all other items will be deselected). */
void setSelectedFile (const File&);
private:
//==============================================================================
/** @internal */
File lastDirectory;
class ItemComponent;
void changeListenerCallback (ChangeBroadcaster*);
/** @internal */
int getNumRows();
/** @internal */
void paintListBoxItem (int, Graphics&, int, int, bool);
/** @internal */
Component* refreshComponentForRow (int rowNumber, bool isRowSelected, Component* existingComponentToUpdate);
/** @internal */
void selectedRowsChanged (int lastRowSelected);
/** @internal */
void deleteKeyPressed (int currentSelectedRow);
/** @internal */
void returnKeyPressed (int currentSelectedRow);
private:
//==============================================================================
File lastDirectory;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileListComponent);
};


+ 3
- 3
modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp View File

@@ -27,9 +27,9 @@ Image juce_createIconForFile (const File& file);
//==============================================================================
class FileListTreeItem : public TreeViewItem,
public TimeSliceClient,
public AsyncUpdater,
public ChangeListener
private TimeSliceClient,
private AsyncUpdater,
private ChangeListener
{
public:
FileListTreeItem (FileTreeComponent& owner_,


+ 3
- 3
modules/juce_gui_basics/keyboard/juce_CaretComponent.h View File

@@ -33,7 +33,7 @@
/**
*/
class JUCE_API CaretComponent : public Component,
public Timer
private Timer
{
public:
//==============================================================================
@@ -69,12 +69,12 @@ public:
//==============================================================================
/** @internal */
void paint (Graphics& g);
/** @internal */
void timerCallback();
private:
Component* owner;
bool shouldBeShown() const;
void timerCallback();
JUCE_DECLARE_NON_COPYABLE (CaretComponent);
};


+ 3
- 3
modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp View File

@@ -79,10 +79,10 @@ MultiDocumentPanel* MultiDocumentPanelWindow::getOwner() const noexcept
//==============================================================================
class MDITabbedComponentInternal : public TabbedComponent
class MultiDocumentPanel::TabbedComponentInternal : public TabbedComponent
{
public:
MDITabbedComponentInternal()
TabbedComponentInternal()
: TabbedComponent (TabbedButtonBar::TabsAtTop)
{
}
@@ -203,7 +203,7 @@ bool MultiDocumentPanel::addDocument (Component* const component,
{
if (tabComponent == nullptr && components.size() > numDocsBeforeTabsUsed)
{
addAndMakeVisible (tabComponent = new MDITabbedComponentInternal());
addAndMakeVisible (tabComponent = new TabbedComponentInternal());
Array <Component*> temp (components);


+ 2
- 2
modules/juce_gui_basics/layout/juce_MultiDocumentPanel.h View File

@@ -29,7 +29,6 @@
#include "juce_TabbedComponent.h"
#include "../windows/juce_DocumentWindow.h"
class MultiDocumentPanel;
class MDITabbedComponentInternal;
//==============================================================================
@@ -293,8 +292,9 @@ private:
Colour backgroundColour;
int maximumNumDocuments, numDocsBeforeTabsUsed;
class TabbedComponentInternal;
friend class MultiDocumentPanelWindow;
friend class MDITabbedComponentInternal;
friend class TabbedComponentInternal;
Component* getContainerComp (Component* c) const;
void updateOrder();


+ 2
- 6
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp View File

@@ -1605,7 +1605,7 @@ Button* LookAndFeel::createSliderButton (const bool isIncrement)
return new TextButton (isIncrement ? "+" : "-", String::empty);
}
class SliderLabelComp : public Label
class LookAndFeel::SliderLabelComp : public Label
{
public:
SliderLabelComp() : Label (String::empty, String::empty) {}
@@ -1827,7 +1827,7 @@ void LookAndFeel::drawDocumentWindowTitleBar (DocumentWindow& window,
}
//==============================================================================
class GlassWindowButton : public Button
class LookAndFeel::GlassWindowButton : public Button
{
public:
//==============================================================================
@@ -1841,10 +1841,6 @@ public:
{
}
~GlassWindowButton()
{
}
//==============================================================================
void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)
{


+ 3
- 0
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h View File

@@ -639,6 +639,9 @@ private:
virtual int getTabButtonBestWidth (int, const String&, int, Button&) { return 0; }
#endif
class GlassWindowButton;
class SliderLabelComp;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel);
};


+ 2
- 2
modules/juce_gui_basics/menus/juce_PopupMenu.cpp View File

@@ -1244,7 +1244,7 @@ void PopupMenu::addCustomItem (const int itemResultId, CustomComponent* const cu
Colours::black, false, customComponent, nullptr, nullptr));
}
class NormalComponentWrapper : public PopupMenu::CustomComponent
class PopupMenu::NormalComponentWrapper : public PopupMenu::CustomComponent
{
public:
NormalComponentWrapper (Component* const comp, const int w, const int h,
@@ -1301,7 +1301,7 @@ void PopupMenu::addSeparator()
}
//==============================================================================
class HeaderItemComponent : public PopupMenu::CustomComponent
class PopupMenu::HeaderItemComponent : public PopupMenu::CustomComponent
{
public:
HeaderItemComponent (const String& name)


+ 2
- 0
modules/juce_gui_basics/menus/juce_PopupMenu.h View File

@@ -478,6 +478,8 @@ private:
//==============================================================================
class Item;
class ItemComponent;
class HeaderItemComponent;
class NormalComponentWrapper;
friend class MenuItemIterator;
friend class ItemComponent;


+ 1
- 1
modules/juce_gui_basics/misc/juce_DropShadower.cpp View File

@@ -23,7 +23,7 @@
==============================================================================
*/
class ShadowWindow : public Component
class DropShadower::ShadowWindow : public Component
{
public:
ShadowWindow (Component& owner, const int type_, const Image shadowImageSections [12])


+ 2
- 0
modules/juce_gui_basics/misc/juce_DropShadower.h View File

@@ -59,6 +59,8 @@ public:
private:
//==============================================================================
class ShadowWindow;
Component* owner;
OwnedArray<Component> shadowWindows;
Image shadowImageSections[12];


+ 2
- 2
modules/juce_gui_basics/mouse/juce_DragAndDropContainer.cpp View File

@@ -28,8 +28,8 @@ bool juce_performDragDropText (const String&, bool& shouldStop);
//==============================================================================
class DragImageComponent : public Component,
public Timer
class DragAndDropContainer::DragImageComponent : public Component,
private Timer
{
public:
DragImageComponent (const Image& im,


+ 1
- 0
modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h View File

@@ -170,6 +170,7 @@ protected:
private:
//==============================================================================
class DragImageComponent;
friend class DragImageComponent;
ScopedPointer <Component> dragImageComponent;
String currentDragDesc;


+ 1
- 1
modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp View File

@@ -23,7 +23,7 @@
==============================================================================
*/
class MouseInputSourceInternal : public AsyncUpdater
class MouseInputSourceInternal : private AsyncUpdater
{
public:
//==============================================================================


+ 1
- 1
modules/juce_gui_basics/native/juce_mac_Windowing.mm View File

@@ -269,7 +269,7 @@ bool Desktop::isScreenSaverEnabled()
}
//==============================================================================
class DisplaySettingsChangeCallback : public DeletedAtShutdown
class DisplaySettingsChangeCallback : private DeletedAtShutdown
{
public:
DisplaySettingsChangeCallback()


+ 1
- 1
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -1110,7 +1110,7 @@ private:
TemporaryImage offscreenImageGenerator;
//==============================================================================
class WindowClassHolder : public DeletedAtShutdown
class WindowClassHolder : private DeletedAtShutdown
{
public:
WindowClassHolder()


+ 5
- 8
modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp View File

@@ -24,7 +24,7 @@
*/
class ChoicePropertyComponent::RemapperValueSource : public Value::ValueSource,
public ValueListener
private ValueListener
{
public:
RemapperValueSource (const Value& sourceValue_, const Array<var>& mappings_)
@@ -34,8 +34,6 @@ public:
sourceValue.addListener (this);
}
~RemapperValueSource() {}
var getValue() const
{
return mappings.indexOf (sourceValue.getValue()) + 1;
@@ -49,16 +47,15 @@ public:
sourceValue = remappedVal;
}
protected:
Value sourceValue;
Array<var> mappings;
void valueChanged (Value&)
{
sendChangeMessage (true);
}
protected:
//==============================================================================
Value sourceValue;
Array<var> mappings;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RemapperValueSource);
};


+ 17
- 17
modules/juce_gui_basics/properties/juce_PropertyPanel.cpp View File

@@ -23,12 +23,12 @@
==============================================================================
*/
class PropertySectionComponent : public Component
class PropertyPanel::SectionComponent : public Component
{
public:
PropertySectionComponent (const String& sectionTitle,
const Array <PropertyComponent*>& newProperties,
const bool sectionIsOpen_)
SectionComponent (const String& sectionTitle,
const Array <PropertyComponent*>& newProperties,
const bool sectionIsOpen_)
: Component (sectionTitle),
titleHeight (sectionTitle.isNotEmpty() ? 22 : 0),
sectionIsOpen (sectionIsOpen_)
@@ -42,7 +42,7 @@ public:
}
}
~PropertySectionComponent()
~SectionComponent()
{
propertyComps.clear();
}
@@ -127,7 +127,7 @@ private:
int titleHeight;
bool sectionIsOpen;
JUCE_DECLARE_NON_COPYABLE (PropertySectionComponent);
JUCE_DECLARE_NON_COPYABLE (SectionComponent);
};
//==============================================================================
@@ -144,7 +144,7 @@ public:
for (int i = 0; i < sections.size(); ++i)
{
PropertySectionComponent* const section = sections.getUnchecked(i);
SectionComponent* const section = sections.getUnchecked(i);
section->setBounds (0, y, width, section->getPreferredHeight());
y = section->getBottom();
@@ -165,17 +165,17 @@ public:
sections.clear();
}
void addSection (PropertySectionComponent* newSection)
void addSection (SectionComponent* newSection)
{
sections.add (newSection);
addAndMakeVisible (newSection, 0);
}
int getNumSections() const noexcept { return sections.size(); }
PropertySectionComponent* getSection (const int index) const { return sections [index]; }
int getNumSections() const noexcept { return sections.size(); }
SectionComponent* getSection (const int index) const { return sections [index]; }
private:
OwnedArray<PropertySectionComponent> sections;
OwnedArray<SectionComponent> sections;
JUCE_DECLARE_NON_COPYABLE (PropertyHolderComponent);
};
@@ -229,7 +229,7 @@ void PropertyPanel::addProperties (const Array <PropertyComponent*>& newProperti
if (propertyHolderComponent->getNumSections() == 0)
repaint();
propertyHolderComponent->addSection (new PropertySectionComponent (String::empty, newProperties, true));
propertyHolderComponent->addSection (new SectionComponent (String::empty, newProperties, true));
updatePropHolderLayout();
}
@@ -242,7 +242,7 @@ void PropertyPanel::addSection (const String& sectionTitle,
if (propertyHolderComponent->getNumSections() == 0)
repaint();
propertyHolderComponent->addSection (new PropertySectionComponent (sectionTitle, newProperties, shouldBeOpen));
propertyHolderComponent->addSection (new SectionComponent (sectionTitle, newProperties, shouldBeOpen));
updatePropHolderLayout();
}
@@ -271,7 +271,7 @@ StringArray PropertyPanel::getSectionNames() const
for (int i = 0; i < propertyHolderComponent->getNumSections(); ++i)
{
PropertySectionComponent* const section = propertyHolderComponent->getSection (i);
SectionComponent* const section = propertyHolderComponent->getSection (i);
if (section->getName().isNotEmpty())
s.add (section->getName());
@@ -286,7 +286,7 @@ bool PropertyPanel::isSectionOpen (const int sectionIndex) const
for (int i = 0; i < propertyHolderComponent->getNumSections(); ++i)
{
PropertySectionComponent* const section = propertyHolderComponent->getSection (i);
SectionComponent* const section = propertyHolderComponent->getSection (i);
if (section->getName().isNotEmpty())
{
@@ -306,7 +306,7 @@ void PropertyPanel::setSectionOpen (const int sectionIndex, const bool shouldBeO
for (int i = 0; i < propertyHolderComponent->getNumSections(); ++i)
{
PropertySectionComponent* const section = propertyHolderComponent->getSection (i);
SectionComponent* const section = propertyHolderComponent->getSection (i);
if (section->getName().isNotEmpty())
{
@@ -327,7 +327,7 @@ void PropertyPanel::setSectionEnabled (const int sectionIndex, const bool should
for (int i = 0; i < propertyHolderComponent->getNumSections(); ++i)
{
PropertySectionComponent* const section = propertyHolderComponent->getSection (i);
SectionComponent* const section = propertyHolderComponent->getSection (i);
if (section->getName().isNotEmpty())
{


+ 2
- 0
modules/juce_gui_basics/properties/juce_PropertyPanel.h View File

@@ -149,6 +149,8 @@ public:
void resized();
private:
class SectionComponent;
Viewport viewport;
class PropertyHolderComponent;
PropertyHolderComponent* propertyHolderComponent;


+ 4
- 4
modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp View File

@@ -23,11 +23,11 @@
==============================================================================
*/
class TextPropLabel : public Label
class TextPropertyComponent::LabelComp : public Label
{
public:
TextPropLabel (TextPropertyComponent& owner_,
const int maxChars_, const bool isMultiline_)
LabelComp (TextPropertyComponent& owner_,
const int maxChars_, const bool isMultiline_)
: Label (String::empty, String::empty),
owner (owner_),
maxChars (maxChars_),
@@ -100,7 +100,7 @@ String TextPropertyComponent::getText() const
void TextPropertyComponent::createEditor (const int maxNumChars, const bool isMultiLine)
{
addAndMakeVisible (textEditor = new TextPropLabel (*this, maxNumChars, isMultiLine));
addAndMakeVisible (textEditor = new LabelComp (*this, maxNumChars, isMultiLine));
if (isMultiLine)
{


+ 5
- 4
modules/juce_gui_basics/properties/juce_TextPropertyComponent.h View File

@@ -75,20 +75,21 @@ public:
*/
virtual void setText (const String& newText);
/** Returns the text that should be shown in the text editor.
*/
/** Returns the text that should be shown in the text editor. */
virtual String getText() const;
//==============================================================================
/** @internal */
void refresh();
/** @internal */
void textWasEdited();
private:
ScopedPointer<Label> textEditor;
class LabelComp;
friend class LabelComp;
void textWasEdited();
void createEditor (int maxNumChars, bool isMultiLine);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextPropertyComponent);


+ 10
- 10
modules/juce_gui_basics/widgets/juce_ListBox.cpp View File

@@ -23,11 +23,11 @@
==============================================================================
*/
class ListBoxRowComponent : public Component,
public TooltipClient
class ListBox::RowComponent : public Component,
public TooltipClient
{
public:
ListBoxRowComponent (ListBox& owner_)
RowComponent (ListBox& owner_)
: owner (owner_), row (-1),
selected (false), isDragging (false), selectRowOnMouseUp (false)
{
@@ -138,7 +138,7 @@ private:
int row;
bool selected, isDragging, selectRowOnMouseUp;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ListBoxRowComponent);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RowComponent);
};
@@ -157,12 +157,12 @@ public:
content->setWantsKeyboardFocus (false);
}
ListBoxRowComponent* getComponentForRow (const int row) const noexcept
RowComponent* getComponentForRow (const int row) const noexcept
{
return rows [row % jmax (1, rows.size())];
}
ListBoxRowComponent* getComponentForRowIfOnscreen (const int row) const noexcept
RowComponent* getComponentForRowIfOnscreen (const int row) const noexcept
{
return (row >= firstIndex && row < firstIndex + rows.size())
? getComponentForRow (row) : nullptr;
@@ -221,7 +221,7 @@ public:
while (numNeeded > rows.size())
{
ListBoxRowComponent* newRow = new ListBoxRowComponent (owner);
RowComponent* newRow = new RowComponent (owner);
rows.add (newRow);
getViewedComponent()->addAndMakeVisible (newRow);
}
@@ -233,7 +233,7 @@ public:
for (int i = 0; i < numNeeded; ++i)
{
const int row = i + firstIndex;
ListBoxRowComponent* const rowComp = getComponentForRow (row);
RowComponent* const rowComp = getComponentForRow (row);
if (rowComp != nullptr)
{
@@ -320,7 +320,7 @@ public:
private:
ListBox& owner;
OwnedArray<ListBoxRowComponent> rows;
OwnedArray<RowComponent> rows;
int firstIndex, firstWholeIndex, lastWholeIndex;
bool hasUpdated;
@@ -619,7 +619,7 @@ int ListBox::getInsertionIndexForPosition (const int x, const int y) const noexc
Component* ListBox::getComponentForRowNumber (const int row) const noexcept
{
ListBoxRowComponent* const listRowComp = viewport->getComponentForRowIfOnscreen (row);
RowComponent* const listRowComp = viewport->getComponentForRowIfOnscreen (row);
return listRowComp != nullptr ? static_cast <Component*> (listRowComp->customComponent) : nullptr;
}


+ 1
- 0
modules/juce_gui_basics/widgets/juce_ListBox.h View File

@@ -562,6 +562,7 @@ public:
private:
//==============================================================================
class ListViewport;
class RowComponent;
friend class ListViewport;
friend class TableListBox;
ListBoxModel* model;


+ 1
- 1
modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp View File

@@ -23,7 +23,7 @@
==============================================================================
*/
class DragOverlayComp : public Component
class TableHeaderComponent::DragOverlayComp : public Component
{
public:
DragOverlayComp (const Image& image_)


+ 1
- 0
modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h View File

@@ -407,6 +407,7 @@ private:
OwnedArray <ColumnInfo> columns;
Array <Listener*> listeners;
ScopedPointer <Component> dragOverlayComp;
class DragOverlayComp;
bool columnsChanged, columnsResized, sortChanged, menuActive, stretchToFit;
int columnIdBeingResized, columnIdBeingDragged, initialColumnWidth;


+ 12
- 12
modules/juce_gui_basics/widgets/juce_TableListBox.cpp View File

@@ -23,11 +23,11 @@
==============================================================================
*/
class TableListRowComp : public Component,
public TooltipClient
class TableListBox::RowComp : public Component,
public TooltipClient
{
public:
TableListRowComp (TableListBox& owner_)
RowComp (TableListBox& owner_)
: owner (owner_), row (-1), isSelected (false)
{
}
@@ -208,15 +208,15 @@ private:
int row;
bool isSelected, isDragging, selectRowOnMouseUp;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TableListRowComp);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RowComp);
};
//==============================================================================
class TableListBoxHeader : public TableHeaderComponent
class TableListBox::Header : public TableHeaderComponent
{
public:
TableListBoxHeader (TableListBox& owner_)
Header (TableListBox& owner_)
: owner (owner_)
{
}
@@ -248,7 +248,7 @@ private:
enum { autoSizeColumnId = 0xf836743, autoSizeAllId = 0xf836744 };
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TableListBoxHeader);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Header);
};
//==============================================================================
@@ -260,7 +260,7 @@ TableListBox::TableListBox (const String& name, TableListBoxModel* const model_)
{
ListBox::model = this;
setHeader (new TableListBoxHeader (*this));
setHeader (new Header (*this));
}
TableListBox::~TableListBox()
@@ -342,7 +342,7 @@ Rectangle<int> TableListBox::getCellPosition (const int columnId, const int rowN
Component* TableListBox::getCellComponent (int columnId, int rowNumber) const
{
TableListRowComp* const rowComp = dynamic_cast <TableListRowComp*> (getComponentForRowNumber (rowNumber));
RowComp* const rowComp = dynamic_cast <RowComp*> (getComponentForRowNumber (rowNumber));
return rowComp != nullptr ? rowComp->findChildComponentForColumn (columnId) : 0;
}
@@ -378,9 +378,9 @@ void TableListBox::paintListBoxItem (int, Graphics&, int, int, bool)
Component* TableListBox::refreshComponentForRow (int rowNumber, bool isRowSelected_, Component* existingComponentToUpdate)
{
if (existingComponentToUpdate == nullptr)
existingComponentToUpdate = new TableListRowComp (*this);
existingComponentToUpdate = new RowComp (*this);
static_cast <TableListRowComp*> (existingComponentToUpdate)->update (rowNumber, isRowSelected_);
static_cast <RowComp*> (existingComponentToUpdate)->update (rowNumber, isRowSelected_);
return existingComponentToUpdate;
}
@@ -456,7 +456,7 @@ void TableListBox::updateColumnComponents() const
for (int i = firstRow + getNumRowsOnScreen() + 2; --i >= firstRow;)
{
TableListRowComp* const rowComp = dynamic_cast <TableListRowComp*> (getComponentForRowNumber (i));
RowComp* const rowComp = dynamic_cast <RowComp*> (getComponentForRowNumber (i));
if (rowComp != nullptr)
rowComp->resized();


+ 3
- 0
modules/juce_gui_basics/widgets/juce_TableListBox.h View File

@@ -324,6 +324,9 @@ public:
private:
//==============================================================================
class Header;
class RowComp;
TableHeaderComponent* header;
TableListBoxModel* model;
int columnIdNowBeingDragged;


+ 1
- 1
modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -857,7 +857,7 @@ private:
//==============================================================================
class TextEditor::TextHolderComponent : public Component,
public Timer,
public ValueListener
private ValueListener
{
public:
TextHolderComponent (TextEditor& owner_)


+ 14
- 14
modules/juce_gui_basics/widgets/juce_Toolbar.cpp View File

@@ -26,10 +26,10 @@
const char* const Toolbar::toolbarDragDescriptor = "_toolbarItem_";
//==============================================================================
class ToolbarSpacerComp : public ToolbarItemComponent
class Toolbar::Spacer : public ToolbarItemComponent
{
public:
ToolbarSpacerComp (const int itemId_, const float fixedSize_, const bool drawBar_)
Spacer (const int itemId_, const float fixedSize_, const bool drawBar_)
: ToolbarItemComponent (itemId_, String::empty, false),
fixedSize (fixedSize_),
drawBar (drawBar_)
@@ -143,7 +143,7 @@ private:
const float fixedSize;
const bool drawBar;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToolbarSpacerComp);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Spacer);
};
//==============================================================================
@@ -159,7 +159,7 @@ public:
{
ToolbarItemComponent* const tc = owner_.items.getUnchecked(i);
if (dynamic_cast <ToolbarSpacerComp*> (tc) == nullptr && ! tc->isVisible())
if (dynamic_cast <Spacer*> (tc) == nullptr && ! tc->isVisible())
{
oldIndexes.insert (0, i);
addAndMakeVisible (tc, 0);
@@ -274,11 +274,11 @@ void Toolbar::clear()
ToolbarItemComponent* Toolbar::createItem (ToolbarItemFactory& factory, const int itemId)
{
if (itemId == ToolbarItemFactory::separatorBarId)
return new ToolbarSpacerComp (itemId, 0.1f, true);
return new Spacer (itemId, 0.1f, true);
else if (itemId == ToolbarItemFactory::spacerId)
return new ToolbarSpacerComp (itemId, 0.5f, false);
return new Spacer (itemId, 0.5f, false);
else if (itemId == ToolbarItemFactory::flexibleSpacerId)
return new ToolbarSpacerComp (itemId, 0, false);
return new Spacer (itemId, 0, false);
return factory.createItem (itemId);
}
@@ -451,7 +451,7 @@ void Toolbar::updateAllItemPositions (const bool animate)
tc->setStyle (toolbarStyle);
ToolbarSpacerComp* const spacer = dynamic_cast <ToolbarSpacerComp*> (tc);
Spacer* const spacer = dynamic_cast <Spacer*> (tc);
int preferredSize = 1, minSize = 1, maxSize = 1;
@@ -647,12 +647,12 @@ void Toolbar::mouseDown (const MouseEvent&)
}
//==============================================================================
class ToolbarCustomisationDialog : public DialogWindow
class Toolbar::CustomisationDialog : public DialogWindow
{
public:
ToolbarCustomisationDialog (ToolbarItemFactory& factory,
Toolbar* const toolbar_,
const int optionFlags)
CustomisationDialog (ToolbarItemFactory& factory,
Toolbar* const toolbar_,
const int optionFlags)
: DialogWindow (TRANS("Add/remove items from toolbar"), Colours::white, true, true),
toolbar (toolbar_)
{
@@ -662,7 +662,7 @@ public:
positionNearBar();
}
~ToolbarCustomisationDialog()
~CustomisationDialog()
{
toolbar->setEditingActive (false);
}
@@ -820,6 +820,6 @@ void Toolbar::showCustomisationDialog (ToolbarItemFactory& factory, const int op
{
setEditingActive (true);
(new ToolbarCustomisationDialog (factory, this, optionFlags))
(new CustomisationDialog (factory, this, optionFlags))
->enterModalState (true, 0, true);
}

+ 5
- 5
modules/juce_gui_basics/widgets/juce_Toolbar.h View File

@@ -275,8 +275,6 @@ public:
/** @internal */
void resized();
/** @internal */
void buttonClicked (Button*);
/** @internal */
void mouseDown (const MouseEvent&);
/** @internal */
bool isInterestedInDragSource (const SourceDetails&);
@@ -290,6 +288,8 @@ public:
void updateAllItemPositions (bool animate);
/** @internal */
static ToolbarItemComponent* createItem (ToolbarItemFactory&, int itemId);
/** @internal */
static const char* const toolbarDragDescriptor;
private:
//==============================================================================
@@ -299,10 +299,10 @@ private:
class MissingItemsComponent;
friend class MissingItemsComponent;
OwnedArray <ToolbarItemComponent> items;
class Spacer;
class CustomisationDialog;
friend class ItemDragAndDropOverlayComponent;
static const char* const toolbarDragDescriptor;
void buttonClicked (Button*);
void addItemInternal (ToolbarItemFactory& factory, int itemId, int insertIndex);
ToolbarItemComponent* getNextActiveComponent (int index, int delta) const;


+ 1
- 1
modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.cpp View File

@@ -32,7 +32,7 @@ ToolbarItemFactory::~ToolbarItemFactory()
}
//==============================================================================
class ItemDragAndDropOverlayComponent : public Component
class ToolbarItemComponent::ItemDragAndDropOverlayComponent : public Component
{
public:
ItemDragAndDropOverlayComponent()


+ 1
- 0
modules/juce_gui_basics/widgets/juce_ToolbarItemComponent.h View File

@@ -194,6 +194,7 @@ public:
private:
friend class Toolbar;
class ItemDragAndDropOverlayComponent;
friend class ItemDragAndDropOverlayComponent;
const int itemId;
ToolbarEditingMode mode;


+ 10
- 10
modules/juce_gui_basics/widgets/juce_TreeView.cpp View File

@@ -23,12 +23,12 @@
==============================================================================
*/
class TreeViewContentComponent : public Component,
public TooltipClient,
public AsyncUpdater
class TreeView::ContentComponent : public Component,
public TooltipClient,
public AsyncUpdater
{
public:
TreeViewContentComponent (TreeView& owner_)
ContentComponent (TreeView& owner_)
: owner (owner_),
buttonUnderMouse (nullptr),
isDragging (false)
@@ -403,7 +403,7 @@ private:
owner.recalculateIfNeeded();
}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TreeViewContentComponent);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ContentComponent);
};
//==============================================================================
@@ -414,7 +414,7 @@ public:
void updateComponents (const bool triggerResize)
{
TreeViewContentComponent* const tvc = getContentComp();
ContentComponent* const tvc = getContentComp();
if (tvc != nullptr)
{
@@ -434,9 +434,9 @@ public:
updateComponents (hasScrolledSideways);
}
TreeViewContentComponent* getContentComp() const noexcept
ContentComponent* getContentComp() const noexcept
{
return static_cast <TreeViewContentComponent*> (getViewedComponent());
return static_cast <ContentComponent*> (getViewedComponent());
}
bool keyPressed (const KeyPress& key)
@@ -467,7 +467,7 @@ TreeView::TreeView (const String& name)
openCloseButtonsVisible (true)
{
addAndMakeVisible (viewport);
viewport->setViewedComponent (new TreeViewContentComponent (*this));
viewport->setViewedComponent (new ContentComponent (*this));
setWantsKeyboardFocus (true);
}
@@ -605,7 +605,7 @@ TreeViewItem* TreeView::getItemOnRow (int index) const
TreeViewItem* TreeView::getItemAt (int y) const noexcept
{
TreeViewContentComponent* const tc = viewport->getContentComp();
ContentComponent* const tc = viewport->getContentComp();
Rectangle<int> pos;
return tc->findItemAt (tc->getLocalPoint (this, Point<int> (0, y)).y, pos);
}


+ 6
- 5
modules/juce_gui_basics/widgets/juce_TreeView.h View File

@@ -508,7 +508,6 @@ private:
unsigned int openness : 2;
friend class TreeView;
friend class TreeViewContentComponent;
void updatePositions (int newY);
int getIndentX() const noexcept;
@@ -791,14 +790,16 @@ public:
void itemDropped (const SourceDetails&);
private:
friend class TreeViewItem;
friend class TreeViewContentComponent;
class ContentComponent;
class TreeViewport;
class InsertPointHighlight;
class TargetGroupHighlight;
friend class TreeViewItem;
friend class ContentComponent;
friend class ScopedPointer<TreeViewport>;
friend class ScopedPointer<InsertPointHighlight>;
friend class ScopedPointer<TargetGroupHighlight>;
ScopedPointer<TreeViewport> viewport;
CriticalSection nodeAlterationLock;
TreeViewItem* rootItem;
@@ -818,8 +819,8 @@ private:
struct InsertPoint;
void showDragHighlight (const InsertPoint&) noexcept;
void hideDragHighlight() noexcept;
void handleDrag (const StringArray& files, const SourceDetails&);
void handleDrop (const StringArray& files, const SourceDetails&);
void handleDrag (const StringArray&, const SourceDetails&);
void handleDrop (const StringArray&, const SourceDetails&);
void toggleOpenSelectedItem();
void moveOutOfSelectedItem();
void moveIntoSelectedItem();


+ 23
- 9
modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp View File

@@ -24,8 +24,8 @@
*/
/** Keeps track of the active top level window. */
class TopLevelWindowManager : public Timer,
public DeletedAtShutdown
class TopLevelWindowManager : private Timer,
private DeletedAtShutdown
{
public:
//==============================================================================
@@ -41,7 +41,12 @@ public:
juce_DeclareSingleton_SingleThreaded_Minimal (TopLevelWindowManager);
void timerCallback()
void checkFocusAsync()
{
startTimer (10);
}
void checkFocus()
{
startTimer (jmin (1731, getTimerInterval() * 2));
@@ -80,14 +85,14 @@ public:
bool addWindow (TopLevelWindow* const w)
{
windows.add (w);
startTimer (10);
checkFocusAsync();
return isWindowActive (w);
}
void removeWindow (TopLevelWindow* const w)
{
startTimer (10);
checkFocusAsync();
if (currentActive == w)
currentActive = nullptr;
@@ -103,6 +108,11 @@ public:
private:
TopLevelWindow* currentActive;
void timerCallback()
{
checkFocus();
}
bool isWindowActive (TopLevelWindow* const tlw) const
{
return (tlw == currentActive
@@ -119,8 +129,10 @@ juce_ImplementSingleton_SingleThreaded (TopLevelWindowManager)
void juce_CheckCurrentlyFocusedTopLevelWindow();
void juce_CheckCurrentlyFocusedTopLevelWindow()
{
if (TopLevelWindowManager::getInstanceWithoutCreating() != nullptr)
TopLevelWindowManager::getInstanceWithoutCreating()->startTimer (20);
TopLevelWindowManager* const wm = TopLevelWindowManager::getInstanceWithoutCreating();
if (wm != nullptr)
wm->checkFocusAsync();
}
//==============================================================================
@@ -152,10 +164,12 @@ TopLevelWindow::~TopLevelWindow()
//==============================================================================
void TopLevelWindow::focusOfChildComponentChanged (FocusChangeType)
{
TopLevelWindowManager* const wm = TopLevelWindowManager::getInstance();
if (hasKeyboardFocus (true))
TopLevelWindowManager::getInstance()->timerCallback();
wm->checkFocus();
else
TopLevelWindowManager::getInstance()->startTimer (10);
wm->checkFocusAsync();
}
void TopLevelWindow::setWindowActive (const bool isNowActive)


+ 15
- 24
modules/juce_gui_extra/misc/juce_ColourSelector.cpp View File

@@ -23,7 +23,7 @@
==============================================================================
*/
class ColourComponentSlider : public Slider
class ColourSelector::ColourComponentSlider : public Slider
{
public:
ColourComponentSlider (const String& name)
@@ -47,7 +47,7 @@ private:
};
//==============================================================================
class ColourSpaceMarker : public Component
class ColourSelector::ColourSpaceMarker : public Component
{
public:
ColourSpaceMarker()
@@ -71,13 +71,8 @@ private:
class ColourSelector::ColourSpaceView : public Component
{
public:
ColourSpaceView (ColourSelector& owner_,
float& h_, float& s_, float& v_,
const int edgeSize)
: owner (owner_),
h (h_), s (s_), v (v_),
lastHue (0.0f),
edge (edgeSize)
ColourSpaceView (ColourSelector& owner_, float& h_, float& s_, float& v_, const int edgeSize)
: owner (owner_), h (h_), s (s_), v (v_), lastHue (0.0f), edge (edgeSize)
{
addAndMakeVisible (&marker);
setMouseCursor (MouseCursor::CrosshairCursor);
@@ -100,7 +95,6 @@ public:
for (int x = 0; x < width; ++x)
{
const float sat = x / (float) width;
pixels.setPixelColour (x, y, Colour (h, sat, val, 1.0f));
}
}
@@ -163,7 +157,7 @@ private:
};
//==============================================================================
class HueSelectorMarker : public Component
class ColourSelector::HueSelectorMarker : public Component
{
public:
HueSelectorMarker()
@@ -173,14 +167,17 @@ public:
void paint (Graphics& g)
{
const float w = (float) getWidth();
const float h = (float) getHeight();
Path p;
p.addTriangle (1.0f, 1.0f,
getWidth() * 0.3f, getHeight() * 0.5f,
1.0f, getHeight() - 1.0f);
w * 0.3f, h * 0.5f,
1.0f, h - 1.0f);
p.addTriangle (getWidth() - 1.0f, 1.0f,
getWidth() * 0.7f, getHeight() * 0.5f,
getWidth() - 1.0f, getHeight() - 1.0f);
p.addTriangle (w - 1.0f, 1.0f,
w * 0.7f, h * 0.5f,
w - 1.0f, h - 1.0f);
g.setColour (Colours::white.withAlpha (0.75f));
g.fillPath (p);
@@ -197,13 +194,8 @@ private:
class ColourSelector::HueSelectorComp : public Component
{
public:
HueSelectorComp (ColourSelector& owner_,
float& h_, float& s_, float& v_,
const int edgeSize)
: owner (owner_),
h (h_), s (s_), v (v_),
lastHue (0.0f),
edge (edgeSize)
HueSelectorComp (ColourSelector& owner_, float& h_, float& s_, float& v_, const int edgeSize)
: owner (owner_), h (h_), s (s_), v (v_), edge (edgeSize)
{
addAndMakeVisible (&marker);
}
@@ -247,7 +239,6 @@ private:
float& h;
float& s;
float& v;
float lastHue;
HueSelectorMarker marker;
const int edge;


+ 3
- 0
modules/juce_gui_extra/misc/juce_ColourSelector.h View File

@@ -134,6 +134,9 @@ private:
class ColourSpaceView;
class HueSelectorComp;
class SwatchComponent;
class ColourComponentSlider;
class ColourSpaceMarker;
class HueSelectorMarker;
friend class ColourSpaceView;
friend class ScopedPointer<ColourSpaceView>;
friend class HueSelectorComp;


+ 2
- 2
modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp View File

@@ -347,8 +347,8 @@ private:
//==============================================================================
class KeyMappingEditorComponent::TopLevelItem : public TreeViewItem,
public ChangeListener,
public ButtonListener
public ButtonListener,
private ChangeListener
{
public:
TopLevelItem (KeyMappingEditorComponent& owner_)


+ 4
- 4
modules/juce_gui_extra/misc/juce_SplashScreen.h View File

@@ -53,7 +53,7 @@
@endcode
*/
class JUCE_API SplashScreen : public Component,
public Timer,
private Timer,
private DeletedAtShutdown
{
public:
@@ -129,9 +129,7 @@ public:
//==============================================================================
/** @internal */
void paint (Graphics& g);
/** @internal */
void timerCallback();
void paint (Graphics&);
private:
//==============================================================================
@@ -139,6 +137,8 @@ private:
Time earliestTimeToDelete;
int originalClickCounter;
void timerCallback();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SplashScreen);
};


+ 2
- 5
modules/juce_gui_extra/misc/juce_WebBrowserComponent.h View File

@@ -28,10 +28,6 @@
#if JUCE_WEB_BROWSER || DOXYGEN
#if ! DOXYGEN
class WebBrowserComponentInternal;
#endif
//==============================================================================
/**
A component that displays an embedded web browser.
@@ -114,7 +110,8 @@ public:
private:
//==============================================================================
WebBrowserComponentInternal* browser;
class Pimpl;
Pimpl* browser;
bool blankPageShown, unloadPageWhenBrowserIsHidden;
String lastURL;
StringArray lastHeaders;


+ 4
- 4
modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm View File

@@ -116,7 +116,7 @@ namespace juce {
#endif
//==============================================================================
class WebBrowserComponentInternal
class WebBrowserComponent::Pimpl
#if JUCE_MAC
: public NSViewComponent
#else
@@ -124,7 +124,7 @@ class WebBrowserComponentInternal
#endif
{
public:
WebBrowserComponentInternal (WebBrowserComponent* owner)
Pimpl (WebBrowserComponent* owner)
{
#if JUCE_MAC
webView = [[WebView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f)
@@ -148,7 +148,7 @@ public:
#endif
}
~WebBrowserComponentInternal()
~Pimpl()
{
#if JUCE_MAC
[webView setPolicyDelegate: nil];
@@ -241,7 +241,7 @@ WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidd
{
setOpaque (true);
addAndMakeVisible (browser = new WebBrowserComponentInternal (this));
addAndMakeVisible (browser = new Pimpl (this));
}
WebBrowserComponent::~WebBrowserComponent()


+ 8
- 8
modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp View File

@@ -24,17 +24,17 @@
*/
//==============================================================================
class WebBrowserComponentInternal : public ActiveXControlComponent
class WebBrowserComponent::Pimpl : public ActiveXControlComponent
{
public:
WebBrowserComponentInternal()
: browser (nullptr),
connectionPoint (nullptr),
adviseCookie (0)
Pimpl()
: browser (nullptr),
connectionPoint (nullptr),
adviseCookie (0)
{
}
~WebBrowserComponentInternal()
~Pimpl()
{
if (connectionPoint != nullptr)
connectionPoint->Unadvise (adviseCookie);
@@ -183,7 +183,7 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EventHandler);
};
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebBrowserComponentInternal);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl);
};
@@ -194,7 +194,7 @@ WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidd
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
setOpaque (true);
addAndMakeVisible (browser = new WebBrowserComponentInternal());
addAndMakeVisible (browser = new Pimpl());
}
WebBrowserComponent::~WebBrowserComponent()


+ 1
- 1
modules/juce_video/native/juce_win32_DirectShowComponent.cpp View File

@@ -492,7 +492,7 @@ private:
ScopedPointer <DirectShowHelpers::VideoRenderer> videoRenderer;
//======================================================================
class NativeWindowClass : public DeletedAtShutdown
class NativeWindowClass : private DeletedAtShutdown
{
private:
NativeWindowClass()


Loading…
Cancel
Save