Removed the old jucer project - this functionality is all now integrated into the introjucer. If you really need the old project for some reason, you can still grab it from the git history.
|
|
@ -1,300 +0,0 @@
|
|||
# Automatically generated makefile, created by the Introjucer
|
||||
# Don't edit this file! Your changes will be overwritten when you re-save the Introjucer project!
|
||||
|
||||
ifndef CONFIG
|
||||
CONFIG=Debug
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG),Debug)
|
||||
BINDIR := build
|
||||
LIBDIR := build
|
||||
OBJDIR := build/intermediate/Debug
|
||||
OUTDIR := build
|
||||
|
||||
ifeq ($(TARGET_ARCH),)
|
||||
TARGET_ARCH := -march=native
|
||||
endif
|
||||
|
||||
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
|
||||
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt
|
||||
LDDEPS :=
|
||||
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
|
||||
TARGET := Jucer
|
||||
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG),Release)
|
||||
BINDIR := build
|
||||
LIBDIR := build
|
||||
OBJDIR := build/intermediate/Release
|
||||
OUTDIR := build
|
||||
|
||||
ifeq ($(TARGET_ARCH),)
|
||||
TARGET_ARCH := -march=native
|
||||
endif
|
||||
|
||||
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
|
||||
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -Os
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt
|
||||
LDDEPS :=
|
||||
RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
|
||||
TARGET := Jucer
|
||||
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
|
||||
endif
|
||||
|
||||
# (this disables dependency generation if multiple architectures are set)
|
||||
DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD)
|
||||
|
||||
OBJECTS := \
|
||||
$(OBJDIR)/jucer_ComponentTypeHandler_354f298a.o \
|
||||
$(OBJDIR)/jucer_ButtonDocument_2640b7a4.o \
|
||||
$(OBJDIR)/jucer_ComponentDocument_6b7b1bab.o \
|
||||
$(OBJDIR)/jucer_BinaryResources_58dfb26e.o \
|
||||
$(OBJDIR)/jucer_ComponentLayout_e6861851.o \
|
||||
$(OBJDIR)/jucer_GeneratedCode_21f6b0a6.o \
|
||||
$(OBJDIR)/jucer_JucerDocument_84dcbdea.o \
|
||||
$(OBJDIR)/jucer_ObjectTypes_b1a6db44.o \
|
||||
$(OBJDIR)/jucer_PaintRoutine_28460bc6.o \
|
||||
$(OBJDIR)/jucer_ColouredElement_df063961.o \
|
||||
$(OBJDIR)/jucer_FillType_95631dd7.o \
|
||||
$(OBJDIR)/jucer_PaintElement_e65c9438.o \
|
||||
$(OBJDIR)/jucer_PaintElementPath_e99c487d.o \
|
||||
$(OBJDIR)/jucer_StrokeType_1099c4c.o \
|
||||
$(OBJDIR)/jucer_FilePropertyComponent_1d8c8e56.o \
|
||||
$(OBJDIR)/jucer_FontPropertyComponent_7bcf0963.o \
|
||||
$(OBJDIR)/jucer_ComponentLayoutEditor_281590ff.o \
|
||||
$(OBJDIR)/jucer_ComponentLayoutPanel_e5a9efbc.o \
|
||||
$(OBJDIR)/jucer_ComponentOverlayComponent_786fc5d5.o \
|
||||
$(OBJDIR)/jucer_EditingPanelBase_c6a2f93c.o \
|
||||
$(OBJDIR)/jucer_JucerDocumentHolder_6f9b88d7.o \
|
||||
$(OBJDIR)/jucer_MainWindow_eaa39988.o \
|
||||
$(OBJDIR)/jucer_PaintRoutineEditor_84958712.o \
|
||||
$(OBJDIR)/jucer_PaintRoutinePanel_b7196b49.o \
|
||||
$(OBJDIR)/jucer_PrefsPanel_97415233.o \
|
||||
$(OBJDIR)/jucer_ResourceEditorPanel_d49fe8d4.o \
|
||||
$(OBJDIR)/jucer_SnapGridPainter_5a2aa466.o \
|
||||
$(OBJDIR)/jucer_TestComponent_f0e05136.o \
|
||||
$(OBJDIR)/jucer_StoredSettings_235fe7c3.o \
|
||||
$(OBJDIR)/jucer_UtilityFunctions_9848bfec.o \
|
||||
$(OBJDIR)/jucer_Main_f97c9d13.o \
|
||||
$(OBJDIR)/BinaryData_ce4232d4.o \
|
||||
$(OBJDIR)/juce_core_1ee54a40.o \
|
||||
$(OBJDIR)/juce_data_structures_84790dfc.o \
|
||||
$(OBJDIR)/juce_events_584896b4.o \
|
||||
$(OBJDIR)/juce_graphics_f9afc18.o \
|
||||
$(OBJDIR)/juce_gui_basics_90929794.o \
|
||||
$(OBJDIR)/juce_gui_extra_b81d9e1c.o \
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
$(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES)
|
||||
@echo Linking Jucer
|
||||
-@mkdir -p $(BINDIR)
|
||||
-@mkdir -p $(LIBDIR)
|
||||
-@mkdir -p $(OUTDIR)
|
||||
@$(BLDCMD)
|
||||
|
||||
clean:
|
||||
@echo Cleaning Jucer
|
||||
-@rm -f $(OUTDIR)/$(TARGET)
|
||||
-@rm -rf $(OBJDIR)/*
|
||||
-@rm -rf $(OBJDIR)
|
||||
|
||||
strip:
|
||||
@echo Stripping Jucer
|
||||
-@strip --strip-unneeded $(OUTDIR)/$(TARGET)
|
||||
|
||||
$(OBJDIR)/jucer_ComponentTypeHandler_354f298a.o: ../../src/model/components/jucer_ComponentTypeHandler.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ComponentTypeHandler.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ButtonDocument_2640b7a4.o: ../../src/model/documents/jucer_ButtonDocument.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ButtonDocument.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ComponentDocument_6b7b1bab.o: ../../src/model/documents/jucer_ComponentDocument.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ComponentDocument.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_BinaryResources_58dfb26e.o: ../../src/model/jucer_BinaryResources.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_BinaryResources.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ComponentLayout_e6861851.o: ../../src/model/jucer_ComponentLayout.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ComponentLayout.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_GeneratedCode_21f6b0a6.o: ../../src/model/jucer_GeneratedCode.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_GeneratedCode.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_JucerDocument_84dcbdea.o: ../../src/model/jucer_JucerDocument.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_JucerDocument.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ObjectTypes_b1a6db44.o: ../../src/model/jucer_ObjectTypes.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ObjectTypes.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_PaintRoutine_28460bc6.o: ../../src/model/jucer_PaintRoutine.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_PaintRoutine.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ColouredElement_df063961.o: ../../src/model/paintelements/jucer_ColouredElement.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ColouredElement.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_FillType_95631dd7.o: ../../src/model/paintelements/jucer_FillType.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_FillType.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_PaintElement_e65c9438.o: ../../src/model/paintelements/jucer_PaintElement.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_PaintElement.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_PaintElementPath_e99c487d.o: ../../src/model/paintelements/jucer_PaintElementPath.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_PaintElementPath.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_StrokeType_1099c4c.o: ../../src/model/paintelements/jucer_StrokeType.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_StrokeType.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_FilePropertyComponent_1d8c8e56.o: ../../src/properties/jucer_FilePropertyComponent.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_FilePropertyComponent.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_FontPropertyComponent_7bcf0963.o: ../../src/properties/jucer_FontPropertyComponent.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_FontPropertyComponent.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ComponentLayoutEditor_281590ff.o: ../../src/ui/jucer_ComponentLayoutEditor.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ComponentLayoutEditor.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ComponentLayoutPanel_e5a9efbc.o: ../../src/ui/jucer_ComponentLayoutPanel.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ComponentLayoutPanel.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ComponentOverlayComponent_786fc5d5.o: ../../src/ui/jucer_ComponentOverlayComponent.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ComponentOverlayComponent.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_EditingPanelBase_c6a2f93c.o: ../../src/ui/jucer_EditingPanelBase.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_EditingPanelBase.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_JucerDocumentHolder_6f9b88d7.o: ../../src/ui/jucer_JucerDocumentHolder.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_JucerDocumentHolder.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_MainWindow_eaa39988.o: ../../src/ui/jucer_MainWindow.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_MainWindow.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_PaintRoutineEditor_84958712.o: ../../src/ui/jucer_PaintRoutineEditor.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_PaintRoutineEditor.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_PaintRoutinePanel_b7196b49.o: ../../src/ui/jucer_PaintRoutinePanel.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_PaintRoutinePanel.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_PrefsPanel_97415233.o: ../../src/ui/jucer_PrefsPanel.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_PrefsPanel.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_ResourceEditorPanel_d49fe8d4.o: ../../src/ui/jucer_ResourceEditorPanel.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_ResourceEditorPanel.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_SnapGridPainter_5a2aa466.o: ../../src/ui/jucer_SnapGridPainter.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_SnapGridPainter.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_TestComponent_f0e05136.o: ../../src/ui/jucer_TestComponent.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_TestComponent.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_StoredSettings_235fe7c3.o: ../../src/utility/jucer_StoredSettings.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_StoredSettings.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_UtilityFunctions_9848bfec.o: ../../src/utility/jucer_UtilityFunctions.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_UtilityFunctions.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/jucer_Main_f97c9d13.o: ../../src/jucer_Main.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling jucer_Main.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/BinaryData_ce4232d4.o: ../../JuceLibraryCode/BinaryData.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling BinaryData.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_core_1ee54a40.o: ../../../../modules/juce_core/juce_core.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_core.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_data_structures_84790dfc.o: ../../../../modules/juce_data_structures/juce_data_structures.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_data_structures.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_events_584896b4.o: ../../../../modules/juce_events/juce_events.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_events.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_graphics_f9afc18.o: ../../../../modules/juce_graphics/juce_graphics.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_graphics.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_gui_basics_90929794.o: ../../../../modules/juce_gui_basics/juce_gui_basics.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_gui_basics.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_gui_extra_b81d9e1c.o: ../../../../modules/juce_gui_extra/juce_gui_extra.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_gui_extra.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
-include $(OBJECTS:%.o=%.d)
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist>
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Icon.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.Jucer</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Jucer</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.0</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,253 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1080</int>
|
||||
<string key="IBDocument.SystemVersion">12C60</string>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSMenu</string>
|
||||
<string>NSMenuItem</string>
|
||||
</array>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
|
||||
<object class="NSCustomObject" id="1021">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1014">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1050">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSMenu" id="649796088">
|
||||
<string key="NSTitle">AMainMenu</string>
|
||||
<array class="NSMutableArray" key="NSMenuItems">
|
||||
<object class="NSMenuItem" id="694149608">
|
||||
<reference key="NSMenu" ref="649796088"/>
|
||||
<string key="NSTitle">delmeAppKit</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<object class="NSCustomResource" key="NSOnImage" id="1033313550">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSMenuCheckmark</string>
|
||||
</object>
|
||||
<object class="NSCustomResource" key="NSMixedImage" id="310636482">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSMenuMixedState</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="379814623">
|
||||
<reference key="NSMenu" ref="649796088"/>
|
||||
<string key="NSTitle">File</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
<string key="NSAction">submenuAction:</string>
|
||||
<object class="NSMenu" key="NSSubmenu" id="720053764">
|
||||
<string key="NSTitle">File</string>
|
||||
<array class="NSMutableArray" key="NSMenuItems">
|
||||
<object class="NSMenuItem" id="1025936716">
|
||||
<reference key="NSMenu" ref="720053764"/>
|
||||
<string key="NSTitle">Open Recent</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
<string key="NSAction">submenuAction:</string>
|
||||
<object class="NSMenu" key="NSSubmenu" id="1065607017">
|
||||
<string key="NSTitle">Open Recent</string>
|
||||
<array class="NSMutableArray" key="NSMenuItems">
|
||||
<object class="NSMenuItem" id="759406840">
|
||||
<reference key="NSMenu" ref="1065607017"/>
|
||||
<string key="NSTitle">Clear Menu</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSName">_NSRecentDocumentsMenu</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="952259628">
|
||||
<reference key="NSMenu" ref="649796088"/>
|
||||
<string key="NSTitle">Edit</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="470804886">
|
||||
<reference key="NSMenu" ref="649796088"/>
|
||||
<string key="NSTitle">Format</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="586577488">
|
||||
<reference key="NSMenu" ref="649796088"/>
|
||||
<string key="NSTitle">View</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="713487014">
|
||||
<reference key="NSMenu" ref="649796088"/>
|
||||
<string key="NSTitle">Window</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="1050483726">
|
||||
<reference key="NSMenu" ref="649796088"/>
|
||||
<string key="NSTitle">Help</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1033313550"/>
|
||||
<reference key="NSMixedImage" ref="310636482"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSName">_NSMainMenu</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="739804602">
|
||||
<string key="NSClassName">NSFontManager</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1048"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="1021"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="1014"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1050"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">29</int>
|
||||
<reference key="object" ref="649796088"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="713487014"/>
|
||||
<reference ref="694149608"/>
|
||||
<reference ref="952259628"/>
|
||||
<reference ref="379814623"/>
|
||||
<reference ref="586577488"/>
|
||||
<reference ref="470804886"/>
|
||||
<reference ref="1050483726"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">19</int>
|
||||
<reference key="object" ref="713487014"/>
|
||||
<array class="NSMutableArray" key="children"/>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">56</int>
|
||||
<reference key="object" ref="694149608"/>
|
||||
<array class="NSMutableArray" key="children"/>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">217</int>
|
||||
<reference key="object" ref="952259628"/>
|
||||
<array class="NSMutableArray" key="children"/>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">83</int>
|
||||
<reference key="object" ref="379814623"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="720053764"/>
|
||||
</array>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">81</int>
|
||||
<reference key="object" ref="720053764"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="1025936716"/>
|
||||
</array>
|
||||
<reference key="parent" ref="379814623"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">124</int>
|
||||
<reference key="object" ref="1025936716"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="1065607017"/>
|
||||
</array>
|
||||
<reference key="parent" ref="720053764"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">125</int>
|
||||
<reference key="object" ref="1065607017"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="759406840"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1025936716"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">126</int>
|
||||
<reference key="object" ref="759406840"/>
|
||||
<reference key="parent" ref="1065607017"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">295</int>
|
||||
<reference key="object" ref="586577488"/>
|
||||
<array class="NSMutableArray" key="children"/>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">374</int>
|
||||
<reference key="object" ref="470804886"/>
|
||||
<array class="NSMutableArray" key="children"/>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">419</int>
|
||||
<reference key="object" ref="739804602"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">491</int>
|
||||
<reference key="object" ref="1050483726"/>
|
||||
<array class="NSMutableArray" key="children"/>
|
||||
<reference key="parent" ref="649796088"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="maxID">533</int>
|
||||
</object>
|
||||
</data>
|
||||
</archive>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{564A18DF-F8DA-8D8F-D473-CFFE700460BA}") = "Jucer", "Jucer.vcproj", "{47850045-7AC4-D12B-6F23-A2E7E3B3617A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -1,32 +0,0 @@
|
|||
#ifdef JUCE_USER_DEFINED_RC_FILE
|
||||
#include JUCE_USER_DEFINED_RC_FILE
|
||||
#else
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "Jucer\0"
|
||||
VALUE "FileVersion", "1.0.0\0"
|
||||
VALUE "ProductName", "Jucer\0"
|
||||
VALUE "ProductVersion", "1.0.0\0"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 65001
|
||||
END
|
||||
END
|
||||
|
||||
#endif
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "icon.ico"
|
||||
IDI_ICON2 ICON DISCARDABLE "icon.ico"
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{564A18DF-F8DA-8D8F-D473-CFFE700460BA}") = "Jucer", "Jucer.vcxproj", "{47850045-7AC4-D12B-6F23-A2E7E3B3617A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{47850045-7AC4-D12B-6F23-A2E7E3B3617A}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -1,32 +0,0 @@
|
|||
#ifdef JUCE_USER_DEFINED_RC_FILE
|
||||
#include JUCE_USER_DEFINED_RC_FILE
|
||||
#else
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "Jucer\0"
|
||||
VALUE "FileVersion", "1.0.0\0"
|
||||
VALUE "ProductName", "Jucer\0"
|
||||
VALUE "ProductVersion", "1.0.0\0"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 65001
|
||||
END
|
||||
END
|
||||
|
||||
#endif
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "icon.ico"
|
||||
IDI_ICON2 ICON DISCARDABLE "icon.ico"
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
|
||||
IMPORTANT! This file is auto-generated each time you save your
|
||||
project - if you alter its contents, your changes may be overwritten!
|
||||
|
||||
There's a section below where you can add your own custom code safely, and the
|
||||
Introjucer will preserve the contents of that block, but the best way to change
|
||||
any of these definitions is by using the Introjucer's project settings.
|
||||
|
||||
Any commented-out settings will assume their default values.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __JUCE_APPCONFIG_UY86NK__
|
||||
#define __JUCE_APPCONFIG_UY86NK__
|
||||
|
||||
//==============================================================================
|
||||
// [BEGIN_USER_CODE_SECTION]
|
||||
|
||||
// (You can add your own code in this section, and the Introjucer will not overwrite it)
|
||||
|
||||
// [END_USER_CODE_SECTION]
|
||||
|
||||
//==============================================================================
|
||||
#define JUCE_MODULE_AVAILABLE_juce_core 1
|
||||
#define JUCE_MODULE_AVAILABLE_juce_data_structures 1
|
||||
#define JUCE_MODULE_AVAILABLE_juce_events 1
|
||||
#define JUCE_MODULE_AVAILABLE_juce_graphics 1
|
||||
#define JUCE_MODULE_AVAILABLE_juce_gui_basics 1
|
||||
#define JUCE_MODULE_AVAILABLE_juce_gui_extra 1
|
||||
|
||||
//==============================================================================
|
||||
// juce_core flags:
|
||||
|
||||
#ifndef JUCE_FORCE_DEBUG
|
||||
//#define JUCE_FORCE_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_LOG_ASSERTIONS
|
||||
//#define JUCE_LOG_ASSERTIONS
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_CHECK_MEMORY_LEAKS
|
||||
//#define JUCE_CHECK_MEMORY_LEAKS
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
|
||||
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
// juce_graphics flags:
|
||||
|
||||
#ifndef JUCE_USE_COREIMAGE_LOADER
|
||||
//#define JUCE_USE_COREIMAGE_LOADER
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_USE_DIRECTWRITE
|
||||
//#define JUCE_USE_DIRECTWRITE
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
// juce_gui_basics flags:
|
||||
|
||||
#ifndef JUCE_ENABLE_REPAINT_DEBUGGING
|
||||
//#define JUCE_ENABLE_REPAINT_DEBUGGING
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_USE_XSHM
|
||||
//#define JUCE_USE_XSHM
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_USE_XRENDER
|
||||
//#define JUCE_USE_XRENDER
|
||||
#endif
|
||||
|
||||
#ifndef JUCE_USE_XCURSOR
|
||||
//#define JUCE_USE_XCURSOR
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
// juce_gui_extra flags:
|
||||
|
||||
#ifndef JUCE_WEB_BROWSER
|
||||
//#define JUCE_WEB_BROWSER
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __JUCE_APPCONFIG_UY86NK__
|
||||
|
|
@ -1,532 +0,0 @@
|
|||
/* ==================================== JUCER_BINARY_RESOURCE ====================================
|
||||
|
||||
This is an auto-generated file: Any edits you make may be overwritten!
|
||||
|
||||
*/
|
||||
|
||||
namespace BinaryData
|
||||
{
|
||||
|
||||
//================== jules.jpg ==================
|
||||
static const unsigned char temp_ec935dd1[] =
|
||||
{ 255,216,255,224,0,16,74,70,73,70,0,1,2,1,0,180,0,180,0,0,255,225,20,89,69,120,105,102,0,0,73,73,42,0,8,0,0,0,10,0,15,1,2,0,6,0,0,0,134,0,0,0,16,1,2,0,22,0,0,0,140,0,0,0,18,1,3,0,1,0,0,0,1,0,0,0,26,1,5,0,1,0,0,0,162,0,0,0,27,1,5,0,1,0,0,0,170,0,0,0,40,
|
||||
1,3,0,1,0,0,0,2,0,0,0,49,1,2,0,20,0,0,0,178,0,0,0,50,1,2,0,20,0,0,0,198,0,0,0,19,2,3,0,1,0,0,0,1,0,0,0,105,135,4,0,1,0,0,0,220,0,0,0,200,3,0,0,67,97,110,111,110,0,67,97,110,111,110,32,68,73,71,73,84,65,76,32,73,88,85,83,32,53,48,0,180,0,0,0,1,0,0,0,180,
|
||||
0,0,0,1,0,0,0,65,100,111,98,101,32,80,104,111,116,111,115,104,111,112,32,55,46,48,0,50,48,48,54,58,48,53,58,50,53,32,50,50,58,52,54,58,49,53,0,0,0,29,0,154,130,5,0,1,0,0,0,62,2,0,0,157,130,5,0,1,0,0,0,70,2,0,0,0,144,7,0,4,0,0,0,48,50,50,48,3,144,2,0,
|
||||
20,0,0,0,78,2,0,0,4,144,2,0,20,0,0,0,98,2,0,0,1,145,7,0,4,0,0,0,1,2,3,0,2,145,5,0,1,0,0,0,118,2,0,0,1,146,10,0,1,0,0,0,126,2,0,0,2,146,5,0,1,0,0,0,134,2,0,0,4,146,10,0,1,0,0,0,142,2,0,0,5,146,5,0,1,0,0,0,150,2,0,0,7,146,3,0,1,0,0,0,5,0,0,0,9,146,3,0,
|
||||
1,0,0,0,24,0,0,0,10,146,5,0,1,0,0,0,158,2,0,0,134,146,7,0,8,1,0,0,166,2,0,0,0,160,7,0,4,0,0,0,48,49,48,48,1,160,3,0,1,0,0,0,1,0,0,0,2,160,4,0,1,0,0,0,220,0,0,0,3,160,4,0,1,0,0,0,246,0,0,0,14,162,5,0,1,0,0,0,174,3,0,0,15,162,5,0,1,0,0,0,182,3,0,0,16,162,
|
||||
3,0,1,0,0,0,2,0,0,0,23,162,3,0,1,0,0,0,2,0,0,0,0,163,7,0,1,0,0,0,3,0,0,0,1,164,3,0,1,0,0,0,0,0,0,0,2,164,3,0,1,0,0,0,0,0,0,0,3,164,3,0,1,0,0,0,0,0,0,0,4,164,5,0,1,0,0,0,190,3,0,0,6,164,3,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,60,0,0,0,28,0,0,0,10,0,0,0,50,
|
||||
48,48,54,58,48,53,58,49,50,32,49,56,58,53,49,58,52,56,0,50,48,48,54,58,48,53,58,49,50,32,49,56,58,53,49,58,52,56,0,3,0,0,0,1,0,0,0,189,0,0,0,32,0,0,0,95,0,0,0,32,0,0,0,0,0,0,0,3,0,0,0,95,0,0,0,32,0,0,0,168,22,0,0,232,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,64,31,0,225,0,0,0,0,112,23,0,168,0,0,0,32,10,0,0,32,10,0,0,0,0,6,0,3,1,3,0,1,0,0,0,6,0,0,0,26,1,5,0,1,0,0,0,22,4,0,0,27,1,5,0,1,0,0,0,30,4,0,0,40,1,3,0,1,0,0,0,2,0,0,0,1,2,4,0,1,0,0,0,38,4,0,0,2,2,4,0,1,0,0,0,43,16,0,0,0,0,0,0,72,0,0,0,1,0,0,0,72,0,
|
||||
0,0,1,0,0,0,255,216,255,224,0,16,74,70,73,70,0,1,2,1,0,72,0,72,0,0,255,237,0,12,65,100,111,98,101,95,67,77,0,1,255,238,0,14,65,100,111,98,101,0,100,128,0,0,0,1,255,219,0,132,0,12,8,8,8,9,8,12,9,9,12,17,11,10,11,17,21,15,12,12,15,21,24,19,19,21,19,19,
|
||||
24,17,12,12,12,12,12,12,17,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,13,11,11,13,14,13,16,14,14,16,20,14,14,14,20,20,14,14,14,14,20,17,12,12,12,12,12,17,17,12,12,12,12,12,12,17,12,12,12,12,12,12,12,12,12,12,
|
||||
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,192,0,17,8,0,128,0,114,3,1,34,0,2,17,1,3,17,1,255,221,0,4,0,8,255,196,1,63,0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0,3,0,1,2,4,5,6,7,8,9,10,11,1,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,2,3,4,5,6,7,8,9,10,
|
||||
11,16,0,1,4,1,3,2,4,2,5,7,6,8,5,3,12,51,1,0,2,17,3,4,33,18,49,5,65,81,97,19,34,113,129,50,6,20,145,161,177,66,35,36,21,82,193,98,51,52,114,130,209,67,7,37,146,83,240,225,241,99,115,53,22,162,178,131,38,68,147,84,100,69,194,163,116,54,23,210,85,226,101,
|
||||
242,179,132,195,211,117,227,243,70,39,148,164,133,180,149,196,212,228,244,165,181,197,213,229,245,86,102,118,134,150,166,182,198,214,230,246,55,71,87,103,119,135,151,167,183,199,215,231,247,17,0,2,2,1,2,4,4,3,4,5,6,7,7,6,5,53,1,0,2,17,3,33,49,18,4,65,
|
||||
81,97,113,34,19,5,50,129,145,20,161,177,66,35,193,82,209,240,51,36,98,225,114,130,146,67,83,21,99,115,52,241,37,6,22,162,178,131,7,38,53,194,210,68,147,84,163,23,100,69,85,54,116,101,226,242,179,132,195,211,117,227,243,70,148,164,133,180,149,196,212,
|
||||
228,244,165,181,197,213,229,245,86,102,118,134,150,166,182,198,214,230,246,39,55,71,87,103,119,135,151,167,183,199,255,218,0,12,3,1,0,2,17,3,17,0,63,0,245,84,146,73,37,41,84,234,61,75,23,167,81,235,100,58,39,70,48,106,247,159,221,173,170,191,89,235,148,
|
||||
116,202,142,158,165,228,75,107,237,175,181,190,163,191,55,114,243,206,171,214,175,201,176,223,147,97,178,195,160,141,0,19,59,43,73,78,151,87,250,197,212,51,156,237,196,213,65,250,52,7,67,0,252,223,82,33,247,61,97,93,152,71,243,143,237,196,144,127,232,
|
||||
172,203,179,237,113,59,121,58,15,159,116,204,104,96,157,95,97,214,79,0,36,166,225,201,214,67,39,249,86,104,63,205,111,185,232,111,201,177,192,130,75,167,191,3,224,192,134,210,118,146,243,171,126,147,143,105,237,255,0,168,210,245,91,249,154,120,58,53,
|
||||
249,36,166,205,87,190,182,251,160,1,171,221,225,253,79,229,163,83,213,178,153,107,125,43,94,209,38,54,184,130,73,254,87,210,89,173,123,28,240,3,139,136,51,167,3,205,206,86,241,131,55,238,112,144,14,131,78,15,146,74,119,153,215,179,61,48,215,63,99,79,
|
||||
238,253,35,58,61,223,201,220,187,63,171,217,84,59,13,149,48,137,29,198,147,253,152,110,213,231,153,45,118,29,14,204,13,47,169,132,7,30,205,113,250,45,127,242,81,186,31,94,125,89,0,182,64,221,45,111,135,194,82,83,234,169,42,93,51,169,87,155,72,112,210,
|
||||
193,244,199,241,87,82,82,146,73,36,148,255,0,255,208,245,85,91,55,45,184,213,23,146,27,226,227,240,221,223,249,35,251,9,198,110,43,234,23,87,107,29,91,132,135,238,17,3,233,119,252,213,198,125,104,235,99,34,195,77,4,122,76,36,23,146,61,196,115,179,249,
|
||||
31,245,105,41,195,235,125,81,217,25,54,90,73,13,36,237,110,186,142,55,127,45,238,254,82,231,178,50,64,110,231,18,92,103,107,103,95,235,35,229,228,86,194,231,191,244,150,25,219,174,130,86,112,220,92,109,183,158,117,237,63,247,212,148,154,138,255,0,62,
|
||||
193,50,102,60,124,26,63,145,251,232,143,201,173,142,241,121,50,99,83,62,27,190,139,22,126,70,123,157,53,211,26,142,70,146,56,221,252,148,42,193,104,157,73,252,231,159,250,150,164,167,69,249,35,233,16,8,224,52,153,215,254,165,56,177,214,235,97,7,200,5,
|
||||
65,165,187,139,139,128,62,3,82,172,87,123,195,161,130,62,73,41,211,166,176,90,54,128,209,220,232,63,0,175,225,98,92,251,131,106,105,48,68,186,63,34,169,211,114,139,236,109,100,6,204,2,232,4,254,43,174,192,244,105,172,150,0,9,229,199,147,231,41,41,209,
|
||||
192,233,117,183,12,226,88,198,217,75,218,89,101,100,123,92,211,244,155,5,112,217,253,50,206,141,213,31,136,101,212,59,223,141,105,231,97,250,33,223,203,175,249,187,23,79,127,214,159,179,203,107,108,144,64,104,84,58,151,80,175,175,227,53,187,90,204,218,
|
||||
28,95,75,187,56,127,132,99,167,253,39,181,37,55,254,173,117,39,213,149,64,115,165,150,205,124,240,70,172,93,242,242,174,143,97,102,109,77,112,44,12,123,108,45,58,29,195,254,252,189,85,37,41,36,146,73,79,255,209,205,234,89,85,215,157,125,152,47,138,220,
|
||||
231,30,76,17,62,215,55,232,189,173,119,238,172,219,186,149,174,27,92,211,161,137,107,129,34,127,173,244,85,60,140,135,181,230,90,96,73,105,227,226,15,42,185,190,155,218,67,72,22,52,125,23,72,14,29,219,38,118,191,254,131,210,82,123,50,153,59,156,209,61,
|
||||
139,140,253,205,84,175,203,54,238,18,67,7,49,202,103,186,166,56,135,0,90,121,19,175,127,162,134,227,140,91,184,177,251,121,107,73,26,159,236,251,146,83,42,73,35,113,208,56,201,238,79,238,171,52,212,235,221,185,211,180,24,107,2,5,108,177,231,128,28,116,
|
||||
107,7,2,120,106,232,49,122,69,206,107,91,95,132,72,255,0,95,206,73,72,177,49,177,196,147,16,222,120,0,127,109,222,213,103,211,97,159,73,205,124,114,24,90,226,63,205,114,144,250,161,101,237,27,242,54,25,58,153,208,125,45,163,243,127,170,180,241,126,174,
|
||||
87,94,51,49,203,131,236,173,206,119,172,7,190,93,251,159,186,212,148,231,99,2,109,3,110,163,184,93,142,14,41,183,167,216,233,146,24,92,103,159,104,220,178,235,233,133,142,0,146,253,186,239,116,79,245,125,171,115,164,90,106,120,97,59,72,212,20,148,242,
|
||||
216,244,156,183,200,4,131,169,32,73,90,76,233,184,149,157,142,5,182,196,236,123,75,28,64,253,221,223,73,47,172,223,84,247,100,183,55,2,223,79,31,32,145,109,4,146,218,236,62,239,209,126,229,54,253,61,159,224,237,254,66,54,7,70,203,123,217,83,114,79,162,
|
||||
215,53,204,170,199,111,212,24,115,153,171,189,47,111,210,73,77,17,176,117,55,177,178,118,88,198,130,126,13,220,189,73,121,78,3,29,111,87,59,199,185,249,78,99,154,237,0,62,163,153,14,251,151,168,228,100,83,139,67,239,189,219,43,172,75,137,254,31,188,231,
|
||||
36,164,169,44,223,249,193,211,255,0,225,63,154,245,254,129,250,63,249,63,228,164,146,159,255,210,227,58,147,50,234,176,250,155,235,121,27,128,113,247,65,226,89,252,175,229,172,155,108,113,33,238,209,196,159,112,210,99,201,110,117,190,159,151,138,226,
|
||||
203,137,54,56,146,246,144,224,225,175,211,119,170,214,57,219,191,121,97,216,221,196,15,205,104,129,230,92,82,82,236,188,3,250,82,230,142,197,176,164,114,234,4,10,65,115,143,47,112,136,254,171,117,65,200,111,181,173,28,142,84,43,104,221,175,110,82,83,
|
||||
214,116,46,158,203,94,219,158,37,199,81,229,162,238,58,126,3,54,180,129,240,92,143,213,171,195,128,99,185,17,248,133,218,225,218,26,209,7,64,146,155,204,194,100,106,209,243,0,169,187,20,52,113,3,192,104,153,153,109,28,165,110,88,32,136,146,120,73,77,
|
||||
12,141,141,119,245,76,66,150,48,45,247,185,170,175,81,203,56,100,92,246,151,52,141,72,18,1,92,254,103,214,110,171,145,102,220,26,26,41,225,214,88,226,63,232,49,37,62,129,94,86,56,168,139,92,11,72,135,52,35,87,141,141,27,234,32,131,171,93,226,188,227,
|
||||
27,168,117,27,92,69,77,54,217,3,216,211,166,226,118,237,220,232,93,167,75,179,39,19,18,188,108,178,223,93,128,185,229,135,112,247,29,222,215,254,118,212,148,243,223,89,75,122,127,214,91,72,59,27,152,198,100,2,59,88,127,69,119,246,94,250,247,45,11,49,
|
||||
242,50,250,69,217,199,61,239,244,195,94,113,92,231,57,164,110,107,119,139,29,103,230,207,238,111,171,254,219,89,95,94,47,221,213,48,206,147,232,109,37,220,107,103,182,127,170,159,166,245,76,113,137,86,59,129,245,107,162,202,11,1,141,238,178,192,107,99,
|
||||
191,125,149,181,182,110,223,255,0,162,82,83,115,115,63,210,31,232,243,201,255,0,53,36,47,81,190,95,205,237,231,183,250,52,146,83,255,211,231,186,247,80,181,247,220,50,94,255,0,90,231,189,199,213,97,107,200,107,221,91,95,186,208,223,221,244,108,175,217,
|
||||
233,217,91,214,9,44,58,254,112,146,216,17,202,238,190,188,226,245,10,186,147,242,89,211,233,109,57,172,39,37,213,150,184,11,88,108,161,214,220,75,91,238,177,187,93,235,123,23,3,151,77,213,88,230,185,165,140,124,237,208,196,115,237,253,228,148,137,187,
|
||||
73,177,199,77,187,118,159,158,191,244,84,30,0,121,178,177,236,221,161,31,31,15,234,169,122,126,155,73,38,55,112,15,17,228,228,29,192,55,159,139,103,68,148,244,189,6,210,215,135,107,218,15,97,251,171,180,197,203,110,226,211,161,28,174,19,160,219,46,214,
|
||||
6,237,38,99,88,90,148,117,11,25,103,168,79,178,75,79,156,120,164,167,180,174,226,240,72,62,200,146,124,148,109,234,152,248,195,125,179,36,75,90,59,172,154,58,163,44,197,115,75,183,232,75,128,19,49,244,90,213,137,144,115,242,46,138,234,51,38,94,239,162,
|
||||
33,37,59,221,71,235,15,168,215,54,166,255,0,184,31,250,75,26,247,61,214,19,99,245,105,237,225,251,205,133,99,23,160,2,221,249,249,78,104,208,157,128,52,104,54,255,0,89,95,175,23,234,206,43,161,237,118,69,156,151,190,74,74,114,107,206,115,92,230,63,218,
|
||||
28,1,13,34,36,143,166,92,186,30,153,213,217,233,52,94,233,20,193,175,249,32,129,53,159,222,107,165,8,143,171,54,88,67,177,3,172,208,110,39,77,120,104,85,114,186,30,21,78,25,221,61,239,101,65,195,126,51,158,76,31,228,57,223,155,162,74,108,245,30,134,239,
|
||||
172,157,105,152,152,217,35,31,211,163,75,139,61,65,4,185,237,107,154,215,179,111,210,250,107,164,233,127,81,250,87,76,197,200,201,113,118,94,126,203,7,175,102,141,107,182,150,111,166,129,236,175,119,253,113,255,0,240,139,137,233,159,88,173,233,157,97,
|
||||
217,21,57,142,246,150,239,123,36,65,31,155,183,220,221,206,218,182,236,250,251,155,233,58,187,44,17,108,7,61,149,22,134,2,96,128,231,126,255,0,239,255,0,131,73,77,13,195,195,252,26,73,122,99,255,0,5,244,127,243,20,146,83,255,212,25,250,192,236,160,107,
|
||||
5,214,154,154,97,141,253,24,104,115,137,47,46,218,55,251,157,238,92,231,85,109,87,57,222,156,1,27,182,151,76,145,164,107,30,228,59,125,127,93,190,139,95,107,158,100,50,176,92,226,54,159,205,103,187,107,84,50,30,227,81,173,204,45,115,76,16,241,193,227,
|
||||
86,253,36,148,225,221,201,0,184,158,118,144,90,62,48,129,14,58,144,174,230,226,93,77,134,155,218,234,173,137,34,198,154,196,30,29,239,252,213,75,210,113,16,7,120,158,117,73,77,236,75,126,207,105,15,252,221,7,197,93,178,247,88,221,160,134,123,131,140,
|
||||
76,253,223,71,220,139,214,250,75,198,6,55,82,165,164,135,86,209,123,71,103,16,54,191,111,203,107,214,53,121,47,107,136,58,105,4,164,167,127,15,57,213,153,26,54,125,179,224,22,167,76,234,142,101,229,210,54,184,16,225,243,246,174,65,185,71,121,113,137,
|
||||
39,131,224,143,86,97,101,141,33,222,208,116,9,41,244,65,151,70,85,96,52,246,209,156,29,86,22,107,11,46,253,27,183,201,246,198,160,115,43,8,117,107,160,53,142,45,34,64,29,160,248,255,0,85,89,167,168,110,21,180,17,181,218,23,31,15,16,18,83,167,138,219,
|
||||
154,90,94,230,145,35,116,247,229,88,234,189,87,102,59,41,167,70,59,233,56,243,253,191,234,44,191,182,186,73,6,88,4,65,215,143,5,159,145,152,94,231,158,210,8,157,9,145,206,191,188,146,146,222,246,55,38,210,6,208,53,104,105,142,211,183,243,191,59,222,167,
|
||||
141,116,227,187,113,116,30,197,198,57,14,14,115,103,201,85,164,59,33,236,222,8,107,156,3,200,48,118,147,179,83,254,107,83,84,242,49,109,104,236,199,71,200,18,146,146,126,214,204,255,0,74,239,231,253,110,127,194,127,164,73,108,254,206,233,63,232,63,237,
|
||||
39,173,244,157,244,191,123,233,36,146,159,255,213,193,233,39,103,87,161,237,225,193,224,107,221,204,63,218,219,162,173,214,198,220,156,147,196,218,231,126,59,209,122,8,109,221,107,2,151,184,214,219,109,53,7,176,251,160,135,53,63,214,236,102,227,245,108,
|
||||
202,24,9,4,49,204,220,100,251,235,99,191,233,61,37,55,62,179,81,234,219,139,125,160,238,123,8,105,112,137,247,51,255,0,38,168,116,142,140,51,178,158,11,35,31,20,143,81,192,71,187,150,83,223,254,49,108,125,111,235,61,39,53,221,31,6,172,182,54,246,108,
|
||||
251,93,196,23,85,64,181,180,79,172,230,255,0,57,109,91,63,75,83,63,235,155,23,73,78,14,46,22,53,120,216,131,244,13,27,154,233,14,47,221,238,118,67,158,223,109,142,187,247,218,146,156,230,225,49,216,130,151,137,96,150,150,248,130,87,29,214,254,170,178,
|
||||
178,235,176,125,147,175,162,120,254,195,191,53,122,9,104,108,129,164,254,85,67,50,144,240,100,74,74,124,153,236,125,79,117,111,4,56,29,65,242,73,182,17,248,253,203,179,234,125,22,155,206,231,180,57,195,131,199,60,172,43,58,8,14,118,215,16,59,55,193,37,
|
||||
57,109,179,82,9,249,249,132,97,105,12,157,78,224,53,208,113,164,43,71,162,63,243,93,4,242,79,31,234,229,167,141,245,70,175,176,59,51,38,231,109,96,18,198,136,146,231,10,254,147,191,117,37,56,227,49,204,108,253,39,22,236,4,241,4,238,118,209,252,159,222,
|
||||
70,197,198,204,203,166,235,233,172,186,140,102,151,221,111,33,160,71,231,253,22,185,206,115,118,177,110,98,116,126,145,77,173,38,128,242,209,14,47,37,210,15,59,155,59,125,203,91,11,8,213,245,43,173,214,203,236,109,117,91,145,52,6,214,107,112,96,165,213,
|
||||
151,61,213,253,163,249,189,191,70,196,148,228,253,85,195,171,168,117,79,179,58,199,214,61,23,88,31,92,53,210,199,213,237,247,7,126,242,197,36,183,214,103,238,61,237,4,114,126,147,23,65,254,47,173,99,126,177,86,29,195,233,181,186,248,254,141,203,14,214,
|
||||
56,245,28,138,91,163,190,210,240,60,65,245,28,208,146,157,111,183,81,254,139,35,143,217,255,0,69,188,254,239,254,25,254,66,75,103,237,110,255,0,184,244,125,61,252,191,249,207,243,191,157,254,95,244,127,229,164,146,159,255,214,229,177,30,220,110,185,142,
|
||||
251,93,233,51,27,51,244,142,224,53,173,176,135,189,220,237,216,161,245,163,173,226,231,245,123,178,48,119,186,146,24,198,217,107,97,206,53,141,158,163,25,249,140,119,248,61,254,245,153,159,158,114,50,46,181,160,51,214,177,214,57,163,128,94,227,102,209,
|
||||
254,114,164,73,148,148,201,207,220,100,232,127,189,109,253,93,250,219,155,209,99,30,192,114,122,113,50,236,114,117,100,253,39,226,188,255,0,54,239,248,47,230,109,255,0,166,176,15,41,106,146,159,93,195,234,120,29,79,31,237,56,54,139,171,31,77,188,61,135,
|
||||
247,110,171,233,86,239,250,31,232,208,239,113,215,72,30,43,202,177,115,50,176,239,110,70,37,174,162,230,232,44,172,193,143,221,254,83,127,146,186,76,31,175,153,13,1,157,79,29,183,129,254,26,152,173,255,0,23,87,252,203,255,0,179,232,164,167,167,182,160,
|
||||
241,10,139,250,116,146,121,8,76,250,219,208,45,0,250,239,161,223,187,101,110,7,255,0,2,22,181,88,111,214,30,128,6,231,231,213,240,135,147,248,86,146,154,206,193,113,246,141,10,159,87,180,97,116,74,113,103,117,153,22,130,233,240,175,222,239,236,239,117,
|
||||
109,84,242,254,182,116,118,60,154,158,251,135,109,140,32,31,157,190,154,200,205,235,191,181,114,155,96,172,211,85,21,250,117,176,187,113,130,226,247,61,199,70,238,119,242,82,83,118,156,250,205,128,88,54,7,55,97,112,212,110,31,69,199,247,86,246,14,68,
|
||||
253,93,235,184,254,158,224,227,116,184,17,166,236,122,136,150,124,151,25,99,128,27,154,116,61,188,21,222,157,215,242,176,105,200,196,210,204,92,182,61,150,48,136,50,230,26,125,86,188,123,189,141,252,207,160,146,155,63,81,30,71,214,92,120,4,185,213,90,
|
||||
52,254,166,239,251,234,163,115,157,87,214,60,182,180,25,25,175,129,19,197,165,200,255,0,82,207,167,245,143,13,142,131,252,235,99,88,214,167,237,66,207,107,91,245,187,38,183,31,105,206,51,179,221,203,231,217,244,247,164,167,75,211,119,252,31,210,219,244,
|
||||
199,208,73,105,125,137,191,232,153,253,51,253,37,63,250,95,250,71,253,215,254,142,146,74,127,255,217,255,237,21,222,80,104,111,116,111,115,104,111,112,32,51,46,48,0,56,66,73,77,4,37,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,66,73,77,3,237,0,0,0,
|
||||
0,0,16,0,180,0,0,0,1,0,2,0,180,0,0,0,1,0,2,56,66,73,77,4,38,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,63,128,0,0,56,66,73,77,4,13,0,0,0,0,0,4,0,0,0,30,56,66,73,77,4,25,0,0,0,0,0,4,0,0,0,30,56,66,73,77,3,243,0,0,0,0,0,9,0,0,0,0,0,0,0,0,1,0,56,66,73,77,4,10,0,0,
|
||||
0,0,0,1,0,0,56,66,73,77,39,16,0,0,0,0,0,10,0,1,0,0,0,0,0,0,0,2,56,66,73,77,3,245,0,0,0,0,0,72,0,47,102,102,0,1,0,108,102,102,0,6,0,0,0,0,0,1,0,47,102,102,0,1,0,161,153,154,0,6,0,0,0,0,0,1,0,50,0,0,0,1,0,90,0,0,0,6,0,0,0,0,0,1,0,53,0,0,0,1,0,45,0,0,0,
|
||||
6,0,0,0,0,0,1,56,66,73,77,3,248,0,0,0,0,0,112,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,232,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,232,0,0,
|
||||
0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,232,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,232,0,0,56,66,73,77,4,8,0,0,0,0,0,16,0,0,0,1,0,0,2,64,
|
||||
0,0,2,64,0,0,0,0,56,66,73,77,4,30,0,0,0,0,0,4,0,0,0,0,56,66,73,77,4,26,0,0,0,0,3,63,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,246,0,0,0,220,0,0,0,5,0,106,0,117,0,108,0,101,0,115,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,220,0,0,0,246,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0,0,0,0,110,117,108,108,0,0,0,2,0,0,0,6,98,111,117,110,100,115,79,98,106,99,0,0,0,1,0,0,0,0,0,0,82,99,116,49,0,0,0,4,0,0,0,0,84,111,112,32,108,111,110,103,0,0,0,0,
|
||||
0,0,0,0,76,101,102,116,108,111,110,103,0,0,0,0,0,0,0,0,66,116,111,109,108,111,110,103,0,0,0,246,0,0,0,0,82,103,104,116,108,111,110,103,0,0,0,220,0,0,0,6,115,108,105,99,101,115,86,108,76,115,0,0,0,1,79,98,106,99,0,0,0,1,0,0,0,0,0,5,115,108,105,99,101,
|
||||
0,0,0,18,0,0,0,7,115,108,105,99,101,73,68,108,111,110,103,0,0,0,0,0,0,0,7,103,114,111,117,112,73,68,108,111,110,103,0,0,0,0,0,0,0,6,111,114,105,103,105,110,101,110,117,109,0,0,0,12,69,83,108,105,99,101,79,114,105,103,105,110,0,0,0,13,97,117,116,111,71,
|
||||
101,110,101,114,97,116,101,100,0,0,0,0,84,121,112,101,101,110,117,109,0,0,0,10,69,83,108,105,99,101,84,121,112,101,0,0,0,0,73,109,103,32,0,0,0,6,98,111,117,110,100,115,79,98,106,99,0,0,0,1,0,0,0,0,0,0,82,99,116,49,0,0,0,4,0,0,0,0,84,111,112,32,108,111,
|
||||
110,103,0,0,0,0,0,0,0,0,76,101,102,116,108,111,110,103,0,0,0,0,0,0,0,0,66,116,111,109,108,111,110,103,0,0,0,246,0,0,0,0,82,103,104,116,108,111,110,103,0,0,0,220,0,0,0,3,117,114,108,84,69,88,84,0,0,0,1,0,0,0,0,0,0,110,117,108,108,84,69,88,84,0,0,0,1,0,
|
||||
0,0,0,0,0,77,115,103,101,84,69,88,84,0,0,0,1,0,0,0,0,0,6,97,108,116,84,97,103,84,69,88,84,0,0,0,1,0,0,0,0,0,14,99,101,108,108,84,101,120,116,73,115,72,84,77,76,98,111,111,108,1,0,0,0,8,99,101,108,108,84,101,120,116,84,69,88,84,0,0,0,1,0,0,0,0,0,9,104,
|
||||
111,114,122,65,108,105,103,110,101,110,117,109,0,0,0,15,69,83,108,105,99,101,72,111,114,122,65,108,105,103,110,0,0,0,7,100,101,102,97,117,108,116,0,0,0,9,118,101,114,116,65,108,105,103,110,101,110,117,109,0,0,0,15,69,83,108,105,99,101,86,101,114,116,
|
||||
65,108,105,103,110,0,0,0,7,100,101,102,97,117,108,116,0,0,0,11,98,103,67,111,108,111,114,84,121,112,101,101,110,117,109,0,0,0,17,69,83,108,105,99,101,66,71,67,111,108,111,114,84,121,112,101,0,0,0,0,78,111,110,101,0,0,0,9,116,111,112,79,117,116,115,101,
|
||||
116,108,111,110,103,0,0,0,0,0,0,0,10,108,101,102,116,79,117,116,115,101,116,108,111,110,103,0,0,0,0,0,0,0,12,98,111,116,116,111,109,79,117,116,115,101,116,108,111,110,103,0,0,0,0,0,0,0,11,114,105,103,104,116,79,117,116,115,101,116,108,111,110,103,0,0,
|
||||
0,0,0,56,66,73,77,4,20,0,0,0,0,0,4,0,0,0,3,56,66,73,77,4,12,0,0,0,0,16,71,0,0,0,1,0,0,0,114,0,0,0,128,0,0,1,88,0,0,172,0,0,0,16,43,0,24,0,1,255,216,255,224,0,16,74,70,73,70,0,1,2,1,0,72,0,72,0,0,255,237,0,12,65,100,111,98,101,95,67,77,0,1,255,238,0,14,
|
||||
65,100,111,98,101,0,100,128,0,0,0,1,255,219,0,132,0,12,8,8,8,9,8,12,9,9,12,17,11,10,11,17,21,15,12,12,15,21,24,19,19,21,19,19,24,17,12,12,12,12,12,12,17,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,13,11,11,13,
|
||||
14,13,16,14,14,16,20,14,14,14,20,20,14,14,14,14,20,17,12,12,12,12,12,17,17,12,12,12,12,12,12,17,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,192,0,17,8,0,128,0,114,3,1,34,0,2,17,1,3,17,1,255,221,0,4,0,8,255,
|
||||
196,1,63,0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0,3,0,1,2,4,5,6,7,8,9,10,11,1,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,2,3,4,5,6,7,8,9,10,11,16,0,1,4,1,3,2,4,2,5,7,6,8,5,3,12,51,1,0,2,17,3,4,33,18,49,5,65,81,97,19,34,113,129,50,6,20,145,161,177,66,35,36,21,82,193,
|
||||
98,51,52,114,130,209,67,7,37,146,83,240,225,241,99,115,53,22,162,178,131,38,68,147,84,100,69,194,163,116,54,23,210,85,226,101,242,179,132,195,211,117,227,243,70,39,148,164,133,180,149,196,212,228,244,165,181,197,213,229,245,86,102,118,134,150,166,182,
|
||||
198,214,230,246,55,71,87,103,119,135,151,167,183,199,215,231,247,17,0,2,2,1,2,4,4,3,4,5,6,7,7,6,5,53,1,0,2,17,3,33,49,18,4,65,81,97,113,34,19,5,50,129,145,20,161,177,66,35,193,82,209,240,51,36,98,225,114,130,146,67,83,21,99,115,52,241,37,6,22,162,178,
|
||||
131,7,38,53,194,210,68,147,84,163,23,100,69,85,54,116,101,226,242,179,132,195,211,117,227,243,70,148,164,133,180,149,196,212,228,244,165,181,197,213,229,245,86,102,118,134,150,166,182,198,214,230,246,39,55,71,87,103,119,135,151,167,183,199,255,218,0,
|
||||
12,3,1,0,2,17,3,17,0,63,0,245,84,146,73,37,41,84,234,61,75,23,167,81,235,100,58,39,70,48,106,247,159,221,173,170,191,89,235,148,116,202,142,158,165,228,75,107,237,175,181,190,163,191,55,114,243,206,171,214,175,201,176,223,147,97,178,195,160,141,0,19,
|
||||
59,43,73,78,151,87,250,197,212,51,156,237,196,213,65,250,52,7,67,0,252,223,82,33,247,61,97,93,152,71,243,143,237,196,144,127,232,172,203,179,237,113,59,121,58,15,159,116,204,104,96,157,95,97,214,79,0,36,166,225,201,214,67,39,249,86,104,63,205,111,185,
|
||||
232,111,201,177,192,130,75,167,191,3,224,192,134,210,118,146,243,171,126,147,143,105,237,255,0,168,210,245,91,249,154,120,58,53,249,36,166,205,87,190,182,251,160,1,171,221,225,253,79,229,163,83,213,178,153,107,125,43,94,209,38,54,184,130,73,254,87,210,
|
||||
89,173,123,28,240,3,139,136,51,167,3,205,206,86,241,131,55,238,112,144,14,131,78,15,146,74,119,153,215,179,61,48,215,63,99,79,238,253,35,58,61,223,201,220,187,63,171,217,84,59,13,149,48,137,29,198,147,253,152,110,213,231,153,45,118,29,14,204,13,47,169,
|
||||
132,7,30,205,113,250,45,127,242,81,186,31,94,125,89,0,182,64,221,45,111,135,194,82,83,234,169,42,93,51,169,87,155,72,112,210,193,244,199,241,87,82,82,146,73,36,148,255,0,255,208,245,85,91,55,45,184,213,23,146,27,226,227,240,221,223,249,35,251,9,198,110,
|
||||
43,234,23,87,107,29,91,132,135,238,17,3,233,119,252,213,198,125,104,235,99,34,195,77,4,122,76,36,23,146,61,196,115,179,249,31,245,105,41,195,235,125,81,217,25,54,90,73,13,36,237,110,186,142,55,127,45,238,254,82,231,178,50,64,110,231,18,92,103,107,103,
|
||||
95,235,35,229,228,86,194,231,191,244,150,25,219,174,130,86,112,220,92,109,183,158,117,237,63,247,212,148,154,138,255,0,62,193,50,102,60,124,26,63,145,251,232,143,201,173,142,241,121,50,99,83,62,27,190,139,22,126,70,123,157,53,211,26,142,70,146,56,221,
|
||||
252,148,42,193,104,157,73,252,231,159,250,150,164,167,69,249,35,233,16,8,224,52,153,215,254,165,56,177,214,235,97,7,200,5,65,165,187,139,139,128,62,3,82,172,87,123,195,161,130,62,73,41,211,166,176,90,54,128,209,220,232,63,0,175,225,98,92,251,131,106,
|
||||
105,48,68,186,63,34,169,211,114,139,236,109,100,6,204,2,232,4,254,43,174,192,244,105,172,150,0,9,229,199,147,231,41,41,209,192,233,117,183,12,226,88,198,217,75,218,89,101,100,123,92,211,244,155,5,112,217,253,50,206,141,213,31,136,101,212,59,223,141,105,
|
||||
231,97,250,33,223,203,175,249,187,23,79,127,214,159,179,203,107,108,144,64,104,84,58,151,80,175,175,227,53,187,90,204,218,28,95,75,187,56,127,132,99,167,253,39,181,37,55,254,173,117,39,213,149,64,115,165,150,205,124,240,70,172,93,242,242,174,143,97,102,
|
||||
109,77,112,44,12,123,108,45,58,29,195,254,252,189,85,37,41,36,146,73,79,255,209,205,234,89,85,215,157,125,152,47,138,220,231,30,76,17,62,215,55,232,189,173,119,238,172,219,186,149,174,27,92,211,161,137,107,129,34,127,173,244,85,60,140,135,181,230,90,
|
||||
96,73,105,227,226,15,42,185,190,155,218,67,72,22,52,125,23,72,14,29,219,38,118,191,254,131,210,82,123,50,153,59,156,209,61,139,140,253,205,84,175,203,54,238,18,67,7,49,202,103,186,166,56,135,0,90,121,19,175,127,162,134,227,140,91,184,177,251,121,107,
|
||||
73,26,159,236,251,146,83,42,73,35,113,208,56,201,238,79,238,171,52,212,235,221,185,211,180,24,107,2,5,108,177,231,128,28,116,107,7,2,120,106,232,49,122,69,206,107,91,95,132,72,255,0,95,206,73,72,177,49,177,196,147,16,222,120,0,127,109,222,213,103,211,
|
||||
97,159,73,205,124,114,24,90,226,63,205,114,144,250,161,101,237,27,242,54,25,58,153,208,125,45,163,243,127,170,180,241,126,174,87,94,51,49,203,131,236,173,206,119,172,7,190,93,251,159,186,212,148,231,99,2,109,3,110,163,184,93,142,14,41,183,167,216,233,
|
||||
146,24,92,103,159,104,220,178,235,233,133,142,0,146,253,186,239,116,79,245,125,171,115,164,90,106,120,97,59,72,212,20,148,242,216,244,156,183,200,4,131,169,32,73,90,76,233,184,149,157,142,5,182,196,236,123,75,28,64,253,221,223,73,47,172,223,84,247,100,
|
||||
183,55,2,223,79,31,32,145,109,4,146,218,236,62,239,209,126,229,54,253,61,159,224,237,254,66,54,7,70,203,123,217,83,114,79,162,215,53,204,170,199,111,212,24,115,153,171,189,47,111,210,73,77,17,176,117,55,177,178,118,88,198,130,126,13,220,189,73,121,78,
|
||||
3,29,111,87,59,199,185,249,78,99,154,237,0,62,163,153,14,251,151,168,228,100,83,139,67,239,189,219,43,172,75,137,254,31,188,231,36,164,169,44,223,249,193,211,255,0,225,63,154,245,254,129,250,63,249,63,228,164,146,159,255,210,227,58,147,50,234,176,250,
|
||||
155,235,121,27,128,113,247,65,226,89,252,175,229,172,155,108,113,33,238,209,196,159,112,210,99,201,110,117,190,159,151,138,226,203,137,54,56,146,246,144,224,225,175,211,119,170,214,57,219,191,121,97,216,221,196,15,205,104,129,230,92,82,82,236,188,3,250,
|
||||
82,230,142,197,176,164,114,234,4,10,65,115,143,47,112,136,254,171,117,65,200,111,181,173,28,142,84,43,104,221,175,110,82,83,214,116,46,158,203,94,219,158,37,199,81,229,162,238,58,126,3,54,180,129,240,92,143,213,171,195,128,99,185,17,248,133,218,225,218,
|
||||
26,209,7,64,146,155,204,194,100,106,209,243,0,169,187,20,52,113,3,192,104,153,153,109,28,165,110,88,32,136,146,120,73,77,12,141,141,119,245,76,66,150,48,45,247,185,170,175,81,203,56,100,92,246,151,52,141,72,18,1,92,254,103,214,110,171,145,102,220,26,
|
||||
26,41,225,214,88,226,63,232,49,37,62,129,94,86,56,168,139,92,11,72,135,52,35,87,141,141,27,234,32,131,171,93,226,188,227,27,168,117,27,92,69,77,54,217,3,216,211,166,226,118,237,220,232,93,167,75,179,39,19,18,188,108,178,223,93,128,185,229,135,112,247,
|
||||
29,222,215,254,118,212,148,243,223,89,75,122,127,214,91,72,59,27,152,198,100,2,59,88,127,69,119,246,94,250,247,45,11,49,242,50,250,69,217,199,61,239,244,195,94,113,92,231,57,164,110,107,119,139,29,103,230,207,238,111,171,254,219,89,95,94,47,221,213,48,
|
||||
206,147,232,109,37,220,107,103,182,127,170,159,166,245,76,113,137,86,59,129,245,107,162,202,11,1,141,238,178,192,107,99,191,125,149,181,182,110,223,255,0,162,82,83,115,115,63,210,31,232,243,201,255,0,53,36,47,81,190,95,205,237,231,183,250,52,146,83,255,
|
||||
211,231,186,247,80,181,247,220,50,94,255,0,90,231,189,199,213,97,107,200,107,221,91,95,186,208,223,221,244,108,175,217,233,217,91,214,9,44,58,254,112,146,216,17,202,238,190,188,226,245,10,186,147,242,89,211,233,109,57,172,39,37,213,150,184,11,88,108,
|
||||
161,214,220,75,91,238,177,187,93,235,123,23,3,151,77,213,88,230,185,165,140,124,237,208,196,115,237,253,228,148,137,187,73,177,199,77,187,118,159,158,191,244,84,30,0,121,178,177,236,221,161,31,31,15,234,169,122,126,155,73,38,55,112,15,17,228,228,29,192,
|
||||
55,159,139,103,68,148,244,189,6,210,215,135,107,218,15,97,251,171,180,197,203,110,226,211,161,28,174,19,160,219,46,214,6,237,38,99,88,90,148,117,11,25,103,168,79,178,75,79,156,120,164,167,180,174,226,240,72,62,200,146,124,148,109,234,152,248,195,125,
|
||||
179,36,75,90,59,172,154,58,163,44,197,115,75,183,232,75,128,19,49,244,90,213,137,144,115,242,46,138,234,51,38,94,239,162,33,37,59,221,71,235,15,168,215,54,166,255,0,184,31,250,75,26,247,61,214,19,99,245,105,237,225,251,205,133,99,23,160,2,221,249,249,
|
||||
78,104,208,157,128,52,104,54,255,0,89,95,175,23,234,206,43,161,237,118,69,156,151,190,74,74,114,107,206,115,92,230,63,218,28,1,13,34,36,143,166,92,186,30,153,213,217,233,52,94,233,20,193,175,249,32,129,53,159,222,107,165,8,143,171,54,88,67,177,3,172,
|
||||
208,110,39,77,120,104,85,114,186,30,21,78,25,221,61,239,101,65,195,126,51,158,76,31,228,57,223,155,162,74,108,245,30,134,239,172,157,105,152,152,217,35,31,211,163,75,139,61,65,4,185,237,107,154,215,179,111,210,250,107,164,233,127,81,250,87,76,197,200,
|
||||
201,113,118,94,126,203,7,175,102,141,107,182,150,111,166,129,236,175,119,253,113,255,0,240,139,137,233,159,88,173,233,157,97,217,21,57,142,246,150,239,123,36,65,31,155,183,220,221,206,218,182,236,250,251,155,233,58,187,44,17,108,7,61,149,22,134,2,96,
|
||||
128,231,126,255,0,239,255,0,131,73,77,13,195,195,252,26,73,122,99,255,0,5,244,127,243,20,146,83,255,212,25,250,192,236,160,107,5,214,154,154,97,141,253,24,104,115,137,47,46,218,55,251,157,238,92,231,85,109,87,57,222,156,1,27,182,151,76,145,164,107,30,
|
||||
228,59,125,127,93,190,139,95,107,158,100,50,176,92,226,54,159,205,103,187,107,84,50,30,227,81,173,204,45,115,76,16,241,193,227,86,253,36,148,225,221,201,0,184,158,118,144,90,62,48,129,14,58,144,174,230,226,93,77,134,155,218,234,173,137,34,198,154,196,
|
||||
30,29,239,252,213,75,210,113,16,7,120,158,117,73,77,236,75,126,207,105,15,252,221,7,197,93,178,247,88,221,160,134,123,131,140,76,253,223,71,220,139,214,250,75,198,6,55,82,165,164,135,86,209,123,71,103,16,54,191,111,203,107,214,53,121,47,107,136,58,105,
|
||||
4,164,167,127,15,57,213,153,26,54,125,179,224,22,167,76,234,142,101,229,210,54,184,16,225,243,246,174,65,185,71,121,113,137,39,131,224,143,86,97,101,141,33,222,208,116,9,41,244,65,151,70,85,96,52,246,209,156,29,86,22,107,11,46,253,27,183,201,246,198,
|
||||
160,115,43,8,117,107,160,53,142,45,34,64,29,160,248,255,0,85,89,167,168,110,21,180,17,181,218,23,31,15,16,18,83,167,138,219,154,90,94,230,145,35,116,247,229,88,234,189,87,102,59,41,167,70,59,233,56,243,253,191,234,44,191,182,186,73,6,88,4,65,215,143,
|
||||
5,159,145,152,94,231,158,210,8,157,9,145,206,191,188,146,146,222,246,55,38,210,6,208,53,104,105,142,211,183,243,191,59,222,167,141,116,227,187,113,116,30,197,198,57,14,14,115,103,201,85,164,59,33,236,222,8,107,156,3,200,48,118,147,179,83,254,107,83,84,
|
||||
242,49,109,104,236,199,71,200,18,146,146,126,214,204,255,0,74,239,231,253,110,127,194,127,164,73,108,254,206,233,63,232,63,237,39,173,244,157,244,191,123,233,36,146,159,255,213,193,233,39,103,87,161,237,225,193,224,107,221,204,63,218,219,162,173,214,
|
||||
198,220,156,147,196,218,231,126,59,209,122,8,109,221,107,2,151,184,214,219,109,53,7,176,251,160,135,53,63,214,236,102,227,245,108,202,24,9,4,49,204,220,100,251,235,99,191,233,61,37,55,62,179,81,234,219,139,125,160,238,123,8,105,112,137,247,51,255,0,38,
|
||||
168,116,142,140,51,178,158,11,35,31,20,143,81,192,71,187,150,83,223,254,49,108,125,111,235,61,39,53,221,31,6,172,182,54,246,108,251,93,196,23,85,64,181,180,79,172,230,255,0,57,109,91,63,75,83,63,235,155,23,73,78,14,46,22,53,120,216,131,244,13,27,154,
|
||||
233,14,47,221,238,118,67,158,223,109,142,187,247,218,146,156,230,225,49,216,130,151,137,96,150,150,248,130,87,29,214,254,170,178,178,235,176,125,147,175,162,120,254,195,191,53,122,9,104,108,129,164,254,85,67,50,144,240,100,74,74,124,153,236,125,79,117,
|
||||
111,4,56,29,65,242,73,182,17,248,253,203,179,234,125,22,155,206,231,180,57,195,131,199,60,172,43,58,8,14,118,215,16,59,55,193,37,57,109,179,82,9,249,249,132,97,105,12,157,78,224,53,208,113,164,43,71,162,63,243,93,4,242,79,31,234,229,167,141,245,70,175,
|
||||
176,59,51,38,231,109,96,18,198,136,146,231,10,254,147,191,117,37,56,227,49,204,108,253,39,22,236,4,241,4,238,118,209,252,159,222,70,197,198,204,203,166,235,233,172,186,140,102,151,221,111,33,160,71,231,253,22,185,206,115,118,177,110,98,116,126,145,77,
|
||||
173,38,128,242,209,14,47,37,210,15,59,155,59,125,203,91,11,8,213,245,43,173,214,203,236,109,117,91,145,52,6,214,107,112,96,165,213,151,61,213,253,163,249,189,191,70,196,148,228,253,85,195,171,168,117,79,179,58,199,214,61,23,88,31,92,53,210,199,213,237,
|
||||
247,7,126,242,197,36,183,214,103,238,61,237,4,114,126,147,23,65,254,47,173,99,126,177,86,29,195,233,181,186,248,254,141,203,14,214,56,245,28,138,91,163,190,210,240,60,65,245,28,208,146,157,111,183,81,254,139,35,143,217,255,0,69,188,254,239,254,25,254,
|
||||
66,75,103,237,110,255,0,184,244,125,61,252,191,249,207,243,191,157,254,95,244,127,229,164,146,159,255,214,229,177,30,220,110,185,142,251,93,233,51,27,51,244,142,224,53,173,176,135,189,220,237,216,161,245,163,173,226,231,245,123,178,48,119,186,146,24,
|
||||
198,217,107,97,206,53,141,158,163,25,249,140,119,248,61,254,245,153,159,158,114,50,46,181,160,51,214,177,214,57,163,128,94,227,102,209,254,114,164,73,148,148,201,207,220,100,232,127,189,109,253,93,250,219,155,209,99,30,192,114,122,113,50,236,114,117,
|
||||
100,253,39,226,188,255,0,54,239,248,47,230,109,255,0,166,176,15,41,106,146,159,93,195,234,120,29,79,31,237,56,54,139,171,31,77,188,61,135,247,110,171,233,86,239,250,31,232,208,239,113,215,72,30,43,202,177,115,50,176,239,110,70,37,174,162,230,232,44,172,
|
||||
193,143,221,254,83,127,146,186,76,31,175,153,13,1,157,79,29,183,129,254,26,152,173,255,0,23,87,252,203,255,0,179,232,164,167,167,182,160,241,10,139,250,116,146,121,8,76,250,219,208,45,0,250,239,161,223,187,101,110,7,255,0,2,22,181,88,111,214,30,128,6,
|
||||
231,231,213,240,135,147,248,86,146,154,206,193,113,246,141,10,159,87,180,97,116,74,113,103,117,153,22,130,233,240,175,222,239,236,239,117,109,84,242,254,182,116,118,60,154,158,251,135,109,140,32,31,157,190,154,200,205,235,191,181,114,155,96,172,211,85,
|
||||
21,250,117,176,187,113,130,226,247,61,199,70,238,119,242,82,83,118,156,250,205,128,88,54,7,55,97,112,212,110,31,69,199,247,86,246,14,68,253,93,235,184,254,158,224,227,116,184,17,166,236,122,136,150,124,151,25,99,128,27,154,116,61,188,21,222,157,215,242,
|
||||
176,105,200,196,210,204,92,182,61,150,48,136,50,230,26,125,86,188,123,189,141,252,207,160,146,155,63,81,30,71,214,92,120,4,185,213,90,52,254,166,239,251,234,163,115,157,87,214,60,182,180,25,25,175,129,19,197,165,200,255,0,82,207,167,245,143,13,142,131,
|
||||
252,235,99,88,214,167,237,66,207,107,91,245,187,38,183,31,105,206,51,179,221,203,231,217,244,247,164,167,75,211,119,252,31,210,219,244,199,208,73,105,125,137,191,232,153,253,51,253,37,63,250,95,250,71,253,215,254,142,146,74,127,255,217,0,56,66,73,77,
|
||||
4,33,0,0,0,0,0,85,0,0,0,1,1,0,0,0,15,0,65,0,100,0,111,0,98,0,101,0,32,0,80,0,104,0,111,0,116,0,111,0,115,0,104,0,111,0,112,0,0,0,19,0,65,0,100,0,111,0,98,0,101,0,32,0,80,0,104,0,111,0,116,0,111,0,115,0,104,0,111,0,112,0,32,0,55,0,46,0,48,0,0,0,1,0,56,
|
||||
66,73,77,4,6,0,0,0,0,0,7,255,255,1,1,0,1,1,0,255,225,18,72,104,116,116,112,58,47,47,110,115,46,97,100,111,98,101,46,99,111,109,47,120,97,112,47,49,46,48,47,0,60,63,120,112,97,99,107,101,116,32,98,101,103,105,110,61,39,239,187,191,39,32,105,100,61,39,
|
||||
87,53,77,48,77,112,67,101,104,105,72,122,114,101,83,122,78,84,99,122,107,99,57,100,39,63,62,10,60,63,97,100,111,98,101,45,120,97,112,45,102,105,108,116,101,114,115,32,101,115,99,61,34,67,82,34,63,62,10,60,120,58,120,97,112,109,101,116,97,32,120,109,108,
|
||||
110,115,58,120,61,39,97,100,111,98,101,58,110,115,58,109,101,116,97,47,39,32,120,58,120,97,112,116,107,61,39,88,77,80,32,116,111,111,108,107,105,116,32,50,46,56,46,50,45,51,51,44,32,102,114,97,109,101,119,111,114,107,32,49,46,53,39,62,10,60,114,100,102,
|
||||
58,82,68,70,32,120,109,108,110,115,58,114,100,102,61,39,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,49,57,57,57,47,48,50,47,50,50,45,114,100,102,45,115,121,110,116,97,120,45,110,115,35,39,32,120,109,108,110,115,58,105,88,61,39,104,
|
||||
116,116,112,58,47,47,110,115,46,97,100,111,98,101,46,99,111,109,47,105,88,47,49,46,48,47,39,62,10,10,32,60,114,100,102,58,68,101,115,99,114,105,112,116,105,111,110,32,97,98,111,117,116,61,39,117,117,105,100,58,99,52,51,52,99,53,48,52,45,101,99,51,55,
|
||||
45,49,49,100,97,45,98,102,97,49,45,98,49,51,52,56,102,52,57,97,98,98,50,39,10,32,32,120,109,108,110,115,58,120,97,112,77,77,61,39,104,116,116,112,58,47,47,110,115,46,97,100,111,98,101,46,99,111,109,47,120,97,112,47,49,46,48,47,109,109,47,39,62,10,32,
|
||||
32,60,120,97,112,77,77,58,68,111,99,117,109,101,110,116,73,68,62,97,100,111,98,101,58,100,111,99,105,100,58,112,104,111,116,111,115,104,111,112,58,99,52,51,52,99,53,48,48,45,101,99,51,55,45,49,49,100,97,45,98,102,97,49,45,98,49,51,52,56,102,52,57,97,
|
||||
98,98,50,60,47,120,97,112,77,77,58,68,111,99,117,109,101,110,116,73,68,62,10,32,60,47,114,100,102,58,68,101,115,99,114,105,112,116,105,111,110,62,10,10,60,47,114,100,102,58,82,68,70,62,10,60,47,120,58,120,97,112,109,101,116,97,62,10,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
|
||||
32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,60,63,120,112,97,99,107,101,116,32,101,110,100,61,39,119,39,63,62,255,226,12,
|
||||
88,73,67,67,95,80,82,79,70,73,76,69,0,1,1,0,0,12,72,76,105,110,111,2,16,0,0,109,110,116,114,82,71,66,32,88,89,90,32,7,206,0,2,0,9,0,6,0,49,0,0,97,99,115,112,77,83,70,84,0,0,0,0,73,69,67,32,115,82,71,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,214,0,1,0,0,0,0,
|
||||
211,45,72,80,32,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,99,112,114,116,0,0,1,80,0,0,0,51,100,101,115,99,0,0,1,132,0,0,0,108,119,116,112,116,0,0,1,240,0,0,0,20,98,107,112,116,0,0,2,4,0,0,0,20,
|
||||
114,88,89,90,0,0,2,24,0,0,0,20,103,88,89,90,0,0,2,44,0,0,0,20,98,88,89,90,0,0,2,64,0,0,0,20,100,109,110,100,0,0,2,84,0,0,0,112,100,109,100,100,0,0,2,196,0,0,0,136,118,117,101,100,0,0,3,76,0,0,0,134,118,105,101,119,0,0,3,212,0,0,0,36,108,117,109,105,0,
|
||||
0,3,248,0,0,0,20,109,101,97,115,0,0,4,12,0,0,0,36,116,101,99,104,0,0,4,48,0,0,0,12,114,84,82,67,0,0,4,60,0,0,8,12,103,84,82,67,0,0,4,60,0,0,8,12,98,84,82,67,0,0,4,60,0,0,8,12,116,101,120,116,0,0,0,0,67,111,112,121,114,105,103,104,116,32,40,99,41,32,49,
|
||||
57,57,56,32,72,101,119,108,101,116,116,45,80,97,99,107,97,114,100,32,67,111,109,112,97,110,121,0,0,100,101,115,99,0,0,0,0,0,0,0,18,115,82,71,66,32,73,69,67,54,49,57,54,54,45,50,46,49,0,0,0,0,0,0,0,0,0,0,0,18,115,82,71,66,32,73,69,67,54,49,57,54,54,45,
|
||||
50,46,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,89,90,32,0,0,0,0,0,0,243,81,0,1,0,0,0,1,22,204,88,89,90,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,89,90,32,0,0,0,0,0,0,111,162,0,0,56,245,0,0,
|
||||
3,144,88,89,90,32,0,0,0,0,0,0,98,153,0,0,183,133,0,0,24,218,88,89,90,32,0,0,0,0,0,0,36,160,0,0,15,132,0,0,182,207,100,101,115,99,0,0,0,0,0,0,0,22,73,69,67,32,104,116,116,112,58,47,47,119,119,119,46,105,101,99,46,99,104,0,0,0,0,0,0,0,0,0,0,0,22,73,69,
|
||||
67,32,104,116,116,112,58,47,47,119,119,119,46,105,101,99,46,99,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,101,115,99,0,0,0,0,0,0,0,46,73,69,67,32,54,49,57,54,54,45,50,46,49,32,68,101,102,97,117,
|
||||
108,116,32,82,71,66,32,99,111,108,111,117,114,32,115,112,97,99,101,32,45,32,115,82,71,66,0,0,0,0,0,0,0,0,0,0,0,46,73,69,67,32,54,49,57,54,54,45,50,46,49,32,68,101,102,97,117,108,116,32,82,71,66,32,99,111,108,111,117,114,32,115,112,97,99,101,32,45,32,
|
||||
115,82,71,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,101,115,99,0,0,0,0,0,0,0,44,82,101,102,101,114,101,110,99,101,32,86,105,101,119,105,110,103,32,67,111,110,100,105,116,105,111,110,32,105,110,32,73,69,67,54,49,57,54,54,45,50,46,49,0,0,0,0,0,
|
||||
0,0,0,0,0,0,44,82,101,102,101,114,101,110,99,101,32,86,105,101,119,105,110,103,32,67,111,110,100,105,116,105,111,110,32,105,110,32,73,69,67,54,49,57,54,54,45,50,46,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,118,105,101,119,0,0,0,0,0,19,164,
|
||||
254,0,20,95,46,0,16,207,20,0,3,237,204,0,4,19,11,0,3,92,158,0,0,0,1,88,89,90,32,0,0,0,0,0,76,9,86,0,80,0,0,0,87,31,231,109,101,97,115,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,143,0,0,0,2,115,105,103,32,0,0,0,0,67,82,84,32,99,117,114,118,
|
||||
0,0,0,0,0,0,4,0,0,0,0,5,0,10,0,15,0,20,0,25,0,30,0,35,0,40,0,45,0,50,0,55,0,59,0,64,0,69,0,74,0,79,0,84,0,89,0,94,0,99,0,104,0,109,0,114,0,119,0,124,0,129,0,134,0,139,0,144,0,149,0,154,0,159,0,164,0,169,0,174,0,178,0,183,0,188,0,193,0,198,0,203,0,208,
|
||||
0,213,0,219,0,224,0,229,0,235,0,240,0,246,0,251,1,1,1,7,1,13,1,19,1,25,1,31,1,37,1,43,1,50,1,56,1,62,1,69,1,76,1,82,1,89,1,96,1,103,1,110,1,117,1,124,1,131,1,139,1,146,1,154,1,161,1,169,1,177,1,185,1,193,1,201,1,209,1,217,1,225,1,233,1,242,1,250,2,3,
|
||||
2,12,2,20,2,29,2,38,2,47,2,56,2,65,2,75,2,84,2,93,2,103,2,113,2,122,2,132,2,142,2,152,2,162,2,172,2,182,2,193,2,203,2,213,2,224,2,235,2,245,3,0,3,11,3,22,3,33,3,45,3,56,3,67,3,79,3,90,3,102,3,114,3,126,3,138,3,150,3,162,3,174,3,186,3,199,3,211,3,224,
|
||||
3,236,3,249,4,6,4,19,4,32,4,45,4,59,4,72,4,85,4,99,4,113,4,126,4,140,4,154,4,168,4,182,4,196,4,211,4,225,4,240,4,254,5,13,5,28,5,43,5,58,5,73,5,88,5,103,5,119,5,134,5,150,5,166,5,181,5,197,5,213,5,229,5,246,6,6,6,22,6,39,6,55,6,72,6,89,6,106,6,123,6,
|
||||
140,6,157,6,175,6,192,6,209,6,227,6,245,7,7,7,25,7,43,7,61,7,79,7,97,7,116,7,134,7,153,7,172,7,191,7,210,7,229,7,248,8,11,8,31,8,50,8,70,8,90,8,110,8,130,8,150,8,170,8,190,8,210,8,231,8,251,9,16,9,37,9,58,9,79,9,100,9,121,9,143,9,164,9,186,9,207,9,229,
|
||||
9,251,10,17,10,39,10,61,10,84,10,106,10,129,10,152,10,174,10,197,10,220,10,243,11,11,11,34,11,57,11,81,11,105,11,128,11,152,11,176,11,200,11,225,11,249,12,18,12,42,12,67,12,92,12,117,12,142,12,167,12,192,12,217,12,243,13,13,13,38,13,64,13,90,13,116,13,
|
||||
142,13,169,13,195,13,222,13,248,14,19,14,46,14,73,14,100,14,127,14,155,14,182,14,210,14,238,15,9,15,37,15,65,15,94,15,122,15,150,15,179,15,207,15,236,16,9,16,38,16,67,16,97,16,126,16,155,16,185,16,215,16,245,17,19,17,49,17,79,17,109,17,140,17,170,17,
|
||||
201,17,232,18,7,18,38,18,69,18,100,18,132,18,163,18,195,18,227,19,3,19,35,19,67,19,99,19,131,19,164,19,197,19,229,20,6,20,39,20,73,20,106,20,139,20,173,20,206,20,240,21,18,21,52,21,86,21,120,21,155,21,189,21,224,22,3,22,38,22,73,22,108,22,143,22,178,
|
||||
22,214,22,250,23,29,23,65,23,101,23,137,23,174,23,210,23,247,24,27,24,64,24,101,24,138,24,175,24,213,24,250,25,32,25,69,25,107,25,145,25,183,25,221,26,4,26,42,26,81,26,119,26,158,26,197,26,236,27,20,27,59,27,99,27,138,27,178,27,218,28,2,28,42,28,82,28,
|
||||
123,28,163,28,204,28,245,29,30,29,71,29,112,29,153,29,195,29,236,30,22,30,64,30,106,30,148,30,190,30,233,31,19,31,62,31,105,31,148,31,191,31,234,32,21,32,65,32,108,32,152,32,196,32,240,33,28,33,72,33,117,33,161,33,206,33,251,34,39,34,85,34,130,34,175,
|
||||
34,221,35,10,35,56,35,102,35,148,35,194,35,240,36,31,36,77,36,124,36,171,36,218,37,9,37,56,37,104,37,151,37,199,37,247,38,39,38,87,38,135,38,183,38,232,39,24,39,73,39,122,39,171,39,220,40,13,40,63,40,113,40,162,40,212,41,6,41,56,41,107,41,157,41,208,
|
||||
42,2,42,53,42,104,42,155,42,207,43,2,43,54,43,105,43,157,43,209,44,5,44,57,44,110,44,162,44,215,45,12,45,65,45,118,45,171,45,225,46,22,46,76,46,130,46,183,46,238,47,36,47,90,47,145,47,199,47,254,48,53,48,108,48,164,48,219,49,18,49,74,49,130,49,186,49,
|
||||
242,50,42,50,99,50,155,50,212,51,13,51,70,51,127,51,184,51,241,52,43,52,101,52,158,52,216,53,19,53,77,53,135,53,194,53,253,54,55,54,114,54,174,54,233,55,36,55,96,55,156,55,215,56,20,56,80,56,140,56,200,57,5,57,66,57,127,57,188,57,249,58,54,58,116,58,
|
||||
178,58,239,59,45,59,107,59,170,59,232,60,39,60,101,60,164,60,227,61,34,61,97,61,161,61,224,62,32,62,96,62,160,62,224,63,33,63,97,63,162,63,226,64,35,64,100,64,166,64,231,65,41,65,106,65,172,65,238,66,48,66,114,66,181,66,247,67,58,67,125,67,192,68,3,68,
|
||||
71,68,138,68,206,69,18,69,85,69,154,69,222,70,34,70,103,70,171,70,240,71,53,71,123,71,192,72,5,72,75,72,145,72,215,73,29,73,99,73,169,73,240,74,55,74,125,74,196,75,12,75,83,75,154,75,226,76,42,76,114,76,186,77,2,77,74,77,147,77,220,78,37,78,110,78,183,
|
||||
79,0,79,73,79,147,79,221,80,39,80,113,80,187,81,6,81,80,81,155,81,230,82,49,82,124,82,199,83,19,83,95,83,170,83,246,84,66,84,143,84,219,85,40,85,117,85,194,86,15,86,92,86,169,86,247,87,68,87,146,87,224,88,47,88,125,88,203,89,26,89,105,89,184,90,7,90,
|
||||
86,90,166,90,245,91,69,91,149,91,229,92,53,92,134,92,214,93,39,93,120,93,201,94,26,94,108,94,189,95,15,95,97,95,179,96,5,96,87,96,170,96,252,97,79,97,162,97,245,98,73,98,156,98,240,99,67,99,151,99,235,100,64,100,148,100,233,101,61,101,146,101,231,102,
|
||||
61,102,146,102,232,103,61,103,147,103,233,104,63,104,150,104,236,105,67,105,154,105,241,106,72,106,159,106,247,107,79,107,167,107,255,108,87,108,175,109,8,109,96,109,185,110,18,110,107,110,196,111,30,111,120,111,209,112,43,112,134,112,224,113,58,113,
|
||||
149,113,240,114,75,114,166,115,1,115,93,115,184,116,20,116,112,116,204,117,40,117,133,117,225,118,62,118,155,118,248,119,86,119,179,120,17,120,110,120,204,121,42,121,137,121,231,122,70,122,165,123,4,123,99,123,194,124,33,124,129,124,225,125,65,125,161,
|
||||
126,1,126,98,126,194,127,35,127,132,127,229,128,71,128,168,129,10,129,107,129,205,130,48,130,146,130,244,131,87,131,186,132,29,132,128,132,227,133,71,133,171,134,14,134,114,134,215,135,59,135,159,136,4,136,105,136,206,137,51,137,153,137,254,138,100,138,
|
||||
202,139,48,139,150,139,252,140,99,140,202,141,49,141,152,141,255,142,102,142,206,143,54,143,158,144,6,144,110,144,214,145,63,145,168,146,17,146,122,146,227,147,77,147,182,148,32,148,138,148,244,149,95,149,201,150,52,150,159,151,10,151,117,151,224,152,
|
||||
76,152,184,153,36,153,144,153,252,154,104,154,213,155,66,155,175,156,28,156,137,156,247,157,100,157,210,158,64,158,174,159,29,159,139,159,250,160,105,160,216,161,71,161,182,162,38,162,150,163,6,163,118,163,230,164,86,164,199,165,56,165,169,166,26,166,
|
||||
139,166,253,167,110,167,224,168,82,168,196,169,55,169,169,170,28,170,143,171,2,171,117,171,233,172,92,172,208,173,68,173,184,174,45,174,161,175,22,175,139,176,0,176,117,176,234,177,96,177,214,178,75,178,194,179,56,179,174,180,37,180,156,181,19,181,138,
|
||||
182,1,182,121,182,240,183,104,183,224,184,89,184,209,185,74,185,194,186,59,186,181,187,46,187,167,188,33,188,155,189,21,189,143,190,10,190,132,190,255,191,122,191,245,192,112,192,236,193,103,193,227,194,95,194,219,195,88,195,212,196,81,196,206,197,75,
|
||||
197,200,198,70,198,195,199,65,199,191,200,61,200,188,201,58,201,185,202,56,202,183,203,54,203,182,204,53,204,181,205,53,205,181,206,54,206,182,207,55,207,184,208,57,208,186,209,60,209,190,210,63,210,193,211,68,211,198,212,73,212,203,213,78,213,209,214,
|
||||
85,214,216,215,92,215,224,216,100,216,232,217,108,217,241,218,118,218,251,219,128,220,5,220,138,221,16,221,150,222,28,222,162,223,41,223,175,224,54,224,189,225,68,225,204,226,83,226,219,227,99,227,235,228,115,228,252,229,132,230,13,230,150,231,31,231,
|
||||
169,232,50,232,188,233,70,233,208,234,91,234,229,235,112,235,251,236,134,237,17,237,156,238,40,238,180,239,64,239,204,240,88,240,229,241,114,241,255,242,140,243,25,243,167,244,52,244,194,245,80,245,222,246,109,246,251,247,138,248,25,248,168,249,56,249,
|
||||
199,250,87,250,231,251,119,252,7,252,152,253,41,253,186,254,75,254,220,255,109,255,255,255,238,0,33,65,100,111,98,101,0,100,128,0,0,0,1,3,0,16,3,2,3,6,0,0,0,0,0,0,0,0,0,0,0,0,255,219,0,132,0,18,14,14,14,16,14,21,16,16,21,30,19,17,19,30,35,26,21,21,26,
|
||||
35,34,23,23,23,23,23,34,17,12,12,12,12,12,12,17,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,20,19,19,22,25,22,27,23,23,27,20,14,14,14,20,20,14,14,14,14,20,17,12,12,12,12,12,17,17,12,12,12,12,12,12,17,12,12,12,
|
||||
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,194,0,17,8,0,246,0,220,3,1,34,0,2,17,1,3,17,1,255,196,0,165,0,0,2,3,1,1,1,0,0,0,0,0,0,0,0,0,0,3,4,0,2,5,6,1,7,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,2,2,2,2,2,1,2,6,3,1,
|
||||
1,0,0,0,0,1,2,0,3,17,4,18,5,33,19,34,20,6,16,32,49,35,51,21,48,50,36,112,37,17,0,1,3,2,4,2,7,6,2,9,3,5,0,0,0,0,1,0,17,2,33,49,65,81,18,3,97,34,16,113,129,145,50,66,82,32,161,177,98,19,4,114,35,48,240,193,209,130,194,51,67,195,225,210,211,162,226,99,115,
|
||||
20,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,255,218,0,12,3,1,1,2,17,3,17,0,0,0,238,36,132,146,18,72,79,7,206,142,98,140,1,40,17,135,240,62,5,160,236,50,69,106,104,59,130,209,182,108,45,35,169,245,86,137,36,36,144,146,66,73,8,173,57,144,185,245,76,32,69,
|
||||
98,246,243,210,222,214,161,43,90,151,184,76,17,128,56,11,210,227,29,71,65,194,238,157,44,9,137,36,36,144,128,38,41,155,151,116,200,31,64,93,138,120,18,43,3,192,64,215,25,66,90,197,41,164,61,128,156,207,92,185,199,233,102,182,116,187,60,175,80,90,72,79,
|
||||
48,238,51,204,145,0,65,241,99,194,212,33,148,173,139,251,231,133,138,59,150,48,174,61,161,143,176,104,145,117,13,26,224,208,208,69,145,141,246,60,95,100,94,72,112,217,182,88,40,132,16,245,0,194,6,181,8,90,122,122,207,133,10,116,236,30,123,115,205,4,244,
|
||||
13,44,142,131,12,93,164,220,12,3,170,123,217,241,61,185,105,33,242,145,21,96,212,90,197,189,165,2,74,122,67,87,68,242,218,109,152,126,244,54,16,166,167,166,113,205,6,216,71,64,228,24,233,21,51,150,232,178,0,246,124,103,78,63,92,69,14,57,77,76,208,52,
|
||||
184,139,152,34,27,170,199,53,54,80,215,25,106,140,158,88,150,0,54,87,23,167,183,44,202,129,54,173,136,201,165,159,160,19,146,213,231,246,134,130,226,38,14,95,85,130,102,212,245,40,3,64,71,9,77,157,206,115,116,211,58,101,27,245,95,70,67,91,136,41,161,
|
||||
142,34,75,88,182,146,186,134,143,139,248,114,122,88,229,58,10,214,166,78,127,83,206,137,87,193,149,58,215,60,158,122,104,109,98,106,154,76,100,56,59,106,44,54,190,90,230,130,171,16,189,76,192,163,21,17,183,126,125,192,253,10,123,39,188,143,83,202,15,
|
||||
241,253,166,97,201,135,115,44,13,108,34,121,95,71,181,49,116,2,52,144,142,129,117,24,18,97,173,0,13,13,19,71,220,42,155,228,193,209,60,206,208,197,25,107,20,166,169,178,8,24,153,208,58,44,170,36,34,132,240,131,49,25,245,65,191,64,64,230,66,230,150,134,
|
||||
3,70,240,178,160,74,207,66,52,149,10,134,180,39,149,240,113,38,46,92,5,210,50,198,234,226,139,117,24,134,113,217,116,123,152,237,115,78,94,228,92,45,129,232,114,45,232,205,148,176,241,243,172,60,10,12,191,148,40,81,104,34,91,79,43,68,3,217,218,32,83,
|
||||
208,206,55,241,187,14,56,247,160,41,64,208,254,25,120,93,74,39,37,93,180,4,253,188,41,121,80,158,24,194,115,90,22,75,172,228,78,151,15,127,16,85,165,122,19,19,103,33,225,188,61,206,116,222,67,34,167,209,171,197,117,193,107,122,2,89,144,137,169,168,185,
|
||||
153,87,188,17,57,172,61,157,161,148,49,229,33,209,240,125,239,4,116,153,143,162,43,175,148,232,15,42,128,101,103,132,158,67,210,134,29,94,175,207,220,58,250,102,233,30,86,245,41,83,193,82,142,130,217,190,66,204,35,14,191,139,232,57,227,125,70,2,35,165,
|
||||
157,180,115,131,4,13,3,2,193,64,190,14,4,131,133,200,8,109,177,206,67,168,23,57,13,5,5,6,207,155,13,26,35,7,124,78,29,47,156,220,53,54,249,8,127,255,218,0,8,1,2,0,1,5,0,255,0,216,63,255,218,0,8,1,3,0,1,5,0,255,0,216,63,255,218,0,8,1,1,0,1,5,0,252,236,
|
||||
193,70,231,112,115,118,203,51,53,164,198,102,131,4,155,107,88,108,56,15,229,108,64,61,204,2,111,90,30,189,242,97,236,115,52,126,118,175,233,254,59,239,174,148,223,236,108,217,44,99,16,35,218,130,123,25,137,4,194,216,158,98,172,24,134,194,96,39,40,39,
|
||||
51,52,182,49,53,182,21,135,248,182,247,106,214,93,173,235,118,26,203,99,223,44,180,177,68,38,22,196,30,64,25,132,168,133,137,152,102,62,64,173,76,53,156,12,2,111,80,116,246,200,154,219,2,213,255,0,6,246,232,164,109,108,181,142,246,248,178,198,98,91,205,
|
||||
67,203,19,21,96,253,61,132,204,144,77,161,98,150,99,19,244,164,153,187,165,96,161,28,205,123,78,117,54,89,101,54,139,7,230,186,254,35,127,103,155,216,240,146,101,140,4,65,225,87,138,252,68,231,11,46,77,220,103,34,209,23,240,10,76,79,19,82,162,93,83,227,
|
||||
219,245,255,0,77,117,71,51,90,214,19,173,216,200,252,174,192,13,237,209,139,172,2,59,23,143,103,0,1,102,80,4,103,81,26,242,103,41,236,16,31,35,38,34,182,81,103,6,43,173,169,202,107,211,197,85,70,55,181,86,250,90,166,166,234,31,13,162,252,54,144,252,63,
|
||||
18,211,123,101,42,91,246,25,217,128,118,186,212,65,254,204,48,35,221,136,246,23,101,194,204,248,0,146,190,32,179,6,187,124,213,124,162,176,101,68,1,239,8,27,125,21,87,180,172,158,218,144,229,49,199,72,150,181,14,87,240,175,190,169,35,247,84,50,108,237,
|
||||
11,94,203,129,150,221,227,203,17,196,75,46,196,44,204,203,136,120,168,230,12,82,230,45,110,96,161,224,169,165,64,131,174,217,85,39,142,197,199,46,236,208,51,230,155,206,45,161,84,106,30,50,175,227,252,59,52,168,92,110,113,62,169,99,220,173,13,149,195,
|
||||
100,178,226,97,49,76,7,1,65,98,149,137,93,80,34,224,172,242,34,17,157,81,146,149,146,155,56,22,37,108,210,189,89,232,2,109,160,74,233,35,157,95,197,248,93,178,246,22,124,134,111,44,203,158,113,153,140,30,78,75,48,194,143,214,86,164,12,132,131,98,180,
|
||||
131,176,158,203,56,170,6,9,81,7,89,112,104,108,175,103,67,83,179,94,222,178,202,118,116,236,30,198,70,236,31,19,92,229,170,254,63,194,219,56,147,98,224,88,24,56,40,231,2,7,76,19,73,140,202,144,2,101,53,150,117,168,195,168,207,63,172,176,170,244,214,2,
|
||||
53,207,1,160,144,85,17,120,205,118,151,234,211,183,70,199,85,177,69,244,233,241,170,157,43,130,111,131,245,90,63,205,87,241,18,4,246,215,139,150,177,8,66,28,50,50,222,112,206,76,32,152,1,17,107,242,1,206,166,185,197,116,68,215,24,26,236,7,166,216,41,
|
||||
48,215,10,133,133,68,167,32,214,199,27,90,226,248,41,117,149,43,9,221,209,235,217,212,112,150,142,219,76,14,199,180,75,87,222,191,75,108,177,76,228,211,49,94,41,170,27,107,80,150,51,182,181,32,157,122,128,21,84,34,86,4,9,56,67,92,112,4,121,159,53,248,
|
||||
149,49,48,50,128,85,26,122,196,238,41,246,232,107,218,24,107,83,245,7,127,173,58,139,199,254,125,139,145,150,210,4,199,196,8,71,131,250,137,64,249,234,140,138,71,138,241,132,43,128,103,136,101,184,132,146,85,20,6,185,20,29,213,88,55,131,13,77,188,218,
|
||||
26,109,124,245,208,16,122,187,44,101,216,218,59,58,88,62,155,116,157,69,168,67,63,233,140,67,254,164,121,0,202,252,29,43,37,4,21,67,21,224,176,65,108,54,70,37,141,214,250,222,238,196,32,183,119,126,198,174,205,140,37,204,7,89,86,207,37,179,34,215,197,
|
||||
121,96,253,118,200,215,100,216,84,213,229,240,237,31,81,236,217,173,20,154,252,133,142,78,125,121,36,97,170,242,117,92,114,214,124,170,49,129,167,40,26,103,36,40,155,41,83,45,218,244,130,89,68,8,174,42,245,162,106,238,22,10,112,251,12,69,46,248,111,99,
|
||||
147,167,214,237,250,124,227,98,234,13,214,186,180,4,2,196,66,126,108,84,90,192,152,135,13,172,64,154,207,43,183,36,63,129,242,133,184,147,176,137,31,176,150,237,147,24,151,66,51,25,192,21,217,133,174,194,101,123,3,134,213,161,181,250,238,143,87,176,154,
|
||||
29,54,158,149,155,171,157,73,247,7,90,106,59,26,117,162,183,197,157,188,2,114,241,95,140,83,150,214,39,149,109,192,45,196,20,177,76,70,92,91,115,41,187,101,137,55,129,5,249,10,110,97,94,142,219,207,235,111,10,58,157,188,221,173,185,174,42,217,118,151,
|
||||
92,22,175,183,236,172,35,108,107,43,237,238,107,173,25,249,118,218,91,150,234,250,247,57,93,89,4,12,206,60,75,249,128,248,7,206,177,242,91,246,129,50,187,162,94,172,54,173,44,93,110,115,78,128,105,78,173,8,21,245,146,127,97,88,35,124,97,123,18,224,94,
|
||||
174,54,180,210,179,182,234,6,166,194,169,27,84,44,254,192,59,100,123,91,125,25,54,17,109,93,138,221,99,214,1,107,8,135,204,56,128,74,152,136,173,148,230,202,137,111,35,77,176,186,149,214,116,46,170,153,124,75,178,176,216,192,251,252,165,128,202,115,54,
|
||||
246,2,174,207,32,85,136,137,123,150,119,103,95,175,255,0,168,239,32,141,117,172,183,217,201,111,81,193,156,70,25,156,76,69,203,15,139,165,185,153,4,41,10,43,102,0,216,74,212,248,106,182,136,43,106,176,187,4,88,48,86,161,201,43,80,5,252,87,98,214,45,176,
|
||||
67,86,44,110,53,49,230,236,49,203,247,45,62,83,98,195,6,12,184,40,142,115,31,57,25,154,222,111,221,214,122,138,182,10,191,203,154,229,108,204,228,34,221,229,46,226,62,175,139,125,81,177,253,139,144,248,130,208,101,150,96,88,224,150,96,87,230,90,188,134,
|
||||
176,254,223,245,246,122,156,2,22,155,221,191,113,73,66,239,177,77,212,66,170,64,76,205,116,253,221,141,85,190,139,169,116,112,78,121,146,3,136,175,241,230,48,109,36,123,152,202,237,193,47,150,54,64,101,182,18,165,188,32,36,212,167,216,127,145,137,53,
|
||||
115,255,0,231,184,34,117,39,20,109,168,27,58,237,199,111,180,79,102,185,160,79,82,77,45,50,98,47,237,238,245,203,124,191,82,234,91,204,6,103,192,105,203,200,108,128,254,85,136,90,237,33,171,124,2,249,60,129,137,52,233,189,235,183,43,121,39,24,111,160,
|
||||
36,21,235,63,215,116,126,253,103,27,27,84,217,244,163,12,250,186,239,179,120,164,42,214,184,91,19,35,98,133,97,181,161,196,149,101,63,134,96,98,8,97,147,226,43,70,108,197,60,138,245,86,166,178,177,19,237,255,0,58,221,144,35,124,147,142,123,127,80,8,199,
|
||||
83,93,214,30,218,150,171,102,191,23,110,32,109,61,106,222,235,245,116,147,86,146,176,12,70,150,46,101,245,2,54,116,195,155,52,216,65,75,147,233,124,154,157,96,173,153,147,71,97,205,93,85,132,209,213,214,140,250,130,157,206,205,183,27,64,102,125,182,51,
|
||||
71,110,49,216,131,242,206,175,32,62,95,109,191,253,31,112,140,90,63,219,179,251,144,181,125,39,103,70,165,225,150,197,35,16,195,230,48,17,214,89,88,50,202,68,53,9,233,16,208,9,215,161,121,217,90,215,168,27,194,52,180,230,238,204,19,160,15,159,183,28,
|
||||
129,221,248,236,117,208,189,191,12,91,129,111,66,95,235,126,225,5,67,220,12,102,204,204,235,187,109,141,23,213,221,215,220,172,195,24,195,25,99,215,152,106,243,234,196,100,148,87,97,179,177,176,87,167,85,136,101,39,50,194,0,220,42,218,102,125,182,103,
|
||||
220,3,29,142,163,98,220,140,238,175,13,221,93,182,211,191,107,110,253,155,51,249,40,217,187,94,205,14,250,155,193,57,12,4,243,12,43,61,98,53,115,128,149,40,7,183,187,149,196,196,181,209,173,181,90,171,170,206,185,62,126,220,254,79,184,64,27,250,131,54,
|
||||
226,174,91,215,165,187,47,102,73,63,155,51,87,181,220,213,154,253,246,173,161,44,170,197,108,99,38,1,152,229,112,92,67,183,175,72,178,255,0,117,228,2,9,34,11,10,205,94,231,157,103,195,253,186,71,212,125,198,63,236,208,82,219,62,145,245,118,114,229,231,
|
||||
252,85,123,249,82,123,240,18,222,248,79,119,125,139,159,238,18,45,254,202,55,179,52,231,138,242,205,159,128,204,127,215,237,222,95,89,247,49,206,207,92,24,236,243,210,247,127,255,218,0,8,1,2,2,6,63,0,96,255,218,0,8,1,3,2,6,63,0,96,255,218,0,8,1,1,1,6,
|
||||
63,0,246,220,208,11,147,101,163,237,237,235,68,202,70,115,55,76,234,238,50,78,104,51,92,156,210,78,75,44,250,215,57,87,32,96,29,1,2,65,28,83,238,200,200,198,174,108,134,154,75,220,19,200,84,214,69,238,135,233,12,247,36,209,30,245,166,60,187,66,209,123,
|
||||
252,211,77,169,129,239,42,152,98,172,234,129,151,57,61,74,129,149,221,61,214,162,104,19,16,195,5,75,148,196,211,18,154,33,208,4,2,217,208,161,23,161,182,96,250,63,70,76,139,202,224,39,145,112,44,48,68,186,161,170,210,10,121,89,1,26,146,171,82,191,106,
|
||||
99,117,91,11,15,247,46,9,216,18,44,83,148,241,193,85,3,19,214,16,171,252,87,17,223,250,29,27,100,29,211,255,0,79,226,68,202,90,155,19,137,85,78,127,95,149,86,248,167,185,54,28,21,45,137,78,244,207,53,90,68,123,211,70,203,245,126,129,128,77,128,232,111,
|
||||
48,163,35,185,7,45,89,14,8,50,15,222,129,123,98,19,226,125,178,5,0,188,242,62,152,252,234,81,133,0,185,185,145,249,164,138,108,74,96,93,18,113,178,175,136,220,228,173,168,149,82,220,19,214,92,85,2,168,170,193,113,78,152,45,68,87,52,215,11,234,109,143,
|
||||
202,220,56,121,100,184,133,76,170,17,131,248,106,31,218,169,108,202,58,105,113,182,50,143,159,118,127,62,226,63,171,42,91,134,40,181,206,63,203,20,248,44,206,1,115,84,166,5,149,106,152,95,37,96,153,130,253,202,130,185,167,102,64,154,241,66,61,18,219,
|
||||
149,164,40,114,62,85,40,74,241,44,131,215,62,165,17,153,110,194,163,213,236,124,74,119,171,213,74,68,212,226,170,250,113,122,38,29,193,57,84,174,104,129,220,152,84,252,17,55,145,247,46,37,80,55,21,94,138,171,58,213,46,99,240,84,92,83,209,52,170,13,148,
|
||||
126,227,106,180,231,9,202,18,61,99,177,3,211,163,126,36,17,77,81,55,79,16,242,193,202,148,228,229,197,30,128,42,142,244,206,169,222,169,108,83,70,233,133,241,41,135,250,148,228,171,42,123,33,58,113,130,0,88,96,135,4,211,14,17,148,60,50,171,100,81,25,
|
||||
40,245,14,153,179,137,221,197,139,252,170,194,67,185,84,49,79,169,102,85,45,197,48,78,75,42,14,196,73,79,210,206,21,199,72,170,100,99,146,200,42,170,132,8,243,22,81,80,252,35,225,210,101,41,60,179,56,167,179,44,211,128,239,238,76,213,54,85,234,92,5,202,
|
||||
167,98,226,179,123,42,221,113,85,58,143,5,203,8,246,221,9,110,109,242,155,24,212,46,85,84,10,100,101,34,208,153,120,156,25,23,6,77,146,26,103,45,169,30,228,35,34,39,25,120,38,44,86,220,123,74,10,61,67,225,210,225,187,83,129,214,154,76,70,98,132,32,252,
|
||||
209,62,25,14,42,151,92,227,181,51,245,0,134,145,84,229,1,149,83,166,205,12,197,147,146,6,101,139,161,0,57,64,197,57,36,27,184,77,118,196,161,195,160,236,239,7,140,172,113,137,245,193,74,4,62,154,2,40,37,31,44,144,137,241,93,144,32,211,0,180,31,44,98,
|
||||
160,25,203,168,14,1,86,129,62,160,217,189,21,193,9,132,171,197,94,171,78,0,184,25,43,247,170,200,86,201,128,98,156,166,103,57,39,55,55,86,232,160,86,29,235,152,170,123,1,9,10,78,62,245,64,21,84,55,199,131,116,105,151,226,138,140,241,137,118,65,228,65,
|
||||
107,50,27,123,50,120,72,115,209,138,209,199,83,43,30,33,147,217,49,168,78,184,39,4,245,156,23,41,212,113,37,57,236,78,130,7,218,5,112,232,224,156,173,67,21,69,63,86,223,48,254,100,1,45,44,20,99,57,104,123,79,7,244,40,79,94,189,68,134,102,78,142,222,220,
|
||||
68,35,137,188,229,248,164,153,18,122,151,5,78,144,131,32,131,251,77,209,84,193,93,8,59,131,209,185,28,226,71,185,80,226,221,202,96,49,17,26,140,13,164,7,163,209,184,163,2,8,220,219,147,86,186,131,38,199,36,126,164,163,22,226,231,240,166,34,183,110,9,
|
||||
144,6,234,157,20,65,54,40,123,117,162,44,229,114,129,24,224,233,183,8,235,69,176,67,126,96,198,2,206,170,166,126,83,240,92,165,137,149,123,84,204,195,176,49,111,83,168,237,248,165,41,234,36,122,165,253,180,252,108,180,253,180,4,32,13,119,5,111,205,162,
|
||||
58,147,2,9,56,132,115,21,70,70,229,1,250,213,17,143,238,89,61,151,16,131,118,251,21,167,67,116,17,58,167,114,9,226,152,7,9,197,26,235,149,137,197,104,221,96,44,22,159,41,172,79,5,187,31,148,167,177,5,67,77,117,134,45,119,117,47,185,222,137,132,54,195,
|
||||
196,74,132,255,0,2,237,117,185,35,33,162,103,150,64,49,4,15,52,22,99,4,225,213,59,208,235,85,176,6,169,197,250,63,106,24,103,193,30,29,3,52,215,41,165,116,90,141,100,98,13,113,90,177,114,17,56,154,16,136,141,30,157,200,135,230,186,225,25,10,240,40,2,
|
||||
113,167,90,148,133,12,131,93,72,238,78,123,115,108,49,254,37,166,17,213,202,8,148,134,162,254,101,186,62,83,209,61,237,185,64,125,190,235,75,112,16,211,140,163,249,127,149,255,0,181,72,194,100,177,0,71,27,35,19,130,97,138,226,15,75,224,184,33,243,98,
|
||||
159,0,83,154,228,159,222,140,137,234,224,170,108,170,106,207,218,156,23,150,45,154,104,192,212,215,169,96,31,173,88,63,106,50,167,189,60,182,201,139,220,21,164,135,6,232,196,158,53,70,50,220,20,115,16,75,48,37,9,75,118,33,131,92,41,13,90,140,226,68,64,
|
||||
197,194,101,189,19,56,202,123,122,76,72,167,204,136,220,113,39,50,114,88,58,37,159,50,170,158,65,149,10,226,152,89,2,253,104,72,151,43,81,46,112,124,130,191,134,200,0,105,136,71,72,164,113,64,105,161,55,79,58,149,88,133,70,76,6,107,80,32,139,135,93,127,
|
||||
21,162,86,54,90,246,219,153,203,34,215,96,228,102,137,37,169,78,181,168,213,173,215,243,32,36,73,47,66,120,166,237,91,166,114,51,145,210,192,6,240,167,208,36,9,38,36,142,100,218,92,0,196,90,136,176,229,226,154,227,37,90,5,78,134,8,196,155,217,73,152,
|
||||
241,85,194,232,86,202,165,158,235,76,170,13,149,40,233,130,162,113,213,222,180,131,96,162,31,18,128,43,67,212,45,78,226,116,126,40,2,28,226,176,60,26,138,36,196,70,181,108,25,107,242,89,57,212,80,105,52,13,64,85,147,149,168,84,100,169,22,235,79,154,100,
|
||||
200,158,8,0,171,218,152,88,221,7,197,126,244,12,112,178,17,205,81,115,98,128,136,171,151,78,123,184,32,229,243,70,24,97,44,81,171,140,80,24,26,247,35,86,41,240,76,108,187,83,35,23,164,109,208,238,201,205,176,233,136,56,150,78,220,166,197,85,63,122,117,
|
||||
122,33,87,64,102,162,94,128,32,214,53,85,46,214,9,201,68,220,96,233,138,229,184,197,106,190,69,8,26,1,94,245,166,33,204,172,81,6,225,19,146,250,186,162,218,117,32,123,74,145,219,132,165,18,110,5,22,153,6,34,224,221,8,128,101,35,64,2,26,246,204,99,43,
|
||||
58,115,38,57,21,74,168,145,129,4,173,56,222,39,138,32,131,79,97,151,21,149,40,155,133,211,10,19,82,113,110,128,213,165,184,167,199,36,114,6,170,236,6,10,253,171,110,120,18,64,71,173,72,112,79,255,0,141,12,153,72,57,3,95,236,91,131,139,173,179,148,130,
|
||||
36,134,168,35,22,71,85,243,76,253,136,238,16,192,219,177,12,194,123,28,74,49,144,166,4,91,165,211,166,184,89,172,203,50,118,170,1,145,51,194,200,213,198,43,51,117,102,66,91,91,98,122,102,93,212,132,134,146,230,138,67,58,45,44,117,125,59,98,200,57,97,
|
||||
137,91,129,205,8,101,35,155,93,67,30,96,183,11,88,126,212,127,10,250,99,194,43,57,53,162,180,196,48,22,77,208,196,58,50,133,49,100,196,49,233,37,56,186,201,211,58,204,230,132,93,201,64,11,217,110,125,206,228,116,198,32,104,123,148,203,117,238,55,31,220,
|
||||
183,71,204,139,94,139,233,127,115,78,151,236,212,180,155,173,200,109,224,197,205,148,65,62,56,2,123,22,217,30,161,241,91,205,140,15,193,13,157,177,170,115,139,1,146,27,113,172,141,103,47,84,189,167,52,100,225,51,38,101,80,180,139,166,49,44,3,186,252,
|
||||
201,105,25,138,167,148,181,140,172,182,225,181,29,90,136,48,28,95,192,183,70,231,219,8,67,77,101,168,29,63,195,209,189,248,199,193,110,143,153,3,197,107,215,207,118,106,187,41,27,17,78,229,189,19,140,31,184,173,153,103,18,61,232,102,8,43,255,0,159,236,
|
||||
249,98,99,167,115,116,138,154,126,100,118,212,254,184,97,186,195,235,99,16,60,178,249,16,148,14,168,144,224,138,134,246,173,208,204,172,156,139,32,88,45,194,40,224,124,83,167,95,109,184,47,29,192,31,181,125,197,124,133,5,189,27,135,7,220,183,115,36,31,
|
||||
114,132,64,121,18,24,45,20,109,109,175,205,169,255,0,164,183,34,40,117,17,239,68,59,60,74,217,148,141,57,151,40,237,43,227,208,0,252,205,131,226,218,63,227,95,83,102,79,234,137,241,71,241,199,218,162,175,72,24,58,211,234,32,119,115,34,9,106,34,22,209,
|
||||
179,110,71,226,183,128,46,251,102,253,93,27,224,101,18,165,196,15,130,219,113,171,129,90,120,248,184,250,150,244,70,19,147,47,175,16,36,64,32,3,103,62,100,119,55,166,101,35,209,78,145,185,179,51,9,12,71,243,33,183,247,13,181,187,234,242,75,253,137,197,
|
||||
138,113,127,108,102,163,180,15,244,133,71,205,37,84,241,61,138,36,122,163,78,213,57,69,195,192,191,114,162,223,4,179,196,124,85,49,136,81,4,183,21,224,230,102,189,27,214,183,55,97,225,156,137,7,244,32,66,122,182,199,146,85,8,71,120,29,153,103,226,138,
|
||||
213,183,49,49,152,46,178,246,46,181,110,204,6,242,249,150,230,229,90,114,36,62,93,52,71,111,238,41,202,64,144,181,191,185,21,212,86,240,151,160,31,122,137,3,200,29,64,2,1,119,15,101,167,64,250,183,119,228,117,95,110,158,192,250,58,181,124,143,252,139,
|
||||
148,76,143,157,191,200,191,163,9,117,152,15,242,170,125,188,31,241,67,254,85,205,182,34,56,24,127,200,142,189,125,159,246,46,103,124,93,118,171,46,56,244,252,235,113,189,21,239,91,116,110,79,218,160,1,107,212,217,105,250,99,194,218,181,27,250,180,248,
|
||||
215,255,217,0,0 };
|
||||
|
||||
const char* jules_jpg = (const char*) temp_ec935dd1;
|
||||
|
||||
//================== prefs_about.png ==================
|
||||
static const unsigned char temp_101ffda8[] =
|
||||
{ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,60,0,0,0,60,8,6,0,0,0,58,252,217,114,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,4,103,65,77,65,0,0,177,142,124,251,81,147,0,0,0,32,99,72,82,77,0,0,122,37,0,0,128,131,0,0,249,255,
|
||||
0,0,128,233,0,0,117,48,0,0,234,96,0,0,58,152,0,0,23,111,146,95,197,70,0,0,6,145,73,68,65,84,120,218,98,252,255,255,63,195,72,2,0,1,196,196,48,194,0,64,0,141,56,15,3,4,208,136,243,48,64,0,141,56,15,3,4,208,136,243,48,64,0,141,56,15,3,4,208,136,243,48,
|
||||
64,0,141,56,15,3,4,208,136,243,48,64,0,141,56,15,3,4,208,136,243,48,64,0,141,56,15,3,4,208,136,243,48,64,0,141,56,15,3,4,208,136,243,48,64,0,177,80,162,89,215,233,32,33,37,140,64,44,12,196,78,64,108,10,210,242,247,223,127,21,126,30,86,209,162,52,69,102,
|
||||
31,87,113,38,14,118,102,198,123,143,191,221,41,105,188,214,119,237,246,151,45,108,172,140,111,129,234,254,225,51,244,242,62,123,178,221,12,16,64,140,148,12,0,16,240,176,26,16,199,0,177,47,16,27,128,4,64,54,253,253,243,159,97,66,163,22,131,187,163,24,
|
||||
138,226,27,119,190,48,36,22,94,188,242,233,203,159,45,76,140,12,11,65,66,180,240,48,64,0,209,34,73,115,2,113,28,16,175,5,226,90,152,103,65,224,215,175,127,12,6,58,124,12,214,102,66,24,154,52,84,120,24,236,44,132,116,254,253,251,95,1,228,174,1,226,52,
|
||||
32,230,166,182,227,0,2,136,133,202,230,73,1,113,1,16,103,3,49,23,186,228,31,96,236,74,75,112,48,48,51,99,15,103,57,105,78,72,50,96,96,208,6,226,73,64,172,3,196,93,64,252,132,90,14,4,8,32,38,42,123,182,5,136,139,177,121,22,4,88,89,24,25,30,60,249,206,
|
||||
240,227,231,95,172,6,220,121,240,141,129,145,17,206,101,7,226,28,32,110,5,133,5,181,28,9,16,64,212,242,48,27,16,23,1,113,60,62,51,217,216,152,24,46,93,251,196,176,231,240,27,12,185,211,23,62,48,28,58,254,150,129,137,137,17,189,208,3,149,3,101,184,2,145,
|
||||
84,0,16,64,212,74,210,17,64,156,65,76,0,178,177,50,49,180,76,184,205,240,225,227,111,6,83,3,1,6,102,160,7,239,63,250,202,208,51,227,30,195,183,31,127,25,88,152,25,177,69,74,50,16,95,1,226,25,148,58,20,32,128,168,81,74,171,0,241,22,32,86,39,86,223,63,
|
||||
96,165,243,245,219,31,6,1,126,86,6,22,22,38,134,55,111,127,50,112,114,48,3,217,140,248,180,61,4,98,15,80,233,77,73,41,13,16,64,148,38,105,102,32,142,133,86,65,196,91,10,180,149,151,135,5,92,106,127,253,250,135,129,135,155,133,144,103,65,64,30,154,101,
|
||||
88,41,113,48,64,0,81,234,97,1,32,14,132,230,53,172,224,239,223,255,12,127,64,24,88,66,255,70,195,160,180,197,8,116,1,9,169,204,15,136,69,41,113,48,64,0,81,154,135,65,45,40,93,92,146,32,111,136,8,177,129,99,15,148,116,129,173,40,20,57,81,97,118,6,25,9,
|
||||
118,134,15,159,254,48,156,60,251,158,225,251,207,127,200,165,52,54,160,5,196,110,64,188,128,92,7,3,4,16,165,30,54,199,37,1,138,81,25,41,14,134,169,173,186,12,18,226,236,12,124,60,184,173,58,125,241,3,195,185,203,31,25,190,124,199,90,104,161,3,51,74,60,
|
||||
12,16,64,148,122,88,27,103,236,2,147,41,40,159,222,126,240,149,225,241,179,239,192,124,202,204,96,168,195,15,174,154,208,193,165,235,159,25,62,125,254,195,192,196,72,153,157,196,0,128,0,162,212,195,170,184,36,88,129,213,207,93,96,67,162,186,227,6,195,
|
||||
23,96,137,236,104,37,194,48,173,93,0,171,218,91,192,118,244,23,96,225,197,203,67,148,115,148,41,113,48,64,0,81,234,97,17,124,146,160,2,11,132,65,125,31,89,41,78,112,75,11,29,252,0,230,219,87,192,106,137,137,200,232,37,100,39,33,0,16,64,148,150,210,120,
|
||||
93,9,42,128,64,85,16,168,190,53,208,226,195,170,230,254,163,111,12,207,94,254,36,166,90,34,202,78,66,0,32,128,40,245,240,107,66,10,64,53,14,39,7,19,131,170,18,55,78,15,63,1,230,113,86,226,61,252,134,18,7,3,4,16,165,30,190,71,140,135,249,120,88,25,20,
|
||||
229,176,55,133,239,63,254,198,240,17,84,96,17,159,164,239,81,226,96,128,0,162,212,195,87,8,166,63,160,63,20,128,158,229,96,199,180,234,39,176,165,117,15,88,176,49,51,147,100,231,85,74,28,12,16,64,148,122,248,36,225,102,36,35,131,161,46,246,252,251,238,
|
||||
195,47,134,39,207,127,0,147,51,73,206,56,69,137,131,1,2,136,82,15,239,3,226,107,132,98,88,71,141,23,123,1,240,246,23,195,173,251,95,192,85,24,145,224,38,16,239,166,196,193,0,1,68,169,135,223,1,241,38,6,216,56,5,142,78,191,142,6,246,24,126,241,234,39,
|
||||
195,171,215,63,193,173,43,34,155,211,160,94,217,11,74,28,12,16,64,148,122,24,52,116,49,31,52,88,129,171,30,86,87,225,97,224,228,100,194,42,119,230,210,7,6,54,118,102,120,203,236,227,231,223,248,60,254,24,136,231,1,241,111,74,28,12,16,64,212,24,241,184,
|
||||
13,196,221,160,54,4,134,167,254,253,103,208,211,226,103,96,198,210,35,248,254,227,31,195,245,219,95,192,41,224,247,239,255,12,182,22,66,12,85,185,170,12,220,192,38,40,150,222,19,200,147,125,64,124,157,82,199,2,4,16,53,60,12,114,221,98,32,158,131,158,
|
||||
180,65,177,168,166,200,133,181,169,0,26,215,2,151,208,192,66,13,212,81,76,143,145,103,8,242,146,0,55,49,177,104,88,132,205,124,114,0,64,0,81,107,76,11,20,187,157,64,188,4,217,81,127,129,77,74,61,28,45,172,199,79,127,48,188,0,230,223,175,223,255,48,68,
|
||||
5,72,131,59,22,139,214,60,97,248,251,135,1,189,139,184,12,58,56,248,133,26,14,5,8,32,106,142,90,130,134,82,107,128,120,42,168,138,133,55,214,113,180,160,46,92,5,118,7,191,254,101,208,215,228,103,72,140,144,5,86,79,223,25,214,108,121,14,84,143,146,140,
|
||||
103,3,113,53,16,63,160,150,35,1,2,136,218,227,210,143,128,184,18,218,56,40,2,198,148,234,215,175,216,135,100,153,129,54,123,56,137,50,84,100,171,48,200,72,114,48,36,21,93,4,15,4,64,155,152,119,160,1,7,42,16,63,82,211,129,0,1,68,109,15,51,64,147,30,104,
|
||||
116,241,32,176,186,137,221,119,244,109,156,142,6,175,52,186,162,96,47,41,134,16,31,41,6,46,14,102,134,198,222,91,12,199,78,191,7,213,199,160,233,149,173,80,143,94,165,129,219,24,0,2,136,22,30,134,129,235,192,242,168,230,229,235,31,179,159,189,248,57,
|
||||
85,74,130,221,19,89,146,155,139,153,225,225,227,239,63,251,103,223,187,178,101,207,203,83,64,207,158,6,246,172,246,0,165,158,65,171,59,154,0,128,0,162,165,135,65,224,31,48,150,239,3,219,204,33,12,144,145,77,123,104,127,246,19,16,31,251,240,233,247,205,
|
||||
7,143,191,253,252,247,239,255,15,160,186,223,12,116,0,0,1,196,56,210,150,15,3,4,208,136,155,16,7,8,160,17,231,97,128,0,26,113,30,6,8,160,17,231,97,128,0,26,113,30,6,8,160,17,231,97,128,0,26,113,30,6,8,160,17,231,97,128,0,26,113,30,6,8,160,17,231,97,128,
|
||||
0,26,113,30,6,8,160,17,231,97,128,0,3,0,159,22,207,49,216,248,213,199,0,0,0,0,73,69,78,68,174,66,96,130,0,0 };
|
||||
|
||||
const char* prefs_about_png = (const char*) temp_101ffda8;
|
||||
|
||||
//================== prefs_keys.png ==================
|
||||
static const unsigned char temp_958eb5cf[] =
|
||||
{ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,42,0,0,0,60,8,6,0,0,0,16,76,40,221,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,4,103,65,77,65,0,0,177,142,124,251,81,147,0,0,0,32,99,72,82,77,0,0,122,37,0,0,128,131,0,0,249,255,0,
|
||||
0,128,233,0,0,117,48,0,0,234,96,0,0,58,152,0,0,23,111,146,95,197,70,0,0,14,72,73,68,65,84,120,218,98,252,255,255,63,195,80,0,0,1,196,196,48,68,0,64,0,13,25,135,2,4,208,144,113,40,64,0,13,25,135,2,4,208,144,113,40,64,0,13,25,135,2,4,208,144,113,40,64,
|
||||
0,49,18,33,199,72,132,90,74,192,127,34,216,12,0,1,196,130,195,129,200,152,9,141,77,169,163,209,29,131,140,255,33,177,81,212,3,4,16,11,150,16,100,130,225,134,134,70,125,14,14,14,109,109,109,173,121,48,69,31,63,126,186,249,247,223,63,145,191,127,254,178,
|
||||
51,49,51,51,51,49,50,50,252,251,255,143,129,153,133,153,225,255,191,255,12,127,126,255,97,0,138,51,0,133,25,254,253,131,216,205,8,52,142,145,137,17,226,91,38,198,127,192,218,240,15,80,231,143,95,63,127,126,248,241,227,199,27,46,46,174,199,192,10,242,
|
||||
49,35,35,227,149,39,79,158,238,169,174,174,122,141,228,104,176,99,1,2,136,17,75,40,50,139,138,138,178,102,103,103,39,124,253,254,93,221,197,201,217,198,212,212,68,149,141,141,141,5,104,40,3,43,27,59,80,243,127,160,7,25,129,110,3,185,147,17,98,26,35,68,
|
||||
51,168,74,6,213,202,32,250,239,223,127,96,7,131,192,191,127,255,128,248,47,216,82,160,71,255,1,61,244,251,229,203,151,63,46,93,186,244,237,195,251,119,159,190,124,251,246,230,247,239,223,15,153,152,24,207,51,49,50,109,153,51,123,246,195,7,15,30,252,129,
|
||||
57,24,32,0,23,100,172,131,48,12,196,208,112,177,239,138,154,37,123,6,96,133,159,160,51,162,255,193,63,208,63,204,223,16,178,114,45,11,226,36,75,30,172,211,179,227,63,164,139,207,101,121,244,222,111,167,195,241,60,207,247,75,74,105,88,65,189,57,204,148,
|
||||
126,66,165,152,106,32,177,201,161,183,37,1,124,245,227,69,196,51,12,170,116,31,119,0,189,37,36,231,236,111,212,90,123,15,227,152,246,4,204,199,176,8,145,233,58,189,74,41,173,214,186,194,134,143,0,98,65,10,81,80,116,179,148,150,150,105,1,29,25,36,43,43,
|
||||
39,46,34,42,194,7,114,20,70,34,6,130,255,192,232,254,243,231,47,195,175,95,191,192,14,1,90,12,140,250,127,64,199,50,33,18,22,35,34,242,64,33,10,12,45,48,254,15,138,14,96,34,0,134,28,19,208,14,102,126,1,1,166,127,127,255,50,115,112,176,254,103,98,102,
|
||||
248,245,241,195,71,29,160,249,119,5,4,4,94,2,181,126,7,153,2,16,64,200,25,5,228,104,86,96,168,24,115,113,113,171,10,8,240,139,252,250,253,139,251,207,159,63,40,142,4,122,130,225,246,157,59,12,32,135,254,253,251,7,232,208,223,12,175,95,191,102,184,114,
|
||||
229,50,195,151,175,159,25,126,3,211,40,48,106,33,73,1,24,239,160,180,9,114,60,35,19,35,60,193,129,67,5,40,0,76,226,140,236,236,236,76,220,220,156,44,236,192,56,227,227,231,227,22,22,18,17,2,106,148,123,250,236,249,223,174,174,174,31,208,88,102,4,8,32,
|
||||
38,180,16,101,253,241,253,59,7,144,195,206,193,193,201,6,204,48,172,95,191,125,131,231,112,80,8,190,123,247,145,225,192,129,253,12,55,110,92,7,71,57,40,13,158,59,119,158,225,211,199,15,192,244,203,10,78,155,136,60,139,200,192,96,71,131,48,48,73,128,18,
|
||||
29,40,3,50,64,211,52,72,26,152,44,88,216,217,192,233,138,7,152,60,248,128,1,38,9,4,108,176,128,4,8,32,38,164,156,14,78,159,192,80,98,2,166,33,176,102,144,25,63,127,254,68,41,207,132,132,132,24,212,84,53,24,78,157,62,205,240,235,247,111,134,75,151,47,
|
||||
1,45,253,203,96,104,100,204,192,10,212,7,11,61,152,239,144,155,187,16,199,253,103,96,6,151,10,140,144,36,3,82,15,132,224,18,130,145,145,137,131,147,147,25,232,90,54,198,255,12,92,220,220,220,108,176,16,5,8,32,22,180,140,196,2,140,58,70,144,241,64,199,
|
||||
254,7,137,126,255,249,19,238,115,70,160,161,76,192,104,213,214,214,97,120,242,244,49,195,250,141,235,193,22,90,152,91,50,112,113,241,0,213,252,101,128,101,115,104,56,2,163,24,41,128,255,254,7,134,230,63,72,248,252,7,167,13,134,223,192,88,250,11,42,222,
|
||||
152,153,255,131,60,9,244,12,51,48,84,89,128,118,113,0,147,29,51,172,28,7,8,32,38,164,104,7,135,42,51,48,220,193,145,7,20,5,249,24,168,152,17,92,26,2,29,250,15,84,220,0,33,47,55,15,131,178,130,26,195,213,203,87,25,212,212,84,24,36,196,197,129,33,242,7,
|
||||
28,58,160,114,149,17,71,233,14,204,59,160,92,15,246,52,168,220,101,132,6,57,200,92,80,102,3,42,254,207,204,200,244,159,141,157,29,228,21,78,96,41,195,10,11,72,128,0,92,150,65,14,0,33,8,3,187,186,137,250,255,255,233,83,220,14,97,47,156,9,164,166,116,176,
|
||||
21,224,119,224,24,29,55,45,242,6,80,128,137,4,139,100,195,211,125,182,230,88,114,66,109,119,166,185,222,148,250,177,176,208,176,92,143,18,182,97,21,51,233,180,88,191,179,93,75,120,93,129,219,191,219,250,4,224,170,92,114,0,4,97,40,216,160,103,196,59,107,
|
||||
92,187,86,143,97,210,199,20,76,19,221,3,133,247,25,202,31,248,48,45,242,34,112,193,190,208,81,67,77,247,62,4,78,219,182,175,54,241,214,90,23,218,126,216,117,159,93,205,7,2,40,77,207,162,124,255,207,136,208,112,234,173,154,114,29,214,123,153,185,43,103,
|
||||
161,14,217,83,82,169,9,32,38,204,58,254,255,63,96,232,252,7,250,158,9,17,170,96,239,50,0,163,5,232,176,171,192,226,233,22,131,131,131,3,131,188,188,2,131,148,164,12,195,233,83,103,24,126,252,252,1,118,44,3,158,64,5,215,90,64,115,192,229,45,56,25,48,129,
|
||||
197,128,14,252,15,5,224,164,245,255,239,95,198,127,127,254,2,195,234,239,127,88,136,2,4,16,19,166,97,12,176,84,246,31,148,118,64,134,129,69,128,142,124,249,242,21,195,229,203,151,25,172,173,109,25,248,248,248,25,62,127,254,204,96,100,104,204,240,237,
|
||||
235,15,96,113,117,147,129,5,88,92,193,2,241,63,172,72,66,15,77,80,219,0,82,149,130,99,9,28,154,160,82,139,133,5,148,40,64,118,2,29,248,31,228,194,223,95,191,124,253,7,11,68,128,0,194,214,122,2,183,40,128,134,128,92,7,207,28,160,34,135,5,88,13,58,57,57,
|
||||
49,136,139,139,129,27,31,160,234,81,68,88,152,193,210,210,26,168,224,31,168,40,3,251,29,228,185,127,208,90,10,22,106,176,52,10,17,103,6,39,39,112,59,225,255,127,198,63,191,254,252,7,229,4,80,38,2,21,97,64,167,130,146,222,239,111,223,191,193,67,20,32,
|
||||
128,88,176,199,16,36,93,50,65,11,105,6,72,113,192,32,36,44,200,192,47,192,15,22,99,134,214,52,160,74,64,70,74,26,24,36,140,224,154,138,145,9,104,228,63,72,141,4,117,8,122,245,203,0,43,164,25,145,204,135,52,86,254,128,147,44,48,253,2,83,199,223,63,200,
|
||||
241,1,16,128,205,50,202,1,0,134,96,232,58,187,255,137,23,166,132,248,216,1,200,179,182,230,124,40,217,29,25,70,133,45,29,235,197,95,197,208,233,21,164,156,202,69,177,67,194,144,149,144,226,192,245,213,79,216,224,10,145,123,16,26,211,88,83,86,96,208,220,
|
||||
159,215,175,169,62,243,158,0,98,193,82,132,252,251,253,247,15,72,17,27,40,243,51,130,157,135,200,111,176,12,3,115,4,184,102,97,135,26,3,178,236,15,36,202,25,145,67,240,63,3,188,52,0,87,78,72,9,23,28,24,144,128,97,4,229,95,38,80,193,15,164,129,121,130,
|
||||
17,212,226,130,57,22,32,128,208,27,206,140,60,60,192,210,156,129,1,92,54,65,27,74,40,165,55,216,217,255,97,237,79,104,20,195,171,31,160,71,88,152,48,219,243,140,136,166,47,184,192,131,149,161,176,116,6,106,29,177,176,128,252,194,8,12,35,80,179,10,156,
|
||||
77,190,125,251,6,143,10,128,0,194,8,81,126,62,126,53,14,54,246,111,191,127,255,226,0,55,88,129,62,132,228,75,70,72,245,197,200,8,15,145,255,240,50,13,34,6,43,65,255,35,187,18,238,38,72,131,26,226,111,136,206,127,224,30,193,95,72,105,0,77,22,127,255,129,
|
||||
61,2,108,187,48,177,128,26,57,160,178,25,4,0,2,136,5,189,3,247,251,207,31,96,75,238,251,79,96,59,19,152,244,32,173,35,120,109,128,84,111,51,34,107,66,202,52,140,140,168,221,47,104,184,193,139,45,72,6,98,134,247,4,64,142,5,55,1,33,165,204,127,70,48,96,
|
||||
98,252,143,86,11,3,4,16,19,122,71,13,88,236,0,187,50,63,254,254,250,249,235,31,36,44,24,25,80,115,2,246,130,28,181,199,247,31,73,252,63,162,254,71,242,29,180,201,10,114,27,195,95,80,195,228,31,56,181,129,219,228,160,50,1,84,33,2,67,19,30,46,0,1,132,81,
|
||||
51,1,155,108,127,129,45,168,127,160,242,12,86,206,161,228,90,52,159,193,219,153,140,140,112,143,48,50,32,21,44,208,250,31,28,122,127,255,129,59,128,144,228,15,41,77,64,81,13,110,249,131,123,13,96,185,255,96,187,129,130,172,108,108,240,128,4,8,32,22,204,
|
||||
190,50,211,127,88,173,244,23,84,31,35,18,61,212,29,136,242,145,17,45,132,25,145,67,29,86,29,50,34,234,114,80,117,12,139,114,112,105,1,86,250,15,92,235,65,28,253,247,63,200,149,64,123,255,131,11,28,164,16,2,8,64,118,153,160,0,0,130,64,48,169,255,255,183,
|
||||
75,115,211,14,234,1,130,44,50,179,166,223,160,96,167,144,114,44,160,191,2,17,59,53,207,233,133,248,18,196,81,164,165,21,157,183,236,23,68,254,158,8,219,124,210,101,81,182,167,157,90,159,132,41,53,83,199,147,170,173,252,226,104,24,2,136,5,91,93,15,108,
|
||||
56,253,5,165,171,63,192,74,23,154,78,192,206,68,14,69,228,208,252,9,108,233,195,28,7,115,4,168,133,196,200,194,0,110,127,130,74,213,127,208,214,62,72,27,200,3,255,161,250,127,254,254,5,10,81,112,233,2,180,150,17,146,99,65,149,14,188,80,1,3,128,0,66,111,
|
||||
148,128,210,9,211,127,112,141,4,41,24,159,63,127,6,105,189,128,219,155,144,34,5,214,111,135,165,65,38,70,38,104,202,132,116,43,64,161,4,236,250,34,236,97,100,128,166,67,132,71,88,129,142,253,9,44,122,190,127,251,6,108,33,115,50,50,65,187,39,32,252,7,
|
||||
146,228,144,91,183,255,1,2,136,5,45,127,252,7,55,65,193,33,198,244,159,131,131,131,225,249,139,23,12,143,30,61,98,144,146,146,2,55,66,48,70,115,128,92,96,191,12,140,25,144,66,13,25,252,5,151,31,255,224,158,3,229,242,159,63,126,50,60,125,254,12,84,243,
|
||||
48,0,123,162,96,26,212,75,128,12,92,252,253,15,77,184,112,147,0,2,136,5,217,213,192,244,8,78,155,160,52,3,116,20,104,160,0,108,246,245,155,55,24,94,188,124,193,192,203,203,11,108,225,176,49,0,123,139,192,110,42,59,120,144,129,141,149,13,148,68,224,105,
|
||||
239,63,35,52,165,195,234,109,160,28,136,255,27,216,255,7,177,65,106,64,93,106,96,203,8,136,191,195,186,21,255,33,101,234,63,160,246,31,140,144,144,69,45,92,0,2,8,37,141,66,18,239,127,80,170,254,203,194,12,30,186,1,183,246,129,22,48,190,122,245,154,225,
|
||||
217,179,103,176,134,46,196,49,64,204,197,201,5,111,194,33,231,108,96,122,99,248,15,235,25,48,64,50,24,184,36,1,210,160,12,10,194,192,30,231,127,54,54,182,255,48,125,64,79,51,254,4,103,94,80,50,102,2,141,198,48,2,243,8,216,193,0,1,216,48,131,29,0,32,24,
|
||||
134,166,248,255,207,69,130,209,78,66,36,110,59,74,83,221,235,190,152,71,213,71,140,32,20,170,86,106,255,142,201,5,112,58,56,165,145,249,125,206,185,248,149,68,246,147,87,129,77,103,155,215,153,203,102,111,82,0,222,191,90,175,135,73,131,127,166,100,10,
|
||||
8,62,86,65,202,74,68,26,159,87,213,37,0,23,102,140,3,48,8,195,192,129,180,130,255,127,182,162,41,244,28,194,194,14,82,44,34,227,179,29,77,193,199,239,229,40,121,1,182,7,208,171,242,97,66,108,2,163,136,182,196,144,115,241,121,164,30,38,27,102,128,10,151,
|
||||
180,127,73,49,171,229,43,17,49,210,35,199,110,103,212,232,17,180,187,246,126,182,218,20,212,92,47,201,121,183,251,114,105,76,123,10,133,191,0,76,152,193,10,128,48,12,67,55,197,255,255,81,47,30,116,232,148,154,151,34,243,184,75,73,67,23,146,252,129,230,
|
||||
148,58,157,186,189,67,91,237,180,117,50,200,203,227,38,113,118,5,3,80,131,15,18,35,206,204,133,67,152,22,116,193,253,82,218,159,114,15,143,139,220,5,185,93,116,178,112,90,185,34,249,187,120,84,49,217,53,79,22,163,55,221,240,166,152,179,66,220,247,161,
|
||||
94,1,196,130,228,72,16,254,11,212,248,232,245,235,55,10,114,242,114,108,64,95,2,53,254,98,2,166,19,22,144,77,160,17,184,63,192,156,9,108,58,128,29,10,78,228,204,224,17,59,112,200,2,83,33,200,1,127,193,221,94,38,72,36,252,6,151,147,140,32,9,102,88,122,
|
||||
3,135,40,184,32,0,117,189,127,130,203,109,6,110,198,63,108,172,172,63,129,81,254,237,215,143,159,79,150,44,94,124,7,230,38,144,57,0,1,152,176,130,28,0,97,16,150,109,137,143,48,153,255,127,141,190,129,249,3,14,206,108,113,72,25,38,94,129,3,33,5,218,254,
|
||||
39,138,64,163,82,142,156,183,149,232,108,10,69,229,166,178,216,173,76,209,236,183,228,224,148,103,184,31,55,121,62,244,84,12,230,2,69,76,79,203,6,150,80,25,56,48,41,159,3,56,37,56,148,140,253,86,195,192,93,107,80,186,214,53,223,137,232,98,230,29,191,
|
||||
192,123,50,37,248,10,32,216,80,14,8,131,198,121,64,109,80,30,63,191,0,37,9,9,73,83,96,2,23,7,22,87,28,192,244,7,14,33,112,142,103,98,98,1,85,8,255,192,169,12,220,96,1,119,83,193,157,85,112,218,4,117,183,153,192,67,76,127,64,99,50,64,125,160,97,34,160,
|
||||
135,254,1,253,4,74,19,160,192,4,38,19,198,127,224,150,242,127,80,219,14,156,114,126,1,243,198,23,96,7,228,214,148,201,147,15,1,221,241,5,58,228,8,26,209,251,3,16,64,200,195,57,172,80,199,114,2,49,59,16,115,65,249,236,72,158,97,68,155,124,96,68,107,199,
|
||||
99,235,214,99,155,64,96,66,27,183,7,133,26,168,133,252,11,201,113,223,160,124,144,248,95,128,0,66,143,250,223,80,7,193,198,207,127,66,53,194,28,138,62,209,192,136,133,255,15,143,67,255,161,85,221,48,123,254,64,233,95,80,71,194,220,2,31,26,7,8,32,148,
|
||||
154,9,150,78,161,244,63,164,225,72,102,180,201,8,108,51,40,255,209,102,52,112,57,26,61,244,145,103,66,254,64,237,255,15,11,73,152,60,64,0,49,98,155,13,65,74,187,76,104,211,55,184,28,202,64,68,180,51,160,57,156,17,203,116,13,44,243,252,71,162,193,122,
|
||||
0,2,8,91,212,33,15,238,226,74,147,12,104,105,141,145,152,73,45,28,195,82,255,208,216,200,14,135,203,1,4,16,35,17,179,116,184,102,238,112,241,255,227,160,137,153,40,195,233,49,128,0,98,36,194,98,98,166,38,25,137,156,54,68,155,43,33,56,179,7,23,3,8,32,
|
||||
198,161,178,166,4,32,128,134,204,236,50,64,0,13,25,135,2,4,208,144,113,40,64,0,13,25,135,2,4,208,144,113,40,64,0,13,25,135,2,4,208,144,113,40,64,128,1,0,18,155,223,249,154,121,1,250,0,0,0,0,73,69,78,68,174,66,96,130,0,0 };
|
||||
|
||||
const char* prefs_keys_png = (const char*) temp_958eb5cf;
|
||||
|
||||
//================== prefs_misc.png ==================
|
||||
static const unsigned char temp_2dcb70c7[] =
|
||||
{ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,57,0,0,0,60,8,6,0,0,0,220,213,18,54,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,4,103,65,77,65,0,0,177,142,124,251,81,147,0,0,0,32,99,72,82,77,0,0,122,37,0,0,128,131,0,0,249,255,0,
|
||||
0,128,233,0,0,117,48,0,0,234,96,0,0,58,152,0,0,23,111,146,95,197,70,0,0,23,136,73,68,65,84,120,218,98,252,255,255,63,195,112,7,0,1,196,196,48,2,0,64,0,141,8,79,2,4,16,203,80,112,228,253,251,247,25,153,153,153,25,62,125,250,196,160,163,163,67,114,254,
|
||||
2,8,32,198,193,154,39,31,63,126,204,248,239,223,63,48,91,94,94,30,236,200,11,23,46,48,254,252,249,147,193,220,220,156,36,71,3,4,16,221,146,43,35,18,64,23,207,205,205,99,218,179,103,15,138,184,172,172,236,127,144,231,96,30,4,129,247,239,223,51,48,49,145,
|
||||
238,100,128,0,162,106,76,194,60,240,31,106,40,11,43,51,35,43,11,43,211,239,223,127,64,124,166,191,127,255,254,23,20,20,224,100,97,101,147,250,251,239,47,3,48,9,254,96,248,247,239,165,170,170,218,223,99,199,142,253,131,106,197,235,160,171,87,175,50,106,
|
||||
107,107,147,228,104,128,0,98,161,178,7,25,153,152,153,152,69,196,132,68,255,255,99,82,81,82,86,18,151,149,147,253,248,232,254,163,35,47,94,188,252,251,249,243,231,159,161,225,193,206,10,202,234,253,63,127,253,101,228,230,227,124,242,243,235,219,218,254,
|
||||
174,41,39,128,122,255,2,241,63,40,141,98,38,208,223,255,96,98,239,222,189,35,217,109,0,1,196,66,69,15,130,210,17,19,7,7,59,191,147,155,125,25,195,63,238,124,30,30,17,6,17,49,193,135,191,127,239,142,185,115,231,238,73,144,58,93,3,3,59,30,46,1,69,33,97,
|
||||
41,134,143,175,127,43,252,101,251,29,8,212,119,30,136,255,0,3,232,143,161,177,142,160,172,172,188,237,205,155,183,206,3,61,247,0,100,52,16,51,193,98,249,204,153,51,12,124,124,124,140,250,250,250,68,199,38,64,0,177,80,234,185,255,80,0,117,8,43,80,148,
|
||||
151,133,129,75,143,155,139,147,65,65,81,129,225,215,127,102,57,6,38,118,127,86,86,166,139,191,127,255,251,242,239,239,127,17,102,86,160,10,46,22,134,239,191,126,48,240,178,243,2,245,48,112,1,241,79,62,62,46,38,115,107,171,234,127,127,184,10,84,213,181,
|
||||
182,7,135,249,205,149,145,145,62,240,228,201,211,247,160,0,4,218,241,15,100,215,131,7,15,24,73,113,39,64,0,177,144,225,49,38,164,252,252,87,73,89,94,76,128,95,232,23,200,145,64,204,14,20,99,249,253,231,215,203,95,191,88,24,62,127,124,197,192,194,33,200,
|
||||
168,174,173,235,250,247,223,151,11,31,222,127,249,42,35,45,163,203,201,193,197,240,15,232,76,110,30,110,134,167,207,239,232,128,12,227,224,100,231,84,211,210,41,102,102,20,200,55,54,51,101,120,249,226,185,231,135,247,31,229,149,85,148,98,128,158,124,
|
||||
7,77,41,32,207,253,87,80,80,32,41,79,2,4,16,185,49,201,12,244,204,111,21,85,21,117,125,125,131,118,62,1,161,55,47,95,61,43,127,246,244,21,227,143,239,63,88,30,60,186,251,90,91,77,159,225,247,239,159,12,255,254,127,96,16,23,149,213,102,54,96,105,250,251,
|
||||
251,47,19,15,7,167,12,51,227,63,134,191,127,254,50,8,137,136,51,124,251,254,195,216,192,196,56,7,152,38,254,232,104,25,87,25,153,90,49,136,138,137,50,124,253,242,133,225,237,235,55,79,159,61,123,246,18,104,31,39,40,175,2,237,252,67,142,99,1,2,8,197,147,
|
||||
215,175,95,103,212,212,212,252,79,32,22,65,248,175,158,158,158,1,16,244,138,8,137,58,177,113,241,50,24,154,90,177,112,243,95,88,245,237,203,183,175,220,64,240,247,239,63,80,41,196,240,231,247,47,6,214,95,223,89,4,184,4,148,254,252,249,195,192,204,244,
|
||||
151,225,31,72,14,104,20,211,127,102,6,13,77,61,46,1,97,129,162,119,47,95,254,214,208,210,1,122,92,132,225,203,231,79,12,207,158,60,252,253,236,217,211,203,143,31,61,253,10,74,206,64,15,190,177,180,50,227,57,126,236,212,23,144,91,20,21,21,153,129,117,
|
||||
233,63,96,137,205,64,168,68,6,8,32,162,171,16,164,194,133,5,168,231,167,139,171,75,178,136,176,200,84,89,89,57,118,38,160,103,126,252,102,248,255,229,219,231,187,15,239,221,126,47,45,45,173,40,34,44,38,194,240,15,40,200,0,201,62,204,44,204,160,162,131,
|
||||
1,236,81,102,86,6,14,46,62,6,46,110,1,6,62,65,49,6,38,32,159,9,24,220,66,66,124,192,140,199,196,240,238,237,107,134,3,187,183,60,186,124,229,76,197,149,139,215,246,41,43,43,254,214,212,210,244,103,100,100,78,254,249,227,199,254,93,187,118,119,168,168,
|
||||
168,252,0,182,132,24,64,213,18,161,170,7,32,128,200,73,174,160,2,128,71,87,79,231,52,144,190,37,44,44,162,203,197,197,197,192,194,248,143,81,82,92,82,69,136,79,136,225,199,143,143,192,64,1,38,73,144,23,129,118,255,7,250,243,15,48,121,2,185,32,4,140,97,
|
||||
70,80,168,129,49,168,114,96,227,100,99,224,224,102,3,185,21,104,248,127,6,46,78,46,6,33,97,49,33,33,33,17,43,83,51,163,63,156,92,188,1,194,66,226,110,186,122,6,34,47,94,60,53,228,226,225,254,188,127,239,254,217,64,15,130,98,153,96,18,6,8,32,22,82,234,
|
||||
64,104,76,2,163,132,129,251,230,141,155,239,4,4,4,231,60,124,248,176,94,67,67,75,8,164,238,251,151,247,224,100,200,2,108,103,254,255,7,169,238,254,195,203,65,144,167,254,131,114,22,200,43,208,150,11,35,152,6,181,75,193,209,0,137,19,6,30,94,46,6,75,107,
|
||||
91,30,22,54,182,248,39,143,238,134,40,42,40,139,0,147,53,139,180,148,4,176,237,240,151,235,195,251,119,209,192,20,177,14,90,216,253,135,214,173,56,99,18,32,128,88,136,105,193,64,61,247,95,79,95,143,243,221,219,183,12,192,210,238,239,175,95,191,133,143,
|
||||
28,62,114,208,216,212,228,172,132,148,148,179,132,152,36,211,183,239,95,128,249,237,55,88,195,191,127,8,191,33,153,8,49,9,20,0,64,207,48,1,147,48,19,11,80,128,133,145,1,216,56,2,230,87,112,157,200,0,138,104,1,65,126,6,91,59,123,222,159,63,44,121,217,
|
||||
217,217,25,216,217,57,24,30,63,121,200,112,230,204,73,6,14,118,246,133,160,48,5,102,125,214,175,95,191,130,27,17,176,234,12,155,63,0,2,136,80,76,194,98,239,159,145,145,17,183,134,186,122,215,155,183,239,236,84,213,212,15,61,122,248,96,179,168,132,168,
|
||||
150,0,175,176,161,156,188,26,19,40,153,253,5,250,236,231,143,207,12,196,100,115,144,18,102,102,96,140,50,50,131,61,7,242,24,51,56,9,131,253,15,76,222,255,24,88,88,128,121,149,11,136,129,121,254,251,183,31,12,231,206,156,2,6,222,159,185,91,183,238,62,
|
||||
4,244,28,35,15,15,15,11,122,48,98,3,0,1,196,66,68,18,101,4,54,150,89,4,4,4,18,248,5,4,163,108,237,157,120,95,189,122,163,121,247,222,157,88,96,146,100,55,48,180,96,230,229,19,100,248,242,245,35,184,52,5,185,254,219,183,79,12,144,212,200,136,51,236,64,
|
||||
5,12,8,50,179,2,61,201,12,137,65,80,210,102,98,68,4,2,56,176,64,45,30,160,224,165,139,103,25,62,126,122,187,239,192,129,131,91,223,190,125,7,74,46,108,95,190,124,249,137,84,127,226,4,0,1,68,76,76,130,242,140,26,176,41,21,40,39,39,207,163,166,174,206,
|
||||
160,161,173,205,96,102,97,197,245,11,152,191,64,201,242,231,143,95,12,44,108,192,36,197,198,5,206,147,32,93,160,24,133,25,1,78,69,140,136,56,252,15,110,162,2,147,39,51,27,3,27,59,43,48,15,51,194,99,19,174,234,63,4,131,186,91,255,129,85,13,7,176,48,2,
|
||||
198,222,71,32,31,232,28,102,126,96,94,102,229,224,228,100,253,242,229,243,191,255,255,192,245,39,168,213,245,15,185,131,0,3,0,1,196,66,192,131,160,66,134,253,5,176,72,3,54,165,166,0,93,39,202,193,193,165,165,173,163,203,4,108,166,129,195,240,47,176,120,
|
||||
252,207,200,10,12,109,110,6,70,96,30,251,7,118,28,208,35,255,255,50,252,248,254,149,1,158,173,255,131,60,251,15,230,109,6,80,88,0,219,170,240,88,68,142,10,184,7,129,4,200,60,80,93,171,160,164,204,240,252,233,195,64,123,59,22,254,151,175,95,252,149,148,
|
||||
146,210,100,99,101,103,58,122,236,224,196,71,247,31,79,66,202,5,24,153,5,32,128,8,121,18,92,232,252,248,241,131,11,216,97,61,1,244,104,211,143,159,63,235,191,126,251,170,1,108,10,48,115,114,112,2,99,0,148,232,254,3,243,19,11,176,46,228,6,242,129,201,
|
||||
143,133,13,136,89,25,62,188,123,206,240,243,251,55,176,81,63,126,126,103,120,253,234,213,223,111,223,190,253,1,230,49,70,97,225,247,172,64,175,50,114,241,178,51,112,9,8,2,147,55,184,197,6,78,25,255,193,133,48,40,143,255,7,199,228,207,95,191,128,5,243,
|
||||
63,6,29,3,35,96,201,203,231,164,169,163,207,192,197,203,205,192,6,12,164,239,63,126,212,60,123,252,108,62,176,138,250,4,107,168,160,23,66,0,1,196,66,160,108,128,209,160,40,16,250,240,225,195,213,123,247,239,46,99,99,99,45,150,148,150,19,146,145,149,5,
|
||||
199,10,48,91,1,49,19,195,111,150,255,192,164,199,5,106,135,50,176,3,27,232,192,100,196,240,250,231,125,80,59,244,223,213,171,215,158,223,190,125,251,236,55,80,134,5,166,16,33,33,65,57,85,21,21,77,35,99,19,33,109,3,19,6,105,25,69,176,69,127,64,30,3,123,
|
||||
144,129,225,55,176,240,249,251,251,55,184,196,254,243,23,212,176,96,102,80,84,211,4,167,136,95,63,190,49,252,250,249,21,36,255,23,88,79,75,124,250,244,249,35,212,157,40,93,51,16,0,8,32,22,2,133,206,127,22,22,22,78,96,126,84,6,106,20,3,230,5,1,118,54,
|
||||
54,117,81,113,113,22,96,123,154,225,231,111,72,245,196,2,74,118,160,154,0,148,29,217,128,213,1,184,117,195,206,112,247,243,123,134,43,151,47,125,187,114,229,234,145,231,207,159,175,5,42,190,7,173,211,24,223,189,123,207,124,242,212,105,163,143,31,63,197,
|
||||
62,125,250,68,203,221,59,152,81,82,86,1,232,201,63,192,216,251,15,108,247,254,5,150,176,191,128,109,220,63,96,143,254,254,11,18,255,13,182,15,228,193,103,143,31,48,188,0,70,225,235,215,47,119,2,91,80,175,161,89,11,107,195,0,32,128,88,240,85,29,172,172,
|
||||
172,140,202,202,202,58,106,106,106,53,28,28,28,2,64,44,200,202,198,46,169,174,161,197,250,7,104,233,151,15,159,128,201,18,152,76,217,88,25,88,129,221,39,80,146,3,213,119,28,108,204,12,175,94,190,102,56,113,252,192,151,131,7,14,46,0,182,76,118,2,205,123,
|
||||
11,196,191,161,248,31,164,91,198,112,224,198,205,155,15,128,141,240,116,96,11,199,209,81,80,20,104,43,27,48,105,3,61,7,108,220,255,5,218,1,194,192,6,42,216,243,160,84,3,18,191,126,249,252,207,83,199,143,238,254,255,239,223,62,96,116,156,228,227,227,229,
|
||||
122,255,254,221,23,88,125,142,158,92,1,2,136,5,79,27,149,25,24,131,44,26,192,230,140,184,184,184,54,176,65,204,3,212,198,204,197,195,199,196,198,198,6,44,233,62,51,128,70,47,128,1,193,192,252,139,29,88,167,1,49,208,179,127,216,88,24,126,252,250,205,112,
|
||||
238,236,153,255,103,207,156,189,2,244,32,168,101,2,114,0,168,9,246,13,218,74,97,128,122,146,3,228,233,79,159,63,79,57,113,236,168,129,130,170,182,160,180,178,54,56,255,130,10,27,112,91,23,152,76,65,141,112,80,107,9,148,109,127,0,27,28,175,95,61,127,3,
|
||||
236,76,44,0,234,125,6,196,63,76,141,141,121,129,45,175,55,184,98,19,32,128,88,240,52,0,254,2,147,42,15,176,85,193,1,180,228,11,208,239,28,192,216,98,250,245,227,59,176,122,248,14,42,30,25,153,153,129,177,200,12,138,65,86,112,140,130,42,111,54,80,50,254,
|
||||
249,131,225,198,213,43,223,62,126,252,184,7,52,98,1,196,160,254,230,103,36,79,50,65,237,254,5,205,243,192,70,212,147,11,143,31,220,118,20,144,144,5,122,18,216,69,3,198,32,40,190,65,181,3,168,240,1,5,61,40,175,130,26,243,98,98,18,28,58,186,218,214,192,
|
||||
252,125,238,254,221,251,103,94,191,121,203,200,199,199,207,254,233,211,199,223,216,146,37,64,0,177,224,41,116,152,62,127,254,252,3,216,157,57,35,33,33,113,241,220,185,115,182,252,252,252,108,162,162,162,192,228,192,2,42,217,153,65,45,22,72,239,11,88,
|
||||
199,1,219,159,160,138,128,5,24,179,64,203,129,33,254,253,7,52,164,191,131,66,27,9,195,198,112,96,237,77,80,232,179,2,3,241,5,80,15,195,247,175,223,128,233,249,31,184,52,5,21,92,32,159,66,202,17,70,134,127,192,130,136,13,88,23,203,41,170,8,50,179,178,
|
||||
196,126,122,255,222,145,143,95,240,36,59,51,203,194,23,47,95,190,66,138,32,148,170,4,32,128,240,121,18,228,88,208,152,202,77,96,243,105,6,48,63,30,7,246,200,157,129,98,230,34,34,162,220,172,192,152,251,15,87,138,218,224,248,243,231,55,3,48,154,255,65,
|
||||
147,40,204,147,63,161,30,251,139,164,244,55,84,28,132,127,128,146,227,127,70,112,5,9,78,170,160,60,248,239,63,162,242,4,214,82,12,191,128,237,94,118,110,126,38,89,5,53,129,255,178,191,248,197,164,101,212,247,236,222,241,249,255,223,223,173,184,134,88,
|
||||
1,2,136,133,80,29,9,244,212,111,32,126,0,108,97,124,7,182,252,255,3,243,163,18,48,70,185,129,133,12,48,21,253,99,194,166,19,148,188,128,253,49,102,168,57,63,161,158,249,3,45,112,96,206,254,135,228,233,223,192,100,193,9,234,145,128,27,6,255,161,93,52,
|
||||
168,71,25,161,237,36,48,4,85,164,44,204,255,56,184,121,65,81,253,87,142,155,231,159,174,182,110,144,174,166,198,163,53,171,215,77,199,214,196,3,8,32,124,49,201,136,140,129,14,255,254,243,231,207,95,76,160,154,156,17,218,84,195,161,19,212,117,2,182,117,
|
||||
65,165,177,10,176,33,241,29,106,198,63,36,12,31,70,129,242,127,253,254,253,91,143,95,68,20,26,2,255,192,5,13,35,212,188,255,208,126,40,40,249,178,48,50,253,251,248,230,229,191,15,239,223,3,5,254,254,255,254,245,243,143,31,95,191,254,224,228,228,190,8,
|
||||
45,204,254,192,198,178,97,37,44,64,0,177,224,25,89,135,40,0,38,75,96,239,149,79,82,82,210,3,136,253,229,229,229,197,128,142,255,7,140,85,156,13,9,80,140,200,200,200,48,25,24,24,36,156,56,113,226,0,80,232,40,158,70,199,47,96,87,42,213,205,195,67,93,80,
|
||||
76,150,1,52,108,2,142,183,191,255,97,99,23,16,12,20,102,7,230,247,31,95,62,254,191,120,238,244,43,160,231,110,127,248,248,254,5,7,59,215,217,215,175,95,95,123,246,244,233,45,160,57,204,192,136,248,141,30,155,0,1,196,130,35,22,255,195,74,88,17,17,17,101,
|
||||
115,115,243,106,160,199,52,4,5,5,249,128,52,35,104,8,3,26,3,204,216,92,13,42,242,65,125,64,99,99,99,105,160,218,181,192,124,157,14,20,222,128,212,30,134,101,9,70,96,32,246,251,248,248,36,171,233,24,48,179,114,112,3,99,237,55,184,49,192,8,245,32,56,201,
|
||||
130,139,19,240,168,193,127,96,3,224,255,243,39,15,15,1,59,237,7,126,255,249,251,2,40,243,28,168,6,68,255,0,102,165,191,216,122,177,0,1,68,204,200,0,47,176,224,145,0,122,150,9,4,128,142,254,11,164,88,64,73,242,223,191,127,56,53,129,228,64,1,98,107,107,
|
||||
203,15,172,111,231,3,75,231,32,96,210,157,246,235,215,175,123,160,145,62,96,32,232,0,155,99,141,94,158,158,22,192,150,14,19,167,128,24,184,81,15,242,20,19,164,76,5,210,144,84,14,201,227,160,160,103,250,247,21,88,24,190,121,243,254,201,175,223,127,190,
|
||||
0,213,126,129,86,77,159,129,169,243,7,16,195,70,225,81,202,10,128,0,34,212,118,253,15,116,204,23,32,126,241,230,205,27,174,239,223,191,51,2,235,62,22,30,94,94,110,57,89,89,30,96,44,128,6,123,153,176,39,89,96,247,136,3,212,142,229,96,176,177,181,227,84,
|
||||
215,208,12,123,249,226,69,24,176,71,243,17,88,167,178,2,27,24,92,82,210,178,12,130,98,18,12,172,92,252,160,102,10,120,196,0,236,23,104,211,243,31,184,0,2,85,76,76,224,212,241,23,104,19,208,28,80,179,39,248,194,185,179,239,110,222,188,249,24,24,232,95,
|
||||
65,3,107,160,188,8,202,134,176,241,110,100,183,0,4,16,33,79,50,3,67,254,201,253,251,247,23,3,123,32,38,64,139,222,252,254,243,251,131,176,176,136,6,208,240,72,5,121,121,17,96,139,7,165,14,1,197,48,48,162,193,13,3,78,96,35,157,147,139,155,129,155,71,128,
|
||||
65,67,211,0,92,135,254,254,245,147,31,148,24,217,129,1,240,13,216,124,251,248,229,43,195,55,96,151,236,247,159,63,112,91,255,255,67,46,21,32,185,7,52,76,242,19,216,146,98,102,230,248,171,166,173,47,0,236,160,39,202,41,200,177,94,188,112,105,209,211,39,
|
||||
79,192,138,64,101,5,176,241,194,0,140,16,148,62,37,64,0,17,234,106,253,7,54,172,191,3,241,17,32,251,28,16,11,2,177,212,243,103,207,63,252,252,254,221,76,68,88,88,24,152,79,225,121,0,84,234,66,90,64,44,12,144,113,25,118,6,54,86,54,72,159,17,152,138,88,
|
||||
128,177,203,201,47,8,142,33,112,249,0,76,158,76,160,138,31,210,207,6,247,77,97,57,29,222,13,253,7,26,201,102,100,248,9,108,96,252,254,241,227,63,11,7,251,127,86,54,182,111,198,22,150,223,47,157,62,165,199,110,194,33,191,254,201,147,23,224,118,34,43,168,
|
||||
13,205,202,140,86,130,51,0,4,16,49,93,173,223,72,37,46,168,114,255,0,204,224,242,124,192,214,15,48,185,254,1,77,11,128,146,8,48,6,65,133,8,208,18,54,8,6,182,111,89,128,253,74,86,96,140,130,60,7,105,25,253,5,183,73,255,130,235,192,223,224,126,40,40,175,
|
||||
129,70,247,254,177,128,186,85,16,15,67,7,14,192,249,147,5,168,224,239,159,31,12,183,174,94,248,242,242,249,211,151,138,202,42,220,108,28,92,63,63,113,113,125,121,245,250,245,219,183,175,95,60,129,69,55,168,67,1,108,176,128,70,16,80,26,233,0,1,132,175,
|
||||
158,68,158,70,131,121,152,9,88,88,240,1,27,237,238,122,122,122,74,192,170,16,60,56,13,30,86,4,181,93,129,142,5,123,10,232,73,118,240,112,8,27,52,116,33,61,20,80,12,50,51,252,131,13,222,128,99,11,20,203,172,192,204,246,7,60,123,5,244,252,31,104,149,1,
|
||||
30,174,4,234,249,251,139,225,206,181,171,191,47,95,60,119,232,251,183,239,135,129,85,132,196,183,47,192,166,52,19,120,20,108,253,133,115,231,94,67,135,60,24,223,190,125,251,223,198,198,230,191,148,148,20,195,170,85,171,224,201,21,32,128,112,121,242,31,
|
||||
82,44,194,20,51,131,70,255,129,30,180,212,212,212,52,6,38,83,112,96,1,243,236,63,80,129,4,76,185,140,160,228,9,74,174,160,38,31,200,227,32,71,130,60,193,4,29,188,97,130,214,238,160,65,46,112,115,13,232,25,200,216,14,116,140,7,232,177,191,112,235,32,5,
|
||||
206,207,31,63,24,222,190,125,249,241,193,253,7,151,65,45,47,96,249,112,26,40,249,154,141,131,227,199,175,31,63,222,32,69,4,35,208,78,70,96,42,251,103,102,102,134,226,25,128,0,98,34,98,56,18,62,57,10,204,216,160,102,157,28,48,118,216,64,73,1,152,87,255,
|
||||
0,187,56,207,46,92,184,112,254,238,221,187,191,129,205,22,160,7,217,25,64,217,130,133,149,5,92,8,65,122,110,144,194,227,63,108,8,238,31,162,185,6,246,52,3,36,70,153,65,3,211,172,64,12,26,143,101,98,4,235,226,228,230,249,175,164,170,198,33,41,45,41,9,
|
||||
52,10,148,93,64,13,241,183,64,15,190,130,246,98,96,77,69,70,96,128,51,126,249,242,229,127,78,78,14,74,233,10,16,64,24,49,9,77,199,255,145,6,150,89,160,77,37,22,96,114,248,5,236,224,110,22,19,19,51,6,86,37,146,55,110,220,56,247,254,253,251,235,160,161,
|
||||
193,71,143,30,221,1,230,201,16,3,125,67,96,100,114,0,11,28,96,183,139,131,29,60,6,4,50,9,20,123,160,228,8,25,195,249,15,31,155,101,130,6,37,19,176,112,97,3,6,14,104,68,224,249,179,199,12,63,190,125,255,47,10,236,118,1,171,43,6,73,73,89,14,93,61,125,29,
|
||||
96,129,183,234,219,215,111,160,206,247,39,164,84,6,239,113,128,26,41,167,79,159,102,68,31,204,2,8,32,156,5,15,116,98,21,150,47,25,97,201,2,232,201,91,64,207,76,7,102,110,126,160,7,31,0,243,8,200,12,97,96,219,243,59,176,232,246,7,13,167,130,60,8,210,3,
|
||||
26,173,19,20,16,2,231,203,191,255,32,117,3,168,0,130,140,33,51,130,251,134,127,65,37,236,175,191,224,113,216,111,95,223,50,220,189,113,243,251,253,7,119,30,125,254,248,225,179,186,134,174,150,138,166,54,7,31,159,192,95,9,73,25,49,25,105,25,145,123,247,
|
||||
238,253,131,182,184,254,163,123,18,68,131,58,17,213,213,213,172,7,15,30,252,119,228,200,17,176,155,1,2,8,111,139,7,201,163,176,50,239,15,208,51,12,192,58,243,52,116,54,137,9,58,119,248,93,73,73,73,5,88,165,252,7,182,110,254,0,11,33,166,123,119,239,48,
|
||||
94,187,114,149,81,81,89,137,1,152,143,25,68,197,196,193,37,11,44,245,2,243,26,227,251,143,239,193,3,94,192,126,233,63,144,103,223,191,121,253,111,207,158,109,183,63,188,255,184,241,15,176,66,254,246,245,251,61,126,126,94,175,207,239,222,49,124,249,244,
|
||||
225,7,40,32,255,253,251,247,31,41,59,253,67,242,36,56,229,1,179,208,127,55,55,183,127,192,182,51,60,54,1,2,136,216,89,45,152,65,160,32,252,241,23,52,240,130,200,240,160,102,213,111,94,94,94,105,89,121,249,159,28,156,156,127,111,223,190,195,188,103,207,
|
||||
238,39,119,238,222,61,240,236,229,115,157,159,63,127,24,152,153,89,176,3,61,250,255,243,151,79,12,167,78,158,252,255,226,249,115,208,226,163,239,106,26,154,28,250,70,38,255,129,102,50,130,6,137,129,165,243,155,47,159,191,60,6,217,5,204,231,119,185,121,
|
||||
184,63,40,43,171,88,222,184,118,109,229,147,39,79,110,2,61,201,136,84,250,163,55,225,192,217,12,88,110,48,130,74,126,80,193,8,18,4,8,32,98,61,9,143,73,104,39,152,25,169,17,207,4,76,190,95,128,134,242,3,147,240,215,91,55,111,178,30,61,122,244,54,48,89,
|
||||
109,6,118,135,190,92,186,120,241,238,95,96,12,40,42,41,89,139,75,72,252,191,118,229,202,255,147,167,78,28,187,121,253,198,77,160,242,119,175,94,189,242,2,54,253,128,233,64,157,153,155,135,247,159,144,176,200,255,251,247,30,128,42,247,111,192,152,123,
|
||||
127,233,226,165,187,183,111,221,94,243,253,219,183,247,192,86,209,39,164,130,16,61,54,17,221,154,95,191,254,190,124,249,18,94,174,0,4,16,11,145,177,248,15,169,239,199,0,235,179,193,198,106,128,177,240,247,226,197,139,211,129,169,251,51,48,143,10,92,185,
|
||||
114,101,193,135,15,31,190,3,249,108,64,62,231,59,96,222,253,253,235,151,254,183,111,95,24,95,189,126,245,233,198,181,235,39,128,249,25,212,80,255,249,230,245,235,79,215,175,93,205,146,147,147,103,23,17,18,250,207,199,203,199,34,41,33,241,237,249,139,
|
||||
23,15,64,5,12,40,123,0,49,43,210,152,208,111,164,228,249,15,189,157,10,243,24,242,162,40,128,0,34,232,73,164,124,201,128,104,139,160,84,49,160,6,193,31,96,200,61,218,183,111,223,100,80,0,0,253,12,242,32,35,52,191,242,128,218,188,64,207,190,251,240,254,
|
||||
3,227,187,183,111,239,3,217,32,15,62,2,57,250,225,163,135,47,196,196,69,183,159,60,113,204,2,152,49,153,56,216,216,222,3,219,189,111,160,217,224,7,212,158,63,72,246,255,193,22,123,104,238,101,68,230,3,4,16,81,201,21,170,17,185,20,131,15,62,67,99,248,
|
||||
55,168,219,3,44,217,190,32,57,136,17,54,190,3,204,71,151,78,158,60,41,13,236,87,10,1,27,14,39,128,102,221,134,142,195,254,2,202,177,157,59,119,126,193,223,127,255,46,115,112,113,254,252,253,227,215,195,39,79,159,188,69,26,159,101,64,242,212,95,44,163,
|
||||
11,56,61,10,139,101,128,0,34,105,217,25,218,186,56,88,7,24,20,80,108,88,70,201,144,229,56,161,52,44,38,126,34,13,108,65,215,255,48,32,215,111,63,208,198,133,144,61,10,43,108,254,162,79,7,224,2,0,1,68,246,218,58,232,74,16,216,96,21,11,82,33,128,60,59,
|
||||
205,12,27,114,68,42,188,254,66,29,143,220,193,69,238,174,253,199,18,107,255,145,74,81,152,71,9,174,195,131,1,128,0,162,196,147,140,72,22,51,163,197,4,114,146,102,66,98,163,199,8,3,22,15,50,160,141,232,49,161,213,135,12,216,230,32,241,1,128,0,162,116,
|
||||
109,221,127,36,207,253,71,106,29,97,107,3,163,7,194,127,28,133,199,127,180,170,11,156,44,241,173,9,32,4,0,2,136,162,165,160,88,242,40,122,44,50,34,229,187,255,56,26,24,140,120,34,224,15,177,249,14,31,0,8,32,138,98,18,45,100,255,227,90,57,137,220,246,
|
||||
69,179,251,63,182,209,53,164,214,21,85,22,227,2,4,16,205,151,103,35,205,117,50,16,72,154,140,216,2,235,63,21,28,8,16,64,244,90,104,255,159,80,106,128,165,252,255,52,8,117,128,0,98,28,9,155,95,0,2,104,68,236,11,1,8,160,17,225,73,128,0,3,0,120,52,172,151,
|
||||
198,78,252,63,0,0,0,0,73,69,78,68,174,66,96,130,0,0 };
|
||||
|
||||
const char* prefs_misc_png = (const char*) temp_2dcb70c7;
|
||||
|
||||
|
||||
const char* getNamedResource (const char*, int&) throw();
|
||||
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()
|
||||
{
|
||||
unsigned int hash = 0;
|
||||
if (resourceNameUTF8 != 0)
|
||||
while (*resourceNameUTF8 != 0)
|
||||
hash = 31 * hash + (unsigned int) *resourceNameUTF8++;
|
||||
|
||||
switch (hash)
|
||||
{
|
||||
case 0xe23b4891: numBytes = 24218; return jules_jpg;
|
||||
case 0x496477a8: numBytes = 1819; return prefs_about_png;
|
||||
case 0x44e88a0d: numBytes = 3794; return prefs_keys_png;
|
||||
case 0xdd254505: numBytes = 6162; return prefs_misc_png;
|
||||
default: break;
|
||||
}
|
||||
|
||||
numBytes = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
/* =========================================================================================
|
||||
|
||||
This is an auto-generated file: Any edits you make may be overwritten!
|
||||
|
||||
*/
|
||||
|
||||
namespace BinaryData
|
||||
{
|
||||
extern const char* jules_jpg;
|
||||
const int jules_jpgSize = 24218;
|
||||
|
||||
extern const char* prefs_about_png;
|
||||
const int prefs_about_pngSize = 1819;
|
||||
|
||||
extern const char* prefs_keys_png;
|
||||
const int prefs_keys_pngSize = 3794;
|
||||
|
||||
extern const char* prefs_misc_png;
|
||||
const int prefs_misc_pngSize = 6162;
|
||||
|
||||
// If you provide the name of one of the binary resource variables above, this function will
|
||||
// return the corresponding data and its size (or a null pointer if the name isn't found).
|
||||
const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
|
||||
IMPORTANT! This file is auto-generated each time you save your
|
||||
project - if you alter its contents, your changes may be overwritten!
|
||||
|
||||
This is the header file that your files should include in order to get all the
|
||||
JUCE library headers. You should avoid including the JUCE headers directly in
|
||||
your own source files, because that wouldn't pick up the correct configuration
|
||||
options for your app.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __APPHEADERFILE_UY86NK__
|
||||
#define __APPHEADERFILE_UY86NK__
|
||||
|
||||
#include "AppConfig.h"
|
||||
#include "modules/juce_core/juce_core.h"
|
||||
#include "modules/juce_data_structures/juce_data_structures.h"
|
||||
#include "modules/juce_events/juce_events.h"
|
||||
#include "modules/juce_graphics/juce_graphics.h"
|
||||
#include "modules/juce_gui_basics/juce_gui_basics.h"
|
||||
#include "modules/juce_gui_extra/juce_gui_extra.h"
|
||||
#include "BinaryData.h"
|
||||
|
||||
#if ! DONT_SET_USING_JUCE_NAMESPACE
|
||||
// If your code uses a lot of JUCE classes, then this will obviously save you
|
||||
// a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE.
|
||||
using namespace juce;
|
||||
#endif
|
||||
|
||||
namespace ProjectInfo
|
||||
{
|
||||
const char* const projectName = "Jucer";
|
||||
const char* const versionString = "1.0.0";
|
||||
const int versionNumber = 0x10000;
|
||||
}
|
||||
|
||||
#endif // __APPHEADERFILE_UY86NK__
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
Important Note!!
|
||||
================
|
||||
|
||||
The purpose of this folder is to contain files that are auto-generated by the Introjucer,
|
||||
and ALL files in this folder will be mercilessly DELETED and completely re-written whenever
|
||||
the Introjucer saves your project.
|
||||
|
||||
Therefore, it's a bad idea to make any manual changes to the files in here, or to
|
||||
put any of your own files in here if you don't want to lose them. (Of course you may choose
|
||||
to add the folder's contents to your version-control system so that you can re-merge your own
|
||||
modifications after the Introjucer has saved its changes).
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This is an auto-generated file to redirect any included
|
||||
// module headers to the correct external folder.
|
||||
|
||||
#include "../../../../../modules/juce_core/juce_core.h"
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This is an auto-generated file to redirect any included
|
||||
// module headers to the correct external folder.
|
||||
|
||||
#include "../../../../../modules/juce_data_structures/juce_data_structures.h"
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This is an auto-generated file to redirect any included
|
||||
// module headers to the correct external folder.
|
||||
|
||||
#include "../../../../../modules/juce_events/juce_events.h"
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This is an auto-generated file to redirect any included
|
||||
// module headers to the correct external folder.
|
||||
|
||||
#include "../../../../../modules/juce_graphics/juce_graphics.h"
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This is an auto-generated file to redirect any included
|
||||
// module headers to the correct external folder.
|
||||
|
||||
#include "../../../../../modules/juce_gui_basics/juce_gui_basics.h"
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This is an auto-generated file to redirect any included
|
||||
// module headers to the correct external folder.
|
||||
|
||||
#include "../../../../../modules/juce_gui_extra/juce_gui_extra.h"
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
|
||||
Jucer things to do:
|
||||
====================
|
||||
|
||||
- allow colours to be specified by name
|
||||
- add password character option to textboxes
|
||||
- add a field for specifying constructor parameters for the component's base class
|
||||
- add textbox font settings
|
||||
- should be able to move graphics objects around with cursor keys, like components can be
|
||||
- ability to change some properties when more than one item is selected
|
||||
- a treeview of sub-objects and graphics elements, which can be selected
|
||||
- creation of more event handling callback code for the various types of component
|
||||
- polygon editing needs to be better and to support creating sub-paths
|
||||
- add texteditorlistener callback
|
||||
- gradient points should probably be relative to the shape they're in rather than the whole component (not sure about this though)
|
||||
- look-and-feel editing
|
||||
- add lots of code comments explaining how it all works!
|
||||
- add UI help tips for the various property editors
|
||||
- grouping components
|
||||
- component effects like drop-shadows, etc
|
||||
- some way of selecting things that are behind other things
|
||||
- add callbacks for embedded jucer comps that are buttons
|
||||
- flip + rotate of shapes
|
||||
- editor for setting component properties on any component
|
||||
- hit test alpha channel options
|
||||
- auto-scrolling when you drag the mouse
|
||||
- allow gradients to have more intermediate colours
|
||||
- menu editor
|
||||
- options for making font sizes, rounded rect corners, etc proportional
|
||||
- add a utility to create a complete set of ready-made project files for all the platforms
|
||||
- aligning selected components vertically/horizontally
|
||||
- equally distributing selected components vertically/horizontally inside their bounding rectangle.
|
||||
- a way of replacing an existing subcomponent by another one while keeping all the properties which are common to all jucer components: name, location, size, tooltip... (Right-Click->Replace->list of components)
|
||||
- allow position/size of multiple selected components to be edited with the mouse and/or by manually entering the surrounding rectangle dimensions
|
||||
|
|
@ -1,272 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<JUCERPROJECT id="Uy86Nk" name="Jucer" projectType="guiapp" version="1.0.0"
|
||||
bundleIdentifier="com.yourcompany.Jucer" jucerVersion="3.1.0">
|
||||
<EXPORTFORMATS>
|
||||
<XCODE_MAC targetFolder="Builds/MacOSX" objCExtraSuffix="wQBvzo" juceFolder="../.."
|
||||
bigIcon="HFdB13">
|
||||
<CONFIGURATIONS>
|
||||
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
|
||||
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>
|
||||
</CONFIGURATIONS>
|
||||
</XCODE_MAC>
|
||||
<VS2008 targetFolder="Builds/VisualStudio2008" libraryType="1" juceFolder="../.."
|
||||
bigIcon="HFdB13">
|
||||
<CONFIGURATIONS>
|
||||
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
|
||||
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>
|
||||
</CONFIGURATIONS>
|
||||
</VS2008>
|
||||
<VS2010 targetFolder="Builds/VisualStudio2010" libraryType="1" juceFolder="../.."
|
||||
bigIcon="HFdB13">
|
||||
<CONFIGURATIONS>
|
||||
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
|
||||
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>
|
||||
</CONFIGURATIONS>
|
||||
</VS2010>
|
||||
<LINUX_MAKE targetFolder="Builds/Linux" juceFolder="../.." bigIcon="HFdB13">
|
||||
<CONFIGURATIONS>
|
||||
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Jucer"/>
|
||||
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Jucer"/>
|
||||
</CONFIGURATIONS>
|
||||
</LINUX_MAKE>
|
||||
</EXPORTFORMATS>
|
||||
<MAINGROUP id="ba5BEZ" name="Jucer">
|
||||
<GROUP id="{417804F2-13A6-72FD-F93D-5821DBB93EBE}" name="src">
|
||||
<GROUP id="{CBEEAC5A-1CD0-80DB-7D92-99E502259E6A}" name="model">
|
||||
<GROUP id="{923E245A-E23A-E7BB-8B6A-34D5EC8F6373}" name="components">
|
||||
<FILE id="K38t3w" name="jucer_ButtonHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_ButtonHandler.h"/>
|
||||
<FILE id="PjLA9U" name="jucer_ComboBoxHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_ComboBoxHandler.h"/>
|
||||
<FILE id="hS0VIy" name="jucer_ComponentNameProperty.h" compile="0"
|
||||
resource="0" file="src/model/components/jucer_ComponentNameProperty.h"/>
|
||||
<FILE id="hrX0Jg" name="jucer_ComponentTypeHandler.cpp" compile="1"
|
||||
resource="0" file="src/model/components/jucer_ComponentTypeHandler.cpp"/>
|
||||
<FILE id="AIlV9" name="jucer_ComponentTypeHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_ComponentTypeHandler.h"/>
|
||||
<FILE id="I8iVP0" name="jucer_ComponentUndoableAction.h" compile="0"
|
||||
resource="0" file="src/model/components/jucer_ComponentUndoableAction.h"/>
|
||||
<FILE id="X8y4Ya" name="jucer_GenericComponentHandler.h" compile="0"
|
||||
resource="0" file="src/model/components/jucer_GenericComponentHandler.h"/>
|
||||
<FILE id="RMtu7i" name="jucer_GroupComponentHandler.h" compile="0"
|
||||
resource="0" file="src/model/components/jucer_GroupComponentHandler.h"/>
|
||||
<FILE id="xhwWFa" name="jucer_HyperlinkButtonHandler.h" compile="0"
|
||||
resource="0" file="src/model/components/jucer_HyperlinkButtonHandler.h"/>
|
||||
<FILE id="rx6Zde" name="jucer_ImageButtonHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_ImageButtonHandler.h"/>
|
||||
<FILE id="vSPkI" name="jucer_JucerComponentHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_JucerComponentHandler.h"/>
|
||||
<FILE id="lAIDfy" name="jucer_LabelHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_LabelHandler.h"/>
|
||||
<FILE id="tyIuLL" name="jucer_SliderHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_SliderHandler.h"/>
|
||||
<FILE id="lBt2l4" name="jucer_TabbedComponentHandler.h" compile="0"
|
||||
resource="0" file="src/model/components/jucer_TabbedComponentHandler.h"/>
|
||||
<FILE id="nGXDri" name="jucer_TextButtonHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_TextButtonHandler.h"/>
|
||||
<FILE id="q7iUTY" name="jucer_TextEditorHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_TextEditorHandler.h"/>
|
||||
<FILE id="G4a16H" name="jucer_ToggleButtonHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_ToggleButtonHandler.h"/>
|
||||
<FILE id="WFl7j" name="jucer_TreeViewHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_TreeViewHandler.h"/>
|
||||
<FILE id="qskf7" name="jucer_ViewportHandler.h" compile="0" resource="0"
|
||||
file="src/model/components/jucer_ViewportHandler.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{065049A0-0EDE-41A7-35D8-2DD5279B1808}" name="documents">
|
||||
<FILE id="DVUbt9" name="jucer_ButtonDocument.cpp" compile="1" resource="0"
|
||||
file="src/model/documents/jucer_ButtonDocument.cpp"/>
|
||||
<FILE id="rh8Gvr" name="jucer_ButtonDocument.h" compile="0" resource="0"
|
||||
file="src/model/documents/jucer_ButtonDocument.h"/>
|
||||
<FILE id="i4hFKU" name="jucer_ComponentDocument.cpp" compile="1" resource="0"
|
||||
file="src/model/documents/jucer_ComponentDocument.cpp"/>
|
||||
<FILE id="Rd3Y1h" name="jucer_ComponentDocument.h" compile="0" resource="0"
|
||||
file="src/model/documents/jucer_ComponentDocument.h"/>
|
||||
</GROUP>
|
||||
<FILE id="JR2mUS" name="jucer_BinaryResources.cpp" compile="1" resource="0"
|
||||
file="src/model/jucer_BinaryResources.cpp"/>
|
||||
<FILE id="RhrtfM" name="jucer_BinaryResources.h" compile="0" resource="0"
|
||||
file="src/model/jucer_BinaryResources.h"/>
|
||||
<FILE id="gVEYlr" name="jucer_ComponentLayout.cpp" compile="1" resource="0"
|
||||
file="src/model/jucer_ComponentLayout.cpp"/>
|
||||
<FILE id="ROW15K" name="jucer_ComponentLayout.h" compile="0" resource="0"
|
||||
file="src/model/jucer_ComponentLayout.h"/>
|
||||
<FILE id="Qe2Zld" name="jucer_GeneratedCode.cpp" compile="1" resource="0"
|
||||
file="src/model/jucer_GeneratedCode.cpp"/>
|
||||
<FILE id="BfVcdz" name="jucer_GeneratedCode.h" compile="0" resource="0"
|
||||
file="src/model/jucer_GeneratedCode.h"/>
|
||||
<FILE id="YpSEKV" name="jucer_JucerDocument.cpp" compile="1" resource="0"
|
||||
file="src/model/jucer_JucerDocument.cpp"/>
|
||||
<FILE id="lKqcWg" name="jucer_JucerDocument.h" compile="0" resource="0"
|
||||
file="src/model/jucer_JucerDocument.h"/>
|
||||
<FILE id="EVF3I6" name="jucer_ObjectTypes.cpp" compile="1" resource="0"
|
||||
file="src/model/jucer_ObjectTypes.cpp"/>
|
||||
<FILE id="KCcDsM" name="jucer_ObjectTypes.h" compile="0" resource="0"
|
||||
file="src/model/jucer_ObjectTypes.h"/>
|
||||
<FILE id="grdvqE" name="jucer_PaintRoutine.cpp" compile="1" resource="0"
|
||||
file="src/model/jucer_PaintRoutine.cpp"/>
|
||||
<FILE id="sgAl3K" name="jucer_PaintRoutine.h" compile="0" resource="0"
|
||||
file="src/model/jucer_PaintRoutine.h"/>
|
||||
<GROUP id="{4A32664F-F74C-9796-EC36-AADA599007B5}" name="paintelements">
|
||||
<FILE id="JYoD7Z" name="jucer_ColouredElement.cpp" compile="1" resource="0"
|
||||
file="src/model/paintelements/jucer_ColouredElement.cpp"/>
|
||||
<FILE id="lYggL0" name="jucer_ColouredElement.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_ColouredElement.h"/>
|
||||
<FILE id="zYlnOn" name="jucer_ElementSiblingComponent.h" compile="0"
|
||||
resource="0" file="src/model/paintelements/jucer_ElementSiblingComponent.h"/>
|
||||
<FILE id="dVs54Z" name="jucer_FillType.cpp" compile="1" resource="0"
|
||||
file="src/model/paintelements/jucer_FillType.cpp"/>
|
||||
<FILE id="dz0oow" name="jucer_FillType.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_FillType.h"/>
|
||||
<FILE id="Wrl9Ws" name="jucer_GradientPointComponent.h" compile="0"
|
||||
resource="0" file="src/model/paintelements/jucer_GradientPointComponent.h"/>
|
||||
<FILE id="v1ptpY" name="jucer_ImageResourceProperty.h" compile="0"
|
||||
resource="0" file="src/model/paintelements/jucer_ImageResourceProperty.h"/>
|
||||
<FILE id="ZklbHp" name="jucer_PaintElement.cpp" compile="1" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElement.cpp"/>
|
||||
<FILE id="DYURuh" name="jucer_PaintElement.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElement.h"/>
|
||||
<FILE id="e6h5oz" name="jucer_PaintElementEllipse.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElementEllipse.h"/>
|
||||
<FILE id="Z1wPM3" name="jucer_PaintElementGroup.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElementGroup.h"/>
|
||||
<FILE id="wbGo6N" name="jucer_PaintElementImage.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElementImage.h"/>
|
||||
<FILE id="Stmqhq" name="jucer_PaintElementPath.cpp" compile="1" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElementPath.cpp"/>
|
||||
<FILE id="czS48f" name="jucer_PaintElementPath.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElementPath.h"/>
|
||||
<FILE id="uGFtpO" name="jucer_PaintElementRectangle.h" compile="0"
|
||||
resource="0" file="src/model/paintelements/jucer_PaintElementRectangle.h"/>
|
||||
<FILE id="MnMUB5" name="jucer_PaintElementRoundedRectangle.h" compile="0"
|
||||
resource="0" file="src/model/paintelements/jucer_PaintElementRoundedRectangle.h"/>
|
||||
<FILE id="y6FdP" name="jucer_PaintElementText.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_PaintElementText.h"/>
|
||||
<FILE id="iTMbfZ" name="jucer_PaintElementUndoableAction.h" compile="0"
|
||||
resource="0" file="src/model/paintelements/jucer_PaintElementUndoableAction.h"/>
|
||||
<FILE id="ChRPXH" name="jucer_PointComponent.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_PointComponent.h"/>
|
||||
<FILE id="FGErx3" name="jucer_StrokeType.cpp" compile="1" resource="0"
|
||||
file="src/model/paintelements/jucer_StrokeType.cpp"/>
|
||||
<FILE id="ieM2FU" name="jucer_StrokeType.h" compile="0" resource="0"
|
||||
file="src/model/paintelements/jucer_StrokeType.h"/>
|
||||
</GROUP>
|
||||
</GROUP>
|
||||
<GROUP id="{149D4669-7A36-123F-FC28-865BE524612E}" name="properties">
|
||||
<FILE id="csyXZc" name="jucer_ColourPropertyComponent.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_ColourPropertyComponent.h"/>
|
||||
<FILE id="FYo9Dj" name="jucer_ComponentBooleanProperty.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_ComponentBooleanProperty.h"/>
|
||||
<FILE id="aRj3CH" name="jucer_ComponentChoiceProperty.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_ComponentChoiceProperty.h"/>
|
||||
<FILE id="UKZevC" name="jucer_ComponentColourProperty.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_ComponentColourProperty.h"/>
|
||||
<FILE id="NjfDNQ" name="jucer_ComponentTextProperty.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_ComponentTextProperty.h"/>
|
||||
<FILE id="sXr24a" name="jucer_FilePropertyComponent.cpp" compile="1"
|
||||
resource="0" file="src/properties/jucer_FilePropertyComponent.cpp"/>
|
||||
<FILE id="AV4NWc" name="jucer_FilePropertyComponent.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_FilePropertyComponent.h"/>
|
||||
<FILE id="B0QU9" name="jucer_FontPropertyComponent.cpp" compile="1"
|
||||
resource="0" file="src/properties/jucer_FontPropertyComponent.cpp"/>
|
||||
<FILE id="WZNLpi" name="jucer_FontPropertyComponent.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_FontPropertyComponent.h"/>
|
||||
<FILE id="kZlBuw" name="jucer_JustificationProperty.h" compile="0"
|
||||
resource="0" file="src/properties/jucer_JustificationProperty.h"/>
|
||||
<FILE id="BlS8kG" name="jucer_PositionPropertyBase.h" compile="0" resource="0"
|
||||
file="src/properties/jucer_PositionPropertyBase.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{E2F99C10-9ACF-85C5-8776-59E6D054035A}" name="templates">
|
||||
<FILE id="BLD0kH" name="jucer_ComponentTemplate.cpp" compile="0" resource="0"
|
||||
file="src/templates/jucer_ComponentTemplate.cpp"/>
|
||||
<FILE id="sBGQYY" name="jucer_ComponentTemplate.h" compile="0" resource="0"
|
||||
file="src/templates/jucer_ComponentTemplate.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{D059EEDE-CEF9-F85A-0AA1-C135A7F7FDD7}" name="ui">
|
||||
<FILE id="dPCSHX" name="jucer_CommandIDs.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_CommandIDs.h"/>
|
||||
<FILE id="fkmkk6" name="jucer_ComponentLayoutEditor.cpp" compile="1"
|
||||
resource="0" file="src/ui/jucer_ComponentLayoutEditor.cpp"/>
|
||||
<FILE id="dgwRZQ" name="jucer_ComponentLayoutEditor.h" compile="0"
|
||||
resource="0" file="src/ui/jucer_ComponentLayoutEditor.h"/>
|
||||
<FILE id="FO9xBr" name="jucer_ComponentLayoutPanel.cpp" compile="1"
|
||||
resource="0" file="src/ui/jucer_ComponentLayoutPanel.cpp"/>
|
||||
<FILE id="IWhxId" name="jucer_ComponentLayoutPanel.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_ComponentLayoutPanel.h"/>
|
||||
<FILE id="ei6Lh" name="jucer_ComponentOverlayComponent.cpp" compile="1"
|
||||
resource="0" file="src/ui/jucer_ComponentOverlayComponent.cpp"/>
|
||||
<FILE id="pHgXol" name="jucer_ComponentOverlayComponent.h" compile="0"
|
||||
resource="0" file="src/ui/jucer_ComponentOverlayComponent.h"/>
|
||||
<FILE id="MsSBOe" name="jucer_EditingPanelBase.cpp" compile="1" resource="0"
|
||||
file="src/ui/jucer_EditingPanelBase.cpp"/>
|
||||
<FILE id="vM4JSd" name="jucer_EditingPanelBase.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_EditingPanelBase.h"/>
|
||||
<FILE id="zNWznE" name="jucer_JucerDocumentHolder.cpp" compile="1"
|
||||
resource="0" file="src/ui/jucer_JucerDocumentHolder.cpp"/>
|
||||
<FILE id="XeOAyl" name="jucer_JucerDocumentHolder.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_JucerDocumentHolder.h"/>
|
||||
<FILE id="u9rXvh" name="jucer_MainWindow.cpp" compile="1" resource="0"
|
||||
file="src/ui/jucer_MainWindow.cpp"/>
|
||||
<FILE id="ddW3EL" name="jucer_MainWindow.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_MainWindow.h"/>
|
||||
<FILE id="PUW77Z" name="jucer_PaintRoutineEditor.cpp" compile="1" resource="0"
|
||||
file="src/ui/jucer_PaintRoutineEditor.cpp"/>
|
||||
<FILE id="bspjJy" name="jucer_PaintRoutineEditor.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_PaintRoutineEditor.h"/>
|
||||
<FILE id="merXod" name="jucer_PaintRoutinePanel.cpp" compile="1" resource="0"
|
||||
file="src/ui/jucer_PaintRoutinePanel.cpp"/>
|
||||
<FILE id="wm7Qum" name="jucer_PaintRoutinePanel.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_PaintRoutinePanel.h"/>
|
||||
<FILE id="L37nKz" name="jucer_PrefsPanel.cpp" compile="1" resource="0"
|
||||
file="src/ui/jucer_PrefsPanel.cpp"/>
|
||||
<FILE id="N9uuzW" name="jucer_PrefsPanel.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_PrefsPanel.h"/>
|
||||
<FILE id="MChgPJ" name="jucer_ResourceEditorPanel.cpp" compile="1"
|
||||
resource="0" file="src/ui/jucer_ResourceEditorPanel.cpp"/>
|
||||
<FILE id="t307Af" name="jucer_ResourceEditorPanel.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_ResourceEditorPanel.h"/>
|
||||
<FILE id="gbS9cJ" name="jucer_SnapGridPainter.cpp" compile="1" resource="0"
|
||||
file="src/ui/jucer_SnapGridPainter.cpp"/>
|
||||
<FILE id="afYG0B" name="jucer_SnapGridPainter.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_SnapGridPainter.h"/>
|
||||
<FILE id="BM8LBg" name="jucer_TestComponent.cpp" compile="1" resource="0"
|
||||
file="src/ui/jucer_TestComponent.cpp"/>
|
||||
<FILE id="JG2dAT" name="jucer_TestComponent.h" compile="0" resource="0"
|
||||
file="src/ui/jucer_TestComponent.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{C7C6BA2D-6E42-C323-497D-82254877017F}" name="utility">
|
||||
<FILE id="tDZW9q" name="jucer_ColourEditorComponent.h" compile="0"
|
||||
resource="0" file="src/utility/jucer_ColourEditorComponent.h"/>
|
||||
<FILE id="yYoqPB" name="jucer_Colours.h" compile="0" resource="0" file="src/utility/jucer_Colours.h"/>
|
||||
<FILE id="YaaPTF" name="jucer_StoredSettings.cpp" compile="1" resource="0"
|
||||
file="src/utility/jucer_StoredSettings.cpp"/>
|
||||
<FILE id="izi1dD" name="jucer_StoredSettings.h" compile="0" resource="0"
|
||||
file="src/utility/jucer_StoredSettings.h"/>
|
||||
<FILE id="iGQuHc" name="jucer_UtilityFunctions.cpp" compile="1" resource="0"
|
||||
file="src/utility/jucer_UtilityFunctions.cpp"/>
|
||||
<FILE id="ziqgIg" name="jucer_UtilityFunctions.h" compile="0" resource="0"
|
||||
file="src/utility/jucer_UtilityFunctions.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{DDB85FEF-DE4B-BF1D-6446-151070FA7D34}" name="binarydata">
|
||||
<FILE id="HFdB13" name="juce_icon.png" compile="0" resource="0" file="src/binarydata/juce_icon.png"/>
|
||||
<FILE id="Yrnydj" name="jules.jpg" compile="0" resource="1" file="src/binarydata/jules.jpg"/>
|
||||
<FILE id="Roq6vP" name="prefs_about.png" compile="0" resource="1" file="src/binarydata/prefs_about.png"/>
|
||||
<FILE id="VDx5J1" name="prefs_keys.png" compile="0" resource="1" file="src/binarydata/prefs_keys.png"/>
|
||||
<FILE id="HkKHwW" name="prefs_misc.png" compile="0" resource="1" file="src/binarydata/prefs_misc.png"/>
|
||||
</GROUP>
|
||||
<FILE id="VaW1a5" name="jucer_Main.cpp" compile="1" resource="0" file="src/jucer_Main.cpp"/>
|
||||
<FILE id="qrek85" name="jucer_Headers.h" compile="0" resource="0" file="src/jucer_Headers.h"/>
|
||||
</GROUP>
|
||||
</MAINGROUP>
|
||||
<MODULES>
|
||||
<MODULE id="juce_core" showAllCode="1"/>
|
||||
<MODULE id="juce_events" showAllCode="1"/>
|
||||
<MODULE id="juce_graphics" showAllCode="1"/>
|
||||
<MODULE id="juce_data_structures" showAllCode="1"/>
|
||||
<MODULE id="juce_gui_basics" showAllCode="1"/>
|
||||
<MODULE id="juce_gui_extra" showAllCode="1"/>
|
||||
<MODULE id="juce_gui_audio" showAllCode="1"/>
|
||||
</MODULES>
|
||||
<JUCEOPTIONS/>
|
||||
</JUCERPROJECT>
|
||||
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 6 KiB |
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_HEADERS_JUCEHEADER__
|
||||
#define __JUCER_HEADERS_JUCEHEADER__
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable: 4100 4505)
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#define JUCER_MAJOR_VERSION 1
|
||||
#define JUCER_MINOR_VERSION 12
|
||||
|
||||
//==============================================================================
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "utility/jucer_StoredSettings.h"
|
||||
#include "utility/jucer_UtilityFunctions.h"
|
||||
#include "ui/jucer_CommandIDs.h"
|
||||
|
||||
//==============================================================================
|
||||
const int editorEdgeGap = 4;
|
||||
const int numSwatchColours = 24;
|
||||
|
||||
extern ApplicationCommandManager* commandManager;
|
||||
|
||||
|
||||
#endif // __JUCER_HEADERS_JUCEHEADER__
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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 "jucer_Headers.h"
|
||||
#include "ui/jucer_MainWindow.h"
|
||||
|
||||
ApplicationCommandManager* commandManager = 0;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
class JucerApplication : public JUCEApplication
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
JucerApplication()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void initialise (const String& commandLine)
|
||||
{
|
||||
commandManager = new ApplicationCommandManager();
|
||||
|
||||
theMainWindow = new MainWindow();
|
||||
theMainWindow->setVisible (true);
|
||||
|
||||
ImageCache::setCacheTimeout (30 * 1000);
|
||||
|
||||
if (commandLine.trim().isNotEmpty()
|
||||
&& ! commandLine.trim().startsWithChar ('-'))
|
||||
anotherInstanceStarted (commandLine);
|
||||
}
|
||||
|
||||
void shutdown()
|
||||
{
|
||||
theMainWindow = nullptr;
|
||||
|
||||
deleteAndZero (commandManager);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void systemRequestedQuit()
|
||||
{
|
||||
if (theMainWindow == nullptr || theMainWindow->closeAllDocuments())
|
||||
{
|
||||
theMainWindow = nullptr;
|
||||
StoredSettings::deleteInstance();
|
||||
quit();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String getApplicationName()
|
||||
{
|
||||
return "The Jucer";
|
||||
}
|
||||
|
||||
const String getApplicationVersion()
|
||||
{
|
||||
return String (JUCER_MAJOR_VERSION) + "." + String (JUCER_MINOR_VERSION);
|
||||
}
|
||||
|
||||
bool moreThanOneInstanceAllowed()
|
||||
{
|
||||
#ifndef JUCE_LINUX
|
||||
return false;
|
||||
#else
|
||||
return true; //xxx should be false but doesn't work on linux..
|
||||
#endif
|
||||
}
|
||||
|
||||
void anotherInstanceStarted (const String& commandLine)
|
||||
{
|
||||
if (theMainWindow != nullptr && commandLine.unquoted().isNotEmpty())
|
||||
theMainWindow->openFile (commandLine.unquoted());
|
||||
}
|
||||
|
||||
private:
|
||||
ScopedPointer<MainWindow> theMainWindow;
|
||||
};
|
||||
|
||||
|
||||
START_JUCE_APPLICATION(JucerApplication)
|
||||
|
|
@ -1,396 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_BUTTONHANDLER_JUCEHEADER__
|
||||
#define __JUCER_BUTTONHANDLER_JUCEHEADER__
|
||||
|
||||
#include "../../properties/jucer_ComponentChoiceProperty.h"
|
||||
#include "../../properties/jucer_ComponentTextProperty.h"
|
||||
#include "../../properties/jucer_ComponentBooleanProperty.h"
|
||||
#include "jucer_ComponentUndoableAction.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ButtonHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ButtonHandler (const String& typeDescription_,
|
||||
const String& className_,
|
||||
const std::type_info& componentClass,
|
||||
const int defaultWidth_,
|
||||
const int defaultHeight_)
|
||||
: ComponentTypeHandler (typeDescription_, className_, componentClass,
|
||||
defaultWidth_, defaultHeight_)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
Button* const b = dynamic_cast <Button*> (component);
|
||||
|
||||
properties.add (new ButtonTextProperty (b, document));
|
||||
|
||||
properties.add (new ButtonCallbackProperty (b, document));
|
||||
|
||||
properties.add (new ButtonRadioGroupProperty (b, document));
|
||||
|
||||
properties.add (new ButtonConnectedEdgeProperty ("connected left", Button::ConnectedOnLeft, b, document));
|
||||
properties.add (new ButtonConnectedEdgeProperty ("connected right", Button::ConnectedOnRight, b, document));
|
||||
properties.add (new ButtonConnectedEdgeProperty ("connected top", Button::ConnectedOnTop, b, document));
|
||||
properties.add (new ButtonConnectedEdgeProperty ("connected bottom", Button::ConnectedOnBottom, b, document));
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
Button* const b = dynamic_cast <Button*> (comp);
|
||||
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
e->setAttribute ("buttonText", b->getButtonText());
|
||||
e->setAttribute ("connectedEdges", b->getConnectedEdgeFlags());
|
||||
e->setAttribute ("needsCallback", needsButtonListener (b));
|
||||
e->setAttribute ("radioGroupId", b->getRadioGroupId());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
Button* const b = dynamic_cast <Button*> (comp);
|
||||
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
b->setButtonText (xml.getStringAttribute ("buttonText", b->getButtonText()));
|
||||
b->setConnectedEdges (xml.getIntAttribute ("connectedEdges", 0));
|
||||
setNeedsButtonListener (b, xml.getBoolAttribute ("needsCallback", true));
|
||||
b->setRadioGroupId (xml.getIntAttribute ("radioGroupId", 0));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* component)
|
||||
{
|
||||
return quotedString (component->getName());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
Button* const b = dynamic_cast <Button*> (component);
|
||||
|
||||
if (b->getButtonText() != b->getName())
|
||||
{
|
||||
code.constructorCode
|
||||
<< memberVariableName << "->setButtonText ("
|
||||
<< quotedString (b->getButtonText()) << ");\n";
|
||||
}
|
||||
|
||||
if (b->getConnectedEdgeFlags() != 0)
|
||||
{
|
||||
StringArray flags;
|
||||
|
||||
if (b->isConnectedOnLeft())
|
||||
flags.add ("Button::ConnectedOnLeft");
|
||||
|
||||
if (b->isConnectedOnRight())
|
||||
flags.add ("Button::ConnectedOnRight");
|
||||
|
||||
if (b->isConnectedOnTop())
|
||||
flags.add ("Button::ConnectedOnTop");
|
||||
|
||||
if (b->isConnectedOnBottom())
|
||||
flags.add ("Button::ConnectedOnBottom");
|
||||
|
||||
String s;
|
||||
s << memberVariableName << "->setConnectedEdges ("
|
||||
<< flags.joinIntoString (" | ") << ");\n";
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
if (b->getRadioGroupId() != 0)
|
||||
code.constructorCode << memberVariableName << "->setRadioGroupId ("
|
||||
<< b->getRadioGroupId() << ");\n";
|
||||
|
||||
if (needsButtonListener (component))
|
||||
code.constructorCode << memberVariableName << "->addListener (this);\n";
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (Component* component, GeneratedCode& code)
|
||||
{
|
||||
ComponentTypeHandler::fillInGeneratedCode (component, code);
|
||||
|
||||
if (needsButtonListener (component))
|
||||
{
|
||||
String& callback = code.getCallbackCode ("public ButtonListener",
|
||||
"void",
|
||||
"buttonClicked (Button* buttonThatWasClicked)",
|
||||
true);
|
||||
|
||||
if (callback.isNotEmpty())
|
||||
callback << "else ";
|
||||
|
||||
const String memberVariableName (code.document->getComponentLayout()->getComponentMemberVariableName (component));
|
||||
const String userCodeComment ("UserButtonCode_" + memberVariableName);
|
||||
|
||||
callback
|
||||
<< "if (buttonThatWasClicked == " << memberVariableName
|
||||
<< ")\n{\n //[" << userCodeComment << "] -- add your button handler code here..\n //[/" << userCodeComment << "]\n}\n";
|
||||
}
|
||||
}
|
||||
|
||||
static bool needsButtonListener (Component* button)
|
||||
{
|
||||
return button->getProperties().getWithDefault ("generateListenerCallback", true);
|
||||
}
|
||||
|
||||
static void setNeedsButtonListener (Component* button, const bool shouldDoCallback)
|
||||
{
|
||||
button->getProperties().set ("generateListenerCallback", shouldDoCallback);
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class ButtonTextProperty : public ComponentTextProperty <Button>
|
||||
{
|
||||
public:
|
||||
ButtonTextProperty (Button* button_, JucerDocument& document_)
|
||||
: ComponentTextProperty <Button> ("text", 100, false, button_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ButtonTextChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change button text");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getButtonText();
|
||||
}
|
||||
|
||||
private:
|
||||
class ButtonTextChangeAction : public ComponentUndoableAction <Button>
|
||||
{
|
||||
public:
|
||||
ButtonTextChangeAction (Button* const comp, ComponentLayout& layout, const String& newName_)
|
||||
: ComponentUndoableAction <Button> (comp, layout),
|
||||
newName (newName_)
|
||||
{
|
||||
oldName = comp->getButtonText();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setButtonText (newName);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setButtonText (oldName);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newName, oldName;
|
||||
};
|
||||
};
|
||||
|
||||
class ButtonCallbackProperty : public ComponentBooleanProperty <Button>
|
||||
{
|
||||
public:
|
||||
ButtonCallbackProperty (Button* button, JucerDocument& document)
|
||||
: ComponentBooleanProperty <Button> ("callback", "Generate ButtonListener", "Generate ButtonListener", button, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new ButtonCallbackChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change button callback");
|
||||
}
|
||||
|
||||
bool getState() const { return needsButtonListener (component); }
|
||||
|
||||
private:
|
||||
class ButtonCallbackChangeAction : public ComponentUndoableAction <Button>
|
||||
{
|
||||
public:
|
||||
ButtonCallbackChangeAction (Button* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <Button> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = needsButtonListener (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
setNeedsButtonListener (getComponent(), newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
setNeedsButtonListener (getComponent(), oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
class ButtonRadioGroupProperty : public ComponentTextProperty <Button>
|
||||
{
|
||||
public:
|
||||
ButtonRadioGroupProperty (Button* const button_, JucerDocument& document_)
|
||||
: ComponentTextProperty <Button> ("radio group", 10, false, button_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ButtonRadioGroupChangeAction (component, *document.getComponentLayout(), newText.getIntValue()),
|
||||
"Change radio group ID");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return String (component->getRadioGroupId());
|
||||
}
|
||||
|
||||
private:
|
||||
class ButtonRadioGroupChangeAction : public ComponentUndoableAction <Button>
|
||||
{
|
||||
public:
|
||||
ButtonRadioGroupChangeAction (Button* const comp, ComponentLayout& layout, const int newId_)
|
||||
: ComponentUndoableAction <Button> (comp, layout),
|
||||
newId (newId_)
|
||||
{
|
||||
oldId = comp->getRadioGroupId();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setRadioGroupId (newId);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setRadioGroupId (oldId);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
int newId, oldId;
|
||||
};
|
||||
};
|
||||
|
||||
class ButtonConnectedEdgeProperty : public ComponentBooleanProperty <Button>
|
||||
{
|
||||
public:
|
||||
ButtonConnectedEdgeProperty (const String& name, const int flag_,
|
||||
Button* button, JucerDocument& document)
|
||||
: ComponentBooleanProperty <Button> (name, "Connected", "Connected", button, document),
|
||||
flag (flag_)
|
||||
{
|
||||
}
|
||||
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new ButtonConnectedChangeAction (component, *document.getComponentLayout(), flag, newState),
|
||||
"Change button connected edges");
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return (component->getConnectedEdgeFlags() & flag) != 0;
|
||||
}
|
||||
|
||||
private:
|
||||
const int flag;
|
||||
|
||||
class ButtonConnectedChangeAction : public ComponentUndoableAction <Button>
|
||||
{
|
||||
public:
|
||||
ButtonConnectedChangeAction (Button* const comp, ComponentLayout& layout, const int flag_, const bool newState_)
|
||||
: ComponentUndoableAction <Button> (comp, layout),
|
||||
flag (flag_),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = ((comp->getConnectedEdgeFlags() & flag) != 0);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
|
||||
if (newState)
|
||||
getComponent()->setConnectedEdges (getComponent()->getConnectedEdgeFlags() | flag);
|
||||
else
|
||||
getComponent()->setConnectedEdges (getComponent()->getConnectedEdgeFlags() & ~flag);
|
||||
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
|
||||
if (oldState)
|
||||
getComponent()->setConnectedEdges (getComponent()->getConnectedEdgeFlags() | flag);
|
||||
else
|
||||
getComponent()->setConnectedEdges (getComponent()->getConnectedEdgeFlags() & ~flag);
|
||||
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
const int flag;
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_BUTTONHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,445 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMBOBOXHANDLER_JUCEHEADER__
|
||||
#define __JUCER_COMBOBOXHANDLER_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ComboBoxHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ComboBoxHandler()
|
||||
: ComponentTypeHandler ("Combo Box", "ComboBox", typeid (ComboBox), 150, 24)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new ComboBox ("new combo box");
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
ComboBox* const c = dynamic_cast <ComboBox*> (comp);
|
||||
jassert (c != 0);
|
||||
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
|
||||
e->setAttribute ("editable", c->isTextEditable());
|
||||
e->setAttribute ("layout", c->getJustificationType().getFlags());
|
||||
e->setAttribute ("items", c->getProperties() ["items"].toString());
|
||||
e->setAttribute ("textWhenNonSelected", c->getTextWhenNothingSelected());
|
||||
e->setAttribute ("textWhenNoItems", c->getTextWhenNoChoicesAvailable());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
ComboBox defaultBox (String::empty);
|
||||
|
||||
ComboBox* const c = dynamic_cast <ComboBox*> (comp);
|
||||
jassert (c != 0);
|
||||
|
||||
c->setEditableText (xml.getBoolAttribute ("editable", defaultBox.isTextEditable()));
|
||||
c->setJustificationType (Justification (xml.getIntAttribute ("layout", defaultBox.getJustificationType().getFlags())));
|
||||
c->getProperties().set ("items", xml.getStringAttribute ("items", String::empty));
|
||||
c->setTextWhenNothingSelected (xml.getStringAttribute ("textWhenNonSelected", defaultBox.getTextWhenNothingSelected()));
|
||||
c->setTextWhenNoChoicesAvailable (xml.getStringAttribute ("textWhenNoItems", defaultBox.getTextWhenNoChoicesAvailable()));
|
||||
|
||||
updateItems (c);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
ComboBox* const c = dynamic_cast <ComboBox*> (component);
|
||||
jassert (c != 0);
|
||||
|
||||
properties.add (new ComboItemsProperty (c, document));
|
||||
properties.add (new ComboEditableProperty (c, document));
|
||||
properties.add (new ComboJustificationProperty (c, document));
|
||||
properties.add (new ComboTextWhenNoneSelectedProperty (c, document));
|
||||
properties.add (new ComboTextWhenNoItemsProperty (c, document));
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* component)
|
||||
{
|
||||
return quotedString (component->getName());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
ComboBox* const c = dynamic_cast <ComboBox*> (component);
|
||||
jassert (c != 0);
|
||||
|
||||
String s;
|
||||
s << memberVariableName << "->setEditableText (" << boolToString (c->isTextEditable()) << ");\n"
|
||||
<< memberVariableName << "->setJustificationType (" << justificationToCode (c->getJustificationType()) << ");\n"
|
||||
<< memberVariableName << "->setTextWhenNothingSelected (" << quotedString (c->getTextWhenNothingSelected()) << ");\n"
|
||||
<< memberVariableName << "->setTextWhenNoChoicesAvailable (" << quotedString (c->getTextWhenNoChoicesAvailable()) << ");\n";
|
||||
|
||||
StringArray lines;
|
||||
lines.addLines (c->getProperties() ["items"].toString());
|
||||
int itemId = 1;
|
||||
|
||||
for (int i = 0; i < lines.size(); ++i)
|
||||
{
|
||||
if (lines[i].trim().isEmpty())
|
||||
s << memberVariableName << "->addSeparator();\n";
|
||||
else
|
||||
s << memberVariableName << "->addItem ("
|
||||
<< quotedString (lines[i]) << ", " << itemId++ << ");\n";
|
||||
}
|
||||
|
||||
if (needsCallback (component))
|
||||
s << memberVariableName << "->addListener (this);\n";
|
||||
|
||||
s << '\n';
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (Component* component, GeneratedCode& code)
|
||||
{
|
||||
ComponentTypeHandler::fillInGeneratedCode (component, code);
|
||||
|
||||
if (needsCallback (component))
|
||||
{
|
||||
String& callback = code.getCallbackCode ("public ComboBoxListener",
|
||||
"void",
|
||||
"comboBoxChanged (ComboBox* comboBoxThatHasChanged)",
|
||||
true);
|
||||
|
||||
if (callback.trim().isNotEmpty())
|
||||
callback << "else ";
|
||||
|
||||
const String memberVariableName (code.document->getComponentLayout()->getComponentMemberVariableName (component));
|
||||
const String userCodeComment ("UserComboBoxCode_" + memberVariableName);
|
||||
|
||||
callback
|
||||
<< "if (comboBoxThatHasChanged == " << memberVariableName
|
||||
<< ")\n{\n //[" << userCodeComment << "] -- add your combo box handling code here..\n //[/" << userCodeComment << "]\n}\n";
|
||||
}
|
||||
}
|
||||
|
||||
static void updateItems (ComboBox* c)
|
||||
{
|
||||
StringArray lines;
|
||||
lines.addLines (c->getProperties() ["items"].toString());
|
||||
|
||||
c->clear();
|
||||
int itemId = 1;
|
||||
|
||||
for (int i = 0; i < lines.size(); ++i)
|
||||
{
|
||||
if (lines[i].trim().isEmpty())
|
||||
c->addSeparator();
|
||||
else
|
||||
c->addItem (lines[i], itemId++);
|
||||
}
|
||||
}
|
||||
|
||||
static bool needsCallback (Component* slider)
|
||||
{
|
||||
return true; // xxx should be configurable
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class ComboEditableProperty : public ComponentBooleanProperty <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboEditableProperty (ComboBox* component_, JucerDocument& document_)
|
||||
: ComponentBooleanProperty <ComboBox> ("editable", "Text is editable", "Text is editable", component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new ComboEditableChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change combo box editability");
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return component->isTextEditable();
|
||||
}
|
||||
|
||||
private:
|
||||
class ComboEditableChangeAction : public ComponentUndoableAction <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboEditableChangeAction (ComboBox* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <ComboBox> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isTextEditable();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setEditableText (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setEditableText (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ComboJustificationProperty : public JustificationProperty
|
||||
{
|
||||
public:
|
||||
ComboJustificationProperty (ComboBox* component_, JucerDocument& document_)
|
||||
: JustificationProperty ("text layout", false),
|
||||
component (component_),
|
||||
document (document_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setJustification (const Justification& newJustification)
|
||||
{
|
||||
document.perform (new ComboJustifyChangeAction (component, *document.getComponentLayout(), newJustification),
|
||||
"Change combo box justification");
|
||||
}
|
||||
|
||||
const Justification getJustification() const { return component->getJustificationType(); }
|
||||
|
||||
private:
|
||||
ComboBox* const component;
|
||||
JucerDocument& document;
|
||||
|
||||
class ComboJustifyChangeAction : public ComponentUndoableAction <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboJustifyChangeAction (ComboBox* const comp, ComponentLayout& layout, const Justification& newState_)
|
||||
: ComponentUndoableAction <ComboBox> (comp, layout),
|
||||
newState (newState_),
|
||||
oldState (comp->getJustificationType())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setJustificationType (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setJustificationType (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
Justification newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ComboItemsProperty : public ComponentTextProperty <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboItemsProperty (ComboBox* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <ComboBox> ("items", 10000, true, component_, document_)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ComboItemsChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change combo box items");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getProperties() ["items"];
|
||||
}
|
||||
|
||||
private:
|
||||
class ComboItemsChangeAction : public ComponentUndoableAction <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboItemsChangeAction (ComboBox* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <ComboBox> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getProperties() ["items"];
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->getProperties().set ("items", newState);
|
||||
ComboBoxHandler::updateItems (getComponent());
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->getProperties().set ("items", oldState);
|
||||
ComboBoxHandler::updateItems (getComponent());
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ComboTextWhenNoneSelectedProperty : public ComponentTextProperty <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboTextWhenNoneSelectedProperty (ComboBox* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <ComboBox> ("text when none selected", 200, false, component_, document_)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ComboNonSelTextChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change combo box text when nothing selected");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getTextWhenNothingSelected();
|
||||
}
|
||||
|
||||
private:
|
||||
class ComboNonSelTextChangeAction : public ComponentUndoableAction <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboNonSelTextChangeAction (ComboBox* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <ComboBox> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getTextWhenNothingSelected();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextWhenNothingSelected (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextWhenNothingSelected (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ComboTextWhenNoItemsProperty : public ComponentTextProperty <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboTextWhenNoItemsProperty (ComboBox* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <ComboBox> ("text when no items", 200, false, component_, document_)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ComboNoItemTextChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change combo box 'no items' text");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getTextWhenNoChoicesAvailable();
|
||||
}
|
||||
|
||||
private:
|
||||
class ComboNoItemTextChangeAction : public ComponentUndoableAction <ComboBox>
|
||||
{
|
||||
public:
|
||||
ComboNoItemTextChangeAction (ComboBox* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <ComboBox> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getTextWhenNoChoicesAvailable();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextWhenNoChoicesAvailable (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextWhenNoChoicesAvailable (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMBOBOXHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTNAMEPROPERTY_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTNAMEPROPERTY_JUCEHEADER__
|
||||
|
||||
#include "jucer_ComponentTypeHandler.h"
|
||||
#include "jucer_ComponentUndoableAction.h"
|
||||
#include "../../properties/jucer_ComponentTextProperty.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ComponentNameProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentNameProperty (Component* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <Component> ("name", 40, false, component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
~ComponentNameProperty()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new CompNameChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change component name");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getName();
|
||||
}
|
||||
|
||||
private:
|
||||
class CompNameChangeAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
CompNameChangeAction (Component* const comp, ComponentLayout& layout, const String& newName_)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
newName (newName_)
|
||||
{
|
||||
oldName = comp->getName();
|
||||
}
|
||||
|
||||
~CompNameChangeAction() {}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setName (newName);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setName (oldName);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newName, oldName;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ComponentMemberNameProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentMemberNameProperty (Component* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <Component> ("member name", 40, false, component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
~ComponentMemberNameProperty()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new CompMemberNameChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change component member name");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return document.getComponentLayout()->getComponentMemberVariableName (component);
|
||||
}
|
||||
|
||||
private:
|
||||
class CompMemberNameChangeAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
CompMemberNameChangeAction (Component* const comp, ComponentLayout& layout, const String& newName_)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
newName (newName_)
|
||||
{
|
||||
oldName = layout.getComponentMemberVariableName (comp);
|
||||
}
|
||||
|
||||
~CompMemberNameChangeAction() {}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.setComponentMemberVariableName (getComponent(), newName);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.setComponentMemberVariableName (getComponent(), oldName);
|
||||
return true;
|
||||
}
|
||||
|
||||
String newName, oldName;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ComponentVirtualClassProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentVirtualClassProperty (Component* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <Component> ("virtual class", 40, false, component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
~ComponentVirtualClassProperty()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new CompVirtualClassChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change component virtual class name");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return document.getComponentLayout()->getComponentVirtualClassName (component);
|
||||
}
|
||||
|
||||
private:
|
||||
class CompVirtualClassChangeAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
CompVirtualClassChangeAction (Component* const comp, ComponentLayout& layout, const String& newName_)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
newName (newName_)
|
||||
{
|
||||
oldName = layout.getComponentVirtualClassName (comp);
|
||||
}
|
||||
|
||||
~CompVirtualClassChangeAction() {}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.setComponentVirtualClassName (getComponent(), newName);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.setComponentVirtualClassName (getComponent(), oldName);
|
||||
return true;
|
||||
}
|
||||
|
||||
String newName, oldName;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTNAMEPROPERTY_JUCEHEADER__
|
||||
|
|
@ -1,589 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../../jucer_Headers.h"
|
||||
#include "../jucer_ObjectTypes.h"
|
||||
#include "../../ui/jucer_ComponentOverlayComponent.h"
|
||||
#include "jucer_ComponentNameProperty.h"
|
||||
#include "../../properties/jucer_PositionPropertyBase.h"
|
||||
#include "../../properties/jucer_ComponentColourProperty.h"
|
||||
#include "../../ui/jucer_TestComponent.h"
|
||||
|
||||
#if JUCE_MSVC
|
||||
#define type_name raw_name
|
||||
#else
|
||||
#define type_name name
|
||||
#endif
|
||||
|
||||
|
||||
//==============================================================================
|
||||
ComponentTypeHandler::ComponentTypeHandler (const String& typeName_,
|
||||
const String& className_,
|
||||
const std::type_info& componentClass_,
|
||||
const int defaultWidth_,
|
||||
const int defaultHeight_)
|
||||
: typeName (typeName_),
|
||||
className (className_),
|
||||
componentClassRawName (componentClass_.type_name()),
|
||||
defaultWidth (defaultWidth_),
|
||||
defaultHeight (defaultHeight_)
|
||||
{
|
||||
}
|
||||
|
||||
ComponentTypeHandler::~ComponentTypeHandler()
|
||||
{
|
||||
}
|
||||
|
||||
Component* ComponentTypeHandler::createCopyOf (JucerDocument* document, Component& existing)
|
||||
{
|
||||
jassert (getHandlerFor (existing) == this);
|
||||
|
||||
Component* const newOne = createNewComponent (document);
|
||||
ScopedPointer<XmlElement> xml (createXmlFor (&existing, document->getComponentLayout()));
|
||||
|
||||
if (xml != nullptr)
|
||||
restoreFromXml (*xml, newOne, document->getComponentLayout());
|
||||
|
||||
return newOne;
|
||||
}
|
||||
|
||||
ComponentOverlayComponent* ComponentTypeHandler::createOverlayComponent (Component* child, ComponentLayout& layout)
|
||||
{
|
||||
return new ComponentOverlayComponent (child, layout);
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::showPopupMenu (Component* component,
|
||||
ComponentLayout& layout)
|
||||
{
|
||||
PopupMenu m;
|
||||
|
||||
m.addCommandItem (commandManager, CommandIDs::toFront);
|
||||
m.addCommandItem (commandManager, CommandIDs::toBack);
|
||||
m.addSeparator();
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::cut);
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::copy);
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::paste);
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::del);
|
||||
|
||||
m.show();
|
||||
}
|
||||
|
||||
JucerDocument* ComponentTypeHandler::findParentDocument (Component* component)
|
||||
{
|
||||
Component* p = component->getParentComponent();
|
||||
|
||||
while (p != 0)
|
||||
{
|
||||
JucerDocumentHolder* const dh = dynamic_cast <JucerDocumentHolder*> (p);
|
||||
|
||||
if (dh != 0)
|
||||
return dh->getDocument();
|
||||
|
||||
TestComponent* const t = dynamic_cast <TestComponent*> (p);
|
||||
|
||||
if (t != 0)
|
||||
return t->getDocument();
|
||||
|
||||
p = p->getParentComponent();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool ComponentTypeHandler::canHandle (Component& component) const
|
||||
{
|
||||
return componentClassRawName == String (typeid (component).type_name());
|
||||
}
|
||||
|
||||
ComponentTypeHandler* ComponentTypeHandler::getHandlerFor (Component& component)
|
||||
{
|
||||
for (int i = 0; i < ObjectTypes::numComponentTypes; ++i)
|
||||
if (ObjectTypes::componentTypeHandlers[i]->canHandle (component))
|
||||
return ObjectTypes::componentTypeHandlers[i];
|
||||
|
||||
jassertfalse
|
||||
return 0;
|
||||
}
|
||||
|
||||
ComponentTypeHandler* ComponentTypeHandler::getHandlerForXmlTag (const String& tagName)
|
||||
{
|
||||
for (int i = 0; i < ObjectTypes::numComponentTypes; ++i)
|
||||
if (ObjectTypes::componentTypeHandlers[i]->getXmlTagName().equalsIgnoreCase (tagName))
|
||||
return ObjectTypes::componentTypeHandlers[i];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
XmlElement* ComponentTypeHandler::createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
XmlElement* e = new XmlElement (getXmlTagName());
|
||||
|
||||
e->setAttribute ("name", comp->getName());
|
||||
e->setAttribute ("id", String::toHexString (getComponentId (comp)));
|
||||
e->setAttribute ("memberName", comp->getProperties() ["memberName"].toString());
|
||||
e->setAttribute ("virtualName", comp->getProperties() ["virtualName"].toString());
|
||||
e->setAttribute ("explicitFocusOrder", comp->getExplicitFocusOrder());
|
||||
|
||||
RelativePositionedRectangle pos (getComponentPosition (comp));
|
||||
pos.updateFromComponent (*comp, layout);
|
||||
pos.applyToXml (*e);
|
||||
|
||||
SettableTooltipClient* const ttc = dynamic_cast <SettableTooltipClient*> (comp);
|
||||
if (ttc != 0 && ttc->getTooltip().isNotEmpty())
|
||||
e->setAttribute ("tooltip", ttc->getTooltip());
|
||||
|
||||
for (int i = 0; i < colours.size(); ++i)
|
||||
{
|
||||
if (comp->isColourSpecified (colours[i]->colourId))
|
||||
{
|
||||
e->setAttribute (colours[i]->xmlTagName,
|
||||
colourToHex (comp->findColour (colours[i]->colourId)));
|
||||
}
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool ComponentTypeHandler::restoreFromXml (const XmlElement& xml,
|
||||
Component* comp,
|
||||
const ComponentLayout* layout)
|
||||
{
|
||||
jassert (xml.hasTagName (getXmlTagName()));
|
||||
|
||||
if (! xml.hasTagName (getXmlTagName()))
|
||||
return false;
|
||||
|
||||
comp->setName (xml.getStringAttribute ("name", comp->getName()));
|
||||
setComponentId (comp, xml.getStringAttribute ("id").getHexValue64());
|
||||
comp->getProperties().set ("memberName", xml.getStringAttribute ("memberName"));
|
||||
comp->getProperties().set ("virtualName", xml.getStringAttribute ("virtualName"));
|
||||
comp->setExplicitFocusOrder (xml.getIntAttribute ("explicitFocusOrder"));
|
||||
|
||||
RelativePositionedRectangle currentPos (getComponentPosition (comp));
|
||||
currentPos.updateFromComponent (*comp, layout);
|
||||
|
||||
RelativePositionedRectangle rpr;
|
||||
rpr.restoreFromXml (xml, currentPos);
|
||||
|
||||
jassert (layout != 0);
|
||||
setComponentPosition (comp, rpr, layout);
|
||||
|
||||
SettableTooltipClient* const ttc = dynamic_cast <SettableTooltipClient*> (comp);
|
||||
if (ttc != 0)
|
||||
ttc->setTooltip (xml.getStringAttribute ("tooltip"));
|
||||
|
||||
for (int i = 0; i < colours.size(); ++i)
|
||||
{
|
||||
const String col (xml.getStringAttribute (colours[i]->xmlTagName, String::empty));
|
||||
|
||||
if (col.isNotEmpty())
|
||||
{
|
||||
comp->setColour (colours[i]->colourId,
|
||||
Colour (col.getHexValue32()));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
int64 ComponentTypeHandler::getComponentId (Component* comp)
|
||||
{
|
||||
if (comp == 0)
|
||||
return 0;
|
||||
|
||||
int64 compId = comp->getProperties() ["jucerCompId"].toString().getHexValue64();
|
||||
|
||||
if (compId == 0)
|
||||
{
|
||||
compId = Random::getSystemRandom().nextInt64();
|
||||
setComponentId (comp, compId);
|
||||
}
|
||||
|
||||
return compId;
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::setComponentId (Component* comp, const int64 newID)
|
||||
{
|
||||
jassert (comp != 0);
|
||||
if (newID != 0)
|
||||
comp->getProperties().set ("jucerCompId", String::toHexString (newID));
|
||||
}
|
||||
|
||||
const RelativePositionedRectangle ComponentTypeHandler::getComponentPosition (Component* comp)
|
||||
{
|
||||
RelativePositionedRectangle rp;
|
||||
rp.rect = PositionedRectangle (comp->getProperties() ["pos"]);
|
||||
rp.relativeToX = comp->getProperties() ["relativeToX"].toString().getHexValue64();
|
||||
rp.relativeToY = comp->getProperties() ["relativeToY"].toString().getHexValue64();
|
||||
rp.relativeToW = comp->getProperties() ["relativeToW"].toString().getHexValue64();
|
||||
rp.relativeToH = comp->getProperties() ["relativeToH"].toString().getHexValue64();
|
||||
|
||||
return rp;
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::setComponentPosition (Component* comp,
|
||||
const RelativePositionedRectangle& newPos,
|
||||
const ComponentLayout* layout)
|
||||
{
|
||||
comp->getProperties().set ("pos", newPos.rect.toString());
|
||||
comp->getProperties().set ("relativeToX", String::toHexString (newPos.relativeToX));
|
||||
comp->getProperties().set ("relativeToY", String::toHexString (newPos.relativeToY));
|
||||
comp->getProperties().set ("relativeToW", String::toHexString (newPos.relativeToW));
|
||||
comp->getProperties().set ("relativeToH", String::toHexString (newPos.relativeToH));
|
||||
|
||||
comp->setBounds (newPos.getRectangle (Rectangle<int> (0, 0, comp->getParentWidth(), comp->getParentHeight()),
|
||||
layout));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class TooltipProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
TooltipProperty (Component* comp, JucerDocument& document)
|
||||
: ComponentTextProperty <Component> ("tooltip", 1024, false, comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
SettableTooltipClient* ttc = dynamic_cast <SettableTooltipClient*> (component);
|
||||
return ttc->getTooltip();
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new SetTooltipAction (component, *document.getComponentLayout(), newText),
|
||||
"Change tooltip");
|
||||
}
|
||||
|
||||
private:
|
||||
class SetTooltipAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
SetTooltipAction (Component* const comp, ComponentLayout& layout, const String& newValue_)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
newValue (newValue_)
|
||||
{
|
||||
SettableTooltipClient* ttc = dynamic_cast <SettableTooltipClient*> (comp);
|
||||
jassert (ttc != 0);
|
||||
oldValue = ttc->getTooltip();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
SettableTooltipClient* ttc = dynamic_cast <SettableTooltipClient*> (getComponent());
|
||||
|
||||
jassert (ttc != 0);
|
||||
if (ttc == 0)
|
||||
return false;
|
||||
|
||||
ttc->setTooltip (newValue);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
SettableTooltipClient* ttc = dynamic_cast <SettableTooltipClient*> (getComponent());
|
||||
|
||||
jassert (ttc != 0);
|
||||
if (ttc == 0)
|
||||
return false;
|
||||
|
||||
ttc->setTooltip (oldValue);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newValue, oldValue;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ComponentPositionProperty : public PositionPropertyBase
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ComponentPositionProperty (Component* component_,
|
||||
JucerDocument& document_,
|
||||
const String& name,
|
||||
ComponentPositionDimension dimension_)
|
||||
: PositionPropertyBase (component_, name, dimension_,
|
||||
true, true,
|
||||
document_.getComponentLayout()),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ComponentPositionProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setPosition (const RelativePositionedRectangle& newPos)
|
||||
{
|
||||
document.getComponentLayout()->setComponentPosition (component, newPos, true);
|
||||
}
|
||||
|
||||
const RelativePositionedRectangle getPosition() const
|
||||
{
|
||||
return ComponentTypeHandler::getComponentPosition (component);
|
||||
}
|
||||
|
||||
private:
|
||||
JucerDocument& document;
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
class FocusOrderProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
FocusOrderProperty (Component* comp, JucerDocument& document)
|
||||
: ComponentTextProperty <Component> ("focus order", 8, false, comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return String (component->getExplicitFocusOrder());
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new SetFocusOrderAction (component, *document.getComponentLayout(), jmax (0, newText.getIntValue())),
|
||||
"Change focus order");
|
||||
}
|
||||
|
||||
private:
|
||||
class SetFocusOrderAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
SetFocusOrderAction (Component* const comp, ComponentLayout& layout, const int newOrder_)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
newValue (newOrder_)
|
||||
{
|
||||
oldValue = comp->getExplicitFocusOrder();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setExplicitFocusOrder (newValue);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setExplicitFocusOrder (oldValue);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
int newValue, oldValue;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
void ComponentTypeHandler::getEditableProperties (Component* component,
|
||||
JucerDocument& document,
|
||||
Array <PropertyComponent*>& properties)
|
||||
{
|
||||
properties.add (new ComponentMemberNameProperty (component, document));
|
||||
properties.add (new ComponentNameProperty (component, document));
|
||||
properties.add (new ComponentVirtualClassProperty (component, document));
|
||||
|
||||
properties.add (new ComponentPositionProperty (component, document, "x", ComponentPositionProperty::componentX));
|
||||
properties.add (new ComponentPositionProperty (component, document, "y", ComponentPositionProperty::componentY));
|
||||
properties.add (new ComponentPositionProperty (component, document, "width", ComponentPositionProperty::componentWidth));
|
||||
properties.add (new ComponentPositionProperty (component, document, "height", ComponentPositionProperty::componentHeight));
|
||||
|
||||
if (dynamic_cast <SettableTooltipClient*> (component) != 0)
|
||||
properties.add (new TooltipProperty (component, document));
|
||||
|
||||
properties.add (new FocusOrderProperty (component, document));
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::addPropertiesToPropertyPanel (Component* comp,
|
||||
JucerDocument& document,
|
||||
PropertyPanel& panel)
|
||||
{
|
||||
Array <PropertyComponent*> props;
|
||||
getEditableProperties (comp, document, props);
|
||||
|
||||
panel.addSection (getClassName (comp), props);
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::registerEditableColour (int colourId,
|
||||
const String& colourIdCode,
|
||||
const String& colourName, const String& xmlTagName)
|
||||
{
|
||||
ComponentColourInfo* const c = new ComponentColourInfo();
|
||||
|
||||
c->colourId = colourId;
|
||||
c->colourIdCode = colourIdCode;
|
||||
c->colourName = colourName;
|
||||
c->xmlTagName = xmlTagName;
|
||||
|
||||
colours.add (c);
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::addColourProperties (Component* component,
|
||||
JucerDocument& document,
|
||||
Array <PropertyComponent*>& properties)
|
||||
{
|
||||
for (int i = 0; i < colours.size(); ++i)
|
||||
{
|
||||
properties.add (new ComponentColourIdProperty (component, document,
|
||||
colours[i]->colourId,
|
||||
colours[i]->colourName,
|
||||
true));
|
||||
}
|
||||
}
|
||||
|
||||
const String ComponentTypeHandler::getColourIntialisationCode (Component* component,
|
||||
const String& objectName)
|
||||
{
|
||||
String s;
|
||||
|
||||
for (int i = 0; i < colours.size(); ++i)
|
||||
{
|
||||
if (component->isColourSpecified (colours[i]->colourId))
|
||||
{
|
||||
s << objectName << "->setColour ("
|
||||
<< colours[i]->colourIdCode
|
||||
<< ", "
|
||||
<< colourToCode (component->findColour (colours[i]->colourId))
|
||||
<< ");\n";
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentTypeHandler::fillInGeneratedCode (Component* component, GeneratedCode& code)
|
||||
{
|
||||
const String memberVariableName (code.document->getComponentLayout()->getComponentMemberVariableName (component));
|
||||
|
||||
fillInMemberVariableDeclarations (code, component, memberVariableName);
|
||||
fillInCreationCode (code, component, memberVariableName);
|
||||
fillInDeletionCode (code, component, memberVariableName);
|
||||
fillInResizeCode (code, component, memberVariableName);
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::fillInMemberVariableDeclarations (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
const String virtualName (component->getProperties() ["virtualName"].toString());
|
||||
|
||||
if (virtualName.isNotEmpty())
|
||||
{
|
||||
code.privateMemberDeclarations
|
||||
<< makeValidCppIdentifier (virtualName, false, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
code.privateMemberDeclarations
|
||||
<< getClassName (component);
|
||||
}
|
||||
|
||||
code.privateMemberDeclarations
|
||||
<< "* " << memberVariableName << ";\n";
|
||||
|
||||
code.initialisers.add (memberVariableName + " (0)");
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::fillInResizeCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
const RelativePositionedRectangle pos (getComponentPosition (component));
|
||||
|
||||
String x, y, w, h, r;
|
||||
positionToCode (pos, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
r << memberVariableName << "->setBounds ("
|
||||
<< x << ", " << y << ", " << w << ", " << h << ");\n";
|
||||
|
||||
if (pos.rect.isPositionAbsolute())
|
||||
code.constructorCode += r + "\n";
|
||||
else
|
||||
code.getCallbackCode (String::empty, "void", "resized()", false) += r;
|
||||
}
|
||||
|
||||
const String ComponentTypeHandler::getCreationParameters (Component* component)
|
||||
{
|
||||
return String::empty;
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
String params (getCreationParameters (component));
|
||||
const String virtualName (component->getProperties() ["virtualName"].toString());
|
||||
|
||||
String s;
|
||||
s << "addAndMakeVisible (" << memberVariableName << " = new ";
|
||||
|
||||
if (virtualName.isNotEmpty())
|
||||
s << makeValidCppIdentifier (virtualName, false, false, true);
|
||||
else
|
||||
s << getClassName (component);
|
||||
|
||||
if (params.isEmpty())
|
||||
s << "());\n";
|
||||
else
|
||||
{
|
||||
params = StringArray::fromLines (params)
|
||||
.joinIntoString ("\n" + String::repeatedString (" ", s.length() + 2));
|
||||
|
||||
s << " (" << params << "));\n";
|
||||
}
|
||||
|
||||
SettableTooltipClient* ttc = dynamic_cast <SettableTooltipClient*> (component);
|
||||
if (ttc != 0 && ttc->getTooltip().isNotEmpty())
|
||||
{
|
||||
s << memberVariableName << "->setTooltip ("
|
||||
<< quotedString (ttc->getTooltip())
|
||||
<< ");\n";
|
||||
}
|
||||
|
||||
if (component->getExplicitFocusOrder() > 0)
|
||||
s << memberVariableName << "->setExplicitFocusOrder ("
|
||||
<< component->getExplicitFocusOrder()
|
||||
<< ");\n";
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
void ComponentTypeHandler::fillInDeletionCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
code.destructorCode
|
||||
<< "deleteAndZero (" << memberVariableName << ");\n";
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTTYPEHANDLER_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTTYPEHANDLER_JUCEHEADER__
|
||||
|
||||
class ComponentOverlayComponent;
|
||||
class ComponentLayout;
|
||||
#include "../jucer_GeneratedCode.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Base class for handlers that can understand the properties of all the component classes.
|
||||
*/
|
||||
class ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ComponentTypeHandler (const String& typeDescription_,
|
||||
const String& className_,
|
||||
const std::type_info& componentClass,
|
||||
const int defaultWidth_,
|
||||
const int defaultHeight_);
|
||||
|
||||
virtual ~ComponentTypeHandler();
|
||||
|
||||
//==============================================================================
|
||||
virtual bool canHandle (Component& component) const;
|
||||
|
||||
static ComponentTypeHandler* getHandlerFor (Component& component);
|
||||
|
||||
//==============================================================================
|
||||
virtual const String getXmlTagName() const throw() { return className.toUpperCase(); }
|
||||
|
||||
static ComponentTypeHandler* getHandlerForXmlTag (const String& tagName);
|
||||
|
||||
virtual XmlElement* createXmlFor (Component* component, const ComponentLayout* layout);
|
||||
virtual bool restoreFromXml (const XmlElement& xml, Component* component, const ComponentLayout* layout);
|
||||
|
||||
virtual void getEditableProperties (Component* component,
|
||||
JucerDocument& document,
|
||||
Array <PropertyComponent*>& properties);
|
||||
|
||||
virtual void addPropertiesToPropertyPanel (Component* component,
|
||||
JucerDocument& document,
|
||||
PropertyPanel& panel);
|
||||
|
||||
|
||||
void registerEditableColour (int colourId,
|
||||
const String& colourIdCode,
|
||||
const String& colourName,
|
||||
const String& xmlTagName);
|
||||
|
||||
#define registerColour(colourId, colourName, xmlTagName) \
|
||||
registerEditableColour (colourId, #colourId, colourName, xmlTagName)
|
||||
|
||||
void addColourProperties (Component* component,
|
||||
JucerDocument& document,
|
||||
Array <PropertyComponent*>& properties);
|
||||
|
||||
const String getColourIntialisationCode (Component* component,
|
||||
const String& objectName);
|
||||
|
||||
//==============================================================================
|
||||
virtual Component* createNewComponent (JucerDocument*) = 0;
|
||||
|
||||
virtual Component* createCopyOf (JucerDocument*, Component& existing);
|
||||
|
||||
virtual ComponentOverlayComponent* createOverlayComponent (Component* child, ComponentLayout& layout);
|
||||
|
||||
virtual void showPopupMenu (Component* component,
|
||||
ComponentLayout& layout);
|
||||
|
||||
//==============================================================================
|
||||
// Code-generation methods:
|
||||
|
||||
virtual void fillInGeneratedCode (Component* component, GeneratedCode& code);
|
||||
|
||||
virtual void fillInMemberVariableDeclarations (GeneratedCode& code, Component* component, const String& memberVariableName);
|
||||
virtual void fillInResizeCode (GeneratedCode& code, Component* component, const String& memberVariableName);
|
||||
virtual void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName);
|
||||
virtual const String getCreationParameters (Component* component);
|
||||
virtual void fillInDeletionCode (GeneratedCode& code, Component* component, const String& memberVariableName);
|
||||
|
||||
//==============================================================================
|
||||
const String& getTypeName() const throw() { return typeName; }
|
||||
virtual const String getClassName (Component*) const { return className; }
|
||||
|
||||
int getDefaultWidth() const throw() { return defaultWidth; }
|
||||
int getDefaultHeight() const throw() { return defaultHeight; }
|
||||
|
||||
static int64 getComponentId (Component* comp);
|
||||
static void setComponentId (Component* comp, const int64 newID);
|
||||
|
||||
static const RelativePositionedRectangle getComponentPosition (Component* comp);
|
||||
static void setComponentPosition (Component* comp,
|
||||
const RelativePositionedRectangle& newPos,
|
||||
const ComponentLayout* layout);
|
||||
|
||||
static JucerDocument* findParentDocument (Component* component);
|
||||
|
||||
protected:
|
||||
//==============================================================================
|
||||
const String typeName, className, virtualClass, componentClassRawName;
|
||||
int defaultWidth, defaultHeight;
|
||||
|
||||
struct ComponentColourInfo
|
||||
{
|
||||
int colourId;
|
||||
String colourIdCode, colourName, xmlTagName;
|
||||
};
|
||||
|
||||
OwnedArray <ComponentColourInfo> colours;
|
||||
|
||||
private:
|
||||
ComponentTypeHandler (const ComponentTypeHandler&);
|
||||
ComponentTypeHandler& operator= (const ComponentTypeHandler&);
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTTYPEHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTUNDOABLEACTION_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTUNDOABLEACTION_JUCEHEADER__
|
||||
|
||||
#include "../../ui/jucer_JucerDocumentHolder.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
template <class ComponentType>
|
||||
class ComponentUndoableAction : public UndoableAction
|
||||
{
|
||||
public:
|
||||
ComponentUndoableAction (ComponentType* const comp,
|
||||
ComponentLayout& layout_)
|
||||
: layout (layout_),
|
||||
componentIndex (layout_.indexOfComponent (comp))
|
||||
{
|
||||
jassert (comp != 0);
|
||||
jassert (componentIndex >= 0);
|
||||
}
|
||||
|
||||
~ComponentUndoableAction()
|
||||
{
|
||||
}
|
||||
|
||||
ComponentType* getComponent() const
|
||||
{
|
||||
ComponentType* const c = dynamic_cast <ComponentType*> (layout.getComponent (componentIndex));
|
||||
jassert (c != 0);
|
||||
return c;
|
||||
}
|
||||
|
||||
int getSizeInUnits() { return 2; }
|
||||
|
||||
protected:
|
||||
ComponentLayout& layout;
|
||||
const int componentIndex;
|
||||
|
||||
void changed() const
|
||||
{
|
||||
jassert (layout.getDocument() != 0);
|
||||
layout.getDocument()->changed();
|
||||
}
|
||||
|
||||
void showCorrectTab() const
|
||||
{
|
||||
JucerDocumentHolder* const docHolder = JucerDocumentHolder::getActiveDocumentHolder();
|
||||
|
||||
if (docHolder != 0)
|
||||
docHolder->showLayout();
|
||||
|
||||
if (layout.getSelectedSet().getNumSelected() == 0)
|
||||
{
|
||||
ComponentType* const c = dynamic_cast <ComponentType*> (layout.getComponent (componentIndex));
|
||||
|
||||
if (c != 0)
|
||||
layout.getSelectedSet().selectOnly (getComponent());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
ComponentUndoableAction (const ComponentUndoableAction&);
|
||||
ComponentUndoableAction& operator= (const ComponentUndoableAction&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTUNDOABLEACTION_JUCEHEADER__
|
||||
|
|
@ -1,246 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_GENERICCOMPONENTHANDLER_JUCEHEADER__
|
||||
#define __JUCER_GENERICCOMPONENTHANDLER_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class GenericComponent : public Component
|
||||
{
|
||||
public:
|
||||
GenericComponent()
|
||||
: Component ("new component"),
|
||||
actualClassName ("Component")
|
||||
{
|
||||
}
|
||||
|
||||
void paint (Graphics& g)
|
||||
{
|
||||
g.fillAll (Colours::white.withAlpha (0.25f));
|
||||
|
||||
g.setColour (Colours::black.withAlpha (0.5f));
|
||||
g.drawRect (0, 0, getWidth(), getHeight());
|
||||
g.drawLine (0.0f, 0.0f, (float) getWidth(), (float) getHeight());
|
||||
g.drawLine (0.0f, (float) getHeight(), (float) getWidth(), 0.0f);
|
||||
|
||||
g.setFont (14.0f);
|
||||
g.drawText (actualClassName, 0, 0, getWidth(), getHeight() / 2, Justification::centred, true);
|
||||
}
|
||||
|
||||
void setClassName (const String& newName)
|
||||
{
|
||||
if (actualClassName != newName)
|
||||
{
|
||||
actualClassName = newName;
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||
void setParams (const String& newParams)
|
||||
{
|
||||
if (constructorParams != newParams)
|
||||
{
|
||||
constructorParams = newParams;
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||
String actualClassName, constructorParams;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class GenericComponentHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
GenericComponentHandler()
|
||||
: ComponentTypeHandler ("Generic Component", "GenericComponent", typeid (GenericComponent), 150, 24)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new GenericComponent();
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
e->setAttribute ("class", ((GenericComponent*) comp)->actualClassName);
|
||||
e->setAttribute ("params", ((GenericComponent*) comp)->constructorParams);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
((GenericComponent*) comp)->actualClassName = xml.getStringAttribute ("class", "Component");
|
||||
((GenericComponent*) comp)->constructorParams = xml.getStringAttribute ("params", String::empty);
|
||||
return true;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
properties.add (new GenericCompClassProperty (dynamic_cast <GenericComponent*> (component), document));
|
||||
properties.add (new GenericCompParamsProperty (dynamic_cast <GenericComponent*> (component), document));
|
||||
}
|
||||
|
||||
const String getClassName (Component* comp) const
|
||||
{
|
||||
return ((GenericComponent*) comp)->actualClassName;
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* comp)
|
||||
{
|
||||
return ((GenericComponent*) comp)->constructorParams;
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
if (component->getName().isNotEmpty())
|
||||
code.constructorCode
|
||||
<< memberVariableName << "->setName ("
|
||||
<< quotedString (component->getName())
|
||||
<< ");\n\n";
|
||||
else
|
||||
code.constructorCode << "\n";
|
||||
}
|
||||
|
||||
private:
|
||||
class GenericCompClassProperty : public ComponentTextProperty <GenericComponent>
|
||||
{
|
||||
public:
|
||||
GenericCompClassProperty (GenericComponent* comp, JucerDocument& document)
|
||||
: ComponentTextProperty <GenericComponent> ("class", 300, false, comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new GenericCompClassChangeAction (component, *document.getComponentLayout(),
|
||||
makeValidCppIdentifier (newText, false, false, true)),
|
||||
"Change generic component class");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->actualClassName;
|
||||
}
|
||||
|
||||
private:
|
||||
class GenericCompClassChangeAction : public ComponentUndoableAction <GenericComponent>
|
||||
{
|
||||
public:
|
||||
GenericCompClassChangeAction (GenericComponent* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <GenericComponent> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->actualClassName;
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setClassName (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setClassName (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
class GenericCompParamsProperty : public ComponentTextProperty <GenericComponent>
|
||||
{
|
||||
public:
|
||||
GenericCompParamsProperty (GenericComponent* comp, JucerDocument& document)
|
||||
: ComponentTextProperty <GenericComponent> ("constructor params", 1024, true, comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new GenericCompParamsChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change generic component class");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->constructorParams;
|
||||
}
|
||||
|
||||
private:
|
||||
class GenericCompParamsChangeAction : public ComponentUndoableAction <GenericComponent>
|
||||
{
|
||||
public:
|
||||
GenericCompParamsChangeAction (GenericComponent* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <GenericComponent> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->constructorParams;
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setParams (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setParams (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_GENERICCOMPONENTHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,238 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_GROUPCOMPONENTHANDLER_JUCEHEADER__
|
||||
#define __JUCER_GROUPCOMPONENTHANDLER_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class GroupComponentHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
GroupComponentHandler()
|
||||
: ComponentTypeHandler ("Group Box", "GroupComponent", typeid (GroupComponent), 200, 150)
|
||||
{
|
||||
registerColour (GroupComponent::outlineColourId, "outline", "outlinecol");
|
||||
registerColour (GroupComponent::textColourId, "text", "textcol");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new GroupComponent ("new group", "group");
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
GroupComponent* const g = (GroupComponent*) comp;
|
||||
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
e->setAttribute ("title", g->getText());
|
||||
|
||||
GroupComponent defaultComp (String::empty, String::empty);
|
||||
|
||||
if (g->getTextLabelPosition().getFlags() != defaultComp.getTextLabelPosition().getFlags())
|
||||
e->setAttribute ("textpos", g->getTextLabelPosition().getFlags());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
GroupComponent* const g = (GroupComponent*) comp;
|
||||
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
g->setText (xml.getStringAttribute ("title", g->getText()));
|
||||
g->setTextLabelPosition (Justification (xml.getIntAttribute ("textpos", g->getTextLabelPosition().getFlags())));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* component)
|
||||
{
|
||||
GroupComponent* g = dynamic_cast <GroupComponent*> (component);
|
||||
|
||||
return quotedString (component->getName())
|
||||
+ ",\n"
|
||||
+ quotedString (g->getText());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
GroupComponent* const g = dynamic_cast <GroupComponent*> (component);
|
||||
|
||||
String s;
|
||||
|
||||
GroupComponent defaultComp (String::empty, String::empty);
|
||||
|
||||
if (g->getTextLabelPosition().getFlags() != defaultComp.getTextLabelPosition().getFlags())
|
||||
{
|
||||
s << memberVariableName << "->setTextLabelPosition ("
|
||||
<< justificationToCode (g->getTextLabelPosition())
|
||||
<< ");\n";
|
||||
}
|
||||
|
||||
s << getColourIntialisationCode (component, memberVariableName)
|
||||
<< '\n';
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
properties.add (new GroupTitleProperty ((GroupComponent*) component, document));
|
||||
properties.add (new GroupJustificationProperty ((GroupComponent*) component, document));
|
||||
|
||||
addColourProperties (component, document, properties);
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class GroupTitleProperty : public ComponentTextProperty <GroupComponent>
|
||||
{
|
||||
public:
|
||||
GroupTitleProperty (GroupComponent* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <GroupComponent> ("text", 200, false, component_, document_)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new GroupTitleChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change group title");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getText();
|
||||
}
|
||||
|
||||
private:
|
||||
class GroupTitleChangeAction : public ComponentUndoableAction <GroupComponent>
|
||||
{
|
||||
public:
|
||||
GroupTitleChangeAction (GroupComponent* const comp, ComponentLayout& layout, const String& newName_)
|
||||
: ComponentUndoableAction <GroupComponent> (comp, layout),
|
||||
newName (newName_)
|
||||
{
|
||||
oldName = comp->getText();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setText (newName);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setText (oldName);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newName, oldName;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class GroupJustificationProperty : public JustificationProperty,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
GroupJustificationProperty (GroupComponent* const group_, JucerDocument& document_)
|
||||
: JustificationProperty ("layout", true),
|
||||
group (group_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~GroupJustificationProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setJustification (const Justification& newJustification)
|
||||
{
|
||||
document.perform (new GroupJustifyChangeAction (group, *document.getComponentLayout(), newJustification),
|
||||
"Change text label position");
|
||||
}
|
||||
|
||||
const Justification getJustification() const
|
||||
{
|
||||
return group->getTextLabelPosition();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
GroupComponent* const group;
|
||||
JucerDocument& document;
|
||||
|
||||
class GroupJustifyChangeAction : public ComponentUndoableAction <GroupComponent>
|
||||
{
|
||||
public:
|
||||
GroupJustifyChangeAction (GroupComponent* const comp, ComponentLayout& layout, const Justification& newState_)
|
||||
: ComponentUndoableAction <GroupComponent> (comp, layout),
|
||||
newState (newState_),
|
||||
oldState (comp->getTextLabelPosition())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextLabelPosition (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextLabelPosition (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
Justification newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_GROUPCOMPONENTHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,160 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_HYPERLINKBUTTONHANDLER_JUCEHEADER__
|
||||
#define __JUCER_HYPERLINKBUTTONHANDLER_JUCEHEADER__
|
||||
|
||||
#include "jucer_ButtonHandler.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class HyperlinkButtonHandler : public ButtonHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
HyperlinkButtonHandler()
|
||||
: ButtonHandler ("Hyperlink Button", "HyperlinkButton", typeid (HyperlinkButton), 150, 24)
|
||||
{
|
||||
registerColour (HyperlinkButton::textColourId, "text", "textCol");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
HyperlinkButton* hb = new HyperlinkButton ("new hyperlink", URL ("http://www.rawmaterialsoftware.com/juce"));
|
||||
|
||||
setNeedsButtonListener (hb, false);
|
||||
return hb;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
HyperlinkButton* const hb = (HyperlinkButton*) component;
|
||||
|
||||
ButtonHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
properties.add (new HyperlinkURLProperty (hb, document));
|
||||
|
||||
addColourProperties (component, document, properties);
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
HyperlinkButton* const hb = (HyperlinkButton*) comp;
|
||||
|
||||
XmlElement* const e = ButtonHandler::createXmlFor (comp, layout);
|
||||
|
||||
e->setAttribute ("url", hb->getURL().toString (false));
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
HyperlinkButton* const hb = (HyperlinkButton*) comp;
|
||||
|
||||
if (! ButtonHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
hb->setURL (URL (xml.getStringAttribute ("url", hb->getURL().toString (false))));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* comp)
|
||||
{
|
||||
HyperlinkButton* const hb = dynamic_cast <HyperlinkButton*> (comp);
|
||||
|
||||
return quotedString (hb->getButtonText())
|
||||
+ ",\nURL ("
|
||||
+ quotedString (hb->getURL().toString (false))
|
||||
+ ")";
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ButtonHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
code.constructorCode << getColourIntialisationCode (component, memberVariableName)
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class HyperlinkURLProperty : public ComponentTextProperty <HyperlinkButton>
|
||||
{
|
||||
public:
|
||||
HyperlinkURLProperty (HyperlinkButton* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <HyperlinkButton> ("URL", 512, false, component_, document_)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new HyperlinkURLChangeAction (component, *document.getComponentLayout(), URL (newText)),
|
||||
"Change hyperlink URL");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getURL().toString (false);
|
||||
}
|
||||
|
||||
private:
|
||||
class HyperlinkURLChangeAction : public ComponentUndoableAction <HyperlinkButton>
|
||||
{
|
||||
public:
|
||||
HyperlinkURLChangeAction (HyperlinkButton* const comp, ComponentLayout& layout, const URL& newState_)
|
||||
: ComponentUndoableAction <HyperlinkButton> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getURL();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setURL (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setURL (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
URL newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_HYPERLINKBUTTONHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,542 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_IMAGEBUTTONHANDLER_JUCEHEADER__
|
||||
#define __JUCER_IMAGEBUTTONHANDLER_JUCEHEADER__
|
||||
|
||||
#include "jucer_ButtonHandler.h"
|
||||
#include "../../properties/jucer_ComponentColourProperty.h"
|
||||
#include "../paintelements/jucer_ImageResourceProperty.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ImageButtonHandler : public ButtonHandler
|
||||
{
|
||||
public:
|
||||
enum ImageRole
|
||||
{
|
||||
normalImage = 0,
|
||||
overImage = 1,
|
||||
downImage = 2
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
ImageButtonHandler()
|
||||
: ButtonHandler ("Image Button", "ImageButton", typeid (ImageButton), 150, 24)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new ImageButton ("new button");
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ButtonHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
addColourProperties (component, document, properties);
|
||||
|
||||
ImageButton* const ib = (ImageButton*) component;
|
||||
|
||||
ComponentLayout& layout = *document.getComponentLayout();
|
||||
|
||||
properties.add (new ImageButtonProportionProperty (layout, ib));
|
||||
|
||||
properties.add (new ImageButtonResourceProperty (layout, ib, normalImage, "normal image"));
|
||||
properties.add (new ImageButtonOpacityProperty (layout, ib, "opacity", normalImage));
|
||||
properties.add (new ImageButtonColourProperty (layout, ib, "overlay col.", normalImage));
|
||||
|
||||
properties.add (new ImageButtonResourceProperty (layout, ib, overImage, "over image"));
|
||||
properties.add (new ImageButtonOpacityProperty (layout, ib, "opacity", overImage));
|
||||
properties.add (new ImageButtonColourProperty (layout, ib, "overlay col.", overImage));
|
||||
|
||||
properties.add (new ImageButtonResourceProperty (layout, ib, downImage, "down image"));
|
||||
properties.add (new ImageButtonOpacityProperty (layout, ib, "opacity", downImage));
|
||||
properties.add (new ImageButtonColourProperty (layout, ib, "overlay col.", downImage));
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
XmlElement* e = ButtonHandler::createXmlFor (comp, layout);
|
||||
|
||||
ImageButton* const ib = (ImageButton*) comp;
|
||||
|
||||
e->setAttribute ("keepProportions", doesImageKeepProportions (ib));
|
||||
|
||||
e->setAttribute ("resourceNormal", getImageResource (ib, normalImage));
|
||||
e->setAttribute ("opacityNormal", getImageOpacity (ib, normalImage));
|
||||
e->setAttribute ("colourNormal", getImageColour (ib, normalImage).toString());
|
||||
|
||||
e->setAttribute ("resourceOver", getImageResource (ib, overImage));
|
||||
e->setAttribute ("opacityOver", getImageOpacity (ib, overImage));
|
||||
e->setAttribute ("colourOver", getImageColour (ib, overImage).toString());
|
||||
|
||||
e->setAttribute ("resourceDown", getImageResource (ib, downImage));
|
||||
e->setAttribute ("opacityDown", getImageOpacity (ib, downImage));
|
||||
e->setAttribute ("colourDown", getImageColour (ib, downImage).toString());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ButtonHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
ImageButton* const ib = (ImageButton*) comp;
|
||||
ComponentLayout& l = const_cast <ComponentLayout&> (*layout);
|
||||
|
||||
setImageKeepProportions (l, ib, xml.getBoolAttribute ("keepProportions", true), false);
|
||||
|
||||
setImageResource (l, ib, normalImage, xml.getStringAttribute ("resourceNormal", String::empty), false);
|
||||
setImageOpacity (l, ib, normalImage, (float) xml.getDoubleAttribute ("opacityNormal", 1.0f), false);
|
||||
setImageColour (l, ib, normalImage, Colour::fromString (xml.getStringAttribute ("colourNormal", "0")), false);
|
||||
|
||||
setImageResource (l, ib, overImage, xml.getStringAttribute ("resourceOver", String::empty), false);
|
||||
setImageOpacity (l, ib, overImage, (float) xml.getDoubleAttribute ("opacityOver", 1.0f), false);
|
||||
setImageColour (l, ib, overImage, Colour::fromString (xml.getStringAttribute ("colourOver", "0")), false);
|
||||
|
||||
setImageResource (l, ib, downImage, xml.getStringAttribute ("resourceDown", String::empty), false);
|
||||
setImageOpacity (l, ib, downImage, (float) xml.getDoubleAttribute ("opacityDown", 1.0f), false);
|
||||
setImageColour (l, ib, downImage, Colour::fromString (xml.getStringAttribute ("colourDown", "0")), false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ButtonHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
ImageButton* const ib = dynamic_cast <ImageButton*> (component);
|
||||
|
||||
String s;
|
||||
|
||||
s << getColourIntialisationCode (component, memberVariableName)
|
||||
<< '\n';
|
||||
|
||||
const String indent (String::repeatedString (" ", memberVariableName.length() + 13));
|
||||
|
||||
s << memberVariableName << "->setImages (false, true, "
|
||||
<< boolToString (doesImageKeepProportions (ib)) << ",\n"
|
||||
<< indent
|
||||
<< getImageCreationCode (ib, normalImage) << ", "
|
||||
<< valueToFloat (getImageOpacity (ib, normalImage)) << ", "
|
||||
<< colourToCode (getImageColour (ib, normalImage)) << ",\n"
|
||||
<< indent
|
||||
<< getImageCreationCode (ib, overImage) << ", "
|
||||
<< valueToFloat (getImageOpacity (ib, overImage)) << ", "
|
||||
<< colourToCode (getImageColour (ib, overImage)) << ",\n"
|
||||
<< indent
|
||||
<< getImageCreationCode (ib, downImage) << ", "
|
||||
<< valueToFloat (getImageOpacity (ib, downImage)) << ", "
|
||||
<< colourToCode (getImageColour (ib, downImage))
|
||||
<< ");\n";
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
static const String getImageCreationCode (ImageButton* ib, const ImageRole role)
|
||||
{
|
||||
const String resName (getImageResource (ib, role));
|
||||
|
||||
if (resName.isEmpty())
|
||||
return "Image()";
|
||||
|
||||
return "ImageCache::getFromMemory (" + resName + ", " + resName + "Size)";
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class ImageButtonResourceProperty : public ImageResourceProperty <ImageButton>
|
||||
{
|
||||
public:
|
||||
ImageButtonResourceProperty (ComponentLayout& layout_, ImageButton* const owner_, const ImageRole role_, const String& name)
|
||||
: ImageResourceProperty <ImageButton> (*layout_.getDocument(), owner_, name, true),
|
||||
role (role_),
|
||||
layout (layout_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setResource (const String& newName)
|
||||
{
|
||||
setImageResource (layout, element, role, newName, true);
|
||||
}
|
||||
|
||||
const String getResource() const
|
||||
{
|
||||
return getImageResource (element, role);
|
||||
}
|
||||
|
||||
private:
|
||||
const ImageRole role;
|
||||
ComponentLayout& layout;
|
||||
};
|
||||
|
||||
class SetImageResourceAction : public ComponentUndoableAction <ImageButton>
|
||||
{
|
||||
public:
|
||||
SetImageResourceAction (ImageButton* const button,
|
||||
ComponentLayout& layout_,
|
||||
const ImageRole role_,
|
||||
const String& newResource_)
|
||||
: ComponentUndoableAction <ImageButton> (button, layout_),
|
||||
newResource (newResource_),
|
||||
role (role_),
|
||||
layout (layout_)
|
||||
{
|
||||
oldResource = ImageButtonHandler::getImageResource (button, role_);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageResource (layout, getComponent(), role, newResource, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageResource (layout, getComponent(), role, oldResource, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
String newResource, oldResource;
|
||||
const ImageRole role;
|
||||
ComponentLayout& layout;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
static void setImageResource (ComponentLayout& layout, ImageButton* button, const ImageRole role, const String& newName, const bool undoable)
|
||||
{
|
||||
jassert (role < 3);
|
||||
|
||||
if (role < 3 && getImageResource (button, role) != newName)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
layout.getDocument()->perform (new SetImageResourceAction (button, layout, role, newName),
|
||||
"Change image resource");
|
||||
}
|
||||
else
|
||||
{
|
||||
button->getProperties().set ("resource" + String ((int) role), newName);
|
||||
updateButtonImages (*layout.getDocument(), button);
|
||||
layout.changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const String getImageResource (ImageButton* button, const ImageRole role)
|
||||
{
|
||||
jassert (role < 3);
|
||||
return button->getProperties() ["resource" + String ((int) role)].toString();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class SetImageKeepsPropAction : public ComponentUndoableAction <ImageButton>
|
||||
{
|
||||
public:
|
||||
SetImageKeepsPropAction (ImageButton* const button,
|
||||
ComponentLayout& layout_,
|
||||
const bool newState_)
|
||||
: ComponentUndoableAction <ImageButton> (button, layout_),
|
||||
newState (newState_),
|
||||
layout (layout_)
|
||||
{
|
||||
oldState = ImageButtonHandler::doesImageKeepProportions (button);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageKeepProportions (layout, getComponent(), newState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageKeepProportions (layout, getComponent(), oldState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
bool newState, oldState;
|
||||
ComponentLayout& layout;
|
||||
};
|
||||
|
||||
static bool doesImageKeepProportions (ImageButton* button)
|
||||
{
|
||||
return button->getProperties().getWithDefault ("keepImageProp", true);
|
||||
}
|
||||
|
||||
static void setImageKeepProportions (ComponentLayout& layout, ImageButton* button, const bool newState, const bool undoable)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
layout.perform (new SetImageKeepsPropAction (button, layout, newState), "change imagebutton proportion mode");
|
||||
}
|
||||
else
|
||||
{
|
||||
button->getProperties().set ("keepImageProp", newState);
|
||||
updateButtonImages (*layout.getDocument(), button);
|
||||
layout.changed();
|
||||
}
|
||||
}
|
||||
|
||||
class ImageButtonProportionProperty : public ComponentBooleanProperty <ImageButton>
|
||||
{
|
||||
public:
|
||||
ImageButtonProportionProperty (ComponentLayout& layout_, ImageButton* const owner_)
|
||||
: ComponentBooleanProperty <ImageButton> ("proportional", "maintain image proportions", "scale to fit",
|
||||
owner_, *layout_.getDocument()),
|
||||
layout (layout_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setState (bool newState)
|
||||
{
|
||||
setImageKeepProportions (layout, component, newState, true);
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return doesImageKeepProportions (component);
|
||||
}
|
||||
|
||||
private:
|
||||
ComponentLayout& layout;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class SetImageOpacityAction : public ComponentUndoableAction <ImageButton>
|
||||
{
|
||||
public:
|
||||
SetImageOpacityAction (ImageButton* const button,
|
||||
ComponentLayout& layout_,
|
||||
const ImageRole role_,
|
||||
const float newState_)
|
||||
: ComponentUndoableAction <ImageButton> (button, layout_),
|
||||
role (role_),
|
||||
newState (newState_),
|
||||
layout (layout_)
|
||||
{
|
||||
oldState = ImageButtonHandler::getImageOpacity (button, role_);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageOpacity (layout, getComponent(), role, newState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageOpacity (layout, getComponent(), role, oldState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
const ImageRole role;
|
||||
float newState, oldState;
|
||||
ComponentLayout& layout;
|
||||
};
|
||||
|
||||
static float getImageOpacity (ImageButton* button, const ImageRole role)
|
||||
{
|
||||
return (float) button->getProperties().getWithDefault ("imageOpacity" + String ((int) role), 1.0f);
|
||||
}
|
||||
|
||||
static void setImageOpacity (ComponentLayout& layout, ImageButton* button, const ImageRole role, const float opacity, const bool undoable)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
layout.perform (new SetImageOpacityAction (button, layout, role, opacity), "change imagebutton opacity");
|
||||
}
|
||||
else
|
||||
{
|
||||
button->getProperties().set ("imageOpacity" + String ((int) role), opacity);
|
||||
updateButtonImages (*layout.getDocument(), button);
|
||||
layout.changed();
|
||||
}
|
||||
}
|
||||
|
||||
class ImageButtonOpacityProperty : public SliderPropertyComponent
|
||||
{
|
||||
public:
|
||||
ImageButtonOpacityProperty (ComponentLayout& layout_, ImageButton* const owner_,
|
||||
const String& name, const ImageRole role_)
|
||||
: SliderPropertyComponent (name, 0.0, 1.0, 0.0),
|
||||
owner (owner_),
|
||||
layout (layout_),
|
||||
role (role_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setValue (double newValue)
|
||||
{
|
||||
setImageOpacity (layout, owner, role, (float) newValue, true);
|
||||
}
|
||||
|
||||
double getValue() const
|
||||
{
|
||||
return getImageOpacity (owner, role);
|
||||
}
|
||||
|
||||
private:
|
||||
ImageButton* const owner;
|
||||
ComponentLayout& layout;
|
||||
const ImageRole role;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class SetImageColourAction : public ComponentUndoableAction <ImageButton>
|
||||
{
|
||||
public:
|
||||
SetImageColourAction (ImageButton* const button,
|
||||
ComponentLayout& layout_,
|
||||
const ImageRole role_,
|
||||
const Colour& newState_)
|
||||
: ComponentUndoableAction <ImageButton> (button, layout_),
|
||||
role (role_),
|
||||
newState (newState_),
|
||||
layout (layout_)
|
||||
{
|
||||
oldState = ImageButtonHandler::getImageColour (button, role_);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageColour (layout, getComponent(), role, newState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
ImageButtonHandler::setImageColour (layout, getComponent(), role, oldState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
const ImageRole role;
|
||||
Colour newState, oldState;
|
||||
ComponentLayout& layout;
|
||||
};
|
||||
|
||||
static const Colour getImageColour (ImageButton* button, const ImageRole role)
|
||||
{
|
||||
return Colour::fromString (button->getProperties().getWithDefault ("imageColour" + String ((int) role), "0").toString());
|
||||
}
|
||||
|
||||
static void setImageColour (ComponentLayout& layout, ImageButton* button, const ImageRole role, const Colour& colour, const bool undoable)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
layout.perform (new SetImageColourAction (button, layout, role, colour), "change imagebutton colour");
|
||||
}
|
||||
else
|
||||
{
|
||||
button->getProperties().set ("imageColour" + String ((int) role), colour.toString());
|
||||
updateButtonImages (*layout.getDocument(), button);
|
||||
layout.changed();
|
||||
}
|
||||
}
|
||||
|
||||
class ImageButtonColourProperty : public ColourPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
ImageButtonColourProperty (ComponentLayout& layout_, ImageButton* const owner_,
|
||||
const String& name, const ImageRole role_)
|
||||
: ColourPropertyComponent (name, false),
|
||||
owner (owner_),
|
||||
layout (layout_),
|
||||
role (role_)
|
||||
{
|
||||
layout_.getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~ImageButtonColourProperty()
|
||||
{
|
||||
layout.getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setColour (const Colour& newColour)
|
||||
{
|
||||
setImageColour (layout, owner, role, newColour, true);
|
||||
}
|
||||
|
||||
Colour getColour() const
|
||||
{
|
||||
return getImageColour (owner, role);
|
||||
}
|
||||
|
||||
void resetToDefault() {}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
private:
|
||||
ImageButton* const owner;
|
||||
ComponentLayout& layout;
|
||||
const ImageRole role;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
static void updateButtonImages (JucerDocument& document, ImageButton* const ib)
|
||||
{
|
||||
Image norm = document.getResources().getImageFromCache (getImageResource (ib, normalImage));
|
||||
Image over = document.getResources().getImageFromCache (getImageResource (ib, overImage));
|
||||
Image down = document.getResources().getImageFromCache (getImageResource (ib, downImage));
|
||||
|
||||
ib->setImages (false, true, doesImageKeepProportions (ib),
|
||||
norm,
|
||||
getImageOpacity (ib, normalImage),
|
||||
getImageColour (ib, normalImage),
|
||||
over,
|
||||
getImageOpacity (ib, overImage),
|
||||
getImageColour (ib, overImage),
|
||||
down,
|
||||
getImageOpacity (ib, downImage),
|
||||
getImageColour (ib, downImage));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_IMAGEBUTTONHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,285 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_JUCERCOMPONENTHANDLER_JUCEHEADER__
|
||||
#define __JUCER_JUCERCOMPONENTHANDLER_JUCEHEADER__
|
||||
|
||||
#include "../../ui/jucer_TestComponent.h"
|
||||
#include "../../properties/jucer_FilePropertyComponent.h"
|
||||
#include "../../properties/jucer_ComponentTextProperty.h"
|
||||
#include "../../ui/jucer_MainWindow.h"
|
||||
#include "jucer_ComponentUndoableAction.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class JucerComponentHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
JucerComponentHandler()
|
||||
: ComponentTypeHandler ("Jucer Component", "xxx", typeid (TestComponent), 300, 200)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument* doc)
|
||||
{
|
||||
return new TestComponent (doc, 0, false);
|
||||
}
|
||||
|
||||
const String getXmlTagName() const throw() { return "JUCERCOMP"; }
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
TestComponent* const tc = dynamic_cast <TestComponent*> (comp);
|
||||
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
e->setAttribute ("sourceFile", tc->getFilename());
|
||||
e->setAttribute ("constructorParams", tc->getConstructorParams());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
TestComponent* const tc = dynamic_cast <TestComponent*> (comp);
|
||||
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
tc->setFilename (xml.getStringAttribute ("sourceFile", tc->getFilename()));
|
||||
tc->setConstructorParams (xml.getStringAttribute ("constructorParams"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const String getClassName (Component* comp) const
|
||||
{
|
||||
TestComponent* const tc = dynamic_cast <TestComponent*> (comp);
|
||||
|
||||
String jucerCompClassName;
|
||||
|
||||
if (tc->getDocument() != 0)
|
||||
jucerCompClassName = tc->getDocument()->getClassName();
|
||||
|
||||
if (jucerCompClassName.isEmpty())
|
||||
jucerCompClassName = "Component";
|
||||
|
||||
return jucerCompClassName;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
TestComponent* const tc = dynamic_cast <TestComponent*> (component);
|
||||
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
properties.add (new JucerCompFileProperty (tc, document));
|
||||
properties.add (new ConstructorParamsProperty (tc, document));
|
||||
properties.add (new JucerCompOpenDocProperty (tc));
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* component)
|
||||
{
|
||||
TestComponent* const tc = dynamic_cast <TestComponent*> (component);
|
||||
|
||||
return tc->getConstructorParams().trim();
|
||||
}
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
TestComponent* const tc = dynamic_cast <TestComponent*> (component);
|
||||
|
||||
code.includeFilesH.add (tc->getFilename().replace (".cpp", ".h"));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class JucerCompFileChangeAction : public ComponentUndoableAction <TestComponent>
|
||||
{
|
||||
public:
|
||||
JucerCompFileChangeAction (TestComponent* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <TestComponent> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getFilename();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setFilename (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setFilename (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
|
||||
static void setJucerComponentFile (JucerDocument& document, TestComponent* comp, const String& newFilename)
|
||||
{
|
||||
jassert (comp != 0);
|
||||
|
||||
if (comp != 0)
|
||||
document.perform (new JucerCompFileChangeAction (comp, *document.getComponentLayout(), newFilename),
|
||||
"Change Jucer component file");
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class JucerCompFileProperty : public FilePropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
JucerCompFileProperty (TestComponent* const component_, JucerDocument& document_)
|
||||
: FilePropertyComponent ("Jucer file", false, true),
|
||||
component (component_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~JucerCompFileProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setFile (const File& newFile)
|
||||
{
|
||||
setJucerComponentFile (document, component,
|
||||
newFile.getRelativePathFrom (document.getFile().getParentDirectory())
|
||||
.replaceCharacter ('\\', '/'));
|
||||
}
|
||||
|
||||
File getFile() const
|
||||
{
|
||||
return component->findFile();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
private:
|
||||
TestComponent* const component;
|
||||
JucerDocument& document;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class JucerCompOpenDocProperty : public ButtonPropertyComponent
|
||||
{
|
||||
public:
|
||||
JucerCompOpenDocProperty (TestComponent* const component_)
|
||||
: ButtonPropertyComponent ("edit", false),
|
||||
component (component_)
|
||||
{
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
MainWindow* const mw = findParentComponentOfClass<MainWindow>();
|
||||
|
||||
jassert (mw != 0);
|
||||
if (mw != 0)
|
||||
mw->openFile (component->findFile());
|
||||
}
|
||||
|
||||
String getButtonText() const
|
||||
{
|
||||
return "Open file for editing";
|
||||
}
|
||||
|
||||
private:
|
||||
TestComponent* const component;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ConstructorParamsProperty : public ComponentTextProperty <TestComponent>
|
||||
{
|
||||
public:
|
||||
ConstructorParamsProperty (TestComponent* comp, JucerDocument& document)
|
||||
: ComponentTextProperty <TestComponent> ("constructor params", 512, false, comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ConstructorParamChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change Viewport content constructor params");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getConstructorParams();
|
||||
}
|
||||
|
||||
private:
|
||||
int tabIndex;
|
||||
|
||||
class ConstructorParamChangeAction : public ComponentUndoableAction <TestComponent>
|
||||
{
|
||||
public:
|
||||
ConstructorParamChangeAction (TestComponent* const comp, ComponentLayout& layout, const String& newValue_)
|
||||
: ComponentUndoableAction <TestComponent> (comp, layout),
|
||||
newValue (newValue_)
|
||||
{
|
||||
oldValue = comp->getConstructorParams();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setConstructorParams (newValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setConstructorParams (oldValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newValue, oldValue;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_JUCERCOMPONENTHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,656 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_LABELHANDLER_JUCEHEADER__
|
||||
#define __JUCER_LABELHANDLER_JUCEHEADER__
|
||||
|
||||
#include "../../properties/jucer_JustificationProperty.h"
|
||||
#include "../../properties/jucer_FontPropertyComponent.h"
|
||||
#include "../../properties/jucer_ComponentBooleanProperty.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class LabelHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
LabelHandler()
|
||||
: ComponentTypeHandler ("Label", "Label", typeid (Label), 150, 24)
|
||||
{
|
||||
registerColour (Label::backgroundColourId, "background", "bkgCol");
|
||||
registerColour (Label::textColourId, "text", "textCol");
|
||||
registerColour (Label::outlineColourId, "outline", "outlineCol");
|
||||
registerColour (TextEditor::textColourId, "editor text", "edTextCol");
|
||||
registerColour (TextEditor::backgroundColourId, "editor bkg", "edBkgCol");
|
||||
registerColour (TextEditor::highlightColourId, "highlight", "hiliteCol");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new Label ("new label", "label text");
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
Label* const l = dynamic_cast <Label*> (comp);
|
||||
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
e->setAttribute ("labelText", l->getText());
|
||||
|
||||
e->setAttribute ("editableSingleClick", l->isEditableOnSingleClick());
|
||||
e->setAttribute ("editableDoubleClick", l->isEditableOnDoubleClick());
|
||||
e->setAttribute ("focusDiscardsChanges", l->doesLossOfFocusDiscardChanges());
|
||||
|
||||
e->setAttribute ("fontname", l->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont).toString());
|
||||
e->setAttribute ("fontsize", roundToInt (l->getFont().getHeight() * 100.0) / 100.0);
|
||||
e->setAttribute ("bold", l->getFont().isBold());
|
||||
e->setAttribute ("italic", l->getFont().isItalic());
|
||||
e->setAttribute ("justification", l->getJustificationType().getFlags());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
Label* const l = dynamic_cast <Label*> (comp);
|
||||
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
Label defaultLabel (String::empty, String::empty);
|
||||
|
||||
Font font;
|
||||
font.setHeight ((float) xml.getDoubleAttribute ("fontsize", 15.0));
|
||||
font.setBold (xml.getBoolAttribute ("bold", false));
|
||||
font.setItalic (xml.getBoolAttribute ("italic", false));
|
||||
l->setFont (font);
|
||||
|
||||
l->getProperties().set ("typefaceName", xml.getStringAttribute ("fontname", FontPropertyComponent::defaultFont));
|
||||
updateLabelFont (l);
|
||||
|
||||
l->setJustificationType (Justification (xml.getIntAttribute ("justification", Justification::centred)));
|
||||
|
||||
l->setText (xml.getStringAttribute ("labelText", "Label Text"), dontSendNotification);
|
||||
|
||||
l->setEditable (xml.getBoolAttribute ("editableSingleClick", defaultLabel.isEditableOnSingleClick()),
|
||||
xml.getBoolAttribute ("editableDoubleClick", defaultLabel.isEditableOnDoubleClick()),
|
||||
xml.getBoolAttribute ("focusDiscardsChanges", defaultLabel.doesLossOfFocusDiscardChanges()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void updateLabelFont (Label* label)
|
||||
{
|
||||
Font f (label->getFont());
|
||||
f = FontPropertyComponent::applyNameToFont (label->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont), f);
|
||||
label->setFont (f);
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* component)
|
||||
{
|
||||
Label* const l = dynamic_cast <Label*> (component);
|
||||
|
||||
return quotedString (component->getName())
|
||||
+ ",\n"
|
||||
+ quotedString (l->getText());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
Label* const l = dynamic_cast <Label*> (component);
|
||||
|
||||
String s;
|
||||
|
||||
s << memberVariableName << "->setFont ("
|
||||
<< FontPropertyComponent::getCompleteFontCode (l->getFont(), l->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont))
|
||||
<< ");\n"
|
||||
<< memberVariableName << "->setJustificationType ("
|
||||
<< justificationToCode (l->getJustificationType())
|
||||
<< ");\n"
|
||||
<< memberVariableName << "->setEditable ("
|
||||
<< boolToString (l->isEditableOnSingleClick()) << ", "
|
||||
<< boolToString (l->isEditableOnDoubleClick()) << ", "
|
||||
<< boolToString (l->doesLossOfFocusDiscardChanges()) << ");\n"
|
||||
<< getColourIntialisationCode (component, memberVariableName);
|
||||
|
||||
if (needsCallback (component))
|
||||
s << memberVariableName << "->addListener (this);\n";
|
||||
|
||||
s << '\n';
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (Component* component, GeneratedCode& code)
|
||||
{
|
||||
ComponentTypeHandler::fillInGeneratedCode (component, code);
|
||||
|
||||
if (needsCallback (component))
|
||||
{
|
||||
String& callback = code.getCallbackCode ("public LabelListener",
|
||||
"void",
|
||||
"labelTextChanged (Label* labelThatHasChanged)",
|
||||
true);
|
||||
|
||||
if (callback.trim().isNotEmpty())
|
||||
callback << "else ";
|
||||
|
||||
const String memberVariableName (code.document->getComponentLayout()->getComponentMemberVariableName (component));
|
||||
const String userCodeComment ("UserLabelCode_" + memberVariableName);
|
||||
|
||||
callback
|
||||
<< "if (labelThatHasChanged == " << memberVariableName
|
||||
<< ")\n{\n //[" << userCodeComment << "] -- add your label text handling code here..\n //[/" << userCodeComment << "]\n}\n";
|
||||
}
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
Label* const l = dynamic_cast <Label*> (component);
|
||||
properties.add (new LabelTextProperty (l, document));
|
||||
|
||||
properties.add (new LabelJustificationProperty (l, document));
|
||||
properties.add (new FontNameProperty (l, document));
|
||||
properties.add (new FontSizeProperty (l, document));
|
||||
properties.add (new FontStyleProperty (l, document));
|
||||
|
||||
addColourProperties (component, document, properties);
|
||||
|
||||
properties.add (new LabelEditableProperty (l, document));
|
||||
|
||||
if (l->isEditableOnDoubleClick() || l->isEditableOnSingleClick())
|
||||
properties.add (new LabelLossOfFocusProperty (l, document));
|
||||
}
|
||||
|
||||
static bool needsCallback (Component* label)
|
||||
{
|
||||
return ((Label*) label)->isEditableOnSingleClick()
|
||||
|| ((Label*) label)->isEditableOnDoubleClick(); // xxx should be configurable
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//==============================================================================
|
||||
class LabelTextProperty : public ComponentTextProperty <Label>
|
||||
{
|
||||
public:
|
||||
LabelTextProperty (Label* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <Label> ("text", 10000, true, component_, document_)
|
||||
{}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new LabelTextChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change Label text");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getText();
|
||||
}
|
||||
|
||||
private:
|
||||
class LabelTextChangeAction : public ComponentUndoableAction <Label>
|
||||
{
|
||||
public:
|
||||
LabelTextChangeAction (Label* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <Label> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getText();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setText (newState, dontSendNotification);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setText (oldState, dontSendNotification);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class LabelEditableProperty : public ComponentChoiceProperty <Label>
|
||||
{
|
||||
public:
|
||||
LabelEditableProperty (Label* component_,
|
||||
JucerDocument& document_)
|
||||
: ComponentChoiceProperty <Label> ("editing", component_, document_)
|
||||
{
|
||||
choices.add ("read-only");
|
||||
choices.add ("edit on single-click");
|
||||
choices.add ("edit on double-click");
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
document.perform (new LabelEditableChangeAction (component, *document.getComponentLayout(), newIndex),
|
||||
"Change Label editability");
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
return component->isEditableOnSingleClick()
|
||||
? 1
|
||||
: (component->isEditableOnDoubleClick() ? 2 : 0);
|
||||
}
|
||||
|
||||
private:
|
||||
class LabelEditableChangeAction : public ComponentUndoableAction <Label>
|
||||
{
|
||||
public:
|
||||
LabelEditableChangeAction (Label* const comp, ComponentLayout& layout, const int newState_)
|
||||
: ComponentUndoableAction <Label> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isEditableOnSingleClick()
|
||||
? 1
|
||||
: (comp->isEditableOnDoubleClick() ? 2 : 0);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setEditable (newState == 1, newState >= 1, getComponent()->doesLossOfFocusDiscardChanges());
|
||||
changed();
|
||||
layout.getSelectedSet().changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setEditable (oldState == 1, oldState >= 1, getComponent()->doesLossOfFocusDiscardChanges());
|
||||
changed();
|
||||
layout.getSelectedSet().changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
int newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class LabelLossOfFocusProperty : public ComponentChoiceProperty <Label>
|
||||
{
|
||||
public:
|
||||
LabelLossOfFocusProperty (Label* component_, JucerDocument& document_)
|
||||
: ComponentChoiceProperty <Label> ("focus", component_, document_)
|
||||
{
|
||||
choices.add ("loss of focus discards changes");
|
||||
choices.add ("loss of focus commits changes");
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
document.perform (new LabelFocusLossChangeAction (component, *document.getComponentLayout(), newIndex == 0),
|
||||
"Change Label focus behaviour");
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
return component->doesLossOfFocusDiscardChanges() ? 0 : 1;
|
||||
}
|
||||
|
||||
private:
|
||||
class LabelFocusLossChangeAction : public ComponentUndoableAction <Label>
|
||||
{
|
||||
public:
|
||||
LabelFocusLossChangeAction (Label* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <Label> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->doesLossOfFocusDiscardChanges();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setEditable (getComponent()->isEditableOnSingleClick(),
|
||||
getComponent()->isEditableOnDoubleClick(),
|
||||
newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setEditable (getComponent()->isEditableOnSingleClick(),
|
||||
getComponent()->isEditableOnDoubleClick(),
|
||||
oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class LabelJustificationProperty : public JustificationProperty,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
LabelJustificationProperty (Label* const label_, JucerDocument& document_)
|
||||
: JustificationProperty ("layout", false),
|
||||
label (label_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~LabelJustificationProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setJustification (const Justification& newJustification)
|
||||
{
|
||||
document.perform (new LabelJustifyChangeAction (label, *document.getComponentLayout(), newJustification),
|
||||
"Change Label justification");
|
||||
}
|
||||
|
||||
const Justification getJustification() const
|
||||
{
|
||||
return label->getJustificationType();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
JucerDocument& document;
|
||||
|
||||
class LabelJustifyChangeAction : public ComponentUndoableAction <Label>
|
||||
{
|
||||
public:
|
||||
LabelJustifyChangeAction (Label* const comp, ComponentLayout& layout, const Justification& newState_)
|
||||
: ComponentUndoableAction <Label> (comp, layout),
|
||||
newState (newState_),
|
||||
oldState (comp->getJustificationType())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setJustificationType (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setJustificationType (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
Justification newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class FontNameProperty : public FontPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
FontNameProperty (Label* const label_, JucerDocument& document_)
|
||||
: FontPropertyComponent ("font"),
|
||||
label (label_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~FontNameProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setTypefaceName (const String& newFontName)
|
||||
{
|
||||
document.perform (new FontNameChangeAction (label, *document.getComponentLayout(), newFontName),
|
||||
"Change Label typeface");
|
||||
}
|
||||
|
||||
String getTypefaceName() const
|
||||
{
|
||||
return label->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont);
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
JucerDocument& document;
|
||||
|
||||
class FontNameChangeAction : public ComponentUndoableAction <Label>
|
||||
{
|
||||
public:
|
||||
FontNameChangeAction (Label* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <Label> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->getProperties().set ("typefaceName", newState);
|
||||
LabelHandler::updateLabelFont (getComponent());
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->getProperties().set ("typefaceName", oldState);
|
||||
LabelHandler::updateLabelFont (getComponent());
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class FontSizeProperty : public SliderPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
FontSizeProperty (Label* const label_, JucerDocument& document_)
|
||||
: SliderPropertyComponent ("size", 1.0, 250.0, 0.1, 0.3),
|
||||
label (label_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~FontSizeProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setValue (double newValue)
|
||||
{
|
||||
document.getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
document.perform (new FontSizeChangeAction (label, *document.getComponentLayout(), (float) newValue),
|
||||
"Change Label font size");
|
||||
}
|
||||
|
||||
double getValue() const
|
||||
{
|
||||
return label->getFont().getHeight();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
JucerDocument& document;
|
||||
|
||||
class FontSizeChangeAction : public ComponentUndoableAction <Label>
|
||||
{
|
||||
public:
|
||||
FontSizeChangeAction (Label* const comp, ComponentLayout& layout, const float newState_)
|
||||
: ComponentUndoableAction <Label> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getFont().getHeight();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
Font f (getComponent()->getFont());
|
||||
f.setHeight ((float) newState);
|
||||
getComponent()->setFont (f);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
Font f (getComponent()->getFont());
|
||||
f.setHeight ((float) oldState);
|
||||
getComponent()->setFont (f);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
float newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class FontStyleProperty : public ChoicePropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
FontStyleProperty (Label* const label_, JucerDocument& document_)
|
||||
: ChoicePropertyComponent ("style"),
|
||||
label (label_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
|
||||
choices.add ("normal");
|
||||
choices.add ("bold");
|
||||
choices.add ("italic");
|
||||
choices.add ("bold + italic");
|
||||
}
|
||||
|
||||
~FontStyleProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
Font f (label->getFont());
|
||||
|
||||
f.setBold (newIndex == 1 || newIndex == 3);
|
||||
f.setItalic (newIndex == 2 || newIndex == 3);
|
||||
|
||||
document.perform (new FontStyleChangeAction (label, *document.getComponentLayout(), f),
|
||||
"Change Label font style");
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
if (label->getFont().isBold() && label->getFont().isItalic())
|
||||
return 3;
|
||||
else if (label->getFont().isBold())
|
||||
return 1;
|
||||
else if (label->getFont().isItalic())
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
Label* const label;
|
||||
JucerDocument& document;
|
||||
|
||||
class FontStyleChangeAction : public ComponentUndoableAction <Label>
|
||||
{
|
||||
public:
|
||||
FontStyleChangeAction (Label* const comp, ComponentLayout& layout, const Font& newState_)
|
||||
: ComponentUndoableAction <Label> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getFont();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setFont (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setFont (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
Font newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_LABELHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,740 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_SLIDERHANDLER_JUCEHEADER__
|
||||
#define __JUCER_SLIDERHANDLER_JUCEHEADER__
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class SliderHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
SliderHandler()
|
||||
: ComponentTypeHandler ("Slider", "Slider", typeid (Slider), 150, 24)
|
||||
{
|
||||
registerColour (Slider::backgroundColourId, "background", "bkgcol");
|
||||
registerColour (Slider::thumbColourId, "thumb", "thumbcol");
|
||||
registerColour (Slider::trackColourId, "track", "trackcol");
|
||||
registerColour (Slider::rotarySliderFillColourId, "rotary fill", "rotarysliderfill");
|
||||
registerColour (Slider::rotarySliderOutlineColourId, "rotary outln", "rotaryslideroutline");
|
||||
registerColour (Slider::textBoxTextColourId, "textbox text", "textboxtext");
|
||||
registerColour (Slider::textBoxBackgroundColourId, "textbox bkgd", "textboxbkgd");
|
||||
registerColour (Slider::textBoxHighlightColourId, "textbox highlt", "textboxhighlight");
|
||||
registerColour (Slider::textBoxOutlineColourId, "textbox outln", "textboxoutline");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new Slider ("new slider");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
|
||||
Slider* const s = dynamic_cast <Slider*> (comp);
|
||||
e->setAttribute ("min", s->getMinimum());
|
||||
e->setAttribute ("max", s->getMaximum());
|
||||
e->setAttribute ("int", s->getInterval());
|
||||
e->setAttribute ("style", sliderStyleToString (s->getSliderStyle()));
|
||||
e->setAttribute ("textBoxPos", textBoxPosToString (s->getTextBoxPosition()));
|
||||
e->setAttribute ("textBoxEditable", s->isTextBoxEditable());
|
||||
e->setAttribute ("textBoxWidth", s->getTextBoxWidth());
|
||||
e->setAttribute ("textBoxHeight", s->getTextBoxHeight());
|
||||
e->setAttribute ("skewFactor", s->getSkewFactor());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
Slider* const s = dynamic_cast <Slider*> (comp);
|
||||
|
||||
s->setRange (xml.getDoubleAttribute ("min", 0.0),
|
||||
xml.getDoubleAttribute ("max", 10.0),
|
||||
xml.getDoubleAttribute ("int", 0.0));
|
||||
|
||||
s->setSliderStyle (sliderStringToStyle (xml.getStringAttribute ("style", "LinearHorizontal")));
|
||||
|
||||
s->setTextBoxStyle (stringToTextBoxPos (xml.getStringAttribute ("textBoxPos", "TextBoxLeft")),
|
||||
! xml.getBoolAttribute ("textBoxEditable", true),
|
||||
xml.getIntAttribute ("textBoxWidth", 80),
|
||||
xml.getIntAttribute ("textBoxHeight", 20));
|
||||
|
||||
s->setSkewFactor (xml.getDoubleAttribute ("skewFactor", 1.0));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String getCreationParameters (Component* component)
|
||||
{
|
||||
return quotedString (component->getName());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
Slider* const s = dynamic_cast <Slider*> (component);
|
||||
|
||||
String r;
|
||||
r << memberVariableName << "->setRange ("
|
||||
<< s->getMinimum() << ", " << s->getMaximum() << ", " << s->getInterval()
|
||||
<< ");\n"
|
||||
<< memberVariableName << "->setSliderStyle (Slider::"
|
||||
<< sliderStyleToString (s->getSliderStyle()) << ");\n"
|
||||
<< memberVariableName << "->setTextBoxStyle (Slider::"
|
||||
<< textBoxPosToString (s->getTextBoxPosition())
|
||||
<< ", " << boolToString (! s->isTextBoxEditable())
|
||||
<< ", " << s->getTextBoxWidth() << ", " << s->getTextBoxHeight() << ");\n"
|
||||
<< getColourIntialisationCode (component, memberVariableName);
|
||||
|
||||
if (needsCallback (component))
|
||||
r << memberVariableName << "->addListener (this);\n";
|
||||
|
||||
if (s->getSkewFactor() != 1.0)
|
||||
r << memberVariableName << "->setSkewFactor (" << s->getSkewFactor() << ");\n";
|
||||
|
||||
r << '\n';
|
||||
code.constructorCode += r;
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (Component* component, GeneratedCode& code)
|
||||
{
|
||||
ComponentTypeHandler::fillInGeneratedCode (component, code);
|
||||
|
||||
if (needsCallback (component))
|
||||
{
|
||||
String& callback = code.getCallbackCode ("public SliderListener",
|
||||
"void",
|
||||
"sliderValueChanged (Slider* sliderThatWasMoved)",
|
||||
true);
|
||||
|
||||
if (callback.isNotEmpty())
|
||||
callback << "else ";
|
||||
|
||||
const String memberVariableName (code.document->getComponentLayout()->getComponentMemberVariableName (component));
|
||||
const String userCodeComment ("UserSliderCode_" + memberVariableName);
|
||||
|
||||
callback
|
||||
<< "if (sliderThatWasMoved == " << memberVariableName
|
||||
<< ")\n{\n //[" << userCodeComment << "] -- add your slider handling code here..\n //[/" << userCodeComment << "]\n}\n";
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
Slider* s = dynamic_cast <Slider*> (component);
|
||||
jassert (s != 0);
|
||||
|
||||
properties.add (new SliderRangeProperty (s, document, "minimum", 0));
|
||||
properties.add (new SliderRangeProperty (s, document, "maximum", 1));
|
||||
properties.add (new SliderRangeProperty (s, document, "interval", 2));
|
||||
properties.add (new SliderTypeProperty (s, document));
|
||||
properties.add (new SliderTextboxProperty (s, document));
|
||||
properties.add (new SliderTextboxEditableProperty (s, document));
|
||||
properties.add (new SliderTextboxSizeProperty (s, document, true));
|
||||
properties.add (new SliderTextboxSizeProperty (s, document, false));
|
||||
properties.add (new SliderSkewProperty (s, document));
|
||||
|
||||
addColourProperties (component, document, properties);
|
||||
}
|
||||
|
||||
static bool needsCallback (Component* slider)
|
||||
{
|
||||
return true; //xxx should be a property
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class SliderTypeProperty : public ComponentChoiceProperty <Slider>
|
||||
{
|
||||
public:
|
||||
SliderTypeProperty (Slider* slider, JucerDocument& document)
|
||||
: ComponentChoiceProperty <Slider> ("type", slider, document)
|
||||
{
|
||||
choices.add ("Linear Horizontal");
|
||||
choices.add ("Linear Vertical");
|
||||
choices.add ("Linear Bar");
|
||||
choices.add ("Rotary");
|
||||
choices.add ("Rotary HorizontalDrag");
|
||||
choices.add ("Rotary VerticalDrag");
|
||||
choices.add ("Rotary HorizontalVerticalDrag");
|
||||
choices.add ("Inc/Dec Buttons");
|
||||
choices.add ("Two Value Horizontal");
|
||||
choices.add ("Two Value Vertical");
|
||||
choices.add ("Three Value Horizontal");
|
||||
choices.add ("Three Value Vertical");
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
const Slider::SliderStyle types[] = { Slider::LinearHorizontal,
|
||||
Slider::LinearVertical,
|
||||
Slider::LinearBar,
|
||||
Slider::Rotary,
|
||||
Slider::RotaryHorizontalDrag,
|
||||
Slider::RotaryVerticalDrag,
|
||||
Slider::RotaryHorizontalVerticalDrag,
|
||||
Slider::IncDecButtons,
|
||||
Slider::TwoValueHorizontal,
|
||||
Slider::TwoValueVertical,
|
||||
Slider::ThreeValueHorizontal,
|
||||
Slider::ThreeValueVertical };
|
||||
|
||||
if (newIndex >= 0 && newIndex < numElementsInArray (types))
|
||||
{
|
||||
document.perform (new SliderTypeChangeAction (component, *document.getComponentLayout(), types [newIndex]),
|
||||
"Change Slider style");
|
||||
}
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
const Slider::SliderStyle types[] = { Slider::LinearHorizontal,
|
||||
Slider::LinearVertical,
|
||||
Slider::LinearBar,
|
||||
Slider::Rotary,
|
||||
Slider::RotaryHorizontalDrag,
|
||||
Slider::RotaryVerticalDrag,
|
||||
Slider::RotaryHorizontalVerticalDrag,
|
||||
Slider::IncDecButtons,
|
||||
Slider::TwoValueHorizontal,
|
||||
Slider::TwoValueVertical,
|
||||
Slider::ThreeValueHorizontal,
|
||||
Slider::ThreeValueVertical };
|
||||
|
||||
for (int i = 0; i < numElementsInArray (types); ++i)
|
||||
if (types [i] == dynamic_cast <Slider*> (component)->getSliderStyle())
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private:
|
||||
class SliderTypeChangeAction : public ComponentUndoableAction <Slider>
|
||||
{
|
||||
public:
|
||||
SliderTypeChangeAction (Slider* const comp, ComponentLayout& layout, const Slider::SliderStyle newState_)
|
||||
: ComponentUndoableAction <Slider> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getSliderStyle();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setSliderStyle (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setSliderStyle (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
Slider::SliderStyle newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class SliderTextboxProperty : public ComponentChoiceProperty <Slider>
|
||||
{
|
||||
public:
|
||||
SliderTextboxProperty (Slider* slider, JucerDocument& document)
|
||||
: ComponentChoiceProperty <Slider> ("text position", slider, document)
|
||||
{
|
||||
choices.add ("No text box");
|
||||
choices.add ("Text box on left");
|
||||
choices.add ("Text box on right");
|
||||
choices.add ("Text box above");
|
||||
choices.add ("Text box below");
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
const Slider::TextEntryBoxPosition types[] = { Slider::NoTextBox,
|
||||
Slider::TextBoxLeft,
|
||||
Slider::TextBoxRight,
|
||||
Slider::TextBoxAbove,
|
||||
Slider::TextBoxBelow };
|
||||
|
||||
if (newIndex >= 0 && newIndex < numElementsInArray (types))
|
||||
{
|
||||
document.perform (new SliderTextBoxChangeAction (component, *document.getComponentLayout(), types [newIndex]),
|
||||
"Change Slider textbox");
|
||||
}
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
const Slider::TextEntryBoxPosition types[] = { Slider::NoTextBox,
|
||||
Slider::TextBoxLeft,
|
||||
Slider::TextBoxRight,
|
||||
Slider::TextBoxAbove,
|
||||
Slider::TextBoxBelow };
|
||||
|
||||
for (int i = 0; i < numElementsInArray (types); ++i)
|
||||
if (types [i] == component->getTextBoxPosition())
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private:
|
||||
class SliderTextBoxChangeAction : public ComponentUndoableAction <Slider>
|
||||
{
|
||||
public:
|
||||
SliderTextBoxChangeAction (Slider* const comp, ComponentLayout& layout, const Slider::TextEntryBoxPosition newState_)
|
||||
: ComponentUndoableAction <Slider> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getTextBoxPosition();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextBoxStyle (newState,
|
||||
! getComponent()->isTextBoxEditable(),
|
||||
getComponent()->getTextBoxWidth(),
|
||||
getComponent()->getTextBoxHeight());
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextBoxStyle (oldState,
|
||||
! getComponent()->isTextBoxEditable(),
|
||||
getComponent()->getTextBoxWidth(),
|
||||
getComponent()->getTextBoxHeight());
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
Slider::TextEntryBoxPosition newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class SliderTextboxEditableProperty : public ComponentBooleanProperty <Slider>
|
||||
{
|
||||
public:
|
||||
SliderTextboxEditableProperty (Slider* slider, JucerDocument& document)
|
||||
: ComponentBooleanProperty <Slider> ("text box mode", "Editable", "Editable", slider, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new SliderEditableChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change Slider editability");
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return component->isTextBoxEditable();
|
||||
}
|
||||
|
||||
private:
|
||||
class SliderEditableChangeAction : public ComponentUndoableAction <Slider>
|
||||
{
|
||||
public:
|
||||
SliderEditableChangeAction (Slider* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <Slider> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isTextBoxEditable();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextBoxIsEditable (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setTextBoxIsEditable (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class SliderTextboxSizeProperty : public ComponentTextProperty <Slider>
|
||||
{
|
||||
public:
|
||||
SliderTextboxSizeProperty (Slider* slider, JucerDocument& document, const bool isWidth_)
|
||||
: ComponentTextProperty <Slider> (isWidth_ ? "text box width" : "text box height",
|
||||
12, false, slider, document),
|
||||
isWidth (isWidth_)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new SliderBoxSizeChangeAction (component, *document.getComponentLayout(), isWidth, newText.getIntValue()),
|
||||
"Change Slider textbox size");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return String (isWidth ? component->getTextBoxWidth()
|
||||
: component->getTextBoxHeight());
|
||||
}
|
||||
|
||||
private:
|
||||
const bool isWidth;
|
||||
|
||||
class SliderBoxSizeChangeAction : public ComponentUndoableAction <Slider>
|
||||
{
|
||||
public:
|
||||
SliderBoxSizeChangeAction (Slider* const comp, ComponentLayout& layout, const bool isWidth_, int newSize_)
|
||||
: ComponentUndoableAction <Slider> (comp, layout),
|
||||
isWidth (isWidth_),
|
||||
newSize (newSize_)
|
||||
{
|
||||
oldSize = isWidth ? comp->getTextBoxWidth()
|
||||
: comp->getTextBoxHeight();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
|
||||
if (isWidth)
|
||||
getComponent()->setTextBoxStyle (getComponent()->getTextBoxPosition(),
|
||||
! getComponent()->isTextBoxEditable(),
|
||||
newSize,
|
||||
getComponent()->getTextBoxHeight());
|
||||
else
|
||||
getComponent()->setTextBoxStyle (getComponent()->getTextBoxPosition(),
|
||||
! getComponent()->isTextBoxEditable(),
|
||||
getComponent()->getTextBoxWidth(),
|
||||
newSize);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
|
||||
if (isWidth)
|
||||
getComponent()->setTextBoxStyle (getComponent()->getTextBoxPosition(),
|
||||
! getComponent()->isTextBoxEditable(),
|
||||
oldSize,
|
||||
getComponent()->getTextBoxHeight());
|
||||
else
|
||||
getComponent()->setTextBoxStyle (getComponent()->getTextBoxPosition(),
|
||||
! getComponent()->isTextBoxEditable(),
|
||||
getComponent()->getTextBoxWidth(),
|
||||
oldSize);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isWidth;
|
||||
int newSize, oldSize;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class SliderRangeProperty : public ComponentTextProperty <Slider>
|
||||
{
|
||||
public:
|
||||
SliderRangeProperty (Slider* slider, JucerDocument& document,
|
||||
const String& name, const int rangeParam_)
|
||||
: ComponentTextProperty <Slider> (name, 15, false, slider, document),
|
||||
rangeParam (rangeParam_)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
double state [3];
|
||||
state [0] = component->getMinimum();
|
||||
state [1] = component->getMaximum();
|
||||
state [2] = component->getInterval();
|
||||
|
||||
state [rangeParam] = newText.getDoubleValue();
|
||||
|
||||
document.perform (new SliderRangeChangeAction (component, *document.getComponentLayout(), state),
|
||||
"Change Slider range");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
Slider* s = dynamic_cast <Slider*> (component);
|
||||
jassert (s != 0);
|
||||
|
||||
switch (rangeParam)
|
||||
{
|
||||
case 0:
|
||||
return String (s->getMinimum());
|
||||
|
||||
case 1:
|
||||
return String (s->getMaximum());
|
||||
|
||||
case 2:
|
||||
return String (s->getInterval());
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return String::empty;
|
||||
}
|
||||
|
||||
private:
|
||||
const int rangeParam;
|
||||
|
||||
class SliderRangeChangeAction : public ComponentUndoableAction <Slider>
|
||||
{
|
||||
public:
|
||||
SliderRangeChangeAction (Slider* const comp, ComponentLayout& layout, const double newState_[3])
|
||||
: ComponentUndoableAction <Slider> (comp, layout)
|
||||
{
|
||||
newState [0] = newState_ [0];
|
||||
newState [1] = newState_ [1];
|
||||
newState [2] = newState_ [2];
|
||||
|
||||
oldState [0] = comp->getMinimum();
|
||||
oldState [1] = comp->getMaximum();
|
||||
oldState [2] = comp->getInterval();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setRange (newState[0], newState[1], newState[2]);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setRange (oldState[0], oldState[1], oldState[2]);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
double newState[3], oldState[3];
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class SliderSkewProperty : public ComponentTextProperty <Slider>
|
||||
{
|
||||
public:
|
||||
SliderSkewProperty (Slider* slider, JucerDocument& document)
|
||||
: ComponentTextProperty <Slider> ("skew factor", 12, false, slider, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
const double skew = jlimit (0.001, 1000.0, newText.getDoubleValue());
|
||||
|
||||
document.perform (new SliderSkewChangeAction (component, *document.getComponentLayout(), skew),
|
||||
"Change Slider skew");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
Slider* s = dynamic_cast <Slider*> (component);
|
||||
jassert (s != 0);
|
||||
|
||||
return String (s->getSkewFactor());
|
||||
}
|
||||
|
||||
private:
|
||||
class SliderSkewChangeAction : public ComponentUndoableAction <Slider>
|
||||
{
|
||||
public:
|
||||
SliderSkewChangeAction (Slider* const comp, ComponentLayout& layout, const double newValue_)
|
||||
: ComponentUndoableAction <Slider> (comp, layout)
|
||||
{
|
||||
newValue = newValue_;
|
||||
oldValue = comp->getSkewFactor();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setSkewFactor (newValue);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setSkewFactor (oldValue);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
double newValue, oldValue;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
static const String sliderStyleToString (Slider::SliderStyle style)
|
||||
{
|
||||
switch (style)
|
||||
{
|
||||
case Slider::LinearHorizontal:
|
||||
return "LinearHorizontal";
|
||||
case Slider::LinearVertical:
|
||||
return "LinearVertical";
|
||||
case Slider::LinearBar:
|
||||
return "LinearBar";
|
||||
case Slider::Rotary:
|
||||
return "Rotary";
|
||||
case Slider::RotaryHorizontalDrag:
|
||||
return "RotaryHorizontalDrag";
|
||||
case Slider::RotaryVerticalDrag:
|
||||
return "RotaryVerticalDrag";
|
||||
case Slider::RotaryHorizontalVerticalDrag:
|
||||
return "RotaryHorizontalVerticalDrag";
|
||||
case Slider::IncDecButtons:
|
||||
return "IncDecButtons";
|
||||
case Slider::TwoValueHorizontal:
|
||||
return "TwoValueHorizontal";
|
||||
case Slider::TwoValueVertical:
|
||||
return "TwoValueVertical";
|
||||
case Slider::ThreeValueHorizontal:
|
||||
return "ThreeValueHorizontal";
|
||||
case Slider::ThreeValueVertical:
|
||||
return "ThreeValueVertical";
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return String::empty;
|
||||
}
|
||||
|
||||
static Slider::SliderStyle sliderStringToStyle (const String& s)
|
||||
{
|
||||
if (s == "LinearHorizontal")
|
||||
return Slider::LinearHorizontal;
|
||||
else if (s == "LinearVertical")
|
||||
return Slider::LinearVertical;
|
||||
else if (s == "LinearBar")
|
||||
return Slider::LinearBar;
|
||||
else if (s == "Rotary")
|
||||
return Slider::Rotary;
|
||||
else if (s == "RotaryHorizontalDrag")
|
||||
return Slider::RotaryHorizontalDrag;
|
||||
else if (s == "RotaryVerticalDrag")
|
||||
return Slider::RotaryVerticalDrag;
|
||||
else if (s == "RotaryHorizontalVerticalDrag")
|
||||
return Slider::RotaryHorizontalVerticalDrag;
|
||||
else if (s == "IncDecButtons")
|
||||
return Slider::IncDecButtons;
|
||||
else if (s.startsWithIgnoreCase ("TwoValueHoriz"))
|
||||
return Slider::TwoValueHorizontal;
|
||||
else if (s.startsWithIgnoreCase ("TwoValueVert"))
|
||||
return Slider::TwoValueVertical;
|
||||
else if (s.startsWithIgnoreCase ("ThreeValueHoriz"))
|
||||
return Slider::ThreeValueHorizontal;
|
||||
else if (s.startsWithIgnoreCase ("ThreeValueVert"))
|
||||
return Slider::ThreeValueVertical;
|
||||
|
||||
jassertfalse
|
||||
return Slider::LinearHorizontal;
|
||||
}
|
||||
|
||||
static const String textBoxPosToString (const Slider::TextEntryBoxPosition pos)
|
||||
{
|
||||
switch (pos)
|
||||
{
|
||||
case Slider::NoTextBox:
|
||||
return "NoTextBox";
|
||||
case Slider::TextBoxLeft:
|
||||
return "TextBoxLeft";
|
||||
case Slider::TextBoxRight:
|
||||
return "TextBoxRight";
|
||||
case Slider::TextBoxAbove:
|
||||
return "TextBoxAbove";
|
||||
case Slider::TextBoxBelow:
|
||||
return "TextBoxBelow";
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return String::empty;
|
||||
}
|
||||
|
||||
static const Slider::TextEntryBoxPosition stringToTextBoxPos (const String& s)
|
||||
{
|
||||
if (s == "NoTextBox")
|
||||
return Slider::NoTextBox;
|
||||
else if (s == "TextBoxLeft")
|
||||
return Slider::TextBoxLeft;
|
||||
else if (s == "TextBoxRight")
|
||||
return Slider::TextBoxRight;
|
||||
else if (s == "TextBoxAbove")
|
||||
return Slider::TextBoxAbove;
|
||||
else if (s == "TextBoxBelow")
|
||||
return Slider::TextBoxBelow;
|
||||
|
||||
jassertfalse
|
||||
return Slider::TextBoxLeft;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_SLIDERHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_TEXTBUTTONHANDLER_JUCEHEADER__
|
||||
#define __JUCER_TEXTBUTTONHANDLER_JUCEHEADER__
|
||||
|
||||
#include "jucer_ButtonHandler.h"
|
||||
#include "../../properties/jucer_ComponentColourProperty.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class TextButtonHandler : public ButtonHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
TextButtonHandler()
|
||||
: ButtonHandler ("Text Button", "TextButton", typeid (TextButton), 150, 24)
|
||||
{
|
||||
registerColour (TextButton::buttonColourId, "background (normal)", "bgColOff");
|
||||
registerColour (TextButton::buttonOnColourId, "background (on)", "bgColOn");
|
||||
registerColour (TextButton::textColourOnId, "text colour (normal)", "textCol");
|
||||
registerColour (TextButton::textColourOffId, "text colour (on)", "textColOn");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new TextButton ("new button", String::empty);
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ButtonHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
addColourProperties (component, document, properties);
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
XmlElement* e = ButtonHandler::createXmlFor (comp, layout);
|
||||
|
||||
//TextButton* tb = (TextButton*) comp;
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ButtonHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
//TextButton* tb = (TextButton*) comp;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ButtonHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
//TextButton* const tb = dynamic_cast <TextButton*> (component);
|
||||
//TextButton defaultButton (String::empty);
|
||||
|
||||
String s;
|
||||
|
||||
s << getColourIntialisationCode (component, memberVariableName)
|
||||
<< '\n';
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_TEXTBUTTONHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,442 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_TEXTEDITORHANDLER_JUCEHEADER__
|
||||
#define __JUCER_TEXTEDITORHANDLER_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class TextEditorHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
TextEditorHandler()
|
||||
: ComponentTypeHandler ("Text Editor", "TextEditor", typeid (TextEditor), 150, 24)
|
||||
{
|
||||
registerColour (TextEditor::textColourId, "text", "textcol");
|
||||
registerColour (TextEditor::backgroundColourId, "background", "bkgcol");
|
||||
registerColour (TextEditor::highlightColourId, "highlight", "hilitecol");
|
||||
registerColour (TextEditor::outlineColourId, "outline", "outlinecol");
|
||||
registerColour (TextEditor::shadowColourId, "shadow", "shadowcol");
|
||||
registerColour (CaretComponent::caretColourId, "caret", "caretcol");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new TextEditor ("new text editor");
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
TextEditor* te = (TextEditor*) comp;
|
||||
|
||||
e->setAttribute ("initialText", comp->getProperties() ["initialText"].toString());
|
||||
|
||||
e->setAttribute ("multiline", te->isMultiLine());
|
||||
e->setAttribute ("retKeyStartsLine", te->getReturnKeyStartsNewLine());
|
||||
e->setAttribute ("readonly", te->isReadOnly());
|
||||
e->setAttribute ("scrollbars", te->areScrollbarsShown());
|
||||
e->setAttribute ("caret", te->isCaretVisible());
|
||||
e->setAttribute ("popupmenu", te->isPopupMenuEnabled());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
TextEditor* te = (TextEditor*) comp;
|
||||
TextEditor defaultEditor;
|
||||
|
||||
te->setMultiLine (xml.getBoolAttribute ("multiline", defaultEditor.isMultiLine()));
|
||||
te->setReturnKeyStartsNewLine (xml.getBoolAttribute ("retKeyStartsLine", defaultEditor.getReturnKeyStartsNewLine()));
|
||||
te->setReadOnly (xml.getBoolAttribute ("readonly", defaultEditor.isReadOnly()));
|
||||
te->setScrollbarsShown (xml.getBoolAttribute ("scrollbars", defaultEditor.areScrollbarsShown()));
|
||||
te->setCaretVisible (xml.getBoolAttribute ("caret", defaultEditor.isCaretVisible()));
|
||||
te->setPopupMenuEnabled (xml.getBoolAttribute ("popupmenu", defaultEditor.isPopupMenuEnabled()));
|
||||
|
||||
const String initialText (xml.getStringAttribute ("initialText"));
|
||||
te->setText (initialText, false);
|
||||
te->getProperties().set ("initialText", initialText);
|
||||
return true;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
TextEditor* const t = dynamic_cast <TextEditor*> (component);
|
||||
jassert (t != 0);
|
||||
|
||||
properties.add (new TextEditorInitialTextProperty (t, document));
|
||||
properties.add (new TextEditorMultiLineProperty (t, document));
|
||||
properties.add (new TextEditorReadOnlyProperty (t, document));
|
||||
properties.add (new TextEditorScrollbarsProperty (t, document));
|
||||
properties.add (new TextEditorCaretProperty (t, document));
|
||||
properties.add (new TextEditorPopupMenuProperty (t, document));
|
||||
|
||||
addColourProperties (t, document, properties);
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* component)
|
||||
{
|
||||
return quotedString (component->getName());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
TextEditor* const te = dynamic_cast <TextEditor*> (component);
|
||||
jassert (te != 0);
|
||||
|
||||
String s;
|
||||
s << memberVariableName << "->setMultiLine (" << boolToString (te->isMultiLine()) << ");\n"
|
||||
<< memberVariableName << "->setReturnKeyStartsNewLine (" << boolToString (te->getReturnKeyStartsNewLine()) << ");\n"
|
||||
<< memberVariableName << "->setReadOnly (" << boolToString (te->isReadOnly()) << ");\n"
|
||||
<< memberVariableName << "->setScrollbarsShown (" << boolToString (te->areScrollbarsShown()) << ");\n"
|
||||
<< memberVariableName << "->setCaretVisible (" << boolToString (te->isCaretVisible()) << ");\n"
|
||||
<< memberVariableName << "->setPopupMenuEnabled (" << boolToString (te->isPopupMenuEnabled()) << ");\n"
|
||||
<< getColourIntialisationCode (component, memberVariableName)
|
||||
<< memberVariableName << "->setText (" << quotedString (te->getProperties() ["initialText"].toString()) << ");\n\n";
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class TextEditorMultiLineProperty : public ComponentChoiceProperty <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorMultiLineProperty (TextEditor* component_, JucerDocument& document_)
|
||||
: ComponentChoiceProperty <TextEditor> ("mode", component_, document_)
|
||||
{
|
||||
choices.add ("single line");
|
||||
choices.add ("multi-line, return key starts new line");
|
||||
choices.add ("multi-line, return key disabled");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
document.perform (new TextEditorMultilineChangeAction (component, *document.getComponentLayout(), newIndex),
|
||||
"Change TextEditor multiline mode");
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
return component->isMultiLine() ? (component->getReturnKeyStartsNewLine() ? 1 : 2) : 0;
|
||||
}
|
||||
|
||||
private:
|
||||
class TextEditorMultilineChangeAction : public ComponentUndoableAction <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorMultilineChangeAction (TextEditor* const comp, ComponentLayout& layout, const int newState_)
|
||||
: ComponentUndoableAction <TextEditor> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isMultiLine() ? (comp->getReturnKeyStartsNewLine() ? 1 : 2) : 0;
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setMultiLine (newState > 0);
|
||||
getComponent()->setReturnKeyStartsNewLine (newState == 1);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setMultiLine (oldState > 0);
|
||||
getComponent()->setReturnKeyStartsNewLine (oldState == 1);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
int newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TextEditorReadOnlyProperty : public ComponentBooleanProperty <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorReadOnlyProperty (TextEditor* component_, JucerDocument& document_)
|
||||
: ComponentBooleanProperty <TextEditor> ("editable", "Editable", "Editable", component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new TextEditorReadonlyChangeAction (component, *document.getComponentLayout(), ! newState),
|
||||
"Change TextEditor read-only mode");
|
||||
}
|
||||
|
||||
bool getState() const { return ! component->isReadOnly(); }
|
||||
|
||||
private:
|
||||
class TextEditorReadonlyChangeAction : public ComponentUndoableAction <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorReadonlyChangeAction (TextEditor* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <TextEditor> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isReadOnly();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setReadOnly (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setReadOnly (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TextEditorScrollbarsProperty : public ComponentBooleanProperty <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorScrollbarsProperty (TextEditor* component_, JucerDocument& document_)
|
||||
: ComponentBooleanProperty <TextEditor> ("scrollbars", "Scrollbars enabled", "Scrollbars enabled", component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new TextEditorScrollbarChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change TextEditor scrollbars");
|
||||
}
|
||||
|
||||
bool getState() const { return component->areScrollbarsShown(); }
|
||||
|
||||
private:
|
||||
class TextEditorScrollbarChangeAction : public ComponentUndoableAction <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorScrollbarChangeAction (TextEditor* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <TextEditor> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->areScrollbarsShown();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setScrollbarsShown (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setScrollbarsShown (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TextEditorCaretProperty : public ComponentBooleanProperty <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorCaretProperty (TextEditor* component_, JucerDocument& document_)
|
||||
: ComponentBooleanProperty <TextEditor> ("caret", "Caret visible", "Caret visible", component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new TextEditorCaretChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change TextEditor caret");
|
||||
}
|
||||
|
||||
bool getState() const { return component->isCaretVisible(); }
|
||||
|
||||
private:
|
||||
class TextEditorCaretChangeAction : public ComponentUndoableAction <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorCaretChangeAction (TextEditor* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <TextEditor> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isCaretVisible();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setCaretVisible (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setCaretVisible (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TextEditorPopupMenuProperty : public ComponentBooleanProperty <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorPopupMenuProperty (TextEditor* component_, JucerDocument& document_)
|
||||
: ComponentBooleanProperty <TextEditor> ("popup menu", "Popup menu enabled", "Popup menu enabled", component_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new TextEditorPopupMenuChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change TextEditor popup menu");
|
||||
}
|
||||
|
||||
bool getState() const { return component->isPopupMenuEnabled(); }
|
||||
|
||||
private:
|
||||
class TextEditorPopupMenuChangeAction : public ComponentUndoableAction <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorPopupMenuChangeAction (TextEditor* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <TextEditor> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isPopupMenuEnabled();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setPopupMenuEnabled (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setPopupMenuEnabled (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TextEditorInitialTextProperty : public ComponentTextProperty <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorInitialTextProperty (TextEditor* component_, JucerDocument& document_)
|
||||
: ComponentTextProperty <TextEditor> ("initial text", 10000, true, component_, document_)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new TextEditorInitialTextChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change TextEditor initial text");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return component->getProperties() ["initialText"];
|
||||
}
|
||||
|
||||
private:
|
||||
class TextEditorInitialTextChangeAction : public ComponentUndoableAction <TextEditor>
|
||||
{
|
||||
public:
|
||||
TextEditorInitialTextChangeAction (TextEditor* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <TextEditor> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getProperties() ["initialText"];
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setText (newState, false);
|
||||
getComponent()->getProperties().set ("initialText", newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setText (oldState, false);
|
||||
getComponent()->getProperties().set ("initialText", oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_TEXTEDITORHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,151 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_TOGGLEBUTTONHANDLER_JUCEHEADER__
|
||||
#define __JUCER_TOGGLEBUTTONHANDLER_JUCEHEADER__
|
||||
|
||||
#include "jucer_ButtonHandler.h"
|
||||
#include "../../properties/jucer_ComponentChoiceProperty.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ToggleButtonHandler : public ButtonHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ToggleButtonHandler()
|
||||
: ButtonHandler ("Toggle Button", "ToggleButton", typeid (ToggleButton), 150, 24)
|
||||
{
|
||||
registerColour (ToggleButton::textColourId, "text colour", "txtcol");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new ToggleButton ("new toggle button");
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ButtonHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
properties.add (new ToggleButtonStateProperty ((ToggleButton*) component, document));
|
||||
|
||||
addColourProperties (component, document, properties);
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
ToggleButton* tb = (ToggleButton*) comp;
|
||||
|
||||
XmlElement* e = ButtonHandler::createXmlFor (comp, layout);
|
||||
e->setAttribute ("state", tb->getToggleState());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
ToggleButton* const tb = (ToggleButton*) comp;
|
||||
|
||||
if (! ButtonHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
tb->setToggleState (xml.getBoolAttribute ("state", false), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
ButtonHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
ToggleButton* const tb = dynamic_cast <ToggleButton*> (component);
|
||||
|
||||
String s;
|
||||
|
||||
if (tb->getToggleState())
|
||||
s << memberVariableName << "->setToggleState (true, false);\n";
|
||||
|
||||
s << getColourIntialisationCode (component, memberVariableName)
|
||||
<< '\n';
|
||||
|
||||
code.constructorCode += s;
|
||||
}
|
||||
|
||||
private:
|
||||
class ToggleButtonStateProperty : public ComponentBooleanProperty <ToggleButton>
|
||||
{
|
||||
public:
|
||||
ToggleButtonStateProperty (ToggleButton* button_, JucerDocument& document_)
|
||||
: ComponentBooleanProperty <ToggleButton> ("initial state", "on", "off", button_, document_)
|
||||
{
|
||||
}
|
||||
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new ToggleStateChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change ToggleButton state");
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return component->getToggleState();
|
||||
}
|
||||
|
||||
private:
|
||||
class ToggleStateChangeAction : public ComponentUndoableAction <ToggleButton>
|
||||
{
|
||||
public:
|
||||
ToggleStateChangeAction (ToggleButton* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <ToggleButton> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getToggleState();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setToggleState (newState, false);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setToggleState (oldState, false);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_TOGGLEBUTTONHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_TREEVIEWHANDLER_JUCEHEADER__
|
||||
#define __JUCER_TREEVIEWHANDLER_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class TreeViewHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
TreeViewHandler()
|
||||
: ComponentTypeHandler ("TreeView", "TreeView", typeid (DemoTreeView), 150, 150)
|
||||
{
|
||||
registerColour (TreeView::backgroundColourId, "background", "backgroundColour");
|
||||
registerColour (TreeView::linesColourId, "lines", "linecol");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
return new DemoTreeView();
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
TreeView* const t = dynamic_cast <TreeView*> (comp);
|
||||
XmlElement* const e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
|
||||
e->setAttribute ("rootVisible", t->isRootItemVisible());
|
||||
e->setAttribute ("openByDefault", t->areItemsOpenByDefault());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
TreeView defaultTreeView;
|
||||
TreeView* const t = dynamic_cast <TreeView*> (comp);
|
||||
|
||||
t->setRootItemVisible (xml.getBoolAttribute ("rootVisible", defaultTreeView.isRootItemVisible()));
|
||||
t->setDefaultOpenness (xml.getBoolAttribute ("openByDefault", defaultTreeView.areItemsOpenByDefault()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
TreeView* const t = dynamic_cast <TreeView*> (component);
|
||||
|
||||
properties.add (new TreeViewRootItemProperty (t, document));
|
||||
properties.add (new TreeViewRootOpennessProperty (t, document));
|
||||
|
||||
addColourProperties (t, document, properties);
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* comp)
|
||||
{
|
||||
return quotedString (comp->getName());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
TreeView defaultTreeView;
|
||||
TreeView* const t = dynamic_cast <TreeView*> (component);
|
||||
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
if (defaultTreeView.isRootItemVisible() != t->isRootItemVisible())
|
||||
{
|
||||
code.constructorCode
|
||||
<< memberVariableName << "->setRootItemVisible ("
|
||||
<< boolToString (t->isRootItemVisible()) << ");\n";
|
||||
}
|
||||
|
||||
if (defaultTreeView.areItemsOpenByDefault() != t->areItemsOpenByDefault())
|
||||
{
|
||||
code.constructorCode
|
||||
<< memberVariableName << "->setDefaultOpenness ("
|
||||
<< boolToString (t->areItemsOpenByDefault()) << ");\n";
|
||||
}
|
||||
|
||||
code.constructorCode << getColourIntialisationCode (component, memberVariableName);
|
||||
|
||||
code.constructorCode << "\n";
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class DemoTreeView : public TreeView
|
||||
{
|
||||
public:
|
||||
DemoTreeView()
|
||||
: TreeView ("new treeview")
|
||||
{
|
||||
setRootItem (new DemoTreeViewItem ("Demo root node", 4));
|
||||
}
|
||||
|
||||
~DemoTreeView()
|
||||
{
|
||||
TreeViewItem* root = getRootItem();
|
||||
setRootItem (0);
|
||||
delete root;
|
||||
}
|
||||
|
||||
private:
|
||||
class DemoTreeViewItem : public TreeViewItem
|
||||
{
|
||||
public:
|
||||
DemoTreeViewItem (const String& name_, const int numItems)
|
||||
: name (name_)
|
||||
{
|
||||
for (int i = 0; i < numItems; ++i)
|
||||
addSubItem (new DemoTreeViewItem ("Demo sub-node " + String (i), numItems - 1));
|
||||
}
|
||||
|
||||
~DemoTreeViewItem()
|
||||
{
|
||||
}
|
||||
|
||||
void paintItem (Graphics& g, int width, int height)
|
||||
{
|
||||
if (isSelected())
|
||||
g.fillAll (Colours::lightblue);
|
||||
|
||||
g.setColour (Colours::black);
|
||||
g.setFont (height * 0.7f);
|
||||
g.drawText (name, 4, 0, width - 4, height, Justification::centredLeft, true);
|
||||
}
|
||||
|
||||
bool mightContainSubItems()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const String name;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TreeViewRootItemProperty : public ComponentBooleanProperty <TreeView>
|
||||
{
|
||||
public:
|
||||
TreeViewRootItemProperty (TreeView* comp, JucerDocument& document)
|
||||
: ComponentBooleanProperty <TreeView> ("show root item", "Root item visible", "Root item visible", comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new TreeviewRootChangeAction (component, *document.getComponentLayout(), newState),
|
||||
"Change TreeView root item");
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return component->isRootItemVisible();
|
||||
}
|
||||
|
||||
private:
|
||||
class TreeviewRootChangeAction : public ComponentUndoableAction <TreeView>
|
||||
{
|
||||
public:
|
||||
TreeviewRootChangeAction (TreeView* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <TreeView> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->isRootItemVisible();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setRootItemVisible (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setRootItemVisible (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TreeViewRootOpennessProperty : public ComponentChoiceProperty <TreeView>
|
||||
{
|
||||
public:
|
||||
TreeViewRootOpennessProperty (TreeView* comp, JucerDocument& document)
|
||||
: ComponentChoiceProperty <TreeView> ("default openness", comp, document)
|
||||
{
|
||||
choices.add ("Items open by default");
|
||||
choices.add ("Items closed by default");
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
document.perform (new TreeviewOpennessChangeAction (component, *document.getComponentLayout(), newIndex == 0),
|
||||
"Change TreeView openness");
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
return component->areItemsOpenByDefault() ? 0 : 1;
|
||||
}
|
||||
|
||||
private:
|
||||
class TreeviewOpennessChangeAction : public ComponentUndoableAction <TreeView>
|
||||
{
|
||||
public:
|
||||
TreeviewOpennessChangeAction (TreeView* const comp, ComponentLayout& layout, const bool newState_)
|
||||
: ComponentUndoableAction <TreeView> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->areItemsOpenByDefault();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setDefaultOpenness (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setDefaultOpenness (oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool newState, oldState;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_TREEVIEWHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,672 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_VIEWPORTHANDLER_JUCEHEADER__
|
||||
#define __JUCER_VIEWPORTHANDLER_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ViewportHandler : public ComponentTypeHandler
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ViewportHandler()
|
||||
: ComponentTypeHandler ("Viewport", "Viewport", typeid (UpdatingViewport), 150, 150)
|
||||
{}
|
||||
|
||||
//==============================================================================
|
||||
Component* createNewComponent (JucerDocument*)
|
||||
{
|
||||
Viewport* const v = new UpdatingViewport ("new viewport");
|
||||
v->setViewedComponent (new ViewportDemoContentComp());
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
Viewport* const v = dynamic_cast <Viewport*> (comp);
|
||||
XmlElement* const e = ComponentTypeHandler::createXmlFor (comp, layout);
|
||||
|
||||
e->setAttribute ("vscroll", v->isVerticalScrollBarShown());
|
||||
e->setAttribute ("hscroll", v->isHorizontalScrollBarShown());
|
||||
e->setAttribute ("scrollbarThickness", v->getScrollBarThickness());
|
||||
|
||||
e->setAttribute ("contentType", getViewportContentType (v));
|
||||
e->setAttribute ("jucerFile", getViewportJucerComponentFile (v));
|
||||
e->setAttribute ("contentClass", getViewportGenericComponentClass (v));
|
||||
e->setAttribute ("constructorParams", getViewportConstructorParams (v));
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout)
|
||||
{
|
||||
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
|
||||
return false;
|
||||
|
||||
Viewport defaultViewport;
|
||||
Viewport* const v = dynamic_cast <Viewport*> (comp);
|
||||
v->setScrollBarsShown (xml.getBoolAttribute ("vscroll", defaultViewport.isVerticalScrollBarShown()),
|
||||
xml.getBoolAttribute ("hscroll", defaultViewport.isHorizontalScrollBarShown()));
|
||||
|
||||
v->setScrollBarThickness (xml.getIntAttribute ("scrollbarThickness", defaultViewport.getScrollBarThickness()));
|
||||
|
||||
setViewportJucerComponentFile (v, xml.getStringAttribute ("jucerFile", String::empty));
|
||||
setViewportGenericComponentClass (v, xml.getStringAttribute ("contentClass"));
|
||||
setViewportContentType (v, xml.getIntAttribute ("contentType", 0));
|
||||
setViewportConstructorParams (v, xml.getStringAttribute ("constructorParams"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ComponentTypeHandler::getEditableProperties (component, document, properties);
|
||||
|
||||
Viewport* const v = dynamic_cast <Viewport*> (component);
|
||||
|
||||
properties.add (new ViewportScrollbarShownProperty (v, document, true));
|
||||
properties.add (new ViewportScrollbarShownProperty (v, document, false));
|
||||
properties.add (new ViewportScrollbarSizeProperty (v, document));
|
||||
properties.add (new ViewportContentTypeProperty (v, document));
|
||||
|
||||
if (getViewportContentType (v) == 1)
|
||||
{
|
||||
properties.add (new ViewportJucerFileProperty (v, document));
|
||||
properties.add (new ConstructorParamsProperty (v, document));
|
||||
}
|
||||
else if (getViewportContentType (v) == 2)
|
||||
{
|
||||
properties.add (new ViewportContentClassProperty (v, document));
|
||||
properties.add (new ConstructorParamsProperty (v, document));
|
||||
}
|
||||
}
|
||||
|
||||
const String getCreationParameters (Component* comp)
|
||||
{
|
||||
return quotedString (comp->getName());
|
||||
}
|
||||
|
||||
void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
|
||||
{
|
||||
Viewport defaultViewport;
|
||||
Viewport* const v = dynamic_cast <Viewport*> (component);
|
||||
|
||||
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
|
||||
|
||||
if (defaultViewport.isVerticalScrollBarShown() != v->isVerticalScrollBarShown()
|
||||
|| defaultViewport.isHorizontalScrollBarShown() != v->isHorizontalScrollBarShown())
|
||||
{
|
||||
code.constructorCode
|
||||
<< memberVariableName << "->setScrollBarsShown ("
|
||||
<< boolToString (v->isVerticalScrollBarShown()) << ", "
|
||||
<< boolToString (v->isHorizontalScrollBarShown()) << ");\n";
|
||||
}
|
||||
|
||||
if (defaultViewport.getScrollBarThickness() != v->getScrollBarThickness())
|
||||
{
|
||||
code.constructorCode
|
||||
<< memberVariableName << "->setScrollBarThickness ("
|
||||
<< v->getScrollBarThickness() << ");\n";
|
||||
}
|
||||
|
||||
if (getViewportContentType (v) != 0)
|
||||
{
|
||||
String className (getViewportGenericComponentClass (v));
|
||||
|
||||
if (getViewportContentType (v) == 1)
|
||||
{
|
||||
File file;
|
||||
|
||||
const String filename (getViewportJucerComponentFile (v));
|
||||
|
||||
if (filename.isNotEmpty())
|
||||
file = code.document->getFile().getSiblingFile (filename);
|
||||
|
||||
ScopedPointer<JucerDocument> doc (ObjectTypes::loadDocumentFromFile (file, false));
|
||||
|
||||
if (doc != 0)
|
||||
{
|
||||
code.includeFilesCPP.add (doc->getFile().withFileExtension ("h")
|
||||
.getRelativePathFrom (code.document->getFile().getParentDirectory())
|
||||
.replaceCharacter ('\\', '/'));
|
||||
|
||||
className = doc->getClassName();
|
||||
}
|
||||
else
|
||||
{
|
||||
className = String::empty;
|
||||
}
|
||||
}
|
||||
|
||||
if (className.isNotEmpty())
|
||||
{
|
||||
code.constructorCode
|
||||
<< memberVariableName << "->setViewedComponent (new "
|
||||
<< className;
|
||||
|
||||
if (getViewportConstructorParams (v).trim().isNotEmpty())
|
||||
{
|
||||
code.constructorCode << " (" << getViewportConstructorParams (v).trim() << "));\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
code.constructorCode << "());\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
code.constructorCode << "\n";
|
||||
}
|
||||
|
||||
static void updateViewportContentComp (Viewport* vp)
|
||||
{
|
||||
if (getViewportContentType (vp) == 1)
|
||||
{
|
||||
JucerDocument* doc = findParentDocument (vp);
|
||||
TestComponent* tc = new TestComponent (doc, 0, false);
|
||||
|
||||
tc->setFilename (getViewportJucerComponentFile (vp));
|
||||
tc->setToInitialSize();
|
||||
|
||||
vp->setViewedComponent (tc);
|
||||
}
|
||||
else
|
||||
{
|
||||
vp->setViewedComponent (new ViewportDemoContentComp());
|
||||
}
|
||||
}
|
||||
|
||||
static int getViewportContentType (Viewport* vp)
|
||||
{
|
||||
return vp->getProperties() ["contentType"];
|
||||
}
|
||||
|
||||
static void setViewportContentType (Viewport* vp, int newValue)
|
||||
{
|
||||
if (newValue != getViewportContentType (vp))
|
||||
{
|
||||
vp->getProperties().set ("contentType", newValue);
|
||||
updateViewportContentComp (vp);
|
||||
}
|
||||
}
|
||||
|
||||
static const String getViewportJucerComponentFile (Viewport* vp)
|
||||
{
|
||||
return vp->getProperties() ["jucerFile"].toString();
|
||||
}
|
||||
|
||||
static void setViewportJucerComponentFile (Viewport* vp, const String& file)
|
||||
{
|
||||
if (file != getViewportJucerComponentFile (vp))
|
||||
{
|
||||
vp->getProperties().set ("jucerFile", file);
|
||||
updateViewportContentComp (vp);
|
||||
}
|
||||
}
|
||||
|
||||
static const String getViewportGenericComponentClass (Viewport* vp)
|
||||
{
|
||||
return vp->getProperties() ["contentClass"].toString();
|
||||
}
|
||||
|
||||
static void setViewportGenericComponentClass (Viewport* vp, const String& className)
|
||||
{
|
||||
if (className != getViewportGenericComponentClass (vp))
|
||||
{
|
||||
vp->getProperties().set ("contentClass", className);
|
||||
updateViewportContentComp (vp);
|
||||
}
|
||||
}
|
||||
|
||||
static const String getViewportConstructorParams (Viewport* vp)
|
||||
{
|
||||
return vp->getProperties() ["constructorParams"].toString();
|
||||
}
|
||||
|
||||
static void setViewportConstructorParams (Viewport* vp, const String& newParams)
|
||||
{
|
||||
if (newParams != getViewportConstructorParams (vp))
|
||||
{
|
||||
vp->getProperties().set ("constructorParams", newParams);
|
||||
updateViewportContentComp (vp);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class UpdatingViewport : public Viewport
|
||||
{
|
||||
public:
|
||||
UpdatingViewport (const String& name)
|
||||
: Viewport (name)
|
||||
{
|
||||
}
|
||||
|
||||
void parentHierarchyChanged()
|
||||
{
|
||||
Viewport::parentHierarchyChanged();
|
||||
updateViewportContentComp (this);
|
||||
}
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ViewportDemoContentComp : public Component
|
||||
{
|
||||
public:
|
||||
ViewportDemoContentComp()
|
||||
{
|
||||
setSize (2048, 2048);
|
||||
}
|
||||
|
||||
void paint (Graphics& g)
|
||||
{
|
||||
g.fillCheckerBoard (getLocalBounds(), 50, 50,
|
||||
Colours::lightgrey.withAlpha (0.5f),
|
||||
Colours::darkgrey.withAlpha (0.5f));
|
||||
}
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ViewportScrollbarShownProperty : public ComponentBooleanProperty <Viewport>
|
||||
{
|
||||
public:
|
||||
ViewportScrollbarShownProperty (Viewport* comp, JucerDocument& document, const bool vertical_)
|
||||
: ComponentBooleanProperty <Viewport> (vertical_ ? "V scrollbar" : "H scrollbar",
|
||||
"enabled", "enabled",
|
||||
comp, document),
|
||||
vertical (vertical_)
|
||||
{
|
||||
}
|
||||
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.perform (new ViewportScrollbarChangeAction (component, *document.getComponentLayout(), vertical, newState),
|
||||
"Change Viewport scrollbar");
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return vertical ? component->isVerticalScrollBarShown()
|
||||
: component->isHorizontalScrollBarShown();
|
||||
}
|
||||
|
||||
const bool vertical;
|
||||
|
||||
private:
|
||||
class ViewportScrollbarChangeAction : public ComponentUndoableAction <Viewport>
|
||||
{
|
||||
public:
|
||||
ViewportScrollbarChangeAction (Viewport* const comp, ComponentLayout& layout, const bool vertical_, const bool newState_)
|
||||
: ComponentUndoableAction <Viewport> (comp, layout),
|
||||
vertical (vertical_),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = vertical ? comp->isVerticalScrollBarShown()
|
||||
: comp->isHorizontalScrollBarShown();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
if (vertical)
|
||||
getComponent()->setScrollBarsShown (newState, getComponent()->isHorizontalScrollBarShown());
|
||||
else
|
||||
getComponent()->setScrollBarsShown (getComponent()->isVerticalScrollBarShown(), newState);
|
||||
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
if (vertical)
|
||||
getComponent()->setScrollBarsShown (oldState, getComponent()->isHorizontalScrollBarShown());
|
||||
else
|
||||
getComponent()->setScrollBarsShown (getComponent()->isVerticalScrollBarShown(), oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool vertical, newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ViewportScrollbarSizeProperty : public SliderPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
ViewportScrollbarSizeProperty (Viewport* comp, JucerDocument& document_)
|
||||
: SliderPropertyComponent ("scrollbar size", 3.0, 30.0, 1.0, 1.0),
|
||||
component (comp),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ViewportScrollbarSizeProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setValue (double newValue)
|
||||
{
|
||||
document.getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
document.perform (new ViewportScrollbarSizeChangeAction (component, *document.getComponentLayout(), roundToInt (newValue)),
|
||||
"Change Viewport scrollbar size");
|
||||
}
|
||||
|
||||
double getValue() const
|
||||
{
|
||||
return component->getScrollBarThickness();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
Viewport* component;
|
||||
JucerDocument& document;
|
||||
|
||||
private:
|
||||
class ViewportScrollbarSizeChangeAction : public ComponentUndoableAction <Viewport>
|
||||
{
|
||||
public:
|
||||
ViewportScrollbarSizeChangeAction (Viewport* const comp, ComponentLayout& layout, const int newState_)
|
||||
: ComponentUndoableAction <Viewport> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = comp->getScrollBarThickness();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setScrollBarThickness (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getComponent()->setScrollBarThickness (newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
int newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ViewportContentTypeProperty : public ComponentChoiceProperty <Viewport>
|
||||
{
|
||||
public:
|
||||
ViewportContentTypeProperty (Viewport* comp, JucerDocument& document)
|
||||
: ComponentChoiceProperty <Viewport> ("content", comp, document)
|
||||
{
|
||||
choices.add ("No content component");
|
||||
choices.add ("Jucer content component");
|
||||
choices.add ("Named content component");
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
document.perform (new ViewportContentTypeChangeAction (component, *document.getComponentLayout(), newIndex),
|
||||
"Change Viewport content type");
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
return getViewportContentType (component);
|
||||
}
|
||||
|
||||
private:
|
||||
class ViewportContentTypeChangeAction : public ComponentUndoableAction <Viewport>
|
||||
{
|
||||
public:
|
||||
ViewportContentTypeChangeAction (Viewport* const comp, ComponentLayout& layout, const int newValue_)
|
||||
: ComponentUndoableAction <Viewport> (comp, layout),
|
||||
newValue (newValue_)
|
||||
{
|
||||
oldValue = getViewportContentType (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportContentType (getComponent(), newValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportContentType (getComponent(), oldValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
int newValue, oldValue;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ViewportJucerFileProperty : public FilePropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
ViewportJucerFileProperty (Viewport* const component_, JucerDocument& document_)
|
||||
: FilePropertyComponent ("Jucer file", false, true),
|
||||
component (component_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ViewportJucerFileProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setFile (const File& newFile)
|
||||
{
|
||||
document.perform (new JucerCompFileChangeAction (component, *document.getComponentLayout(),
|
||||
newFile.getRelativePathFrom (document.getFile().getParentDirectory())
|
||||
.replaceCharacter ('\\', '/')),
|
||||
"Change Jucer component file");
|
||||
}
|
||||
|
||||
File getFile() const
|
||||
{
|
||||
const String filename (getViewportJucerComponentFile (component));
|
||||
|
||||
if (filename.isEmpty())
|
||||
return File::nonexistent;
|
||||
|
||||
return document.getFile().getSiblingFile (filename);
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
private:
|
||||
Viewport* const component;
|
||||
JucerDocument& document;
|
||||
|
||||
class JucerCompFileChangeAction : public ComponentUndoableAction <Viewport>
|
||||
{
|
||||
public:
|
||||
JucerCompFileChangeAction (Viewport* const comp, ComponentLayout& layout, const String& newState_)
|
||||
: ComponentUndoableAction <Viewport> (comp, layout),
|
||||
newState (newState_)
|
||||
{
|
||||
oldState = getViewportJucerComponentFile (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportJucerComponentFile (getComponent(), newState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportJucerComponentFile (getComponent(), oldState);
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newState, oldState;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ViewportContentClassProperty : public ComponentTextProperty <Viewport>
|
||||
{
|
||||
public:
|
||||
ViewportContentClassProperty (Viewport* comp, JucerDocument& document)
|
||||
: ComponentTextProperty <Viewport> ("content class", 256, false, comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ViewportClassNameChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change Viewport content class");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return getViewportGenericComponentClass (component);
|
||||
}
|
||||
|
||||
private:
|
||||
class ViewportClassNameChangeAction : public ComponentUndoableAction <Viewport>
|
||||
{
|
||||
public:
|
||||
ViewportClassNameChangeAction (Viewport* const comp, ComponentLayout& layout, const String& newValue_)
|
||||
: ComponentUndoableAction <Viewport> (comp, layout),
|
||||
newValue (newValue_)
|
||||
{
|
||||
oldValue = getViewportGenericComponentClass (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportGenericComponentClass (getComponent(), newValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportGenericComponentClass (getComponent(), oldValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newValue, oldValue;
|
||||
};
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ConstructorParamsProperty : public ComponentTextProperty <Viewport>
|
||||
{
|
||||
public:
|
||||
ConstructorParamsProperty (Viewport* comp, JucerDocument& document)
|
||||
: ComponentTextProperty <Viewport> ("constructor params", 512, false, comp, document)
|
||||
{
|
||||
}
|
||||
|
||||
void setText (const String& newText)
|
||||
{
|
||||
document.perform (new ConstructorParamChangeAction (component, *document.getComponentLayout(), newText),
|
||||
"Change Viewport content constructor params");
|
||||
}
|
||||
|
||||
String getText() const
|
||||
{
|
||||
return getViewportConstructorParams (component);
|
||||
}
|
||||
|
||||
private:
|
||||
int tabIndex;
|
||||
|
||||
class ConstructorParamChangeAction : public ComponentUndoableAction <Viewport>
|
||||
{
|
||||
public:
|
||||
ConstructorParamChangeAction (Viewport* const comp, ComponentLayout& layout, const String& newValue_)
|
||||
: ComponentUndoableAction <Viewport> (comp, layout),
|
||||
newValue (newValue_)
|
||||
{
|
||||
oldValue = getViewportConstructorParams (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportConstructorParams (getComponent(), newValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
setViewportConstructorParams (getComponent(), oldValue);
|
||||
changed();
|
||||
layout.getDocument()->refreshAllPropertyComps();
|
||||
return true;
|
||||
}
|
||||
|
||||
String newValue, oldValue;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_VIEWPORTHANDLER_JUCEHEADER__
|
||||
|
|
@ -1,434 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../../jucer_Headers.h"
|
||||
#include "jucer_ButtonDocument.h"
|
||||
|
||||
//==============================================================================
|
||||
static const int normalOff = 0;
|
||||
static const int overOff = 1;
|
||||
static const int downOff = 2;
|
||||
static const int normalOn = 3;
|
||||
static const int overOn = 4;
|
||||
static const int downOn = 5;
|
||||
static const int background = 6;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
ButtonDocument::ButtonDocument()
|
||||
{
|
||||
paintStatesEnabled [normalOff] = true;
|
||||
paintStatesEnabled [overOff] = true;
|
||||
paintStatesEnabled [downOff] = true;
|
||||
paintStatesEnabled [normalOn] = false;
|
||||
paintStatesEnabled [overOn] = false;
|
||||
paintStatesEnabled [downOn] = false;
|
||||
paintStatesEnabled [background] = false;
|
||||
|
||||
parentClasses = "public Button";
|
||||
|
||||
for (int i = 7; --i >= 0;)
|
||||
{
|
||||
paintRoutines [i] = new PaintRoutine();
|
||||
paintRoutines [i]->setDocument (this);
|
||||
paintRoutines [i]->setBackgroundColour (Colours::transparentBlack);
|
||||
}
|
||||
}
|
||||
|
||||
ButtonDocument::~ButtonDocument()
|
||||
{
|
||||
for (int i = 7; --i >= 0;)
|
||||
delete paintRoutines [i];
|
||||
}
|
||||
|
||||
static const char* const stateNames[] =
|
||||
{
|
||||
"normal", "over", "down",
|
||||
"normal on", "over on", "down on",
|
||||
"common background"
|
||||
};
|
||||
|
||||
int stateNameToIndex (const String& name)
|
||||
{
|
||||
for (int i = 7; --i >= 0;)
|
||||
if (name.equalsIgnoreCase (stateNames[i]))
|
||||
return i;
|
||||
|
||||
jassertfalse
|
||||
return normalOff;
|
||||
}
|
||||
|
||||
|
||||
int ButtonDocument::getNumPaintRoutines() const
|
||||
{
|
||||
int n = 0;
|
||||
|
||||
for (int i = 7; --i >= 0;)
|
||||
if (paintStatesEnabled [i])
|
||||
++n;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
const StringArray ButtonDocument::getPaintRoutineNames() const
|
||||
{
|
||||
StringArray s;
|
||||
|
||||
for (int i = 0; i < 7; ++i)
|
||||
if (paintStatesEnabled [i])
|
||||
s.add (stateNames [i]);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
PaintRoutine* ButtonDocument::getPaintRoutine (const int index) const
|
||||
{
|
||||
int n = 0;
|
||||
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
if (paintStatesEnabled [i])
|
||||
{
|
||||
if (index == n)
|
||||
return paintRoutines [i];
|
||||
else
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
jassertfalse
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ButtonDocument::setStatePaintRoutineEnabled (const int index, bool b)
|
||||
{
|
||||
jassert (index > 0 && index < 7);
|
||||
|
||||
if (paintStatesEnabled [index] != b)
|
||||
{
|
||||
paintStatesEnabled [index] = b;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
bool ButtonDocument::isStatePaintRoutineEnabled (const int index) const
|
||||
{
|
||||
return paintStatesEnabled [index];
|
||||
}
|
||||
|
||||
int ButtonDocument::chooseBestEnabledPaintRoutine (int paintRoutineWanted) const
|
||||
{
|
||||
switch (paintRoutineWanted)
|
||||
{
|
||||
case normalOff:
|
||||
return normalOff;
|
||||
|
||||
case overOff:
|
||||
return paintStatesEnabled [overOff] ? overOff : normalOff;
|
||||
|
||||
case downOff:
|
||||
return paintStatesEnabled [downOff] ? downOff : chooseBestEnabledPaintRoutine (overOff);
|
||||
|
||||
case normalOn:
|
||||
return paintStatesEnabled [normalOn] ? normalOn : normalOff;
|
||||
|
||||
case overOn:
|
||||
return paintStatesEnabled [overOn] ? overOn : (paintStatesEnabled [normalOn] ? normalOn : chooseBestEnabledPaintRoutine (overOff));
|
||||
|
||||
case downOn:
|
||||
return paintStatesEnabled [downOn] ? downOn
|
||||
: ((paintStatesEnabled [overOn] || paintStatesEnabled [normalOn])
|
||||
? chooseBestEnabledPaintRoutine (overOn)
|
||||
: chooseBestEnabledPaintRoutine (downOff));
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return normalOff;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String ButtonDocument::getTypeName() const
|
||||
{
|
||||
return "Button";
|
||||
}
|
||||
|
||||
JucerDocument* ButtonDocument::createCopy()
|
||||
{
|
||||
ButtonDocument* newOne = new ButtonDocument();
|
||||
|
||||
newOne->resources = resources;
|
||||
newOne->setFile (getFile());
|
||||
|
||||
ScopedPointer<XmlElement> xml (createXml());
|
||||
newOne->loadFromXml (*xml);
|
||||
|
||||
return newOne;
|
||||
}
|
||||
|
||||
XmlElement* ButtonDocument::createXml() const
|
||||
{
|
||||
XmlElement* const doc = JucerDocument::createXml();
|
||||
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
XmlElement* e = paintRoutines [i]->createXml();
|
||||
e->setAttribute ("buttonState", stateNames [i]);
|
||||
e->setAttribute ("enabled", paintStatesEnabled [i]);
|
||||
|
||||
doc->addChildElement (e);
|
||||
}
|
||||
|
||||
return doc;
|
||||
}
|
||||
|
||||
bool ButtonDocument::loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (JucerDocument::loadFromXml (xml))
|
||||
{
|
||||
for (int i = 7; --i >= 0;)
|
||||
paintStatesEnabled [i] = false;
|
||||
|
||||
forEachXmlChildElementWithTagName (xml, e, PaintRoutine::xmlTagName)
|
||||
{
|
||||
const int stateIndex = stateNameToIndex (e->getStringAttribute ("buttonState"));
|
||||
|
||||
paintRoutines [stateIndex]->loadFromXml (*e);
|
||||
paintStatesEnabled [stateIndex] = e->getBoolAttribute ("enabled", stateIndex < normalOn);
|
||||
}
|
||||
|
||||
changed();
|
||||
getUndoManager().clearUndoHistory();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ButtonDocument::getOptionalMethods (StringArray& baseClasses,
|
||||
StringArray& returnValues,
|
||||
StringArray& methods,
|
||||
StringArray& initialContents) const
|
||||
{
|
||||
JucerDocument::getOptionalMethods (baseClasses, returnValues, methods, initialContents);
|
||||
|
||||
addMethod ("Button", "void", "clicked()", "", baseClasses, returnValues, methods, initialContents);
|
||||
addMethod ("Button", "void", "buttonStateChanged()", "", baseClasses, returnValues, methods, initialContents);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class ButtonStatePaintEnabledProperty : public BooleanPropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
ButtonStatePaintEnabledProperty (const String& name, ButtonDocument& document_, const int stateMethod_)
|
||||
: BooleanPropertyComponent (name, "enabled", "disabled"),
|
||||
document (document_),
|
||||
stateMethod (stateMethod_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ButtonStatePaintEnabledProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setState (bool newState)
|
||||
{
|
||||
document.setStatePaintRoutineEnabled (stateMethod, newState);
|
||||
}
|
||||
|
||||
bool getState() const
|
||||
{
|
||||
return document.isStatePaintRoutineEnabled (stateMethod);
|
||||
}
|
||||
|
||||
private:
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
ButtonDocument& document;
|
||||
const int stateMethod;
|
||||
};
|
||||
|
||||
void ButtonDocument::addExtraClassProperties (PropertyPanel* panel)
|
||||
{
|
||||
Array <PropertyComponent*> props;
|
||||
|
||||
for (int i = 1; i < 7; ++i)
|
||||
props.add (new ButtonStatePaintEnabledProperty (stateNames[i], *this, i));
|
||||
|
||||
panel->addSection ("Button paint routines", props);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class ButtonTestComponent : public Button
|
||||
{
|
||||
public:
|
||||
ButtonTestComponent (ButtonDocument* const document_, const bool alwaysFillBackground_)
|
||||
: Button (String::empty),
|
||||
document (document_),
|
||||
alwaysFillBackground (alwaysFillBackground_)
|
||||
{
|
||||
setClickingTogglesState (true);
|
||||
}
|
||||
|
||||
~ButtonTestComponent()
|
||||
{
|
||||
}
|
||||
|
||||
void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)
|
||||
{
|
||||
if (document->paintStatesEnabled [background])
|
||||
{
|
||||
document->paintRoutines [background]->fillWithBackground (g, alwaysFillBackground);
|
||||
document->paintRoutines [background]->drawElements (g, Rectangle<int> (0, 0, getWidth(), getHeight()));
|
||||
}
|
||||
|
||||
const int stateIndex
|
||||
= getToggleState()
|
||||
? (isButtonDown ? document->chooseBestEnabledPaintRoutine (downOn)
|
||||
: (isMouseOverButton ? document->chooseBestEnabledPaintRoutine (overOn)
|
||||
: document->chooseBestEnabledPaintRoutine (normalOn)))
|
||||
: (isButtonDown ? document->chooseBestEnabledPaintRoutine (downOff)
|
||||
: (isMouseOverButton ? document->chooseBestEnabledPaintRoutine (overOff)
|
||||
: normalOff));
|
||||
|
||||
document->paintRoutines [stateIndex]->fillWithBackground (g, ! document->paintStatesEnabled [background]);
|
||||
document->paintRoutines [stateIndex]->drawElements (g, Rectangle<int> (0, 0, getWidth(), getHeight()));
|
||||
}
|
||||
|
||||
private:
|
||||
ButtonDocument* const document;
|
||||
const bool alwaysFillBackground;
|
||||
};
|
||||
|
||||
Component* ButtonDocument::createTestComponent (const bool alwaysFillBackground)
|
||||
{
|
||||
return new ButtonTestComponent (this, alwaysFillBackground);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ButtonDocument::fillInGeneratedCode (GeneratedCode& code) const
|
||||
{
|
||||
JucerDocument::fillInGeneratedCode (code);
|
||||
|
||||
code.parentClassInitialiser = "Button (" + quotedString (code.componentName) + ")";
|
||||
code.removeCallback ("void", "paint (Graphics& g)");
|
||||
}
|
||||
|
||||
void ButtonDocument::fillInPaintCode (GeneratedCode& code) const
|
||||
{
|
||||
jassert (paintStatesEnabled [normalOff]);
|
||||
String paintCode [7];
|
||||
|
||||
for (int i = 0; i < 7; ++i)
|
||||
if (paintStatesEnabled [i])
|
||||
paintRoutines[i]->fillInGeneratedCode (code, paintCode [i]);
|
||||
|
||||
String& s = code.getCallbackCode ("public Button",
|
||||
"void",
|
||||
"paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)",
|
||||
false);
|
||||
|
||||
int numPaintRoutines = getNumPaintRoutines();
|
||||
|
||||
if (paintStatesEnabled [background])
|
||||
{
|
||||
s << paintCode [background] << "\n";
|
||||
--numPaintRoutines;
|
||||
}
|
||||
|
||||
if (numPaintRoutines == 1)
|
||||
{
|
||||
s << paintCode [normalOff];
|
||||
}
|
||||
else if (numPaintRoutines == downOff && (paintStatesEnabled [overOff] || paintStatesEnabled [downOff] || paintStatesEnabled [normalOn]))
|
||||
{
|
||||
if (paintStatesEnabled [normalOn])
|
||||
{
|
||||
s << "if (getToggleState())\n{\n "
|
||||
<< indentCode (paintCode [normalOn], 4).trimEnd();
|
||||
}
|
||||
else if (paintStatesEnabled [overOff])
|
||||
{
|
||||
s << "if (isButtonDown || isMouseOverButton)\n{\n "
|
||||
<< indentCode (paintCode [overOff], 4).trimEnd();
|
||||
}
|
||||
else
|
||||
{
|
||||
s << "if (isButtonDown)\n{\n "
|
||||
<< indentCode (paintCode [downOff], 4).trimEnd();
|
||||
}
|
||||
|
||||
s << "\n}\nelse\n{\n "
|
||||
<< indentCode (paintCode [normalOff], 4).trimEnd()
|
||||
<< "\n}\n";
|
||||
}
|
||||
else if (numPaintRoutines == normalOn && paintStatesEnabled [overOff] && paintStatesEnabled [downOff])
|
||||
{
|
||||
s << "if (isButtonDown)\n{\n "
|
||||
<< indentCode (paintCode [downOff], 4).trimEnd()
|
||||
<< "\n}\nelse if (isMouseOverButton)\n{\n "
|
||||
<< indentCode (paintCode [overOff], 4).trimEnd()
|
||||
<< "\n}\nelse\n{\n "
|
||||
<< indentCode (paintCode [normalOff], 4).trimEnd()
|
||||
<< "\n}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paintStatesEnabled [normalOn] || paintStatesEnabled [overOn] || paintStatesEnabled [downOn])
|
||||
{
|
||||
s << "switch (getToggleState() ? (isButtonDown ? "
|
||||
<< chooseBestEnabledPaintRoutine (downOn) << " : (isMouseOverButton ? "
|
||||
<< chooseBestEnabledPaintRoutine (overOn) << " : "
|
||||
<< chooseBestEnabledPaintRoutine (normalOn) << "))\n : (isButtonDown ? "
|
||||
<< chooseBestEnabledPaintRoutine (downOff) << " : (isMouseOverButton ? "
|
||||
<< chooseBestEnabledPaintRoutine (overOff) << " : 0)))\n{\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
s << "switch (isButtonDown ? " << chooseBestEnabledPaintRoutine (downOff)
|
||||
<< " : (isMouseOverButton ? " << chooseBestEnabledPaintRoutine (overOff)
|
||||
<< " : 0))\n{\n";
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; ++i)
|
||||
{
|
||||
if (paintStatesEnabled [i])
|
||||
{
|
||||
s << "case " << i << ":\n {\n "
|
||||
<< indentCode (paintCode [i], 8).trimEnd()
|
||||
<< "\n break;\n }\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
s << "default:\n break;\n}\n";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_BUTTONDOCUMENT_JUCEHEADER__
|
||||
#define __JUCER_BUTTONDOCUMENT_JUCEHEADER__
|
||||
|
||||
#include "../jucer_JucerDocument.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ButtonDocument : public JucerDocument
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ButtonDocument();
|
||||
~ButtonDocument();
|
||||
|
||||
//==============================================================================
|
||||
const String getTypeName() const;
|
||||
|
||||
JucerDocument* createCopy();
|
||||
Component* createTestComponent (const bool alwaysFillBackground);
|
||||
|
||||
int getNumPaintRoutines() const;
|
||||
const StringArray getPaintRoutineNames() const;
|
||||
PaintRoutine* getPaintRoutine (const int index) const;
|
||||
|
||||
void setStatePaintRoutineEnabled (const int index, bool b);
|
||||
bool isStatePaintRoutineEnabled (const int index) const;
|
||||
|
||||
int chooseBestEnabledPaintRoutine (int paintRoutineWanted) const;
|
||||
|
||||
ComponentLayout* getComponentLayout() const { return 0; }
|
||||
|
||||
void addExtraClassProperties (PropertyPanel* panel);
|
||||
|
||||
//==============================================================================
|
||||
XmlElement* createXml() const;
|
||||
bool loadFromXml (const XmlElement& xml);
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code) const;
|
||||
void fillInPaintCode (GeneratedCode& code) const;
|
||||
|
||||
void getOptionalMethods (StringArray& baseClasses,
|
||||
StringArray& returnValues,
|
||||
StringArray& methods,
|
||||
StringArray& initialContents) const;
|
||||
|
||||
//==============================================================================
|
||||
PaintRoutine* paintRoutines[7];
|
||||
bool paintStatesEnabled [7];
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_BUTTONDOCUMENT_JUCEHEADER__
|
||||
|
|
@ -1,170 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../../jucer_Headers.h"
|
||||
#include "jucer_ComponentDocument.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
ComponentDocument::ComponentDocument()
|
||||
{
|
||||
components = new ComponentLayout();
|
||||
components->setDocument (this);
|
||||
|
||||
backgroundGraphics = new PaintRoutine();
|
||||
backgroundGraphics->setDocument (this);
|
||||
}
|
||||
|
||||
ComponentDocument::~ComponentDocument()
|
||||
{
|
||||
delete components;
|
||||
delete backgroundGraphics;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String ComponentDocument::getTypeName() const
|
||||
{
|
||||
return "Component";
|
||||
}
|
||||
|
||||
JucerDocument* ComponentDocument::createCopy()
|
||||
{
|
||||
ComponentDocument* newOne = new ComponentDocument();
|
||||
|
||||
newOne->resources = resources;
|
||||
newOne->setFile (getFile());
|
||||
|
||||
ScopedPointer<XmlElement> xml (createXml());
|
||||
newOne->loadFromXml (*xml);
|
||||
|
||||
return newOne;
|
||||
}
|
||||
|
||||
XmlElement* ComponentDocument::createXml() const
|
||||
{
|
||||
XmlElement* const doc = JucerDocument::createXml();
|
||||
|
||||
doc->addChildElement (backgroundGraphics->createXml());
|
||||
components->addToXml (*doc);
|
||||
|
||||
return doc;
|
||||
}
|
||||
|
||||
bool ComponentDocument::loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (JucerDocument::loadFromXml (xml))
|
||||
{
|
||||
components->clearComponents();
|
||||
|
||||
forEachXmlChildElement (xml, e)
|
||||
{
|
||||
if (e->hasTagName (PaintRoutine::xmlTagName))
|
||||
backgroundGraphics->loadFromXml (*e);
|
||||
else
|
||||
components->addComponentFromXml (*e, false);
|
||||
}
|
||||
|
||||
changed();
|
||||
getUndoManager().clearUndoHistory();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class NormalTestComponent : public Component
|
||||
{
|
||||
public:
|
||||
NormalTestComponent (ComponentDocument* const document_, const bool alwaysFillBackground_)
|
||||
: document (document_),
|
||||
alwaysFillBackground (alwaysFillBackground_)
|
||||
{
|
||||
ComponentLayout* const layout = document->getComponentLayout();
|
||||
|
||||
for (int i = 0; i < layout->getNumComponents(); ++i)
|
||||
addAndMakeVisible (layout->getComponent (i));
|
||||
}
|
||||
|
||||
~NormalTestComponent()
|
||||
{
|
||||
for (int i = getNumChildComponents(); --i >= 0;)
|
||||
removeChildComponent (i);
|
||||
}
|
||||
|
||||
void paint (Graphics& g)
|
||||
{
|
||||
document->getPaintRoutine (0)->fillWithBackground (g, alwaysFillBackground);
|
||||
document->getPaintRoutine (0)->drawElements (g, Rectangle<int> (0, 0, getWidth(), getHeight()));
|
||||
}
|
||||
|
||||
void resized()
|
||||
{
|
||||
if (! getBounds().isEmpty())
|
||||
{
|
||||
int numTimesToTry = 10;
|
||||
|
||||
while (--numTimesToTry >= 0)
|
||||
{
|
||||
bool anyCompsMoved = false;
|
||||
|
||||
for (int i = 0; i < getNumChildComponents(); ++i)
|
||||
{
|
||||
Component* comp = getChildComponent (i);
|
||||
ComponentTypeHandler* const type = ComponentTypeHandler::getHandlerFor (*comp);
|
||||
|
||||
if (type != 0)
|
||||
{
|
||||
const Rectangle<int> newBounds (type->getComponentPosition (comp)
|
||||
.getRectangle (Rectangle<int> (0, 0, getWidth(), getHeight()),
|
||||
document->getComponentLayout()));
|
||||
|
||||
anyCompsMoved = anyCompsMoved || (comp->getBounds() != newBounds);
|
||||
comp->setBounds (newBounds);
|
||||
}
|
||||
}
|
||||
|
||||
// repeat this loop until they've all stopped shuffling (might require a few
|
||||
// loops for all the relative positioned comps to settle down)
|
||||
if (! anyCompsMoved)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
ComponentDocument* const document;
|
||||
const bool alwaysFillBackground;
|
||||
};
|
||||
|
||||
Component* ComponentDocument::createTestComponent (const bool alwaysFillBackground)
|
||||
{
|
||||
return new NormalTestComponent (this, alwaysFillBackground);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentDocument::fillInGeneratedCode (GeneratedCode& code) const
|
||||
{
|
||||
JucerDocument::fillInGeneratedCode (code);
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTDOCUMENT_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTDOCUMENT_JUCEHEADER__
|
||||
|
||||
#include "../jucer_JucerDocument.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ComponentDocument : public JucerDocument
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ComponentDocument();
|
||||
~ComponentDocument();
|
||||
|
||||
//==============================================================================
|
||||
const String getTypeName() const;
|
||||
|
||||
JucerDocument* createCopy();
|
||||
Component* createTestComponent (const bool alwaysFillBackground);
|
||||
|
||||
int getNumPaintRoutines() const { return 1; }
|
||||
const StringArray getPaintRoutineNames() const { return StringArray ("Graphics"); }
|
||||
PaintRoutine* getPaintRoutine (const int index) const { return index == 0 ? backgroundGraphics : 0; }
|
||||
|
||||
ComponentLayout* getComponentLayout() const { return components; }
|
||||
|
||||
//==============================================================================
|
||||
XmlElement* createXml() const;
|
||||
bool loadFromXml (const XmlElement& xml);
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code) const;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
ComponentLayout* components;
|
||||
PaintRoutine* backgroundGraphics;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTDOCUMENT_JUCEHEADER__
|
||||
|
|
@ -1,357 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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 "../jucer_Headers.h"
|
||||
#include "jucer_JucerDocument.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
BinaryResources::BinaryResources()
|
||||
{
|
||||
}
|
||||
|
||||
BinaryResources::~BinaryResources()
|
||||
{
|
||||
}
|
||||
|
||||
BinaryResources& BinaryResources::operator= (const BinaryResources& other)
|
||||
{
|
||||
for (int i = 0; i < other.resources.size(); ++i)
|
||||
add (other.resources[i]->name,
|
||||
other.resources[i]->originalFilename,
|
||||
other.resources[i]->data);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void BinaryResources::changed()
|
||||
{
|
||||
if (document != 0)
|
||||
{
|
||||
document->changed();
|
||||
document->refreshAllPropertyComps();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void BinaryResources::clear()
|
||||
{
|
||||
if (resources.size() > 0)
|
||||
{
|
||||
resources.clear();
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
const StringArray BinaryResources::getResourceNames() const
|
||||
{
|
||||
StringArray s;
|
||||
|
||||
for (int i = 0; i < resources.size(); ++i)
|
||||
s.add (resources.getUnchecked(i)->name);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
BinaryResources::BinaryResource* BinaryResources::findResource (const String& name) const throw()
|
||||
{
|
||||
for (int i = resources.size(); --i >= 0;)
|
||||
if (resources.getUnchecked(i)->name == name)
|
||||
return resources.getUnchecked(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const BinaryResources::BinaryResource* BinaryResources::getResource (const String& name) const
|
||||
{
|
||||
return findResource (name);
|
||||
}
|
||||
|
||||
const BinaryResources::BinaryResource* BinaryResources::getResourceForFile (const File& file) const
|
||||
{
|
||||
for (int i = resources.size(); --i >= 0;)
|
||||
if (resources.getUnchecked(i)->originalFilename == file.getFullPathName())
|
||||
return resources.getUnchecked(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool BinaryResources::add (const String& name, const File& file)
|
||||
{
|
||||
MemoryBlock mb;
|
||||
|
||||
if (! file.loadFileAsData (mb))
|
||||
return false;
|
||||
|
||||
add (name, file.getFullPathName(), mb);
|
||||
return true;
|
||||
}
|
||||
|
||||
void BinaryResources::add (const String& name, const String& originalFileName, const MemoryBlock& data)
|
||||
{
|
||||
BinaryResource* r = findResource (name);
|
||||
|
||||
if (r == 0)
|
||||
{
|
||||
resources.add (r = new BinaryResource());
|
||||
r->name = name;
|
||||
}
|
||||
|
||||
r->originalFilename = originalFileName;
|
||||
r->data = data;
|
||||
deleteAndZero (r->drawable);
|
||||
|
||||
changed();
|
||||
}
|
||||
|
||||
bool BinaryResources::reload (const int index)
|
||||
{
|
||||
return resources[index] != 0
|
||||
&& add (resources [index]->name,
|
||||
File (resources [index]->originalFilename));
|
||||
}
|
||||
|
||||
const String BinaryResources::browseForResource (const String& title,
|
||||
const String& wildcard,
|
||||
const File& fileToStartFrom,
|
||||
const String& resourceToReplace)
|
||||
{
|
||||
FileChooser fc (title, fileToStartFrom, wildcard);
|
||||
|
||||
if (fc.browseForFileToOpen())
|
||||
{
|
||||
String name (resourceToReplace);
|
||||
|
||||
if (name.isEmpty())
|
||||
name = findUniqueName (fc.getResult().getFileName());
|
||||
|
||||
if (! add (name, fc.getResult()))
|
||||
{
|
||||
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
|
||||
TRANS("Adding Resource"),
|
||||
TRANS("Failed to load the file!"));
|
||||
|
||||
name = String::empty;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
return String::empty;
|
||||
}
|
||||
|
||||
const String BinaryResources::findUniqueName (const String& rootName) const
|
||||
{
|
||||
String nameRoot (makeValidCppIdentifier (rootName, true, true, false));
|
||||
String name (nameRoot);
|
||||
|
||||
const StringArray resources (getResourceNames());
|
||||
|
||||
int suffix = 1;
|
||||
|
||||
while (resources.contains (name))
|
||||
name = nameRoot + String (++suffix);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
void BinaryResources::remove (const int i)
|
||||
{
|
||||
if (resources[i] != 0)
|
||||
{
|
||||
resources.remove (i);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
const Drawable* BinaryResources::getDrawable (const String& name) const
|
||||
{
|
||||
BinaryResources::BinaryResource* const res = const_cast <BinaryResources::BinaryResource*> (getResource (name));
|
||||
|
||||
if (res == 0)
|
||||
return 0;
|
||||
|
||||
if (res->drawable == 0 && res->data.getSize() > 0)
|
||||
res->drawable = Drawable::createFromImageData (res->data.getData(), res->data.getSize());
|
||||
|
||||
return res->drawable;
|
||||
}
|
||||
|
||||
const Image BinaryResources::getImageFromCache (const String& name) const
|
||||
{
|
||||
const BinaryResources::BinaryResource* const res = getResource (name);
|
||||
|
||||
if (res != 0 && res->data.getSize() > 0)
|
||||
return ImageCache::getFromMemory (res->data.getData(), (int) res->data.getSize());
|
||||
|
||||
return Image();
|
||||
}
|
||||
|
||||
void BinaryResources::loadFromCpp (const File& cppFileLocation, const String& cppFile)
|
||||
{
|
||||
StringArray cpp;
|
||||
cpp.addLines (cppFile);
|
||||
|
||||
clear();
|
||||
|
||||
for (int i = 0; i < cpp.size(); ++i)
|
||||
{
|
||||
if (cpp[i].contains ("JUCER_RESOURCE:"))
|
||||
{
|
||||
StringArray tokens;
|
||||
tokens.addTokens (cpp[i].fromFirstOccurrenceOf (":", false, false), ",", "\"'");
|
||||
tokens.trim();
|
||||
tokens.removeEmptyStrings();
|
||||
|
||||
const String resourceName (tokens[0]);
|
||||
const int size = tokens[1].getIntValue();
|
||||
const String originalFileName (cppFileLocation.getSiblingFile (tokens[2].unquoted()).getFullPathName());
|
||||
|
||||
jassert (resourceName.isNotEmpty() && size > 0);
|
||||
|
||||
if (resourceName.isNotEmpty() && size > 0)
|
||||
{
|
||||
const int firstLine = i;
|
||||
|
||||
while (i < cpp.size())
|
||||
if (cpp [i++].contains ("}"))
|
||||
break;
|
||||
|
||||
const String dataString (cpp.joinIntoString (" ", firstLine, i - firstLine)
|
||||
.fromFirstOccurrenceOf ("{", false, false));
|
||||
|
||||
MemoryOutputStream out;
|
||||
String::CharPointerType t (dataString.getCharPointer());
|
||||
int n = 0;
|
||||
|
||||
while (! t.isEmpty())
|
||||
{
|
||||
const juce_wchar c = t.getAndAdvance();
|
||||
|
||||
if (c >= '0' && c <= '9')
|
||||
n = n * 10 + (c - '0');
|
||||
else if (c == ',')
|
||||
{
|
||||
out.writeByte ((char) n);
|
||||
n = 0;
|
||||
}
|
||||
else if (c == '}')
|
||||
break;
|
||||
}
|
||||
|
||||
jassert (size < (int) out.getDataSize() && size > (int) out.getDataSize() - 2);
|
||||
|
||||
MemoryBlock mb (out.getData(), out.getDataSize());
|
||||
mb.setSize (size);
|
||||
|
||||
add (resourceName, originalFileName, mb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void BinaryResources::fillInGeneratedCode (GeneratedCode& code) const
|
||||
{
|
||||
if (resources.size() > 0)
|
||||
{
|
||||
code.publicMemberDeclarations << "// Binary resources:\n";
|
||||
|
||||
String defs;
|
||||
defs << "//==============================================================================\n";
|
||||
defs << "// Binary resources - be careful not to edit any of these sections!\n\n";
|
||||
|
||||
for (int i = 0; i < resources.size(); ++i)
|
||||
{
|
||||
code.publicMemberDeclarations
|
||||
<< "static const char* "
|
||||
<< resources[i]->name
|
||||
<< ";\nstatic const int "
|
||||
<< resources[i]->name
|
||||
<< "Size;\n";
|
||||
|
||||
const String name (resources[i]->name);
|
||||
const MemoryBlock& mb = resources[i]->data;
|
||||
|
||||
defs << "// JUCER_RESOURCE: " << name << ", " << (int) mb.getSize()
|
||||
<< ", \""
|
||||
<< File (resources[i]->originalFilename)
|
||||
.getRelativePathFrom (code.document->getFile())
|
||||
.replaceCharacter ('\\', '/')
|
||||
<< "\"\n";
|
||||
|
||||
String line1;
|
||||
line1 << "static const unsigned char resource_"
|
||||
<< code.className << "_" << name << "[] = { ";
|
||||
|
||||
defs += line1;
|
||||
|
||||
MemoryOutputStream out (65536);
|
||||
int charsOnLine = line1.length();
|
||||
|
||||
for (size_t j = 0; j < mb.getSize(); ++j)
|
||||
{
|
||||
const int num = ((int) (unsigned char) mb[j]);
|
||||
out << num << ',';
|
||||
|
||||
charsOnLine += 2;
|
||||
if (num >= 10)
|
||||
++charsOnLine;
|
||||
if (num >= 100)
|
||||
++charsOnLine;
|
||||
|
||||
if (charsOnLine >= 200)
|
||||
{
|
||||
charsOnLine = 0;
|
||||
out << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
out << (char) 0;
|
||||
|
||||
defs
|
||||
<< (const char*) out.getData()
|
||||
<< "0,0};\n\nconst char* "
|
||||
<< code.className << "::" << name
|
||||
<< " = (const char*) resource_" << code.className << "_" << name
|
||||
<< ";\nconst int "
|
||||
<< code.className << "::" << name << "Size = "
|
||||
<< (int) mb.getSize()
|
||||
<< ";\n\n";
|
||||
}
|
||||
|
||||
code.staticMemberDefinitions += defs;
|
||||
}
|
||||
}
|
||||
|
||||
BinaryResources::BinaryResource::BinaryResource()
|
||||
: drawable (0)
|
||||
{
|
||||
}
|
||||
|
||||
BinaryResources::BinaryResource::~BinaryResource()
|
||||
{
|
||||
deleteAndZero (drawable);
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_BINARYRESOURCES_JUCEHEADER__
|
||||
#define __JUCER_BINARYRESOURCES_JUCEHEADER__
|
||||
|
||||
class JucerDocument;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Manages a list of binary data objects that a JucerDocument wants to embed in
|
||||
the code it generates.
|
||||
*/
|
||||
class BinaryResources
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
BinaryResources();
|
||||
~BinaryResources();
|
||||
|
||||
BinaryResources& operator= (const BinaryResources& other);
|
||||
|
||||
void loadFromCpp (const File& cppFileLocation, const String& cpp);
|
||||
|
||||
//==============================================================================
|
||||
struct BinaryResource
|
||||
{
|
||||
BinaryResource();
|
||||
~BinaryResource();
|
||||
|
||||
String name;
|
||||
String originalFilename;
|
||||
MemoryBlock data;
|
||||
Drawable* drawable;
|
||||
};
|
||||
|
||||
void clear();
|
||||
bool add (const String& name, const File& file);
|
||||
void add (const String& name, const String& originalFileName, const MemoryBlock& data);
|
||||
void remove (const int index);
|
||||
bool reload (const int index);
|
||||
const String browseForResource (const String& title, const String& wildcard,
|
||||
const File& fileToStartFrom, const String& resourceToReplace);
|
||||
|
||||
const String findUniqueName (const String& rootName) const;
|
||||
|
||||
int size() const throw() { return resources.size(); }
|
||||
const BinaryResource* operator[] (const int index) const throw() { return resources [index]; }
|
||||
|
||||
const BinaryResource* getResource (const String& resourceName) const;
|
||||
const BinaryResource* getResourceForFile (const File& file) const;
|
||||
|
||||
const StringArray getResourceNames() const;
|
||||
|
||||
const Drawable* getDrawable (const String& name) const;
|
||||
const Image getImageFromCache (const String& name) const;
|
||||
|
||||
template <class ElementComparator>
|
||||
void sort (ElementComparator& sorter)
|
||||
{
|
||||
resources.sort (sorter, true);
|
||||
changed();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setDocument (JucerDocument* const document_) { document = document_; }
|
||||
JucerDocument* getDocument() const throw() { return document; }
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code) const;
|
||||
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
JucerDocument* document;
|
||||
OwnedArray <BinaryResource> resources;
|
||||
|
||||
BinaryResource* findResource (const String& name) const throw();
|
||||
void changed();
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_BINARYRESOURCES_JUCEHEADER__
|
||||
|
|
@ -1,844 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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 "../jucer_Headers.h"
|
||||
#include "jucer_JucerDocument.h"
|
||||
#include "jucer_ObjectTypes.h"
|
||||
#include "../ui/jucer_JucerDocumentHolder.h"
|
||||
#include "components/jucer_ComponentUndoableAction.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
ComponentLayout::ComponentLayout()
|
||||
: document (0),
|
||||
nextCompUID (1)
|
||||
{
|
||||
}
|
||||
|
||||
ComponentLayout::~ComponentLayout()
|
||||
{
|
||||
components.clear();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentLayout::changed()
|
||||
{
|
||||
if (document != 0)
|
||||
document->changed();
|
||||
}
|
||||
|
||||
void ComponentLayout::perform (UndoableAction* action, const String& actionName)
|
||||
{
|
||||
jassert (document != 0);
|
||||
|
||||
if (document != 0)
|
||||
{
|
||||
document->getUndoManager().perform (action, actionName);
|
||||
}
|
||||
else
|
||||
{
|
||||
action->perform();
|
||||
delete action;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentLayout::clearComponents()
|
||||
{
|
||||
selected.deselectAll();
|
||||
components.clear();
|
||||
changed();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class AddCompAction : public UndoableAction
|
||||
{
|
||||
public:
|
||||
AddCompAction (XmlElement* const xml_, ComponentLayout& layout_)
|
||||
: indexAdded (-1),
|
||||
xml (xml_),
|
||||
layout (layout_)
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
Component* const newComp = layout.addComponentFromXml (*xml, false);
|
||||
jassert (newComp != 0);
|
||||
|
||||
indexAdded = layout.indexOfComponent (newComp);
|
||||
jassert (indexAdded >= 0);
|
||||
return indexAdded >= 0;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.removeComponent (layout.getComponent (indexAdded), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
int getSizeInUnits() { return 10; }
|
||||
|
||||
int indexAdded;
|
||||
|
||||
private:
|
||||
ScopedPointer<XmlElement> xml;
|
||||
ComponentLayout& layout;
|
||||
|
||||
static void showCorrectTab()
|
||||
{
|
||||
JucerDocumentHolder* const docHolder = JucerDocumentHolder::getActiveDocumentHolder();
|
||||
|
||||
if (docHolder != 0)
|
||||
docHolder->showLayout();
|
||||
}
|
||||
|
||||
AddCompAction (const AddCompAction&);
|
||||
AddCompAction& operator= (const AddCompAction&);
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class DeleteCompAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
DeleteCompAction (Component* const comp, ComponentLayout& layout)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
oldIndex (-1)
|
||||
{
|
||||
ComponentTypeHandler* const h = ComponentTypeHandler::getHandlerFor (*comp);
|
||||
jassert (h != 0);
|
||||
if (h != 0)
|
||||
xml = h->createXmlFor (comp, &layout);
|
||||
|
||||
oldIndex = layout.indexOfComponent (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.removeComponent (getComponent(), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
Component* c = layout.addComponentFromXml (*xml, false);
|
||||
jassert (c != 0);
|
||||
|
||||
layout.moveComponentZOrder (layout.indexOfComponent (c), oldIndex);
|
||||
|
||||
showCorrectTab();
|
||||
return c != 0;
|
||||
}
|
||||
|
||||
private:
|
||||
ScopedPointer<XmlElement> xml;
|
||||
int oldIndex;
|
||||
};
|
||||
|
||||
void ComponentLayout::removeComponent (Component* comp, const bool undoable)
|
||||
{
|
||||
if (comp != 0 && components.contains (comp))
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new DeleteCompAction (comp, *this), "Delete components");
|
||||
}
|
||||
else
|
||||
{
|
||||
selected.deselect (comp);
|
||||
selected.changed (true); // synchronous message to get rid of any property components
|
||||
|
||||
components.removeObject (comp);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class FrontBackCompAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
FrontBackCompAction (Component* const comp, ComponentLayout& layout, int newIndex_)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
newIndex (newIndex_)
|
||||
{
|
||||
oldIndex = layout.indexOfComponent (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
Component* comp = layout.getComponent (oldIndex);
|
||||
layout.moveComponentZOrder (oldIndex, newIndex);
|
||||
newIndex = layout.indexOfComponent (comp);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.moveComponentZOrder (newIndex, oldIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
int newIndex, oldIndex;
|
||||
};
|
||||
|
||||
void ComponentLayout::moveComponentZOrder (int oldIndex, int newIndex)
|
||||
{
|
||||
jassert (components [oldIndex] != 0);
|
||||
|
||||
if (oldIndex != newIndex && components [oldIndex] != 0)
|
||||
{
|
||||
components.move (oldIndex, newIndex);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentLayout::componentToFront (Component* comp, const bool undoable)
|
||||
{
|
||||
if (comp != 0 && components.contains (comp))
|
||||
{
|
||||
if (undoable)
|
||||
perform (new FrontBackCompAction (comp, *this, -1), "Move components to front");
|
||||
else
|
||||
moveComponentZOrder (components.indexOf (comp), -1);
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentLayout::componentToBack (Component* comp, const bool undoable)
|
||||
{
|
||||
if (comp != 0 && components.contains (comp))
|
||||
{
|
||||
if (undoable)
|
||||
perform (new FrontBackCompAction (comp, *this, 0), "Move components to back");
|
||||
else
|
||||
moveComponentZOrder (components.indexOf (comp), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
const char* const ComponentLayout::clipboardXmlTag = "COMPONENTS";
|
||||
|
||||
void ComponentLayout::copySelectedToClipboard()
|
||||
{
|
||||
if (selected.getNumSelected() == 0)
|
||||
return;
|
||||
|
||||
XmlElement clip (clipboardXmlTag);
|
||||
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
{
|
||||
Component* const c = components.getUnchecked(i);
|
||||
|
||||
if (selected.isSelected (c))
|
||||
{
|
||||
ComponentTypeHandler* const type = ComponentTypeHandler::getHandlerFor (*c);
|
||||
|
||||
jassert (type != 0);
|
||||
if (type != 0)
|
||||
{
|
||||
XmlElement* const e = type->createXmlFor (c, this);
|
||||
clip.addChildElement (e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SystemClipboard::copyTextToClipboard (clip.createDocument (String::empty, false, false));
|
||||
}
|
||||
|
||||
void ComponentLayout::paste()
|
||||
{
|
||||
XmlDocument clip (SystemClipboard::getTextFromClipboard());
|
||||
ScopedPointer<XmlElement> doc (clip.getDocumentElement());
|
||||
|
||||
if (doc != 0 && doc->hasTagName (clipboardXmlTag))
|
||||
{
|
||||
selected.deselectAll();
|
||||
|
||||
forEachXmlChildElement (*doc, e)
|
||||
{
|
||||
Component* newComp = addComponentFromXml (*e, true);
|
||||
|
||||
if (newComp != 0)
|
||||
selected.addToSelection (newComp);
|
||||
}
|
||||
|
||||
startDragging();
|
||||
dragSelectedComps (Random::getSystemRandom().nextInt (40),
|
||||
Random::getSystemRandom().nextInt (40));
|
||||
endDragging();
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentLayout::deleteSelected()
|
||||
{
|
||||
const SelectedItemSet <Component*> temp (selected);
|
||||
selected.deselectAll();
|
||||
selected.changed (true); // synchronous message to get rid of any property components
|
||||
|
||||
if (temp.getNumSelected() > 0)
|
||||
{
|
||||
for (int i = temp.getNumSelected(); --i >= 0;)
|
||||
removeComponent (temp.getSelectedItem (i), true);
|
||||
|
||||
changed();
|
||||
|
||||
if (document != 0)
|
||||
document->dispatchPendingMessages(); // forces the change to propagate before a paint() callback can happen,
|
||||
// in case there are components floating around that are now dangling pointers
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentLayout::selectAll()
|
||||
{
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
selected.addToSelection (components.getUnchecked (i));
|
||||
}
|
||||
|
||||
void ComponentLayout::selectedToFront()
|
||||
{
|
||||
const SelectedItemSet <Component*> temp (selected);
|
||||
|
||||
for (int i = temp.getNumSelected(); --i >= 0;)
|
||||
componentToFront (temp.getSelectedItem(i), true);
|
||||
}
|
||||
|
||||
void ComponentLayout::selectedToBack()
|
||||
{
|
||||
const SelectedItemSet <Component*> temp (selected);
|
||||
|
||||
for (int i = 0; i < temp.getNumSelected(); ++i)
|
||||
componentToBack (temp.getSelectedItem(i), true);
|
||||
}
|
||||
|
||||
void ComponentLayout::bringLostItemsBackOnScreen (int width, int height)
|
||||
{
|
||||
for (int i = components.size(); --i >= 0;)
|
||||
{
|
||||
Component* const c = components[i];
|
||||
|
||||
if (! c->getBounds().intersects (Rectangle<int> (0, 0, width, height)))
|
||||
{
|
||||
c->setTopLeftPosition (width / 2, height / 2);
|
||||
updateStoredComponentPosition (c, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component* ComponentLayout::addNewComponent (ComponentTypeHandler* const type, int x, int y)
|
||||
{
|
||||
ScopedPointer<Component> c (type->createNewComponent (getDocument()));
|
||||
jassert (c != 0);
|
||||
|
||||
if (c != 0)
|
||||
{
|
||||
c->setSize (type->getDefaultWidth(), type->getDefaultHeight());
|
||||
c->setCentrePosition (x, y);
|
||||
updateStoredComponentPosition (c, false);
|
||||
|
||||
c->getProperties().set ("id", nextCompUID++);
|
||||
|
||||
ScopedPointer<XmlElement> xml (type->createXmlFor (c, this));
|
||||
c = nullptr;
|
||||
c = addComponentFromXml (*xml, true);
|
||||
|
||||
String memberName (makeValidCppIdentifier (type->getClassName (c), true, true, false));
|
||||
setComponentMemberVariableName (c, memberName);
|
||||
|
||||
selected.selectOnly (c);
|
||||
}
|
||||
|
||||
return c.release();
|
||||
}
|
||||
|
||||
|
||||
Component* ComponentLayout::addComponentFromXml (const XmlElement& xml, const bool undoable)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
AddCompAction* const action = new AddCompAction (new XmlElement (xml), *this);
|
||||
perform (action, "Add new components");
|
||||
|
||||
return components [action->indexAdded];
|
||||
}
|
||||
else
|
||||
{
|
||||
ComponentTypeHandler* const type
|
||||
= ComponentTypeHandler::getHandlerForXmlTag (xml.getTagName());
|
||||
|
||||
if (type != 0)
|
||||
{
|
||||
Component* const newComp = type->createNewComponent (getDocument());
|
||||
|
||||
if (type->restoreFromXml (xml, newComp, this))
|
||||
{
|
||||
// ensure that the new comp's name is unique
|
||||
setComponentMemberVariableName (newComp, getComponentMemberVariableName (newComp));
|
||||
|
||||
// check for duped IDs..
|
||||
while (findComponentWithId (ComponentTypeHandler::getComponentId (newComp)) != 0)
|
||||
ComponentTypeHandler::setComponentId (newComp, Random::getSystemRandom().nextInt64());
|
||||
|
||||
components.add (newComp);
|
||||
changed();
|
||||
return newComp;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete newComp;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Component* ComponentLayout::findComponentWithId (const int64 componentId) const
|
||||
{
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
if (ComponentTypeHandler::getComponentId (components.getUnchecked(i)) == componentId)
|
||||
return components.getUnchecked(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static const char* const dimensionSuffixes[] = { "X", "Y", "W", "H" };
|
||||
|
||||
Component* ComponentLayout::getComponentRelativePosTarget (Component* comp, int whichDimension) const
|
||||
{
|
||||
jassert (comp != 0);
|
||||
|
||||
PaintElement* const pe = dynamic_cast <PaintElement*> (comp);
|
||||
|
||||
if (pe != 0)
|
||||
{
|
||||
int64 compId;
|
||||
|
||||
if (whichDimension == 0)
|
||||
compId = pe->getPosition().relativeToX;
|
||||
else if (whichDimension == 1)
|
||||
compId = pe->getPosition().relativeToY;
|
||||
else if (whichDimension == 2)
|
||||
compId = pe->getPosition().relativeToW;
|
||||
else
|
||||
compId = pe->getPosition().relativeToH;
|
||||
|
||||
return findComponentWithId (compId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return findComponentWithId (comp->getProperties() [String ("relativeTo") + dimensionSuffixes [whichDimension]]
|
||||
.toString().getHexValue64());
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentLayout::setComponentRelativeTarget (Component* comp, int whichDimension, Component* compToBeRelativeTo)
|
||||
{
|
||||
PaintElement* const pe = dynamic_cast <PaintElement*> (comp);
|
||||
|
||||
jassert (comp != 0);
|
||||
jassert (pe != 0 || components.contains (comp));
|
||||
jassert (compToBeRelativeTo == 0 || components.contains (compToBeRelativeTo));
|
||||
jassert (compToBeRelativeTo == 0 || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp));
|
||||
|
||||
if (compToBeRelativeTo != getComponentRelativePosTarget (comp, whichDimension)
|
||||
&& (compToBeRelativeTo == 0 || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp)))
|
||||
{
|
||||
const int64 compId = ComponentTypeHandler::getComponentId (compToBeRelativeTo);
|
||||
|
||||
Rectangle<int> oldBounds (comp->getBounds());
|
||||
RelativePositionedRectangle pos;
|
||||
|
||||
if (pe != 0)
|
||||
{
|
||||
oldBounds = pe->getCurrentBounds (dynamic_cast <PaintRoutineEditor*> (pe->getParentComponent())->getComponentArea());
|
||||
pos = pe->getPosition();
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = ComponentTypeHandler::getComponentPosition (comp);
|
||||
}
|
||||
|
||||
if (whichDimension == 0)
|
||||
pos.relativeToX = compId;
|
||||
else if (whichDimension == 1)
|
||||
pos.relativeToY = compId;
|
||||
else if (whichDimension == 2)
|
||||
pos.relativeToW = compId;
|
||||
else if (whichDimension == 3)
|
||||
pos.relativeToH = compId;
|
||||
|
||||
if (pe != 0)
|
||||
{
|
||||
pe->setPosition (pos, true);
|
||||
pe->setCurrentBounds (oldBounds, dynamic_cast <PaintRoutineEditor*> (pe->getParentComponent())->getComponentArea(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
setComponentPosition (comp, pos, true);
|
||||
comp->setBounds (oldBounds);
|
||||
updateStoredComponentPosition (comp, false);
|
||||
}
|
||||
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
bool ComponentLayout::dependsOnComponentForRelativePos (Component* comp, Component* possibleDependee) const
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
Component* const c = getComponentRelativePosTarget (comp, i);
|
||||
if (c != 0 && (c == possibleDependee || dependsOnComponentForRelativePos (c, possibleDependee)))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const int menuIdBase = 0x63240000;
|
||||
|
||||
PopupMenu ComponentLayout::getRelativeTargetMenu (Component* comp, int whichDimension) const
|
||||
{
|
||||
PopupMenu m;
|
||||
|
||||
Component* const current = getComponentRelativePosTarget (comp, whichDimension);
|
||||
|
||||
m.addItem (menuIdBase, "Relative to parent component", true, current == 0);
|
||||
m.addSeparator();
|
||||
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
{
|
||||
Component* const c = components.getUnchecked(i);
|
||||
|
||||
if (c != comp)
|
||||
{
|
||||
m.addItem (menuIdBase + i + 1,
|
||||
"Relative to " + getComponentMemberVariableName (c)
|
||||
+ " (class: " + ComponentTypeHandler::getHandlerFor (*c)->getClassName (c) + ")",
|
||||
! dependsOnComponentForRelativePos (c, comp),
|
||||
current == c);
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
void ComponentLayout::processRelativeTargetMenuResult (Component* comp, int whichDimension, int menuResultID)
|
||||
{
|
||||
if (menuResultID != 0)
|
||||
{
|
||||
Component* const newTarget = components [menuResultID - menuIdBase - 1];
|
||||
setComponentRelativeTarget (comp, whichDimension, newTarget);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class ChangeCompPositionAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
ChangeCompPositionAction (Component* const comp, ComponentLayout& layout,
|
||||
const RelativePositionedRectangle& newPos_)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
newPos (newPos_)
|
||||
{
|
||||
oldPos = ComponentTypeHandler::getComponentPosition (comp);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.setComponentPosition (getComponent(), newPos, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
layout.setComponentPosition (getComponent(), oldPos, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
RelativePositionedRectangle newPos, oldPos;
|
||||
};
|
||||
|
||||
void ComponentLayout::setComponentPosition (Component* comp,
|
||||
const RelativePositionedRectangle& newPos,
|
||||
const bool undoable)
|
||||
{
|
||||
if (ComponentTypeHandler::getComponentPosition (comp) != newPos)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new ChangeCompPositionAction (comp, *this, newPos), "Move components");
|
||||
}
|
||||
else
|
||||
{
|
||||
ComponentTypeHandler::setComponentPosition (comp, newPos, this);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentLayout::updateStoredComponentPosition (Component* comp, const bool undoable)
|
||||
{
|
||||
RelativePositionedRectangle newPos (ComponentTypeHandler::getComponentPosition (comp));
|
||||
|
||||
newPos.updateFromComponent (*comp, this);
|
||||
|
||||
setComponentPosition (comp, newPos, undoable);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentLayout::startDragging()
|
||||
{
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
{
|
||||
Component* const c = components[i];
|
||||
c->getProperties().set ("xDragStart", c->getX());
|
||||
c->getProperties().set ("yDragStart", c->getY());
|
||||
}
|
||||
|
||||
jassert (document != 0);
|
||||
document->getUndoManager().beginNewTransaction();
|
||||
}
|
||||
|
||||
void ComponentLayout::dragSelectedComps (int dx, int dy, const bool allowSnap)
|
||||
{
|
||||
if (allowSnap && document != 0 && selected.getNumSelected() > 1)
|
||||
{
|
||||
dx = document->snapPosition (dx);
|
||||
dy = document->snapPosition (dy);
|
||||
}
|
||||
|
||||
for (int i = 0; i < selected.getNumSelected(); ++i)
|
||||
{
|
||||
Component* const c = selected.getSelectedItem (i);
|
||||
|
||||
const int startX = c->getProperties() ["xDragStart"];
|
||||
const int startY = c->getProperties() ["yDragStart"];
|
||||
|
||||
if (allowSnap && document != 0 && selected.getNumSelected() == 1)
|
||||
{
|
||||
c->setTopLeftPosition (document->snapPosition (startX + dx),
|
||||
document->snapPosition (startY + dy));
|
||||
}
|
||||
else
|
||||
{
|
||||
c->setTopLeftPosition (startX + dx,
|
||||
startY + dy);
|
||||
}
|
||||
|
||||
updateStoredComponentPosition (c, false);
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentLayout::endDragging()
|
||||
{
|
||||
// after the drag, roll back all the comps to their start position, then
|
||||
// back to their finish positions using an undoable command.
|
||||
document->getUndoManager().beginNewTransaction();
|
||||
|
||||
for (int i = 0; i < selected.getNumSelected(); ++i)
|
||||
{
|
||||
Component* const c = selected.getSelectedItem (i);
|
||||
|
||||
const int newX = c->getX();
|
||||
const int newY = c->getY();
|
||||
|
||||
const int startX = c->getProperties() ["xDragStart"];
|
||||
const int startY = c->getProperties() ["yDragStart"];
|
||||
|
||||
c->setTopLeftPosition (startX, startY);
|
||||
updateStoredComponentPosition (c, false);
|
||||
|
||||
c->setTopLeftPosition (newX, newY);
|
||||
updateStoredComponentPosition (c, true);
|
||||
}
|
||||
|
||||
document->getUndoManager().beginNewTransaction();
|
||||
}
|
||||
|
||||
void ComponentLayout::moveSelectedComps (int dx, int dy, bool snap)
|
||||
{
|
||||
startDragging();
|
||||
dragSelectedComps (dx, dy, snap);
|
||||
endDragging();
|
||||
}
|
||||
|
||||
void ComponentLayout::stretchSelectedComps (int dw, int dh, bool allowSnap)
|
||||
{
|
||||
int neww, newh;
|
||||
|
||||
if (document != 0 && selected.getNumSelected() == 1)
|
||||
{
|
||||
Component* const c = selected.getSelectedItem (0);
|
||||
|
||||
if (allowSnap)
|
||||
{
|
||||
int bot = c->getBottom() + dh;
|
||||
int right = c->getRight() + dw;
|
||||
bot = (dh != 0) ? document->snapPosition (bot) : bot;
|
||||
right = (dw != 0) ? document->snapPosition (right) : right;
|
||||
newh = bot - c->getY();
|
||||
neww = right - c->getX();
|
||||
}
|
||||
else
|
||||
{
|
||||
newh = c->getHeight() + dh;
|
||||
neww = c->getWidth() + dw;
|
||||
}
|
||||
|
||||
c->setSize (neww, newh);
|
||||
|
||||
updateStoredComponentPosition (c, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < selected.getNumSelected(); ++i)
|
||||
{
|
||||
Component* const c = selected.getSelectedItem (i);
|
||||
|
||||
neww = c->getWidth() + dw;
|
||||
newh = c->getHeight() + dh;
|
||||
c->setSize (neww, newh);
|
||||
|
||||
updateStoredComponentPosition (c, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
void ComponentLayout::fillInGeneratedCode (GeneratedCode& code) const
|
||||
{
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
{
|
||||
Component* const comp = components[i];
|
||||
ComponentTypeHandler* const type = ComponentTypeHandler::getHandlerFor (*comp);
|
||||
|
||||
if (type != 0)
|
||||
type->fillInGeneratedCode (comp, code);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String ComponentLayout::getComponentMemberVariableName (Component* comp) const
|
||||
{
|
||||
if (comp == 0)
|
||||
return String::empty;
|
||||
|
||||
String name (comp->getProperties() ["memberName"].toString());
|
||||
|
||||
if (name.isEmpty())
|
||||
name = getUnusedMemberName (makeValidCppIdentifier (comp->getName(), true, true, false), comp);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
void ComponentLayout::setComponentMemberVariableName (Component* comp, const String& newName)
|
||||
{
|
||||
const String oldName (getComponentMemberVariableName (comp));
|
||||
|
||||
comp->getProperties().set ("memberName", String::empty);
|
||||
|
||||
const String n (getUnusedMemberName (makeValidCppIdentifier (newName, false, true, false), comp));
|
||||
comp->getProperties().set ("memberName", n);
|
||||
|
||||
if (n != oldName)
|
||||
changed();
|
||||
}
|
||||
|
||||
const String ComponentLayout::getUnusedMemberName (String nameRoot, Component* comp) const
|
||||
{
|
||||
String n (nameRoot);
|
||||
|
||||
while (CharacterFunctions::isDigit (nameRoot.getLastCharacter()))
|
||||
nameRoot = nameRoot.dropLastCharacters (1);
|
||||
|
||||
int suffix = 2;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
bool alreadyUsed = false;
|
||||
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
{
|
||||
if (components[i] != comp
|
||||
&& components[i]->getProperties() ["memberName"] == n)
|
||||
{
|
||||
alreadyUsed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! alreadyUsed)
|
||||
break;
|
||||
|
||||
n = nameRoot + String (suffix++);
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String ComponentLayout::getComponentVirtualClassName (Component* comp) const
|
||||
{
|
||||
if (comp == 0)
|
||||
return String::empty;
|
||||
|
||||
return comp->getProperties() ["virtualName"];
|
||||
}
|
||||
|
||||
void ComponentLayout::setComponentVirtualClassName (Component* comp, const String& newName)
|
||||
{
|
||||
const String name (makeValidCppIdentifier (newName, false, false, true));
|
||||
|
||||
if (name != getComponentVirtualClassName (comp))
|
||||
{
|
||||
comp->getProperties().set ("virtualName", name);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentLayout::addToXml (XmlElement& xml) const
|
||||
{
|
||||
for (int i = 0; i < components.size(); ++i)
|
||||
{
|
||||
ComponentTypeHandler* h = ComponentTypeHandler::getHandlerFor (*components [i]);
|
||||
|
||||
if (h != 0)
|
||||
xml.addChildElement (h->createXmlFor (components [i], this));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTLAYOUT_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTLAYOUT_JUCEHEADER__
|
||||
|
||||
|
||||
#include "components/jucer_ComponentTypeHandler.h"
|
||||
class JucerDocument;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Manages the set of sub-components for a JucerDocument.
|
||||
|
||||
*/
|
||||
class ComponentLayout
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ComponentLayout();
|
||||
~ComponentLayout();
|
||||
|
||||
//==============================================================================
|
||||
void changed();
|
||||
|
||||
int getNumComponents() const throw() { return components.size(); }
|
||||
Component* getComponent (const int index) const throw() { return components [index]; }
|
||||
int indexOfComponent (Component* const comp) const throw() { return components.indexOf (comp); }
|
||||
bool containsComponent (Component* const comp) const throw() { return components.contains (comp); }
|
||||
|
||||
//==============================================================================
|
||||
void clearComponents();
|
||||
void removeComponent (Component* comp, const bool undoable);
|
||||
|
||||
Component* addNewComponent (ComponentTypeHandler* const type, int x, int y);
|
||||
Component* addComponentFromXml (const XmlElement& xml, const bool undoable);
|
||||
|
||||
Component* findComponentWithId (const int64 componentId) const;
|
||||
|
||||
//==============================================================================
|
||||
void componentToFront (Component* comp, const bool undoable);
|
||||
void componentToBack (Component* comp, const bool undoable);
|
||||
|
||||
void setComponentPosition (Component* comp, const RelativePositionedRectangle& newPos, const bool undoable);
|
||||
void updateStoredComponentPosition (Component* comp, const bool undoable);
|
||||
|
||||
//==============================================================================
|
||||
Component* getComponentRelativePosTarget (Component* comp, int whichDimension) const;
|
||||
void setComponentRelativeTarget (Component* comp, int whichDimension, Component* compToBeRelativeTo);
|
||||
// checks recursively whether the comp depends on the given comp for its position
|
||||
bool dependsOnComponentForRelativePos (Component* comp, Component* possibleDependee) const;
|
||||
|
||||
PopupMenu getRelativeTargetMenu (Component* comp, int whichDimension) const;
|
||||
void processRelativeTargetMenuResult (Component* comp, int whichDimension, int menuResultID);
|
||||
|
||||
//==============================================================================
|
||||
void setComponentMemberVariableName (Component* comp, const String& newName);
|
||||
const String getComponentMemberVariableName (Component* comp) const;
|
||||
|
||||
//==============================================================================
|
||||
void setComponentVirtualClassName (Component* comp, const String& newName);
|
||||
const String getComponentVirtualClassName (Component* comp) const;
|
||||
|
||||
//==============================================================================
|
||||
SelectedItemSet <Component*>& getSelectedSet() { return selected; }
|
||||
|
||||
static const char* const clipboardXmlTag;
|
||||
void copySelectedToClipboard();
|
||||
void paste();
|
||||
void deleteSelected();
|
||||
void selectAll();
|
||||
|
||||
void selectedToFront();
|
||||
void selectedToBack();
|
||||
|
||||
void startDragging();
|
||||
void dragSelectedComps (int dxFromDragStart, int dyFromDragStart, const bool allowSnap = true);
|
||||
void endDragging();
|
||||
|
||||
void moveSelectedComps (int dx, int dy, bool snap);
|
||||
void stretchSelectedComps (int dw, int dh, bool allowSnap);
|
||||
|
||||
void bringLostItemsBackOnScreen (int width, int height);
|
||||
|
||||
//==============================================================================
|
||||
void setDocument (JucerDocument* const document_) { document = document_; }
|
||||
JucerDocument* getDocument() const throw() { return document; }
|
||||
|
||||
//==============================================================================
|
||||
void addToXml (XmlElement& xml) const;
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code) const;
|
||||
|
||||
void perform (UndoableAction* action, const String& actionName);
|
||||
|
||||
private:
|
||||
JucerDocument* document;
|
||||
OwnedArray <Component> components;
|
||||
SelectedItemSet <Component*> selected;
|
||||
int nextCompUID;
|
||||
|
||||
const String getUnusedMemberName (String nameRoot, Component* comp) const;
|
||||
|
||||
friend class FrontBackCompAction;
|
||||
friend class DeleteCompAction;
|
||||
void moveComponentZOrder (int oldIndex, int newIndex);
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTLAYOUT_JUCEHEADER__
|
||||
|
|
@ -1,379 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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 "../jucer_Headers.h"
|
||||
#include "jucer_GeneratedCode.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
GeneratedCode::GeneratedCode (const JucerDocument* const document_)
|
||||
: document (document_),
|
||||
suffix (0)
|
||||
{
|
||||
}
|
||||
|
||||
GeneratedCode::~GeneratedCode()
|
||||
{
|
||||
}
|
||||
|
||||
int GeneratedCode::getUniqueSuffix()
|
||||
{
|
||||
return ++suffix;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
String& GeneratedCode::getCallbackCode (const String& requiredParentClass,
|
||||
const String& returnType,
|
||||
const String& prototype,
|
||||
const bool hasPrePostUserSections)
|
||||
{
|
||||
String parentClass (requiredParentClass);
|
||||
if (parentClass.isNotEmpty()
|
||||
&& ! (parentClass.startsWith ("public ")
|
||||
|| parentClass.startsWith ("private ")
|
||||
|| parentClass.startsWith ("protected ")))
|
||||
{
|
||||
parentClass = "public " + parentClass;
|
||||
}
|
||||
|
||||
for (int i = callbacks.size(); --i >= 0;)
|
||||
{
|
||||
CallbackMethod* const cm = callbacks.getUnchecked(i);
|
||||
|
||||
if (cm->requiredParentClass == parentClass
|
||||
&& cm->returnType == returnType
|
||||
&& cm->prototype == prototype)
|
||||
return cm->content;
|
||||
}
|
||||
|
||||
CallbackMethod* const cm = new CallbackMethod();
|
||||
callbacks.add (cm);
|
||||
|
||||
cm->requiredParentClass = parentClass;
|
||||
cm->returnType = returnType;
|
||||
cm->prototype = prototype;
|
||||
cm->hasPrePostUserSections = hasPrePostUserSections;
|
||||
return cm->content;
|
||||
}
|
||||
|
||||
void GeneratedCode::removeCallback (const String& returnType, const String& prototype)
|
||||
{
|
||||
for (int i = callbacks.size(); --i >= 0;)
|
||||
{
|
||||
CallbackMethod* const cm = callbacks.getUnchecked(i);
|
||||
|
||||
if (cm->returnType == returnType && cm->prototype == prototype)
|
||||
callbacks.remove (i);
|
||||
}
|
||||
}
|
||||
|
||||
void GeneratedCode::addImageResourceLoader (const String& imageMemberName, const String& resourceName)
|
||||
{
|
||||
const String initialiser (imageMemberName + " (0)");
|
||||
|
||||
if (! initialisers.contains (initialiser, false))
|
||||
{
|
||||
initialisers.add (initialiser);
|
||||
|
||||
privateMemberDeclarations
|
||||
<< "Image " << imageMemberName << ";\n";
|
||||
|
||||
if (resourceName.isNotEmpty())
|
||||
{
|
||||
constructorCode
|
||||
<< imageMemberName << " = ImageCache::getFromMemory ("
|
||||
<< resourceName << ", " << resourceName << "Size);\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const StringArray GeneratedCode::getExtraParentClasses() const
|
||||
{
|
||||
StringArray s;
|
||||
|
||||
for (int i = 0; i < callbacks.size(); ++i)
|
||||
{
|
||||
CallbackMethod* const cm = callbacks.getUnchecked(i);
|
||||
s.add (cm->requiredParentClass);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
const String GeneratedCode::getCallbackDeclarations() const
|
||||
{
|
||||
String s;
|
||||
|
||||
for (int i = 0; i < callbacks.size(); ++i)
|
||||
{
|
||||
CallbackMethod* const cm = callbacks.getUnchecked(i);
|
||||
|
||||
s << cm->returnType << " " << cm->prototype << ";\n";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
const String GeneratedCode::getCallbackDefinitions() const
|
||||
{
|
||||
String s;
|
||||
|
||||
for (int i = 0; i < callbacks.size(); ++i)
|
||||
{
|
||||
CallbackMethod* const cm = callbacks.getUnchecked(i);
|
||||
|
||||
const String userCodeBlockName ("User"
|
||||
+ makeValidCppIdentifier (cm->prototype.upToFirstOccurrenceOf ("(", false, false),
|
||||
true, true, false).trim());
|
||||
|
||||
if (userCodeBlockName.isNotEmpty() && cm->hasPrePostUserSections)
|
||||
{
|
||||
s << cm->returnType << " " << className << "::" << cm->prototype
|
||||
<< "\n{\n //[" << userCodeBlockName << "_Pre]\n //[/" << userCodeBlockName
|
||||
<< "_Pre]\n\n "
|
||||
<< indentCode (cm->content.trim(), 4)
|
||||
<< "\n\n //[" << userCodeBlockName << "_Post]\n //[/" << userCodeBlockName
|
||||
<< "_Post]\n}\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
s << cm->returnType << " " << className << "::" << cm->prototype
|
||||
<< "\n{\n "
|
||||
<< indentCode (cm->content.trim(), 4)
|
||||
<< "\n}\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String GeneratedCode::getClassDeclaration() const
|
||||
{
|
||||
StringArray parentClassLines;
|
||||
parentClassLines.addTokens (parentClasses, ",", String::empty);
|
||||
parentClassLines.addArray (getExtraParentClasses());
|
||||
|
||||
parentClassLines.trim();
|
||||
parentClassLines.removeEmptyStrings();
|
||||
parentClassLines.removeDuplicates (false);
|
||||
|
||||
if (parentClassLines.contains ("public Button", false))
|
||||
parentClassLines.removeString ("public Component", false);
|
||||
|
||||
String r ("class ");
|
||||
r << className << " : ";
|
||||
|
||||
r += parentClassLines.joinIntoString (",\n" + String::repeatedString (" ", r.length()));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
const String GeneratedCode::getInitialiserList() const
|
||||
{
|
||||
StringArray inits (initialisers);
|
||||
|
||||
if (parentClassInitialiser.isNotEmpty())
|
||||
inits.insert (0, parentClassInitialiser);
|
||||
|
||||
inits.trim();
|
||||
inits.removeEmptyStrings();
|
||||
inits.removeDuplicates (false);
|
||||
|
||||
String s;
|
||||
|
||||
if (inits.size() == 0)
|
||||
return s;
|
||||
|
||||
s << " : ";
|
||||
|
||||
for (int i = 0; i < inits.size(); ++i)
|
||||
{
|
||||
String init (inits[i]);
|
||||
|
||||
while (init.endsWithChar (','))
|
||||
init = init.dropLastCharacters (1);
|
||||
|
||||
s << init;
|
||||
|
||||
if (i < inits.size() - 1)
|
||||
s << ",\n ";
|
||||
else
|
||||
s << "\n";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
static const String getIncludeFileCode (StringArray files)
|
||||
{
|
||||
files.trim();
|
||||
files.removeEmptyStrings();
|
||||
files.removeDuplicates (false);
|
||||
|
||||
String s;
|
||||
|
||||
for (int i = 0; i < files.size(); ++i)
|
||||
s << "#include \"" << files[i] << "\"\n";
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static void replaceTemplate (String& text, const String& itemName, const String& value)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
const int index = text.indexOf ("%%" + itemName + "%%");
|
||||
|
||||
if (index < 0)
|
||||
break;
|
||||
|
||||
int indentLevel = 0;
|
||||
|
||||
for (int i = index; --i >= 0;)
|
||||
{
|
||||
if (text[i] == '\n')
|
||||
break;
|
||||
|
||||
++indentLevel;
|
||||
}
|
||||
|
||||
text = text.replaceSection (index, itemName.length() + 4,
|
||||
indentCode (value, indentLevel));
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static bool getUserSection (const StringArray& lines, const String& tag, StringArray& resultLines)
|
||||
{
|
||||
const int start = indexOfLineStartingWith (lines, "//[" + tag + "]", 0);
|
||||
|
||||
if (start < 0)
|
||||
return false;
|
||||
|
||||
const int end = indexOfLineStartingWith (lines, "//[/" + tag + "]", start + 1);
|
||||
|
||||
for (int i = start + 1; i < end; ++i)
|
||||
resultLines.add (lines [i]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void copyAcrossUserSections (String& dest, const String& src)
|
||||
{
|
||||
StringArray srcLines, dstLines;
|
||||
srcLines.addLines (src);
|
||||
dstLines.addLines (dest);
|
||||
|
||||
for (int i = 0; i < dstLines.size(); ++i)
|
||||
{
|
||||
if (dstLines[i].trimStart().startsWith ("//["))
|
||||
{
|
||||
String tag (dstLines[i].trimStart().substring (3));
|
||||
tag = tag.upToFirstOccurrenceOf ("]", false, false);
|
||||
|
||||
jassert (! tag.startsWithChar ('/'));
|
||||
|
||||
if (! tag.startsWithChar ('/'))
|
||||
{
|
||||
const int endLine = indexOfLineStartingWith (dstLines,
|
||||
"//[/" + tag + "]",
|
||||
i + 1);
|
||||
|
||||
if (endLine > i)
|
||||
{
|
||||
StringArray sourceLines;
|
||||
|
||||
if (getUserSection (srcLines, tag, sourceLines))
|
||||
{
|
||||
int j;
|
||||
for (j = endLine - i; --j > 0;)
|
||||
dstLines.remove (i + 1);
|
||||
|
||||
for (j = 0; j < sourceLines.size(); ++j)
|
||||
dstLines.insert (++i, sourceLines [j].trimEnd());
|
||||
|
||||
++i;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = endLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dstLines.set (i, dstLines[i].trimEnd());
|
||||
}
|
||||
|
||||
dest = dstLines.joinIntoString ("\n") + "\n";
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void GeneratedCode::applyToCode (String& code,
|
||||
const String& fileNameRoot,
|
||||
const bool isForPreview,
|
||||
const String& oldFileWithUserData) const
|
||||
{
|
||||
// header guard..
|
||||
String headerGuard ("__JUCER_HEADER_");
|
||||
headerGuard << className.toUpperCase().retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
<< "_" << fileNameRoot.toUpperCase().retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
<< "_" << String::toHexString (Random::getSystemRandom().nextInt()).toUpperCase()
|
||||
<< "__";
|
||||
replaceTemplate (code, "headerGuard", headerGuard);
|
||||
|
||||
replaceTemplate (code, "creationTime", Time::getCurrentTime().toString (true, true, true));
|
||||
|
||||
replaceTemplate (code, "className", className);
|
||||
replaceTemplate (code, "constructorParams", constructorParams);
|
||||
replaceTemplate (code, "initialisers", getInitialiserList());
|
||||
|
||||
replaceTemplate (code, "classDeclaration", getClassDeclaration());
|
||||
replaceTemplate (code, "privateMemberDeclarations", privateMemberDeclarations);
|
||||
replaceTemplate (code, "publicMemberDeclarations", getCallbackDeclarations() + "\n" + publicMemberDeclarations);
|
||||
|
||||
replaceTemplate (code, "methodDefinitions", getCallbackDefinitions());
|
||||
|
||||
replaceTemplate (code, "includeFilesH", getIncludeFileCode (includeFilesH));
|
||||
replaceTemplate (code, "includeFilesCPP", getIncludeFileCode (includeFilesCPP));
|
||||
|
||||
replaceTemplate (code, "constructor", constructorCode);
|
||||
replaceTemplate (code, "destructor", destructorCode);
|
||||
|
||||
if (! isForPreview)
|
||||
{
|
||||
replaceTemplate (code, "metadata", jucerMetadata);
|
||||
replaceTemplate (code, "staticMemberDefinitions", staticMemberDefinitions);
|
||||
}
|
||||
else
|
||||
{
|
||||
replaceTemplate (code, "metadata", " << Metadata isn't shown in the code preview >>\n");
|
||||
replaceTemplate (code, "staticMemberDefinitions", "// Static member declarations and resources would go here... (these aren't shown in the code preview)");
|
||||
}
|
||||
|
||||
copyAcrossUserSections (code, oldFileWithUserData);
|
||||
}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_GENERATEDCODE_JUCEHEADER__
|
||||
#define __JUCER_GENERATEDCODE_JUCEHEADER__
|
||||
|
||||
class JucerDocument;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
A class for collecting the various snippets of c++ that will be assembled into
|
||||
the final cpp and header files.
|
||||
*/
|
||||
class GeneratedCode
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
GeneratedCode (const JucerDocument* const document);
|
||||
~GeneratedCode();
|
||||
|
||||
//==============================================================================
|
||||
void applyToCode (String& code,
|
||||
const String& fileNameRoot,
|
||||
const bool isForPreview,
|
||||
const String& oldFileWithUserData = String::empty) const;
|
||||
|
||||
int getUniqueSuffix();
|
||||
|
||||
//==============================================================================
|
||||
const JucerDocument* const document;
|
||||
|
||||
String className;
|
||||
String componentName;
|
||||
String parentClassInitialiser; // optional parent class initialiser to go before the items in the initialisers list
|
||||
StringArray initialisers; // (a list of the member variables that need initalising after the constructor declaration)
|
||||
String parentClasses;
|
||||
String constructorParams;
|
||||
String privateMemberDeclarations;
|
||||
String publicMemberDeclarations;
|
||||
StringArray includeFilesH, includeFilesCPP;
|
||||
String constructorCode;
|
||||
String destructorCode;
|
||||
String staticMemberDefinitions;
|
||||
String jucerMetadata;
|
||||
|
||||
struct CallbackMethod
|
||||
{
|
||||
String requiredParentClass;
|
||||
String returnType;
|
||||
String prototype;
|
||||
String content;
|
||||
bool hasPrePostUserSections;
|
||||
};
|
||||
|
||||
OwnedArray <CallbackMethod> callbacks;
|
||||
|
||||
String& getCallbackCode (const String& requiredParentClass,
|
||||
const String& returnType,
|
||||
const String& prototype,
|
||||
const bool hasPrePostUserSections);
|
||||
|
||||
void removeCallback (const String& returnType, const String& prototype);
|
||||
|
||||
void addImageResourceLoader (const String& imageMemberName, const String& resourceName);
|
||||
|
||||
const String getCallbackDeclarations() const;
|
||||
const String getCallbackDefinitions() const;
|
||||
const StringArray getExtraParentClasses() const;
|
||||
|
||||
private:
|
||||
const String getClassDeclaration() const;
|
||||
const String getInitialiserList() const;
|
||||
int suffix;
|
||||
|
||||
GeneratedCode (const GeneratedCode&);
|
||||
GeneratedCode& operator= (const GeneratedCode&);
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_GENERATEDCODE_JUCEHEADER__
|
||||
|
|
@ -1,653 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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 "../jucer_Headers.h"
|
||||
#include "jucer_JucerDocument.h"
|
||||
#include "jucer_ObjectTypes.h"
|
||||
#include "../ui/jucer_TestComponent.h"
|
||||
|
||||
const char* const defaultClassName = "NewJucerComponent";
|
||||
const char* const defaultParentClasses = "public Component";
|
||||
|
||||
static const int timerInterval = 150;
|
||||
|
||||
//==============================================================================
|
||||
JucerDocument::JucerDocument()
|
||||
: FileBasedDocument (".cpp", "*.cpp",
|
||||
"Open a Jucer C++ file...",
|
||||
"Save as a Jucer C++ file..."),
|
||||
className (defaultClassName),
|
||||
parentClasses (defaultParentClasses),
|
||||
fixedSize (false),
|
||||
initialWidth (600),
|
||||
initialHeight (400),
|
||||
snapGridPixels (8),
|
||||
snapActive (true),
|
||||
snapShown (true),
|
||||
lastFocusedComp (0),
|
||||
lastClickCounter (0),
|
||||
componentOverlayOpacity (0.33f)
|
||||
{
|
||||
resources.setDocument (this);
|
||||
|
||||
startTimer (timerInterval);
|
||||
commandManager->commandStatusChanged();
|
||||
}
|
||||
|
||||
JucerDocument::~JucerDocument()
|
||||
{
|
||||
commandManager->commandStatusChanged();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void JucerDocument::changed()
|
||||
{
|
||||
FileBasedDocument::changed();
|
||||
commandManager->commandStatusChanged();
|
||||
}
|
||||
|
||||
void JucerDocument::timerCallback()
|
||||
{
|
||||
if ((lastFocusedComp != Component::getCurrentlyFocusedComponent()
|
||||
|| lastClickCounter != Desktop::getInstance().getMouseButtonClickCounter())
|
||||
&& ! Component::isMouseButtonDownAnywhere())
|
||||
{
|
||||
lastFocusedComp = Component::getCurrentlyFocusedComponent();
|
||||
lastClickCounter = Desktop::getInstance().getMouseButtonClickCounter();
|
||||
|
||||
getUndoManager().beginNewTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
bool JucerDocument::perform (UndoableAction* const action, const String& actionName)
|
||||
{
|
||||
startTimer (timerInterval);
|
||||
return undoManager.perform (action, actionName);
|
||||
}
|
||||
|
||||
void JucerDocument::refreshAllPropertyComps()
|
||||
{
|
||||
if (getComponentLayout() != 0)
|
||||
getComponentLayout()->getSelectedSet().changed();
|
||||
|
||||
for (int i = getNumPaintRoutines(); --i >= 0;)
|
||||
{
|
||||
getPaintRoutine (i)->getSelectedElements().changed();
|
||||
getPaintRoutine (i)->getSelectedPoints().changed();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void JucerDocument::setClassName (const String& newName)
|
||||
{
|
||||
if (newName != className
|
||||
&& makeValidCppIdentifier (newName, false, false, true).isNotEmpty())
|
||||
{
|
||||
className = makeValidCppIdentifier (newName, false, false, true);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
void JucerDocument::setComponentName (const String& newName)
|
||||
{
|
||||
if (newName != componentName)
|
||||
{
|
||||
componentName = newName;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
const String JucerDocument::getParentClassString() const
|
||||
{
|
||||
return parentClasses;
|
||||
}
|
||||
|
||||
void JucerDocument::setParentClasses (const String& classes)
|
||||
{
|
||||
if (classes != parentClasses)
|
||||
{
|
||||
StringArray parentClassLines;
|
||||
parentClassLines.addTokens (classes, ",", String::empty);
|
||||
parentClassLines.trim();
|
||||
parentClassLines.removeEmptyStrings();
|
||||
parentClassLines.removeDuplicates (false);
|
||||
|
||||
for (int i = parentClassLines.size(); --i >= 0;)
|
||||
{
|
||||
String s (parentClassLines[i]);
|
||||
String type;
|
||||
|
||||
if (s.startsWith ("public ")
|
||||
|| s.startsWith ("protected ")
|
||||
|| s.startsWith ("private "))
|
||||
{
|
||||
type = s.upToFirstOccurrenceOf (" ", true, false);
|
||||
s = s.fromFirstOccurrenceOf (" ", false, false);
|
||||
|
||||
if (s.trim().isEmpty())
|
||||
type = s = String::empty;
|
||||
}
|
||||
|
||||
s = type + makeValidCppIdentifier (s.trim(), false, false, true);
|
||||
|
||||
parentClassLines.set (i, s);
|
||||
}
|
||||
|
||||
parentClasses = parentClassLines.joinIntoString (", ");
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
const String JucerDocument::getConstructorParams() const
|
||||
{
|
||||
return constructorParams;
|
||||
}
|
||||
|
||||
void JucerDocument::setConstructorParams (const String& newParams)
|
||||
{
|
||||
if (constructorParams != newParams)
|
||||
{
|
||||
constructorParams = newParams;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
const String JucerDocument::getVariableInitialisers() const
|
||||
{
|
||||
return variableInitialisers;
|
||||
}
|
||||
|
||||
void JucerDocument::setVariableInitialisers (const String& newInitlialisers)
|
||||
{
|
||||
if (variableInitialisers != newInitlialisers)
|
||||
{
|
||||
variableInitialisers = newInitlialisers;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
void JucerDocument::setFixedSize (const bool isFixed)
|
||||
{
|
||||
if (fixedSize != isFixed)
|
||||
{
|
||||
fixedSize = isFixed;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
void JucerDocument::setInitialSize (int w, int h)
|
||||
{
|
||||
w = jmax (1, w);
|
||||
h = jmax (1, h);
|
||||
|
||||
if (initialWidth != w || initialHeight != h)
|
||||
{
|
||||
initialWidth = w;
|
||||
initialHeight = h;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool JucerDocument::isSnapActive (const bool disableIfCtrlKeyDown) const throw()
|
||||
{
|
||||
return snapActive != (disableIfCtrlKeyDown && ModifierKeys::getCurrentModifiers().isCtrlDown());
|
||||
}
|
||||
|
||||
int JucerDocument::snapPosition (int pos) const throw()
|
||||
{
|
||||
if (isSnapActive (true))
|
||||
{
|
||||
jassert (snapGridPixels > 0);
|
||||
pos = ((pos + snapGridPixels * 1024 + snapGridPixels / 2) / snapGridPixels - 1024) * snapGridPixels;
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
void JucerDocument::setSnappingGrid (const int numPixels, const bool active, const bool shown)
|
||||
{
|
||||
if (numPixels != snapGridPixels
|
||||
|| active != snapActive
|
||||
|| shown != snapShown)
|
||||
{
|
||||
snapGridPixels = numPixels;
|
||||
snapActive = active;
|
||||
snapShown = shown;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
void JucerDocument::setComponentOverlayOpacity (const float alpha)
|
||||
{
|
||||
if (alpha != componentOverlayOpacity)
|
||||
{
|
||||
componentOverlayOpacity = alpha;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
String JucerDocument::getDocumentTitle()
|
||||
{
|
||||
return className;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void JucerDocument::addMethod (const String& base, const String& returnVal, const String& method, const String& initialContent,
|
||||
StringArray& baseClasses, StringArray& returnValues, StringArray& methods, StringArray& initialContents)
|
||||
{
|
||||
baseClasses.add (base);
|
||||
returnValues.add (returnVal);
|
||||
methods.add (method);
|
||||
initialContents.add (initialContent);
|
||||
}
|
||||
|
||||
void JucerDocument::getOptionalMethods (StringArray& baseClasses,
|
||||
StringArray& returnValues,
|
||||
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 (const 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);
|
||||
}
|
||||
|
||||
void JucerDocument::setOptionalMethodEnabled (const String& methodSignature, const bool enable)
|
||||
{
|
||||
if (enable)
|
||||
activeExtraMethods.addIfNotAlreadyThere (methodSignature);
|
||||
else
|
||||
activeExtraMethods.removeString (methodSignature);
|
||||
|
||||
changed();
|
||||
}
|
||||
|
||||
bool JucerDocument::isOptionalMethodEnabled (const String& methodSignature) const throw()
|
||||
{
|
||||
return activeExtraMethods.contains (methodSignature);
|
||||
}
|
||||
|
||||
|
||||
void JucerDocument::addExtraClassProperties (PropertyPanel* panel)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const char* const JucerDocument::jucerCompXmlTag = "JUCER_COMPONENT";
|
||||
|
||||
XmlElement* JucerDocument::createXml() const
|
||||
{
|
||||
XmlElement* doc = new XmlElement (jucerCompXmlTag);
|
||||
|
||||
doc->setAttribute ("documentType", getTypeName());
|
||||
doc->setAttribute ("className", className);
|
||||
doc->setAttribute ("componentName", componentName);
|
||||
doc->setAttribute ("parentClasses", parentClasses);
|
||||
doc->setAttribute ("constructorParams", constructorParams);
|
||||
doc->setAttribute ("variableInitialisers", variableInitialisers);
|
||||
doc->setAttribute ("snapPixels", snapGridPixels);
|
||||
doc->setAttribute ("snapActive", snapActive);
|
||||
doc->setAttribute ("snapShown", snapShown);
|
||||
doc->setAttribute ("overlayOpacity", (double) componentOverlayOpacity);
|
||||
doc->setAttribute ("fixedSize", fixedSize);
|
||||
doc->setAttribute ("initialWidth", initialWidth);
|
||||
doc->setAttribute ("initialHeight", initialHeight);
|
||||
|
||||
if (activeExtraMethods.size() > 0)
|
||||
{
|
||||
XmlElement* extraMethods = new XmlElement ("METHODS");
|
||||
doc->addChildElement (extraMethods);
|
||||
|
||||
for (int i = 0; i < activeExtraMethods.size(); ++i)
|
||||
{
|
||||
XmlElement* e = new XmlElement ("METHOD");
|
||||
extraMethods ->addChildElement (e);
|
||||
e->setAttribute ("name", activeExtraMethods[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return doc;
|
||||
}
|
||||
|
||||
bool JucerDocument::loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (jucerCompXmlTag)
|
||||
&& getTypeName().equalsIgnoreCase (xml.getStringAttribute ("documentType", ObjectTypes::documentTypeNames[0])))
|
||||
{
|
||||
className = xml.getStringAttribute ("className", defaultClassName);
|
||||
componentName = xml.getStringAttribute ("componentName", String::empty);
|
||||
parentClasses = xml.getStringAttribute ("parentClasses", defaultParentClasses);
|
||||
constructorParams = xml.getStringAttribute ("constructorParams", String::empty);
|
||||
variableInitialisers = xml.getStringAttribute ("variableInitialisers", String::empty);
|
||||
|
||||
fixedSize = xml.getBoolAttribute ("fixedSize", false);
|
||||
initialWidth = xml.getIntAttribute ("initialWidth", 300);
|
||||
initialHeight = xml.getIntAttribute ("initialHeight", 200);
|
||||
|
||||
snapGridPixels = xml.getIntAttribute ("snapPixels", snapGridPixels);
|
||||
snapActive = xml.getBoolAttribute ("snapActive", snapActive);
|
||||
snapShown = xml.getBoolAttribute ("snapShown", snapShown);
|
||||
|
||||
componentOverlayOpacity = (float) xml.getDoubleAttribute ("overlayOpacity", 0.0);
|
||||
|
||||
activeExtraMethods.clear();
|
||||
|
||||
XmlElement* const methods = xml.getChildByName ("METHODS");
|
||||
|
||||
if (methods != 0)
|
||||
{
|
||||
forEachXmlChildElementWithTagName (*methods, e, "METHOD")
|
||||
{
|
||||
activeExtraMethods.addIfNotAlreadyThere (e->getStringAttribute ("name"));
|
||||
}
|
||||
}
|
||||
|
||||
activeExtraMethods.trim();
|
||||
activeExtraMethods.removeEmptyStrings();
|
||||
|
||||
changed();
|
||||
getUndoManager().clearUndoHistory();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Result JucerDocument::loadDocument (const File& file)
|
||||
{
|
||||
const File cppFile (file.withFileExtension (".cpp"));
|
||||
|
||||
const String cppFileString (cppFile.loadFileAsString());
|
||||
|
||||
resources.loadFromCpp (file, cppFileString);
|
||||
|
||||
ScopedPointer<XmlElement> xml (pullMetaDataFromCppFile (cppFileString));
|
||||
|
||||
if (xml != nullptr)
|
||||
{
|
||||
if (loadFromXml (*xml))
|
||||
return Result::ok();
|
||||
|
||||
return Result::fail (TRANS("Couldn't parse the XML section of this file correctly"));
|
||||
}
|
||||
|
||||
return Result::fail (TRANS("Not a valid Jucer cpp file"));
|
||||
}
|
||||
|
||||
Result JucerDocument::saveDocument (const File& file)
|
||||
{
|
||||
const File cppFile (file.withFileExtension (".cpp"));
|
||||
const File hFile (file.withFileExtension (".h"));
|
||||
|
||||
String templateH, templateCpp;
|
||||
|
||||
if (! findTemplateFiles (templateH, templateCpp))
|
||||
return Result::fail (TRANS("Couldn't find the required Jucer template files...\n\nMake sure the template files directory is set up correctly in the preferences box."));
|
||||
|
||||
const bool ok = writeCodeFiles (hFile, cppFile, templateH, templateCpp);
|
||||
TestComponent::reloadAll();
|
||||
|
||||
if (ok)
|
||||
return Result::ok();
|
||||
|
||||
return Result::fail (TRANS("Couldn't write to the file."));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
File JucerDocument::getLastDocumentOpened()
|
||||
{
|
||||
return StoredSettings::getInstance()->recentFiles.getFile (0);
|
||||
}
|
||||
|
||||
void JucerDocument::setLastDocumentOpened (const File& file)
|
||||
{
|
||||
StoredSettings::getInstance()->recentFiles.addFile (file);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
XmlElement* JucerDocument::pullMetaDataFromCppFile (const String& cpp)
|
||||
{
|
||||
StringArray lines;
|
||||
lines.addLines (cpp);
|
||||
|
||||
int startLine = indexOfLineStartingWith (lines, "BEGIN_JUCER_METADATA", 0);
|
||||
|
||||
if (startLine > 0)
|
||||
{
|
||||
int endLine = indexOfLineStartingWith (lines, "END_JUCER_METADATA", 0);
|
||||
|
||||
if (endLine > startLine)
|
||||
{
|
||||
String xmlText;
|
||||
|
||||
for (int i = startLine + 1; i < endLine; ++i)
|
||||
xmlText << lines[i] << "\n";
|
||||
|
||||
XmlDocument doc (xmlText);
|
||||
return doc.getDocumentElement();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const
|
||||
{
|
||||
code.className = className;
|
||||
code.componentName = componentName;
|
||||
code.parentClasses = parentClasses;
|
||||
code.constructorParams = constructorParams;
|
||||
code.initialisers.addLines (variableInitialisers);
|
||||
|
||||
if (! componentName.isEmpty())
|
||||
code.parentClassInitialiser = "Component (" + quotedString (code.componentName) + ")";
|
||||
|
||||
// call these now, just to make sure they're the first two methods in the list.
|
||||
code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false)
|
||||
<< "//[UserPrePaint] Add your own custom painting code here..\n//[/UserPrePaint]\n\n";
|
||||
|
||||
code.getCallbackCode (String::empty, "void", "resized()", false);
|
||||
|
||||
if (getComponentLayout() != 0)
|
||||
getComponentLayout()->fillInGeneratedCode (code);
|
||||
|
||||
fillInPaintCode (code);
|
||||
|
||||
ScopedPointer<XmlElement> e (createXml());
|
||||
jassert (e != 0);
|
||||
code.jucerMetadata = e->createDocument (String::empty, false, false);
|
||||
|
||||
resources.fillInGeneratedCode (code);
|
||||
|
||||
code.constructorCode
|
||||
<< "\n//[UserPreSize]\n//[/UserPreSize]\n";
|
||||
|
||||
if (initialWidth > 0 || initialHeight > 0)
|
||||
code.constructorCode
|
||||
<< "\nsetSize (" << initialWidth << ", " << initialHeight << ");\n";
|
||||
|
||||
code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false)
|
||||
<< "//[UserPaint] Add your own custom painting code here..\n//[/UserPaint]";
|
||||
|
||||
code.getCallbackCode (String::empty, "void", "resized()", false)
|
||||
<< "//[UserResized] Add your own custom resize handling here..\n//[/UserResized]";
|
||||
|
||||
// add optional methods
|
||||
StringArray baseClasses, returnValues, methods, initialContents;
|
||||
getOptionalMethods (baseClasses, returnValues, methods, initialContents);
|
||||
|
||||
for (int i = 0; i < methods.size(); ++i)
|
||||
{
|
||||
if (isOptionalMethodEnabled (methods[i]))
|
||||
{
|
||||
String& s = code.getCallbackCode (baseClasses[i], returnValues[i], methods[i], false);
|
||||
|
||||
if (! s.contains ("//["))
|
||||
{
|
||||
String userCommentTag ("UserCode_");
|
||||
userCommentTag += methods[i].upToFirstOccurrenceOf ("(", false, false).trim();
|
||||
|
||||
s << "\n//["
|
||||
<< userCommentTag
|
||||
<< "] -- Add your code here...\n"
|
||||
<< initialContents[i];
|
||||
|
||||
if (initialContents[i].isNotEmpty() && ! initialContents[i].endsWithChar ('\n'))
|
||||
s << '\n';
|
||||
|
||||
s << "//[/"
|
||||
<< userCommentTag
|
||||
<< "]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JucerDocument::fillInPaintCode (GeneratedCode& code) const
|
||||
{
|
||||
for (int i = 0; i < getNumPaintRoutines(); ++i)
|
||||
{
|
||||
getPaintRoutine (i)
|
||||
->fillInGeneratedCode (code, code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false));
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool JucerDocument::findTemplateFiles (String& templateH, String& templateCpp) const
|
||||
{
|
||||
const File templateDir (StoredSettings::getInstance()->getTemplatesDir());
|
||||
|
||||
const File hTemplate (templateDir.getChildFile ("jucer_ComponentTemplate.h"));
|
||||
const File cppTemplate (templateDir.getChildFile ("jucer_ComponentTemplate.cpp"));
|
||||
|
||||
if (! (cppTemplate.existsAsFile() && hTemplate.existsAsFile()))
|
||||
return false;
|
||||
|
||||
templateH = hTemplate.loadFileAsString();
|
||||
templateCpp = cppTemplate.loadFileAsString();
|
||||
|
||||
const String jucerVersionString ("Jucer version: " + String (JUCER_MAJOR_VERSION)
|
||||
+ "." + String (JUCER_MINOR_VERSION));
|
||||
|
||||
// This checks the template files to see if they're the ones that shipped with this
|
||||
// version of the jucer. If it fails, you're probably using the wrong ones.
|
||||
// If you're using customised template files, just add the appropriate version line to
|
||||
// their headers to avoid this warning.
|
||||
jassert (templateH.containsIgnoreCase (jucerVersionString));
|
||||
jassert (templateCpp.containsIgnoreCase (jucerVersionString));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void JucerDocument::getPreviewFiles (String& h, String& cpp)
|
||||
{
|
||||
if (! findTemplateFiles (h, cpp))
|
||||
{
|
||||
h = cpp = TRANS("Couldn't find the required Jucer template files...\n\nMake sure the template files directory is set up correctly in the preferences box.");
|
||||
}
|
||||
else
|
||||
{
|
||||
GeneratedCode generated (this);
|
||||
fillInGeneratedCode (generated);
|
||||
generated.includeFilesCPP.insert (0, getFile().withFileExtension ("h").getFileName());
|
||||
|
||||
generated.applyToCode (h, getClassName(), true);
|
||||
generated.applyToCode (cpp, getClassName(), true);
|
||||
}
|
||||
}
|
||||
|
||||
static const String fixNewLines (const String& s)
|
||||
{
|
||||
StringArray lines;
|
||||
lines.addLines (s);
|
||||
|
||||
for (int i = 0; i < lines.size(); ++i)
|
||||
lines.set (i, lines[i].trimEnd());
|
||||
|
||||
while (lines.size() > 0 && lines [lines.size() - 1].trim().isEmpty())
|
||||
lines.remove (lines.size() - 1);
|
||||
|
||||
return lines.joinIntoString ("\r\n") + "\r\n";
|
||||
}
|
||||
|
||||
bool JucerDocument::writeCodeFiles (const File& headerFile,
|
||||
const File& cppFile,
|
||||
String h,
|
||||
String cpp) const
|
||||
{
|
||||
GeneratedCode generated (this);
|
||||
fillInGeneratedCode (generated);
|
||||
|
||||
generated.includeFilesCPP.insert (0, headerFile.getFileName());
|
||||
|
||||
String existingHeader (h), existingCpp (cpp);
|
||||
|
||||
if (headerFile.existsAsFile())
|
||||
existingHeader = headerFile.loadFileAsString();
|
||||
|
||||
if (cppFile.existsAsFile())
|
||||
existingCpp = cppFile.loadFileAsString();
|
||||
|
||||
generated.applyToCode (h, headerFile.getFileNameWithoutExtension(), false, existingHeader);
|
||||
generated.applyToCode (cpp, headerFile.getFileNameWithoutExtension(), false, existingCpp);
|
||||
|
||||
h = fixNewLines (h);
|
||||
cpp = fixNewLines (cpp);
|
||||
|
||||
return headerFile.replaceWithText (h, false, false)
|
||||
&& cppFile.replaceWithText (cpp, false, false);
|
||||
}
|
||||
|
|
@ -1,202 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_JUCERDOCUMENT_JUCEHEADER__
|
||||
#define __JUCER_JUCERDOCUMENT_JUCEHEADER__
|
||||
|
||||
#include "components/jucer_ComponentTypeHandler.h"
|
||||
#include "jucer_PaintRoutine.h"
|
||||
#include "jucer_ComponentLayout.h"
|
||||
#include "jucer_BinaryResources.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
This is the main document base class, which loads, saves and manages the state of
|
||||
an entire jucer component.
|
||||
|
||||
It contains a ComponentLayout object to represent its sub-components, and
|
||||
one or more PaintRoutine objects to represent sets of drawing operations it
|
||||
might want to do.
|
||||
|
||||
It also holds a BinaryResources object to manage its resources.
|
||||
*/
|
||||
class JucerDocument : public FileBasedDocument,
|
||||
private Timer
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
JucerDocument();
|
||||
~JucerDocument();
|
||||
|
||||
void changed();
|
||||
|
||||
virtual JucerDocument* createCopy() = 0;
|
||||
virtual const String getTypeName() const = 0;
|
||||
|
||||
//==============================================================================
|
||||
UndoManager& getUndoManager() throw() { return undoManager; }
|
||||
|
||||
bool perform (UndoableAction* const action, const String& actionName);
|
||||
|
||||
void refreshAllPropertyComps();
|
||||
|
||||
//==============================================================================
|
||||
const String& getClassName() const throw() { return className; }
|
||||
void setClassName (const String& newName);
|
||||
|
||||
const String& getComponentName() const throw() { return componentName; }
|
||||
void setComponentName (const String& newName);
|
||||
|
||||
const String getParentClassString() const;
|
||||
void setParentClasses (const String& classes);
|
||||
|
||||
const String getConstructorParams() const;
|
||||
void setConstructorParams (const String& newParams);
|
||||
|
||||
const String getVariableInitialisers() const;
|
||||
void setVariableInitialisers (const String& newInitlialisers);
|
||||
|
||||
void setFixedSize (const bool isFixed);
|
||||
bool isFixedSize() const throw() { return fixedSize; }
|
||||
|
||||
void setInitialSize (int w, int h);
|
||||
|
||||
int getInitialWidth() const throw() { return initialWidth; }
|
||||
int getInitialHeight() const throw() { return initialHeight; }
|
||||
|
||||
//==============================================================================
|
||||
virtual int getNumPaintRoutines() const = 0;
|
||||
virtual const StringArray getPaintRoutineNames() const = 0;
|
||||
virtual PaintRoutine* getPaintRoutine (const int index) const = 0;
|
||||
|
||||
virtual ComponentLayout* getComponentLayout() const = 0;
|
||||
|
||||
virtual Component* createTestComponent (const bool alwaysFillBackground) = 0;
|
||||
|
||||
virtual void addExtraClassProperties (PropertyPanel* panel);
|
||||
|
||||
//==============================================================================
|
||||
virtual void getOptionalMethods (StringArray& baseClasses,
|
||||
StringArray& returnValues,
|
||||
StringArray& methods,
|
||||
StringArray& initialContents) const;
|
||||
|
||||
void setOptionalMethodEnabled (const String& methodSignature, const bool enable);
|
||||
bool isOptionalMethodEnabled (const String& methodSignature) const throw();
|
||||
|
||||
//==============================================================================
|
||||
BinaryResources& getResources() throw() { return resources; }
|
||||
|
||||
//==============================================================================
|
||||
void setSnappingGrid (const int numPixels, const bool active, const bool shown);
|
||||
|
||||
int getSnappingGridSize() const throw() { return snapGridPixels; }
|
||||
bool isSnapActive (const bool disableIfCtrlKeyDown) const throw();
|
||||
bool isSnapShown() const throw() { return snapShown; }
|
||||
|
||||
int snapPosition (int pos) const throw();
|
||||
|
||||
//==============================================================================
|
||||
void setComponentOverlayOpacity (const float alpha);
|
||||
float getComponentOverlayOpacity() const throw() { return componentOverlayOpacity; }
|
||||
|
||||
//==============================================================================
|
||||
static const char* const jucerCompXmlTag;
|
||||
|
||||
/** Creates the document's metadata xml section.
|
||||
|
||||
This doesn't include resources, which are done separately.
|
||||
*/
|
||||
virtual XmlElement* createXml() const;
|
||||
|
||||
/** Restores the sub-components and graphics from xml metadata.
|
||||
|
||||
This doesn't include resources, which aren't altered.
|
||||
*/
|
||||
virtual bool loadFromXml (const XmlElement& xml);
|
||||
|
||||
static XmlElement* pullMetaDataFromCppFile (const String& cpp);
|
||||
|
||||
//==============================================================================
|
||||
// Code generation
|
||||
|
||||
/** Fills in a GeneratedCode structure with this component's state. */
|
||||
virtual void fillInGeneratedCode (GeneratedCode& code) const;
|
||||
|
||||
virtual void fillInPaintCode (GeneratedCode& code) const;
|
||||
|
||||
/** Tries to track down and load the header and cpp templates.
|
||||
*/
|
||||
bool findTemplateFiles (String& templateH, String& templateCpp) const;
|
||||
|
||||
/** Generates and returns the header and cpp file contents for this component. */
|
||||
void getPreviewFiles (String& header, String& cpp);
|
||||
|
||||
|
||||
protected:
|
||||
String getDocumentTitle();
|
||||
Result loadDocument (const File& file);
|
||||
Result saveDocument (const File& file);
|
||||
File getLastDocumentOpened();
|
||||
void setLastDocumentOpened (const File& file);
|
||||
|
||||
|
||||
protected:
|
||||
//==============================================================================
|
||||
String className;
|
||||
String componentName;
|
||||
String parentClasses, constructorParams, variableInitialisers;
|
||||
bool fixedSize;
|
||||
int initialWidth, initialHeight;
|
||||
|
||||
BinaryResources resources;
|
||||
|
||||
static void addMethod (const String& base, const String& returnVal, const String& method, const String& initialContent,
|
||||
StringArray& baseClasses, StringArray& returnValues, StringArray& methods, StringArray& initialContents);
|
||||
|
||||
private:
|
||||
UndoManager undoManager;
|
||||
int snapGridPixels;
|
||||
bool snapActive, snapShown;
|
||||
Component* lastFocusedComp;
|
||||
int lastClickCounter;
|
||||
float componentOverlayOpacity;
|
||||
|
||||
StringArray activeExtraMethods;
|
||||
|
||||
void timerCallback();
|
||||
|
||||
//==============================================================================
|
||||
const String getMetadata() const;
|
||||
|
||||
bool writeCodeFiles (const File& headerFile,
|
||||
const File& cppFile,
|
||||
String headerTemplate,
|
||||
String cppTemplate) const;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_JUCERDOCUMENT_JUCEHEADER__
|
||||
|
|
@ -1,271 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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 "../jucer_Headers.h"
|
||||
|
||||
#include "jucer_ObjectTypes.h"
|
||||
|
||||
#include "paintelements/jucer_PaintElementUndoableAction.h"
|
||||
#include "paintelements/jucer_PaintElementRectangle.h"
|
||||
#include "paintelements/jucer_PaintElementRoundedRectangle.h"
|
||||
#include "paintelements/jucer_PaintElementImage.h"
|
||||
#include "paintelements/jucer_PaintElementEllipse.h"
|
||||
#include "paintelements/jucer_PaintElementPath.h"
|
||||
#include "paintelements/jucer_PaintElementText.h"
|
||||
#include "paintelements/jucer_PaintElementGroup.h"
|
||||
|
||||
#include "documents/jucer_ComponentDocument.h"
|
||||
#include "documents/jucer_ButtonDocument.h"
|
||||
|
||||
#include "components/jucer_TextButtonHandler.h"
|
||||
#include "components/jucer_ToggleButtonHandler.h"
|
||||
#include "components/jucer_SliderHandler.h"
|
||||
#include "components/jucer_LabelHandler.h"
|
||||
#include "components/jucer_TextEditorHandler.h"
|
||||
#include "components/jucer_ComboBoxHandler.h"
|
||||
#include "components/jucer_GroupComponentHandler.h"
|
||||
#include "components/jucer_JucerComponentHandler.h"
|
||||
#include "components/jucer_HyperlinkButtonHandler.h"
|
||||
#include "components/jucer_ViewportHandler.h"
|
||||
#include "components/jucer_TabbedComponentHandler.h"
|
||||
#include "components/jucer_TreeViewHandler.h"
|
||||
#include "components/jucer_GenericComponentHandler.h"
|
||||
#include "components/jucer_ImageButtonHandler.h"
|
||||
|
||||
namespace ObjectTypes
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
static const char* const documentNames[] =
|
||||
{
|
||||
"Component",
|
||||
"Button",
|
||||
0
|
||||
};
|
||||
|
||||
const char** const documentTypeNames = (const char**) documentNames;
|
||||
const int numDocumentTypes = numElementsInArray (documentNames) - 1;
|
||||
|
||||
JucerDocument* createNewDocument (const int index)
|
||||
{
|
||||
jassert (index >= 0 && index < numDocumentTypes);
|
||||
JucerDocument* newDoc = 0;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
newDoc = new ComponentDocument();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
newDoc = new ButtonDocument();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
jassert (newDoc != 0 && newDoc->getTypeName() == documentTypeNames[index]);
|
||||
return newDoc;
|
||||
}
|
||||
|
||||
JucerDocument* loadDocumentFromFile (const File& f, const bool showErrorMessage)
|
||||
{
|
||||
File file (f);
|
||||
|
||||
if (file == File::nonexistent && showErrorMessage)
|
||||
{
|
||||
FileChooser fc ("Open a Jucer C++ file...",
|
||||
StoredSettings::getInstance()->recentFiles.getFile (0),
|
||||
"*.cpp");
|
||||
|
||||
if (! fc.browseForFileToOpen())
|
||||
return 0;
|
||||
|
||||
file = fc.getResult();
|
||||
}
|
||||
|
||||
ScopedPointer<XmlElement> xml (JucerDocument::pullMetaDataFromCppFile (file.loadFileAsString()));
|
||||
|
||||
if (xml == nullptr || ! xml->hasTagName (JucerDocument::jucerCompXmlTag))
|
||||
{
|
||||
if (file != File::nonexistent && showErrorMessage)
|
||||
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
|
||||
TRANS("Failed to open file..."),
|
||||
TRANS("This wasn't a valid Jucer .cpp file..."));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const String docType (xml->getStringAttribute ("documentType"));
|
||||
|
||||
// (reverse order so ComponentDocument is default last-case)
|
||||
for (int i = numDocumentTypes; --i >= 0;)
|
||||
{
|
||||
if (docType.equalsIgnoreCase (documentTypeNames[i]) || i == 0)
|
||||
{
|
||||
ScopedPointer<JucerDocument> doc (createNewDocument (i));
|
||||
|
||||
if (doc->loadFrom (file, showErrorMessage))
|
||||
return doc.release();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static const char* const elementNames[] =
|
||||
{
|
||||
"Rectangle",
|
||||
"Rounded Rectangle",
|
||||
"Ellipse",
|
||||
"Path",
|
||||
"Image",
|
||||
"Text",
|
||||
0
|
||||
};
|
||||
|
||||
const char** const elementTypeNames = (const char**) elementNames;
|
||||
const int numElementTypes = (sizeof (elementNames) / sizeof (elementNames[0])) - 1;
|
||||
|
||||
PaintElement* createNewElement (const int index, PaintRoutine* owner)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
return new PaintElementRectangle (owner);
|
||||
|
||||
case 1:
|
||||
return new PaintElementRoundedRectangle (owner);
|
||||
|
||||
case 2:
|
||||
return new PaintElementEllipse (owner);
|
||||
|
||||
case 3:
|
||||
return new PaintElementPath (owner);
|
||||
|
||||
case 4:
|
||||
return new PaintElementImage (owner);
|
||||
|
||||
case 5:
|
||||
return new PaintElementText (owner);
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PaintElement* createNewImageElement (PaintRoutine* owner)
|
||||
{
|
||||
return new PaintElementImage (owner);
|
||||
}
|
||||
|
||||
PaintElement* createElementForXml (const XmlElement* const e, PaintRoutine* const owner)
|
||||
{
|
||||
jassert (e != 0);
|
||||
|
||||
ScopedPointer<PaintElement> pe;
|
||||
|
||||
if (e->hasTagName (PaintElementRectangle::getTagName()))
|
||||
{
|
||||
pe = new PaintElementRectangle (owner);
|
||||
}
|
||||
else if (e->hasTagName (PaintElementRoundedRectangle::getTagName()))
|
||||
{
|
||||
pe = new PaintElementRoundedRectangle (owner);
|
||||
}
|
||||
else if (e->hasTagName (PaintElementEllipse::getTagName()))
|
||||
{
|
||||
pe = new PaintElementEllipse (owner);
|
||||
}
|
||||
else if (e->hasTagName (PaintElementImage::getTagName()))
|
||||
{
|
||||
pe = new PaintElementImage (owner);
|
||||
}
|
||||
else if (e->hasTagName (PaintElementPath::getTagName()))
|
||||
{
|
||||
pe = new PaintElementPath (owner);
|
||||
}
|
||||
else if (e->hasTagName (PaintElementText::getTagName()))
|
||||
{
|
||||
pe = new PaintElementText (owner);
|
||||
}
|
||||
else if (e->hasTagName (PaintElementGroup::getTagName()))
|
||||
{
|
||||
pe = new PaintElementGroup (owner);
|
||||
}
|
||||
|
||||
if (pe != nullptr && pe->loadFromXml (*e))
|
||||
return pe.release();
|
||||
|
||||
jassertfalse
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static TextButtonHandler textButton;
|
||||
static ToggleButtonHandler toggleButton;
|
||||
static SliderHandler slider;
|
||||
static LabelHandler label;
|
||||
static TextEditorHandler textEditor;
|
||||
static ComboBoxHandler comboBox;
|
||||
static JucerComponentHandler jucerCompHandler;
|
||||
static GroupComponentHandler group;
|
||||
static HyperlinkButtonHandler hyperlink;
|
||||
static ViewportHandler viewport;
|
||||
static TabbedComponentHandler tabbedComp;
|
||||
static TreeViewHandler treeview;
|
||||
static GenericComponentHandler genericHandler;
|
||||
static ImageButtonHandler imageButtonHandler;
|
||||
|
||||
static ComponentTypeHandler* const compTypes[] =
|
||||
{
|
||||
&textButton,
|
||||
&toggleButton,
|
||||
&slider,
|
||||
&label,
|
||||
&textEditor,
|
||||
&comboBox,
|
||||
&group,
|
||||
&jucerCompHandler,
|
||||
&hyperlink,
|
||||
&viewport,
|
||||
&tabbedComp,
|
||||
&treeview,
|
||||
&genericHandler,
|
||||
&imageButtonHandler,
|
||||
0
|
||||
};
|
||||
|
||||
ComponentTypeHandler** const componentTypeHandlers = (ComponentTypeHandler**) compTypes;
|
||||
const int numComponentTypes = numElementsInArray (compTypes) - 1;
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_OBJECTTYPES_JUCEHEADER__
|
||||
#define __JUCER_OBJECTTYPES_JUCEHEADER__
|
||||
|
||||
#include "jucer_JucerDocument.h"
|
||||
#include "paintelements/jucer_PaintElement.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
A list of the various types of document, component and elements available,
|
||||
and functions to create them.
|
||||
|
||||
*/
|
||||
namespace ObjectTypes
|
||||
{
|
||||
//==============================================================================
|
||||
/**
|
||||
Documents.
|
||||
*/
|
||||
extern const char** const documentTypeNames;
|
||||
extern const int numDocumentTypes;
|
||||
|
||||
JucerDocument* createNewDocument (const int index);
|
||||
JucerDocument* loadDocumentFromFile (const File& file, const bool showErrorMessage);
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Component types.
|
||||
*/
|
||||
extern ComponentTypeHandler** const componentTypeHandlers;
|
||||
extern const int numComponentTypes;
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Elements.
|
||||
*/
|
||||
extern const char** const elementTypeNames;
|
||||
extern const int numElementTypes;
|
||||
|
||||
PaintElement* createNewElement (const int index, PaintRoutine* owner);
|
||||
PaintElement* createNewImageElement (PaintRoutine* owner);
|
||||
PaintElement* createElementForXml (const XmlElement* const e, PaintRoutine* const owner);
|
||||
}
|
||||
|
||||
#endif // __JUCER_OBJECTTYPES_JUCEHEADER__
|
||||
|
|
@ -1,617 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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 "../jucer_Headers.h"
|
||||
#include "jucer_PaintRoutine.h"
|
||||
#include "jucer_JucerDocument.h"
|
||||
#include "jucer_ObjectTypes.h"
|
||||
#include "paintelements/jucer_PaintElementUndoableAction.h"
|
||||
#include "paintelements/jucer_PaintElementPath.h"
|
||||
#include "paintelements/jucer_PaintElementImage.h"
|
||||
#include "paintelements/jucer_PaintElementGroup.h"
|
||||
#include "../ui/jucer_JucerDocumentHolder.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
PaintRoutine::PaintRoutine()
|
||||
: document (0),
|
||||
backgroundColour (Colours::white)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
PaintRoutine::~PaintRoutine()
|
||||
{
|
||||
elements.clear(); // do this explicitly before the scalar destructor because these
|
||||
// objects will be listeners on this object
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void PaintRoutine::changed()
|
||||
{
|
||||
if (document != 0)
|
||||
document->changed();
|
||||
}
|
||||
|
||||
bool PaintRoutine::perform (UndoableAction* action, const String& actionName)
|
||||
{
|
||||
jassert (document != 0);
|
||||
|
||||
if (document != 0)
|
||||
{
|
||||
return document->getUndoManager().perform (action, actionName);
|
||||
}
|
||||
else
|
||||
{
|
||||
action->perform();
|
||||
delete action;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::setBackgroundColour (const Colour& newColour) throw()
|
||||
{
|
||||
backgroundColour = newColour;
|
||||
changed();
|
||||
}
|
||||
|
||||
void PaintRoutine::clear()
|
||||
{
|
||||
if (elements.size() > 0)
|
||||
{
|
||||
elements.clear();
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class AddXmlElementAction : public UndoableAction
|
||||
{
|
||||
public:
|
||||
AddXmlElementAction (PaintRoutine& routine_, XmlElement* xml_)
|
||||
: routine (routine_),
|
||||
xml (xml_)
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
PaintElement* newElement = routine.addElementFromXml (*xml, -1, false);
|
||||
jassert (newElement != 0);
|
||||
|
||||
indexAdded = routine.indexOfElement (newElement);
|
||||
jassert (indexAdded >= 0);
|
||||
return indexAdded >= 0;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
routine.removeElement (routine.getElement (indexAdded), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
int getSizeInUnits() { return 10; }
|
||||
|
||||
int indexAdded;
|
||||
|
||||
private:
|
||||
PaintRoutine& routine;
|
||||
ScopedPointer<XmlElement> xml;
|
||||
|
||||
void showCorrectTab() const
|
||||
{
|
||||
JucerDocumentHolder* const docHolder = JucerDocumentHolder::getActiveDocumentHolder();
|
||||
|
||||
if (docHolder != 0)
|
||||
docHolder->showGraphics (&routine);
|
||||
}
|
||||
|
||||
AddXmlElementAction (const AddXmlElementAction&);
|
||||
AddXmlElementAction& operator= (const AddXmlElementAction&);
|
||||
};
|
||||
|
||||
PaintElement* PaintRoutine::addElementFromXml (const XmlElement& xml, const int index, const bool undoable)
|
||||
{
|
||||
selectedPoints.deselectAll();
|
||||
|
||||
if (undoable)
|
||||
{
|
||||
AddXmlElementAction* action = new AddXmlElementAction (*this, new XmlElement (xml));
|
||||
perform (action, "Add new element");
|
||||
|
||||
return elements [action->indexAdded];
|
||||
}
|
||||
else
|
||||
{
|
||||
PaintElement* const newElement = ObjectTypes::createElementForXml (&xml, this);
|
||||
|
||||
if (newElement != 0)
|
||||
{
|
||||
elements.insert (index, newElement);
|
||||
changed();
|
||||
|
||||
return newElement;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PaintElement* PaintRoutine::addNewElement (PaintElement* e, const int index, const bool undoable)
|
||||
{
|
||||
if (e != 0)
|
||||
{
|
||||
ScopedPointer<XmlElement> xml (e->createXml());
|
||||
delete e;
|
||||
|
||||
e = addElementFromXml (*xml, index, undoable);
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class DeleteElementAction : public PaintElementUndoableAction <PaintElement>
|
||||
{
|
||||
public:
|
||||
DeleteElementAction (PaintElement* const element)
|
||||
: PaintElementUndoableAction <PaintElement> (element),
|
||||
oldIndex (-1)
|
||||
{
|
||||
xml = element->createXml();
|
||||
oldIndex = routine.indexOfElement (element);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
routine.removeElement (getElement(), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
PaintElement* newElement = routine.addElementFromXml (*xml, oldIndex, false);
|
||||
showCorrectTab();
|
||||
return newElement != 0;
|
||||
}
|
||||
|
||||
int getSizeInUnits() { return 10; }
|
||||
|
||||
private:
|
||||
ScopedPointer<XmlElement> xml;
|
||||
int oldIndex;
|
||||
};
|
||||
|
||||
|
||||
void PaintRoutine::removeElement (PaintElement* element, const bool undoable)
|
||||
{
|
||||
if (elements.contains (element))
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new DeleteElementAction (element),
|
||||
"Delete " + element->getTypeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedElements.deselect (element);
|
||||
selectedPoints.deselectAll();
|
||||
|
||||
selectedPoints.changed (true);
|
||||
selectedElements.changed (true);
|
||||
|
||||
elements.removeObject (element);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class FrontOrBackElementAction : public PaintElementUndoableAction <PaintElement>
|
||||
{
|
||||
public:
|
||||
FrontOrBackElementAction (PaintElement* const element, int newIndex_)
|
||||
: PaintElementUndoableAction <PaintElement> (element),
|
||||
newIndex (newIndex_)
|
||||
{
|
||||
oldIndex = routine.indexOfElement (element);
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
|
||||
PaintElement* e = routine.getElement (oldIndex);
|
||||
routine.moveElementZOrder (oldIndex, newIndex);
|
||||
newIndex = routine.indexOfElement (e);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
routine.moveElementZOrder (newIndex, oldIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
int newIndex, oldIndex;
|
||||
};
|
||||
|
||||
void PaintRoutine::moveElementZOrder (int oldIndex, int newIndex)
|
||||
{
|
||||
jassert (elements [oldIndex] != 0);
|
||||
|
||||
if (oldIndex != newIndex && elements [oldIndex] != 0)
|
||||
{
|
||||
elements.move (oldIndex, newIndex);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::elementToFront (PaintElement* element, const bool undoable)
|
||||
{
|
||||
if (element != 0 && elements.contains (element))
|
||||
{
|
||||
if (undoable)
|
||||
perform (new FrontOrBackElementAction (element, -1), "Move elements to front");
|
||||
else
|
||||
moveElementZOrder (elements.indexOf (element), -1);
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::elementToBack (PaintElement* element, const bool undoable)
|
||||
{
|
||||
if (element != 0 && elements.contains (element))
|
||||
{
|
||||
if (undoable)
|
||||
perform (new FrontOrBackElementAction (element, 0), "Move elements to back");
|
||||
else
|
||||
moveElementZOrder (elements.indexOf (element), 0);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const char* const PaintRoutine::clipboardXmlTag = "PAINTELEMENTS";
|
||||
|
||||
void PaintRoutine::copySelectedToClipboard()
|
||||
{
|
||||
if (selectedElements.getNumSelected() == 0)
|
||||
return;
|
||||
|
||||
XmlElement clip (clipboardXmlTag);
|
||||
|
||||
for (int i = 0; i < elements.size(); ++i)
|
||||
{
|
||||
PaintElement* const pe = elements.getUnchecked(i);
|
||||
|
||||
if (selectedElements.isSelected (pe))
|
||||
{
|
||||
XmlElement* const e = pe->createXml();
|
||||
clip.addChildElement (e);
|
||||
}
|
||||
}
|
||||
|
||||
SystemClipboard::copyTextToClipboard (clip.createDocument (String::empty, false, false));
|
||||
}
|
||||
|
||||
void PaintRoutine::paste()
|
||||
{
|
||||
XmlDocument clip (SystemClipboard::getTextFromClipboard());
|
||||
ScopedPointer<XmlElement> doc (clip.getDocumentElement());
|
||||
|
||||
if (doc != 0 && doc->hasTagName (clipboardXmlTag))
|
||||
{
|
||||
selectedElements.deselectAll();
|
||||
selectedPoints.deselectAll();
|
||||
|
||||
forEachXmlChildElement (*doc, e)
|
||||
{
|
||||
PaintElement* newElement = addElementFromXml (*e, -1, true);
|
||||
|
||||
if (newElement != 0)
|
||||
selectedElements.addToSelection (newElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::deleteSelected()
|
||||
{
|
||||
const SelectedItemSet <PaintElement*> temp1 (selectedElements);
|
||||
const SelectedItemSet <PathPoint*> temp2 (selectedPoints);
|
||||
|
||||
if (temp2.getNumSelected() > 0)
|
||||
{
|
||||
selectedPoints.deselectAll();
|
||||
selectedPoints.changed (true); // synchronous message to get rid of any property components
|
||||
|
||||
// if any points are selected, just delete them, and not the element, which may
|
||||
// also be selected..
|
||||
for (int i = temp2.getNumSelected(); --i >= 0;)
|
||||
temp2.getSelectedItem (i)->deleteFromPath();
|
||||
|
||||
changed();
|
||||
}
|
||||
else if (temp1.getNumSelected() > 0)
|
||||
{
|
||||
selectedElements.deselectAll();
|
||||
selectedElements.changed (true);
|
||||
|
||||
for (int i = temp1.getNumSelected(); --i >= 0;)
|
||||
removeElement (temp1.getSelectedItem (i), true);
|
||||
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::selectAll()
|
||||
{
|
||||
if (selectedPoints.getNumSelected() > 0)
|
||||
{
|
||||
PaintElementPath* path = selectedPoints.getSelectedItem (0)->owner;
|
||||
|
||||
if (path != 0)
|
||||
{
|
||||
for (int i = 0; i < path->getNumPoints(); ++i)
|
||||
selectedPoints.addToSelection (path->getPoint (i));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < elements.size(); ++i)
|
||||
selectedElements.addToSelection (elements.getUnchecked (i));
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::selectedToFront()
|
||||
{
|
||||
const SelectedItemSet <PaintElement*> temp (selectedElements);
|
||||
|
||||
for (int i = temp.getNumSelected(); --i >= 0;)
|
||||
elementToFront (temp.getSelectedItem(i), true);
|
||||
}
|
||||
|
||||
void PaintRoutine::selectedToBack()
|
||||
{
|
||||
const SelectedItemSet <PaintElement*> temp (selectedElements);
|
||||
|
||||
for (int i = 0; i < temp.getNumSelected(); ++i)
|
||||
elementToBack (temp.getSelectedItem(i), true);
|
||||
}
|
||||
|
||||
void PaintRoutine::groupSelected()
|
||||
{
|
||||
PaintElementGroup::groupSelected (this);
|
||||
}
|
||||
|
||||
void PaintRoutine::ungroupSelected()
|
||||
{
|
||||
const SelectedItemSet <PaintElement*> temp (selectedElements);
|
||||
|
||||
for (int i = 0; i < temp.getNumSelected(); ++i)
|
||||
{
|
||||
PaintElementGroup* const pg = dynamic_cast <PaintElementGroup*> (temp.getSelectedItem (i));
|
||||
|
||||
if (pg != 0)
|
||||
pg->ungroup (true);
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::bringLostItemsBackOnScreen (const Rectangle<int>& parentArea)
|
||||
{
|
||||
for (int i = 0; i < elements.size(); ++i)
|
||||
{
|
||||
PaintElement* const c = elements[i];
|
||||
|
||||
Rectangle<int> r (c->getCurrentBounds (parentArea));
|
||||
|
||||
if (! r.intersects (parentArea))
|
||||
{
|
||||
r.setPosition (parentArea.getCentreX(), parentArea.getCentreY());
|
||||
c->setCurrentBounds (r, parentArea, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::startDragging (const Rectangle<int>& parentArea)
|
||||
{
|
||||
for (int i = 0; i < elements.size(); ++i)
|
||||
{
|
||||
PaintElement* const c = elements[i];
|
||||
|
||||
Rectangle<int> r (c->getCurrentBounds (parentArea));
|
||||
|
||||
c->getProperties().set ("xDragStart", r.getX());
|
||||
c->getProperties().set ("yDragStart", r.getY());
|
||||
}
|
||||
|
||||
getDocument()->getUndoManager().beginNewTransaction();
|
||||
}
|
||||
|
||||
void PaintRoutine::dragSelectedComps (int dx, int dy, const Rectangle<int>& parentArea)
|
||||
{
|
||||
getDocument()->getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
if (document != 0 && selectedElements.getNumSelected() > 1)
|
||||
{
|
||||
dx = document->snapPosition (dx);
|
||||
dy = document->snapPosition (dy);
|
||||
}
|
||||
|
||||
for (int i = 0; i < selectedElements.getNumSelected(); ++i)
|
||||
{
|
||||
PaintElement* const c = selectedElements.getSelectedItem (i);
|
||||
|
||||
const int startX = c->getProperties() ["xDragStart"];
|
||||
const int startY = c->getProperties() ["yDragStart"];
|
||||
|
||||
Rectangle<int> r (c->getCurrentBounds (parentArea));
|
||||
|
||||
if (document != 0 && selectedElements.getNumSelected() == 1)
|
||||
{
|
||||
r.setPosition (document->snapPosition (startX + dx),
|
||||
document->snapPosition (startY + dy));
|
||||
}
|
||||
else
|
||||
{
|
||||
r.setPosition (startX + dx,
|
||||
startY + dy);
|
||||
}
|
||||
|
||||
c->setCurrentBounds (r, parentArea, true);
|
||||
}
|
||||
|
||||
changed();
|
||||
}
|
||||
|
||||
void PaintRoutine::endDragging()
|
||||
{
|
||||
getDocument()->getUndoManager().beginNewTransaction();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void PaintRoutine::fillWithBackground (Graphics& g, const bool drawOpaqueBackground)
|
||||
{
|
||||
if ((! backgroundColour.isOpaque()) && drawOpaqueBackground)
|
||||
{
|
||||
g.fillCheckerBoard (Rectangle<int> (0, 0, g.getClipBounds().getRight(), g.getClipBounds().getBottom()),
|
||||
50, 50,
|
||||
Colour (0xffdddddd).overlaidWith (backgroundColour),
|
||||
Colour (0xffffffff).overlaidWith (backgroundColour));
|
||||
}
|
||||
else
|
||||
{
|
||||
g.fillAll (backgroundColour);
|
||||
}
|
||||
}
|
||||
|
||||
void PaintRoutine::drawElements (Graphics& g, const Rectangle<int>& relativeTo)
|
||||
{
|
||||
Component temp;
|
||||
temp.setBounds (relativeTo);
|
||||
|
||||
for (int i = 0; i < elements.size(); ++i)
|
||||
elements.getUnchecked (i)->draw (g, getDocument()->getComponentLayout(), relativeTo);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void PaintRoutine::dropImageAt (const File& f, int x, int y)
|
||||
{
|
||||
ScopedPointer<Drawable> d (Drawable::createFromImageFile (f));
|
||||
|
||||
if (d != nullptr)
|
||||
{
|
||||
Rectangle<float> bounds (d->getDrawableBounds());
|
||||
d = nullptr;
|
||||
|
||||
PaintElement* newElement
|
||||
= addNewElement (ObjectTypes::createNewImageElement (this), -1, true);
|
||||
|
||||
PaintElementImage* pei = dynamic_cast <PaintElementImage*> (newElement);
|
||||
|
||||
if (pei != 0)
|
||||
{
|
||||
String resourceName (getDocument()->getResources().findUniqueName (f.getFileName()));
|
||||
|
||||
const BinaryResources::BinaryResource* existingResource = getDocument()->getResources().getResourceForFile (f);
|
||||
|
||||
if (existingResource != 0)
|
||||
{
|
||||
resourceName = existingResource->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
MemoryBlock data;
|
||||
f.loadFileAsData (data);
|
||||
|
||||
getDocument()->getResources().add (resourceName, f.getFullPathName(), data);
|
||||
}
|
||||
|
||||
pei->setResource (resourceName, true);
|
||||
|
||||
const int imageW = (int) (bounds.getRight() + 0.999f);
|
||||
const int imageH = (int) (bounds.getBottom() + 0.999f);
|
||||
|
||||
RelativePositionedRectangle pr;
|
||||
pr.rect.setX (x - imageW / 2);
|
||||
pr.rect.setY (y - imageH / 2);
|
||||
pr.rect.setWidth (imageW);
|
||||
pr.rect.setHeight (imageH);
|
||||
|
||||
pei->setPosition (pr, true);
|
||||
|
||||
getSelectedElements().selectOnly (pei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const char* PaintRoutine::xmlTagName = "BACKGROUND";
|
||||
|
||||
XmlElement* PaintRoutine::createXml() const
|
||||
{
|
||||
XmlElement* const xml = new XmlElement (xmlTagName);
|
||||
|
||||
xml->setAttribute ("backgroundColour", colourToHex (backgroundColour));
|
||||
|
||||
for (int i = 0; i < elements.size(); ++i)
|
||||
xml->addChildElement (elements.getUnchecked (i)->createXml());
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
bool PaintRoutine::loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (xmlTagName))
|
||||
{
|
||||
backgroundColour = Colour (xml.getStringAttribute ("backgroundColour", colourToHex (Colours::white)).getHexValue32());
|
||||
|
||||
clear();
|
||||
|
||||
forEachXmlChildElement (xml, e)
|
||||
{
|
||||
PaintElement* const newElement = ObjectTypes::createElementForXml (e, this);
|
||||
|
||||
if (newElement != 0)
|
||||
elements.add (newElement);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PaintRoutine::fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode) const
|
||||
{
|
||||
if (! backgroundColour.isTransparent())
|
||||
paintMethodCode << "g.fillAll (" << colourToCode (backgroundColour) << ");\n\n";
|
||||
|
||||
for (int i = 0; i < elements.size(); ++i)
|
||||
elements[i]->fillInGeneratedCode (code, paintMethodCode);
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-11 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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTROUTINE_JUCEHEADER__
|
||||
#define __JUCER_PAINTROUTINE_JUCEHEADER__
|
||||
|
||||
#include "paintelements/jucer_PaintElement.h"
|
||||
class JucerDocument;
|
||||
class PathPoint;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Contains a set of PaintElements that constitute some kind of paint() method.
|
||||
|
||||
*/
|
||||
class PaintRoutine
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintRoutine();
|
||||
~PaintRoutine();
|
||||
|
||||
//==============================================================================
|
||||
void changed();
|
||||
bool perform (UndoableAction* action, const String& actionName);
|
||||
|
||||
//==============================================================================
|
||||
int getNumElements() const throw() { return elements.size(); }
|
||||
PaintElement* getElement (const int index) const throw() { return elements [index]; }
|
||||
int indexOfElement (PaintElement* e) const throw() { return elements.indexOf (e); }
|
||||
bool containsElement (PaintElement* e) const throw() { return elements.contains (e); }
|
||||
|
||||
//==============================================================================
|
||||
void clear();
|
||||
PaintElement* addElementFromXml (const XmlElement& xml, const int index, const bool undoable);
|
||||
PaintElement* addNewElement (PaintElement* elementToCopy, const int index, const bool undoable);
|
||||
void removeElement (PaintElement* element, const bool undoable);
|
||||
|
||||
void elementToFront (PaintElement* element, const bool undoable);
|
||||
void elementToBack (PaintElement* element, const bool undoable);
|
||||
|
||||
const Colour getBackgroundColour() const throw() { return backgroundColour; }
|
||||
void setBackgroundColour (const Colour& newColour) throw();
|
||||
|
||||
void fillWithBackground (Graphics& g, const bool drawOpaqueBackground);
|
||||
void drawElements (Graphics& g, const Rectangle<int>& relativeTo);
|
||||
|
||||
void dropImageAt (const File& f, int x, int y);
|
||||
|
||||
//==============================================================================
|
||||
SelectedItemSet <PaintElement*>& getSelectedElements() throw() { return selectedElements; }
|
||||
SelectedItemSet <PathPoint*>& getSelectedPoints() throw() { return selectedPoints; }
|
||||
|
||||
static const char* const clipboardXmlTag;
|
||||
void copySelectedToClipboard();
|
||||
void paste();
|
||||
void deleteSelected();
|
||||
void selectAll();
|
||||
|
||||
void selectedToFront();
|
||||
void selectedToBack();
|
||||
|
||||
void groupSelected();
|
||||
void ungroupSelected();
|
||||
|
||||
void startDragging (const Rectangle<int>& parentArea);
|
||||
void dragSelectedComps (int dxFromDragStart, int dyFromDragStart, const Rectangle<int>& parentArea);
|
||||
void endDragging();
|
||||
|
||||
void bringLostItemsBackOnScreen (const Rectangle<int>& parentArea);
|
||||
|
||||
//==============================================================================
|
||||
void setDocument (JucerDocument* const document_) { document = document_; }
|
||||
JucerDocument* getDocument() const throw() { return document; }
|
||||
|
||||
//==============================================================================
|
||||
static const char* xmlTagName;
|
||||
XmlElement* createXml() const;
|
||||
bool loadFromXml (const XmlElement& xml);
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode) const;
|
||||
|
||||
//==============================================================================
|
||||
private:
|
||||
OwnedArray <PaintElement> elements;
|
||||
SelectedItemSet <PaintElement*> selectedElements;
|
||||
SelectedItemSet <PathPoint*> selectedPoints;
|
||||
JucerDocument* document;
|
||||
|
||||
Colour backgroundColour;
|
||||
|
||||
friend class DeleteElementAction;
|
||||
friend class FrontOrBackElementAction;
|
||||
void moveElementZOrder (int oldIndex, int newIndex);
|
||||
};
|
||||
|
||||
#endif // __JUCER_PAINTROUTINE_JUCEHEADER__
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COLOUREDELEMENT_JUCEHEADER__
|
||||
#define __JUCER_COLOUREDELEMENT_JUCEHEADER__
|
||||
|
||||
#include "../jucer_PaintRoutine.h"
|
||||
#include "../jucer_JucerDocument.h"
|
||||
#include "jucer_StrokeType.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Base class for paint elements that have a fill colour and stroke.
|
||||
|
||||
*/
|
||||
class ColouredElement : public PaintElement
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ColouredElement (PaintRoutine* owner,
|
||||
const String& name,
|
||||
const bool showOutline_,
|
||||
const bool showJointAndEnd_);
|
||||
|
||||
~ColouredElement();
|
||||
|
||||
//==============================================================================
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties);
|
||||
void getColourSpecificProperties (Array <PropertyComponent*>& properties);
|
||||
|
||||
//==============================================================================
|
||||
const JucerFillType& getFillType() throw();
|
||||
void setFillType (const JucerFillType& newType, const bool undoable);
|
||||
|
||||
bool isStrokeEnabled() const throw();
|
||||
void enableStroke (bool enable, const bool undoable);
|
||||
|
||||
const StrokeType& getStrokeType() throw();
|
||||
void setStrokeType (const PathStrokeType& newType, const bool undoable);
|
||||
void setStrokeFill (const JucerFillType& newType, const bool undoable);
|
||||
|
||||
//==============================================================================
|
||||
const Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const;
|
||||
void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, const bool undoable);
|
||||
|
||||
void createSiblingComponents();
|
||||
|
||||
//==============================================================================
|
||||
void addColourAttributes (XmlElement* const e) const;
|
||||
bool loadColourAttributes (const XmlElement& xml);
|
||||
|
||||
protected:
|
||||
JucerFillType fillType;
|
||||
|
||||
bool isStrokePresent;
|
||||
const bool showOutline, showJointAndEnd;
|
||||
StrokeType strokeType;
|
||||
|
||||
void convertToNewPathElement (const Path& path);
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COLOUREDELEMENT_JUCEHEADER__
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_ELEMENTSIBLINGCOMPONENT_JUCEHEADER__
|
||||
#define __JUCER_ELEMENTSIBLINGCOMPONENT_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ElementSiblingComponent : public Component,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ElementSiblingComponent (PaintElement* const owner_)
|
||||
: owner (owner_)
|
||||
{
|
||||
setAlwaysOnTop (true);
|
||||
|
||||
owner->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~ElementSiblingComponent()
|
||||
{
|
||||
owner->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
virtual void updatePosition() = 0;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
updatePosition();
|
||||
}
|
||||
|
||||
protected:
|
||||
PaintElement* const owner;
|
||||
};
|
||||
|
||||
#endif // __JUCER_ELEMENTSIBLINGCOMPONENT_JUCEHEADER__
|
||||
|
|
@ -1,342 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../../jucer_Headers.h"
|
||||
#include "jucer_FillType.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
JucerFillType::JucerFillType()
|
||||
: image (0)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
JucerFillType::JucerFillType (const JucerFillType& other)
|
||||
{
|
||||
image = Image();
|
||||
mode = other.mode;
|
||||
colour = other.colour;
|
||||
gradCol1 = other.gradCol1;
|
||||
gradCol2 = other.gradCol2;
|
||||
gradPos1 = other.gradPos1;
|
||||
gradPos2 = other.gradPos2;
|
||||
imageResourceName = other.imageResourceName;
|
||||
imageOpacity = other.imageOpacity;
|
||||
imageAnchor = other.imageAnchor;
|
||||
}
|
||||
|
||||
JucerFillType& JucerFillType::operator= (const JucerFillType& other)
|
||||
{
|
||||
image = Image();
|
||||
mode = other.mode;
|
||||
colour = other.colour;
|
||||
gradCol1 = other.gradCol1;
|
||||
gradCol2 = other.gradCol2;
|
||||
gradPos1 = other.gradPos1;
|
||||
gradPos2 = other.gradPos2;
|
||||
imageResourceName = other.imageResourceName;
|
||||
imageOpacity = other.imageOpacity;
|
||||
imageAnchor = other.imageAnchor;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
JucerFillType::~JucerFillType()
|
||||
{
|
||||
}
|
||||
|
||||
bool JucerFillType::operator== (const JucerFillType& other) const throw()
|
||||
{
|
||||
return mode == other.mode
|
||||
&& colour == other.colour
|
||||
&& gradCol1 == other.gradCol1
|
||||
&& gradCol2 == other.gradCol2
|
||||
&& gradPos1 == other.gradPos1
|
||||
&& gradPos2 == other.gradPos2
|
||||
&& imageResourceName == other.imageResourceName
|
||||
&& imageOpacity == other.imageOpacity
|
||||
&& imageAnchor == other.imageAnchor;
|
||||
}
|
||||
|
||||
bool JucerFillType::operator!= (const JucerFillType& other) const throw()
|
||||
{
|
||||
return ! operator== (other);
|
||||
}
|
||||
|
||||
void JucerFillType::reset()
|
||||
{
|
||||
image = Image();
|
||||
mode = solidColour;
|
||||
colour = Colours::brown.withHue (Random::getSystemRandom().nextFloat());
|
||||
gradCol1 = Colours::red;
|
||||
gradCol2 = Colours::green;
|
||||
gradPos1 = RelativePositionedRectangle();
|
||||
gradPos1.rect = PositionedRectangle ("50 50");
|
||||
gradPos2 = RelativePositionedRectangle();
|
||||
gradPos2.rect = PositionedRectangle ("100 100");
|
||||
|
||||
imageResourceName = String::empty;
|
||||
imageOpacity = 1.0;
|
||||
imageAnchor = RelativePositionedRectangle();
|
||||
imageAnchor.rect = PositionedRectangle ("0 0");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void JucerFillType::setFillType (Graphics& g, JucerDocument* const document, const Rectangle<int>& parentArea)
|
||||
{
|
||||
if (mode == solidColour)
|
||||
{
|
||||
image = Image();
|
||||
g.setColour (colour);
|
||||
}
|
||||
else if (mode == imageBrush)
|
||||
{
|
||||
loadImage (document);
|
||||
|
||||
Rectangle<int> r (imageAnchor.getRectangle (parentArea, document->getComponentLayout()));
|
||||
|
||||
g.setTiledImageFill (image, r.getX(), r.getY(), (float) imageOpacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
image = Image();
|
||||
|
||||
Rectangle<int> r1 (gradPos1.getRectangle (parentArea, document->getComponentLayout()));
|
||||
Rectangle<int> r2 (gradPos2.getRectangle (parentArea, document->getComponentLayout()));
|
||||
|
||||
g.setGradientFill (ColourGradient (gradCol1, (float) r1.getX(), (float) r1.getY(),
|
||||
gradCol2, (float) r2.getX(), (float) r2.getY(),
|
||||
mode == radialGradient));
|
||||
}
|
||||
}
|
||||
|
||||
void JucerFillType::fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode) const
|
||||
{
|
||||
String s;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case solidColour:
|
||||
s << "g.setColour (" << colourToCode (colour) << ");\n";
|
||||
break;
|
||||
|
||||
case linearGradient:
|
||||
case radialGradient:
|
||||
{
|
||||
String x1, y1, w, h, x2, y2;
|
||||
positionToCode (gradPos1, code.document->getComponentLayout(), x1, y1, w, h);
|
||||
positionToCode (gradPos2, code.document->getComponentLayout(), x2, y2, w, h);
|
||||
|
||||
s << "g.setGradientFill (ColourGradient (";
|
||||
|
||||
const String indent (String::repeatedString (" ", s.length()));
|
||||
|
||||
s << colourToCode (gradCol1) << ",\n"
|
||||
<< indent << castToFloat (x1) << ", " << castToFloat (y1) << ",\n"
|
||||
<< indent << colourToCode (gradCol2) << ",\n"
|
||||
<< indent << castToFloat (x2) << ", " << castToFloat (y2) << ",\n"
|
||||
<< indent << boolToString (mode == radialGradient) << "));\n";
|
||||
break;
|
||||
}
|
||||
|
||||
case imageBrush:
|
||||
{
|
||||
const String imageVariable ("cachedImage_" + imageResourceName + "_" + String (code.getUniqueSuffix()));
|
||||
|
||||
code.addImageResourceLoader (imageVariable, imageResourceName);
|
||||
|
||||
String x, y, w, h;
|
||||
positionToCode (imageAnchor, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
s << "g.setTiledImageFill (";
|
||||
|
||||
const String indent (String::repeatedString (" ", s.length()));
|
||||
|
||||
s << imageVariable << ",\n"
|
||||
<< indent << x << ", " << y << ",\n"
|
||||
<< indent << valueToFloat (imageOpacity) << ");\n";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
paintMethodCode += s;
|
||||
}
|
||||
|
||||
const String JucerFillType::toString() const
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case solidColour:
|
||||
return "solid: " + colourToHex (colour);
|
||||
|
||||
case linearGradient:
|
||||
case radialGradient:
|
||||
return (mode == linearGradient ? "linear: "
|
||||
: " radial: ")
|
||||
+ positionToString (gradPos1)
|
||||
+ ", "
|
||||
+ positionToString (gradPos2)
|
||||
+ ", 0=" + colourToHex (gradCol1)
|
||||
+ ", 1=" + colourToHex (gradCol2);
|
||||
|
||||
case imageBrush:
|
||||
return "image: " + imageResourceName
|
||||
+ ", "
|
||||
+ String (imageOpacity)
|
||||
+ ", "
|
||||
+ positionToString (imageAnchor);
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return String::empty;
|
||||
}
|
||||
|
||||
void JucerFillType::restoreFromString (const String& s)
|
||||
{
|
||||
reset();
|
||||
|
||||
if (s.isNotEmpty())
|
||||
{
|
||||
StringArray toks;
|
||||
toks.addTokens (s, ",:", String::empty);
|
||||
toks.trim();
|
||||
|
||||
if (toks[0] == "solid")
|
||||
{
|
||||
mode = solidColour;
|
||||
colour = Colour (toks[1].getHexValue32());
|
||||
}
|
||||
else if (toks[0] == "linear"
|
||||
|| toks[0] == "radial")
|
||||
{
|
||||
mode = (toks[0] == "linear") ? linearGradient : radialGradient;
|
||||
|
||||
gradPos1 = RelativePositionedRectangle();
|
||||
gradPos1.rect = PositionedRectangle (toks[1]);
|
||||
gradPos2 = RelativePositionedRectangle();
|
||||
gradPos2.rect = PositionedRectangle (toks[2]);
|
||||
|
||||
gradCol1 = Colour (toks[3].fromFirstOccurrenceOf ("=", false, false).getHexValue32());
|
||||
gradCol2 = Colour (toks[4].fromFirstOccurrenceOf ("=", false, false).getHexValue32());
|
||||
}
|
||||
else if (toks[0] == "image")
|
||||
{
|
||||
mode = imageBrush;
|
||||
imageResourceName = toks[1];
|
||||
imageOpacity = toks[2].getDoubleValue();
|
||||
imageAnchor= RelativePositionedRectangle();
|
||||
imageAnchor.rect = PositionedRectangle (toks[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool JucerFillType::isOpaque() const
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case solidColour:
|
||||
return colour.isOpaque();
|
||||
|
||||
case linearGradient:
|
||||
case radialGradient:
|
||||
return gradCol1.isOpaque() && gradCol1.isOpaque();
|
||||
|
||||
case imageBrush:
|
||||
return image.isValid()
|
||||
&& imageOpacity >= 1.0f
|
||||
&& ! image.hasAlphaChannel();
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool JucerFillType::isInvisible() const
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case solidColour:
|
||||
return colour.isTransparent();
|
||||
|
||||
case linearGradient:
|
||||
case radialGradient:
|
||||
return gradCol1.isTransparent() && gradCol2.isTransparent();
|
||||
|
||||
case imageBrush:
|
||||
return imageOpacity == 0;
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void JucerFillType::loadImage (JucerDocument* const document)
|
||||
{
|
||||
if (image.isNull())
|
||||
{
|
||||
if (document != 0)
|
||||
image = document->getResources().getImageFromCache (imageResourceName);
|
||||
|
||||
if (image.isNull())
|
||||
{
|
||||
const int hashCode = 0x3437856f;
|
||||
image = ImageCache::getFromHashCode (hashCode);
|
||||
|
||||
if (image.isNull())
|
||||
{
|
||||
image = Image (Image::RGB, 100, 100, true);
|
||||
|
||||
Graphics g (image);
|
||||
g.fillCheckerBoard (image.getBounds(),
|
||||
image.getWidth() / 2, image.getHeight() / 2,
|
||||
Colours::white, Colours::lightgrey);
|
||||
|
||||
g.setFont (12.0f);
|
||||
g.setColour (Colours::grey);
|
||||
g.drawText ("(image missing)", 0, 0, image.getWidth(), image.getHeight() / 2, Justification::centred, true);
|
||||
|
||||
ImageCache::addImageToCache (image, hashCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_FILLTYPE_JUCEHEADER__
|
||||
#define __JUCER_FILLTYPE_JUCEHEADER__
|
||||
|
||||
#include "../jucer_JucerDocument.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Defines a brush to be used to fill a shape.
|
||||
*/
|
||||
class JucerFillType
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
JucerFillType();
|
||||
JucerFillType (const JucerFillType& other);
|
||||
JucerFillType& operator= (const JucerFillType& other);
|
||||
~JucerFillType();
|
||||
|
||||
bool operator== (const JucerFillType& other) const throw();
|
||||
bool operator!= (const JucerFillType& other) const throw();
|
||||
|
||||
//==============================================================================
|
||||
void setFillType (Graphics& g, JucerDocument* const document, const Rectangle<int>& parentArea);
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode) const;
|
||||
|
||||
const String toString() const;
|
||||
void restoreFromString (const String& s);
|
||||
|
||||
bool isOpaque() const;
|
||||
bool isInvisible() const;
|
||||
|
||||
//==============================================================================
|
||||
enum FillMode
|
||||
{
|
||||
solidColour,
|
||||
linearGradient,
|
||||
radialGradient,
|
||||
imageBrush
|
||||
};
|
||||
|
||||
FillMode mode;
|
||||
|
||||
Colour colour, gradCol1, gradCol2;
|
||||
|
||||
// just the x, y, of these are used
|
||||
RelativePositionedRectangle gradPos1, gradPos2;
|
||||
|
||||
String imageResourceName;
|
||||
double imageOpacity;
|
||||
RelativePositionedRectangle imageAnchor;
|
||||
|
||||
//==============================================================================
|
||||
private:
|
||||
Image image;
|
||||
|
||||
void reset();
|
||||
void loadImage (JucerDocument* const document);
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_FILLTYPE_JUCEHEADER__
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_GRADIENTPOINTCOMPONENT_JUCEHEADER__
|
||||
#define __JUCER_GRADIENTPOINTCOMPONENT_JUCEHEADER__
|
||||
|
||||
#include "jucer_PointComponent.h"
|
||||
#include "jucer_ColouredElement.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class GradientPointComponent : public PointComponent
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
GradientPointComponent (ColouredElement* const owner_,
|
||||
const bool isStroke_,
|
||||
const bool isStart_)
|
||||
: PointComponent (owner_),
|
||||
isStroke (isStroke_),
|
||||
isStart (isStart_)
|
||||
{
|
||||
}
|
||||
|
||||
~GradientPointComponent()
|
||||
{
|
||||
}
|
||||
|
||||
const RelativePositionedRectangle getPosition()
|
||||
{
|
||||
ColouredElement* e = dynamic_cast <ColouredElement*> (owner);
|
||||
|
||||
if (isStroke)
|
||||
{
|
||||
return isStart ? e->getStrokeType().fill.gradPos1
|
||||
: e->getStrokeType().fill.gradPos2;
|
||||
}
|
||||
else
|
||||
{
|
||||
return isStart ? e->getFillType().gradPos1
|
||||
: e->getFillType().gradPos2;
|
||||
}
|
||||
}
|
||||
|
||||
void setPosition (const RelativePositionedRectangle& newPos)
|
||||
{
|
||||
ColouredElement* e = dynamic_cast <ColouredElement*> (owner);
|
||||
|
||||
if (isStroke)
|
||||
{
|
||||
JucerFillType f (e->getStrokeType().fill);
|
||||
|
||||
if (isStart)
|
||||
f.gradPos1 = newPos;
|
||||
else
|
||||
f.gradPos2 = newPos;
|
||||
|
||||
e->setStrokeFill (f, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
JucerFillType f (e->getFillType());
|
||||
|
||||
if (isStart)
|
||||
f.gradPos1 = newPos;
|
||||
else
|
||||
f.gradPos2 = newPos;
|
||||
|
||||
e->setFillType (f, true);
|
||||
}
|
||||
}
|
||||
|
||||
void updatePosition()
|
||||
{
|
||||
PointComponent::updatePosition();
|
||||
|
||||
ColouredElement* e = dynamic_cast <ColouredElement*> (owner);
|
||||
|
||||
JucerFillType f (isStroke ? e->getStrokeType().fill
|
||||
: e->getFillType());
|
||||
|
||||
setVisible (f.mode == JucerFillType::linearGradient
|
||||
|| f.mode == JucerFillType::radialGradient);
|
||||
}
|
||||
|
||||
private:
|
||||
bool isStroke, isStart;
|
||||
};
|
||||
|
||||
#endif // __JUCER_GRADIENTPOINTCOMPONENT_JUCEHEADER__
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_IMAGERESOURCEPROPERTY_JUCEHEADER__
|
||||
#define __JUCER_IMAGERESOURCEPROPERTY_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
A property that lets you pick a resource to use as an image, or create a
|
||||
new one with a file selector.
|
||||
*/
|
||||
template <class ElementType>
|
||||
class ImageResourceProperty : public ChoicePropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
ImageResourceProperty (JucerDocument& document_,
|
||||
ElementType* const element_,
|
||||
const String& name,
|
||||
const bool allowChoiceOfNoResource_)
|
||||
: ChoicePropertyComponent (name),
|
||||
element (element_),
|
||||
document (document_),
|
||||
allowChoiceOfNoResource (allowChoiceOfNoResource_)
|
||||
{
|
||||
choices.add ("-- create a new image resource -- ");
|
||||
choices.add (String::empty);
|
||||
if (allowChoiceOfNoResource_)
|
||||
choices.add ("<< none >>");
|
||||
choices.addArray (document_.getResources().getResourceNames());
|
||||
|
||||
document_.addChangeListener (this);
|
||||
}
|
||||
|
||||
ImageResourceProperty (ElementType* const element_,
|
||||
const String& name,
|
||||
const bool allowChoiceOfNoResource_ = false)
|
||||
: ChoicePropertyComponent (name),
|
||||
element (element_),
|
||||
document (*element_->getDocument()),
|
||||
allowChoiceOfNoResource (allowChoiceOfNoResource_)
|
||||
{
|
||||
choices.add ("-- create a new image resource -- ");
|
||||
choices.add (String::empty);
|
||||
if (allowChoiceOfNoResource_)
|
||||
choices.add ("<< none >>");
|
||||
|
||||
choices.addArray (document.getResources().getResourceNames());
|
||||
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ImageResourceProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
virtual void setResource (const String& newName) = 0;
|
||||
|
||||
virtual const String getResource() const = 0;
|
||||
|
||||
//==============================================================================
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
if (newIndex == 0)
|
||||
{
|
||||
String resource (document.getResources()
|
||||
.browseForResource ("Select an image file to add as a resource",
|
||||
"*.jpg;*.jpeg;*.png;*.gif;*.svg",
|
||||
File::nonexistent,
|
||||
String::empty));
|
||||
|
||||
if (resource.isNotEmpty())
|
||||
setResource (resource);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (choices[newIndex] == "<< none >>" && allowChoiceOfNoResource)
|
||||
setResource (String::empty);
|
||||
else
|
||||
setResource (choices [newIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
if (getResource().isEmpty())
|
||||
return -1;
|
||||
|
||||
return choices.indexOf (getResource());
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
protected:
|
||||
ElementType* const element;
|
||||
JucerDocument& document;
|
||||
const bool allowChoiceOfNoResource;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_IMAGERESOURCEPROPERTY_JUCEHEADER__
|
||||
|
|
@ -1,484 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../../jucer_Headers.h"
|
||||
#include "../jucer_PaintRoutine.h"
|
||||
#include "../../ui/jucer_PaintRoutineEditor.h"
|
||||
#include "../../properties/jucer_PositionPropertyBase.h"
|
||||
#include "jucer_ElementSiblingComponent.h"
|
||||
#include "jucer_PaintElementUndoableAction.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
PaintElement::PaintElement (PaintRoutine* owner_,
|
||||
const String& typeName_)
|
||||
: borderThickness (4),
|
||||
owner (owner_),
|
||||
typeName (typeName_),
|
||||
selected (false),
|
||||
dragging (false),
|
||||
originalAspectRatio (1.0)
|
||||
{
|
||||
setRepaintsOnMouseActivity (true);
|
||||
|
||||
position.rect.setWidth (100);
|
||||
position.rect.setHeight (100);
|
||||
|
||||
setMinimumOnscreenAmounts (0, 0, 0, 0);
|
||||
setSizeLimits (borderThickness * 2 + 1, borderThickness * 2 + 1, 8192, 8192);
|
||||
|
||||
addChildComponent (border = new ResizableBorderComponent (this, this));
|
||||
|
||||
border->setBorderThickness (BorderSize<int> (borderThickness));
|
||||
|
||||
if (owner != 0)
|
||||
owner->getSelectedElements().addChangeListener (this);
|
||||
|
||||
selfChangeListenerList.addChangeListener (this);
|
||||
siblingComponentsChanged();
|
||||
}
|
||||
|
||||
PaintElement::~PaintElement()
|
||||
{
|
||||
siblingComponents.clear();
|
||||
|
||||
if (owner != 0)
|
||||
owner->getSelectedElements().removeChangeListener (this);
|
||||
|
||||
delete border;
|
||||
}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
void PaintElement::setInitialBounds (int parentWidth, int parentHeight)
|
||||
{
|
||||
RelativePositionedRectangle pr (getPosition());
|
||||
pr.rect.setX (parentWidth / 4 + Random::getSystemRandom().nextInt (parentWidth / 4) - parentWidth / 8);
|
||||
pr.rect.setY (parentHeight / 3 + Random::getSystemRandom().nextInt (parentHeight / 4) - parentHeight / 8);
|
||||
setPosition (pr, false);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const RelativePositionedRectangle& PaintElement::getPosition() const
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
class PaintElementMoveAction : public PaintElementUndoableAction <PaintElement>
|
||||
{
|
||||
public:
|
||||
PaintElementMoveAction (PaintElement* const element, const RelativePositionedRectangle& newState_)
|
||||
: PaintElementUndoableAction <PaintElement> (element),
|
||||
newState (newState_),
|
||||
oldState (element->getPosition())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setPosition (newState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setPosition (oldState, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
RelativePositionedRectangle newState, oldState;
|
||||
};
|
||||
|
||||
void PaintElement::setPosition (const RelativePositionedRectangle& newPosition, const bool undoable)
|
||||
{
|
||||
if (position != newPosition)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new PaintElementMoveAction (this, newPosition),
|
||||
"Move " + getTypeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
position = newPosition;
|
||||
|
||||
if (owner != 0)
|
||||
owner->changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const Rectangle<int> PaintElement::getCurrentBounds (const Rectangle<int>& parentArea) const
|
||||
{
|
||||
return position.getRectangle (parentArea, getDocument()->getComponentLayout());
|
||||
}
|
||||
|
||||
void PaintElement::setCurrentBounds (const Rectangle<int>& newBounds,
|
||||
const Rectangle<int>& parentArea,
|
||||
const bool undoable)
|
||||
{
|
||||
RelativePositionedRectangle pr (position);
|
||||
pr.updateFrom (newBounds.getX() - parentArea.getX(),
|
||||
newBounds.getY() - parentArea.getY(),
|
||||
jmax (1, newBounds.getWidth()),
|
||||
jmax (1, newBounds.getHeight()),
|
||||
Rectangle<int> (0, 0, parentArea.getWidth(), parentArea.getHeight()),
|
||||
getDocument()->getComponentLayout());
|
||||
|
||||
setPosition (pr, undoable);
|
||||
|
||||
updateBounds (parentArea);
|
||||
}
|
||||
|
||||
void PaintElement::updateBounds (const Rectangle<int>& parentArea)
|
||||
{
|
||||
if (! parentArea.isEmpty())
|
||||
{
|
||||
setBounds (getCurrentBounds (parentArea)
|
||||
.expanded (borderThickness,
|
||||
borderThickness));
|
||||
|
||||
for (int i = siblingComponents.size(); --i >= 0;)
|
||||
siblingComponents.getUnchecked(i)->updatePosition();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class ElementPositionProperty : public PositionPropertyBase
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ElementPositionProperty (PaintElement* element_,
|
||||
const String& name,
|
||||
ComponentPositionDimension dimension_)
|
||||
: PositionPropertyBase (element_, name, dimension_, true, false,
|
||||
element_->getDocument()->getComponentLayout()),
|
||||
element (element_)
|
||||
{
|
||||
element_->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~ElementPositionProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setPosition (const RelativePositionedRectangle& newPos)
|
||||
{
|
||||
element->setPosition (newPos, true);
|
||||
}
|
||||
|
||||
const RelativePositionedRectangle getPosition() const
|
||||
{
|
||||
return element->getPosition();
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElement* const element;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
void PaintElement::getEditableProperties (Array <PropertyComponent*>& properties)
|
||||
{
|
||||
properties.add (new ElementPositionProperty (this, "x", PositionPropertyBase::componentX));
|
||||
properties.add (new ElementPositionProperty (this, "y", PositionPropertyBase::componentY));
|
||||
properties.add (new ElementPositionProperty (this, "width", PositionPropertyBase::componentWidth));
|
||||
properties.add (new ElementPositionProperty (this, "height", PositionPropertyBase::componentHeight));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
JucerDocument* PaintElement::getDocument() const
|
||||
{
|
||||
return owner->getDocument();
|
||||
}
|
||||
|
||||
void PaintElement::changed()
|
||||
{
|
||||
repaint();
|
||||
owner->changed();
|
||||
}
|
||||
|
||||
bool PaintElement::perform (UndoableAction* action, const String& actionName)
|
||||
{
|
||||
return owner->perform (action, actionName);
|
||||
}
|
||||
|
||||
void PaintElement::parentHierarchyChanged()
|
||||
{
|
||||
updateSiblingComps();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void PaintElement::drawExtraEditorGraphics (Graphics& g, const Rectangle<int>& relativeTo)
|
||||
{
|
||||
}
|
||||
|
||||
void PaintElement::paint (Graphics& g)
|
||||
{
|
||||
Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
|
||||
g.saveState();
|
||||
g.setOrigin (area.getX() - getX(), area.getY() - getY());
|
||||
area.setPosition (0, 0);
|
||||
|
||||
g.saveState();
|
||||
g.reduceClipRegion (0, 0, area.getWidth(), area.getHeight());
|
||||
|
||||
draw (g, getDocument()->getComponentLayout(), area);
|
||||
|
||||
g.restoreState();
|
||||
|
||||
drawExtraEditorGraphics (g, area);
|
||||
g.restoreState();
|
||||
|
||||
if (selected)
|
||||
{
|
||||
const BorderSize<int> borderSize (border->getBorderThickness());
|
||||
|
||||
drawResizableBorder (g, getWidth(), getHeight(), borderSize,
|
||||
(isMouseOverOrDragging() || border->isMouseOverOrDragging()));
|
||||
}
|
||||
else if (isMouseOverOrDragging())
|
||||
{
|
||||
drawMouseOverCorners (g, getWidth(), getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
void PaintElement::resized()
|
||||
{
|
||||
border->setBounds (0, 0, getWidth(), getHeight());
|
||||
}
|
||||
|
||||
void PaintElement::mouseDown (const MouseEvent& e)
|
||||
{
|
||||
dragging = false;
|
||||
|
||||
if (owner != 0)
|
||||
{
|
||||
owner->getSelectedPoints().deselectAll();
|
||||
mouseDownSelectStatus = owner->getSelectedElements().addToSelectionOnMouseDown (this, e.mods);
|
||||
}
|
||||
|
||||
if (e.mods.isPopupMenu())
|
||||
{
|
||||
showPopupMenu();
|
||||
return; // this may be deleted now..
|
||||
}
|
||||
}
|
||||
|
||||
void PaintElement::mouseDrag (const MouseEvent& e)
|
||||
{
|
||||
if (! e.mods.isPopupMenu())
|
||||
{
|
||||
jassert (dynamic_cast <PaintRoutineEditor*> (getParentComponent()) != 0);
|
||||
const Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
|
||||
if (selected && ! dragging)
|
||||
{
|
||||
dragging = ! e.mouseWasClicked();
|
||||
|
||||
if (dragging)
|
||||
owner->startDragging (area);
|
||||
}
|
||||
|
||||
if (dragging)
|
||||
owner->dragSelectedComps (e.getDistanceFromDragStartX(),
|
||||
e.getDistanceFromDragStartY(),
|
||||
area);
|
||||
}
|
||||
}
|
||||
|
||||
void PaintElement::mouseUp (const MouseEvent& e)
|
||||
{
|
||||
if (dragging)
|
||||
owner->endDragging();
|
||||
|
||||
if (owner != 0)
|
||||
owner->getSelectedElements().addToSelectionOnMouseUp (this, e.mods, dragging, mouseDownSelectStatus);
|
||||
}
|
||||
|
||||
void PaintElement::resizeStart()
|
||||
{
|
||||
if (getHeight() > 0)
|
||||
originalAspectRatio = getWidth() / (double) getHeight();
|
||||
else
|
||||
originalAspectRatio = 1.0;
|
||||
}
|
||||
|
||||
void PaintElement::resizeEnd()
|
||||
{
|
||||
}
|
||||
|
||||
void PaintElement::checkBounds (Rectangle<int>& bounds,
|
||||
const Rectangle<int>& previousBounds,
|
||||
const Rectangle<int>& limits,
|
||||
const bool isStretchingTop,
|
||||
const bool isStretchingLeft,
|
||||
const bool isStretchingBottom,
|
||||
const bool isStretchingRight)
|
||||
{
|
||||
if (ModifierKeys::getCurrentModifiers().isShiftDown())
|
||||
setFixedAspectRatio (originalAspectRatio);
|
||||
else
|
||||
setFixedAspectRatio (0.0);
|
||||
|
||||
ComponentBoundsConstrainer::checkBounds (bounds, previousBounds, limits, isStretchingTop, isStretchingLeft, isStretchingBottom, isStretchingRight);
|
||||
|
||||
JucerDocument* document = getDocument();
|
||||
|
||||
if (document != 0 && document->isSnapActive (true))
|
||||
{
|
||||
jassert (getParentComponent() != 0);
|
||||
const Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
|
||||
int x = bounds.getX();
|
||||
int y = bounds.getY();
|
||||
int w = bounds.getWidth();
|
||||
int h = bounds.getHeight();
|
||||
|
||||
x += borderThickness - area.getX();
|
||||
y += borderThickness - area.getY();
|
||||
w -= borderThickness * 2;
|
||||
h -= borderThickness * 2;
|
||||
|
||||
int right = x + w;
|
||||
int bottom = y + h;
|
||||
|
||||
if (isStretchingRight)
|
||||
right = document->snapPosition (right);
|
||||
|
||||
if (isStretchingBottom)
|
||||
bottom = document->snapPosition (bottom);
|
||||
|
||||
if (isStretchingLeft)
|
||||
x = document->snapPosition (x);
|
||||
|
||||
if (isStretchingTop)
|
||||
y = document->snapPosition (y);
|
||||
|
||||
w = (right - x) + borderThickness * 2;
|
||||
h = (bottom - y) + borderThickness * 2;
|
||||
x -= borderThickness - area.getX();
|
||||
y -= borderThickness - area.getY();
|
||||
|
||||
bounds = Rectangle<int> (x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
void PaintElement::applyBoundsToComponent (Component* component, const Rectangle<int>& bounds)
|
||||
{
|
||||
if (getBounds() != bounds)
|
||||
{
|
||||
getDocument()->getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
jassert (dynamic_cast <PaintRoutineEditor*> (getParentComponent()) != 0);
|
||||
|
||||
setCurrentBounds (bounds.expanded (-borderThickness, -borderThickness),
|
||||
((PaintRoutineEditor*) getParentComponent())->getComponentArea(),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
const Rectangle<int> PaintElement::getCurrentAbsoluteBounds() const
|
||||
{
|
||||
jassert (dynamic_cast <PaintRoutineEditor*> (getParentComponent()) != 0);
|
||||
const Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
|
||||
return position.getRectangle (area, getDocument()->getComponentLayout());
|
||||
}
|
||||
|
||||
void PaintElement::getCurrentAbsoluteBoundsDouble (double& x, double& y, double& w, double& h) const
|
||||
{
|
||||
jassert (dynamic_cast <PaintRoutineEditor*> (getParentComponent()) != 0);
|
||||
const Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
|
||||
position.getRectangleDouble (x, y, w, h, area, getDocument()->getComponentLayout());
|
||||
}
|
||||
|
||||
void PaintElement::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
const bool nowSelected = owner != 0 && owner->getSelectedElements().isSelected (this);
|
||||
|
||||
if (selected != nowSelected)
|
||||
{
|
||||
selected = nowSelected;
|
||||
border->setVisible (nowSelected);
|
||||
repaint();
|
||||
|
||||
selectionChanged (nowSelected);
|
||||
}
|
||||
|
||||
updateSiblingComps();
|
||||
}
|
||||
|
||||
void PaintElement::selectionChanged (const bool isSelected)
|
||||
{
|
||||
}
|
||||
|
||||
void PaintElement::createSiblingComponents()
|
||||
{
|
||||
}
|
||||
|
||||
void PaintElement::siblingComponentsChanged()
|
||||
{
|
||||
siblingComponents.clear();
|
||||
selfChangeListenerList.sendChangeMessage();
|
||||
}
|
||||
|
||||
void PaintElement::updateSiblingComps()
|
||||
{
|
||||
if (selected && getParentComponent() != 0 && owner->getSelectedElements().getNumSelected() == 1)
|
||||
{
|
||||
if (siblingComponents.size() == 0)
|
||||
createSiblingComponents();
|
||||
|
||||
for (int i = siblingComponents.size(); --i >= 0;)
|
||||
siblingComponents.getUnchecked(i)->updatePosition();
|
||||
}
|
||||
else
|
||||
{
|
||||
siblingComponents.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PaintElement::showPopupMenu()
|
||||
{
|
||||
PopupMenu m;
|
||||
|
||||
m.addCommandItem (commandManager, CommandIDs::toFront);
|
||||
m.addCommandItem (commandManager, CommandIDs::toBack);
|
||||
m.addSeparator();
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::cut);
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::copy);
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::paste);
|
||||
m.addCommandItem (commandManager, StandardApplicationCommandIDs::del);
|
||||
|
||||
m.show();
|
||||
}
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENT_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENT_JUCEHEADER__
|
||||
|
||||
#include "../jucer_GeneratedCode.h"
|
||||
class FillType;
|
||||
class PaintRoutine;
|
||||
class JucerDocument;
|
||||
class ElementSiblingComponent;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Base class for objects that can be used in a PaintRoutine.
|
||||
|
||||
*/
|
||||
class PaintElement : public Component,
|
||||
public ChangeListener,
|
||||
public ComponentBoundsConstrainer
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintElement (PaintRoutine* owner, const String& typeName);
|
||||
virtual ~PaintElement();
|
||||
|
||||
//==============================================================================
|
||||
virtual void setInitialBounds (int parentWidth, int parentHeight);
|
||||
|
||||
virtual const Rectangle<int> getCurrentBounds (const Rectangle<int>& activeArea) const;
|
||||
virtual void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& activeArea, const bool undoable);
|
||||
|
||||
const RelativePositionedRectangle& getPosition() const;
|
||||
void setPosition (const RelativePositionedRectangle& newPosition, const bool undoable);
|
||||
|
||||
void updateBounds (const Rectangle<int>& activeArea);
|
||||
|
||||
const String& getTypeName() const throw() { return typeName; }
|
||||
PaintRoutine* getOwner() const throw() { return owner; }
|
||||
|
||||
//==============================================================================
|
||||
virtual void draw (Graphics& g,
|
||||
const ComponentLayout* layout,
|
||||
const Rectangle<int>& parentArea) = 0;
|
||||
|
||||
virtual void drawExtraEditorGraphics (Graphics& g, const Rectangle<int>& relativeTo);
|
||||
|
||||
virtual void getEditableProperties (Array <PropertyComponent*>& properties);
|
||||
|
||||
virtual void showPopupMenu();
|
||||
|
||||
//==============================================================================
|
||||
virtual XmlElement* createXml() const = 0;
|
||||
virtual bool loadFromXml (const XmlElement& xml) = 0;
|
||||
|
||||
//==============================================================================
|
||||
virtual void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode) = 0;
|
||||
|
||||
JucerDocument* getDocument() const;
|
||||
|
||||
virtual void changed();
|
||||
bool perform (UndoableAction* action, const String& actionName);
|
||||
|
||||
//==============================================================================
|
||||
void paint (Graphics& g);
|
||||
void resized();
|
||||
void mouseDown (const MouseEvent& e);
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
void mouseUp (const MouseEvent& e);
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
void parentHierarchyChanged();
|
||||
|
||||
int borderThickness;
|
||||
|
||||
protected:
|
||||
PaintRoutine* const owner;
|
||||
RelativePositionedRectangle position;
|
||||
|
||||
void resizeStart();
|
||||
void resizeEnd();
|
||||
void checkBounds (Rectangle<int>& bounds,
|
||||
const Rectangle<int>& previousBounds,
|
||||
const Rectangle<int>& limits,
|
||||
bool isStretchingTop,
|
||||
bool isStretchingLeft,
|
||||
bool isStretchingBottom,
|
||||
bool isStretchingRight);
|
||||
|
||||
void applyBoundsToComponent (Component* component, const Rectangle<int>& bounds);
|
||||
|
||||
const Rectangle<int> getCurrentAbsoluteBounds() const;
|
||||
void getCurrentAbsoluteBoundsDouble (double& x, double& y, double& w, double& h) const;
|
||||
|
||||
virtual void selectionChanged (const bool isSelected);
|
||||
|
||||
virtual void createSiblingComponents();
|
||||
|
||||
void siblingComponentsChanged();
|
||||
|
||||
OwnedArray <ElementSiblingComponent> siblingComponents;
|
||||
|
||||
void updateSiblingComps();
|
||||
|
||||
private:
|
||||
ResizableBorderComponent* border;
|
||||
String typeName;
|
||||
bool selected, dragging, mouseDownSelectStatus;
|
||||
double originalAspectRatio;
|
||||
ChangeBroadcaster selfChangeListenerList;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENT_JUCEHEADER__
|
||||
|
|
@ -1,166 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTELLIPSE_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTELLIPSE_JUCEHEADER__
|
||||
|
||||
#include "jucer_ColouredElement.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PaintElementEllipse : public ColouredElement
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintElementEllipse (PaintRoutine* owner)
|
||||
: ColouredElement (owner, "Ellipse", true, false)
|
||||
{
|
||||
}
|
||||
|
||||
~PaintElementEllipse() {}
|
||||
|
||||
void draw (Graphics& g, const ComponentLayout* layout, const Rectangle<int>& parentArea)
|
||||
{
|
||||
fillType.setFillType (g, getDocument(), parentArea);
|
||||
|
||||
Rectangle<int> r (position.getRectangle (parentArea, layout));
|
||||
g.fillEllipse ((float) r.getX(), (float) r.getY(), (float) r.getWidth(), (float) r.getHeight());
|
||||
|
||||
if (isStrokePresent)
|
||||
{
|
||||
strokeType.fill.setFillType (g, getDocument(), parentArea);
|
||||
|
||||
g.drawEllipse ((float) r.getX(), (float) r.getY(), (float) r.getWidth(), (float) r.getHeight(),
|
||||
getStrokeType().stroke.getStrokeThickness());
|
||||
}
|
||||
}
|
||||
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ColouredElement::getEditableProperties (properties);
|
||||
properties.add (new ShapeToPathProperty (this));
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode)
|
||||
{
|
||||
if (! fillType.isInvisible())
|
||||
{
|
||||
String x, y, w, h, s;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
fillType.fillInGeneratedCode (code, paintMethodCode);
|
||||
s << "g.fillEllipse ("
|
||||
<< castToFloat (x) << ", "
|
||||
<< castToFloat (y) << ", "
|
||||
<< castToFloat (w) << ", "
|
||||
<< castToFloat (h) << ");\n\n";
|
||||
|
||||
paintMethodCode += s;
|
||||
}
|
||||
|
||||
if (isStrokePresent && ! strokeType.isInvisible())
|
||||
{
|
||||
String x, y, w, h, s;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
strokeType.fill.fillInGeneratedCode (code, paintMethodCode);
|
||||
s << "g.drawEllipse ("
|
||||
<< castToFloat (x) << ", "
|
||||
<< castToFloat (y) << ", "
|
||||
<< castToFloat (w) << ", "
|
||||
<< castToFloat (h) << ", "
|
||||
<< valueToFloat (strokeType.stroke.getStrokeThickness()) << ");\n\n";
|
||||
|
||||
paintMethodCode += s;
|
||||
}
|
||||
}
|
||||
|
||||
static const char* getTagName() throw() { return "ELLIPSE"; }
|
||||
|
||||
XmlElement* createXml() const
|
||||
{
|
||||
XmlElement* e = new XmlElement (getTagName());
|
||||
position.applyToXml (*e);
|
||||
addColourAttributes (e);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (getTagName()))
|
||||
{
|
||||
position.restoreFromXml (xml, position);
|
||||
loadColourAttributes (xml);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void convertToPath()
|
||||
{
|
||||
double x, y, w, h;
|
||||
getCurrentAbsoluteBoundsDouble (x, y, w, h);
|
||||
|
||||
Path path;
|
||||
path.addEllipse ((float) x, (float) y, (float) w, (float) h);
|
||||
|
||||
convertToNewPathElement (path);
|
||||
}
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
class ShapeToPathProperty : public ButtonPropertyComponent
|
||||
{
|
||||
public:
|
||||
ShapeToPathProperty (PaintElementEllipse* const element_)
|
||||
: ButtonPropertyComponent ("path", false),
|
||||
element (element_)
|
||||
{
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
element->convertToPath();
|
||||
}
|
||||
|
||||
String getButtonText() const
|
||||
{
|
||||
return "convert to a path";
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElementEllipse* const element;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTELLIPSE_JUCEHEADER__
|
||||
|
|
@ -1,253 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTGROUP_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTGROUP_JUCEHEADER__
|
||||
|
||||
#include "jucer_PaintElement.h"
|
||||
#include "../jucer_ObjectTypes.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PaintElementGroup : public PaintElement
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintElementGroup (PaintRoutine* owner)
|
||||
: PaintElement (owner, "Group")
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void ungroup (const bool undoable)
|
||||
{
|
||||
getOwner()->getSelectedElements().deselectAll();
|
||||
getOwner()->getSelectedPoints().deselectAll();
|
||||
|
||||
const int index = getOwner()->indexOfElement (this);
|
||||
|
||||
for (int i = 0; i < subElements.size(); ++i)
|
||||
{
|
||||
ScopedPointer<XmlElement> xml (subElements.getUnchecked(i)->createXml());
|
||||
|
||||
PaintElement* newOne = getOwner()->addElementFromXml (*xml, index, undoable);
|
||||
getOwner()->getSelectedElements().addToSelection (newOne);
|
||||
}
|
||||
|
||||
getOwner()->removeElement (this, undoable);
|
||||
}
|
||||
|
||||
static void groupSelected (PaintRoutine* const routine)
|
||||
{
|
||||
if (routine->getSelectedElements().getNumSelected() > 1)
|
||||
{
|
||||
PaintElementGroup* newGroup = new PaintElementGroup (routine);
|
||||
|
||||
int frontIndex = -1;
|
||||
|
||||
for (int i = 0; i < routine->getNumElements(); ++i)
|
||||
{
|
||||
if (routine->getSelectedElements().isSelected (routine->getElement (i)))
|
||||
{
|
||||
ScopedPointer<XmlElement> xml (routine->getElement(i)->createXml());
|
||||
|
||||
PaintElement* newOne = ObjectTypes::createElementForXml (xml, routine);
|
||||
if (newOne != 0)
|
||||
newGroup->subElements.add (newOne);
|
||||
|
||||
if (i > frontIndex)
|
||||
frontIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
routine->deleteSelected();
|
||||
|
||||
PaintElement* const g = routine->addNewElement (newGroup, frontIndex, true);
|
||||
routine->getSelectedElements().selectOnly (g);
|
||||
}
|
||||
}
|
||||
|
||||
int getNumElements() const throw() { return subElements.size(); }
|
||||
|
||||
PaintElement* getElement (const int index) const throw() { return subElements [index]; }
|
||||
|
||||
int indexOfElement (const PaintElement* element) const throw() { return subElements.indexOf (element); }
|
||||
|
||||
bool containsElement (const PaintElement* element) const
|
||||
{
|
||||
if (subElements.contains (element))
|
||||
return true;
|
||||
|
||||
for (int i = subElements.size(); --i >= 0;)
|
||||
{
|
||||
PaintElementGroup* pg = dynamic_cast <PaintElementGroup*> (subElements.getUnchecked(i));
|
||||
|
||||
if (pg != 0 && pg->containsElement (element))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setInitialBounds (int parentWidth, int parentHeight)
|
||||
{
|
||||
}
|
||||
|
||||
const Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const
|
||||
{
|
||||
Rectangle<int> r;
|
||||
|
||||
if (subElements.size() > 0)
|
||||
{
|
||||
r = subElements.getUnchecked(0)->getCurrentBounds (parentArea);
|
||||
|
||||
for (int i = 1; i < subElements.size(); ++i)
|
||||
r = r.getUnion (subElements.getUnchecked(i)->getCurrentBounds (parentArea));
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void setCurrentBounds (const Rectangle<int>& b, const Rectangle<int>& parentArea, const bool undoable)
|
||||
{
|
||||
Rectangle<int> newBounds (b);
|
||||
newBounds.setSize (jmax (1, newBounds.getWidth()),
|
||||
jmax (1, newBounds.getHeight()));
|
||||
|
||||
const Rectangle<int> current (getCurrentBounds (parentArea));
|
||||
|
||||
if (newBounds != current)
|
||||
{
|
||||
const int dx = newBounds.getX() - current.getX();
|
||||
const int dy = newBounds.getY() - current.getY();
|
||||
|
||||
const double scaleStartX = current.getX();
|
||||
const double scaleStartY = current.getY();
|
||||
const double scaleX = newBounds.getWidth() / (double) current.getWidth();
|
||||
const double scaleY = newBounds.getHeight() / (double) current.getHeight();
|
||||
|
||||
for (int i = 0; i < subElements.size(); ++i)
|
||||
{
|
||||
PaintElement* const e = subElements.getUnchecked(i);
|
||||
|
||||
Rectangle<int> pos (e->getCurrentBounds (parentArea));
|
||||
|
||||
const int newX = roundToInt ((pos.getX() - scaleStartX) * scaleX + scaleStartX + dx);
|
||||
const int newY = roundToInt ((pos.getY() - scaleStartY) * scaleY + scaleStartY + dy);
|
||||
|
||||
pos.setBounds (newX, newY,
|
||||
roundToInt ((pos.getRight() - scaleStartX) * scaleX + scaleStartX + dx) - newX,
|
||||
roundToInt ((pos.getBottom() - scaleStartY) * scaleY + scaleStartY + dy) - newY);
|
||||
|
||||
e->setCurrentBounds (pos, parentArea, undoable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void draw (Graphics& g, const ComponentLayout* layout, const Rectangle<int>& parentArea)
|
||||
{
|
||||
for (int i = 0; i < subElements.size(); ++i)
|
||||
subElements.getUnchecked(i)->draw (g, layout, parentArea);
|
||||
}
|
||||
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties)
|
||||
{
|
||||
properties.add (new UngroupProperty (this));
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode)
|
||||
{
|
||||
for (int i = 0; i < subElements.size(); ++i)
|
||||
subElements.getUnchecked(i)->fillInGeneratedCode (code, paintMethodCode);
|
||||
}
|
||||
|
||||
static const char* getTagName() throw() { return "GROUP"; }
|
||||
|
||||
XmlElement* createXml() const
|
||||
{
|
||||
XmlElement* e = new XmlElement (getTagName());
|
||||
|
||||
for (int i = 0; i < subElements.size(); ++i)
|
||||
{
|
||||
XmlElement* const sub = subElements.getUnchecked(i)->createXml();
|
||||
e->addChildElement (sub);
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (getTagName()))
|
||||
{
|
||||
forEachXmlChildElement (xml, e)
|
||||
{
|
||||
PaintElement* const pe = ObjectTypes::createElementForXml (e, owner);
|
||||
|
||||
if (pe != 0)
|
||||
subElements.add (pe);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
OwnedArray <PaintElement> subElements;
|
||||
|
||||
class UngroupProperty : public ButtonPropertyComponent
|
||||
{
|
||||
public:
|
||||
UngroupProperty (PaintElementGroup* const element_)
|
||||
: ButtonPropertyComponent ("ungroup", false),
|
||||
element (element_)
|
||||
{
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
element->ungroup (true);
|
||||
}
|
||||
|
||||
String getButtonText() const
|
||||
{
|
||||
return "Ungroup";
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElementGroup* const element;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTGROUP_JUCEHEADER__
|
||||
|
|
@ -1,524 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTIMAGE_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTIMAGE_JUCEHEADER__
|
||||
|
||||
#include "../jucer_PaintRoutine.h"
|
||||
#include "../../properties/jucer_FilePropertyComponent.h"
|
||||
#include "jucer_ImageResourceProperty.h"
|
||||
#include "jucer_PaintElementUndoableAction.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PaintElementImage : public PaintElement
|
||||
{
|
||||
public:
|
||||
enum StretchMode
|
||||
{
|
||||
stretched = 0,
|
||||
proportional = 1,
|
||||
proportionalReducingOnly = 2
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
PaintElementImage (PaintRoutine* owner)
|
||||
: PaintElement (owner, "Image"),
|
||||
opacity (1.0),
|
||||
mode (stretched)
|
||||
{
|
||||
}
|
||||
|
||||
~PaintElementImage()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const Drawable* getDrawable()
|
||||
{
|
||||
JucerDocument* const document = getDocument();
|
||||
|
||||
if (document != 0)
|
||||
return document->getResources().getDrawable (resourceName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void draw (Graphics& g, const ComponentLayout* layout, const Rectangle<int>& parentArea)
|
||||
{
|
||||
const Rectangle<int> r (position.getRectangle (parentArea, layout));
|
||||
|
||||
const Drawable* const image = getDrawable();
|
||||
|
||||
if (image != 0)
|
||||
{
|
||||
image->drawWithin (g, r.toFloat(),
|
||||
mode == stretched ? RectanglePlacement::stretchToFit
|
||||
: (mode == proportionalReducingOnly ? (RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize)
|
||||
: RectanglePlacement::centred),
|
||||
(float) opacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
g.setColour (Colours::grey.withAlpha (0.5f));
|
||||
g.fillRect (r);
|
||||
|
||||
g.setColour (Colours::black);
|
||||
g.drawText ("(image missing)",
|
||||
r.getX(), r.getY(), r.getWidth(), r.getHeight(),
|
||||
Justification::centred, true);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties)
|
||||
{
|
||||
PaintElement::getEditableProperties (properties);
|
||||
|
||||
properties.add (new ImageElementResourceProperty (this));
|
||||
properties.add (new StretchModeProperty (this));
|
||||
properties.add (new OpacityProperty (this));
|
||||
properties.add (new ResetSizeProperty (this));
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode)
|
||||
{
|
||||
String r;
|
||||
|
||||
if (opacity > 0)
|
||||
{
|
||||
if (dynamic_cast <const DrawableImage*> (getDrawable()) != 0)
|
||||
{
|
||||
const String imageVariable ("cachedImage_" + resourceName);
|
||||
|
||||
code.addImageResourceLoader (imageVariable, resourceName);
|
||||
|
||||
if (opacity >= 254.0 / 255.0)
|
||||
r << "g.setColour (Colours::black);\n";
|
||||
else
|
||||
r << "g.setColour (Colours::black.withAlpha (" << valueToFloat (opacity) << "));\n";
|
||||
|
||||
String x, y, w, h;
|
||||
positionToCode (position, getDocument()->getComponentLayout(), x, y, w, h);
|
||||
|
||||
if (mode == stretched)
|
||||
{
|
||||
r << "g.drawImage (" << imageVariable << ",\n "
|
||||
<< x << ", " << y << ", " << w << ", " << h
|
||||
<< ",\n 0, 0, "
|
||||
<< imageVariable << ".getWidth(), "
|
||||
<< imageVariable << ".getHeight());\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
r << "g.drawImageWithin (" << imageVariable << ",\n "
|
||||
<< x << ", " << y << ", " << w << ", " << h
|
||||
<< ",\n ";
|
||||
|
||||
if (mode == proportionalReducingOnly)
|
||||
r << "RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize";
|
||||
else
|
||||
r << "RectanglePlacement::centred";
|
||||
|
||||
r << ",\n false);\n\n";
|
||||
}
|
||||
|
||||
paintMethodCode += r;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (resourceName.isNotEmpty())
|
||||
{
|
||||
const String imageVariable ("drawable" + String (code.getUniqueSuffix()));
|
||||
|
||||
code.privateMemberDeclarations
|
||||
<< "Drawable* " << imageVariable << ";\n";
|
||||
|
||||
code.constructorCode
|
||||
<< imageVariable << " = Drawable::createFromImageData ("
|
||||
<< resourceName << ", " << resourceName << "Size);\n";
|
||||
|
||||
code.destructorCode
|
||||
<< "deleteAndZero (" << imageVariable << ");\n";
|
||||
|
||||
if (opacity >= 254.0 / 255.0)
|
||||
r << "g.setColour (Colours::black);\n";
|
||||
else
|
||||
r << "g.setColour (Colours::black.withAlpha (" << valueToFloat (opacity) << "));\n";
|
||||
|
||||
String x, y, w, h;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
r << "jassert (" << imageVariable << " != 0);\n"
|
||||
<< "if (" << imageVariable << " != 0)\n "
|
||||
<< imageVariable << "->drawWithin (g, Rectangle<float> ("
|
||||
<< x << ", " << y << ", " << w << ", " << h
|
||||
<< "),\n"
|
||||
<< String::repeatedString (" ", imageVariable.length() + 18)
|
||||
<< (mode == stretched ? "RectanglePlacement::stretchToFit"
|
||||
: (mode == proportionalReducingOnly ? "RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize"
|
||||
: "RectanglePlacement::centred"))
|
||||
<< ", " << valueToFloat (opacity)
|
||||
<< ");\n\n";
|
||||
|
||||
paintMethodCode += r;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse // this resource isn't valid!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class SetResourceAction : public PaintElementUndoableAction <PaintElementImage>
|
||||
{
|
||||
public:
|
||||
SetResourceAction (PaintElementImage* const element, const String& newResource_)
|
||||
: PaintElementUndoableAction <PaintElementImage> (element),
|
||||
newResource (newResource_)
|
||||
{
|
||||
oldResource = element->getResource();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setResource (newResource, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setResource (oldResource, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
String newResource, oldResource;
|
||||
};
|
||||
|
||||
void setResource (const String& newName, const bool undoable)
|
||||
{
|
||||
if (resourceName != newName)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetResourceAction (this, newName),
|
||||
"Change image resource");
|
||||
}
|
||||
else
|
||||
{
|
||||
resourceName = newName;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
repaint();
|
||||
}
|
||||
|
||||
const String getResource() const
|
||||
{
|
||||
return resourceName;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class SetOpacityAction : public PaintElementUndoableAction <PaintElementImage>
|
||||
{
|
||||
public:
|
||||
SetOpacityAction (PaintElementImage* const element, const double newOpacity_)
|
||||
: PaintElementUndoableAction <PaintElementImage> (element),
|
||||
newOpacity (newOpacity_)
|
||||
{
|
||||
oldOpacity = element->getOpacity();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setOpacity (newOpacity, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setOpacity (oldOpacity, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
double newOpacity, oldOpacity;
|
||||
};
|
||||
|
||||
void setOpacity (double newOpacity, const bool undoable)
|
||||
{
|
||||
newOpacity = jlimit (0.0, 1.0, newOpacity);
|
||||
|
||||
if (opacity != newOpacity)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetOpacityAction (this, newOpacity),
|
||||
"Change image opacity");
|
||||
}
|
||||
else
|
||||
{
|
||||
opacity = newOpacity;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double getOpacity() const throw() { return opacity; }
|
||||
|
||||
//==============================================================================
|
||||
static const char* getTagName() throw() { return "IMAGE"; }
|
||||
|
||||
void resetToImageSize()
|
||||
{
|
||||
const Drawable* const image = getDrawable();
|
||||
|
||||
if (image != 0 && getParentComponent() != 0)
|
||||
{
|
||||
const Rectangle<int> parentArea (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
|
||||
Rectangle<int> r (getCurrentBounds (parentArea));
|
||||
Rectangle<float> bounds (image->getDrawableBounds());
|
||||
|
||||
r.setSize ((int) (bounds.getWidth() + 0.999f), (int) (bounds.getHeight() + 0.999f));
|
||||
|
||||
setCurrentBounds (r, parentArea, true);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class SetStretchModeAction : public PaintElementUndoableAction <PaintElementImage>
|
||||
{
|
||||
public:
|
||||
SetStretchModeAction (PaintElementImage* const element, const StretchMode newValue_)
|
||||
: PaintElementUndoableAction <PaintElementImage> (element),
|
||||
newValue (newValue_)
|
||||
{
|
||||
oldValue = element->getStretchMode();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setStretchMode (newValue, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setStretchMode (oldValue, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
StretchMode newValue, oldValue;
|
||||
};
|
||||
|
||||
StretchMode getStretchMode() const throw() { return mode; }
|
||||
|
||||
void setStretchMode (const StretchMode newMode, const bool undoable)
|
||||
{
|
||||
if (mode != newMode)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetStretchModeAction (this, newMode),
|
||||
"Change image mode");
|
||||
}
|
||||
else
|
||||
{
|
||||
mode = newMode;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
XmlElement* createXml() const
|
||||
{
|
||||
XmlElement* e = new XmlElement (getTagName());
|
||||
position.applyToXml (*e);
|
||||
e->setAttribute ("resource", resourceName);
|
||||
e->setAttribute ("opacity", opacity);
|
||||
e->setAttribute ("mode", (int) mode);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (getTagName()))
|
||||
{
|
||||
position.restoreFromXml (xml, position);
|
||||
resourceName = xml.getStringAttribute ("resource", String::empty);
|
||||
opacity = xml.getDoubleAttribute ("opacity", 1.0);
|
||||
mode = (StretchMode) xml.getIntAttribute ("mode", (int) stretched);
|
||||
|
||||
repaint();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
String resourceName;
|
||||
double opacity;
|
||||
StretchMode mode;
|
||||
|
||||
//==============================================================================
|
||||
class ImageElementResourceProperty : public ImageResourceProperty <PaintElementImage>
|
||||
{
|
||||
public:
|
||||
ImageElementResourceProperty (PaintElementImage* const element_)
|
||||
: ImageResourceProperty <PaintElementImage> (element_, "image source")
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void setResource (const String& newName)
|
||||
{
|
||||
element->setResource (newName, true);
|
||||
}
|
||||
|
||||
const String getResource() const
|
||||
{
|
||||
return element->getResource();
|
||||
}
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class OpacityProperty : public SliderPropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
OpacityProperty (PaintElementImage* const element_)
|
||||
: SliderPropertyComponent ("opacity", 0.0, 1.0, 0.001),
|
||||
element (element_)
|
||||
{
|
||||
element->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~OpacityProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setValue (double newValue)
|
||||
{
|
||||
element->getDocument()->getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
element->setOpacity (newValue, true);
|
||||
}
|
||||
|
||||
double getValue() const
|
||||
{
|
||||
return element->getOpacity();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElementImage* const element;
|
||||
};
|
||||
|
||||
class StretchModeProperty : public ChoicePropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
StretchModeProperty (PaintElementImage* const element_)
|
||||
: ChoicePropertyComponent ("stretch mode"),
|
||||
element (element_)
|
||||
{
|
||||
choices.add ("Stretched to fit");
|
||||
choices.add ("Maintain aspect ratio");
|
||||
choices.add ("Maintain aspect ratio, only reduce in size");
|
||||
|
||||
element->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~StretchModeProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
element->setStretchMode ((StretchMode) newIndex, true);
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
return (int) element->getStretchMode();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElementImage* const element;
|
||||
};
|
||||
|
||||
class ResetSizeProperty : public ButtonPropertyComponent
|
||||
{
|
||||
public:
|
||||
ResetSizeProperty (PaintElementImage* const element_)
|
||||
: ButtonPropertyComponent ("reset", false),
|
||||
element (element_)
|
||||
{
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
element->resetToImageSize();
|
||||
}
|
||||
|
||||
String getButtonText() const { return "reset to image size"; }
|
||||
|
||||
private:
|
||||
PaintElementImage* const element;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTIMAGE_JUCEHEADER__
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTPATH_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTPATH_JUCEHEADER__
|
||||
|
||||
#include "jucer_ColouredElement.h"
|
||||
#include "jucer_ElementSiblingComponent.h"
|
||||
class PathPointComponent;
|
||||
class PaintElementPath;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PathPoint
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PathPoint (PaintElementPath* const owner);
|
||||
PathPoint (const PathPoint& other);
|
||||
PathPoint& operator= (const PathPoint& other);
|
||||
~PathPoint();
|
||||
|
||||
//==============================================================================
|
||||
PaintElementPath* owner;
|
||||
|
||||
Path::Iterator::PathElementType type;
|
||||
|
||||
RelativePositionedRectangle pos [3];
|
||||
|
||||
//==============================================================================
|
||||
int getNumPoints() const;
|
||||
|
||||
void changePointType (const Path::Iterator::PathElementType newType,
|
||||
const Rectangle<int>& parentArea,
|
||||
const bool undoable);
|
||||
|
||||
void deleteFromPath();
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties);
|
||||
|
||||
private:
|
||||
const PathPoint withChangedPointType (const Path::Iterator::PathElementType newType,
|
||||
const Rectangle<int>& parentArea) const;
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PaintElementPath : public ColouredElement
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintElementPath (PaintRoutine* owner);
|
||||
~PaintElementPath();
|
||||
|
||||
//==============================================================================
|
||||
void setInitialBounds (int parentWidth, int parentHeight);
|
||||
const Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const;
|
||||
void setCurrentBounds (const Rectangle<int>& b, const Rectangle<int>& parentArea, const bool undoable);
|
||||
|
||||
//==============================================================================
|
||||
bool getPoint (int index, int pointNumber, double& x, double& y, const Rectangle<int>& parentArea) const;
|
||||
void movePoint (int index, int pointNumber, double newX, double newY, const Rectangle<int>& parentArea, const bool undoable);
|
||||
|
||||
const RelativePositionedRectangle getPoint (int index, int pointNumber) const;
|
||||
void setPoint (int index, int pointNumber, const RelativePositionedRectangle& newPoint, const bool undoable);
|
||||
|
||||
int getNumPoints() const throw() { return points.size(); }
|
||||
PathPoint* getPoint (int index) const throw() { return points [index]; }
|
||||
int indexOfPoint (PathPoint* const p) const throw() { return points.indexOf (p); }
|
||||
|
||||
PathPoint* addPoint (int pointIndexToAddItAfter, const bool undoable);
|
||||
void deletePoint (int pointIndex, const bool undoable);
|
||||
|
||||
void pointListChanged();
|
||||
|
||||
int findSegmentAtXY (int x, int y) const;
|
||||
|
||||
//==============================================================================
|
||||
bool isSubpathClosed (int pointIndex) const;
|
||||
void setSubpathClosed (int pointIndex, const bool closed, const bool undoable);
|
||||
|
||||
bool isNonZeroWinding() const throw() { return nonZeroWinding; }
|
||||
void setNonZeroWinding (const bool nonZero, const bool undoable);
|
||||
|
||||
//==============================================================================
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties);
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode);
|
||||
|
||||
//==============================================================================
|
||||
static const char* getTagName() throw() { return "PATH"; }
|
||||
XmlElement* createXml() const;
|
||||
bool loadFromXml (const XmlElement& xml);
|
||||
|
||||
void setToPath (const Path& p);
|
||||
|
||||
//==============================================================================
|
||||
void draw (Graphics& g, const ComponentLayout* layout, const Rectangle<int>& parentArea);
|
||||
void drawExtraEditorGraphics (Graphics& g, const Rectangle<int>& relativeTo);
|
||||
|
||||
void resized();
|
||||
void parentSizeChanged();
|
||||
|
||||
void mouseDown (const MouseEvent& e);
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
void mouseUp (const MouseEvent& e);
|
||||
|
||||
void createSiblingComponents();
|
||||
void changed();
|
||||
|
||||
private:
|
||||
friend class PathPoint;
|
||||
friend class PathPointComponent;
|
||||
OwnedArray <PathPoint> points;
|
||||
bool nonZeroWinding;
|
||||
mutable Path path;
|
||||
mutable Rectangle<int> lastPathBounds;
|
||||
int mouseDownOnSegment;
|
||||
bool mouseDownSelectSegmentStatus;
|
||||
|
||||
const String pathToString() const;
|
||||
void restorePathFromString (const String& s);
|
||||
void updateStoredPath (const ComponentLayout* layout, const Rectangle<int>& parentArea) const;
|
||||
int getBorderSize() const;
|
||||
|
||||
void rescalePoint (RelativePositionedRectangle& pos, int dx, int dy,
|
||||
double scaleX, double scaleY,
|
||||
double scaleStartX, double scaleStartY,
|
||||
const Rectangle<int>& parentArea) const;
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PathPointComponent : public ElementSiblingComponent
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PathPointComponent (PaintElementPath* const path_,
|
||||
const int index, const int pointNumber);
|
||||
|
||||
~PathPointComponent();
|
||||
|
||||
//==============================================================================
|
||||
void updatePosition();
|
||||
void showPopupMenu();
|
||||
|
||||
//==============================================================================
|
||||
void paint (Graphics& g);
|
||||
void mouseDown (const MouseEvent& e);
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
void mouseUp (const MouseEvent& e);
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
|
||||
private:
|
||||
PaintElementPath* const path;
|
||||
PaintRoutine* const routine;
|
||||
const int index;
|
||||
const int pointNumber;
|
||||
int dragX, dragY;
|
||||
bool selected, dragging, mouseDownSelectStatus;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTPATH_JUCEHEADER__
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTRECTANGLE_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTRECTANGLE_JUCEHEADER__
|
||||
|
||||
#include "jucer_ColouredElement.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PaintElementRectangle : public ColouredElement
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintElementRectangle (PaintRoutine* owner)
|
||||
: ColouredElement (owner, "Rectangle", true, false)
|
||||
{
|
||||
}
|
||||
|
||||
~PaintElementRectangle()
|
||||
{
|
||||
}
|
||||
|
||||
const Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const
|
||||
{
|
||||
return PaintElement::getCurrentBounds (parentArea); // bypass the ColouredElement implementation
|
||||
}
|
||||
|
||||
void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, const bool undoable)
|
||||
{
|
||||
PaintElement::setCurrentBounds (newBounds, parentArea, undoable); // bypass the ColouredElement implementation
|
||||
}
|
||||
|
||||
void draw (Graphics& g, const ComponentLayout* layout, const Rectangle<int>& parentArea)
|
||||
{
|
||||
Component parentComponent;
|
||||
parentComponent.setBounds (parentArea);
|
||||
|
||||
fillType.setFillType (g, getDocument(), parentArea);
|
||||
|
||||
const Rectangle<int> r (position.getRectangle (parentArea, layout));
|
||||
g.fillRect (r);
|
||||
|
||||
if (isStrokePresent)
|
||||
{
|
||||
strokeType.fill.setFillType (g, getDocument(), parentArea);
|
||||
|
||||
g.drawRect (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
|
||||
roundToInt (getStrokeType().stroke.getStrokeThickness()));
|
||||
}
|
||||
}
|
||||
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ColouredElement::getEditableProperties (properties);
|
||||
|
||||
properties.add (new ShapeToPathProperty (this));
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode)
|
||||
{
|
||||
if (! fillType.isInvisible())
|
||||
{
|
||||
String x, y, w, h, s;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
fillType.fillInGeneratedCode (code, paintMethodCode);
|
||||
s << "g.fillRect (" << x << ", " << y << ", " << w << ", " << h << ");\n\n";
|
||||
|
||||
paintMethodCode += s;
|
||||
}
|
||||
|
||||
if (isStrokePresent && ! strokeType.isInvisible())
|
||||
{
|
||||
String x, y, w, h, s;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
strokeType.fill.fillInGeneratedCode (code, paintMethodCode);
|
||||
s << "g.drawRect (" << x << ", " << y << ", " << w << ", " << h << ", "
|
||||
<< roundToInt (strokeType.stroke.getStrokeThickness()) << ");\n\n";
|
||||
|
||||
paintMethodCode += s;
|
||||
}
|
||||
}
|
||||
|
||||
static const char* getTagName() throw() { return "RECT"; }
|
||||
|
||||
XmlElement* createXml() const
|
||||
{
|
||||
XmlElement* e = new XmlElement (getTagName());
|
||||
position.applyToXml (*e);
|
||||
|
||||
addColourAttributes (e);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (getTagName()))
|
||||
{
|
||||
position.restoreFromXml (xml, position);
|
||||
loadColourAttributes (xml);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void convertToPath()
|
||||
{
|
||||
const Rectangle<int> r (getCurrentAbsoluteBounds());
|
||||
|
||||
Path path;
|
||||
path.addRectangle ((float) r.getX(), (float) r.getY(), (float) r.getWidth(), (float) r.getHeight());
|
||||
|
||||
convertToNewPathElement (path);
|
||||
}
|
||||
|
||||
private:
|
||||
class ShapeToPathProperty : public ButtonPropertyComponent
|
||||
{
|
||||
public:
|
||||
ShapeToPathProperty (PaintElementRectangle* const element_)
|
||||
: ButtonPropertyComponent ("path", false),
|
||||
element (element_)
|
||||
{
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
element->convertToPath();
|
||||
}
|
||||
|
||||
String getButtonText() const
|
||||
{
|
||||
return "convert to a path";
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElementRectangle* const element;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTRECTANGLE_JUCEHEADER__
|
||||
|
|
@ -1,260 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTROUNDEDRECTANGLE_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTROUNDEDRECTANGLE_JUCEHEADER__
|
||||
|
||||
#include "jucer_ColouredElement.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PaintElementRoundedRectangle : public ColouredElement
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintElementRoundedRectangle (PaintRoutine* owner)
|
||||
: ColouredElement (owner, "Rounded Rectangle", true, false)
|
||||
{
|
||||
cornerSize = 10.0;
|
||||
}
|
||||
|
||||
~PaintElementRoundedRectangle() {}
|
||||
|
||||
//==============================================================================
|
||||
void draw (Graphics& g, const ComponentLayout* layout, const Rectangle<int>& parentArea)
|
||||
{
|
||||
double x, y, w, h;
|
||||
position.getRectangleDouble (x, y, w, h, parentArea, layout);
|
||||
|
||||
fillType.setFillType (g, getDocument(), parentArea);
|
||||
g.fillRoundedRectangle ((float) x, (float) y, (float) w, (float) h, (float) cornerSize);
|
||||
|
||||
if (isStrokePresent)
|
||||
{
|
||||
strokeType.fill.setFillType (g, getDocument(), parentArea);
|
||||
|
||||
g.drawRoundedRectangle ((float) x, (float) y, (float) w, (float) h, (float) cornerSize,
|
||||
getStrokeType().stroke.getStrokeThickness());
|
||||
}
|
||||
}
|
||||
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties)
|
||||
{
|
||||
properties.add (new CornerSizeProperty (this));
|
||||
|
||||
ColouredElement::getEditableProperties (properties);
|
||||
|
||||
properties.add (new ShapeToPathProperty (this));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class SetCornerSizeAction : public PaintElementUndoableAction <PaintElementRoundedRectangle>
|
||||
{
|
||||
public:
|
||||
SetCornerSizeAction (PaintElementRoundedRectangle* const element, const double newSize_)
|
||||
: PaintElementUndoableAction <PaintElementRoundedRectangle> (element),
|
||||
newSize (newSize_)
|
||||
{
|
||||
oldSize = element->getCornerSize();
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setCornerSize (newSize, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setCornerSize (oldSize, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
double newSize, oldSize;
|
||||
};
|
||||
|
||||
void setCornerSize (const double newSize, const bool undoable)
|
||||
{
|
||||
if (newSize != cornerSize)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetCornerSizeAction (this, newSize),
|
||||
"Change rounded rectangle corner size");
|
||||
}
|
||||
else
|
||||
{
|
||||
cornerSize = newSize;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double getCornerSize() const throw() { return cornerSize; }
|
||||
|
||||
//==============================================================================
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode)
|
||||
{
|
||||
if (! fillType.isInvisible())
|
||||
{
|
||||
String x, y, w, h, s;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
fillType.fillInGeneratedCode (code, paintMethodCode);
|
||||
s << "g.fillRoundedRectangle ("
|
||||
<< castToFloat (x) << ", "
|
||||
<< castToFloat (y) << ", "
|
||||
<< castToFloat (w) << ", "
|
||||
<< castToFloat (h) << ", "
|
||||
<< valueToFloat (cornerSize) << ");\n\n";
|
||||
|
||||
paintMethodCode += s;
|
||||
}
|
||||
|
||||
if (isStrokePresent && ! strokeType.isInvisible())
|
||||
{
|
||||
String x, y, w, h, s;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
strokeType.fill.fillInGeneratedCode (code, paintMethodCode);
|
||||
s << "g.drawRoundedRectangle ("
|
||||
<< castToFloat (x) << ", "
|
||||
<< castToFloat (y) << ", "
|
||||
<< castToFloat (w) << ", "
|
||||
<< castToFloat (h) << ", "
|
||||
<< valueToFloat (cornerSize) << ", "
|
||||
<< valueToFloat (strokeType.stroke.getStrokeThickness()) << ");\n\n";
|
||||
|
||||
paintMethodCode += s;
|
||||
}
|
||||
}
|
||||
|
||||
static const char* getTagName() throw() { return "ROUNDRECT"; }
|
||||
|
||||
XmlElement* createXml() const
|
||||
{
|
||||
XmlElement* const e = new XmlElement (getTagName());
|
||||
|
||||
position.applyToXml (*e);
|
||||
e->setAttribute ("cornerSize", cornerSize);
|
||||
addColourAttributes (e);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (getTagName()))
|
||||
{
|
||||
position.restoreFromXml (xml, position);
|
||||
cornerSize = xml.getDoubleAttribute ("cornerSize", 10.0);
|
||||
loadColourAttributes (xml);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void convertToPath()
|
||||
{
|
||||
double x, y, w, h;
|
||||
getCurrentAbsoluteBoundsDouble (x, y, w, h);
|
||||
|
||||
Path path;
|
||||
path.addRoundedRectangle ((float) x, (float) y, (float) w, (float) h, (float) cornerSize);
|
||||
|
||||
convertToNewPathElement (path);
|
||||
}
|
||||
|
||||
private:
|
||||
double cornerSize;
|
||||
|
||||
//==============================================================================
|
||||
class CornerSizeProperty : public SliderPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
CornerSizeProperty (PaintElementRoundedRectangle* const owner_)
|
||||
: SliderPropertyComponent ("corner size", 1.0, 200.0, 0.5, 0.4),
|
||||
owner (owner_)
|
||||
{
|
||||
owner->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~CornerSizeProperty()
|
||||
{
|
||||
owner->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setValue (double newValue)
|
||||
{
|
||||
owner->getDocument()->getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
owner->setCornerSize (newValue, true);
|
||||
}
|
||||
|
||||
double getValue() const { return owner->getCornerSize(); }
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementRoundedRectangle* const owner;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class ShapeToPathProperty : public ButtonPropertyComponent
|
||||
{
|
||||
public:
|
||||
ShapeToPathProperty (PaintElementRoundedRectangle* const element_)
|
||||
: ButtonPropertyComponent ("path", false),
|
||||
element (element_)
|
||||
{
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
element->convertToPath();
|
||||
}
|
||||
|
||||
String getButtonText() const
|
||||
{
|
||||
return "convert to a path";
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElementRoundedRectangle* const element;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTROUNDEDRECTANGLE_JUCEHEADER__
|
||||
|
|
@ -1,565 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTTEXT_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTTEXT_JUCEHEADER__
|
||||
|
||||
#include "jucer_ColouredElement.h"
|
||||
#include "../../properties/jucer_FontPropertyComponent.h"
|
||||
#include "../../properties/jucer_JustificationProperty.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PaintElementText : public ColouredElement
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PaintElementText (PaintRoutine* owner)
|
||||
: ColouredElement (owner, "Text", false, false),
|
||||
text ("Your text goes here"),
|
||||
font (15.0f),
|
||||
typefaceName (FontPropertyComponent::defaultFont),
|
||||
justification (Justification::centred)
|
||||
{
|
||||
fillType.colour = Colours::black;
|
||||
position.rect.setWidth (200);
|
||||
position.rect.setHeight (30);
|
||||
}
|
||||
|
||||
~PaintElementText()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void draw (Graphics& g, const ComponentLayout* layout, const Rectangle<int>& parentArea)
|
||||
{
|
||||
fillType.setFillType (g, getDocument(), parentArea);
|
||||
|
||||
font = FontPropertyComponent::applyNameToFont (typefaceName, font);
|
||||
g.setFont (font);
|
||||
|
||||
const Rectangle<int> r (position.getRectangle (parentArea, layout));
|
||||
g.drawText (replaceStringTranslations (text, owner->getDocument()),
|
||||
r.getX(), r.getY(), r.getWidth(), r.getHeight(),
|
||||
justification, true);
|
||||
}
|
||||
|
||||
void getEditableProperties (Array <PropertyComponent*>& properties)
|
||||
{
|
||||
ColouredElement::getEditableProperties (properties);
|
||||
|
||||
properties.add (new TextProperty (this));
|
||||
properties.add (new FontNameProperty (this));
|
||||
properties.add (new FontStyleProperty (this));
|
||||
properties.add (new FontSizeProperty (this));
|
||||
properties.add (new TextJustificationProperty (this));
|
||||
properties.add (new TextToPathProperty (this));
|
||||
}
|
||||
|
||||
void fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode)
|
||||
{
|
||||
if (! fillType.isInvisible())
|
||||
{
|
||||
String r;
|
||||
|
||||
fillType.fillInGeneratedCode (code, paintMethodCode);
|
||||
|
||||
String x, y, w, h;
|
||||
positionToCode (position, code.document->getComponentLayout(), x, y, w, h);
|
||||
|
||||
r << "g.setFont ("
|
||||
<< FontPropertyComponent::getCompleteFontCode (font, typefaceName)
|
||||
<< ");\ng.drawText ("
|
||||
<< quotedString (text)
|
||||
<< ",\n "
|
||||
<< x << ", " << y << ", " << w << ", " << h
|
||||
<< ",\n "
|
||||
<< justificationToCode (justification)
|
||||
<< ", true);\n\n";
|
||||
|
||||
paintMethodCode += r;
|
||||
}
|
||||
}
|
||||
|
||||
static const char* getTagName() throw() { return "TEXT"; }
|
||||
|
||||
XmlElement* createXml() const
|
||||
{
|
||||
XmlElement* e = new XmlElement (getTagName());
|
||||
position.applyToXml (*e);
|
||||
addColourAttributes (e);
|
||||
e->setAttribute ("text", text);
|
||||
e->setAttribute ("fontname", typefaceName);
|
||||
e->setAttribute ("fontsize", roundToInt (font.getHeight() * 100.0) / 100.0);
|
||||
e->setAttribute ("bold", font.isBold());
|
||||
e->setAttribute ("italic", font.isItalic());
|
||||
e->setAttribute ("justification", justification.getFlags());
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
bool loadFromXml (const XmlElement& xml)
|
||||
{
|
||||
if (xml.hasTagName (getTagName()))
|
||||
{
|
||||
position.restoreFromXml (xml, position);
|
||||
loadColourAttributes (xml);
|
||||
|
||||
text = xml.getStringAttribute ("text", "Hello World");
|
||||
typefaceName = xml.getStringAttribute ("fontname", FontPropertyComponent::defaultFont);
|
||||
font.setHeight ((float) xml.getDoubleAttribute ("fontsize", 15.0));
|
||||
font.setBold (xml.getBoolAttribute ("bold", false));
|
||||
font.setItalic (xml.getBoolAttribute ("italic", false));
|
||||
justification = Justification (xml.getIntAttribute ("justification", Justification::centred));
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String& getText() const throw() { return text; }
|
||||
|
||||
class SetTextAction : public PaintElementUndoableAction <PaintElementText>
|
||||
{
|
||||
public:
|
||||
SetTextAction (PaintElementText* const element, const String& newText_)
|
||||
: PaintElementUndoableAction <PaintElementText> (element),
|
||||
newText (newText_),
|
||||
oldText (element->getText())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setText (newText, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setText (oldText, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
String newText, oldText;
|
||||
};
|
||||
|
||||
void setText (const String& t, const bool undoable)
|
||||
{
|
||||
if (t != text)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetTextAction (this, t),
|
||||
"Change text element text");
|
||||
}
|
||||
else
|
||||
{
|
||||
text = t;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const Font& getFont() const { return font; }
|
||||
|
||||
class SetFontAction : public PaintElementUndoableAction <PaintElementText>
|
||||
{
|
||||
public:
|
||||
SetFontAction (PaintElementText* const element, const Font& newFont_)
|
||||
: PaintElementUndoableAction <PaintElementText> (element),
|
||||
newFont (newFont_),
|
||||
oldFont (element->getFont())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setFont (newFont, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setFont (oldFont, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Font newFont, oldFont;
|
||||
};
|
||||
|
||||
void setFont (const Font& newFont, const bool undoable)
|
||||
{
|
||||
if (font != newFont)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetFontAction (this, newFont),
|
||||
"Change text element font");
|
||||
}
|
||||
else
|
||||
{
|
||||
font = newFont;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class SetTypefaceAction : public PaintElementUndoableAction <PaintElementText>
|
||||
{
|
||||
public:
|
||||
SetTypefaceAction (PaintElementText* const element, const String& newValue_)
|
||||
: PaintElementUndoableAction <PaintElementText> (element),
|
||||
newValue (newValue_),
|
||||
oldValue (element->getTypefaceName())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setTypefaceName (newValue, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setTypefaceName (oldValue, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
String newValue, oldValue;
|
||||
};
|
||||
|
||||
void setTypefaceName (const String& newFontName, const bool undoable)
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetTypefaceAction (this, newFontName),
|
||||
"Change text element typeface");
|
||||
}
|
||||
else
|
||||
{
|
||||
typefaceName = newFontName;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
String getTypefaceName() const throw() { return typefaceName; }
|
||||
|
||||
//==============================================================================
|
||||
const Justification& getJustification() const throw() { return justification; }
|
||||
|
||||
class SetJustifyAction : public PaintElementUndoableAction <PaintElementText>
|
||||
{
|
||||
public:
|
||||
SetJustifyAction (PaintElementText* const element, const Justification& newValue_)
|
||||
: PaintElementUndoableAction <PaintElementText> (element),
|
||||
newValue (newValue_),
|
||||
oldValue (element->getJustification())
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setJustification (newValue, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
getElement()->setJustification (oldValue, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Justification newValue, oldValue;
|
||||
};
|
||||
|
||||
void setJustification (const Justification& j, const bool undoable)
|
||||
{
|
||||
if (justification.getFlags() != j.getFlags())
|
||||
{
|
||||
if (undoable)
|
||||
{
|
||||
perform (new SetJustifyAction (this, j),
|
||||
"Change text element justification");
|
||||
}
|
||||
else
|
||||
{
|
||||
justification = j;
|
||||
changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void convertToPath()
|
||||
{
|
||||
font = FontPropertyComponent::applyNameToFont (typefaceName, font);
|
||||
|
||||
const Rectangle<int> r (getCurrentAbsoluteBounds());
|
||||
|
||||
GlyphArrangement arr;
|
||||
arr.addCurtailedLineOfText (font, text,
|
||||
0.0f, 0.0f, (float) r.getWidth(),
|
||||
true);
|
||||
|
||||
arr.justifyGlyphs (0, arr.getNumGlyphs(),
|
||||
(float) r.getX(), (float) r.getY(),
|
||||
(float) r.getWidth(), (float) r.getHeight(),
|
||||
justification);
|
||||
|
||||
Path path;
|
||||
arr.createPath (path);
|
||||
|
||||
convertToNewPathElement (path);
|
||||
}
|
||||
|
||||
private:
|
||||
String text;
|
||||
Font font;
|
||||
String typefaceName;
|
||||
Justification justification;
|
||||
|
||||
Array <Justification> justificationTypes;
|
||||
|
||||
//==============================================================================
|
||||
class TextProperty : public TextPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
TextProperty (PaintElementText* const element_)
|
||||
: TextPropertyComponent ("text", 2048, false),
|
||||
element (element_)
|
||||
{
|
||||
element->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~TextProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setText (const String& newText) { element->setText (newText, true); }
|
||||
String getText() const { return element->getText(); }
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class FontNameProperty : public FontPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
FontNameProperty (PaintElementText* const element_)
|
||||
: FontPropertyComponent ("font"),
|
||||
element (element_)
|
||||
{
|
||||
element->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~FontNameProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setTypefaceName (const String& newFontName) { element->setTypefaceName (newFontName, true); }
|
||||
String getTypefaceName() const { return element->getTypefaceName(); }
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class FontStyleProperty : public ChoicePropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
FontStyleProperty (PaintElementText* const element_)
|
||||
: ChoicePropertyComponent ("style"),
|
||||
element (element_)
|
||||
{
|
||||
element->getDocument()->addChangeListener (this);
|
||||
|
||||
choices.add ("normal");
|
||||
choices.add ("bold");
|
||||
choices.add ("italic");
|
||||
choices.add ("bold + italic");
|
||||
}
|
||||
|
||||
~FontStyleProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setIndex (int newIndex)
|
||||
{
|
||||
Font f (element->getFont());
|
||||
|
||||
f.setBold (newIndex == 1 || newIndex == 3);
|
||||
f.setItalic (newIndex == 2 || newIndex == 3);
|
||||
|
||||
element->setFont (f, true);
|
||||
}
|
||||
|
||||
int getIndex() const
|
||||
{
|
||||
if (element->getFont().isBold() && element->getFont().isItalic())
|
||||
return 3;
|
||||
else if (element->getFont().isBold())
|
||||
return 1;
|
||||
else if (element->getFont().isItalic())
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class FontSizeProperty : public SliderPropertyComponent,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
FontSizeProperty (PaintElementText* const element_)
|
||||
: SliderPropertyComponent ("size", 1.0, 250.0, 0.1, 0.3),
|
||||
element (element_)
|
||||
{
|
||||
element->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~FontSizeProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setValue (double newValue)
|
||||
{
|
||||
element->getDocument()->getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
Font f (element->getFont());
|
||||
f.setHeight ((float) newValue);
|
||||
|
||||
element->setFont (f, true);
|
||||
}
|
||||
|
||||
double getValue() const
|
||||
{
|
||||
return element->getFont().getHeight();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TextJustificationProperty : public JustificationProperty,
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
TextJustificationProperty (PaintElementText* const element_)
|
||||
: JustificationProperty ("layout", false),
|
||||
element (element_)
|
||||
{
|
||||
element->getDocument()->addChangeListener (this);
|
||||
}
|
||||
|
||||
~TextJustificationProperty()
|
||||
{
|
||||
element->getDocument()->removeChangeListener (this);
|
||||
}
|
||||
|
||||
void setJustification (const Justification& newJustification)
|
||||
{
|
||||
element->setJustification (newJustification, true);
|
||||
}
|
||||
|
||||
const Justification getJustification() const
|
||||
{
|
||||
return element->getJustification();
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*) { refresh(); }
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
class TextToPathProperty : public ButtonPropertyComponent
|
||||
{
|
||||
public:
|
||||
TextToPathProperty (PaintElementText* const element_)
|
||||
: ButtonPropertyComponent ("path", false),
|
||||
element (element_)
|
||||
{
|
||||
}
|
||||
|
||||
void buttonClicked()
|
||||
{
|
||||
element->convertToPath();
|
||||
}
|
||||
|
||||
String getButtonText() const
|
||||
{
|
||||
return "convert text to a path";
|
||||
}
|
||||
|
||||
private:
|
||||
PaintElementText* const element;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTTEXT_JUCEHEADER__
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_PAINTELEMENTUNDOABLEACTION_JUCEHEADER__
|
||||
#define __JUCER_PAINTELEMENTUNDOABLEACTION_JUCEHEADER__
|
||||
|
||||
#include "../../ui/jucer_JucerDocumentHolder.h"
|
||||
#include "jucer_PaintElementGroup.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
template <class ElementType>
|
||||
class PaintElementUndoableAction : public UndoableAction
|
||||
{
|
||||
public:
|
||||
PaintElementUndoableAction (ElementType* const element)
|
||||
: routine (*element->getOwner()),
|
||||
elementIndex (element->getOwner()->indexOfElement (element))
|
||||
{
|
||||
jassert (element != 0);
|
||||
|
||||
if (elementIndex < 0)
|
||||
findGroupIndices (element->getOwner(), element);
|
||||
|
||||
jassert (elementIndex >= 0);
|
||||
}
|
||||
|
||||
~PaintElementUndoableAction()
|
||||
{
|
||||
}
|
||||
|
||||
ElementType* getElement() const
|
||||
{
|
||||
if (containerGroups.size() > 0)
|
||||
{
|
||||
PaintElementGroup* group = 0;
|
||||
group = dynamic_cast <PaintElementGroup*> (routine.getElement (containerGroups.getFirst()));
|
||||
|
||||
if (group == 0)
|
||||
return 0;
|
||||
|
||||
for (int i = 1; i < containerGroups.size(); ++i)
|
||||
{
|
||||
group = dynamic_cast <PaintElementGroup*> (group->getElement (containerGroups.getUnchecked(i)));
|
||||
|
||||
if (group == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
ElementType* const e = dynamic_cast <ElementType*> (group->getElement (elementIndex));
|
||||
jassert (e != 0);
|
||||
return e;
|
||||
}
|
||||
else
|
||||
{
|
||||
ElementType* const e = dynamic_cast <ElementType*> (routine.getElement (elementIndex));
|
||||
jassert (e != 0);
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
int getSizeInUnits() { return 2; }
|
||||
|
||||
protected:
|
||||
PaintRoutine& routine;
|
||||
int elementIndex;
|
||||
Array <int> containerGroups;
|
||||
|
||||
void changed() const
|
||||
{
|
||||
jassert (routine.getDocument() != 0);
|
||||
routine.getDocument()->changed();
|
||||
}
|
||||
|
||||
void showCorrectTab() const
|
||||
{
|
||||
JucerDocumentHolder* const docHolder = JucerDocumentHolder::getActiveDocumentHolder();
|
||||
|
||||
if (docHolder != 0)
|
||||
docHolder->showGraphics (&routine);
|
||||
|
||||
if (routine.getSelectedElements().getNumSelected() == 0)
|
||||
{
|
||||
ElementType* const e = dynamic_cast <ElementType*> (routine.getElement (elementIndex));
|
||||
|
||||
if (e != 0)
|
||||
routine.getSelectedElements().selectOnly (e);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void findGroupIndices (PaintRoutine* const routine, PaintElement* const element)
|
||||
{
|
||||
for (int i = routine->getNumElements(); --i >= 0;)
|
||||
{
|
||||
PaintElementGroup* const pg = dynamic_cast <PaintElementGroup*> (routine->getElement (i));
|
||||
|
||||
if (pg != 0 && pg->containsElement (element))
|
||||
{
|
||||
containerGroups.add (i);
|
||||
findGroupIndices (pg, element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void findGroupIndices (PaintElementGroup* const group, PaintElement* const element)
|
||||
{
|
||||
elementIndex = group->indexOfElement (element);
|
||||
if (elementIndex < 0)
|
||||
{
|
||||
for (int i = group->getNumElements(); --i >= 0;)
|
||||
{
|
||||
PaintElementGroup* pg = dynamic_cast <PaintElementGroup*> (group->getElement (i));
|
||||
|
||||
if (pg != 0 && pg->containsElement (element))
|
||||
{
|
||||
containerGroups.add (i);
|
||||
findGroupIndices (pg, element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PaintElementUndoableAction (const PaintElementUndoableAction&);
|
||||
PaintElementUndoableAction& operator= (const PaintElementUndoableAction&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __JUCER_PAINTELEMENTUNDOABLEACTION_JUCEHEADER__
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_POINTCOMPONENT_JUCEHEADER__
|
||||
#define __JUCER_POINTCOMPONENT_JUCEHEADER__
|
||||
|
||||
#include "jucer_ElementSiblingComponent.h"
|
||||
#include "../../ui/jucer_PaintRoutineEditor.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class PointComponent : public ElementSiblingComponent
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PointComponent (PaintElement* const owner_)
|
||||
: ElementSiblingComponent (owner_)
|
||||
{
|
||||
setSize (11, 11);
|
||||
setMouseCursor (MouseCursor::UpDownLeftRightResizeCursor);
|
||||
}
|
||||
|
||||
~PointComponent()
|
||||
{
|
||||
}
|
||||
|
||||
virtual const RelativePositionedRectangle getPosition() = 0;
|
||||
virtual void setPosition (const RelativePositionedRectangle& newPos) = 0;
|
||||
|
||||
virtual void updatePosition()
|
||||
{
|
||||
if (dynamic_cast <PaintRoutineEditor*> (getParentComponent()) != 0)
|
||||
{
|
||||
const Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
|
||||
const Rectangle<int> r (getPosition().getRectangle (area, owner->getDocument()->getComponentLayout()));
|
||||
|
||||
setCentrePosition (r.getX(), r.getY());
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void paint (Graphics& g)
|
||||
{
|
||||
g.setColour (Colours::white);
|
||||
g.drawEllipse (2.0f, 2.0f, getWidth() - 4.0f, getHeight() - 4.0f, 2.0f);
|
||||
|
||||
g.setColour (Colours::black);
|
||||
g.drawEllipse (1.0f, 1.0f, getWidth() - 2.0f, getHeight() - 2.0f, 2.0f);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void mouseDown (const MouseEvent& e)
|
||||
{
|
||||
const Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
dragX = getX() + getWidth() / 2 - area.getX();
|
||||
dragY = getY() + getHeight() / 2 - area.getY();
|
||||
}
|
||||
|
||||
void mouseDrag (const MouseEvent& e)
|
||||
{
|
||||
const Rectangle<int> area (((PaintRoutineEditor*) getParentComponent())->getComponentArea());
|
||||
int x = dragX + e.getDistanceFromDragStartX();
|
||||
int y = dragY + e.getDistanceFromDragStartY();
|
||||
|
||||
JucerDocument* const document = owner->getDocument();
|
||||
|
||||
if (document != 0)
|
||||
{
|
||||
x = document->snapPosition (x);
|
||||
y = document->snapPosition (y);
|
||||
}
|
||||
|
||||
const RelativePositionedRectangle original (getPosition());
|
||||
RelativePositionedRectangle pr (original);
|
||||
|
||||
Rectangle<int> r (pr.getRectangle (Rectangle<int> (0, 0, area.getWidth(), area.getHeight()),
|
||||
document->getComponentLayout()));
|
||||
r.setPosition (x, y);
|
||||
|
||||
pr.updateFrom (r.getX(), r.getY(), r.getWidth(), r.getHeight(),
|
||||
Rectangle<int> (0, 0, area.getWidth(), area.getHeight()),
|
||||
document->getComponentLayout());
|
||||
|
||||
if (pr != original)
|
||||
setPosition (pr);
|
||||
}
|
||||
|
||||
void mouseUp (const MouseEvent& e)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
int dragX, dragY;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_POINTCOMPONENT_JUCEHEADER__
|
||||
|
|
@ -1,199 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../../jucer_Headers.h"
|
||||
#include "jucer_StrokeType.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
StrokeType::StrokeType()
|
||||
: stroke (1.0f)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
StrokeType::~StrokeType()
|
||||
{
|
||||
}
|
||||
|
||||
void StrokeType::reset()
|
||||
{
|
||||
stroke = PathStrokeType (5.0f);
|
||||
fill = JucerFillType();
|
||||
fill.colour = Colours::black;
|
||||
}
|
||||
|
||||
const String StrokeType::getPathStrokeCode() const
|
||||
{
|
||||
PathStrokeType defaultStroke (1.0f);
|
||||
|
||||
String s;
|
||||
|
||||
s << "PathStrokeType (" << valueToFloat (stroke.getStrokeThickness());
|
||||
|
||||
if (stroke.getJointStyle() != defaultStroke.getJointStyle()
|
||||
|| stroke.getEndStyle() != defaultStroke.getEndStyle())
|
||||
{
|
||||
s << ", ";
|
||||
|
||||
switch (stroke.getJointStyle())
|
||||
{
|
||||
case PathStrokeType::mitered:
|
||||
s << "PathStrokeType::mitered";
|
||||
break;
|
||||
|
||||
case PathStrokeType::curved:
|
||||
s << "PathStrokeType::curved";
|
||||
break;
|
||||
case PathStrokeType::beveled:
|
||||
s << "PathStrokeType::beveled";
|
||||
break;
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
if (stroke.getEndStyle() != defaultStroke.getEndStyle())
|
||||
{
|
||||
s << ", ";
|
||||
|
||||
switch (stroke.getEndStyle())
|
||||
{
|
||||
case PathStrokeType::butt:
|
||||
s << "PathStrokeType::butt";
|
||||
break;
|
||||
|
||||
case PathStrokeType::square:
|
||||
s << "PathStrokeType::square";
|
||||
break;
|
||||
case PathStrokeType::rounded:
|
||||
s << "PathStrokeType::rounded";
|
||||
break;
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s << ")";
|
||||
return s;
|
||||
}
|
||||
|
||||
const String StrokeType::toString() const
|
||||
{
|
||||
String s;
|
||||
s << stroke.getStrokeThickness();
|
||||
|
||||
switch (stroke.getJointStyle())
|
||||
{
|
||||
case PathStrokeType::mitered:
|
||||
s << ", mitered";
|
||||
break;
|
||||
|
||||
case PathStrokeType::curved:
|
||||
s << ", curved";
|
||||
break;
|
||||
case PathStrokeType::beveled:
|
||||
s << ", beveled";
|
||||
break;
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
switch (stroke.getEndStyle())
|
||||
{
|
||||
case PathStrokeType::butt:
|
||||
s << ", butt";
|
||||
break;
|
||||
|
||||
case PathStrokeType::square:
|
||||
s << ", square";
|
||||
break;
|
||||
case PathStrokeType::rounded:
|
||||
s << ", rounded";
|
||||
break;
|
||||
|
||||
default:
|
||||
jassertfalse
|
||||
break;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void StrokeType::restoreFromString (const String& s)
|
||||
{
|
||||
reset();
|
||||
|
||||
if (s.isNotEmpty())
|
||||
{
|
||||
const float thickness = (float) s.upToFirstOccurrenceOf (",", false, false).getDoubleValue();
|
||||
|
||||
PathStrokeType::JointStyle joint = stroke.getJointStyle();
|
||||
|
||||
if (s.containsIgnoreCase ("miter"))
|
||||
joint = PathStrokeType::mitered;
|
||||
else if (s.containsIgnoreCase ("curve"))
|
||||
joint = PathStrokeType::curved;
|
||||
else if (s.containsIgnoreCase ("bevel"))
|
||||
joint = PathStrokeType::beveled;
|
||||
|
||||
PathStrokeType::EndCapStyle end = stroke.getEndStyle();
|
||||
|
||||
if (s.containsIgnoreCase ("butt"))
|
||||
end = PathStrokeType::butt;
|
||||
else if (s.containsIgnoreCase ("square"))
|
||||
end = PathStrokeType::square;
|
||||
else if (s.containsIgnoreCase ("round"))
|
||||
end = PathStrokeType::rounded;
|
||||
|
||||
stroke = PathStrokeType (thickness, joint, end);
|
||||
}
|
||||
}
|
||||
|
||||
bool StrokeType::isOpaque() const
|
||||
{
|
||||
return fill.isOpaque();
|
||||
}
|
||||
|
||||
bool StrokeType::isInvisible() const
|
||||
{
|
||||
return fill.isInvisible() || stroke.getStrokeThickness() <= 0.0f;
|
||||
}
|
||||
|
||||
bool StrokeType::operator== (const StrokeType& other) const throw()
|
||||
{
|
||||
return stroke == other.stroke
|
||||
&& fill == other.fill;
|
||||
}
|
||||
|
||||
bool StrokeType::operator!= (const StrokeType& other) const throw()
|
||||
{
|
||||
return ! operator== (other);
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_STROKETYPE_JUCEHEADER__
|
||||
#define __JUCER_STROKETYPE_JUCEHEADER__
|
||||
|
||||
#include "jucer_FillType.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Defines the attributes of a stroke to use around a shape.
|
||||
*/
|
||||
class StrokeType
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
StrokeType();
|
||||
~StrokeType();
|
||||
|
||||
//==============================================================================
|
||||
const String getPathStrokeCode() const;
|
||||
|
||||
const String toString() const;
|
||||
void restoreFromString (const String& s);
|
||||
|
||||
bool isOpaque() const;
|
||||
bool isInvisible() const;
|
||||
|
||||
//==============================================================================
|
||||
PathStrokeType stroke;
|
||||
JucerFillType fill;
|
||||
|
||||
//==============================================================================
|
||||
bool operator== (const StrokeType& other) const throw();
|
||||
bool operator!= (const StrokeType& other) const throw();
|
||||
|
||||
|
||||
private:
|
||||
void reset();
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_STROKETYPE_JUCEHEADER__
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COLOURPROPERTYCOMPONENT_JUCEHEADER__
|
||||
#define __JUCER_COLOURPROPERTYCOMPONENT_JUCEHEADER__
|
||||
|
||||
#include "../utility/jucer_ColourEditorComponent.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ColourPropertyComponent : public PropertyComponent
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ColourPropertyComponent (const String& name,
|
||||
const bool canResetToDefault)
|
||||
: PropertyComponent (name)
|
||||
{
|
||||
addAndMakeVisible (new ColourPropEditorComponent (this, canResetToDefault));
|
||||
}
|
||||
|
||||
~ColourPropertyComponent()
|
||||
{
|
||||
deleteAllChildren();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
virtual void setColour (const Colour& newColour) = 0;
|
||||
virtual Colour getColour() const = 0;
|
||||
virtual void resetToDefault() = 0;
|
||||
|
||||
void refresh()
|
||||
{
|
||||
((ColourPropEditorComponent*) getChildComponent (0))->refresh();
|
||||
}
|
||||
|
||||
private:
|
||||
class ColourPropEditorComponent : public ColourEditorComponent
|
||||
{
|
||||
ColourPropertyComponent* const owner;
|
||||
|
||||
public:
|
||||
ColourPropEditorComponent (ColourPropertyComponent* const owner_,
|
||||
const bool canResetToDefault)
|
||||
: ColourEditorComponent (canResetToDefault),
|
||||
owner (owner_)
|
||||
{}
|
||||
|
||||
~ColourPropEditorComponent() {}
|
||||
|
||||
void setColour (const Colour& newColour)
|
||||
{
|
||||
owner->setColour (newColour);
|
||||
}
|
||||
|
||||
Colour getColour() const
|
||||
{
|
||||
return owner->getColour();
|
||||
}
|
||||
|
||||
void resetToDefault()
|
||||
{
|
||||
owner->resetToDefault();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COLOURPROPERTYCOMPONENT_JUCEHEADER__
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTBOOLEANPROPERTY_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTBOOLEANPROPERTY_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
template <class ComponentType>
|
||||
class ComponentBooleanProperty : public BooleanPropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
ComponentBooleanProperty (const String& name,
|
||||
const String& onText,
|
||||
const String& offText,
|
||||
ComponentType* component_,
|
||||
JucerDocument& document_)
|
||||
: BooleanPropertyComponent (name, onText, offText),
|
||||
component (component_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ComponentBooleanProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
protected:
|
||||
ComponentType* component;
|
||||
JucerDocument& document;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTBOOLEANPROPERTY_JUCEHEADER__
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTCHOICEPROPERTY_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTCHOICEPROPERTY_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
template <class ComponentType>
|
||||
class ComponentChoiceProperty : public ChoicePropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
ComponentChoiceProperty (const String& name,
|
||||
ComponentType* component_,
|
||||
JucerDocument& document_)
|
||||
: ChoicePropertyComponent (name),
|
||||
component (component_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ComponentChoiceProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
protected:
|
||||
ComponentType* component;
|
||||
JucerDocument& document;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTCHOICEPROPERTY_JUCEHEADER__
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTCOLOURPROPERTY_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTCOLOURPROPERTY_JUCEHEADER__
|
||||
|
||||
#include "jucer_ColourPropertyComponent.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
template <class ComponentType>
|
||||
class ComponentColourProperty : public ColourPropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
ComponentColourProperty (const String& name,
|
||||
ComponentType* component_,
|
||||
JucerDocument& document_,
|
||||
const bool canResetToDefault)
|
||||
: ColourPropertyComponent (name, canResetToDefault),
|
||||
component (component_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ComponentColourProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
protected:
|
||||
ComponentType* component;
|
||||
JucerDocument& document;
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class ComponentColourIdProperty : public ComponentColourProperty <Component>
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
ComponentColourIdProperty (Component* const component_,
|
||||
JucerDocument& document_,
|
||||
const int colourId_,
|
||||
const String& name,
|
||||
const bool canResetToDefault)
|
||||
: ComponentColourProperty <Component> (name, component_, document_, canResetToDefault),
|
||||
colourId (colourId_)
|
||||
{
|
||||
}
|
||||
|
||||
~ComponentColourIdProperty()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Colour getColour() const
|
||||
{
|
||||
return component->findColour (colourId);
|
||||
}
|
||||
|
||||
void setColour (const Colour& newColour)
|
||||
{
|
||||
if (component->findColour (colourId) != newColour)
|
||||
{
|
||||
document.getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
document.perform (new ColourChangeAction (component,
|
||||
*document.getComponentLayout(),
|
||||
colourId,
|
||||
newColour,
|
||||
false),
|
||||
"Change colour");
|
||||
}
|
||||
}
|
||||
|
||||
void resetToDefault()
|
||||
{
|
||||
document.getUndoManager().undoCurrentTransactionOnly();
|
||||
|
||||
document.perform (new ColourChangeAction (component,
|
||||
*document.getComponentLayout(),
|
||||
colourId,
|
||||
Colours::black,
|
||||
true),
|
||||
"Reset colour");
|
||||
}
|
||||
|
||||
private:
|
||||
const int colourId;
|
||||
|
||||
class ColourChangeAction : public ComponentUndoableAction <Component>
|
||||
{
|
||||
public:
|
||||
ColourChangeAction (Component* const comp,
|
||||
ComponentLayout& layout,
|
||||
const int colourId_,
|
||||
const Colour& newColour_,
|
||||
const bool newColourIsDefault)
|
||||
: ComponentUndoableAction <Component> (comp, layout),
|
||||
colourId (colourId_),
|
||||
newColour (newColour_),
|
||||
isDefault (newColourIsDefault)
|
||||
{
|
||||
}
|
||||
|
||||
bool perform()
|
||||
{
|
||||
showCorrectTab();
|
||||
|
||||
wasSpecified = getComponent()->isColourSpecified (colourId);
|
||||
oldColour = getComponent()->findColour (colourId);
|
||||
|
||||
if (isDefault)
|
||||
getComponent()->removeColour (colourId);
|
||||
else
|
||||
getComponent()->setColour (colourId, newColour);
|
||||
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool undo()
|
||||
{
|
||||
showCorrectTab();
|
||||
|
||||
if (wasSpecified)
|
||||
getComponent()->setColour (colourId, oldColour);
|
||||
else
|
||||
getComponent()->removeColour (colourId);
|
||||
|
||||
TextEditor* const te = dynamic_cast <TextEditor*> (getComponent());
|
||||
if (te != 0)
|
||||
te->applyFontToAllText (te->getFont());
|
||||
|
||||
changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
int colourId;
|
||||
Colour newColour, oldColour;
|
||||
bool isDefault, wasSpecified;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTCOLOURPROPERTY_JUCEHEADER__
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_COMPONENTTEXTPROPERTY_JUCEHEADER__
|
||||
#define __JUCER_COMPONENTTEXTPROPERTY_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
template <class ComponentType>
|
||||
class ComponentTextProperty : public TextPropertyComponent,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
ComponentTextProperty (const String& name,
|
||||
const int maxNumChars_,
|
||||
const bool isMultiLine_,
|
||||
ComponentType* const component_,
|
||||
JucerDocument& document_)
|
||||
: TextPropertyComponent (name, maxNumChars_, isMultiLine_),
|
||||
component (component_),
|
||||
document (document_)
|
||||
{
|
||||
document.addChangeListener (this);
|
||||
}
|
||||
|
||||
~ComponentTextProperty()
|
||||
{
|
||||
document.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
protected:
|
||||
ComponentType* component;
|
||||
JucerDocument& document;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_COMPONENTTEXTPROPERTY_JUCEHEADER__
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../jucer_Headers.h"
|
||||
#include "jucer_FilePropertyComponent.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
FilePropertyComponent::FilePropertyComponent (const String& name,
|
||||
const bool isDirectory,
|
||||
const bool allowEditingOfFilename,
|
||||
const String& fileBrowserWildcard)
|
||||
: PropertyComponent (name)
|
||||
{
|
||||
addAndMakeVisible (filenameComp = new FilenameComponent (name,
|
||||
File::nonexistent,
|
||||
allowEditingOfFilename,
|
||||
isDirectory,
|
||||
false,
|
||||
fileBrowserWildcard,
|
||||
String::empty,
|
||||
String::empty));
|
||||
|
||||
filenameComp->addListener (this);
|
||||
}
|
||||
|
||||
FilePropertyComponent::~FilePropertyComponent()
|
||||
{
|
||||
deleteAllChildren();
|
||||
}
|
||||
|
||||
void FilePropertyComponent::refresh()
|
||||
{
|
||||
filenameComp->setCurrentFile (getFile(), false);
|
||||
}
|
||||
|
||||
void FilePropertyComponent::filenameComponentChanged (FilenameComponent*)
|
||||
{
|
||||
if (getFile() != filenameComp->getCurrentFile())
|
||||
setFile (filenameComp->getCurrentFile());
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_FILEPROPERTYCOMPONENT_JUCEHEADER__
|
||||
#define __JUCER_FILEPROPERTYCOMPONENT_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class FilePropertyComponent : public PropertyComponent,
|
||||
public FilenameComponentListener
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
FilePropertyComponent (const String& name,
|
||||
const bool isDirectory,
|
||||
const bool allowEditingOfFilename,
|
||||
const String& fileBrowserWildcard = "*");
|
||||
|
||||
~FilePropertyComponent();
|
||||
|
||||
|
||||
//==============================================================================
|
||||
virtual void setFile (const File& newFile) = 0;
|
||||
virtual File getFile() const = 0;
|
||||
|
||||
//==============================================================================
|
||||
void refresh();
|
||||
void filenameComponentChanged (FilenameComponent*);
|
||||
|
||||
private:
|
||||
FilenameComponent* filenameComp;
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCER_FILEPROPERTYCOMPONENT_JUCEHEADER__
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../jucer_Headers.h"
|
||||
#include "jucer_FontPropertyComponent.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
class FontList : private DeletedAtShutdown
|
||||
{
|
||||
public:
|
||||
FontList()
|
||||
{
|
||||
Array<Font> fonts;
|
||||
Font::findFonts (fonts);
|
||||
|
||||
for (int i = 0; i < fonts.size(); ++i)
|
||||
fontNames.add (fonts[i].getTypefaceName());
|
||||
}
|
||||
|
||||
~FontList()
|
||||
{
|
||||
clearSingletonInstance();
|
||||
}
|
||||
|
||||
juce_DeclareSingleton_SingleThreaded_Minimal (FontList)
|
||||
|
||||
StringArray fontNames;
|
||||
};
|
||||
|
||||
juce_ImplementSingleton_SingleThreaded (FontList)
|
||||
|
||||
void FontPropertyComponent::preloadAllFonts()
|
||||
{
|
||||
FontList::getInstance();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String FontPropertyComponent::defaultFont ("Default font");
|
||||
const String FontPropertyComponent::defaultSans ("Default sans-serif font");
|
||||
const String FontPropertyComponent::defaultSerif ("Default serif font");
|
||||
const String FontPropertyComponent::defaultMono ("Default monospaced font");
|
||||
|
||||
FontPropertyComponent::FontPropertyComponent (const String& name)
|
||||
: ChoicePropertyComponent (name)
|
||||
{
|
||||
choices.add (defaultFont);
|
||||
choices.add (defaultSans);
|
||||
choices.add (defaultSerif);
|
||||
choices.add (defaultMono);
|
||||
choices.add (String::empty);
|
||||
|
||||
choices.addArray (FontList::getInstance()->fontNames);
|
||||
}
|
||||
|
||||
FontPropertyComponent::~FontPropertyComponent()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void FontPropertyComponent::setIndex (const int newIndex)
|
||||
{
|
||||
String type (choices [newIndex]);
|
||||
|
||||
if (type.isEmpty())
|
||||
type = defaultFont;
|
||||
|
||||
if (getTypefaceName() != type)
|
||||
setTypefaceName (type);
|
||||
}
|
||||
|
||||
int FontPropertyComponent::getIndex() const
|
||||
{
|
||||
return choices.indexOf (getTypefaceName());
|
||||
}
|
||||
|
||||
const Font FontPropertyComponent::applyNameToFont (const String& typefaceName, const Font& font)
|
||||
{
|
||||
if (typefaceName == defaultFont)
|
||||
return Font (font.getHeight(), font.getStyleFlags());
|
||||
else if (typefaceName == defaultSans)
|
||||
return Font (Font::getDefaultSansSerifFontName(), font.getHeight(), font.getStyleFlags());
|
||||
else if (typefaceName == defaultSerif)
|
||||
return Font (Font::getDefaultSerifFontName(), font.getHeight(), font.getStyleFlags());
|
||||
else if (typefaceName == defaultMono)
|
||||
return Font (Font::getDefaultMonospacedFontName(), font.getHeight(), font.getStyleFlags());
|
||||
|
||||
return Font (typefaceName, font.getHeight(), font.getStyleFlags());
|
||||
}
|
||||
|
||||
const String FontPropertyComponent::getTypefaceNameCode (const String& typefaceName)
|
||||
{
|
||||
if (typefaceName == defaultFont)
|
||||
return String::empty;
|
||||
else if (typefaceName == defaultSans)
|
||||
return "Font::getDefaultSansSerifFontName(), ";
|
||||
else if (typefaceName == defaultSerif)
|
||||
return "Font::getDefaultSerifFontName(), ";
|
||||
else if (typefaceName == defaultMono)
|
||||
return "Font::getDefaultMonospacedFontName(), ";
|
||||
|
||||
return "\"" + typefaceName + "\", ";
|
||||
}
|
||||
|
||||
const String FontPropertyComponent::getFontStyleCode (const Font& font)
|
||||
{
|
||||
if (font.isBold() && font.isItalic())
|
||||
return "Font::bold | Font::italic";
|
||||
else if (font.isBold())
|
||||
return "Font::bold";
|
||||
else if (font.isItalic())
|
||||
return "Font::italic";
|
||||
|
||||
return "Font::plain";
|
||||
}
|
||||
|
||||
const String FontPropertyComponent::getCompleteFontCode (const Font& font, const String& typefaceName)
|
||||
{
|
||||
return "Font ("
|
||||
+ getTypefaceNameCode (typefaceName)
|
||||
+ valueToFloat (font.getHeight())
|
||||
+ ", "
|
||||
+ getFontStyleCode (font)
|
||||
+ ")";
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
|
||||
Permission is granted to use this software under the terms of either:
|
||||
a) the GPL v2 (or any later version)
|
||||
b) the Affero GPL v3
|
||||
|
||||
Details of these licenses can be found 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.juce.com for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCER_FONTPROPERTYCOMPONENT_JUCEHEADER__
|
||||
#define __JUCER_FONTPROPERTYCOMPONENT_JUCEHEADER__
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class FontPropertyComponent : public ChoicePropertyComponent
|
||||
{
|
||||
public:
|
||||
FontPropertyComponent (const String& name);
|
||||
~FontPropertyComponent();
|
||||
|
||||
//==============================================================================
|
||||
static const String defaultFont;
|
||||
static const String defaultSans;
|
||||
static const String defaultSerif;
|
||||
static const String defaultMono;
|
||||
|
||||
static void preloadAllFonts();
|
||||
|
||||
virtual void setTypefaceName (const String& newFontName) = 0;
|
||||
virtual String getTypefaceName() const = 0;
|
||||
|
||||
static const Font applyNameToFont (const String& typefaceName, const Font& font);
|
||||
static const String getTypefaceNameCode (const String& typefaceName);
|
||||
static const String getFontStyleCode (const Font& font);
|
||||
|
||||
static const String getCompleteFontCode (const Font& font, const String& typefaceName);
|
||||
|
||||
//==============================================================================
|
||||
void setIndex (int newIndex);
|
||||
int getIndex() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __JUCER_FONTPROPERTYCOMPONENT_JUCEHEADER__
|
||||