├── .gitattributes ├── .gitignore ├── Builds └── Prototype.app │ └── Contents │ ├── Info.plist │ ├── MacOS │ └── Prototype │ ├── PkgInfo │ └── Resources │ ├── AlignBottom.png │ ├── AlignCenter.png │ ├── AlignLeft.png │ ├── AlignMiddle.png │ ├── AlignRight.png │ ├── AlignTop.png │ ├── Alignment_center.png │ ├── Alignment_justified.png │ ├── Alignment_left.png │ ├── Alignment_right.png │ ├── ArrangeBack.png │ ├── ArrangeBackwards.png │ ├── ArrangeFront.png │ ├── ArrangeFrontwards.png │ ├── COPYING │ ├── ColorPencil.qtz │ ├── DistributeBottom.png │ ├── DistributeCenter.png │ ├── DistributeLeft.png │ ├── DistributeMiddle.png │ ├── DistributeRight.png │ ├── DistributeTop.png │ ├── Document.nib │ ├── ExportSavePanelAccessoryView.nib │ ├── Group.png │ ├── IconPicker.nib │ ├── InfoPlist.strings │ ├── MKIOSTemplate.pdf │ ├── MKMacTemplate.pdf │ ├── MKWebTemplate.pdf │ ├── MainMenu.nib │ ├── MatchBoth.png │ ├── MatchHeight.png │ ├── MatchWidth.png │ ├── Menu.nib │ ├── Prototype-Info.plist │ ├── SpaceHorizontal.png │ ├── SpaceVertical.png │ ├── TexturedSliderPhotoLarge.tif │ ├── TexturedSliderPhotoSmall.tif │ ├── TexturedSliderSpeakerLoud.png │ ├── TexturedSliderSpeakerQuiet.png │ ├── TexturedSliderThumbN.tiff │ ├── TexturedSliderThumbP.tiff │ ├── TexturedSliderTrackFill.tiff │ ├── TexturedSliderTrackLeft.tiff │ ├── TexturedSliderTrackRight.tiff │ ├── Ungroup.png │ ├── WidgetTool.nib │ ├── darkdenim3.png │ ├── graybg_s1.png │ ├── icon_search.png │ ├── icon_tick.png │ ├── o.png │ └── sidebg_s1.png ├── LICENSE ├── Prototype.xcodeproj ├── markdodwell.mode1v3 ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── Prototype.xccheckout ├── Prototype_Prefix.pch ├── README.md ├── Resources ├── AlignBottom.png ├── AlignCenter.png ├── AlignLeft.png ├── AlignMiddle.png ├── AlignRight.png ├── AlignTop.png ├── Alignment_center.png ├── Alignment_justified.png ├── Alignment_left.png ├── Alignment_right.png ├── ArrangeBack.png ├── ArrangeBackwards.png ├── ArrangeFront.png ├── ArrangeFrontwards.png ├── ColorPencil.qtz ├── DistributeBottom.png ├── DistributeCenter.png ├── DistributeLeft.png ├── DistributeMiddle.png ├── DistributeRight.png ├── DistributeTop.png ├── Document.xib ├── ExportSavePanelAccessoryView.xib ├── Group.png ├── IconPicker.xib ├── InfoPlist.strings ├── MKIOSTemplate.pdf ├── MKMacTemplate.pdf ├── MKWebTemplate.pdf ├── MainMenu.xib ├── MatchBoth.png ├── MatchHeight.png ├── MatchWidth.png ├── Menu.xib ├── Prototype-Info.plist ├── SpaceHorizontal.png ├── SpaceVertical.png ├── TexturedSliderPhotoLarge.tif ├── TexturedSliderPhotoSmall.tif ├── TexturedSliderSpeakerLoud.png ├── TexturedSliderSpeakerQuiet.png ├── TexturedSliderThumbN.tiff ├── TexturedSliderThumbP.tiff ├── TexturedSliderTrackFill.tiff ├── TexturedSliderTrackLeft.tiff ├── TexturedSliderTrackRight.tiff ├── Ungroup.png ├── WidgetTool.xib ├── darkdenim3.png ├── graybg_s1.png ├── icon_search.png ├── icon_tick.png ├── o.png └── sidebg_s1.png ├── Samples ├── bootstrap.prototype ├── export.pdf └── export.png ├── Source ├── MKAlertDialogWidget.h ├── MKAlertDialogWidget.m ├── MKAppController.h ├── MKAppController.m ├── MKBrowserWindowWidget.h ├── MKBrowserWindowWidget.m ├── MKButtonWidget.h ├── MKButtonWidget.m ├── MKCenteringDocumentView.h ├── MKCenteringDocumentView.m ├── MKCheckbox.h ├── MKCheckbox.m ├── MKCheckboxWidget.h ├── MKCheckboxWidget.m ├── MKColorPickerView.h ├── MKColorPickerView.m ├── MKColorSwatchCell.h ├── MKColorSwatchCell.m ├── MKColorSwatchMatrix.h ├── MKColorSwatchMatrix.m ├── MKColorWell+Bindings.h ├── MKColorWell+Bindings.m ├── MKColorWell.h ├── MKColorWell.m ├── MKDocNameLabel.h ├── MKDocNameLabel.m ├── MKDocument.h ├── MKDocument.m ├── MKDrawView.h ├── MKDrawView.m ├── MKDropDownSelectWidget.h ├── MKDropDownSelectWidget.m ├── MKElement.h ├── MKElement.m ├── MKExportAccessoryView.h ├── MKExportAccessoryView.m ├── MKFont.h ├── MKFont.m ├── MKFractionToPercentTransformer.h ├── MKFractionToPercentTransformer.m ├── MKGroupWidget.h ├── MKGroupWidget.m ├── MKHeading1Widget.h ├── MKHeading1Widget.m ├── MKHeading2Widget.h ├── MKHeading2Widget.m ├── MKHeading3Widget.h ├── MKHeading3Widget.m ├── MKHeading4Widget.h ├── MKHeading4Widget.m ├── MKHeadingWidget.h ├── MKHeadingWidget.m ├── MKHierarchicalElement.h ├── MKHorizontalLineWidget.h ├── MKHorizontalLineWidget.m ├── MKHorizontalSliderWidget.h ├── MKHorizontalSliderWidget.m ├── MKIPhoneWidget.h ├── MKIPhoneWidget.m ├── MKIconPickerController.h ├── MKIconPickerController.m ├── MKImageElement.h ├── MKImageElement.m ├── MKImageWidget.h ├── MKImageWidget.m ├── MKLinkWidget.h ├── MKLinkWidget.m ├── MKMainSplitView.h ├── MKMainSplitView.m ├── MKMultipleLineTextWidget.h ├── MKMultipleLineTextWidget.m ├── MKOrderedListWidget.h ├── MKOrderedListWidget.m ├── MKOvalWidget.h ├── MKOvalWidget.m ├── MKPropertiesView.h ├── MKPropertiesView.m ├── MKPropertiesViewController.h ├── MKPropertiesViewController.m ├── MKPropertyView.h ├── MKPropertyView.m ├── MKRadioWidget.h ├── MKRadioWidget.m ├── MKRectangleWidget.h ├── MKRectangleWidget.m ├── MKRoundedRectElement.h ├── MKRoundedRectElement.m ├── MKSearchInputWidget.h ├── MKSearchInputWidget.m ├── MKSideView.h ├── MKSideView.m ├── MKSidebarLabel.h ├── MKSidebarLabel.m ├── MKSingleLineTextInputWidget.h ├── MKSingleLineTextInputWidget.m ├── MKSingleLineTextWidget.h ├── MKSingleLineTextWidget.m ├── MKTextElement.h ├── MKTextElement.m ├── MKTextMarkup.h ├── MKTextMarkup.m ├── MKToolsController.h ├── MKToolsController.m ├── MKTriangleElement.h ├── MKTriangleElement.m ├── MKUnorderedListWidget.h ├── MKUnorderedListWidget.m ├── MKVerticalLineWidget.h ├── MKVerticalLineWidget.m ├── MKVerticalSliderWidget.h ├── MKVerticalSliderWidget.m ├── MKVideoPlayerWidget.h ├── MKVideoPlayerWidget.m ├── MKWidget.h ├── MKWidget.m ├── MKWidgetElement.h ├── MKWidgetElement.m ├── MKWidgetToolCollectionView.h ├── MKWidgetToolCollectionView.m ├── MKWidgetToolView.h ├── MKWidgetToolView.m ├── MKWindow.h ├── MKWindow.m ├── MKWindowContentView.h ├── MKWindowContentView.m ├── MKWindowController+Align.h ├── MKWindowController+Align.m ├── MKWindowController+Arrange.h ├── MKWindowController+Arrange.m ├── MKWindowController+Distribute.h ├── MKWindowController+Distribute.m ├── MKWindowController+Group.h ├── MKWindowController+Group.m ├── MKWindowController+Nudge.h ├── MKWindowController+Nudge.m ├── MKWindowController+Pasteboard.h ├── MKWindowController+Pasteboard.m ├── MKWindowController+Size.h ├── MKWindowController+Size.m ├── MKWindowController+Space.h ├── MKWindowController+Space.m ├── MKWindowController.h ├── MKWindowController.m ├── MKWindowDragSplitView.h ├── MKWindowDragSplitView.m ├── MKWindowDragView.h ├── MKWindowDragView.m ├── MKWindowWidget.h └── MKWindowWidget.m ├── Vendor ├── BWTexturedSlider.h ├── BWTexturedSlider.m ├── BWTexturedSliderCell.h ├── BWTexturedSliderCell.m ├── INAppStoreWindow.h ├── INAppStoreWindow.m ├── JLNDragEffectManager.h ├── JLNDragEffectManager.m ├── LTPixelAlign.h ├── LTPixelAlign.m ├── MKZoomView.h ├── MKZoomView.m ├── NSAttributedString+Metrics.h ├── NSAttributedString+Metrics.m ├── NSMainScrollView.h ├── NSMainScrollView.m ├── NSToolbarDivider.h ├── NSToolbarDivider.m ├── OnigRegexp.h ├── OnigRegexp.m ├── OnigRegexpUtility.h ├── OnigRegexpUtility.m ├── PrioritySplitViewDelegate.h ├── PrioritySplitViewDelegate.m └── oniguruma │ ├── COPYING │ ├── config.h │ ├── enc │ ├── ascii.c │ ├── unicode.c │ └── utf16_le.c │ ├── oniguruma.h │ ├── regcomp.c │ ├── regenc.c │ ├── regenc.h │ ├── regerror.c │ ├── regexec.c │ ├── regext.c │ ├── regint.h │ ├── regparse.c │ ├── regparse.h │ ├── regsyntax.c │ ├── regtrav.c │ ├── regversion.c │ ├── st.c │ └── st.h └── main.m /.gitattributes: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.pyc 3 | *~.nib 4 | *.pbxuser 5 | *.perspective 6 | *.perspectivev3 7 | *.mode2v3 8 | xcuserdata -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 12F45 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleDocumentTypes 10 | 11 | 12 | CFBundleTypeExtensions 13 | 14 | prototype 15 | 16 | CFBundleTypeName 17 | Prototype drawing 18 | CFBundleTypeOSTypes 19 | 20 | .prototype 21 | 22 | CFBundleTypeRole 23 | Editor 24 | NSDocumentClass 25 | MKDocument 26 | 27 | 28 | CFBundleExecutable 29 | Prototype 30 | CFBundleIdentifier 31 | com.mkdynamic.Prototype 32 | CFBundleInfoDictionaryVersion 33 | 6.0 34 | CFBundleName 35 | Prototype 36 | CFBundlePackageType 37 | APPL 38 | CFBundleShortVersionString 39 | 1.0 40 | CFBundleSignature 41 | MK 42 | CFBundleVersion 43 | 1 44 | DTCompiler 45 | com.apple.compilers.llvm.clang.1_0 46 | DTPlatformBuild 47 | 5A3005 48 | DTPlatformVersion 49 | GM 50 | DTSDKBuild 51 | 13A595 52 | DTSDKName 53 | macosx10.9 54 | DTXcode 55 | 0502 56 | DTXcodeBuild 57 | 5A3005 58 | LSMinimumSystemVersion 59 | 10.7 60 | NSMainNibFile 61 | MainMenu 62 | NSPrincipalClass 63 | NSApplication 64 | 65 | 66 | -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/MacOS/Prototype: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/MacOS/Prototype -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/AlignBottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/AlignBottom.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/AlignCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/AlignCenter.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/AlignLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/AlignLeft.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/AlignMiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/AlignMiddle.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/AlignRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/AlignRight.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/AlignTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/AlignTop.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Alignment_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Alignment_center.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Alignment_justified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Alignment_justified.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Alignment_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Alignment_left.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Alignment_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Alignment_right.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/ArrangeBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/ArrangeBack.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/ArrangeBackwards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/ArrangeBackwards.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/ArrangeFront.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/ArrangeFront.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/ArrangeFrontwards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/ArrangeFrontwards.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/COPYING: -------------------------------------------------------------------------------- 1 | Oniguruma LICENSE 2 | ----------------- 3 | 4 | /*- 5 | * Copyright (c) 2002-2007 K.Kosako 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | */ 29 | -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/ColorPencil.qtz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/ColorPencil.qtz -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/DistributeBottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/DistributeBottom.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/DistributeCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/DistributeCenter.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/DistributeLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/DistributeLeft.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/DistributeMiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/DistributeMiddle.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/DistributeRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/DistributeRight.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/DistributeTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/DistributeTop.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Document.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Document.nib -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/ExportSavePanelAccessoryView.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/ExportSavePanelAccessoryView.nib -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Group.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/IconPicker.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/IconPicker.nib -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/InfoPlist.strings -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/MKIOSTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/MKIOSTemplate.pdf -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/MKMacTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/MKMacTemplate.pdf -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/MKWebTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/MKWebTemplate.pdf -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/MainMenu.nib -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/MatchBoth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/MatchBoth.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/MatchHeight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/MatchHeight.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/MatchWidth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/MatchWidth.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Menu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Menu.nib -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Prototype-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | prototype 13 | 14 | CFBundleTypeIconFile 15 | 16 | CFBundleTypeName 17 | Prototype drawing 18 | CFBundleTypeOSTypes 19 | 20 | .prototype 21 | 22 | CFBundleTypeRole 23 | Editor 24 | NSDocumentClass 25 | MKDocument 26 | 27 | 28 | CFBundleExecutable 29 | ${EXECUTABLE_NAME} 30 | CFBundleIconFile 31 | 32 | CFBundleIdentifier 33 | com.mkdynamic.Prototype 34 | CFBundleInfoDictionaryVersion 35 | 6.0 36 | CFBundleName 37 | ${PRODUCT_NAME} 38 | CFBundlePackageType 39 | APPL 40 | CFBundleShortVersionString 41 | 1.0 42 | CFBundleSignature 43 | MK 44 | CFBundleVersion 45 | 1 46 | LSMinimumSystemVersion 47 | ${MACOSX_DEPLOYMENT_TARGET} 48 | NSMainNibFile 49 | MainMenu 50 | NSPrincipalClass 51 | NSApplication 52 | 53 | 54 | -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/SpaceHorizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/SpaceHorizontal.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/SpaceVertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/SpaceVertical.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderPhotoLarge.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderPhotoLarge.tif -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderPhotoSmall.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderPhotoSmall.tif -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderSpeakerLoud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderSpeakerLoud.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderSpeakerQuiet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderSpeakerQuiet.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderThumbN.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderThumbN.tiff -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderThumbP.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderThumbP.tiff -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderTrackFill.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderTrackFill.tiff -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderTrackLeft.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderTrackLeft.tiff -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/TexturedSliderTrackRight.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/TexturedSliderTrackRight.tiff -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/Ungroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/Ungroup.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/WidgetTool.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/WidgetTool.nib -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/darkdenim3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/darkdenim3.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/graybg_s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/graybg_s1.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/icon_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/icon_search.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/icon_tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/icon_tick.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/o.png -------------------------------------------------------------------------------- /Builds/Prototype.app/Contents/Resources/sidebg_s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Builds/Prototype.app/Contents/Resources/sidebg_s1.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Mark Dodwell. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | -------------------------------------------------------------------------------- /Prototype.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Prototype.xcodeproj/project.xcworkspace/xcshareddata/Prototype.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 81764A09-885F-4BF3-8132-0928AD2DB060 9 | IDESourceControlProjectName 10 | Prototype 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | C3BF9635-BD31-4033-B27E-2D7C886AFC7C 14 | ssh://github.com/mkdynamic/prototype 15 | 16 | IDESourceControlProjectPath 17 | Prototype.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | C3BF9635-BD31-4033-B27E-2D7C886AFC7C 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/mkdynamic/prototype 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | C3BF9635-BD31-4033-B27E-2D7C886AFC7C 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | C3BF9635-BD31-4033-B27E-2D7C886AFC7C 36 | IDESourceControlWCCName 37 | prototype 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Prototype_Prefix.pch: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #ifdef __OBJC__ 17 | #import 18 | #endif 19 | -------------------------------------------------------------------------------- /Resources/AlignBottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/AlignBottom.png -------------------------------------------------------------------------------- /Resources/AlignCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/AlignCenter.png -------------------------------------------------------------------------------- /Resources/AlignLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/AlignLeft.png -------------------------------------------------------------------------------- /Resources/AlignMiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/AlignMiddle.png -------------------------------------------------------------------------------- /Resources/AlignRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/AlignRight.png -------------------------------------------------------------------------------- /Resources/AlignTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/AlignTop.png -------------------------------------------------------------------------------- /Resources/Alignment_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/Alignment_center.png -------------------------------------------------------------------------------- /Resources/Alignment_justified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/Alignment_justified.png -------------------------------------------------------------------------------- /Resources/Alignment_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/Alignment_left.png -------------------------------------------------------------------------------- /Resources/Alignment_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/Alignment_right.png -------------------------------------------------------------------------------- /Resources/ArrangeBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/ArrangeBack.png -------------------------------------------------------------------------------- /Resources/ArrangeBackwards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/ArrangeBackwards.png -------------------------------------------------------------------------------- /Resources/ArrangeFront.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/ArrangeFront.png -------------------------------------------------------------------------------- /Resources/ArrangeFrontwards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/ArrangeFrontwards.png -------------------------------------------------------------------------------- /Resources/ColorPencil.qtz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/ColorPencil.qtz -------------------------------------------------------------------------------- /Resources/DistributeBottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/DistributeBottom.png -------------------------------------------------------------------------------- /Resources/DistributeCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/DistributeCenter.png -------------------------------------------------------------------------------- /Resources/DistributeLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/DistributeLeft.png -------------------------------------------------------------------------------- /Resources/DistributeMiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/DistributeMiddle.png -------------------------------------------------------------------------------- /Resources/DistributeRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/DistributeRight.png -------------------------------------------------------------------------------- /Resources/DistributeTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/DistributeTop.png -------------------------------------------------------------------------------- /Resources/Group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/Group.png -------------------------------------------------------------------------------- /Resources/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Resources/MKIOSTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/MKIOSTemplate.pdf -------------------------------------------------------------------------------- /Resources/MKMacTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/MKMacTemplate.pdf -------------------------------------------------------------------------------- /Resources/MKWebTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/MKWebTemplate.pdf -------------------------------------------------------------------------------- /Resources/MatchBoth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/MatchBoth.png -------------------------------------------------------------------------------- /Resources/MatchHeight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/MatchHeight.png -------------------------------------------------------------------------------- /Resources/MatchWidth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/MatchWidth.png -------------------------------------------------------------------------------- /Resources/Prototype-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | prototype 13 | 14 | CFBundleTypeIconFile 15 | 16 | CFBundleTypeName 17 | Prototype drawing 18 | CFBundleTypeOSTypes 19 | 20 | .prototype 21 | 22 | CFBundleTypeRole 23 | Editor 24 | NSDocumentClass 25 | MKDocument 26 | 27 | 28 | CFBundleExecutable 29 | ${EXECUTABLE_NAME} 30 | CFBundleIconFile 31 | 32 | CFBundleIdentifier 33 | com.mkdynamic.Prototype 34 | CFBundleInfoDictionaryVersion 35 | 6.0 36 | CFBundleName 37 | ${PRODUCT_NAME} 38 | CFBundlePackageType 39 | APPL 40 | CFBundleShortVersionString 41 | 1.0 42 | CFBundleSignature 43 | MK 44 | CFBundleVersion 45 | 1 46 | LSMinimumSystemVersion 47 | ${MACOSX_DEPLOYMENT_TARGET} 48 | NSMainNibFile 49 | MainMenu 50 | NSPrincipalClass 51 | NSApplication 52 | 53 | 54 | -------------------------------------------------------------------------------- /Resources/SpaceHorizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/SpaceHorizontal.png -------------------------------------------------------------------------------- /Resources/SpaceVertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/SpaceVertical.png -------------------------------------------------------------------------------- /Resources/TexturedSliderPhotoLarge.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderPhotoLarge.tif -------------------------------------------------------------------------------- /Resources/TexturedSliderPhotoSmall.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderPhotoSmall.tif -------------------------------------------------------------------------------- /Resources/TexturedSliderSpeakerLoud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderSpeakerLoud.png -------------------------------------------------------------------------------- /Resources/TexturedSliderSpeakerQuiet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderSpeakerQuiet.png -------------------------------------------------------------------------------- /Resources/TexturedSliderThumbN.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderThumbN.tiff -------------------------------------------------------------------------------- /Resources/TexturedSliderThumbP.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderThumbP.tiff -------------------------------------------------------------------------------- /Resources/TexturedSliderTrackFill.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderTrackFill.tiff -------------------------------------------------------------------------------- /Resources/TexturedSliderTrackLeft.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderTrackLeft.tiff -------------------------------------------------------------------------------- /Resources/TexturedSliderTrackRight.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/TexturedSliderTrackRight.tiff -------------------------------------------------------------------------------- /Resources/Ungroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/Ungroup.png -------------------------------------------------------------------------------- /Resources/darkdenim3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/darkdenim3.png -------------------------------------------------------------------------------- /Resources/graybg_s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/graybg_s1.png -------------------------------------------------------------------------------- /Resources/icon_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/icon_search.png -------------------------------------------------------------------------------- /Resources/icon_tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/icon_tick.png -------------------------------------------------------------------------------- /Resources/o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/o.png -------------------------------------------------------------------------------- /Resources/sidebg_s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Resources/sidebg_s1.png -------------------------------------------------------------------------------- /Samples/bootstrap.prototype: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Samples/bootstrap.prototype -------------------------------------------------------------------------------- /Samples/export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Samples/export.pdf -------------------------------------------------------------------------------- /Samples/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkdynamic/prototype/ecdf1f888f890f59e20fd9dca8b0d44441181b44/Samples/export.png -------------------------------------------------------------------------------- /Source/MKAlertDialogWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowWidget.h" 17 | 18 | @interface MKAlertDialogWidget : MKWindowWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKAlertDialogWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKAlertDialogWidget.h" 17 | #import "MKWidgetElement.h" 18 | #import "MKButtonWidget.h" 19 | 20 | @implementation MKAlertDialogWidget 21 | 22 | - (id)init 23 | { 24 | if ((self = [super init])) { 25 | text = @"Alert Dialog"; 26 | 27 | MKButtonWidget *button = [[MKButtonWidget alloc] init]; 28 | MKWidgetElement *buttonEl = [[MKWidgetElement alloc] init]; 29 | buttonEl.groupedWidget = button; 30 | [self addSubelement:buttonEl]; 31 | } 32 | 33 | return self; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Source/MKAppController.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @class MKWindowController; 19 | @class MKIconPickerController; 20 | 21 | @interface MKAppController : NSObject { 22 | @private 23 | MKWindowController *docWindowController; 24 | MKIconPickerController *iconPickerController; 25 | } 26 | 27 | @property MKWindowController *docWindowController; 28 | @property MKIconPickerController *iconPickerController; 29 | 30 | - (IBAction)showIconPicker:(id)sender; 31 | + (uint)randomSeed; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/MKBrowserWindowWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKWidget.h" 18 | 19 | @class MKTextElement; 20 | 21 | @interface MKBrowserWindowWidget : MKWidget { 22 | @private 23 | NSString *textTitle; 24 | NSString *textUrl; 25 | MKTextElement *urlEl; 26 | MKTextElement *titleEl; 27 | } 28 | 29 | @property (copy) NSString *textTitle; 30 | @property (copy) NSString *textUrl; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/MKButtonWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKButtonWidget : MKWidget 19 | 20 | @property (copy) NSMutableDictionary *els; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/MKCenteringDocumentView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKCenteringDocumentView : NSView { 19 | @private 20 | NSView *documentView; 21 | } 22 | 23 | @property NSView *documentView; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/MKCheckbox.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKCheckbox : NSButton 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKCheckbox.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKCheckbox.h" 17 | #import "MKPropertiesView.h" 18 | 19 | @implementation MKCheckbox 20 | 21 | - (void)drawRect:(NSRect)dirtyRect 22 | { 23 | NSColor *color; 24 | 25 | if ([self isEnabled]) { 26 | color = MKLabelTextColor; 27 | } else { 28 | color = MKLabelTextColorDisabled; 29 | } 30 | 31 | NSFont *font = [NSFont fontWithName:MKLabelFontFamily size:MKLabelFontSize]; 32 | 33 | NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: 34 | [MKLabelTextShadow copy], NSShadowAttributeName, 35 | font, NSFontAttributeName, 36 | color, NSForegroundColorAttributeName, 37 | nil]; 38 | 39 | NSAttributedString *str = [[NSAttributedString alloc] initWithString:[self title] 40 | attributes:attributes]; 41 | 42 | [self setAttributedTitle:str]; 43 | 44 | [super drawRect:dirtyRect]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Source/MKCheckboxWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @class MKTextElement; 19 | @class MKImageElement; 20 | @class MKElement; 21 | @class MKRoundedRectElement; 22 | 23 | @interface MKCheckboxWidget : MKWidget 24 | 25 | @property MKTextElement *textEl; 26 | @property MKImageElement *checkOnEl; 27 | @property MKElement *checkMixedEl; 28 | @property MKRoundedRectElement *boxEl; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Source/MKColorPickerView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKColorPickerView : NSView { 19 | NSMatrix *matrix; 20 | } 21 | 22 | @property NSMatrix *matrix; 23 | 24 | - (id)initWithColors:(NSArray *)colors 25 | numberOfRows:(NSInteger)rows 26 | numberOfColumns:(NSInteger)columns 27 | swatchSize:(NSSize)size 28 | targetColorWell:(NSColorWell *)aTargetColorWell; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Source/MKColorSwatchCell.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKColorSwatchCell : NSCell { 19 | NSColor *color; 20 | } 21 | 22 | @property (copy) NSColor *color; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKColorSwatchCell.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKColorSwatchCell.h" 17 | 18 | @implementation MKColorSwatchCell 19 | 20 | @synthesize color; 21 | 22 | - (void)drawWithFrame:(NSRect)cellFrame 23 | inView:(NSMatrix *)controlView { 24 | [super drawWithFrame:cellFrame inView:controlView]; 25 | 26 | if ([color isEqualTo:[NSColor clearColor]]) { 27 | [[NSColor whiteColor] setFill]; 28 | NSRectFill(cellFrame); 29 | 30 | NSBezierPath *line = [NSBezierPath bezierPath]; 31 | [line moveToPoint:NSMakePoint(cellFrame.size.width, cellFrame.origin.y)]; 32 | [line lineToPoint:NSMakePoint(cellFrame.origin.x, cellFrame.size.height)]; 33 | [line setLineWidth:1.5]; 34 | [[NSColor redColor] setStroke]; 35 | 36 | [[NSGraphicsContext currentContext] saveGraphicsState]; 37 | [[NSBezierPath bezierPathWithRect:cellFrame] setClip]; 38 | [line stroke]; 39 | [[NSGraphicsContext currentContext] restoreGraphicsState]; 40 | } else { 41 | [color setFill]; 42 | NSRectFill(cellFrame); 43 | } 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Source/MKColorSwatchMatrix.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | @class MKColorSwatchCell; 18 | @class MKColorWell; 19 | 20 | @interface MKColorSwatchMatrix : NSMatrix { 21 | NSArray *colors; 22 | MKColorWell *targetColorWell; 23 | int colCount; 24 | } 25 | 26 | - (id)initWithFrame:(NSRect)frameRect 27 | numberOfRows:(NSInteger)rowsHigh 28 | numberOfColumns:(NSInteger)colsWide 29 | colors:(NSArray *)theColors 30 | targetColorWell:(MKColorWell *)aTargetColorWell; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/MKColorWell+Bindings.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKColorWell.h" 17 | 18 | @interface MKColorWell (Bindings) 19 | 20 | -(void)propagateValue:(id)value 21 | forBinding:(NSString*)binding; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/MKColorWell.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKColorWell : NSColorWell { 19 | NSPopover *popover; 20 | NSViewController *popoverViewController; 21 | NSView *popoverView; 22 | } 23 | 24 | @property (nonatomic, assign) BOOL animatePopover; 25 | 26 | - (void)setColorAndClose:(NSColor *)aColor; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Source/MKDocNameLabel.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKDocNameLabel : NSTextField 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKDocNameLabel.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKDocNameLabel.h" 17 | #import "MKPropertiesView.h" 18 | 19 | @implementation MKDocNameLabel 20 | 21 | - (void)awakeFromNib 22 | { 23 | NSFont *font = [NSFont fontWithName:MKLabelFontFamily size:10]; 24 | 25 | NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: 26 | [MKLabelTextShadow copy], NSShadowAttributeName, 27 | font, NSFontAttributeName, 28 | MKLabelTextColor, NSForegroundColorAttributeName, 29 | nil]; 30 | 31 | NSAttributedString *str = [[NSAttributedString alloc] initWithString:[self stringValue] 32 | attributes:attributes]; 33 | 34 | [self setAttributedStringValue:str]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Source/MKDocument.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | @class MKWidget; 18 | 19 | @interface MKDocument : NSDocument { 20 | @private 21 | NSMutableArray *_selection; 22 | NSArray *objects; 23 | } 24 | 25 | @property (copy) NSArray *objects; 26 | 27 | /* selection maintenance */ 28 | 29 | - (void)selectObject:(id)object; 30 | - (void)deselectObject:(id)object; 31 | - (void)selectAll; 32 | - (void)deselectAll; 33 | - (NSArray *)selection; 34 | 35 | /* undo machinary */ 36 | 37 | - (void)startObservingWidgetForUndo:(MKWidget *)widget; 38 | - (void)stopObservingWidgetForUndo:(MKWidget *)widget; 39 | 40 | /* print */ 41 | 42 | - (IBAction)printSelection:(id)sender; 43 | 44 | /* export */ 45 | 46 | - (IBAction)exportDocument:(id)sender; 47 | - (IBAction)exportSelection:(id)sender; 48 | - (void)changedExportFileFormat:(id)sender; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Source/MKDropDownSelectWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKWidget.h" 18 | 19 | @interface MKDropDownSelectWidget : MKWidget { 20 | @private 21 | 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKExportAccessoryView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKExportAccessoryView : NSView 19 | @property NSPopUpButton IBOutlet *fileType; 20 | @property NSSavePanel *savePanel; 21 | @end 22 | -------------------------------------------------------------------------------- /Source/MKExportAccessoryView.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKExportAccessoryView.h" 17 | 18 | @implementation MKExportAccessoryView 19 | 20 | - (id)initWithFrame:(NSRect)frame 21 | { 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | // Initialization code here. 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (void)drawRect:(NSRect)dirtyRect 31 | { 32 | // Drawing code here. 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Source/MKFont.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKFont : NSFont 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKFont.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKFont.h" 17 | 18 | @implementation MKFont 19 | - (CGFloat)underlineThickness 20 | { 21 | return 1.0f; 22 | } 23 | @end 24 | -------------------------------------------------------------------------------- /Source/MKFractionToPercentTransformer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKFractionToPercentTransformer : NSValueTransformer 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKGroupWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKWidget.h" 18 | 19 | 20 | @interface MKGroupWidget : MKWidget { 21 | @private 22 | NSArray *groupedWidgets; 23 | NSArrayController *arrayControler; 24 | } 25 | 26 | @property (copy) NSArray *groupedWidgets; 27 | 28 | - (void)setInitialGroupFrame:(NSRect)aFrame; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Source/MKHeading1Widget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeadingWidget.h" 17 | 18 | @interface MKHeading1Widget : MKHeadingWidget 19 | @end 20 | -------------------------------------------------------------------------------- /Source/MKHeading1Widget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeading1Widget.h" 17 | #import "MKTextElement.h" 18 | 19 | @implementation MKHeading1Widget 20 | + (void)load 21 | { 22 | [self registerKind:self]; 23 | } 24 | + (float)headingFontSize { 25 | return 36.f; 26 | } 27 | 28 | + (NSString *)headingText { 29 | return @"Heading 1"; 30 | } 31 | @end 32 | -------------------------------------------------------------------------------- /Source/MKHeading2Widget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeadingWidget.h" 17 | 18 | @interface MKHeading2Widget : MKHeadingWidget 19 | @end 20 | -------------------------------------------------------------------------------- /Source/MKHeading2Widget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeading2Widget.h" 17 | #import "MKTextElement.h" 18 | 19 | @implementation MKHeading2Widget 20 | + (void)load 21 | { 22 | [self registerKind:self]; 23 | } 24 | + (float)headingFontSize { 25 | return 30.f; 26 | } 27 | 28 | + (NSString *)headingText { 29 | return @"Heading 2"; 30 | } 31 | @end 32 | -------------------------------------------------------------------------------- /Source/MKHeading3Widget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeadingWidget.h" 17 | 18 | @interface MKHeading3Widget : MKHeadingWidget 19 | @end 20 | -------------------------------------------------------------------------------- /Source/MKHeading3Widget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeading3Widget.h" 17 | #import "MKTextElement.h" 18 | 19 | @implementation MKHeading3Widget 20 | + (void)load 21 | { 22 | [self registerKind:self]; 23 | } 24 | + (float)headingFontSize { 25 | return 24.f; 26 | } 27 | 28 | + (NSString *)headingText { 29 | return @"Heading 3"; 30 | } 31 | @end 32 | -------------------------------------------------------------------------------- /Source/MKHeading4Widget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeadingWidget.h" 17 | 18 | @interface MKHeading4Widget : MKHeadingWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKHeading4Widget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHeading4Widget.h" 17 | #import "MKTextElement.h" 18 | 19 | @implementation MKHeading4Widget 20 | + (void)load 21 | { 22 | [self registerKind:self]; 23 | } 24 | 25 | + (float)headingFontSize { 26 | return 18.f; 27 | } 28 | 29 | + (NSString *)headingText { 30 | return @"Heading 4"; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /Source/MKHeadingWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | @class MKTextElement; 18 | 19 | @interface MKHeadingWidget : MKWidget { 20 | @private 21 | MKTextElement *el; 22 | } 23 | 24 | + (float)headingFontSize; 25 | + (NSString *)headingText; 26 | @end 27 | -------------------------------------------------------------------------------- /Source/MKHierarchicalElement.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | @class MKWidget; 18 | 19 | @protocol MKHierarchicalElement 20 | @required 21 | 22 | @property (copy) NSMutableArray *subelements; 23 | @property NSRect frame; 24 | @property NSRect frameBase; 25 | @property MKWidget *root; 26 | 27 | - (void)addSubelement:(id )element; 28 | - (void)resizeSubelementsWithOldSize:(NSSize)oldSize; 29 | 30 | @optional 31 | 32 | @property id superelement; 33 | 34 | - (void)resizeWithOldSuperelementSize:(NSSize)oldSize; 35 | @end 36 | -------------------------------------------------------------------------------- /Source/MKHorizontalLineWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKHorizontalLineWidget : MKWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKHorizontalLineWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKHorizontalLineWidget.h" 17 | #import "MKElement.h" 18 | 19 | @implementation MKHorizontalLineWidget 20 | - (id)init 21 | { 22 | self = [super init]; 23 | 24 | if (self) { 25 | fixedHeight = 0.1; 26 | NSRect b = {.size = NSMakeSize(self.frame.size.width, fixedHeight)}; 27 | 28 | MKElement *el = [[MKElement alloc] initWithFrame:b withStroke:1 withFill:0]; 29 | NSBezierPath *p = [NSBezierPath bezierPath]; 30 | [p moveToPoint:NSZeroPoint]; 31 | [p lineToPoint:NSMakePoint(1, 0)]; 32 | el.path = p; 33 | [[el pin:@"Left", @"Right", nil] flex:@"Width", nil]; 34 | [self addSubelement:el]; 35 | } 36 | 37 | return self; 38 | } 39 | 40 | - (NSSize)defaultSize { 41 | return NSMakeSize(200, fixedHeight); 42 | } 43 | 44 | + (void)load 45 | { 46 | [self registerKind:self]; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /Source/MKHorizontalSliderWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | @class MKElement; 18 | 19 | @interface MKHorizontalSliderWidget : MKWidget 20 | @property MKElement *knobEl; 21 | @end 22 | -------------------------------------------------------------------------------- /Source/MKIPhoneWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKWidget.h" 18 | 19 | @interface MKIPhoneWidget : MKWidget { 20 | @private 21 | MKElement *barEl; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKIconPickerController.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKIconPickerController : NSWindowController { 19 | NSMutableArray *icons; 20 | } 21 | 22 | @property (copy) NSMutableArray *icons; 23 | 24 | - (IBAction)pickIcon:(id)sender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Source/MKImageElement.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKElement.h" 18 | 19 | @interface MKImageElement : MKElement { 20 | @private 21 | NSURL *url; 22 | NSImage *image; 23 | CIImage *srcImage; 24 | BOOL sketch; 25 | } 26 | 27 | @property (copy) NSURL *url; 28 | @property (copy) CIImage *srcImage; 29 | @property BOOL sketch; 30 | @end 31 | -------------------------------------------------------------------------------- /Source/MKImageWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKWidget.h" 18 | @class MKImageElement; 19 | 20 | @interface MKImageWidget : MKWidget { 21 | @private 22 | NSURL *imagePath; 23 | MKImageElement *imgEl; 24 | BOOL sketch; 25 | } 26 | 27 | @property (copy) NSURL *imagePath; 28 | @property BOOL sketch; 29 | @property MKImageElement *imgEl; 30 | @end 31 | -------------------------------------------------------------------------------- /Source/MKLinkWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKSingleLineTextWidget.h" 17 | 18 | @interface MKLinkWidget : MKSingleLineTextWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKLinkWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKLinkWidget.h" 17 | 18 | @implementation MKLinkWidget 19 | 20 | - (id)init 21 | { 22 | self = [super init]; 23 | if (self) { 24 | self.text = @""; 25 | } 26 | return self; 27 | } 28 | 29 | + (void)load 30 | { 31 | [self registerKind:self]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Source/MKMainSplitView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKMainSplitView : NSSplitView 19 | @end 20 | -------------------------------------------------------------------------------- /Source/MKMainSplitView.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKMainSplitView.h" 17 | 18 | @implementation MKMainSplitView 19 | -(void)drawRect:(NSRect)dirtyRect 20 | { 21 | [super drawRect:dirtyRect]; 22 | } 23 | 24 | - (void)drawDividerInRect:(NSRect)rect 25 | { 26 | NSBezierPath *p = [NSBezierPath bezierPathWithRect:rect]; 27 | [[NSColor colorWithDeviceWhite:0 alpha:0.25] setFill]; 28 | [p fill]; 29 | } 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/MKMultipleLineTextWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKMultipleLineTextWidget : MKWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKMultipleLineTextWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKMultipleLineTextWidget.h" 17 | #import "MKTextElement.h" 18 | #import "MKElement.h" 19 | 20 | @implementation MKMultipleLineTextWidget 21 | - (id)init 22 | { 23 | self = [super init]; 24 | 25 | if (self) { 26 | text = @"A wonderful paragraph of text, awesome and interesting some may say."; 27 | 28 | NSRect r = {NSZeroPoint, self.frame.size}; 29 | 30 | // MKElement *b = [[MKElement alloc] initWithFrame:r withStroke:100 withFill:0]; 31 | //[[b pin] flex]; 32 | // [self addSubelement:b]; 33 | 34 | 35 | MKTextElement *el = [[MKTextElement alloc] initWithFrame:r]; 36 | // el.lineBreakMode = NSLineBreakByTruncatingMiddle; 37 | [[el pin] flex]; 38 | [self addSubelement:el]; 39 | } 40 | 41 | return self; 42 | } 43 | 44 | - (NSSize)defaultSize 45 | { 46 | return NSMakeSize(225, 200); 47 | } 48 | 49 | - (BOOL)hasEditableText 50 | { 51 | return YES; 52 | } 53 | 54 | - (BOOL)editOnAdd { 55 | return NO; 56 | } 57 | 58 | + (void)load 59 | { 60 | [self registerKind:self]; 61 | } 62 | @end 63 | -------------------------------------------------------------------------------- /Source/MKOrderedListWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKMultipleLineTextWidget.h" 17 | 18 | @interface MKOrderedListWidget : MKMultipleLineTextWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKOrderedListWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKOrderedListWidget.h" 17 | 18 | @implementation MKOrderedListWidget 19 | - (id)init 20 | { 21 | if ((self = [super init])) { 22 | self.text = @"# List Item\n# List Item\n# List Item\n# List Item\n# List Item"; 23 | } 24 | 25 | return self; 26 | } 27 | 28 | + (void)load 29 | { 30 | [self registerKind:self]; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /Source/MKOvalWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKWidget.h" 18 | 19 | @interface MKOvalWidget : MKWidget { 20 | @private 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/MKOvalWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKOvalWidget.h" 17 | #import "MKElement.h" 18 | 19 | @implementation MKOvalWidget 20 | - (id)init { 21 | self = [super init]; 22 | if (self) { 23 | NSRect r = NSMakeRect(0, 0, self.frame.size.width, self.frame.size.height); 24 | 25 | // box 26 | MKElement *bgEl = [[MKElement alloc] initWithFrame:r withStroke:1 withFill:1]; 27 | [[bgEl pin:@"Top", @"Right", @"Bottom", @"Left", nil] flex:@"Width", @"Height", nil]; 28 | bgEl.path = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(0, 0, 1, 1)]; 29 | [self addSubelement:bgEl]; 30 | } 31 | 32 | return self; 33 | } 34 | 35 | + (void)load 36 | { 37 | [self registerKind:self]; 38 | } 39 | 40 | + (NSString *)filters 41 | { 42 | return @"ios mac web"; 43 | } 44 | @end 45 | -------------------------------------------------------------------------------- /Source/MKPropertiesView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | extern NSColor *MKLabelTextColor; 19 | extern NSColor *MKLabelTextColorDisabled; 20 | extern NSShadow *MKLabelTextShadow; 21 | extern float MKLabelFontSize; 22 | extern NSString *MKLabelFontFamily; 23 | 24 | @interface MKPropertiesView : NSView { 25 | IBOutlet NSColorWell *strokeColorWell; 26 | IBOutlet NSColorWell *fillColorWell; 27 | } 28 | 29 | @property NSColorWell *strokeColorWell; 30 | @property NSColorWell *fillColorWell; 31 | 32 | - (void)showPropertiesForWidgetKinds:(NSSet *)kinds; 33 | @end 34 | -------------------------------------------------------------------------------- /Source/MKPropertiesViewController.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKPropertiesViewController : NSViewController { 19 | @private 20 | IBOutlet NSSegmentedControl *fontStyles; 21 | } 22 | 23 | - (IBAction)fontStyleChanged:(id)sender; 24 | - (IBAction)chooseFile:(id)sender; 25 | - (IBAction)chooseIcon:(id)sender; 26 | - (IBAction)fillColorChanged:(id)sender; 27 | - (IBAction)strokeColorChanged:(id)sender; 28 | - (void)iconPicked:(NSNotification *)note; 29 | @end 30 | -------------------------------------------------------------------------------- /Source/MKPropertyView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKPropertyView : NSView { 19 | @private 20 | NSString *widgets; 21 | BOOL alwaysShow; 22 | } 23 | 24 | @property (copy) NSString *widgets; 25 | @property BOOL alwaysShow; 26 | @end 27 | -------------------------------------------------------------------------------- /Source/MKPropertyView.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKPropertyView.h" 17 | 18 | @implementation MKPropertyView 19 | 20 | @synthesize widgets, alwaysShow; 21 | - (void)awakeFromNib 22 | { 23 | self.autoresizingMask = NSViewMinXMargin | NSViewMaxXMargin | NSViewMaxYMargin | NSViewWidthSizable; 24 | } 25 | 26 | - (void)drawRect:(NSRect)dirtyRect 27 | { 28 | NSRect b = [self bounds]; 29 | b.size.height = 1; 30 | b.origin.y += 1; 31 | // [[NSColor orangeColor] setFill]; 32 | // NSRectFill(b); 33 | 34 | NSBezierPath *p = [NSBezierPath bezierPathWithRect:b]; 35 | 36 | [[NSColor colorWithDeviceWhite:0 alpha:0.075] setFill]; 37 | 38 | [p fill]; 39 | 40 | b.origin.y -= 1; 41 | 42 | p = [NSBezierPath bezierPathWithRect:b]; 43 | 44 | [[NSColor colorWithDeviceWhite:1 alpha:0.2] setFill]; 45 | 46 | [p fill]; 47 | 48 | 49 | } 50 | @end 51 | -------------------------------------------------------------------------------- /Source/MKRadioWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @class MKTextElement; 19 | @class MKElement; 20 | 21 | @interface MKRadioWidget : MKWidget 22 | @property MKTextElement *textEl; 23 | @property MKElement *checkEl; 24 | @property MKElement *outerEl; 25 | @end 26 | -------------------------------------------------------------------------------- /Source/MKRectangleWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | @class MKRoundedRectElement; 18 | 19 | @interface MKRectangleWidget : MKWidget 20 | @property MKRoundedRectElement *el; 21 | @end 22 | -------------------------------------------------------------------------------- /Source/MKRoundedRectElement.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKElement.h" 18 | 19 | @interface MKRoundedRectElement : MKElement { 20 | @private 21 | float radius; 22 | 23 | } 24 | 25 | @property float radius; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Source/MKRoundedRectElement.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKRoundedRectElement.h" 17 | 18 | @implementation MKRoundedRectElement 19 | @synthesize radius; 20 | 21 | - (id)init { 22 | self = [super init]; 23 | if (self) { 24 | radius = 10.f; 25 | } 26 | return self; 27 | } 28 | 29 | - (NSBezierPath *)path { 30 | if (self.radius > 0) { 31 | return [NSBezierPath bezierPathWithRoundedRect:[[super path] bounds] xRadius:self.radius yRadius:self.radius]; 32 | } else { 33 | return [super path]; 34 | } 35 | } 36 | @end 37 | -------------------------------------------------------------------------------- /Source/MKSearchInputWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKSearchInputWidget : MKWidget 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/MKSideView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKSideView : NSSplitView { 19 | IBOutlet NSScrollView *propertiesScrollView; 20 | IBOutlet NSView *propertiesView; 21 | } 22 | @end 23 | -------------------------------------------------------------------------------- /Source/MKSidebarLabel.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKSidebarLabel : NSTextField 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKSidebarLabel.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKSidebarLabel.h" 17 | #import "MKPropertiesView.h" 18 | 19 | @implementation MKSidebarLabel 20 | - (NSColor *)textColor 21 | { 22 | if ([self isEnabled]) { 23 | return MKLabelTextColor; 24 | } else { 25 | return MKLabelTextColorDisabled; 26 | } 27 | } 28 | 29 | - (void)drawRect:(NSRect)dirtyRect 30 | { 31 | NSFont *font = [NSFont fontWithName:MKLabelFontFamily size:MKLabelFontSize]; 32 | 33 | NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: 34 | [MKLabelTextShadow copy], NSShadowAttributeName, 35 | font, NSFontAttributeName, 36 | [self textColor], NSForegroundColorAttributeName, 37 | nil]; 38 | 39 | NSAttributedString *str = [[NSAttributedString alloc] initWithString:[self stringValue] 40 | attributes:attributes]; 41 | 42 | [self setAttributedStringValue:str]; 43 | 44 | 45 | [super drawRect:dirtyRect]; 46 | } 47 | @end 48 | -------------------------------------------------------------------------------- /Source/MKSingleLineTextInputWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKSingleLineTextInputWidget : MKWidget 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/MKSingleLineTextWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | @class MKTextElement; 18 | 19 | @interface MKSingleLineTextWidget : MKWidget { 20 | @private 21 | MKTextElement *el; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKTextMarkup.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKTextMarkup : NSObject 19 | + (void)markup:(NSMutableAttributedString *)aString; 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKToolsController.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKToolsController : NSWindowController { 19 | @private 20 | } 21 | 22 | //- (IBAction)selectionDidChange:(id)sender; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKToolsController.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKToolsController.h" 17 | 18 | @implementation MKToolsController 19 | - (void)awakeFromNib { 20 | [(NSPanel *)[self window] setFloatingPanel:YES]; 21 | [(NSPanel *)[self window] setBecomesKeyOnlyIfNeeded:YES]; 22 | } 23 | @end 24 | -------------------------------------------------------------------------------- /Source/MKTriangleElement.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKElement.h" 18 | 19 | @interface MKTriangleElement : MKElement { 20 | @private 21 | int direction; 22 | } 23 | 24 | @property int direction; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Source/MKTriangleElement.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKTriangleElement.h" 17 | 18 | @implementation MKTriangleElement 19 | 20 | @synthesize direction; 21 | 22 | - (NSBezierPath *)defaultPath { 23 | NSBezierPath *trianglePath = [NSBezierPath bezierPath]; 24 | NSPoint trianglePoints[3]; 25 | 26 | switch (direction) { 27 | case 1: // upwards 28 | trianglePoints[0] = NSMakePoint(0.5, 0); 29 | trianglePoints[1] = NSMakePoint(1, 1); 30 | trianglePoints[2] = NSMakePoint(0, 1); 31 | break; 32 | case 2: // downwards 33 | trianglePoints[0] = NSZeroPoint; 34 | trianglePoints[1] = NSMakePoint(1, 0); 35 | trianglePoints[2] = NSMakePoint(0.5, 1); 36 | break; 37 | case 3: // leftwards 38 | trianglePoints[0] = NSMakePoint(1, 0); 39 | trianglePoints[1] = NSMakePoint(1, 1); 40 | trianglePoints[2] = NSMakePoint(0, 0.5); 41 | break; 42 | default: // rightwards 43 | trianglePoints[0] = NSZeroPoint; 44 | trianglePoints[1] = NSMakePoint(1, 0.5); 45 | trianglePoints[2] = NSMakePoint(0, 1); 46 | break; 47 | } 48 | 49 | [trianglePath appendBezierPathWithPoints:trianglePoints count:3]; 50 | [trianglePath closePath]; 51 | 52 | return trianglePath; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Source/MKUnorderedListWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKMultipleLineTextWidget.h" 17 | 18 | @interface MKUnorderedListWidget : MKMultipleLineTextWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKUnorderedListWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKUnorderedListWidget.h" 17 | 18 | @implementation MKUnorderedListWidget 19 | - (id)init 20 | { 21 | if ((self = [super init])) { 22 | self.text = @"* List Item\n* List Item\n* List Item\n* List Item\n* List Item"; 23 | } 24 | 25 | return self; 26 | } 27 | 28 | + (void)load 29 | { 30 | [self registerKind:self]; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /Source/MKVerticalLineWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKVerticalLineWidget : MKWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKVerticalLineWidget.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKVerticalLineWidget.h" 17 | #import "MKElement.h" 18 | 19 | @implementation MKVerticalLineWidget 20 | - (id)init 21 | { 22 | self = [super init]; 23 | 24 | if (self) { 25 | fixedWidth = 0.1; 26 | 27 | NSRect b = {.size = NSMakeSize(0, self.frame.size.height)}; 28 | 29 | 30 | MKElement *el = [[MKElement alloc] initWithFrame:b withStroke:1 withFill:0]; 31 | [[el pin:@"Top", @"Bottom", nil] flex:@"Height", nil]; 32 | NSBezierPath *p = [NSBezierPath bezierPath]; 33 | [p moveToPoint:NSZeroPoint]; 34 | [p lineToPoint:NSMakePoint(0, 1)]; 35 | el.path = p; 36 | [self addSubelement:el]; 37 | } 38 | 39 | return self; 40 | } 41 | 42 | - (NSSize)defaultSize { 43 | return NSMakeSize(fixedWidth, 200); 44 | } 45 | 46 | + (void)load 47 | { 48 | [self registerKind:self]; 49 | } 50 | @end 51 | -------------------------------------------------------------------------------- /Source/MKVerticalSliderWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | @class MKElement; 18 | 19 | @interface MKVerticalSliderWidget : MKWidget 20 | @property MKElement *knobEl; 21 | @end 22 | -------------------------------------------------------------------------------- /Source/MKVideoPlayerWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKVideoPlayerWidget : MKWidget 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKWidgetElement.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | #import "MKElement.h" 18 | @class MKWidget; 19 | @class MKGroupWidget; 20 | 21 | @interface MKWidgetElement : MKElement { 22 | @private 23 | MKWidget *groupedWidget; 24 | MKGroupWidget *group; 25 | } 26 | 27 | @property (assign) MKWidget *groupedWidget; 28 | @property (assign) MKGroupWidget *group; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Source/MKWidgetElement.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidgetElement.h" 17 | #import "MKWidget.h" 18 | 19 | @implementation MKWidgetElement 20 | 21 | @synthesize groupedWidget, group; 22 | 23 | - (void)drawForWidget:(MKWidget *)widget { 24 | [groupedWidget drawRect:NSMakeRect(0, 0, FLT_MAX, FLT_MAX) withSelection:NO]; 25 | } 26 | 27 | - (void)setGroupedWidget:(MKWidget *)widget { 28 | widget.widgetElement = self; 29 | groupedWidget = widget; 30 | } 31 | 32 | /* NSCoding */ 33 | 34 | - (void)encodeWithCoder:(NSCoder *)coder { 35 | [coder encodeObject:[self groupedWidget] forKey:@"grouped_widget"]; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)coder { 39 | [self init]; 40 | [self setGroupedWidget:[coder decodeObjectForKey:@"grouped_widget"]]; 41 | 42 | return self; 43 | } 44 | 45 | /* NSCopying */ 46 | 47 | - (id)copyWithZone:(NSZone *)zone { 48 | MKWidgetElement *copy = [[[self class] allocWithZone:zone] init]; 49 | [copy setGroupedWidget:[[self groupedWidget] copyWithZone:zone]]; 50 | 51 | return copy; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Source/MKWidgetToolCollectionView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | 19 | @interface MKWidgetToolCollectionView : NSCollectionView { 20 | @private 21 | 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKWidgetToolCollectionView.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidgetToolCollectionView.h" 17 | #import "MKWidgetToolView.h" 18 | 19 | @implementation MKWidgetToolCollectionView 20 | 21 | - (void)awakeFromNib { 22 | [self setBackgroundColors:[NSArray arrayWithObject:[NSColor clearColor]]]; 23 | [self resizeSubviewsWithOldSize:[self bounds].size]; 24 | } 25 | 26 | - (BOOL)ignoreModifierKeysWhileDragging { 27 | return YES; 28 | } 29 | 30 | - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { 31 | return YES; 32 | } 33 | 34 | - (void)resizeSubviewsWithOldSize:(NSSize)oldSize { 35 | float size = floor([self bounds].size.width / [self maxNumberOfColumns]); 36 | [self setMinItemSize:NSMakeSize(size, size)]; 37 | [self setMaxItemSize:NSMakeSize(size, size)]; 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Source/MKWidgetToolView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @class MKWidget; 19 | 20 | @interface MKWidgetToolView : NSView { 21 | IBOutlet NSCollectionViewItem *delegate; 22 | @private 23 | NSString *kind; 24 | MKWidget *widget; 25 | NSImage *insideImg; 26 | NSImage *outsideImg; 27 | NSImage *img; 28 | 29 | } 30 | 31 | @property (copy) NSString *kind; 32 | @property (copy) MKWidget *widget; 33 | @property (copy) NSImage *insideImg; 34 | @property (copy) NSImage *outsideImg; 35 | @property (copy) NSImage *img; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Source/MKWindow.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKWindow : NSWindow { 19 | @private 20 | NSView *titleBarView; 21 | } 22 | 23 | @property NSView *titleBarView; 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKWindowContentView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKWindowContentView : NSView 19 | @end 20 | -------------------------------------------------------------------------------- /Source/MKWindowContentView.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowContentView.h" 17 | 18 | @implementation MKWindowContentView 19 | - (void)drawRect:(NSRect)dirtyRect 20 | { 21 | } 22 | @end 23 | -------------------------------------------------------------------------------- /Source/MKWindowController+Align.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Align) 19 | 20 | - (IBAction)alignLeft:(id)sender; 21 | - (IBAction)alignCenterHorizontal:(id)sender; 22 | - (IBAction)alignRight:(id)sender; 23 | - (IBAction)alignTop:(id)sender; 24 | - (IBAction)alignCenterVertical:(id)sender; 25 | - (IBAction)alignBottom:(id)sender; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Source/MKWindowController+Arrange.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Arrange) 19 | 20 | - (IBAction)bringToFront:(id)sender; 21 | - (IBAction)bringForward:(id)sender; 22 | - (IBAction)sendBackward:(id)sender; 23 | - (IBAction)sendToBack:(id)sender; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/MKWindowController+Distribute.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Distribute) 19 | 20 | - (IBAction)distributeLeftEdges:(id)sender; 21 | - (IBAction)distributeHorizontalCenters:(id)sender; 22 | - (IBAction)distributeRightEdges:(id)sender; 23 | - (IBAction)distributeTopEdges:(id)sender; 24 | - (IBAction)distributeVerticalCenters:(id)sender; 25 | - (IBAction)distributeBottomEdges:(id)sender; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Source/MKWindowController+Group.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Group) 19 | 20 | - (IBAction)group:(id)sender; 21 | - (IBAction)ungroup:(id)sender; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/MKWindowController+Nudge.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Nudge) 19 | 20 | - (IBAction)moveUp:(id)sender; 21 | - (IBAction)moveDown:(id)sender; 22 | - (IBAction)moveLeft:(id)sender; 23 | - (IBAction)moveRight:(id)sender; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/MKWindowController+Nudge.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController+Nudge.h" 17 | #import "MKWidget.h" 18 | 19 | #define NUDGE_AMOUNT 1 20 | #define SHIFT_NUDGE_AMOUNT 5 21 | 22 | @implementation MKWindowController (Nudge) 23 | 24 | - (IBAction)moveUp:(id)sender { 25 | for (MKWidget *widget in [self.graphicsController selectedObjects]) { 26 | widget.frame = NSOffsetRect(widget.frame, 0, -(shiftKey ? SHIFT_NUDGE_AMOUNT : NUDGE_AMOUNT)); 27 | } 28 | [[self docUndoManager] setActionName:@"Nudge Up"]; 29 | } 30 | 31 | - (IBAction)moveDown:(id)sender { 32 | for (MKWidget *widget in [self.graphicsController selectedObjects]) { 33 | widget.frame = NSOffsetRect(widget.frame, 0, shiftKey ? SHIFT_NUDGE_AMOUNT : NUDGE_AMOUNT); 34 | } 35 | [[self docUndoManager] setActionName:@"Nudge Down"]; 36 | } 37 | 38 | - (IBAction)moveLeft:(id)sender { 39 | for (MKWidget *widget in [self.graphicsController selectedObjects]) { 40 | widget.frame = NSOffsetRect(widget.frame, -(shiftKey ? SHIFT_NUDGE_AMOUNT : NUDGE_AMOUNT), 0); 41 | } 42 | [[self docUndoManager] setActionName:@"Nudge Left"]; 43 | } 44 | 45 | - (IBAction)moveRight:(id)sender { 46 | for (MKWidget *widget in [self.graphicsController selectedObjects]) { 47 | widget.frame = NSOffsetRect(widget.frame, shiftKey ? SHIFT_NUDGE_AMOUNT : NUDGE_AMOUNT, 0); 48 | } 49 | [[self docUndoManager] setActionName:@"Nudge Right"]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Source/MKWindowController+Pasteboard.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Pasteboard) 19 | 20 | - (IBAction)cut:(id)sender; 21 | - (IBAction)copy:(id)sender; 22 | - (IBAction)paste:(id)sender; 23 | - (IBAction)delete:(id)sender; 24 | 25 | - (IBAction)duplicate:(id)sender; 26 | 27 | - (IBAction)selectAll:(id)sender; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Source/MKWindowController+Size.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Size) 19 | 20 | - (IBAction)matchHeights:(id)sender; 21 | - (IBAction)matchWidths:(id)sender; 22 | - (IBAction)matchWidthsAndHeights:(id)sender; 23 | - (IBAction)resetToDefaultSize:(id)sender; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/MKWindowController+Space.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowController.h" 17 | 18 | @interface MKWindowController (Space) 19 | 20 | - (IBAction)spaceHorizontally:(id)sender; 21 | - (IBAction)spaceVertically:(id)sender; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/MKWindowDragSplitView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKWindowDragSplitView : NSSplitView { 19 | @private 20 | BOOL bottom; 21 | } 22 | 23 | @property BOOL bottom; 24 | @end 25 | -------------------------------------------------------------------------------- /Source/MKWindowDragSplitView.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWindowDragSplitView.h" 17 | 18 | @implementation MKWindowDragSplitView 19 | @synthesize bottom; 20 | 21 | - (id)init 22 | { 23 | self = [super init]; 24 | 25 | if (self) { 26 | bottom = NO; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)drawDividerInRect:(NSRect)rect 33 | { 34 | float opacity = 0.15; 35 | 36 | NSColor *startColor = [NSColor colorWithDeviceWhite:0 alpha:opacity * 0.5]; 37 | NSColor *endColor = [NSColor colorWithDeviceWhite:0 alpha:opacity]; 38 | NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:startColor 39 | endingColor:endColor]; 40 | [gradient drawInRect:rect angle:self.bottom ? -90 : 90]; 41 | 42 | rect.origin.x += 1; 43 | startColor = [NSColor colorWithDeviceWhite:1 alpha:opacity * 0.5]; 44 | endColor = [NSColor colorWithDeviceWhite:1 alpha:opacity]; 45 | gradient = [[NSGradient alloc] initWithStartingColor:startColor 46 | endingColor:endColor]; 47 | [gradient drawInRect:rect angle:self.bottom ? -90 : 90]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Source/MKWindowDragView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKWindowDragView : NSView 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/MKWindowWidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "MKWidget.h" 17 | 18 | @interface MKWindowWidget : MKWidget 19 | @property (copy) NSMutableDictionary *els; 20 | @end 21 | -------------------------------------------------------------------------------- /Vendor/BWTexturedSlider.h: -------------------------------------------------------------------------------- 1 | // 2 | // BWTexturedSlider.h 3 | // BWToolkit 4 | // 5 | // Created by Brandon Walkin (www.brandonwalkin.com) 6 | // All code is provided under the New BSD license. 7 | // 8 | 9 | #import 10 | 11 | @interface BWTexturedSlider : NSSlider 12 | { 13 | int trackHeight, indicatorIndex; 14 | NSRect sliderCellRect; 15 | NSButton *minButton, *maxButton; 16 | } 17 | 18 | @property int indicatorIndex; 19 | @property (retain) NSButton *minButton; 20 | @property (retain) NSButton *maxButton; 21 | 22 | - (int)trackHeight; 23 | - (void)setTrackHeight:(int)newTrackHeight; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Vendor/BWTexturedSliderCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // BWTexturedSliderCell.h 3 | // BWToolkit 4 | // 5 | // Created by Brandon Walkin (www.brandonwalkin.com) 6 | // All code is provided under the New BSD license. 7 | // 8 | 9 | #import 10 | 11 | @interface BWTexturedSliderCell : NSSliderCell 12 | { 13 | BOOL isPressed; 14 | int trackHeight; 15 | } 16 | 17 | @property int trackHeight; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Vendor/LTPixelAlign.h: -------------------------------------------------------------------------------- 1 | // 2 | // LTPixelAlign.h 3 | // 4 | // Created by Jacob Xiao on 10/21/09. 5 | // Copyright 2009 Like Thought. 6 | 7 | /* 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, 10 | publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to 11 | do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 18 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | */ 20 | 21 | #import 22 | 23 | @interface NSView (LTPixelAlign) 24 | 25 | - (CGFloat)pixelAlignStroke:(CGFloat)stroke; 26 | - (NSPoint)pixelAlignPoint:(NSPoint)point withStroke:(CGFloat)stroke; 27 | - (NSRect)pixelAlignRect:(NSRect)rect withStroke:(CGFloat)stroke; 28 | - (CGFloat)pixelAlignPixelizedHalfStroke:(CGFloat)stroke; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Vendor/MKZoomView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface MKZoomView : NSView { 19 | @private 20 | float scale; 21 | } 22 | 23 | @property float scale; 24 | @property (readonly) float minimumScale; 25 | @property (readonly) float maximumScale; 26 | 27 | - (IBAction)zoomIn:(id)sender; 28 | - (IBAction)zoomOut:(id)sender; 29 | - (IBAction)zoomToActualSize:(id)sender; 30 | - (IBAction)zoomFitInWindow:(id)sender; 31 | 32 | - (void)zoomViewByFactor:(float)factor; 33 | - (void)zoomViewToAbsoluteScale:(float)scale; 34 | - (void)zoomViewToFitRect:(NSRect)aRect; 35 | - (void)zoomViewToRect:(NSRect)aRect; 36 | - (void)zoomViewToPaddedRect:(NSRect)aRect; 37 | - (void)zoomViewByFactor:(float)factor andCentrePoint:(NSPoint)p; 38 | - (void)zoomWithScrollWheelDelta:(float) delta toCentrePoint:(NSPoint)cp; 39 | 40 | - (NSPoint)centredPointInDocView; 41 | - (void)scrollPointToCentre:(NSPoint)aPoint; 42 | 43 | - (float)minimumScale; 44 | - (float)maximumScale; 45 | 46 | - (void)performZoom:(float)aScale; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Vendor/NSAttributedString+Metrics.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface NSAttributedString (Metrics) 19 | - (NSSize)sizeWithSize:(NSSize)size; 20 | - (NSSize)sizeWithWidth:(CGFloat)width; 21 | - (NSSize)sizeWithHeight:(CGFloat)height; 22 | - (CGFloat)heightWithWidth:(CGFloat)width; 23 | - (CGFloat)widthWithHeight:(CGFloat)height; 24 | @end 25 | -------------------------------------------------------------------------------- /Vendor/NSAttributedString+Metrics.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "NSAttributedString+Metrics.h" 17 | 18 | @implementation NSAttributedString (Metrics) 19 | - (NSSize)sizeWithSize:(NSSize)size 20 | { 21 | // container 22 | NSTextContainer *container = [[[NSTextContainer alloc] initWithContainerSize:size] autorelease]; 23 | 24 | // layout manager 25 | NSLayoutManager *layoutManager = [[[NSLayoutManager alloc] init] autorelease]; 26 | [layoutManager addTextContainer:container]; 27 | 28 | // text store 29 | NSTextStorage *store = [[[NSTextStorage alloc] initWithAttributedString:self] autorelease]; 30 | [store addLayoutManager:layoutManager]; 31 | 32 | // trigger drawing 33 | [container setLineFragmentPadding:0.0]; // this is important 34 | [layoutManager setUsesFontLeading:NO]; 35 | (void) [layoutManager glyphRangeForTextContainer:container]; 36 | 37 | // return size 38 | return [layoutManager usedRectForTextContainer:container].size; 39 | } 40 | 41 | - (NSSize)sizeWithWidth:(CGFloat)width 42 | { 43 | return [self sizeWithSize:NSMakeSize(width, FLT_MAX)]; 44 | } 45 | 46 | - (NSSize)sizeWithHeight:(CGFloat)height 47 | { 48 | return [self sizeWithSize:NSMakeSize(FLT_MAX, height)]; 49 | } 50 | 51 | - (CGFloat)heightWithWidth:(CGFloat)width 52 | { 53 | return [self sizeWithWidth:width].height; 54 | } 55 | 56 | - (CGFloat)widthWithHeight:(CGFloat)height 57 | { 58 | return [self sizeWithHeight:height].width; 59 | } 60 | @end 61 | -------------------------------------------------------------------------------- /Vendor/NSMainScrollView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface NSMainScrollView : NSScrollView 19 | @end 20 | -------------------------------------------------------------------------------- /Vendor/NSToolbarDivider.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | @interface NSToolbarDivider : NSBox 19 | @end 20 | -------------------------------------------------------------------------------- /Vendor/NSToolbarDivider.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import "NSToolbarDivider.h" 17 | 18 | @implementation NSToolbarDivider 19 | - (id)initWithFrame:(NSRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | 23 | if (self) { 24 | // Initialization code here. 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (void)drawRect:(NSRect)dirtyRect 31 | { 32 | NSRect rect = [self bounds]; 33 | rect.size.width = 1; 34 | float opacity = 0.15; 35 | NSColor *startColor = [NSColor colorWithDeviceWhite:0 alpha:opacity * 0.5]; 36 | NSColor *endColor = [NSColor colorWithDeviceWhite:0 alpha:opacity]; 37 | NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:startColor 38 | endingColor:endColor]; 39 | [gradient drawInRect:rect angle:-90]; 40 | 41 | rect.origin.x += 1; 42 | startColor = [NSColor colorWithDeviceWhite:1 alpha:opacity * 0.5]; 43 | endColor = [NSColor colorWithDeviceWhite:1 alpha:opacity]; 44 | gradient = [[NSGradient alloc] initWithStartingColor:startColor 45 | endingColor:endColor]; 46 | [gradient drawInRect:rect angle:-90]; 47 | 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /Vendor/OnigRegexpUtility.h: -------------------------------------------------------------------------------- 1 | // CocoaOniguruma is copyrighted free software by Satoshi Nakagawa . 2 | // You can redistribute it and/or modify it under the new BSD license. 3 | 4 | #import 5 | #import "oniguruma.h" 6 | #import "OnigRegexp.h" 7 | 8 | 9 | @class OnigRegexp; 10 | @class OnigResult; 11 | 12 | 13 | @interface NSString (OnigRegexpUtility) 14 | 15 | // pattern is OnigRegexp or NSString 16 | 17 | - (NSRange)rangeOfRegexp:(id)pattern; 18 | 19 | // based on ruby's split 20 | 21 | - (NSArray*)split; 22 | - (NSArray*)splitByRegexp:(id)pattern; 23 | - (NSArray*)splitByRegexp:(id)pattern limit:(int)limit; 24 | 25 | // based on ruby's gsub 26 | 27 | - (NSString*)replaceByRegexp:(id)pattern with:(NSString*)string; 28 | - (NSString*)replaceAllByRegexp:(id)pattern with:(NSString*)string; 29 | 30 | - (NSString*)replaceByRegexp:(id)pattern withCallback:(id)object selector:(SEL)sel; 31 | - (NSString*)replaceAllByRegexp:(id)pattern withCallback:(id)object selector:(SEL)sel; 32 | 33 | #if defined(NS_BLOCKS_AVAILABLE) 34 | - (NSString*)replaceByRegexp:(id)pattern withBlock:(NSString* (^)(OnigResult*))block; 35 | - (NSString*)replaceAllByRegexp:(id)pattern withBlock:(NSString* (^)(OnigResult*))block; 36 | #endif 37 | 38 | @end 39 | 40 | 41 | @interface NSMutableString (OnigRegexpUtility) 42 | 43 | // pattern is OnigRegexp or NSString 44 | 45 | // based on ruby's gsub 46 | 47 | - (NSMutableString*)replaceByRegexp:(id)pattern with:(NSString*)string; 48 | - (NSMutableString*)replaceAllByRegexp:(id)pattern with:(NSString*)string; 49 | 50 | - (NSMutableString*)replaceByRegexp:(id)pattern withCallback:(id)object selector:(SEL)sel; 51 | - (NSMutableString*)replaceAllByRegexp:(id)pattern withCallback:(id)object selector:(SEL)sel; 52 | 53 | #if defined(NS_BLOCKS_AVAILABLE) 54 | - (NSMutableString*)replaceByRegexp:(id)pattern withBlock:(NSString* (^)(OnigResult*))block; 55 | - (NSMutableString*)replaceAllByRegexp:(id)pattern withBlock:(NSString* (^)(OnigResult*))block; 56 | #endif 57 | @end 58 | -------------------------------------------------------------------------------- /Vendor/PrioritySplitViewDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // PrioritySplitViewDelegate.m 3 | // ColumnSplitView 4 | // 5 | // Created by Matt Gallagher on 2009/09/01. 6 | // Copyright 2009 Matt Gallagher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PrioritySplitViewDelegate : NSObject { 12 | @private 13 | NSMutableDictionary *lengthsByViewIndex; 14 | NSMutableDictionary *viewIndicesByPriority; 15 | } 16 | - (void)setMinimumLength:(CGFloat)minLength 17 | forViewAtIndex:(NSInteger)viewIndex; 18 | - (void)setPriority:(NSInteger)priorityIndex 19 | forViewAtIndex:(NSInteger)viewIndex; 20 | @end 21 | -------------------------------------------------------------------------------- /Vendor/oniguruma/COPYING: -------------------------------------------------------------------------------- 1 | Oniguruma LICENSE 2 | ----------------- 3 | 4 | /*- 5 | * Copyright (c) 2002-2007 K.Kosako 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | */ 29 | -------------------------------------------------------------------------------- /Vendor/oniguruma/regversion.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | regversion.c - Oniguruma (regular expression library) 3 | **********************************************************************/ 4 | /*- 5 | * Copyright (c) 2002-2008 K.Kosako 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | */ 29 | 30 | #include "config.h" 31 | #include "oniguruma.h" 32 | #include 33 | 34 | extern const char* 35 | onig_version(void) 36 | { 37 | static char s[12]; 38 | 39 | sprintf(s, "%d.%d.%d", 40 | ONIGURUMA_VERSION_MAJOR, 41 | ONIGURUMA_VERSION_MINOR, 42 | ONIGURUMA_VERSION_TEENY); 43 | return s; 44 | } 45 | 46 | extern const char* 47 | onig_copyright(void) 48 | { 49 | static char s[58]; 50 | 51 | sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2008 K.Kosako", 52 | ONIGURUMA_VERSION_MAJOR, 53 | ONIGURUMA_VERSION_MINOR, 54 | ONIGURUMA_VERSION_TEENY); 55 | return s; 56 | } 57 | -------------------------------------------------------------------------------- /Vendor/oniguruma/st.h: -------------------------------------------------------------------------------- 1 | /* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */ 2 | 3 | /* @(#) st.h 5.1 89/12/14 */ 4 | 5 | #ifndef ST_INCLUDED 6 | 7 | #define ST_INCLUDED 8 | 9 | typedef unsigned long st_data_t; 10 | #define ST_DATA_T_DEFINED 11 | 12 | typedef struct st_table st_table; 13 | 14 | struct st_hash_type { 15 | int (*compare)(); 16 | int (*hash)(); 17 | }; 18 | 19 | struct st_table { 20 | struct st_hash_type *type; 21 | int num_bins; 22 | int num_entries; 23 | struct st_table_entry **bins; 24 | }; 25 | 26 | #define st_is_member(table,key) st_lookup(table,key,(st_data_t *)0) 27 | 28 | enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK}; 29 | 30 | #ifndef _ 31 | # define _(args) args 32 | #endif 33 | #ifndef ANYARGS 34 | # ifdef __cplusplus 35 | # define ANYARGS ... 36 | # else 37 | # define ANYARGS 38 | # endif 39 | #endif 40 | 41 | st_table *st_init_table _((struct st_hash_type *)); 42 | st_table *st_init_table_with_size _((struct st_hash_type *, int)); 43 | st_table *st_init_numtable _((void)); 44 | st_table *st_init_numtable_with_size _((int)); 45 | st_table *st_init_strtable _((void)); 46 | st_table *st_init_strtable_with_size _((int)); 47 | int st_delete _((st_table *, st_data_t *, st_data_t *)); 48 | int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t)); 49 | int st_insert _((st_table *, st_data_t, st_data_t)); 50 | int st_lookup _((st_table *, st_data_t, st_data_t *)); 51 | int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t)); 52 | void st_add_direct _((st_table *, st_data_t, st_data_t)); 53 | void st_free_table _((st_table *)); 54 | void st_cleanup_safe _((st_table *, st_data_t)); 55 | st_table *st_copy _((st_table *)); 56 | 57 | #define ST_NUMCMP ((int (*)()) 0) 58 | #define ST_NUMHASH ((int (*)()) -2) 59 | 60 | #define st_numcmp ST_NUMCMP 61 | #define st_numhash ST_NUMHASH 62 | 63 | #endif /* ST_INCLUDED */ 64 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Mark Dodwell. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 6 | // permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // 8 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | // Software. 10 | // 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | #import 17 | 18 | int main(int argc, char *argv[]) 19 | { 20 | return NSApplicationMain(argc, (const char **) argv); 21 | } 22 | --------------------------------------------------------------------------------