From 5093ecbc84e5c296b436251bab40742b76ea2b67 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Tue, 27 Apr 2010 19:19:18 +0100 Subject: [PATCH] Minor clean-ups. Jucer development. --- .../JuceLibraryCode/BinaryData.cpp | 36 +- .../JuceLibraryCode/BinaryData.h | 4 +- .../Source/jucer_Headers.h | 3 +- .../Source/jucer_Main.cpp | 2 +- .../model/Component Types/jucer_ComboBox.h | 2 +- .../jucer_ComponentTypeManager.cpp | 4 +- .../jucer_ComponentTypeManager.h | 2 +- .../Component Types/jucer_ComponentTypes.h | 2 +- .../Component Types/jucer_GenericComponent.h | 2 +- .../Component Types/jucer_GroupComponent.h | 2 +- .../Component Types/jucer_JucerComponent.h | 2 +- .../model/Component Types/jucer_Label.h | 2 +- .../model/Component Types/jucer_Slider.h | 2 +- .../Component Types/jucer_TabbedComponent.h | 2 +- .../model/Component Types/jucer_TextButton.h | 2 +- .../model/Component Types/jucer_TextEditor.h | 2 +- .../Component Types/jucer_ToggleButton.h | 2 +- .../model/Component Types/jucer_Viewport.h | 2 +- .../Source/model/jucer_CodeGenerator.cpp | 280 ++++++----- .../Source/model/jucer_CodeGenerator.h | 43 +- .../Source/model/jucer_ComponentDocument.cpp | 58 ++- .../Source/model/jucer_ComponentDocument.h | 14 +- .../Source/model/jucer_Coordinate.cpp | 2 +- .../Source/model/jucer_Coordinate.h | 2 +- .../Source/model/jucer_DrawableDocument.cpp | 2 +- .../Source/model/jucer_DrawableDocument.h | 2 +- .../Source/model/jucer_NewFileWizard.cpp | 2 +- .../Source/model/jucer_NewFileWizard.h | 2 +- .../Source/model/jucer_Project.cpp | 2 +- .../Source/model/jucer_Project.h | 2 +- .../Source/model/jucer_ProjectExport_MSVC.h | 2 +- .../Source/model/jucer_ProjectExport_Make.h | 2 +- .../Source/model/jucer_ProjectExport_XCode.h | 2 +- .../Source/model/jucer_ProjectExporter.cpp | 2 +- .../Source/model/jucer_ProjectExporter.h | 2 +- .../Source/model/jucer_ProjectSaver.h | 2 +- .../Source/model/jucer_ProjectWizard.cpp | 2 +- .../Source/model/jucer_ProjectWizard.h | 2 +- .../Source/model/jucer_ResourceFile.cpp | 2 +- .../Source/model/jucer_ResourceFile.h | 2 +- .../templates/jucer_ComponentTemplate.cpp | 23 +- .../templates/jucer_ComponentTemplate.h | 11 +- .../jucer_ComponentDragOperation.h | 2 +- .../jucer_ComponentEditor.cpp | 451 +++++++++++++++++- .../Component Editor/jucer_ComponentEditor.h | 5 +- .../jucer_ComponentEditorCanvas.cpp | 204 ++++---- .../jucer_ComponentEditorCanvas.h | 16 +- .../Drawable Editor/jucer_DrawableEditor.cpp | 2 +- .../ui/Drawable Editor/jucer_DrawableEditor.h | 2 +- .../jucer_DrawableObjectComponent.h | 2 +- .../jucer_DrawableTreeViewItem.h | 2 +- .../Source/ui/jucer_CommandIDs.h | 6 +- .../ui/jucer_CoordinatePropertyComponent.h | 2 +- .../ui/jucer_DocumentEditorComponent.cpp | 2 +- .../Source/ui/jucer_DocumentEditorComponent.h | 2 +- .../ui/jucer_GroupInformationComponent.cpp | 2 +- .../ui/jucer_GroupInformationComponent.h | 2 +- .../Source/ui/jucer_ItemPreviewComponent.cpp | 2 +- .../Source/ui/jucer_ItemPreviewComponent.h | 2 +- .../Source/ui/jucer_JucerTreeViewBase.cpp | 2 +- .../Source/ui/jucer_JucerTreeViewBase.h | 4 +- .../Source/ui/jucer_MainWindow.cpp | 17 +- .../Source/ui/jucer_MainWindow.h | 2 +- .../Source/ui/jucer_OpenDocumentManager.cpp | 2 +- .../Source/ui/jucer_OpenDocumentManager.h | 2 +- .../ui/jucer_ProjectContentComponent.cpp | 2 +- .../Source/ui/jucer_ProjectContentComponent.h | 2 +- .../Source/ui/jucer_ProjectTreeViewBase.cpp | 2 +- .../Source/ui/jucer_ProjectTreeViewBase.h | 2 +- .../Source/ui/jucer_SourceCodeEditor.cpp | 2 +- .../Source/ui/jucer_SourceCodeEditor.h | 2 +- .../Source/ui/jucer_TreeViewTypes.cpp | 2 +- .../Source/ui/jucer_TreeViewTypes.h | 2 +- .../utility/jucer_ColourEditorComponent.h | 2 +- .../Source/utility/jucer_Colours.h | 2 +- .../Source/utility/jucer_RelativePath.h | 2 +- .../Source/utility/jucer_StoredSettings.cpp | 2 +- .../Source/utility/jucer_StoredSettings.h | 2 +- .../Source/utility/jucer_UtilityFunctions.cpp | 2 +- .../Source/utility/jucer_UtilityFunctions.h | 2 +- .../utility/jucer_ValueRemapperSource.h | 2 +- juce_amalgamated.cpp | 156 +++--- juce_amalgamated.h | 99 ++-- .../mouse/juce_DragAndDropContainer.cpp | 5 +- src/gui/components/mouse/juce_MouseCursor.cpp | 4 +- src/gui/components/mouse/juce_MouseCursor.h | 4 +- .../special/juce_ColourSelector.cpp | 2 +- .../special/juce_MidiKeyboardComponent.cpp | 2 +- .../special/juce_MidiKeyboardComponent.h | 2 +- .../components/windows/juce_ComponentPeer.cpp | 7 +- .../components/windows/juce_ComponentPeer.h | 7 +- .../windows/juce_TopLevelWindow.cpp | 8 +- .../components/windows/juce_TopLevelWindow.h | 2 +- .../graphics/colour/juce_ColourGradient.cpp | 10 +- src/gui/graphics/colour/juce_ColourGradient.h | 10 +- src/gui/graphics/contexts/juce_FillType.cpp | 8 +- src/gui/graphics/contexts/juce_FillType.h | 8 +- src/gui/graphics/drawables/juce_Drawable.cpp | 2 +- src/gui/graphics/drawables/juce_Drawable.h | 4 +- .../drawables/juce_DrawableComposite.cpp | 4 +- .../drawables/juce_DrawableComposite.h | 4 +- .../graphics/drawables/juce_DrawableImage.cpp | 4 +- .../graphics/drawables/juce_DrawableImage.h | 4 +- .../graphics/drawables/juce_DrawablePath.cpp | 14 +- .../graphics/drawables/juce_DrawablePath.h | 14 +- .../graphics/drawables/juce_DrawableText.cpp | 5 +- .../graphics/drawables/juce_DrawableText.h | 4 +- .../graphics/geometry/juce_RectangleList.cpp | 36 +- .../graphics/geometry/juce_RectangleList.h | 36 +- src/native/mac/juce_mac_MiscUtilities.mm | 2 +- src/native/windows/juce_win32_ASIO.cpp | 24 +- src/native/windows/juce_win32_Fonts.cpp | 8 +- src/native/windows/juce_win32_Midi.cpp | 12 +- 113 files changed, 1181 insertions(+), 637 deletions(-) diff --git a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp index f1ed9b676e..a116b11e19 100644 --- a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp +++ b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp @@ -425,24 +425,21 @@ static const unsigned char temp_73015554[] = "\r\n" " This is an automatically generated file created by the Jucer!\r\n" "\r\n" -" Creation date: %%creationTime%%\r\n" -"\r\n" " Be careful when adding custom code to these files, as only the code within\r\n" " the \"//[xyz]\" and \"//[/xyz]\" sections will be retained when the file is loaded\r\n" " and re-saved.\r\n" "\r\n" -" Jucer version: 1.12\r\n" +" Created for JUCE version: %%juceVersion%%\r\n" "\r\n" " ------------------------------------------------------------------------------\r\n" "\r\n" -" The Jucer is part of the JUCE library - \"Jules' Utility Class Extensions\"\r\n" -" Copyright 2004-6 by Raw Material Software ltd.\r\n" +" JUCE and the Jucer are copyright 2004-10 by Raw Material Software ltd.\r\n" "\r\n" " ==============================================================================\r\n" "*/\r\n" "\r\n" -"//[Headers] You can add your own extra header files here...\r\n" -"//[/Headers]\r\n" +"//[CppHeaders] You can add your own extra header files here...\r\n" +"//[/CppHeaders]\r\n" "\r\n" "%%includeFilesCPP%%\r\n" "\r\n" @@ -475,21 +472,17 @@ static const unsigned char temp_73015554[] = "//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...\r\n" "//[/MiscUserCode]\r\n" "\r\n" +"%%staticMemberDefinitions%%\r\n" "\r\n" "//==============================================================================\r\n" +"//======================= Jucer Information Section ==========================\r\n" +"//==============================================================================\r\n" "#if 0\r\n" -"/* -- Jucer information section --\r\n" -"\r\n" -" This is where the Jucer puts all of its metadata, so don't change anything in here!\r\n" -"\r\n" -"BEGIN_JUCER_METADATA\r\n" +"/* This section stores the Jucer's metadata - edit it at your own risk!\r\n" "\r\n" "%%metadata%%\r\n" -"END_JUCER_METADATA\r\n" "*/\r\n" -"#endif\r\n" -"\r\n" -"%%staticMemberDefinitions%%\r\n"; +"#endif\r\n"; const char* BinaryData::jucer_ComponentTemplate_cpp = (const char*) temp_73015554; @@ -500,18 +493,15 @@ static const unsigned char temp_b930c59[] = "\r\n" " This is an automatically generated file created by the Jucer!\r\n" "\r\n" -" Creation date: %%creationTime%%\r\n" -"\r\n" " Be careful when adding custom code to these files, as only the code within\r\n" " the \"//[xyz]\" and \"//[/xyz]\" sections will be retained when the file is loaded\r\n" " and re-saved.\r\n" "\r\n" -" Jucer version: 1.12\r\n" +" Created for JUCE version: %%juceVersion%%\r\n" "\r\n" " ------------------------------------------------------------------------------\r\n" "\r\n" -" The Jucer is part of the JUCE library - \"Jules' Utility Class Extensions\"\r\n" -" Copyright 2004-6 by Raw Material Software ltd.\r\n" +" JUCE and the Jucer are copyright 2004-10 by Raw Material Software ltd.\r\n" "\r\n" " ==============================================================================\r\n" "*/\r\n" @@ -520,7 +510,7 @@ static const unsigned char temp_b930c59[] = "#define %%headerGuard%%\r\n" "\r\n" "//[Headers] -- You can add your own extra header files here --\r\n" -"#include \"juce.h\"\r\n" +"%%defaultJuceInclude%%\r\n" "//[/Headers]\r\n" "\r\n" "%%includeFilesH%%\r\n" @@ -559,7 +549,7 @@ static const unsigned char temp_b930c59[] = " //==============================================================================\r\n" " // (prevent copy constructor and operator= being generated..)\r\n" " %%className%% (const %%className%%&);\r\n" -" const %%className%%& operator= (const %%className%%&);\r\n" +" %%className%%& operator= (const %%className%%&);\r\n" "};\r\n" "\r\n" "\r\n" diff --git a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h index e68f279930..67628d7b00 100644 --- a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h +++ b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h @@ -23,10 +23,10 @@ namespace BinaryData const int jucer_AudioPluginFilterTemplate_hSize = 2353; extern const char* jucer_ComponentTemplate_cpp; - const int jucer_ComponentTemplate_cppSize = 1975; + const int jucer_ComponentTemplate_cppSize = 1976; extern const char* jucer_ComponentTemplate_h; - const int jucer_ComponentTemplate_hSize = 2309; + const int jucer_ComponentTemplate_hSize = 2239; extern const char* jucer_MainConsoleAppTemplate_cpp; const int jucer_MainConsoleAppTemplate_cppSize = 749; diff --git a/extras/Jucer (experimental)/Source/jucer_Headers.h b/extras/Jucer (experimental)/Source/jucer_Headers.h index be75c35f18..79ea6e04b2 100644 --- a/extras/Jucer (experimental)/Source/jucer_Headers.h +++ b/extras/Jucer (experimental)/Source/jucer_Headers.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -47,6 +47,7 @@ static const char* const newLine = "\r\n"; const char* const projectItemDragType = "Project Items"; const char* const drawableItemDragType = "Drawable Items"; +const char* const componentItemDragType = "Components"; const char* const textFileExtensions = "cpp;h;hpp;mm;m;c;txt;xml;plist;rtf;html;htm;php;py;rb;cs"; const char* const sourceFileExtensions = "cpp;mm;m;c;h;hpp"; diff --git a/extras/Jucer (experimental)/Source/jucer_Main.cpp b/extras/Jucer (experimental)/Source/jucer_Main.cpp index 685468d1eb..9925928a4b 100644 --- a/extras/Jucer (experimental)/Source/jucer_Main.cpp +++ b/extras/Jucer (experimental)/Source/jucer_Main.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComboBox.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComboBox.h index f9e937e27b..fdec0b688f 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComboBox.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComboBox.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.cpp b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.cpp index ddde0581a2..17c6d833e7 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.cpp +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -205,7 +205,7 @@ public: ~CompMemberNameValueSource() {} void valueChanged (Value&) { sendChangeMessage (true); } - const var getValue() const { return sourceValue.toString(); } + const var getValue() const { return sourceValue.toString(); } void setValue (const var& newValue) { diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.h index 550f2f95e4..3b0a73b362 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypeManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypes.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypes.h index 55035fe647..7657365224 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypes.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ComponentTypes.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_GenericComponent.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_GenericComponent.h index 1d715be157..fdb1e8b82c 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_GenericComponent.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_GenericComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_GroupComponent.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_GroupComponent.h index e4e7231ac8..ac7be87566 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_GroupComponent.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_GroupComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_JucerComponent.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_JucerComponent.h index 9886a2a0b2..a9a1151fdd 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_JucerComponent.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_JucerComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_Label.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_Label.h index bf78bd693c..dc09109332 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_Label.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_Label.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_Slider.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_Slider.h index 8ed0222d7c..72d57f56db 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_Slider.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_Slider.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_TabbedComponent.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_TabbedComponent.h index 21dc3b293c..b45aeb0e52 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_TabbedComponent.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_TabbedComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextButton.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextButton.h index 072b6623b9..83e5126a67 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextButton.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextEditor.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextEditor.h index 1099d91883..8b3d79f101 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextEditor.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_TextEditor.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ToggleButton.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ToggleButton.h index aeee91e3cd..a003510f2f 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_ToggleButton.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_ToggleButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/Component Types/jucer_Viewport.h b/extras/Jucer (experimental)/Source/model/Component Types/jucer_Viewport.h index 82d0897536..0efcb68aef 100644 --- a/extras/Jucer (experimental)/Source/model/Component Types/jucer_Viewport.h +++ b/extras/Jucer (experimental)/Source/model/Component Types/jucer_Viewport.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.cpp b/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.cpp index a77910f30e..007b902a68 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -86,29 +86,6 @@ void CodeGenerator::removeCallback (const String& returnType, const String& prot } } -void CodeGenerator::addImageResourceLoader (const String& imageMemberName, const String& resourceName) -{ - const String initialiser (imageMemberName + " (0)"); - - if (! memberInitialisers.contains (initialiser, false)) - { - memberInitialisers.add (initialiser); - - privateMemberDeclarations - << "Image* " << imageMemberName << ";" << newLine; - - if (resourceName.isNotEmpty()) - { - constructorCode - << imageMemberName << " = ImageCache::getFromMemory (" - << resourceName << ", " << resourceName << "Size);" << newLine; - - destructorCode - << "ImageCache::release (" << imageMemberName << ");" << newLine; - } - } -} - const StringArray CodeGenerator::getExtraParentClasses() const { StringArray s; @@ -189,16 +166,15 @@ const String CodeGenerator::getClassDeclaration() const if (parentClassLines.contains ("public Button", false)) parentClassLines.removeString ("public Component", false); - String r ("class "); - r << className << " : "; - - r += parentClassLines.joinIntoString ("," + String (newLine) + String::repeatedString (" ", r.length())); - + String r; + r << "class " << className << " : "; + r << parentClassLines.joinIntoString ("," + String (newLine) + String::repeatedString (" ", r.length())); return r; } const String CodeGenerator::getInitialiserList() const { + String s; StringArray inits (memberInitialisers); if (parentClassInitialiser.isNotEmpty()) @@ -208,26 +184,24 @@ const String CodeGenerator::getInitialiserList() const inits.removeEmptyStrings(); inits.removeDuplicates (false); - String s; - - if (inits.size() == 0) - return s; - - s << " : "; - - for (int i = 0; i < inits.size(); ++i) + if (inits.size() > 0) { - String init (inits[i]); + s << " : "; - while (init.endsWithChar (',')) - init = init.dropLastCharacters (1); + for (int i = 0; i < inits.size(); ++i) + { + String init (inits[i]); - s << init; + while (init.endsWithChar (',')) + init = init.dropLastCharacters (1); - if (i < inits.size() - 1) - s << "," << newLine << " "; - else - s << newLine; + s << init; + + if (i < inits.size() - 1) + s << "," << newLine << " "; + else + s << newLine; + } } return s; @@ -263,56 +237,6 @@ static bool getUserSection (const StringArray& lines, const String& tag, StringA return true; } -static void copyAcrossUserSections (String& dest, const String& src) -{ - StringArray srcLines, dstLines; - srcLines.addLines (src); - dstLines.addLines (dest); - - for (int i = 0; i < dstLines.size(); ++i) - { - if (dstLines[i].trimStart().startsWith ("//[")) - { - String tag (dstLines[i].trimStart().substring (3)); - tag = tag.upToFirstOccurrenceOf ("]", false, false); - - jassert (! tag.startsWithChar ('/')); - - if (! tag.startsWithChar ('/')) - { - const int endLine = indexOfLineStartingWith (dstLines, - "//[/" + tag + "]", - i + 1); - - if (endLine > i) - { - StringArray sourceLines; - - if (getUserSection (srcLines, tag, sourceLines)) - { - int j; - for (j = endLine - i; --j > 0;) - dstLines.remove (i + 1); - - for (j = 0; j < sourceLines.size(); ++j) - dstLines.insert (++i, sourceLines [j].trimEnd()); - - ++i; - } - else - { - i = endLine; - } - } - } - } - - dstLines.set (i, dstLines[i].trimEnd()); - } - - dest = dstLines.joinIntoString (newLine) + newLine; -} - //============================================================================== static void replaceTemplate (String& text, const String& itemName, const String& value) { @@ -339,20 +263,11 @@ static void replaceTemplate (String& text, const String& itemName, const String& } //============================================================================== -void CodeGenerator::applyToCode (String& code, - const String& fileNameRoot, - const bool isForPreview, - const String& oldFileWithUserData) const +void CodeGenerator::applyToCode (String& code, const File& targetFile, + bool isForPreview, Project* project) const { - // header guard.. - String headerGuard ("__JUCER_HEADER_"); - headerGuard << className.toUpperCase().retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZ") - << "_" << fileNameRoot.toUpperCase().retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZ") - << "_" << String::toHexString (Random::getSystemRandom().nextInt()).toUpperCase() << "__"; - - replaceTemplate (code, "headerGuard", headerGuard); - - replaceTemplate (code, "creationTime", Time::getCurrentTime().toString (true, true, true)); + replaceTemplate (code, "juceVersion", SystemStats::getJUCEVersion()); + replaceTemplate (code, "headerGuard", makeHeaderGuardName (targetFile)); replaceTemplate (code, "className", className); replaceTemplate (code, "constructorParams", constructorParams); @@ -364,6 +279,11 @@ void CodeGenerator::applyToCode (String& code, replaceTemplate (code, "methodDefinitions", getCallbackDefinitions()); + if (project != 0) + replaceTemplate (code, "defaultJuceInclude", createIncludeStatement (project->getAppIncludeFile(), targetFile)); + else + replaceTemplate (code, "defaultJuceInclude", "#include \"juce_amalgamated.h\""); + replaceTemplate (code, "includeFilesH", getIncludeFileCode (includeFilesH)); replaceTemplate (code, "includeFilesCPP", getIncludeFileCode (includeFilesCPP)); @@ -380,6 +300,146 @@ void CodeGenerator::applyToCode (String& code, replaceTemplate (code, "metadata", " << Metadata isn't shown in the code preview >>" + String (newLine)); replaceTemplate (code, "staticMemberDefinitions", "// Static member declarations and resources would go here... (these aren't shown in the code preview)"); } - - copyAcrossUserSections (code, oldFileWithUserData); } + + +//============================================================================== +CodeGenerator::CustomisedCodeSnippets::CustomisedCodeSnippets() +{ +} + +CodeGenerator::CustomisedCodeSnippets::~CustomisedCodeSnippets() +{ +} + +void CodeGenerator::CustomisedCodeSnippets::reloadFrom (const String& fileContent) +{ + sectionNames.clear(); + sectionContent.clear(); + + StringArray lines; + lines.addLines (fileContent); + + for (int i = 0; i < lines.size(); ++i) + { + if (lines[i].trimStart().startsWith ("//[")) + { + String tag (lines[i].trimStart().substring (3)); + tag = tag.upToFirstOccurrenceOf ("]", false, false).trim(); + + jassert (! (tag.isEmpty() || tag.startsWithChar ('/'))); + + if (! (tag.isEmpty() || tag.startsWithChar ('/'))) + { + const int endLine = indexOfLineStartingWith (lines, "//[/" + tag + "]", i + 1); + + if (endLine > i) + { + String content (lines.joinIntoString (newLine, i + 1, endLine - i - 1)); + + sectionNames.add (tag); + + CodeDocument* doc = new CodeDocument(); + sectionContent.add (doc); + + doc->replaceAllContent (content); + + i = endLine; + } + } + } + } +} + +void CodeGenerator::CustomisedCodeSnippets::applyTo (String& fileContent) const +{ + StringArray lines; + lines.addLines (fileContent); + + for (int i = 0; i < lines.size(); ++i) + { + if (lines[i].trimStart().startsWith ("//[")) + { + String tag (lines[i].trimStart().substring (3)); + tag = tag.upToFirstOccurrenceOf ("]", false, false); + + jassert (! tag.startsWithChar ('/')); + + if (! tag.startsWithChar ('/')) + { + const int endLine = indexOfLineStartingWith (lines, "//[/" + tag + "]", i + 1); + + if (endLine > i) + { + StringArray sourceLines; + sourceLines.addLines (getSectionContent (tag)); + + if (sourceLines.size() > 0) + { + lines.removeRange (i + 1, endLine - i - 1); + + for (int j = 0; j < sourceLines.size(); ++j) + lines.insert (++i, sourceLines [j].trimEnd()); + + ++i; + } + else + { + i = endLine; + } + } + } + } + + lines.set (i, lines[i].trimEnd()); + } + + if (lines[lines.size() - 1].isNotEmpty()) + lines.add (String::empty); + + fileContent = lines.joinIntoString (newLine); +} + +bool CodeGenerator::CustomisedCodeSnippets::areAnySnippetsUnsaved() const +{ + return true; //xxx +} + +CodeDocument* CodeGenerator::CustomisedCodeSnippets::getDocumentFor (const String& sectionName, bool createIfNotFound) +{ + const int index = sectionNames.indexOf (sectionName); + + if (index >= 0) + return sectionContent [index]; + + if (createIfNotFound) + { + sectionNames.add (sectionName); + sectionContent.add (new CodeDocument()); + return sectionContent.getLast(); + } + + return 0; +} + +const String CodeGenerator::CustomisedCodeSnippets::getSectionContent (const String& sectionName) const +{ + const int index = sectionNames.indexOf (sectionName); + + if (index >= 0) + return sectionContent[index]->getAllContent(); + + return String::empty; +} + +void CodeGenerator::CustomisedCodeSnippets::removeSection (const String& sectionName) +{ + const int index = sectionNames.indexOf (sectionName); + + if (index >= 0) + { + sectionNames.remove (index); + sectionContent.remove (index); + } +} + diff --git a/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.h b/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.h index ab8ca80522..99f5d754df 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.h +++ b/extras/Jucer (experimental)/Source/model/jucer_CodeGenerator.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -27,6 +27,7 @@ #define __JUCER_CODEGENERATOR_H_F79AEF58__ #include "../jucer_Headers.h" +#include "jucer_Project.h" //============================================================================== @@ -37,17 +38,8 @@ public: CodeGenerator(); ~CodeGenerator(); - //============================================================================== - void applyToCode (String& codeTemplate, - const String& fileNameRoot, - const bool isForPreview, - const String& oldFileContents) const; - - int getUniqueSuffix(); - //============================================================================== String className; - String componentName; String parentClassInitialiser; // optional parent class initialiser to go before the items in the initialisers list StringArray memberInitialisers; String parentClasses; @@ -75,13 +67,40 @@ public: void removeCallback (const String& returnType, const String& prototype); - void addImageResourceLoader (const String& imageMemberName, const String& resourceName); - const String getCallbackDeclarations() const; const String getCallbackDefinitions() const; const StringArray getExtraParentClasses() const; + int getUniqueSuffix(); + + //============================================================================== + // An object to load and store all the user-defined bits of code as documents. + class CustomisedCodeSnippets + { + public: + CustomisedCodeSnippets(); + ~CustomisedCodeSnippets(); + + void reloadFrom (const String& fileContent); + void applyTo (String& fileContent) const; + bool areAnySnippetsUnsaved() const; + + CodeDocument* getDocumentFor (const String& sectionName, bool createIfNotFound); + const String getSectionContent (const String& sectionName) const; + void removeSection (const String& sectionName); + + private: + StringArray sectionNames; + OwnedArray sectionContent; + }; + + //============================================================================== + void applyToCode (String& codeTemplate, const File& targetFile, + bool isForPreview, Project* project) const; + + private: + //============================================================================== const String getClassDeclaration() const; const String getInitialiserList() const; int suffix; diff --git a/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.cpp b/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.cpp index 377d500672..045d90e944 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -48,7 +48,8 @@ const char* const ComponentDocument::markerPosProperty = "position"; //============================================================================== ComponentDocument::ComponentDocument (Project* project_, const File& cppFile_) - : project (project_), cppFile (cppFile_), + : project (project_), + cppFile (cppFile_), root (componentDocumentTag), changedSinceSaved (false) { @@ -58,6 +59,17 @@ ComponentDocument::ComponentDocument (Project* project_, const File& cppFile_) root.addListener (this); } +ComponentDocument::ComponentDocument (const ComponentDocument& other) + : project (other.project), + cppFile (other.cppFile), + root (other.root.createCopy()), + changedSinceSaved (false) +{ + checkRootObject(); + + root.addListener (this); +} + ComponentDocument::~ComponentDocument() { root.removeListener (this); @@ -104,18 +116,39 @@ bool ComponentDocument::isComponentFile (const File& file) void ComponentDocument::writeCode (OutputStream& cpp, OutputStream& header) { - cpp << "/** */" - << newLine << newLine; + CodeGenerator codeGen; - header << "/** */" - << newLine << newLine; + codeGen.className = getClassName().toString(); + codeGen.parentClasses = "public Component"; + + { + MemoryOutputStream metaData; + writeMetadata (metaData); + codeGen.jucerMetadata = metaData.toUTF8(); + } + + { + String code (BinaryData::jucer_ComponentTemplate_cpp); + String oldContent; + + codeGen.applyToCode (code, cppFile, false, project); + customisedCodeSnippets.applyTo (code); + cpp << code; + } + + { + String code (BinaryData::jucer_ComponentTemplate_h); + String oldContent; + + codeGen.applyToCode (code, cppFile.withFileExtension (".h"), false, project); + customisedCodeSnippets.applyTo (code); + header << code; + } } void ComponentDocument::writeMetadata (OutputStream& out) { - out << "#if 0" << newLine - << "/** Jucer-generated metadata section - Edit this data at own risk!" << newLine - << metadataTagStart << newLine << newLine; + out << metadataTagStart << newLine << newLine; ScopedPointer xml (root.createXml()); jassert (xml != 0); @@ -124,15 +157,13 @@ void ComponentDocument::writeMetadata (OutputStream& out) xml->writeToStream (out, String::empty, false, false); out << newLine - << metadataTagEnd << " */" << newLine - << "#endif" << newLine; + << metadataTagEnd << newLine; } bool ComponentDocument::save() { MemoryOutputStream cpp, header; writeCode (cpp, header); - writeMetadata (cpp); bool savedOk = overwriteFileWithNewDataIfDifferent (cppFile, cpp) && overwriteFileWithNewDataIfDifferent (cppFile.withFileExtension (".h"), header); @@ -192,6 +223,8 @@ bool ComponentDocument::reload() checkRootObject(); undoManager.clearUndoHistory(); changedSinceSaved = false; + + customisedCodeSnippets.reloadFrom (cppFile.loadFileAsString()); return true; } } @@ -523,6 +556,7 @@ ComponentDocument::MarkerList::MarkerList (ComponentDocument& document_, const b group (document_.getRoot().getChildWithName (isX_ ? markersGroupXTag : markersGroupYTag)), isX (isX_) { + jassert (group.isValid()); jassert (group.isAChildOf (document_.getRoot())); } diff --git a/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.h b/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.h index 9af0d4213f..728f7d62c3 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ComponentDocument.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -29,6 +29,7 @@ #include "../jucer_Headers.h" #include "jucer_Project.h" #include "jucer_Coordinate.h" +#include "jucer_CodeGenerator.h" //============================================================================== @@ -38,6 +39,7 @@ class ComponentDocument : public ValueTree::Listener, public: //============================================================================== ComponentDocument (Project* project, const File& cppFile); + ComponentDocument (const ComponentDocument& other); ~ComponentDocument(); static bool isComponentFile (const File& file); @@ -45,6 +47,7 @@ public: bool save(); bool reload(); bool hasChangedSinceLastSave(); + const File getCppFile() const { return cppFile; } //============================================================================== Value getClassName() const { return getRootValueNonUndoable ("className"); } @@ -133,7 +136,12 @@ public: void endDrag (const MouseEvent& e); //============================================================================== - ValueTree& getRoot() { return root; } + CodeGenerator::CustomisedCodeSnippets& getCustomisedCodeSnippets() throw() { return customisedCodeSnippets; } + + //============================================================================== + ValueTree& getRoot() { return root; } + ValueTree getComponentGroup() const; + UndoManager* getUndoManager() const; void beginNewTransaction(); @@ -156,12 +164,12 @@ private: File cppFile; ValueTree root; ScopedPointer markersX, markersY; + CodeGenerator::CustomisedCodeSnippets customisedCodeSnippets; mutable UndoManager undoManager; bool changedSinceSaved; void checkRootObject(); void createSubTreeIfNotThere (const String& name); - ValueTree getComponentGroup() const; void addMarkerMenuItem (int i, const Coordinate& coord, const String& name, PopupMenu& menu, bool isAnchor1, const String& fullCoordName); diff --git a/extras/Jucer (experimental)/Source/model/jucer_Coordinate.cpp b/extras/Jucer (experimental)/Source/model/jucer_Coordinate.cpp index 917716b8da..97a56378a5 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_Coordinate.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_Coordinate.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_Coordinate.h b/extras/Jucer (experimental)/Source/model/jucer_Coordinate.h index 29204b2469..0bbff1a7ea 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_Coordinate.h +++ b/extras/Jucer (experimental)/Source/model/jucer_Coordinate.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.cpp b/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.cpp index 2f3160bedc..6b763424b5 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.h b/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.h index 09ef86cc98..540d06b512 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.h +++ b/extras/Jucer (experimental)/Source/model/jucer_DrawableDocument.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp b/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp index 84126cefdc..f991f63a99 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.h b/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.h index 047e074962..8469f3baee 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.h +++ b/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_Project.cpp b/extras/Jucer (experimental)/Source/model/jucer_Project.cpp index aa8841aef0..bcebf3c15f 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_Project.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_Project.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_Project.h b/extras/Jucer (experimental)/Source/model/jucer_Project.h index e671af046c..100724deb5 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_Project.h +++ b/extras/Jucer (experimental)/Source/model/jucer_Project.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_MSVC.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_MSVC.h index 00a51ce8d5..2ebcfa8b1d 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_MSVC.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_MSVC.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h index db78a6d3d8..a408170c66 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h index ea82f71820..6c2fa12981 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.cpp b/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.cpp index bb835a8c12..f4939d236f 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.h index 3332bb148d..550291b98c 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectExporter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h index 7bed928fb4..1d70cc7aa9 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.cpp b/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.cpp index 8acba7c374..618483d16a 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.h index ae65b44272..1a5c850710 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectWizard.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp b/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp index 6b00cae13e..09ace75b59 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.h b/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.h index efb551197c..b3745c3f29 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.cpp b/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.cpp index 28a72216c0..14ed7e765b 100644 --- a/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.cpp +++ b/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.cpp @@ -3,24 +3,21 @@ This is an automatically generated file created by the Jucer! - Creation date: %%creationTime%% - Be careful when adding custom code to these files, as only the code within the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded and re-saved. - Jucer version: 1.12 + Created for JUCE version: %%juceVersion%% ------------------------------------------------------------------------------ - The Jucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-6 by Raw Material Software ltd. + JUCE and the Jucer are copyright 2004-10 by Raw Material Software ltd. ============================================================================== */ -//[Headers] You can add your own extra header files here... -//[/Headers] +//[CppHeaders] You can add your own extra header files here... +//[/CppHeaders] %%includeFilesCPP%% @@ -53,18 +50,14 @@ //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... //[/MiscUserCode] +%%staticMemberDefinitions%% +//============================================================================== +//======================= Jucer Information Section ========================== //============================================================================== #if 0 -/* -- Jucer information section -- - - This is where the Jucer puts all of its metadata, so don't change anything in here! - -BEGIN_JUCER_METADATA +/* This section stores the Jucer's metadata - edit it at your own risk! %%metadata%% -END_JUCER_METADATA */ #endif - -%%staticMemberDefinitions%% diff --git a/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.h b/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.h index 210d2372b0..fcb197e0af 100644 --- a/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.h +++ b/extras/Jucer (experimental)/Source/templates/jucer_ComponentTemplate.h @@ -3,18 +3,15 @@ This is an automatically generated file created by the Jucer! - Creation date: %%creationTime%% - Be careful when adding custom code to these files, as only the code within the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded and re-saved. - Jucer version: 1.12 + Created for JUCE version: %%juceVersion%% ------------------------------------------------------------------------------ - The Jucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-6 by Raw Material Software ltd. + JUCE and the Jucer are copyright 2004-10 by Raw Material Software ltd. ============================================================================== */ @@ -23,7 +20,7 @@ #define %%headerGuard%% //[Headers] -- You can add your own extra header files here -- -#include "juce.h" +%%defaultJuceInclude%% //[/Headers] %%includeFilesH%% @@ -62,7 +59,7 @@ private: //============================================================================== // (prevent copy constructor and operator= being generated..) %%className%% (const %%className%%&); - const %%className%%& operator= (const %%className%%&); + %%className%%& operator= (const %%className%%&); }; diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentDragOperation.h b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentDragOperation.h index f9632a07f9..34e4f57897 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentDragOperation.h +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentDragOperation.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp index 486a140513..911575eb40 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -25,8 +25,289 @@ #include "../../jucer_Headers.h" #include "jucer_ComponentEditor.h" +#include "../jucer_JucerTreeViewBase.h" +//============================================================================== +namespace ComponentTree +{ + //============================================================================== + class Base : public JucerTreeViewBase, + public ValueTree::Listener, + public ChangeListener + { + public: + Base (ComponentEditor& editor_) + : editor (editor_) + { + editor.getCanvas()->getSelection().addChangeListener (this); + } + + ~Base() + { + editor.getCanvas()->getSelection().removeChangeListener (this); + } + + //============================================================================== + void valueTreePropertyChanged (ValueTree& tree, const var::identifier& property) {} + void valueTreeParentChanged (ValueTree& tree) {} + void valueTreeChildrenChanged (ValueTree& tree) {} + + const String getUniqueName() const + { + jassert (getItemId().isNotEmpty()); + return getItemId(); + } + + //============================================================================== + void itemOpennessChanged (bool isNowOpen) + { + if (isNowOpen) + refreshSubItems(); + } + + virtual void refreshSubItems() = 0; + virtual const String getItemId() const = 0; + + void setName (const String& newName) {} + + void itemClicked (const MouseEvent& e) {} + void itemDoubleClicked (const MouseEvent& e) {} + + void itemSelectionChanged (bool isNowSelected) + { + if (isNowSelected) + editor.getCanvas()->getSelection().addToSelection (getItemId()); + else + editor.getCanvas()->getSelection().deselect (getItemId()); + } + + void changeListenerCallback (void*) { updateSelectionState(); } + + void updateSelectionState() + { + setSelected (editor.getCanvas()->getSelection().isSelected (getItemId()), false); + } + + bool isMissing() { return false; } + const String getTooltip() { return String::empty; } + + protected: + //============================================================================== + ComponentEditor& editor; + }; + + + //============================================================================== + class ComponentItem : public Base + { + public: + ComponentItem (ComponentEditor& editor_, const ValueTree& componentState_) + : Base (editor_), componentState (componentState_) + { + componentState.addListener (this); + updateSelectionState(); + } + + ~ComponentItem() + { + componentState.removeListener (this); + } + + //============================================================================== + const String getItemId() const { return componentState [ComponentDocument::idProperty]; } + + bool mightContainSubItems() { return false; } + void refreshSubItems() {} + + const String getDisplayName() const { return getRenamingName(); } + const String getRenamingName() const { return componentState [ComponentDocument::memberNameProperty]; } + + Image* getIcon() const { return LookAndFeel::getDefaultLookAndFeel().getDefaultDocumentFileImage(); } + + const String getDragSourceDescription() { return componentItemDragType; } + + void valueTreePropertyChanged (ValueTree& tree, const var::identifier& property) + { + if (property == ComponentDocument::memberNameProperty) + repaintItem(); + } + + private: + //============================================================================== + ValueTree componentState; + }; + + //============================================================================== + class ComponentList : public Base + { + public: + ComponentList (ComponentEditor& editor_) + : Base (editor_), componentTree (editor.getDocument().getComponentGroup()) + { + componentTree.addListener (this); + } + + ~ComponentList() + { + componentTree.removeListener (this); + } + + //============================================================================== + const String getItemId() const { return "components"; } + bool mightContainSubItems() { return true; } + + void valueTreeChildrenChanged (ValueTree& tree) + { + if (tree == componentTree) + refreshSubItems(); + } + + void refreshSubItems() + { + ScopedPointer openness (getOpennessState()); + clearSubItems(); + + ComponentDocument& doc = editor.getDocument(); + + const int num = doc.getNumComponents(); + for (int i = 0; i < num; ++i) + addSubItem (new ComponentItem (editor, doc.getComponent (i))); + + if (openness != 0) + restoreOpennessState (*openness); + } + + const String getDisplayName() const { return getRenamingName(); } + const String getRenamingName() const { return "Components"; } + Image* getIcon() const { return LookAndFeel::getDefaultLookAndFeel().getDefaultFolderImage(); } + const String getDragSourceDescription() { return String::empty; } + + private: + ValueTree componentTree; + }; + + + //============================================================================== + class MarkerItem : public Base + { + public: + MarkerItem (ComponentEditor& editor_, const ValueTree& markerState_) + : Base (editor_), markerState (markerState_) + { + markerState.addListener (this); + updateSelectionState(); + } + + ~MarkerItem() + { + markerState.removeListener (this); + } + + //============================================================================== + const String getItemId() const { return markerState [ComponentDocument::idProperty]; } + + bool mightContainSubItems() { return false; } + void refreshSubItems() {} + + const String getDisplayName() const { return getRenamingName(); } + const String getRenamingName() const { return markerState [ComponentDocument::markerNameProperty]; } + + Image* getIcon() const { return LookAndFeel::getDefaultLookAndFeel().getDefaultDocumentFileImage(); } + + const String getDragSourceDescription() { return componentItemDragType; } + + void valueTreePropertyChanged (ValueTree& tree, const var::identifier& property) + { + if (property == ComponentDocument::markerNameProperty) + repaintItem(); + } + + private: + //============================================================================== + ValueTree markerState; + }; + + //============================================================================== + class MarkerList : public Base + { + public: + MarkerList (ComponentEditor& editor_, bool isX_) + : Base (editor_), markerList (editor_.getDocument().getMarkerList (isX_).getGroup()), isX (isX_) + { + markerList.addListener (this); + } + + ~MarkerList() + { + markerList.removeListener (this); + } + + //============================================================================== + const String getItemId() const { return isX ? "markersX" : "markersY"; } + bool mightContainSubItems() { return true; } + + void valueTreeChildrenChanged (ValueTree& tree) + { + refreshSubItems(); + } + + void refreshSubItems() + { + ScopedPointer openness (getOpennessState()); + clearSubItems(); + + ComponentDocument::MarkerList& markers = editor.getDocument().getMarkerList (isX); + + const int num = markers.size(); + for (int i = 0; i < num; ++i) + addSubItem (new MarkerItem (editor, markers.getMarker (i))); + + if (openness != 0) + restoreOpennessState (*openness); + } + + const String getDisplayName() const { return getRenamingName(); } + const String getRenamingName() const { return isX ? "Markers (X-axis)" : "Markers (Y-axis)"; } + Image* getIcon() const { return LookAndFeel::getDefaultLookAndFeel().getDefaultFolderImage(); } + const String getDragSourceDescription() { return String::empty; } + + private: + ValueTree markerList; + bool isX; + }; + + //============================================================================== + class Root : public Base + { + public: + Root (ComponentEditor& editor_) : Base (editor_) {} + ~Root() {} + + //============================================================================== + const String getItemId() const { return "root"; } + bool mightContainSubItems() { return true; } + + void refreshSubItems() + { + ScopedPointer openness (getOpennessState()); + clearSubItems(); + + addSubItem (new ComponentList (editor)); + addSubItem (new MarkerList (editor, true)); + addSubItem (new MarkerList (editor, false)); + + if (openness != 0) + restoreOpennessState (*openness); + } + + const String getDisplayName() const { return getRenamingName(); } + const String getRenamingName() const { return editor.getDocument().getClassName().toString(); } + Image* getIcon() const { return LookAndFeel::getDefaultLookAndFeel().getDefaultFolderImage(); } + const String getDragSourceDescription() { return String::empty; } + }; +} + //============================================================================== class ComponentEditor::ClassInfoHolder : public Component { @@ -56,18 +337,32 @@ private: PropertyPanelWithTooltips* panel; }; + //============================================================================== -class ComponentEditor::LayoutEditorHolder : public Component +class ComponentEditor::LayoutEditorHolder : public Component, + public ToolbarItemFactory { public: LayoutEditorHolder (ComponentEditor& editor_) - : editor (editor_), infoPanel (0) + : editor (editor_), infoPanel (0), tree (0) { + addAndMakeVisible (toolbar = new Toolbar()); + toolbar->addDefaultItems (*this); + toolbar->setStyle (Toolbar::textOnly); + addAndMakeVisible (viewport = new Viewport()); + + addChildComponent (tree = new TreeView()); + tree->setRootItemVisible (true); + tree->setMultiSelectEnabled (true); + tree->setDefaultOpenness (true); + tree->setColour (TreeView::backgroundColourId, Colours::white); + tree->setIndentSize (15); } ~LayoutEditorHolder() { + tree->deleteRootItem(); deleteAndZero (infoPanel); deleteAllChildren(); } @@ -76,20 +371,94 @@ public: { viewport->setViewedComponent (new ComponentEditorCanvas (editor)); addAndMakeVisible (infoPanel = new InfoPanel (editor)); + tree->setRootItem (new ComponentTree::Root (editor)); + resized(); } void resized() { - const int infoPanelWidth = 200; - viewport->setBounds (0, 0, getWidth() - infoPanelWidth, getHeight()); + const int toolbarHeight = 22; - if (infoPanel != 0) - infoPanel->setBounds (getWidth() - infoPanelWidth, 0, infoPanelWidth, getHeight()); + toolbar->setBounds (0, 0, getWidth(), toolbarHeight); + + int infoPanelWidth = 200; + if (infoPanel != 0 && infoPanel->isVisible()) + infoPanel->setBounds (getWidth() - infoPanelWidth, toolbar->getBottom(), infoPanelWidth, getHeight() - toolbar->getBottom()); + else + infoPanelWidth = 0; + + if (tree->isVisible()) + { + tree->setBounds (0, toolbar->getBottom(), infoPanelWidth, getHeight() - toolbar->getBottom()); + viewport->setBounds (infoPanelWidth, toolbar->getBottom(), getWidth() - infoPanelWidth * 2, getHeight() - toolbar->getBottom()); + } + else + { + viewport->setBounds (0, toolbar->getBottom(), getWidth() - infoPanelWidth, getHeight() - toolbar->getBottom()); + } + } + + void showOrHideProperties() + { + infoPanel->setVisible (! infoPanel->isVisible()); + resized(); + } + + void showOrHideTree() + { + tree->setVisible (! tree->isVisible()); + resized(); } Viewport* getViewport() const { return viewport; } + //============================================================================== + enum DemoToolbarItemIds + { + createComponent = 1, + showInfo = 2, + showComponentTree = 3, + }; + + void getAllToolbarItemIds (Array & ids) + { + ids.add (createComponent); + ids.add (showInfo); + ids.add (showComponentTree); + + ids.add (separatorBarId); + ids.add (spacerId); + ids.add (flexibleSpacerId); + } + + void getDefaultItemSet (Array & ids) + { + ids.add (createComponent); + ids.add (flexibleSpacerId); + ids.add (showInfo); + ids.add (showComponentTree); + } + + ToolbarItemComponent* createItem (int itemId) + { + String name; + int commandId = 0; + + switch (itemId) + { + case createComponent: name = "new"; break; + case showInfo: name = "info"; commandId = CommandIDs::showOrHideProperties; break; + case showComponentTree: name = "tree"; commandId = CommandIDs::showOrHideTree; break; + default: jassertfalse; return 0; + } + + ToolbarButton* b = new ToolbarButton (itemId, name, new DrawablePath(), 0); + b->setCommandToTrigger (commandManager, commandId, true); + return b; + } + private: + //============================================================================== class InfoPanel : public Component, public ChangeListener { @@ -136,9 +505,11 @@ private: PropertyPanel* props; }; + Toolbar* toolbar; ComponentEditor& editor; Viewport* viewport; InfoPanel* infoPanel; + TreeView* tree; }; //============================================================================== @@ -233,6 +604,44 @@ Viewport* ComponentEditor::getViewport() const return layoutEditorHolder->getViewport(); } +//============================================================================== +class TestComponent : public ComponentEditorCanvas::ComponentHolder +{ +public: + TestComponent (ComponentDocument& document_) + : document (document_) + { + setSize (document.getCanvasWidth().getValue(), + document.getCanvasHeight().getValue()); + } + + ~TestComponent() + { + } + + void resized() + { + document.getCanvasWidth() = getWidth(); + document.getCanvasHeight() = getHeight(); + + ComponentEditorCanvas::ComponentHolder::resized(); + updateComponents (document, selected); + } + +private: + ComponentDocument document; + ComponentEditorCanvas::SelectedItems selected; +}; + +void ComponentEditor::test() +{ + TestComponent testComp (getDocument()); + + DialogWindow::showModalDialog ("Testing: " + getDocument().getClassName().toString(), + &testComp, this, Colours::lightgrey, true, true); +} + +//============================================================================== void ComponentEditor::getAllCommands (Array & commands) { DocumentEditorComponent::getAllCommands (commands); @@ -241,6 +650,9 @@ void ComponentEditor::getAllCommands (Array & commands) CommandIDs::redo, CommandIDs::toFront, CommandIDs::toBack, + CommandIDs::test, + CommandIDs::showOrHideProperties, + CommandIDs::showOrHideTree, StandardApplicationCommandIDs::del }; commands.addArray (ids, numElementsInArray (ids)); @@ -271,6 +683,19 @@ void ComponentEditor::getCommandInfo (CommandID commandID, ApplicationCommandInf result.setInfo ("Send to Back", "Moves the selected items to the back", CommandCategories::editing, 0); break; + case CommandIDs::test: + result.setInfo ("Test", "Test the current component", CommandCategories::editing, 0); + result.defaultKeypresses.add (KeyPress ('t', ModifierKeys::commandModifier, 0)); + break; + + case CommandIDs::showOrHideProperties: + result.setInfo ("Show/Hide Tree", "Shows or hides the component tree view", CommandCategories::editing, 0); + break; + + case CommandIDs::showOrHideTree: + result.setInfo ("Show/Hide Properties", "Shows or hides the component properties panel", CommandCategories::editing, 0); + break; + case StandardApplicationCommandIDs::del: result.setInfo ("Delete", String::empty, CommandCategories::general, 0); result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0)); @@ -303,6 +728,18 @@ bool ComponentEditor::perform (const InvocationInfo& info) getCanvas()->selectionToBack(); return true; + case CommandIDs::test: + test(); + return true; + + case CommandIDs::showOrHideProperties: + layoutEditorHolder->showOrHideProperties(); + return true; + + case CommandIDs::showOrHideTree: + layoutEditorHolder->showOrHideTree(); + return true; + case StandardApplicationCommandIDs::del: getCanvas()->deleteSelection(); return true; diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h index 510201c55f..93fbe41ce8 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -53,9 +53,10 @@ public: ComponentDocument& getDocument() const { return *componentDocument; } Viewport* getViewport() const; - ComponentEditorCanvas* getCanvas() const; + void test(); + private: class ClassInfoHolder; class LayoutEditorHolder; diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.cpp b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.cpp index 1baadb2c35..ce10febf8f 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.cpp +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -332,8 +332,8 @@ public: if (axis.expanded (30, 30).contains (e.x, e.y)) { Coordinate coord (getMarkerList().getCoordinate (marker)); - coord.moveToAbsolute (jmax (0.0, dragStartPos + (isX ? e.getDistanceFromDragStartX() - : e.getDistanceFromDragStartY())), + coord.moveToAbsolute (jmax (0, roundToInt (dragStartPos + (isX ? e.getDistanceFromDragStartX() + : e.getDistanceFromDragStartY()))), getMarkerList()); getMarkerList().setCoordinate (marker, coord); } @@ -380,104 +380,6 @@ private: String labelText; }; -//============================================================================== -class ComponentEditorCanvas::ComponentHolder : public Component -{ -public: - ComponentHolder() {} - ~ComponentHolder() {} - - void updateComponents (ComponentDocument& doc, SelectedItems& selection) - { - int i; - for (i = getNumChildComponents(); --i >= 0;) - { - Component* c = getChildComponent (i); - - if (! doc.containsComponent (c)) - { - selection.deselect (ComponentDocument::getJucerIDFor (c)); - delete c; - } - } - - Array componentsInOrder; - - const int num = doc.getNumComponents(); - for (i = 0; i < num; ++i) - { - const ValueTree v (doc.getComponent (i)); - Component* c = getComponentForState (doc, v); - - if (c == 0) - { - c = doc.createComponent (i); - addAndMakeVisible (c); - } - - doc.updateComponent (c); - componentsInOrder.add (c); - } - - // Make sure the z-order is correct.. - if (num > 0) - { - componentsInOrder.getLast()->toFront (false); - - for (i = num - 1; --i >= 0;) - componentsInOrder.getUnchecked(i)->toBehind (componentsInOrder.getUnchecked (i + 1)); - } - } - - Component* getComponentForState (ComponentDocument& doc, const ValueTree& state) const - { - for (int i = getNumChildComponents(); --i >= 0;) - { - Component* const c = getChildComponent (i); - - if (doc.isStateForComponent (state, c)) - return c; - } - - return 0; - } - - Component* findComponentWithID (const String& uid) const - { - for (int i = getNumChildComponents(); --i >= 0;) - { - Component* const c = getChildComponent(i); - - if (ComponentDocument::getJucerIDFor (c) == uid) - return c; - } - - return 0; - } - - Component* findComponentAt (const Point& pos) const - { - for (int i = getNumChildComponents(); --i >= 0;) - { - Component* const c = getChildComponent(i); - if (c->getBounds().contains (pos)) - return c; - } - - return 0; - } - - void findLassoItemsInArea (Array & itemsFound, const Rectangle& lassoArea) - { - for (int i = getNumChildComponents(); --i >= 0;) - { - Component* c = getChildComponent(i); - if (c->getBounds().intersects (lassoArea)) - itemsFound.add (ComponentDocument::getJucerIDFor (c)); - } - } -}; - //============================================================================== class ComponentEditorCanvas::OverlayComponent : public Component, @@ -1097,6 +999,106 @@ void ComponentEditorCanvas::endDrag (const MouseEvent& e) } } +//============================================================================== +ComponentEditorCanvas::ComponentHolder::ComponentHolder() +{ +} + +ComponentEditorCanvas::ComponentHolder::~ComponentHolder() +{ +} + +void ComponentEditorCanvas::ComponentHolder::updateComponents (ComponentDocument& doc, SelectedItems& selection) +{ + int i; + for (i = getNumChildComponents(); --i >= 0;) + { + Component* c = getChildComponent (i); + + if (! doc.containsComponent (c)) + { + selection.deselect (ComponentDocument::getJucerIDFor (c)); + delete c; + } + } + + Array componentsInOrder; + + const int num = doc.getNumComponents(); + for (i = 0; i < num; ++i) + { + const ValueTree v (doc.getComponent (i)); + Component* c = getComponentForState (doc, v); + + if (c == 0) + { + c = doc.createComponent (i); + addAndMakeVisible (c); + } + + doc.updateComponent (c); + componentsInOrder.add (c); + } + + // Make sure the z-order is correct.. + if (num > 0) + { + componentsInOrder.getLast()->toFront (false); + + for (i = num - 1; --i >= 0;) + componentsInOrder.getUnchecked(i)->toBehind (componentsInOrder.getUnchecked (i + 1)); + } +} + +Component* ComponentEditorCanvas::ComponentHolder::getComponentForState (ComponentDocument& doc, const ValueTree& state) const +{ + for (int i = getNumChildComponents(); --i >= 0;) + { + Component* const c = getChildComponent (i); + + if (doc.isStateForComponent (state, c)) + return c; + } + + return 0; +} + +Component* ComponentEditorCanvas::ComponentHolder::findComponentWithID (const String& uid) const +{ + for (int i = getNumChildComponents(); --i >= 0;) + { + Component* const c = getChildComponent(i); + + if (ComponentDocument::getJucerIDFor (c) == uid) + return c; + } + + return 0; +} + +Component* ComponentEditorCanvas::ComponentHolder::findComponentAt (const Point& pos) const +{ + for (int i = getNumChildComponents(); --i >= 0;) + { + Component* const c = getChildComponent(i); + if (c->getBounds().contains (pos)) + return c; + } + + return 0; +} + +void ComponentEditorCanvas::ComponentHolder::findLassoItemsInArea (Array & itemsFound, const Rectangle& lassoArea) +{ + for (int i = getNumChildComponents(); --i >= 0;) + { + Component* c = getChildComponent(i); + if (c->getBounds().intersects (lassoArea)) + itemsFound.add (ComponentDocument::getJucerIDFor (c)); + } +} + + //============================================================================== ComponentEditorCanvas::OverlayItemComponent::OverlayItemComponent (ComponentEditorCanvas& canvas_) : canvas (canvas_) diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.h b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.h index 7d90fc493b..4f8f42f1ca 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.h +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditorCanvas.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -85,6 +85,20 @@ public: void continueDrag (const MouseEvent& e); void endDrag (const MouseEvent& e); + //============================================================================== + class ComponentHolder : public Component + { + public: + ComponentHolder(); + ~ComponentHolder(); + + void updateComponents (ComponentDocument& doc, SelectedItems& selection); + Component* getComponentForState (ComponentDocument& doc, const ValueTree& state) const; + Component* findComponentWithID (const String& uid) const; + Component* findComponentAt (const Point& pos) const; + void findLassoItemsInArea (Array & itemsFound, const Rectangle& lassoArea); + }; + private: ComponentEditor& editor; const BorderSize border; diff --git a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp index 4585a55d6d..6020bda0bb 100644 --- a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp +++ b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.h b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.h index 5d5b223623..49fbfb01a1 100644 --- a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.h +++ b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableEditor.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableObjectComponent.h b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableObjectComponent.h index 07aff4124e..555a8d0005 100644 --- a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableObjectComponent.h +++ b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableObjectComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableTreeViewItem.h b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableTreeViewItem.h index 2de885e01c..9b8d5a474b 100644 --- a/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableTreeViewItem.h +++ b/extras/Jucer (experimental)/Source/ui/Drawable Editor/jucer_DrawableTreeViewItem.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_CommandIDs.h b/extras/Jucer (experimental)/Source/ui/jucer_CommandIDs.h index 50ed171d8d..860b5b1c2b 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_CommandIDs.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_CommandIDs.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -48,7 +48,9 @@ namespace CommandIDs static const int test = 0x202090; static const int toFront = 0x2020a0; - static const int toBack = 0x2030b0; + static const int toBack = 0x2030a1; + static const int showOrHideProperties = 0x2030b0; + static const int showOrHideTree = 0x2030b1; static const int group = 0x202170; static const int ungroup = 0x202180; diff --git a/extras/Jucer (experimental)/Source/ui/jucer_CoordinatePropertyComponent.h b/extras/Jucer (experimental)/Source/ui/jucer_CoordinatePropertyComponent.h index ddeab9da2b..988ed473bf 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_CoordinatePropertyComponent.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_CoordinatePropertyComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp b/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp index 0a2764aad2..04151623c0 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.h b/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.h index a0e59daaad..7aa75739fb 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.cpp b/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.cpp index 62ff41186e..02c8154f93 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.h b/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.h index cf16163351..a6cb9013e7 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_GroupInformationComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.cpp b/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.cpp index 58d5a53765..d83bf22d61 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.h b/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.h index 648078b303..03231c47dc 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_ItemPreviewComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.cpp b/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.cpp index 127444727b..f2d405a102 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.h b/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.h index 775e655cf3..e665d08633 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_JucerTreeViewBase.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -54,7 +54,7 @@ public: virtual bool isMissing() = 0; virtual Image* getIcon() const = 0; - void showRenameBox(); + virtual void showRenameBox(); // Text editor listener for renaming.. void textEditorTextChanged (TextEditor& editor) {} diff --git a/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp b/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp index d09ab6a077..f813f20c6b 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ @@ -301,7 +301,6 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex, menu.addCommandItem (commandManager, CommandIDs::undo); menu.addCommandItem (commandManager, CommandIDs::redo); menu.addSeparator(); - menu.addCommandItem (commandManager, StandardApplicationCommandIDs::cut); menu.addCommandItem (commandManager, StandardApplicationCommandIDs::copy); menu.addCommandItem (commandManager, StandardApplicationCommandIDs::paste); @@ -322,20 +321,14 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex, // "View" menu menu.addCommandItem (commandManager, CommandIDs::showProjectSettings); - - //menu.addCommandItem (commandManager, CommandIDs::test); menu.addSeparator(); + + menu.addCommandItem (commandManager, CommandIDs::test); + menu.addSeparator(); + menu.addCommandItem (commandManager, CommandIDs::showGrid); menu.addCommandItem (commandManager, CommandIDs::enableSnapToGrid); - /* const int currentSnapSize = getActiveDocument() != 0 ? getActiveDocument()->getSnappingGridSize() : 0; - - PopupMenu m; - for (int i = 0; i < numElementsInArray (snapSizes); ++i) - m.addItem (300 + i, String (snapSizes[i]) + " pixels", true, snapSizes[i] == currentSnapSize); - - menu.addSubMenu ("Grid size", m, getActiveDocument() != 0);*/ - menu.addSeparator(); menu.addCommandItem (commandManager, CommandIDs::zoomIn); menu.addCommandItem (commandManager, CommandIDs::zoomOut); diff --git a/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.h b/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.h index 61ddc99bf5..f8fc8fbedf 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp b/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp index 7bc62e6023..50537a9925 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.h b/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.h index d485257123..b1c9e7e609 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp b/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp index b9bd39e49f..11e14b2cde 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.h b/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.h index 69049a04d2..0104b3883f 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.cpp b/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.cpp index ee08fcceb8..e0a9e4e25a 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.h b/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.h index b96f38e38b..e5ae3362a6 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_ProjectTreeViewBase.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.cpp b/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.cpp index e622650394..43789ca572 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.h b/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.h index f419b00c64..cd347f5a40 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_SourceCodeEditor.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.cpp b/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.cpp index 9e7009610b..f7c55e4a8e 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.h b/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.h index cfe2bfb76d..ff0d414ee9 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.h +++ b/extras/Jucer (experimental)/Source/ui/jucer_TreeViewTypes.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h b/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h index 563df2467f..05f4ceee91 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_Colours.h b/extras/Jucer (experimental)/Source/utility/jucer_Colours.h index bf01e3b80f..e2a75ba8c0 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_Colours.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_Colours.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h b/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h index 2b015fe95a..b892852acc 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp b/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp index 2aea4bec46..12e6c7a018 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp +++ b/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.h b/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.h index a49097bb26..fb1a2d5221 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp index 3591e3a116..3417b3a453 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp +++ b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h index 0989a66374..b643ed6dec 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h b/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h index edd97934a9..a4f639a0e6 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_ValueRemapperSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. + Copyright 2004-10 by Raw Material Software Ltd. ------------------------------------------------------------------------------ diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 86813a37a0..8f2ec02f56 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -69219,10 +69219,9 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, else { if (imageOffsetFromMouse == 0) - imageOffset = Point (dragImage->getWidth() / -2, - dragImage->getHeight() / -2); + imageOffset = -dragImage->getBounds().getCentre(); else - imageOffset = *imageOffsetFromMouse; + imageOffset = -(dragImage->getBounds().getConstrainedPoint (-*imageOffsetFromMouse)); } dragImageComponent = new DragImageComponent (dragImage.release(), sourceDescription, sourceComponent, @@ -69448,12 +69447,12 @@ void* MouseCursor::getHandle() const throw() return cursorHandle->getHandle(); } -void MouseCursor::showWaitCursor() throw() +void MouseCursor::showWaitCursor() { Desktop::getInstance().getMainMouseSource().showMouseCursor (MouseCursor::WaitCursor); } -void MouseCursor::hideWaitCursor() throw() +void MouseCursor::hideWaitCursor() { Desktop::getInstance().getMainMouseSource().revealCursor(); } @@ -72624,7 +72623,7 @@ private: ScopedPointer colours; - void updateMarker() const throw() + void updateMarker() const { marker->setBounds (roundToInt ((getWidth() - edge * 2) * s), roundToInt ((getHeight() - edge * 2) * (1.0f - v)), @@ -74188,7 +74187,7 @@ void MidiKeyboardComponent::drawBlackNote (int /*midiNoteNumber*/, } } -void MidiKeyboardComponent::setOctaveForMiddleC (const int octaveNumForMiddleC_) throw() +void MidiKeyboardComponent::setOctaveForMiddleC (const int octaveNumForMiddleC_) { octaveNumForMiddleC = octaveNumForMiddleC_; repaint(); @@ -75672,8 +75671,7 @@ BEGIN_JUCE_NAMESPACE static VoidArray heavyweightPeers; -ComponentPeer::ComponentPeer (Component* const component_, - const int styleFlags_) throw() +ComponentPeer::ComponentPeer (Component* const component_, const int styleFlags_) : component (component_), styleFlags (styleFlags_), lastPaintTime (0), @@ -76126,12 +76124,12 @@ void ComponentPeer::bringModalComponentToFront() Component::bringModalComponentToFront(); } -void ComponentPeer::clearMaskedRegion() throw() +void ComponentPeer::clearMaskedRegion() { maskedRegion.clear(); } -void ComponentPeer::addMaskedRegion (int x, int y, int w, int h) throw() +void ComponentPeer::addMaskedRegion (int x, int y, int w, int h) { maskedRegion.add (x, y, w, h); } @@ -77490,7 +77488,7 @@ public: } } - bool addWindow (TopLevelWindow* const w) throw() + bool addWindow (TopLevelWindow* const w) { windows.add (w); startTimer (10); @@ -77498,7 +77496,7 @@ public: return isWindowActive (w); } - void removeWindow (TopLevelWindow* const w) throw() + void removeWindow (TopLevelWindow* const w) { startTimer (10); @@ -77516,7 +77514,7 @@ public: private: TopLevelWindow* currentActive; - bool isWindowActive (TopLevelWindow* const tlw) const throw() + bool isWindowActive (TopLevelWindow* const tlw) const { return (tlw == currentActive || tlw->isParentOf (currentActive) @@ -77569,7 +77567,7 @@ void TopLevelWindow::focusOfChildComponentChanged (FocusChangeType) TopLevelWindowManager::getInstance()->startTimer (10); } -void TopLevelWindow::setWindowActive (const bool isNowActive) throw() +void TopLevelWindow::setWindowActive (const bool isNowActive) { if (windowIsActive_ != isNowActive) { @@ -78273,7 +78271,7 @@ ColourGradient::ColourGradient (const Colour& colour1, const Colour& colour2, const float x2_, const float y2_, - const bool isRadial_) throw() + const bool isRadial_) : x1 (x1_), y1 (y1_), x2 (x2_), @@ -78287,17 +78285,17 @@ ColourGradient::ColourGradient (const Colour& colour1, colours.add (colour2.getARGB()); } -ColourGradient::~ColourGradient() throw() +ColourGradient::~ColourGradient() { } -void ColourGradient::clearColours() throw() +void ColourGradient::clearColours() { colours.clear(); } void ColourGradient::addColour (const double proportionAlongGradient, - const Colour& colour) throw() + const Colour& colour) { // must be within the two end-points jassert (proportionAlongGradient >= 0 && proportionAlongGradient <= 1.0); @@ -78362,7 +78360,7 @@ const Colour ColourGradient::getColourAtPosition (const float position) const th return col1.interpolatedWith (col2, (integerPos - pos1) / (float) (pos2 - pos1)); } -int ColourGradient::createLookupTable (const AffineTransform& transform, HeapBlock & lookupTable) const throw() +int ColourGradient::createLookupTable (const AffineTransform& transform, HeapBlock & lookupTable) const { #ifdef JUCE_DEBUG // trying to use the object without setting its co-ordinates? Have a careful read of @@ -79478,7 +79476,7 @@ FillType::FillType (const Colour& colour_) throw() { } -FillType::FillType (const ColourGradient& gradient_) throw() +FillType::FillType (const ColourGradient& gradient_) : colour (0xff000000), gradient (new ColourGradient (gradient_)), image (0) { } @@ -79488,14 +79486,14 @@ FillType::FillType (const Image& image_, const AffineTransform& transform_) thro { } -FillType::FillType (const FillType& other) throw() +FillType::FillType (const FillType& other) : colour (other.colour), gradient (other.gradient != 0 ? new ColourGradient (*other.gradient) : 0), image (other.image), transform (other.transform) { } -FillType& FillType::operator= (const FillType& other) throw() +FillType& FillType::operator= (const FillType& other) { if (this != &other) { @@ -79519,7 +79517,7 @@ void FillType::setColour (const Colour& newColour) throw() colour = newColour; } -void FillType::setGradient (const ColourGradient& newGradient) throw() +void FillType::setGradient (const ColourGradient& newGradient) { if (gradient != 0) { @@ -82556,7 +82554,7 @@ Drawable* Drawable::createFromImageFile (const File& file) return fin != 0 ? createFromImageDataStream (*fin) : 0; } -Drawable* Drawable::createFromValueTree (const ValueTree& tree) throw() +Drawable* Drawable::createFromValueTree (const ValueTree& tree) { Drawable* d = DrawablePath::createFromValueTree (tree); @@ -82728,7 +82726,7 @@ Drawable* DrawableComposite::createCopy() const return dc; } -ValueTree DrawableComposite::createValueTree() const throw() +ValueTree DrawableComposite::createValueTree() const { ValueTree v ("Group"); @@ -82758,7 +82756,7 @@ ValueTree DrawableComposite::createValueTree() const throw() return v; } -DrawableComposite* DrawableComposite::createFromValueTree (const ValueTree& tree) throw() +DrawableComposite* DrawableComposite::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Group")) return 0; @@ -82913,7 +82911,7 @@ Drawable* DrawableImage::createCopy() const return di; } -ValueTree DrawableImage::createValueTree() const throw() +ValueTree DrawableImage::createValueTree() const { ValueTree v ("Image"); @@ -82944,7 +82942,7 @@ ValueTree DrawableImage::createValueTree() const throw() return v; } -DrawableImage* DrawableImage::createFromValueTree (const ValueTree& tree) throw() +DrawableImage* DrawableImage::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Image")) return 0; @@ -82986,29 +82984,29 @@ DrawablePath::~DrawablePath() { } -void DrawablePath::setPath (const Path& newPath) throw() +void DrawablePath::setPath (const Path& newPath) { path = newPath; updateOutline(); } -void DrawablePath::setFill (const FillType& newFill) throw() +void DrawablePath::setFill (const FillType& newFill) { mainFill = newFill; } -void DrawablePath::setStrokeFill (const FillType& newFill) throw() +void DrawablePath::setStrokeFill (const FillType& newFill) { strokeFill = newFill; } -void DrawablePath::setStrokeType (const PathStrokeType& newStrokeType) throw() +void DrawablePath::setStrokeType (const PathStrokeType& newStrokeType) { strokeType = newStrokeType; updateOutline(); } -void DrawablePath::setStrokeThickness (const float newThickness) throw() +void DrawablePath::setStrokeThickness (const float newThickness) { setStrokeType (PathStrokeType (newThickness, strokeType.getJointStyle(), strokeType.getEndStyle())); } @@ -83135,7 +83133,7 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f return v; } -ValueTree DrawablePath::createValueTree() const throw() +ValueTree DrawablePath::createValueTree() const { ValueTree v ("Path"); @@ -83155,7 +83153,7 @@ ValueTree DrawablePath::createValueTree() const throw() return v; } -DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) throw() +DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Path")) return 0; @@ -83243,7 +83241,7 @@ Drawable* DrawableText::createCopy() const return dt; } -ValueTree DrawableText::createValueTree() const throw() +ValueTree DrawableText::createValueTree() const { ValueTree v ("Text"); @@ -83254,7 +83252,7 @@ ValueTree DrawableText::createValueTree() const throw() return v; } -DrawableText* DrawableText::createFromValueTree (const ValueTree& tree) throw() +DrawableText* DrawableText::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Text")) return 0; @@ -89684,28 +89682,28 @@ RectangleList::RectangleList() throw() { } -RectangleList::RectangleList (const Rectangle& rect) throw() +RectangleList::RectangleList (const Rectangle& rect) { if (! rect.isEmpty()) rects.add (rect); } -RectangleList::RectangleList (const RectangleList& other) throw() +RectangleList::RectangleList (const RectangleList& other) : rects (other.rects) { } -RectangleList& RectangleList::operator= (const RectangleList& other) throw() +RectangleList& RectangleList::operator= (const RectangleList& other) { rects = other.rects; return *this; } -RectangleList::~RectangleList() throw() +RectangleList::~RectangleList() { } -void RectangleList::clear() throw() +void RectangleList::clear() { rects.clearQuick(); } @@ -89730,7 +89728,7 @@ RectangleList::Iterator::Iterator (const RectangleList& list) throw() { } -RectangleList::Iterator::~Iterator() throw() +RectangleList::Iterator::~Iterator() { } @@ -89745,7 +89743,7 @@ bool RectangleList::Iterator::next() throw() return false; } -void RectangleList::add (const Rectangle& rect) throw() +void RectangleList::add (const Rectangle& rect) { if (! rect.isEmpty()) { @@ -89799,12 +89797,12 @@ void RectangleList::add (const Rectangle& rect) throw() } } -void RectangleList::addWithoutMerging (const Rectangle& rect) throw() +void RectangleList::addWithoutMerging (const Rectangle& rect) { rects.add (rect); } -void RectangleList::add (const int x, const int y, const int w, const int h) throw() +void RectangleList::add (const int x, const int y, const int w, const int h) { if (rects.size() == 0) { @@ -89817,13 +89815,13 @@ void RectangleList::add (const int x, const int y, const int w, const int h) thr } } -void RectangleList::add (const RectangleList& other) throw() +void RectangleList::add (const RectangleList& other) { for (int i = 0; i < other.rects.size(); ++i) add (other.rects.getReference (i)); } -void RectangleList::subtract (const Rectangle& rect) throw() +void RectangleList::subtract (const Rectangle& rect) { const int originalNumRects = rects.size(); @@ -89909,13 +89907,13 @@ void RectangleList::subtract (const Rectangle& rect) throw() } } -void RectangleList::subtract (const RectangleList& otherList) throw() +void RectangleList::subtract (const RectangleList& otherList) { for (int i = otherList.rects.size(); --i >= 0;) subtract (otherList.rects.getReference (i)); } -bool RectangleList::clipTo (const Rectangle& rect) throw() +bool RectangleList::clipTo (const Rectangle& rect) { bool notEmpty = false; @@ -89939,7 +89937,7 @@ bool RectangleList::clipTo (const Rectangle& rect) throw() return notEmpty; } -bool RectangleList::clipTo (const RectangleList& other) throw() +bool RectangleList::clipTo (const RectangleList& other) { if (rects.size() == 0) return false; @@ -89964,7 +89962,7 @@ bool RectangleList::clipTo (const RectangleList& other) throw() return ! isEmpty(); } -bool RectangleList::getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw() +bool RectangleList::getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const { destRegion.clear(); @@ -89987,7 +89985,7 @@ void RectangleList::swapWith (RectangleList& otherList) throw() rects.swapWithArray (otherList.rects); } -void RectangleList::consolidate() throw() +void RectangleList::consolidate() { int i; for (i = 0; i < getNumRectangles() - 1; ++i) @@ -90068,7 +90066,7 @@ bool RectangleList::containsPoint (const int x, const int y) const throw() return false; } -bool RectangleList::containsRectangle (const Rectangle& rectangleToCheck) const throw() +bool RectangleList::containsRectangle (const Rectangle& rectangleToCheck) const { if (rects.size() > 1) { @@ -90151,7 +90149,7 @@ void RectangleList::offsetAll (const int dx, const int dy) throw() } } -const Path RectangleList::toPath() const throw() +const Path RectangleList::toPath() const { Path p; @@ -216071,13 +216069,13 @@ class FontDCHolder : private DeletedAtShutdown { public: - FontDCHolder() throw() + FontDCHolder() : dc (0), numKPs (0), size (0), bold (false), italic (false) { } - ~FontDCHolder() throw() + ~FontDCHolder() { if (dc != 0) { @@ -216090,7 +216088,7 @@ public: juce_DeclareSingleton_SingleThreaded_Minimal (FontDCHolder); - HDC loadFont (const String& fontName_, const bool bold_, const bool italic_, const int size_) throw() + HDC loadFont (const String& fontName_, const bool bold_, const bool italic_, const int size_) { if (fontName != fontName_ || bold != bold_ || italic != italic_ || size != size_) { @@ -216160,7 +216158,7 @@ public: return dc; } - KERNINGPAIR* getKerningPairs (int& numKPs_) throw() + KERNINGPAIR* getKerningPairs (int& numKPs_) { if (kps == 0) { @@ -220848,7 +220846,7 @@ public: } } - void handle (const uint32 message, const uint32 timeStamp) throw() + void handle (const uint32 message, const uint32 timeStamp) { const int byte = message & 0xff; if (byte < 0x80) @@ -220877,7 +220875,7 @@ public: notify(); } - void handleSysEx (MIDIHDR* const hdr, const uint32 timeStamp) throw() + void handleSysEx (MIDIHDR* const hdr, const uint32 timeStamp) { const int num = hdr->dwBytesRecorded; @@ -220906,7 +220904,7 @@ public: } } - void writeBlock (const int i) throw() + void writeBlock (const int i) { hdr[i].dwBytesRecorded = 0; MMRESULT res = midiInPrepareHeader (hIn, &hdr[i], sizeof (MIDIHDR)); @@ -220973,7 +220971,7 @@ public: } } - void start() throw() + void start() { jassert (hIn != 0); if (hIn != 0 && ! isStarted) @@ -221000,7 +220998,7 @@ public: } } - void stop() throw() + void stop() { if (isStarted) { @@ -221062,7 +221060,7 @@ private: int pendingLength; char pending [MidiConstants::midiBufferSize]; - double timeStampToTime (uint32 timeStamp) throw() + double timeStampToTime (uint32 timeStamp) { timeStamp += startTime; @@ -222560,7 +222558,7 @@ private: return error; } - void callback (const long index) throw() + void callback (const long index) { if (isStarted) { @@ -222576,7 +222574,7 @@ private: calledback = true; } - void processBuffer() throw() + void processBuffer() { const ASIOBufferInfo* const infos = bufferInfos; const int bi = bufferIndex; @@ -222705,7 +222703,7 @@ private: asioObject->outputReady(); } - static ASIOTime* bufferSwitchTimeInfoCallback0 (ASIOTime*, long index, long) throw() + static ASIOTime* bufferSwitchTimeInfoCallback0 (ASIOTime*, long index, long) { if (currentASIODev[0] != 0) currentASIODev[0]->callback (index); @@ -222713,7 +222711,7 @@ private: return 0; } - static ASIOTime* bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) throw() + static ASIOTime* bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) { if (currentASIODev[1] != 0) currentASIODev[1]->callback (index); @@ -222721,7 +222719,7 @@ private: return 0; } - static ASIOTime* bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) throw() + static ASIOTime* bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) { if (currentASIODev[2] != 0) currentASIODev[2]->callback (index); @@ -222729,40 +222727,40 @@ private: return 0; } - static void bufferSwitchCallback0 (long index, long) throw() + static void bufferSwitchCallback0 (long index, long) { if (currentASIODev[0] != 0) currentASIODev[0]->callback (index); } - static void bufferSwitchCallback1 (long index, long) throw() + static void bufferSwitchCallback1 (long index, long) { if (currentASIODev[1] != 0) currentASIODev[1]->callback (index); } - static void bufferSwitchCallback2 (long index, long) throw() + static void bufferSwitchCallback2 (long index, long) { if (currentASIODev[2] != 0) currentASIODev[2]->callback (index); } - static long asioMessagesCallback0 (long selector, long value, void*, double*) throw() + static long asioMessagesCallback0 (long selector, long value, void*, double*) { return asioMessagesCallback (selector, value, 0); } - static long asioMessagesCallback1 (long selector, long value, void*, double*) throw() + static long asioMessagesCallback1 (long selector, long value, void*, double*) { return asioMessagesCallback (selector, value, 1); } - static long asioMessagesCallback2 (long selector, long value, void*, double*) throw() + static long asioMessagesCallback2 (long selector, long value, void*, double*) { return asioMessagesCallback (selector, value, 2); } - static long asioMessagesCallback (long selector, long value, const int deviceIndex) throw() + static long asioMessagesCallback (long selector, long value, const int deviceIndex) { switch (selector) { @@ -238168,7 +238166,7 @@ class ScreenSaverDefeater : public Timer, public DeletedAtShutdown { public: - ScreenSaverDefeater() throw() + ScreenSaverDefeater() { startTimer (10000); timerCallback(); diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 9568a506b3..7af60cc928 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -9367,9 +9367,9 @@ public: bool operator!= (const MouseCursor& other) const throw(); - static void showWaitCursor() throw(); + static void showWaitCursor(); - static void hideWaitCursor() throw(); + static void hideWaitCursor(); juce_UseDebuggingNewOperator @@ -11974,16 +11974,16 @@ public: ColourGradient (const Colour& colour1, float x1, float y1, const Colour& colour2, float x2, float y2, - bool isRadial) throw(); + bool isRadial); ColourGradient() throw(); - ~ColourGradient() throw(); + ~ColourGradient(); - void clearColours() throw(); + void clearColours(); void addColour (double proportionAlongGradient, - const Colour& colour) throw(); + const Colour& colour); void multiplyOpacity (float multiplier) throw(); @@ -11995,7 +11995,7 @@ public: const Colour getColourAtPosition (float position) const throw(); - int createLookupTable (const AffineTransform& transform, HeapBlock & resultLookupTable) const throw(); + int createLookupTable (const AffineTransform& transform, HeapBlock & resultLookupTable) const; bool isOpaque() const throw(); @@ -12027,13 +12027,13 @@ public: FillType (const Colour& colour) throw(); - FillType (const ColourGradient& gradient) throw(); + FillType (const ColourGradient& gradient); FillType (const Image& image, const AffineTransform& transform) throw(); - FillType (const FillType& other) throw(); + FillType (const FillType& other); - FillType& operator= (const FillType& other) throw(); + FillType& operator= (const FillType& other); ~FillType() throw(); @@ -12045,7 +12045,7 @@ public: void setColour (const Colour& newColour) throw(); - void setGradient (const ColourGradient& newGradient) throw(); + void setGradient (const ColourGradient& newGradient); void setTiledImage (const Image& image, const AffineTransform& transform) throw(); @@ -12369,13 +12369,13 @@ public: RectangleList() throw(); - RectangleList (const RectangleList& other) throw(); + RectangleList (const RectangleList& other); - RectangleList (const Rectangle& rect) throw(); + RectangleList (const Rectangle& rect); - RectangleList& operator= (const RectangleList& other) throw(); + RectangleList& operator= (const RectangleList& other); - ~RectangleList() throw(); + ~RectangleList(); bool isEmpty() const throw(); @@ -12383,31 +12383,31 @@ public: const Rectangle getRectangle (const int index) const throw(); - void clear() throw(); + void clear(); - void add (int x, int y, int width, int height) throw(); + void add (int x, int y, int width, int height); - void add (const Rectangle& rect) throw(); + void add (const Rectangle& rect); - void addWithoutMerging (const Rectangle& rect) throw(); + void addWithoutMerging (const Rectangle& rect); - void add (const RectangleList& other) throw(); + void add (const RectangleList& other); - void subtract (const Rectangle& rect) throw(); + void subtract (const Rectangle& rect); - void subtract (const RectangleList& otherList) throw(); + void subtract (const RectangleList& otherList); - bool clipTo (const Rectangle& rect) throw(); + bool clipTo (const Rectangle& rect); - bool clipTo (const RectangleList& other) throw(); + bool clipTo (const RectangleList& other); - bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw(); + bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const; void swapWith (RectangleList& otherList) throw(); bool containsPoint (int x, int y) const throw(); - bool containsRectangle (const Rectangle& rectangleToCheck) const throw(); + bool containsRectangle (const Rectangle& rectangleToCheck) const; bool intersectsRectangle (const Rectangle& rectangleToCheck) const throw(); @@ -12415,18 +12415,18 @@ public: const Rectangle getBounds() const throw(); - void consolidate() throw(); + void consolidate(); void offsetAll (int dx, int dy) throw(); - const Path toPath() const throw(); + const Path toPath() const; class Iterator { public: Iterator (const RectangleList& list) throw(); - ~Iterator() throw(); + ~Iterator(); bool next() throw(); @@ -20197,9 +20197,9 @@ public: static Drawable* createFromSVG (const XmlElement& svgDocument); - static Drawable* createFromValueTree (const ValueTree& tree) throw(); + static Drawable* createFromValueTree (const ValueTree& tree); - virtual ValueTree createValueTree() const throw() = 0; + virtual ValueTree createValueTree() const = 0; juce_UseDebuggingNewOperator @@ -22947,7 +22947,7 @@ private: bool useDropShadow, useNativeTitleBar, windowIsActive_; ScopedPointer shadower; - void setWindowActive (bool isNowActive) throw(); + void setWindowActive (bool isNowActive); TopLevelWindow (const TopLevelWindow&); TopLevelWindow& operator= (const TopLevelWindow&); @@ -26812,7 +26812,7 @@ public: void setKeyPressBaseOctave (int newOctaveNumber); - void setOctaveForMiddleC (int octaveNumForMiddleC) throw(); + void setOctaveForMiddleC (int octaveNumForMiddleC); int getOctaveForMiddleC() const throw() { return octaveNumForMiddleC; } @@ -27405,8 +27405,7 @@ public: }; - ComponentPeer (Component* component, - int styleFlags) throw(); + ComponentPeer (Component* component, int styleFlags); virtual ~ComponentPeer(); @@ -27503,9 +27502,9 @@ public: void handleFileDragExit (const StringArray& files); void handleFileDragDrop (const StringArray& files, const Point& position); - void clearMaskedRegion() throw(); + void clearMaskedRegion(); - void addMaskedRegion (int x, int y, int w, int h) throw(); + void addMaskedRegion (int x, int y, int w, int h); static int getNumPeers() throw(); @@ -27985,8 +27984,8 @@ public: const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; - ValueTree createValueTree() const throw(); - static DrawableComposite* createFromValueTree (const ValueTree& tree) throw(); + ValueTree createValueTree() const; + static DrawableComposite* createFromValueTree (const ValueTree& tree); juce_UseDebuggingNewOperator @@ -28038,8 +28037,8 @@ public: const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; - ValueTree createValueTree() const throw(); - static DrawableImage* createFromValueTree (const ValueTree& tree) throw(); + ValueTree createValueTree() const; + static DrawableImage* createFromValueTree (const ValueTree& tree); juce_UseDebuggingNewOperator @@ -28072,21 +28071,21 @@ public: virtual ~DrawablePath(); - void setPath (const Path& newPath) throw(); + void setPath (const Path& newPath); const Path& getPath() const throw() { return path; } - void setFill (const FillType& newFill) throw(); + void setFill (const FillType& newFill); const FillType& getFill() const throw() { return mainFill; } - void setStrokeFill (const FillType& newStrokeFill) throw(); + void setStrokeFill (const FillType& newStrokeFill); const FillType& getStrokeFill() const throw() { return strokeFill; } - void setStrokeType (const PathStrokeType& newStrokeType) throw(); + void setStrokeType (const PathStrokeType& newStrokeType); - void setStrokeThickness (float newThickness) throw(); + void setStrokeThickness (float newThickness); const PathStrokeType& getStrokeType() const throw() { return strokeType; } @@ -28094,8 +28093,8 @@ public: const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; - ValueTree createValueTree() const throw(); - static DrawablePath* createFromValueTree (const ValueTree& tree) throw(); + ValueTree createValueTree() const; + static DrawablePath* createFromValueTree (const ValueTree& tree); juce_UseDebuggingNewOperator @@ -28143,8 +28142,8 @@ public: const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; - ValueTree createValueTree() const throw(); - static DrawableText* createFromValueTree (const ValueTree& tree) throw(); + ValueTree createValueTree() const; + static DrawableText* createFromValueTree (const ValueTree& tree); juce_UseDebuggingNewOperator diff --git a/src/gui/components/mouse/juce_DragAndDropContainer.cpp b/src/gui/components/mouse/juce_DragAndDropContainer.cpp index fcbc20b7ce..90520d903e 100644 --- a/src/gui/components/mouse/juce_DragAndDropContainer.cpp +++ b/src/gui/components/mouse/juce_DragAndDropContainer.cpp @@ -386,10 +386,9 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, else { if (imageOffsetFromMouse == 0) - imageOffset = Point (dragImage->getWidth() / -2, - dragImage->getHeight() / -2); + imageOffset = -dragImage->getBounds().getCentre(); else - imageOffset = *imageOffsetFromMouse; + imageOffset = -(dragImage->getBounds().getConstrainedPoint (-*imageOffsetFromMouse)); } dragImageComponent = new DragImageComponent (dragImage.release(), sourceDescription, sourceComponent, diff --git a/src/gui/components/mouse/juce_MouseCursor.cpp b/src/gui/components/mouse/juce_MouseCursor.cpp index 4e562d37a8..d68d4ca3e2 100644 --- a/src/gui/components/mouse/juce_MouseCursor.cpp +++ b/src/gui/components/mouse/juce_MouseCursor.cpp @@ -178,12 +178,12 @@ void* MouseCursor::getHandle() const throw() return cursorHandle->getHandle(); } -void MouseCursor::showWaitCursor() throw() +void MouseCursor::showWaitCursor() { Desktop::getInstance().getMainMouseSource().showMouseCursor (MouseCursor::WaitCursor); } -void MouseCursor::hideWaitCursor() throw() +void MouseCursor::hideWaitCursor() { Desktop::getInstance().getMainMouseSource().revealCursor(); } diff --git a/src/gui/components/mouse/juce_MouseCursor.h b/src/gui/components/mouse/juce_MouseCursor.h index 140f45e8fa..4e4b0f8a62 100644 --- a/src/gui/components/mouse/juce_MouseCursor.h +++ b/src/gui/components/mouse/juce_MouseCursor.h @@ -127,7 +127,7 @@ public: @see MessageManager::setTimeBeforeShowingWaitCursor */ - static void showWaitCursor() throw(); + static void showWaitCursor(); /** If showWaitCursor has been called, this will return the mouse to its normal state. @@ -137,7 +137,7 @@ public: @see showWaitCursor */ - static void hideWaitCursor() throw(); + static void hideWaitCursor(); //============================================================================== diff --git a/src/gui/components/special/juce_ColourSelector.cpp b/src/gui/components/special/juce_ColourSelector.cpp index 630111d97b..c19a960542 100644 --- a/src/gui/components/special/juce_ColourSelector.cpp +++ b/src/gui/components/special/juce_ColourSelector.cpp @@ -184,7 +184,7 @@ private: ScopedPointer colours; - void updateMarker() const throw() + void updateMarker() const { marker->setBounds (roundToInt ((getWidth() - edge * 2) * s), roundToInt ((getHeight() - edge * 2) * (1.0f - v)), diff --git a/src/gui/components/special/juce_MidiKeyboardComponent.cpp b/src/gui/components/special/juce_MidiKeyboardComponent.cpp index 96355e302d..6cdf6fff2e 100644 --- a/src/gui/components/special/juce_MidiKeyboardComponent.cpp +++ b/src/gui/components/special/juce_MidiKeyboardComponent.cpp @@ -536,7 +536,7 @@ void MidiKeyboardComponent::drawBlackNote (int /*midiNoteNumber*/, } } -void MidiKeyboardComponent::setOctaveForMiddleC (const int octaveNumForMiddleC_) throw() +void MidiKeyboardComponent::setOctaveForMiddleC (const int octaveNumForMiddleC_) { octaveNumForMiddleC = octaveNumForMiddleC_; repaint(); diff --git a/src/gui/components/special/juce_MidiKeyboardComponent.h b/src/gui/components/special/juce_MidiKeyboardComponent.h index 392a83c633..083128e87b 100644 --- a/src/gui/components/special/juce_MidiKeyboardComponent.h +++ b/src/gui/components/special/juce_MidiKeyboardComponent.h @@ -263,7 +263,7 @@ public: @see getOctaveForMiddleC */ - void setOctaveForMiddleC (int octaveNumForMiddleC) throw(); + void setOctaveForMiddleC (int octaveNumForMiddleC); /** This returns the value set by setOctaveForMiddleC(). @see setOctaveForMiddleC diff --git a/src/gui/components/windows/juce_ComponentPeer.cpp b/src/gui/components/windows/juce_ComponentPeer.cpp index e1d410baff..e2a9696f50 100644 --- a/src/gui/components/windows/juce_ComponentPeer.cpp +++ b/src/gui/components/windows/juce_ComponentPeer.cpp @@ -45,8 +45,7 @@ static VoidArray heavyweightPeers; //============================================================================== -ComponentPeer::ComponentPeer (Component* const component_, - const int styleFlags_) throw() +ComponentPeer::ComponentPeer (Component* const component_, const int styleFlags_) : component (component_), styleFlags (styleFlags_), lastPaintTime (0), @@ -507,12 +506,12 @@ void ComponentPeer::bringModalComponentToFront() } //============================================================================== -void ComponentPeer::clearMaskedRegion() throw() +void ComponentPeer::clearMaskedRegion() { maskedRegion.clear(); } -void ComponentPeer::addMaskedRegion (int x, int y, int w, int h) throw() +void ComponentPeer::addMaskedRegion (int x, int y, int w, int h) { maskedRegion.add (x, y, w, h); } diff --git a/src/gui/components/windows/juce_ComponentPeer.h b/src/gui/components/windows/juce_ComponentPeer.h index 8a94abda20..89ae594060 100644 --- a/src/gui/components/windows/juce_ComponentPeer.h +++ b/src/gui/components/windows/juce_ComponentPeer.h @@ -87,8 +87,7 @@ public: The component is the one that we intend to represent, and the style flags are a combination of the values in the StyleFlags enum */ - ComponentPeer (Component* component, - int styleFlags) throw(); + ComponentPeer (Component* component, int styleFlags); /** Destructor. */ virtual ~ComponentPeer(); @@ -310,7 +309,7 @@ public: @see addMaskedRegion */ - void clearMaskedRegion() throw(); + void clearMaskedRegion(); /** Adds a rectangle to the set of areas not to paint over. @@ -321,7 +320,7 @@ public: The masked region is cleared each time before a paint happens, so a component will have to make sure it calls this every time it's painted. */ - void addMaskedRegion (int x, int y, int w, int h) throw(); + void addMaskedRegion (int x, int y, int w, int h); //============================================================================== /** Returns the number of currently-active peers. diff --git a/src/gui/components/windows/juce_TopLevelWindow.cpp b/src/gui/components/windows/juce_TopLevelWindow.cpp index 0953d755aa..d14614d10a 100644 --- a/src/gui/components/windows/juce_TopLevelWindow.cpp +++ b/src/gui/components/windows/juce_TopLevelWindow.cpp @@ -95,7 +95,7 @@ public: } } - bool addWindow (TopLevelWindow* const w) throw() + bool addWindow (TopLevelWindow* const w) { windows.add (w); startTimer (10); @@ -103,7 +103,7 @@ public: return isWindowActive (w); } - void removeWindow (TopLevelWindow* const w) throw() + void removeWindow (TopLevelWindow* const w) { startTimer (10); @@ -121,7 +121,7 @@ public: private: TopLevelWindow* currentActive; - bool isWindowActive (TopLevelWindow* const tlw) const throw() + bool isWindowActive (TopLevelWindow* const tlw) const { return (tlw == currentActive || tlw->isParentOf (currentActive) @@ -176,7 +176,7 @@ void TopLevelWindow::focusOfChildComponentChanged (FocusChangeType) TopLevelWindowManager::getInstance()->startTimer (10); } -void TopLevelWindow::setWindowActive (const bool isNowActive) throw() +void TopLevelWindow::setWindowActive (const bool isNowActive) { if (windowIsActive_ != isNowActive) { diff --git a/src/gui/components/windows/juce_TopLevelWindow.h b/src/gui/components/windows/juce_TopLevelWindow.h index 7bdaebb657..533040c08d 100644 --- a/src/gui/components/windows/juce_TopLevelWindow.h +++ b/src/gui/components/windows/juce_TopLevelWindow.h @@ -161,7 +161,7 @@ private: bool useDropShadow, useNativeTitleBar, windowIsActive_; ScopedPointer shadower; - void setWindowActive (bool isNowActive) throw(); + void setWindowActive (bool isNowActive); TopLevelWindow (const TopLevelWindow&); TopLevelWindow& operator= (const TopLevelWindow&); diff --git a/src/gui/graphics/colour/juce_ColourGradient.cpp b/src/gui/graphics/colour/juce_ColourGradient.cpp index b06291aa17..b4ac4f77dc 100644 --- a/src/gui/graphics/colour/juce_ColourGradient.cpp +++ b/src/gui/graphics/colour/juce_ColourGradient.cpp @@ -44,7 +44,7 @@ ColourGradient::ColourGradient (const Colour& colour1, const Colour& colour2, const float x2_, const float y2_, - const bool isRadial_) throw() + const bool isRadial_) : x1 (x1_), y1 (y1_), x2 (x2_), @@ -58,18 +58,18 @@ ColourGradient::ColourGradient (const Colour& colour1, colours.add (colour2.getARGB()); } -ColourGradient::~ColourGradient() throw() +ColourGradient::~ColourGradient() { } //============================================================================== -void ColourGradient::clearColours() throw() +void ColourGradient::clearColours() { colours.clear(); } void ColourGradient::addColour (const double proportionAlongGradient, - const Colour& colour) throw() + const Colour& colour) { // must be within the two end-points jassert (proportionAlongGradient >= 0 && proportionAlongGradient <= 1.0); @@ -136,7 +136,7 @@ const Colour ColourGradient::getColourAtPosition (const float position) const th } //============================================================================== -int ColourGradient::createLookupTable (const AffineTransform& transform, HeapBlock & lookupTable) const throw() +int ColourGradient::createLookupTable (const AffineTransform& transform, HeapBlock & lookupTable) const { #ifdef JUCE_DEBUG // trying to use the object without setting its co-ordinates? Have a careful read of diff --git a/src/gui/graphics/colour/juce_ColourGradient.h b/src/gui/graphics/colour/juce_ColourGradient.h index a9d2fc6a91..507dfa15f3 100644 --- a/src/gui/graphics/colour/juce_ColourGradient.h +++ b/src/gui/graphics/colour/juce_ColourGradient.h @@ -61,7 +61,7 @@ public: */ ColourGradient (const Colour& colour1, float x1, float y1, const Colour& colour2, float x2, float y2, - bool isRadial) throw(); + bool isRadial); /** Creates an uninitialised gradient. @@ -71,7 +71,7 @@ public: ColourGradient() throw(); /** Destructor */ - ~ColourGradient() throw(); + ~ColourGradient(); //============================================================================== /** Removes any colours that have been added. @@ -79,7 +79,7 @@ public: This will also remove any start and end colours, so the gradient won't work. You'll need to add more colours with addColour(). */ - void clearColours() throw(); + void clearColours(); /** Adds a colour at a point along the length of the gradient. @@ -92,7 +92,7 @@ public: @param colour the colour that should be used at this point */ void addColour (double proportionAlongGradient, - const Colour& colour) throw(); + const Colour& colour); /** Multiplies the alpha value of all the colours by the given scale factor */ void multiplyOpacity (float multiplier) throw(); @@ -123,7 +123,7 @@ public: This will resize the HeapBlock, fill it with the colours, and will return the number of colours that it added. */ - int createLookupTable (const AffineTransform& transform, HeapBlock & resultLookupTable) const throw(); + int createLookupTable (const AffineTransform& transform, HeapBlock & resultLookupTable) const; /** Returns true if all colours are opaque. */ bool isOpaque() const throw(); diff --git a/src/gui/graphics/contexts/juce_FillType.cpp b/src/gui/graphics/contexts/juce_FillType.cpp index d3fdf9c866..db52d7522f 100644 --- a/src/gui/graphics/contexts/juce_FillType.cpp +++ b/src/gui/graphics/contexts/juce_FillType.cpp @@ -42,7 +42,7 @@ FillType::FillType (const Colour& colour_) throw() { } -FillType::FillType (const ColourGradient& gradient_) throw() +FillType::FillType (const ColourGradient& gradient_) : colour (0xff000000), gradient (new ColourGradient (gradient_)), image (0) { } @@ -52,14 +52,14 @@ FillType::FillType (const Image& image_, const AffineTransform& transform_) thro { } -FillType::FillType (const FillType& other) throw() +FillType::FillType (const FillType& other) : colour (other.colour), gradient (other.gradient != 0 ? new ColourGradient (*other.gradient) : 0), image (other.image), transform (other.transform) { } -FillType& FillType::operator= (const FillType& other) throw() +FillType& FillType::operator= (const FillType& other) { if (this != &other) { @@ -83,7 +83,7 @@ void FillType::setColour (const Colour& newColour) throw() colour = newColour; } -void FillType::setGradient (const ColourGradient& newGradient) throw() +void FillType::setGradient (const ColourGradient& newGradient) { if (gradient != 0) { diff --git a/src/gui/graphics/contexts/juce_FillType.h b/src/gui/graphics/contexts/juce_FillType.h index 1e0eb81124..1a5d1fbfbf 100644 --- a/src/gui/graphics/contexts/juce_FillType.h +++ b/src/gui/graphics/contexts/juce_FillType.h @@ -54,7 +54,7 @@ public: /** Creates a gradient fill type. @see setGradient */ - FillType (const ColourGradient& gradient) throw(); + FillType (const ColourGradient& gradient); /** Creates a tiled image fill type. The transform allows you to set the scaling, offset and rotation of the pattern. @@ -63,10 +63,10 @@ public: FillType (const Image& image, const AffineTransform& transform) throw(); /** Creates a copy of another FillType. */ - FillType (const FillType& other) throw(); + FillType (const FillType& other); /** Makes a copy of another FillType. */ - FillType& operator= (const FillType& other) throw(); + FillType& operator= (const FillType& other); /** Destructor. */ ~FillType() throw(); @@ -85,7 +85,7 @@ public: void setColour (const Colour& newColour) throw(); /** Turns this object into a gradient fill. */ - void setGradient (const ColourGradient& newGradient) throw(); + void setGradient (const ColourGradient& newGradient); /** Turns this object into a tiled image fill type. The transform allows you to set the scaling, offset and rotation of the pattern. diff --git a/src/gui/graphics/drawables/juce_Drawable.cpp b/src/gui/graphics/drawables/juce_Drawable.cpp index 59027e793d..6f86857893 100644 --- a/src/gui/graphics/drawables/juce_Drawable.cpp +++ b/src/gui/graphics/drawables/juce_Drawable.cpp @@ -133,7 +133,7 @@ Drawable* Drawable::createFromImageFile (const File& file) } //============================================================================== -Drawable* Drawable::createFromValueTree (const ValueTree& tree) throw() +Drawable* Drawable::createFromValueTree (const ValueTree& tree) { Drawable* d = DrawablePath::createFromValueTree (tree); diff --git a/src/gui/graphics/drawables/juce_Drawable.h b/src/gui/graphics/drawables/juce_Drawable.h index 43db2c149e..1f21069e3d 100644 --- a/src/gui/graphics/drawables/juce_Drawable.h +++ b/src/gui/graphics/drawables/juce_Drawable.h @@ -183,13 +183,13 @@ public: /** Tries to create a Drawable from a previously-saved ValueTree. The ValueTree must have been created by the createValueTree() method. */ - static Drawable* createFromValueTree (const ValueTree& tree) throw(); + static Drawable* createFromValueTree (const ValueTree& tree); /** Creates a ValueTree to represent this Drawable. The VarTree that is returned can be turned back into a Drawable with createFromValueTree(). */ - virtual ValueTree createValueTree() const throw() = 0; + virtual ValueTree createValueTree() const = 0; //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.cpp b/src/gui/graphics/drawables/juce_DrawableComposite.cpp index c565e1cc54..814736ee77 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.cpp +++ b/src/gui/graphics/drawables/juce_DrawableComposite.cpp @@ -183,7 +183,7 @@ Drawable* DrawableComposite::createCopy() const } //============================================================================== -ValueTree DrawableComposite::createValueTree() const throw() +ValueTree DrawableComposite::createValueTree() const { ValueTree v ("Group"); @@ -213,7 +213,7 @@ ValueTree DrawableComposite::createValueTree() const throw() return v; } -DrawableComposite* DrawableComposite::createFromValueTree (const ValueTree& tree) throw() +DrawableComposite* DrawableComposite::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Group")) return 0; diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.h b/src/gui/graphics/drawables/juce_DrawableComposite.h index 882af7ac17..aff05168cb 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.h +++ b/src/gui/graphics/drawables/juce_DrawableComposite.h @@ -140,9 +140,9 @@ public: /** @internal */ Drawable* createCopy() const; /** @internal */ - ValueTree createValueTree() const throw(); + ValueTree createValueTree() const; /** @internal */ - static DrawableComposite* createFromValueTree (const ValueTree& tree) throw(); + static DrawableComposite* createFromValueTree (const ValueTree& tree); //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/graphics/drawables/juce_DrawableImage.cpp b/src/gui/graphics/drawables/juce_DrawableImage.cpp index 645d102d46..be456fc09b 100644 --- a/src/gui/graphics/drawables/juce_DrawableImage.cpp +++ b/src/gui/graphics/drawables/juce_DrawableImage.cpp @@ -144,7 +144,7 @@ Drawable* DrawableImage::createCopy() const } //============================================================================== -ValueTree DrawableImage::createValueTree() const throw() +ValueTree DrawableImage::createValueTree() const { ValueTree v ("Image"); @@ -175,7 +175,7 @@ ValueTree DrawableImage::createValueTree() const throw() return v; } -DrawableImage* DrawableImage::createFromValueTree (const ValueTree& tree) throw() +DrawableImage* DrawableImage::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Image")) return 0; diff --git a/src/gui/graphics/drawables/juce_DrawableImage.h b/src/gui/graphics/drawables/juce_DrawableImage.h index ea978ea63e..a5ecbdda70 100644 --- a/src/gui/graphics/drawables/juce_DrawableImage.h +++ b/src/gui/graphics/drawables/juce_DrawableImage.h @@ -108,9 +108,9 @@ public: /** @internal */ Drawable* createCopy() const; /** @internal */ - ValueTree createValueTree() const throw(); + ValueTree createValueTree() const; /** @internal */ - static DrawableImage* createFromValueTree (const ValueTree& tree) throw(); + static DrawableImage* createFromValueTree (const ValueTree& tree); //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/graphics/drawables/juce_DrawablePath.cpp b/src/gui/graphics/drawables/juce_DrawablePath.cpp index b2cb4067ce..82ccfc4c80 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.cpp +++ b/src/gui/graphics/drawables/juce_DrawablePath.cpp @@ -44,29 +44,29 @@ DrawablePath::~DrawablePath() } //============================================================================== -void DrawablePath::setPath (const Path& newPath) throw() +void DrawablePath::setPath (const Path& newPath) { path = newPath; updateOutline(); } -void DrawablePath::setFill (const FillType& newFill) throw() +void DrawablePath::setFill (const FillType& newFill) { mainFill = newFill; } -void DrawablePath::setStrokeFill (const FillType& newFill) throw() +void DrawablePath::setStrokeFill (const FillType& newFill) { strokeFill = newFill; } -void DrawablePath::setStrokeType (const PathStrokeType& newStrokeType) throw() +void DrawablePath::setStrokeType (const PathStrokeType& newStrokeType) { strokeType = newStrokeType; updateOutline(); } -void DrawablePath::setStrokeThickness (const float newThickness) throw() +void DrawablePath::setStrokeThickness (const float newThickness) { setStrokeType (PathStrokeType (newThickness, strokeType.getJointStyle(), strokeType.getEndStyle())); } @@ -195,7 +195,7 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f return v; } -ValueTree DrawablePath::createValueTree() const throw() +ValueTree DrawablePath::createValueTree() const { ValueTree v ("Path"); @@ -215,7 +215,7 @@ ValueTree DrawablePath::createValueTree() const throw() return v; } -DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) throw() +DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Path")) return 0; diff --git a/src/gui/graphics/drawables/juce_DrawablePath.h b/src/gui/graphics/drawables/juce_DrawablePath.h index 0204f3ed15..ae9aa31a23 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.h +++ b/src/gui/graphics/drawables/juce_DrawablePath.h @@ -52,7 +52,7 @@ public: @see setFillColour, setStrokeType */ - void setPath (const Path& newPath) throw(); + void setPath (const Path& newPath); /** Returns the current path. */ const Path& getPath() const throw() { return path; } @@ -65,7 +65,7 @@ public: @see setPath, setStrokeFill */ - void setFill (const FillType& newFill) throw(); + void setFill (const FillType& newFill); /** Returns the current fill type. @see setFill @@ -75,7 +75,7 @@ public: /** Sets the fill type with which the outline will be drawn. @see setFill */ - void setStrokeFill (const FillType& newStrokeFill) throw(); + void setStrokeFill (const FillType& newStrokeFill); /** Returns the current stroke fill. @see setStrokeFill @@ -86,12 +86,12 @@ public: If the stroke has 0 thickness, no stroke will be drawn. @see setStrokeThickness, setStrokeColour */ - void setStrokeType (const PathStrokeType& newStrokeType) throw(); + void setStrokeType (const PathStrokeType& newStrokeType); /** Changes the stroke thickness. This is a shortcut for calling setStrokeType. */ - void setStrokeThickness (float newThickness) throw(); + void setStrokeThickness (float newThickness); /** Returns the current outline style. */ const PathStrokeType& getStrokeType() const throw() { return strokeType; } @@ -107,9 +107,9 @@ public: /** @internal */ Drawable* createCopy() const; /** @internal */ - ValueTree createValueTree() const throw(); + ValueTree createValueTree() const; /** @internal */ - static DrawablePath* createFromValueTree (const ValueTree& tree) throw(); + static DrawablePath* createFromValueTree (const ValueTree& tree); //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/graphics/drawables/juce_DrawableText.cpp b/src/gui/graphics/drawables/juce_DrawableText.cpp index 8009290cbc..c19cd7ae00 100644 --- a/src/gui/graphics/drawables/juce_DrawableText.cpp +++ b/src/gui/graphics/drawables/juce_DrawableText.cpp @@ -27,7 +27,6 @@ BEGIN_JUCE_NAMESPACE - #include "juce_DrawableText.h" @@ -86,7 +85,7 @@ Drawable* DrawableText::createCopy() const } //============================================================================== -ValueTree DrawableText::createValueTree() const throw() +ValueTree DrawableText::createValueTree() const { ValueTree v ("Text"); @@ -97,7 +96,7 @@ ValueTree DrawableText::createValueTree() const throw() return v; } -DrawableText* DrawableText::createFromValueTree (const ValueTree& tree) throw() +DrawableText* DrawableText::createFromValueTree (const ValueTree& tree) { if (! tree.hasType ("Text")) return 0; diff --git a/src/gui/graphics/drawables/juce_DrawableText.h b/src/gui/graphics/drawables/juce_DrawableText.h index 2ead075f2e..5f1c230217 100644 --- a/src/gui/graphics/drawables/juce_DrawableText.h +++ b/src/gui/graphics/drawables/juce_DrawableText.h @@ -78,9 +78,9 @@ public: /** @internal */ Drawable* createCopy() const; /** @internal */ - ValueTree createValueTree() const throw(); + ValueTree createValueTree() const; /** @internal */ - static DrawableText* createFromValueTree (const ValueTree& tree) throw(); + static DrawableText* createFromValueTree (const ValueTree& tree); //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/graphics/geometry/juce_RectangleList.cpp b/src/gui/graphics/geometry/juce_RectangleList.cpp index 31f8d5b8ae..ee492e8087 100644 --- a/src/gui/graphics/geometry/juce_RectangleList.cpp +++ b/src/gui/graphics/geometry/juce_RectangleList.cpp @@ -36,29 +36,29 @@ RectangleList::RectangleList() throw() { } -RectangleList::RectangleList (const Rectangle& rect) throw() +RectangleList::RectangleList (const Rectangle& rect) { if (! rect.isEmpty()) rects.add (rect); } -RectangleList::RectangleList (const RectangleList& other) throw() +RectangleList::RectangleList (const RectangleList& other) : rects (other.rects) { } -RectangleList& RectangleList::operator= (const RectangleList& other) throw() +RectangleList& RectangleList::operator= (const RectangleList& other) { rects = other.rects; return *this; } -RectangleList::~RectangleList() throw() +RectangleList::~RectangleList() { } //============================================================================== -void RectangleList::clear() throw() +void RectangleList::clear() { rects.clearQuick(); } @@ -84,7 +84,7 @@ RectangleList::Iterator::Iterator (const RectangleList& list) throw() { } -RectangleList::Iterator::~Iterator() throw() +RectangleList::Iterator::~Iterator() { } @@ -101,7 +101,7 @@ bool RectangleList::Iterator::next() throw() //============================================================================== -void RectangleList::add (const Rectangle& rect) throw() +void RectangleList::add (const Rectangle& rect) { if (! rect.isEmpty()) { @@ -155,12 +155,12 @@ void RectangleList::add (const Rectangle& rect) throw() } } -void RectangleList::addWithoutMerging (const Rectangle& rect) throw() +void RectangleList::addWithoutMerging (const Rectangle& rect) { rects.add (rect); } -void RectangleList::add (const int x, const int y, const int w, const int h) throw() +void RectangleList::add (const int x, const int y, const int w, const int h) { if (rects.size() == 0) { @@ -173,13 +173,13 @@ void RectangleList::add (const int x, const int y, const int w, const int h) thr } } -void RectangleList::add (const RectangleList& other) throw() +void RectangleList::add (const RectangleList& other) { for (int i = 0; i < other.rects.size(); ++i) add (other.rects.getReference (i)); } -void RectangleList::subtract (const Rectangle& rect) throw() +void RectangleList::subtract (const Rectangle& rect) { const int originalNumRects = rects.size(); @@ -265,13 +265,13 @@ void RectangleList::subtract (const Rectangle& rect) throw() } } -void RectangleList::subtract (const RectangleList& otherList) throw() +void RectangleList::subtract (const RectangleList& otherList) { for (int i = otherList.rects.size(); --i >= 0;) subtract (otherList.rects.getReference (i)); } -bool RectangleList::clipTo (const Rectangle& rect) throw() +bool RectangleList::clipTo (const Rectangle& rect) { bool notEmpty = false; @@ -295,7 +295,7 @@ bool RectangleList::clipTo (const Rectangle& rect) throw() return notEmpty; } -bool RectangleList::clipTo (const RectangleList& other) throw() +bool RectangleList::clipTo (const RectangleList& other) { if (rects.size() == 0) return false; @@ -320,7 +320,7 @@ bool RectangleList::clipTo (const RectangleList& other) throw() return ! isEmpty(); } -bool RectangleList::getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw() +bool RectangleList::getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const { destRegion.clear(); @@ -345,7 +345,7 @@ void RectangleList::swapWith (RectangleList& otherList) throw() //============================================================================== -void RectangleList::consolidate() throw() +void RectangleList::consolidate() { int i; for (i = 0; i < getNumRectangles() - 1; ++i) @@ -427,7 +427,7 @@ bool RectangleList::containsPoint (const int x, const int y) const throw() return false; } -bool RectangleList::containsRectangle (const Rectangle& rectangleToCheck) const throw() +bool RectangleList::containsRectangle (const Rectangle& rectangleToCheck) const { if (rects.size() > 1) { @@ -511,7 +511,7 @@ void RectangleList::offsetAll (const int dx, const int dy) throw() } //============================================================================== -const Path RectangleList::toPath() const throw() +const Path RectangleList::toPath() const { Path p; diff --git a/src/gui/graphics/geometry/juce_RectangleList.h b/src/gui/graphics/geometry/juce_RectangleList.h index 97382382bb..8536b222ca 100644 --- a/src/gui/graphics/geometry/juce_RectangleList.h +++ b/src/gui/graphics/geometry/juce_RectangleList.h @@ -48,16 +48,16 @@ public: RectangleList() throw(); /** Creates a copy of another list */ - RectangleList (const RectangleList& other) throw(); + RectangleList (const RectangleList& other); /** Creates a list containing just one rectangle. */ - RectangleList (const Rectangle& rect) throw(); + RectangleList (const Rectangle& rect); /** Copies this list from another one. */ - RectangleList& operator= (const RectangleList& other) throw(); + RectangleList& operator= (const RectangleList& other); /** Destructor. */ - ~RectangleList() throw(); + ~RectangleList(); //============================================================================== /** Returns true if the region is empty. */ @@ -76,14 +76,14 @@ public: //============================================================================== /** Removes all rectangles to leave an empty region. */ - void clear() throw(); + void clear(); /** Merges a new rectangle into the list. The rectangle being added will first be clipped to remove any parts of it that overlap existing rectangles in the list. */ - void add (int x, int y, int width, int height) throw(); + void add (int x, int y, int width, int height); /** Merges a new rectangle into the list. @@ -91,35 +91,35 @@ public: that overlap existing rectangles in the list, and adjacent rectangles will be merged into it. */ - void add (const Rectangle& rect) throw(); + void add (const Rectangle& rect); /** Dumbly adds a rectangle to the list without checking for overlaps. This simply adds the rectangle to the end, it doesn't merge it or remove any overlapping bits. */ - void addWithoutMerging (const Rectangle& rect) throw(); + void addWithoutMerging (const Rectangle& rect); /** Merges another rectangle list into this one. Any overlaps between the two lists will be clipped, so that the result is the union of both lists. */ - void add (const RectangleList& other) throw(); + void add (const RectangleList& other); /** Removes a rectangular region from the list. Any rectangles in the list which overlap this will be clipped and subdivided if necessary. */ - void subtract (const Rectangle& rect) throw(); + void subtract (const Rectangle& rect); /** Removes all areas in another RectangleList from this one. Any rectangles in the list which overlap this will be clipped and subdivided if necessary. */ - void subtract (const RectangleList& otherList) throw(); + void subtract (const RectangleList& otherList); /** Removes any areas of the region that lie outside a given rectangle. @@ -130,7 +130,7 @@ public: @see getIntersectionWith */ - bool clipTo (const Rectangle& rect) throw(); + bool clipTo (const Rectangle& rect); /** Removes any areas of the region that lie outside a given rectangle list. @@ -141,7 +141,7 @@ public: @see getIntersectionWith */ - bool clipTo (const RectangleList& other) throw(); + bool clipTo (const RectangleList& other); /** Creates a region which is the result of clipping this one to a given rectangle. @@ -152,7 +152,7 @@ public: @see clipTo */ - bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw(); + bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const; /** Swaps the contents of this and another list. @@ -174,7 +174,7 @@ public: defined by this object @see intersectsRectangle, containsPoint */ - bool containsRectangle (const Rectangle& rectangleToCheck) const throw(); + bool containsRectangle (const Rectangle& rectangleToCheck) const; /** Checks whether the region contains any part of a given rectangle. @@ -200,14 +200,14 @@ public: possible, to simplify lists that might have been fragmented by repeated add/subtract calls. */ - void consolidate() throw(); + void consolidate(); /** Adds an x and y value to all the co-ordinates. */ void offsetAll (int dx, int dy) throw(); //============================================================================== /** Creates a Path object to represent this region. */ - const Path toPath() const throw(); + const Path toPath() const; //============================================================================== @@ -217,7 +217,7 @@ public: public: //============================================================================== Iterator (const RectangleList& list) throw(); - ~Iterator() throw(); + ~Iterator(); //============================================================================== /** Advances to the next rectangle, and returns true if it's not finished. diff --git a/src/native/mac/juce_mac_MiscUtilities.mm b/src/native/mac/juce_mac_MiscUtilities.mm index 764bcda7a5..524629c438 100644 --- a/src/native/mac/juce_mac_MiscUtilities.mm +++ b/src/native/mac/juce_mac_MiscUtilities.mm @@ -174,7 +174,7 @@ class ScreenSaverDefeater : public Timer, public DeletedAtShutdown { public: - ScreenSaverDefeater() throw() + ScreenSaverDefeater() { startTimer (10000); timerCallback(); diff --git a/src/native/windows/juce_win32_ASIO.cpp b/src/native/windows/juce_win32_ASIO.cpp index 852c475c47..4d807bade0 100644 --- a/src/native/windows/juce_win32_ASIO.cpp +++ b/src/native/windows/juce_win32_ASIO.cpp @@ -1196,7 +1196,7 @@ private: } //============================================================================== - void callback (const long index) throw() + void callback (const long index) { if (isStarted) { @@ -1212,7 +1212,7 @@ private: calledback = true; } - void processBuffer() throw() + void processBuffer() { const ASIOBufferInfo* const infos = bufferInfos; const int bi = bufferIndex; @@ -1342,7 +1342,7 @@ private: } //============================================================================== - static ASIOTime* bufferSwitchTimeInfoCallback0 (ASIOTime*, long index, long) throw() + static ASIOTime* bufferSwitchTimeInfoCallback0 (ASIOTime*, long index, long) { if (currentASIODev[0] != 0) currentASIODev[0]->callback (index); @@ -1350,7 +1350,7 @@ private: return 0; } - static ASIOTime* bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) throw() + static ASIOTime* bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) { if (currentASIODev[1] != 0) currentASIODev[1]->callback (index); @@ -1358,7 +1358,7 @@ private: return 0; } - static ASIOTime* bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) throw() + static ASIOTime* bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) { if (currentASIODev[2] != 0) currentASIODev[2]->callback (index); @@ -1366,41 +1366,41 @@ private: return 0; } - static void bufferSwitchCallback0 (long index, long) throw() + static void bufferSwitchCallback0 (long index, long) { if (currentASIODev[0] != 0) currentASIODev[0]->callback (index); } - static void bufferSwitchCallback1 (long index, long) throw() + static void bufferSwitchCallback1 (long index, long) { if (currentASIODev[1] != 0) currentASIODev[1]->callback (index); } - static void bufferSwitchCallback2 (long index, long) throw() + static void bufferSwitchCallback2 (long index, long) { if (currentASIODev[2] != 0) currentASIODev[2]->callback (index); } - static long asioMessagesCallback0 (long selector, long value, void*, double*) throw() + static long asioMessagesCallback0 (long selector, long value, void*, double*) { return asioMessagesCallback (selector, value, 0); } - static long asioMessagesCallback1 (long selector, long value, void*, double*) throw() + static long asioMessagesCallback1 (long selector, long value, void*, double*) { return asioMessagesCallback (selector, value, 1); } - static long asioMessagesCallback2 (long selector, long value, void*, double*) throw() + static long asioMessagesCallback2 (long selector, long value, void*, double*) { return asioMessagesCallback (selector, value, 2); } //============================================================================== - static long asioMessagesCallback (long selector, long value, const int deviceIndex) throw() + static long asioMessagesCallback (long selector, long value, const int deviceIndex) { switch (selector) { diff --git a/src/native/windows/juce_win32_Fonts.cpp b/src/native/windows/juce_win32_Fonts.cpp index 1b39e61c8c..525e224a6e 100644 --- a/src/native/windows/juce_win32_Fonts.cpp +++ b/src/native/windows/juce_win32_Fonts.cpp @@ -127,13 +127,13 @@ class FontDCHolder : private DeletedAtShutdown { public: //============================================================================== - FontDCHolder() throw() + FontDCHolder() : dc (0), numKPs (0), size (0), bold (false), italic (false) { } - ~FontDCHolder() throw() + ~FontDCHolder() { if (dc != 0) { @@ -147,7 +147,7 @@ public: juce_DeclareSingleton_SingleThreaded_Minimal (FontDCHolder); //============================================================================== - HDC loadFont (const String& fontName_, const bool bold_, const bool italic_, const int size_) throw() + HDC loadFont (const String& fontName_, const bool bold_, const bool italic_, const int size_) { if (fontName != fontName_ || bold != bold_ || italic != italic_ || size != size_) { @@ -218,7 +218,7 @@ public: } //============================================================================== - KERNINGPAIR* getKerningPairs (int& numKPs_) throw() + KERNINGPAIR* getKerningPairs (int& numKPs_) { if (kps == 0) { diff --git a/src/native/windows/juce_win32_Midi.cpp b/src/native/windows/juce_win32_Midi.cpp index 263e931a98..38d4a8da53 100644 --- a/src/native/windows/juce_win32_Midi.cpp +++ b/src/native/windows/juce_win32_Midi.cpp @@ -77,7 +77,7 @@ public: } //============================================================================== - void handle (const uint32 message, const uint32 timeStamp) throw() + void handle (const uint32 message, const uint32 timeStamp) { const int byte = message & 0xff; if (byte < 0x80) @@ -106,7 +106,7 @@ public: notify(); } - void handleSysEx (MIDIHDR* const hdr, const uint32 timeStamp) throw() + void handleSysEx (MIDIHDR* const hdr, const uint32 timeStamp) { const int num = hdr->dwBytesRecorded; @@ -135,7 +135,7 @@ public: } } - void writeBlock (const int i) throw() + void writeBlock (const int i) { hdr[i].dwBytesRecorded = 0; MMRESULT res = midiInPrepareHeader (hIn, &hdr[i], sizeof (MIDIHDR)); @@ -202,7 +202,7 @@ public: } } - void start() throw() + void start() { jassert (hIn != 0); if (hIn != 0 && ! isStarted) @@ -229,7 +229,7 @@ public: } } - void stop() throw() + void stop() { if (isStarted) { @@ -291,7 +291,7 @@ private: int pendingLength; char pending [MidiConstants::midiBufferSize]; - double timeStampToTime (uint32 timeStamp) throw() + double timeStampToTime (uint32 timeStamp) { timeStamp += startTime;