diff --git a/build/linux/JUCE.make b/build/linux/JUCE.make index 4a267a347e..57dff2aaf7 100644 --- a/build/linux/JUCE.make +++ b/build/linux/JUCE.make @@ -51,11 +51,11 @@ OBJECTS := \ $(OBJDIR)/juce_Primes.o \ $(OBJDIR)/juce_RSAKey.o \ $(OBJDIR)/juce_MD5.o \ - $(OBJDIR)/juce_ValueTree.o \ $(OBJDIR)/juce_PropertySet.o \ $(OBJDIR)/juce_NamedValueSet.o \ $(OBJDIR)/juce_MemoryBlock.o \ $(OBJDIR)/juce_Value.o \ + $(OBJDIR)/juce_ValueTree.o \ $(OBJDIR)/juce_BitArray.o \ $(OBJDIR)/juce_DynamicObject.o \ $(OBJDIR)/juce_Variant.o \ @@ -79,12 +79,12 @@ OBJECTS := \ $(OBJDIR)/juce_GZIPCompressorOutputStream.o \ $(OBJDIR)/juce_InputStream.o \ $(OBJDIR)/juce_StringArray.o \ - $(OBJDIR)/juce_String.o \ $(OBJDIR)/juce_StringPairArray.o \ - $(OBJDIR)/juce_CharacterFunctions.o \ $(OBJDIR)/juce_LocalisedStrings.o \ + $(OBJDIR)/juce_String.o \ $(OBJDIR)/juce_XmlElement.o \ $(OBJDIR)/juce_XmlDocument.o \ + $(OBJDIR)/juce_CharacterFunctions.o \ $(OBJDIR)/juce_InterProcessLock.o \ $(OBJDIR)/juce_ReadWriteLock.o \ $(OBJDIR)/juce_Thread.o \ @@ -96,8 +96,8 @@ OBJECTS := \ $(OBJDIR)/juce_ApplicationCommandTarget.o \ $(OBJDIR)/juce_Application.o \ $(OBJDIR)/juce_IIRFilter.o \ - $(OBJDIR)/juce_AudioSampleBuffer.o \ $(OBJDIR)/juce_AudioDataConverters.o \ + $(OBJDIR)/juce_AudioSampleBuffer.o \ $(OBJDIR)/juce_MidiKeyboardState.o \ $(OBJDIR)/juce_MidiMessage.o \ $(OBJDIR)/juce_MidiFile.o \ @@ -120,14 +120,14 @@ OBJECTS := \ $(OBJDIR)/juce_AudioSubsectionReader.o \ $(OBJDIR)/juce_AudioThumbnailCache.o \ $(OBJDIR)/juce_AudioCDReader.o \ - $(OBJDIR)/juce_AudioThumbnail.o \ $(OBJDIR)/juce_AudioFormatManager.o \ $(OBJDIR)/juce_OggVorbisAudioFormat.o \ $(OBJDIR)/juce_AiffAudioFormat.o \ - $(OBJDIR)/juce_AudioFormat.o \ + $(OBJDIR)/juce_AudioThumbnail.o \ $(OBJDIR)/juce_FlacAudioFormat.o \ - $(OBJDIR)/juce_QuickTimeAudioFormat.o \ $(OBJDIR)/juce_WavAudioFormat.o \ + $(OBJDIR)/juce_QuickTimeAudioFormat.o \ + $(OBJDIR)/juce_AudioFormat.o \ $(OBJDIR)/juce_AudioFormatReaderSource.o \ $(OBJDIR)/juce_AudioSourcePlayer.o \ $(OBJDIR)/juce_AudioTransportSource.o \ @@ -163,67 +163,65 @@ OBJECTS := \ $(OBJDIR)/juce_Colours.o \ $(OBJDIR)/juce_Colour.o \ $(OBJDIR)/juce_ColourGradient.o \ - $(OBJDIR)/juce_Graphics.o \ $(OBJDIR)/juce_Justification.o \ $(OBJDIR)/juce_RectanglePlacement.o \ - $(OBJDIR)/juce_FillType.o \ - $(OBJDIR)/juce_EdgeTable.o \ $(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o \ + $(OBJDIR)/juce_EdgeTable.o \ + $(OBJDIR)/juce_FillType.o \ $(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o \ + $(OBJDIR)/juce_Graphics.o \ $(OBJDIR)/juce_DrawableComposite.o \ - $(OBJDIR)/juce_DrawablePath.o \ - $(OBJDIR)/juce_DrawableText.o \ $(OBJDIR)/juce_SVGParser.o \ - $(OBJDIR)/juce_Drawable.o \ + $(OBJDIR)/juce_DrawableText.o \ $(OBJDIR)/juce_DrawableImage.o \ + $(OBJDIR)/juce_DrawablePath.o \ + $(OBJDIR)/juce_Drawable.o \ $(OBJDIR)/juce_ReduceOpacityEffect.o \ $(OBJDIR)/juce_GlowEffect.o \ $(OBJDIR)/juce_DropShadowEffect.o \ - $(OBJDIR)/juce_Font.o \ $(OBJDIR)/juce_TextLayout.o \ $(OBJDIR)/juce_GlyphArrangement.o \ $(OBJDIR)/juce_Typeface.o \ - $(OBJDIR)/juce_Path.o \ + $(OBJDIR)/juce_Font.o \ $(OBJDIR)/juce_BorderSize.o \ $(OBJDIR)/juce_Line.o \ + $(OBJDIR)/juce_Path.o \ $(OBJDIR)/juce_AffineTransform.o \ - $(OBJDIR)/juce_Point.o \ - $(OBJDIR)/juce_Rectangle.o \ $(OBJDIR)/juce_PathIterator.o \ $(OBJDIR)/juce_PathStrokeType.o \ - $(OBJDIR)/juce_PositionedRectangle.o \ $(OBJDIR)/juce_RectangleList.o \ - $(OBJDIR)/juce_Image.o \ + $(OBJDIR)/juce_PositionedRectangle.o \ $(OBJDIR)/juce_ImageFileFormat.o \ $(OBJDIR)/juce_ImageCache.o \ $(OBJDIR)/juce_ImageConvolutionKernel.o \ + $(OBJDIR)/juce_Image.o \ $(OBJDIR)/juce_JPEGLoader.o \ $(OBJDIR)/juce_PNGLoader.o \ $(OBJDIR)/juce_GIFLoader.o \ $(OBJDIR)/juce_ComponentListener.o \ - $(OBJDIR)/juce_Desktop.o \ $(OBJDIR)/juce_Component.o \ + $(OBJDIR)/juce_Desktop.o \ $(OBJDIR)/juce_ArrowButton.o \ $(OBJDIR)/juce_HyperlinkButton.o \ $(OBJDIR)/juce_TextButton.o \ $(OBJDIR)/juce_ToggleButton.o \ - $(OBJDIR)/juce_ShapeButton.o \ - $(OBJDIR)/juce_ToolbarButton.o \ - $(OBJDIR)/juce_DrawableButton.o \ $(OBJDIR)/juce_ImageButton.o \ + $(OBJDIR)/juce_DrawableButton.o \ $(OBJDIR)/juce_Button.o \ - $(OBJDIR)/juce_TreeView.o \ + $(OBJDIR)/juce_ToolbarButton.o \ + $(OBJDIR)/juce_ShapeButton.o \ + $(OBJDIR)/juce_ListBox.o \ $(OBJDIR)/juce_Label.o \ $(OBJDIR)/juce_ToolbarItemPalette.o \ - $(OBJDIR)/juce_TextEditor.o \ - $(OBJDIR)/juce_ToolbarItemComponent.o \ - $(OBJDIR)/juce_Toolbar.o \ - $(OBJDIR)/juce_TableHeaderComponent.o \ - $(OBJDIR)/juce_ProgressBar.o \ $(OBJDIR)/juce_Slider.o \ - $(OBJDIR)/juce_ListBox.o \ + $(OBJDIR)/juce_ProgressBar.o \ $(OBJDIR)/juce_ComboBox.o \ + $(OBJDIR)/juce_TableHeaderComponent.o \ $(OBJDIR)/juce_TableListBox.o \ + $(OBJDIR)/juce_TextEditor.o \ + $(OBJDIR)/juce_Toolbar.o \ + $(OBJDIR)/juce_ToolbarItemComponent.o \ + $(OBJDIR)/juce_TreeView.o \ $(OBJDIR)/juce_CPlusPlusCodeTokeniser.o \ $(OBJDIR)/juce_CodeDocument.o \ $(OBJDIR)/juce_CodeEditorComponent.o \ @@ -241,29 +239,29 @@ OBJECTS := \ $(OBJDIR)/juce_DirectoryContentsDisplayComponent.o \ $(OBJDIR)/juce_KeyListener.o \ $(OBJDIR)/juce_KeyPress.o \ - $(OBJDIR)/juce_KeyboardFocusTraverser.o \ - $(OBJDIR)/juce_ModifierKeys.o \ $(OBJDIR)/juce_KeyPressMappingSet.o \ $(OBJDIR)/juce_KeyMappingEditorComponent.o \ + $(OBJDIR)/juce_KeyboardFocusTraverser.o \ + $(OBJDIR)/juce_ModifierKeys.o \ $(OBJDIR)/juce_ScrollBar.o \ $(OBJDIR)/juce_GroupComponent.o \ $(OBJDIR)/juce_ResizableBorderComponent.o \ $(OBJDIR)/juce_ResizableCornerComponent.o \ - $(OBJDIR)/juce_ComponentAnimator.o \ + $(OBJDIR)/juce_TabbedComponent.o \ $(OBJDIR)/juce_StretchableLayoutResizerBar.o \ - $(OBJDIR)/juce_StretchableObjectResizer.o \ + $(OBJDIR)/juce_ComponentAnimator.o \ $(OBJDIR)/juce_ComponentMovementWatcher.o \ $(OBJDIR)/juce_Viewport.o \ $(OBJDIR)/juce_TabbedButtonBar.o \ $(OBJDIR)/juce_StretchableLayoutManager.o \ - $(OBJDIR)/juce_ComponentBoundsConstrainer.o \ - $(OBJDIR)/juce_TabbedComponent.o \ + $(OBJDIR)/juce_StretchableObjectResizer.o \ $(OBJDIR)/juce_MultiDocumentPanel.o \ + $(OBJDIR)/juce_ComponentBoundsConstrainer.o \ $(OBJDIR)/juce_LookAndFeel.o \ $(OBJDIR)/juce_OldSchoolLookAndFeel.o \ - $(OBJDIR)/juce_PopupMenu.o \ $(OBJDIR)/juce_MenuBarModel.o \ $(OBJDIR)/juce_MenuBarComponent.o \ + $(OBJDIR)/juce_PopupMenu.o \ $(OBJDIR)/juce_ComponentDragger.o \ $(OBJDIR)/juce_MouseEvent.o \ $(OBJDIR)/juce_MouseHoverDetector.o \ @@ -271,30 +269,30 @@ OBJECTS := \ $(OBJDIR)/juce_MouseCursor.o \ $(OBJDIR)/juce_DragAndDropContainer.o \ $(OBJDIR)/juce_ButtonPropertyComponent.o \ + $(OBJDIR)/juce_PropertyPanel.o \ $(OBJDIR)/juce_PropertyComponent.o \ $(OBJDIR)/juce_SliderPropertyComponent.o \ - $(OBJDIR)/juce_PropertyPanel.o \ - $(OBJDIR)/juce_BooleanPropertyComponent.o \ $(OBJDIR)/juce_TextPropertyComponent.o \ $(OBJDIR)/juce_ChoicePropertyComponent.o \ - $(OBJDIR)/juce_ColourSelector.o \ + $(OBJDIR)/juce_BooleanPropertyComponent.o \ $(OBJDIR)/juce_BubbleMessageComponent.o \ $(OBJDIR)/juce_SystemTrayIconComponent.o \ - $(OBJDIR)/juce_BubbleComponent.o \ $(OBJDIR)/juce_PreferencesPanel.o \ $(OBJDIR)/juce_AudioDeviceSelectorComponent.o \ $(OBJDIR)/juce_DropShadower.o \ - $(OBJDIR)/juce_MagnifierComponent.o \ $(OBJDIR)/juce_MidiKeyboardComponent.o \ $(OBJDIR)/juce_OpenGLComponent.o \ - $(OBJDIR)/juce_AlertWindow.o \ + $(OBJDIR)/juce_BubbleComponent.o \ + $(OBJDIR)/juce_ColourSelector.o \ + $(OBJDIR)/juce_MagnifierComponent.o \ + $(OBJDIR)/juce_SplashScreen.o \ $(OBJDIR)/juce_DialogWindow.o \ - $(OBJDIR)/juce_ResizableWindow.o \ $(OBJDIR)/juce_TooltipWindow.o \ $(OBJDIR)/juce_ThreadWithProgressWindow.o \ - $(OBJDIR)/juce_DocumentWindow.o \ + $(OBJDIR)/juce_AlertWindow.o \ $(OBJDIR)/juce_ComponentPeer.o \ - $(OBJDIR)/juce_SplashScreen.o \ + $(OBJDIR)/juce_DocumentWindow.o \ + $(OBJDIR)/juce_ResizableWindow.o \ $(OBJDIR)/juce_TopLevelWindow.o \ $(OBJDIR)/juce_linux_Midi.o \ $(OBJDIR)/juce_linux_Windowing.o \ @@ -412,11 +410,6 @@ $(OBJDIR)/juce_MD5.o: ../../src/cryptography/juce_MD5.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ValueTree.o: ../../src/containers/juce_ValueTree.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_PropertySet.o: ../../src/containers/juce_PropertySet.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -437,6 +430,11 @@ $(OBJDIR)/juce_Value.o: ../../src/containers/juce_Value.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_ValueTree.o: ../../src/containers/juce_ValueTree.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_BitArray.o: ../../src/containers/juce_BitArray.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -552,22 +550,17 @@ $(OBJDIR)/juce_StringArray.o: ../../src/text/juce_StringArray.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_String.o: ../../src/text/juce_String.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_StringPairArray.o: ../../src/text/juce_StringPairArray.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_CharacterFunctions.o: ../../src/text/juce_CharacterFunctions.cpp +$(OBJDIR)/juce_LocalisedStrings.o: ../../src/text/juce_LocalisedStrings.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_LocalisedStrings.o: ../../src/text/juce_LocalisedStrings.cpp +$(OBJDIR)/juce_String.o: ../../src/text/juce_String.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -582,6 +575,11 @@ $(OBJDIR)/juce_XmlDocument.o: ../../src/text/juce_XmlDocument.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_CharacterFunctions.o: ../../src/text/juce_CharacterFunctions.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_InterProcessLock.o: ../../src/threads/juce_InterProcessLock.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -637,12 +635,12 @@ $(OBJDIR)/juce_IIRFilter.o: ../../src/audio/dsp/juce_IIRFilter.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioSampleBuffer.o: ../../src/audio/dsp/juce_AudioSampleBuffer.cpp +$(OBJDIR)/juce_AudioDataConverters.o: ../../src/audio/dsp/juce_AudioDataConverters.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioDataConverters.o: ../../src/audio/dsp/juce_AudioDataConverters.cpp +$(OBJDIR)/juce_AudioSampleBuffer.o: ../../src/audio/dsp/juce_AudioSampleBuffer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -757,11 +755,6 @@ $(OBJDIR)/juce_AudioCDReader.o: ../../src/audio/audio_file_formats/juce_AudioCDR @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioThumbnail.o: ../../src/audio/audio_file_formats/juce_AudioThumbnail.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_AudioFormatManager.o: ../../src/audio/audio_file_formats/juce_AudioFormatManager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -777,7 +770,7 @@ $(OBJDIR)/juce_AiffAudioFormat.o: ../../src/audio/audio_file_formats/juce_AiffAu @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AudioFormat.o: ../../src/audio/audio_file_formats/juce_AudioFormat.cpp +$(OBJDIR)/juce_AudioThumbnail.o: ../../src/audio/audio_file_formats/juce_AudioThumbnail.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -787,12 +780,17 @@ $(OBJDIR)/juce_FlacAudioFormat.o: ../../src/audio/audio_file_formats/juce_FlacAu @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_WavAudioFormat.o: ../../src/audio/audio_file_formats/juce_WavAudioFormat.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_QuickTimeAudioFormat.o: ../../src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_WavAudioFormat.o: ../../src/audio/audio_file_formats/juce_WavAudioFormat.cpp +$(OBJDIR)/juce_AudioFormat.o: ../../src/audio/audio_file_formats/juce_AudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -972,11 +970,6 @@ $(OBJDIR)/juce_ColourGradient.o: ../../src/gui/graphics/colour/juce_ColourGradie @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Graphics.o: ../../src/gui/graphics/contexts/juce_Graphics.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_Justification.o: ../../src/gui/graphics/contexts/juce_Justification.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -987,7 +980,7 @@ $(OBJDIR)/juce_RectanglePlacement.o: ../../src/gui/graphics/contexts/juce_Rectan @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_FillType.o: ../../src/gui/graphics/contexts/juce_FillType.cpp +$(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o: ../../src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -997,7 +990,7 @@ $(OBJDIR)/juce_EdgeTable.o: ../../src/gui/graphics/contexts/juce_EdgeTable.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o: ../../src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +$(OBJDIR)/juce_FillType.o: ../../src/gui/graphics/contexts/juce_FillType.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1007,27 +1000,22 @@ $(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o: ../../src/gui/graphics/cont @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_Graphics.o: ../../src/gui/graphics/contexts/juce_Graphics.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_DrawableComposite.o: ../../src/gui/graphics/drawables/juce_DrawableComposite.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_DrawablePath.o: ../../src/gui/graphics/drawables/juce_DrawablePath.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_DrawableText.o: ../../src/gui/graphics/drawables/juce_DrawableText.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_SVGParser.o: ../../src/gui/graphics/drawables/juce_SVGParser.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Drawable.o: ../../src/gui/graphics/drawables/juce_Drawable.cpp +$(OBJDIR)/juce_DrawableText.o: ../../src/gui/graphics/drawables/juce_DrawableText.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1037,6 +1025,16 @@ $(OBJDIR)/juce_DrawableImage.o: ../../src/gui/graphics/drawables/juce_DrawableIm @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_DrawablePath.o: ../../src/gui/graphics/drawables/juce_DrawablePath.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_Drawable.o: ../../src/gui/graphics/drawables/juce_Drawable.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_ReduceOpacityEffect.o: ../../src/gui/graphics/effects/juce_ReduceOpacityEffect.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1052,11 +1050,6 @@ $(OBJDIR)/juce_DropShadowEffect.o: ../../src/gui/graphics/effects/juce_DropShado @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Font.o: ../../src/gui/graphics/fonts/juce_Font.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_TextLayout.o: ../../src/gui/graphics/fonts/juce_TextLayout.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1072,7 +1065,7 @@ $(OBJDIR)/juce_Typeface.o: ../../src/gui/graphics/fonts/juce_Typeface.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Path.o: ../../src/gui/graphics/geometry/juce_Path.cpp +$(OBJDIR)/juce_Font.o: ../../src/gui/graphics/fonts/juce_Font.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1087,21 +1080,16 @@ $(OBJDIR)/juce_Line.o: ../../src/gui/graphics/geometry/juce_Line.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_Path.o: ../../src/gui/graphics/geometry/juce_Path.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_AffineTransform.o: ../../src/gui/graphics/geometry/juce_AffineTransform.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Point.o: ../../src/gui/graphics/geometry/juce_Point.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_Rectangle.o: ../../src/gui/graphics/geometry/juce_Rectangle.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_PathIterator.o: ../../src/gui/graphics/geometry/juce_PathIterator.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1112,17 +1100,12 @@ $(OBJDIR)/juce_PathStrokeType.o: ../../src/gui/graphics/geometry/juce_PathStroke @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PositionedRectangle.o: ../../src/gui/graphics/geometry/juce_PositionedRectangle.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_RectangleList.o: ../../src/gui/graphics/geometry/juce_RectangleList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Image.o: ../../src/gui/graphics/imaging/juce_Image.cpp +$(OBJDIR)/juce_PositionedRectangle.o: ../../src/gui/graphics/geometry/juce_PositionedRectangle.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1142,6 +1125,11 @@ $(OBJDIR)/juce_ImageConvolutionKernel.o: ../../src/gui/graphics/imaging/juce_Ima @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_Image.o: ../../src/gui/graphics/imaging/juce_Image.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_JPEGLoader.o: ../../src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1162,12 +1150,12 @@ $(OBJDIR)/juce_ComponentListener.o: ../../src/gui/components/juce_ComponentListe @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Desktop.o: ../../src/gui/components/juce_Desktop.cpp +$(OBJDIR)/juce_Component.o: ../../src/gui/components/juce_Component.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Component.o: ../../src/gui/components/juce_Component.cpp +$(OBJDIR)/juce_Desktop.o: ../../src/gui/components/juce_Desktop.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1192,12 +1180,7 @@ $(OBJDIR)/juce_ToggleButton.o: ../../src/gui/components/buttons/juce_ToggleButto @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ShapeButton.o: ../../src/gui/components/buttons/juce_ShapeButton.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_ToolbarButton.o: ../../src/gui/components/buttons/juce_ToolbarButton.cpp +$(OBJDIR)/juce_ImageButton.o: ../../src/gui/components/buttons/juce_ImageButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1207,17 +1190,22 @@ $(OBJDIR)/juce_DrawableButton.o: ../../src/gui/components/buttons/juce_DrawableB @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ImageButton.o: ../../src/gui/components/buttons/juce_ImageButton.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_Button.o: ../../src/gui/components/buttons/juce_Button.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TreeView.o: ../../src/gui/components/controls/juce_TreeView.cpp +$(OBJDIR)/juce_ToolbarButton.o: ../../src/gui/components/buttons/juce_ToolbarButton.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_ShapeButton.o: ../../src/gui/components/buttons/juce_ShapeButton.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_ListBox.o: ../../src/gui/components/controls/juce_ListBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1232,22 +1220,7 @@ $(OBJDIR)/juce_ToolbarItemPalette.o: ../../src/gui/components/controls/juce_Tool @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_TextEditor.o: ../../src/gui/components/controls/juce_TextEditor.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_ToolbarItemComponent.o: ../../src/gui/components/controls/juce_ToolbarItemComponent.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_Toolbar.o: ../../src/gui/components/controls/juce_Toolbar.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_TableHeaderComponent.o: ../../src/gui/components/controls/juce_TableHeaderComponent.cpp +$(OBJDIR)/juce_Slider.o: ../../src/gui/components/controls/juce_Slider.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1257,26 +1230,41 @@ $(OBJDIR)/juce_ProgressBar.o: ../../src/gui/components/controls/juce_ProgressBar @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_Slider.o: ../../src/gui/components/controls/juce_Slider.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_ListBox.o: ../../src/gui/components/controls/juce_ListBox.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_ComboBox.o: ../../src/gui/components/controls/juce_ComboBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_TableHeaderComponent.o: ../../src/gui/components/controls/juce_TableHeaderComponent.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_TableListBox.o: ../../src/gui/components/controls/juce_TableListBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_TextEditor.o: ../../src/gui/components/controls/juce_TextEditor.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_Toolbar.o: ../../src/gui/components/controls/juce_Toolbar.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_ToolbarItemComponent.o: ../../src/gui/components/controls/juce_ToolbarItemComponent.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_TreeView.o: ../../src/gui/components/controls/juce_TreeView.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_CPlusPlusCodeTokeniser.o: ../../src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1362,16 +1350,6 @@ $(OBJDIR)/juce_KeyPress.o: ../../src/gui/components/keyboard/juce_KeyPress.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_KeyboardFocusTraverser.o: ../../src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_ModifierKeys.o: ../../src/gui/components/keyboard/juce_ModifierKeys.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_KeyPressMappingSet.o: ../../src/gui/components/keyboard/juce_KeyPressMappingSet.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1382,6 +1360,16 @@ $(OBJDIR)/juce_KeyMappingEditorComponent.o: ../../src/gui/components/keyboard/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_KeyboardFocusTraverser.o: ../../src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_ModifierKeys.o: ../../src/gui/components/keyboard/juce_ModifierKeys.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_ScrollBar.o: ../../src/gui/components/layout/juce_ScrollBar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1402,7 +1390,7 @@ $(OBJDIR)/juce_ResizableCornerComponent.o: ../../src/gui/components/layout/juce_ @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ComponentAnimator.o: ../../src/gui/components/layout/juce_ComponentAnimator.cpp +$(OBJDIR)/juce_TabbedComponent.o: ../../src/gui/components/layout/juce_TabbedComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1412,7 +1400,7 @@ $(OBJDIR)/juce_StretchableLayoutResizerBar.o: ../../src/gui/components/layout/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_StretchableObjectResizer.o: ../../src/gui/components/layout/juce_StretchableObjectResizer.cpp +$(OBJDIR)/juce_ComponentAnimator.o: ../../src/gui/components/layout/juce_ComponentAnimator.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1437,12 +1425,7 @@ $(OBJDIR)/juce_StretchableLayoutManager.o: ../../src/gui/components/layout/juce_ @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ComponentBoundsConstrainer.o: ../../src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_TabbedComponent.o: ../../src/gui/components/layout/juce_TabbedComponent.cpp +$(OBJDIR)/juce_StretchableObjectResizer.o: ../../src/gui/components/layout/juce_StretchableObjectResizer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1452,6 +1435,11 @@ $(OBJDIR)/juce_MultiDocumentPanel.o: ../../src/gui/components/layout/juce_MultiD @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_ComponentBoundsConstrainer.o: ../../src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_LookAndFeel.o: ../../src/gui/components/lookandfeel/juce_LookAndFeel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1462,11 +1450,6 @@ $(OBJDIR)/juce_OldSchoolLookAndFeel.o: ../../src/gui/components/lookandfeel/juce @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PopupMenu.o: ../../src/gui/components/menus/juce_PopupMenu.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_MenuBarModel.o: ../../src/gui/components/menus/juce_MenuBarModel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1477,6 +1460,11 @@ $(OBJDIR)/juce_MenuBarComponent.o: ../../src/gui/components/menus/juce_MenuBarCo @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_PopupMenu.o: ../../src/gui/components/menus/juce_PopupMenu.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_ComponentDragger.o: ../../src/gui/components/mouse/juce_ComponentDragger.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1512,6 +1500,11 @@ $(OBJDIR)/juce_ButtonPropertyComponent.o: ../../src/gui/components/properties/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/juce_PropertyPanel.o: ../../src/gui/components/properties/juce_PropertyPanel.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/juce_PropertyComponent.o: ../../src/gui/components/properties/juce_PropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1522,16 +1515,6 @@ $(OBJDIR)/juce_SliderPropertyComponent.o: ../../src/gui/components/properties/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_PropertyPanel.o: ../../src/gui/components/properties/juce_PropertyPanel.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_BooleanPropertyComponent.o: ../../src/gui/components/properties/juce_BooleanPropertyComponent.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_TextPropertyComponent.o: ../../src/gui/components/properties/juce_TextPropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1542,7 +1525,7 @@ $(OBJDIR)/juce_ChoicePropertyComponent.o: ../../src/gui/components/properties/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ColourSelector.o: ../../src/gui/components/special/juce_ColourSelector.cpp +$(OBJDIR)/juce_BooleanPropertyComponent.o: ../../src/gui/components/properties/juce_BooleanPropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1557,11 +1540,6 @@ $(OBJDIR)/juce_SystemTrayIconComponent.o: ../../src/gui/components/special/juce_ @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_BubbleComponent.o: ../../src/gui/components/special/juce_BubbleComponent.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_PreferencesPanel.o: ../../src/gui/components/special/juce_PreferencesPanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1577,11 +1555,6 @@ $(OBJDIR)/juce_DropShadower.o: ../../src/gui/components/special/juce_DropShadowe @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_MagnifierComponent.o: ../../src/gui/components/special/juce_MagnifierComponent.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_MidiKeyboardComponent.o: ../../src/gui/components/special/juce_MidiKeyboardComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1592,7 +1565,22 @@ $(OBJDIR)/juce_OpenGLComponent.o: ../../src/gui/components/special/juce_OpenGLCo @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_AlertWindow.o: ../../src/gui/components/windows/juce_AlertWindow.cpp +$(OBJDIR)/juce_BubbleComponent.o: ../../src/gui/components/special/juce_BubbleComponent.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_ColourSelector.o: ../../src/gui/components/special/juce_ColourSelector.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_MagnifierComponent.o: ../../src/gui/components/special/juce_MagnifierComponent.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_SplashScreen.o: ../../src/gui/components/windows/juce_SplashScreen.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1602,11 +1590,6 @@ $(OBJDIR)/juce_DialogWindow.o: ../../src/gui/components/windows/juce_DialogWindo @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_ResizableWindow.o: ../../src/gui/components/windows/juce_ResizableWindow.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/juce_TooltipWindow.o: ../../src/gui/components/windows/juce_TooltipWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -1617,7 +1600,7 @@ $(OBJDIR)/juce_ThreadWithProgressWindow.o: ../../src/gui/components/windows/juce @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_DocumentWindow.o: ../../src/gui/components/windows/juce_DocumentWindow.cpp +$(OBJDIR)/juce_AlertWindow.o: ../../src/gui/components/windows/juce_AlertWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1627,7 +1610,12 @@ $(OBJDIR)/juce_ComponentPeer.o: ../../src/gui/components/windows/juce_ComponentP @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_SplashScreen.o: ../../src/gui/components/windows/juce_SplashScreen.cpp +$(OBJDIR)/juce_DocumentWindow.o: ../../src/gui/components/windows/juce_DocumentWindow.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_ResizableWindow.o: ../../src/gui/components/windows/juce_ResizableWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" diff --git a/build/macosx/Juce.xcodeproj/project.pbxproj b/build/macosx/Juce.xcodeproj/project.pbxproj index 27c8eb363d..47f5f614b0 100644 --- a/build/macosx/Juce.xcodeproj/project.pbxproj +++ b/build/macosx/Juce.xcodeproj/project.pbxproj @@ -542,7 +542,6 @@ 8481706010809E00008FEC33 /* juce_PluginDirectoryScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E7D010403614006A1807 /* juce_PluginDirectoryScanner.cpp */; }; 8481706110809E00008FEC33 /* juce_PluginListComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E7D210403614006A1807 /* juce_PluginListComponent.cpp */; }; 8481706210809E00008FEC33 /* juce_PNGLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB7910403709006A1807 /* juce_PNGLoader.cpp */; }; - 8481706310809E00008FEC33 /* juce_Point.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6310403709006A1807 /* juce_Point.cpp */; }; 8481706410809E00008FEC33 /* juce_PopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EACA10403709006A1807 /* juce_PopupMenu.cpp */; }; 8481706510809E00008FEC33 /* juce_PositionedRectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6510403709006A1807 /* juce_PositionedRectangle.cpp */; }; 8481706610809E00008FEC33 /* juce_posix_NamedPipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8484E9D7103C95A6008B7C6C /* juce_posix_NamedPipe.cpp */; }; @@ -557,7 +556,6 @@ 8481706F10809E00008FEC33 /* juce_Random.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E8FB10403681006A1807 /* juce_Random.cpp */; }; 8481707010809E00008FEC33 /* juce_ReadWriteLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9DD104036D6006A1807 /* juce_ReadWriteLock.cpp */; }; 8481707110809E00008FEC33 /* juce_RecentlyOpenedFilesList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1E9301040369C006A1807 /* juce_RecentlyOpenedFilesList.cpp */; }; - 8481707210809E00008FEC33 /* juce_Rectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6710403709006A1807 /* juce_Rectangle.cpp */; }; 8481707310809E00008FEC33 /* juce_RectangleList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6910403709006A1807 /* juce_RectangleList.cpp */; }; 8481707410809E00008FEC33 /* juce_RectanglePlacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB3710403709006A1807 /* juce_RectanglePlacement.cpp */; }; 8481707510809E00008FEC33 /* juce_ReduceOpacityEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB4B10403709006A1807 /* juce_ReduceOpacityEffect.cpp */; }; @@ -1206,11 +1204,9 @@ 84F1ECD31040370A006A1807 /* juce_PathIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1EB6010403709006A1807 /* juce_PathIterator.h */; }; 84F1ECD41040370A006A1807 /* juce_PathStrokeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6110403709006A1807 /* juce_PathStrokeType.cpp */; }; 84F1ECD51040370A006A1807 /* juce_PathStrokeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1EB6210403709006A1807 /* juce_PathStrokeType.h */; }; - 84F1ECD61040370A006A1807 /* juce_Point.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6310403709006A1807 /* juce_Point.cpp */; }; 84F1ECD71040370A006A1807 /* juce_Point.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1EB6410403709006A1807 /* juce_Point.h */; }; 84F1ECD81040370A006A1807 /* juce_PositionedRectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6510403709006A1807 /* juce_PositionedRectangle.cpp */; }; 84F1ECD91040370A006A1807 /* juce_PositionedRectangle.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1EB6610403709006A1807 /* juce_PositionedRectangle.h */; }; - 84F1ECDA1040370A006A1807 /* juce_Rectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6710403709006A1807 /* juce_Rectangle.cpp */; }; 84F1ECDB1040370A006A1807 /* juce_Rectangle.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1EB6810403709006A1807 /* juce_Rectangle.h */; }; 84F1ECDC1040370A006A1807 /* juce_RectangleList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1EB6910403709006A1807 /* juce_RectangleList.cpp */; }; 84F1ECDD1040370A006A1807 /* juce_RectangleList.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F1EB6A10403709006A1807 /* juce_RectangleList.h */; }; @@ -1823,11 +1819,9 @@ 84F1EB6010403709006A1807 /* juce_PathIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_PathIterator.h; path = ../../src/gui/graphics/geometry/juce_PathIterator.h; sourceTree = SOURCE_ROOT; }; 84F1EB6110403709006A1807 /* juce_PathStrokeType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_PathStrokeType.cpp; path = ../../src/gui/graphics/geometry/juce_PathStrokeType.cpp; sourceTree = SOURCE_ROOT; }; 84F1EB6210403709006A1807 /* juce_PathStrokeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_PathStrokeType.h; path = ../../src/gui/graphics/geometry/juce_PathStrokeType.h; sourceTree = SOURCE_ROOT; }; - 84F1EB6310403709006A1807 /* juce_Point.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Point.cpp; path = ../../src/gui/graphics/geometry/juce_Point.cpp; sourceTree = SOURCE_ROOT; }; 84F1EB6410403709006A1807 /* juce_Point.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_Point.h; path = ../../src/gui/graphics/geometry/juce_Point.h; sourceTree = SOURCE_ROOT; }; 84F1EB6510403709006A1807 /* juce_PositionedRectangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_PositionedRectangle.cpp; path = ../../src/gui/graphics/geometry/juce_PositionedRectangle.cpp; sourceTree = SOURCE_ROOT; }; 84F1EB6610403709006A1807 /* juce_PositionedRectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_PositionedRectangle.h; path = ../../src/gui/graphics/geometry/juce_PositionedRectangle.h; sourceTree = SOURCE_ROOT; }; - 84F1EB6710403709006A1807 /* juce_Rectangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Rectangle.cpp; path = ../../src/gui/graphics/geometry/juce_Rectangle.cpp; sourceTree = SOURCE_ROOT; }; 84F1EB6810403709006A1807 /* juce_Rectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_Rectangle.h; path = ../../src/gui/graphics/geometry/juce_Rectangle.h; sourceTree = SOURCE_ROOT; }; 84F1EB6910403709006A1807 /* juce_RectangleList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = juce_RectangleList.cpp; path = ../../src/gui/graphics/geometry/juce_RectangleList.cpp; sourceTree = SOURCE_ROOT; }; 84F1EB6A10403709006A1807 /* juce_RectangleList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_RectangleList.h; path = ../../src/gui/graphics/geometry/juce_RectangleList.h; sourceTree = SOURCE_ROOT; }; @@ -2877,11 +2871,9 @@ 84F1EB6010403709006A1807 /* juce_PathIterator.h */, 84F1EB6110403709006A1807 /* juce_PathStrokeType.cpp */, 84F1EB6210403709006A1807 /* juce_PathStrokeType.h */, - 84F1EB6310403709006A1807 /* juce_Point.cpp */, 84F1EB6410403709006A1807 /* juce_Point.h */, 84F1EB6510403709006A1807 /* juce_PositionedRectangle.cpp */, 84F1EB6610403709006A1807 /* juce_PositionedRectangle.h */, - 84F1EB6710403709006A1807 /* juce_Rectangle.cpp */, 84F1EB6810403709006A1807 /* juce_Rectangle.h */, 84F1EB6910403709006A1807 /* juce_RectangleList.cpp */, 84F1EB6A10403709006A1807 /* juce_RectangleList.h */, @@ -3842,7 +3834,6 @@ 8481706010809E00008FEC33 /* juce_PluginDirectoryScanner.cpp in Sources */, 8481706110809E00008FEC33 /* juce_PluginListComponent.cpp in Sources */, 8481706210809E00008FEC33 /* juce_PNGLoader.cpp in Sources */, - 8481706310809E00008FEC33 /* juce_Point.cpp in Sources */, 8481706410809E00008FEC33 /* juce_PopupMenu.cpp in Sources */, 8481706510809E00008FEC33 /* juce_PositionedRectangle.cpp in Sources */, 8481706610809E00008FEC33 /* juce_posix_NamedPipe.cpp in Sources */, @@ -3857,7 +3848,6 @@ 8481706F10809E00008FEC33 /* juce_Random.cpp in Sources */, 8481707010809E00008FEC33 /* juce_ReadWriteLock.cpp in Sources */, 8481707110809E00008FEC33 /* juce_RecentlyOpenedFilesList.cpp in Sources */, - 8481707210809E00008FEC33 /* juce_Rectangle.cpp in Sources */, 8481707310809E00008FEC33 /* juce_RectangleList.cpp in Sources */, 8481707410809E00008FEC33 /* juce_RectanglePlacement.cpp in Sources */, 8481707510809E00008FEC33 /* juce_ReduceOpacityEffect.cpp in Sources */, @@ -4201,9 +4191,7 @@ 84F1ECD01040370A006A1807 /* juce_Path.cpp in Sources */, 84F1ECD21040370A006A1807 /* juce_PathIterator.cpp in Sources */, 84F1ECD41040370A006A1807 /* juce_PathStrokeType.cpp in Sources */, - 84F1ECD61040370A006A1807 /* juce_Point.cpp in Sources */, 84F1ECD81040370A006A1807 /* juce_PositionedRectangle.cpp in Sources */, - 84F1ECDA1040370A006A1807 /* juce_Rectangle.cpp in Sources */, 84F1ECDC1040370A006A1807 /* juce_RectangleList.cpp in Sources */, 84F1ECDF1040370A006A1807 /* juce_Image.cpp in Sources */, 84F1ECE11040370A006A1807 /* juce_ImageCache.cpp in Sources */, diff --git a/build/win32/vc8/JUCE.vcproj b/build/win32/vc8/JUCE.vcproj index a03b0fc764..9d09bfa26f 100644 --- a/build/win32/vc8/JUCE.vcproj +++ b/build/win32/vc8/JUCE.vcproj @@ -2471,10 +2471,6 @@ RelativePath="..\..\..\src\gui\graphics\geometry\juce_PathStrokeType.h" > - - @@ -2487,10 +2483,6 @@ RelativePath="..\..\..\src\gui\graphics\geometry\juce_PositionedRectangle.h" > - - diff --git a/extras/audio plugin host/src/host/GraphEditorPanel.cpp b/extras/audio plugin host/src/host/GraphEditorPanel.cpp index 2acc77bc0a..e2d98f9423 100644 --- a/extras/audio plugin host/src/host/GraphEditorPanel.cpp +++ b/extras/audio plugin host/src/host/GraphEditorPanel.cpp @@ -540,10 +540,10 @@ public: float x1, y1, x2, y2; getPoints (x1, y1, x2, y2); - const Rectangle newBounds ((int) jmin (x1, x2) - 4, - (int) jmin (y1, y2) - 4, - (int) fabsf (x1 - x2) + 8, - (int) fabsf (y1 - y2) + 8); + const Rectangle newBounds ((int) jmin (x1, x2) - 4, + (int) jmin (y1, y2) - 4, + (int) fabsf (x1 - x2) + 8, + (int) fabsf (y1 - y2) + 8); if (newBounds != getBounds()) setBounds (newBounds); diff --git a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm index 93c9031e0b..f19dd4dfa4 100644 --- a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm +++ b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm @@ -29,8 +29,7 @@ #include #include "AUMIDIEffectBase.h" #include "MusicDeviceBase.h" -#include "../juce_PluginHeaders.h" -#include "../juce_PluginHostType.h" +#include "../juce_IncludeCharacteristics.h" #if JucePlugin_Build_AU @@ -48,6 +47,9 @@ class JuceAUView; #endif +#include "../juce_PluginHeaders.h" +#include "../juce_PluginHostType.h" + //============================================================================== #define juceFilterObjectPropertyID 0x1a45ffe9 static VoidArray activePlugins, activeUIs; diff --git a/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp b/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp index 4347d1446e..cee09e2d08 100644 --- a/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp +++ b/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp @@ -45,8 +45,6 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, { setTitleBarButtonsRequired (DocumentWindow::minimiseButton | DocumentWindow::closeButton, false); - PropertySet* const globalSettings = getGlobalSettings(); - optionsButton = new TextButton (T("options")); Component::addAndMakeVisible (optionsButton); optionsButton->addButtonListener (this); @@ -58,6 +56,8 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, if (filter != 0) { + PropertySet* const globalSettings = getGlobalSettings(); + deviceManager = new AudioFilterStreamingDeviceManager(); deviceManager->setFilter (filter); diff --git a/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp b/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp index e19a93c7e4..a18647a8a1 100644 --- a/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp +++ b/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp @@ -419,8 +419,8 @@ public: x -= frame.origin.x; y -= frame.origin.y; - Rectangle rr (frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); - Rectangle rr2 (bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height); + Rectangle rr (frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); + Rectangle rr2 (bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height); //log (String ((int) x) + ", " + String ((int) y) + " - " + nsStringToJuce([parent description]) + " " + rr.toString() + " " + rr2.toString()); if (x >= 0 && x < frame.size.width && y >= 0 && y < frame.size.height) @@ -479,11 +479,11 @@ public: #endif log ("window: " + nsStringToJuce ([win description])); - const Rectangle clip (window->clipRect.left, window->clipRect.top, + const Rectangle clip (window->clipRect.left, window->clipRect.top, window->clipRect.right - window->clipRect.left, window->clipRect.bottom - window->clipRect.top); - const Rectangle target ((int) window->x, (int) window->y, (int) window->width, (int) window->height); - const Rectangle intersection (clip.getIntersection (target)); + const Rectangle target ((int) window->x, (int) window->y, (int) window->width, (int) window->height); + const Rectangle intersection (clip.getIntersection (target)); // in firefox the clip rect is usually out of step with the target rect, but in safari it matches log ("plugin window clip: " + clip.toString()); @@ -501,8 +501,8 @@ public: NSRect v = [content convertRect: [content frame] toView: nil]; NSRect w = [win frame]; - log ("wx: " + Rectangle (v.origin.x, v.origin.y, v.size.width, v.size.height).toString() - + " " + Rectangle (w.origin.x, w.origin.y, w.size.width, w.size.height).toString()); + log ("wx: " + Rectangle (v.origin.x, v.origin.y, v.size.width, v.size.height).toString() + + " " + Rectangle (w.origin.x, w.origin.y, w.size.width, w.size.height).toString()); // adjust the requested window pos to deal with the content view's origin within the window wy -= w.size.height - (v.origin.y + v.size.height); diff --git a/extras/juce demo/build/linux/JuceDemo.make b/extras/juce demo/build/linux/JuceDemo.make index d145d4ba7b..65ab3313b6 100644 --- a/extras/juce demo/build/linux/JuceDemo.make +++ b/extras/juce demo/build/linux/JuceDemo.make @@ -41,9 +41,8 @@ endif OBJECTS := \ $(OBJDIR)/BinaryData.o \ $(OBJDIR)/juce_LibrarySource.o \ - $(OBJDIR)/ApplicationStartup.o \ $(OBJDIR)/MainDemoWindow.o \ - $(OBJDIR)/AudioDemoLatencyPage.o \ + $(OBJDIR)/ApplicationStartup.o \ $(OBJDIR)/AudioDemoPlaybackPage.o \ $(OBJDIR)/AudioDemoSetupPage.o \ $(OBJDIR)/AudioDemoSynthPage.o \ @@ -55,12 +54,13 @@ OBJECTS := \ $(OBJDIR)/OpenGLDemo.o \ $(OBJDIR)/QuickTimeDemo.o \ $(OBJDIR)/TableDemo.o \ - $(OBJDIR)/ThreadingDemo.o \ $(OBJDIR)/TreeViewDemo.o \ $(OBJDIR)/WebBrowserDemo.o \ $(OBJDIR)/CodeEditorDemo.o \ $(OBJDIR)/RenderingTestComponent.o \ $(OBJDIR)/AudioDemoRecordPage.o \ + $(OBJDIR)/AudioDemoLatencyPage.o \ + $(OBJDIR)/ThreadingDemo.o \ $(OBJDIR)/WidgetsDemo.o \ MKDIR_TYPE := msdos @@ -113,17 +113,12 @@ $(OBJDIR)/juce_LibrarySource.o: ../../src/juce_LibrarySource.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/ApplicationStartup.o: ../../src/ApplicationStartup.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/MainDemoWindow.o: ../../src/MainDemoWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/AudioDemoLatencyPage.o: ../../src/demos/AudioDemoLatencyPage.cpp +$(OBJDIR)/ApplicationStartup.o: ../../src/ApplicationStartup.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -183,11 +178,6 @@ $(OBJDIR)/TableDemo.o: ../../src/demos/TableDemo.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/ThreadingDemo.o: ../../src/demos/ThreadingDemo.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/TreeViewDemo.o: ../../src/demos/TreeViewDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -213,6 +203,16 @@ $(OBJDIR)/AudioDemoRecordPage.o: ../../src/demos/AudioDemoRecordPage.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/AudioDemoLatencyPage.o: ../../src/demos/AudioDemoLatencyPage.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/ThreadingDemo.o: ../../src/demos/ThreadingDemo.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(OBJDIR)/WidgetsDemo.o: ../../src/demos/WidgetsDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) diff --git a/extras/juce demo/src/demos/FontsAndTextDemo.cpp b/extras/juce demo/src/demos/FontsAndTextDemo.cpp index 576d5931d5..7c47194408 100644 --- a/extras/juce demo/src/demos/FontsAndTextDemo.cpp +++ b/extras/juce demo/src/demos/FontsAndTextDemo.cpp @@ -90,17 +90,9 @@ public: horizontalScaleSlider->addListener (this); (new Label (String::empty, horizontalScaleSlider->getName()))->attachToComponent (horizontalScaleSlider, true); - for (int i = 0; i < fonts.size(); ++i) - { - if (fonts[i]->getTypefaceName().startsWithIgnoreCase (T("Arial"))) - { - listBox->selectRow (i); - break; - } - } - listBox->setColour (ListBox::outlineColourId, Colours::black.withAlpha (0.5f)); listBox->setOutlineThickness (1); + listBox->selectRow (Random::getSystemRandom().nextInt (fonts.size())); // set up the layout and resizer bars.. diff --git a/extras/juce demo/src/demos/RenderingTestComponent.cpp b/extras/juce demo/src/demos/RenderingTestComponent.cpp index 50e60a281e..ccf3d0f79f 100644 --- a/extras/juce demo/src/demos/RenderingTestComponent.cpp +++ b/extras/juce demo/src/demos/RenderingTestComponent.cpp @@ -196,7 +196,7 @@ private: .scaled (bouncingNumber[2] + 4.0f, bouncingNumber[2] + 4.0f) .translated (bouncingPointX[2], bouncingPointY[2])); g.reduceClipRegion (*argbImage, - Rectangle (0, 0, argbImage->getWidth(), argbImage->getHeight()), + Rectangle (0, 0, argbImage->getWidth(), argbImage->getHeight()), transform); } @@ -352,13 +352,14 @@ private: // to make our icon the right size, we'll put it inside a DrawableComposite, and apply // a transform to get it to the size we want. - float x, y, w, h; - loadedSVG->getBounds (x, y, w, h); - const float scaleFactor = 300.0f / jmax (w, h); + Rectangle bounds = loadedSVG->getBounds(); + const float scaleFactor = 300.0f / jmax (bounds.getWidth(), bounds.getHeight()); svgDrawable = new DrawableComposite(); - svgDrawable->insertDrawable (loadedSVG, AffineTransform::translation (-(x + w * 0.5f), -(y + h * 0.5f)) - .scaled (scaleFactor, scaleFactor)); + svgDrawable->insertDrawable (loadedSVG, + AffineTransform::translation (-bounds.getCentreX(), + -bounds.getCentreY()) + .scaled (scaleFactor, scaleFactor)); } } } diff --git a/extras/juce demo/src/demos/WidgetsDemo.cpp b/extras/juce demo/src/demos/WidgetsDemo.cpp index 5cff8057e8..b49d1e527c 100644 --- a/extras/juce demo/src/demos/WidgetsDemo.cpp +++ b/extras/juce demo/src/demos/WidgetsDemo.cpp @@ -605,10 +605,10 @@ public: if (getChildComponent (i) != animateButton) { animator.animateComponent (getChildComponent (i), - Rectangle (Random::getSystemRandom().nextInt (getWidth() / 2), - Random::getSystemRandom().nextInt (getHeight() / 2), - 60 + Random::getSystemRandom().nextInt (getWidth() / 3), - 16 + Random::getSystemRandom().nextInt (getHeight() / 6)), + Rectangle (Random::getSystemRandom().nextInt (getWidth() / 2), + Random::getSystemRandom().nextInt (getHeight() / 2), + 60 + Random::getSystemRandom().nextInt (getWidth() / 3), + 16 + Random::getSystemRandom().nextInt (getHeight() / 6)), 500 + Random::getSystemRandom().nextInt (2000), Random::getSystemRandom().nextDouble(), Random::getSystemRandom().nextDouble()); @@ -920,7 +920,7 @@ private: { } - void contentAreaChanged (const Rectangle& contentArea) + void contentAreaChanged (const Rectangle& contentArea) { comboBox->setSize (contentArea.getWidth() - 2, jmin (contentArea.getHeight() - 2, 22)); diff --git a/extras/the jucer/src/model/components/jucer_ComponentTypeHandler.cpp b/extras/the jucer/src/model/components/jucer_ComponentTypeHandler.cpp index 71029d7b02..75800e21d8 100644 --- a/extras/the jucer/src/model/components/jucer_ComponentTypeHandler.cpp +++ b/extras/the jucer/src/model/components/jucer_ComponentTypeHandler.cpp @@ -258,7 +258,7 @@ void ComponentTypeHandler::setComponentPosition (Component* comp, comp->getProperties().set ("relativeToW", String::toHexString (newPos.relativeToW)); comp->getProperties().set ("relativeToH", String::toHexString (newPos.relativeToH)); - comp->setBounds (newPos.getRectangle (Rectangle (0, 0, comp->getParentWidth(), comp->getParentHeight()), + comp->setBounds (newPos.getRectangle (Rectangle (0, 0, comp->getParentWidth(), comp->getParentHeight()), layout)); } diff --git a/extras/the jucer/src/model/documents/jucer_ButtonDocument.cpp b/extras/the jucer/src/model/documents/jucer_ButtonDocument.cpp index 69e55a09d5..6edc57cab8 100644 --- a/extras/the jucer/src/model/documents/jucer_ButtonDocument.cpp +++ b/extras/the jucer/src/model/documents/jucer_ButtonDocument.cpp @@ -310,7 +310,7 @@ public: if (document->paintStatesEnabled [background]) { document->paintRoutines [background]->fillWithBackground (g, alwaysFillBackground); - document->paintRoutines [background]->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); + document->paintRoutines [background]->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); } const int stateIndex @@ -323,7 +323,7 @@ public: : normalOff)); document->paintRoutines [stateIndex]->fillWithBackground (g, ! document->paintStatesEnabled [background]); - document->paintRoutines [stateIndex]->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); + document->paintRoutines [stateIndex]->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); } private: diff --git a/extras/the jucer/src/model/documents/jucer_ComponentDocument.cpp b/extras/the jucer/src/model/documents/jucer_ComponentDocument.cpp index 7d03a47d58..b66de73a50 100644 --- a/extras/the jucer/src/model/documents/jucer_ComponentDocument.cpp +++ b/extras/the jucer/src/model/documents/jucer_ComponentDocument.cpp @@ -118,7 +118,7 @@ public: void paint (Graphics& g) { document->getPaintRoutine (0)->fillWithBackground (g, alwaysFillBackground); - document->getPaintRoutine (0)->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); + document->getPaintRoutine (0)->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); } void resized() @@ -138,9 +138,9 @@ public: if (type != 0) { - const Rectangle newBounds (type->getComponentPosition (comp) - .getRectangle (Rectangle (0, 0, getWidth(), getHeight()), - document->getComponentLayout())); + const Rectangle newBounds (type->getComponentPosition (comp) + .getRectangle (Rectangle (0, 0, getWidth(), getHeight()), + document->getComponentLayout())); anyCompsMoved = anyCompsMoved || (comp->getBounds() != newBounds); comp->setBounds (newBounds); diff --git a/extras/the jucer/src/model/jucer_ComponentLayout.cpp b/extras/the jucer/src/model/jucer_ComponentLayout.cpp index 4b7b61ad02..16bd411124 100644 --- a/extras/the jucer/src/model/jucer_ComponentLayout.cpp +++ b/extras/the jucer/src/model/jucer_ComponentLayout.cpp @@ -359,7 +359,7 @@ void ComponentLayout::bringLostItemsBackOnScreen (int width, int height) { Component* const c = components[i]; - if (! c->getBounds().intersects (Rectangle (0, 0, width, height))) + if (! c->getBounds().intersects (Rectangle (0, 0, width, height))) { c->setTopLeftPosition (width / 2, height / 2); updateStoredComponentPosition (c, false); @@ -492,7 +492,7 @@ void ComponentLayout::setComponentRelativeTarget (Component* comp, int whichDime { const int64 compId = ComponentTypeHandler::getComponentId (compToBeRelativeTo); - Rectangle oldBounds (comp->getBounds()); + Rectangle oldBounds (comp->getBounds()); RelativePositionedRectangle pos; if (pe != 0) diff --git a/extras/the jucer/src/model/jucer_PaintRoutine.cpp b/extras/the jucer/src/model/jucer_PaintRoutine.cpp index b038bb0a32..dd449590a8 100644 --- a/extras/the jucer/src/model/jucer_PaintRoutine.cpp +++ b/extras/the jucer/src/model/jucer_PaintRoutine.cpp @@ -436,13 +436,13 @@ void PaintRoutine::ungroupSelected() } } -void PaintRoutine::bringLostItemsBackOnScreen (const Rectangle& parentArea) +void PaintRoutine::bringLostItemsBackOnScreen (const Rectangle& parentArea) { for (int i = 0; i < elements.size(); ++i) { PaintElement* const c = elements[i]; - Rectangle r (c->getCurrentBounds (parentArea)); + Rectangle r (c->getCurrentBounds (parentArea)); if (! r.intersects (parentArea)) { @@ -452,13 +452,13 @@ void PaintRoutine::bringLostItemsBackOnScreen (const Rectangle& parentArea) } } -void PaintRoutine::startDragging (const Rectangle& parentArea) +void PaintRoutine::startDragging (const Rectangle& parentArea) { for (int i = 0; i < elements.size(); ++i) { PaintElement* const c = elements[i]; - Rectangle r (c->getCurrentBounds (parentArea)); + Rectangle r (c->getCurrentBounds (parentArea)); c->getProperties().set ("xDragStart", r.getX()); c->getProperties().set ("yDragStart", r.getY()); @@ -467,7 +467,7 @@ void PaintRoutine::startDragging (const Rectangle& parentArea) getDocument()->getUndoManager().beginNewTransaction(); } -void PaintRoutine::dragSelectedComps (int dx, int dy, const Rectangle& parentArea) +void PaintRoutine::dragSelectedComps (int dx, int dy, const Rectangle& parentArea) { getDocument()->getUndoManager().undoCurrentTransactionOnly(); @@ -484,7 +484,7 @@ void PaintRoutine::dragSelectedComps (int dx, int dy, const Rectangle& parentAre const int startX = c->getProperties() ["xDragStart"]; const int startY = c->getProperties() ["yDragStart"]; - Rectangle r (c->getCurrentBounds (parentArea)); + Rectangle r (c->getCurrentBounds (parentArea)); if (document != 0 && selectedElements.getNumSelected() == 1) { @@ -524,7 +524,7 @@ void PaintRoutine::fillWithBackground (Graphics& g, const bool drawOpaqueBackgro } } -void PaintRoutine::drawElements (Graphics& g, const Rectangle& relativeTo) +void PaintRoutine::drawElements (Graphics& g, const Rectangle& relativeTo) { Component temp; temp.setBounds (relativeTo); @@ -540,8 +540,7 @@ void PaintRoutine::dropImageAt (const File& f, int x, int y) if (d != 0) { - float ix, iy, iw, ih; - d->getBounds (ix, iy, iw, ih); + Rectangle bounds (d->getBounds()); delete d; PaintElement* newElement @@ -569,8 +568,8 @@ void PaintRoutine::dropImageAt (const File& f, int x, int y) pei->setResource (resourceName, true); - const int imageW = (int) (ix + iw + 1.0f); - const int imageH = (int) (iy + ih + 1.0f); + const int imageW = (int) (bounds.getRight() + 1.0f); + const int imageH = (int) (bounds.getBottom() + 1.0f); RelativePositionedRectangle pr; pr.rect.setX (x - imageW / 2); diff --git a/extras/the jucer/src/model/jucer_PaintRoutine.h b/extras/the jucer/src/model/jucer_PaintRoutine.h index 3928964333..172aedd42c 100644 --- a/extras/the jucer/src/model/jucer_PaintRoutine.h +++ b/extras/the jucer/src/model/jucer_PaintRoutine.h @@ -66,7 +66,7 @@ public: void setBackgroundColour (const Colour& newColour) throw(); void fillWithBackground (Graphics& g, const bool drawOpaqueBackground); - void drawElements (Graphics& g, const Rectangle& relativeTo); + void drawElements (Graphics& g, const Rectangle& relativeTo); void dropImageAt (const File& f, int x, int y); @@ -86,11 +86,11 @@ public: void groupSelected(); void ungroupSelected(); - void startDragging (const Rectangle& parentArea); - void dragSelectedComps (int dxFromDragStart, int dyFromDragStart, const Rectangle& parentArea); + void startDragging (const Rectangle& parentArea); + void dragSelectedComps (int dxFromDragStart, int dyFromDragStart, const Rectangle& parentArea); void endDragging(); - void bringLostItemsBackOnScreen (const Rectangle& parentArea); + void bringLostItemsBackOnScreen (const Rectangle& parentArea); //============================================================================== void setDocument (JucerDocument* const document_) { document = document_; } diff --git a/extras/the jucer/src/model/paintelements/jucer_ColouredElement.cpp b/extras/the jucer/src/model/paintelements/jucer_ColouredElement.cpp index 97b89e8488..70bd41d1d0 100644 --- a/extras/the jucer/src/model/paintelements/jucer_ColouredElement.cpp +++ b/extras/the jucer/src/model/paintelements/jucer_ColouredElement.cpp @@ -959,7 +959,7 @@ void ColouredElement::createSiblingComponents() } } -const Rectangle ColouredElement::getCurrentBounds (const Rectangle& parentArea) const +const Rectangle ColouredElement::getCurrentBounds (const Rectangle& parentArea) const { int border = 0; @@ -970,11 +970,11 @@ const Rectangle ColouredElement::getCurrentBounds (const Rectangle& parentArea) .expanded (border, border); } -void ColouredElement::setCurrentBounds (const Rectangle& newBounds, - const Rectangle& parentArea, +void ColouredElement::setCurrentBounds (const Rectangle& newBounds, + const Rectangle& parentArea, const bool undoable) { - Rectangle r (newBounds); + Rectangle r (newBounds); if (isStrokePresent) { @@ -988,7 +988,7 @@ void ColouredElement::setCurrentBounds (const Rectangle& newBounds, pr.updateFrom (r.getX() - parentArea.getX(), r.getY() - parentArea.getY(), r.getWidth(), r.getHeight(), - Rectangle (0, 0, parentArea.getWidth(), parentArea.getHeight()), + Rectangle (0, 0, parentArea.getWidth(), parentArea.getHeight()), getDocument()->getComponentLayout()); setPosition (pr, undoable); diff --git a/extras/the jucer/src/model/paintelements/jucer_ColouredElement.h b/extras/the jucer/src/model/paintelements/jucer_ColouredElement.h index 806d307d66..66f097d6ec 100644 --- a/extras/the jucer/src/model/paintelements/jucer_ColouredElement.h +++ b/extras/the jucer/src/model/paintelements/jucer_ColouredElement.h @@ -63,8 +63,8 @@ public: void setStrokeFill (const JucerFillType& newType, const bool undoable); //============================================================================== - const Rectangle getCurrentBounds (const Rectangle& parentArea) const; - void setCurrentBounds (const Rectangle& newBounds, const Rectangle& parentArea, const bool undoable); + const Rectangle getCurrentBounds (const Rectangle& parentArea) const; + void setCurrentBounds (const Rectangle& newBounds, const Rectangle& parentArea, const bool undoable); void createSiblingComponents(); diff --git a/extras/the jucer/src/model/paintelements/jucer_FillType.cpp b/extras/the jucer/src/model/paintelements/jucer_FillType.cpp index f1db2a4972..674d57bf1b 100644 --- a/extras/the jucer/src/model/paintelements/jucer_FillType.cpp +++ b/extras/the jucer/src/model/paintelements/jucer_FillType.cpp @@ -110,7 +110,7 @@ void JucerFillType::reset() } //============================================================================== -void JucerFillType::setFillType (Graphics& g, JucerDocument* const document, const Rectangle& parentArea) +void JucerFillType::setFillType (Graphics& g, JucerDocument* const document, const Rectangle& parentArea) { if (mode == solidColour) { @@ -123,7 +123,7 @@ void JucerFillType::setFillType (Graphics& g, JucerDocument* const document, con { loadImage (document); - Rectangle r (imageAnchor.getRectangle (parentArea, document->getComponentLayout())); + Rectangle r (imageAnchor.getRectangle (parentArea, document->getComponentLayout())); g.setTiledImageFill (*image, r.getX(), r.getY(), (float) imageOpacity); } @@ -132,8 +132,8 @@ void JucerFillType::setFillType (Graphics& g, JucerDocument* const document, con ImageCache::release (image); image = 0; - Rectangle r1 (gradPos1.getRectangle (parentArea, document->getComponentLayout())); - Rectangle r2 (gradPos2.getRectangle (parentArea, document->getComponentLayout())); + Rectangle r1 (gradPos1.getRectangle (parentArea, document->getComponentLayout())); + Rectangle r2 (gradPos2.getRectangle (parentArea, document->getComponentLayout())); g.setGradientFill (ColourGradient (gradCol1, (float) r1.getX(), (float) r1.getY(), gradCol2, (float) r2.getX(), (float) r2.getY(), diff --git a/extras/the jucer/src/model/paintelements/jucer_FillType.h b/extras/the jucer/src/model/paintelements/jucer_FillType.h index b19f37d524..8fb4f2e91e 100644 --- a/extras/the jucer/src/model/paintelements/jucer_FillType.h +++ b/extras/the jucer/src/model/paintelements/jucer_FillType.h @@ -46,7 +46,7 @@ public: bool operator!= (const JucerFillType& other) const throw(); //============================================================================== - void setFillType (Graphics& g, JucerDocument* const document, const Rectangle& parentArea); + void setFillType (Graphics& g, JucerDocument* const document, const Rectangle& parentArea); void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode) const; diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElement.cpp b/extras/the jucer/src/model/paintelements/jucer_PaintElement.cpp index 6fec36d968..60f077c339 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElement.cpp +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElement.cpp @@ -134,13 +134,13 @@ void PaintElement::setPosition (const RelativePositionedRectangle& newPosition, } //============================================================================== -const Rectangle PaintElement::getCurrentBounds (const Rectangle& parentArea) const +const Rectangle PaintElement::getCurrentBounds (const Rectangle& parentArea) const { return position.getRectangle (parentArea, getDocument()->getComponentLayout()); } -void PaintElement::setCurrentBounds (const Rectangle& newBounds, - const Rectangle& parentArea, +void PaintElement::setCurrentBounds (const Rectangle& newBounds, + const Rectangle& parentArea, const bool undoable) { RelativePositionedRectangle pr (position); @@ -148,7 +148,7 @@ void PaintElement::setCurrentBounds (const Rectangle& newBounds, newBounds.getY() - parentArea.getY(), jmax (1, newBounds.getWidth()), jmax (1, newBounds.getHeight()), - Rectangle (0, 0, parentArea.getWidth(), parentArea.getHeight()), + Rectangle (0, 0, parentArea.getWidth(), parentArea.getHeight()), getDocument()->getComponentLayout()); setPosition (pr, undoable); @@ -156,7 +156,7 @@ void PaintElement::setCurrentBounds (const Rectangle& newBounds, updateBounds (parentArea); } -void PaintElement::updateBounds (const Rectangle& parentArea) +void PaintElement::updateBounds (const Rectangle& parentArea) { if (! parentArea.isEmpty()) { @@ -236,13 +236,13 @@ void PaintElement::parentHierarchyChanged() } //============================================================================== -void PaintElement::drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo) +void PaintElement::drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo) { } void PaintElement::paint (Graphics& g) { - Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); g.saveState(); g.setOrigin (area.getX() - getX(), area.getY() - getY()); @@ -298,7 +298,7 @@ void PaintElement::mouseDrag (const MouseEvent& e) if (! e.mods.isPopupMenu()) { jassert (dynamic_cast (getParentComponent()) != 0); - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); if (selected && ! dragging) { @@ -337,8 +337,8 @@ void PaintElement::resizeEnd() } void PaintElement::checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& previousBounds, - const Rectangle& limits, + const Rectangle& previousBounds, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, @@ -356,7 +356,7 @@ void PaintElement::checkBounds (int& x, int& y, int& w, int& h, if (document != 0 && document->isSnapActive (true)) { jassert (getParentComponent() != 0); - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); x += borderThickness - area.getX(); y += borderThickness - area.getY(); @@ -387,23 +387,23 @@ void PaintElement::checkBounds (int& x, int& y, int& w, int& h, void PaintElement::applyBoundsToComponent (Component* component, int x, int y, int w, int h) { - if (getBounds() != Rectangle (x, y, w, h)) + if (getBounds() != Rectangle (x, y, w, h)) { getDocument()->getUndoManager().undoCurrentTransactionOnly(); jassert (dynamic_cast (getParentComponent()) != 0); - setCurrentBounds (Rectangle (x, y, w, h) + setCurrentBounds (Rectangle (x, y, w, h) .expanded (-borderThickness, -borderThickness), ((PaintRoutineEditor*) getParentComponent())->getComponentArea(), true); } } -const Rectangle PaintElement::getCurrentAbsoluteBounds() const +const Rectangle PaintElement::getCurrentAbsoluteBounds() const { jassert (dynamic_cast (getParentComponent()) != 0); - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); return position.getRectangle (area, getDocument()->getComponentLayout()); } @@ -411,7 +411,7 @@ const Rectangle PaintElement::getCurrentAbsoluteBounds() const void PaintElement::getCurrentAbsoluteBoundsDouble (double& x, double& y, double& w, double& h) const { jassert (dynamic_cast (getParentComponent()) != 0); - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); position.getRectangleDouble (x, y, w, h, area, getDocument()->getComponentLayout()); } diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElement.h b/extras/the jucer/src/model/paintelements/jucer_PaintElement.h index bf57b1e507..aa0cd4f45a 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElement.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElement.h @@ -50,13 +50,13 @@ public: //============================================================================== virtual void setInitialBounds (int parentWidth, int parentHeight); - virtual const Rectangle getCurrentBounds (const Rectangle& activeArea) const; - virtual void setCurrentBounds (const Rectangle& newBounds, const Rectangle& activeArea, const bool undoable); + virtual const Rectangle getCurrentBounds (const Rectangle& activeArea) const; + virtual void setCurrentBounds (const Rectangle& newBounds, const Rectangle& activeArea, const bool undoable); const RelativePositionedRectangle& getPosition() const; void setPosition (const RelativePositionedRectangle& newPosition, const bool undoable); - void updateBounds (const Rectangle& activeArea); + void updateBounds (const Rectangle& activeArea); const String& getTypeName() const throw() { return typeName; } PaintRoutine* getOwner() const throw() { return owner; } @@ -64,9 +64,9 @@ public: //============================================================================== virtual void draw (Graphics& g, const ComponentLayout* layout, - const Rectangle& parentArea) = 0; + const Rectangle& parentArea) = 0; - virtual void drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo); + virtual void drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo); virtual void getEditableProperties (Array & properties); @@ -103,8 +103,8 @@ protected: void resizeStart(); void resizeEnd(); void checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& previousBounds, - const Rectangle& limits, + const Rectangle& previousBounds, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, @@ -112,7 +112,7 @@ protected: void applyBoundsToComponent (Component* component, int x, int y, int w, int h); - const Rectangle getCurrentAbsoluteBounds() const; + const Rectangle getCurrentAbsoluteBounds() const; void getCurrentAbsoluteBoundsDouble (double& x, double& y, double& w, double& h) const; virtual void selectionChanged (const bool isSelected); diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementEllipse.h b/extras/the jucer/src/model/paintelements/jucer_PaintElementEllipse.h index 3b283d9cb0..a4cf183b6c 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementEllipse.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementEllipse.h @@ -43,11 +43,11 @@ public: ~PaintElementEllipse() {} - void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) + void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) { fillType.setFillType (g, getDocument(), parentArea); - Rectangle r (position.getRectangle (parentArea, layout)); + Rectangle r (position.getRectangle (parentArea, layout)); g.fillEllipse ((float) r.getX(), (float) r.getY(), (float) r.getWidth(), (float) r.getHeight()); if (isStrokePresent) diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementGroup.h b/extras/the jucer/src/model/paintelements/jucer_PaintElementGroup.h index 77b325709c..ceafa9a5ab 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementGroup.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementGroup.h @@ -124,9 +124,9 @@ public: { } - const Rectangle getCurrentBounds (const Rectangle& parentArea) const + const Rectangle getCurrentBounds (const Rectangle& parentArea) const { - Rectangle r; + Rectangle r; if (subElements.size() > 0) { @@ -139,13 +139,13 @@ public: return r; } - void setCurrentBounds (const Rectangle& b, const Rectangle& parentArea, const bool undoable) + void setCurrentBounds (const Rectangle& b, const Rectangle& parentArea, const bool undoable) { - Rectangle newBounds (b); + Rectangle newBounds (b); newBounds.setSize (jmax (1, newBounds.getWidth()), jmax (1, newBounds.getHeight())); - const Rectangle current (getCurrentBounds (parentArea)); + const Rectangle current (getCurrentBounds (parentArea)); if (newBounds != current) { @@ -161,7 +161,7 @@ public: { PaintElement* const e = subElements.getUnchecked(i); - Rectangle pos (e->getCurrentBounds (parentArea)); + Rectangle pos (e->getCurrentBounds (parentArea)); const int newX = roundToInt ((pos.getX() - scaleStartX) * scaleX + scaleStartX + dx); const int newY = roundToInt ((pos.getY() - scaleStartY) * scaleY + scaleStartY + dy); @@ -176,7 +176,7 @@ public: } //============================================================================== - void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) + void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) { for (int i = 0; i < subElements.size(); ++i) subElements.getUnchecked(i)->draw (g, layout, parentArea); diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementImage.h b/extras/the jucer/src/model/paintelements/jucer_PaintElementImage.h index 5a1d363a75..ed015a507e 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementImage.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementImage.h @@ -68,9 +68,9 @@ public: return 0; } - void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) + void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) { - const Rectangle r (position.getRectangle (parentArea, layout)); + const Rectangle r (position.getRectangle (parentArea, layout)); const Drawable* const image = getDrawable(); @@ -306,14 +306,12 @@ public: if (image != 0 && getParentComponent() != 0) { - const Rectangle parentArea (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle parentArea (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); - Rectangle r (getCurrentBounds (parentArea)); + Rectangle r (getCurrentBounds (parentArea)); + Rectangle bounds (image->getBounds()); - float x, y, w, h; - image->getBounds (x, y, w, h); - - r.setSize ((int) (w + 1.0f), (int) (h + 1.0f)); + r.setSize ((int) (bounds.getWidth() + 1.0f), (int) (bounds.getHeight() + 1.0f)); setCurrentBounds (r, parentArea, true); } diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.cpp b/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.cpp index 82aed55a38..05c44f1936 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.cpp +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.cpp @@ -166,30 +166,29 @@ int PaintElementPath::getBorderSize() const : 0; } -const Rectangle PaintElementPath::getCurrentBounds (const Rectangle& parentArea) const +const Rectangle PaintElementPath::getCurrentBounds (const Rectangle& parentArea) const { updateStoredPath (getDocument()->getComponentLayout(), parentArea); - float x, y, w, h; - path.getBounds (x, y, w, h); + Rectangle bounds (path.getBounds()); const int borderSize = getBorderSize(); - return Rectangle ((int) x - borderSize, - (int) y - borderSize, - (int) w + borderSize * 2, - (int) h + borderSize * 2); + return Rectangle ((int) bounds.getX() - borderSize, + (int) bounds.getY() - borderSize, + (int) bounds.getWidth() + borderSize * 2, + (int) bounds.getHeight() + borderSize * 2); } -void PaintElementPath::setCurrentBounds (const Rectangle& b, - const Rectangle& parentArea, +void PaintElementPath::setCurrentBounds (const Rectangle& b, + const Rectangle& parentArea, const bool undoable) { - Rectangle newBounds (b); + Rectangle newBounds (b); newBounds.setSize (jmax (1, newBounds.getWidth()), jmax (1, newBounds.getHeight())); - const Rectangle current (getCurrentBounds (parentArea)); + const Rectangle current (getCurrentBounds (parentArea)); if (newBounds != current) { @@ -222,7 +221,7 @@ void PaintElementPath::setCurrentBounds (const Rectangle& b, void PaintElementPath::rescalePoint (RelativePositionedRectangle& pos, int dx, int dy, double scaleX, double scaleY, double scaleStartX, double scaleStartY, - const Rectangle& parentArea) const + const Rectangle& parentArea) const { double x, y, w, h; pos.getRectangleDouble (x, y, w, h, parentArea, getDocument()->getComponentLayout()); @@ -240,7 +239,7 @@ static void drawArrow (Graphics& g, float x1, float y1, float x2, float y2) g.drawLine (x1 + (x2 - x1) * 0.49f, y1 + (y2 - y1) * 0.49f, x2, y2); } -void PaintElementPath::draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) +void PaintElementPath::draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) { updateStoredPath (layout, parentArea); path.setUsingNonZeroWinding (nonZeroWinding); @@ -255,7 +254,7 @@ void PaintElementPath::draw (Graphics& g, const ComponentLayout* layout, const R } } -void PaintElementPath::drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo) +void PaintElementPath::drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo) { ComponentLayout* layout = getDocument()->getComponentLayout(); @@ -351,7 +350,7 @@ void PaintElementPath::mouseUp (const MouseEvent& e) void PaintElementPath::changed() { ColouredElement::changed(); - lastPathBounds = Rectangle(); + lastPathBounds = Rectangle(); } void PaintElementPath::pointListChanged() @@ -687,7 +686,7 @@ void PaintElementPath::setToPath (const Path& p) } } -void PaintElementPath::updateStoredPath (const ComponentLayout* layout, const Rectangle& relativeTo) const +void PaintElementPath::updateStoredPath (const ComponentLayout* layout, const Rectangle& relativeTo) const { if (lastPathBounds != relativeTo && ! relativeTo.isEmpty()) { @@ -889,7 +888,7 @@ PathPoint* PaintElementPath::addPoint (int pointIndexToAddItAfter, const bool un double x1 = 20.0, y1 = 20.0, x2, y2; ComponentLayout* layout = getDocument()->getComponentLayout(); - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); if (points [pointIndexToAddItAfter] != 0) positionToXY (points [pointIndexToAddItAfter]->pos [points [pointIndexToAddItAfter]->getNumPoints() - 1], x1, y1, @@ -1009,7 +1008,7 @@ void PaintElementPath::deletePoint (int pointIndex, const bool undoable) } //============================================================================== -bool PaintElementPath::getPoint (int index, int pointNumber, double& x, double& y, const Rectangle& parentArea) const +bool PaintElementPath::getPoint (int index, int pointNumber, double& x, double& y, const Rectangle& parentArea) const { const PathPoint* const p = points [index]; @@ -1028,7 +1027,7 @@ int PaintElementPath::findSegmentAtXY (int x, int y) const double x1, y1, x2, y2, x3, y3, lastX = 0.0, lastY = 0.0, subPathStartX = 0.0, subPathStartY = 0.0; ComponentLayout* const layout = getDocument()->getComponentLayout(); - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); int subpathStartIndex = 0; @@ -1113,7 +1112,7 @@ int PaintElementPath::findSegmentAtXY (int x, int y) const //============================================================================== void PaintElementPath::movePoint (int index, int pointNumber, double newX, double newY, - const Rectangle& parentArea, + const Rectangle& parentArea, const bool undoable) { PathPoint* const p = points [index]; @@ -1242,7 +1241,7 @@ public: break; } - const Rectangle area (((PaintRoutineEditor*) owner->getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) owner->getParentComponent())->getComponentArea()); owner->getPoint (index)->changePointType (type, area, true); } @@ -1436,7 +1435,7 @@ int PathPoint::getNumPoints() const } const PathPoint PathPoint::withChangedPointType (const Path::Iterator::PathElementType newType, - const Rectangle& parentArea) const + const Rectangle& parentArea) const { PathPoint p (*this); @@ -1486,7 +1485,7 @@ const PathPoint PathPoint::withChangedPointType (const Path::Iterator::PathEleme } void PathPoint::changePointType (const Path::Iterator::PathElementType newType, - const Rectangle& parentArea, const bool undoable) + const Rectangle& parentArea, const bool undoable) { if (newType != type) { @@ -1584,7 +1583,7 @@ PathPointComponent::~PathPointComponent() void PathPointComponent::updatePosition() { - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); jassert (getParentComponent() != 0); double x, y; @@ -1647,7 +1646,7 @@ void PathPointComponent::mouseDrag (const MouseEvent& e) if (dragging) { - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); int x = dragX + e.getDistanceFromDragStartX() - area.getX(); int y = dragY + e.getDistanceFromDragStartY() - area.getY(); diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.h b/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.h index 07b5b0858f..d730bfc644 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementPath.h @@ -55,7 +55,7 @@ public: int getNumPoints() const; void changePointType (const Path::Iterator::PathElementType newType, - const Rectangle& parentArea, + const Rectangle& parentArea, const bool undoable); void deleteFromPath(); @@ -66,7 +66,7 @@ public: private: const PathPoint withChangedPointType (const Path::Iterator::PathElementType newType, - const Rectangle& parentArea) const; + const Rectangle& parentArea) const; }; @@ -82,12 +82,12 @@ public: //============================================================================== void setInitialBounds (int parentWidth, int parentHeight); - const Rectangle getCurrentBounds (const Rectangle& parentArea) const; - void setCurrentBounds (const Rectangle& b, const Rectangle& parentArea, const bool undoable); + const Rectangle getCurrentBounds (const Rectangle& parentArea) const; + void setCurrentBounds (const Rectangle& b, const Rectangle& parentArea, const bool undoable); //============================================================================== - bool getPoint (int index, int pointNumber, double& x, double& y, const Rectangle& parentArea) const; - void movePoint (int index, int pointNumber, double newX, double newY, const Rectangle& parentArea, const bool undoable); + bool getPoint (int index, int pointNumber, double& x, double& y, const Rectangle& parentArea) const; + void movePoint (int index, int pointNumber, double newX, double newY, const Rectangle& parentArea, const bool undoable); const RelativePositionedRectangle getPoint (int index, int pointNumber) const; void setPoint (int index, int pointNumber, const RelativePositionedRectangle& newPoint, const bool undoable); @@ -123,8 +123,8 @@ public: void setToPath (const Path& p); //============================================================================== - void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea); - void drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo); + void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea); + void drawExtraEditorGraphics (Graphics& g, const Rectangle& relativeTo); void resized(); void parentSizeChanged(); @@ -145,19 +145,19 @@ private: OwnedArray points; bool nonZeroWinding; mutable Path path; - mutable Rectangle lastPathBounds; + mutable Rectangle lastPathBounds; int mouseDownOnSegment; bool mouseDownSelectSegmentStatus; const String pathToString() const; void restorePathFromString (const String& s); - void updateStoredPath (const ComponentLayout* layout, const Rectangle& parentArea) const; + void updateStoredPath (const ComponentLayout* layout, const Rectangle& parentArea) const; int getBorderSize() const; void rescalePoint (RelativePositionedRectangle& pos, int dx, int dy, double scaleX, double scaleY, double scaleStartX, double scaleStartY, - const Rectangle& parentArea) const; + const Rectangle& parentArea) const; }; diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementRectangle.h b/extras/the jucer/src/model/paintelements/jucer_PaintElementRectangle.h index 64994fa640..5359ae9e7c 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementRectangle.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementRectangle.h @@ -45,24 +45,24 @@ public: { } - const Rectangle getCurrentBounds (const Rectangle& parentArea) const + const Rectangle getCurrentBounds (const Rectangle& parentArea) const { return PaintElement::getCurrentBounds (parentArea); // bypass the ColouredElement implementation } - void setCurrentBounds (const Rectangle& newBounds, const Rectangle& parentArea, const bool undoable) + void setCurrentBounds (const Rectangle& newBounds, const Rectangle& parentArea, const bool undoable) { PaintElement::setCurrentBounds (newBounds, parentArea, undoable); // bypass the ColouredElement implementation } - void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) + void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) { Component parentComponent; parentComponent.setBounds (parentArea); fillType.setFillType (g, getDocument(), parentArea); - const Rectangle r (position.getRectangle (parentArea, layout)); + const Rectangle r (position.getRectangle (parentArea, layout)); g.fillRect (r); if (isStrokePresent) @@ -137,7 +137,7 @@ public: void convertToPath() { - const Rectangle r (getCurrentAbsoluteBounds()); + const Rectangle r (getCurrentAbsoluteBounds()); Path path; path.addRectangle ((float) r.getX(), (float) r.getY(), (float) r.getWidth(), (float) r.getHeight()); diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementRoundedRectangle.h b/extras/the jucer/src/model/paintelements/jucer_PaintElementRoundedRectangle.h index b81c880f58..d2db43d7e3 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementRoundedRectangle.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementRoundedRectangle.h @@ -45,7 +45,7 @@ public: ~PaintElementRoundedRectangle() {} //============================================================================== - void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) + void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) { double x, y, w, h; position.getRectangleDouble (x, y, w, h, parentArea, layout); diff --git a/extras/the jucer/src/model/paintelements/jucer_PaintElementText.h b/extras/the jucer/src/model/paintelements/jucer_PaintElementText.h index 2dab8b4e84..83151a9dbb 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PaintElementText.h +++ b/extras/the jucer/src/model/paintelements/jucer_PaintElementText.h @@ -55,14 +55,14 @@ public: } //============================================================================== - void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) + void draw (Graphics& g, const ComponentLayout* layout, const Rectangle& parentArea) { fillType.setFillType (g, getDocument(), parentArea); font = FontPropertyComponent::applyNameToFont (typefaceName, font); g.setFont (font); - const Rectangle r (position.getRectangle (parentArea, layout)); + const Rectangle r (position.getRectangle (parentArea, layout)); g.drawText (replaceStringTranslations (text, owner->getDocument()), r.getX(), r.getY(), r.getWidth(), r.getHeight(), justification, true); @@ -338,7 +338,7 @@ public: { font = FontPropertyComponent::applyNameToFont (typefaceName, font); - const Rectangle r (getCurrentAbsoluteBounds()); + const Rectangle r (getCurrentAbsoluteBounds()); GlyphArrangement arr; arr.addCurtailedLineOfText (font, text, diff --git a/extras/the jucer/src/model/paintelements/jucer_PointComponent.h b/extras/the jucer/src/model/paintelements/jucer_PointComponent.h index 4c0b1cba74..41817afd15 100644 --- a/extras/the jucer/src/model/paintelements/jucer_PointComponent.h +++ b/extras/the jucer/src/model/paintelements/jucer_PointComponent.h @@ -55,9 +55,9 @@ public: { if (dynamic_cast (getParentComponent()) != 0) { - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); - const Rectangle r (getPosition().getRectangle (area, owner->getDocument()->getComponentLayout())); + const Rectangle r (getPosition().getRectangle (area, owner->getDocument()->getComponentLayout())); setCentrePosition (r.getX(), r.getY()); } @@ -76,14 +76,14 @@ public: //============================================================================== void mouseDown (const MouseEvent& e) { - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); dragX = getX() + getWidth() / 2 - area.getX(); dragY = getY() + getHeight() / 2 - area.getY(); } void mouseDrag (const MouseEvent& e) { - const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); + const Rectangle area (((PaintRoutineEditor*) getParentComponent())->getComponentArea()); int x = dragX + e.getDistanceFromDragStartX(); int y = dragY + e.getDistanceFromDragStartY(); @@ -98,12 +98,12 @@ public: const RelativePositionedRectangle original (getPosition()); RelativePositionedRectangle pr (original); - Rectangle r (pr.getRectangle (Rectangle (0, 0, area.getWidth(), area.getHeight()), - document->getComponentLayout())); + Rectangle r (pr.getRectangle (Rectangle (0, 0, area.getWidth(), area.getHeight()), + document->getComponentLayout())); r.setPosition (x, y); pr.updateFrom (r.getX(), r.getY(), r.getWidth(), r.getHeight(), - Rectangle (0, 0, area.getWidth(), area.getHeight()), + Rectangle (0, 0, area.getWidth(), area.getHeight()), document->getComponentLayout()); if (pr != original) diff --git a/extras/the jucer/src/properties/jucer_PositionPropertyBase.h b/extras/the jucer/src/properties/jucer_PositionPropertyBase.h index 84ce72a41d..c33c605380 100644 --- a/extras/the jucer/src/properties/jucer_PositionPropertyBase.h +++ b/extras/the jucer/src/properties/jucer_PositionPropertyBase.h @@ -340,7 +340,7 @@ public: break; } - Rectangle parentArea; + Rectangle parentArea; if (component->findParentComponentOfClass ((ComponentLayoutEditor*) 0) != 0) { @@ -362,13 +362,13 @@ public: PositionedRectangle whRect (p); xyRect.setModes (xAnchor, xMode, yAnchor, yMode, sizeW, sizeH, - Rectangle (x, y, xw, yh)); + Rectangle (x, y, xw, yh)); whRect.setModes (xAnchor, xMode, yAnchor, yMode, sizeW, sizeH, - Rectangle (x, y, w, h)); + Rectangle (x, y, w, h)); p.setModes (xAnchor, xMode, yAnchor, yMode, sizeW, sizeH, - Rectangle (x, y, xw, yh)); + Rectangle (x, y, xw, yh)); p.setX (xyRect.getX()); p.setY (xyRect.getY()); @@ -384,7 +384,7 @@ public: void resized() { - const Rectangle r (getLookAndFeel().getPropertyComponentContentPosition (*this)); + const Rectangle r (getLookAndFeel().getPropertyComponentContentPosition (*this)); button->changeWidthToFitText (r.getHeight()); button->setTopRightPosition (r.getRight(), r.getY()); diff --git a/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.cpp b/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.cpp index 28e60eb126..c0a031755a 100644 --- a/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.cpp +++ b/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.cpp @@ -56,7 +56,7 @@ public: if (background != 0) { background->fillWithBackground (g, false); - background->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); + background->drawElements (g, Rectangle (0, 0, getWidth(), getHeight())); } grid.draw (g, background); @@ -80,9 +80,9 @@ public: if (type != 0) { - const Rectangle newBounds (type->getComponentPosition (comp) - .getRectangle (Rectangle (0, 0, getWidth(), getHeight()), - document.getComponentLayout())); + const Rectangle newBounds (type->getComponentPosition (comp) + .getRectangle (Rectangle (0, 0, getWidth(), getHeight()), + document.getComponentLayout())); anyCompsMoved = anyCompsMoved || (comp->getBounds() != newBounds); comp->setBounds (newBounds); @@ -167,27 +167,27 @@ void ComponentLayoutEditor::resized() updateOverlayPositions(); } -const Rectangle ComponentLayoutEditor::getComponentArea() const +const Rectangle ComponentLayoutEditor::getComponentArea() const { if (document.isFixedSize()) { - return Rectangle ((getWidth() - document.getInitialWidth()) / 2, - (getHeight() - document.getInitialHeight()) / 2, - document.getInitialWidth(), - document.getInitialHeight()); + return Rectangle ((getWidth() - document.getInitialWidth()) / 2, + (getHeight() - document.getInitialHeight()) / 2, + document.getInitialWidth(), + document.getInitialHeight()); } else { - return Rectangle (editorEdgeGap, editorEdgeGap, - getWidth() - editorEdgeGap * 2, - getHeight() - editorEdgeGap * 2); + return Rectangle (editorEdgeGap, editorEdgeGap, + getWidth() - editorEdgeGap * 2, + getHeight() - editorEdgeGap * 2); } } Image* ComponentLayoutEditor::createComponentLayerSnapshot() const { ((SubComponentHolderComp*) subCompHolder)->dontFillBackground = true; - Image* const im = subCompHolder->createComponentSnapshot (Rectangle (0, 0, subCompHolder->getWidth(), subCompHolder->getHeight())); + Image* const im = subCompHolder->createComponentSnapshot (Rectangle (0, 0, subCompHolder->getWidth(), subCompHolder->getHeight())); ((SubComponentHolderComp*) subCompHolder)->dontFillBackground = false; return im; @@ -405,7 +405,7 @@ ComponentOverlayComponent* ComponentLayoutEditor::getOverlayCompFor (Component* void ComponentLayoutEditor::findLassoItemsInArea (Array & results, int x, int y, int w, int h) { - const Rectangle lasso (x - subCompHolder->getX(), y - subCompHolder->getY(), w, h); + const Rectangle lasso (x - subCompHolder->getX(), y - subCompHolder->getY(), w, h); for (int i = 0; i < subCompHolder->getNumChildComponents(); ++i) { diff --git a/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.h b/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.h index e2d3b99091..b9b5b39c7c 100644 --- a/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.h +++ b/extras/the jucer/src/ui/jucer_ComponentLayoutEditor.h @@ -71,7 +71,7 @@ public: ComponentOverlayComponent* getOverlayCompFor (Component* comp) const; - const Rectangle getComponentArea() const; + const Rectangle getComponentArea() const; Image* createComponentLayerSnapshot() const; diff --git a/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.cpp b/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.cpp index 3e1d58304c..384f08f488 100644 --- a/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.cpp +++ b/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.cpp @@ -115,7 +115,7 @@ void ComponentLayoutPanel::updatePropertiesList() ((LayoutPropsPanel*) propsPanel)->updateList(); } -const Rectangle ComponentLayoutPanel::getComponentArea() const +const Rectangle ComponentLayoutPanel::getComponentArea() const { return ((ComponentLayoutEditor*) editor)->getComponentArea(); } diff --git a/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.h b/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.h index c9f7393170..4e376a7ce8 100644 --- a/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.h +++ b/extras/the jucer/src/ui/jucer_ComponentLayoutPanel.h @@ -43,7 +43,7 @@ public: ComponentLayout& getLayout() const throw() { return layout;} void updatePropertiesList(); - const Rectangle getComponentArea() const; + const Rectangle getComponentArea() const; Image* createComponentSnapshot() const; diff --git a/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.cpp b/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.cpp index 46edafd203..925c713b99 100644 --- a/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.cpp +++ b/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.cpp @@ -180,8 +180,8 @@ void ComponentOverlayComponent::resizeEnd() } void ComponentOverlayComponent::checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& previousBounds, - const Rectangle& limits, + const Rectangle& previousBounds, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, @@ -234,7 +234,7 @@ void ComponentOverlayComponent::checkBounds (int& x, int& y, int& w, int& h, void ComponentOverlayComponent::applyBoundsToComponent (Component* component, int x, int y, int w, int h) { - if (component->getBounds() != Rectangle (x, y, w, h)) + if (component->getBounds() != Rectangle (x, y, w, h)) { layout.getDocument()->getUndoManager().undoCurrentTransactionOnly(); diff --git a/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.h b/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.h index 1013d9ef96..b658f9584e 100644 --- a/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.h +++ b/extras/the jucer/src/ui/jucer_ComponentOverlayComponent.h @@ -65,8 +65,8 @@ public: void updateBoundsToMatchTarget(); void checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& previousBounds, - const Rectangle& limits, + const Rectangle& previousBounds, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, diff --git a/extras/the jucer/src/ui/jucer_EditingPanelBase.h b/extras/the jucer/src/ui/jucer_EditingPanelBase.h index 2393e0ddda..f3ba0ffd44 100644 --- a/extras/the jucer/src/ui/jucer_EditingPanelBase.h +++ b/extras/the jucer/src/ui/jucer_EditingPanelBase.h @@ -53,7 +53,7 @@ public: virtual void updatePropertiesList() = 0; - virtual const Rectangle getComponentArea() const = 0; + virtual const Rectangle getComponentArea() const = 0; double getZoom() const; void setZoom (double newScale); diff --git a/extras/the jucer/src/ui/jucer_JucerDocumentHolder.cpp b/extras/the jucer/src/ui/jucer_JucerDocumentHolder.cpp index d0f77b1a41..57a63c9495 100644 --- a/extras/the jucer/src/ui/jucer_JucerDocumentHolder.cpp +++ b/extras/the jucer/src/ui/jucer_JucerDocumentHolder.cpp @@ -628,7 +628,7 @@ void JucerDocumentHolder::addElement (const int index) if (panel != 0) { PaintRoutine* const currentPaintRoutine = & (panel->getPaintRoutine()); - const Rectangle area (panel->getComponentArea()); + const Rectangle area (panel->getComponentArea()); document->getUndoManager().beginNewTransaction(); @@ -648,7 +648,7 @@ void JucerDocumentHolder::addElement (const int index) panel->xyToTargetXY (x, y); - Rectangle r (e->getCurrentBounds (area)); + Rectangle r (e->getCurrentBounds (area)); r.setPosition (x, y); e->setCurrentBounds (r, area, true); @@ -669,7 +669,7 @@ void JucerDocumentHolder::addComponent (const int index) if (panel != 0) { - const Rectangle area (panel->getComponentArea()); + const Rectangle area (panel->getComponentArea()); document->getUndoManager().beginNewTransaction (T("Add new ") + ObjectTypes::componentTypeHandlers [index]->getTypeName()); diff --git a/extras/the jucer/src/ui/jucer_PaintRoutineEditor.cpp b/extras/the jucer/src/ui/jucer_PaintRoutineEditor.cpp index 8474e88900..0dce063f80 100644 --- a/extras/the jucer/src/ui/jucer_PaintRoutineEditor.cpp +++ b/extras/the jucer/src/ui/jucer_PaintRoutineEditor.cpp @@ -68,27 +68,27 @@ void PaintRoutineEditor::removeAllElementComps() } } -const Rectangle PaintRoutineEditor::getComponentArea() const +const Rectangle PaintRoutineEditor::getComponentArea() const { if (document.isFixedSize()) { - return Rectangle ((getWidth() - document.getInitialWidth()) / 2, - (getHeight() - document.getInitialHeight()) / 2, - document.getInitialWidth(), - document.getInitialHeight()); + return Rectangle ((getWidth() - document.getInitialWidth()) / 2, + (getHeight() - document.getInitialHeight()) / 2, + document.getInitialWidth(), + document.getInitialHeight()); } else { - return Rectangle (editorEdgeGap, editorEdgeGap, - getWidth() - editorEdgeGap * 2, - getHeight() - editorEdgeGap * 2); + return Rectangle (editorEdgeGap, editorEdgeGap, + getWidth() - editorEdgeGap * 2, + getHeight() - editorEdgeGap * 2); } } //============================================================================== void PaintRoutineEditor::paint (Graphics& g) { - const Rectangle clip (getComponentArea()); + const Rectangle clip (getComponentArea()); g.setOrigin (clip.getX(), clip.getY()); g.reduceClipRegion (0, 0, clip.getWidth(), clip.getHeight()); @@ -104,7 +104,7 @@ void PaintRoutineEditor::paintOverChildren (Graphics& g) if (componentOverlay != 0) { - const Rectangle clip (getComponentArea()); + const Rectangle clip (getComponentArea()); g.drawImageAt (componentOverlay, clip.getX(), clip.getY()); } } @@ -120,7 +120,7 @@ void PaintRoutineEditor::resized() void PaintRoutineEditor::updateChildBounds() { - const Rectangle clip (getComponentArea()); + const Rectangle clip (getComponentArea()); for (int i = 0; i < getNumChildComponents(); ++i) { @@ -263,7 +263,7 @@ void PaintRoutineEditor::mouseUp (const MouseEvent& e) void PaintRoutineEditor::findLassoItemsInArea (Array & results, int x, int y, int w, int h) { - const Rectangle lasso (x, y, w, h); + const Rectangle lasso (x, y, w, h); for (int i = 0; i < getNumChildComponents(); ++i) { diff --git a/extras/the jucer/src/ui/jucer_PaintRoutineEditor.h b/extras/the jucer/src/ui/jucer_PaintRoutineEditor.h index 843d23a6d1..826f7296af 100644 --- a/extras/the jucer/src/ui/jucer_PaintRoutineEditor.h +++ b/extras/the jucer/src/ui/jucer_PaintRoutineEditor.h @@ -66,7 +66,7 @@ public: bool isInterestedInFileDrag (const StringArray& files); void filesDropped (const StringArray& filenames, int x, int y); - const Rectangle getComponentArea() const; + const Rectangle getComponentArea() const; //============================================================================== void refreshAllElements(); diff --git a/extras/the jucer/src/ui/jucer_PaintRoutinePanel.cpp b/extras/the jucer/src/ui/jucer_PaintRoutinePanel.cpp index a422beef24..f73c00fa9a 100644 --- a/extras/the jucer/src/ui/jucer_PaintRoutinePanel.cpp +++ b/extras/the jucer/src/ui/jucer_PaintRoutinePanel.cpp @@ -188,7 +188,7 @@ void PaintRoutinePanel::updatePropertiesList() ((GraphicsPropsPanel*) propsPanel)->updateList(); } -const Rectangle PaintRoutinePanel::getComponentArea() const +const Rectangle PaintRoutinePanel::getComponentArea() const { return ((PaintRoutineEditor*) editor)->getComponentArea(); } diff --git a/extras/the jucer/src/ui/jucer_PaintRoutinePanel.h b/extras/the jucer/src/ui/jucer_PaintRoutinePanel.h index 77586d0212..3381b039fc 100644 --- a/extras/the jucer/src/ui/jucer_PaintRoutinePanel.h +++ b/extras/the jucer/src/ui/jucer_PaintRoutinePanel.h @@ -46,7 +46,7 @@ public: PaintRoutine& getPaintRoutine() const throw() { return routine; } void updatePropertiesList(); - const Rectangle getComponentArea() const; + const Rectangle getComponentArea() const; //============================================================================== juce_UseDebuggingNewOperator diff --git a/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp b/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp index d5a32a7d65..a55a8e6ae3 100644 --- a/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp +++ b/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp @@ -333,7 +333,7 @@ const String positionToString (const RelativePositionedRectangle& pos) void positionToXY (const RelativePositionedRectangle& position, double& x, double& y, - const Rectangle& parentArea, + const Rectangle& parentArea, const ComponentLayout* layout) { double w, h; @@ -586,12 +586,12 @@ void drawResizableBorder (Graphics& g, void drawMouseOverCorners (Graphics& g, int w, int h) { - RectangleList r (Rectangle (0, 0, w, h)); - r.subtract (Rectangle (1, 1, w - 2, h - 2)); + RectangleList r (Rectangle (0, 0, w, h)); + r.subtract (Rectangle (1, 1, w - 2, h - 2)); const int size = jmin (w / 3, h / 3, 12); - r.subtract (Rectangle (size, 0, w - size - size, h)); - r.subtract (Rectangle (0, size, w, h - size - size)); + r.subtract (Rectangle (size, 0, w - size - size, h)); + r.subtract (Rectangle (0, size, w, h - size - size)); g.setColour (Colours::darkgrey); @@ -648,7 +648,7 @@ bool RelativePositionedRectangle::operator!= (const RelativePositionedRectangle& return ! operator== (other); } -void RelativePositionedRectangle::getRelativeTargetBounds (const Rectangle& parentArea, +void RelativePositionedRectangle::getRelativeTargetBounds (const Rectangle& parentArea, const ComponentLayout* layout, int& x, int& xw, int& y, int& yh, int& w, int& h) const @@ -674,44 +674,44 @@ void RelativePositionedRectangle::getRelativeTargetBounds (const Rectangle& pare yh = ry != 0 ? ry->getHeight() : parentArea.getHeight(); } -const Rectangle RelativePositionedRectangle::getRectangle (const Rectangle& parentArea, - const ComponentLayout* layout) const +const Rectangle RelativePositionedRectangle::getRectangle (const Rectangle& parentArea, + const ComponentLayout* layout) const { int x, xw, y, yh, w, h; getRelativeTargetBounds (parentArea, layout, x, xw, y, yh, w, h); - const Rectangle xyRect ((xw <= 0 || yh <= 0) ? Rectangle() - : rect.getRectangle (Rectangle (x, y, xw, yh))); + const Rectangle xyRect ((xw <= 0 || yh <= 0) ? Rectangle() + : rect.getRectangle (Rectangle (x, y, xw, yh))); - const Rectangle whRect ((w <= 0 || h <= 0) ? Rectangle() - : rect.getRectangle (Rectangle (x, y, w, h))); + const Rectangle whRect ((w <= 0 || h <= 0) ? Rectangle() + : rect.getRectangle (Rectangle (x, y, w, h))); - return Rectangle (xyRect.getX(), xyRect.getY(), - whRect.getWidth(), whRect.getHeight()); + return Rectangle (xyRect.getX(), xyRect.getY(), + whRect.getWidth(), whRect.getHeight()); } void RelativePositionedRectangle::getRectangleDouble (double& x, double& y, double& w, double& h, - const Rectangle& parentArea, + const Rectangle& parentArea, const ComponentLayout* layout) const { int rx, rxw, ry, ryh, rw, rh; getRelativeTargetBounds (parentArea, layout, rx, rxw, ry, ryh, rw, rh); double dummy1, dummy2; - rect.getRectangleDouble (Rectangle (rx, ry, rxw, ryh), x, y, dummy1, dummy2); - rect.getRectangleDouble (Rectangle (rx, ry, rw, rh), dummy1, dummy2, w, h); + rect.getRectangleDouble (Rectangle (rx, ry, rxw, ryh), x, y, dummy1, dummy2); + rect.getRectangleDouble (Rectangle (rx, ry, rw, rh), dummy1, dummy2, w, h); } void RelativePositionedRectangle::updateFromComponent (const Component& comp, const ComponentLayout* layout) { int x, xw, y, yh, w, h; - getRelativeTargetBounds (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()), + getRelativeTargetBounds (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()), layout, x, xw, y, yh, w, h); PositionedRectangle xyRect (rect), whRect (rect); - xyRect.updateFrom (comp.getBounds(), Rectangle (x, y, xw, yh)); - whRect.updateFrom (comp.getBounds(), Rectangle (x, y, w, h)); + xyRect.updateFrom (comp.getBounds(), Rectangle (x, y, xw, yh)); + whRect.updateFrom (comp.getBounds(), Rectangle (x, y, w, h)); rect.setX (xyRect.getX()); rect.setY (xyRect.getY()); @@ -720,14 +720,14 @@ void RelativePositionedRectangle::updateFromComponent (const Component& comp, } void RelativePositionedRectangle::updateFrom (double newX, double newY, double newW, double newH, - const Rectangle& parentArea, const ComponentLayout* layout) + const Rectangle& parentArea, const ComponentLayout* layout) { int x, xw, y, yh, w, h; getRelativeTargetBounds (parentArea, layout, x, xw, y, yh, w, h); PositionedRectangle xyRect (rect), whRect (rect); - xyRect.updateFromDouble (newX, newY, newW, newH, Rectangle (x, y, xw, yh)); - whRect.updateFromDouble (newX, newY, newW, newH, Rectangle (x, y, w, h)); + xyRect.updateFromDouble (newX, newY, newW, newH, Rectangle (x, y, xw, yh)); + whRect.updateFromDouble (newX, newY, newW, newH, Rectangle (x, y, w, h)); rect.setX (xyRect.getX()); rect.setY (xyRect.getY()); diff --git a/extras/the jucer/src/utility/jucer_UtilityFunctions.h b/extras/the jucer/src/utility/jucer_UtilityFunctions.h index 3aae045b47..3b18ebf762 100644 --- a/extras/the jucer/src/utility/jucer_UtilityFunctions.h +++ b/extras/the jucer/src/utility/jucer_UtilityFunctions.h @@ -48,17 +48,17 @@ struct RelativePositionedRectangle bool operator== (const RelativePositionedRectangle& other) const throw(); bool operator!= (const RelativePositionedRectangle& other) const throw(); - const Rectangle getRectangle (const Rectangle& parentArea, const ComponentLayout* layout) const; + const Rectangle getRectangle (const Rectangle& parentArea, const ComponentLayout* layout) const; void getRectangleDouble (double& x, double& y, double& w, double& h, - const Rectangle& parentArea, const ComponentLayout* layout) const; + const Rectangle& parentArea, const ComponentLayout* layout) const; void updateFromComponent (const Component& comp, const ComponentLayout* layout); void updateFrom (double newX, double newY, double newW, double newH, - const Rectangle& parentArea, const ComponentLayout* layout); + const Rectangle& parentArea, const ComponentLayout* layout); void applyToXml (XmlElement& e) const; void restoreFromXml (const XmlElement& e, const RelativePositionedRectangle& defaultPos); - void getRelativeTargetBounds (const Rectangle& parentArea, + void getRelativeTargetBounds (const Rectangle& parentArea, const ComponentLayout* layout, int& x, int& xw, int& y, int& yh, int& w, int& h) const; }; @@ -96,7 +96,7 @@ const String positionToString (const RelativePositionedRectangle& pos); void positionToXY (const RelativePositionedRectangle& position, double& x, double& y, - const Rectangle& parentArea, + const Rectangle& parentArea, const ComponentLayout* layout); void positionToCode (const RelativePositionedRectangle& position, diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 05b2d4b5c7..75cf605a0a 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -21151,7 +21151,7 @@ void AudioThumbnail::drawChannel (Graphics& g, const float midY = topY + h * 0.5f; const float vscale = verticalZoomFactor * h / 256.0f; - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); const int skipLeft = jlimit (0, w, clip.getX() - x); w -= skipLeft; x += skipLeft; @@ -32754,7 +32754,7 @@ public: #if JUCE_LINUX if (pluginWindow != 0) { - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); XEvent ev; zerostruct (ev); @@ -38634,7 +38634,7 @@ public: alpha (1.0f), scale (1.0f) { - image = comp->createComponentSnapshot (Rectangle (0, 0, comp->getWidth(), comp->getHeight())); + image = comp->createComponentSnapshot (Rectangle (0, 0, comp->getWidth(), comp->getHeight())); setBounds (comp->getBounds()); comp->getParentComponent()->addAndMakeVisible (this); toBehind (comp); @@ -38785,7 +38785,7 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo) bool wasFullscreen = false; bool wasMinimised = false; ComponentBoundsConstrainer* currentConstainer = 0; - Rectangle oldNonFullScreenBounds; + Rectangle oldNonFullScreenBounds; if (peer != 0) { @@ -39290,7 +39290,7 @@ void Component::setTopRightPosition (const int x, const int y) setTopLeftPosition (x - getWidth(), y); } -void Component::setBounds (const Rectangle& r) +void Component::setBounds (const Rectangle& r) { setBounds (r.getX(), r.getY(), @@ -40127,13 +40127,13 @@ void Component::paintEntireComponent (Graphics& originalContext) #endif } -Image* Component::createComponentSnapshot (const Rectangle& areaToGrab, +Image* Component::createComponentSnapshot (const Rectangle& areaToGrab, const bool clipImageToComponentBounds) { - Rectangle r (areaToGrab); + Rectangle r (areaToGrab); if (clipImageToComponentBounds) - r = r.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); + r = r.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); Image* const componentImage = Image::createNativeImage (flags.opaqueFlag ? Image::RGB : Image::ARGB, jmax (1, r.getWidth()), @@ -40270,7 +40270,7 @@ void Component::colourChanged() { } -const Rectangle Component::getUnclippedArea() const +const Rectangle Component::getUnclippedArea() const { int x = 0, y = 0, w = getWidth(), h = getHeight(); @@ -40280,18 +40280,18 @@ const Rectangle Component::getUnclippedArea() const while (p != 0) { - if (! Rectangle::intersectRectangles (x, y, w, h, -px, -py, p->getWidth(), p->getHeight())) - return Rectangle(); + if (! Rectangle::intersectRectangles (x, y, w, h, -px, -py, p->getWidth(), p->getHeight())) + return Rectangle(); px += p->getX(); py += p->getY(); p = p->parentComponent_; } - return Rectangle (x, y, w, h); + return Rectangle (x, y, w, h); } -void Component::clipObscuredRegions (Graphics& g, const Rectangle& clipRect, +void Component::clipObscuredRegions (Graphics& g, const Rectangle& clipRect, const int deltaX, const int deltaY) const throw() { for (int i = childComponentList_.size(); --i >= 0;) @@ -40300,7 +40300,7 @@ void Component::clipObscuredRegions (Graphics& g, const Rectangle& clipRect, if (c->isVisible()) { - Rectangle newClip (clipRect.getIntersection (c->bounds_)); + Rectangle newClip (clipRect.getIntersection (c->bounds_)); if (! newClip.isEmpty()) { @@ -40327,7 +40327,7 @@ void Component::getVisibleArea (RectangleList& result, const bool includeSiblings) const { result.clear(); - const Rectangle unclipped (getUnclippedArea()); + const Rectangle unclipped (getUnclippedArea()); if (! unclipped.isEmpty()) { @@ -40341,7 +40341,7 @@ void Component::getVisibleArea (RectangleList& result, c->relativePositionToOtherComponent (this, x, y); c->subtractObscuredRegions (result, x, y, - Rectangle (0, 0, c->getWidth(), c->getHeight()), + Rectangle (0, 0, c->getWidth(), c->getHeight()), this); } @@ -40353,7 +40353,7 @@ void Component::getVisibleArea (RectangleList& result, void Component::subtractObscuredRegions (RectangleList& result, const int deltaX, const int deltaY, - const Rectangle& clipRect, + const Rectangle& clipRect, const Component* const compToAvoid) const throw() { for (int i = childComponentList_.size(); --i >= 0;) @@ -40364,14 +40364,14 @@ void Component::subtractObscuredRegions (RectangleList& result, { if (c->isOpaque()) { - Rectangle childBounds (c->bounds_.getIntersection (clipRect)); + Rectangle childBounds (c->bounds_.getIntersection (clipRect)); childBounds.translate (deltaX, deltaY); result.subtract (childBounds); } else { - Rectangle newClip (clipRect.getIntersection (c->bounds_)); + Rectangle newClip (clipRect.getIntersection (c->bounds_)); newClip.translate (-c->getX(), -c->getY()); c->subtractObscuredRegions (result, @@ -40789,7 +40789,7 @@ void Component::internalMouseDown (const int x, const int y, const int64 time) int gx = x, gy = y; relativePositionToGlobal (gx, gy); - desktop.registerMouseDown (gx, gy, time, this); + desktop.registerMouseDown (Point (gx, gy), time, this); const ComponentDeletionWatcher deletionChecker (this); @@ -40931,7 +40931,7 @@ void Component::internalMouseUp (const int oldModifiers, int x, int y, const int int gx = x, gy = y; relativePositionToGlobal (gx, gy); - desktop.registerMouseDrag (gx, gy); + desktop.registerMouseDrag (Point (gx, gy)); const ComponentDeletionWatcher deletionChecker (this); @@ -41073,7 +41073,7 @@ void Component::internalMouseDrag (int x, int y, const int64 time) int gx = x, gy = y; relativePositionToGlobal (gx, gy); - desktop.registerMouseDrag (gx, gy); + desktop.registerMouseDrag (Point (gx, gy)); const ComponentDeletionWatcher deletionChecker (this); @@ -41146,7 +41146,7 @@ void Component::internalMouseDrag (int x, int y, const int64 time) { if (isUnboundedMouseModeOn) { - Rectangle screenArea (getParentMonitorArea().expanded (-2, -2)); + Rectangle screenArea (getParentMonitorArea().expanded (-2, -2)); int mx, my; Desktop::getMousePosition (mx, my); @@ -41782,7 +41782,7 @@ Component* JUCE_CALLTYPE Component::getComponentUnderMouse() throw() return componentUnderMouse; } -const Rectangle Component::getParentMonitorArea() const throw() +const Rectangle Component::getParentMonitorArea() const throw() { int centreX = getWidth() / 2; int centreY = getHeight() / 2; @@ -41928,13 +41928,13 @@ Desktop& JUCE_CALLTYPE Desktop::getInstance() throw() Desktop* Desktop::instance = 0; -extern void juce_updateMultiMonitorInfo (Array & monitorCoords, +extern void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea); void Desktop::refreshMonitorSizes() throw() { - const Array oldClipped (monitorCoordsClipped); - const Array oldUnclipped (monitorCoordsUnclipped); + const Array > oldClipped (monitorCoordsClipped); + const Array > oldUnclipped (monitorCoordsUnclipped); monitorCoordsClipped.clear(); monitorCoordsUnclipped.clear(); @@ -41960,7 +41960,7 @@ int Desktop::getNumDisplayMonitors() const throw() return monitorCoordsClipped.size(); } -const Rectangle Desktop::getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw() +const Rectangle Desktop::getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw() { return clippedToWorkArea ? monitorCoordsClipped [index] : monitorCoordsUnclipped [index]; @@ -41976,19 +41976,19 @@ const RectangleList Desktop::getAllMonitorDisplayAreas (const bool clippedToWork return rl; } -const Rectangle Desktop::getMainMonitorArea (const bool clippedToWorkArea) const throw() +const Rectangle Desktop::getMainMonitorArea (const bool clippedToWorkArea) const throw() { return getDisplayMonitorCoordinates (0, clippedToWorkArea); } -const Rectangle Desktop::getMonitorAreaContaining (int cx, int cy, const bool clippedToWorkArea) const throw() +const Rectangle Desktop::getMonitorAreaContaining (int cx, int cy, const bool clippedToWorkArea) const throw() { - Rectangle best (getMainMonitorArea (clippedToWorkArea)); + Rectangle best (getMainMonitorArea (clippedToWorkArea)); double bestDistance = 1.0e10; for (int i = getNumDisplayMonitors(); --i >= 0;) { - const Rectangle rect (getDisplayMonitorCoordinates (i, clippedToWorkArea)); + const Rectangle rect (getDisplayMonitorCoordinates (i, clippedToWorkArea)); if (rect.contains (cx, cy)) return rect; @@ -42071,8 +42071,8 @@ void Desktop::componentBroughtToFront (Component* const c) throw() void Desktop::getLastMouseDownPosition (int& x, int& y) throw() { const Desktop& d = getInstance(); - x = d.mouseDowns[0].x; - y = d.mouseDowns[0].y; + x = d.mouseDowns[0].position.getX(); + y = d.mouseDowns[0].position.getY(); } int Desktop::getMouseButtonClickCounter() throw() @@ -42090,24 +42090,23 @@ const Time Desktop::getLastMouseDownTime() const throw() return Time (mouseDowns[0].time); } -void Desktop::registerMouseDown (int x, int y, int64 time, Component* component) throw() +void Desktop::registerMouseDown (const Point& position, int64 time, Component* component) throw() { for (int i = numElementsInArray (mouseDowns); --i > 0;) mouseDowns[i] = mouseDowns[i - 1]; - mouseDowns[0].x = x; - mouseDowns[0].y = y; + mouseDowns[0].position = position; mouseDowns[0].time = time; mouseDowns[0].component = component; mouseMovedSignificantlySincePressed = false; } -void Desktop::registerMouseDrag (int x, int y) throw() +void Desktop::registerMouseDrag (const Point& position) throw() { mouseMovedSignificantlySincePressed = mouseMovedSignificantlySincePressed - || abs (mouseDowns[0].x - x) >= 4 - || abs (mouseDowns[0].y - y) >= 4; + || abs (mouseDowns[0].position.getX() - position.getX()) >= 4 + || abs (mouseDowns[0].position.getY() - position.getY()) >= 4; } int Desktop::getNumberOfMultipleClicks() const throw() @@ -42123,8 +42122,8 @@ int Desktop::getNumberOfMultipleClicks() const throw() { if (mouseDowns[0].time - mouseDowns[i].time < (int) (MouseEvent::getDoubleClickTimeout() * (1.0 + 0.25 * (i - 1))) - && abs (mouseDowns[0].x - mouseDowns[i].x) < 8 - && abs (mouseDowns[0].y - mouseDowns[i].y) < 8 + && abs (mouseDowns[0].position.getX() - mouseDowns[i].position.getX()) < 8 + && abs (mouseDowns[0].position.getY() - mouseDowns[i].position.getY()) < 8 && mouseDowns[0].component == mouseDowns[i].component) { ++numClicks; @@ -43124,7 +43123,7 @@ void DrawableButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) { - Rectangle imageSpace; + Rectangle imageSpace; if (style == ImageOnButtonBackground) { @@ -43597,19 +43596,15 @@ void ShapeButton::setShape (const Path& newShape, if (resizeNowToFitThisShape) { - float x, y, w, h; - shape.getBounds (x, y, w, h); - shape.applyTransform (AffineTransform::translation (-x, -y)); + Rectangle bounds (shape.getBounds()); if (hasShadow) - { - w += 4.0f; - h += 4.0f; - shape.applyTransform (AffineTransform::translation (2.0f, 2.0f)); - } + bounds.expand (4.0f, 4.0f); - setSize (1 + (int) (w + outlineWidth), - 1 + (int) (h + outlineWidth)); + shape.applyTransform (AffineTransform::translation (-bounds.getX(), -bounds.getY())); + + setSize (1 + (int) (bounds.getWidth() + outlineWidth), + 1 + (int) (bounds.getHeight() + outlineWidth)); } } @@ -43792,7 +43787,7 @@ void ToolbarButton::paintButtonArea (Graphics& g, } } -void ToolbarButton::contentAreaChanged (const Rectangle&) +void ToolbarButton::contentAreaChanged (const Rectangle&) { } @@ -44316,7 +44311,7 @@ bool CodeDocument::writeToStream (OutputStream& stream) String temp (lines.getUnchecked(i)->line); // use a copy to avoid bloating the memory footprint of the stored string. const char* utf8 = temp.toUTF8(); - if (! stream.write (utf8, strlen (utf8))) + if (! stream.write (utf8, (int) strlen (utf8))) return false; } @@ -44735,7 +44730,7 @@ public: startTimer (400); setVisible (true); - const Rectangle pos (owner.getCharacterBounds (owner.getCaretPos())); + const Rectangle pos (owner.getCharacterBounds (owner.getCaretPos())); setBounds (pos.getX(), pos.getY(), 2, pos.getHeight()); } }; @@ -45057,7 +45052,7 @@ void CodeEditorComponent::paint (Graphics& g) const Colour defaultColour (findColour (CodeEditorComponent::defaultTextColourId)); const Colour highlightColour (findColour (CodeEditorComponent::highlightColourId)); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); const int firstLineToDraw = jmax (0, clip.getY() / lineHeight); const int lastLineToDraw = jmin (lines.size(), clip.getBottom() / lineHeight + 1); @@ -45260,12 +45255,12 @@ void CodeEditorComponent::scrollToKeepCaretOnScreen() scrollToColumn (column); } -const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const throw() +const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const throw() { - return Rectangle (roundToInt ((gutter - xOffset * charWidth) + indexToColumn (pos.getLineNumber(), pos.getIndexInLine()) * charWidth), - (pos.getLineNumber() - firstLineOnScreen) * lineHeight, - roundToInt (charWidth), - lineHeight); + return Rectangle (roundToInt ((gutter - xOffset * charWidth) + indexToColumn (pos.getLineNumber(), pos.getIndexInLine()) * charWidth), + (pos.getLineNumber() - firstLineOnScreen) * lineHeight, + roundToInt (charWidth), + lineHeight); } const CodeDocument::Position CodeEditorComponent::getPositionAt (int x, int y) @@ -48076,8 +48071,8 @@ int ListBox::getRowNumberOfComponent (Component* const rowComponent) const throw return viewport->getRowNumberOfComponent (rowComponent); } -const Rectangle ListBox::getRowPosition (const int rowNumber, - const bool relativeToComponentTopLeft) const throw() +const Rectangle ListBox::getRowPosition (const int rowNumber, + const bool relativeToComponentTopLeft) const throw() { const int rowHeight = getRowHeight(); int y = viewport->getY() + rowHeight * rowNumber; @@ -48085,8 +48080,8 @@ const Rectangle ListBox::getRowPosition (const int rowNumber, if (relativeToComponentTopLeft) y -= viewport->getViewPositionY(); - return Rectangle (viewport->getX(), y, - viewport->getViewedComponent()->getWidth(), rowHeight); + return Rectangle (viewport->getX(), y, + viewport->getViewedComponent()->getWidth(), rowHeight); } void ListBox::setVerticalPosition (const double proportion) @@ -48302,13 +48297,13 @@ void ListBox::setHeaderComponent (Component* const newHeaderComponent) void ListBox::repaintRow (const int rowNumber) throw() { - const Rectangle r (getRowPosition (rowNumber, true)); + const Rectangle r (getRowPosition (rowNumber, true)); repaint (r.getX(), r.getY(), r.getWidth(), r.getHeight()); } Image* ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) { - Rectangle imageArea; + Rectangle imageArea; const int firstRow = getRowContainingPosition (0, 0); int i; @@ -48321,7 +48316,7 @@ Image* ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) int x = 0, y = 0; rowComp->relativePositionToOtherComponent (this, x, y); - const Rectangle rowRect (x, y, rowComp->getWidth(), rowComp->getHeight()); + const Rectangle rowRect (x, y, rowComp->getWidth(), rowComp->getHeight()); if (imageArea.isEmpty()) imageArea = rowRect; @@ -48330,7 +48325,7 @@ Image* ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) } } - imageArea = imageArea.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); + imageArea = imageArea.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); imageX = imageArea.getX(); imageY = imageArea.getY(); Image* snapshot = Image::createNativeImage (Image::ARGB, imageArea.getWidth(), imageArea.getHeight(), true); @@ -48366,7 +48361,7 @@ void ListBox::startDragAndDrop (const MouseEvent& e, const String& dragDescripti dragImage->multiplyAllAlphas (0.6f); MouseEvent e2 (e.getEventRelativeTo (this)); - const Point p ((float) (x - e2.x), (float) (y - e2.y)); + const Point p (x - e2.x, y - e2.y); dragContainer->startDragging (dragDescription, this, dragImage, true, &p); } else @@ -49413,7 +49408,7 @@ void Slider::resized() if (style == IncDecButtons) { - Rectangle buttonRect (sliderRect); + Rectangle buttonRect (sliderRect); if (textBoxPos == TextBoxLeft || textBoxPos == TextBoxRight) buttonRect.expand (-2, 0); @@ -50127,7 +50122,7 @@ int TableHeaderComponent::getColumnIdOfIndex (int index, const bool onlyCountVis return (ci != 0) ? ci->id : 0; } -const Rectangle TableHeaderComponent::getColumnPosition (const int index) const +const Rectangle TableHeaderComponent::getColumnPosition (const int index) const { int x = 0, width = 0, n = 0; @@ -50148,7 +50143,7 @@ const Rectangle TableHeaderComponent::getColumnPosition (const int index) const } } - return Rectangle (x, 0, width, getHeight()); + return Rectangle (x, 0, width, getHeight()); } int TableHeaderComponent::getColumnIdAtX (const int xToFind) const @@ -50407,7 +50402,7 @@ void TableHeaderComponent::paint (Graphics& g) lf.drawTableHeaderBackground (g, *this); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); int x = 0; for (int i = 0; i < columns.size(); ++i) @@ -50516,7 +50511,7 @@ void TableHeaderComponent::mouseDrag (const MouseEvent& e) if (columns.getUnchecked (i)->isVisible()) minWidthOnRight += columns.getUnchecked (i)->minimumWidth; - const Rectangle currentPos (getColumnPosition (getIndexOfColumnId (columnIdBeingResized, true))); + const Rectangle currentPos (getColumnPosition (getIndexOfColumnId (columnIdBeingResized, true))); w = jmax (ci->minimumWidth, jmin (w, getWidth() - minWidthOnRight - currentPos.getX())); } @@ -50610,7 +50605,7 @@ void TableHeaderComponent::beginDrag (const MouseEvent& e) { draggingColumnOriginalIndex = getIndexOfColumnId (columnIdBeingDragged, true); - const Rectangle columnRect (getColumnPosition (draggingColumnOriginalIndex)); + const Rectangle columnRect (getColumnPosition (draggingColumnOriginalIndex)); const int temp = columnIdBeingDragged; columnIdBeingDragged = 0; @@ -50856,7 +50851,7 @@ public: if (! columnsWithComponents [i]) { const int columnId = header->getColumnIdOfIndex (i, true); - Rectangle columnRect (header->getColumnPosition (i)); + Rectangle columnRect (header->getColumnPosition (i)); columnRect.setSize (columnRect.getWidth(), getHeight()); g.saveState(); @@ -50910,7 +50905,7 @@ public: newComp->getProperties().set (tagPropertyName, newTag); newComp->getProperties().set (tableColumnPropertyTag, columnId); - const Rectangle columnRect (header->getColumnPosition (i)); + const Rectangle columnRect (header->getColumnPosition (i)); newComp->setBounds (columnRect.getX(), 0, columnRect.getWidth(), getHeight()); columnsWithComponents.setBit (i); @@ -50943,7 +50938,7 @@ public: if (columnId != 0) { - const Rectangle columnRect (owner.getHeader()->getColumnPosition (owner.getHeader()->getIndexOfColumnId (columnId, true))); + const Rectangle columnRect (owner.getHeader()->getColumnPosition (owner.getHeader()->getIndexOfColumnId (columnId, true))); c->setBounds (columnRect.getX(), 0, columnRect.getWidth(), getHeight()); } } @@ -51162,19 +51157,19 @@ bool TableListBox::isAutoSizeMenuOptionShown() const return autoSizeOptionsShown; } -const Rectangle TableListBox::getCellPosition (const int columnId, - const int rowNumber, - const bool relativeToComponentTopLeft) const +const Rectangle TableListBox::getCellPosition (const int columnId, + const int rowNumber, + const bool relativeToComponentTopLeft) const { - Rectangle headerCell (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); + Rectangle headerCell (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); if (relativeToComponentTopLeft) headerCell.translate (header->getX(), 0); - const Rectangle row (getRowPosition (rowNumber, relativeToComponentTopLeft)); + const Rectangle row (getRowPosition (rowNumber, relativeToComponentTopLeft)); - return Rectangle (headerCell.getX(), row.getY(), - headerCell.getWidth(), row.getHeight()); + return Rectangle (headerCell.getX(), row.getY(), + headerCell.getWidth(), row.getHeight()); } void TableListBox::scrollToEnsureColumnIsOnscreen (const int columnId) @@ -51183,7 +51178,7 @@ void TableListBox::scrollToEnsureColumnIsOnscreen (const int columnId) if (scrollbar != 0) { - const Rectangle pos (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); + const Rectangle pos (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); double x = scrollbar->getCurrentRangeStart(); const double w = scrollbar->getCurrentRangeSize(); @@ -52708,13 +52703,13 @@ void TextEditor::scrollEditorToPositionCaret (const int desiredCaretX, viewport->setViewPosition (vx, vy); } -const Rectangle TextEditor::getCaretRectangle() +const Rectangle TextEditor::getCaretRectangle() { updateCaretPosition(); - return Rectangle (roundToInt (cursorX) - viewport->getX(), - roundToInt (cursorY) - viewport->getY(), - 1, roundToInt (cursorHeight)); + return Rectangle (roundToInt (cursorX) - viewport->getX(), + roundToInt (cursorY) - viewport->getY(), + 1, roundToInt (cursorHeight)); } float TextEditor::getWordWrapWidth() const @@ -52968,7 +52963,7 @@ void TextEditor::drawContent (Graphics& g) if (wordWrapWidth > 0) { g.setOrigin (leftIndent, topIndent); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); Colour selectedTextColour; TextEditorIterator i (sections, wordWrapWidth, passwordCharacter); @@ -53969,7 +53964,7 @@ public: { } - void contentAreaChanged (const Rectangle&) + void contentAreaChanged (const Rectangle&) { } @@ -54425,7 +54420,7 @@ void Toolbar::updateAllItemPositions (const bool animate) { const int size = (int) resizer.getItemSize (activeIndex++); - Rectangle newBounds; + Rectangle newBounds; if (vertical) newBounds.setBounds (0, pos, getWidth(), size); else @@ -54523,12 +54518,12 @@ void Toolbar::itemDragMove (const String&, Component* sourceComponent, int x, in const int dragObjectLeft = vertical ? (y - tc->dragOffsetY) : (x - tc->dragOffsetX); const int dragObjectRight = dragObjectLeft + (vertical ? tc->getHeight() : tc->getWidth()); - const Rectangle current (animator.getComponentDestination (getChildComponent (newIndex))); + const Rectangle current (animator.getComponentDestination (getChildComponent (newIndex))); ToolbarItemComponent* const prev = getNextActiveComponent (newIndex, -1); if (prev != 0) { - const Rectangle previousPos (animator.getComponentDestination (prev)); + const Rectangle previousPos (animator.getComponentDestination (prev)); if (abs (dragObjectLeft - (vertical ? previousPos.getY() : previousPos.getX()) < abs (dragObjectRight - (vertical ? current.getBottom() : current.getRight())))) @@ -54540,7 +54535,7 @@ void Toolbar::itemDragMove (const String&, Component* sourceComponent, int x, in ToolbarItemComponent* const next = getNextActiveComponent (newIndex, 1); if (next != 0) { - const Rectangle nextPos (animator.getComponentDestination (next)); + const Rectangle nextPos (animator.getComponentDestination (next)); if (abs (dragObjectLeft - (vertical ? current.getY() : current.getX()) > abs (dragObjectRight - (vertical ? nextPos.getBottom() : nextPos.getRight())))) @@ -54624,7 +54619,7 @@ public: void positionNearBar() { - const Rectangle screenSize (toolbar->getParentMonitorArea()); + const Rectangle screenSize (toolbar->getParentMonitorArea()); const int tbx = toolbar->getScreenX(); const int tby = toolbar->getScreenY(); const int gap = 8; @@ -54978,14 +54973,14 @@ void ToolbarItemComponent::resized() const int indent = jmin (proportionOfWidth (0.08f), proportionOfHeight (0.08f)); - contentArea = Rectangle (indent, indent, - getWidth() - indent * 2, - toolbarStyle == Toolbar::iconsWithText ? proportionOfHeight (0.55f) - : (getHeight() - indent * 2)); + contentArea = Rectangle (indent, indent, + getWidth() - indent * 2, + toolbarStyle == Toolbar::iconsWithText ? proportionOfHeight (0.55f) + : (getHeight() - indent * 2)); } else { - contentArea = Rectangle(); + contentArea = Rectangle(); } contentAreaChanged (contentArea); @@ -55140,7 +55135,7 @@ public: isDragging = false; needSelectionOnMouseUp = false; - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.y, pos); if (item == 0) @@ -55180,7 +55175,7 @@ public: if (needSelectionOnMouseUp && e.mouseWasClicked()) { - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.y, pos); if (item != 0) @@ -55192,7 +55187,7 @@ public: { if (e.getNumberOfClicks() != 3) // ignore triple clicks { - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.y, pos); if (item != 0 && (e.x >= pos.getX() || ! owner->openCloseButtonsVisible)) @@ -55214,7 +55209,7 @@ public: { isDragging = true; - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.getMouseDownY(), pos); if (item != 0 && e.getMouseDownX() >= pos.getX()) @@ -55232,7 +55227,7 @@ public: Image* dragImage = Component::createComponentSnapshot (pos, true); dragImage->multiplyAllAlphas (0.6f); - Point imageOffset ((float) (pos.getX() - e.x), (float) (pos.getY() - e.y)); + Point imageOffset (pos.getX() - e.x, pos.getY() - e.y); dragContainer->startDragging (dragDescription, owner, dragImage, true, &imageOffset); } else @@ -55257,7 +55252,7 @@ public: } void paint (Graphics& g); - TreeViewItem* findItemAt (int y, Rectangle& itemPosition) const; + TreeViewItem* findItemAt (int y, Rectangle& itemPosition) const; void updateComponents() { @@ -55310,7 +55305,7 @@ public: { const TreeViewItem* const item = (TreeViewItem*) rowComponentItems.getUnchecked(i); - Rectangle pos (item->getItemPosition (false)); + Rectangle pos (item->getItemPosition (false)); pos.setSize (pos.getWidth(), item->itemHeight); if (pos.getBottom() >= visibleTop && pos.getY() < visibleBottom) @@ -55346,7 +55341,7 @@ public: if (owner->openCloseButtonsVisible) { - Rectangle pos; + Rectangle pos; TreeViewItem* item = findItemAt (e.y, pos); if (item != 0 && e.x < pos.getX() && e.x >= pos.getX() - owner->getIndentSize()) @@ -55362,7 +55357,7 @@ public: { if (buttonUnderMouse != 0 && containsItem (buttonUnderMouse)) { - const Rectangle r (buttonUnderMouse->getItemPosition (false)); + const Rectangle r (buttonUnderMouse->getItemPosition (false)); repaint (0, r.getY(), r.getX(), buttonUnderMouse->getItemHeight()); } @@ -55370,7 +55365,7 @@ public: if (buttonUnderMouse != 0) { - const Rectangle r (buttonUnderMouse->getItemPosition (false)); + const Rectangle r (buttonUnderMouse->getItemPosition (false)); repaint (0, r.getY(), r.getX(), buttonUnderMouse->getItemHeight()); } } @@ -55390,7 +55385,7 @@ public: { int x, y; getMouseXYRelative (x, y); - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (y, pos); @@ -55635,7 +55630,7 @@ TreeViewItem* TreeView::getItemAt (int y) const throw() TreeViewContentComponent* const tc = (TreeViewContentComponent*) viewport->getViewedComponent(); int x; relativePositionToOtherComponent (tc, x, y); - Rectangle pos; + Rectangle pos; return tc->findItemAt (y, pos); } @@ -55925,7 +55920,7 @@ public: void setTargetPosition (TreeViewItem* const item) throw() { - Rectangle r (item->getItemPosition (true)); + Rectangle r (item->getItemPosition (true)); r.setHeight (item->getItemHeight()); setBounds (r); } @@ -55970,7 +55965,7 @@ TreeViewItem* TreeView::getInsertPosition (int& x, int& y, int& insertIndex, if (item == 0) return 0; - Rectangle itemPos (item->getItemPosition (true)); + Rectangle itemPos (item->getItemPosition (true)); insertIndex = item->getIndexInParent(); const int oldY = y; y = itemPos.getY(); @@ -56125,7 +56120,7 @@ void TreeViewContentComponent::paint (Graphics& g) } } -TreeViewItem* TreeViewContentComponent::findItemAt (int y, Rectangle& itemPosition) const +TreeViewItem* TreeViewContentComponent::findItemAt (int y, Rectangle& itemPosition) const { if (owner->rootItem != 0) { @@ -56359,7 +56354,7 @@ void TreeViewItem::itemDropped (const String& /*sourceDescription*/, Component* { } -const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopLeft) const throw() +const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopLeft) const throw() { const int indentX = getIndentX(); @@ -56368,7 +56363,7 @@ const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopL if (ownerView != 0 && width < 0) width = ownerView->viewport->getViewWidth() - indentX; - Rectangle r (indentX, y, jmax (0, width), totalHeight); + Rectangle r (indentX, y, jmax (0, width), totalHeight); if (relativeToTreeViewTopLeft) r.setPosition (r.getX() - ownerView->viewport->getViewPositionX(), @@ -56387,7 +56382,7 @@ void TreeViewItem::repaintItem() const { if (ownerView != 0 && areAllParentsOpen()) { - const Rectangle r (getItemPosition (true)); + const Rectangle r (getItemPosition (true)); ownerView->viewport->repaint (0, r.getY(), r.getRight(), r.getHeight()); } } @@ -56553,7 +56548,7 @@ void TreeViewItem::paintRecursively (Graphics& g, int width) if (isOpen()) { - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); for (int i = 0; i < subItems.size(); ++i) { @@ -60464,7 +60459,7 @@ struct AnimationTask Component* component; ComponentDeletionWatcher watcher; - Rectangle destination; + Rectangle destination; int msElapsed, msTotal; double startSpeed, midSpeed, endSpeed, lastProgress; double left, top, right, bottom; @@ -60491,10 +60486,10 @@ struct AnimationTask if (delta < 1.0) { - const Rectangle newBounds (roundToInt (left), - roundToInt (top), - roundToInt (right - left), - roundToInt (bottom - top)); + const Rectangle newBounds (roundToInt (left), + roundToInt (top), + roundToInt (right - left), + roundToInt (bottom - top)); if (newBounds != destination) { @@ -60544,7 +60539,7 @@ void* ComponentAnimator::findTaskFor (Component* const component) const } void ComponentAnimator::animateComponent (Component* const component, - const Rectangle& finalPosition, + const Rectangle& finalPosition, const int millisecondsToSpendMoving, const double startSpeed, const double endSpeed) @@ -60617,7 +60612,7 @@ void ComponentAnimator::cancelAnimation (Component* const component, } } -const Rectangle ComponentAnimator::getComponentDestination (Component* const component) +const Rectangle ComponentAnimator::getComponentDestination (Component* const component) { AnimationTask* const at = (AnimationTask*) findTaskFor (component); @@ -60626,7 +60621,7 @@ const Rectangle ComponentAnimator::getComponentDestination (Component* const com else if (component != 0) return component->getBounds(); - return Rectangle(); + return Rectangle(); } bool ComponentAnimator::isAnimating (Component* component) const @@ -60777,7 +60772,7 @@ void ComponentBoundsConstrainer::setBoundsForComponent (Component* const compone { jassert (component != 0); - Rectangle limits; + Rectangle limits; Component* const p = component->getParentComponent(); if (p == 0) @@ -60839,8 +60834,8 @@ void ComponentBoundsConstrainer::resizeEnd() } void ComponentBoundsConstrainer::checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& old, - const Rectangle& limits, + const Rectangle& old, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, @@ -63649,7 +63644,7 @@ void TabbedComponent::resized() indents.setRight (tabDepth + edgeIndent); } - const Rectangle bounds (indents.subtractedFrom (Rectangle (0, 0, getWidth(), getHeight()))); + const Rectangle bounds (indents.subtractedFrom (Rectangle (0, 0, getWidth(), getHeight()))); for (int i = contentComponents.size(); --i >= 0;) if (contentComponents.getUnchecked (i) != 0) @@ -64483,7 +64478,7 @@ AlertWindow* LookAndFeel::createAlertWindow (const String& title, void LookAndFeel::drawAlertBox (Graphics& g, AlertWindow& alert, - const Rectangle& textArea, + const Rectangle& textArea, TextLayout& textLayout) { g.fillAll (alert.findColour (AlertWindow::backgroundColourId)); @@ -64497,8 +64492,8 @@ void LookAndFeel::drawAlertBox (Graphics& g, if (alert.containsAnyExtraComponents() || alert.getNumButtons() > 2) iconSize = jmin (iconSize, textArea.getHeight() + 50); - const Rectangle iconRect (iconSize / -10, iconSize / -10, - iconSize, iconSize); + const Rectangle iconRect (iconSize / -10, iconSize / -10, + iconSize, iconSize); if (alert.getAlertType() != AlertWindow::NoIcon) { @@ -66223,7 +66218,7 @@ void LookAndFeel::drawTabAreaBehindFrontButton (Graphics& g, const float shadowSize = 0.2f; float x1 = 0.0f, y1 = 0.0f, x2 = 0.0f, y2 = 0.0f; - Rectangle shadowRect; + Rectangle shadowRect; if (orientation == TabbedButtonBar::TabsAtLeft) { @@ -66439,17 +66434,17 @@ void LookAndFeel::drawPropertyComponentLabel (Graphics& g, int, int height, g.setFont (jmin (height, 24) * 0.65f); - const Rectangle r (getPropertyComponentContentPosition (component)); + const Rectangle r (getPropertyComponentContentPosition (component)); g.drawFittedText (component.getName(), 3, r.getY(), r.getX() - 5, r.getHeight(), Justification::centredLeft, 2); } -const Rectangle LookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component) +const Rectangle LookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component) { - return Rectangle (component.getWidth() / 3, 1, - component.getWidth() - component.getWidth() / 3 - 1, component.getHeight() - 3); + return Rectangle (component.getWidth() / 3, 1, + component.getWidth() - component.getWidth() / 3 - 1, component.getHeight() - 3); } void LookAndFeel::createFileChooserHeaderText (const String& title, @@ -67230,7 +67225,7 @@ void OldSchoolLookAndFeel::drawScrollbar (Graphics& g, if (thumbSize > 0.0f) { - Rectangle thumb; + Rectangle thumb; if (isScrollbarVertical) { @@ -68776,7 +68771,7 @@ private: ApplicationCommandManager** managerOfChosenCommand; Component* componentAttachedTo; ScopedPointer attachedCompWatcher; - Rectangle windowPos; + Rectangle windowPos; int lastMouseX, lastMouseY; int minimumWidth, maximumNumColumns, standardItemHeight; bool isOver, hasBeenOver, isDown, needsToScroll; @@ -68786,7 +68781,7 @@ private: uint32 menuCreationTime, lastFocused, lastScroll, lastMouseMoveTime, timeEnteredCurrentChildComp; double scrollAcceleration; - bool overlaps (const Rectangle& r) const + bool overlaps (const Rectangle& r) const { return r.intersects (getBounds()) || (owner != 0 && owner->overlaps (r)); @@ -68838,13 +68833,13 @@ private: const int minY, const int maxY, const bool alignToRectangle) { - const Rectangle mon (Desktop::getInstance() - .getMonitorAreaContaining ((minX + maxX) / 2, - (minY + maxY) / 2, + const Rectangle mon (Desktop::getInstance() + .getMonitorAreaContaining ((minX + maxX) / 2, + (minY + maxY) / 2, #if JUCE_MAC - true)); + true)); #else - false)); // on windows, don't stop the menu overlapping the taskbar + false)); // on windows, don't stop the menu overlapping the taskbar #endif int x, y, widthToUse, heightToUse; @@ -69011,10 +69006,10 @@ private: windowPos.getHeight() - (PopupMenuSettings::scrollZone + m->getHeight())), currentY); - const Rectangle mon (Desktop::getInstance() - .getMonitorAreaContaining (windowPos.getX(), - windowPos.getY(), - true)); + const Rectangle mon (Desktop::getInstance() + .getMonitorAreaContaining (windowPos.getX(), + windowPos.getY(), + true)); int deltaY = wantedY - currentY; @@ -69037,7 +69032,7 @@ private: void resizeToBestWindowPos() { - Rectangle r (windowPos); + Rectangle r (windowPos); if (childYOffset < 0) { @@ -70190,7 +70185,7 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, Component* sourceComponent, Image* dragImage_, const bool allowDraggingToExternalWindows, - const Point* imageOffsetFromMouse) + const Point* imageOffsetFromMouse) { ScopedPointer dragImage (dragImage_); @@ -70206,7 +70201,7 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, if (dragImage == 0) { - dragImage = sourceComponent->createComponentSnapshot (Rectangle (0, 0, sourceComponent->getWidth(), sourceComponent->getHeight())); + dragImage = sourceComponent->createComponentSnapshot (Rectangle (0, 0, sourceComponent->getWidth(), sourceComponent->getHeight())); if (dragImage->getFormat() != Image::ARGB) { @@ -70259,8 +70254,8 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, } else { - imageX = (int) imageOffsetFromMouse->getX(); - imageY = (int) imageOffsetFromMouse->getY(); + imageX = imageOffsetFromMouse->getX(); + imageY = imageOffsetFromMouse->getY(); } } @@ -70826,7 +70821,7 @@ void BooleanPropertyComponent::paint (Graphics& g) { PropertyComponent::paint (g); - const Rectangle r (button->getBounds()); + const Rectangle r (button->getBounds()); g.setColour (Colours::white); g.fillRect (r); @@ -72779,18 +72774,18 @@ void BubbleComponent::setPosition (Component* componentToPointTo) else componentToPointTo->relativePositionToGlobal (tx, ty); - setPosition (Rectangle (tx, ty, componentToPointTo->getWidth(), componentToPointTo->getHeight())); + setPosition (Rectangle (tx, ty, componentToPointTo->getWidth(), componentToPointTo->getHeight())); } void BubbleComponent::setPosition (const int arrowTipX_, const int arrowTipY_) { - setPosition (Rectangle (arrowTipX_, arrowTipY_, 1, 1)); + setPosition (Rectangle (arrowTipX_, arrowTipY_, 1, 1)); } -void BubbleComponent::setPosition (const Rectangle& rectangleToPointTo) +void BubbleComponent::setPosition (const Rectangle& rectangleToPointTo) { - Rectangle availableSpace; + Rectangle availableSpace; if (getParentComponent() != 0) { @@ -73209,7 +73204,7 @@ public: { const float yScale = 1.0f / (getHeight() - edge * 2); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); for (int y = jmin (clip.getBottom(), getHeight() - edge); --y >= jmax (edge, clip.getY());) { @@ -74129,7 +74124,7 @@ void MagnifierComponent::paint (Graphics& g) if (w == 0 || h == 0) return; - const Rectangle r (g.getClipBounds()); + const Rectangle r (g.getClipBounds()); const int srcX = (int) (r.getX() / scaleFactor); const int srcY = (int) (r.getY() / scaleFactor); @@ -76702,12 +76697,12 @@ void ComponentPeer::handleScreenSizeChange() handleMovedOrResized(); } -void ComponentPeer::setNonFullScreenBounds (const Rectangle& newBounds) throw() +void ComponentPeer::setNonFullScreenBounds (const Rectangle& newBounds) throw() { lastNonFullscreenBounds = newBounds; } -const Rectangle& ComponentPeer::getNonFullScreenBounds() const throw() +const Rectangle& ComponentPeer::getNonFullScreenBounds() const throw() { return lastNonFullscreenBounds; } @@ -76994,7 +76989,7 @@ DocumentWindow::~DocumentWindow() void DocumentWindow::repaintTitleBar() { - const Rectangle titleBarArea (getTitleBarArea()); + const Rectangle titleBarArea (getTitleBarArea()); repaint (titleBarArea.getX(), titleBarArea.getY(), titleBarArea.getWidth(), titleBarArea.getHeight()); } @@ -77102,7 +77097,7 @@ void DocumentWindow::paint (Graphics& g) g.fillRect (0, getHeight() - border.getBottom(), getWidth(), border.getBottom()); } - const Rectangle titleBarArea (getTitleBarArea()); + const Rectangle titleBarArea (getTitleBarArea()); g.setOrigin (titleBarArea.getX(), titleBarArea.getY()); g.reduceClipRegion (0, 0, titleBarArea.getWidth(), titleBarArea.getHeight()); @@ -77136,7 +77131,7 @@ void DocumentWindow::resized() if (titleBarButtons[1] != 0) titleBarButtons[1]->setToggleState (isFullScreen(), false); - const Rectangle titleBarArea (getTitleBarArea()); + const Rectangle titleBarArea (getTitleBarArea()); getLookAndFeel() .positionDocumentWindowButtons (*this, @@ -77174,13 +77169,13 @@ int DocumentWindow::getTitleBarHeight() const return isUsingNativeTitleBar() ? 0 : jmin (titleBarHeight, getHeight() - 4); } -const Rectangle DocumentWindow::getTitleBarArea() +const Rectangle DocumentWindow::getTitleBarArea() { const BorderSize border (getBorderThickness()); - return Rectangle (border.getLeft(), border.getTop(), - getWidth() - border.getLeftAndRight(), - getTitleBarHeight()); + return Rectangle (border.getLeft(), border.getTop(), + getWidth() - border.getLeftAndRight(), + getTitleBarHeight()); } Button* DocumentWindow::getCloseButton() const throw() @@ -77640,7 +77635,7 @@ void ResizableWindow::setFullScreen (const bool shouldBeFullScreen) if (peer != 0) { // keep a copy of this intact in case the real one gets messed-up while we're un-maximising - const Rectangle lastPos (lastNonFullScreenPos); + const Rectangle lastPos (lastNonFullScreenPos); peer->setFullScreen (shouldBeFullScreen); @@ -77735,15 +77730,15 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s) if (tokens.size() != 4 + n) return false; - Rectangle r (tokens[n].getIntValue(), - tokens[n + 1].getIntValue(), - tokens[n + 2].getIntValue(), - tokens[n + 3].getIntValue()); + Rectangle r (tokens[n].getIntValue(), + tokens[n + 1].getIntValue(), + tokens[n + 2].getIntValue(), + tokens[n + 3].getIntValue()); if (r.isEmpty()) return false; - const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (r.getX(), r.getY())); + const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (r.getX(), r.getY())); if (! screen.contains (r)) { @@ -78406,7 +78401,7 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const int y = (c->getHeight() - height) / 2; c->relativePositionToGlobal (x, y); - Rectangle parentArea (c->getParentMonitorArea()); + Rectangle parentArea (c->getParentMonitorArea()); if (getParentComponent() != 0) { @@ -79468,7 +79463,7 @@ static void copyEdgeTableData (int* dest, const int destLineStride, const int* s } } -EdgeTable::EdgeTable (const Rectangle& bounds_, +EdgeTable::EdgeTable (const Rectangle& bounds_, const Path& path, const AffineTransform& transform) throw() : bounds (bounds_), maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine), @@ -79543,7 +79538,7 @@ EdgeTable::EdgeTable (const Rectangle& bounds_, sanitiseLevels (path.isUsingNonZeroWinding()); } -EdgeTable::EdgeTable (const Rectangle& rectangleToAdd) throw() +EdgeTable::EdgeTable (const Rectangle& rectangleToAdd) throw() : bounds (rectangleToAdd), maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine), lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1), @@ -79584,7 +79579,7 @@ EdgeTable::EdgeTable (const RectangleList& rectanglesToAdd) throw() for (RectangleList::Iterator iter (rectanglesToAdd); iter.next();) { - const Rectangle* const r = iter.getRectangle(); + const Rectangle* const r = iter.getRectangle(); const int x1 = r->getX() << 8; const int x2 = r->getRight() << 8; @@ -79602,7 +79597,7 @@ EdgeTable::EdgeTable (const RectangleList& rectanglesToAdd) throw() } EdgeTable::EdgeTable (const float x, const float y, const float w, const float h) throw() - : bounds (Rectangle ((int) floorf (x), roundToInt (y * 256.0f) >> 8, 2 + (int) w, 2 + (int) h)), + : bounds (Rectangle ((int) floorf (x), roundToInt (y * 256.0f) >> 8, 2 + (int) w, 2 + (int) h)), maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine), lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1), needToCheckEmptinesss (true) @@ -80006,9 +80001,9 @@ void EdgeTable::clipEdgeTableLineToRange (int* dest, const int x1, const int x2) } } -void EdgeTable::clipToRectangle (const Rectangle& r) throw() +void EdgeTable::clipToRectangle (const Rectangle& r) throw() { - const Rectangle clipped (r.getIntersection (bounds)); + const Rectangle clipped (r.getIntersection (bounds)); if (clipped.isEmpty()) { @@ -80048,9 +80043,9 @@ void EdgeTable::clipToRectangle (const Rectangle& r) throw() } } -void EdgeTable::excludeRectangle (const Rectangle& r) throw() +void EdgeTable::excludeRectangle (const Rectangle& r) throw() { - const Rectangle clipped (r.getIntersection (bounds)); + const Rectangle clipped (r.getIntersection (bounds)); if (! clipped.isEmpty()) { @@ -80073,7 +80068,7 @@ void EdgeTable::excludeRectangle (const Rectangle& r) throw() void EdgeTable::clipToEdgeTable (const EdgeTable& other) { - const Rectangle clipped (other.bounds.getIntersection (bounds)); + const Rectangle clipped (other.bounds.getIntersection (bounds)); if (clipped.isEmpty()) { @@ -80321,7 +80316,7 @@ bool Graphics::reduceClipRegion (const int x, const int y, const int w, const int h) throw() { saveStateIfPending(); - return context->clipToRectangle (Rectangle (x, y, w, h)); + return context->clipToRectangle (Rectangle (x, y, w, h)); } bool Graphics::reduceClipRegion (const RectangleList& clipRegion) throw() @@ -80337,7 +80332,7 @@ bool Graphics::reduceClipRegion (const Path& path, const AffineTransform& transf return ! context->isClipEmpty(); } -bool Graphics::reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, const AffineTransform& transform) throw() +bool Graphics::reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, const AffineTransform& transform) throw() { saveStateIfPending(); context->clipToImageAlpha (image, sourceClipRegion, transform); @@ -80348,7 +80343,7 @@ void Graphics::excludeClipRegion (const int x, const int y, const int w, const int h) throw() { saveStateIfPending(); - context->excludeClipRectangle (Rectangle (x, y, w, h)); + context->excludeClipRectangle (Rectangle (x, y, w, h)); } bool Graphics::isClipEmpty() const throw() @@ -80356,7 +80351,7 @@ bool Graphics::isClipEmpty() const throw() return context->isClipEmpty(); } -const Rectangle Graphics::getClipBounds() const throw() +const Rectangle Graphics::getClipBounds() const throw() { return context->getClipBounds(); } @@ -80394,7 +80389,7 @@ void Graphics::setOrigin (const int newOriginX, bool Graphics::clipRegionIntersects (const int x, const int y, const int w, const int h) const throw() { - return context->clipRegionIntersects (Rectangle (x, y, w, h)); + return context->clipRegionIntersects (Rectangle (x, y, w, h)); } void Graphics::setColour (const Colour& newColour) throw() @@ -80494,7 +80489,7 @@ void Graphics::drawText (const String& text, const Justification& justificationType, const bool useEllipsesIfTooBig) const throw() { - if (text.isNotEmpty() && context->clipRegionIntersects (Rectangle (x, y, width, height))) + if (text.isNotEmpty() && context->clipRegionIntersects (Rectangle (x, y, width, height))) { GlyphArrangement arr; @@ -80521,7 +80516,7 @@ void Graphics::drawFittedText (const String& text, { if (text.isNotEmpty() && width > 0 && height > 0 - && context->clipRegionIntersects (Rectangle (x, y, width, height))) + && context->clipRegionIntersects (Rectangle (x, y, width, height))) { GlyphArrangement arr; @@ -80544,10 +80539,10 @@ void Graphics::fillRect (int x, // passing in a silly number can cause maths problems in rendering! jassert (areCoordsSensibleNumbers (x, y, width, height)); - context->fillRect (Rectangle (x, y, width, height), false); + context->fillRect (Rectangle (x, y, width, height), false); } -void Graphics::fillRect (const Rectangle& r) const throw() +void Graphics::fillRect (const Rectangle& r) const throw() { context->fillRect (r, false); } @@ -80567,7 +80562,7 @@ void Graphics::fillRect (const float x, void Graphics::setPixel (int x, int y) const throw() { - context->fillRect (Rectangle (x, y, 1, 1), false); + context->fillRect (Rectangle (x, y, 1, 1), false); } void Graphics::fillAll() const throw() @@ -80579,7 +80574,7 @@ void Graphics::fillAll (const Colour& colourToUse) const throw() { if (! colourToUse.isTransparent()) { - const Rectangle clip (context->getClipBounds()); + const Rectangle clip (context->getClipBounds()); context->saveState(); context->setFill (FillType (colourToUse)); @@ -80613,10 +80608,10 @@ void Graphics::drawRect (const int x, // passing in a silly number can cause maths problems in rendering! jassert (areCoordsSensibleNumbers (x, y, width, height)); - context->fillRect (Rectangle (x, y, width, lineThickness), false); - context->fillRect (Rectangle (x, y + lineThickness, lineThickness, height - lineThickness * 2), false); - context->fillRect (Rectangle (x + width - lineThickness, y + lineThickness, lineThickness, height - lineThickness * 2), false); - context->fillRect (Rectangle (x, y + height - lineThickness, width, lineThickness), false); + context->fillRect (Rectangle (x, y, width, lineThickness), false); + context->fillRect (Rectangle (x, y + lineThickness, lineThickness, height - lineThickness * 2), false); + context->fillRect (Rectangle (x + width - lineThickness, y + lineThickness, lineThickness, height - lineThickness * 2), false); + context->fillRect (Rectangle (x, y + height - lineThickness, width, lineThickness), false); } void Graphics::drawRect (const float x, @@ -80636,7 +80631,7 @@ void Graphics::drawRect (const float x, fillPath (p); } -void Graphics::drawRect (const Rectangle& r, +void Graphics::drawRect (const Rectangle& r, const int lineThickness) const throw() { drawRect (r.getX(), r.getY(), @@ -80670,13 +80665,13 @@ void Graphics::drawBevel (const int x, : oldOpacity; context->setFill (FillType (topLeftColour.withMultipliedAlpha (op))); - context->fillRect (Rectangle (x + i, y + i, width - i * 2, 1), false); + context->fillRect (Rectangle (x + i, y + i, width - i * 2, 1), false); context->setFill (FillType (topLeftColour.withMultipliedAlpha (op * 0.75f))); - context->fillRect (Rectangle (x + i, y + i + 1, 1, height - i * 2 - 2), false); + context->fillRect (Rectangle (x + i, y + i + 1, 1, height - i * 2 - 2), false); context->setFill (FillType (bottomRightColour.withMultipliedAlpha (op))); - context->fillRect (Rectangle (x + i, y + height - i - 1, width - i * 2, 1), false); + context->fillRect (Rectangle (x + i, y + height - i - 1, width - i * 2, 1), false); context->setFill (FillType (bottomRightColour.withMultipliedAlpha (op * 0.75f))); - context->fillRect (Rectangle (x + width - i - 1, y + i + 1, 1, height - i * 2 - 2), false); + context->fillRect (Rectangle (x + width - i - 1, y + i + 1, 1, height - i * 2 - 2), false); } context->restoreState(); @@ -80724,7 +80719,7 @@ void Graphics::fillRoundedRectangle (const float x, fillPath (p); } -void Graphics::fillRoundedRectangle (const Rectangle& r, +void Graphics::fillRoundedRectangle (const Rectangle& r, const float cornerSize) const throw() { fillRoundedRectangle ((float) r.getX(), @@ -80749,7 +80744,7 @@ void Graphics::drawRoundedRectangle (const float x, strokePath (p, PathStrokeType (lineThickness)); } -void Graphics::drawRoundedRectangle (const Rectangle& r, +void Graphics::drawRoundedRectangle (const Rectangle& r, const float cornerSize, const float lineThickness) const throw() { @@ -80790,11 +80785,11 @@ void Graphics::fillCheckerBoard (int x, int y, if (colour1 == colour2) { context->setFill (FillType (colour1)); - context->fillRect (Rectangle (x, y, width, height), false); + context->fillRect (Rectangle (x, y, width, height), false); } else { - const Rectangle clip (context->getClipBounds()); + const Rectangle clip (context->getClipBounds()); const int right = jmin (x + width, clip.getRight()); const int bottom = jmin (y + height, clip.getBottom()); @@ -80807,7 +80802,7 @@ void Graphics::fillCheckerBoard (int x, int y, for (int xx = x; xx < right; xx += checkWidth) { context->setFill (FillType (((cx++ & 1) == 0) ? colour1 : colour2)); - context->fillRect (Rectangle (xx, y, jmin (checkWidth, right - xx), jmin (checkHeight, bottom - y)), + context->fillRect (Rectangle (xx, y, jmin (checkWidth, right - xx), jmin (checkHeight, bottom - y)), false); } @@ -80969,9 +80964,9 @@ void Graphics::drawImage (const Image* const imageToDraw, jassert (areCoordsSensibleNumbers (dx, dy, dw, dh)); jassert (areCoordsSensibleNumbers (sx, sy, sw, sh)); - if (context->clipRegionIntersects (Rectangle (dx, dy, dw, dh))) + if (context->clipRegionIntersects (Rectangle (dx, dy, dw, dh))) { - drawImageTransformed (imageToDraw, Rectangle (sx, sy, sw, sh), + drawImageTransformed (imageToDraw, Rectangle (sx, sy, sw, sh), AffineTransform::scale (dw / (float) sw, dh / (float) sh) .translated ((float) dx, (float) dy), fillAlphaChannelWithCurrentBrush); @@ -80979,13 +80974,13 @@ void Graphics::drawImage (const Image* const imageToDraw, } void Graphics::drawImageTransformed (const Image* const imageToDraw, - const Rectangle& imageSubRegion, + const Rectangle& imageSubRegion, const AffineTransform& transform, const bool fillAlphaChannelWithCurrentBrush) const throw() { if (imageToDraw != 0 && ! context->isClipEmpty()) { - const Rectangle srcClip (imageSubRegion.getIntersection (imageToDraw->getBounds())); + const Rectangle srcClip (imageSubRegion.getIntersection (imageToDraw->getBounds())); if (fillAlphaChannelWithCurrentBrush) { @@ -81088,7 +81083,7 @@ LowLevelGraphicsPostScriptRenderer::LowLevelGraphicsPostScriptRenderer (OutputSt needToClip (true) { stateStack.add (new SavedState()); - stateStack.getLast()->clip = Rectangle (0, 0, totalWidth_, totalHeight_); + stateStack.getLast()->clip = Rectangle (0, 0, totalWidth_, totalHeight_); const float scale = jmin ((520.0f / totalWidth_), (750.0f / totalHeight)); @@ -81142,7 +81137,7 @@ void LowLevelGraphicsPostScriptRenderer::setOrigin (int x, int y) } } -bool LowLevelGraphicsPostScriptRenderer::clipToRectangle (const Rectangle& r) +bool LowLevelGraphicsPostScriptRenderer::clipToRectangle (const Rectangle& r) { needToClip = true; return stateStack.getLast()->clip.clipTo (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); @@ -81154,7 +81149,7 @@ bool LowLevelGraphicsPostScriptRenderer::clipToRectangleList (const RectangleLis return stateStack.getLast()->clip.clipTo (clipRegion); } -void LowLevelGraphicsPostScriptRenderer::excludeClipRectangle (const Rectangle& r) +void LowLevelGraphicsPostScriptRenderer::excludeClipRectangle (const Rectangle& r) { needToClip = true; stateStack.getLast()->clip.subtract (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); @@ -81170,18 +81165,18 @@ void LowLevelGraphicsPostScriptRenderer::clipToPath (const Path& path, const Aff out << "clip\n"; } -void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& /*sourceImage*/, const Rectangle& /*srcClip*/, const AffineTransform& /*transform*/) +void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& /*sourceImage*/, const Rectangle& /*srcClip*/, const AffineTransform& /*transform*/) { needToClip = true; jassertfalse // xxx } -bool LowLevelGraphicsPostScriptRenderer::clipRegionIntersects (const Rectangle& r) +bool LowLevelGraphicsPostScriptRenderer::clipRegionIntersects (const Rectangle& r) { return stateStack.getLast()->clip.intersectsRectangle (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); } -const Rectangle LowLevelGraphicsPostScriptRenderer::getClipBounds() const +const Rectangle LowLevelGraphicsPostScriptRenderer::getClipBounds() const { return stateStack.getLast()->clip.getBounds().translated (-stateStack.getLast()->xOffset, -stateStack.getLast()->yOffset); @@ -81233,7 +81228,7 @@ void LowLevelGraphicsPostScriptRenderer::writeClip() out << '\n'; } - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); out << r.getX() << ' ' << -r.getY() << ' ' << r.getWidth() << ' ' << -r.getHeight() << " pr "; @@ -81359,14 +81354,14 @@ void LowLevelGraphicsPostScriptRenderer::setInterpolationQuality (Graphics::Resa { } -void LowLevelGraphicsPostScriptRenderer::fillRect (const Rectangle& r, const bool /*replaceExistingContents*/) +void LowLevelGraphicsPostScriptRenderer::fillRect (const Rectangle& r, const bool /*replaceExistingContents*/) { if (stateStack.getLast()->fillType.isColour()) { writeClip(); writeColour (stateStack.getLast()->fillType.colour); - Rectangle r2 (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); + Rectangle r2 (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); out << r2.getX() << ' ' << -r2.getBottom() << ' ' << r2.getWidth() << ' ' << r2.getHeight() << " rectfill\n"; } @@ -81410,7 +81405,7 @@ void LowLevelGraphicsPostScriptRenderer::fillPath (const Path& path, const Affin out << "clip\n"; } - const Rectangle bounds (stateStack.getLast()->clip.getBounds()); + const Rectangle bounds (stateStack.getLast()->clip.getBounds()); // ideally this would draw lots of lines or ellipses to approximate the gradient, but for the // time-being, this just fills it with the average colour.. @@ -81478,7 +81473,7 @@ void LowLevelGraphicsPostScriptRenderer::writeImage (const Image& im, out << "\n>}\n"; } -void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, +void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool /*fillEntireClipAsTiles*/) { const int w = jmin (sourceImage.getWidth(), srcClip.getRight()); @@ -81505,7 +81500,7 @@ void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, co itemsOnLine = 0; } - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); out << r.getX() << ' ' << r.getY() << ' ' << r.getWidth() << ' ' << r.getHeight() << " pr "; } @@ -81708,7 +81703,7 @@ public: if (! transform.isIdentity()) { const Line l (x2, y2, x1, y1); - const Point p3 = l.getPointAlongLine (0.0f, 100.0f); + const Point p3 = l.getPointAlongLine (0.0f, 100.0f); float x3 = p3.getX(); float y3 = p3.getY(); @@ -81718,7 +81713,7 @@ public: const Line l2 (x2, y2, x3, y3); const float prop = l2.findNearestPointTo (x1, y1); - const Point newP2 (l2.getPointAlongLineProportionally (prop)); + const Point newP2 (l2.getPointAlongLineProportionally (prop)); x2 = newP2.getX(); y2 = newP2.getY(); @@ -82416,7 +82411,7 @@ private: class LLGCSavedState { public: - LLGCSavedState (const Rectangle& clip_, const int xOffset_, const int yOffset_, + LLGCSavedState (const Rectangle& clip_, const int xOffset_, const int yOffset_, const Font& font_, const FillType& fillType_, const Graphics::ResamplingQuality interpolationQuality_) throw() : edgeTable (new EdgeTableHolder (EdgeTable (clip_))), @@ -82437,7 +82432,7 @@ public: { } - bool clipToRectangle (const Rectangle& r) throw() + bool clipToRectangle (const Rectangle& r) throw() { dupeEdgeTableIfMultiplyReferenced(); edgeTable->edgeTable.clipToRectangle (r.translated (xOffset, yOffset)); @@ -82455,7 +82450,7 @@ public: return ! edgeTable->edgeTable.isEmpty(); } - bool excludeClipRectangle (const Rectangle& r) throw() + bool excludeClipRectangle (const Rectangle& r) throw() { dupeEdgeTableIfMultiplyReferenced(); edgeTable->edgeTable.excludeRectangle (r.translated (xOffset, yOffset)); @@ -82522,7 +82517,7 @@ public: } } - void renderImage (Image& destImage, const Image& sourceImage, const Rectangle& srcClip, + void renderImage (Image& destImage, const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& t, const EdgeTable* const tiledFillClipRegion) throw() { const AffineTransform transform (t.translated ((float) xOffset, (float) yOffset)); @@ -82549,7 +82544,7 @@ public: } else { - EdgeTable et (Rectangle (tx, ty, srcClip.getWidth(), srcClip.getHeight()).getIntersection (destImage.getBounds())); + EdgeTable et (Rectangle (tx, ty, srcClip.getWidth(), srcClip.getHeight()).getIntersection (destImage.getBounds())); et.clipToEdgeTable (edgeTable->edgeTable); if (! et.isEmpty()) @@ -82580,7 +82575,7 @@ public: } } - void clipToImageAlpha (const Image& image, const Rectangle& srcClip, const AffineTransform& t) throw() + void clipToImageAlpha (const Image& image, const Rectangle& srcClip, const AffineTransform& t) throw() { if (! image.hasAlphaChannel()) { @@ -82619,7 +82614,7 @@ public: if (transform.isSingularity()) { - et.clipToRectangle (Rectangle()); + et.clipToRectangle (Rectangle()); return; } @@ -82652,7 +82647,7 @@ public: template void straightClipImage (EdgeTable& et, const Image::BitmapData& srcData, int imageX, int imageY, const SrcPixelType *) throw() { - Rectangle r (imageX, imageY, srcData.width, srcData.height); + Rectangle r (imageX, imageY, srcData.width, srcData.height); et.clipToRectangle (r); ImageFillEdgeTableRenderer renderer (srcData, srcData, 255, imageX, imageY); @@ -82867,7 +82862,7 @@ void LowLevelGraphicsSoftwareRenderer::setOrigin (int x, int y) currentState->yOffset += y; } -bool LowLevelGraphicsSoftwareRenderer::clipToRectangle (const Rectangle& r) +bool LowLevelGraphicsSoftwareRenderer::clipToRectangle (const Rectangle& r) { return currentState->clipToRectangle (r); } @@ -82877,7 +82872,7 @@ bool LowLevelGraphicsSoftwareRenderer::clipToRectangleList (const RectangleList& return currentState->clipToRectangleList (clipRegion); } -void LowLevelGraphicsSoftwareRenderer::excludeClipRectangle (const Rectangle& r) +void LowLevelGraphicsSoftwareRenderer::excludeClipRectangle (const Rectangle& r) { currentState->excludeClipRectangle (r); } @@ -82887,18 +82882,18 @@ void LowLevelGraphicsSoftwareRenderer::clipToPath (const Path& path, const Affin currentState->clipToPath (path, transform); } -void LowLevelGraphicsSoftwareRenderer::clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) +void LowLevelGraphicsSoftwareRenderer::clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) { currentState->clipToImageAlpha (sourceImage, srcClip, transform); } -bool LowLevelGraphicsSoftwareRenderer::clipRegionIntersects (const Rectangle& r) +bool LowLevelGraphicsSoftwareRenderer::clipRegionIntersects (const Rectangle& r) { return currentState->edgeTable->edgeTable.getMaximumBounds() .intersects (r.translated (currentState->xOffset, currentState->yOffset)); } -const Rectangle LowLevelGraphicsSoftwareRenderer::getClipBounds() const +const Rectangle LowLevelGraphicsSoftwareRenderer::getClipBounds() const { return currentState->edgeTable->edgeTable.getMaximumBounds().translated (-currentState->xOffset, -currentState->yOffset); } @@ -82943,10 +82938,10 @@ void LowLevelGraphicsSoftwareRenderer::setInterpolationQuality (Graphics::Resamp currentState->interpolationQuality = quality; } -void LowLevelGraphicsSoftwareRenderer::fillRect (const Rectangle& r, const bool replaceExistingContents) +void LowLevelGraphicsSoftwareRenderer::fillRect (const Rectangle& r, const bool replaceExistingContents) { - const Rectangle& totalClip = currentState->edgeTable->edgeTable.getMaximumBounds(); - const Rectangle clipped (totalClip.getIntersection (r.translated (currentState->xOffset, currentState->yOffset))); + const Rectangle& totalClip = currentState->edgeTable->edgeTable.getMaximumBounds(); + const Rectangle clipped (totalClip.getIntersection (r.translated (currentState->xOffset, currentState->yOffset))); if (! clipped.isEmpty()) { @@ -82964,7 +82959,7 @@ void LowLevelGraphicsSoftwareRenderer::fillPath (const Path& path, const AffineT currentState->fillEdgeTable (image, et); } -void LowLevelGraphicsSoftwareRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, +void LowLevelGraphicsSoftwareRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles) { jassert (sourceImage.getBounds().contains (srcClip)); @@ -83087,15 +83082,11 @@ public: if (! glyphPath.isEmpty()) { const float fontHeight = font.getHeight(); - const AffineTransform transform (AffineTransform::scale (fontHeight * font.getHorizontalScale(), fontHeight)); + const AffineTransform transform (AffineTransform::scale (fontHeight * font.getHorizontalScale(), fontHeight) + .translated (0.0f, -0.5f)); - float px, py, pw, ph; - glyphPath.getBoundsTransformed (transform.translated (0.0f, -0.5f), px, py, pw, ph); - - Rectangle clip ((int) floorf (px), (int) floorf (py), - roundToInt (pw) + 2, roundToInt (ph) + 2); - - edgeTable = new EdgeTable (clip, glyphPath, transform); + edgeTable = new EdgeTable (glyphPath.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0), + glyphPath, transform); } } @@ -83310,11 +83301,10 @@ void Drawable::drawWithin (Graphics& g, { if (destW > 0 && destH > 0) { - float x, y, w, h; - getBounds (x, y, w, h); + Rectangle bounds (getBounds()); draw (g, opacity, - placement.getTransformToFit (x, y, w, h, + placement.getTransformToFit (bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight(), (float) destX, (float) destY, (float) destW, (float) destH)); } @@ -83467,7 +83457,7 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const // To correctly render a whole composite layer with an overall transparency, // we need to render everything opaquely into a temp buffer, then blend that // with the target opacity... - const Rectangle clipBounds (context.g.getClipBounds()); + const Rectangle clipBounds (context.g.getClipBounds()); Image tempImage (Image::ARGB, clipBounds.getWidth(), clipBounds.getHeight(), true); { @@ -83483,29 +83473,20 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const } } -void DrawableComposite::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawableComposite::getBounds() const { - Path totalPath; + Rectangle bounds; for (int i = 0; i < drawables.size(); ++i) { - drawables.getUnchecked(i)->getBounds (x, y, width, height); + const Drawable* const d = drawables.getUnchecked(i); + const AffineTransform* const t = transforms.getUnchecked(i); - if (width > 0.0f && height > 0.0f) - { - Path outline; - outline.addRectangle (x, y, width, height); - - const AffineTransform* const t = transforms.getUnchecked(i); - - if (t == 0) - totalPath.addPath (outline); - else - totalPath.addPath (outline, *t); - } + bounds = bounds.getUnion (t == 0 ? d->getBounds() + : d->getBounds().transformed (*t)); } - totalPath.getBounds (x, y, width, height); + return bounds; } bool DrawableComposite::hitTest (float x, float y) const @@ -83686,18 +83667,12 @@ void DrawableImage::render (const Drawable::RenderingContext& context) const } } -void DrawableImage::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawableImage::getBounds() const { - x = 0.0f; - y = 0.0f; - width = 0.0f; - height = 0.0f; + if (image == 0) + return Rectangle(); - if (image != 0) - { - width = (float) image->getWidth(); - height = (float) image->getHeight(); - } + return Rectangle (0, 0, (float) image->getWidth(), (float) image->getHeight()); } bool DrawableImage::hitTest (float x, float y) const @@ -83863,12 +83838,12 @@ void DrawablePath::updateOutline() strokeType.createStrokedPath (stroke, path, AffineTransform::identity, 4.0f); } -void DrawablePath::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawablePath::getBounds() const { if (strokeType.getStrokeThickness() > 0.0f) - stroke.getBounds (x, y, width, height); + return stroke.getBounds(); else - path.getBounds (x, y, width, height); + return path.getBounds(); } bool DrawablePath::hitTest (float x, float y) const @@ -84043,11 +84018,13 @@ void DrawableText::render (const Drawable::RenderingContext& context) const text.draw (context.g, context.transform); } -void DrawableText::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawableText::getBounds() const { - text.getBoundingBox (0, -1, x, y, width, height, false); // (really returns top, left, bottom, right) - width -= x; - height -= y; + float x, y, w, h; + text.getBoundingBox (0, -1, x, y, w, h, false); // (really returns top, left, bottom, right) + w -= x; + h -= y; + return Rectangle (x, y, w, h); } bool DrawableText::hitTest (float x, float y) const @@ -84796,7 +84773,13 @@ private: const bool userSpace = fillXml->getStringAttribute (T("gradientUnits")).equalsIgnoreCase (T("userSpaceOnUse")); if (! userSpace) - path.getBounds (dx, dy, width, height); + { + const Rectangle bounds (path.getBounds()); + dx = bounds.getX(); + dy = bounds.getY(); + width = bounds.getWidth(); + height = bounds.getHeight(); + } if (gradient.isRadial) { @@ -87662,15 +87645,15 @@ void BorderSize::setRight (const int newRightGap) throw() right = newRightGap; } -const Rectangle BorderSize::subtractedFrom (const Rectangle& r) const throw() +const Rectangle BorderSize::subtractedFrom (const Rectangle& r) const throw() { - return Rectangle (r.getX() + left, - r.getY() + top, - r.getWidth() - (left + right), - r.getHeight() - (top + bottom)); + return Rectangle (r.getX() + left, + r.getY() + top, + r.getWidth() - (left + right), + r.getHeight() - (top + bottom)); } -void BorderSize::subtractFrom (Rectangle& r) const throw() +void BorderSize::subtractFrom (Rectangle& r) const throw() { r.setBounds (r.getX() + left, r.getY() + top, @@ -87678,15 +87661,15 @@ void BorderSize::subtractFrom (Rectangle& r) const throw() r.getHeight() - (top + bottom)); } -const Rectangle BorderSize::addedTo (const Rectangle& r) const throw() +const Rectangle BorderSize::addedTo (const Rectangle& r) const throw() { - return Rectangle (r.getX() - left, - r.getY() - top, - r.getWidth() + (left + right), - r.getHeight() + (top + bottom)); + return Rectangle (r.getX() - left, + r.getY() - top, + r.getWidth() + (left + right), + r.getHeight() + (top + bottom)); } -void BorderSize::addTo (Rectangle& r) const throw() +void BorderSize::addTo (Rectangle& r) const throw() { r.setBounds (r.getX() - left, r.getY() - top, @@ -87816,8 +87799,8 @@ Line::Line (const float startX_, const float startY_, { } -Line::Line (const Point& start, - const Point& end) throw() +Line::Line (const Point& start, + const Point& end) throw() : startX (start.getX()), startY (start.getY()), endX (end.getX()), @@ -87839,14 +87822,14 @@ Line::~Line() throw() { } -const Point Line::getStart() const throw() +const Point Line::getStart() const throw() { - return Point (startX, startY); + return Point (startX, startY); } -const Point Line::getEnd() const throw() +const Point Line::getEnd() const throw() { - return Point (endX, endY); + return Point (endX, endY); } void Line::setStart (const float newStartX, @@ -87856,7 +87839,7 @@ void Line::setStart (const float newStartX, startY = newStartY; } -void Line::setStart (const Point& newStart) throw() +void Line::setStart (const Point& newStart) throw() { startX = newStart.getX(); startY = newStart.getY(); @@ -87869,7 +87852,7 @@ void Line::setEnd (const float newEndX, endY = newEndY; } -void Line::setEnd (const Point& newEnd) throw() +void Line::setEnd (const Point& newEnd) throw() { endX = newEnd.getX(); endY = newEnd.getY(); @@ -87909,32 +87892,32 @@ float Line::getAngle() const throw() endY - startY); } -const Point Line::getPointAlongLine (const float distanceFromStart) const throw() +const Point Line::getPointAlongLine (const float distanceFromStart) const throw() { const float alpha = distanceFromStart / getLength(); - return Point (startX + (endX - startX) * alpha, - startY + (endY - startY) * alpha); + return Point (startX + (endX - startX) * alpha, + startY + (endY - startY) * alpha); } -const Point Line::getPointAlongLine (const float offsetX, - const float offsetY) const throw() +const Point Line::getPointAlongLine (const float offsetX, + const float offsetY) const throw() { const float dx = endX - startX; const float dy = endY - startY; const double length = juce_hypot (dx, dy); if (length == 0) - return Point (startX, startY); + return Point (startX, startY); else - return Point (startX + (float) (((dx * offsetX) - (dy * offsetY)) / length), - startY + (float) (((dy * offsetX) + (dx * offsetY)) / length)); + return Point (startX + (float) (((dx * offsetX) - (dy * offsetY)) / length), + startY + (float) (((dy * offsetX) + (dx * offsetY)) / length)); } -const Point Line::getPointAlongLineProportionally (const float alpha) const throw() +const Point Line::getPointAlongLineProportionally (const float alpha) const throw() { - return Point (startX + (endX - startX) * alpha, - startY + (endY - startY) * alpha); + return Point (startX + (endX - startX) * alpha, + startY + (endY - startY) * alpha); } float Line::getDistanceFromLine (const float x, @@ -88194,39 +88177,16 @@ bool Path::isEmpty() const throw() return true; } -void Path::getBounds (float& x, float& y, - float& w, float& h) const throw() +const Rectangle Path::getBounds () const throw() { - x = pathXMin; - y = pathYMin; - w = pathXMax - pathXMin; - h = pathYMax - pathYMin; + return Rectangle (pathXMin, pathYMin, + pathXMax - pathXMin, + pathYMax - pathYMin); } -void Path::getBoundsTransformed (const AffineTransform& transform, - float& x, float& y, - float& w, float& h) const throw() +const Rectangle Path::getBoundsTransformed (const AffineTransform& transform) const throw() { - float x1 = pathXMin; - float y1 = pathYMin; - transform.transformPoint (x1, y1); - - float x2 = pathXMax; - float y2 = pathYMin; - transform.transformPoint (x2, y2); - - float x3 = pathXMin; - float y3 = pathYMax; - transform.transformPoint (x3, y3); - - float x4 = pathXMax; - float y4 = pathYMax; - transform.transformPoint (x4, y4); - - x = jmin (x1, x2, x3, x4); - y = jmin (y1, y2, y3, y4); - w = jmax (x1, x2, x3, x4) - x; - h = jmax (y1, y2, y3, y4) - y; + return getBounds().transformed (transform); } void Path::startNewSubPath (const float x, @@ -88333,7 +88293,7 @@ void Path::closeSubPath() throw() } } -const Point Path::getCurrentPosition() const +const Point Path::getCurrentPosition() const { int i = numElements - 1; @@ -88352,9 +88312,9 @@ const Point Path::getCurrentPosition() const } if (i > 0) - return Point (data.elements [i - 1], data.elements [i]); + return Point (data.elements [i - 1], data.elements [i]); - return Point (0.0f, 0.0f); + return Point(); } void Path::addRectangle (const float x, const float y, @@ -88400,7 +88360,7 @@ void Path::addRectangle (const float x, const float y, data.elements [numElements++] = closeSubPathMarker; } -void Path::addRectangle (const Rectangle& rectangle) throw() +void Path::addRectangle (const Rectangle& rectangle) throw() { addRectangle ((float) rectangle.getX(), (float) rectangle.getY(), (float) rectangle.getWidth(), (float) rectangle.getHeight()); @@ -89013,16 +88973,15 @@ const AffineTransform Path::getTransformToScaleToFit (const float x, const float const bool preserveProportions, const Justification& justification) const throw() { - float sx, sy, sw, sh; - getBounds (sx, sy, sw, sh); + Rectangle bounds (getBounds()); if (preserveProportions) { - if (w <= 0 || h <= 0 || sw <= 0 || sh <= 0) + if (w <= 0 || h <= 0 || bounds.isEmpty()) return AffineTransform::identity; float newW, newH; - const float srcRatio = sh / sw; + const float srcRatio = bounds.getHeight() / bounds.getWidth(); if (srcRatio > h / w) { @@ -89052,14 +89011,15 @@ const AffineTransform Path::getTransformToScaleToFit (const float x, const float else newYCentre += h * 0.5f; - return AffineTransform::translation (sw * -0.5f - sx, sh * -0.5f - sy) - .scaled (newW / sw, newH / sh) + return AffineTransform::translation (bounds.getWidth() * -0.5f - bounds.getX(), + bounds.getHeight() * -0.5f - bounds.getY()) + .scaled (newW / bounds.getWidth(), newH / bounds.getHeight()) .translated (newXCentre, newYCentre); } else { - return AffineTransform::translation (-sx, -sy) - .scaled (w / sw, h / sh) + return AffineTransform::translation (-bounds.getX(), -bounds.getY()) + .scaled (w / bounds.getWidth(), h / bounds.getHeight()) .translated (x, y); } } @@ -90503,56 +90463,6 @@ void PathStrokeType::createDashedStroke (Path& destPath, END_JUCE_NAMESPACE /********* End of inlined file: juce_PathStrokeType.cpp *********/ -/********* Start of inlined file: juce_Point.cpp *********/ - -BEGIN_JUCE_NAMESPACE - -Point::Point() throw() - : x (0.0f), - y (0.0f) -{ -} - -Point::Point (const Point& other) throw() - : x (other.x), - y (other.y) -{ -} - -const Point& Point::operator= (const Point& other) throw() -{ - x = other.x; - y = other.y; - - return *this; -} - -Point::Point (const float x_, - const float y_) throw() - : x (x_), - y (y_) -{ -} - -Point::~Point() throw() -{ -} - -void Point::setXY (const float x_, - const float y_) throw() -{ - x = x_; - y = y_; -} - -void Point::applyTransform (const AffineTransform& transform) throw() -{ - transform.transformPoint (x, y); -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_Point.cpp *********/ - /********* Start of inlined file: juce_PositionedRectangle.cpp *********/ BEGIN_JUCE_NAMESPACE @@ -90643,7 +90553,7 @@ const String PositionedRectangle::toString() const throw() return s; } -const Rectangle PositionedRectangle::getRectangle (const Rectangle& target) const throw() +const Rectangle PositionedRectangle::getRectangle (const Rectangle& target) const throw() { jassert (! target.isEmpty()); @@ -90651,11 +90561,11 @@ const Rectangle PositionedRectangle::getRectangle (const Rectangle& target) cons applyPosAndSize (x_, w_, x, w, xMode, wMode, target.getX(), target.getWidth()); applyPosAndSize (y_, h_, y, h, yMode, hMode, target.getY(), target.getHeight()); - return Rectangle (roundToInt (x_), roundToInt (y_), - roundToInt (w_), roundToInt (h_)); + return Rectangle (roundToInt (x_), roundToInt (y_), + roundToInt (w_), roundToInt (h_)); } -void PositionedRectangle::getRectangleDouble (const Rectangle& target, +void PositionedRectangle::getRectangleDouble (const Rectangle& target, double& x_, double& y_, double& w_, double& h_) const throw() { @@ -90667,11 +90577,11 @@ void PositionedRectangle::getRectangleDouble (const Rectangle& target, void PositionedRectangle::applyToComponent (Component& comp) const throw() { - comp.setBounds (getRectangle (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()))); + comp.setBounds (getRectangle (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()))); } -void PositionedRectangle::updateFrom (const Rectangle& rectangle, - const Rectangle& target) throw() +void PositionedRectangle::updateFrom (const Rectangle& rectangle, + const Rectangle& target) throw() { updatePosAndSize (x, w, rectangle.getX(), rectangle.getWidth(), xMode, wMode, target.getX(), target.getWidth()); updatePosAndSize (y, h, rectangle.getY(), rectangle.getHeight(), yMode, hMode, target.getY(), target.getHeight()); @@ -90679,7 +90589,7 @@ void PositionedRectangle::updateFrom (const Rectangle& rectangle, void PositionedRectangle::updateFromDouble (const double newX, const double newY, const double newW, const double newH, - const Rectangle& target) throw() + const Rectangle& target) throw() { updatePosAndSize (x, w, newX, newW, xMode, wMode, target.getX(), target.getWidth()); updatePosAndSize (y, h, newY, newH, yMode, hMode, target.getY(), target.getHeight()); @@ -90688,9 +90598,9 @@ void PositionedRectangle::updateFromDouble (const double newX, const double newY void PositionedRectangle::updateFromComponent (const Component& comp) throw() { if (comp.getParentComponent() == 0 && ! comp.isOnDesktop()) - updateFrom (comp.getBounds(), Rectangle()); + updateFrom (comp.getBounds(), Rectangle()); else - updateFrom (comp.getBounds(), Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight())); + updateFrom (comp.getBounds(), Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight())); } PositionedRectangle::AnchorPoint PositionedRectangle::getAnchorPointX() const throw() @@ -90735,7 +90645,7 @@ void PositionedRectangle::setModes (const AnchorPoint xAnchor, const PositionMode yMode_, const SizeMode widthMode, const SizeMode heightMode, - const Rectangle& target) throw() + const Rectangle& target) throw() { if (xMode != (xAnchor | xMode_) || wMode != widthMode) { @@ -90911,365 +90821,6 @@ void PositionedRectangle::updatePosAndSize (double& xOut, double& wOut, END_JUCE_NAMESPACE /********* End of inlined file: juce_PositionedRectangle.cpp *********/ -/********* Start of inlined file: juce_Rectangle.cpp *********/ - -BEGIN_JUCE_NAMESPACE - -Rectangle::Rectangle() throw() - : x (0), - y (0), - w (0), - h (0) -{ -} - -Rectangle::Rectangle (const int x_, const int y_, - const int w_, const int h_) throw() - : x (x_), - y (y_), - w (w_), - h (h_) -{ -} - -Rectangle::Rectangle (const int w_, const int h_) throw() - : x (0), - y (0), - w (w_), - h (h_) -{ -} - -Rectangle::Rectangle (const Rectangle& other) throw() - : x (other.x), - y (other.y), - w (other.w), - h (other.h) -{ -} - -Rectangle::~Rectangle() throw() -{ -} - -bool Rectangle::isEmpty() const throw() -{ - return w <= 0 || h <= 0; -} - -void Rectangle::setBounds (const int x_, - const int y_, - const int w_, - const int h_) throw() -{ - x = x_; - y = y_; - w = w_; - h = h_; -} - -void Rectangle::setPosition (const int x_, - const int y_) throw() -{ - x = x_; - y = y_; -} - -void Rectangle::setSize (const int w_, - const int h_) throw() -{ - w = w_; - h = h_; -} - -void Rectangle::setWidth (const int newWidth) throw() -{ - w = newWidth; -} - -void Rectangle::setHeight (const int newHeight) throw() -{ - h = newHeight; -} - -void Rectangle::setLeft (const int newLeft) throw() -{ - w = jmax (0, x + w - newLeft); - x = newLeft; -} - -void Rectangle::setTop (const int newTop) throw() -{ - h = jmax (0, y + h - newTop); - y = newTop; -} - -void Rectangle::setRight (const int newRight) throw() -{ - x = jmin (x, newRight); - w = newRight - x; -} - -void Rectangle::setBottom (const int newBottom) throw() -{ - y = jmin (y, newBottom); - h = newBottom - y; -} - -void Rectangle::translate (const int dx, - const int dy) throw() -{ - x += dx; - y += dy; -} - -const Rectangle Rectangle::translated (const int dx, - const int dy) const throw() -{ - return Rectangle (x + dx, y + dy, w, h); -} - -void Rectangle::expand (const int deltaX, - const int deltaY) throw() -{ - const int nw = jmax (0, w + deltaX + deltaX); - const int nh = jmax (0, h + deltaY + deltaY); - - setBounds (x - deltaX, - y - deltaY, - nw, nh); -} - -const Rectangle Rectangle::expanded (const int deltaX, - const int deltaY) const throw() -{ - const int nw = jmax (0, w + deltaX + deltaX); - const int nh = jmax (0, h + deltaY + deltaY); - - return Rectangle (x - deltaX, - y - deltaY, - nw, nh); -} - -void Rectangle::reduce (const int deltaX, - const int deltaY) throw() -{ - expand (-deltaX, -deltaY); -} - -const Rectangle Rectangle::reduced (const int deltaX, - const int deltaY) const throw() -{ - return expanded (-deltaX, -deltaY); -} - -bool Rectangle::operator== (const Rectangle& other) const throw() -{ - return x == other.x - && y == other.y - && w == other.w - && h == other.h; -} - -bool Rectangle::operator!= (const Rectangle& other) const throw() -{ - return x != other.x - || y != other.y - || w != other.w - || h != other.h; -} - -bool Rectangle::contains (const int px, - const int py) const throw() -{ - return px >= x - && py >= y - && px < x + w - && py < y + h; -} - -bool Rectangle::contains (const Rectangle& other) const throw() -{ - return x <= other.x - && y <= other.y - && x + w >= other.x + other.w - && y + h >= other.y + other.h; -} - -bool Rectangle::intersects (const Rectangle& other) const throw() -{ - return x + w > other.x - && y + h > other.y - && x < other.x + other.w - && y < other.y + other.h - && w > 0 - && h > 0; -} - -const Rectangle Rectangle::getIntersection (const Rectangle& other) const throw() -{ - const int nx = jmax (x, other.x); - const int ny = jmax (y, other.y); - const int nw = jmin (x + w, other.x + other.w) - nx; - const int nh = jmin (y + h, other.y + other.h) - ny; - - if (nw >= 0 && nh >= 0) - return Rectangle (nx, ny, nw, nh); - else - return Rectangle(); -} - -bool Rectangle::intersectRectangle (int& x1, int& y1, int& w1, int& h1) const throw() -{ - const int maxX = jmax (x1, x); - w1 = jmin (x1 + w1, x + w) - maxX; - - if (w1 > 0) - { - const int maxY = jmax (y1, y); - h1 = jmin (y1 + h1, y + h) - maxY; - - if (h1 > 0) - { - x1 = maxX; - y1 = maxY; - - return true; - } - } - - return false; -} - -bool Rectangle::intersectRectangles (int& x1, int& y1, int& w1, int& h1, - int x2, int y2, int w2, int h2) throw() -{ - const int x = jmax (x1, x2); - w1 = jmin (x1 + w1, x2 + w2) - x; - - if (w1 > 0) - { - const int y = jmax (y1, y2); - h1 = jmin (y1 + h1, y2 + h2) - y; - - if (h1 > 0) - { - x1 = x; - y1 = y; - - return true; - } - } - - return false; -} - -const Rectangle Rectangle::getUnion (const Rectangle& other) const throw() -{ - const int newX = jmin (x, other.x); - const int newY = jmin (y, other.y); - - return Rectangle (newX, newY, - jmax (x + w, other.x + other.w) - newX, - jmax (y + h, other.y + other.h) - newY); -} - -bool Rectangle::enlargeIfAdjacent (const Rectangle& other) throw() -{ - if (x == other.x && getRight() == other.getRight() - && (other.getBottom() >= y && other.y <= getBottom())) - { - const int newY = jmin (y, other.y); - h = jmax (getBottom(), other.getBottom()) - newY; - y = newY; - return true; - } - else if (y == other.y && getBottom() == other.getBottom() - && (other.getRight() >= x && other.x <= getRight())) - { - const int newX = jmin (x, other.x); - w = jmax (getRight(), other.getRight()) - newX; - x = newX; - return true; - } - - return false; -} - -bool Rectangle::reduceIfPartlyContainedIn (const Rectangle& other) throw() -{ - int inside = 0; - const int otherR = other.getRight(); - - if (x >= other.x && x < otherR) - inside = 1; - - const int otherB = other.getBottom(); - - if (y >= other.y && y < otherB) - inside |= 2; - - const int r = x + w; - - if (r >= other.x && r < otherR) - inside |= 4; - - const int b = y + h; - - if (b >= other.y && b < otherB) - inside |= 8; - - switch (inside) - { - case 1 + 2 + 8: - w = r - otherR; - x = otherR; - return true; - - case 1 + 2 + 4: - h = b - otherB; - y = otherB; - return true; - - case 2 + 4 + 8: - w = other.x - x; - return true; - - case 1 + 4 + 8: - h = other.y - y; - return true; - } - - return false; -} - -const String Rectangle::toString() const throw() -{ - String s; - s.preallocateStorage (16); - - s << x << T(' ') - << y << T(' ') - << w << T(' ') - << h; - - return s; -} - -const Rectangle Rectangle::fromString (const String& stringVersion) -{ - StringArray toks; - toks.addTokens (stringVersion.trim(), T(",; \t\r\n"), 0); - - return Rectangle (toks[0].trim().getIntValue(), - toks[1].trim().getIntValue(), - toks[2].trim().getIntValue(), - toks[3].trim().getIntValue()); -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_Rectangle.cpp *********/ - /********* Start of inlined file: juce_RectangleList.cpp *********/ BEGIN_JUCE_NAMESPACE @@ -91278,7 +90829,7 @@ RectangleList::RectangleList() throw() { } -RectangleList::RectangleList (const Rectangle& rect) throw() +RectangleList::RectangleList (const Rectangle& rect) throw() { if (! rect.isEmpty()) rects.add (rect); @@ -91304,12 +90855,12 @@ void RectangleList::clear() throw() rects.clearQuick(); } -const Rectangle RectangleList::getRectangle (const int index) const throw() +const Rectangle RectangleList::getRectangle (const int index) const throw() { if (((unsigned int) index) < (unsigned int) rects.size()) return rects.getReference (index); - return Rectangle(); + return Rectangle(); } bool RectangleList::isEmpty() const throw() @@ -91339,7 +90890,7 @@ bool RectangleList::Iterator::next() throw() return false; } -void RectangleList::add (const Rectangle& rect) throw() +void RectangleList::add (const Rectangle& rect) throw() { if (! rect.isEmpty()) { @@ -91354,7 +90905,7 @@ void RectangleList::add (const Rectangle& rect) throw() int i; for (i = rects.size(); --i >= 0;) { - Rectangle& ourRect = rects.getReference (i); + Rectangle& ourRect = rects.getReference (i); if (rect.intersects (ourRect)) { @@ -91371,7 +90922,7 @@ void RectangleList::add (const Rectangle& rect) throw() for (i = rects.size(); --i >= 0;) { - const Rectangle& ourRect = rects.getReference (i); + const Rectangle& ourRect = rects.getReference (i); if (rect.intersects (ourRect)) { @@ -91393,7 +90944,7 @@ void RectangleList::add (const Rectangle& rect) throw() } } -void RectangleList::addWithoutMerging (const Rectangle& rect) throw() +void RectangleList::addWithoutMerging (const Rectangle& rect) throw() { rects.add (rect); } @@ -91403,11 +90954,11 @@ void RectangleList::add (const int x, const int y, const int w, const int h) thr if (rects.size() == 0) { if (w > 0 && h > 0) - rects.add (Rectangle (x, y, w, h)); + rects.add (Rectangle (x, y, w, h)); } else { - add (Rectangle (x, y, w, h)); + add (Rectangle (x, y, w, h)); } } @@ -91417,7 +90968,7 @@ void RectangleList::add (const RectangleList& other) throw() add (other.rects.getReference (i)); } -void RectangleList::subtract (const Rectangle& rect) throw() +void RectangleList::subtract (const Rectangle& rect) throw() { const int originalNumRects = rects.size(); @@ -91430,7 +90981,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() for (int i = getNumRectangles(); --i >= 0;) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); const int rx1 = r.x; const int ry1 = r.y; @@ -91450,7 +91001,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() r.x = x1; r.w = rx2 - x1; - rects.insert (i + 1, Rectangle (rx1, ry1, x1 - rx1, ry2 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, x1 - rx1, ry2 - ry1)); i += 2; } } @@ -91461,7 +91012,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() if (y1 > ry1 || y2 < ry2 || x1 > rx1) { - rects.insert (i + 1, Rectangle (rx1, ry1, x2 - rx1, ry2 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, x2 - rx1, ry2 - ry1)); i += 2; } } @@ -91476,7 +91027,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() r.y = y1; r.h = ry2 - y1; - rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y1 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y1 - ry1)); i += 2; } } @@ -91487,7 +91038,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() if (x1 > rx1 || x2 < rx2 || y1 > ry1) { - rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y2 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y2 - ry1)); i += 2; } } @@ -91509,7 +91060,7 @@ void RectangleList::subtract (const RectangleList& otherList) throw() subtract (otherList.rects.getReference (i)); } -bool RectangleList::clipTo (const Rectangle& rect) throw() +bool RectangleList::clipTo (const Rectangle& rect) throw() { bool notEmpty = false; @@ -91521,7 +91072,7 @@ bool RectangleList::clipTo (const Rectangle& rect) throw() { for (int i = rects.size(); --i >= 0;) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); if (! rect.intersectRectangle (r.x, r.y, r.w, r.h)) rects.remove (i); @@ -91542,11 +91093,11 @@ bool RectangleList::clipTo (const RectangleList& other) throw() for (int j = 0; j < rects.size(); ++j) { - const Rectangle& rect = rects.getReference (j); + const Rectangle& rect = rects.getReference (j); for (int i = other.rects.size(); --i >= 0;) { - Rectangle r (other.rects.getReference (i)); + Rectangle r (other.rects.getReference (i)); if (rect.intersectRectangle (r.x, r.y, r.w, r.h)) result.rects.add (r); @@ -91558,7 +91109,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 throw() { destRegion.clear(); @@ -91566,7 +91117,7 @@ bool RectangleList::getIntersectionWith (const Rectangle& rect, RectangleList& d { for (int i = rects.size(); --i >= 0;) { - Rectangle r (rects.getReference (i)); + Rectangle r (rects.getReference (i)); if (rect.intersectRectangle (r.x, r.y, r.w, r.h)) destRegion.rects.add (r); @@ -91586,7 +91137,7 @@ void RectangleList::consolidate() throw() int i; for (i = 0; i < getNumRectangles() - 1; ++i) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); const int rx1 = r.x; const int ry1 = r.y; const int rx2 = rx1 + r.w; @@ -91594,7 +91145,7 @@ void RectangleList::consolidate() throw() for (int j = rects.size(); --j > i;) { - Rectangle& r2 = rects.getReference (j); + Rectangle& r2 = rects.getReference (j); const int jrx1 = r2.x; const int jry1 = r2.y; const int jrx2 = jrx1 + r2.w; @@ -91607,7 +91158,7 @@ void RectangleList::consolidate() throw() if (jry1 > ry1 && jry1 < ry2) { r.h = jry1 - ry1; - rects.add (Rectangle (rx1, jry1, rx2 - rx1, ry2 - jry1)); + rects.add (Rectangle (rx1, jry1, rx2 - rx1, ry2 - jry1)); i = -1; break; } @@ -91615,21 +91166,21 @@ void RectangleList::consolidate() throw() if (jry2 > ry1 && jry2 < ry2) { r.h = jry2 - ry1; - rects.add (Rectangle (rx1, jry2, rx2 - rx1, ry2 - jry2)); + rects.add (Rectangle (rx1, jry2, rx2 - rx1, ry2 - jry2)); i = -1; break; } else if (ry1 > jry1 && ry1 < jry2) { r2.h = ry1 - jry1; - rects.add (Rectangle (jrx1, ry1, jrx2 - jrx1, jry2 - ry1)); + rects.add (Rectangle (jrx1, ry1, jrx2 - jrx1, jry2 - ry1)); i = -1; break; } else if (ry2 > jry1 && ry2 < jry2) { r2.h = ry2 - jry1; - rects.add (Rectangle (jrx1, ry2, jrx2 - jrx1, jry2 - ry2)); + rects.add (Rectangle (jrx1, ry2, jrx2 - jrx1, jry2 - ry2)); i = -1; break; } @@ -91639,7 +91190,7 @@ void RectangleList::consolidate() throw() for (i = 0; i < rects.size() - 1; ++i) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); for (int j = rects.size(); --j > i;) { @@ -91662,7 +91213,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 throw() { if (rects.size() > 1) { @@ -91684,7 +91235,7 @@ bool RectangleList::containsRectangle (const Rectangle& rectangleToCheck) const return false; } -bool RectangleList::intersectsRectangle (const Rectangle& rectangleToCheck) const throw() +bool RectangleList::intersectsRectangle (const Rectangle& rectangleToCheck) const throw() { for (int i = rects.size(); --i >= 0;) if (rects.getReference (i).intersects (rectangleToCheck)) @@ -91702,18 +91253,18 @@ bool RectangleList::intersects (const RectangleList& other) const throw() return false; } -const Rectangle RectangleList::getBounds() const throw() +const Rectangle RectangleList::getBounds() const throw() { if (rects.size() <= 1) { if (rects.size() == 0) - return Rectangle(); + return Rectangle(); else return rects.getReference (0); } else { - const Rectangle& r = rects.getReference (0); + const Rectangle& r = rects.getReference (0); int minX = r.x; int minY = r.y; @@ -91722,7 +91273,7 @@ const Rectangle RectangleList::getBounds() const throw() for (int i = rects.size(); --i > 0;) { - const Rectangle& r2 = rects.getReference (i); + const Rectangle& r2 = rects.getReference (i); minX = jmin (minX, r2.x); minY = jmin (minY, r2.y); @@ -91730,7 +91281,7 @@ const Rectangle RectangleList::getBounds() const throw() maxY = jmax (maxY, r2.getBottom()); } - return Rectangle (minX, minY, maxX - minX, maxY - minY); + return Rectangle (minX, minY, maxX - minX, maxY - minY); } } @@ -91738,7 +91289,7 @@ void RectangleList::offsetAll (const int dx, const int dy) throw() { for (int i = rects.size(); --i >= 0;) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); r.x += dx; r.y += dy; @@ -91751,7 +91302,7 @@ const Path RectangleList::toPath() const throw() for (int i = rects.size(); --i >= 0;) { - const Rectangle& r = rects.getReference (i); + const Rectangle& r = rects.getReference (i); p.addRectangle ((float) r.x, (float) r.y, @@ -91856,7 +91407,7 @@ void Image::setPixelData (int x, int y, int w, int h, { jassert (x >= 0 && y >= 0 && w > 0 && h > 0 && x + w <= imageWidth && y + h <= imageHeight); - if (Rectangle::intersectRectangles (x, y, w, h, 0, 0, imageWidth, imageHeight)) + if (Rectangle::intersectRectangles (x, y, w, h, 0, 0, imageWidth, imageHeight)) { const BitmapData dest (*this, x, y, w, h, true); @@ -92134,7 +91685,7 @@ void Image::createSolidAreaMask (RectangleList& result, const float alphaThresho int x, w; if (pixelsOnRow.getRange (i, x, w)) - result.add (Rectangle (x, y, w, 1)); + result.add (Rectangle (x, y, w, 1)); } result.consolidate(); @@ -213279,7 +212830,7 @@ const String File::getVersion() const VS_FIXEDFILEINFO* vffi; UINT len = 0; - if (VerQueryValue (buffer, _T("\\"), (LPVOID*) &vffi, &len)) + if (VerQueryValue (buffer, (LPTSTR) _T("\\"), (LPVOID*) &vffi, &len)) { result << (int) HIWORD (vffi->dwFileVersionMS) << "." << (int) LOWORD (vffi->dwFileVersionMS) << "." @@ -213667,6 +213218,10 @@ void NamedPipe::cancelPendingReads() #define INTERNET_FLAG_NEED_FILE 0x00000010 #endif +#ifndef INTERNET_OPTION_DISABLE_AUTODIAL + #define INTERNET_OPTION_DISABLE_AUTODIAL 70 +#endif + bool juce_isOnLine() { DWORD connectionType; @@ -214833,7 +214388,7 @@ public: { for (RectangleList::Iterator i (maskedRegion); i.next();) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); ExcludeClipRect (hdc, r.getX(), r.getY(), r.getRight(), r.getBottom()); } } @@ -214850,7 +214405,7 @@ public: for (RectangleList::Iterator i (maskedRegion); i.next();) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); ExcludeClipRect (dc, r.getX(), r.getY(), r.getRight(), r.getBottom()); } } @@ -215197,7 +214752,7 @@ public: if (! fullScreen) { - const Rectangle boundsCopy (lastNonFullscreenBounds); + const Rectangle boundsCopy (lastNonFullscreenBounds); if (hasTitleBar()) ShowWindow (hwnd, SW_SHOWNORMAL); @@ -215754,7 +215309,7 @@ private: if (cx + cw - x <= w && cy + ch - y <= h) { - contextClip.addWithoutMerging (Rectangle (cx - x, cy - y, cw, ch)); + contextClip.addWithoutMerging (Rectangle (cx - x, cy - y, cw, ch)); } else { @@ -215771,7 +215326,7 @@ private: if (needToPaintAll) { contextClip.clear(); - contextClip.addWithoutMerging (Rectangle (0, 0, w, h)); + contextClip.addWithoutMerging (Rectangle (0, 0, w, h)); } if (transparent) @@ -215780,7 +215335,7 @@ private: while (i.next()) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); offscreenImage->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); } } @@ -216326,7 +215881,7 @@ private: if (fullScreen && ! isMinimised()) { - const Rectangle r (component->getParentMonitorArea()); + const Rectangle r (component->getParentMonitorArea()); SetWindowPos (hwnd, 0, r.getX(), r.getY(), r.getWidth(), r.getHeight(), @@ -216429,10 +215984,10 @@ private: { if (constrainer != 0) { - const Rectangle current (component->getX() - windowBorder.getLeft(), - component->getY() - windowBorder.getTop(), - component->getWidth() + windowBorder.getLeftAndRight(), - component->getHeight() + windowBorder.getTopAndBottom()); + const Rectangle current (component->getX() - windowBorder.getLeft(), + component->getY() - windowBorder.getTop(), + component->getWidth() + windowBorder.getLeftAndRight(), + component->getHeight() + windowBorder.getTopAndBottom()); constrainer->checkBounds (wp->x, wp->y, wp->cx, wp->cy, current, @@ -216915,14 +216470,14 @@ void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable static BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo) { - Array * const monitorCoords = (Array *) userInfo; + Array >* const monitorCoords = (Array >*) userInfo; - monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); + monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); return TRUE; } -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) +void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea) { EnumDisplayMonitors (0, 0, &enumMonitorsProc, (LPARAM) &monitorCoords); @@ -216936,7 +216491,7 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c RECT r; GetWindowRect (GetDesktopWindow(), &r); - monitorCoords.add (Rectangle (r.left, r.top, r.right - r.left, r.bottom - r.top)); + monitorCoords.add (Rectangle (r.left, r.top, r.right - r.left, r.bottom - r.top)); } if (clipToWorkArea) @@ -216945,7 +216500,7 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c RECT r; SystemParametersInfo (SPI_GETWORKAREA, 0, &r, 0); - Rectangle& screen = monitorCoords.getReference (0); + Rectangle& screen = monitorCoords.getReference (0); screen.setPosition (jmax (screen.getX(), (int) r.left), jmax (screen.getY(), (int) r.top)); @@ -218096,7 +217651,7 @@ void FileChooser::showPlatformDialog (Array& results, { // use a modal window as the parent for this dialog box // to block input from other app windows - const Rectangle mainMon (Desktop::getInstance().getMainMonitorArea()); + const Rectangle mainMon (Desktop::getInstance().getMainMonitorArea()); Component w (String::empty); w.setBounds (mainMon.getX() + mainMon.getWidth() / 4, @@ -218592,7 +218147,7 @@ public: int x = 0, y = 0; owner->relativePositionToOtherComponent (topComp, x, y); - owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); + owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); } } @@ -218779,7 +218334,7 @@ bool ActiveXControlComponent::createControl (const void* controlIID) if (info->control->DoVerb (OLEIVERB_SHOW, 0, info->clientSite, 0, hwnd, &rect) == S_OK) { control = info.release(); - setControlBounds (Rectangle (x, y, getWidth(), getHeight())); + setControlBounds (Rectangle (x, y, getWidth(), getHeight())); ((ActiveXControlData*) control)->controlHWND = getHWND (this); @@ -218823,7 +218378,7 @@ void* ActiveXControlComponent::queryInterface (const void* iid) const return 0; } -void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const +void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const { HWND hwnd = ((ActiveXControlData*) control)->controlHWND; @@ -219286,7 +218841,7 @@ void QuickTimeMovieComponent::goToStart() setPosition (0.0); } -void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, const RectanglePlacement& placement) { int normalWidth, normalHeight; @@ -232568,7 +232123,7 @@ public: void setFullScreen (const bool shouldBeFullScreen) { - Rectangle r (lastNonFullscreenBounds); // (get a copy of this before de-minimising) + Rectangle r (lastNonFullscreenBounds); // (get a copy of this before de-minimising) setMinimised (false); @@ -232801,10 +232356,10 @@ public: void repaint (int x, int y, int w, int h) { - if (Rectangle::intersectRectangles (x, y, w, h, - 0, 0, - getComponent()->getWidth(), - getComponent()->getHeight())) + if (Rectangle::intersectRectangles (x, y, w, h, + 0, 0, + getComponent()->getWidth(), + getComponent()->getHeight())) { repainter->repaint (x, y, w, h); } @@ -233530,7 +233085,7 @@ private: RectangleList originalRepaintRegion (regionsNeedingRepaint); regionsNeedingRepaint.clear(); - const Rectangle totalArea (originalRepaintRegion.getBounds()); + const Rectangle totalArea (originalRepaintRegion.getBounds()); if (! totalArea.isEmpty()) { @@ -233567,7 +233122,7 @@ private: for (RectangleList::Iterator i (originalRepaintRegion); i.next();) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); image->blitToWindow (peer->windowH, r.getX(), r.getY(), r.getWidth(), r.getHeight(), @@ -234326,7 +233881,7 @@ void juce_windowMessageReceive (XEvent* event) } } -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool /*clipToWorkArea*/) +void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool /*clipToWorkArea*/) { if (display == 0) return; @@ -234370,12 +233925,12 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool / if (index >= 0) { while (monitorCoords.size() < index) - monitorCoords.add (Rectangle (0, 0, 0, 0)); + monitorCoords.add (Rectangle()); - monitorCoords.set (index, Rectangle (screens[i].x_org, - screens[i].y_org, - screens[i].width, - screens[i].height)); + monitorCoords.set (index, Rectangle (screens[i].x_org, + screens[i].y_org, + screens[i].width, + screens[i].height)); } } @@ -234409,8 +233964,8 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool / const long* const position = (const long*) data; if (actualType == XA_CARDINAL && actualFormat == 32 && nitems == 4) - monitorCoords.add (Rectangle (position[0], position[1], - position[2], position[3])); + monitorCoords.add (Rectangle (position[0], position[1], + position[2], position[3])); XFree (data); } @@ -234419,9 +233974,9 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool / if (monitorCoords.size() == 0) { - monitorCoords.add (Rectangle (0, 0, - DisplayWidth (display, DefaultScreen (display)), - DisplayHeight (display, DefaultScreen (display)))); + monitorCoords.add (Rectangle (0, 0, + DisplayWidth (display, DefaultScreen (display)), + DisplayHeight (display, DefaultScreen (display)))); } } } @@ -239455,10 +239010,10 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c CGRect r = clipToWorkArea ? [[UIScreen mainScreen] applicationFrame] : [[UIScreen mainScreen] bounds]; - monitorCoords.add (Rectangle ((int) r.origin.x, - (int) r.origin.y, - (int) r.size.width, - (int) r.size.height)); + monitorCoords.add (Rectangle ((int) r.origin.x, + (int) r.origin.y, + (int) r.size.width, + (int) r.size.height)); } #endif @@ -239675,7 +239230,7 @@ bool Desktop::isScreenSaverEnabled() throw() #endif -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) +void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea) { const ScopedAutoReleasePool pool; monitorCoords.clear(); @@ -239689,10 +239244,10 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c NSRect r = clipToWorkArea ? [s visibleFrame] : [s frame]; - monitorCoords.add (Rectangle ((int) r.origin.x, - (int) (mainScreenBottom - (r.origin.y + r.size.height)), - (int) r.size.width, - (int) r.size.height)); + monitorCoords.add (Rectangle ((int) r.origin.x, + (int) (mainScreenBottom - (r.origin.y + r.size.height)), + (int) r.size.width, + (int) r.size.height)); } jassert (monitorCoords.size() > 0); @@ -240382,7 +239937,7 @@ public: CGContextTranslateCTM (context, x, -y); } - bool clipToRectangle (const Rectangle& r) + bool clipToRectangle (const Rectangle& r) { CGContextClipToRect (context, CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight())); return ! isClipEmpty(); @@ -240402,7 +239957,7 @@ public: HeapBlock rects (numRects); for (int i = 0; i < numRects; ++i) { - const Rectangle& r = clipRegion.getRectangle(i); + const Rectangle& r = clipRegion.getRectangle(i); rects[i] = CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight()); } @@ -240411,7 +239966,7 @@ public: } } - void excludeClipRectangle (const Rectangle& r) + void excludeClipRectangle (const Rectangle& r) { RectangleList remaining (getClipBounds()); remaining.subtract (r); @@ -240424,7 +239979,7 @@ public: CGContextClip (context); } - void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) + void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) { if (! transform.isSingularity()) { @@ -240446,19 +240001,19 @@ public: } } - bool clipRegionIntersects (const Rectangle& r) + bool clipRegionIntersects (const Rectangle& r) { return getClipBounds().intersects (r); } - const Rectangle getClipBounds() const + const Rectangle getClipBounds() const { CGRect bounds = CGRectIntegral (CGContextGetClipBoundingBox (context)); - return Rectangle (roundToInt (bounds.origin.x), - roundToInt (flipHeight - (bounds.origin.y + bounds.size.height)), - roundToInt (bounds.size.width), - roundToInt (bounds.size.height)); + return Rectangle (roundToInt (bounds.origin.x), + roundToInt (flipHeight - (bounds.origin.y + bounds.size.height)), + roundToInt (bounds.size.width), + roundToInt (bounds.size.height)); } bool isClipEmpty() const @@ -240514,7 +240069,7 @@ public: : kCGInterpolationHigh); } - void fillRect (const Rectangle& r, const bool replaceExistingContents) + void fillRect (const Rectangle& r, const bool replaceExistingContents) { CGRect cgRect = CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight()); @@ -240590,7 +240145,7 @@ public: CGContextRestoreGState (context); } - void drawImage (const Image& sourceImage, const Rectangle& srcClip, + void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles) { jassert (sourceImage.getBounds().contains (srcClip)); @@ -241450,8 +241005,8 @@ CGRect UIViewComponentPeer::constrainRect (CGRect r) int w = (int) r.size.width; int h = (int) r.size.height; - Rectangle original ((int) current.origin.x, (int) current.origin.y, - (int) current.size.width, (int) current.size.height); + Rectangle original ((int) current.origin.x, (int) current.origin.y, + (int) current.size.width, (int) current.size.height); constrainer->checkBounds (x, y, w, h, original, @@ -241484,7 +241039,7 @@ void UIViewComponentPeer::setFullScreen (bool shouldBeFullScreen) { if (! isSharedWindow) { - Rectangle r (lastNonFullscreenBounds); + Rectangle r (lastNonFullscreenBounds); setMinimised (false); @@ -241685,9 +241240,9 @@ class AsyncRepaintMessage : public CallbackMessage { public: UIViewComponentPeer* const peer; - const Rectangle rect; + const Rectangle rect; - AsyncRepaintMessage (UIViewComponentPeer* const peer_, const Rectangle& rect_) + AsyncRepaintMessage (UIViewComponentPeer* const peer_, const Rectangle& rect_) : peer (peer_), rect (rect_) { } @@ -241703,7 +241258,7 @@ void UIViewComponentPeer::repaint (int x, int y, int w, int h) { if (insideDrawRect || ! MessageManager::getInstance()->isThisTheMessageThread()) { - (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); + (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); } else { @@ -244809,7 +244364,7 @@ public: CGContextTranslateCTM (context, x, -y); } - bool clipToRectangle (const Rectangle& r) + bool clipToRectangle (const Rectangle& r) { CGContextClipToRect (context, CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight())); return ! isClipEmpty(); @@ -244829,7 +244384,7 @@ public: HeapBlock rects (numRects); for (int i = 0; i < numRects; ++i) { - const Rectangle& r = clipRegion.getRectangle(i); + const Rectangle& r = clipRegion.getRectangle(i); rects[i] = CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight()); } @@ -244838,7 +244393,7 @@ public: } } - void excludeClipRectangle (const Rectangle& r) + void excludeClipRectangle (const Rectangle& r) { RectangleList remaining (getClipBounds()); remaining.subtract (r); @@ -244851,7 +244406,7 @@ public: CGContextClip (context); } - void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) + void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) { if (! transform.isSingularity()) { @@ -244873,19 +244428,19 @@ public: } } - bool clipRegionIntersects (const Rectangle& r) + bool clipRegionIntersects (const Rectangle& r) { return getClipBounds().intersects (r); } - const Rectangle getClipBounds() const + const Rectangle getClipBounds() const { CGRect bounds = CGRectIntegral (CGContextGetClipBoundingBox (context)); - return Rectangle (roundToInt (bounds.origin.x), - roundToInt (flipHeight - (bounds.origin.y + bounds.size.height)), - roundToInt (bounds.size.width), - roundToInt (bounds.size.height)); + return Rectangle (roundToInt (bounds.origin.x), + roundToInt (flipHeight - (bounds.origin.y + bounds.size.height)), + roundToInt (bounds.size.width), + roundToInt (bounds.size.height)); } bool isClipEmpty() const @@ -244941,7 +244496,7 @@ public: : kCGInterpolationHigh); } - void fillRect (const Rectangle& r, const bool replaceExistingContents) + void fillRect (const Rectangle& r, const bool replaceExistingContents) { CGRect cgRect = CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight()); @@ -245017,7 +244572,7 @@ public: CGContextRestoreGState (context); } - void drawImage (const Image& sourceImage, const Rectangle& srcClip, + void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles) { jassert (sourceImage.getBounds().contains (srcClip)); @@ -246235,8 +245790,8 @@ NSRect NSViewComponentPeer::constrainRect (NSRect r) int w = (int) r.size.width; int h = (int) r.size.height; - Rectangle original ((int) current.origin.x, (int) current.origin.y, - (int) current.size.width, (int) current.size.height); + Rectangle original ((int) current.origin.x, (int) current.origin.y, + (int) current.size.width, (int) current.size.height); constrainer->checkBounds (x, y, w, h, original, @@ -246275,7 +245830,7 @@ void NSViewComponentPeer::setFullScreen (bool shouldBeFullScreen) { if (! isSharedWindow) { - Rectangle r (lastNonFullscreenBounds); + Rectangle r (lastNonFullscreenBounds); setMinimised (false); @@ -246717,10 +246272,10 @@ void NSViewComponentPeer::drawRect (NSRect r) RectangleList clip; for (int i = 0; i < numRects; ++i) { - clip.addWithoutMerging (Rectangle (roundToInt (rects[i].origin.x), - roundToInt ([view frame].size.height - (rects[i].origin.y + rects[i].size.height)), - roundToInt (rects[i].size.width), - roundToInt (rects[i].size.height))); + clip.addWithoutMerging (Rectangle (roundToInt (rects[i].origin.x), + roundToInt ([view frame].size.height - (rects[i].origin.y + rects[i].size.height)), + roundToInt (rects[i].size.width), + roundToInt (rects[i].size.height))); } if (context.clipToRectangleList (clip)) @@ -246811,9 +246366,9 @@ class AsyncRepaintMessage : public CallbackMessage { public: NSViewComponentPeer* const peer; - const Rectangle rect; + const Rectangle rect; - AsyncRepaintMessage (NSViewComponentPeer* const peer_, const Rectangle& rect_) + AsyncRepaintMessage (NSViewComponentPeer* const peer_, const Rectangle& rect_) : peer (peer_), rect (rect_) { } @@ -246829,7 +246384,7 @@ void NSViewComponentPeer::repaint (int x, int y, int w, int h) { if (insideDrawRect) { - (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); + (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); } else { @@ -248662,7 +248217,7 @@ void QuickTimeMovieComponent::goToStart() setPosition (0.0); } -void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, const RectanglePlacement& placement) { int normalWidth, normalHeight; diff --git a/juce_amalgamated.h b/juce_amalgamated.h index c6672628fa..7ac860205c 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -3890,7 +3890,7 @@ private: // disallow copy constructor and assignment OwnedArray (const OwnedArray&); - const OwnedArray& operator= (const OwnedArray&); + OwnedArray& operator= (const OwnedArray&); }; #endif // __JUCE_OWNEDARRAY_JUCEHEADER__ @@ -9395,33 +9395,43 @@ private: #ifndef __JUCE_POINT_JUCEHEADER__ #define __JUCE_POINT_JUCEHEADER__ -class JUCE_API Point +template +class Point { public: - Point() throw(); + Point() throw() : x (0), y (0) {} - Point (const Point& other) throw(); + Point (const Point& other) throw() : x (other.x), y (other.y) {} - Point (const float x, const float y) throw(); + Point (const ValueType initialX, const ValueType initialY) throw() : x (initialX), y (initialY) {} - const Point& operator= (const Point& other) throw(); + ~Point() throw() {} - ~Point() throw(); + Point& operator= (const Point& other) throw() { x = other.x; y = other.y; return *this; } - inline float getX() const throw() { return x; } + inline ValueType getX() const throw() { return x; } - inline float getY() const throw() { return y; } + inline ValueType getY() const throw() { return y; } - void setXY (const float x, - const float y) throw(); + void setXY (const ValueType newX, const ValueType newY) throw() { x = newX; y = newY; } - void applyTransform (const AffineTransform& transform) throw(); + void addXY (const ValueType xToAdd, const ValueType yToAdd) throw() { x += xToAdd; y += yToAdd; } + + const Point operator+ (const Point& other) const throw() { return Point (x + other.x, y + other.y); } + + Point& operator+= (const Point& other) throw() { x += other.x; y += other.y; return *this; } + + const Point operator- (const Point& other) const throw() { return Point (x - other.x, y - other.y); } + + Point& operator-= (const Point& other) throw() { x -= other.x; y -= other.y; return *this; } + + void applyTransform (const AffineTransform& transform) throw() { transform.transformPoint (x, y); } juce_UseDebuggingNewOperator private: - float x, y; + ValueType x, y; }; #endif // __JUCE_POINT_JUCEHEADER__ @@ -9431,108 +9441,339 @@ private: #ifndef __JUCE_RECTANGLE_JUCEHEADER__ #define __JUCE_RECTANGLE_JUCEHEADER__ -class JUCE_API Rectangle +class RectangleList; + +template +class Rectangle { public: - Rectangle() throw(); + Rectangle() throw() + : x (0), y (0), w (0), h (0) + { + } - Rectangle (const Rectangle& other) throw(); + Rectangle (const Rectangle& other) throw() + : x (other.x), y (other.y), + w (other.w), h (other.h) + { + } - Rectangle (const int x, const int y, - const int width, const int height) throw(); + Rectangle (const ValueType initialX, const ValueType initialY, + const ValueType width, const ValueType height) throw() + : x (initialX), y (initialY), + w (width), h (height) + { + } - Rectangle (const int width, const int height) throw(); + Rectangle (const ValueType width, const ValueType height) throw() + : x (0), y (0), w (width), h (height) + { + } - ~Rectangle() throw(); + Rectangle& operator= (const Rectangle& other) throw() + { + x = other.x; y = other.y; + w = other.w; h = other.h; + return *this; + } - inline int getX() const throw() { return x; } + ~Rectangle() throw() {} - inline int getY() const throw() { return y; } + inline ValueType getX() const throw() { return x; } - inline int getWidth() const throw() { return w; } + inline ValueType getY() const throw() { return y; } - inline int getHeight() const throw() { return h; } + inline ValueType getWidth() const throw() { return w; } - inline int getRight() const throw() { return x + w; } + inline ValueType getHeight() const throw() { return h; } - inline int getBottom() const throw() { return y + h; } + inline ValueType getRight() const throw() { return x + w; } - inline int getCentreX() const throw() { return x + (w >> 1); } + inline ValueType getBottom() const throw() { return y + h; } - inline int getCentreY() const throw() { return y + (h >> 1); } + inline ValueType getCentreX() const throw() { return x + w / (ValueType) 2; } - bool isEmpty() const throw(); + inline ValueType getCentreY() const throw() { return y + h / (ValueType) 2; } - void setPosition (const int x, const int y) throw(); + bool isEmpty() const throw() { return w <= 0 || h <= 0; } - void setSize (const int w, const int h) throw(); + const Point getPosition() const throw() { return Point (x, y); } - void setBounds (const int newX, const int newY, - const int newWidth, const int newHeight) throw(); + void setPosition (const ValueType newX, const ValueType newY) throw() { x = newX; y = newY; } - void setWidth (const int newWidth) throw(); + void setSize (const ValueType newWidth, const ValueType newHeight) throw() { w = newWidth; h = newHeight; } - void setHeight (const int newHeight) throw(); + void setBounds (const ValueType newX, const ValueType newY, + const ValueType newWidth, const ValueType newHeight) throw() + { + x = newX; y = newY; w = newWidth; h = newHeight; + } - void setLeft (const int newLeft) throw(); + void setWidth (const ValueType newWidth) throw() { w = newWidth; } - void setTop (const int newTop) throw(); + void setHeight (const ValueType newHeight) throw() { h = newHeight; } - void setRight (const int newRight) throw(); + void setLeft (const ValueType newLeft) throw() + { + w = jmax (ValueType(), x + w - newLeft); + x = newLeft; + } - void setBottom (const int newBottom) throw(); + void setTop (const ValueType newTop) throw() + { + h = jmax (ValueType(), y + h - newTop); + y = newTop; + } - void translate (const int deltaX, - const int deltaY) throw(); + void setRight (const ValueType newRight) throw() + { + x = jmin (x, newRight); + w = newRight - x; + } - const Rectangle translated (const int deltaX, - const int deltaY) const throw(); + void setBottom (const ValueType newBottom) throw() + { + y = jmin (y, newBottom); + h = newBottom - y; + } - void expand (const int deltaX, - const int deltaY) throw(); + void translate (const ValueType deltaX, + const ValueType deltaY) throw() + { + x += deltaX; + y += deltaY; + } - const Rectangle expanded (const int deltaX, - const int deltaY) const throw(); + const Rectangle translated (const ValueType deltaX, + const ValueType deltaY) const throw() + { + return Rectangle (x + deltaX, y + deltaY, w, h); + } - void reduce (const int deltaX, - const int deltaY) throw(); + void expand (const ValueType deltaX, + const ValueType deltaY) throw() + { + const ValueType nw = jmax (ValueType(), w + deltaX * 2); + const ValueType nh = jmax (ValueType(), h + deltaY * 2); + setBounds (x - deltaX, y - deltaY, nw, nh); + } - const Rectangle reduced (const int deltaX, - const int deltaY) const throw(); + const Rectangle expanded (const ValueType deltaX, + const ValueType deltaY) const throw() + { + const ValueType nw = jmax (ValueType(), w + deltaX * 2); + const ValueType nh = jmax (ValueType(), h + deltaY * 2); + return Rectangle (x - deltaX, y - deltaY, nw, nh); + } - bool operator== (const Rectangle& other) const throw(); + void reduce (const ValueType deltaX, + const ValueType deltaY) throw() + { + expand (-deltaX, -deltaY); + } - bool operator!= (const Rectangle& other) const throw(); + const Rectangle reduced (const ValueType deltaX, + const ValueType deltaY) const throw() + { + return expanded (-deltaX, -deltaY); + } - bool contains (const int x, const int y) const throw(); + bool operator== (const Rectangle& other) const throw() + { + return x == other.x && y == other.y + && w == other.w && h == other.h; + } - bool contains (const Rectangle& other) const throw(); + bool operator!= (const Rectangle& other) const throw() + { + return x != other.x || y != other.y + || w != other.w || h != other.h; + } - bool intersects (const Rectangle& other) const throw(); + bool contains (const ValueType xCoord, const ValueType yCoord) const throw() + { + return xCoord >= x && yCoord >= y && xCoord < x + w && yCoord < y + h; + } - const Rectangle getIntersection (const Rectangle& other) const throw(); + bool contains (const Rectangle& other) const throw() + { + return x <= other.x && y <= other.y + && x + w >= other.x + other.w && y + h >= other.y + other.h; + } - bool intersectRectangle (int& x, int& y, int& w, int& h) const throw(); + bool intersects (const Rectangle& other) const throw() + { + return x + w > other.x + && y + h > other.y + && x < other.x + other.w + && y < other.y + other.h + && w > ValueType() && h > ValueType(); + } - const Rectangle getUnion (const Rectangle& other) const throw(); + const Rectangle getIntersection (const Rectangle& other) const throw() + { + const ValueType nx = jmax (x, other.x); + const ValueType ny = jmax (y, other.y); + const ValueType nw = jmin (x + w, other.x + other.w) - nx; + const ValueType nh = jmin (y + h, other.y + other.h) - ny; - bool enlargeIfAdjacent (const Rectangle& other) throw(); + if (nw >= ValueType() && nh >= ValueType()) + return Rectangle (nx, ny, nw, nh); - bool reduceIfPartlyContainedIn (const Rectangle& other) throw(); + return Rectangle(); + } - static bool intersectRectangles (int& x1, int& y1, int& w1, int& h1, - int x2, int y2, int w2, int h2) throw(); + bool intersectRectangle (ValueType& otherX, ValueType& otherY, ValueType& otherW, ValueType& otherH) const throw() + { + const int maxX = jmax (otherX, x); + otherW = jmin (otherX + otherW, x + w) - maxX; - const String toString() const throw(); + if (otherW > 0) + { + const int maxY = jmax (otherY, y); + otherH = jmin (otherY + otherH, y + h) - maxY; - static const Rectangle fromString (const String& stringVersion); + if (otherH > 0) + { + otherX = maxX; otherY = maxY; + return true; + } + } + + return false; + } + + const Rectangle getUnion (const Rectangle& other) const throw() + { + const ValueType newX = jmin (x, other.x); + const ValueType newY = jmin (y, other.y); + + return Rectangle (newX, newY, + jmax (x + w, other.x + other.w) - newX, + jmax (y + h, other.y + other.h) - newY); + } + + bool enlargeIfAdjacent (const Rectangle& other) throw() + { + if (x == other.x && getRight() == other.getRight() + && (other.getBottom() >= y && other.y <= getBottom())) + { + const ValueType newY = jmin (y, other.y); + h = jmax (getBottom(), other.getBottom()) - newY; + y = newY; + return true; + } + else if (y == other.y && getBottom() == other.getBottom() + && (other.getRight() >= x && other.x <= getRight())) + { + const ValueType newX = jmin (x, other.x); + w = jmax (getRight(), other.getRight()) - newX; + x = newX; + return true; + } + + return false; + } + + bool reduceIfPartlyContainedIn (const Rectangle& other) throw() + { + int inside = 0; + const int otherR = other.getRight(); + if (x >= other.x && x < otherR) inside = 1; + const int otherB = other.getBottom(); + if (y >= other.y && y < otherB) inside |= 2; + const int r = x + w; + if (r >= other.x && r < otherR) inside |= 4; + const int b = y + h; + if (b >= other.y && b < otherB) inside |= 8; + + switch (inside) + { + case 1 + 2 + 8: w = r - otherR; x = otherR; return true; + case 1 + 2 + 4: h = b - otherB; y = otherB; return true; + case 2 + 4 + 8: w = other.x - x; return true; + case 1 + 4 + 8: h = other.y - y; return true; + } + + return false; + } + + const Rectangle transformed (const AffineTransform& transform) const throw() + { + float x1 = x, y1 = y; + float x2 = x + w, y2 = y; + float x3 = x, y3 = y + h; + float x4 = x2, y4 = y3; + + transform.transformPoint (x1, y1); + transform.transformPoint (x2, y2); + transform.transformPoint (x3, y3); + transform.transformPoint (x4, y4); + + const float x = jmin (x1, x2, x3, x4); + const float y = jmin (y1, y2, y3, y4); + + return Rectangle (x, y, + jmax (x1, x2, x3, x4) - x, + jmax (y1, y2, y3, y4) - y); + } + + const Rectangle getSmallestIntegerContainer() const throw() + { + const int x1 = (int) floorf ((float) x); + const int y1 = (int) floorf ((float) y); + const int x2 = (int) floorf ((float) (x + w + 0.9999f)); + const int y2 = (int) floorf ((float) (y + h + 0.9999f)); + + return Rectangle (x1, y1, x2 - x1, y2 - y1); + } + + static bool intersectRectangles (ValueType& x1, ValueType& y1, ValueType& w1, ValueType& h1, + const ValueType x2, const ValueType y2, const ValueType w2, const ValueType h2) throw() + { + const ValueType x = jmax (x1, x2); + w1 = jmin (x1 + w1, x2 + w2) - x; + + if (w1 > 0) + { + const ValueType y = jmax (y1, y2); + h1 = jmin (y1 + h1, y2 + h2) - y; + + if (h1 > 0) + { + x1 = x; y1 = y; + return true; + } + } + + return false; + } + + const String toString() const + { + String s; + s.preallocateStorage (16); + s << x << T(' ') << y << T(' ') << w << T(' ') << h; + return s; + } + + static const Rectangle fromString (const String& stringVersion) + { + StringArray toks; + toks.addTokens (stringVersion.trim(), T(",; \t\r\n"), 0); + + return Rectangle (toks[0].trim().getIntValue(), + toks[1].trim().getIntValue(), + toks[2].trim().getIntValue(), + toks[3].trim().getIntValue()); + } juce_UseDebuggingNewOperator private: friend class RectangleList; - int x, y, w, h; + ValueType x, y, w, h; }; #endif // __JUCE_RECTANGLE_JUCEHEADER__ @@ -9621,11 +9862,11 @@ class JUCE_API EdgeTable { public: - EdgeTable (const Rectangle& clipLimits, + EdgeTable (const Rectangle& clipLimits, const Path& pathToAdd, const AffineTransform& transform) throw(); - EdgeTable (const Rectangle& rectangleToAdd) throw(); + EdgeTable (const Rectangle& rectangleToAdd) throw(); EdgeTable (const RectangleList& rectanglesToAdd) throw(); @@ -9638,12 +9879,12 @@ public: ~EdgeTable() throw(); - void clipToRectangle (const Rectangle& r) throw(); - void excludeRectangle (const Rectangle& r) throw(); + void clipToRectangle (const Rectangle& r) throw(); + void excludeRectangle (const Rectangle& r) throw(); void clipToEdgeTable (const EdgeTable& other); void clipLineToMask (int x, int y, uint8* mask, int maskStride, int numPixels) throw(); bool isEmpty() throw(); - const Rectangle& getMaximumBounds() const throw() { return bounds; } + const Rectangle& getMaximumBounds() const throw() { return bounds; } void translate (float dx, int dy) throw(); void optimiseTable() throw(); @@ -9732,8 +9973,8 @@ public: private: // table line format: number of points; point0 x, point0 levelDelta, point1 x, point1 levelDelta, etc - HeapBlock table; - Rectangle bounds; + HeapBlock table; + Rectangle bounds; int maxEdgesPerLine, lineStrideElements; bool needToCheckEmptinesss; @@ -9763,12 +10004,9 @@ public: bool isEmpty() const throw(); - void getBounds (float& x, float& y, - float& w, float& h) const throw(); + const Rectangle getBounds() const throw(); - void getBoundsTransformed (const AffineTransform& transform, - float& x, float& y, - float& w, float& h) const throw(); + const Rectangle getBoundsTransformed (const AffineTransform& transform) const throw(); bool contains (const float x, const float y, @@ -9800,12 +10038,12 @@ public: const float endPointX, const float endPointY) throw(); - const Point getCurrentPosition() const; + const Point getCurrentPosition() const; void addRectangle (const float x, const float y, const float w, const float h) throw(); - void addRectangle (const Rectangle& rectangle) throw(); + void addRectangle (const Rectangle& rectangle) throw(); void addRoundedRectangle (const float x, const float y, const float w, const float h, @@ -10267,8 +10505,8 @@ public: const float endX, const float endY) throw(); - Line (const Point& start, - const Point& end) throw(); + Line (const Point& start, + const Point& end) throw(); const Line& operator= (const Line& other) throw(); @@ -10282,9 +10520,9 @@ public: inline float getEndY() const throw() { return endY; } - const Point getStart() const throw(); + const Point getStart() const throw(); - const Point getEnd() const throw(); + const Point getEnd() const throw(); void setStart (const float newStartX, const float newStartY) throw(); @@ -10292,9 +10530,9 @@ public: void setEnd (const float newEndX, const float newEndY) throw(); - void setStart (const Point& newStart) throw(); + void setStart (const Point& newStart) throw(); - void setEnd (const Point& newEnd) throw(); + void setEnd (const Point& newEnd) throw(); void applyTransform (const AffineTransform& transform) throw(); @@ -10314,12 +10552,12 @@ public: float& intersectionX, float& intersectionY) const throw(); - const Point getPointAlongLine (const float distanceFromStart) const throw(); + const Point getPointAlongLine (const float distanceFromStart) const throw(); - const Point getPointAlongLine (const float distanceFromStart, - const float perpendicularDistance) const throw(); + const Point getPointAlongLine (const float distanceFromStart, + const float perpendicularDistance) const throw(); - const Point getPointAlongLineProportionally (const float proportionOfLength) const throw(); + const Point getPointAlongLineProportionally (const float proportionOfLength) const throw(); float getDistanceFromLine (const float x, const float y) const throw(); @@ -11237,7 +11475,7 @@ public: int width, int height) const throw(); - void fillRect (const Rectangle& rectangle) const throw(); + void fillRect (const Rectangle& rectangle) const throw(); void fillRect (const float x, const float y, @@ -11250,7 +11488,7 @@ public: const float height, const float cornerSize) const throw(); - void fillRoundedRectangle (const Rectangle& rectangle, + void fillRoundedRectangle (const Rectangle& rectangle, const float cornerSize) const throw(); void fillCheckerBoard (int x, int y, @@ -11272,7 +11510,7 @@ public: const float height, const float lineThickness = 1.0f) const throw(); - void drawRect (const Rectangle& rectangle, + void drawRect (const Rectangle& rectangle, const int lineThickness = 1) const throw(); void drawRoundedRectangle (const float x, @@ -11282,7 +11520,7 @@ public: const float cornerSize, const float lineThickness) const throw(); - void drawRoundedRectangle (const Rectangle& rectangle, + void drawRoundedRectangle (const Rectangle& rectangle, const float cornerSize, const float lineThickness) const throw(); @@ -11378,7 +11616,7 @@ public: const bool fillAlphaChannelWithCurrentBrush = false) const throw(); void drawImageTransformed (const Image* const imageToDraw, - const Rectangle& imageSubRegion, + const Rectangle& imageSubRegion, const AffineTransform& transform, const bool fillAlphaChannelWithCurrentBrush = false) const throw(); @@ -11390,7 +11628,7 @@ public: const RectanglePlacement& placementWithinTarget, const bool fillAlphaChannelWithCurrentBrush = false) const throw(); - const Rectangle getClipBounds() const throw(); + const Rectangle getClipBounds() const throw(); bool clipRegionIntersects (const int x, const int y, const int width, const int height) const throw(); @@ -11401,7 +11639,7 @@ public: bool reduceClipRegion (const Path& path, const AffineTransform& transform = AffineTransform::identity) throw(); - bool reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, + bool reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, const AffineTransform& transform) throw(); void excludeClipRegion (const int x, const int y, @@ -11467,7 +11705,7 @@ public: RectangleList (const RectangleList& other) throw(); - RectangleList (const Rectangle& rect) throw(); + RectangleList (const Rectangle& rect) throw(); const RectangleList& operator= (const RectangleList& other) throw(); @@ -11477,40 +11715,40 @@ public: int getNumRectangles() const throw() { return rects.size(); } - const Rectangle getRectangle (const int index) const throw(); + const Rectangle getRectangle (const int index) const throw(); void clear() throw(); void add (const int x, const int y, const int w, const int h) throw(); - void add (const Rectangle& rect) throw(); + void add (const Rectangle& rect) throw(); - void addWithoutMerging (const Rectangle& rect) throw(); + void addWithoutMerging (const Rectangle& rect) throw(); void add (const RectangleList& other) throw(); - void subtract (const Rectangle& rect) throw(); + void subtract (const Rectangle& rect) throw(); void subtract (const RectangleList& otherList) throw(); - bool clipTo (const Rectangle& rect) throw(); + bool clipTo (const Rectangle& rect) throw(); bool clipTo (const RectangleList& other) throw(); - bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw(); + bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw(); void swapWith (RectangleList& otherList) throw(); bool containsPoint (const int x, const int y) const throw(); - bool containsRectangle (const Rectangle& rectangleToCheck) const throw(); + bool containsRectangle (const Rectangle& rectangleToCheck) const throw(); - bool intersectsRectangle (const Rectangle& rectangleToCheck) const throw(); + bool intersectsRectangle (const Rectangle& rectangleToCheck) const throw(); bool intersects (const RectangleList& other) const throw(); - const Rectangle getBounds() const throw(); + const Rectangle getBounds() const throw(); void consolidate() throw(); @@ -11527,12 +11765,12 @@ public: bool next() throw(); - const Rectangle* getRectangle() const throw() { return current; } + const Rectangle* getRectangle() const throw() { return current; } juce_UseDebuggingNewOperator private: - const Rectangle* current; + const Rectangle* current; const RectangleList& owner; int index; @@ -11544,7 +11782,7 @@ public: private: friend class Iterator; - Array rects; + Array > rects; }; #endif // __JUCE_RECTANGLELIST_JUCEHEADER__ @@ -11591,13 +11829,13 @@ public: void setRight (const int newRightGap) throw(); - const Rectangle subtractedFrom (const Rectangle& original) const throw(); + const Rectangle subtractedFrom (const Rectangle& original) const throw(); - void subtractFrom (Rectangle& rectangle) const throw(); + void subtractFrom (Rectangle& rectangle) const throw(); - const Rectangle addedTo (const Rectangle& original) const throw(); + const Rectangle addedTo (const Rectangle& original) const throw(); - void addTo (Rectangle& original) const throw(); + void addTo (Rectangle& original) const throw(); bool operator== (const BorderSize& other) const throw(); bool operator!= (const BorderSize& other) const throw(); @@ -11694,9 +11932,9 @@ public: virtual bool isFullScreen() const = 0; - void setNonFullScreenBounds (const Rectangle& newBounds) throw(); + void setNonFullScreenBounds (const Rectangle& newBounds) throw(); - const Rectangle& getNonFullScreenBounds() const throw(); + const Rectangle& getNonFullScreenBounds() const throw(); virtual void setIcon (const Image& newIcon) = 0; @@ -11782,7 +12020,7 @@ protected: Component* const component; const int styleFlags; RectangleList maskedRegion; - Rectangle lastNonFullscreenBounds; + Rectangle lastNonFullscreenBounds; uint32 lastPaintTime; ComponentBoundsConstrainer* constrainer; @@ -11874,9 +12112,11 @@ public: int getRight() const throw() { return bounds_.getRight(); } + const Point getPosition() const throw() { return bounds_.getPosition(); } + int getBottom() const throw() { return bounds_.getBottom(); } - const Rectangle& getBounds() const throw() { return bounds_; } + const Rectangle& getBounds() const throw() { return bounds_; } void getVisibleArea (RectangleList& result, const bool includeSiblings) const; @@ -11900,7 +12140,7 @@ public: void setBounds (int x, int y, int width, int height); - void setBounds (const Rectangle& newBounds); + void setBounds (const Rectangle& newBounds); void setBoundsRelative (const float proportionalX, const float proportionalY, const float proportionalWidth, const float proportionalHeight); @@ -11925,7 +12165,7 @@ public: int getParentHeight() const throw(); - const Rectangle getParentMonitorArea() const throw(); + const Rectangle getParentMonitorArea() const throw(); int getNumChildComponents() const throw(); @@ -11996,7 +12236,7 @@ public: void setBufferedToImage (const bool shouldBeBuffered) throw(); - Image* createComponentSnapshot (const Rectangle& areaToGrab, + Image* createComponentSnapshot (const Rectangle& areaToGrab, const bool clipImageToComponentBounds = true); void paintEntireComponent (Graphics& context); @@ -12199,7 +12439,7 @@ private: String componentName_; Component* parentComponent_; uint32 componentUID; - Rectangle bounds_; + Rectangle bounds_; int numDeepMouseListeners; Array childComponentList_; LookAndFeel* lookAndFeel_; @@ -12269,13 +12509,13 @@ private: static void bringModalComponentToFront(); void subtractObscuredRegions (RectangleList& result, const int deltaX, const int deltaY, - const Rectangle& clipRect, + const Rectangle& clipRect, const Component* const compToAvoid) const throw(); - void clipObscuredRegions (Graphics& g, const Rectangle& clipRect, + void clipObscuredRegions (Graphics& g, const Rectangle& clipRect, const int deltaX, const int deltaY) const throw(); // how much of the component is not off the edges of its parents - const Rectangle getUnclippedArea() const; + const Rectangle getUnclippedArea() const; void sendVisibilityChangeMessage(); // This is included here just to cause a compile error if your code is still handling @@ -12657,9 +12897,9 @@ public: const RectangleList getAllMonitorDisplayAreas (const bool clippedToWorkArea = true) const throw(); - const Rectangle getMainMonitorArea (const bool clippedToWorkArea = true) const throw(); + const Rectangle getMainMonitorArea (const bool clippedToWorkArea = true) const throw(); - const Rectangle getMonitorAreaContaining (int x, int y, const bool clippedToWorkArea = true) const throw(); + const Rectangle getMonitorAreaContaining (int x, int y, const bool clippedToWorkArea = true) const throw(); static void getMousePosition (int& x, int& y) throw(); @@ -12713,14 +12953,14 @@ private: Desktop() throw(); ~Desktop() throw(); - Array monitorCoordsClipped, monitorCoordsUnclipped; + Array > monitorCoordsClipped, monitorCoordsUnclipped; int lastFakeMouseMoveX, lastFakeMouseMoveY, mouseClickCounter; bool mouseMovedSignificantlySincePressed; struct RecentMouseDown { - int x, y; + Point position; int64 time; Component* component; }; @@ -12728,20 +12968,20 @@ private: RecentMouseDown mouseDowns[4]; void incrementMouseClickCounter() throw(); - void registerMouseDown (int x, int y, int64 time, Component* component) throw(); - void registerMouseDrag (int x, int y) throw(); + void registerMouseDown (const Point& position, int64 time, Component* component) throw(); + void registerMouseDrag (const Point& position) throw(); const Time getLastMouseDownTime() const throw(); int getNumberOfMultipleClicks() const throw(); Component* kioskModeComponent; - Rectangle kioskComponentOriginalBounds; + Rectangle kioskComponentOriginalBounds; void timerCallback(); void sendMouseMove(); void resetTimer() throw(); int getNumDisplayMonitors() const throw(); - const Rectangle getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw(); + const Rectangle getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw(); void addDesktopComponent (Component* const c) throw(); void removeDesktopComponent (Component* const c) throw(); @@ -15980,7 +16220,7 @@ public: void scrollEditorToPositionCaret (const int desiredCaretX, const int desiredCaretY); - const Rectangle getCaretRectangle(); + const Rectangle getCaretRectangle(); void setHighlightedRegion (int startIndex, int numberOfCharactersToHighlight); @@ -17935,8 +18175,8 @@ public: int getInsertionIndexForPosition (const int x, const int y) const throw(); - const Rectangle getRowPosition (const int rowNumber, - const bool relativeToComponentTopLeft) const throw(); + const Rectangle getRowPosition (const int rowNumber, + const bool relativeToComponentTopLeft) const throw(); Component* getComponentForRowNumber (const int rowNumber) const throw(); @@ -19289,7 +19529,7 @@ public: virtual void render (const RenderingContext& context) const = 0; - virtual void getBounds (float& x, float& y, float& width, float& height) const = 0; + virtual const Rectangle getBounds() const = 0; virtual bool hitTest (float x, float y) const = 0; @@ -19665,7 +19905,7 @@ public: Component* sourceComponent, Image* dragImage = 0, const bool allowDraggingToOtherJuceWindows = false, - const Point* imageOffsetFromMouse = 0); + const Point* imageOffsetFromMouse = 0); bool isDragAndDropActive() const; @@ -19708,7 +19948,7 @@ public: ~ComponentAnimator(); void animateComponent (Component* const component, - const Rectangle& finalPosition, + const Rectangle& finalPosition, const int millisecondsToSpendMoving, const double startSpeed = 1.0, const double endSpeed = 1.0); @@ -19718,7 +19958,7 @@ public: void cancelAllAnimations (const bool moveComponentsToTheirFinalPositions); - const Rectangle getComponentDestination (Component* const component); + const Rectangle getComponentDestination (Component* const component); bool isAnimating (Component* component) const; @@ -19884,7 +20124,7 @@ public: virtual void setStyle (const Toolbar::ToolbarItemStyle& newStyle); - const Rectangle getContentArea() const throw() { return contentArea; } + const Rectangle getContentArea() const throw() { return contentArea; } virtual bool getToolbarItemSizes (int toolbarThickness, bool isToolbarVertical, @@ -19896,7 +20136,7 @@ public: int width, int height, bool isMouseOver, bool isMouseDown) = 0; - virtual void contentAreaChanged (const Rectangle& newBounds) = 0; + virtual void contentAreaChanged (const Rectangle& newBounds) = 0; enum ToolbarEditingMode { @@ -19925,7 +20165,7 @@ private: ScopedPointer overlayComp; int dragOffsetX, dragOffsetY; bool isActive, isBeingDragged, isBeingUsedAsAButton; - Rectangle contentArea; + Rectangle contentArea; ToolbarItemComponent (const ToolbarItemComponent&); const ToolbarItemComponent& operator= (const ToolbarItemComponent&); @@ -19948,7 +20188,7 @@ public: bool getToolbarItemSizes (int toolbarDepth, bool isToolbarVertical, int& preferredSize, int& minSize, int& maxSize); void paintButtonArea (Graphics& g, int width, int height, bool isMouseOver, bool isMouseDown); - void contentAreaChanged (const Rectangle& newBounds); + void contentAreaChanged (const Rectangle& newBounds); juce_UseDebuggingNewOperator @@ -20200,7 +20440,7 @@ public: void moveCaretTo (const CodeDocument::Position& newPos, const bool selecting); - const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const throw(); + const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const throw(); const CodeDocument::Position getPositionAt (int x, int y); @@ -20718,7 +20958,7 @@ private: int sliderRegionStart, sliderRegionSize; int sliderBeingDragged; int pixelsForFullDragExtent; - Rectangle sliderRect; + Rectangle sliderRect; String textSuffix; SliderStyle style; @@ -20853,7 +21093,7 @@ public: int getColumnIdOfIndex (int index, const bool onlyCountVisibleColumns) const; - const Rectangle getColumnPosition (const int index) const; + const Rectangle getColumnPosition (const int index) const; int getColumnIdAtX (const int xToFind) const; @@ -21013,9 +21253,9 @@ public: bool isAutoSizeMenuOptionShown() const; - const Rectangle getCellPosition (const int columnId, - const int rowNumber, - const bool relativeToComponentTopLeft) const; + const Rectangle getCellPosition (const int columnId, + const int rowNumber, + const bool relativeToComponentTopLeft) const; void scrollToEnsureColumnIsOnscreen (const int columnId); @@ -21195,7 +21435,7 @@ public: void setSelected (const bool shouldBeSelected, const bool deselectOtherItemsFirst); - const Rectangle getItemPosition (const bool relativeToTreeViewTopLeft) const throw(); + const Rectangle getItemPosition (const bool relativeToTreeViewTopLeft) const throw(); void treeHasChanged() const throw(); @@ -21480,7 +21720,7 @@ public: int getHeight() const throw() { return imageHeight; } - const Rectangle getBounds() const throw() { return Rectangle (0, 0, imageWidth, imageHeight); } + const Rectangle getBounds() const throw() { return Rectangle (0, 0, imageWidth, imageHeight); } PixelFormat getFormat() const throw() { return format; } @@ -22084,8 +22324,8 @@ public: double getFixedAspectRatio() const throw(); virtual void checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& previousBounds, - const Rectangle& limits, + const Rectangle& previousBounds, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, @@ -22314,7 +22554,7 @@ private: ScopedPointer contentComponent; bool resizeToFitContent, fullscreen; ComponentDragger dragger; - Rectangle lastNonFullScreenPos; + Rectangle lastNonFullScreenPos; ComponentBoundsConstrainer defaultConstrainer; ComponentBoundsConstrainer* constrainer; #ifdef JUCE_DEBUG @@ -23553,7 +23793,7 @@ public: void activeWindowStatusChanged(); int getDesktopWindowStyleFlags() const; void parentHierarchyChanged(); - const Rectangle getTitleBarArea(); + const Rectangle getTitleBarArea(); juce_UseDebuggingNewOperator @@ -24042,7 +24282,7 @@ private: AlertIconType alertIconType; ComponentBoundsConstrainer constrainer; ComponentDragger dragger; - Rectangle textArea; + Rectangle textArea; VoidArray buttons, textBoxes, comboBoxes; VoidArray progressBars, customComps, textBlocks, allComps; StringArray textboxNames, comboBoxNames; @@ -24148,7 +24388,7 @@ public: virtual void drawAlertBox (Graphics& g, AlertWindow& alert, - const Rectangle& textArea, + const Rectangle& textArea, TextLayout& textLayout); virtual int getAlertBoxWindowFlags(); @@ -24481,7 +24721,7 @@ public: virtual void drawPropertyComponentLabel (Graphics& g, int width, int height, PropertyComponent& component); - virtual const Rectangle getPropertyComponentContentPosition (PropertyComponent& component); + virtual const Rectangle getPropertyComponentContentPosition (PropertyComponent& component); virtual void drawLevelMeter (Graphics& g, int width, int height, float level); @@ -25354,7 +25594,7 @@ private: ActiveXControlComponent (const ActiveXControlComponent&); const ActiveXControlComponent& operator= (const ActiveXControlComponent&); - void setControlBounds (const Rectangle& bounds) const; + void setControlBounds (const Rectangle& bounds) const; void setControlVisible (const bool b) const; }; @@ -25452,7 +25692,7 @@ public: void setPosition (const int arrowTipX, const int arrowTipY); - void setPosition (const Rectangle& rectangleToPointTo); + void setPosition (const Rectangle& rectangleToPointTo); protected: @@ -25467,7 +25707,7 @@ public: juce_UseDebuggingNewOperator private: - Rectangle content; + Rectangle content; int side, allowablePlacements; float arrowTipX, arrowTipY; DropShadowEffect shadow; @@ -26124,7 +26364,7 @@ public: void getMovieNormalSize (int& width, int& height) const; - void setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, + void setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, const RectanglePlacement& placement); void play(); @@ -26471,14 +26711,14 @@ public: virtual void setOrigin (int x, int y) = 0; - virtual bool clipToRectangle (const Rectangle& r) = 0; + virtual bool clipToRectangle (const Rectangle& r) = 0; virtual bool clipToRectangleList (const RectangleList& clipRegion) = 0; - virtual void excludeClipRectangle (const Rectangle& r) = 0; + virtual void excludeClipRectangle (const Rectangle& r) = 0; virtual void clipToPath (const Path& path, const AffineTransform& transform) = 0; - virtual void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) = 0; + virtual void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) = 0; - virtual bool clipRegionIntersects (const Rectangle& r) = 0; - virtual const Rectangle getClipBounds() const = 0; + virtual bool clipRegionIntersects (const Rectangle& r) = 0; + virtual const Rectangle getClipBounds() const = 0; virtual bool isClipEmpty() const = 0; virtual void saveState() = 0; @@ -26488,10 +26728,10 @@ public: virtual void setOpacity (float newOpacity) = 0; virtual void setInterpolationQuality (Graphics::ResamplingQuality quality) = 0; - virtual void fillRect (const Rectangle& r, const bool replaceExistingContents) = 0; + virtual void fillRect (const Rectangle& r, const bool replaceExistingContents) = 0; virtual void fillPath (const Path& path, const AffineTransform& transform) = 0; - virtual void drawImage (const Image& sourceImage, const Rectangle& srcClip, + virtual void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles) = 0; virtual void drawLine (double x1, double y1, double x2, double y2) = 0; @@ -26527,27 +26767,27 @@ public: bool isVectorDevice() const; void setOrigin (int x, int y); - bool clipToRectangle (const Rectangle& r); + bool clipToRectangle (const Rectangle& r); bool clipToRectangleList (const RectangleList& clipRegion); - void excludeClipRectangle (const Rectangle& r); + void excludeClipRectangle (const Rectangle& r); void clipToPath (const Path& path, const AffineTransform& transform); - void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); + void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); void saveState(); void restoreState(); - bool clipRegionIntersects (const Rectangle& r); - const Rectangle getClipBounds() const; + bool clipRegionIntersects (const Rectangle& r); + const Rectangle getClipBounds() const; bool isClipEmpty() const; void setFill (const FillType& fillType); void setOpacity (float opacity); void setInterpolationQuality (Graphics::ResamplingQuality quality); - void fillRect (const Rectangle& r, const bool replaceExistingContents); + void fillRect (const Rectangle& r, const bool replaceExistingContents); void fillPath (const Path& path, const AffineTransform& transform); - void drawImage (const Image& sourceImage, const Rectangle& srcClip, + void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles); void drawLine (double x1, double y1, double x2, double y2); @@ -26618,14 +26858,14 @@ public: void setOrigin (int x, int y); - bool clipToRectangle (const Rectangle& r); + bool clipToRectangle (const Rectangle& r); bool clipToRectangleList (const RectangleList& clipRegion); - void excludeClipRectangle (const Rectangle& r); + void excludeClipRectangle (const Rectangle& r); void clipToPath (const Path& path, const AffineTransform& transform); - void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); + void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); - bool clipRegionIntersects (const Rectangle& r); - const Rectangle getClipBounds() const; + bool clipRegionIntersects (const Rectangle& r); + const Rectangle getClipBounds() const; bool isClipEmpty() const; void saveState(); @@ -26635,10 +26875,10 @@ public: void setOpacity (float opacity); void setInterpolationQuality (Graphics::ResamplingQuality quality); - void fillRect (const Rectangle& r, const bool replaceExistingContents); + void fillRect (const Rectangle& r, const bool replaceExistingContents); void fillPath (const Path& path, const AffineTransform& transform); - void drawImage (const Image& sourceImage, const Rectangle& srcClip, + void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles); void drawLine (double x1, double y1, double x2, double y2); @@ -26707,7 +26947,7 @@ public: void bringToFront (const int index); void render (const Drawable::RenderingContext& context) const; - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; ValueTree createValueTree() const throw(); @@ -26759,7 +26999,7 @@ public: const Colour& getOverlayColour() const throw() { return overlayColour; } void render (const Drawable::RenderingContext& context) const; - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; ValueTree createValueTree() const throw(); @@ -26814,7 +27054,7 @@ public: const PathStrokeType& getStrokeType() const throw() { return strokeType; } void render (const Drawable::RenderingContext& context) const; - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; ValueTree createValueTree() const throw(); @@ -26862,7 +27102,7 @@ public: const Colour& getColour() const throw() { return colour; } void render (const Drawable::RenderingContext& context) const; - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; bool hitTest (float x, float y) const; Drawable* createCopy() const; ValueTree createValueTree() const throw(); @@ -27050,9 +27290,9 @@ public: const String toString() const throw(); - const Rectangle getRectangle (const Rectangle& targetSpaceToBeRelativeTo) const throw(); + const Rectangle getRectangle (const Rectangle& targetSpaceToBeRelativeTo) const throw(); - void getRectangleDouble (const Rectangle& targetSpaceToBeRelativeTo, + void getRectangleDouble (const Rectangle& targetSpaceToBeRelativeTo, double& x, double& y, double& width, @@ -27060,12 +27300,12 @@ public: void applyToComponent (Component& comp) const throw(); - void updateFrom (const Rectangle& newPosition, - const Rectangle& targetSpaceToBeRelativeTo) throw(); + void updateFrom (const Rectangle& newPosition, + const Rectangle& targetSpaceToBeRelativeTo) throw(); void updateFromDouble (const double x, const double y, const double width, const double height, - const Rectangle& targetSpaceToBeRelativeTo) throw(); + const Rectangle& targetSpaceToBeRelativeTo) throw(); void updateFromComponent (const Component& comp) throw(); @@ -27097,7 +27337,7 @@ public: const PositionMode yPositionMode, const SizeMode widthMode, const SizeMode heightMode, - const Rectangle& targetSpaceToBeRelativeTo) throw(); + const Rectangle& targetSpaceToBeRelativeTo) throw(); AnchorPoint getAnchorPointX() const throw(); diff --git a/src/audio/audio_file_formats/juce_AudioThumbnail.cpp b/src/audio/audio_file_formats/juce_AudioThumbnail.cpp index f380976abc..bd6dbd6afc 100644 --- a/src/audio/audio_file_formats/juce_AudioThumbnail.cpp +++ b/src/audio/audio_file_formats/juce_AudioThumbnail.cpp @@ -500,7 +500,7 @@ void AudioThumbnail::drawChannel (Graphics& g, const float midY = topY + h * 0.5f; const float vscale = verticalZoomFactor * h / 256.0f; - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); const int skipLeft = jlimit (0, w, clip.getX() - x); w -= skipLeft; x += skipLeft; diff --git a/src/audio/plugins/formats/juce_VSTPluginFormat.cpp b/src/audio/plugins/formats/juce_VSTPluginFormat.cpp index ac6731885d..8c5284a4e4 100644 --- a/src/audio/plugins/formats/juce_VSTPluginFormat.cpp +++ b/src/audio/plugins/formats/juce_VSTPluginFormat.cpp @@ -1296,7 +1296,7 @@ public: #if JUCE_LINUX if (pluginWindow != 0) { - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); XEvent ev; zerostruct (ev); diff --git a/src/gui/components/buttons/juce_DrawableButton.cpp b/src/gui/components/buttons/juce_DrawableButton.cpp index 71e2bca73c..bbd47e7cf0 100644 --- a/src/gui/components/buttons/juce_DrawableButton.cpp +++ b/src/gui/components/buttons/juce_DrawableButton.cpp @@ -140,7 +140,7 @@ void DrawableButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) { - Rectangle imageSpace; + Rectangle imageSpace; if (style == ImageOnButtonBackground) { diff --git a/src/gui/components/buttons/juce_ShapeButton.cpp b/src/gui/components/buttons/juce_ShapeButton.cpp index a384af57bb..2791c6e6bb 100644 --- a/src/gui/components/buttons/juce_ShapeButton.cpp +++ b/src/gui/components/buttons/juce_ShapeButton.cpp @@ -77,19 +77,15 @@ void ShapeButton::setShape (const Path& newShape, if (resizeNowToFitThisShape) { - float x, y, w, h; - shape.getBounds (x, y, w, h); - shape.applyTransform (AffineTransform::translation (-x, -y)); + Rectangle bounds (shape.getBounds()); if (hasShadow) - { - w += 4.0f; - h += 4.0f; - shape.applyTransform (AffineTransform::translation (2.0f, 2.0f)); - } + bounds.expand (4.0f, 4.0f); - setSize (1 + (int) (w + outlineWidth), - 1 + (int) (h + outlineWidth)); + shape.applyTransform (AffineTransform::translation (-bounds.getX(), -bounds.getY())); + + setSize (1 + (int) (bounds.getWidth() + outlineWidth), + 1 + (int) (bounds.getHeight() + outlineWidth)); } } diff --git a/src/gui/components/buttons/juce_ToolbarButton.cpp b/src/gui/components/buttons/juce_ToolbarButton.cpp index 6118517618..55d6b128cf 100644 --- a/src/gui/components/buttons/juce_ToolbarButton.cpp +++ b/src/gui/components/buttons/juce_ToolbarButton.cpp @@ -83,7 +83,7 @@ void ToolbarButton::paintButtonArea (Graphics& g, } } -void ToolbarButton::contentAreaChanged (const Rectangle&) +void ToolbarButton::contentAreaChanged (const Rectangle&) { } diff --git a/src/gui/components/buttons/juce_ToolbarButton.h b/src/gui/components/buttons/juce_ToolbarButton.h index 8441c5616f..a2dd73cfb7 100644 --- a/src/gui/components/buttons/juce_ToolbarButton.h +++ b/src/gui/components/buttons/juce_ToolbarButton.h @@ -76,7 +76,7 @@ public: /** @internal */ void paintButtonArea (Graphics& g, int width, int height, bool isMouseOver, bool isMouseDown); /** @internal */ - void contentAreaChanged (const Rectangle& newBounds); + void contentAreaChanged (const Rectangle& newBounds); juce_UseDebuggingNewOperator diff --git a/src/gui/components/code_editor/juce_CodeDocument.cpp b/src/gui/components/code_editor/juce_CodeDocument.cpp index d655a84815..086061b9b8 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.cpp +++ b/src/gui/components/code_editor/juce_CodeDocument.cpp @@ -547,7 +547,7 @@ bool CodeDocument::writeToStream (OutputStream& stream) String temp (lines.getUnchecked(i)->line); // use a copy to avoid bloating the memory footprint of the stored string. const char* utf8 = temp.toUTF8(); - if (! stream.write (utf8, strlen (utf8))) + if (! stream.write (utf8, (int) strlen (utf8))) return false; } diff --git a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp index aa75f63b5e..5fff6745df 100644 --- a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp +++ b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp @@ -63,7 +63,7 @@ public: startTimer (400); setVisible (true); - const Rectangle pos (owner.getCharacterBounds (owner.getCaretPos())); + const Rectangle pos (owner.getCharacterBounds (owner.getCaretPos())); setBounds (pos.getX(), pos.getY(), 2, pos.getHeight()); } }; @@ -388,7 +388,7 @@ void CodeEditorComponent::paint (Graphics& g) const Colour defaultColour (findColour (CodeEditorComponent::defaultTextColourId)); const Colour highlightColour (findColour (CodeEditorComponent::highlightColourId)); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); const int firstLineToDraw = jmax (0, clip.getY() / lineHeight); const int lastLineToDraw = jmin (lines.size(), clip.getBottom() / lineHeight + 1); @@ -592,12 +592,12 @@ void CodeEditorComponent::scrollToKeepCaretOnScreen() scrollToColumn (column); } -const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const throw() +const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const throw() { - return Rectangle (roundToInt ((gutter - xOffset * charWidth) + indexToColumn (pos.getLineNumber(), pos.getIndexInLine()) * charWidth), - (pos.getLineNumber() - firstLineOnScreen) * lineHeight, - roundToInt (charWidth), - lineHeight); + return Rectangle (roundToInt ((gutter - xOffset * charWidth) + indexToColumn (pos.getLineNumber(), pos.getIndexInLine()) * charWidth), + (pos.getLineNumber() - firstLineOnScreen) * lineHeight, + roundToInt (charWidth), + lineHeight); } const CodeDocument::Position CodeEditorComponent::getPositionAt (int x, int y) diff --git a/src/gui/components/code_editor/juce_CodeEditorComponent.h b/src/gui/components/code_editor/juce_CodeEditorComponent.h index a4e4d31dbe..449ffbd3fc 100644 --- a/src/gui/components/code_editor/juce_CodeEditorComponent.h +++ b/src/gui/components/code_editor/juce_CodeEditorComponent.h @@ -102,7 +102,7 @@ public: /** Returns the on-screen position of a character in the document. The rectangle returned is relative to this component's top-left origin. */ - const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const throw(); + const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const throw(); /** Finds the character at a given on-screen position. The co-ordinates are relative to this component's top-left origin. diff --git a/src/gui/components/controls/juce_ListBox.cpp b/src/gui/components/controls/juce_ListBox.cpp index c60c533cc9..97a3116683 100644 --- a/src/gui/components/controls/juce_ListBox.cpp +++ b/src/gui/components/controls/juce_ListBox.cpp @@ -654,8 +654,8 @@ int ListBox::getRowNumberOfComponent (Component* const rowComponent) const throw return viewport->getRowNumberOfComponent (rowComponent); } -const Rectangle ListBox::getRowPosition (const int rowNumber, - const bool relativeToComponentTopLeft) const throw() +const Rectangle ListBox::getRowPosition (const int rowNumber, + const bool relativeToComponentTopLeft) const throw() { const int rowHeight = getRowHeight(); int y = viewport->getY() + rowHeight * rowNumber; @@ -663,8 +663,8 @@ const Rectangle ListBox::getRowPosition (const int rowNumber, if (relativeToComponentTopLeft) y -= viewport->getViewPositionY(); - return Rectangle (viewport->getX(), y, - viewport->getViewedComponent()->getWidth(), rowHeight); + return Rectangle (viewport->getX(), y, + viewport->getViewedComponent()->getWidth(), rowHeight); } void ListBox::setVerticalPosition (const double proportion) @@ -882,13 +882,13 @@ void ListBox::setHeaderComponent (Component* const newHeaderComponent) void ListBox::repaintRow (const int rowNumber) throw() { - const Rectangle r (getRowPosition (rowNumber, true)); + const Rectangle r (getRowPosition (rowNumber, true)); repaint (r.getX(), r.getY(), r.getWidth(), r.getHeight()); } Image* ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) { - Rectangle imageArea; + Rectangle imageArea; const int firstRow = getRowContainingPosition (0, 0); int i; @@ -901,7 +901,7 @@ Image* ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) int x = 0, y = 0; rowComp->relativePositionToOtherComponent (this, x, y); - const Rectangle rowRect (x, y, rowComp->getWidth(), rowComp->getHeight()); + const Rectangle rowRect (x, y, rowComp->getWidth(), rowComp->getHeight()); if (imageArea.isEmpty()) imageArea = rowRect; @@ -910,7 +910,7 @@ Image* ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) } } - imageArea = imageArea.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); + imageArea = imageArea.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); imageX = imageArea.getX(); imageY = imageArea.getY(); Image* snapshot = Image::createNativeImage (Image::ARGB, imageArea.getWidth(), imageArea.getHeight(), true); @@ -946,7 +946,7 @@ void ListBox::startDragAndDrop (const MouseEvent& e, const String& dragDescripti dragImage->multiplyAllAlphas (0.6f); MouseEvent e2 (e.getEventRelativeTo (this)); - const Point p ((float) (x - e2.x), (float) (y - e2.y)); + const Point p (x - e2.x, y - e2.y); dragContainer->startDragging (dragDescription, this, dragImage, true, &p); } else diff --git a/src/gui/components/controls/juce_ListBox.h b/src/gui/components/controls/juce_ListBox.h index e9f4504005..171363c265 100644 --- a/src/gui/components/controls/juce_ListBox.h +++ b/src/gui/components/controls/juce_ListBox.h @@ -401,8 +401,8 @@ public: This may be off-screen, and the range of the row number that is passed-in is not checked to see if it's a valid row. */ - const Rectangle getRowPosition (const int rowNumber, - const bool relativeToComponentTopLeft) const throw(); + const Rectangle getRowPosition (const int rowNumber, + const bool relativeToComponentTopLeft) const throw(); /** Finds the row component for a given row in the list. diff --git a/src/gui/components/controls/juce_Slider.cpp b/src/gui/components/controls/juce_Slider.cpp index 40e6cd5fa6..8022c66b8c 100644 --- a/src/gui/components/controls/juce_Slider.cpp +++ b/src/gui/components/controls/juce_Slider.cpp @@ -938,7 +938,7 @@ void Slider::resized() if (style == IncDecButtons) { - Rectangle buttonRect (sliderRect); + Rectangle buttonRect (sliderRect); if (textBoxPos == TextBoxLeft || textBoxPos == TextBoxRight) buttonRect.expand (-2, 0); diff --git a/src/gui/components/controls/juce_Slider.h b/src/gui/components/controls/juce_Slider.h index 04919d5fb8..293b4b4d7d 100644 --- a/src/gui/components/controls/juce_Slider.h +++ b/src/gui/components/controls/juce_Slider.h @@ -763,7 +763,7 @@ private: int sliderRegionStart, sliderRegionSize; int sliderBeingDragged; int pixelsForFullDragExtent; - Rectangle sliderRect; + Rectangle sliderRect; String textSuffix; SliderStyle style; diff --git a/src/gui/components/controls/juce_TableHeaderComponent.cpp b/src/gui/components/controls/juce_TableHeaderComponent.cpp index b46d412423..f463b62bbc 100644 --- a/src/gui/components/controls/juce_TableHeaderComponent.cpp +++ b/src/gui/components/controls/juce_TableHeaderComponent.cpp @@ -253,7 +253,7 @@ int TableHeaderComponent::getColumnIdOfIndex (int index, const bool onlyCountVis return (ci != 0) ? ci->id : 0; } -const Rectangle TableHeaderComponent::getColumnPosition (const int index) const +const Rectangle TableHeaderComponent::getColumnPosition (const int index) const { int x = 0, width = 0, n = 0; @@ -274,7 +274,7 @@ const Rectangle TableHeaderComponent::getColumnPosition (const int index) const } } - return Rectangle (x, 0, width, getHeight()); + return Rectangle (x, 0, width, getHeight()); } int TableHeaderComponent::getColumnIdAtX (const int xToFind) const @@ -537,7 +537,7 @@ void TableHeaderComponent::paint (Graphics& g) lf.drawTableHeaderBackground (g, *this); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); int x = 0; for (int i = 0; i < columns.size(); ++i) @@ -646,7 +646,7 @@ void TableHeaderComponent::mouseDrag (const MouseEvent& e) if (columns.getUnchecked (i)->isVisible()) minWidthOnRight += columns.getUnchecked (i)->minimumWidth; - const Rectangle currentPos (getColumnPosition (getIndexOfColumnId (columnIdBeingResized, true))); + const Rectangle currentPos (getColumnPosition (getIndexOfColumnId (columnIdBeingResized, true))); w = jmax (ci->minimumWidth, jmin (w, getWidth() - minWidthOnRight - currentPos.getX())); } @@ -740,7 +740,7 @@ void TableHeaderComponent::beginDrag (const MouseEvent& e) { draggingColumnOriginalIndex = getIndexOfColumnId (columnIdBeingDragged, true); - const Rectangle columnRect (getColumnPosition (draggingColumnOriginalIndex)); + const Rectangle columnRect (getColumnPosition (draggingColumnOriginalIndex)); const int temp = columnIdBeingDragged; columnIdBeingDragged = 0; diff --git a/src/gui/components/controls/juce_TableHeaderComponent.h b/src/gui/components/controls/juce_TableHeaderComponent.h index 7c509c576f..35e0557272 100644 --- a/src/gui/components/controls/juce_TableHeaderComponent.h +++ b/src/gui/components/controls/juce_TableHeaderComponent.h @@ -276,7 +276,7 @@ public: ones are not counted). It returns a rectangle showing the position of the column relative to this component's top-left. If the index is out-of-range, an empty rectangle is retrurned. */ - const Rectangle getColumnPosition (const int index) const; + const Rectangle getColumnPosition (const int index) const; /** Finds the column ID at a given x-position in the component. diff --git a/src/gui/components/controls/juce_TableListBox.cpp b/src/gui/components/controls/juce_TableListBox.cpp index e9d8c883f9..a2ee85a057 100644 --- a/src/gui/components/controls/juce_TableListBox.cpp +++ b/src/gui/components/controls/juce_TableListBox.cpp @@ -71,7 +71,7 @@ public: if (! columnsWithComponents [i]) { const int columnId = header->getColumnIdOfIndex (i, true); - Rectangle columnRect (header->getColumnPosition (i)); + Rectangle columnRect (header->getColumnPosition (i)); columnRect.setSize (columnRect.getWidth(), getHeight()); g.saveState(); @@ -125,7 +125,7 @@ public: newComp->getProperties().set (tagPropertyName, newTag); newComp->getProperties().set (tableColumnPropertyTag, columnId); - const Rectangle columnRect (header->getColumnPosition (i)); + const Rectangle columnRect (header->getColumnPosition (i)); newComp->setBounds (columnRect.getX(), 0, columnRect.getWidth(), getHeight()); columnsWithComponents.setBit (i); @@ -158,7 +158,7 @@ public: if (columnId != 0) { - const Rectangle columnRect (owner.getHeader()->getColumnPosition (owner.getHeader()->getIndexOfColumnId (columnId, true))); + const Rectangle columnRect (owner.getHeader()->getColumnPosition (owner.getHeader()->getIndexOfColumnId (columnId, true))); c->setBounds (columnRect.getX(), 0, columnRect.getWidth(), getHeight()); } } @@ -380,19 +380,19 @@ bool TableListBox::isAutoSizeMenuOptionShown() const return autoSizeOptionsShown; } -const Rectangle TableListBox::getCellPosition (const int columnId, - const int rowNumber, - const bool relativeToComponentTopLeft) const +const Rectangle TableListBox::getCellPosition (const int columnId, + const int rowNumber, + const bool relativeToComponentTopLeft) const { - Rectangle headerCell (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); + Rectangle headerCell (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); if (relativeToComponentTopLeft) headerCell.translate (header->getX(), 0); - const Rectangle row (getRowPosition (rowNumber, relativeToComponentTopLeft)); + const Rectangle row (getRowPosition (rowNumber, relativeToComponentTopLeft)); - return Rectangle (headerCell.getX(), row.getY(), - headerCell.getWidth(), row.getHeight()); + return Rectangle (headerCell.getX(), row.getY(), + headerCell.getWidth(), row.getHeight()); } void TableListBox::scrollToEnsureColumnIsOnscreen (const int columnId) @@ -401,7 +401,7 @@ void TableListBox::scrollToEnsureColumnIsOnscreen (const int columnId) if (scrollbar != 0) { - const Rectangle pos (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); + const Rectangle pos (header->getColumnPosition (header->getIndexOfColumnId (columnId, true))); double x = scrollbar->getCurrentRangeStart(); const double w = scrollbar->getCurrentRangeSize(); diff --git a/src/gui/components/controls/juce_TableListBox.h b/src/gui/components/controls/juce_TableListBox.h index d3dcc1ab78..64c6aa9bf3 100644 --- a/src/gui/components/controls/juce_TableListBox.h +++ b/src/gui/components/controls/juce_TableListBox.h @@ -269,9 +269,9 @@ public: If relativeToComponentTopLeft is false, the co-ords are relative to the top-left of the table's top-left cell. */ - const Rectangle getCellPosition (const int columnId, - const int rowNumber, - const bool relativeToComponentTopLeft) const; + const Rectangle getCellPosition (const int columnId, + const int rowNumber, + const bool relativeToComponentTopLeft) const; /** Scrolls horizontally if necessary to make sure that a particular column is visible. diff --git a/src/gui/components/controls/juce_TextEditor.cpp b/src/gui/components/controls/juce_TextEditor.cpp index 8802084c78..6118115f6f 100644 --- a/src/gui/components/controls/juce_TextEditor.cpp +++ b/src/gui/components/controls/juce_TextEditor.cpp @@ -1414,13 +1414,13 @@ void TextEditor::scrollEditorToPositionCaret (const int desiredCaretX, viewport->setViewPosition (vx, vy); } -const Rectangle TextEditor::getCaretRectangle() +const Rectangle TextEditor::getCaretRectangle() { updateCaretPosition(); - return Rectangle (roundToInt (cursorX) - viewport->getX(), - roundToInt (cursorY) - viewport->getY(), - 1, roundToInt (cursorHeight)); + return Rectangle (roundToInt (cursorX) - viewport->getX(), + roundToInt (cursorY) - viewport->getY(), + 1, roundToInt (cursorHeight)); } //============================================================================== @@ -1677,7 +1677,7 @@ void TextEditor::drawContent (Graphics& g) if (wordWrapWidth > 0) { g.setOrigin (leftIndent, topIndent); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); Colour selectedTextColour; TextEditorIterator i (sections, wordWrapWidth, passwordCharacter); diff --git a/src/gui/components/controls/juce_TextEditor.h b/src/gui/components/controls/juce_TextEditor.h index acec66ef7a..aaf086f833 100644 --- a/src/gui/components/controls/juce_TextEditor.h +++ b/src/gui/components/controls/juce_TextEditor.h @@ -439,7 +439,7 @@ l */ The rectangle returned is relative to the component's top-left corner. @see scrollEditorToPositionCaret */ - const Rectangle getCaretRectangle(); + const Rectangle getCaretRectangle(); /** Selects a section of the text. */ diff --git a/src/gui/components/controls/juce_Toolbar.cpp b/src/gui/components/controls/juce_Toolbar.cpp index 183b2cf6dd..727b2bc340 100644 --- a/src/gui/components/controls/juce_Toolbar.cpp +++ b/src/gui/components/controls/juce_Toolbar.cpp @@ -84,7 +84,7 @@ public: { } - void contentAreaChanged (const Rectangle&) + void contentAreaChanged (const Rectangle&) { } @@ -544,7 +544,7 @@ void Toolbar::updateAllItemPositions (const bool animate) { const int size = (int) resizer.getItemSize (activeIndex++); - Rectangle newBounds; + Rectangle newBounds; if (vertical) newBounds.setBounds (0, pos, getWidth(), size); else @@ -644,12 +644,12 @@ void Toolbar::itemDragMove (const String&, Component* sourceComponent, int x, in const int dragObjectLeft = vertical ? (y - tc->dragOffsetY) : (x - tc->dragOffsetX); const int dragObjectRight = dragObjectLeft + (vertical ? tc->getHeight() : tc->getWidth()); - const Rectangle current (animator.getComponentDestination (getChildComponent (newIndex))); + const Rectangle current (animator.getComponentDestination (getChildComponent (newIndex))); ToolbarItemComponent* const prev = getNextActiveComponent (newIndex, -1); if (prev != 0) { - const Rectangle previousPos (animator.getComponentDestination (prev)); + const Rectangle previousPos (animator.getComponentDestination (prev)); if (abs (dragObjectLeft - (vertical ? previousPos.getY() : previousPos.getX()) < abs (dragObjectRight - (vertical ? current.getBottom() : current.getRight())))) @@ -661,7 +661,7 @@ void Toolbar::itemDragMove (const String&, Component* sourceComponent, int x, in ToolbarItemComponent* const next = getNextActiveComponent (newIndex, 1); if (next != 0) { - const Rectangle nextPos (animator.getComponentDestination (next)); + const Rectangle nextPos (animator.getComponentDestination (next)); if (abs (dragObjectLeft - (vertical ? current.getY() : current.getX()) > abs (dragObjectRight - (vertical ? nextPos.getBottom() : nextPos.getRight())))) @@ -749,7 +749,7 @@ public: void positionNearBar() { - const Rectangle screenSize (toolbar->getParentMonitorArea()); + const Rectangle screenSize (toolbar->getParentMonitorArea()); const int tbx = toolbar->getScreenX(); const int tby = toolbar->getScreenY(); const int gap = 8; diff --git a/src/gui/components/controls/juce_ToolbarItemComponent.cpp b/src/gui/components/controls/juce_ToolbarItemComponent.cpp index c603c32a52..79f9e5f67a 100644 --- a/src/gui/components/controls/juce_ToolbarItemComponent.cpp +++ b/src/gui/components/controls/juce_ToolbarItemComponent.cpp @@ -231,14 +231,14 @@ void ToolbarItemComponent::resized() const int indent = jmin (proportionOfWidth (0.08f), proportionOfHeight (0.08f)); - contentArea = Rectangle (indent, indent, - getWidth() - indent * 2, - toolbarStyle == Toolbar::iconsWithText ? proportionOfHeight (0.55f) - : (getHeight() - indent * 2)); + contentArea = Rectangle (indent, indent, + getWidth() - indent * 2, + toolbarStyle == Toolbar::iconsWithText ? proportionOfHeight (0.55f) + : (getHeight() - indent * 2)); } else { - contentArea = Rectangle(); + contentArea = Rectangle(); } contentAreaChanged (contentArea); diff --git a/src/gui/components/controls/juce_ToolbarItemComponent.h b/src/gui/components/controls/juce_ToolbarItemComponent.h index 4d3db438f9..07a5ccc8e3 100644 --- a/src/gui/components/controls/juce_ToolbarItemComponent.h +++ b/src/gui/components/controls/juce_ToolbarItemComponent.h @@ -110,7 +110,7 @@ public: @see contentAreaChanged */ - const Rectangle getContentArea() const throw() { return contentArea; } + const Rectangle getContentArea() const throw() { return contentArea; } //============================================================================== /** This method must return the size criteria for this item, based on a given toolbar @@ -155,7 +155,7 @@ public: See getContentArea() for a description of what the area is. */ - virtual void contentAreaChanged (const Rectangle& newBounds) = 0; + virtual void contentAreaChanged (const Rectangle& newBounds) = 0; //============================================================================== @@ -203,7 +203,7 @@ private: ScopedPointer overlayComp; int dragOffsetX, dragOffsetY; bool isActive, isBeingDragged, isBeingUsedAsAButton; - Rectangle contentArea; + Rectangle contentArea; ToolbarItemComponent (const ToolbarItemComponent&); const ToolbarItemComponent& operator= (const ToolbarItemComponent&); diff --git a/src/gui/components/controls/juce_TreeView.cpp b/src/gui/components/controls/juce_TreeView.cpp index cf9e0aa024..d1f12a15e7 100644 --- a/src/gui/components/controls/juce_TreeView.cpp +++ b/src/gui/components/controls/juce_TreeView.cpp @@ -58,7 +58,7 @@ public: isDragging = false; needSelectionOnMouseUp = false; - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.y, pos); if (item == 0) @@ -98,7 +98,7 @@ public: if (needSelectionOnMouseUp && e.mouseWasClicked()) { - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.y, pos); if (item != 0) @@ -110,7 +110,7 @@ public: { if (e.getNumberOfClicks() != 3) // ignore triple clicks { - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.y, pos); if (item != 0 && (e.x >= pos.getX() || ! owner->openCloseButtonsVisible)) @@ -132,7 +132,7 @@ public: { isDragging = true; - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (e.getMouseDownY(), pos); if (item != 0 && e.getMouseDownX() >= pos.getX()) @@ -150,7 +150,7 @@ public: Image* dragImage = Component::createComponentSnapshot (pos, true); dragImage->multiplyAllAlphas (0.6f); - Point imageOffset ((float) (pos.getX() - e.x), (float) (pos.getY() - e.y)); + Point imageOffset (pos.getX() - e.x, pos.getY() - e.y); dragContainer->startDragging (dragDescription, owner, dragImage, true, &imageOffset); } else @@ -175,7 +175,7 @@ public: } void paint (Graphics& g); - TreeViewItem* findItemAt (int y, Rectangle& itemPosition) const; + TreeViewItem* findItemAt (int y, Rectangle& itemPosition) const; void updateComponents() { @@ -228,7 +228,7 @@ public: { const TreeViewItem* const item = (TreeViewItem*) rowComponentItems.getUnchecked(i); - Rectangle pos (item->getItemPosition (false)); + Rectangle pos (item->getItemPosition (false)); pos.setSize (pos.getWidth(), item->itemHeight); if (pos.getBottom() >= visibleTop && pos.getY() < visibleBottom) @@ -264,7 +264,7 @@ public: if (owner->openCloseButtonsVisible) { - Rectangle pos; + Rectangle pos; TreeViewItem* item = findItemAt (e.y, pos); if (item != 0 && e.x < pos.getX() && e.x >= pos.getX() - owner->getIndentSize()) @@ -280,7 +280,7 @@ public: { if (buttonUnderMouse != 0 && containsItem (buttonUnderMouse)) { - const Rectangle r (buttonUnderMouse->getItemPosition (false)); + const Rectangle r (buttonUnderMouse->getItemPosition (false)); repaint (0, r.getY(), r.getX(), buttonUnderMouse->getItemHeight()); } @@ -288,7 +288,7 @@ public: if (buttonUnderMouse != 0) { - const Rectangle r (buttonUnderMouse->getItemPosition (false)); + const Rectangle r (buttonUnderMouse->getItemPosition (false)); repaint (0, r.getY(), r.getX(), buttonUnderMouse->getItemHeight()); } } @@ -308,7 +308,7 @@ public: { int x, y; getMouseXYRelative (x, y); - Rectangle pos; + Rectangle pos; TreeViewItem* const item = findItemAt (y, pos); @@ -559,7 +559,7 @@ TreeViewItem* TreeView::getItemAt (int y) const throw() TreeViewContentComponent* const tc = (TreeViewContentComponent*) viewport->getViewedComponent(); int x; relativePositionToOtherComponent (tc, x, y); - Rectangle pos; + Rectangle pos; return tc->findItemAt (y, pos); } @@ -852,7 +852,7 @@ public: void setTargetPosition (TreeViewItem* const item) throw() { - Rectangle r (item->getItemPosition (true)); + Rectangle r (item->getItemPosition (true)); r.setHeight (item->getItemHeight()); setBounds (r); } @@ -898,7 +898,7 @@ TreeViewItem* TreeView::getInsertPosition (int& x, int& y, int& insertIndex, if (item == 0) return 0; - Rectangle itemPos (item->getItemPosition (true)); + Rectangle itemPos (item->getItemPosition (true)); insertIndex = item->getIndexInParent(); const int oldY = y; y = itemPos.getY(); @@ -1055,7 +1055,7 @@ void TreeViewContentComponent::paint (Graphics& g) } } -TreeViewItem* TreeViewContentComponent::findItemAt (int y, Rectangle& itemPosition) const +TreeViewItem* TreeViewContentComponent::findItemAt (int y, Rectangle& itemPosition) const { if (owner->rootItem != 0) { @@ -1290,7 +1290,7 @@ void TreeViewItem::itemDropped (const String& /*sourceDescription*/, Component* { } -const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopLeft) const throw() +const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopLeft) const throw() { const int indentX = getIndentX(); @@ -1299,7 +1299,7 @@ const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopL if (ownerView != 0 && width < 0) width = ownerView->viewport->getViewWidth() - indentX; - Rectangle r (indentX, y, jmax (0, width), totalHeight); + Rectangle r (indentX, y, jmax (0, width), totalHeight); if (relativeToTreeViewTopLeft) r.setPosition (r.getX() - ownerView->viewport->getViewPositionX(), @@ -1318,7 +1318,7 @@ void TreeViewItem::repaintItem() const { if (ownerView != 0 && areAllParentsOpen()) { - const Rectangle r (getItemPosition (true)); + const Rectangle r (getItemPosition (true)); ownerView->viewport->repaint (0, r.getY(), r.getRight(), r.getHeight()); } } @@ -1485,7 +1485,7 @@ void TreeViewItem::paintRecursively (Graphics& g, int width) if (isOpen()) { - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); for (int i = 0; i < subItems.size(); ++i) { diff --git a/src/gui/components/controls/juce_TreeView.h b/src/gui/components/controls/juce_TreeView.h index ee801f65c3..44b4010bac 100644 --- a/src/gui/components/controls/juce_TreeView.h +++ b/src/gui/components/controls/juce_TreeView.h @@ -139,7 +139,7 @@ public: the tree. If false, it is relative to the top-left of the topmost item in the tree (so this would be unaffected by scrolling the view). */ - const Rectangle getItemPosition (const bool relativeToTreeViewTopLeft) const throw(); + const Rectangle getItemPosition (const bool relativeToTreeViewTopLeft) const throw(); /** Sends a signal to the treeview to make it refresh itself. diff --git a/src/gui/components/juce_Component.cpp b/src/gui/components/juce_Component.cpp index f66682c126..e530cd7218 100644 --- a/src/gui/components/juce_Component.cpp +++ b/src/gui/components/juce_Component.cpp @@ -264,7 +264,7 @@ public: alpha (1.0f), scale (1.0f) { - image = comp->createComponentSnapshot (Rectangle (0, 0, comp->getWidth(), comp->getHeight())); + image = comp->createComponentSnapshot (Rectangle (0, 0, comp->getWidth(), comp->getHeight())); setBounds (comp->getBounds()); comp->getParentComponent()->addAndMakeVisible (this); toBehind (comp); @@ -418,7 +418,7 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo) bool wasFullscreen = false; bool wasMinimised = false; ComponentBoundsConstrainer* currentConstainer = 0; - Rectangle oldNonFullScreenBounds; + Rectangle oldNonFullScreenBounds; if (peer != 0) { @@ -928,7 +928,7 @@ void Component::setTopRightPosition (const int x, const int y) setTopLeftPosition (x - getWidth(), y); } -void Component::setBounds (const Rectangle& r) +void Component::setBounds (const Rectangle& r) { setBounds (r.getX(), r.getY(), @@ -1777,13 +1777,13 @@ void Component::paintEntireComponent (Graphics& originalContext) } //============================================================================== -Image* Component::createComponentSnapshot (const Rectangle& areaToGrab, +Image* Component::createComponentSnapshot (const Rectangle& areaToGrab, const bool clipImageToComponentBounds) { - Rectangle r (areaToGrab); + Rectangle r (areaToGrab); if (clipImageToComponentBounds) - r = r.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); + r = r.getIntersection (Rectangle (0, 0, getWidth(), getHeight())); Image* const componentImage = Image::createNativeImage (flags.opaqueFlag ? Image::RGB : Image::ARGB, jmax (1, r.getWidth()), @@ -1922,7 +1922,7 @@ void Component::colourChanged() } //============================================================================== -const Rectangle Component::getUnclippedArea() const +const Rectangle Component::getUnclippedArea() const { int x = 0, y = 0, w = getWidth(), h = getHeight(); @@ -1932,18 +1932,18 @@ const Rectangle Component::getUnclippedArea() const while (p != 0) { - if (! Rectangle::intersectRectangles (x, y, w, h, -px, -py, p->getWidth(), p->getHeight())) - return Rectangle(); + if (! Rectangle::intersectRectangles (x, y, w, h, -px, -py, p->getWidth(), p->getHeight())) + return Rectangle(); px += p->getX(); py += p->getY(); p = p->parentComponent_; } - return Rectangle (x, y, w, h); + return Rectangle (x, y, w, h); } -void Component::clipObscuredRegions (Graphics& g, const Rectangle& clipRect, +void Component::clipObscuredRegions (Graphics& g, const Rectangle& clipRect, const int deltaX, const int deltaY) const throw() { for (int i = childComponentList_.size(); --i >= 0;) @@ -1952,7 +1952,7 @@ void Component::clipObscuredRegions (Graphics& g, const Rectangle& clipRect, if (c->isVisible()) { - Rectangle newClip (clipRect.getIntersection (c->bounds_)); + Rectangle newClip (clipRect.getIntersection (c->bounds_)); if (! newClip.isEmpty()) { @@ -1979,7 +1979,7 @@ void Component::getVisibleArea (RectangleList& result, const bool includeSiblings) const { result.clear(); - const Rectangle unclipped (getUnclippedArea()); + const Rectangle unclipped (getUnclippedArea()); if (! unclipped.isEmpty()) { @@ -1993,7 +1993,7 @@ void Component::getVisibleArea (RectangleList& result, c->relativePositionToOtherComponent (this, x, y); c->subtractObscuredRegions (result, x, y, - Rectangle (0, 0, c->getWidth(), c->getHeight()), + Rectangle (0, 0, c->getWidth(), c->getHeight()), this); } @@ -2005,7 +2005,7 @@ void Component::getVisibleArea (RectangleList& result, void Component::subtractObscuredRegions (RectangleList& result, const int deltaX, const int deltaY, - const Rectangle& clipRect, + const Rectangle& clipRect, const Component* const compToAvoid) const throw() { for (int i = childComponentList_.size(); --i >= 0;) @@ -2016,14 +2016,14 @@ void Component::subtractObscuredRegions (RectangleList& result, { if (c->isOpaque()) { - Rectangle childBounds (c->bounds_.getIntersection (clipRect)); + Rectangle childBounds (c->bounds_.getIntersection (clipRect)); childBounds.translate (deltaX, deltaY); result.subtract (childBounds); } else { - Rectangle newClip (clipRect.getIntersection (c->bounds_)); + Rectangle newClip (clipRect.getIntersection (c->bounds_)); newClip.translate (-c->getX(), -c->getY()); c->subtractObscuredRegions (result, @@ -2453,7 +2453,7 @@ void Component::internalMouseDown (const int x, const int y, const int64 time) int gx = x, gy = y; relativePositionToGlobal (gx, gy); - desktop.registerMouseDown (gx, gy, time, this); + desktop.registerMouseDown (Point (gx, gy), time, this); const ComponentDeletionWatcher deletionChecker (this); @@ -2596,7 +2596,7 @@ void Component::internalMouseUp (const int oldModifiers, int x, int y, const int int gx = x, gy = y; relativePositionToGlobal (gx, gy); - desktop.registerMouseDrag (gx, gy); + desktop.registerMouseDrag (Point (gx, gy)); const ComponentDeletionWatcher deletionChecker (this); @@ -2738,7 +2738,7 @@ void Component::internalMouseDrag (int x, int y, const int64 time) int gx = x, gy = y; relativePositionToGlobal (gx, gy); - desktop.registerMouseDrag (gx, gy); + desktop.registerMouseDrag (Point (gx, gy)); const ComponentDeletionWatcher deletionChecker (this); @@ -2811,7 +2811,7 @@ void Component::internalMouseDrag (int x, int y, const int64 time) { if (isUnboundedMouseModeOn) { - Rectangle screenArea (getParentMonitorArea().expanded (-2, -2)); + Rectangle screenArea (getParentMonitorArea().expanded (-2, -2)); int mx, my; Desktop::getMousePosition (mx, my); @@ -3451,7 +3451,7 @@ Component* JUCE_CALLTYPE Component::getComponentUnderMouse() throw() } //============================================================================== -const Rectangle Component::getParentMonitorArea() const throw() +const Rectangle Component::getParentMonitorArea() const throw() { int centreX = getWidth() / 2; int centreY = getHeight() / 2; diff --git a/src/gui/components/juce_Component.h b/src/gui/components/juce_Component.h index 848b49a1a0..1cace660b7 100644 --- a/src/gui/components/juce_Component.h +++ b/src/gui/components/juce_Component.h @@ -312,6 +312,9 @@ public: */ int getRight() const throw() { return bounds_.getRight(); } + /** Returns the component's top-left position as a Point. */ + const Point getPosition() const throw() { return bounds_.getPosition(); } + /** Returns the y co-ordinate of the bottom edge of this component. This is a distance in pixels from the top edge of the component's parent. @@ -322,7 +325,7 @@ public: The rectangle returned is relative to the top-left of the component's parent. */ - const Rectangle& getBounds() const throw() { return bounds_; } + const Rectangle& getBounds() const throw() { return bounds_; } /** Returns the region of this component that's not obscured by other, opaque components. @@ -411,7 +414,7 @@ public: @see setBounds */ - void setBounds (const Rectangle& newBounds); + void setBounds (const Rectangle& newBounds); /** Changes the component's position and size in terms of fractions of its parent's size. @@ -501,7 +504,7 @@ public: monitors, it will return the area of the monitor that contains the component's centre. */ - const Rectangle getParentMonitorArea() const throw(); + const Rectangle getParentMonitorArea() const throw(); //============================================================================== /** Returns the number of child components that this component contains. @@ -835,7 +838,7 @@ public: @see paintEntireComponent */ - Image* createComponentSnapshot (const Rectangle& areaToGrab, + Image* createComponentSnapshot (const Rectangle& areaToGrab, const bool clipImageToComponentBounds = true); /** Draws this component and all its subcomponents onto the specified graphics @@ -1907,7 +1910,7 @@ private: String componentName_; Component* parentComponent_; uint32 componentUID; - Rectangle bounds_; + Rectangle bounds_; int numDeepMouseListeners; Array childComponentList_; LookAndFeel* lookAndFeel_; @@ -1978,13 +1981,13 @@ private: static void bringModalComponentToFront(); void subtractObscuredRegions (RectangleList& result, const int deltaX, const int deltaY, - const Rectangle& clipRect, + const Rectangle& clipRect, const Component* const compToAvoid) const throw(); - void clipObscuredRegions (Graphics& g, const Rectangle& clipRect, + void clipObscuredRegions (Graphics& g, const Rectangle& clipRect, const int deltaX, const int deltaY) const throw(); // how much of the component is not off the edges of its parents - const Rectangle getUnclippedArea() const; + const Rectangle getUnclippedArea() const; void sendVisibilityChangeMessage(); //============================================================================== diff --git a/src/gui/components/juce_Desktop.cpp b/src/gui/components/juce_Desktop.cpp index 19324759ea..eafe5f11e0 100644 --- a/src/gui/components/juce_Desktop.cpp +++ b/src/gui/components/juce_Desktop.cpp @@ -65,13 +65,13 @@ Desktop& JUCE_CALLTYPE Desktop::getInstance() throw() Desktop* Desktop::instance = 0; //============================================================================== -extern void juce_updateMultiMonitorInfo (Array & monitorCoords, +extern void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea); void Desktop::refreshMonitorSizes() throw() { - const Array oldClipped (monitorCoordsClipped); - const Array oldUnclipped (monitorCoordsUnclipped); + const Array > oldClipped (monitorCoordsClipped); + const Array > oldUnclipped (monitorCoordsUnclipped); monitorCoordsClipped.clear(); monitorCoordsUnclipped.clear(); @@ -97,7 +97,7 @@ int Desktop::getNumDisplayMonitors() const throw() return monitorCoordsClipped.size(); } -const Rectangle Desktop::getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw() +const Rectangle Desktop::getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw() { return clippedToWorkArea ? monitorCoordsClipped [index] : monitorCoordsUnclipped [index]; @@ -113,19 +113,19 @@ const RectangleList Desktop::getAllMonitorDisplayAreas (const bool clippedToWork return rl; } -const Rectangle Desktop::getMainMonitorArea (const bool clippedToWorkArea) const throw() +const Rectangle Desktop::getMainMonitorArea (const bool clippedToWorkArea) const throw() { return getDisplayMonitorCoordinates (0, clippedToWorkArea); } -const Rectangle Desktop::getMonitorAreaContaining (int cx, int cy, const bool clippedToWorkArea) const throw() +const Rectangle Desktop::getMonitorAreaContaining (int cx, int cy, const bool clippedToWorkArea) const throw() { - Rectangle best (getMainMonitorArea (clippedToWorkArea)); + Rectangle best (getMainMonitorArea (clippedToWorkArea)); double bestDistance = 1.0e10; for (int i = getNumDisplayMonitors(); --i >= 0;) { - const Rectangle rect (getDisplayMonitorCoordinates (i, clippedToWorkArea)); + const Rectangle rect (getDisplayMonitorCoordinates (i, clippedToWorkArea)); if (rect.contains (cx, cy)) return rect; @@ -211,8 +211,8 @@ void Desktop::componentBroughtToFront (Component* const c) throw() void Desktop::getLastMouseDownPosition (int& x, int& y) throw() { const Desktop& d = getInstance(); - x = d.mouseDowns[0].x; - y = d.mouseDowns[0].y; + x = d.mouseDowns[0].position.getX(); + y = d.mouseDowns[0].position.getY(); } int Desktop::getMouseButtonClickCounter() throw() @@ -230,24 +230,23 @@ const Time Desktop::getLastMouseDownTime() const throw() return Time (mouseDowns[0].time); } -void Desktop::registerMouseDown (int x, int y, int64 time, Component* component) throw() +void Desktop::registerMouseDown (const Point& position, int64 time, Component* component) throw() { for (int i = numElementsInArray (mouseDowns); --i > 0;) mouseDowns[i] = mouseDowns[i - 1]; - mouseDowns[0].x = x; - mouseDowns[0].y = y; + mouseDowns[0].position = position; mouseDowns[0].time = time; mouseDowns[0].component = component; mouseMovedSignificantlySincePressed = false; } -void Desktop::registerMouseDrag (int x, int y) throw() +void Desktop::registerMouseDrag (const Point& position) throw() { mouseMovedSignificantlySincePressed = mouseMovedSignificantlySincePressed - || abs (mouseDowns[0].x - x) >= 4 - || abs (mouseDowns[0].y - y) >= 4; + || abs (mouseDowns[0].position.getX() - position.getX()) >= 4 + || abs (mouseDowns[0].position.getY() - position.getY()) >= 4; } int Desktop::getNumberOfMultipleClicks() const throw() @@ -263,8 +262,8 @@ int Desktop::getNumberOfMultipleClicks() const throw() { if (mouseDowns[0].time - mouseDowns[i].time < (int) (MouseEvent::getDoubleClickTimeout() * (1.0 + 0.25 * (i - 1))) - && abs (mouseDowns[0].x - mouseDowns[i].x) < 8 - && abs (mouseDowns[0].y - mouseDowns[i].y) < 8 + && abs (mouseDowns[0].position.getX() - mouseDowns[i].position.getX()) < 8 + && abs (mouseDowns[0].position.getY() - mouseDowns[i].position.getY()) < 8 && mouseDowns[0].component == mouseDowns[i].component) { ++numClicks; diff --git a/src/gui/components/juce_Desktop.h b/src/gui/components/juce_Desktop.h index 8f6a9aea53..a42606d53f 100644 --- a/src/gui/components/juce_Desktop.h +++ b/src/gui/components/juce_Desktop.h @@ -81,7 +81,7 @@ public: If clippedToWorkArea is true, it will exclude any areas like the taskbar on Windows, or the menu bar on Mac. If clippedToWorkArea is false, the entire monitor area is returned. */ - const Rectangle getMainMonitorArea (const bool clippedToWorkArea = true) const throw(); + const Rectangle getMainMonitorArea (const bool clippedToWorkArea = true) const throw(); /** Returns the position and size of the monitor which contains this co-ordinate. @@ -91,7 +91,7 @@ public: If clippedToWorkArea is true, it will exclude any areas like the taskbar on Windows, or the menu bar on Mac. If clippedToWorkArea is false, the entire monitor area is returned. */ - const Rectangle getMonitorAreaContaining (int x, int y, const bool clippedToWorkArea = true) const throw(); + const Rectangle getMonitorAreaContaining (int x, int y, const bool clippedToWorkArea = true) const throw(); //============================================================================== @@ -249,14 +249,14 @@ private: Desktop() throw(); ~Desktop() throw(); - Array monitorCoordsClipped, monitorCoordsUnclipped; + Array > monitorCoordsClipped, monitorCoordsUnclipped; int lastFakeMouseMoveX, lastFakeMouseMoveY, mouseClickCounter; bool mouseMovedSignificantlySincePressed; struct RecentMouseDown { - int x, y; + Point position; int64 time; Component* component; }; @@ -264,20 +264,20 @@ private: RecentMouseDown mouseDowns[4]; void incrementMouseClickCounter() throw(); - void registerMouseDown (int x, int y, int64 time, Component* component) throw(); - void registerMouseDrag (int x, int y) throw(); + void registerMouseDown (const Point& position, int64 time, Component* component) throw(); + void registerMouseDrag (const Point& position) throw(); const Time getLastMouseDownTime() const throw(); int getNumberOfMultipleClicks() const throw(); Component* kioskModeComponent; - Rectangle kioskComponentOriginalBounds; + Rectangle kioskComponentOriginalBounds; void timerCallback(); void sendMouseMove(); void resetTimer() throw(); int getNumDisplayMonitors() const throw(); - const Rectangle getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw(); + const Rectangle getDisplayMonitorCoordinates (const int index, const bool clippedToWorkArea) const throw(); void addDesktopComponent (Component* const c) throw(); void removeDesktopComponent (Component* const c) throw(); diff --git a/src/gui/components/layout/juce_ComponentAnimator.cpp b/src/gui/components/layout/juce_ComponentAnimator.cpp index 9f43c883d3..6d1fb0f1b7 100644 --- a/src/gui/components/layout/juce_ComponentAnimator.cpp +++ b/src/gui/components/layout/juce_ComponentAnimator.cpp @@ -41,7 +41,7 @@ struct AnimationTask Component* component; ComponentDeletionWatcher watcher; - Rectangle destination; + Rectangle destination; int msElapsed, msTotal; double startSpeed, midSpeed, endSpeed, lastProgress; double left, top, right, bottom; @@ -68,10 +68,10 @@ struct AnimationTask if (delta < 1.0) { - const Rectangle newBounds (roundToInt (left), - roundToInt (top), - roundToInt (right - left), - roundToInt (bottom - top)); + const Rectangle newBounds (roundToInt (left), + roundToInt (top), + roundToInt (right - left), + roundToInt (bottom - top)); if (newBounds != destination) { @@ -123,7 +123,7 @@ void* ComponentAnimator::findTaskFor (Component* const component) const } void ComponentAnimator::animateComponent (Component* const component, - const Rectangle& finalPosition, + const Rectangle& finalPosition, const int millisecondsToSpendMoving, const double startSpeed, const double endSpeed) @@ -196,7 +196,7 @@ void ComponentAnimator::cancelAnimation (Component* const component, } } -const Rectangle ComponentAnimator::getComponentDestination (Component* const component) +const Rectangle ComponentAnimator::getComponentDestination (Component* const component) { AnimationTask* const at = (AnimationTask*) findTaskFor (component); @@ -205,7 +205,7 @@ const Rectangle ComponentAnimator::getComponentDestination (Component* const com else if (component != 0) return component->getBounds(); - return Rectangle(); + return Rectangle(); } bool ComponentAnimator::isAnimating (Component* component) const diff --git a/src/gui/components/layout/juce_ComponentAnimator.h b/src/gui/components/layout/juce_ComponentAnimator.h index ba5ea9d8c0..fa252ab7d4 100644 --- a/src/gui/components/layout/juce_ComponentAnimator.h +++ b/src/gui/components/layout/juce_ComponentAnimator.h @@ -88,7 +88,7 @@ public: animation, set both the start and end speeds to 1.0 */ void animateComponent (Component* const component, - const Rectangle& finalPosition, + const Rectangle& finalPosition, const int millisecondsToSpendMoving, const double startSpeed = 1.0, const double endSpeed = 1.0); @@ -118,7 +118,7 @@ public: If the specified component isn't currently being animated, this method will just return its current position. */ - const Rectangle getComponentDestination (Component* const component); + const Rectangle getComponentDestination (Component* const component); /** Returns true if the specified component is currently being animated. */ diff --git a/src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp b/src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp index d8851d4f0c..98eb9e8985 100644 --- a/src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp +++ b/src/gui/components/layout/juce_ComponentBoundsConstrainer.cpp @@ -142,7 +142,7 @@ void ComponentBoundsConstrainer::setBoundsForComponent (Component* const compone { jassert (component != 0); - Rectangle limits; + Rectangle limits; Component* const p = component->getParentComponent(); if (p == 0) @@ -206,8 +206,8 @@ void ComponentBoundsConstrainer::resizeEnd() //============================================================================== void ComponentBoundsConstrainer::checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& old, - const Rectangle& limits, + const Rectangle& old, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, diff --git a/src/gui/components/layout/juce_ComponentBoundsConstrainer.h b/src/gui/components/layout/juce_ComponentBoundsConstrainer.h index 682e212e5c..89ea4d0881 100644 --- a/src/gui/components/layout/juce_ComponentBoundsConstrainer.h +++ b/src/gui/components/layout/juce_ComponentBoundsConstrainer.h @@ -145,8 +145,8 @@ public: @param isStretchingRight whether the right edge of the component is being resized */ virtual void checkBounds (int& x, int& y, int& w, int& h, - const Rectangle& previousBounds, - const Rectangle& limits, + const Rectangle& previousBounds, + const Rectangle& limits, const bool isStretchingTop, const bool isStretchingLeft, const bool isStretchingBottom, diff --git a/src/gui/components/layout/juce_TabbedComponent.cpp b/src/gui/components/layout/juce_TabbedComponent.cpp index 957a42cb65..7971378e1c 100644 --- a/src/gui/components/layout/juce_TabbedComponent.cpp +++ b/src/gui/components/layout/juce_TabbedComponent.cpp @@ -302,7 +302,7 @@ void TabbedComponent::resized() indents.setRight (tabDepth + edgeIndent); } - const Rectangle bounds (indents.subtractedFrom (Rectangle (0, 0, getWidth(), getHeight()))); + const Rectangle bounds (indents.subtractedFrom (Rectangle (0, 0, getWidth(), getHeight()))); for (int i = contentComponents.size(); --i >= 0;) if (contentComponents.getUnchecked (i) != 0) diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp index 17c1f9274d..d7d0544cb9 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -531,7 +531,7 @@ AlertWindow* LookAndFeel::createAlertWindow (const String& title, void LookAndFeel::drawAlertBox (Graphics& g, AlertWindow& alert, - const Rectangle& textArea, + const Rectangle& textArea, TextLayout& textLayout) { g.fillAll (alert.findColour (AlertWindow::backgroundColourId)); @@ -545,8 +545,8 @@ void LookAndFeel::drawAlertBox (Graphics& g, if (alert.containsAnyExtraComponents() || alert.getNumButtons() > 2) iconSize = jmin (iconSize, textArea.getHeight() + 50); - const Rectangle iconRect (iconSize / -10, iconSize / -10, - iconSize, iconSize); + const Rectangle iconRect (iconSize / -10, iconSize / -10, + iconSize, iconSize); if (alert.getAlertType() != AlertWindow::NoIcon) { @@ -2296,7 +2296,7 @@ void LookAndFeel::drawTabAreaBehindFrontButton (Graphics& g, const float shadowSize = 0.2f; float x1 = 0.0f, y1 = 0.0f, x2 = 0.0f, y2 = 0.0f; - Rectangle shadowRect; + Rectangle shadowRect; if (orientation == TabbedButtonBar::TabsAtLeft) { @@ -2517,17 +2517,17 @@ void LookAndFeel::drawPropertyComponentLabel (Graphics& g, int, int height, g.setFont (jmin (height, 24) * 0.65f); - const Rectangle r (getPropertyComponentContentPosition (component)); + const Rectangle r (getPropertyComponentContentPosition (component)); g.drawFittedText (component.getName(), 3, r.getY(), r.getX() - 5, r.getHeight(), Justification::centredLeft, 2); } -const Rectangle LookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component) +const Rectangle LookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component) { - return Rectangle (component.getWidth() / 3, 1, - component.getWidth() - component.getWidth() / 3 - 1, component.getHeight() - 3); + return Rectangle (component.getWidth() / 3, 1, + component.getWidth() - component.getWidth() / 3 - 1, component.getHeight() - 3); } //============================================================================== diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.h b/src/gui/components/lookandfeel/juce_LookAndFeel.h index 029556256a..42694e4c1c 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.h +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.h @@ -191,7 +191,7 @@ public: virtual void drawAlertBox (Graphics& g, AlertWindow& alert, - const Rectangle& textArea, + const Rectangle& textArea, TextLayout& textLayout); virtual int getAlertBoxWindowFlags(); @@ -595,7 +595,7 @@ public: virtual void drawPropertyComponentLabel (Graphics& g, int width, int height, PropertyComponent& component); - virtual const Rectangle getPropertyComponentContentPosition (PropertyComponent& component); + virtual const Rectangle getPropertyComponentContentPosition (PropertyComponent& component); //============================================================================== virtual void drawLevelMeter (Graphics& g, int width, int height, float level); diff --git a/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp b/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp index 8df85e7e4b..0a13276c6d 100644 --- a/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp +++ b/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp @@ -268,7 +268,7 @@ void OldSchoolLookAndFeel::drawScrollbar (Graphics& g, if (thumbSize > 0.0f) { - Rectangle thumb; + Rectangle thumb; if (isScrollbarVertical) { diff --git a/src/gui/components/menus/juce_PopupMenu.cpp b/src/gui/components/menus/juce_PopupMenu.cpp index 676e16e9a4..3af507bcbe 100644 --- a/src/gui/components/menus/juce_PopupMenu.cpp +++ b/src/gui/components/menus/juce_PopupMenu.cpp @@ -758,7 +758,7 @@ private: ApplicationCommandManager** managerOfChosenCommand; Component* componentAttachedTo; ScopedPointer attachedCompWatcher; - Rectangle windowPos; + Rectangle windowPos; int lastMouseX, lastMouseY; int minimumWidth, maximumNumColumns, standardItemHeight; bool isOver, hasBeenOver, isDown, needsToScroll; @@ -769,7 +769,7 @@ private: double scrollAcceleration; //============================================================================== - bool overlaps (const Rectangle& r) const + bool overlaps (const Rectangle& r) const { return r.intersects (getBounds()) || (owner != 0 && owner->overlaps (r)); @@ -822,13 +822,13 @@ private: const int minY, const int maxY, const bool alignToRectangle) { - const Rectangle mon (Desktop::getInstance() - .getMonitorAreaContaining ((minX + maxX) / 2, - (minY + maxY) / 2, + const Rectangle mon (Desktop::getInstance() + .getMonitorAreaContaining ((minX + maxX) / 2, + (minY + maxY) / 2, #if JUCE_MAC - true)); + true)); #else - false)); // on windows, don't stop the menu overlapping the taskbar + false)); // on windows, don't stop the menu overlapping the taskbar #endif int x, y, widthToUse, heightToUse; @@ -995,10 +995,10 @@ private: windowPos.getHeight() - (PopupMenuSettings::scrollZone + m->getHeight())), currentY); - const Rectangle mon (Desktop::getInstance() - .getMonitorAreaContaining (windowPos.getX(), - windowPos.getY(), - true)); + const Rectangle mon (Desktop::getInstance() + .getMonitorAreaContaining (windowPos.getX(), + windowPos.getY(), + true)); int deltaY = wantedY - currentY; @@ -1021,7 +1021,7 @@ private: void resizeToBestWindowPos() { - Rectangle r (windowPos); + Rectangle r (windowPos); if (childYOffset < 0) { diff --git a/src/gui/components/mouse/juce_DragAndDropContainer.cpp b/src/gui/components/mouse/juce_DragAndDropContainer.cpp index ab19f268db..a7264e971f 100644 --- a/src/gui/components/mouse/juce_DragAndDropContainer.cpp +++ b/src/gui/components/mouse/juce_DragAndDropContainer.cpp @@ -345,7 +345,7 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, Component* sourceComponent, Image* dragImage_, const bool allowDraggingToExternalWindows, - const Point* imageOffsetFromMouse) + const Point* imageOffsetFromMouse) { ScopedPointer dragImage (dragImage_); @@ -361,7 +361,7 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, if (dragImage == 0) { - dragImage = sourceComponent->createComponentSnapshot (Rectangle (0, 0, sourceComponent->getWidth(), sourceComponent->getHeight())); + dragImage = sourceComponent->createComponentSnapshot (Rectangle (0, 0, sourceComponent->getWidth(), sourceComponent->getHeight())); if (dragImage->getFormat() != Image::ARGB) { @@ -414,8 +414,8 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, } else { - imageX = (int) imageOffsetFromMouse->getX(); - imageY = (int) imageOffsetFromMouse->getY(); + imageX = imageOffsetFromMouse->getX(); + imageY = imageOffsetFromMouse->getY(); } } diff --git a/src/gui/components/mouse/juce_DragAndDropContainer.h b/src/gui/components/mouse/juce_DragAndDropContainer.h index 2ee1cf1e50..f6c66acb04 100644 --- a/src/gui/components/mouse/juce_DragAndDropContainer.h +++ b/src/gui/components/mouse/juce_DragAndDropContainer.h @@ -94,7 +94,7 @@ public: Component* sourceComponent, Image* dragImage = 0, const bool allowDraggingToOtherJuceWindows = false, - const Point* imageOffsetFromMouse = 0); + const Point* imageOffsetFromMouse = 0); /** Returns true if something is currently being dragged. */ bool isDragAndDropActive() const; diff --git a/src/gui/components/properties/juce_BooleanPropertyComponent.cpp b/src/gui/components/properties/juce_BooleanPropertyComponent.cpp index 0569596ed0..b2b4ea072e 100644 --- a/src/gui/components/properties/juce_BooleanPropertyComponent.cpp +++ b/src/gui/components/properties/juce_BooleanPropertyComponent.cpp @@ -81,7 +81,7 @@ void BooleanPropertyComponent::paint (Graphics& g) { PropertyComponent::paint (g); - const Rectangle r (button->getBounds()); + const Rectangle r (button->getBounds()); g.setColour (Colours::white); g.fillRect (r); diff --git a/src/gui/components/special/juce_ActiveXControlComponent.h b/src/gui/components/special/juce_ActiveXControlComponent.h index c7614eec64..7b716aca37 100644 --- a/src/gui/components/special/juce_ActiveXControlComponent.h +++ b/src/gui/components/special/juce_ActiveXControlComponent.h @@ -123,7 +123,7 @@ private: ActiveXControlComponent (const ActiveXControlComponent&); const ActiveXControlComponent& operator= (const ActiveXControlComponent&); - void setControlBounds (const Rectangle& bounds) const; + void setControlBounds (const Rectangle& bounds) const; void setControlVisible (const bool b) const; }; diff --git a/src/gui/components/special/juce_BubbleComponent.cpp b/src/gui/components/special/juce_BubbleComponent.cpp index 8d881b87ef..90b7b6ccc7 100644 --- a/src/gui/components/special/juce_BubbleComponent.cpp +++ b/src/gui/components/special/juce_BubbleComponent.cpp @@ -106,19 +106,19 @@ void BubbleComponent::setPosition (Component* componentToPointTo) else componentToPointTo->relativePositionToGlobal (tx, ty); - setPosition (Rectangle (tx, ty, componentToPointTo->getWidth(), componentToPointTo->getHeight())); + setPosition (Rectangle (tx, ty, componentToPointTo->getWidth(), componentToPointTo->getHeight())); } void BubbleComponent::setPosition (const int arrowTipX_, const int arrowTipY_) { - setPosition (Rectangle (arrowTipX_, arrowTipY_, 1, 1)); + setPosition (Rectangle (arrowTipX_, arrowTipY_, 1, 1)); } //============================================================================== -void BubbleComponent::setPosition (const Rectangle& rectangleToPointTo) +void BubbleComponent::setPosition (const Rectangle& rectangleToPointTo) { - Rectangle availableSpace; + Rectangle availableSpace; if (getParentComponent() != 0) { diff --git a/src/gui/components/special/juce_BubbleComponent.h b/src/gui/components/special/juce_BubbleComponent.h index a3e82619c8..6e1b13b8c8 100644 --- a/src/gui/components/special/juce_BubbleComponent.h +++ b/src/gui/components/special/juce_BubbleComponent.h @@ -125,7 +125,7 @@ public: on where there's the most space, honouring any restrictions that were set with setAllowedPlacement(). */ - void setPosition (const Rectangle& rectangleToPointTo); + void setPosition (const Rectangle& rectangleToPointTo); protected: @@ -151,7 +151,7 @@ public: juce_UseDebuggingNewOperator private: - Rectangle content; + Rectangle content; int side, allowablePlacements; float arrowTipX, arrowTipY; DropShadowEffect shadow; diff --git a/src/gui/components/special/juce_ColourSelector.cpp b/src/gui/components/special/juce_ColourSelector.cpp index d398789df8..d7066890e4 100644 --- a/src/gui/components/special/juce_ColourSelector.cpp +++ b/src/gui/components/special/juce_ColourSelector.cpp @@ -254,7 +254,7 @@ public: { const float yScale = 1.0f / (getHeight() - edge * 2); - const Rectangle clip (g.getClipBounds()); + const Rectangle clip (g.getClipBounds()); for (int y = jmin (clip.getBottom(), getHeight() - edge); --y >= jmax (edge, clip.getY());) { diff --git a/src/gui/components/special/juce_MagnifierComponent.cpp b/src/gui/components/special/juce_MagnifierComponent.cpp index 97112689f6..cc5b504579 100644 --- a/src/gui/components/special/juce_MagnifierComponent.cpp +++ b/src/gui/components/special/juce_MagnifierComponent.cpp @@ -252,7 +252,7 @@ void MagnifierComponent::paint (Graphics& g) if (w == 0 || h == 0) return; - const Rectangle r (g.getClipBounds()); + const Rectangle r (g.getClipBounds()); const int srcX = (int) (r.getX() / scaleFactor); const int srcY = (int) (r.getY() / scaleFactor); diff --git a/src/gui/components/special/juce_QuickTimeMovieComponent.h b/src/gui/components/special/juce_QuickTimeMovieComponent.h index 10a3cf5b9c..1abff381b7 100644 --- a/src/gui/components/special/juce_QuickTimeMovieComponent.h +++ b/src/gui/components/special/juce_QuickTimeMovieComponent.h @@ -142,7 +142,7 @@ public: be aligned according to the justification value if this means there are gaps at the top or sides. */ - void setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, + void setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, const RectanglePlacement& placement); /** Starts the movie playing. */ diff --git a/src/gui/components/windows/juce_AlertWindow.h b/src/gui/components/windows/juce_AlertWindow.h index 252455f4d0..b6ec7d9f1b 100644 --- a/src/gui/components/windows/juce_AlertWindow.h +++ b/src/gui/components/windows/juce_AlertWindow.h @@ -358,7 +358,7 @@ private: AlertIconType alertIconType; ComponentBoundsConstrainer constrainer; ComponentDragger dragger; - Rectangle textArea; + Rectangle textArea; VoidArray buttons, textBoxes, comboBoxes; VoidArray progressBars, customComps, textBlocks, allComps; StringArray textboxNames, comboBoxNames; diff --git a/src/gui/components/windows/juce_ComponentPeer.cpp b/src/gui/components/windows/juce_ComponentPeer.cpp index e615fed18b..b7ab509f4c 100644 --- a/src/gui/components/windows/juce_ComponentPeer.cpp +++ b/src/gui/components/windows/juce_ComponentPeer.cpp @@ -582,12 +582,12 @@ void ComponentPeer::handleScreenSizeChange() handleMovedOrResized(); } -void ComponentPeer::setNonFullScreenBounds (const Rectangle& newBounds) throw() +void ComponentPeer::setNonFullScreenBounds (const Rectangle& newBounds) throw() { lastNonFullscreenBounds = newBounds; } -const Rectangle& ComponentPeer::getNonFullScreenBounds() const throw() +const Rectangle& ComponentPeer::getNonFullScreenBounds() const throw() { return lastNonFullscreenBounds; } diff --git a/src/gui/components/windows/juce_ComponentPeer.h b/src/gui/components/windows/juce_ComponentPeer.h index 8f53637350..0cfbfec4d5 100644 --- a/src/gui/components/windows/juce_ComponentPeer.h +++ b/src/gui/components/windows/juce_ComponentPeer.h @@ -174,10 +174,10 @@ public: virtual bool isFullScreen() const = 0; /** Sets the size to restore to if fullscreen mode is turned off. */ - void setNonFullScreenBounds (const Rectangle& newBounds) throw(); + void setNonFullScreenBounds (const Rectangle& newBounds) throw(); /** Returns the size to restore to if fullscreen mode is turned off. */ - const Rectangle& getNonFullScreenBounds() const throw(); + const Rectangle& getNonFullScreenBounds() const throw(); /** Attempts to change the icon associated with this window. */ @@ -365,7 +365,7 @@ protected: Component* const component; const int styleFlags; RectangleList maskedRegion; - Rectangle lastNonFullscreenBounds; + Rectangle lastNonFullscreenBounds; uint32 lastPaintTime; ComponentBoundsConstrainer* constrainer; diff --git a/src/gui/components/windows/juce_DocumentWindow.cpp b/src/gui/components/windows/juce_DocumentWindow.cpp index 14bfe8caca..56057e9f98 100644 --- a/src/gui/components/windows/juce_DocumentWindow.cpp +++ b/src/gui/components/windows/juce_DocumentWindow.cpp @@ -94,7 +94,7 @@ DocumentWindow::~DocumentWindow() //============================================================================== void DocumentWindow::repaintTitleBar() { - const Rectangle titleBarArea (getTitleBarArea()); + const Rectangle titleBarArea (getTitleBarArea()); repaint (titleBarArea.getX(), titleBarArea.getY(), titleBarArea.getWidth(), titleBarArea.getHeight()); } @@ -205,7 +205,7 @@ void DocumentWindow::paint (Graphics& g) g.fillRect (0, getHeight() - border.getBottom(), getWidth(), border.getBottom()); } - const Rectangle titleBarArea (getTitleBarArea()); + const Rectangle titleBarArea (getTitleBarArea()); g.setOrigin (titleBarArea.getX(), titleBarArea.getY()); g.reduceClipRegion (0, 0, titleBarArea.getWidth(), titleBarArea.getHeight()); @@ -239,7 +239,7 @@ void DocumentWindow::resized() if (titleBarButtons[1] != 0) titleBarButtons[1]->setToggleState (isFullScreen(), false); - const Rectangle titleBarArea (getTitleBarArea()); + const Rectangle titleBarArea (getTitleBarArea()); getLookAndFeel() .positionDocumentWindowButtons (*this, @@ -277,13 +277,13 @@ int DocumentWindow::getTitleBarHeight() const return isUsingNativeTitleBar() ? 0 : jmin (titleBarHeight, getHeight() - 4); } -const Rectangle DocumentWindow::getTitleBarArea() +const Rectangle DocumentWindow::getTitleBarArea() { const BorderSize border (getBorderThickness()); - return Rectangle (border.getLeft(), border.getTop(), - getWidth() - border.getLeftAndRight(), - getTitleBarHeight()); + return Rectangle (border.getLeft(), border.getTop(), + getWidth() - border.getLeftAndRight(), + getTitleBarHeight()); } Button* DocumentWindow::getCloseButton() const throw() diff --git a/src/gui/components/windows/juce_DocumentWindow.h b/src/gui/components/windows/juce_DocumentWindow.h index fc31eaeb06..41245451c6 100644 --- a/src/gui/components/windows/juce_DocumentWindow.h +++ b/src/gui/components/windows/juce_DocumentWindow.h @@ -240,7 +240,7 @@ public: /** @internal */ void parentHierarchyChanged(); /** @internal */ - const Rectangle getTitleBarArea(); + const Rectangle getTitleBarArea(); //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/components/windows/juce_ResizableWindow.cpp b/src/gui/components/windows/juce_ResizableWindow.cpp index 0ad0044674..d29fb2b1e9 100644 --- a/src/gui/components/windows/juce_ResizableWindow.cpp +++ b/src/gui/components/windows/juce_ResizableWindow.cpp @@ -382,7 +382,7 @@ void ResizableWindow::setFullScreen (const bool shouldBeFullScreen) if (peer != 0) { // keep a copy of this intact in case the real one gets messed-up while we're un-maximising - const Rectangle lastPos (lastNonFullScreenPos); + const Rectangle lastPos (lastNonFullScreenPos); peer->setFullScreen (shouldBeFullScreen); @@ -478,15 +478,15 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s) if (tokens.size() != 4 + n) return false; - Rectangle r (tokens[n].getIntValue(), - tokens[n + 1].getIntValue(), - tokens[n + 2].getIntValue(), - tokens[n + 3].getIntValue()); + Rectangle r (tokens[n].getIntValue(), + tokens[n + 1].getIntValue(), + tokens[n + 2].getIntValue(), + tokens[n + 3].getIntValue()); if (r.isEmpty()) return false; - const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (r.getX(), r.getY())); + const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (r.getX(), r.getY())); if (! screen.contains (r)) { diff --git a/src/gui/components/windows/juce_ResizableWindow.h b/src/gui/components/windows/juce_ResizableWindow.h index 546f8cd8a8..77d6e03b16 100644 --- a/src/gui/components/windows/juce_ResizableWindow.h +++ b/src/gui/components/windows/juce_ResizableWindow.h @@ -345,7 +345,7 @@ private: ScopedPointer contentComponent; bool resizeToFitContent, fullscreen; ComponentDragger dragger; - Rectangle lastNonFullScreenPos; + Rectangle lastNonFullScreenPos; ComponentBoundsConstrainer defaultConstrainer; ComponentBoundsConstrainer* constrainer; #ifdef JUCE_DEBUG diff --git a/src/gui/components/windows/juce_TopLevelWindow.cpp b/src/gui/components/windows/juce_TopLevelWindow.cpp index 2720c94004..cd22adab64 100644 --- a/src/gui/components/windows/juce_TopLevelWindow.cpp +++ b/src/gui/components/windows/juce_TopLevelWindow.cpp @@ -295,7 +295,7 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const int y = (c->getHeight() - height) / 2; c->relativePositionToGlobal (x, y); - Rectangle parentArea (c->getParentMonitorArea()); + Rectangle parentArea (c->getParentMonitorArea()); if (getParentComponent() != 0) { diff --git a/src/gui/graphics/contexts/juce_EdgeTable.cpp b/src/gui/graphics/contexts/juce_EdgeTable.cpp index df751d7f31..7d98bb8868 100644 --- a/src/gui/graphics/contexts/juce_EdgeTable.cpp +++ b/src/gui/graphics/contexts/juce_EdgeTable.cpp @@ -46,7 +46,7 @@ static void copyEdgeTableData (int* dest, const int destLineStride, const int* s } //============================================================================== -EdgeTable::EdgeTable (const Rectangle& bounds_, +EdgeTable::EdgeTable (const Rectangle& bounds_, const Path& path, const AffineTransform& transform) throw() : bounds (bounds_), maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine), @@ -121,7 +121,7 @@ EdgeTable::EdgeTable (const Rectangle& bounds_, sanitiseLevels (path.isUsingNonZeroWinding()); } -EdgeTable::EdgeTable (const Rectangle& rectangleToAdd) throw() +EdgeTable::EdgeTable (const Rectangle& rectangleToAdd) throw() : bounds (rectangleToAdd), maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine), lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1), @@ -162,7 +162,7 @@ EdgeTable::EdgeTable (const RectangleList& rectanglesToAdd) throw() for (RectangleList::Iterator iter (rectanglesToAdd); iter.next();) { - const Rectangle* const r = iter.getRectangle(); + const Rectangle* const r = iter.getRectangle(); const int x1 = r->getX() << 8; const int x2 = r->getRight() << 8; @@ -180,7 +180,7 @@ EdgeTable::EdgeTable (const RectangleList& rectanglesToAdd) throw() } EdgeTable::EdgeTable (const float x, const float y, const float w, const float h) throw() - : bounds (Rectangle ((int) floorf (x), roundToInt (y * 256.0f) >> 8, 2 + (int) w, 2 + (int) h)), + : bounds (Rectangle ((int) floorf (x), roundToInt (y * 256.0f) >> 8, 2 + (int) w, 2 + (int) h)), maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine), lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1), needToCheckEmptinesss (true) @@ -587,9 +587,9 @@ void EdgeTable::clipEdgeTableLineToRange (int* dest, const int x1, const int x2) //============================================================================== -void EdgeTable::clipToRectangle (const Rectangle& r) throw() +void EdgeTable::clipToRectangle (const Rectangle& r) throw() { - const Rectangle clipped (r.getIntersection (bounds)); + const Rectangle clipped (r.getIntersection (bounds)); if (clipped.isEmpty()) { @@ -629,9 +629,9 @@ void EdgeTable::clipToRectangle (const Rectangle& r) throw() } } -void EdgeTable::excludeRectangle (const Rectangle& r) throw() +void EdgeTable::excludeRectangle (const Rectangle& r) throw() { - const Rectangle clipped (r.getIntersection (bounds)); + const Rectangle clipped (r.getIntersection (bounds)); if (! clipped.isEmpty()) { @@ -654,7 +654,7 @@ void EdgeTable::excludeRectangle (const Rectangle& r) throw() void EdgeTable::clipToEdgeTable (const EdgeTable& other) { - const Rectangle clipped (other.bounds.getIntersection (bounds)); + const Rectangle clipped (other.bounds.getIntersection (bounds)); if (clipped.isEmpty()) { diff --git a/src/gui/graphics/contexts/juce_EdgeTable.h b/src/gui/graphics/contexts/juce_EdgeTable.h index 2487b661af..9b6cd45f22 100644 --- a/src/gui/graphics/contexts/juce_EdgeTable.h +++ b/src/gui/graphics/contexts/juce_EdgeTable.h @@ -53,13 +53,13 @@ public: @param pathToAdd the path to add to the table @param transform a transform to apply to the path being added */ - EdgeTable (const Rectangle& clipLimits, + EdgeTable (const Rectangle& clipLimits, const Path& pathToAdd, const AffineTransform& transform) throw(); /** Creates an edge table containing a rectangle. */ - EdgeTable (const Rectangle& rectangleToAdd) throw(); + EdgeTable (const Rectangle& rectangleToAdd) throw(); /** Creates an edge table containing a rectangle list. */ @@ -80,12 +80,12 @@ public: ~EdgeTable() throw(); //============================================================================== - void clipToRectangle (const Rectangle& r) throw(); - void excludeRectangle (const Rectangle& r) throw(); + void clipToRectangle (const Rectangle& r) throw(); + void excludeRectangle (const Rectangle& r) throw(); void clipToEdgeTable (const EdgeTable& other); void clipLineToMask (int x, int y, uint8* mask, int maskStride, int numPixels) throw(); bool isEmpty() throw(); - const Rectangle& getMaximumBounds() const throw() { return bounds; } + const Rectangle& getMaximumBounds() const throw() { return bounds; } void translate (float dx, int dy) throw(); /** Reduces the amount of space the table has allocated. @@ -195,8 +195,8 @@ public: private: // table line format: number of points; point0 x, point0 levelDelta, point1 x, point1 levelDelta, etc - HeapBlock table; - Rectangle bounds; + HeapBlock table; + Rectangle bounds; int maxEdgesPerLine, lineStrideElements; bool needToCheckEmptinesss; diff --git a/src/gui/graphics/contexts/juce_Graphics.cpp b/src/gui/graphics/contexts/juce_Graphics.cpp index 0cc7845676..8bb2f40490 100644 --- a/src/gui/graphics/contexts/juce_Graphics.cpp +++ b/src/gui/graphics/contexts/juce_Graphics.cpp @@ -93,7 +93,7 @@ bool Graphics::reduceClipRegion (const int x, const int y, const int w, const int h) throw() { saveStateIfPending(); - return context->clipToRectangle (Rectangle (x, y, w, h)); + return context->clipToRectangle (Rectangle (x, y, w, h)); } bool Graphics::reduceClipRegion (const RectangleList& clipRegion) throw() @@ -109,7 +109,7 @@ bool Graphics::reduceClipRegion (const Path& path, const AffineTransform& transf return ! context->isClipEmpty(); } -bool Graphics::reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, const AffineTransform& transform) throw() +bool Graphics::reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, const AffineTransform& transform) throw() { saveStateIfPending(); context->clipToImageAlpha (image, sourceClipRegion, transform); @@ -120,7 +120,7 @@ void Graphics::excludeClipRegion (const int x, const int y, const int w, const int h) throw() { saveStateIfPending(); - context->excludeClipRectangle (Rectangle (x, y, w, h)); + context->excludeClipRectangle (Rectangle (x, y, w, h)); } bool Graphics::isClipEmpty() const throw() @@ -128,7 +128,7 @@ bool Graphics::isClipEmpty() const throw() return context->isClipEmpty(); } -const Rectangle Graphics::getClipBounds() const throw() +const Rectangle Graphics::getClipBounds() const throw() { return context->getClipBounds(); } @@ -166,7 +166,7 @@ void Graphics::setOrigin (const int newOriginX, bool Graphics::clipRegionIntersects (const int x, const int y, const int w, const int h) const throw() { - return context->clipRegionIntersects (Rectangle (x, y, w, h)); + return context->clipRegionIntersects (Rectangle (x, y, w, h)); } //============================================================================== @@ -269,7 +269,7 @@ void Graphics::drawText (const String& text, const Justification& justificationType, const bool useEllipsesIfTooBig) const throw() { - if (text.isNotEmpty() && context->clipRegionIntersects (Rectangle (x, y, width, height))) + if (text.isNotEmpty() && context->clipRegionIntersects (Rectangle (x, y, width, height))) { GlyphArrangement arr; @@ -296,7 +296,7 @@ void Graphics::drawFittedText (const String& text, { if (text.isNotEmpty() && width > 0 && height > 0 - && context->clipRegionIntersects (Rectangle (x, y, width, height))) + && context->clipRegionIntersects (Rectangle (x, y, width, height))) { GlyphArrangement arr; @@ -320,10 +320,10 @@ void Graphics::fillRect (int x, // passing in a silly number can cause maths problems in rendering! jassert (areCoordsSensibleNumbers (x, y, width, height)); - context->fillRect (Rectangle (x, y, width, height), false); + context->fillRect (Rectangle (x, y, width, height), false); } -void Graphics::fillRect (const Rectangle& r) const throw() +void Graphics::fillRect (const Rectangle& r) const throw() { context->fillRect (r, false); } @@ -343,7 +343,7 @@ void Graphics::fillRect (const float x, void Graphics::setPixel (int x, int y) const throw() { - context->fillRect (Rectangle (x, y, 1, 1), false); + context->fillRect (Rectangle (x, y, 1, 1), false); } void Graphics::fillAll() const throw() @@ -355,7 +355,7 @@ void Graphics::fillAll (const Colour& colourToUse) const throw() { if (! colourToUse.isTransparent()) { - const Rectangle clip (context->getClipBounds()); + const Rectangle clip (context->getClipBounds()); context->saveState(); context->setFill (FillType (colourToUse)); @@ -392,10 +392,10 @@ void Graphics::drawRect (const int x, // passing in a silly number can cause maths problems in rendering! jassert (areCoordsSensibleNumbers (x, y, width, height)); - context->fillRect (Rectangle (x, y, width, lineThickness), false); - context->fillRect (Rectangle (x, y + lineThickness, lineThickness, height - lineThickness * 2), false); - context->fillRect (Rectangle (x + width - lineThickness, y + lineThickness, lineThickness, height - lineThickness * 2), false); - context->fillRect (Rectangle (x, y + height - lineThickness, width, lineThickness), false); + context->fillRect (Rectangle (x, y, width, lineThickness), false); + context->fillRect (Rectangle (x, y + lineThickness, lineThickness, height - lineThickness * 2), false); + context->fillRect (Rectangle (x + width - lineThickness, y + lineThickness, lineThickness, height - lineThickness * 2), false); + context->fillRect (Rectangle (x, y + height - lineThickness, width, lineThickness), false); } void Graphics::drawRect (const float x, @@ -415,7 +415,7 @@ void Graphics::drawRect (const float x, fillPath (p); } -void Graphics::drawRect (const Rectangle& r, +void Graphics::drawRect (const Rectangle& r, const int lineThickness) const throw() { drawRect (r.getX(), r.getY(), @@ -449,13 +449,13 @@ void Graphics::drawBevel (const int x, : oldOpacity; context->setFill (FillType (topLeftColour.withMultipliedAlpha (op))); - context->fillRect (Rectangle (x + i, y + i, width - i * 2, 1), false); + context->fillRect (Rectangle (x + i, y + i, width - i * 2, 1), false); context->setFill (FillType (topLeftColour.withMultipliedAlpha (op * 0.75f))); - context->fillRect (Rectangle (x + i, y + i + 1, 1, height - i * 2 - 2), false); + context->fillRect (Rectangle (x + i, y + i + 1, 1, height - i * 2 - 2), false); context->setFill (FillType (bottomRightColour.withMultipliedAlpha (op))); - context->fillRect (Rectangle (x + i, y + height - i - 1, width - i * 2, 1), false); + context->fillRect (Rectangle (x + i, y + height - i - 1, width - i * 2, 1), false); context->setFill (FillType (bottomRightColour.withMultipliedAlpha (op * 0.75f))); - context->fillRect (Rectangle (x + width - i - 1, y + i + 1, 1, height - i * 2 - 2), false); + context->fillRect (Rectangle (x + width - i - 1, y + i + 1, 1, height - i * 2 - 2), false); } context->restoreState(); @@ -504,7 +504,7 @@ void Graphics::fillRoundedRectangle (const float x, fillPath (p); } -void Graphics::fillRoundedRectangle (const Rectangle& r, +void Graphics::fillRoundedRectangle (const Rectangle& r, const float cornerSize) const throw() { fillRoundedRectangle ((float) r.getX(), @@ -529,7 +529,7 @@ void Graphics::drawRoundedRectangle (const float x, strokePath (p, PathStrokeType (lineThickness)); } -void Graphics::drawRoundedRectangle (const Rectangle& r, +void Graphics::drawRoundedRectangle (const Rectangle& r, const float cornerSize, const float lineThickness) const throw() { @@ -571,11 +571,11 @@ void Graphics::fillCheckerBoard (int x, int y, if (colour1 == colour2) { context->setFill (FillType (colour1)); - context->fillRect (Rectangle (x, y, width, height), false); + context->fillRect (Rectangle (x, y, width, height), false); } else { - const Rectangle clip (context->getClipBounds()); + const Rectangle clip (context->getClipBounds()); const int right = jmin (x + width, clip.getRight()); const int bottom = jmin (y + height, clip.getBottom()); @@ -588,7 +588,7 @@ void Graphics::fillCheckerBoard (int x, int y, for (int xx = x; xx < right; xx += checkWidth) { context->setFill (FillType (((cx++ & 1) == 0) ? colour1 : colour2)); - context->fillRect (Rectangle (xx, y, jmin (checkWidth, right - xx), jmin (checkHeight, bottom - y)), + context->fillRect (Rectangle (xx, y, jmin (checkWidth, right - xx), jmin (checkHeight, bottom - y)), false); } @@ -753,9 +753,9 @@ void Graphics::drawImage (const Image* const imageToDraw, jassert (areCoordsSensibleNumbers (dx, dy, dw, dh)); jassert (areCoordsSensibleNumbers (sx, sy, sw, sh)); - if (context->clipRegionIntersects (Rectangle (dx, dy, dw, dh))) + if (context->clipRegionIntersects (Rectangle (dx, dy, dw, dh))) { - drawImageTransformed (imageToDraw, Rectangle (sx, sy, sw, sh), + drawImageTransformed (imageToDraw, Rectangle (sx, sy, sw, sh), AffineTransform::scale (dw / (float) sw, dh / (float) sh) .translated ((float) dx, (float) dy), fillAlphaChannelWithCurrentBrush); @@ -763,13 +763,13 @@ void Graphics::drawImage (const Image* const imageToDraw, } void Graphics::drawImageTransformed (const Image* const imageToDraw, - const Rectangle& imageSubRegion, + const Rectangle& imageSubRegion, const AffineTransform& transform, const bool fillAlphaChannelWithCurrentBrush) const throw() { if (imageToDraw != 0 && ! context->isClipEmpty()) { - const Rectangle srcClip (imageSubRegion.getIntersection (imageToDraw->getBounds())); + const Rectangle srcClip (imageSubRegion.getIntersection (imageToDraw->getBounds())); if (fillAlphaChannelWithCurrentBrush) { diff --git a/src/gui/graphics/contexts/juce_Graphics.h b/src/gui/graphics/contexts/juce_Graphics.h index 7fc311aa82..ea09745572 100644 --- a/src/gui/graphics/contexts/juce_Graphics.h +++ b/src/gui/graphics/contexts/juce_Graphics.h @@ -240,7 +240,7 @@ public: int height) const throw(); /** Fills a rectangle with the current colour or brush. */ - void fillRect (const Rectangle& rectangle) const throw(); + void fillRect (const Rectangle& rectangle) const throw(); /** Fills a rectangle with the current colour or brush. @@ -266,7 +266,7 @@ public: @see drawRoundedRectangle, Path::addRoundedRectangle */ - void fillRoundedRectangle (const Rectangle& rectangle, + void fillRoundedRectangle (const Rectangle& rectangle, const float cornerSize) const throw(); /** Fills a rectangle with a checkerboard pattern, alternating between two colours. @@ -311,7 +311,7 @@ public: @see fillRect */ - void drawRect (const Rectangle& rectangle, + void drawRect (const Rectangle& rectangle, const int lineThickness = 1) const throw(); /** Uses the current colour or brush to draw the outline of a rectangle with rounded corners. @@ -329,7 +329,7 @@ public: @see fillRoundedRectangle, Path::addRoundedRectangle */ - void drawRoundedRectangle (const Rectangle& rectangle, + void drawRoundedRectangle (const Rectangle& rectangle, const float cornerSize, const float lineThickness) const throw(); @@ -576,7 +576,7 @@ public: @see setImageResamplingQuality, drawImage */ void drawImageTransformed (const Image* const imageToDraw, - const Rectangle& imageSubRegion, + const Rectangle& imageSubRegion, const AffineTransform& transform, const bool fillAlphaChannelWithCurrentBrush = false) const throw(); @@ -615,7 +615,7 @@ public: @see getClipRegion, clipRegionIntersects */ - const Rectangle getClipBounds() const throw(); + const Rectangle getClipBounds() const throw(); /** Checks whether a rectangle overlaps the context's clipping region. @@ -661,7 +661,7 @@ public: @returns true if the resulting clipping region is non-zero in size @see reduceClipRegion */ - bool reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, + bool reduceClipRegion (const Image& image, const Rectangle& sourceClipRegion, const AffineTransform& transform) throw(); /** Excludes a rectangle to stop it being drawn into. */ diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsContext.h b/src/gui/graphics/contexts/juce_LowLevelGraphicsContext.h index 2464971ed7..5245f2fd89 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsContext.h +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsContext.h @@ -66,14 +66,14 @@ public: */ virtual void setOrigin (int x, int y) = 0; - virtual bool clipToRectangle (const Rectangle& r) = 0; + virtual bool clipToRectangle (const Rectangle& r) = 0; virtual bool clipToRectangleList (const RectangleList& clipRegion) = 0; - virtual void excludeClipRectangle (const Rectangle& r) = 0; + virtual void excludeClipRectangle (const Rectangle& r) = 0; virtual void clipToPath (const Path& path, const AffineTransform& transform) = 0; - virtual void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) = 0; + virtual void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) = 0; - virtual bool clipRegionIntersects (const Rectangle& r) = 0; - virtual const Rectangle getClipBounds() const = 0; + virtual bool clipRegionIntersects (const Rectangle& r) = 0; + virtual const Rectangle getClipBounds() const = 0; virtual bool isClipEmpty() const = 0; virtual void saveState() = 0; @@ -85,10 +85,10 @@ public: virtual void setInterpolationQuality (Graphics::ResamplingQuality quality) = 0; //============================================================================== - virtual void fillRect (const Rectangle& r, const bool replaceExistingContents) = 0; + virtual void fillRect (const Rectangle& r, const bool replaceExistingContents) = 0; virtual void fillPath (const Path& path, const AffineTransform& transform) = 0; - virtual void drawImage (const Image& sourceImage, const Rectangle& srcClip, + virtual void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles) = 0; virtual void drawLine (double x1, double y1, double x2, double y2) = 0; diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp b/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp index ecadf708db..c42601333c 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp @@ -57,7 +57,7 @@ LowLevelGraphicsPostScriptRenderer::LowLevelGraphicsPostScriptRenderer (OutputSt needToClip (true) { stateStack.add (new SavedState()); - stateStack.getLast()->clip = Rectangle (0, 0, totalWidth_, totalHeight_); + stateStack.getLast()->clip = Rectangle (0, 0, totalWidth_, totalHeight_); const float scale = jmin ((520.0f / totalWidth_), (750.0f / totalHeight)); @@ -112,7 +112,7 @@ void LowLevelGraphicsPostScriptRenderer::setOrigin (int x, int y) } } -bool LowLevelGraphicsPostScriptRenderer::clipToRectangle (const Rectangle& r) +bool LowLevelGraphicsPostScriptRenderer::clipToRectangle (const Rectangle& r) { needToClip = true; return stateStack.getLast()->clip.clipTo (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); @@ -124,7 +124,7 @@ bool LowLevelGraphicsPostScriptRenderer::clipToRectangleList (const RectangleLis return stateStack.getLast()->clip.clipTo (clipRegion); } -void LowLevelGraphicsPostScriptRenderer::excludeClipRectangle (const Rectangle& r) +void LowLevelGraphicsPostScriptRenderer::excludeClipRectangle (const Rectangle& r) { needToClip = true; stateStack.getLast()->clip.subtract (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); @@ -140,18 +140,18 @@ void LowLevelGraphicsPostScriptRenderer::clipToPath (const Path& path, const Aff out << "clip\n"; } -void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& /*sourceImage*/, const Rectangle& /*srcClip*/, const AffineTransform& /*transform*/) +void LowLevelGraphicsPostScriptRenderer::clipToImageAlpha (const Image& /*sourceImage*/, const Rectangle& /*srcClip*/, const AffineTransform& /*transform*/) { needToClip = true; jassertfalse // xxx } -bool LowLevelGraphicsPostScriptRenderer::clipRegionIntersects (const Rectangle& r) +bool LowLevelGraphicsPostScriptRenderer::clipRegionIntersects (const Rectangle& r) { return stateStack.getLast()->clip.intersectsRectangle (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); } -const Rectangle LowLevelGraphicsPostScriptRenderer::getClipBounds() const +const Rectangle LowLevelGraphicsPostScriptRenderer::getClipBounds() const { return stateStack.getLast()->clip.getBounds().translated (-stateStack.getLast()->xOffset, -stateStack.getLast()->yOffset); @@ -205,7 +205,7 @@ void LowLevelGraphicsPostScriptRenderer::writeClip() out << '\n'; } - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); out << r.getX() << ' ' << -r.getY() << ' ' << r.getWidth() << ' ' << -r.getHeight() << " pr "; @@ -333,14 +333,14 @@ void LowLevelGraphicsPostScriptRenderer::setInterpolationQuality (Graphics::Resa } //============================================================================== -void LowLevelGraphicsPostScriptRenderer::fillRect (const Rectangle& r, const bool /*replaceExistingContents*/) +void LowLevelGraphicsPostScriptRenderer::fillRect (const Rectangle& r, const bool /*replaceExistingContents*/) { if (stateStack.getLast()->fillType.isColour()) { writeClip(); writeColour (stateStack.getLast()->fillType.colour); - Rectangle r2 (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); + Rectangle r2 (r.translated (stateStack.getLast()->xOffset, stateStack.getLast()->yOffset)); out << r2.getX() << ' ' << -r2.getBottom() << ' ' << r2.getWidth() << ' ' << r2.getHeight() << " rectfill\n"; } @@ -385,7 +385,7 @@ void LowLevelGraphicsPostScriptRenderer::fillPath (const Path& path, const Affin out << "clip\n"; } - const Rectangle bounds (stateStack.getLast()->clip.getBounds()); + const Rectangle bounds (stateStack.getLast()->clip.getBounds()); // ideally this would draw lots of lines or ellipses to approximate the gradient, but for the // time-being, this just fills it with the average colour.. @@ -454,7 +454,7 @@ void LowLevelGraphicsPostScriptRenderer::writeImage (const Image& im, out << "\n>}\n"; } -void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, +void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool /*fillEntireClipAsTiles*/) { const int w = jmin (sourceImage.getWidth(), srcClip.getRight()); @@ -481,7 +481,7 @@ void LowLevelGraphicsPostScriptRenderer::drawImage (const Image& sourceImage, co itemsOnLine = 0; } - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); out << r.getX() << ' ' << r.getY() << ' ' << r.getWidth() << ' ' << r.getHeight() << " pr "; } diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h b/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h index 9e8127d74f..41551f0dd6 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h @@ -50,17 +50,17 @@ public: bool isVectorDevice() const; void setOrigin (int x, int y); - bool clipToRectangle (const Rectangle& r); + bool clipToRectangle (const Rectangle& r); bool clipToRectangleList (const RectangleList& clipRegion); - void excludeClipRectangle (const Rectangle& r); + void excludeClipRectangle (const Rectangle& r); void clipToPath (const Path& path, const AffineTransform& transform); - void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); + void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); void saveState(); void restoreState(); - bool clipRegionIntersects (const Rectangle& r); - const Rectangle getClipBounds() const; + bool clipRegionIntersects (const Rectangle& r); + const Rectangle getClipBounds() const; bool isClipEmpty() const; //============================================================================== @@ -69,10 +69,10 @@ public: void setInterpolationQuality (Graphics::ResamplingQuality quality); //============================================================================== - void fillRect (const Rectangle& r, const bool replaceExistingContents); + void fillRect (const Rectangle& r, const bool replaceExistingContents); void fillPath (const Path& path, const AffineTransform& transform); - void drawImage (const Image& sourceImage, const Rectangle& srcClip, + void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles); void drawLine (double x1, double y1, double x2, double y2); diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index 6cd7e8cc20..68920865ef 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -184,7 +184,7 @@ public: if (! transform.isIdentity()) { const Line l (x2, y2, x1, y1); - const Point p3 = l.getPointAlongLine (0.0f, 100.0f); + const Point p3 = l.getPointAlongLine (0.0f, 100.0f); float x3 = p3.getX(); float y3 = p3.getY(); @@ -194,7 +194,7 @@ public: const Line l2 (x2, y2, x3, y3); const float prop = l2.findNearestPointTo (x1, y1); - const Point newP2 (l2.getPointAlongLineProportionally (prop)); + const Point newP2 (l2.getPointAlongLineProportionally (prop)); x2 = newP2.getX(); y2 = newP2.getY(); @@ -901,7 +901,7 @@ private: class LLGCSavedState { public: - LLGCSavedState (const Rectangle& clip_, const int xOffset_, const int yOffset_, + LLGCSavedState (const Rectangle& clip_, const int xOffset_, const int yOffset_, const Font& font_, const FillType& fillType_, const Graphics::ResamplingQuality interpolationQuality_) throw() : edgeTable (new EdgeTableHolder (EdgeTable (clip_))), @@ -922,7 +922,7 @@ public: { } - bool clipToRectangle (const Rectangle& r) throw() + bool clipToRectangle (const Rectangle& r) throw() { dupeEdgeTableIfMultiplyReferenced(); edgeTable->edgeTable.clipToRectangle (r.translated (xOffset, yOffset)); @@ -940,7 +940,7 @@ public: return ! edgeTable->edgeTable.isEmpty(); } - bool excludeClipRectangle (const Rectangle& r) throw() + bool excludeClipRectangle (const Rectangle& r) throw() { dupeEdgeTableIfMultiplyReferenced(); edgeTable->edgeTable.excludeRectangle (r.translated (xOffset, yOffset)); @@ -1009,7 +1009,7 @@ public: } //============================================================================== - void renderImage (Image& destImage, const Image& sourceImage, const Rectangle& srcClip, + void renderImage (Image& destImage, const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& t, const EdgeTable* const tiledFillClipRegion) throw() { const AffineTransform transform (t.translated ((float) xOffset, (float) yOffset)); @@ -1036,7 +1036,7 @@ public: } else { - EdgeTable et (Rectangle (tx, ty, srcClip.getWidth(), srcClip.getHeight()).getIntersection (destImage.getBounds())); + EdgeTable et (Rectangle (tx, ty, srcClip.getWidth(), srcClip.getHeight()).getIntersection (destImage.getBounds())); et.clipToEdgeTable (edgeTable->edgeTable); if (! et.isEmpty()) @@ -1068,7 +1068,7 @@ public: } //============================================================================== - void clipToImageAlpha (const Image& image, const Rectangle& srcClip, const AffineTransform& t) throw() + void clipToImageAlpha (const Image& image, const Rectangle& srcClip, const AffineTransform& t) throw() { if (! image.hasAlphaChannel()) { @@ -1107,7 +1107,7 @@ public: if (transform.isSingularity()) { - et.clipToRectangle (Rectangle()); + et.clipToRectangle (Rectangle()); return; } @@ -1140,7 +1140,7 @@ public: template void straightClipImage (EdgeTable& et, const Image::BitmapData& srcData, int imageX, int imageY, const SrcPixelType *) throw() { - Rectangle r (imageX, imageY, srcData.width, srcData.height); + Rectangle r (imageX, imageY, srcData.width, srcData.height); et.clipToRectangle (r); ImageFillEdgeTableRenderer renderer (srcData, srcData, 255, imageX, imageY); @@ -1363,7 +1363,7 @@ void LowLevelGraphicsSoftwareRenderer::setOrigin (int x, int y) currentState->yOffset += y; } -bool LowLevelGraphicsSoftwareRenderer::clipToRectangle (const Rectangle& r) +bool LowLevelGraphicsSoftwareRenderer::clipToRectangle (const Rectangle& r) { return currentState->clipToRectangle (r); } @@ -1373,7 +1373,7 @@ bool LowLevelGraphicsSoftwareRenderer::clipToRectangleList (const RectangleList& return currentState->clipToRectangleList (clipRegion); } -void LowLevelGraphicsSoftwareRenderer::excludeClipRectangle (const Rectangle& r) +void LowLevelGraphicsSoftwareRenderer::excludeClipRectangle (const Rectangle& r) { currentState->excludeClipRectangle (r); } @@ -1383,18 +1383,18 @@ void LowLevelGraphicsSoftwareRenderer::clipToPath (const Path& path, const Affin currentState->clipToPath (path, transform); } -void LowLevelGraphicsSoftwareRenderer::clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) +void LowLevelGraphicsSoftwareRenderer::clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) { currentState->clipToImageAlpha (sourceImage, srcClip, transform); } -bool LowLevelGraphicsSoftwareRenderer::clipRegionIntersects (const Rectangle& r) +bool LowLevelGraphicsSoftwareRenderer::clipRegionIntersects (const Rectangle& r) { return currentState->edgeTable->edgeTable.getMaximumBounds() .intersects (r.translated (currentState->xOffset, currentState->yOffset)); } -const Rectangle LowLevelGraphicsSoftwareRenderer::getClipBounds() const +const Rectangle LowLevelGraphicsSoftwareRenderer::getClipBounds() const { return currentState->edgeTable->edgeTable.getMaximumBounds().translated (-currentState->xOffset, -currentState->yOffset); } @@ -1442,10 +1442,10 @@ void LowLevelGraphicsSoftwareRenderer::setInterpolationQuality (Graphics::Resamp } //============================================================================== -void LowLevelGraphicsSoftwareRenderer::fillRect (const Rectangle& r, const bool replaceExistingContents) +void LowLevelGraphicsSoftwareRenderer::fillRect (const Rectangle& r, const bool replaceExistingContents) { - const Rectangle& totalClip = currentState->edgeTable->edgeTable.getMaximumBounds(); - const Rectangle clipped (totalClip.getIntersection (r.translated (currentState->xOffset, currentState->yOffset))); + const Rectangle& totalClip = currentState->edgeTable->edgeTable.getMaximumBounds(); + const Rectangle clipped (totalClip.getIntersection (r.translated (currentState->xOffset, currentState->yOffset))); if (! clipped.isEmpty()) { @@ -1463,7 +1463,7 @@ void LowLevelGraphicsSoftwareRenderer::fillPath (const Path& path, const AffineT currentState->fillEdgeTable (image, et); } -void LowLevelGraphicsSoftwareRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, +void LowLevelGraphicsSoftwareRenderer::drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles) { jassert (sourceImage.getBounds().contains (srcClip)); @@ -1590,15 +1590,11 @@ public: if (! glyphPath.isEmpty()) { const float fontHeight = font.getHeight(); - const AffineTransform transform (AffineTransform::scale (fontHeight * font.getHorizontalScale(), fontHeight)); + const AffineTransform transform (AffineTransform::scale (fontHeight * font.getHorizontalScale(), fontHeight) + .translated (0.0f, -0.5f)); - float px, py, pw, ph; - glyphPath.getBoundsTransformed (transform.translated (0.0f, -0.5f), px, py, pw, ph); - - Rectangle clip ((int) floorf (px), (int) floorf (py), - roundToInt (pw) + 2, roundToInt (ph) + 2); - - edgeTable = new EdgeTable (clip, glyphPath, transform); + edgeTable = new EdgeTable (glyphPath.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0), + glyphPath, transform); } } diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h index 916ad79d05..0b87f3eca8 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h @@ -49,14 +49,14 @@ public: //============================================================================== void setOrigin (int x, int y); - bool clipToRectangle (const Rectangle& r); + bool clipToRectangle (const Rectangle& r); bool clipToRectangleList (const RectangleList& clipRegion); - void excludeClipRectangle (const Rectangle& r); + void excludeClipRectangle (const Rectangle& r); void clipToPath (const Path& path, const AffineTransform& transform); - void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); + void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform); - bool clipRegionIntersects (const Rectangle& r); - const Rectangle getClipBounds() const; + bool clipRegionIntersects (const Rectangle& r); + const Rectangle getClipBounds() const; bool isClipEmpty() const; void saveState(); @@ -68,10 +68,10 @@ public: void setInterpolationQuality (Graphics::ResamplingQuality quality); //============================================================================== - void fillRect (const Rectangle& r, const bool replaceExistingContents); + void fillRect (const Rectangle& r, const bool replaceExistingContents); void fillPath (const Path& path, const AffineTransform& transform); - void drawImage (const Image& sourceImage, const Rectangle& srcClip, + void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles); void drawLine (double x1, double y1, double x2, double y2); diff --git a/src/gui/graphics/drawables/juce_Drawable.cpp b/src/gui/graphics/drawables/juce_Drawable.cpp index 60d9dcf36b..bec9f50f70 100644 --- a/src/gui/graphics/drawables/juce_Drawable.cpp +++ b/src/gui/graphics/drawables/juce_Drawable.cpp @@ -76,11 +76,10 @@ void Drawable::drawWithin (Graphics& g, { if (destW > 0 && destH > 0) { - float x, y, w, h; - getBounds (x, y, w, h); + Rectangle bounds (getBounds()); draw (g, opacity, - placement.getTransformToFit (x, y, w, h, + placement.getTransformToFit (bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight(), (float) destX, (float) destY, (float) destW, (float) destH)); } diff --git a/src/gui/graphics/drawables/juce_Drawable.h b/src/gui/graphics/drawables/juce_Drawable.h index 9c8303c571..945156f0ec 100644 --- a/src/gui/graphics/drawables/juce_Drawable.h +++ b/src/gui/graphics/drawables/juce_Drawable.h @@ -130,7 +130,7 @@ public: Co-ordinates are relative to the object's own origin. */ - virtual void getBounds (float& x, float& y, float& width, float& height) const = 0; + virtual const Rectangle getBounds() const = 0; /** Returns true if the given point is somewhere inside this Drawable. diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.cpp b/src/gui/graphics/drawables/juce_DrawableComposite.cpp index 4a96771c8e..2bb0c02f8d 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.cpp +++ b/src/gui/graphics/drawables/juce_DrawableComposite.cpp @@ -111,7 +111,7 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const // To correctly render a whole composite layer with an overall transparency, // we need to render everything opaquely into a temp buffer, then blend that // with the target opacity... - const Rectangle clipBounds (context.g.getClipBounds()); + const Rectangle clipBounds (context.g.getClipBounds()); Image tempImage (Image::ARGB, clipBounds.getWidth(), clipBounds.getHeight(), true); { @@ -127,29 +127,20 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const } } -void DrawableComposite::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawableComposite::getBounds() const { - Path totalPath; + Rectangle bounds; for (int i = 0; i < drawables.size(); ++i) { - drawables.getUnchecked(i)->getBounds (x, y, width, height); + const Drawable* const d = drawables.getUnchecked(i); + const AffineTransform* const t = transforms.getUnchecked(i); - if (width > 0.0f && height > 0.0f) - { - Path outline; - outline.addRectangle (x, y, width, height); - - const AffineTransform* const t = transforms.getUnchecked(i); - - if (t == 0) - totalPath.addPath (outline); - else - totalPath.addPath (outline, *t); - } + bounds = bounds.getUnion (t == 0 ? d->getBounds() + : d->getBounds().transformed (*t)); } - totalPath.getBounds (x, y, width, height); + return bounds; } bool DrawableComposite::hitTest (float x, float y) const diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.h b/src/gui/graphics/drawables/juce_DrawableComposite.h index 6cc4c42058..265f6c460b 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.h +++ b/src/gui/graphics/drawables/juce_DrawableComposite.h @@ -134,7 +134,7 @@ public: /** @internal */ void render (const Drawable::RenderingContext& context) const; /** @internal */ - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; /** @internal */ bool hitTest (float x, float y) const; /** @internal */ diff --git a/src/gui/graphics/drawables/juce_DrawableImage.cpp b/src/gui/graphics/drawables/juce_DrawableImage.cpp index 6828fe6bf9..63449f88de 100644 --- a/src/gui/graphics/drawables/juce_DrawableImage.cpp +++ b/src/gui/graphics/drawables/juce_DrawableImage.cpp @@ -102,18 +102,12 @@ void DrawableImage::render (const Drawable::RenderingContext& context) const } } -void DrawableImage::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawableImage::getBounds() const { - x = 0.0f; - y = 0.0f; - width = 0.0f; - height = 0.0f; + if (image == 0) + return Rectangle(); - if (image != 0) - { - width = (float) image->getWidth(); - height = (float) image->getHeight(); - } + return Rectangle (0, 0, (float) image->getWidth(), (float) image->getHeight()); } bool DrawableImage::hitTest (float x, float y) const diff --git a/src/gui/graphics/drawables/juce_DrawableImage.h b/src/gui/graphics/drawables/juce_DrawableImage.h index 09decedd51..616664ab5d 100644 --- a/src/gui/graphics/drawables/juce_DrawableImage.h +++ b/src/gui/graphics/drawables/juce_DrawableImage.h @@ -102,7 +102,7 @@ public: /** @internal */ void render (const Drawable::RenderingContext& context) const; /** @internal */ - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; /** @internal */ bool hitTest (float x, float y) const; /** @internal */ diff --git a/src/gui/graphics/drawables/juce_DrawablePath.cpp b/src/gui/graphics/drawables/juce_DrawablePath.cpp index 11e2c0e3ae..2fd86d2fed 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.cpp +++ b/src/gui/graphics/drawables/juce_DrawablePath.cpp @@ -102,12 +102,12 @@ void DrawablePath::updateOutline() strokeType.createStrokedPath (stroke, path, AffineTransform::identity, 4.0f); } -void DrawablePath::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawablePath::getBounds() const { if (strokeType.getStrokeThickness() > 0.0f) - stroke.getBounds (x, y, width, height); + return stroke.getBounds(); else - path.getBounds (x, y, width, height); + return path.getBounds(); } bool DrawablePath::hitTest (float x, float y) const diff --git a/src/gui/graphics/drawables/juce_DrawablePath.h b/src/gui/graphics/drawables/juce_DrawablePath.h index ba1bbacd0c..287f7f487f 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.h +++ b/src/gui/graphics/drawables/juce_DrawablePath.h @@ -101,7 +101,7 @@ public: /** @internal */ void render (const Drawable::RenderingContext& context) const; /** @internal */ - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; /** @internal */ bool hitTest (float x, float y) const; /** @internal */ diff --git a/src/gui/graphics/drawables/juce_DrawableText.cpp b/src/gui/graphics/drawables/juce_DrawableText.cpp index beb50aba40..164862dc10 100644 --- a/src/gui/graphics/drawables/juce_DrawableText.cpp +++ b/src/gui/graphics/drawables/juce_DrawableText.cpp @@ -65,11 +65,13 @@ void DrawableText::render (const Drawable::RenderingContext& context) const text.draw (context.g, context.transform); } -void DrawableText::getBounds (float& x, float& y, float& width, float& height) const +const Rectangle DrawableText::getBounds() const { - text.getBoundingBox (0, -1, x, y, width, height, false); // (really returns top, left, bottom, right) - width -= x; - height -= y; + float x, y, w, h; + text.getBoundingBox (0, -1, x, y, w, h, false); // (really returns top, left, bottom, right) + w -= x; + h -= y; + return Rectangle (x, y, w, h); } bool DrawableText::hitTest (float x, float y) const diff --git a/src/gui/graphics/drawables/juce_DrawableText.h b/src/gui/graphics/drawables/juce_DrawableText.h index c8e3585a10..ef82404a80 100644 --- a/src/gui/graphics/drawables/juce_DrawableText.h +++ b/src/gui/graphics/drawables/juce_DrawableText.h @@ -72,7 +72,7 @@ public: /** @internal */ void render (const Drawable::RenderingContext& context) const; /** @internal */ - void getBounds (float& x, float& y, float& width, float& height) const; + const Rectangle getBounds() const; /** @internal */ bool hitTest (float x, float y) const; /** @internal */ diff --git a/src/gui/graphics/drawables/juce_SVGParser.cpp b/src/gui/graphics/drawables/juce_SVGParser.cpp index dad8c4f641..164bd339dd 100644 --- a/src/gui/graphics/drawables/juce_SVGParser.cpp +++ b/src/gui/graphics/drawables/juce_SVGParser.cpp @@ -736,7 +736,13 @@ private: const bool userSpace = fillXml->getStringAttribute (T("gradientUnits")).equalsIgnoreCase (T("userSpaceOnUse")); if (! userSpace) - path.getBounds (dx, dy, width, height); + { + const Rectangle bounds (path.getBounds()); + dx = bounds.getX(); + dy = bounds.getY(); + width = bounds.getWidth(); + height = bounds.getHeight(); + } if (gradient.isRadial) { diff --git a/src/gui/graphics/geometry/juce_BorderSize.cpp b/src/gui/graphics/geometry/juce_BorderSize.cpp index d7c121be36..f3c8130406 100644 --- a/src/gui/graphics/geometry/juce_BorderSize.cpp +++ b/src/gui/graphics/geometry/juce_BorderSize.cpp @@ -92,15 +92,15 @@ void BorderSize::setRight (const int newRightGap) throw() } //============================================================================== -const Rectangle BorderSize::subtractedFrom (const Rectangle& r) const throw() +const Rectangle BorderSize::subtractedFrom (const Rectangle& r) const throw() { - return Rectangle (r.getX() + left, - r.getY() + top, - r.getWidth() - (left + right), - r.getHeight() - (top + bottom)); + return Rectangle (r.getX() + left, + r.getY() + top, + r.getWidth() - (left + right), + r.getHeight() - (top + bottom)); } -void BorderSize::subtractFrom (Rectangle& r) const throw() +void BorderSize::subtractFrom (Rectangle& r) const throw() { r.setBounds (r.getX() + left, r.getY() + top, @@ -108,15 +108,15 @@ void BorderSize::subtractFrom (Rectangle& r) const throw() r.getHeight() - (top + bottom)); } -const Rectangle BorderSize::addedTo (const Rectangle& r) const throw() +const Rectangle BorderSize::addedTo (const Rectangle& r) const throw() { - return Rectangle (r.getX() - left, - r.getY() - top, - r.getWidth() + (left + right), - r.getHeight() + (top + bottom)); + return Rectangle (r.getX() - left, + r.getY() - top, + r.getWidth() + (left + right), + r.getHeight() + (top + bottom)); } -void BorderSize::addTo (Rectangle& r) const throw() +void BorderSize::addTo (Rectangle& r) const throw() { r.setBounds (r.getX() - left, r.getY() - top, diff --git a/src/gui/graphics/geometry/juce_BorderSize.h b/src/gui/graphics/geometry/juce_BorderSize.h index fca37f5783..2125419e62 100644 --- a/src/gui/graphics/geometry/juce_BorderSize.h +++ b/src/gui/graphics/geometry/juce_BorderSize.h @@ -97,16 +97,16 @@ public: //============================================================================== /** Returns a rectangle with these borders removed from it. */ - const Rectangle subtractedFrom (const Rectangle& original) const throw(); + const Rectangle subtractedFrom (const Rectangle& original) const throw(); /** Removes this border from a given rectangle. */ - void subtractFrom (Rectangle& rectangle) const throw(); + void subtractFrom (Rectangle& rectangle) const throw(); /** Returns a rectangle with these borders added around it. */ - const Rectangle addedTo (const Rectangle& original) const throw(); + const Rectangle addedTo (const Rectangle& original) const throw(); /** Adds this border around a given rectangle. */ - void addTo (Rectangle& original) const throw(); + void addTo (Rectangle& original) const throw(); //============================================================================== bool operator== (const BorderSize& other) const throw(); diff --git a/src/gui/graphics/geometry/juce_Line.cpp b/src/gui/graphics/geometry/juce_Line.cpp index e86688cc4f..e51297d90b 100644 --- a/src/gui/graphics/geometry/juce_Line.cpp +++ b/src/gui/graphics/geometry/juce_Line.cpp @@ -136,8 +136,8 @@ Line::Line (const float startX_, const float startY_, { } -Line::Line (const Point& start, - const Point& end) throw() +Line::Line (const Point& start, + const Point& end) throw() : startX (start.getX()), startY (start.getY()), endX (end.getX()), @@ -160,14 +160,14 @@ Line::~Line() throw() } //============================================================================== -const Point Line::getStart() const throw() +const Point Line::getStart() const throw() { - return Point (startX, startY); + return Point (startX, startY); } -const Point Line::getEnd() const throw() +const Point Line::getEnd() const throw() { - return Point (endX, endY); + return Point (endX, endY); } void Line::setStart (const float newStartX, @@ -177,7 +177,7 @@ void Line::setStart (const float newStartX, startY = newStartY; } -void Line::setStart (const Point& newStart) throw() +void Line::setStart (const Point& newStart) throw() { startX = newStart.getX(); startY = newStart.getY(); @@ -190,7 +190,7 @@ void Line::setEnd (const float newEndX, endY = newEndY; } -void Line::setEnd (const Point& newEnd) throw() +void Line::setEnd (const Point& newEnd) throw() { endX = newEnd.getX(); endY = newEnd.getY(); @@ -232,32 +232,32 @@ float Line::getAngle() const throw() endY - startY); } -const Point Line::getPointAlongLine (const float distanceFromStart) const throw() +const Point Line::getPointAlongLine (const float distanceFromStart) const throw() { const float alpha = distanceFromStart / getLength(); - return Point (startX + (endX - startX) * alpha, - startY + (endY - startY) * alpha); + return Point (startX + (endX - startX) * alpha, + startY + (endY - startY) * alpha); } -const Point Line::getPointAlongLine (const float offsetX, - const float offsetY) const throw() +const Point Line::getPointAlongLine (const float offsetX, + const float offsetY) const throw() { const float dx = endX - startX; const float dy = endY - startY; const double length = juce_hypot (dx, dy); if (length == 0) - return Point (startX, startY); + return Point (startX, startY); else - return Point (startX + (float) (((dx * offsetX) - (dy * offsetY)) / length), - startY + (float) (((dy * offsetX) + (dx * offsetY)) / length)); + return Point (startX + (float) (((dx * offsetX) - (dy * offsetY)) / length), + startY + (float) (((dy * offsetX) + (dx * offsetY)) / length)); } -const Point Line::getPointAlongLineProportionally (const float alpha) const throw() +const Point Line::getPointAlongLineProportionally (const float alpha) const throw() { - return Point (startX + (endX - startX) * alpha, - startY + (endY - startY) * alpha); + return Point (startX + (endX - startX) * alpha, + startY + (endY - startY) * alpha); } float Line::getDistanceFromLine (const float x, diff --git a/src/gui/graphics/geometry/juce_Line.h b/src/gui/graphics/geometry/juce_Line.h index 5269bb5b29..7aaf8a1a5d 100644 --- a/src/gui/graphics/geometry/juce_Line.h +++ b/src/gui/graphics/geometry/juce_Line.h @@ -56,8 +56,8 @@ public: const float endY) throw(); /** Creates a line from its start and end points. */ - Line (const Point& start, - const Point& end) throw(); + Line (const Point& start, + const Point& end) throw(); /** Copies a line from another one. */ const Line& operator= (const Line& other) throw(); @@ -79,10 +79,10 @@ public: inline float getEndY() const throw() { return endY; } /** Returns the line's start point. */ - const Point getStart() const throw(); + const Point getStart() const throw(); /** Returns the line's end point. */ - const Point getEnd() const throw(); + const Point getEnd() const throw(); /** Changes this line's start point */ void setStart (const float newStartX, @@ -93,10 +93,10 @@ public: const float newEndY) throw(); /** Changes this line's start point */ - void setStart (const Point& newStart) throw(); + void setStart (const Point& newStart) throw(); /** Changes this line's end point */ - void setEnd (const Point& newEnd) throw(); + void setEnd (const Point& newEnd) throw(); /** Applies an affine transform to the line's start and end points. */ void applyTransform (const AffineTransform& transform) throw(); @@ -151,7 +151,7 @@ public: than the line itself @see getPointAlongLineProportionally */ - const Point getPointAlongLine (const float distanceFromStart) const throw(); + const Point getPointAlongLine (const float distanceFromStart) const throw(); /** Returns a point which is a certain distance along and to the side of this line. @@ -166,8 +166,8 @@ public: end, then a positive value here will move to the right, negative value move to the left. */ - const Point getPointAlongLine (const float distanceFromStart, - const float perpendicularDistance) const throw(); + const Point getPointAlongLine (const float distanceFromStart, + const float perpendicularDistance) const throw(); /** Returns the location of the point which is a given distance along this line proportional to the line's length. @@ -179,7 +179,7 @@ public: can be negative or greater than 1.0). @see getPointAlongLine */ - const Point getPointAlongLineProportionally (const float proportionOfLength) const throw(); + const Point getPointAlongLineProportionally (const float proportionOfLength) const throw(); /** Returns the smallest distance between this line segment and a given point. diff --git a/src/gui/graphics/geometry/juce_Path.cpp b/src/gui/graphics/geometry/juce_Path.cpp index d090296b26..54318ddbbd 100644 --- a/src/gui/graphics/geometry/juce_Path.cpp +++ b/src/gui/graphics/geometry/juce_Path.cpp @@ -153,40 +153,17 @@ bool Path::isEmpty() const throw() return true; } -void Path::getBounds (float& x, float& y, - float& w, float& h) const throw() +const Rectangle Path::getBounds () const throw() { - x = pathXMin; - y = pathYMin; - w = pathXMax - pathXMin; - h = pathYMax - pathYMin; + return Rectangle (pathXMin, pathYMin, + pathXMax - pathXMin, + pathYMax - pathYMin); } -void Path::getBoundsTransformed (const AffineTransform& transform, - float& x, float& y, - float& w, float& h) const throw() +const Rectangle Path::getBoundsTransformed (const AffineTransform& transform) const throw() { - float x1 = pathXMin; - float y1 = pathYMin; - transform.transformPoint (x1, y1); - - float x2 = pathXMax; - float y2 = pathYMin; - transform.transformPoint (x2, y2); - - float x3 = pathXMin; - float y3 = pathYMax; - transform.transformPoint (x3, y3); - - float x4 = pathXMax; - float y4 = pathYMax; - transform.transformPoint (x4, y4); - - x = jmin (x1, x2, x3, x4); - y = jmin (y1, y2, y3, y4); - w = jmax (x1, x2, x3, x4) - x; - h = jmax (y1, y2, y3, y4) - y; + return getBounds().transformed (transform); } //============================================================================== @@ -294,7 +271,7 @@ void Path::closeSubPath() throw() } } -const Point Path::getCurrentPosition() const +const Point Path::getCurrentPosition() const { int i = numElements - 1; @@ -313,9 +290,9 @@ const Point Path::getCurrentPosition() const } if (i > 0) - return Point (data.elements [i - 1], data.elements [i]); + return Point (data.elements [i - 1], data.elements [i]); - return Point (0.0f, 0.0f); + return Point(); } void Path::addRectangle (const float x, const float y, @@ -361,7 +338,7 @@ void Path::addRectangle (const float x, const float y, data.elements [numElements++] = closeSubPathMarker; } -void Path::addRectangle (const Rectangle& rectangle) throw() +void Path::addRectangle (const Rectangle& rectangle) throw() { addRectangle ((float) rectangle.getX(), (float) rectangle.getY(), (float) rectangle.getWidth(), (float) rectangle.getHeight()); @@ -979,16 +956,15 @@ const AffineTransform Path::getTransformToScaleToFit (const float x, const float const bool preserveProportions, const Justification& justification) const throw() { - float sx, sy, sw, sh; - getBounds (sx, sy, sw, sh); + Rectangle bounds (getBounds()); if (preserveProportions) { - if (w <= 0 || h <= 0 || sw <= 0 || sh <= 0) + if (w <= 0 || h <= 0 || bounds.isEmpty()) return AffineTransform::identity; float newW, newH; - const float srcRatio = sh / sw; + const float srcRatio = bounds.getHeight() / bounds.getWidth(); if (srcRatio > h / w) { @@ -1018,14 +994,15 @@ const AffineTransform Path::getTransformToScaleToFit (const float x, const float else newYCentre += h * 0.5f; - return AffineTransform::translation (sw * -0.5f - sx, sh * -0.5f - sy) - .scaled (newW / sw, newH / sh) + return AffineTransform::translation (bounds.getWidth() * -0.5f - bounds.getX(), + bounds.getHeight() * -0.5f - bounds.getY()) + .scaled (newW / bounds.getWidth(), newH / bounds.getHeight()) .translated (newXCentre, newYCentre); } else { - return AffineTransform::translation (-sx, -sy) - .scaled (w / sw, h / sh) + return AffineTransform::translation (-bounds.getX(), -bounds.getY()) + .scaled (w / bounds.getWidth(), h / bounds.getHeight()) .translated (x, y); } } diff --git a/src/gui/graphics/geometry/juce_Path.h b/src/gui/graphics/geometry/juce_Path.h index 508e12068e..372f9e04e2 100644 --- a/src/gui/graphics/geometry/juce_Path.h +++ b/src/gui/graphics/geometry/juce_Path.h @@ -91,15 +91,12 @@ public: /** Returns the smallest rectangle that contains all points within the path. */ - void getBounds (float& x, float& y, - float& w, float& h) const throw(); + const Rectangle getBounds() const throw(); /** Returns the smallest rectangle that contains all points within the path after it's been transformed with the given tranasform matrix. */ - void getBoundsTransformed (const AffineTransform& transform, - float& x, float& y, - float& w, float& h) const throw(); + const Rectangle getBoundsTransformed (const AffineTransform& transform) const throw(); /** Checks whether a point lies within the path. @@ -208,7 +205,7 @@ public: /** Returns the last point that was added to the path by one of the drawing methods. */ - const Point getCurrentPosition() const; + const Point getCurrentPosition() const; //============================================================================== /** Adds a rectangle to the path. @@ -228,7 +225,7 @@ public: @see addRoundedRectangle, addTriangle */ - void addRectangle (const Rectangle& rectangle) throw(); + void addRectangle (const Rectangle& rectangle) throw(); /** Adds a rectangle with rounded corners to the path. diff --git a/src/gui/graphics/geometry/juce_Point.cpp b/src/gui/graphics/geometry/juce_Point.cpp deleted file mode 100644 index 0498324047..0000000000 --- a/src/gui/graphics/geometry/juce_Point.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - ============================================================================== - - This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. - - ------------------------------------------------------------------------------ - - JUCE can be redistributed and/or modified under the terms of the GNU General - Public License (Version 2), as published by the Free Software Foundation. - A copy of the license is included in the JUCE distribution, or can be found - online at www.gnu.org/licenses. - - JUCE is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - ------------------------------------------------------------------------------ - - To release a closed-source product which uses JUCE, commercial licenses are - available: visit www.rawmaterialsoftware.com/juce for more information. - - ============================================================================== -*/ - -#include "../../../core/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - - -#include "juce_Point.h" - - -//============================================================================== -Point::Point() throw() - : x (0.0f), - y (0.0f) -{ -} - -Point::Point (const Point& other) throw() - : x (other.x), - y (other.y) -{ -} - -const Point& Point::operator= (const Point& other) throw() -{ - x = other.x; - y = other.y; - - return *this; -} - -Point::Point (const float x_, - const float y_) throw() - : x (x_), - y (y_) -{ -} - -Point::~Point() throw() -{ -} - -void Point::setXY (const float x_, - const float y_) throw() -{ - x = x_; - y = y_; -} - -void Point::applyTransform (const AffineTransform& transform) throw() -{ - transform.transformPoint (x, y); -} - -END_JUCE_NAMESPACE diff --git a/src/gui/graphics/geometry/juce_Point.h b/src/gui/graphics/geometry/juce_Point.h index 300aa16d64..17077bfc02 100644 --- a/src/gui/graphics/geometry/juce_Point.h +++ b/src/gui/graphics/geometry/juce_Point.h @@ -33,54 +33,68 @@ /** A pair of (x, y) co-ordinates. - Uses 32-bit floating point accuracy. + The ValueType template should be a primitive type such as int, float, double, + rather than a class. @see Line, Path, AffineTransform */ -class JUCE_API Point +template +class Point { public: //============================================================================== /** Creates a point with co-ordinates (0, 0). */ - Point() throw(); + Point() throw() : x (0), y (0) {} /** Creates a copy of another point. */ - Point (const Point& other) throw(); + Point (const Point& other) throw() : x (other.x), y (other.y) {} /** Creates a point from an (x, y) position. */ - Point (const float x, const float y) throw(); - - /** Copies this point from another one. - @see setXY - */ - const Point& operator= (const Point& other) throw(); + Point (const ValueType initialX, const ValueType initialY) throw() : x (initialX), y (initialY) {} /** Destructor. */ - ~Point() throw(); + ~Point() throw() {} //============================================================================== + /** Copies this point from another one. */ + Point& operator= (const Point& other) throw() { x = other.x; y = other.y; return *this; } + /** Returns the point's x co-ordinate. */ - inline float getX() const throw() { return x; } + inline ValueType getX() const throw() { return x; } /** Returns the point's y co-ordinate. */ - inline float getY() const throw() { return y; } + inline ValueType getY() const throw() { return y; } /** Changes the point's x and y co-ordinates. */ - void setXY (const float x, - const float y) throw(); + void setXY (const ValueType newX, const ValueType newY) throw() { x = newX; y = newY; } + + /** Adds a pair of co-ordinates to this value. */ + void addXY (const ValueType xToAdd, const ValueType yToAdd) throw() { x += xToAdd; y += yToAdd; } + + /** Adds two points together. */ + const Point operator+ (const Point& other) const throw() { return Point (x + other.x, y + other.y); } + + /** Adds another point's co-ordinates to this one. */ + Point& operator+= (const Point& other) throw() { x += other.x; y += other.y; return *this; } + + /** Subtracts one points from another. */ + const Point operator- (const Point& other) const throw() { return Point (x - other.x, y - other.y); } + + /** Subtracts another point's co-ordinates to this one. */ + Point& operator-= (const Point& other) throw() { x -= other.x; y -= other.y; return *this; } /** Uses a transform to change the point's co-ordinates. - + This will only compile if ValueType = float! @see AffineTransform::transformPoint */ - void applyTransform (const AffineTransform& transform) throw(); + void applyTransform (const AffineTransform& transform) throw() { transform.transformPoint (x, y); } //============================================================================== juce_UseDebuggingNewOperator private: - float x, y; + ValueType x, y; }; diff --git a/src/gui/graphics/geometry/juce_PositionedRectangle.cpp b/src/gui/graphics/geometry/juce_PositionedRectangle.cpp index af5114770b..5de3961f56 100644 --- a/src/gui/graphics/geometry/juce_PositionedRectangle.cpp +++ b/src/gui/graphics/geometry/juce_PositionedRectangle.cpp @@ -119,7 +119,7 @@ const String PositionedRectangle::toString() const throw() } //============================================================================== -const Rectangle PositionedRectangle::getRectangle (const Rectangle& target) const throw() +const Rectangle PositionedRectangle::getRectangle (const Rectangle& target) const throw() { jassert (! target.isEmpty()); @@ -127,11 +127,11 @@ const Rectangle PositionedRectangle::getRectangle (const Rectangle& target) cons applyPosAndSize (x_, w_, x, w, xMode, wMode, target.getX(), target.getWidth()); applyPosAndSize (y_, h_, y, h, yMode, hMode, target.getY(), target.getHeight()); - return Rectangle (roundToInt (x_), roundToInt (y_), - roundToInt (w_), roundToInt (h_)); + return Rectangle (roundToInt (x_), roundToInt (y_), + roundToInt (w_), roundToInt (h_)); } -void PositionedRectangle::getRectangleDouble (const Rectangle& target, +void PositionedRectangle::getRectangleDouble (const Rectangle& target, double& x_, double& y_, double& w_, double& h_) const throw() { @@ -143,12 +143,12 @@ void PositionedRectangle::getRectangleDouble (const Rectangle& target, void PositionedRectangle::applyToComponent (Component& comp) const throw() { - comp.setBounds (getRectangle (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()))); + comp.setBounds (getRectangle (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()))); } //============================================================================== -void PositionedRectangle::updateFrom (const Rectangle& rectangle, - const Rectangle& target) throw() +void PositionedRectangle::updateFrom (const Rectangle& rectangle, + const Rectangle& target) throw() { updatePosAndSize (x, w, rectangle.getX(), rectangle.getWidth(), xMode, wMode, target.getX(), target.getWidth()); updatePosAndSize (y, h, rectangle.getY(), rectangle.getHeight(), yMode, hMode, target.getY(), target.getHeight()); @@ -156,7 +156,7 @@ void PositionedRectangle::updateFrom (const Rectangle& rectangle, void PositionedRectangle::updateFromDouble (const double newX, const double newY, const double newW, const double newH, - const Rectangle& target) throw() + const Rectangle& target) throw() { updatePosAndSize (x, w, newX, newW, xMode, wMode, target.getX(), target.getWidth()); updatePosAndSize (y, h, newY, newH, yMode, hMode, target.getY(), target.getHeight()); @@ -165,9 +165,9 @@ void PositionedRectangle::updateFromDouble (const double newX, const double newY void PositionedRectangle::updateFromComponent (const Component& comp) throw() { if (comp.getParentComponent() == 0 && ! comp.isOnDesktop()) - updateFrom (comp.getBounds(), Rectangle()); + updateFrom (comp.getBounds(), Rectangle()); else - updateFrom (comp.getBounds(), Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight())); + updateFrom (comp.getBounds(), Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight())); } //============================================================================== @@ -213,7 +213,7 @@ void PositionedRectangle::setModes (const AnchorPoint xAnchor, const PositionMode yMode_, const SizeMode widthMode, const SizeMode heightMode, - const Rectangle& target) throw() + const Rectangle& target) throw() { if (xMode != (xAnchor | xMode_) || wMode != widthMode) { diff --git a/src/gui/graphics/geometry/juce_PositionedRectangle.h b/src/gui/graphics/geometry/juce_PositionedRectangle.h index 6e5dd642df..b4bd860620 100644 --- a/src/gui/graphics/geometry/juce_PositionedRectangle.h +++ b/src/gui/graphics/geometry/juce_PositionedRectangle.h @@ -128,11 +128,11 @@ public: @see applyToComponent */ - const Rectangle getRectangle (const Rectangle& targetSpaceToBeRelativeTo) const throw(); + const Rectangle getRectangle (const Rectangle& targetSpaceToBeRelativeTo) const throw(); /** Same as getRectangle(), but returning the values as doubles rather than ints. */ - void getRectangleDouble (const Rectangle& targetSpaceToBeRelativeTo, + void getRectangleDouble (const Rectangle& targetSpaceToBeRelativeTo, double& x, double& y, double& width, @@ -142,7 +142,7 @@ public: This is equivalent to writing: @code - comp.setBounds (getRectangle (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()))); + comp.setBounds (getRectangle (Rectangle (0, 0, comp.getParentWidth(), comp.getParentHeight()))); @endcode @see getRectangle, updateFromComponent @@ -163,14 +163,14 @@ public: to re-calculate some proportional co-ordinates. In this case, those co-ordinates will not be changed. */ - void updateFrom (const Rectangle& newPosition, - const Rectangle& targetSpaceToBeRelativeTo) throw(); + void updateFrom (const Rectangle& newPosition, + const Rectangle& targetSpaceToBeRelativeTo) throw(); /** Same functionality as updateFrom(), but taking doubles instead of ints. */ void updateFromDouble (const double x, const double y, const double width, const double height, - const Rectangle& targetSpaceToBeRelativeTo) throw(); + const Rectangle& targetSpaceToBeRelativeTo) throw(); /** Updates this object's co-ordinates to match the bounds of this component. @@ -222,7 +222,7 @@ public: const PositionMode yPositionMode, const SizeMode widthMode, const SizeMode heightMode, - const Rectangle& targetSpaceToBeRelativeTo) throw(); + const Rectangle& targetSpaceToBeRelativeTo) throw(); /** Returns the anchoring mode for the x co-ordinate. To change any of the modes, use setModes(). diff --git a/src/gui/graphics/geometry/juce_Rectangle.cpp b/src/gui/graphics/geometry/juce_Rectangle.cpp deleted file mode 100644 index 4871ff9162..0000000000 --- a/src/gui/graphics/geometry/juce_Rectangle.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/* - ============================================================================== - - This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-9 by Raw Material Software Ltd. - - ------------------------------------------------------------------------------ - - JUCE can be redistributed and/or modified under the terms of the GNU General - Public License (Version 2), as published by the Free Software Foundation. - A copy of the license is included in the JUCE distribution, or can be found - online at www.gnu.org/licenses. - - JUCE is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - ------------------------------------------------------------------------------ - - To release a closed-source product which uses JUCE, commercial licenses are - available: visit www.rawmaterialsoftware.com/juce for more information. - - ============================================================================== -*/ - -#include "../../../core/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "juce_Rectangle.h" -#include "../../../text/juce_StringArray.h" - - -//============================================================================== -Rectangle::Rectangle() throw() - : x (0), - y (0), - w (0), - h (0) -{ -} - -Rectangle::Rectangle (const int x_, const int y_, - const int w_, const int h_) throw() - : x (x_), - y (y_), - w (w_), - h (h_) -{ -} - -Rectangle::Rectangle (const int w_, const int h_) throw() - : x (0), - y (0), - w (w_), - h (h_) -{ -} - -Rectangle::Rectangle (const Rectangle& other) throw() - : x (other.x), - y (other.y), - w (other.w), - h (other.h) -{ -} - -Rectangle::~Rectangle() throw() -{ -} - -//============================================================================== -bool Rectangle::isEmpty() const throw() -{ - return w <= 0 || h <= 0; -} - -void Rectangle::setBounds (const int x_, - const int y_, - const int w_, - const int h_) throw() -{ - x = x_; - y = y_; - w = w_; - h = h_; -} - -void Rectangle::setPosition (const int x_, - const int y_) throw() -{ - x = x_; - y = y_; -} - -void Rectangle::setSize (const int w_, - const int h_) throw() -{ - w = w_; - h = h_; -} - -void Rectangle::setWidth (const int newWidth) throw() -{ - w = newWidth; -} - -void Rectangle::setHeight (const int newHeight) throw() -{ - h = newHeight; -} - -void Rectangle::setLeft (const int newLeft) throw() -{ - w = jmax (0, x + w - newLeft); - x = newLeft; -} - -void Rectangle::setTop (const int newTop) throw() -{ - h = jmax (0, y + h - newTop); - y = newTop; -} - -void Rectangle::setRight (const int newRight) throw() -{ - x = jmin (x, newRight); - w = newRight - x; -} - -void Rectangle::setBottom (const int newBottom) throw() -{ - y = jmin (y, newBottom); - h = newBottom - y; -} - -void Rectangle::translate (const int dx, - const int dy) throw() -{ - x += dx; - y += dy; -} - -const Rectangle Rectangle::translated (const int dx, - const int dy) const throw() -{ - return Rectangle (x + dx, y + dy, w, h); -} - -void Rectangle::expand (const int deltaX, - const int deltaY) throw() -{ - const int nw = jmax (0, w + deltaX + deltaX); - const int nh = jmax (0, h + deltaY + deltaY); - - setBounds (x - deltaX, - y - deltaY, - nw, nh); -} - -const Rectangle Rectangle::expanded (const int deltaX, - const int deltaY) const throw() -{ - const int nw = jmax (0, w + deltaX + deltaX); - const int nh = jmax (0, h + deltaY + deltaY); - - return Rectangle (x - deltaX, - y - deltaY, - nw, nh); -} - -void Rectangle::reduce (const int deltaX, - const int deltaY) throw() -{ - expand (-deltaX, -deltaY); -} - -const Rectangle Rectangle::reduced (const int deltaX, - const int deltaY) const throw() -{ - return expanded (-deltaX, -deltaY); -} - -bool Rectangle::operator== (const Rectangle& other) const throw() -{ - return x == other.x - && y == other.y - && w == other.w - && h == other.h; -} - -bool Rectangle::operator!= (const Rectangle& other) const throw() -{ - return x != other.x - || y != other.y - || w != other.w - || h != other.h; -} - -bool Rectangle::contains (const int px, - const int py) const throw() -{ - return px >= x - && py >= y - && px < x + w - && py < y + h; -} - -bool Rectangle::contains (const Rectangle& other) const throw() -{ - return x <= other.x - && y <= other.y - && x + w >= other.x + other.w - && y + h >= other.y + other.h; -} - -bool Rectangle::intersects (const Rectangle& other) const throw() -{ - return x + w > other.x - && y + h > other.y - && x < other.x + other.w - && y < other.y + other.h - && w > 0 - && h > 0; -} - -const Rectangle Rectangle::getIntersection (const Rectangle& other) const throw() -{ - const int nx = jmax (x, other.x); - const int ny = jmax (y, other.y); - const int nw = jmin (x + w, other.x + other.w) - nx; - const int nh = jmin (y + h, other.y + other.h) - ny; - - if (nw >= 0 && nh >= 0) - return Rectangle (nx, ny, nw, nh); - else - return Rectangle(); -} - -bool Rectangle::intersectRectangle (int& x1, int& y1, int& w1, int& h1) const throw() -{ - const int maxX = jmax (x1, x); - w1 = jmin (x1 + w1, x + w) - maxX; - - if (w1 > 0) - { - const int maxY = jmax (y1, y); - h1 = jmin (y1 + h1, y + h) - maxY; - - if (h1 > 0) - { - x1 = maxX; - y1 = maxY; - - return true; - } - } - - return false; -} - -bool Rectangle::intersectRectangles (int& x1, int& y1, int& w1, int& h1, - int x2, int y2, int w2, int h2) throw() -{ - const int x = jmax (x1, x2); - w1 = jmin (x1 + w1, x2 + w2) - x; - - if (w1 > 0) - { - const int y = jmax (y1, y2); - h1 = jmin (y1 + h1, y2 + h2) - y; - - if (h1 > 0) - { - x1 = x; - y1 = y; - - return true; - } - } - - return false; -} - -const Rectangle Rectangle::getUnion (const Rectangle& other) const throw() -{ - const int newX = jmin (x, other.x); - const int newY = jmin (y, other.y); - - return Rectangle (newX, newY, - jmax (x + w, other.x + other.w) - newX, - jmax (y + h, other.y + other.h) - newY); -} - -bool Rectangle::enlargeIfAdjacent (const Rectangle& other) throw() -{ - if (x == other.x && getRight() == other.getRight() - && (other.getBottom() >= y && other.y <= getBottom())) - { - const int newY = jmin (y, other.y); - h = jmax (getBottom(), other.getBottom()) - newY; - y = newY; - return true; - } - else if (y == other.y && getBottom() == other.getBottom() - && (other.getRight() >= x && other.x <= getRight())) - { - const int newX = jmin (x, other.x); - w = jmax (getRight(), other.getRight()) - newX; - x = newX; - return true; - } - - return false; -} - -bool Rectangle::reduceIfPartlyContainedIn (const Rectangle& other) throw() -{ - int inside = 0; - const int otherR = other.getRight(); - - if (x >= other.x && x < otherR) - inside = 1; - - const int otherB = other.getBottom(); - - if (y >= other.y && y < otherB) - inside |= 2; - - const int r = x + w; - - if (r >= other.x && r < otherR) - inside |= 4; - - const int b = y + h; - - if (b >= other.y && b < otherB) - inside |= 8; - - switch (inside) - { - case 1 + 2 + 8: - w = r - otherR; - x = otherR; - return true; - - case 1 + 2 + 4: - h = b - otherB; - y = otherB; - return true; - - case 2 + 4 + 8: - w = other.x - x; - return true; - - case 1 + 4 + 8: - h = other.y - y; - return true; - } - - return false; -} - -const String Rectangle::toString() const throw() -{ - String s; - s.preallocateStorage (16); - - s << x << T(' ') - << y << T(' ') - << w << T(' ') - << h; - - return s; -} - -const Rectangle Rectangle::fromString (const String& stringVersion) -{ - StringArray toks; - toks.addTokens (stringVersion.trim(), T(",; \t\r\n"), 0); - - return Rectangle (toks[0].trim().getIntValue(), - toks[1].trim().getIntValue(), - toks[2].trim().getIntValue(), - toks[3].trim().getIntValue()); -} - - -END_JUCE_NAMESPACE diff --git a/src/gui/graphics/geometry/juce_Rectangle.h b/src/gui/graphics/geometry/juce_Rectangle.h index 32bae3d4cb..0e9fba48e7 100644 --- a/src/gui/graphics/geometry/juce_Rectangle.h +++ b/src/gui/graphics/geometry/juce_Rectangle.h @@ -26,16 +26,19 @@ #ifndef __JUCE_RECTANGLE_JUCEHEADER__ #define __JUCE_RECTANGLE_JUCEHEADER__ -#include "../../../text/juce_String.h" +#include "../../../text/juce_StringArray.h" +#include "juce_Point.h" +class RectangleList; //============================================================================== /** - A rectangle, specified using integer co-ordinates. + Manages a rectangle and allows geometric operations to be performed on it. @see RectangleList, Path, Line, Point */ -class JUCE_API Rectangle +template +class Rectangle { public: //============================================================================== @@ -43,148 +46,249 @@ public: The default co-ordinates will be (0, 0, 0, 0). */ - Rectangle() throw(); + Rectangle() throw() + : x (0), y (0), w (0), h (0) + { + } /** Creates a copy of another rectangle. */ - Rectangle (const Rectangle& other) throw(); + Rectangle (const Rectangle& other) throw() + : x (other.x), y (other.y), + w (other.w), h (other.h) + { + } /** Creates a rectangle with a given position and size. */ - Rectangle (const int x, const int y, - const int width, const int height) throw(); + Rectangle (const ValueType initialX, const ValueType initialY, + const ValueType width, const ValueType height) throw() + : x (initialX), y (initialY), + w (width), h (height) + { + } /** Creates a rectangle with a given size, and a position of (0, 0). */ - Rectangle (const int width, const int height) throw(); + Rectangle (const ValueType width, const ValueType height) throw() + : x (0), y (0), w (width), h (height) + { + } + + Rectangle& operator= (const Rectangle& other) throw() + { + x = other.x; y = other.y; + w = other.w; h = other.h; + return *this; + } /** Destructor. */ - ~Rectangle() throw(); + ~Rectangle() throw() {} //============================================================================== /** Returns the x co-ordinate of the rectangle's left-hand-side. */ - inline int getX() const throw() { return x; } + inline ValueType getX() const throw() { return x; } /** Returns the y co-ordinate of the rectangle's top edge. */ - inline int getY() const throw() { return y; } + inline ValueType getY() const throw() { return y; } /** Returns the width of the rectangle. */ - inline int getWidth() const throw() { return w; } + inline ValueType getWidth() const throw() { return w; } /** Returns the height of the rectangle. */ - inline int getHeight() const throw() { return h; } + inline ValueType getHeight() const throw() { return h; } /** Returns the x co-ordinate of the rectangle's right-hand-side. */ - inline int getRight() const throw() { return x + w; } + inline ValueType getRight() const throw() { return x + w; } /** Returns the y co-ordinate of the rectangle's bottom edge. */ - inline int getBottom() const throw() { return y + h; } + inline ValueType getBottom() const throw() { return y + h; } /** Returns the x co-ordinate of the rectangle's centre. */ - inline int getCentreX() const throw() { return x + (w >> 1); } + inline ValueType getCentreX() const throw() { return x + w / (ValueType) 2; } /** Returns the y co-ordinate of the rectangle's centre. */ - inline int getCentreY() const throw() { return y + (h >> 1); } + inline ValueType getCentreY() const throw() { return y + h / (ValueType) 2; } /** Returns true if the rectangle's width and height are both zero or less */ - bool isEmpty() const throw(); + bool isEmpty() const throw() { return w <= 0 || h <= 0; } + + //============================================================================== + /** Returns the rectangle's top-left position as a Point. */ + const Point getPosition() const throw() { return Point (x, y); } /** Changes the position of the rectangle's top-left corner (leaving its size unchanged). */ - void setPosition (const int x, const int y) throw(); + void setPosition (const ValueType newX, const ValueType newY) throw() { x = newX; y = newY; } /** Changes the rectangle's size, leaving the position of its top-left corner unchanged. */ - void setSize (const int w, const int h) throw(); + void setSize (const ValueType newWidth, const ValueType newHeight) throw() { w = newWidth; h = newHeight; } /** Changes all the rectangle's co-ordinates. */ - void setBounds (const int newX, const int newY, - const int newWidth, const int newHeight) throw(); + void setBounds (const ValueType newX, const ValueType newY, + const ValueType newWidth, const ValueType newHeight) throw() + { + x = newX; y = newY; w = newWidth; h = newHeight; + } /** Changes the rectangle's width */ - void setWidth (const int newWidth) throw(); + void setWidth (const ValueType newWidth) throw() { w = newWidth; } /** Changes the rectangle's height */ - void setHeight (const int newHeight) throw(); + void setHeight (const ValueType newHeight) throw() { h = newHeight; } /** Moves the x position, adjusting the width so that the right-hand edge remains in the same place. If the x is moved to be on the right of the current right-hand edge, the width will be set to zero. */ - void setLeft (const int newLeft) throw(); + void setLeft (const ValueType newLeft) throw() + { + w = jmax (ValueType(), x + w - newLeft); + x = newLeft; + } /** Moves the y position, adjusting the height so that the bottom edge remains in the same place. If the y is moved to be below the current bottom edge, the height will be set to zero. */ - void setTop (const int newTop) throw(); + void setTop (const ValueType newTop) throw() + { + h = jmax (ValueType(), y + h - newTop); + y = newTop; + } /** Adjusts the width so that the right-hand edge of the rectangle has this new value. If the new right is below the current X value, the X will be pushed down to match it. @see getRight */ - void setRight (const int newRight) throw(); + void setRight (const ValueType newRight) throw() + { + x = jmin (x, newRight); + w = newRight - x; + } /** Adjusts the height so that the bottom edge of the rectangle has this new value. If the new bottom is lower than the current Y value, the Y will be pushed down to match it. @see getBottom */ - void setBottom (const int newBottom) throw(); + void setBottom (const ValueType newBottom) throw() + { + y = jmin (y, newBottom); + h = newBottom - y; + } + //============================================================================== /** Moves the rectangle's position by adding amount to its x and y co-ordinates. */ - void translate (const int deltaX, - const int deltaY) throw(); + void translate (const ValueType deltaX, + const ValueType deltaY) throw() + { + x += deltaX; + y += deltaY; + } /** Returns a rectangle which is the same as this one moved by a given amount. */ - const Rectangle translated (const int deltaX, - const int deltaY) const throw(); + const Rectangle translated (const ValueType deltaX, + const ValueType deltaY) const throw() + { + return Rectangle (x + deltaX, y + deltaY, w, h); + } /** Expands the rectangle by a given amount. Effectively, its new size is (x - deltaX, y - deltaY, w + deltaX * 2, h + deltaY * 2). @see expanded, reduce, reduced */ - void expand (const int deltaX, - const int deltaY) throw(); + void expand (const ValueType deltaX, + const ValueType deltaY) throw() + { + const ValueType nw = jmax (ValueType(), w + deltaX * 2); + const ValueType nh = jmax (ValueType(), h + deltaY * 2); + setBounds (x - deltaX, y - deltaY, nw, nh); + } /** Returns a rectangle that is larger than this one by a given amount. Effectively, the rectangle returned is (x - deltaX, y - deltaY, w + deltaX * 2, h + deltaY * 2). @see expand, reduce, reduced */ - const Rectangle expanded (const int deltaX, - const int deltaY) const throw(); + const Rectangle expanded (const ValueType deltaX, + const ValueType deltaY) const throw() + { + const ValueType nw = jmax (ValueType(), w + deltaX * 2); + const ValueType nh = jmax (ValueType(), h + deltaY * 2); + return Rectangle (x - deltaX, y - deltaY, nw, nh); + } /** Shrinks the rectangle by a given amount. Effectively, its new size is (x + deltaX, y + deltaY, w - deltaX * 2, h - deltaY * 2). @see reduced, expand, expanded */ - void reduce (const int deltaX, - const int deltaY) throw(); + void reduce (const ValueType deltaX, + const ValueType deltaY) throw() + { + expand (-deltaX, -deltaY); + } /** Returns a rectangle that is smaller than this one by a given amount. Effectively, the rectangle returned is (x + deltaX, y + deltaY, w - deltaX * 2, h - deltaY * 2). @see reduce, expand, expanded */ - const Rectangle reduced (const int deltaX, - const int deltaY) const throw(); + const Rectangle reduced (const ValueType deltaX, + const ValueType deltaY) const throw() + { + return expanded (-deltaX, -deltaY); + } //============================================================================== /** Returns true if the two rectangles are identical. */ - bool operator== (const Rectangle& other) const throw(); + bool operator== (const Rectangle& other) const throw() + { + return x == other.x && y == other.y + && w == other.w && h == other.h; + } /** Returns true if the two rectangles are not identical. */ - bool operator!= (const Rectangle& other) const throw(); + bool operator!= (const Rectangle& other) const throw() + { + return x != other.x || y != other.y + || w != other.w || h != other.h; + } /** Returns true if this co-ordinate is inside the rectangle. */ - bool contains (const int x, const int y) const throw(); + bool contains (const ValueType xCoord, const ValueType yCoord) const throw() + { + return xCoord >= x && yCoord >= y && xCoord < x + w && yCoord < y + h; + } /** Returns true if this other rectangle is completely inside this one. */ - bool contains (const Rectangle& other) const throw(); + bool contains (const Rectangle& other) const throw() + { + return x <= other.x && y <= other.y + && x + w >= other.x + other.w && y + h >= other.y + other.h; + } /** Returns true if any part of another rectangle overlaps this one. */ - bool intersects (const Rectangle& other) const throw(); + bool intersects (const Rectangle& other) const throw() + { + return x + w > other.x + && y + h > other.y + && x < other.x + other.w + && y < other.y + other.h + && w > ValueType() && h > ValueType(); + } /** Returns the region that is the overlap between this and another rectangle. If the two rectangles don't overlap, the rectangle returned will be empty. */ - const Rectangle getIntersection (const Rectangle& other) const throw(); + const Rectangle getIntersection (const Rectangle& other) const throw() + { + const ValueType nx = jmax (x, other.x); + const ValueType ny = jmax (y, other.y); + const ValueType nw = jmin (x + w, other.x + other.w) - nx; + const ValueType nh = jmin (y + h, other.y + other.h) - ny; + + if (nw >= ValueType() && nh >= ValueType()) + return Rectangle (nx, ny, nw, nh); + + return Rectangle(); + } /** Clips a rectangle so that it lies only within this one. @@ -192,12 +296,38 @@ public: Returns false if the two regions didn't overlap. */ - bool intersectRectangle (int& x, int& y, int& w, int& h) const throw(); + bool intersectRectangle (ValueType& otherX, ValueType& otherY, ValueType& otherW, ValueType& otherH) const throw() + { + const int maxX = jmax (otherX, x); + otherW = jmin (otherX + otherW, x + w) - maxX; + + if (otherW > 0) + { + const int maxY = jmax (otherY, y); + otherH = jmin (otherY + otherH, y + h) - maxY; + + if (otherH > 0) + { + otherX = maxX; otherY = maxY; + return true; + } + } + + return false; + } /** Returns the smallest rectangle that contains both this one and the one passed-in. */ - const Rectangle getUnion (const Rectangle& other) const throw(); + const Rectangle getUnion (const Rectangle& other) const throw() + { + const ValueType newX = jmin (x, other.x); + const ValueType newY = jmin (y, other.y); + + return Rectangle (newX, newY, + jmax (x + w, other.x + other.w) - newX, + jmax (y + h, other.y + other.h) - newY); + } /** If this rectangle merged with another one results in a simple rectangle, this will set this rectangle to the result, and return true. @@ -205,7 +335,27 @@ public: Returns false and does nothing to this rectangle if the two rectangles don't overlap, or if they form a complex region. */ - bool enlargeIfAdjacent (const Rectangle& other) throw(); + bool enlargeIfAdjacent (const Rectangle& other) throw() + { + if (x == other.x && getRight() == other.getRight() + && (other.getBottom() >= y && other.y <= getBottom())) + { + const ValueType newY = jmin (y, other.y); + h = jmax (getBottom(), other.getBottom()) - newY; + y = newY; + return true; + } + else if (y == other.y && getBottom() == other.getBottom() + && (other.getRight() >= x && other.x <= getRight())) + { + const ValueType newX = jmin (x, other.x); + w = jmax (getRight(), other.getRight()) - newX; + x = newX; + return true; + } + + return false; + } /** If after removing another rectangle from this one the result is a simple rectangle, this will set this object's bounds to be the result, and return true. @@ -213,7 +363,66 @@ public: Returns false and does nothing to this rectangle if the two rectangles don't overlap, or if removing the other one would form a complex region. */ - bool reduceIfPartlyContainedIn (const Rectangle& other) throw(); + bool reduceIfPartlyContainedIn (const Rectangle& other) throw() + { + int inside = 0; + const int otherR = other.getRight(); + if (x >= other.x && x < otherR) inside = 1; + const int otherB = other.getBottom(); + if (y >= other.y && y < otherB) inside |= 2; + const int r = x + w; + if (r >= other.x && r < otherR) inside |= 4; + const int b = y + h; + if (b >= other.y && b < otherB) inside |= 8; + + switch (inside) + { + case 1 + 2 + 8: w = r - otherR; x = otherR; return true; + case 1 + 2 + 4: h = b - otherB; y = otherB; return true; + case 2 + 4 + 8: w = other.x - x; return true; + case 1 + 4 + 8: h = other.y - y; return true; + } + + return false; + } + + /** Returns the smallest rectangle that can contain the shape created by applying + a transform to this rectangle. + + This should only be used on floating point rectangles. + */ + const Rectangle transformed (const AffineTransform& transform) const throw() + { + float x1 = x, y1 = y; + float x2 = x + w, y2 = y; + float x3 = x, y3 = y + h; + float x4 = x2, y4 = y3; + + transform.transformPoint (x1, y1); + transform.transformPoint (x2, y2); + transform.transformPoint (x3, y3); + transform.transformPoint (x4, y4); + + const float x = jmin (x1, x2, x3, x4); + const float y = jmin (y1, y2, y3, y4); + + return Rectangle (x, y, + jmax (x1, x2, x3, x4) - x, + jmax (y1, y2, y3, y4) - y); + } + + /** Returns the smallest integer-aligned rectangle that completely contains this one. + This is only relevent for floating-point rectangles, of course. + */ + const Rectangle getSmallestIntegerContainer() const throw() + { + const int x1 = (int) floorf ((float) x); + const int y1 = (int) floorf ((float) y); + const int x2 = (int) floorf ((float) (x + w + 0.9999f)); + const int y2 = (int) floorf ((float) (y + h + 0.9999f)); + + return Rectangle (x1, y1, x2 - x1, y2 - y1); + } //============================================================================== /** Static utility to intersect two sets of rectangular co-ordinates. @@ -222,8 +431,26 @@ public: @see intersectRectangle */ - static bool intersectRectangles (int& x1, int& y1, int& w1, int& h1, - int x2, int y2, int w2, int h2) throw(); + static bool intersectRectangles (ValueType& x1, ValueType& y1, ValueType& w1, ValueType& h1, + const ValueType x2, const ValueType y2, const ValueType w2, const ValueType h2) throw() + { + const ValueType x = jmax (x1, x2); + w1 = jmin (x1 + w1, x2 + w2) - x; + + if (w1 > 0) + { + const ValueType y = jmax (y1, y2); + h1 = jmin (y1 + h1, y2 + h2) - y; + + if (h1 > 0) + { + x1 = x; y1 = y; + return true; + } + } + + return false; + } //============================================================================== /** Creates a string describing this rectangle. @@ -235,7 +462,13 @@ public: @see fromString */ - const String toString() const throw(); + const String toString() const + { + String s; + s.preallocateStorage (16); + s << x << T(' ') << y << T(' ') << w << T(' ') << h; + return s; + } /** Parses a string containing a rectangle's details. @@ -247,14 +480,23 @@ public: @see toString */ - static const Rectangle fromString (const String& stringVersion); + static const Rectangle fromString (const String& stringVersion) + { + StringArray toks; + toks.addTokens (stringVersion.trim(), T(",; \t\r\n"), 0); + + return Rectangle (toks[0].trim().getIntValue(), + toks[1].trim().getIntValue(), + toks[2].trim().getIntValue(), + toks[3].trim().getIntValue()); + } //============================================================================== juce_UseDebuggingNewOperator private: friend class RectangleList; - int x, y, w, h; + ValueType x, y, w, h; }; diff --git a/src/gui/graphics/geometry/juce_RectangleList.cpp b/src/gui/graphics/geometry/juce_RectangleList.cpp index ca01867d51..8ffd2dea27 100644 --- a/src/gui/graphics/geometry/juce_RectangleList.cpp +++ b/src/gui/graphics/geometry/juce_RectangleList.cpp @@ -36,7 +36,7 @@ RectangleList::RectangleList() throw() { } -RectangleList::RectangleList (const Rectangle& rect) throw() +RectangleList::RectangleList (const Rectangle& rect) throw() { if (! rect.isEmpty()) rects.add (rect); @@ -63,12 +63,12 @@ void RectangleList::clear() throw() rects.clearQuick(); } -const Rectangle RectangleList::getRectangle (const int index) const throw() +const Rectangle RectangleList::getRectangle (const int index) const throw() { if (((unsigned int) index) < (unsigned int) rects.size()) return rects.getReference (index); - return Rectangle(); + return Rectangle(); } bool RectangleList::isEmpty() const throw() @@ -101,7 +101,7 @@ bool RectangleList::Iterator::next() throw() //============================================================================== -void RectangleList::add (const Rectangle& rect) throw() +void RectangleList::add (const Rectangle& rect) throw() { if (! rect.isEmpty()) { @@ -116,7 +116,7 @@ void RectangleList::add (const Rectangle& rect) throw() int i; for (i = rects.size(); --i >= 0;) { - Rectangle& ourRect = rects.getReference (i); + Rectangle& ourRect = rects.getReference (i); if (rect.intersects (ourRect)) { @@ -133,7 +133,7 @@ void RectangleList::add (const Rectangle& rect) throw() for (i = rects.size(); --i >= 0;) { - const Rectangle& ourRect = rects.getReference (i); + const Rectangle& ourRect = rects.getReference (i); if (rect.intersects (ourRect)) { @@ -155,7 +155,7 @@ void RectangleList::add (const Rectangle& rect) throw() } } -void RectangleList::addWithoutMerging (const Rectangle& rect) throw() +void RectangleList::addWithoutMerging (const Rectangle& rect) throw() { rects.add (rect); } @@ -165,11 +165,11 @@ void RectangleList::add (const int x, const int y, const int w, const int h) thr if (rects.size() == 0) { if (w > 0 && h > 0) - rects.add (Rectangle (x, y, w, h)); + rects.add (Rectangle (x, y, w, h)); } else { - add (Rectangle (x, y, w, h)); + add (Rectangle (x, y, w, h)); } } @@ -179,7 +179,7 @@ void RectangleList::add (const RectangleList& other) throw() add (other.rects.getReference (i)); } -void RectangleList::subtract (const Rectangle& rect) throw() +void RectangleList::subtract (const Rectangle& rect) throw() { const int originalNumRects = rects.size(); @@ -192,7 +192,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() for (int i = getNumRectangles(); --i >= 0;) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); const int rx1 = r.x; const int ry1 = r.y; @@ -212,7 +212,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() r.x = x1; r.w = rx2 - x1; - rects.insert (i + 1, Rectangle (rx1, ry1, x1 - rx1, ry2 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, x1 - rx1, ry2 - ry1)); i += 2; } } @@ -223,7 +223,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() if (y1 > ry1 || y2 < ry2 || x1 > rx1) { - rects.insert (i + 1, Rectangle (rx1, ry1, x2 - rx1, ry2 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, x2 - rx1, ry2 - ry1)); i += 2; } } @@ -238,7 +238,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() r.y = y1; r.h = ry2 - y1; - rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y1 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y1 - ry1)); i += 2; } } @@ -249,7 +249,7 @@ void RectangleList::subtract (const Rectangle& rect) throw() if (x1 > rx1 || x2 < rx2 || y1 > ry1) { - rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y2 - ry1)); + rects.insert (i + 1, Rectangle (rx1, ry1, rx2 - rx1, y2 - ry1)); i += 2; } } @@ -271,7 +271,7 @@ void RectangleList::subtract (const RectangleList& otherList) throw() subtract (otherList.rects.getReference (i)); } -bool RectangleList::clipTo (const Rectangle& rect) throw() +bool RectangleList::clipTo (const Rectangle& rect) throw() { bool notEmpty = false; @@ -283,7 +283,7 @@ bool RectangleList::clipTo (const Rectangle& rect) throw() { for (int i = rects.size(); --i >= 0;) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); if (! rect.intersectRectangle (r.x, r.y, r.w, r.h)) rects.remove (i); @@ -304,11 +304,11 @@ bool RectangleList::clipTo (const RectangleList& other) throw() for (int j = 0; j < rects.size(); ++j) { - const Rectangle& rect = rects.getReference (j); + const Rectangle& rect = rects.getReference (j); for (int i = other.rects.size(); --i >= 0;) { - Rectangle r (other.rects.getReference (i)); + Rectangle r (other.rects.getReference (i)); if (rect.intersectRectangle (r.x, r.y, r.w, r.h)) result.rects.add (r); @@ -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 throw() { destRegion.clear(); @@ -328,7 +328,7 @@ bool RectangleList::getIntersectionWith (const Rectangle& rect, RectangleList& d { for (int i = rects.size(); --i >= 0;) { - Rectangle r (rects.getReference (i)); + Rectangle r (rects.getReference (i)); if (rect.intersectRectangle (r.x, r.y, r.w, r.h)) destRegion.rects.add (r); @@ -350,7 +350,7 @@ void RectangleList::consolidate() throw() int i; for (i = 0; i < getNumRectangles() - 1; ++i) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); const int rx1 = r.x; const int ry1 = r.y; const int rx2 = rx1 + r.w; @@ -358,7 +358,7 @@ void RectangleList::consolidate() throw() for (int j = rects.size(); --j > i;) { - Rectangle& r2 = rects.getReference (j); + Rectangle& r2 = rects.getReference (j); const int jrx1 = r2.x; const int jry1 = r2.y; const int jrx2 = jrx1 + r2.w; @@ -371,7 +371,7 @@ void RectangleList::consolidate() throw() if (jry1 > ry1 && jry1 < ry2) { r.h = jry1 - ry1; - rects.add (Rectangle (rx1, jry1, rx2 - rx1, ry2 - jry1)); + rects.add (Rectangle (rx1, jry1, rx2 - rx1, ry2 - jry1)); i = -1; break; } @@ -379,21 +379,21 @@ void RectangleList::consolidate() throw() if (jry2 > ry1 && jry2 < ry2) { r.h = jry2 - ry1; - rects.add (Rectangle (rx1, jry2, rx2 - rx1, ry2 - jry2)); + rects.add (Rectangle (rx1, jry2, rx2 - rx1, ry2 - jry2)); i = -1; break; } else if (ry1 > jry1 && ry1 < jry2) { r2.h = ry1 - jry1; - rects.add (Rectangle (jrx1, ry1, jrx2 - jrx1, jry2 - ry1)); + rects.add (Rectangle (jrx1, ry1, jrx2 - jrx1, jry2 - ry1)); i = -1; break; } else if (ry2 > jry1 && ry2 < jry2) { r2.h = ry2 - jry1; - rects.add (Rectangle (jrx1, ry2, jrx2 - jrx1, jry2 - ry2)); + rects.add (Rectangle (jrx1, ry2, jrx2 - jrx1, jry2 - ry2)); i = -1; break; } @@ -403,7 +403,7 @@ void RectangleList::consolidate() throw() for (i = 0; i < rects.size() - 1; ++i) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); for (int j = rects.size(); --j > 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 throw() { if (rects.size() > 1) { @@ -449,7 +449,7 @@ bool RectangleList::containsRectangle (const Rectangle& rectangleToCheck) const return false; } -bool RectangleList::intersectsRectangle (const Rectangle& rectangleToCheck) const throw() +bool RectangleList::intersectsRectangle (const Rectangle& rectangleToCheck) const throw() { for (int i = rects.size(); --i >= 0;) if (rects.getReference (i).intersects (rectangleToCheck)) @@ -467,18 +467,18 @@ bool RectangleList::intersects (const RectangleList& other) const throw() return false; } -const Rectangle RectangleList::getBounds() const throw() +const Rectangle RectangleList::getBounds() const throw() { if (rects.size() <= 1) { if (rects.size() == 0) - return Rectangle(); + return Rectangle(); else return rects.getReference (0); } else { - const Rectangle& r = rects.getReference (0); + const Rectangle& r = rects.getReference (0); int minX = r.x; int minY = r.y; @@ -487,7 +487,7 @@ const Rectangle RectangleList::getBounds() const throw() for (int i = rects.size(); --i > 0;) { - const Rectangle& r2 = rects.getReference (i); + const Rectangle& r2 = rects.getReference (i); minX = jmin (minX, r2.x); minY = jmin (minY, r2.y); @@ -495,7 +495,7 @@ const Rectangle RectangleList::getBounds() const throw() maxY = jmax (maxY, r2.getBottom()); } - return Rectangle (minX, minY, maxX - minX, maxY - minY); + return Rectangle (minX, minY, maxX - minX, maxY - minY); } } @@ -503,7 +503,7 @@ void RectangleList::offsetAll (const int dx, const int dy) throw() { for (int i = rects.size(); --i >= 0;) { - Rectangle& r = rects.getReference (i); + Rectangle& r = rects.getReference (i); r.x += dx; r.y += dy; @@ -517,7 +517,7 @@ const Path RectangleList::toPath() const throw() for (int i = rects.size(); --i >= 0;) { - const Rectangle& r = rects.getReference (i); + const Rectangle& r = rects.getReference (i); p.addRectangle ((float) r.x, (float) r.y, diff --git a/src/gui/graphics/geometry/juce_RectangleList.h b/src/gui/graphics/geometry/juce_RectangleList.h index 4dfb67ea7c..e0177e3aec 100644 --- a/src/gui/graphics/geometry/juce_RectangleList.h +++ b/src/gui/graphics/geometry/juce_RectangleList.h @@ -51,7 +51,7 @@ public: RectangleList (const RectangleList& other) throw(); /** Creates a list containing just one rectangle. */ - RectangleList (const Rectangle& rect) throw(); + RectangleList (const Rectangle& rect) throw(); /** Copies this list from another one. */ const RectangleList& operator= (const RectangleList& other) throw(); @@ -71,7 +71,7 @@ public: @returns the rectangle at the index, or an empty rectangle if the index is out-of-range. */ - const Rectangle getRectangle (const int index) const throw(); + const Rectangle getRectangle (const int index) const throw(); //============================================================================== @@ -92,14 +92,14 @@ 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) throw(); /** 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) throw(); /** Merges another rectangle list into this one. @@ -113,7 +113,7 @@ public: 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) throw(); /** Removes all areas in another RectangleList from this one. @@ -131,7 +131,7 @@ public: @see getIntersectionWith */ - bool clipTo (const Rectangle& rect) throw(); + bool clipTo (const Rectangle& rect) throw(); /** Removes any areas of the region that lie outside a given rectangle list. @@ -153,7 +153,7 @@ public: @see clipTo */ - bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw(); + bool getIntersectionWith (const Rectangle& rect, RectangleList& destRegion) const throw(); /** Swaps the contents of this and another list. @@ -175,7 +175,7 @@ public: defined by this object @see intersectsRectangle, containsPoint */ - bool containsRectangle (const Rectangle& rectangleToCheck) const throw(); + bool containsRectangle (const Rectangle& rectangleToCheck) const throw(); /** Checks whether the region contains any part of a given rectangle. @@ -183,7 +183,7 @@ public: defined by this object @see containsRectangle */ - bool intersectsRectangle (const Rectangle& rectangleToCheck) const throw(); + bool intersectsRectangle (const Rectangle& rectangleToCheck) const throw(); /** Checks whether this region intersects any part of another one. @@ -193,7 +193,7 @@ public: //============================================================================== /** Returns the smallest rectangle that can enclose the whole of this region. */ - const Rectangle getBounds() const throw(); + const Rectangle getBounds() const throw(); /** Optimises the list into a minimum number of constituent rectangles. @@ -228,14 +228,14 @@ public: bool next() throw(); /** Returns the current rectangle. */ - const Rectangle* getRectangle() const throw() { return current; } + const Rectangle* getRectangle() const throw() { return current; } //============================================================================== juce_UseDebuggingNewOperator private: - const Rectangle* current; + const Rectangle* current; const RectangleList& owner; int index; @@ -248,7 +248,7 @@ public: private: friend class Iterator; - Array rects; + Array > rects; }; diff --git a/src/gui/graphics/imaging/juce_Image.cpp b/src/gui/graphics/imaging/juce_Image.cpp index 0de9270052..4504272117 100644 --- a/src/gui/graphics/imaging/juce_Image.cpp +++ b/src/gui/graphics/imaging/juce_Image.cpp @@ -125,7 +125,7 @@ void Image::setPixelData (int x, int y, int w, int h, { jassert (x >= 0 && y >= 0 && w > 0 && h > 0 && x + w <= imageWidth && y + h <= imageHeight); - if (Rectangle::intersectRectangles (x, y, w, h, 0, 0, imageWidth, imageHeight)) + if (Rectangle::intersectRectangles (x, y, w, h, 0, 0, imageWidth, imageHeight)) { const BitmapData dest (*this, x, y, w, h, true); @@ -405,7 +405,7 @@ void Image::createSolidAreaMask (RectangleList& result, const float alphaThresho int x, w; if (pixelsOnRow.getRange (i, x, w)) - result.add (Rectangle (x, y, w, 1)); + result.add (Rectangle (x, y, w, 1)); } result.consolidate(); diff --git a/src/gui/graphics/imaging/juce_Image.h b/src/gui/graphics/imaging/juce_Image.h index 887470d1e9..4d823dde69 100644 --- a/src/gui/graphics/imaging/juce_Image.h +++ b/src/gui/graphics/imaging/juce_Image.h @@ -112,7 +112,7 @@ public: /** Returns a rectangle with the same size as this image. The rectangle is always at position (0, 0). */ - const Rectangle getBounds() const throw() { return Rectangle (0, 0, imageWidth, imageHeight); } + const Rectangle getBounds() const throw() { return Rectangle (0, 0, imageWidth, imageHeight); } /** Returns the image's pixel format. */ PixelFormat getFormat() const throw() { return format; } diff --git a/src/juce_amalgamated_template.cpp b/src/juce_amalgamated_template.cpp index 852c14c8e2..ba83a083c9 100644 --- a/src/juce_amalgamated_template.cpp +++ b/src/juce_amalgamated_template.cpp @@ -321,9 +321,7 @@ #include "gui/graphics/geometry/juce_Path.cpp" #include "gui/graphics/geometry/juce_PathIterator.cpp" #include "gui/graphics/geometry/juce_PathStrokeType.cpp" -#include "gui/graphics/geometry/juce_Point.cpp" #include "gui/graphics/geometry/juce_PositionedRectangle.cpp" -#include "gui/graphics/geometry/juce_Rectangle.cpp" #include "gui/graphics/geometry/juce_RectangleList.cpp" #include "gui/graphics/imaging/juce_Image.cpp" #include "gui/graphics/imaging/juce_ImageCache.cpp" diff --git a/src/native/linux/juce_linux_Windowing.cpp b/src/native/linux/juce_linux_Windowing.cpp index 072c6cb13e..b0fbfd9a6a 100644 --- a/src/native/linux/juce_linux_Windowing.cpp +++ b/src/native/linux/juce_linux_Windowing.cpp @@ -864,7 +864,7 @@ public: void setFullScreen (const bool shouldBeFullScreen) { - Rectangle r (lastNonFullscreenBounds); // (get a copy of this before de-minimising) + Rectangle r (lastNonFullscreenBounds); // (get a copy of this before de-minimising) setMinimised (false); @@ -1097,10 +1097,10 @@ public: void repaint (int x, int y, int w, int h) { - if (Rectangle::intersectRectangles (x, y, w, h, - 0, 0, - getComponent()->getWidth(), - getComponent()->getHeight())) + if (Rectangle::intersectRectangles (x, y, w, h, + 0, 0, + getComponent()->getWidth(), + getComponent()->getHeight())) { repainter->repaint (x, y, w, h); } @@ -1829,7 +1829,7 @@ private: RectangleList originalRepaintRegion (regionsNeedingRepaint); regionsNeedingRepaint.clear(); - const Rectangle totalArea (originalRepaintRegion.getBounds()); + const Rectangle totalArea (originalRepaintRegion.getBounds()); if (! totalArea.isEmpty()) { @@ -1866,7 +1866,7 @@ private: for (RectangleList::Iterator i (originalRepaintRegion); i.next();) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); image->blitToWindow (peer->windowH, r.getX(), r.getY(), r.getWidth(), r.getHeight(), @@ -2632,7 +2632,7 @@ void juce_windowMessageReceive (XEvent* event) } //============================================================================== -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool /*clipToWorkArea*/) +void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool /*clipToWorkArea*/) { if (display == 0) return; @@ -2676,12 +2676,12 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool / if (index >= 0) { while (monitorCoords.size() < index) - monitorCoords.add (Rectangle (0, 0, 0, 0)); + monitorCoords.add (Rectangle()); - monitorCoords.set (index, Rectangle (screens[i].x_org, - screens[i].y_org, - screens[i].width, - screens[i].height)); + monitorCoords.set (index, Rectangle (screens[i].x_org, + screens[i].y_org, + screens[i].width, + screens[i].height)); } } @@ -2715,8 +2715,8 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool / const long* const position = (const long*) data; if (actualType == XA_CARDINAL && actualFormat == 32 && nitems == 4) - monitorCoords.add (Rectangle (position[0], position[1], - position[2], position[3])); + monitorCoords.add (Rectangle (position[0], position[1], + position[2], position[3])); XFree (data); } @@ -2725,9 +2725,9 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool / if (monitorCoords.size() == 0) { - monitorCoords.add (Rectangle (0, 0, - DisplayWidth (display, DefaultScreen (display)), - DisplayHeight (display, DefaultScreen (display)))); + monitorCoords.add (Rectangle (0, 0, + DisplayWidth (display, DefaultScreen (display)), + DisplayHeight (display, DefaultScreen (display)))); } } } diff --git a/src/native/mac/juce_iphone_MiscUtilities.mm b/src/native/mac/juce_iphone_MiscUtilities.mm index 9fbae5ba6b..090d754cb2 100644 --- a/src/native/mac/juce_iphone_MiscUtilities.mm +++ b/src/native/mac/juce_iphone_MiscUtilities.mm @@ -189,10 +189,10 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c CGRect r = clipToWorkArea ? [[UIScreen mainScreen] applicationFrame] : [[UIScreen mainScreen] bounds]; - monitorCoords.add (Rectangle ((int) r.origin.x, - (int) r.origin.y, - (int) r.size.width, - (int) r.size.height)); + monitorCoords.add (Rectangle ((int) r.origin.x, + (int) r.origin.y, + (int) r.size.width, + (int) r.size.height)); } diff --git a/src/native/mac/juce_iphone_UIViewComponentPeer.mm b/src/native/mac/juce_iphone_UIViewComponentPeer.mm index e815fad256..7f948bf8c1 100644 --- a/src/native/mac/juce_iphone_UIViewComponentPeer.mm +++ b/src/native/mac/juce_iphone_UIViewComponentPeer.mm @@ -533,8 +533,8 @@ CGRect UIViewComponentPeer::constrainRect (CGRect r) int w = (int) r.size.width; int h = (int) r.size.height; - Rectangle original ((int) current.origin.x, (int) current.origin.y, - (int) current.size.width, (int) current.size.height); + Rectangle original ((int) current.origin.x, (int) current.origin.y, + (int) current.size.width, (int) current.size.height); constrainer->checkBounds (x, y, w, h, original, @@ -567,7 +567,7 @@ void UIViewComponentPeer::setFullScreen (bool shouldBeFullScreen) { if (! isSharedWindow) { - Rectangle r (lastNonFullscreenBounds); + Rectangle r (lastNonFullscreenBounds); setMinimised (false); @@ -773,9 +773,9 @@ class AsyncRepaintMessage : public CallbackMessage { public: UIViewComponentPeer* const peer; - const Rectangle rect; + const Rectangle rect; - AsyncRepaintMessage (UIViewComponentPeer* const peer_, const Rectangle& rect_) + AsyncRepaintMessage (UIViewComponentPeer* const peer_, const Rectangle& rect_) : peer (peer_), rect (rect_) { } @@ -791,7 +791,7 @@ void UIViewComponentPeer::repaint (int x, int y, int w, int h) { if (insideDrawRect || ! MessageManager::getInstance()->isThisTheMessageThread()) { - (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); + (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); } else { diff --git a/src/native/mac/juce_mac_CoreGraphicsContext.mm b/src/native/mac/juce_mac_CoreGraphicsContext.mm index 129f1f001d..9311f28d01 100644 --- a/src/native/mac/juce_mac_CoreGraphicsContext.mm +++ b/src/native/mac/juce_mac_CoreGraphicsContext.mm @@ -163,7 +163,7 @@ public: CGContextTranslateCTM (context, x, -y); } - bool clipToRectangle (const Rectangle& r) + bool clipToRectangle (const Rectangle& r) { CGContextClipToRect (context, CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight())); return ! isClipEmpty(); @@ -183,7 +183,7 @@ public: HeapBlock rects (numRects); for (int i = 0; i < numRects; ++i) { - const Rectangle& r = clipRegion.getRectangle(i); + const Rectangle& r = clipRegion.getRectangle(i); rects[i] = CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight()); } @@ -192,7 +192,7 @@ public: } } - void excludeClipRectangle (const Rectangle& r) + void excludeClipRectangle (const Rectangle& r) { RectangleList remaining (getClipBounds()); remaining.subtract (r); @@ -205,7 +205,7 @@ public: CGContextClip (context); } - void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) + void clipToImageAlpha (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform) { if (! transform.isSingularity()) { @@ -227,19 +227,19 @@ public: } } - bool clipRegionIntersects (const Rectangle& r) + bool clipRegionIntersects (const Rectangle& r) { return getClipBounds().intersects (r); } - const Rectangle getClipBounds() const + const Rectangle getClipBounds() const { CGRect bounds = CGRectIntegral (CGContextGetClipBoundingBox (context)); - return Rectangle (roundToInt (bounds.origin.x), - roundToInt (flipHeight - (bounds.origin.y + bounds.size.height)), - roundToInt (bounds.size.width), - roundToInt (bounds.size.height)); + return Rectangle (roundToInt (bounds.origin.x), + roundToInt (flipHeight - (bounds.origin.y + bounds.size.height)), + roundToInt (bounds.size.width), + roundToInt (bounds.size.height)); } bool isClipEmpty() const @@ -298,7 +298,7 @@ public: } //============================================================================== - void fillRect (const Rectangle& r, const bool replaceExistingContents) + void fillRect (const Rectangle& r, const bool replaceExistingContents) { CGRect cgRect = CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight()); @@ -374,7 +374,7 @@ public: CGContextRestoreGState (context); } - void drawImage (const Image& sourceImage, const Rectangle& srcClip, + void drawImage (const Image& sourceImage, const Rectangle& srcClip, const AffineTransform& transform, const bool fillEntireClipAsTiles) { jassert (sourceImage.getBounds().contains (srcClip)); diff --git a/src/native/mac/juce_mac_MiscUtilities.mm b/src/native/mac/juce_mac_MiscUtilities.mm index a76f2ef650..5fa396d0cf 100644 --- a/src/native/mac/juce_mac_MiscUtilities.mm +++ b/src/native/mac/juce_mac_MiscUtilities.mm @@ -239,7 +239,7 @@ bool Desktop::isScreenSaverEnabled() throw() #endif //============================================================================== -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) +void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea) { const ScopedAutoReleasePool pool; monitorCoords.clear(); @@ -253,10 +253,10 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c NSRect r = clipToWorkArea ? [s visibleFrame] : [s frame]; - monitorCoords.add (Rectangle ((int) r.origin.x, - (int) (mainScreenBottom - (r.origin.y + r.size.height)), - (int) r.size.width, - (int) r.size.height)); + monitorCoords.add (Rectangle ((int) r.origin.x, + (int) (mainScreenBottom - (r.origin.y + r.size.height)), + (int) r.size.width, + (int) r.size.height)); } jassert (monitorCoords.size() > 0); diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index b2df739639..6e57bdcb3b 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -902,8 +902,8 @@ NSRect NSViewComponentPeer::constrainRect (NSRect r) int w = (int) r.size.width; int h = (int) r.size.height; - Rectangle original ((int) current.origin.x, (int) current.origin.y, - (int) current.size.width, (int) current.size.height); + Rectangle original ((int) current.origin.x, (int) current.origin.y, + (int) current.size.width, (int) current.size.height); constrainer->checkBounds (x, y, w, h, original, @@ -942,7 +942,7 @@ void NSViewComponentPeer::setFullScreen (bool shouldBeFullScreen) { if (! isSharedWindow) { - Rectangle r (lastNonFullscreenBounds); + Rectangle r (lastNonFullscreenBounds); setMinimised (false); @@ -1387,10 +1387,10 @@ void NSViewComponentPeer::drawRect (NSRect r) RectangleList clip; for (int i = 0; i < numRects; ++i) { - clip.addWithoutMerging (Rectangle (roundToInt (rects[i].origin.x), - roundToInt ([view frame].size.height - (rects[i].origin.y + rects[i].size.height)), - roundToInt (rects[i].size.width), - roundToInt (rects[i].size.height))); + clip.addWithoutMerging (Rectangle (roundToInt (rects[i].origin.x), + roundToInt ([view frame].size.height - (rects[i].origin.y + rects[i].size.height)), + roundToInt (rects[i].size.width), + roundToInt (rects[i].size.height))); } if (context.clipToRectangleList (clip)) @@ -1483,9 +1483,9 @@ class AsyncRepaintMessage : public CallbackMessage { public: NSViewComponentPeer* const peer; - const Rectangle rect; + const Rectangle rect; - AsyncRepaintMessage (NSViewComponentPeer* const peer_, const Rectangle& rect_) + AsyncRepaintMessage (NSViewComponentPeer* const peer_, const Rectangle& rect_) : peer (peer_), rect (rect_) { } @@ -1501,7 +1501,7 @@ void NSViewComponentPeer::repaint (int x, int y, int w, int h) { if (insideDrawRect) { - (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); + (new AsyncRepaintMessage (this, Rectangle (x, y, w, h)))->post(); } else { diff --git a/src/native/mac/juce_mac_QuickTimeMovieComponent.mm b/src/native/mac/juce_mac_QuickTimeMovieComponent.mm index 055eca8b2a..1f39d339c8 100644 --- a/src/native/mac/juce_mac_QuickTimeMovieComponent.mm +++ b/src/native/mac/juce_mac_QuickTimeMovieComponent.mm @@ -273,7 +273,7 @@ void QuickTimeMovieComponent::goToStart() setPosition (0.0); } -void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, const RectanglePlacement& placement) { int normalWidth, normalHeight; diff --git a/src/native/windows/juce_win32_ActiveXComponent.cpp b/src/native/windows/juce_win32_ActiveXComponent.cpp index f5b450397f..f83185b01b 100644 --- a/src/native/windows/juce_win32_ActiveXComponent.cpp +++ b/src/native/windows/juce_win32_ActiveXComponent.cpp @@ -289,7 +289,7 @@ public: int x = 0, y = 0; owner->relativePositionToOtherComponent (topComp, x, y); - owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); + owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); } } @@ -477,7 +477,7 @@ bool ActiveXControlComponent::createControl (const void* controlIID) if (info->control->DoVerb (OLEIVERB_SHOW, 0, info->clientSite, 0, hwnd, &rect) == S_OK) { control = info.release(); - setControlBounds (Rectangle (x, y, getWidth(), getHeight())); + setControlBounds (Rectangle (x, y, getWidth(), getHeight())); ((ActiveXControlData*) control)->controlHWND = getHWND (this); @@ -521,7 +521,7 @@ void* ActiveXControlComponent::queryInterface (const void* iid) const return 0; } -void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const +void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const { HWND hwnd = ((ActiveXControlData*) control)->controlHWND; diff --git a/src/native/windows/juce_win32_FileChooser.cpp b/src/native/windows/juce_win32_FileChooser.cpp index e41cadcc91..087540c42d 100644 --- a/src/native/windows/juce_win32_FileChooser.cpp +++ b/src/native/windows/juce_win32_FileChooser.cpp @@ -163,7 +163,7 @@ void FileChooser::showPlatformDialog (Array& results, { // use a modal window as the parent for this dialog box // to block input from other app windows - const Rectangle mainMon (Desktop::getInstance().getMainMonitorArea()); + const Rectangle mainMon (Desktop::getInstance().getMainMonitorArea()); Component w (String::empty); w.setBounds (mainMon.getX() + mainMon.getWidth() / 4, diff --git a/src/native/windows/juce_win32_Files.cpp b/src/native/windows/juce_win32_Files.cpp index e68da9f53b..923a55626d 100644 --- a/src/native/windows/juce_win32_Files.cpp +++ b/src/native/windows/juce_win32_Files.cpp @@ -538,7 +538,7 @@ const String File::getVersion() const VS_FIXEDFILEINFO* vffi; UINT len = 0; - if (VerQueryValue (buffer, _T("\\"), (LPVOID*) &vffi, &len)) + if (VerQueryValue (buffer, (LPTSTR) _T("\\"), (LPVOID*) &vffi, &len)) { result << (int) HIWORD (vffi->dwFileVersionMS) << "." << (int) LOWORD (vffi->dwFileVersionMS) << "." diff --git a/src/native/windows/juce_win32_Network.cpp b/src/native/windows/juce_win32_Network.cpp index e80d641a19..789a22416e 100644 --- a/src/native/windows/juce_win32_Network.cpp +++ b/src/native/windows/juce_win32_Network.cpp @@ -32,6 +32,10 @@ #define INTERNET_FLAG_NEED_FILE 0x00000010 #endif +#ifndef INTERNET_OPTION_DISABLE_AUTODIAL + #define INTERNET_OPTION_DISABLE_AUTODIAL 70 +#endif + //============================================================================== bool juce_isOnLine() { diff --git a/src/native/windows/juce_win32_QuickTimeMovieComponent.cpp b/src/native/windows/juce_win32_QuickTimeMovieComponent.cpp index 1de47d9d15..8f20ac623d 100644 --- a/src/native/windows/juce_win32_QuickTimeMovieComponent.cpp +++ b/src/native/windows/juce_win32_QuickTimeMovieComponent.cpp @@ -481,7 +481,7 @@ void QuickTimeMovieComponent::goToStart() setPosition (0.0); } -void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, const RectanglePlacement& placement) { int normalWidth, normalHeight; diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index 7fcec93659..f9de485d26 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -279,7 +279,7 @@ public: { for (RectangleList::Iterator i (maskedRegion); i.next();) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); ExcludeClipRect (hdc, r.getX(), r.getY(), r.getRight(), r.getBottom()); } } @@ -296,7 +296,7 @@ public: for (RectangleList::Iterator i (maskedRegion); i.next();) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); ExcludeClipRect (dc, r.getX(), r.getY(), r.getRight(), r.getBottom()); } } @@ -648,7 +648,7 @@ public: if (! fullScreen) { - const Rectangle boundsCopy (lastNonFullscreenBounds); + const Rectangle boundsCopy (lastNonFullscreenBounds); if (hasTitleBar()) ShowWindow (hwnd, SW_SHOWNORMAL); @@ -1215,7 +1215,7 @@ private: if (cx + cw - x <= w && cy + ch - y <= h) { - contextClip.addWithoutMerging (Rectangle (cx - x, cy - y, cw, ch)); + contextClip.addWithoutMerging (Rectangle (cx - x, cy - y, cw, ch)); } else { @@ -1232,7 +1232,7 @@ private: if (needToPaintAll) { contextClip.clear(); - contextClip.addWithoutMerging (Rectangle (0, 0, w, h)); + contextClip.addWithoutMerging (Rectangle (0, 0, w, h)); } if (transparent) @@ -1241,7 +1241,7 @@ private: while (i.next()) { - const Rectangle& r = *i.getRectangle(); + const Rectangle& r = *i.getRectangle(); offscreenImage->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); } } @@ -1790,7 +1790,7 @@ private: if (fullScreen && ! isMinimised()) { - const Rectangle r (component->getParentMonitorArea()); + const Rectangle r (component->getParentMonitorArea()); SetWindowPos (hwnd, 0, r.getX(), r.getY(), r.getWidth(), r.getHeight(), @@ -1897,10 +1897,10 @@ private: { if (constrainer != 0) { - const Rectangle current (component->getX() - windowBorder.getLeft(), - component->getY() - windowBorder.getTop(), - component->getWidth() + windowBorder.getLeftAndRight(), - component->getHeight() + windowBorder.getTopAndBottom()); + const Rectangle current (component->getX() - windowBorder.getLeft(), + component->getY() - windowBorder.getTop(), + component->getWidth() + windowBorder.getLeftAndRight(), + component->getHeight() + windowBorder.getTopAndBottom()); constrainer->checkBounds (wp->x, wp->y, wp->cx, wp->cy, current, @@ -2416,14 +2416,14 @@ void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable //============================================================================== static BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo) { - Array * const monitorCoords = (Array *) userInfo; + Array >* const monitorCoords = (Array >*) userInfo; - monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); + monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); return TRUE; } -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) +void juce_updateMultiMonitorInfo (Array >& monitorCoords, const bool clipToWorkArea) { EnumDisplayMonitors (0, 0, &enumMonitorsProc, (LPARAM) &monitorCoords); @@ -2437,7 +2437,7 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c RECT r; GetWindowRect (GetDesktopWindow(), &r); - monitorCoords.add (Rectangle (r.left, r.top, r.right - r.left, r.bottom - r.top)); + monitorCoords.add (Rectangle (r.left, r.top, r.right - r.left, r.bottom - r.top)); } if (clipToWorkArea) @@ -2446,7 +2446,7 @@ void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool c RECT r; SystemParametersInfo (SPI_GETWORKAREA, 0, &r, 0); - Rectangle& screen = monitorCoords.getReference (0); + Rectangle& screen = monitorCoords.getReference (0); screen.setPosition (jmax (screen.getX(), (int) r.left), jmax (screen.getY(), (int) r.top));