Added new StyleAttributeEditor plug-in for editing inline CSS properties and values. (This editor does not apply to the <style> element, instead it is for editing the 'style' attribute).

Fixed view sizing bugs in a couple of plugin xib files.
This commit is contained in:
dsward2
2017-01-04 23:48:21 -06:00
committed by dsward2
parent 00edcf101d
commit 8d3fbed17b
14 changed files with 5669 additions and 26 deletions
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SVGElementEditor">
@@ -22,11 +23,11 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="FXx-2c-vL3" userLabel="PluginView" customClass="FlippedView">
<rect key="frame" x="0.0" y="0.0" width="254" height="267"/>
<autoresizingMask key="autoresizingMask"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<customView id="hMH-GL-c8d">
<rect key="frame" x="0.0" y="0.0" width="254" height="267"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="Msg-zE-f1Y">
<rect key="frame" x="118" y="84" width="57" height="19"/>
@@ -229,12 +230,9 @@ Gw
<action selector="revertButtonAction:" target="-2" id="PZp-Fu-dG3"/>
</connections>
</button>
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="3CT-b5-edK">
<box verticalHuggingPriority="750" boxType="separator" id="3CT-b5-edK">
<rect key="frame" x="20" y="136" width="213" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="2DC-pY-7KX">
<rect key="frame" x="76" y="204" width="36" height="14"/>
@@ -281,7 +279,7 @@ Gw
</subviews>
</customView>
</subviews>
<point key="canvasLocation" x="349" y="345.5"/>
<point key="canvasLocation" x="66" y="145"/>
</customView>
</objects>
</document>
@@ -0,0 +1,300 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0E2EB2191E1AFF7E00F36593 /* StyleAttributeEditor.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E2EB2181E1AFF7E00F36593 /* StyleAttributeEditor.m */; };
0E2EB21C1E1AFFF500F36593 /* StyleAttributeEditor.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0E2EB21B1E1AFFF500F36593 /* StyleAttributeEditor.xib */; };
0E2EB21E1E1B009E00F36593 /* CSSProperties.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E2EB21D1E1B009E00F36593 /* CSSProperties.json */; };
0E2EB2211E1B089500F36593 /* StylePropertiesTableRowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E2EB2201E1B089500F36593 /* StylePropertiesTableRowView.m */; };
0E2EB2231E1B099E00F36593 /* macSVGPluginConfig.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 0E2EB2221E1B099E00F36593 /* macSVGPluginConfig.xcconfig */; };
0E2EB2251E1B0A4000F36593 /* MacSVGPlugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E2EB2241E1B0A4000F36593 /* MacSVGPlugin.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0E2EB20E1E1AFE3B00F36593 /* StyleAttributeEditor.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StyleAttributeEditor.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
0E2EB2111E1AFE3B00F36593 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0E2EB2171E1AFF7E00F36593 /* StyleAttributeEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleAttributeEditor.h; sourceTree = "<group>"; };
0E2EB2181E1AFF7E00F36593 /* StyleAttributeEditor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StyleAttributeEditor.m; sourceTree = "<group>"; };
0E2EB21B1E1AFFF500F36593 /* StyleAttributeEditor.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = StyleAttributeEditor.xib; sourceTree = "<group>"; };
0E2EB21D1E1B009E00F36593 /* CSSProperties.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = CSSProperties.json; sourceTree = "<group>"; };
0E2EB21F1E1B089500F36593 /* StylePropertiesTableRowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StylePropertiesTableRowView.h; sourceTree = "<group>"; };
0E2EB2201E1B089500F36593 /* StylePropertiesTableRowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StylePropertiesTableRowView.m; sourceTree = "<group>"; };
0E2EB2221E1B099E00F36593 /* macSVGPluginConfig.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = macSVGPluginConfig.xcconfig; path = "../../../macSVGPlugin Framework/macSVGPluginConfig.xcconfig"; sourceTree = "<group>"; };
0E2EB2241E1B0A4000F36593 /* MacSVGPlugin.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MacSVGPlugin.framework; path = "../../../../../../../Library/Developer/Xcode/DerivedData/macSVG-czegvdherapyucbqorgcxoryqmlr/Build/Products/Debug/MacSVGPlugin.framework"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
0E2EB20B1E1AFE3B00F36593 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0E2EB2251E1B0A4000F36593 /* MacSVGPlugin.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0E2EB2051E1AFE3B00F36593 = {
isa = PBXGroup;
children = (
0E2EB2101E1AFE3B00F36593 /* StyleAttributeEditor */,
0E2EB20F1E1AFE3B00F36593 /* Products */,
);
sourceTree = "<group>";
};
0E2EB20F1E1AFE3B00F36593 /* Products */ = {
isa = PBXGroup;
children = (
0E2EB20E1E1AFE3B00F36593 /* StyleAttributeEditor.plugin */,
);
name = Products;
sourceTree = "<group>";
};
0E2EB2101E1AFE3B00F36593 /* StyleAttributeEditor */ = {
isa = PBXGroup;
children = (
0E2EB2171E1AFF7E00F36593 /* StyleAttributeEditor.h */,
0E2EB2181E1AFF7E00F36593 /* StyleAttributeEditor.m */,
0E2EB21F1E1B089500F36593 /* StylePropertiesTableRowView.h */,
0E2EB2201E1B089500F36593 /* StylePropertiesTableRowView.m */,
0E2EB21A1E1AFFA900F36593 /* Supporting Files */,
);
path = StyleAttributeEditor;
sourceTree = "<group>";
};
0E2EB21A1E1AFFA900F36593 /* Supporting Files */ = {
isa = PBXGroup;
children = (
0E2EB2241E1B0A4000F36593 /* MacSVGPlugin.framework */,
0E2EB21B1E1AFFF500F36593 /* StyleAttributeEditor.xib */,
0E2EB2111E1AFE3B00F36593 /* Info.plist */,
0E2EB2221E1B099E00F36593 /* macSVGPluginConfig.xcconfig */,
0E2EB21D1E1B009E00F36593 /* CSSProperties.json */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
0E2EB20D1E1AFE3B00F36593 /* StyleAttributeEditor */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0E2EB2141E1AFE3B00F36593 /* Build configuration list for PBXNativeTarget "StyleAttributeEditor" */;
buildPhases = (
0E2EB20A1E1AFE3B00F36593 /* Sources */,
0E2EB20B1E1AFE3B00F36593 /* Frameworks */,
0E2EB20C1E1AFE3B00F36593 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = StyleAttributeEditor;
productName = StyleAttributeEditor;
productReference = 0E2EB20E1E1AFE3B00F36593 /* StyleAttributeEditor.plugin */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0E2EB2061E1AFE3B00F36593 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = "ArkPhone LLC";
TargetAttributes = {
0E2EB20D1E1AFE3B00F36593 = {
CreatedOnToolsVersion = 8.1;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 0E2EB2091E1AFE3B00F36593 /* Build configuration list for PBXProject "StyleAttributeEditor" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 0E2EB2051E1AFE3B00F36593;
productRefGroup = 0E2EB20F1E1AFE3B00F36593 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
0E2EB20D1E1AFE3B00F36593 /* StyleAttributeEditor */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
0E2EB20C1E1AFE3B00F36593 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0E2EB21E1E1B009E00F36593 /* CSSProperties.json in Resources */,
0E2EB2231E1B099E00F36593 /* macSVGPluginConfig.xcconfig in Resources */,
0E2EB21C1E1AFFF500F36593 /* StyleAttributeEditor.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
0E2EB20A1E1AFE3B00F36593 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0E2EB2191E1AFF7E00F36593 /* StyleAttributeEditor.m in Sources */,
0E2EB2211E1B089500F36593 /* StylePropertiesTableRowView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
0E2EB2121E1AFE3B00F36593 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
0E2EB2131E1AFE3B00F36593 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
name = Release;
};
0E2EB2151E1AFE3B00F36593 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../macSVG\"/**";
INFOPLIST_FILE = StyleAttributeEditor/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_BUNDLE_IDENTIFIER = com.arkphone.StyleAttributeEditor;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
WRAPPER_EXTENSION = plugin;
};
name = Debug;
};
0E2EB2161E1AFE3B00F36593 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../macSVG\"/**";
INFOPLIST_FILE = StyleAttributeEditor/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_BUNDLE_IDENTIFIER = com.arkphone.StyleAttributeEditor;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
WRAPPER_EXTENSION = plugin;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
0E2EB2091E1AFE3B00F36593 /* Build configuration list for PBXProject "StyleAttributeEditor" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0E2EB2121E1AFE3B00F36593 /* Debug */,
0E2EB2131E1AFE3B00F36593 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
0E2EB2141E1AFE3B00F36593 /* Build configuration list for PBXNativeTarget "StyleAttributeEditor" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0E2EB2151E1AFE3B00F36593 /* Debug */,
0E2EB2161E1AFE3B00F36593 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0E2EB2061E1AFE3B00F36593 /* Project object */;
}
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 ArkPhone LLC. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -0,0 +1,33 @@
//
// StyleAttributeEditor.h
// StyleAttributeEditor
//
// Created by Douglas Ward on 1/2/17.
// Copyright © 2017 ArkPhone LLC. All rights reserved.
//
#import <MacSVGPlugin/MacSVGPlugin.h>
@interface StyleAttributeEditor : MacSVGPlugin
{
IBOutlet NSTableView * stylePropertiesTableView;
IBOutlet NSButton * cancelButton;
IBOutlet NSButton * applyChangesButton;
IBOutlet NSComboBox * propertyNameComboBox;
IBOutlet NSComboBox * propertyValueComboBox;
}
@property (strong) NSMutableArray * stylePropertiesArray;
@property (strong) NSDictionary * cssPropertiesDictionary;
@property (strong) NSArray * styleNamesComboArray;
@property (strong) NSArray * styleValuesComboArray;
- (IBAction)cancelButtonAction:(id)sender;
- (IBAction)applyChangesButtonAction:(id)sender;
- (IBAction)addStylePropertyRow:(id)sender;
- (IBAction)deleteStylePropertyRow:(id)sender;
@end
@@ -0,0 +1,741 @@
//
// StyleAttributeEditor.m
// StyleAttributeEditor
//
// Created by Douglas Ward on 1/2/17.
// Copyright © 2017 ArkPhone LLC. All rights reserved.
//
#import "StyleAttributeEditor.h"
#import "StylePropertiesTableRowView.h"
#import "MacSVGPlugin/MacSVGPluginCallbacks.h"
#import "MacSVGDocumentWindowController.h"
#import "SVGWebKitController.h"
#import "StylePropertiesTableRowView.h"
@implementation StyleAttributeEditor
//==================================================================================
// dealloc
//==================================================================================
- (void)dealloc
{
}
//==================================================================================
// awakeFromNib
//==================================================================================
- (void)awakeFromNib
{
[super awakeFromNib];
}
//==================================================================================
// init
//==================================================================================
- (instancetype)init
{
self = [super init];
if (self)
{
// Initialization code here.
NSBundle * thisBundle = [NSBundle bundleForClass:[self class]];
NSURL * cssProperiesURL = [thisBundle URLForResource:@"CSSProperties" withExtension:@"json"];
NSData * cssPropertiesData = [NSData dataWithContentsOfURL:cssProperiesURL];
NSError * jsonError = NULL;
NSJSONReadingOptions jsonOptions = 0;
self.cssPropertiesDictionary = [NSJSONSerialization JSONObjectWithData:cssPropertiesData
options:jsonOptions error:&jsonError];
NSDictionary * propertiesDictionary = [self.cssPropertiesDictionary objectForKey:@"properties"];
NSArray * propertiesAllKeysArray = [propertiesDictionary allKeys];
propertiesAllKeysArray = [propertiesAllKeysArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
self.styleNamesComboArray = propertiesAllKeysArray;
self.styleValuesComboArray = [NSArray array];
}
return self;
}
//==================================================================================
// pluginName
//==================================================================================
- (NSString *)pluginName
{
return @"Style Attribute Editor";
}
//==================================================================================
// isEditorForElement:elementName:
//==================================================================================
// return label if this editor can edit specified element tag name
- (NSString *)isEditorForElement:(NSXMLElement *)aElement elementName:(NSString *)elementName
{
NSString * result = NULL;
// currently, the element name is not a factor for this plugin
return result;
}
//==================================================================================
// isEditorForElement:elementName:attribute:
//==================================================================================
// return label if this editor can edit specified element and attribute
- (NSString *)isEditorForElement:(NSXMLElement *)aElement elementName:(NSString *)elementName attribute:(NSString *)attributeName
{
NSString * result = NULL;
if ([attributeName isEqualToString:@"style"] == YES)
{
result = self.pluginName;
}
return result;
}
//==================================================================================
// editorPriority:context:
//==================================================================================
- (NSInteger)editorPriority:(NSXMLElement *)targetElement context:(NSString *)context
{
return 30;
}
//==================================================================================
// beginEditForXMLElement:domElement:attributeName:existingValue:
//==================================================================================
- (BOOL)beginEditForXMLElement:(NSXMLElement *)newPluginTargetXMLElement
domElement:(DOMElement *)newPluginTargetDOMElement
attributeName:(NSString *)newAttributeName
existingValue:(NSString *)existingValue
{
BOOL result = [super beginEditForXMLElement:newPluginTargetXMLElement
domElement:newPluginTargetDOMElement attributeName:newAttributeName
existingValue:existingValue];
self.stylePropertiesArray = [NSMutableArray array];
[self loadStylePropertiesData];
[stylePropertiesTableView reloadData];
return result;
}
//==================================================================================
// beginEditForXMLElement:domElement:existingValue:
//==================================================================================
- (BOOL)beginEditForXMLElement:(NSXMLElement *)newPluginTargetXMLElement
domElement:(DOMElement *)newPluginTargetElement
{
BOOL result = [super beginEditForXMLElement:newPluginTargetXMLElement
domElement:newPluginTargetElement];
self.stylePropertiesArray = [NSMutableArray array];
[self loadStylePropertiesData];
[stylePropertiesTableView reloadData];
return result;
}
//==================================================================================
// loadStylePropertiesData
//==================================================================================
- (void)loadStylePropertiesData
{
NSXMLNode * styleAttributeNode = [self.pluginTargetXMLElement attributeForName:@"style"];
if (styleAttributeNode != NULL)
{
//NSString * valuesAttributeValue = [valuesAttributeNode stringValue];
//[valuesTextView setString:valuesAttributeValue];
[self configureStylePropertiesTableView];
}
else
{
[self.stylePropertiesArray removeAllObjects];
}
}
//==================================================================================
// configureStylePropertiesTableView
//==================================================================================
- (void)configureStylePropertiesTableView
{
self.stylePropertiesArray = [NSMutableArray array];
stylePropertiesTableView.columnAutoresizingStyle = NSTableViewUniformColumnAutoresizingStyle;
while(stylePropertiesTableView.tableColumns.count > 0)
{
[stylePropertiesTableView removeTableColumn:stylePropertiesTableView.tableColumns.lastObject];
}
stylePropertiesTableView.columnAutoresizingStyle = NSTableViewUniformColumnAutoresizingStyle;
NSTableColumn * indexTableColumn = [[NSTableColumn alloc] initWithIdentifier:@"#"];
indexTableColumn.title = @"#";
indexTableColumn.width = 30.0f;
indexTableColumn.minWidth = 30.0f;
indexTableColumn.maxWidth = 100.0f;
[stylePropertiesTableView addTableColumn:indexTableColumn];
CGFloat tableWidth = stylePropertiesTableView.bounds.size.width - 30.0f;
CGFloat columnWidth = tableWidth / 2.0f;
NSTableColumn * xTableColumn = [[NSTableColumn alloc] initWithIdentifier:@"property"];
xTableColumn.title = @"property";
xTableColumn.width = columnWidth;
xTableColumn.minWidth = 60.0f;
xTableColumn.maxWidth = 100.0f;
[stylePropertiesTableView addTableColumn:xTableColumn];
NSTableColumn * yTableColumn = [[NSTableColumn alloc] initWithIdentifier:@"value"];
yTableColumn.title = @"value";
yTableColumn.width = columnWidth;
yTableColumn.minWidth = 60.0f;
yTableColumn.maxWidth = 100.0f;
[stylePropertiesTableView addTableColumn:yTableColumn];
NSXMLElement * animateMotionElement = self.pluginTargetXMLElement;
NSXMLNode * styleAttributeNode = [animateMotionElement attributeForName:@"style"];
if (styleAttributeNode != NULL)
{
NSString * styleAttributeString = styleAttributeNode.stringValue;
if (styleAttributeString.length > 0)
{
NSCharacterSet * whitespaceCharacterSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
styleAttributeString = [styleAttributeString stringByTrimmingCharactersInSet:whitespaceCharacterSet];
while ([styleAttributeString rangeOfString:@" "].location != NSNotFound)
{
styleAttributeString = [styleAttributeString stringByReplacingOccurrencesOfString:@" " withString:@" "];
}
NSArray * newStylePropertiesArray = [styleAttributeString componentsSeparatedByString:@";"];
NSInteger newStylePropertiesArrayCount = newStylePropertiesArray.count;
for (NSInteger i = 0; i < newStylePropertiesArrayCount; i++)
{
NSString * aPropertyString = newStylePropertiesArray[i];
aPropertyString = [aPropertyString stringByTrimmingCharactersInSet:whitespaceCharacterSet];
if ([aPropertyString length] > 0)
{
NSArray * aPropertyArray = [aPropertyString componentsSeparatedByString:@":"];
NSInteger aPropertyArrayCount = [aPropertyArray count];
if (aPropertyArrayCount > 0)
{
NSString * propertyNameString = [aPropertyArray objectAtIndex:0];
NSString * propertyValueString = @"";
if (aPropertyArrayCount == 2)
{
propertyValueString = [aPropertyArray objectAtIndex:1];
}
NSMutableDictionary * propertyDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:
propertyNameString, @"property",
propertyValueString, @"value",
NULL];
[self.stylePropertiesArray addObject:propertyDictionary];
}
}
}
}
}
[stylePropertiesTableView reloadData];
stylePropertiesTableView.rowHeight = 14.0f;
}
//==================================================================================
// numberOfRowsInTableView:
//==================================================================================
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
{
return (self.stylePropertiesArray).count;
}
//==================================================================================
// itemTextFieldUpdated:
//==================================================================================
- (IBAction)itemTextFieldUpdated:(id)sender
{
//NSInteger rowIndex = [stylePropertiesTableView rowForView:sender];
//NSInteger columnIndex = [stylePropertiesTableView columnForView:sender];
NSInteger rowIndex = [stylePropertiesTableView selectedRow];
NSInteger columnIndex = [stylePropertiesTableView selectedColumn];
NSString * stringValue = [sender stringValue];
stringValue = [stringValue copy];
NSView * senderSuperview = NULL;
if ([sender isKindOfClass:[NSView class]] == YES)
{
NSView * senderView = sender;
senderSuperview = senderView.superview;
}
NSMutableDictionary * aStylePropertyDictionary = NULL;
if (sender == propertyNameComboBox)
{
NSDictionary * propertiesDictionary = [self.cssPropertiesDictionary objectForKey:@"properties"];
NSDictionary * propertyDictionary = [propertiesDictionary objectForKey:stringValue];
NSArray * propertyValuesArray = [propertyDictionary objectForKey:@"values"];
self.styleValuesComboArray = propertyValuesArray;
}
else if (sender == propertyValueComboBox)
{
}
else if ([senderSuperview isKindOfClass:[StylePropertiesTableRowView class]] == YES)
{
// sender was a text cell inside the table view
if (rowIndex < (self.stylePropertiesArray).count)
{
NSTextField * tableCellTextField = sender;
NSString * tableCellString = tableCellTextField.stringValue;
aStylePropertyDictionary = (self.stylePropertiesArray)[rowIndex];
if (columnIndex == 1)
{
[aStylePropertyDictionary setValue:tableCellString forKey:@"property"];
}
else if (columnIndex == 2)
{
[aStylePropertyDictionary setValue:tableCellString forKey:@"value"];
}
NSString * propertyString = aStylePropertyDictionary[@"property"];
if (propertyString != NULL)
{
NSString * valueString = aStylePropertyDictionary[@"value"];
if (valueString == NULL)
{
valueString = @"";
}
propertyNameComboBox.stringValue = propertyString;
propertyValueComboBox.stringValue = valueString;
}
}
}
}
//==================================================================================
// controlTextDidEndEditing:
//==================================================================================
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
{
id sender = aNotification.object;
[self itemTextFieldUpdated:sender];
}
//==================================================================================
// controlTextDidBeginEditing:
//==================================================================================
- (void)controlTextDidBeginEditing:(NSNotification *)aNotification
{
id sender = aNotification.object;
NSTextField * textField = sender;
textField.backgroundColor = [NSColor whiteColor];
}
//==================================================================================
// control:textShouldBeginEditing:
//==================================================================================
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
{
return YES;
}
//==================================================================================
// control:textShouldEndEditing:
//==================================================================================
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
{
return YES;
}
//==================================================================================
// tableView:rowViewForRow:
//==================================================================================
- (NSTableRowView *)tableView:(NSTableView *)tableView
rowViewForRow:(NSInteger)row
{
// from http://stackoverflow.com/questions/10910779/coloring-rows-in-view-based-nstableview
static NSString* const kRowIdentifier = @"AnimateMotionTableRowView";
StylePropertiesTableRowView * rowView = [tableView makeViewWithIdentifier:kRowIdentifier owner:self];
if (rowView == NULL)
{
// Size doesn't matter, the table will set it
rowView = [[StylePropertiesTableRowView alloc] initWithFrame:NSZeroRect];
// This seemingly magical line enables your view to be found
// next time "makeViewWithIdentifier" is called.
rowView.identifier = kRowIdentifier;
}
// Can customize properties here. Note that customizing
// 'backgroundColor' isn't going to work at this point since the table
// will reset it later. Use 'didAddRow' to customize if desired.
return rowView;
}
//==================================================================================
// tableView:viewForTableColumn:row:
//==================================================================================
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
NSTextField * resultView = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
if (resultView == nil)
{
resultView = [[NSTextField alloc] initWithFrame:tableView.frame];
resultView.identifier = tableColumn.identifier;
resultView.font = [NSFont systemFontOfSize:10];
resultView.bordered = NO;
resultView.backgroundColor = [NSColor clearColor];
}
NSString * resultString = @"";
if (row < (self.stylePropertiesArray).count)
{
NSString * tableColumnIdentifier = tableColumn.identifier;
if ([tableColumnIdentifier isEqualToString:@"#"] == YES)
{
resultString = [NSString stringWithFormat:@"%ld", (row + 1)];
resultView.editable = NO;
}
else
{
resultView.editable = YES;
resultView.delegate = (id)self;
NSMutableDictionary * aStylePropertyDictionary = (self.stylePropertiesArray)[row];
if ([tableColumnIdentifier isEqualToString:@"property"] == YES)
{
resultString = aStylePropertyDictionary[@"property"];
}
else if ([tableColumnIdentifier isEqualToString:@"value"] == YES)
{
resultString = aStylePropertyDictionary[@"value"];
}
}
}
if (resultString == NULL)
{
resultString = @"";
}
resultView.stringValue = resultString;
return resultView;
}
//==================================================================================
// tableViewSelectionDidChange:
//==================================================================================
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{
id aTableView = aNotification.object;
if (aTableView == stylePropertiesTableView)
{
[self refreshSelectedRow];
}
}
//==================================================================================
// refreshSelectedRow
//==================================================================================
- (void)refreshSelectedRow
{
NSInteger rowIndex = stylePropertiesTableView.selectedRow;
if (rowIndex >= 0)
{
NSDictionary * stylePropertyDictionary = [self.stylePropertiesArray objectAtIndex:rowIndex];
NSString * propertyNameString = [stylePropertyDictionary objectForKey:@"property"];
NSString * propertyValueString = [stylePropertyDictionary objectForKey:@"value"];
if (propertyNameString == NULL)
{
propertyNameString = @"";
}
if (propertyValueString == NULL)
{
propertyValueString = @"";
}
propertyNameComboBox.stringValue = propertyNameString;
propertyValueComboBox.stringValue = propertyValueString;
NSDictionary * propertiesDictionary = [self.cssPropertiesDictionary objectForKey:@"properties"];
NSDictionary * propertyDictionary = [propertiesDictionary objectForKey:propertyNameString];
NSArray * propertyValuesArray = [propertyDictionary objectForKey:@"values"];
self.styleValuesComboArray = propertyValuesArray;
}
else
{
propertyNameComboBox.stringValue = @"";
propertyValueComboBox.stringValue = @"";
}
}
//==================================================================================
// updateEditForXMLElement:domElement:info:
//==================================================================================
- (void)updateEditForXMLElement:(NSXMLElement *)xmlElement domElement:(DOMElement *)domElement info:(id)infoData
{
// subclasses can override as needed
NSArray * aStylePropertiesArray = infoData;
#pragma unused(aStylePropertiesArray)
[self loadStylePropertiesData];
[stylePropertiesTableView reloadData];
}
//==================================================================================
// cancelButtonAction
//==================================================================================
- (IBAction)cancelButtonAction:(id)sender
{
}
//==================================================================================
// applyChangesButtonAction:
//==================================================================================
- (IBAction)applyChangesButtonAction:(id)sender
{
[self.macSVGPluginCallbacks pushUndoRedoDocumentChanges];
NSInteger selectedRow = stylePropertiesTableView.selectedRow;
NSIndexSet * selectedRowIndexSet = stylePropertiesTableView.selectedRowIndexes;
NSMutableDictionary * newStylePropertyDictionary = NULL;
if (selectedRow >= 0)
{
newStylePropertyDictionary = (self.stylePropertiesArray)[selectedRow];
NSString * newPropertyName = propertyNameComboBox.stringValue;
NSString * newPropertyValue = propertyValueComboBox.stringValue;
[newStylePropertyDictionary setObject:newPropertyName forKey:@"property"];
[newStylePropertyDictionary setObject:newPropertyValue forKey:@"value"];
NSMutableString * styleString = [NSMutableString string];
NSInteger indexOfObject = 0;
for (NSMutableDictionary * stylePropertyDictionary in self.stylePropertiesArray)
{
NSString * aStylePropertyString = stylePropertyDictionary[@"property"];
NSString * aStyleValueString = stylePropertyDictionary[@"value"];
[styleString appendString:aStylePropertyString];
if ([aStyleValueString length] > 0)
{
[styleString appendString:@":"];
[styleString appendString:aStyleValueString];
}
[styleString appendString:@"; "];
indexOfObject++;
}
[self setAttributeName:@"style" value:styleString element:self.pluginTargetXMLElement];
[stylePropertiesTableView reloadData];
[stylePropertiesTableView selectRowIndexes:selectedRowIndexSet byExtendingSelection:NO];
[self updateDocumentViews];
}
}
//==================================================================================
// setAttributeName:value:element:
//==================================================================================
- (void)setAttributeName:(NSString *)attributeName value:(NSString *)attributeValue element:(NSXMLElement *)aElement
{
NSXMLNode * attributeNode = [aElement attributeForName:attributeName];
if (attributeValue.length == 0)
{
if (attributeNode != NULL)
{
[aElement removeAttributeForName:attributeName];
}
}
else
{
if (attributeNode == NULL)
{
attributeNode = [[NSXMLNode alloc] initWithKind:NSXMLAttributeKind];
attributeNode.name = attributeName;
attributeNode.stringValue = @"";
[aElement addAttribute:attributeNode];
}
attributeNode.stringValue = attributeValue;
}
}
//==================================================================================
// addStylePropertyRow:
//==================================================================================
- (IBAction)addStylePropertyRow:(id)sender
{
NSInteger selectedRow = stylePropertiesTableView.selectedRow;
NSMutableDictionary * newStylePropertyDictionary = NULL;
NSInteger insertIndex = selectedRow + 1;
newStylePropertyDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"new-css-style", @"property",
@"new-value", @"value",
NULL];
[self.stylePropertiesArray insertObject:newStylePropertyDictionary atIndex:insertIndex];
[stylePropertiesTableView reloadData];
NSIndexSet * rowIndexSet = [NSIndexSet indexSetWithIndex:insertIndex];
[stylePropertiesTableView selectRowIndexes:rowIndexSet byExtendingSelection:NO];
}
//==================================================================================
// deleteStylePropertyRow:
//==================================================================================
- (IBAction)deleteStylePropertyRow:(id)sender
{
NSInteger selectedRow = stylePropertiesTableView.selectedRow;
if (selectedRow >= 0)
{
[self.stylePropertiesArray removeObjectAtIndex:selectedRow];
[stylePropertiesTableView reloadData];
}
}
//==================================================================================
// numberOfItemsInComboBox
//==================================================================================
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox
{
NSInteger result = 0;
if (aComboBox == propertyNameComboBox)
{
result = self.styleNamesComboArray.count;
}
else if (aComboBox == propertyValueComboBox)
{
result = self.styleValuesComboArray.count;
}
return result;
}
//==================================================================================
// objectValueForItemAtIndex
//==================================================================================
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index
{
id result = @"";
if (aComboBox == propertyNameComboBox)
{
if (index < self.styleNamesComboArray.count)
{
result = [self.styleNamesComboArray objectAtIndex:index];
}
}
else if (aComboBox == propertyValueComboBox)
{
if (index < self.styleValuesComboArray.count)
{
result = [self.styleValuesComboArray objectAtIndex:index];
}
}
return result;
}
@end
@@ -0,0 +1,280 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="StyleAttributeEditor">
<connections>
<outlet property="applyChangesButton" destination="viU-Pj-PB0" id="Qcg-zw-tOh"/>
<outlet property="cancelButton" destination="hks-hW-QMv" id="zfp-72-8YN"/>
<outlet property="pluginView" destination="qsn-T2-jYx" id="WOh-l0-gXb"/>
<outlet property="propertyNameComboBox" destination="PnW-u4-X2H" id="PT2-Gh-CqY"/>
<outlet property="propertyValueComboBox" destination="uIp-3s-CR3" id="TQL-VH-nk7"/>
<outlet property="stylePropertiesTableView" destination="nYF-eL-uuE" id="9WJ-O7-cWx"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView misplaced="YES" id="qsn-T2-jYx" customClass="FlippedView">
<rect key="frame" x="0.0" y="0.0" width="270" height="282"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<customView misplaced="YES" id="Y2N-ke-XhC">
<rect key="frame" x="0.0" y="0.0" width="270" height="282"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="azs-kV-qPB">
<rect key="frame" x="18" y="260" width="114" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Style Attribute Editor" id="eAu-CI-9kL">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<scrollView misplaced="YES" autohidesScrollers="YES" horizontalLineScroll="22" horizontalPageScroll="10" verticalLineScroll="22" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="ZGL-VY-zdK">
<rect key="frame" x="23" y="120" width="224" height="134"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<clipView key="contentView" copiesOnScroll="NO" id="wBH-Li-bz9">
<rect key="frame" x="1" y="0.0" width="222" height="133"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="20" rowSizeStyle="automatic" headerView="Ah8-cG-fUy" viewBased="YES" id="nYF-eL-uuE">
<rect key="frame" x="0.0" y="0.0" width="222" height="110"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<tableViewGridLines key="gridStyleMask" vertical="YES" horizontal="YES"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="34.90234375" minWidth="10" maxWidth="3.4028234663852886e+38" id="Hgs-Xk-hSd">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="No.">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="w39-FQ-Gus">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView misplaced="YES" id="0yI-zo-2Hm">
<rect key="frame" x="1" y="1" width="35" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" id="ypr-Os-g1R">
<rect key="frame" x="0.0" y="3" width="91" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="5hQ-gp-DVx">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="textField" destination="ypr-Os-g1R" id="s93-Aa-p69"/>
</connections>
</tableCellView>
</prototypeCellViews>
</tableColumn>
<tableColumn width="78.515625" minWidth="10" maxWidth="3.4028234663852886e+38" id="7f6-ha-QMh">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="property">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="HXU-xu-Nqg">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView misplaced="YES" id="iqT-Er-7aT">
<rect key="frame" x="39" y="1" width="79" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" id="ldM-vi-fhq">
<rect key="frame" x="0.0" y="3" width="122" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="P4u-MW-rvV">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="textField" destination="ldM-vi-fhq" id="xEu-hV-5l9"/>
</connections>
</tableCellView>
</prototypeCellViews>
</tableColumn>
<tableColumn identifier="" width="99" minWidth="10" maxWidth="3.4028234663852886e+38" id="3M4-Tb-llV">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="value">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="xXT-eU-Rkt">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="J5R-MW-I8W">
<rect key="frame" x="121" y="1" width="99" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="vEk-NG-fg4">
<rect key="frame" x="0.0" y="0.0" width="99" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="XZr-rE-VID">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="textField" destination="vEk-NG-fg4" id="R1g-14-7GQ"/>
</connections>
</tableCellView>
</prototypeCellViews>
</tableColumn>
</tableColumns>
<connections>
<action selector="itemTextFieldUpdated:" target="-2" id="2e2-aD-28z"/>
<outlet property="dataSource" destination="-2" id="EER-EJ-X9X"/>
<outlet property="delegate" destination="-2" id="vuq-D8-xZj"/>
<outlet property="nextKeyView" destination="PnW-u4-X2H" id="xGK-em-nSH"/>
</connections>
</tableView>
</subviews>
<nil key="backgroundColor"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="YW6-Kh-vGO">
<rect key="frame" x="1" y="89" width="222" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="M9H-jE-mg4">
<rect key="frame" x="-100" y="-100" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" id="Ah8-cG-fUy">
<rect key="frame" x="0.0" y="0.0" width="222" height="23"/>
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
<button verticalHuggingPriority="750" misplaced="YES" id="hks-hW-QMv">
<rect key="frame" x="89" y="14" width="62" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Hah-sB-oMM">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancelButtonAction:" target="-2" id="nOo-kr-a4H"/>
</connections>
</button>
<button verticalHuggingPriority="750" misplaced="YES" id="viU-Pj-PB0">
<rect key="frame" x="149" y="14" width="106" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Apply Changes" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="yhH-48-Ap8">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<action selector="applyChangesButtonAction:" target="-2" id="mbY-9E-jdQ"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="EZz-d7-5Oe">
<rect key="frame" x="21" y="92" width="61" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Property:" id="hQZ-bL-aVL">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="VXA-Vq-QCN">
<rect key="frame" x="21" y="58" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Value:" id="vuN-hr-cwn">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<comboBox verticalHuggingPriority="750" misplaced="YES" id="PnW-u4-X2H">
<rect key="frame" x="88" y="87" width="162" height="26"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" usesDataSource="YES" numberOfVisibleItems="5" id="Foy-si-PES">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</comboBoxCell>
<connections>
<action selector="itemTextFieldUpdated:" target="-2" id="Z8f-hx-o8T"/>
<outlet property="dataSource" destination="-2" id="2q2-xo-du8"/>
<outlet property="delegate" destination="-2" id="Q8f-0g-bUl"/>
</connections>
</comboBox>
<button verticalHuggingPriority="750" misplaced="YES" id="Das-qC-AJY">
<rect key="frame" x="20" y="17" width="26" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" title="+" bezelStyle="shadowlessSquare" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Qda-9x-gbO">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="addStylePropertyRow:" target="-2" id="ta5-e3-5rJ"/>
</connections>
</button>
<button verticalHuggingPriority="750" misplaced="YES" id="v0t-Rs-851">
<rect key="frame" x="46" y="17" width="26" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" title="-" bezelStyle="shadowlessSquare" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="gFG-w6-cRo">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="deleteStylePropertyRow:" target="-2" id="Cy4-oS-eE9"/>
</connections>
</button>
<comboBox verticalHuggingPriority="750" misplaced="YES" id="uIp-3s-CR3">
<rect key="frame" x="68" y="53" width="161" height="26"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" usesDataSource="YES" numberOfVisibleItems="5" id="HpQ-wp-Qvu">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</comboBoxCell>
<connections>
<action selector="itemTextFieldUpdated:" target="-2" id="0MG-Z7-BV6"/>
<outlet property="dataSource" destination="-2" id="mUF-C9-DRu"/>
<outlet property="delegate" destination="-2" id="dOr-NJ-8im"/>
</connections>
</comboBox>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" id="lNS-zf-ca0">
<rect key="frame" x="231" y="54" width="19" height="27"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="8eB-Wp-l2B"/>
</stepper>
</subviews>
</customView>
</subviews>
<point key="canvasLocation" x="71" y="253"/>
</customView>
</objects>
</document>
@@ -0,0 +1,13 @@
//
// StylePropertiesTableRowView.h
// StyleAttributeEditor
//
// Created by Douglas Ward on 1/2/17.
// Copyright © 2017 ArkPhone LLC. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface StylePropertiesTableRowView : NSTableRowView
@end
@@ -0,0 +1,31 @@
//
// StylePropertiesTableRowView.m
// StyleAttributeEditor
//
// Created by Douglas Ward on 1/2/17.
// Copyright © 2017 ArkPhone LLC. All rights reserved.
//
#import "StylePropertiesTableRowView.h"
@implementation StylePropertiesTableRowView
/*
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
// Drawing code here.
}
*/
- (NSBackgroundStyle)interiorBackgroundStyle
{
return NSBackgroundStyleLight;
}
- (NSTableViewSelectionHighlightStyle)selectionHighlightStyle
{
return NSTableViewSelectionHighlightStyleSourceList;
}
@end
@@ -94,8 +94,8 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="lHh-er-klF">
<rect key="frame" x="53" y="166" width="44" height="19"/>
<textField verticalHuggingPriority="750" misplaced="YES" id="lHh-er-klF">
<rect key="frame" x="53" y="166" width="42" height="19"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="sd8-dp-CZV">
<font key="font" metaFont="smallSystem"/>
@@ -258,7 +258,7 @@
</subviews>
</customView>
</subviews>
<point key="canvasLocation" x="115" y="393"/>
<point key="canvasLocation" x="-26" y="1023"/>
</customView>
<viewController id="HOn-k0-Fu2" userLabel="Fonts Popover View Controller" customClass="FontPopoverViewController">
<connections>
+1 -1
View File
@@ -35,4 +35,4 @@ Open "macSVG.xcworkspace" in Xcode, set the build target to "macSVG Debug", buil
#
Copyright (c) 2016 by ArkPhone, LLC.
Copyright (c) 2016-2017 by ArkPhone, LLC.
+4
View File
@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
0E06F8891D59ADC700265FA2 /* PathFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E06F8881D59ADC700265FA2 /* PathFunctions.m */; };
0E0A050A1E1B12C4002A8035 /* StyleAttributeEditor.plugin in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0E0A05051E1B1273002A8035 /* StyleAttributeEditor.plugin */; };
0E0AEDB11D8A9344004D82C3 /* path_markers_example.svg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0E0AED991D8A932F004D82C3 /* path_markers_example.svg */; };
0E0AEDB31D8AE663004D82C3 /* pattern_example.svg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0E0AEDB21D8AE618004D82C3 /* pattern_example.svg */; };
0E0AEDB51D8AE6A9004D82C3 /* pattern_example2.svg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0E0AEDB41D8AE6A3004D82C3 /* pattern_example2.svg */; };
@@ -768,6 +769,7 @@
0E47E11E17ECCABE00C029DD /* PathElementShapeAnimationEditor.plugin in CopyFiles */,
0ED841221800FCCA003985CD /* PieChartGenerator.plugin in CopyFiles */,
0EA78C3B1D84180900C9D4C8 /* PointsAttributeEditor.plugin in CopyFiles */,
0E0A050A1E1B12C4002A8035 /* StyleAttributeEditor.plugin in CopyFiles */,
0EC2EEA61D683C8A00736FE4 /* SVGAttributeEditor.plugin in CopyFiles */,
0E47E12017ECCABE00C029DD /* SVGElementEditor.plugin in CopyFiles */,
0E47E12117ECCABE00C029DD /* TextElementEditor.plugin in CopyFiles */,
@@ -1360,6 +1362,7 @@
0E06F8871D59ADC700265FA2 /* PathFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = PathFunctions.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
0E06F8881D59ADC700265FA2 /* PathFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = PathFunctions.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
0E0799711D8A53C9001064D5 /* MacSVGPluginCallbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MacSVGPluginCallbacks.h; sourceTree = "<group>"; };
0E0A05051E1B1273002A8035 /* StyleAttributeEditor.plugin */ = {isa = PBXFileReference; lastKnownFileType = file; path = StyleAttributeEditor.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
0E0AED991D8A932F004D82C3 /* path_markers_example.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = path_markers_example.svg; sourceTree = "<group>"; };
0E0AEDB21D8AE618004D82C3 /* pattern_example.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = pattern_example.svg; sourceTree = "<group>"; };
0E0AEDB41D8AE6A3004D82C3 /* pattern_example2.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = pattern_example2.svg; sourceTree = "<group>"; };
@@ -2325,6 +2328,7 @@
0EEFBB2A17EA2C03006887CA /* PathElementShapeAnimationEditor.plugin */,
0ED841201800FCAB003985CD /* PieChartGenerator.plugin */,
0EA78C3A1D8417E600C9D4C8 /* PointsAttributeEditor.plugin */,
0E0A05051E1B1273002A8035 /* StyleAttributeEditor.plugin */,
0EC2EEA51D683C5D00736FE4 /* SVGAttributeEditor.plugin */,
0EEFBB2C17EA2C03006887CA /* SVGElementEditor.plugin */,
0EEFBB2D17EA2C03006887CA /* TextElementEditor.plugin */,
+3
View File
@@ -56,6 +56,9 @@
<FileRef
location = "group:PointsAttributeEditor/PointsAttributeEditor.xcodeproj">
</FileRef>
<FileRef
location = "group:StyleAttributeEditor/StyleAttributeEditor.xcodeproj">
</FileRef>
<FileRef
location = "group:SVGAttributeEditor/SVGAttributeEditor.xcodeproj">
</FileRef>
+23 -13
View File
@@ -1,7 +1,7 @@
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red100\green56\blue32;\red196\green26\blue22;\red92\green38\blue153;
\red0\green0\blue255;}
\red0\green0\blue255;\red163\green21\blue21;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
@@ -175,25 +175,27 @@ The XML SVG graphics format is part of the new HTML5 standard for web design, so
\pard\pardeftab720\partightenfactor0
\b0 \cf0 In XCode, select the "MacSVG Plugin Projects/MacSVG Plugins" folder in the Project navigator.\
Create a new Cocoa Bundle project from the Bundle template in the Framework & Bundle category. \
Create a new MacOS Bundle project by selecting the Bundle template in the Framework & Bundle category. \
For this example, the plugin project product name is "XyzElementEditor" for an element editor, or "XyzAttributeEditor" for an attribute editor.\
Company identifier: "com.arkphone"\
Framework: Cocoa\
Add the "MacSVGPlugin.framework" to the project.\
In the plugin target's Build Settings, changer the Wrapper Extension from "bundle" to "plugin".\
Create a new Objective-C class as a subclass of MacSVGPlugin, name the class like "XyzElementEditor" or "XyzAttributeEditor".\
In the new project options, set the Bundle Extension to "plugin".\
Disable the option to "Create Git repository". Instead, the Git repository for plugin projects already exists in the main macSVG project, so it will be used instead.\
Set the "Add to:" popup menu to the "MacSVG" project, and the "Group" popup menu to the "MacSVG Plugin Projects/MacSVG Plugins" folder. Click the "Create" button to create the plugin project.\
Plugin projects should be ordered alphabetically by name in the Project navigator, so drag the new plugin project folder to the correct location inside the "MacSVG Plugins" folder.\
Select the new plugin project folder icon in the Project navigator, and add a new Cocoa Class file as a subclass of MacSVGPlugin, naming the class like "XyzElementEditor" or "XyzAttributeEditor". Currently, all plugins are implemented in Objective-C language.\
In XyzElementEditor.h or XyzAttributeEditor.h, verify or add import directive -
\f1\fs22 \cf2 \CocoaLigature0 \
\pard\tx560\pardeftab560\pardirnatural\partightenfactor0
\cf2 #import \cf3 <MacSVGPlugin/MacSVGPlugin.h>
\f0\fs24 \cf0 \CocoaLigature1 \
\pard\pardeftab720\partightenfactor0
\cf0 Create a new empty NIB file for the plugin view, named like "XyzElementEditor.xib".\
\cf0 Create a new empty User Interface NIB file for the plugin view, named like "XyzElementEditor.xib".\
In Interface Builder, set the NIB File's Owner object to your plugin object, e.g. "XyzElementEditor" or "XyzAttributeEditor".\
In the NIB's File Inspector, remove the checkbox setting for "Use Auto-Layout".\
In the NIB's File Inspector, disable the checkbox option setting for "Use Auto-Layout".\
For element or attribute editors -\
In the NIB editor, create a new NSView custom view for the plug-in main view.\
In the NIB's Size Inspector, set the dimensions for the plug-in's main view for width=270 and height=346, and enable all of the struts and springs for autosizing the view.\
In the NIB editor, create a new NSView custom view for the plug-in main view (or copy and paste a main view from an existing plugin xib).\
In the NIB's Size Inspector, set the dimensions for the plug-in's main view for width=270 and height=346, and enable all of the struts and springs for autosizing the view. (The height can be increased if needed. The plugin panel view in the main application contains an NSScroller to contain the plugin view.\
Select File's Owner and use the Connection Inspector to connect the "pluginView" outlet to the main view.\
In the main code unit (e.g. XyzPlugin.m), implement one of these mandatory methods, and return a string for valid plug-in for the context, or NULL -\
\pard\tx560\pardeftab560\pardirnatural\partightenfactor0
@@ -202,13 +204,21 @@ The XML SVG graphics format is part of the new HTML5 standard for web design, so
For attribute editors- (\cf4 NSString\cf0 *)isEditorForElement:(NSXMLElement *)aElement elementName:(\cf4 NSString\cf0 *)elementName attribute:(\cf4 NSString\cf0 *)attributeName\
\pard\pardeftab720\partightenfactor0
\f0\fs24 \cf0 \CocoaLigature1 For menu plug-ins -\
\f0\fs24 \cf0 \CocoaLigature1 Add the "MacSVGPlugin.framework" to the project navigator items.\
Add the file named "macSVGPluginConfig.xcconfig" to the project navigator items.\
Add the "macSVGPluginConfig.xcconfig" to the project navigator items.\
For menu plug-ins -\
Implement
\f1\fs22 \CocoaLigature0 - (\cf5 BOOL\cf0 )beginMenuPlugIn
\f0\fs24 \CocoaLigature1 \
If needed, in the NIB editor, create a new NSPanel modal window for the plug-in main view\
Menu plug-ins are responsible for opening and closing their windows.\
The plugin is now ready for your custom implementation.\
\
The plugin is now ready to start using your custom implementation.\
\
It may be useful in the plugin's Build Settings "HEADER_SEARCH_PATH" to add "$(SRCROOT)/../../../macSVG" with recursive searching, if your plugin needs direct access into the main application. Then the
\f1\fs22 \cf5 \CocoaLigature0 #import \cf6 "MacSVGDocumentWindowController.h"
\f0\fs24 \cf0 \CocoaLigature1 directive can be used in your plugin's source code.\
\
Element editors should return a string in the
\f1\fs22 \CocoaLigature0 isEditorForElement:elementName:
@@ -221,8 +231,8 @@ The XML SVG graphics format is part of the new HTML5 standard for web design, so
\f1\fs22 \CocoaLigature0 isEditorForElement:elementName:
\f0\fs24 \CocoaLigature1 method.\
\
If the plugin is to be embedded in the app, add the plugin bundle to the main app's file list in the Plugins group.\
Then, add the plugin to the target's Build Phase, Copy Files section for the Plugins destination.\
To embed the plugin, add the plugin bundle to the main app's file list in the main application's Plugins group. In the File Inspector, set that copy of the plugin to use the Location "Relative to Build Products". \
Then, add that copy of the plugin to the main application's Build Phases, in the Copy Files phase where the Destination is set to "Plugins".\
\
\
=================================================================================================\