diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp index 2570d1692e..b060d0e1f9 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp @@ -338,11 +338,8 @@ void GeneratedCode::applyToCode (String& code, const String& oldFileWithUserData) const { // header guard.. - String headerGuard ("__JUCER_HEADER_"); - headerGuard << className.toUpperCase().retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZ") - << "_" << fileNameRoot.toUpperCase().retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZ") - << "_" << String::toHexString (Random::getSystemRandom().nextInt()).toUpperCase() - << "__"; + String headerGuard ("__JUCE_HEADER_"); + headerGuard << String::toHexString ((className + "xx" + fileNameRoot).hashCode64()).toUpperCase() << "__"; replaceTemplate (code, "headerGuard", headerGuard); replaceTemplate (code, "version", JUCEApplication::getInstance()->getApplicationVersion()); diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp index 9a0c2ababb..1a5462c284 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp @@ -526,6 +526,22 @@ bool JucerDocument::findTemplateFiles (String& headerContent, String& cppContent return true; } +static String fixLineEndings (const String& s) +{ + StringArray lines; + lines.addLines (s); + + for (int i = 0; i < lines.size(); ++i) + lines.set (i, lines[i].trimEnd()); + + while (lines.size() > 0 && lines [lines.size() - 1].trim().isEmpty()) + lines.remove (lines.size() - 1); + + lines.add (String::empty); + + return lines.joinIntoString ("\r\n"); +} + bool JucerDocument::flushChangesToDocuments() { String headerTemplate, cppTemplate; @@ -548,6 +564,9 @@ bool JucerDocument::flushChangesToDocuments() generated.applyToCode (headerTemplate, headerFile.getFileNameWithoutExtension(), false, existingHeader); generated.applyToCode (cppTemplate, headerFile.getFileNameWithoutExtension(), false, existingCpp); + headerTemplate = fixLineEndings (headerTemplate); + cppTemplate = fixLineEndings (cppTemplate); + if (header->getCodeDocument().getAllContent() != headerTemplate) header->getCodeDocument().replaceAllContent (headerTemplate); diff --git a/extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h b/extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h index 6cb8f647c8..084947b052 100644 --- a/extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h +++ b/extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h @@ -17,8 +17,8 @@ ============================================================================== */ -#ifndef __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_DCAF1C2C__ -#define __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_DCAF1C2C__ +#ifndef __JUCE_HEADER_B6583AF122163F8__ +#define __JUCE_HEADER_B6583AF122163F8__ //[Headers] -- You can add your own extra header files here -- #include "../jucedemo_headers.h" @@ -73,4 +73,4 @@ private: //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_DCAF1C2C__ +#endif // __JUCE_HEADER_B6583AF122163F8__ diff --git a/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h b/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h index b0bce501a6..f1a0354c13 100644 --- a/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h +++ b/extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h @@ -17,8 +17,8 @@ ============================================================================== */ -#ifndef __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_1B87E5D0__ -#define __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_1B87E5D0__ +#ifndef __JUCE_HEADER_AFB2CF84BB553F2A__ +#define __JUCE_HEADER_AFB2CF84BB553F2A__ //[Headers] -- You can add your own extra header files here -- #include "../jucedemo_headers.h" @@ -93,4 +93,4 @@ private: //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_1B87E5D0__ +#endif // __JUCE_HEADER_AFB2CF84BB553F2A__ diff --git a/extras/JuceDemo/Source/demos/AudioDemoRecordPage.h b/extras/JuceDemo/Source/demos/AudioDemoRecordPage.h index c4c8967ef0..f009ed7736 100644 --- a/extras/JuceDemo/Source/demos/AudioDemoRecordPage.h +++ b/extras/JuceDemo/Source/demos/AudioDemoRecordPage.h @@ -17,8 +17,8 @@ ============================================================================== */ -#ifndef __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_6C08990__ -#define __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_6C08990__ +#ifndef __JUCE_HEADER_F15E29646987960A__ +#define __JUCE_HEADER_F15E29646987960A__ //[Headers] -- You can add your own extra header files here -- #include "../jucedemo_headers.h" @@ -74,4 +74,4 @@ private: //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_6C08990__ +#endif // __JUCE_HEADER_F15E29646987960A__ diff --git a/extras/JuceDemo/Source/demos/AudioDemoSetupPage.h b/extras/JuceDemo/Source/demos/AudioDemoSetupPage.h index e26c6de3b2..771fab3125 100644 --- a/extras/JuceDemo/Source/demos/AudioDemoSetupPage.h +++ b/extras/JuceDemo/Source/demos/AudioDemoSetupPage.h @@ -17,8 +17,8 @@ ============================================================================== */ -#ifndef __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_D771B0A5__ -#define __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_D771B0A5__ +#ifndef __JUCE_HEADER_EF8CB39C6E013E02__ +#define __JUCE_HEADER_EF8CB39C6E013E02__ //[Headers] -- You can add your own extra header files here -- #include "../jucedemo_headers.h" @@ -66,4 +66,4 @@ private: //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_D771B0A5__ +#endif // __JUCE_HEADER_EF8CB39C6E013E02__ diff --git a/extras/JuceDemo/Source/demos/AudioDemoSynthPage.h b/extras/JuceDemo/Source/demos/AudioDemoSynthPage.h index c1a66a720c..f02b1ef18d 100644 --- a/extras/JuceDemo/Source/demos/AudioDemoSynthPage.h +++ b/extras/JuceDemo/Source/demos/AudioDemoSynthPage.h @@ -17,8 +17,8 @@ ============================================================================== */ -#ifndef __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_1A41C21B__ -#define __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_1A41C21B__ +#ifndef __JUCE_HEADER_2088E4B04AA3CC14__ +#define __JUCE_HEADER_2088E4B04AA3CC14__ //[Headers] -- You can add your own extra header files here -- #include "../jucedemo_headers.h" @@ -76,4 +76,4 @@ private: //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_1A41C21B__ +#endif // __JUCE_HEADER_2088E4B04AA3CC14__ diff --git a/extras/JuceDemo/Source/demos/AudioDemoTabComponent.h b/extras/JuceDemo/Source/demos/AudioDemoTabComponent.h index 9ac7548f45..9282a93c1a 100644 --- a/extras/JuceDemo/Source/demos/AudioDemoTabComponent.h +++ b/extras/JuceDemo/Source/demos/AudioDemoTabComponent.h @@ -17,8 +17,8 @@ ============================================================================== */ -#ifndef __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_85D9915C__ -#define __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_85D9915C__ +#ifndef __JUCE_HEADER_6B066C3EF65F4A5E__ +#define __JUCE_HEADER_6B066C3EF65F4A5E__ //[Headers] -- You can add your own extra header files here -- #include "../jucedemo_headers.h" @@ -96,4 +96,4 @@ private: //[EndFile] You can add extra defines here... //[/EndFile] -#endif // __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_85D9915C__ +#endif // __JUCE_HEADER_6B066C3EF65F4A5E__ diff --git a/extras/JuceDemo/Source/demos/DragAndDropDemo.cpp b/extras/JuceDemo/Source/demos/DragAndDropDemo.cpp index d6bea85454..43e2ae1cbe 100644 --- a/extras/JuceDemo/Source/demos/DragAndDropDemo.cpp +++ b/extras/JuceDemo/Source/demos/DragAndDropDemo.cpp @@ -42,10 +42,6 @@ public: setMultipleSelectionEnabled (true); } - ~DragAndDropDemoSource() - { - } - //============================================================================== // The following methods implement the necessary virtual functions from ListBoxModel, // telling the listbox how many rows there are, painting them, etc. diff --git a/extras/JuceDemo/Source/demos/RenderingTestComponent.cpp b/extras/JuceDemo/Source/demos/RenderingTestComponent.cpp index 94b7a29f0d..30a25b28e0 100644 --- a/extras/JuceDemo/Source/demos/RenderingTestComponent.cpp +++ b/extras/JuceDemo/Source/demos/RenderingTestComponent.cpp @@ -1,20 +1,18 @@ /* ============================================================================== - This is an automatically generated file created by the Jucer! - - Creation date: 21 Sep 2012 12:12:19pm + This is an automatically generated GUI class created by the Introjucer! 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 with Introjucer version: 3.1.0 ------------------------------------------------------------------------------ - The Jucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-6 by Raw Material Software ltd. + The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-13 by Raw Material Software Ltd. ============================================================================== */ @@ -422,19 +420,19 @@ RenderingTestComponent::RenderingTestComponent () addAndMakeVisible (testTypeLabel = new Label (String::empty, "Test type:")); - testTypeLabel->setFont (Font (15.0000f, Font::plain)); + testTypeLabel->setFont (Font (15.00f, Font::plain)); testTypeLabel->setJustificationType (Justification::centredRight); testTypeLabel->setEditable (false, false, false); testTypeLabel->setColour (TextEditor::textColourId, Colours::black); - testTypeLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); + testTypeLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (speedLabel = new Label (String::empty, "speed")); - speedLabel->setFont (Font (15.0000f, Font::plain)); + speedLabel->setFont (Font (15.00f, Font::plain)); speedLabel->setJustificationType (Justification::centredLeft); speedLabel->setEditable (false, false, false); speedLabel->setColour (TextEditor::textColourId, Colours::black); - speedLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); + speedLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (testCanvas = new RenderingTestCanvas (*this)); @@ -461,11 +459,11 @@ RenderingTestComponent::RenderingTestComponent () addAndMakeVisible (opacityLabel = new Label (String::empty, "Opacity:")); - opacityLabel->setFont (Font (15.0000f, Font::plain)); + opacityLabel->setFont (Font (15.00f, Font::plain)); opacityLabel->setJustificationType (Justification::centredRight); opacityLabel->setEditable (false, false, false); opacityLabel->setColour (TextEditor::textColourId, Colours::black); - opacityLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); + opacityLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (xSlider = new Slider (String::empty)); xSlider->setRange (-100, 100, 0.1); @@ -494,35 +492,35 @@ RenderingTestComponent::RenderingTestComponent () addAndMakeVisible (xSliderLabel = new Label (String::empty, "X offset:")); - xSliderLabel->setFont (Font (15.0000f, Font::plain)); + xSliderLabel->setFont (Font (15.00f, Font::plain)); xSliderLabel->setJustificationType (Justification::centredRight); xSliderLabel->setEditable (false, false, false); xSliderLabel->setColour (TextEditor::textColourId, Colours::black); - xSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); + xSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (ySliderLabel = new Label (String::empty, "Y offset:")); - ySliderLabel->setFont (Font (15.0000f, Font::plain)); + ySliderLabel->setFont (Font (15.00f, Font::plain)); ySliderLabel->setJustificationType (Justification::centredRight); ySliderLabel->setEditable (false, false, false); ySliderLabel->setColour (TextEditor::textColourId, Colours::black); - ySliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); + ySliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (sizeSliderLabel = new Label (String::empty, "Size:")); - sizeSliderLabel->setFont (Font (15.0000f, Font::plain)); + sizeSliderLabel->setFont (Font (15.00f, Font::plain)); sizeSliderLabel->setJustificationType (Justification::centredRight); sizeSliderLabel->setEditable (false, false, false); sizeSliderLabel->setColour (TextEditor::textColourId, Colours::black); - sizeSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); + sizeSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (angleSliderLabel = new Label (String::empty, "Angle:")); - angleSliderLabel->setFont (Font (15.0000f, Font::plain)); + angleSliderLabel->setFont (Font (15.00f, Font::plain)); angleSliderLabel->setJustificationType (Justification::centredRight); angleSliderLabel->setEditable (false, false, false); angleSliderLabel->setColour (TextEditor::textColourId, Colours::black); - angleSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); + angleSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (clipToRectangleToggle = new ToggleButton (String::empty)); clipToRectangleToggle->setButtonText ("Clip to rectangle"); @@ -595,28 +593,28 @@ void RenderingTestComponent::paint (Graphics& g) void RenderingTestComponent::resized() { - testTypeComboBox->setBounds (proportionOfWidth (0.1658f), 16, proportionOfWidth (0.3436f), 24); - testTypeLabel->setBounds (proportionOfWidth (0.0273f), 16, proportionOfWidth (0.1299f), 24); - speedLabel->setBounds (proportionOfWidth (0.5368f), 16, proportionOfWidth (0.4308f), 24); + testTypeComboBox->setBounds (proportionOfWidth (0.1646f), 16, proportionOfWidth (0.3436f), 24); + testTypeLabel->setBounds (proportionOfWidth (0.0288f), 16, proportionOfWidth (0.1296f), 24); + speedLabel->setBounds (proportionOfWidth (0.5350f), 16, proportionOfWidth (0.4321f), 24); testCanvas->setBounds (20, 56, getWidth() - 40, getHeight() - 215); - opacitySlider->setBounds (proportionOfWidth (0.6000f), getHeight() - 141, proportionOfWidth (0.3795f), 24); - highQualityToggle->setBounds (proportionOfWidth (0.0222f), getHeight() - 141, proportionOfWidth (0.4444f), 24); - animateSizeToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 85, proportionOfWidth (0.2239f), 24); - animateRotationToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 61, proportionOfWidth (0.2239f), 24); - animatePositionToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 109, proportionOfWidth (0.2239f), 24); - animateFillToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 37, proportionOfWidth (0.2359f), 24); - opacityLabel->setBounds ((proportionOfWidth (0.6000f)) + -66, getHeight() - 141, 64, 24); - xSlider->setBounds (proportionOfWidth (0.3607f), getHeight() - 109, proportionOfWidth (0.3795f), 24); - ySlider->setBounds (proportionOfWidth (0.3607f), getHeight() - 85, proportionOfWidth (0.3795f), 24); - sizeSlider->setBounds (proportionOfWidth (0.3607f), getHeight() - 61, proportionOfWidth (0.3795f), 24); - angleSlider->setBounds (proportionOfWidth (0.3607f), getHeight() - 37, proportionOfWidth (0.3795f), 24); - xSliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 109, proportionOfWidth (0.1060f), 24); - ySliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 85, proportionOfWidth (0.1060f), 24); - sizeSliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 61, proportionOfWidth (0.1060f), 24); - angleSliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 37, proportionOfWidth (0.1060f), 24); - clipToRectangleToggle->setBounds (proportionOfWidth (0.0222f), getHeight() - 109, 144, 24); - clipToPathToggle->setBounds (proportionOfWidth (0.0222f), getHeight() - 85, 144, 24); - clipToImageToggle->setBounds (proportionOfWidth (0.0222f), getHeight() - 61, 144, 24); + opacitySlider->setBounds (proportionOfWidth (0.6008f), getHeight() - 141, proportionOfWidth (0.3786f), 24); + highQualityToggle->setBounds (proportionOfWidth (0.0226f), getHeight() - 141, proportionOfWidth (0.4444f), 24); + animateSizeToggle->setBounds (proportionOfWidth (0.7572f), getHeight() - 85, proportionOfWidth (0.2243f), 24); + animateRotationToggle->setBounds (proportionOfWidth (0.7572f), getHeight() - 61, proportionOfWidth (0.2243f), 24); + animatePositionToggle->setBounds (proportionOfWidth (0.7572f), getHeight() - 109, proportionOfWidth (0.2243f), 24); + animateFillToggle->setBounds (proportionOfWidth (0.7572f), getHeight() - 37, proportionOfWidth (0.2366f), 24); + opacityLabel->setBounds ((proportionOfWidth (0.6008f)) + -66, getHeight() - 141, 64, 24); + xSlider->setBounds (proportionOfWidth (0.3601f), getHeight() - 109, proportionOfWidth (0.3786f), 24); + ySlider->setBounds (proportionOfWidth (0.3601f), getHeight() - 85, proportionOfWidth (0.3786f), 24); + sizeSlider->setBounds (proportionOfWidth (0.3601f), getHeight() - 61, proportionOfWidth (0.3786f), 24); + angleSlider->setBounds (proportionOfWidth (0.3601f), getHeight() - 37, proportionOfWidth (0.3786f), 24); + xSliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 109, proportionOfWidth (0.1070f), 24); + ySliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 85, proportionOfWidth (0.1070f), 24); + sizeSliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 61, proportionOfWidth (0.1070f), 24); + angleSliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 37, proportionOfWidth (0.1070f), 24); + clipToRectangleToggle->setBounds (proportionOfWidth (0.0226f), getHeight() - 109, 144, 24); + clipToPathToggle->setBounds (proportionOfWidth (0.0226f), getHeight() - 85, 144, 24); + clipToImageToggle->setBounds (proportionOfWidth (0.0226f), getHeight() - 61, 144, 24); //[UserResized] Add your own custom resize handling here.. //[/UserResized] } @@ -679,9 +677,10 @@ void RenderingTestComponent::sliderValueChanged (Slider* sliderThatWasMoved) //============================================================================== #if 0 -/* -- Jucer information section -- +/* -- Introjucer information section -- - This is where the Jucer puts all of its metadata, so don't change anything in here! + This is where the Introjucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! BEGIN_JUCER_METADATA @@ -691,16 +690,16 @@ BEGIN_JUCER_METADATA fixedSize="0" initialWidth="600" initialHeight="400">