diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Headers/MCSketchBundleLoaderFramework.h b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Headers/MCSketchBundleLoaderFramework.h deleted file mode 100644 index c347e35..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Headers/MCSketchBundleLoaderFramework.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// MCSketchBundleLoaderFramework.h -// MCSketchBundleLoaderFramework -// -// Created by Matt Curtis on 7/22/15. -// Copyright (c) 2015 Matt. All rights reserved. -// - -#import - -//! Project version number for MCSketchBundleLoaderFramework. -FOUNDATION_EXPORT double MCSketchBundleLoaderFrameworkVersionNumber; - -//! Project version string for MCSketchBundleLoaderFramework. -FOUNDATION_EXPORT const unsigned char MCSketchBundleLoaderFrameworkVersionString[]; - -#import "MCSketchBundleLoader.h" \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/MCSketchBundleLoaderFramework b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/MCSketchBundleLoaderFramework deleted file mode 100755 index 86c5319..0000000 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/MCSketchBundleLoaderFramework and /dev/null differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Modules/module.modulemap b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Modules/module.modulemap deleted file mode 100644 index 5dd2055..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Modules/module.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module MCSketchBundleLoaderFramework { - umbrella header "MCSketchBundleLoaderFramework.h" - - export * - module * { export * } -} diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Resources/Info.plist b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Resources/Info.plist deleted file mode 100644 index 535255f..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Resources/Info.plist +++ /dev/null @@ -1,46 +0,0 @@ - - - - - BuildMachineOSBuild - 14F27 - CFBundleDevelopmentRegion - en - CFBundleExecutable - MCSketchBundleLoaderFramework - CFBundleIdentifier - matt-curtis.MCSketchBundleLoaderFramework - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - MCSketchBundleLoaderFramework - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 7A1001 - DTPlatformVersion - GM - DTSDKBuild - 15A278 - DTSDKName - macosx10.11 - DTXcode - 0701 - DTXcodeBuild - 7A1001 - NSHumanReadableCopyright - Copyright © 2015 Matt. All rights reserved. - - diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Headers/MCSketchBundleLoaderFramework.h b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Headers/MCSketchBundleLoaderFramework.h deleted file mode 100644 index c347e35..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Headers/MCSketchBundleLoaderFramework.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// MCSketchBundleLoaderFramework.h -// MCSketchBundleLoaderFramework -// -// Created by Matt Curtis on 7/22/15. -// Copyright (c) 2015 Matt. All rights reserved. -// - -#import - -//! Project version number for MCSketchBundleLoaderFramework. -FOUNDATION_EXPORT double MCSketchBundleLoaderFrameworkVersionNumber; - -//! Project version string for MCSketchBundleLoaderFramework. -FOUNDATION_EXPORT const unsigned char MCSketchBundleLoaderFrameworkVersionString[]; - -#import "MCSketchBundleLoader.h" \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/MCSketchBundleLoaderFramework b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/MCSketchBundleLoaderFramework deleted file mode 100755 index 86c5319..0000000 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/MCSketchBundleLoaderFramework and /dev/null differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Modules/module.modulemap b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Modules/module.modulemap deleted file mode 100644 index 5dd2055..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Modules/module.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module MCSketchBundleLoaderFramework { - umbrella header "MCSketchBundleLoaderFramework.h" - - export * - module * { export * } -} diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Resources/Info.plist b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index 535255f..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,46 +0,0 @@ - - - - - BuildMachineOSBuild - 14F27 - CFBundleDevelopmentRegion - en - CFBundleExecutable - MCSketchBundleLoaderFramework - CFBundleIdentifier - matt-curtis.MCSketchBundleLoaderFramework - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - MCSketchBundleLoaderFramework - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 7A1001 - DTPlatformVersion - GM - DTSDKBuild - 15A278 - DTSDKName - macosx10.11 - DTXcode - 0701 - DTXcodeBuild - 7A1001 - NSHumanReadableCopyright - Copyright © 2015 Matt. All rights reserved. - - diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Headers/MCSketchBundleLoaderFramework.h b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Headers/MCSketchBundleLoaderFramework.h deleted file mode 100644 index c347e35..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Headers/MCSketchBundleLoaderFramework.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// MCSketchBundleLoaderFramework.h -// MCSketchBundleLoaderFramework -// -// Created by Matt Curtis on 7/22/15. -// Copyright (c) 2015 Matt. All rights reserved. -// - -#import - -//! Project version number for MCSketchBundleLoaderFramework. -FOUNDATION_EXPORT double MCSketchBundleLoaderFrameworkVersionNumber; - -//! Project version string for MCSketchBundleLoaderFramework. -FOUNDATION_EXPORT const unsigned char MCSketchBundleLoaderFrameworkVersionString[]; - -#import "MCSketchBundleLoader.h" \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/MCSketchBundleLoaderFramework b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/MCSketchBundleLoaderFramework deleted file mode 100755 index 86c5319..0000000 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/MCSketchBundleLoaderFramework and /dev/null differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Modules/module.modulemap b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Modules/module.modulemap deleted file mode 100644 index 5dd2055..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Modules/module.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module MCSketchBundleLoaderFramework { - umbrella header "MCSketchBundleLoaderFramework.h" - - export * - module * { export * } -} diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Resources/Info.plist b/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Resources/Info.plist deleted file mode 100644 index 535255f..0000000 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchBundleLoaderFramework.framework/Versions/Current/Resources/Info.plist +++ /dev/null @@ -1,46 +0,0 @@ - - - - - BuildMachineOSBuild - 14F27 - CFBundleDevelopmentRegion - en - CFBundleExecutable - MCSketchBundleLoaderFramework - CFBundleIdentifier - matt-curtis.MCSketchBundleLoaderFramework - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - MCSketchBundleLoaderFramework - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 7A1001 - DTPlatformVersion - GM - DTSDKBuild - 15A278 - DTSDKName - macosx10.11 - DTXcode - 0701 - DTXcodeBuild - 7A1001 - NSHumanReadableCopyright - Copyright © 2015 Matt. All rights reserved. - - diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Info.plist b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Info.plist index 82f409f..8bddf61 100644 --- a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Info.plist +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0 + 1.1 CFBundleSignature ???? CFBundleSupportedPlatforms diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/MacOS/MCSketchConstraints b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/MacOS/MCSketchConstraints index 15335fa..f097560 100755 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/MacOS/MCSketchConstraints and b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/MacOS/MCSketchConstraints differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/Assets.car b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/Assets.car index 4bb90f5..05c949a 100644 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/Assets.car and b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/Assets.car differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginController.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginController.h new file mode 100644 index 0000000..e90cd3b --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginController.h @@ -0,0 +1,72 @@ +// +// MCSPluginController.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/11/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "SketchRuntime.h" + +#import "MochaRuntime.h" + +#import "MCSPluginUserDefaults.h" + +#import "MCSPluginUpdater.h" + + +// Notifications + +extern NSString *const MCSPluginSelectionDidChangeNotification; + +extern NSString *const MCSPluginCurrentArtboardDidChangeNotification; + +extern NSString *const MCSPluginCurrentDocumentDidChangeNotification; + +extern NSString *const MCSPluginAllDocumentsClosedNotification; + +// Notification Keys + +extern NSString *const MCSPluginNotificationDocumentKey; + +extern NSString *const MCSPluginNotificationDocumentWindowKey; + + +@interface MCSPluginController : NSObject + + @property (nonatomic, readonly) NSString *loadedVersion; + + + @property (nonatomic) MSPluginCommand *pluginCommand; + + @property (nonatomic) MSPluginBundle *plugin; + + @property (nonatomic, readonly) MCSPluginUserDefaults *userDefaults; + + @property (nonatomic, readonly) MCSPluginUpdater *updater; + + + + (instancetype) pluginController:(MSPluginBundle*)plugin pluginCommand:(MSPluginCommand*)pluginCommand; + + + (instancetype) pluginController; + + + + (NSAlert*) alertWithTitle:(NSString*)title information:(NSString*)information run:(BOOL)run; + + + (NSAlert*) alertWithTitle:(NSString*)title information:(NSString*)information; + + + - (void) applicationDidBecomeActive; + + + - (void) allDocumentsDidClose; + + - (void) currentDocumentDidChange:(NSNotification*)notification; + + - (void) currentSelectionDidChange:(NSNotification*)notification; + + - (void) currentArtboardDidChange:(NSNotification*)notification; + +@end diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUpdater.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUpdater.h new file mode 100644 index 0000000..2291a23 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUpdater.h @@ -0,0 +1,22 @@ +// +// MCSPluginUpdater.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + + +@interface MCSPluginUpdater : NSObject + + @property (nonatomic) NSString *pluginIdentifier; + + - (BOOL) isNewerPluginBundleAvailableLocally:(NSString*)loadedVersion; + + - (void) showUpdateRestartPrompt; + + - (void) relaunchSketch; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUserDefaults.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUserDefaults.h new file mode 100644 index 0000000..5e9eaf5 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUserDefaults.h @@ -0,0 +1,15 @@ +// +// MCSPluginUserDefaults.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +@interface MCSPluginUserDefaults : NSUserDefaults + + @property (nonatomic) NSString *pluginIdentifier; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUserDefaultsController.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUserDefaultsController.h new file mode 100644 index 0000000..88f990f --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSPluginUserDefaultsController.h @@ -0,0 +1,18 @@ +// +// MCSPluginUserDefaultsController.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "MCSPluginUserDefaults.h" + + +@interface MCSPluginUserDefaultsController : NSUserDefaultsController + + - (MCSPluginUserDefaults*) userDefaultsProxy; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSketchPluginFramework.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSketchPluginFramework.h new file mode 100644 index 0000000..8115f43 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MCSketchPluginFramework.h @@ -0,0 +1,31 @@ +// +// MCSketchPluginFramework.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +//! Project version number for MCSketchPluginFramework. +FOUNDATION_EXPORT double MCSketchPluginFrameworkVersionNumber; + +//! Project version string for MCSketchPluginFramework. +FOUNDATION_EXPORT const unsigned char MCSketchPluginFrameworkVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import + +#import + +#import + +#import + +#import + +#import + +#import \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MochaRuntime.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MochaRuntime.h new file mode 100644 index 0000000..972d234 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/MochaRuntime.h @@ -0,0 +1,22 @@ +// +// MochaRuntime.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import + + +#define MOJavaScriptObject_Class GetClass(@"MOJavaScriptObject") + +@interface MOJavaScriptObject : NSObject + + @property (readonly) JSObjectRef JSObject; + + @property (readonly) JSContextRef JSContext; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/SketchRuntime.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/SketchRuntime.h new file mode 100644 index 0000000..7cd0d36 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/SketchRuntime.h @@ -0,0 +1,347 @@ +// +// Sketch.h +// +// Created by Matt Curtis on 9/9/15. +// Copyright (c) 2015 Matt. All rights reserved. +// + +#import + +#import + + +#pragma mark - +#pragma mark Foward Classes + +@class MSPage, MSLayer, MSArtboardGroup, MSContentDrawView, MSArray, MSLayerGroup, MSDocumentWindow; + + +#pragma mark - +#pragma mark Protocols + +@protocol MSPageDelegate + /* + - (void) refreshViewsWithMask:(unsigned long long)arg1; + - (void) refreshOfType:(unsigned long long)arg1 rect:(struct CGRect)arg2; + - (void) didUpdateDetailsForPage:(MSPage *)arg1; + - (void) willRemovePage:(MSPage *)arg1; + - (void) didAddPage:(MSPage *)arg1; + - (void) willRemoveArtboard:(MSArtboardGroup *)arg1 fromPage:(MSPage *)arg2; + - (void) didAddArtboard:(MSArtboardGroup *)arg1 toPage:(MSPage *)arg2; + - (void) didUpdateDetailsForArtboard:(MSArtboardGroup *)arg1; + - (void) determineCurrentArtboard; + */ + - (void) layerSelectionDidChange; + - (void) currentArtboardDidChange; + /* + - (void) collectRefreshRect:(struct CGRect)arg1 page:(MSPage *)arg2; + */ +@end + + +#pragma mark - +#pragma mark Data Structures + +#define MSArray_Class GetClass(@"MSArray") + +@interface MSArray : NSObject + + @property (readonly, copy, nonatomic) NSArray *array; + +@end + +#define MSLayerArray_Class GetClass(@"MSLayerArray") + +@interface MSLayerArray : NSObject + + + (instancetype) arrayWithLayers:(NSArray*)layers; + +@end + + +#pragma mark - +#pragma mark Event Handler + +#define MSEventHandler_Class GetClass(@"MSEventHandler") + +@interface MSEventHandler : NSObject + + - (void) writeLayers:(MSLayerArray*)layers toPasteboard:(NSPasteboard*)pasteboard; + +@end + +#define MSEventHandlerManager_Class GetClass(@"MSEventHandlerManager") + +@interface MSEventHandlerManager : NSObject + + //@property (nonatomic) MSNormalEventHandler *normalHandler; + @property (nonatomic) MSEventHandler *normalHandler; + +@end + + + +#pragma mark - +#pragma mark Document Classes + +#define MSDocument_Class GetClass(@"MSDocument") + +@interface MSDocument : NSDocument + + - (void) saveArtboardOrSlice:(id)artboardOrSlice toFile:(NSString*)filePath; + + - (MSPage*) currentPage; + + - (void) setCurrentPage:(MSPage*)page; + + - (NSArray*) pages; + + + - (MSEventHandler*) currentHandler; + + + @property (retain, nonatomic) MSEventHandlerManager *eventHandlerManager; + + + - (MSDocumentWindow*) window; + + + (MSDocument*) currentDocument; + + - (NSArray*) selectedLayers; + + + - (MSContentDrawView*) currentView; + + + - (NSUndoManager*) undoManager; + +@end + +#define MSRect_Class GetClass(@"MSRect") + +@interface MSRect : NSObject + + @property (nonatomic) double y; + @property (nonatomic) double x; + @property (nonatomic) double width; + @property (nonatomic) double height; + + @property (nonatomic) CGPoint origin; + @property (nonatomic) CGSize size; + @property (nonatomic) CGRect rect; + + @property (nonatomic) BOOL constrainProportions; + + - (instancetype) scaleBy:(double)scaleBy; + + - (void) makeRectIntegral; + + - (void) makeOriginIntegral; + +@end + +#define MSAbsoluteRect_Class GetClass(@"MSAbsoluteRect") + +@interface MSAbsoluteRect : NSObject + + - (CGRect) rect; + +@end + +#define MSLayer_Class GetClass(@"MSLayer") + +@interface MSLayer : NSObject + + @property (nonatomic) id sharedObjectID; + + @property (nonatomic) MSAbsoluteRect *absoluteRect; + + @property (nonatomic) NSString *name; + + + @property (nonatomic) CGPoint origin; + + @property (nonatomic) CGRect rect; + + @property (retain, nonatomic) MSRect *frame; + + + - (MSPage*) parentPage; + + - (MSArtboardGroup*) parentArtboard; + + - (instancetype) duplicate; + + - (void) removeFromParent; + + - (BOOL) isSharedObject; + - (BOOL) isSymbol; + - (BOOL) containsSymbols; + - (BOOL) parentOrSelfIsSymbol; + +@end + +#define MSLayerGroup_Class GetClass(@"MSLayerGroup") + +@interface MSLayerGroup : MSLayer + + @property (nonatomic) MSArray *layers; + + - (void) removeAllLayers; + - (void) removeLayerAtIndex:(NSInteger)index; + - (void) removeLayer:(MSLayer*)layer; + + - (void) insertLayers:(NSArray*)layers atIndex:(NSInteger)index; + - (void) insertLayers:(NSArray*)layers afterLayer:(MSLayer*)afterLayer; + - (void) insertLayers:(NSArray*)arg1 beforeLayer:(MSLayer*)beforeLayer; + + - (void) replaceLayersWithLayers:(NSArray*)layers; + - (void) addLayers:(NSArray*)layers; + + - (MSLayer*) addLayerOfType:(NSString*)type; + + - (BOOL) resizeRoot:(BOOL)recursive; + +@end + +#define MSPage_Class GetClass(@"MSPage") + +@interface MSPage : MSLayerGroup + + @property (nonatomic) double zoomValue; + + @property(nonatomic) CGPoint scrollOrigin; + + - (NSArray*) artboards; + + - (MSArtboardGroup*) currentArtboard; + +@end + +#define MSExportFormat_Class GetClass(@"MSExportFormat") + +@interface MSExportFormat : NSObject + + + (instancetype) formatWithScale:(double)scale name:(NSString*)name fileFormat:(NSString*)fileFormat; + +@end + +#define MSExportRequest_Class GetClass(@"MSExportRequest") + +@interface MSExportRequest : NSObject + + + (NSArray*) exportRequestsFromExportableLayer:(MSLayer*)layer exportFormats:(NSArray*)formats useIDForName:(BOOL)useIDForName; + + @property (nonatomic) BOOL includeArtboardBackground; + +@end + +#define MSExporter_Class GetClass(@"MSExporter") + +@interface MSExporter : NSObject + + + (instancetype) exporterForRequest:(MSExportRequest*)exportRequest colorSpace:(NSColorSpace*)colorSpace allowSubpixelAntialiasing:(BOOL)allowSubpixelAntialiasing; + + - (NSData*) PNGData; + +@end + +#define MSArtboardGroup_Class GetClass(@"MSArtboardGroup") + +@interface MSArtboardGroup : MSLayerGroup + + @property (nonatomic) BOOL includeBackgroundColorInExport; + @property (nonatomic) BOOL hasBackgroundColor; + +@end + +#define MSTextLayer_Class GetClass(@"MSTextLayer") + +@interface MSTextLayer : MSLayer + + @property (nonatomic) double fontSize; + + - (NSTextContainer*) textContainer; + + - (NSLayoutManager*) layoutManager; + +@end + + +#pragma mark - +#pragma mark Plugins + +#define MSPluginCommand_Class GetClass(@"MSPluginCommand") + +@interface MSPluginCommand : NSObject + + // Supports arrays, dictionaries, numbers and strings + + - (void) setValue:(id)value forKey:(NSString*)key onLayer:(MSLayer*)layer; + - (id) valueForKey:(NSString*)key onLayer:(MSLayer*)layer; + + - (void) setValue:(id)value forKey:(NSString*)key onLayer:(MSLayer*)layer forPluginIdentifier:(NSString*)pluginIdentifier; + - (id) valueForKey:(NSString*)key onLayer:(MSLayer*)layer forPluginIdentifier:(NSString*)pluginIdentifier; + +@end + +#define MSPluginBundle_Class GetClass(@"MSPluginBundle") + +@interface MSPluginBundle : NSObject + + @property (readonly, nonatomic) NSURL *manifestURL; + @property (readonly, nonatomic) NSString *authorEmail; + @property (readonly, nonatomic) NSString *author; + @property (readonly, nonatomic) NSURL *homepageURL; + @property (readonly, nonatomic) NSString *pluginDescription; + @property (readonly, nonatomic) NSString *identifier; + @property (readonly, nonatomic) NSString *name; + @property (readonly, nonatomic) NSString *version; + @property (readonly, nonatomic) NSDictionary *commands; + @property (readonly, nonatomic) NSURL *url; + + - (id) urlForResourceNamed:(NSString*)resourceName; + +@end + +#define MSPluginManager_Class GetClass(@"MSPluginManager") + +@interface MSPluginManager : NSObject + + + (id) pluginsURL; + + @property (readonly, copy, nonatomic) NSURL *pluginsFolderURL; // @synthesize pluginsFolderURL=_pluginsFolderURL; + @property (copy, nonatomic) NSDictionary *plugins; + + - (void) reloadPlugins; + - (NSDictionary*) pluginsFromFolderAtURL:(NSURL*)url visitedURLs:(NSArray*)visitedURLs relativeFolderPath:(NSString*)relativeFolderPath; + +@end + + +#pragma mark - +#pragma mark Interface Classes + +#define MSDocumentWindow_Class GetClass(@"MSDocumentWindow") + +@interface MSDocumentWindow : NSWindow + +@end + +#define MSContentDrawView_Class GetClass(@"MSContentDrawView") + +@interface MSContentDrawView : NSView + +@end + + +#pragma mark - +#pragma mark Application + +@interface AppController : NSObject + + @property (retain, nonatomic) MSPluginManager *pluginManager; + + //@property (retain, nonatomic) MSPasteboardManager *pasteboardManager; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/Utilities.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/Utilities.h new file mode 100644 index 0000000..5b0ef08 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Headers/Utilities.h @@ -0,0 +1,105 @@ +// +// Utilities.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "MochaRuntime.h" + + +#ifndef Utilities_h +#define Utilities_h + +#pragma mark - +#pragma mark General + +Class GetClass(NSString *className); + + +#pragma mark - +#pragma mark Mocha + +JSContext *JSContextOfMochaObject(MOJavaScriptObject *mochaObject); + +JSValue *JSValueFromMochaObject(MOJavaScriptObject *mochaObject); + + +#pragma mark - +#pragma mark Text + +CGFloat Sketch_GetTextHeight(CGFloat desiredTextWidth, MSTextLayer *textLayer); + +CGSize Sketch_GetTextSize(MSTextLayer *textLayer); + + +#pragma mark - +#pragma mark Document + +MSDocument *Sketch_GetCurrentDocument(); + + +#pragma mark - +#pragma mark Page + +MSPage *Sketch_GetCurrentPage(); + + +#pragma mark - +#pragma mark Undo Registration + +void Sketch_DisableUndoRegistration(MSDocument *document); + +void Sketch_EnableUndoRegistration(MSDocument *document); + +void Sketch_DisableUndoRegistrationInBlock(MSDocument *document, void(^block)()); + + +#pragma mark - +#pragma mark Selection + +NSArray *Sketch_GetSelectedLayers(MSDocument *document); + +NSArray *Sketch_GetSelectedArtboards(MSDocument *document, BOOL linear, BOOL includeCurrentOrOnly); + + +#pragma mark - +#pragma mark Artboards + +MSArtboardGroup *Sketch_GetCurrentArtboard(MSDocument *document); + +MSArtboardGroup *Sketch_GetCurrentOrOnlyArtboard(MSDocument *document); + + +#pragma mark - +#pragma mark Geometry + +CGRect Sketch_MSRectToCGRect(MSRect *rect); + +NSRect Sketch_MSRectToNSRect(MSRect *rect); + +void Sketch_SetMSRectWithCGRect(MSRect *msrect, CGRect cgrect); + +void Sketch_SetMSRectWithNSRect(MSRect *msrect, NSRect nsrect); + + +CGRect Sketch_GetAbsoluteLayerFrame(MSLayer *layer); + +CGRect Sketch_GetLayerFrameInContentDrawView(MSLayer *layer); + +CGRect Sketch_GetLayerFrameInWindow(MSLayer *layer, MSDocument *document); + +CGRect Sketch_GetLayerFrameInScreen(MSLayer *layer, MSDocument *document); + + +#pragma mark - +#pragma mark Layer to Images + +NSData *Sketch_GetImageDataFromLayer(MSLayer *layer, double scale); + +NSImage *Sketch_GetImageFromLayer(MSLayer *layer, double scale); + +#endif /* Utilities_h */ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/MCSketchPluginFramework b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/MCSketchPluginFramework index 7379eaf..d501148 100755 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/MCSketchPluginFramework and b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/MCSketchPluginFramework differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Modules/module.modulemap b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Modules/module.modulemap new file mode 100644 index 0000000..5de2463 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module MCSketchPluginFramework { + umbrella header "MCSketchPluginFramework.h" + + export * + module * { export * } +} diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginController.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginController.h new file mode 100644 index 0000000..e90cd3b --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginController.h @@ -0,0 +1,72 @@ +// +// MCSPluginController.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/11/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "SketchRuntime.h" + +#import "MochaRuntime.h" + +#import "MCSPluginUserDefaults.h" + +#import "MCSPluginUpdater.h" + + +// Notifications + +extern NSString *const MCSPluginSelectionDidChangeNotification; + +extern NSString *const MCSPluginCurrentArtboardDidChangeNotification; + +extern NSString *const MCSPluginCurrentDocumentDidChangeNotification; + +extern NSString *const MCSPluginAllDocumentsClosedNotification; + +// Notification Keys + +extern NSString *const MCSPluginNotificationDocumentKey; + +extern NSString *const MCSPluginNotificationDocumentWindowKey; + + +@interface MCSPluginController : NSObject + + @property (nonatomic, readonly) NSString *loadedVersion; + + + @property (nonatomic) MSPluginCommand *pluginCommand; + + @property (nonatomic) MSPluginBundle *plugin; + + @property (nonatomic, readonly) MCSPluginUserDefaults *userDefaults; + + @property (nonatomic, readonly) MCSPluginUpdater *updater; + + + + (instancetype) pluginController:(MSPluginBundle*)plugin pluginCommand:(MSPluginCommand*)pluginCommand; + + + (instancetype) pluginController; + + + + (NSAlert*) alertWithTitle:(NSString*)title information:(NSString*)information run:(BOOL)run; + + + (NSAlert*) alertWithTitle:(NSString*)title information:(NSString*)information; + + + - (void) applicationDidBecomeActive; + + + - (void) allDocumentsDidClose; + + - (void) currentDocumentDidChange:(NSNotification*)notification; + + - (void) currentSelectionDidChange:(NSNotification*)notification; + + - (void) currentArtboardDidChange:(NSNotification*)notification; + +@end diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUpdater.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUpdater.h new file mode 100644 index 0000000..2291a23 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUpdater.h @@ -0,0 +1,22 @@ +// +// MCSPluginUpdater.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + + +@interface MCSPluginUpdater : NSObject + + @property (nonatomic) NSString *pluginIdentifier; + + - (BOOL) isNewerPluginBundleAvailableLocally:(NSString*)loadedVersion; + + - (void) showUpdateRestartPrompt; + + - (void) relaunchSketch; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUserDefaults.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUserDefaults.h new file mode 100644 index 0000000..5e9eaf5 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUserDefaults.h @@ -0,0 +1,15 @@ +// +// MCSPluginUserDefaults.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +@interface MCSPluginUserDefaults : NSUserDefaults + + @property (nonatomic) NSString *pluginIdentifier; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUserDefaultsController.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUserDefaultsController.h new file mode 100644 index 0000000..88f990f --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSPluginUserDefaultsController.h @@ -0,0 +1,18 @@ +// +// MCSPluginUserDefaultsController.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "MCSPluginUserDefaults.h" + + +@interface MCSPluginUserDefaultsController : NSUserDefaultsController + + - (MCSPluginUserDefaults*) userDefaultsProxy; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSketchPluginFramework.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSketchPluginFramework.h new file mode 100644 index 0000000..8115f43 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MCSketchPluginFramework.h @@ -0,0 +1,31 @@ +// +// MCSketchPluginFramework.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +//! Project version number for MCSketchPluginFramework. +FOUNDATION_EXPORT double MCSketchPluginFrameworkVersionNumber; + +//! Project version string for MCSketchPluginFramework. +FOUNDATION_EXPORT const unsigned char MCSketchPluginFrameworkVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import + +#import + +#import + +#import + +#import + +#import + +#import \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MochaRuntime.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MochaRuntime.h new file mode 100644 index 0000000..972d234 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/MochaRuntime.h @@ -0,0 +1,22 @@ +// +// MochaRuntime.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import + + +#define MOJavaScriptObject_Class GetClass(@"MOJavaScriptObject") + +@interface MOJavaScriptObject : NSObject + + @property (readonly) JSObjectRef JSObject; + + @property (readonly) JSContextRef JSContext; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/SketchRuntime.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/SketchRuntime.h new file mode 100644 index 0000000..7cd0d36 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/SketchRuntime.h @@ -0,0 +1,347 @@ +// +// Sketch.h +// +// Created by Matt Curtis on 9/9/15. +// Copyright (c) 2015 Matt. All rights reserved. +// + +#import + +#import + + +#pragma mark - +#pragma mark Foward Classes + +@class MSPage, MSLayer, MSArtboardGroup, MSContentDrawView, MSArray, MSLayerGroup, MSDocumentWindow; + + +#pragma mark - +#pragma mark Protocols + +@protocol MSPageDelegate + /* + - (void) refreshViewsWithMask:(unsigned long long)arg1; + - (void) refreshOfType:(unsigned long long)arg1 rect:(struct CGRect)arg2; + - (void) didUpdateDetailsForPage:(MSPage *)arg1; + - (void) willRemovePage:(MSPage *)arg1; + - (void) didAddPage:(MSPage *)arg1; + - (void) willRemoveArtboard:(MSArtboardGroup *)arg1 fromPage:(MSPage *)arg2; + - (void) didAddArtboard:(MSArtboardGroup *)arg1 toPage:(MSPage *)arg2; + - (void) didUpdateDetailsForArtboard:(MSArtboardGroup *)arg1; + - (void) determineCurrentArtboard; + */ + - (void) layerSelectionDidChange; + - (void) currentArtboardDidChange; + /* + - (void) collectRefreshRect:(struct CGRect)arg1 page:(MSPage *)arg2; + */ +@end + + +#pragma mark - +#pragma mark Data Structures + +#define MSArray_Class GetClass(@"MSArray") + +@interface MSArray : NSObject + + @property (readonly, copy, nonatomic) NSArray *array; + +@end + +#define MSLayerArray_Class GetClass(@"MSLayerArray") + +@interface MSLayerArray : NSObject + + + (instancetype) arrayWithLayers:(NSArray*)layers; + +@end + + +#pragma mark - +#pragma mark Event Handler + +#define MSEventHandler_Class GetClass(@"MSEventHandler") + +@interface MSEventHandler : NSObject + + - (void) writeLayers:(MSLayerArray*)layers toPasteboard:(NSPasteboard*)pasteboard; + +@end + +#define MSEventHandlerManager_Class GetClass(@"MSEventHandlerManager") + +@interface MSEventHandlerManager : NSObject + + //@property (nonatomic) MSNormalEventHandler *normalHandler; + @property (nonatomic) MSEventHandler *normalHandler; + +@end + + + +#pragma mark - +#pragma mark Document Classes + +#define MSDocument_Class GetClass(@"MSDocument") + +@interface MSDocument : NSDocument + + - (void) saveArtboardOrSlice:(id)artboardOrSlice toFile:(NSString*)filePath; + + - (MSPage*) currentPage; + + - (void) setCurrentPage:(MSPage*)page; + + - (NSArray*) pages; + + + - (MSEventHandler*) currentHandler; + + + @property (retain, nonatomic) MSEventHandlerManager *eventHandlerManager; + + + - (MSDocumentWindow*) window; + + + (MSDocument*) currentDocument; + + - (NSArray*) selectedLayers; + + + - (MSContentDrawView*) currentView; + + + - (NSUndoManager*) undoManager; + +@end + +#define MSRect_Class GetClass(@"MSRect") + +@interface MSRect : NSObject + + @property (nonatomic) double y; + @property (nonatomic) double x; + @property (nonatomic) double width; + @property (nonatomic) double height; + + @property (nonatomic) CGPoint origin; + @property (nonatomic) CGSize size; + @property (nonatomic) CGRect rect; + + @property (nonatomic) BOOL constrainProportions; + + - (instancetype) scaleBy:(double)scaleBy; + + - (void) makeRectIntegral; + + - (void) makeOriginIntegral; + +@end + +#define MSAbsoluteRect_Class GetClass(@"MSAbsoluteRect") + +@interface MSAbsoluteRect : NSObject + + - (CGRect) rect; + +@end + +#define MSLayer_Class GetClass(@"MSLayer") + +@interface MSLayer : NSObject + + @property (nonatomic) id sharedObjectID; + + @property (nonatomic) MSAbsoluteRect *absoluteRect; + + @property (nonatomic) NSString *name; + + + @property (nonatomic) CGPoint origin; + + @property (nonatomic) CGRect rect; + + @property (retain, nonatomic) MSRect *frame; + + + - (MSPage*) parentPage; + + - (MSArtboardGroup*) parentArtboard; + + - (instancetype) duplicate; + + - (void) removeFromParent; + + - (BOOL) isSharedObject; + - (BOOL) isSymbol; + - (BOOL) containsSymbols; + - (BOOL) parentOrSelfIsSymbol; + +@end + +#define MSLayerGroup_Class GetClass(@"MSLayerGroup") + +@interface MSLayerGroup : MSLayer + + @property (nonatomic) MSArray *layers; + + - (void) removeAllLayers; + - (void) removeLayerAtIndex:(NSInteger)index; + - (void) removeLayer:(MSLayer*)layer; + + - (void) insertLayers:(NSArray*)layers atIndex:(NSInteger)index; + - (void) insertLayers:(NSArray*)layers afterLayer:(MSLayer*)afterLayer; + - (void) insertLayers:(NSArray*)arg1 beforeLayer:(MSLayer*)beforeLayer; + + - (void) replaceLayersWithLayers:(NSArray*)layers; + - (void) addLayers:(NSArray*)layers; + + - (MSLayer*) addLayerOfType:(NSString*)type; + + - (BOOL) resizeRoot:(BOOL)recursive; + +@end + +#define MSPage_Class GetClass(@"MSPage") + +@interface MSPage : MSLayerGroup + + @property (nonatomic) double zoomValue; + + @property(nonatomic) CGPoint scrollOrigin; + + - (NSArray*) artboards; + + - (MSArtboardGroup*) currentArtboard; + +@end + +#define MSExportFormat_Class GetClass(@"MSExportFormat") + +@interface MSExportFormat : NSObject + + + (instancetype) formatWithScale:(double)scale name:(NSString*)name fileFormat:(NSString*)fileFormat; + +@end + +#define MSExportRequest_Class GetClass(@"MSExportRequest") + +@interface MSExportRequest : NSObject + + + (NSArray*) exportRequestsFromExportableLayer:(MSLayer*)layer exportFormats:(NSArray*)formats useIDForName:(BOOL)useIDForName; + + @property (nonatomic) BOOL includeArtboardBackground; + +@end + +#define MSExporter_Class GetClass(@"MSExporter") + +@interface MSExporter : NSObject + + + (instancetype) exporterForRequest:(MSExportRequest*)exportRequest colorSpace:(NSColorSpace*)colorSpace allowSubpixelAntialiasing:(BOOL)allowSubpixelAntialiasing; + + - (NSData*) PNGData; + +@end + +#define MSArtboardGroup_Class GetClass(@"MSArtboardGroup") + +@interface MSArtboardGroup : MSLayerGroup + + @property (nonatomic) BOOL includeBackgroundColorInExport; + @property (nonatomic) BOOL hasBackgroundColor; + +@end + +#define MSTextLayer_Class GetClass(@"MSTextLayer") + +@interface MSTextLayer : MSLayer + + @property (nonatomic) double fontSize; + + - (NSTextContainer*) textContainer; + + - (NSLayoutManager*) layoutManager; + +@end + + +#pragma mark - +#pragma mark Plugins + +#define MSPluginCommand_Class GetClass(@"MSPluginCommand") + +@interface MSPluginCommand : NSObject + + // Supports arrays, dictionaries, numbers and strings + + - (void) setValue:(id)value forKey:(NSString*)key onLayer:(MSLayer*)layer; + - (id) valueForKey:(NSString*)key onLayer:(MSLayer*)layer; + + - (void) setValue:(id)value forKey:(NSString*)key onLayer:(MSLayer*)layer forPluginIdentifier:(NSString*)pluginIdentifier; + - (id) valueForKey:(NSString*)key onLayer:(MSLayer*)layer forPluginIdentifier:(NSString*)pluginIdentifier; + +@end + +#define MSPluginBundle_Class GetClass(@"MSPluginBundle") + +@interface MSPluginBundle : NSObject + + @property (readonly, nonatomic) NSURL *manifestURL; + @property (readonly, nonatomic) NSString *authorEmail; + @property (readonly, nonatomic) NSString *author; + @property (readonly, nonatomic) NSURL *homepageURL; + @property (readonly, nonatomic) NSString *pluginDescription; + @property (readonly, nonatomic) NSString *identifier; + @property (readonly, nonatomic) NSString *name; + @property (readonly, nonatomic) NSString *version; + @property (readonly, nonatomic) NSDictionary *commands; + @property (readonly, nonatomic) NSURL *url; + + - (id) urlForResourceNamed:(NSString*)resourceName; + +@end + +#define MSPluginManager_Class GetClass(@"MSPluginManager") + +@interface MSPluginManager : NSObject + + + (id) pluginsURL; + + @property (readonly, copy, nonatomic) NSURL *pluginsFolderURL; // @synthesize pluginsFolderURL=_pluginsFolderURL; + @property (copy, nonatomic) NSDictionary *plugins; + + - (void) reloadPlugins; + - (NSDictionary*) pluginsFromFolderAtURL:(NSURL*)url visitedURLs:(NSArray*)visitedURLs relativeFolderPath:(NSString*)relativeFolderPath; + +@end + + +#pragma mark - +#pragma mark Interface Classes + +#define MSDocumentWindow_Class GetClass(@"MSDocumentWindow") + +@interface MSDocumentWindow : NSWindow + +@end + +#define MSContentDrawView_Class GetClass(@"MSContentDrawView") + +@interface MSContentDrawView : NSView + +@end + + +#pragma mark - +#pragma mark Application + +@interface AppController : NSObject + + @property (retain, nonatomic) MSPluginManager *pluginManager; + + //@property (retain, nonatomic) MSPasteboardManager *pasteboardManager; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/Utilities.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/Utilities.h new file mode 100644 index 0000000..5b0ef08 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Headers/Utilities.h @@ -0,0 +1,105 @@ +// +// Utilities.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "MochaRuntime.h" + + +#ifndef Utilities_h +#define Utilities_h + +#pragma mark - +#pragma mark General + +Class GetClass(NSString *className); + + +#pragma mark - +#pragma mark Mocha + +JSContext *JSContextOfMochaObject(MOJavaScriptObject *mochaObject); + +JSValue *JSValueFromMochaObject(MOJavaScriptObject *mochaObject); + + +#pragma mark - +#pragma mark Text + +CGFloat Sketch_GetTextHeight(CGFloat desiredTextWidth, MSTextLayer *textLayer); + +CGSize Sketch_GetTextSize(MSTextLayer *textLayer); + + +#pragma mark - +#pragma mark Document + +MSDocument *Sketch_GetCurrentDocument(); + + +#pragma mark - +#pragma mark Page + +MSPage *Sketch_GetCurrentPage(); + + +#pragma mark - +#pragma mark Undo Registration + +void Sketch_DisableUndoRegistration(MSDocument *document); + +void Sketch_EnableUndoRegistration(MSDocument *document); + +void Sketch_DisableUndoRegistrationInBlock(MSDocument *document, void(^block)()); + + +#pragma mark - +#pragma mark Selection + +NSArray *Sketch_GetSelectedLayers(MSDocument *document); + +NSArray *Sketch_GetSelectedArtboards(MSDocument *document, BOOL linear, BOOL includeCurrentOrOnly); + + +#pragma mark - +#pragma mark Artboards + +MSArtboardGroup *Sketch_GetCurrentArtboard(MSDocument *document); + +MSArtboardGroup *Sketch_GetCurrentOrOnlyArtboard(MSDocument *document); + + +#pragma mark - +#pragma mark Geometry + +CGRect Sketch_MSRectToCGRect(MSRect *rect); + +NSRect Sketch_MSRectToNSRect(MSRect *rect); + +void Sketch_SetMSRectWithCGRect(MSRect *msrect, CGRect cgrect); + +void Sketch_SetMSRectWithNSRect(MSRect *msrect, NSRect nsrect); + + +CGRect Sketch_GetAbsoluteLayerFrame(MSLayer *layer); + +CGRect Sketch_GetLayerFrameInContentDrawView(MSLayer *layer); + +CGRect Sketch_GetLayerFrameInWindow(MSLayer *layer, MSDocument *document); + +CGRect Sketch_GetLayerFrameInScreen(MSLayer *layer, MSDocument *document); + + +#pragma mark - +#pragma mark Layer to Images + +NSData *Sketch_GetImageDataFromLayer(MSLayer *layer, double scale); + +NSImage *Sketch_GetImageFromLayer(MSLayer *layer, double scale); + +#endif /* Utilities_h */ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/MCSketchPluginFramework b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/MCSketchPluginFramework index 7379eaf..d501148 100755 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/MCSketchPluginFramework and b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/MCSketchPluginFramework differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Modules/module.modulemap b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..5de2463 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module MCSketchPluginFramework { + umbrella header "MCSketchPluginFramework.h" + + export * + module * { export * } +} diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginController.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginController.h new file mode 100644 index 0000000..e90cd3b --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginController.h @@ -0,0 +1,72 @@ +// +// MCSPluginController.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/11/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "SketchRuntime.h" + +#import "MochaRuntime.h" + +#import "MCSPluginUserDefaults.h" + +#import "MCSPluginUpdater.h" + + +// Notifications + +extern NSString *const MCSPluginSelectionDidChangeNotification; + +extern NSString *const MCSPluginCurrentArtboardDidChangeNotification; + +extern NSString *const MCSPluginCurrentDocumentDidChangeNotification; + +extern NSString *const MCSPluginAllDocumentsClosedNotification; + +// Notification Keys + +extern NSString *const MCSPluginNotificationDocumentKey; + +extern NSString *const MCSPluginNotificationDocumentWindowKey; + + +@interface MCSPluginController : NSObject + + @property (nonatomic, readonly) NSString *loadedVersion; + + + @property (nonatomic) MSPluginCommand *pluginCommand; + + @property (nonatomic) MSPluginBundle *plugin; + + @property (nonatomic, readonly) MCSPluginUserDefaults *userDefaults; + + @property (nonatomic, readonly) MCSPluginUpdater *updater; + + + + (instancetype) pluginController:(MSPluginBundle*)plugin pluginCommand:(MSPluginCommand*)pluginCommand; + + + (instancetype) pluginController; + + + + (NSAlert*) alertWithTitle:(NSString*)title information:(NSString*)information run:(BOOL)run; + + + (NSAlert*) alertWithTitle:(NSString*)title information:(NSString*)information; + + + - (void) applicationDidBecomeActive; + + + - (void) allDocumentsDidClose; + + - (void) currentDocumentDidChange:(NSNotification*)notification; + + - (void) currentSelectionDidChange:(NSNotification*)notification; + + - (void) currentArtboardDidChange:(NSNotification*)notification; + +@end diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUpdater.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUpdater.h new file mode 100644 index 0000000..2291a23 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUpdater.h @@ -0,0 +1,22 @@ +// +// MCSPluginUpdater.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + + +@interface MCSPluginUpdater : NSObject + + @property (nonatomic) NSString *pluginIdentifier; + + - (BOOL) isNewerPluginBundleAvailableLocally:(NSString*)loadedVersion; + + - (void) showUpdateRestartPrompt; + + - (void) relaunchSketch; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUserDefaults.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUserDefaults.h new file mode 100644 index 0000000..5e9eaf5 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUserDefaults.h @@ -0,0 +1,15 @@ +// +// MCSPluginUserDefaults.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +@interface MCSPluginUserDefaults : NSUserDefaults + + @property (nonatomic) NSString *pluginIdentifier; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUserDefaultsController.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUserDefaultsController.h new file mode 100644 index 0000000..88f990f --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSPluginUserDefaultsController.h @@ -0,0 +1,18 @@ +// +// MCSPluginUserDefaultsController.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 11/23/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "MCSPluginUserDefaults.h" + + +@interface MCSPluginUserDefaultsController : NSUserDefaultsController + + - (MCSPluginUserDefaults*) userDefaultsProxy; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSketchPluginFramework.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSketchPluginFramework.h new file mode 100644 index 0000000..8115f43 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MCSketchPluginFramework.h @@ -0,0 +1,31 @@ +// +// MCSketchPluginFramework.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +//! Project version number for MCSketchPluginFramework. +FOUNDATION_EXPORT double MCSketchPluginFrameworkVersionNumber; + +//! Project version string for MCSketchPluginFramework. +FOUNDATION_EXPORT const unsigned char MCSketchPluginFrameworkVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import + +#import + +#import + +#import + +#import + +#import + +#import \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MochaRuntime.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MochaRuntime.h new file mode 100644 index 0000000..972d234 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/MochaRuntime.h @@ -0,0 +1,22 @@ +// +// MochaRuntime.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import + + +#define MOJavaScriptObject_Class GetClass(@"MOJavaScriptObject") + +@interface MOJavaScriptObject : NSObject + + @property (readonly) JSObjectRef JSObject; + + @property (readonly) JSContextRef JSContext; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/SketchRuntime.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/SketchRuntime.h new file mode 100644 index 0000000..7cd0d36 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/SketchRuntime.h @@ -0,0 +1,347 @@ +// +// Sketch.h +// +// Created by Matt Curtis on 9/9/15. +// Copyright (c) 2015 Matt. All rights reserved. +// + +#import + +#import + + +#pragma mark - +#pragma mark Foward Classes + +@class MSPage, MSLayer, MSArtboardGroup, MSContentDrawView, MSArray, MSLayerGroup, MSDocumentWindow; + + +#pragma mark - +#pragma mark Protocols + +@protocol MSPageDelegate + /* + - (void) refreshViewsWithMask:(unsigned long long)arg1; + - (void) refreshOfType:(unsigned long long)arg1 rect:(struct CGRect)arg2; + - (void) didUpdateDetailsForPage:(MSPage *)arg1; + - (void) willRemovePage:(MSPage *)arg1; + - (void) didAddPage:(MSPage *)arg1; + - (void) willRemoveArtboard:(MSArtboardGroup *)arg1 fromPage:(MSPage *)arg2; + - (void) didAddArtboard:(MSArtboardGroup *)arg1 toPage:(MSPage *)arg2; + - (void) didUpdateDetailsForArtboard:(MSArtboardGroup *)arg1; + - (void) determineCurrentArtboard; + */ + - (void) layerSelectionDidChange; + - (void) currentArtboardDidChange; + /* + - (void) collectRefreshRect:(struct CGRect)arg1 page:(MSPage *)arg2; + */ +@end + + +#pragma mark - +#pragma mark Data Structures + +#define MSArray_Class GetClass(@"MSArray") + +@interface MSArray : NSObject + + @property (readonly, copy, nonatomic) NSArray *array; + +@end + +#define MSLayerArray_Class GetClass(@"MSLayerArray") + +@interface MSLayerArray : NSObject + + + (instancetype) arrayWithLayers:(NSArray*)layers; + +@end + + +#pragma mark - +#pragma mark Event Handler + +#define MSEventHandler_Class GetClass(@"MSEventHandler") + +@interface MSEventHandler : NSObject + + - (void) writeLayers:(MSLayerArray*)layers toPasteboard:(NSPasteboard*)pasteboard; + +@end + +#define MSEventHandlerManager_Class GetClass(@"MSEventHandlerManager") + +@interface MSEventHandlerManager : NSObject + + //@property (nonatomic) MSNormalEventHandler *normalHandler; + @property (nonatomic) MSEventHandler *normalHandler; + +@end + + + +#pragma mark - +#pragma mark Document Classes + +#define MSDocument_Class GetClass(@"MSDocument") + +@interface MSDocument : NSDocument + + - (void) saveArtboardOrSlice:(id)artboardOrSlice toFile:(NSString*)filePath; + + - (MSPage*) currentPage; + + - (void) setCurrentPage:(MSPage*)page; + + - (NSArray*) pages; + + + - (MSEventHandler*) currentHandler; + + + @property (retain, nonatomic) MSEventHandlerManager *eventHandlerManager; + + + - (MSDocumentWindow*) window; + + + (MSDocument*) currentDocument; + + - (NSArray*) selectedLayers; + + + - (MSContentDrawView*) currentView; + + + - (NSUndoManager*) undoManager; + +@end + +#define MSRect_Class GetClass(@"MSRect") + +@interface MSRect : NSObject + + @property (nonatomic) double y; + @property (nonatomic) double x; + @property (nonatomic) double width; + @property (nonatomic) double height; + + @property (nonatomic) CGPoint origin; + @property (nonatomic) CGSize size; + @property (nonatomic) CGRect rect; + + @property (nonatomic) BOOL constrainProportions; + + - (instancetype) scaleBy:(double)scaleBy; + + - (void) makeRectIntegral; + + - (void) makeOriginIntegral; + +@end + +#define MSAbsoluteRect_Class GetClass(@"MSAbsoluteRect") + +@interface MSAbsoluteRect : NSObject + + - (CGRect) rect; + +@end + +#define MSLayer_Class GetClass(@"MSLayer") + +@interface MSLayer : NSObject + + @property (nonatomic) id sharedObjectID; + + @property (nonatomic) MSAbsoluteRect *absoluteRect; + + @property (nonatomic) NSString *name; + + + @property (nonatomic) CGPoint origin; + + @property (nonatomic) CGRect rect; + + @property (retain, nonatomic) MSRect *frame; + + + - (MSPage*) parentPage; + + - (MSArtboardGroup*) parentArtboard; + + - (instancetype) duplicate; + + - (void) removeFromParent; + + - (BOOL) isSharedObject; + - (BOOL) isSymbol; + - (BOOL) containsSymbols; + - (BOOL) parentOrSelfIsSymbol; + +@end + +#define MSLayerGroup_Class GetClass(@"MSLayerGroup") + +@interface MSLayerGroup : MSLayer + + @property (nonatomic) MSArray *layers; + + - (void) removeAllLayers; + - (void) removeLayerAtIndex:(NSInteger)index; + - (void) removeLayer:(MSLayer*)layer; + + - (void) insertLayers:(NSArray*)layers atIndex:(NSInteger)index; + - (void) insertLayers:(NSArray*)layers afterLayer:(MSLayer*)afterLayer; + - (void) insertLayers:(NSArray*)arg1 beforeLayer:(MSLayer*)beforeLayer; + + - (void) replaceLayersWithLayers:(NSArray*)layers; + - (void) addLayers:(NSArray*)layers; + + - (MSLayer*) addLayerOfType:(NSString*)type; + + - (BOOL) resizeRoot:(BOOL)recursive; + +@end + +#define MSPage_Class GetClass(@"MSPage") + +@interface MSPage : MSLayerGroup + + @property (nonatomic) double zoomValue; + + @property(nonatomic) CGPoint scrollOrigin; + + - (NSArray*) artboards; + + - (MSArtboardGroup*) currentArtboard; + +@end + +#define MSExportFormat_Class GetClass(@"MSExportFormat") + +@interface MSExportFormat : NSObject + + + (instancetype) formatWithScale:(double)scale name:(NSString*)name fileFormat:(NSString*)fileFormat; + +@end + +#define MSExportRequest_Class GetClass(@"MSExportRequest") + +@interface MSExportRequest : NSObject + + + (NSArray*) exportRequestsFromExportableLayer:(MSLayer*)layer exportFormats:(NSArray*)formats useIDForName:(BOOL)useIDForName; + + @property (nonatomic) BOOL includeArtboardBackground; + +@end + +#define MSExporter_Class GetClass(@"MSExporter") + +@interface MSExporter : NSObject + + + (instancetype) exporterForRequest:(MSExportRequest*)exportRequest colorSpace:(NSColorSpace*)colorSpace allowSubpixelAntialiasing:(BOOL)allowSubpixelAntialiasing; + + - (NSData*) PNGData; + +@end + +#define MSArtboardGroup_Class GetClass(@"MSArtboardGroup") + +@interface MSArtboardGroup : MSLayerGroup + + @property (nonatomic) BOOL includeBackgroundColorInExport; + @property (nonatomic) BOOL hasBackgroundColor; + +@end + +#define MSTextLayer_Class GetClass(@"MSTextLayer") + +@interface MSTextLayer : MSLayer + + @property (nonatomic) double fontSize; + + - (NSTextContainer*) textContainer; + + - (NSLayoutManager*) layoutManager; + +@end + + +#pragma mark - +#pragma mark Plugins + +#define MSPluginCommand_Class GetClass(@"MSPluginCommand") + +@interface MSPluginCommand : NSObject + + // Supports arrays, dictionaries, numbers and strings + + - (void) setValue:(id)value forKey:(NSString*)key onLayer:(MSLayer*)layer; + - (id) valueForKey:(NSString*)key onLayer:(MSLayer*)layer; + + - (void) setValue:(id)value forKey:(NSString*)key onLayer:(MSLayer*)layer forPluginIdentifier:(NSString*)pluginIdentifier; + - (id) valueForKey:(NSString*)key onLayer:(MSLayer*)layer forPluginIdentifier:(NSString*)pluginIdentifier; + +@end + +#define MSPluginBundle_Class GetClass(@"MSPluginBundle") + +@interface MSPluginBundle : NSObject + + @property (readonly, nonatomic) NSURL *manifestURL; + @property (readonly, nonatomic) NSString *authorEmail; + @property (readonly, nonatomic) NSString *author; + @property (readonly, nonatomic) NSURL *homepageURL; + @property (readonly, nonatomic) NSString *pluginDescription; + @property (readonly, nonatomic) NSString *identifier; + @property (readonly, nonatomic) NSString *name; + @property (readonly, nonatomic) NSString *version; + @property (readonly, nonatomic) NSDictionary *commands; + @property (readonly, nonatomic) NSURL *url; + + - (id) urlForResourceNamed:(NSString*)resourceName; + +@end + +#define MSPluginManager_Class GetClass(@"MSPluginManager") + +@interface MSPluginManager : NSObject + + + (id) pluginsURL; + + @property (readonly, copy, nonatomic) NSURL *pluginsFolderURL; // @synthesize pluginsFolderURL=_pluginsFolderURL; + @property (copy, nonatomic) NSDictionary *plugins; + + - (void) reloadPlugins; + - (NSDictionary*) pluginsFromFolderAtURL:(NSURL*)url visitedURLs:(NSArray*)visitedURLs relativeFolderPath:(NSString*)relativeFolderPath; + +@end + + +#pragma mark - +#pragma mark Interface Classes + +#define MSDocumentWindow_Class GetClass(@"MSDocumentWindow") + +@interface MSDocumentWindow : NSWindow + +@end + +#define MSContentDrawView_Class GetClass(@"MSContentDrawView") + +@interface MSContentDrawView : NSView + +@end + + +#pragma mark - +#pragma mark Application + +@interface AppController : NSObject + + @property (retain, nonatomic) MSPluginManager *pluginManager; + + //@property (retain, nonatomic) MSPasteboardManager *pasteboardManager; + +@end \ No newline at end of file diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/Utilities.h b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/Utilities.h new file mode 100644 index 0000000..5b0ef08 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Headers/Utilities.h @@ -0,0 +1,105 @@ +// +// Utilities.h +// MCSketchPluginFramework +// +// Created by Matt Curtis on 10/2/15. +// Copyright © 2015 Matt. All rights reserved. +// + +#import + +#import "MochaRuntime.h" + + +#ifndef Utilities_h +#define Utilities_h + +#pragma mark - +#pragma mark General + +Class GetClass(NSString *className); + + +#pragma mark - +#pragma mark Mocha + +JSContext *JSContextOfMochaObject(MOJavaScriptObject *mochaObject); + +JSValue *JSValueFromMochaObject(MOJavaScriptObject *mochaObject); + + +#pragma mark - +#pragma mark Text + +CGFloat Sketch_GetTextHeight(CGFloat desiredTextWidth, MSTextLayer *textLayer); + +CGSize Sketch_GetTextSize(MSTextLayer *textLayer); + + +#pragma mark - +#pragma mark Document + +MSDocument *Sketch_GetCurrentDocument(); + + +#pragma mark - +#pragma mark Page + +MSPage *Sketch_GetCurrentPage(); + + +#pragma mark - +#pragma mark Undo Registration + +void Sketch_DisableUndoRegistration(MSDocument *document); + +void Sketch_EnableUndoRegistration(MSDocument *document); + +void Sketch_DisableUndoRegistrationInBlock(MSDocument *document, void(^block)()); + + +#pragma mark - +#pragma mark Selection + +NSArray *Sketch_GetSelectedLayers(MSDocument *document); + +NSArray *Sketch_GetSelectedArtboards(MSDocument *document, BOOL linear, BOOL includeCurrentOrOnly); + + +#pragma mark - +#pragma mark Artboards + +MSArtboardGroup *Sketch_GetCurrentArtboard(MSDocument *document); + +MSArtboardGroup *Sketch_GetCurrentOrOnlyArtboard(MSDocument *document); + + +#pragma mark - +#pragma mark Geometry + +CGRect Sketch_MSRectToCGRect(MSRect *rect); + +NSRect Sketch_MSRectToNSRect(MSRect *rect); + +void Sketch_SetMSRectWithCGRect(MSRect *msrect, CGRect cgrect); + +void Sketch_SetMSRectWithNSRect(MSRect *msrect, NSRect nsrect); + + +CGRect Sketch_GetAbsoluteLayerFrame(MSLayer *layer); + +CGRect Sketch_GetLayerFrameInContentDrawView(MSLayer *layer); + +CGRect Sketch_GetLayerFrameInWindow(MSLayer *layer, MSDocument *document); + +CGRect Sketch_GetLayerFrameInScreen(MSLayer *layer, MSDocument *document); + + +#pragma mark - +#pragma mark Layer to Images + +NSData *Sketch_GetImageDataFromLayer(MSLayer *layer, double scale); + +NSImage *Sketch_GetImageFromLayer(MSLayer *layer, double scale); + +#endif /* Utilities_h */ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/MCSketchPluginFramework b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/MCSketchPluginFramework index 7379eaf..d501148 100755 Binary files a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/MCSketchPluginFramework and b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/MCSketchPluginFramework differ diff --git a/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Modules/module.modulemap b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Modules/module.modulemap new file mode 100644 index 0000000..5de2463 --- /dev/null +++ b/Fluid.sketchplugin/Contents/Resources/MCSketchConstraints.bundle/Contents/Resources/MCSketchPluginFramework.framework/Versions/Current/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module MCSketchPluginFramework { + umbrella header "MCSketchPluginFramework.h" + + export * + module * { export * } +} diff --git a/Fluid.sketchplugin/Contents/Sketch/SketchLibrary.js b/Fluid.sketchplugin/Contents/Sketch/SketchLibrary.js index 4e99b52..c42008b 100644 --- a/Fluid.sketchplugin/Contents/Sketch/SketchLibrary.js +++ b/Fluid.sketchplugin/Contents/Sketch/SketchLibrary.js @@ -377,21 +377,13 @@ }; runtime.loadBundle = function(bundlePath){ - // Load our loader framework if needed - - var resourcesPath = paths.resourcesPath; - - if(!runtime.classExists("MCSketchBundleLoader")){ - if(!runtime.loadFramework("MCSketchBundleLoaderFramework", resourcesPath)){ - log("Failed to load bundle-loader framework."); - - return false; - } - } - - // Load our bundle - - return [MCSketchBundleLoader load:bundlePath]; + var bundle = NSBundle.bundleWithPath(bundlePath); + + if(bundle.isLoaded) bundle.unload(); + + bundle.load(); + + return bundle; }; runtime.classExists = function(className){ diff --git a/Fluid.sketchplugin/Contents/Sketch/manifest.json b/Fluid.sketchplugin/Contents/Sketch/manifest.json index f0c5a6b..c978dd5 100644 --- a/Fluid.sketchplugin/Contents/Sketch/manifest.json +++ b/Fluid.sketchplugin/Contents/Sketch/manifest.json @@ -3,7 +3,7 @@ "description": "Auto Layout-like constraints in Sketch", "author": "Matt Curtis", "homepage": "https://github.com/matt-curtis/Fluid-for-Sketch", - "version": "1.7.1", + "version": "1.7.2", "identifier": "com.matt-curtis.sketch.constraints", "updateURL": "https://raw.githubusercontent.com/matt-curtis/Fluid-for-Sketch/master/Fluid.sketchplugin/Contents/Sketch/manifest.json", diff --git a/README.md b/README.md index c1d4a93..b86ccfe 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# :droplet: Fluid for Sketch 1.7.1 +# :droplet: Fluid for Sketch 1.7.2 > *A collaborative project brought to you by [Matt Curtis](https://twitter.com/matt_sven) & [Cat Noone](https://twitter.com/imcatnoone)* Fluid is a Sketch plugin that provides a means to create more constraint-based, responsive designs. It is based on Auto Layout constraints. -:package: [Download Plugin (.zip)](https://github.com/matt-curtis/Fluid-for-Sketch/releases/download/v1.7.1/Fluid.sketchplugin.zip) | :star: [Changelog](https://github.com/matt-curtis/Fluid-for-Sketch/releases) | :arrow_down: [Download the Demo Sketch Document](https://github.com/matt-curtis/Fluid-for-Sketch/raw/master/Constraint%20Demos.sketch) +:package: [Download Plugin (.zip)](https://github.com/matt-curtis/Fluid-for-Sketch/releases/download/v1.7.2/Fluid.sketchplugin.zip) | :star: [Changelog](https://github.com/matt-curtis/Fluid-for-Sketch/releases) | :arrow_down: [Download the Demo Sketch Document](https://github.com/matt-curtis/Fluid-for-Sketch/raw/master/Constraint%20Demos.sketch) --- | --- | --- --