| @@ -161,8 +161,7 @@ private: | |||||
| File file; | File file; | ||||
| Time fileModificationTime; | Time fileModificationTime; | ||||
| UnknownDocument (const UnknownDocument&); | |||||
| UnknownDocument& operator= (const UnknownDocument&); | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UnknownDocument); | |||||
| }; | }; | ||||
| @@ -322,8 +322,7 @@ private: | |||||
| void createDefaultConfigs(); | void createDefaultConfigs(); | ||||
| ValueTree getJuceConfigNode(); | ValueTree getJuceConfigNode(); | ||||
| Project (const Project&); | |||||
| const Project& operator= (const Project&); | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project); | |||||
| }; | }; | ||||
| @@ -243,7 +243,7 @@ protected: | |||||
| //============================================================================== | //============================================================================== | ||||
| void writeSolutionFile (OutputStream& out, const String& versionString, const File& vcProject) | void writeSolutionFile (OutputStream& out, const String& versionString, const File& vcProject) | ||||
| { | { | ||||
| out << newLine << "Microsoft Visual Studio Solution File, Format Version " << versionString << newLine | |||||
| out << "Microsoft Visual Studio Solution File, Format Version " << versionString << newLine | |||||
| << "Project(\"" << createGUID (project.getProjectName().toString() + "sln_guid") << "\") = \"" << project.getProjectName().toString() << "\", \"" | << "Project(\"" << createGUID (project.getProjectName().toString() + "sln_guid") << "\") = \"" << project.getProjectName().toString() << "\", \"" | ||||
| << vcProject.getFileName() << "\", \"" << projectGUID << '"' << newLine | << vcProject.getFileName() << "\", \"" << projectGUID << '"' << newLine | ||||
| << "EndProject" << newLine | << "EndProject" << newLine | ||||
| @@ -448,8 +448,7 @@ protected: | |||||
| return hasIcon; | return hasIcon; | ||||
| } | } | ||||
| MSVCProjectExporterBase (const MSVCProjectExporterBase&); | |||||
| MSVCProjectExporterBase& operator= (const MSVCProjectExporterBase&); | |||||
| JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterBase); | |||||
| }; | }; | ||||
| @@ -816,8 +815,7 @@ protected: | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| MSVCProjectExporterVC2008 (const MSVCProjectExporterVC2008&); | |||||
| MSVCProjectExporterVC2008& operator= (const MSVCProjectExporterVC2008&); | |||||
| JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2008); | |||||
| }; | }; | ||||
| @@ -850,8 +848,7 @@ protected: | |||||
| const String getProjectVersionString() const { return "8.00"; } | const String getProjectVersionString() const { return "8.00"; } | ||||
| const String getSolutionVersionString() const { return String ("8.00") + newLine + "# Visual C++ Express 2005"; } | const String getSolutionVersionString() const { return String ("8.00") + newLine + "# Visual C++ Express 2005"; } | ||||
| MSVCProjectExporterVC2005 (const MSVCProjectExporterVC2005&); | |||||
| MSVCProjectExporterVC2005& operator= (const MSVCProjectExporterVC2005&); | |||||
| JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2005); | |||||
| }; | }; | ||||
| @@ -1121,8 +1118,7 @@ private: | |||||
| << "}}}" << newLine; | << "}}}" << newLine; | ||||
| } | } | ||||
| MSVCProjectExporterVC6 (const MSVCProjectExporterVC6&); | |||||
| MSVCProjectExporterVC6& operator= (const MSVCProjectExporterVC6&); | |||||
| JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC6); | |||||
| }; | }; | ||||
| @@ -1552,8 +1548,7 @@ protected: | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| MSVCProjectExporterVC2010 (const MSVCProjectExporterVC2010&); | |||||
| MSVCProjectExporterVC2010& operator= (const MSVCProjectExporterVC2010&); | |||||
| JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2010); | |||||
| }; | }; | ||||
| @@ -342,8 +342,7 @@ private: | |||||
| + "_" + String::toHexString (file.toUnixStyle().hashCode()) + ".o"; | + "_" + String::toHexString (file.toUnixStyle().hashCode()) + ".o"; | ||||
| } | } | ||||
| MakefileProjectExporter (const MakefileProjectExporter&); | |||||
| MakefileProjectExporter& operator= (const MakefileProjectExporter&); | |||||
| JUCE_DECLARE_NON_COPYABLE (MakefileProjectExporter); | |||||
| }; | }; | ||||
| @@ -119,8 +119,7 @@ protected: | |||||
| const RelativePath rebaseFromProjectFolderToBuildTarget (const RelativePath& path) const; | const RelativePath rebaseFromProjectFolderToBuildTarget (const RelativePath& path) const; | ||||
| private: | private: | ||||
| ProjectExporter (const ProjectExporter&); | |||||
| ProjectExporter& operator= (const ProjectExporter&); | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectExporter); | |||||
| }; | }; | ||||
| @@ -535,6 +535,8 @@ private: | |||||
| return project.getWrapperFolder().getChildFile (project.getJuceSourceFilenameRoot() + (fileIndex != 0 ? String (fileIndex) : String::empty)) | return project.getWrapperFolder().getChildFile (project.getJuceSourceFilenameRoot() + (fileIndex != 0 ? String (fileIndex) : String::empty)) | ||||
| .withFileExtension (".cpp"); | .withFileExtension (".cpp"); | ||||
| } | } | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectSaver); | |||||
| }; | }; | ||||
| @@ -60,6 +60,8 @@ private: | |||||
| String className; | String className; | ||||
| void addResourcesFromProjectItem (const Project::Item& node); | void addResourcesFromProjectItem (const Project::Item& node); | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResourceFile); | |||||
| }; | }; | ||||
| @@ -59,67 +59,6 @@ private: | |||||
| FilterConnection& operator= (const FilterConnection&); | FilterConnection& operator= (const FilterConnection&); | ||||
| }; | }; | ||||
| //============================================================================== | |||||
| /** | |||||
| Represents one of the filters in a FilterGraph. | |||||
| */ | |||||
| /*class FilterInGraph : public ReferenceCountedObject | |||||
| { | |||||
| public: | |||||
| //============================================================================== | |||||
| FilterInGraph (FilterGraph& owner, AudioPluginInstance* const plugin); | |||||
| ~FilterInGraph(); | |||||
| //============================================================================== | |||||
| AudioPluginInstance* const filter; | |||||
| uint32 uid; | |||||
| //============================================================================== | |||||
| void showUI (bool useGenericUI); | |||||
| double getX() const throw() { return x; } | |||||
| double getY() const throw() { return y; } | |||||
| void setPosition (double x, double y) throw(); | |||||
| XmlElement* createXml() const; | |||||
| static FilterInGraph* createForDescription (FilterGraph& owner, | |||||
| const PluginDescription& desc, | |||||
| String& errorMessage); | |||||
| static FilterInGraph* createFromXml (FilterGraph& owner, const XmlElement& xml); | |||||
| //============================================================================== | |||||
| typedef ReferenceCountedObjectPtr <FilterInGraph> Ptr; | |||||
| //============================================================================== | |||||
| juce_UseDebuggingNewOperator | |||||
| private: | |||||
| friend class FilterGraphPlayer; | |||||
| FilterGraph& owner; | |||||
| double x, y; | |||||
| friend class PluginWindow; | |||||
| Component* activeUI; | |||||
| Component* activeGenericUI; | |||||
| int lastX, lastY; | |||||
| MidiBuffer outputMidi; | |||||
| AudioSampleBuffer processedAudio; | |||||
| MidiBuffer processedMidi; | |||||
| void prepareBuffers (int blockSize); | |||||
| void renderBlock (int numSamples, | |||||
| const ReferenceCountedArray <FilterInGraph>& filters, | |||||
| const OwnedArray <FilterConnection>& connections); | |||||
| FilterInGraph (const FilterInGraph&); | |||||
| FilterInGraph& operator= (const FilterInGraph&); | |||||
| }; | |||||
| */ | |||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** | ||||
| A collection of filters and some connections between them. | A collection of filters and some connections between them. | ||||
| @@ -185,14 +124,8 @@ public: | |||||
| */ | */ | ||||
| static const int midiChannelNumber; | static const int midiChannelNumber; | ||||
| //============================================================================== | |||||
| juce_UseDebuggingNewOperator | |||||
| private: | private: | ||||
| //friend class FilterGraphPlayer; | |||||
| //ReferenceCountedArray <FilterInGraph> filters; | |||||
| //OwnedArray <FilterConnection> connections; | |||||
| //============================================================================== | |||||
| AudioProcessorGraph graph; | AudioProcessorGraph graph; | ||||
| AudioProcessorPlayer player; | AudioProcessorPlayer player; | ||||
| @@ -201,76 +134,8 @@ private: | |||||
| void createNodeFromXml (const XmlElement& xml); | void createNodeFromXml (const XmlElement& xml); | ||||
| FilterGraph (const FilterGraph&); | |||||
| FilterGraph& operator= (const FilterGraph&); | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilterGraph); | |||||
| }; | }; | ||||
| //============================================================================== | |||||
| /** | |||||
| */ | |||||
| /*class FilterGraphPlayer : public AudioIODeviceCallback, | |||||
| public MidiInputCallback, | |||||
| public ChangeListener | |||||
| { | |||||
| public: | |||||
| //============================================================================== | |||||
| FilterGraphPlayer (FilterGraph& graph); | |||||
| ~FilterGraphPlayer(); | |||||
| //============================================================================== | |||||
| void setAudioDeviceManager (AudioDeviceManager* dm); | |||||
| AudioDeviceManager* getAudioDeviceManager() const throw() { return deviceManager; } | |||||
| //============================================================================== | |||||
| void audioDeviceIOCallback (const float** inputChannelData, | |||||
| int totalNumInputChannels, | |||||
| float** outputChannelData, | |||||
| int totalNumOutputChannels, | |||||
| int numSamples); | |||||
| void audioDeviceAboutToStart (double sampleRate, int numSamplesPerBlock); | |||||
| void audioDeviceStopped(); | |||||
| void handleIncomingMidiMessage (MidiInput* source, const MidiMessage& message); | |||||
| void changeListenerCallback (ChangeBroadcaster*); | |||||
| //============================================================================== | |||||
| static int compareElements (FilterInGraph* const first, FilterInGraph* const second) throw(); | |||||
| const float** inputChannelData; | |||||
| int totalNumInputChannels; | |||||
| float** outputChannelData; | |||||
| int totalNumOutputChannels; | |||||
| MidiBuffer incomingMidi; | |||||
| MidiKeyboardState keyState; | |||||
| MidiMessageCollector messageCollector; | |||||
| //============================================================================== | |||||
| class PlayerAwareFilter | |||||
| { | |||||
| public: | |||||
| virtual void setPlayer (FilterGraphPlayer* newPlayer) = 0; | |||||
| }; | |||||
| private: | |||||
| FilterGraph& graph; | |||||
| CriticalSection processLock; | |||||
| double sampleRate; | |||||
| int blockSize; | |||||
| AudioDeviceManager* deviceManager; | |||||
| ReferenceCountedArray <FilterInGraph> filters; | |||||
| OwnedArray <FilterConnection> connections; | |||||
| void update(); | |||||
| FilterGraphPlayer (const FilterGraphPlayer&); | |||||
| FilterGraphPlayer& operator= (const FilterGraphPlayer&); | |||||
| }; | |||||
| */ | |||||
| #endif | #endif | ||||
| @@ -192,8 +192,6 @@ public: | |||||
| getGraphPanel()->endDraggingConnector (e); | getGraphPanel()->endDraggingConnector (e); | ||||
| } | } | ||||
| juce_UseDebuggingNewOperator | |||||
| const uint32 filterID; | const uint32 filterID; | ||||
| const int index; | const int index; | ||||
| const bool isInput; | const bool isInput; | ||||
| @@ -201,13 +199,12 @@ public: | |||||
| private: | private: | ||||
| FilterGraph& graph; | FilterGraph& graph; | ||||
| PinComponent (const PinComponent&); | |||||
| PinComponent& operator= (const PinComponent&); | |||||
| GraphEditorPanel* getGraphPanel() const throw() | GraphEditorPanel* getGraphPanel() const throw() | ||||
| { | { | ||||
| return findParentComponentOfClass ((GraphEditorPanel*) 0); | return findParentComponentOfClass ((GraphEditorPanel*) 0); | ||||
| } | } | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PinComponent); | |||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -679,8 +676,6 @@ public: | |||||
| linePath.setUsingNonZeroWinding (true); | linePath.setUsingNonZeroWinding (true); | ||||
| } | } | ||||
| juce_UseDebuggingNewOperator | |||||
| uint32 sourceFilterID, destFilterID; | uint32 sourceFilterID, destFilterID; | ||||
| int sourceFilterChannel, destFilterChannel; | int sourceFilterChannel, destFilterChannel; | ||||
| @@ -704,8 +699,7 @@ private: | |||||
| distanceFromEnd = juce_hypot (x - (x2 - getX()), y - (y2 - getY())); | distanceFromEnd = juce_hypot (x - (x2 - getX()), y - (y2 - getY())); | ||||
| } | } | ||||
| ConnectorComponent (const ConnectorComponent&); | |||||
| ConnectorComponent& operator= (const ConnectorComponent&); | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ConnectorComponent); | |||||
| }; | }; | ||||
| @@ -990,10 +984,6 @@ public: | |||||
| startTimer (100); | startTimer (100); | ||||
| } | } | ||||
| ~TooltipBar() | |||||
| { | |||||
| } | |||||
| void paint (Graphics& g) | void paint (Graphics& g) | ||||
| { | { | ||||
| g.setFont (getHeight() * 0.7f, Font::bold); | g.setFont (getHeight() * 0.7f, Font::bold); | ||||
| @@ -1018,10 +1008,10 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| juce_UseDebuggingNewOperator | |||||
| private: | private: | ||||
| String tip; | String tip; | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TooltipBar); | |||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -64,10 +64,8 @@ public: | |||||
| const StringArray searchPathsForPlugins (const FileSearchPath&, bool) { return StringArray(); } | const StringArray searchPathsForPlugins (const FileSearchPath&, bool) { return StringArray(); } | ||||
| AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); | AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc); | ||||
| //============================================================================== | |||||
| juce_UseDebuggingNewOperator | |||||
| private: | private: | ||||
| //============================================================================== | |||||
| PluginDescription audioInDesc; | PluginDescription audioInDesc; | ||||
| PluginDescription audioOutDesc; | PluginDescription audioOutDesc; | ||||
| PluginDescription midiInDesc; | PluginDescription midiInDesc; | ||||
| @@ -83,11 +83,8 @@ public: | |||||
| void addPluginsToMenu (PopupMenu& m) const; | void addPluginsToMenu (PopupMenu& m) const; | ||||
| const PluginDescription* getChosenType (const int menuID) const; | const PluginDescription* getChosenType (const int menuID) const; | ||||
| //============================================================================== | |||||
| juce_UseDebuggingNewOperator | |||||
| private: | private: | ||||
| //============================================================================== | |||||
| AudioDeviceManager deviceManager; | AudioDeviceManager deviceManager; | ||||
| OwnedArray <PluginDescription> internalTypes; | OwnedArray <PluginDescription> internalTypes; | ||||
| @@ -96,6 +93,8 @@ private: | |||||
| void showAudioSettings(); | void showAudioSettings(); | ||||
| GraphDocumentComponent* getGraphEditor() const; | GraphDocumentComponent* getGraphEditor() const; | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow); | |||||
| }; | }; | ||||
| @@ -92,15 +92,15 @@ public: | |||||
| float gain, delay; | float gain, delay; | ||||
| //============================================================================== | |||||
| juce_UseDebuggingNewOperator | |||||
| private: | private: | ||||
| //============================================================================== | |||||
| AudioSampleBuffer delayBuffer; | AudioSampleBuffer delayBuffer; | ||||
| int delayPosition; | int delayPosition; | ||||
| // the synth! | // the synth! | ||||
| Synthesiser synth; | Synthesiser synth; | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceDemoPluginAudioProcessor); | |||||
| }; | }; | ||||
| #endif // __PLUGINPROCESSOR_H_526ED7A9__ | #endif // __PLUGINPROCESSOR_H_526ED7A9__ | ||||
| @@ -68,8 +68,9 @@ public: | |||||
| */ | */ | ||||
| virtual const var getJavascriptObject() = 0; | virtual const var getJavascriptObject() = 0; | ||||
| private: | |||||
| //============================================================================== | //============================================================================== | ||||
| juce_UseDebuggingNewOperator | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BrowserPluginComponent); | |||||
| }; | }; | ||||
| @@ -120,11 +120,9 @@ public: | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| MouseEvent e2 (e.getEventRelativeTo (parent)); | |||||
| // if the mouse is inside the parent component, we'll make that the | // if the mouse is inside the parent component, we'll make that the | ||||
| // parent - otherwise, we'll put this comp on the desktop. | // parent - otherwise, we'll put this comp on the desktop. | ||||
| if (e2.x >= 0 && e2.y >= 0 && e2.x < parent->getWidth() && e2.y < parent->getHeight()) | |||||
| if (parent->getLocalBounds().contains (e.getEventRelativeTo (parent).getPosition())) | |||||
| { | { | ||||
| // re-add this component to a parent component, which will | // re-add this component to a parent component, which will | ||||
| // remove it from the desktop.. | // remove it from the desktop.. | ||||
| @@ -77609,8 +77609,31 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in | |||||
| return; | return; | ||||
| } | } | ||||
| const Point<int> pos (targetComp->getLocalPoint (component, position)); | |||||
| target->filesDropped (files, pos.getX(), pos.getY()); | |||||
| // We'll use an async message to deliver the drop, because if the target decides | |||||
| // to run a modal loop, it can gum-up the operating system.. | |||||
| class AsyncFileDropMessage : public CallbackMessage | |||||
| { | |||||
| public: | |||||
| AsyncFileDropMessage (Component* target_, const Point<int>& position_, const StringArray& files_) | |||||
| : target (target_), position (position_), files (files_) | |||||
| { | |||||
| } | |||||
| void messageCallback() | |||||
| { | |||||
| if (target != 0) | |||||
| target->filesDropped (files, position.getX(), position.getY()); | |||||
| } | |||||
| private: | |||||
| Component::SafePointer<Component> target; | |||||
| Point<int> position; | |||||
| StringArray files; | |||||
| JUCE_DECLARE_NON_COPYABLE (AsyncFileDropMessage); | |||||
| }; | |||||
| (new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post(); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -77681,25 +77704,6 @@ void DialogWindow::resized() | |||||
| } | } | ||||
| } | } | ||||
| class TempDialogWindow : public DialogWindow | |||||
| { | |||||
| public: | |||||
| TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
| : DialogWindow (title, colour, escapeCloses, true) | |||||
| { | |||||
| if (! JUCEApplication::isStandaloneApp()) | |||||
| setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
| } | |||||
| void closeButtonPressed() | |||||
| { | |||||
| setVisible (false); | |||||
| } | |||||
| private: | |||||
| JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
| }; | |||||
| int DialogWindow::showModalDialog (const String& dialogTitle, | int DialogWindow::showModalDialog (const String& dialogTitle, | ||||
| Component* contentComponent, | Component* contentComponent, | ||||
| Component* componentToCentreAround, | Component* componentToCentreAround, | ||||
| @@ -77708,6 +77712,25 @@ int DialogWindow::showModalDialog (const String& dialogTitle, | |||||
| const bool shouldBeResizable, | const bool shouldBeResizable, | ||||
| const bool useBottomRightCornerResizer) | const bool useBottomRightCornerResizer) | ||||
| { | { | ||||
| class TempDialogWindow : public DialogWindow | |||||
| { | |||||
| public: | |||||
| TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
| : DialogWindow (title, colour, escapeCloses, true) | |||||
| { | |||||
| if (! JUCEApplication::isStandaloneApp()) | |||||
| setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
| } | |||||
| void closeButtonPressed() | |||||
| { | |||||
| setVisible (false); | |||||
| } | |||||
| private: | |||||
| JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
| }; | |||||
| TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | ||||
| dw.setContentComponent (contentComponent, true, true); | dw.setContentComponent (contentComponent, true, true); | ||||
| @@ -97999,8 +98022,6 @@ ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); | |||||
| BEGIN_JUCE_NAMESPACE | BEGIN_JUCE_NAMESPACE | ||||
| // internal helper object that holds the zlib structures so they don't have to be | |||||
| // included publicly. | |||||
| class GZIPCompressorOutputStream::GZIPCompressorHelper | class GZIPCompressorOutputStream::GZIPCompressorHelper | ||||
| { | { | ||||
| public: | public: | ||||
| @@ -98137,11 +98158,7 @@ bool GZIPCompressorOutputStream::write (const void* destBuffer, int howMany) | |||||
| bool GZIPCompressorOutputStream::doNextBlock() | bool GZIPCompressorOutputStream::doNextBlock() | ||||
| { | { | ||||
| const int len = helper->doNextBlock (buffer, (int) GZIPCompressorHelper::gzipCompBufferSize); | const int len = helper->doNextBlock (buffer, (int) GZIPCompressorHelper::gzipCompBufferSize); | ||||
| if (len > 0) | |||||
| return destStream->write (buffer, len); | |||||
| else | |||||
| return true; | |||||
| return len <= 0 || destStream->write (buffer, len); | |||||
| } | } | ||||
| int64 GZIPCompressorOutputStream::getPosition() | int64 GZIPCompressorOutputStream::getPosition() | ||||
| @@ -242963,8 +242980,6 @@ private: | |||||
| { | { | ||||
| } | } | ||||
| ~JuceDropTarget() {} | |||||
| HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) | HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) | ||||
| { | { | ||||
| updateFileList (pDataObject); | updateFileList (pDataObject); | ||||
| @@ -256089,10 +256104,10 @@ double Time::getMillisecondCounterHiRes() throw() | |||||
| bool Time::setSystemTimeToThisTime() const | bool Time::setSystemTimeToThisTime() const | ||||
| { | { | ||||
| timeval t; | timeval t; | ||||
| t.tv_sec = millisSinceEpoch % 1000000; | |||||
| t.tv_usec = millisSinceEpoch - t.tv_sec; | |||||
| t.tv_sec = millisSinceEpoch / 1000; | |||||
| t.tv_usec = (millisSinceEpoch - t.tv_sec * 1000) * 1000; | |||||
| return settimeofday (&t, 0) ? false : true; | |||||
| return settimeofday (&t, 0) == 0; | |||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -273227,12 +273242,12 @@ BOOL NSViewComponentPeer::sendDragCallback (int type, id <NSDraggingInfo> sender | |||||
| NSPoint p = [view convertPoint: [sender draggingLocation] fromView: nil]; | NSPoint p = [view convertPoint: [sender draggingLocation] fromView: nil]; | ||||
| const Point<int> pos ((int) p.x, (int) ([view frame].size.height - p.y)); | const Point<int> pos ((int) p.x, (int) ([view frame].size.height - p.y)); | ||||
| StringArray files; | |||||
| id list = [[sender draggingPasteboard] propertyListForType: bestType]; | id list = [[sender draggingPasteboard] propertyListForType: bestType]; | ||||
| if (list == nil) | if (list == nil) | ||||
| return false; | return false; | ||||
| StringArray files; | |||||
| if ([list isKindOfClass: [NSArray class]]) | if ([list isKindOfClass: [NSArray class]]) | ||||
| { | { | ||||
| NSArray* items = (NSArray*) list; | NSArray* items = (NSArray*) list; | ||||
| @@ -6882,8 +6882,23 @@ private: | |||||
| const ScopedPointer* getAddress() const throw() { return this; } | const ScopedPointer* getAddress() const throw() { return this; } | ||||
| #if ! JUCE_MSVC // (MSVC can't deal with multiple copy constructors) | #if ! JUCE_MSVC // (MSVC can't deal with multiple copy constructors) | ||||
| // This is private to stop people accidentally copying a const ScopedPointer (the compiler | |||||
| // will let you do so by implicitly casting the source to its raw object pointer). | |||||
| /* This is private to stop people accidentally copying a const ScopedPointer (the compiler | |||||
| would let you do so by implicitly casting the source to its raw object pointer). | |||||
| A side effect of this is that you may hit a puzzling compiler error when you write something | |||||
| like this: | |||||
| ScopedPointer<MyClass> m = new MyClass(); // Compile error: copy constructor is private. | |||||
| Even though the compiler would normally ignore the assignment here, it can't do so when the | |||||
| copy constructor is private. It's very easy to fis though - just write it like this: | |||||
| ScopedPointer<MyClass> m (new MyClass()); // Compiles OK | |||||
| It's good practice to always use the latter form when writing your object declarations anyway, | |||||
| rather than writing them as assignments and assuming (or hoping) that the compiler will be | |||||
| smart enough to replace your construction + assignment with a single constructor. | |||||
| */ | |||||
| ScopedPointer (const ScopedPointer&); | ScopedPointer (const ScopedPointer&); | ||||
| #endif | #endif | ||||
| }; | }; | ||||
| @@ -167,8 +167,23 @@ private: | |||||
| const ScopedPointer* getAddress() const throw() { return this; } | const ScopedPointer* getAddress() const throw() { return this; } | ||||
| #if ! JUCE_MSVC // (MSVC can't deal with multiple copy constructors) | #if ! JUCE_MSVC // (MSVC can't deal with multiple copy constructors) | ||||
| // This is private to stop people accidentally copying a const ScopedPointer (the compiler | |||||
| // will let you do so by implicitly casting the source to its raw object pointer). | |||||
| /* This is private to stop people accidentally copying a const ScopedPointer (the compiler | |||||
| would let you do so by implicitly casting the source to its raw object pointer). | |||||
| A side effect of this is that you may hit a puzzling compiler error when you write something | |||||
| like this: | |||||
| ScopedPointer<MyClass> m = new MyClass(); // Compile error: copy constructor is private. | |||||
| Even though the compiler would normally ignore the assignment here, it can't do so when the | |||||
| copy constructor is private. It's very easy to fis though - just write it like this: | |||||
| ScopedPointer<MyClass> m (new MyClass()); // Compiles OK | |||||
| It's good practice to always use the latter form when writing your object declarations anyway, | |||||
| rather than writing them as assignments and assuming (or hoping) that the compiler will be | |||||
| smart enough to replace your construction + assignment with a single constructor. | |||||
| */ | |||||
| ScopedPointer (const ScopedPointer&); | ScopedPointer (const ScopedPointer&); | ||||
| #endif | #endif | ||||
| }; | }; | ||||
| @@ -507,8 +507,31 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in | |||||
| return; | return; | ||||
| } | } | ||||
| const Point<int> pos (targetComp->getLocalPoint (component, position)); | |||||
| target->filesDropped (files, pos.getX(), pos.getY()); | |||||
| // We'll use an async message to deliver the drop, because if the target decides | |||||
| // to run a modal loop, it can gum-up the operating system.. | |||||
| class AsyncFileDropMessage : public CallbackMessage | |||||
| { | |||||
| public: | |||||
| AsyncFileDropMessage (Component* target_, const Point<int>& position_, const StringArray& files_) | |||||
| : target (target_), position (position_), files (files_) | |||||
| { | |||||
| } | |||||
| void messageCallback() | |||||
| { | |||||
| if (target != 0) | |||||
| target->filesDropped (files, position.getX(), position.getY()); | |||||
| } | |||||
| private: | |||||
| Component::SafePointer<Component> target; | |||||
| Point<int> position; | |||||
| StringArray files; | |||||
| JUCE_DECLARE_NON_COPYABLE (AsyncFileDropMessage); | |||||
| }; | |||||
| (new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post(); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -62,25 +62,6 @@ void DialogWindow::resized() | |||||
| //============================================================================== | //============================================================================== | ||||
| class TempDialogWindow : public DialogWindow | |||||
| { | |||||
| public: | |||||
| TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
| : DialogWindow (title, colour, escapeCloses, true) | |||||
| { | |||||
| if (! JUCEApplication::isStandaloneApp()) | |||||
| setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
| } | |||||
| void closeButtonPressed() | |||||
| { | |||||
| setVisible (false); | |||||
| } | |||||
| private: | |||||
| JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
| }; | |||||
| int DialogWindow::showModalDialog (const String& dialogTitle, | int DialogWindow::showModalDialog (const String& dialogTitle, | ||||
| Component* contentComponent, | Component* contentComponent, | ||||
| Component* componentToCentreAround, | Component* componentToCentreAround, | ||||
| @@ -89,6 +70,25 @@ int DialogWindow::showModalDialog (const String& dialogTitle, | |||||
| const bool shouldBeResizable, | const bool shouldBeResizable, | ||||
| const bool useBottomRightCornerResizer) | const bool useBottomRightCornerResizer) | ||||
| { | { | ||||
| class TempDialogWindow : public DialogWindow | |||||
| { | |||||
| public: | |||||
| TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
| : DialogWindow (title, colour, escapeCloses, true) | |||||
| { | |||||
| if (! JUCEApplication::isStandaloneApp()) | |||||
| setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
| } | |||||
| void closeButtonPressed() | |||||
| { | |||||
| setVisible (false); | |||||
| } | |||||
| private: | |||||
| JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
| }; | |||||
| TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | ||||
| dw.setContentComponent (contentComponent, true, true); | dw.setContentComponent (contentComponent, true, true); | ||||
| @@ -246,7 +246,6 @@ public: | |||||
| ValueTree getMarkerListCreating (bool xAxis, UndoManager* undoManager); | ValueTree getMarkerListCreating (bool xAxis, UndoManager* undoManager); | ||||
| }; | }; | ||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| RelativeParallelogram bounds; | RelativeParallelogram bounds; | ||||
| @@ -43,8 +43,6 @@ BEGIN_JUCE_NAMESPACE | |||||
| //============================================================================== | //============================================================================== | ||||
| // internal helper object that holds the zlib structures so they don't have to be | |||||
| // included publicly. | |||||
| class GZIPCompressorOutputStream::GZIPCompressorHelper | class GZIPCompressorOutputStream::GZIPCompressorHelper | ||||
| { | { | ||||
| public: | public: | ||||
| @@ -130,7 +128,6 @@ public: | |||||
| bool finished, shouldFinish; | bool finished, shouldFinish; | ||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| GZIPCompressorOutputStream::GZIPCompressorOutputStream (OutputStream* const destStream_, | GZIPCompressorOutputStream::GZIPCompressorOutputStream (OutputStream* const destStream_, | ||||
| int compressionLevel, | int compressionLevel, | ||||
| @@ -184,11 +181,7 @@ bool GZIPCompressorOutputStream::write (const void* destBuffer, int howMany) | |||||
| bool GZIPCompressorOutputStream::doNextBlock() | bool GZIPCompressorOutputStream::doNextBlock() | ||||
| { | { | ||||
| const int len = helper->doNextBlock (buffer, (int) GZIPCompressorHelper::gzipCompBufferSize); | const int len = helper->doNextBlock (buffer, (int) GZIPCompressorHelper::gzipCompBufferSize); | ||||
| if (len > 0) | |||||
| return destStream->write (buffer, len); | |||||
| else | |||||
| return true; | |||||
| return len <= 0 || destStream->write (buffer, len); | |||||
| } | } | ||||
| int64 GZIPCompressorOutputStream::getPosition() | int64 GZIPCompressorOutputStream::getPosition() | ||||
| @@ -185,10 +185,10 @@ double Time::getMillisecondCounterHiRes() throw() | |||||
| bool Time::setSystemTimeToThisTime() const | bool Time::setSystemTimeToThisTime() const | ||||
| { | { | ||||
| timeval t; | timeval t; | ||||
| t.tv_sec = millisSinceEpoch % 1000000; | |||||
| t.tv_usec = millisSinceEpoch - t.tv_sec; | |||||
| t.tv_sec = millisSinceEpoch / 1000; | |||||
| t.tv_usec = (millisSinceEpoch - t.tv_sec * 1000) * 1000; | |||||
| return settimeofday (&t, 0) ? false : true; | |||||
| return settimeofday (&t, 0) == 0; | |||||
| } | } | ||||
| @@ -1504,12 +1504,12 @@ BOOL NSViewComponentPeer::sendDragCallback (int type, id <NSDraggingInfo> sender | |||||
| NSPoint p = [view convertPoint: [sender draggingLocation] fromView: nil]; | NSPoint p = [view convertPoint: [sender draggingLocation] fromView: nil]; | ||||
| const Point<int> pos ((int) p.x, (int) ([view frame].size.height - p.y)); | const Point<int> pos ((int) p.x, (int) ([view frame].size.height - p.y)); | ||||
| StringArray files; | |||||
| id list = [[sender draggingPasteboard] propertyListForType: bestType]; | id list = [[sender draggingPasteboard] propertyListForType: bestType]; | ||||
| if (list == nil) | if (list == nil) | ||||
| return false; | return false; | ||||
| StringArray files; | |||||
| if ([list isKindOfClass: [NSArray class]]) | if ([list isKindOfClass: [NSArray class]]) | ||||
| { | { | ||||
| NSArray* items = (NSArray*) list; | NSArray* items = (NSArray*) list; | ||||
| @@ -1850,8 +1850,6 @@ private: | |||||
| { | { | ||||
| } | } | ||||
| ~JuceDropTarget() {} | |||||
| HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) | HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) | ||||
| { | { | ||||
| updateFileList (pDataObject); | updateFileList (pDataObject); | ||||