| @@ -106,16 +106,16 @@ public: | |||
| StringArray flags; | |||
| if (b->isConnectedOnLeft()) | |||
| flags.add ("Button::ConnectedOnLeft"); | |||
| flags.add ("juce::Button::ConnectedOnLeft"); | |||
| if (b->isConnectedOnRight()) | |||
| flags.add ("Button::ConnectedOnRight"); | |||
| flags.add ("juce::Button::ConnectedOnRight"); | |||
| if (b->isConnectedOnTop()) | |||
| flags.add ("Button::ConnectedOnTop"); | |||
| flags.add ("juce::Button::ConnectedOnTop"); | |||
| if (b->isConnectedOnBottom()) | |||
| flags.add ("Button::ConnectedOnBottom"); | |||
| flags.add ("juce::Button::ConnectedOnBottom"); | |||
| String s; | |||
| s << memberVariableName << "->setConnectedEdges (" | |||
| @@ -138,9 +138,9 @@ public: | |||
| if (needsButtonListener (component)) | |||
| { | |||
| String& callback = code.getCallbackCode ("public Button::Listener", | |||
| String& callback = code.getCallbackCode ("public juce::Button::Listener", | |||
| "void", | |||
| "buttonClicked (Button* buttonThatWasClicked)", | |||
| "buttonClicked (juce::Button* buttonThatWasClicked)", | |||
| true); | |||
| if (callback.isNotEmpty()) | |||
| @@ -24,7 +24,7 @@ class ComboBoxHandler : public ComponentTypeHandler | |||
| { | |||
| public: | |||
| ComboBoxHandler() | |||
| : ComponentTypeHandler ("Combo Box", "ComboBox", typeid (ComboBox), 150, 24) | |||
| : ComponentTypeHandler ("Combo Box", "juce::ComboBox", typeid (ComboBox), 150, 24) | |||
| {} | |||
| Component* createNewComponent (JucerDocument*) override | |||
| @@ -132,9 +132,9 @@ public: | |||
| if (needsCallback (component)) | |||
| { | |||
| String& callback = code.getCallbackCode ("public ComboBox::Listener", | |||
| String& callback = code.getCallbackCode ("public juce::ComboBox::Listener", | |||
| "void", | |||
| "comboBoxChanged (ComboBox* comboBoxThatHasChanged)", | |||
| "comboBoxChanged (juce::ComboBox* comboBoxThatHasChanged)", | |||
| true); | |||
| if (callback.trim().isNotEmpty()) | |||
| @@ -25,7 +25,7 @@ class GenericComponent : public Component | |||
| public: | |||
| GenericComponent() | |||
| : Component ("new component"), | |||
| actualClassName ("Component") | |||
| actualClassName ("juce::Component") | |||
| { | |||
| } | |||
| @@ -90,7 +90,7 @@ public: | |||
| if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout)) | |||
| return false; | |||
| ((GenericComponent*) comp)->actualClassName = xml.getStringAttribute ("class", "Component"); | |||
| ((GenericComponent*) comp)->actualClassName = xml.getStringAttribute ("class", "juce::Component"); | |||
| ((GenericComponent*) comp)->constructorParams = xml.getStringAttribute ("params", String()); | |||
| return true; | |||
| } | |||
| @@ -24,7 +24,7 @@ class GroupComponentHandler : public ComponentTypeHandler | |||
| { | |||
| public: | |||
| GroupComponentHandler() | |||
| : ComponentTypeHandler ("Group Box", "GroupComponent", typeid (GroupComponent), 200, 150) | |||
| : ComponentTypeHandler ("Group Box", "juce::GroupComponent", typeid (GroupComponent), 200, 150) | |||
| { | |||
| registerColour (GroupComponent::outlineColourId, "outline", "outlinecol"); | |||
| registerColour (GroupComponent::textColourId, "text", "textcol"); | |||
| @@ -24,7 +24,7 @@ class HyperlinkButtonHandler : public ButtonHandler | |||
| { | |||
| public: | |||
| HyperlinkButtonHandler() | |||
| : ButtonHandler ("Hyperlink Button", "HyperlinkButton", typeid (HyperlinkButton), 150, 24) | |||
| : ButtonHandler ("Hyperlink Button", "juce::HyperlinkButton", typeid (HyperlinkButton), 150, 24) | |||
| { | |||
| registerColour (HyperlinkButton::textColourId, "text", "textCol"); | |||
| } | |||
| @@ -32,7 +32,7 @@ public: | |||
| //============================================================================== | |||
| ImageButtonHandler() | |||
| : ButtonHandler ("Image Button", "ImageButton", typeid (ImageButton), 150, 24) | |||
| : ButtonHandler ("Image Button", "juce::ImageButton", typeid (ImageButton), 150, 24) | |||
| { | |||
| } | |||
| @@ -156,9 +156,9 @@ public: | |||
| const String resName (getImageResource (ib, role)); | |||
| if (resName.isEmpty()) | |||
| return "Image()"; | |||
| return "juce::Image()"; | |||
| return "ImageCache::getFromMemory (" + resName + ", " + resName + "Size)"; | |||
| return "juce::ImageCache::getFromMemory (" + resName + ", " + resName + "Size)"; | |||
| } | |||
| //============================================================================== | |||
| @@ -74,7 +74,7 @@ public: | |||
| jucerCompClassName = tc->getDocument()->getClassName(); | |||
| if (jucerCompClassName.isEmpty()) | |||
| jucerCompClassName = "Component"; | |||
| jucerCompClassName = "juce::Component"; | |||
| return jucerCompClassName; | |||
| } | |||
| @@ -24,7 +24,7 @@ class LabelHandler : public ComponentTypeHandler | |||
| { | |||
| public: | |||
| LabelHandler() | |||
| : ComponentTypeHandler ("Label", "Label", typeid (Label), 150, 24) | |||
| : ComponentTypeHandler ("Label", "juce::Label", typeid (Label), 150, 24) | |||
| { | |||
| registerColour (Label::backgroundColourId, "background", "bkgCol"); | |||
| registerColour (Label::textColourId, "text", "textCol"); | |||
| @@ -148,9 +148,9 @@ public: | |||
| if (needsCallback (component)) | |||
| { | |||
| String& callback = code.getCallbackCode ("public Label::Listener", | |||
| String& callback = code.getCallbackCode ("public juce::Label::Listener", | |||
| "void", | |||
| "labelTextChanged (Label* labelThatHasChanged)", | |||
| "labelTextChanged (juce::Label* labelThatHasChanged)", | |||
| true); | |||
| if (callback.trim().isNotEmpty()) | |||
| @@ -50,7 +50,7 @@ static const Slider::TextEntryBoxPosition sliderTextBoxPositions[] = | |||
| struct SliderHandler : public ComponentTypeHandler | |||
| { | |||
| SliderHandler() | |||
| : ComponentTypeHandler ("Slider", "Slider", typeid (Slider), 150, 24) | |||
| : ComponentTypeHandler ("Slider", "juce::Slider", typeid (Slider), 150, 24) | |||
| { | |||
| registerColour (Slider::backgroundColourId, "background", "bkgcol"); | |||
| registerColour (Slider::thumbColourId, "thumb", "thumbcol"); | |||
| @@ -127,9 +127,9 @@ struct SliderHandler : public ComponentTypeHandler | |||
| r << memberVariableName << "->setRange (" | |||
| << s->getMinimum() << ", " << s->getMaximum() << ", " << s->getInterval() | |||
| << ");\n" | |||
| << memberVariableName << "->setSliderStyle (Slider::" | |||
| << memberVariableName << "->setSliderStyle (juce::Slider::" | |||
| << sliderStyleToString (s->getSliderStyle()) << ");\n" | |||
| << memberVariableName << "->setTextBoxStyle (Slider::" | |||
| << memberVariableName << "->setTextBoxStyle (juce::Slider::" | |||
| << textBoxPosToString (s->getTextBoxPosition()) | |||
| << ", " << CodeHelpers::boolLiteral (! s->isTextBoxEditable()) | |||
| << ", " << s->getTextBoxWidth() << ", " << s->getTextBoxHeight() << ");\n" | |||
| @@ -151,9 +151,9 @@ struct SliderHandler : public ComponentTypeHandler | |||
| if (needsSliderListener (component)) | |||
| { | |||
| String& callback = code.getCallbackCode ("public Slider::Listener", | |||
| String& callback = code.getCallbackCode ("public juce::Slider::Listener", | |||
| "void", | |||
| "sliderValueChanged (Slider* sliderThatWasMoved)", | |||
| "sliderValueChanged (juce::Slider* sliderThatWasMoved)", | |||
| true); | |||
| if (callback.isNotEmpty()) | |||
| @@ -24,7 +24,7 @@ class TabbedComponentHandler : public ComponentTypeHandler | |||
| { | |||
| public: | |||
| TabbedComponentHandler() | |||
| : ComponentTypeHandler ("Tabbed Component", "TabbedComponent", typeid (TabbedComponent), 200, 150) | |||
| : ComponentTypeHandler ("Tabbed Component", "juce::TabbedComponent", typeid (TabbedComponent), 200, 150) | |||
| {} | |||
| Component* createNewComponent (JucerDocument*) override | |||
| @@ -144,10 +144,10 @@ public: | |||
| switch (t->getOrientation()) | |||
| { | |||
| case TabbedButtonBar::TabsAtTop: return "TabbedButtonBar::TabsAtTop"; | |||
| case TabbedButtonBar::TabsAtBottom: return "TabbedButtonBar::TabsAtBottom"; | |||
| case TabbedButtonBar::TabsAtLeft: return "TabbedButtonBar::TabsAtLeft"; | |||
| case TabbedButtonBar::TabsAtRight: return "TabbedButtonBar::TabsAtRight"; | |||
| case TabbedButtonBar::TabsAtTop: return "juce::TabbedButtonBar::TabsAtTop"; | |||
| case TabbedButtonBar::TabsAtBottom: return "juce::TabbedButtonBar::TabsAtBottom"; | |||
| case TabbedButtonBar::TabsAtLeft: return "juce::TabbedButtonBar::TabsAtLeft"; | |||
| case TabbedButtonBar::TabsAtRight: return "juce::TabbedButtonBar::TabsAtRight"; | |||
| default: jassertfalse; break; | |||
| } | |||
| @@ -24,7 +24,7 @@ class TextButtonHandler : public ButtonHandler | |||
| { | |||
| public: | |||
| TextButtonHandler() | |||
| : ButtonHandler ("Text Button", "TextButton", typeid (TextButton), 150, 24) | |||
| : ButtonHandler ("Text Button", "juce::TextButton", typeid (TextButton), 150, 24) | |||
| { | |||
| registerColour (TextButton::buttonColourId, "background (normal)", "bgColOff"); | |||
| registerColour (TextButton::buttonOnColourId, "background (on)", "bgColOn"); | |||
| @@ -24,7 +24,7 @@ class TextEditorHandler : public ComponentTypeHandler | |||
| { | |||
| public: | |||
| TextEditorHandler() | |||
| : ComponentTypeHandler ("Text Editor", "TextEditor", typeid (TextEditor), 150, 24) | |||
| : ComponentTypeHandler ("Text Editor", "juce::TextEditor", typeid (TextEditor), 150, 24) | |||
| { | |||
| registerColour (TextEditor::textColourId, "text", "textcol"); | |||
| registerColour (TextEditor::backgroundColourId, "background", "bkgcol"); | |||
| @@ -24,7 +24,7 @@ class ToggleButtonHandler : public ButtonHandler | |||
| { | |||
| public: | |||
| ToggleButtonHandler() | |||
| : ButtonHandler ("Toggle Button", "ToggleButton", typeid (ToggleButton), 150, 24) | |||
| : ButtonHandler ("Toggle Button", "juce::ToggleButton", typeid (ToggleButton), 150, 24) | |||
| { | |||
| registerColour (ToggleButton::textColourId, "text colour", "txtcol"); | |||
| } | |||
| @@ -24,7 +24,7 @@ class TreeViewHandler : public ComponentTypeHandler | |||
| { | |||
| public: | |||
| TreeViewHandler() | |||
| : ComponentTypeHandler ("TreeView", "TreeView", typeid (DemoTreeView), 150, 150) | |||
| : ComponentTypeHandler ("TreeView", "juce::TreeView", typeid (DemoTreeView), 150, 150) | |||
| { | |||
| registerColour (TreeView::backgroundColourId, "background", "backgroundColour"); | |||
| registerColour (TreeView::linesColourId, "lines", "linecol"); | |||
| @@ -24,7 +24,7 @@ class ViewportHandler : public ComponentTypeHandler | |||
| { | |||
| public: | |||
| ViewportHandler() | |||
| : ComponentTypeHandler ("Viewport", "Viewport", typeid (UpdatingViewport), 150, 150) | |||
| : ComponentTypeHandler ("Viewport", "juce::Viewport", typeid (UpdatingViewport), 150, 150) | |||
| {} | |||
| Component* createNewComponent (JucerDocument*) override | |||
| @@ -42,7 +42,7 @@ ButtonDocument::ButtonDocument (SourceCodeDocument* c) | |||
| paintStatesEnabled [downOn] = false; | |||
| paintStatesEnabled [background] = false; | |||
| parentClasses = "public Button"; | |||
| parentClasses = "public juce::Button"; | |||
| for (int i = 7; --i >= 0;) | |||
| { | |||
| @@ -209,8 +209,8 @@ void ButtonDocument::getOptionalMethods (StringArray& baseClasses, | |||
| { | |||
| JucerDocument::getOptionalMethods (baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Button", "void", "clicked()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Button", "void", "buttonStateChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Button", "void", "clicked()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Button", "void", "buttonStateChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| } | |||
| //============================================================================== | |||
| @@ -322,9 +322,9 @@ void ButtonDocument::fillInPaintCode (GeneratedCode& code) const | |||
| if (paintStatesEnabled [i]) | |||
| paintRoutines[i]->fillInGeneratedCode (code, paintCode [i]); | |||
| String& s = code.getCallbackCode ("public Button", | |||
| String& s = code.getCallbackCode ("public juce::Button", | |||
| "void", | |||
| "paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)", | |||
| "paintButton (juce::Graphics& g, bool isMouseOverButton, bool isButtonDown)", | |||
| false); | |||
| int numPaintRoutines = getNumPaintRoutines(); | |||
| @@ -116,12 +116,12 @@ public: | |||
| switch (mode) | |||
| { | |||
| case solidColour: | |||
| s << "Colour " << type << "Colour = " << CodeHelpers::colourToCode (colour) << ";\n"; | |||
| s << "juce::Colour " << type << "Colour = " << CodeHelpers::colourToCode (colour) << ";\n"; | |||
| break; | |||
| case linearGradient: | |||
| case radialGradient: | |||
| s << "Colour " << type << "Colour1 = " << CodeHelpers::colourToCode (gradCol1) << ", " << type << "Colour2 = " << CodeHelpers::colourToCode (gradCol2) << ";\n"; | |||
| s << "juce::Colour " << type << "Colour1 = " << CodeHelpers::colourToCode (gradCol1) << ", " << type << "Colour2 = " << CodeHelpers::colourToCode (gradCol2) << ";\n"; | |||
| break; | |||
| case imageBrush: | |||
| @@ -153,7 +153,7 @@ public: | |||
| positionToCode (gradPos1, code.document->getComponentLayout(), x1, y1, w, h); | |||
| positionToCode (gradPos2, code.document->getComponentLayout(), x2, y2, w, h); | |||
| s << "g.setGradientFill (ColourGradient ("; | |||
| s << "g.setGradientFill (juce::ColourGradient ("; | |||
| auto indent = String::repeatedString (" ", s.length()); | |||
| @@ -90,9 +90,9 @@ void PaintElementImage::fillInGeneratedCode (GeneratedCode& code, String& paintM | |||
| code.addImageResourceLoader (imageVariable, resourceName); | |||
| if (opacity >= 254.0 / 255.0) | |||
| r << " g.setColour (Colours::black);\n"; | |||
| r << " g.setColour (juce::Colours::black);\n"; | |||
| else | |||
| r << " g.setColour (Colours::black.withAlpha (" << CodeHelpers::floatLiteral (opacity, 3) << "));\n"; | |||
| r << " g.setColour (juce::Colours::black.withAlpha (" << CodeHelpers::floatLiteral (opacity, 3) << "));\n"; | |||
| if (mode == stretched) | |||
| { | |||
| @@ -107,9 +107,9 @@ void PaintElementImage::fillInGeneratedCode (GeneratedCode& code, String& paintM | |||
| << " "; | |||
| if (mode == proportionalReducingOnly) | |||
| r << "RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize"; | |||
| r << "juce::RectanglePlacement::centred | juce::RectanglePlacement::onlyReduceInSize"; | |||
| else | |||
| r << "RectanglePlacement::centred"; | |||
| r << "juce::RectanglePlacement::centred"; | |||
| r << ",\n" | |||
| << " false);\n"; | |||
| @@ -123,27 +123,27 @@ void PaintElementImage::fillInGeneratedCode (GeneratedCode& code, String& paintM | |||
| const String imageVariable ("drawable" + String (code.getUniqueSuffix())); | |||
| code.privateMemberDeclarations | |||
| << "std::unique_ptr<Drawable> " << imageVariable << ";\n"; | |||
| << "std::unique_ptr<juce::Drawable> " << imageVariable << ";\n"; | |||
| code.constructorCode | |||
| << imageVariable << " = Drawable::createFromImageData (" | |||
| << imageVariable << " = juce::Drawable::createFromImageData (" | |||
| << resourceName << ", " << resourceName << "Size);\n"; | |||
| code.destructorCode | |||
| << imageVariable << " = nullptr;\n"; | |||
| if (opacity >= 254.0 / 255.0) | |||
| r << " g.setColour (Colours::black);\n"; | |||
| r << " g.setColour (juce::Colours::black);\n"; | |||
| else | |||
| r << " g.setColour (Colours::black.withAlpha (" << CodeHelpers::floatLiteral (opacity, 3) << "));\n"; | |||
| r << " g.setColour (juce::Colours::black.withAlpha (" << CodeHelpers::floatLiteral (opacity, 3) << "));\n"; | |||
| r << " jassert (" << imageVariable << " != nullptr);\n" | |||
| << " if (" << imageVariable << " != nullptr)\n" | |||
| << " " << imageVariable << "->drawWithin (g, Rectangle<int> (x, y, width, height).toFloat(),\n" | |||
| << " " << imageVariable << "->drawWithin (g, juce::Rectangle<int> (x, y, width, height).toFloat(),\n" | |||
| << " " << String::repeatedString (" ", imageVariable.length() + 18) | |||
| << (mode == stretched ? "RectanglePlacement::stretchToFit" | |||
| : (mode == proportionalReducingOnly ? "RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize" | |||
| : "RectanglePlacement::centred")) | |||
| << (mode == stretched ? "juce::RectanglePlacement::stretchToFit" | |||
| : (mode == proportionalReducingOnly ? "juce::RectanglePlacement::centred | juce::RectanglePlacement::onlyReduceInSize" | |||
| : "juce::RectanglePlacement::centred")) | |||
| << ", " << CodeHelpers::floatLiteral (opacity, 3) << ");\n"; | |||
| } | |||
| } | |||
| @@ -369,7 +369,7 @@ void PaintElementPath::fillInGeneratedCode (GeneratedCode& code, String& paintMe | |||
| const ComponentLayout* layout = code.document->getComponentLayout(); | |||
| code.privateMemberDeclarations | |||
| << "Path " << pathVariable << ";\n"; | |||
| << "juce::Path " << pathVariable << ";\n"; | |||
| String r; | |||
| bool somePointsAreRelative = false; | |||
| @@ -447,14 +447,14 @@ void PaintElementPath::fillInGeneratedCode (GeneratedCode& code, String& paintMe | |||
| { | |||
| s << " "; | |||
| fillType.fillInGeneratedCode ("fill", zero, code, s); | |||
| s << " g.fillPath (" << pathVariable << ", AffineTransform::translation(x, y));\n"; | |||
| s << " g.fillPath (" << pathVariable << ", juce::AffineTransform::translation(x, y));\n"; | |||
| } | |||
| if (isStrokePresent && ! strokeType.isInvisible()) | |||
| { | |||
| s << " "; | |||
| strokeType.fill.fillInGeneratedCode ("stroke", zero, code, s); | |||
| s << " g.strokePath (" << pathVariable << ", " << strokeType.getPathStrokeCode() << ", AffineTransform::translation(x, y));\n"; | |||
| s << " g.strokePath (" << pathVariable << ", " << strokeType.getPathStrokeCode() << ", juce::AffineTransform::translation(x, y));\n"; | |||
| } | |||
| s << "}\n\n"; | |||
| @@ -81,7 +81,7 @@ public: | |||
| positionToCode (position, code.document->getComponentLayout(), x, y, w, h); | |||
| r << "{\n" | |||
| << " int x = " << x << ", y = " << y << ", width = " << w << ", height = " << h << ";\n" | |||
| << " String text (" << quotedString (text, code.shouldUseTransMacro()) << ");\n" | |||
| << " juce::String text (" << quotedString (text, code.shouldUseTransMacro()) << ");\n" | |||
| << " " << fillType.generateVariablesCode ("fill") | |||
| << " //[UserPaintCustomArguments] Customize the painting arguments here..\n" | |||
| << customPaintCode | |||
| @@ -35,7 +35,7 @@ public: | |||
| String s; | |||
| s << "PathStrokeType (" << CodeHelpers::floatLiteral (stroke.getStrokeThickness(), 3); | |||
| s << "juce::PathStrokeType (" << CodeHelpers::floatLiteral (stroke.getStrokeThickness(), 3); | |||
| if (stroke.getJointStyle() != defaultStroke.getJointStyle() | |||
| || stroke.getEndStyle() != defaultStroke.getEndStyle()) | |||
| @@ -44,9 +44,9 @@ public: | |||
| switch (stroke.getJointStyle()) | |||
| { | |||
| case PathStrokeType::mitered: s << "PathStrokeType::mitered"; break; | |||
| case PathStrokeType::curved: s << "PathStrokeType::curved"; break; | |||
| case PathStrokeType::beveled: s << "PathStrokeType::beveled"; break; | |||
| case PathStrokeType::mitered: s << "juce::PathStrokeType::mitered"; break; | |||
| case PathStrokeType::curved: s << "juce::PathStrokeType::curved"; break; | |||
| case PathStrokeType::beveled: s << "juce::PathStrokeType::beveled"; break; | |||
| default: jassertfalse; break; | |||
| } | |||
| @@ -56,9 +56,9 @@ public: | |||
| switch (stroke.getEndStyle()) | |||
| { | |||
| case PathStrokeType::butt: s << "PathStrokeType::butt"; break; | |||
| case PathStrokeType::square: s << "PathStrokeType::square"; break; | |||
| case PathStrokeType::rounded: s << "PathStrokeType::rounded"; break; | |||
| case PathStrokeType::butt: s << "juce::PathStrokeType::butt"; break; | |||
| case PathStrokeType::square: s << "juce::PathStrokeType::square"; break; | |||
| case PathStrokeType::rounded: s << "juce::PathStrokeType::rounded"; break; | |||
| default: jassertfalse; break; | |||
| } | |||
| } | |||
| @@ -92,33 +92,33 @@ public: | |||
| static String getTypefaceNameCode (const String& typefaceName) | |||
| { | |||
| if (typefaceName == getDefaultFont()) return {}; | |||
| if (typefaceName == getDefaultSans()) return "Font::getDefaultSansSerifFontName(), "; | |||
| if (typefaceName == getDefaultSerif()) return "Font::getDefaultSerifFontName(), "; | |||
| if (typefaceName == getDefaultMono()) return "Font::getDefaultMonospacedFontName(), "; | |||
| if (typefaceName == getDefaultSans()) return "juce::Font::getDefaultSansSerifFontName(), "; | |||
| if (typefaceName == getDefaultSerif()) return "juce::Font::getDefaultSerifFontName(), "; | |||
| if (typefaceName == getDefaultMono()) return "juce::Font::getDefaultMonospacedFontName(), "; | |||
| return "\"" + typefaceName + "\", "; | |||
| } | |||
| static String getFontStyleCode (const Font& font) | |||
| { | |||
| if (font.isBold() && font.isItalic()) return "Font::bold | Font::italic"; | |||
| if (font.isBold()) return "Font::bold"; | |||
| if (font.isItalic()) return "Font::italic"; | |||
| if (font.isBold() && font.isItalic()) return "juce::Font::bold | juce::Font::italic"; | |||
| if (font.isBold()) return "juce::Font::bold"; | |||
| if (font.isItalic()) return "juce::Font::italic"; | |||
| return "Font::plain"; | |||
| return "juce::Font::plain"; | |||
| } | |||
| static String getCompleteFontCode (const Font& font, const String& typefaceName) | |||
| { | |||
| String s; | |||
| s << "Font (" | |||
| s << "juce::Font (" | |||
| << getTypefaceNameCode (typefaceName) | |||
| << CodeHelpers::floatLiteral (font.getHeight(), 2) | |||
| << ", "; | |||
| if (font.getAvailableStyles().contains(font.getTypefaceStyle())) | |||
| s << "Font::plain).withTypefaceStyle (" | |||
| s << "juce::Font::plain).withTypefaceStyle (" | |||
| << CodeHelpers::stringLiteral (font.getTypefaceStyle()) | |||
| << ")"; | |||
| else | |||
| @@ -968,7 +968,7 @@ void positionToCode (const RelativePositionedRectangle& position, | |||
| if (position.rect.getWidthMode() == PositionedRectangle::proportionalSize) | |||
| { | |||
| if (wrw.isNotEmpty()) | |||
| w << "roundToInt (" << bracketIfNeeded (wrw) << " * " << CodeHelpers::floatLiteral (position.rect.getWidth(), 4) << ")"; | |||
| w << "juce::roundToInt (" << bracketIfNeeded (wrw) << " * " << CodeHelpers::floatLiteral (position.rect.getWidth(), 4) << ")"; | |||
| else | |||
| w << "proportionOfWidth (" << CodeHelpers::floatLiteral (position.rect.getWidth(), 4) << ")"; | |||
| } | |||
| @@ -991,7 +991,7 @@ void positionToCode (const RelativePositionedRectangle& position, | |||
| if (position.rect.getHeightMode() == PositionedRectangle::proportionalSize) | |||
| { | |||
| if (hrh.isNotEmpty()) | |||
| h << "roundToInt (" << bracketIfNeeded (hrh) << " * " << CodeHelpers::floatLiteral (position.rect.getHeight(), 4) << ")"; | |||
| h << "juce::roundToInt (" << bracketIfNeeded (hrh) << " * " << CodeHelpers::floatLiteral (position.rect.getHeight(), 4) << ")"; | |||
| else | |||
| h << "proportionOfHeight (" << CodeHelpers::floatLiteral (position.rect.getHeight(), 4) << ")"; | |||
| } | |||
| @@ -1014,7 +1014,7 @@ void positionToCode (const RelativePositionedRectangle& position, | |||
| if (position.rect.getPositionModeX() == PositionedRectangle::proportionOfParentSize) | |||
| { | |||
| if (xrx.isNotEmpty() && xrw.isNotEmpty()) | |||
| x << bracketIfNeeded (xrx) << " + roundToInt (" << bracketIfNeeded (xrw) << " * " << CodeHelpers::floatLiteral (position.rect.getX(), 4) << ")"; | |||
| x << bracketIfNeeded (xrx) << " + juce::roundToInt (" << bracketIfNeeded (xrw) << " * " << CodeHelpers::floatLiteral (position.rect.getX(), 4) << ")"; | |||
| else | |||
| x << "proportionOfWidth (" << CodeHelpers::floatLiteral (position.rect.getX(), 4) << ")"; | |||
| } | |||
| @@ -1060,7 +1060,7 @@ void positionToCode (const RelativePositionedRectangle& position, | |||
| if (position.rect.getPositionModeY() == PositionedRectangle::proportionOfParentSize) | |||
| { | |||
| if (yry.isNotEmpty() && yrh.isNotEmpty()) | |||
| y << bracketIfNeeded (yry) << " + roundToInt (" << bracketIfNeeded (yrh) << " * " << CodeHelpers::floatLiteral (position.rect.getY(), 4) << ")"; | |||
| y << bracketIfNeeded (yry) << " + juce::roundToInt (" << bracketIfNeeded (yrh) << " * " << CodeHelpers::floatLiteral (position.rect.getY(), 4) << ")"; | |||
| else | |||
| y << "proportionOfHeight (" << CodeHelpers::floatLiteral (position.rect.getY(), 4) << ")"; | |||
| } | |||
| @@ -84,10 +84,10 @@ void GeneratedCode::removeCallback (const String& returnType, const String& prot | |||
| void GeneratedCode::addImageResourceLoader (const String& imageMemberName, const String& resourceName) | |||
| { | |||
| privateMemberDeclarations | |||
| << "Image " << imageMemberName << ";\n"; | |||
| << "juce::Image " << imageMemberName << ";\n"; | |||
| if (resourceName.isNotEmpty()) | |||
| constructorCode << imageMemberName << " = ImageCache::getFromMemory (" | |||
| constructorCode << imageMemberName << " = juce::ImageCache::getFromMemory (" | |||
| << resourceName << ", " << resourceName << "Size);\n"; | |||
| } | |||
| @@ -160,8 +160,8 @@ String GeneratedCode::getClassDeclaration() const | |||
| parentClassLines = getCleanedStringArray (parentClassLines); | |||
| if (parentClassLines.contains ("public Button", false)) | |||
| parentClassLines.removeString ("public Component", false); | |||
| if (parentClassLines.contains ("public juce::Button", false)) | |||
| parentClassLines.removeString ("public juce::Component", false); | |||
| String r ("class "); | |||
| r << className << " : "; | |||
| @@ -28,7 +28,7 @@ | |||
| #include "Documents/jucer_ButtonDocument.h" | |||
| const char* const defaultClassName = "NewComponent"; | |||
| const char* const defaultParentClasses = "public Component"; | |||
| const char* const defaultParentClasses = "public juce::Component"; | |||
| //============================================================================== | |||
| JucerDocument::JucerDocument (SourceCodeDocument* c) | |||
| @@ -260,36 +260,36 @@ void JucerDocument::getOptionalMethods (StringArray& baseClasses, | |||
| StringArray& methods, | |||
| StringArray& initialContents) const | |||
| { | |||
| addMethod ("Component", "void", "visibilityChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "moved()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "parentHierarchyChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "parentSizeChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "lookAndFeelChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "bool", "hitTest (int x, int y)", "return true;", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "broughtToFront()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "filesDropped (const StringArray& filenames, int mouseX, int mouseY)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "handleCommandMessage (int commandId)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "childrenChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "enablementChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseMove (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseEnter (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseExit (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseDown (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseDrag (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseUp (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseDoubleClick (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& wheel)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "bool", "keyPressed (const KeyPress& key)", "return false; // Return true if your handler uses this key event, or false to allow it to be passed-on.", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "bool", "keyStateChanged (bool isKeyDown)", "return false; // Return true if your handler uses this key event, or false to allow it to be passed-on.", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "modifierKeysChanged (const ModifierKeys& modifiers)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "focusGained (FocusChangeType cause)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "focusLost (FocusChangeType cause)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "focusOfChildComponentChanged (FocusChangeType cause)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "modifierKeysChanged (const ModifierKeys& modifiers)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("Component", "void", "inputAttemptWhenModal()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "visibilityChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "moved()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "parentHierarchyChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "parentSizeChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "lookAndFeelChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "bool", "hitTest (int x, int y)", "return true;", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "broughtToFront()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "filesDropped (const juce::StringArray& filenames, int mouseX, int mouseY)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "handleCommandMessage (int commandId)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "childrenChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "enablementChanged()", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseMove (const juce::MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseEnter (const juce::MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseExit (const juce::MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseDown (const juce::MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseDrag (const juce::MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseUp (const juce::MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseDoubleClick (const juce::MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "mouseWheelMove (const juce::MouseEvent& e, const juce::MouseWheelDetails& wheel)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "bool", "keyPressed (const juce::KeyPress& key)", "return false; // Return true if your handler uses this key event, or false to allow it to be passed-on.", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "bool", "keyStateChanged (bool isKeyDown)", "return false; // Return true if your handler uses this key event, or false to allow it to be passed-on.", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "modifierKeysChanged (const juce::ModifierKeys& modifiers)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "focusGained (juce::FocusChangeType cause)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "focusLost (juce::FocusChangeType cause)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "focusOfChildComponentChanged (juce::FocusChangeType cause)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "modifierKeysChanged (const juce::ModifierKeys& modifiers)", "", baseClasses, returnValues, methods, initialContents); | |||
| addMethod ("juce::Component", "void", "inputAttemptWhenModal()", "", baseClasses, returnValues, methods, initialContents); | |||
| } | |||
| void JucerDocument::setOptionalMethodEnabled (const String& methodSignature, const bool enable) | |||
| @@ -405,7 +405,7 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const | |||
| code.constructorCode << "setName (" + quotedString (componentName, false) + ");\n"; | |||
| // call these now, just to make sure they're the first two methods in the list. | |||
| code.getCallbackCode (String(), "void", "paint (Graphics& g)", false) | |||
| code.getCallbackCode (String(), "void", "paint (juce::Graphics& g)", false) | |||
| << "//[UserPrePaint] Add your own custom painting code here..\n//[/UserPrePaint]\n\n"; | |||
| code.getCallbackCode (String(), "void", "resized()", false) | |||
| @@ -429,7 +429,7 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const | |||
| if (initialWidth > 0 || initialHeight > 0) | |||
| code.constructorCode << "\nsetSize (" << initialWidth << ", " << initialHeight << ");\n"; | |||
| code.getCallbackCode (String(), "void", "paint (Graphics& g)", false) | |||
| code.getCallbackCode (String(), "void", "paint (juce::Graphics& g)", false) | |||
| << "//[UserPaint] Add your own custom painting code here..\n//[/UserPaint]"; | |||
| code.getCallbackCode (String(), "void", "resized()", false) | |||
| @@ -445,7 +445,7 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const | |||
| { | |||
| String baseClassToAdd (baseClasses[i]); | |||
| if (baseClassToAdd == "Component" || baseClassToAdd == "Button") | |||
| if (baseClassToAdd == "juce::Component" || baseClassToAdd == "juce::Button") | |||
| baseClassToAdd.clear(); | |||
| String& s = code.getCallbackCode (baseClassToAdd, returnValues[i], methods[i], false); | |||
| @@ -471,7 +471,7 @@ void JucerDocument::fillInPaintCode (GeneratedCode& code) const | |||
| { | |||
| for (int i = 0; i < getNumPaintRoutines(); ++i) | |||
| getPaintRoutine (i) | |||
| ->fillInGeneratedCode (code, code.getCallbackCode (String(), "void", "paint (Graphics& g)", false)); | |||
| ->fillInGeneratedCode (code, code.getCallbackCode (String(), "void", "paint (juce::Graphics& g)", false)); | |||
| } | |||
| void JucerDocument::setTemplateFile (const String& newFile) | |||
| @@ -82,7 +82,7 @@ namespace CodeHelpers | |||
| String stringLiteral (const String& text, int maxLineLength) | |||
| { | |||
| if (text.isEmpty()) | |||
| return "String()"; | |||
| return "juce::String()"; | |||
| StringArray lines; | |||
| @@ -135,7 +135,7 @@ namespace CodeHelpers | |||
| String result (lines.joinIntoString (newLine)); | |||
| if (! CharPointer_ASCII::isValidString (text.toUTF8(), std::numeric_limits<int>::max())) | |||
| result = "CharPointer_UTF8 (" + result + ")"; | |||
| result = "juce::CharPointer_UTF8 (" + result + ")"; | |||
| return result; | |||
| } | |||
| @@ -200,31 +200,31 @@ namespace CodeHelpers | |||
| for (int i = 0; i < numElementsInArray (colourNames) - 1; ++i) | |||
| if (col == colours[i]) | |||
| return "Colours::" + String (colourNames[i]); | |||
| return "juce::Colours::" + String (colourNames[i]); | |||
| return "Colour (0x" + build_tools::hexString8Digits ((int) col.getARGB()) + ')'; | |||
| return "juce::Colour (0x" + build_tools::hexString8Digits ((int) col.getARGB()) + ')'; | |||
| } | |||
| String justificationToCode (Justification justification) | |||
| { | |||
| switch (justification.getFlags()) | |||
| { | |||
| case Justification::centred: return "Justification::centred"; | |||
| case Justification::centredLeft: return "Justification::centredLeft"; | |||
| case Justification::centredRight: return "Justification::centredRight"; | |||
| case Justification::centredTop: return "Justification::centredTop"; | |||
| case Justification::centredBottom: return "Justification::centredBottom"; | |||
| case Justification::topLeft: return "Justification::topLeft"; | |||
| case Justification::topRight: return "Justification::topRight"; | |||
| case Justification::bottomLeft: return "Justification::bottomLeft"; | |||
| case Justification::bottomRight: return "Justification::bottomRight"; | |||
| case Justification::left: return "Justification::left"; | |||
| case Justification::right: return "Justification::right"; | |||
| case Justification::horizontallyCentred: return "Justification::horizontallyCentred"; | |||
| case Justification::top: return "Justification::top"; | |||
| case Justification::bottom: return "Justification::bottom"; | |||
| case Justification::verticallyCentred: return "Justification::verticallyCentred"; | |||
| case Justification::horizontallyJustified: return "Justification::horizontallyJustified"; | |||
| case Justification::centred: return "juce::Justification::centred"; | |||
| case Justification::centredLeft: return "juce::Justification::centredLeft"; | |||
| case Justification::centredRight: return "juce::Justification::centredRight"; | |||
| case Justification::centredTop: return "juce::Justification::centredTop"; | |||
| case Justification::centredBottom: return "juce::Justification::centredBottom"; | |||
| case Justification::topLeft: return "juce::Justification::topLeft"; | |||
| case Justification::topRight: return "juce::Justification::topRight"; | |||
| case Justification::bottomLeft: return "juce::Justification::bottomLeft"; | |||
| case Justification::bottomRight: return "juce::Justification::bottomRight"; | |||
| case Justification::left: return "juce::Justification::left"; | |||
| case Justification::right: return "juce::Justification::right"; | |||
| case Justification::horizontallyCentred: return "juce::Justification::horizontallyCentred"; | |||
| case Justification::top: return "juce::Justification::top"; | |||
| case Justification::bottom: return "juce::Justification::bottom"; | |||
| case Justification::verticallyCentred: return "juce::Justification::verticallyCentred"; | |||
| case Justification::horizontallyJustified: return "juce::Justification::horizontallyJustified"; | |||
| default: break; | |||
| } | |||