The functions provided in IRIReferenceAttributeEditor plugin are now merged into the SVGAttributeEditor plugin, and the IRIReferenceEditor is removed from the macSVG application bundle.

The IRI Reference attributes (e.g., "url(#radialGradient1)") are now appended to the "Defined Values" popup button menu, with a separator item between the predefined values, and the IRI references found in the document.

The prototypes for the <animate>, <animateColor>, <animateMotion>, and <animateTransform> elements changed the default value for the "fill" attribute from "freeze" to "remove".
This commit is contained in:
dsward2
2017-01-06 20:13:56 -06:00
committed by dsward2
parent 8d3fbed17b
commit 33efcb5b18
10 changed files with 368 additions and 71 deletions
@@ -1,10 +1,11 @@
<?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>
<deployment version="1080" identifier="macosx"/>
<development version="5000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="10116"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="11542"/>
<capability name="box content view" minToolsVersion="7.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="ColorAttributeEditor">
@@ -21,16 +22,16 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="1" userLabel="ColorAttributeEditorView" customClass="FlippedView">
<rect key="frame" x="0.0" y="0.0" width="270" height="213"/>
<customView misplaced="YES" id="1" userLabel="ColorAttributeEditorView" customClass="FlippedView">
<rect key="frame" x="0.0" y="0.0" width="270" height="198"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<customView id="i5e-cB-zNA">
<rect key="frame" x="0.0" y="0.0" width="270" height="224"/>
<rect key="frame" x="0.0" y="-15" width="270" height="224"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="6">
<rect key="frame" x="72" y="179" width="93" height="19"/>
<textField verticalHuggingPriority="750" misplaced="YES" id="6">
<rect key="frame" x="72" y="185" width="93" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" title="Text Field" drawsBackground="YES" id="7">
<font key="font" metaFont="smallSystem"/>
@@ -41,8 +42,8 @@
<action selector="setColorButtonAction:" target="-2" id="mKv-Sg-Wf0"/>
</connections>
</textField>
<scrollView autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="10" verticalLineScroll="16" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="25">
<rect key="frame" x="8" y="46" width="255" height="119"/>
<scrollView misplaced="YES" autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="10" verticalLineScroll="16" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="25">
<rect key="frame" x="8" y="52" width="255" height="119"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="o1d-EF-GeW">
<rect key="frame" x="1" y="0.0" width="253" height="118"/>
@@ -86,7 +87,6 @@
</connections>
</tableView>
</subviews>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="27">
<rect key="frame" x="-100" y="-100" width="223" height="15"/>
@@ -101,16 +101,16 @@
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
<colorWell id="18">
<rect key="frame" x="20" y="173" width="44" height="31"/>
<colorWell misplaced="YES" id="18">
<rect key="frame" x="20" y="179" width="44" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="color" red="0.05813049898" green="0.055541899059999997" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="colorWellAction:" target="-2" id="56"/>
</connections>
</colorWell>
<button verticalHuggingPriority="750" id="45">
<rect key="frame" x="3" y="14" width="102" height="28"/>
<button verticalHuggingPriority="750" misplaced="YES" id="45">
<rect key="frame" x="3" y="20" width="102" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Set Web Color" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="46">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -120,8 +120,8 @@
<action selector="setWebColorButtonAction:" target="-2" id="52"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="4">
<rect key="frame" x="168" y="174" width="87" height="28"/>
<button verticalHuggingPriority="750" misplaced="YES" id="4">
<rect key="frame" x="168" y="180" width="87" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Set Color" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -131,8 +131,8 @@
<action selector="setColorButtonAction:" target="-2" id="51"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="zQ3-vb-go7">
<rect key="frame" x="103" y="14" width="92" height="28"/>
<button verticalHuggingPriority="750" misplaced="YES" id="zQ3-vb-go7">
<rect key="frame" x="103" y="20" width="92" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Set Gradient" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5wu-iW-adD">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -142,8 +142,8 @@
<action selector="colorGradientButtonAction:" target="-2" id="dmX-63-wmJ"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="vvI-Xs-zSf">
<rect key="frame" x="193" y="14" width="75" height="28"/>
<button verticalHuggingPriority="750" misplaced="YES" id="vvI-Xs-zSf">
<rect key="frame" x="193" y="20" width="75" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Set None" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Zm2-t9-AeM">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -156,7 +156,7 @@
</subviews>
</customView>
</subviews>
<point key="canvasLocation" x="341" y="-14.5"/>
<point key="canvasLocation" x="69" y="51"/>
</customView>
<viewController id="nd4-aZ-TFK" userLabel="Gradient Popover View Controller" customClass="GradientEditorPopoverViewController">
<connections>
@@ -213,10 +213,10 @@
<outlet property="resourceLoadDelegate" destination="nd4-aZ-TFK" id="Jqh-S1-BeO"/>
</connections>
</webView>
<box autoresizesSubviews="NO" title="Color Stops" borderType="line" id="aoT-dN-9U3">
<box autoresizesSubviews="NO" borderType="line" title="Color Stops" id="aoT-dN-9U3">
<rect key="frame" x="17" y="16" width="393" height="153"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView">
<view key="contentView" id="8lj-dw-j8i">
<rect key="frame" x="1" y="1" width="391" height="137"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -246,11 +246,11 @@
<rect key="frame" x="192" y="40" width="181" height="87"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="Zlj-zg-FMQ">
<rect key="frame" x="1" y="17" width="179" height="69"/>
<rect key="frame" x="1" y="0.0" width="179" height="86"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="N9s-0Q-0Kt" viewBased="YES" id="Ho9-lU-nOJ">
<rect key="frame" x="0.0" y="0.0" width="169" height="0.0"/>
<rect key="frame" x="0.0" y="0.0" width="179" height="69"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -335,7 +335,6 @@
</connections>
</tableView>
</subviews>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="M8l-rk-G94">
<rect key="frame" x="-100" y="-100" width="179" height="15"/>
@@ -448,13 +447,11 @@
</comboBox>
</subviews>
</view>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</box>
<box autoresizesSubviews="NO" title="Gradients" borderType="line" id="tjD-mf-38v">
<box autoresizesSubviews="NO" borderType="line" title="Gradients" id="tjD-mf-38v">
<rect key="frame" x="17" y="179" width="525" height="153"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView">
<view key="contentView" id="8Qj-bS-zwQ">
<rect key="frame" x="1" y="1" width="523" height="137"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -626,7 +623,7 @@
<rect key="frame" x="194" y="41" width="311" height="86"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="XEZ-EF-zPd">
<rect key="frame" x="1" y="17" width="309" height="68"/>
<rect key="frame" x="1" y="0.0" width="309" height="85"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="xVX-Pe-OFv" viewBased="YES" id="ueQ-kV-d1k">
@@ -709,7 +706,6 @@
</connections>
</tableView>
</subviews>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="laO-4y-ivg">
<rect key="frame" x="-100" y="-100" width="223" height="15"/>
@@ -763,8 +759,6 @@
</button>
</subviews>
</view>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</box>
<button verticalHuggingPriority="750" id="caQ-RI-20S">
<rect key="frame" x="450" y="14" width="60" height="28"/>
@@ -6,6 +6,12 @@
// Copyright © 2016 ArkPhone LLC. All rights reserved.
//
/*********************
20170106 This plugin editor was merged with the SVGElementEditor and removed from the macSVG application bundle
**********************/
#import <MacSVGPlugin/MacSVGPlugin.h>
@interface IRIReferenceAttributeEditor : MacSVGPlugin <NSComboBoxDelegate, NSComboBoxDataSource>
@@ -6,6 +6,13 @@
// Copyright © 2016 ArkPhone LLC. All rights reserved.
//
/*********************
20170106 This plugin editor was merged with the SVGElementEditor and removed from the macSVG application bundle
**********************/
#import "IRIReferenceAttributeEditor.h"
@implementation IRIReferenceAttributeEditor
@@ -20,6 +20,9 @@
IBOutlet NSButton * setDefinedValueButton;
}
@property (strong) NSMutableArray * iriReferencesArray;
- (IBAction)setValueButtonAction:(id)sender;
- (IBAction)setDefinedValueButtonAction:(id)sender;
- (IBAction)definedValuePopUpButtonAction:(id)sender;
@@ -27,6 +27,7 @@
self = [super init];
if (self) {
// Initialization code here.
self.iriReferencesArray = [NSMutableArray array];
}
return self;
@@ -465,6 +466,35 @@
}
}
}
[self buildIRIReferencesArrayForXMLElement:newPluginTargetXMLElement domElement:newPluginTargetDOMElement
attributeName:newAttributeName existingValue:existingValue];
BOOL dividerWasAdded = NO;
for (NSXMLElement * aXMLElement in self.iriReferencesArray)
{
//NSLog(@"aXMLElement=%@", aXMLElement);
NSXMLNode * idAttributeNode = [aXMLElement attributeForName:@"id"];
if (idAttributeNode != NULL)
{
NSString * idAttributeString = idAttributeNode.stringValue;
if (idAttributeString.length > 0)
{
if (dividerWasAdded == NO)
{
[[definedValuePopUpButton menu] addItem:[NSMenuItem separatorItem]];
dividerWasAdded = YES;
}
NSString * valueString = [NSString stringWithFormat:@"url(#%@)", idAttributeString];
[definedValuePopUpButton addItemWithTitle:valueString];
}
}
}
if (definedItemsFound == YES)
{
@@ -508,4 +538,166 @@
}
}
//==================================================================================
// buildIRIReferencesArrayForXMLElement:domElement:attributeName:existingValue:
//==================================================================================
- (void)buildIRIReferencesArrayForXMLElement:(NSXMLElement *)newPluginTargetXMLElement
domElement:(DOMElement *)newPluginTargetDOMElement
attributeName:(NSString *)newAttributeName
existingValue:(NSString *)existingValue
{
NSString * xpathQuery = @"*";
NSString * elementName = newPluginTargetXMLElement.name;
// check elements first
if ([elementName isEqualToString:@"a"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"altGlyph"] == YES)
{
xpathQuery = @".//altGlyphDef|.//glyph";
}
else if ([elementName isEqualToString:@"animate"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"animateColor"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"animateMotion"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"animateTransform"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"color-profile"] == YES)
{
xpathQuery = @"*"; // TODO: FIXME:
}
else if ([elementName isEqualToString:@"cursor"] == YES)
{
xpathQuery = @".//cursor";
}
else if ([elementName isEqualToString:@"feImage"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"filter"] == YES)
{
xpathQuery = @".//filter";
}
else if ([elementName isEqualToString:@"image"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"linearGradient"] == YES)
{
xpathQuery = @".//linearGradient|.//radialGradient";
}
else if ([elementName isEqualToString:@"marker"] == YES)
{
xpathQuery = @".//marker";
}
else if ([elementName isEqualToString:@"pattern"] == YES)
{
xpathQuery = @".//pattern";
}
else if ([elementName isEqualToString:@"radialGradient"] == YES)
{
xpathQuery = @".//linearGradient|.//radialGradient";
}
else if ([elementName isEqualToString:@"script"] == YES)
{
xpathQuery = @""; // TODO: FIXME:
}
else if ([elementName isEqualToString:@"textPath"] == YES)
{
xpathQuery = @".//path";
}
else if ([elementName isEqualToString:@"tref"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"set"] == YES)
{
xpathQuery = @"*";
}
else if ([elementName isEqualToString:@"use"] == YES)
{
xpathQuery = @"*";
}
// check attributes next
if ([newAttributeName isEqualToString:@"clip-path"] == YES)
{
xpathQuery = @".//clipPath";
}
else if ([newAttributeName isEqualToString:@"color-profile"] == YES)
{
xpathQuery = @".//color-profile";
}
else if ([newAttributeName isEqualToString:@"cursor"] == YES)
{
xpathQuery = @"*";
}
else if ([newAttributeName isEqualToString:@"fill"] == YES)
{
xpathQuery = @".//linearGradient|.//radialGradient|.//pattern";
}
else if ([newAttributeName isEqualToString:@"filter"] == YES)
{
xpathQuery = @".//filter";
}
else if ([newAttributeName isEqualToString:@"marker-start"] == YES)
{
xpathQuery = @".//marker";
}
else if ([newAttributeName isEqualToString:@"marker-mid"] == YES)
{
xpathQuery = @".//marker";
}
else if ([newAttributeName isEqualToString:@"marker-end"] == YES)
{
xpathQuery = @".//marker";
}
else if ([newAttributeName isEqualToString:@"mask"] == YES)
{
xpathQuery = @".//mask";
}
else if ([newAttributeName isEqualToString:@"stroke"] == YES)
{
xpathQuery = @".//linearGradient|.//radialGradient|.//pattern";
}
NSXMLElement * rootElement = [self.svgXmlDocument rootElement];
NSError * error = NULL;
NSArray * xpathResultsArray = [rootElement nodesForXPath:xpathQuery error:&error];
[self.iriReferencesArray removeAllObjects];
for (NSXMLElement * aXMLElement in xpathResultsArray)
{
NSXMLNode * idAttributeNode = [aXMLElement attributeForName:@"id"];
if (idAttributeNode != NULL)
{
NSString * idAttributeString = idAttributeNode.stringValue;
if (idAttributeString.length > 0)
{
[self.iriReferencesArray addObject:aXMLElement];
}
}
}
}
@end
@@ -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="15G1004" 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="SVGAttributeEditor">
@@ -122,12 +123,9 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="9Ff-DZ-MbN">
<box verticalHuggingPriority="750" boxType="separator" id="9Ff-DZ-MbN">
<rect key="frame" x="21" y="86" width="230" height="5"/>
<autoresizingMask key="autoresizingMask" widthSizable="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>
<popUpButton verticalHuggingPriority="750" id="4Pj-tA-gmX">
<rect key="frame" x="18" y="43" width="236" height="22"/>
@@ -150,7 +148,7 @@
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="zoc-eO-fuT">
<rect key="frame" x="18" y="66" width="236" height="14"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Defined Values" id="hkF-2R-MMQ">
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Defined Values and IRI References:" id="hkF-2R-MMQ">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-4
View File
@@ -719,7 +719,6 @@
0EEECD281D913A090050AC2F /* macSVG.svg in Resources */ = {isa = PBXBuildFile; fileRef = 0EEECD271D913A090050AC2F /* macSVG.svg */; };
0EEECD2A1D923BD80050AC2F /* xhtml_with_javascript.xhtml in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0EEECD291D923BBC0050AC2F /* xhtml_with_javascript.xhtml */; };
0EF29D991D7955BC00267844 /* AnimateTransformElementEditor.plugin in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0EF29D981D7955B700267844 /* AnimateTransformElementEditor.plugin */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
0EF29DBC1D7B9FD000267844 /* IRIReferenceAttributeEditor.plugin in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0EF29DBB1D7B9FBA00267844 /* IRIReferenceAttributeEditor.plugin */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
0EF420DF1D75588200A667D9 /* linearGradient_element.svg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0EF420DD1D75586400A667D9 /* linearGradient_element.svg */; };
0EF420E31D7561CE00A667D9 /* gaussian_blur_filter_element.svg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0EF420E01D75618400A667D9 /* gaussian_blur_filter_element.svg */; };
0EF420E51D758E4100A667D9 /* clipPath_element_and_clip-path_attribute.svg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0EF420E41D758E3400A667D9 /* clipPath_element_and_clip-path_attribute.svg */; };
@@ -764,7 +763,6 @@
0E47E11917ECCABE00C029DD /* ColorAttributeEditor.plugin in CopyFiles */,
0E47E11A17ECCABE00C029DD /* CoordinatesAttributeEditor.plugin in CopyFiles */,
0E47E11B17ECCABE00C029DD /* ImageElementEditor.plugin in CopyFiles */,
0EF29DBC1D7B9FD000267844 /* IRIReferenceAttributeEditor.plugin in CopyFiles */,
0E47E11D17ECCABE00C029DD /* PathElementEditor.plugin in CopyFiles */,
0E47E11E17ECCABE00C029DD /* PathElementShapeAnimationEditor.plugin in CopyFiles */,
0ED841221800FCCA003985CD /* PieChartGenerator.plugin in CopyFiles */,
@@ -2257,7 +2255,6 @@
0EEFBB2D17EA2C03006887CA /* TextElementEditor.plugin */ = {isa = PBXFileReference; lastKnownFileType = file; path = TextElementEditor.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
0EEFBB4217EA2C46006887CA /* TransformAttributeEditor.plugin */ = {isa = PBXFileReference; lastKnownFileType = file; path = TransformAttributeEditor.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
0EF29D981D7955B700267844 /* AnimateTransformElementEditor.plugin */ = {isa = PBXFileReference; lastKnownFileType = file; path = AnimateTransformElementEditor.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
0EF29DBB1D7B9FBA00267844 /* IRIReferenceAttributeEditor.plugin */ = {isa = PBXFileReference; lastKnownFileType = file; path = IRIReferenceAttributeEditor.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
0EF420DD1D75586400A667D9 /* linearGradient_element.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = linearGradient_element.svg; sourceTree = "<group>"; };
0EF420E01D75618400A667D9 /* gaussian_blur_filter_element.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = gaussian_blur_filter_element.svg; sourceTree = "<group>"; };
0EF420E21D7561AF00A667D9 /* animated_text_on_a_continuous_loop.svg */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = animated_text_on_a_continuous_loop.svg; sourceTree = "<group>"; };
@@ -2323,7 +2320,6 @@
0EEFBB2517EA2C03006887CA /* ColorAttributeEditor.plugin */,
0EEFBB2617EA2C03006887CA /* CoordinatesAttributeEditor.plugin */,
0EEFBB2717EA2C03006887CA /* ImageElementEditor.plugin */,
0EF29DBB1D7B9FBA00267844 /* IRIReferenceAttributeEditor.plugin */,
0EEFBB2917EA2C03006887CA /* PathElementEditor.plugin */,
0EEFBB2A17EA2C03006887CA /* PathElementShapeAnimationEditor.plugin */,
0ED841201800FCAB003985CD /* PieChartGenerator.plugin */,
+119 -18
View File
@@ -638,6 +638,7 @@
textPathDictionary[@"tspan"] = @"tspan";
// customize DTD attribute rules
NSArray * allElementKeys = (self.elementsDictionary).allKeys;
// set default opacity value 1.0f
@@ -655,7 +656,7 @@
NSString * attributeName = aAttributeDictionary[@"attribute_name"];
NSRange opacityRange = [attributeName rangeOfString:@"opacity"];
if (opacityRange.location != NSNotFound)
if (opacityRange.location == 0)
{
NSMutableArray * defaultValuesArray = [NSMutableArray arrayWithObject:@"1.0"];
aAttributeDictionary[@"default_value"] = defaultValuesArray;
@@ -684,7 +685,10 @@
{
NSArray * existingAttributeTypeArray = aAttributeDictionary[@"attribute_type"];
NSMutableArray * attributeTypeArray = [NSMutableArray arrayWithArray:existingAttributeTypeArray];
[attributeTypeArray addObject:@"indefinite"];
//[attributeTypeArray addObject:@"indefinite"];
[self addValue:@"indefinite" toArray:attributeTypeArray];
aAttributeDictionary[@"attribute_type"] = attributeTypeArray;
NSMutableArray * defaultValuesArray = [NSMutableArray arrayWithObject:@"0"];
aAttributeDictionary[@"default_value"] = defaultValuesArray;
@@ -709,12 +713,17 @@
NSString * attributeName = aAttributeDictionary[@"attribute_name"];
NSRange repeatCountRange = [attributeName rangeOfString:@"repeatDur"];
if (repeatCountRange.location != NSNotFound)
if (repeatCountRange.location == 0)
{
NSArray * existingAttributeTypeArray = aAttributeDictionary[@"attribute_type"];
NSMutableArray * attributeTypeArray = [NSMutableArray arrayWithArray:existingAttributeTypeArray];
[attributeTypeArray addObject:@"indefinite"];
[attributeTypeArray addObject:@"media"];
//[attributeTypeArray addObject:@"indefinite"];
//[attributeTypeArray addObject:@"media"];
[self addValue:@"indefinite" toArray:attributeTypeArray];
[self addValue:@"media" toArray:attributeTypeArray];
aAttributeDictionary[@"attribute_type"] = attributeTypeArray;
NSMutableArray * defaultValuesArray = [NSMutableArray arrayWithObject:@"indefinite"];
aAttributeDictionary[@"default_value"] = defaultValuesArray;
@@ -744,6 +753,8 @@
{
NSArray * existingAttributeTypeArray = aAttributeDictionary[@"attribute_type"];
NSMutableArray * attributeTypeArray = [NSMutableArray arrayWithArray:existingAttributeTypeArray];
/*
[attributeTypeArray addObject:@"none"];
[attributeTypeArray addObject:@"xMinYMin meet"];
@@ -765,6 +776,29 @@
[attributeTypeArray addObject:@"xMaxYMin slice"];
[attributeTypeArray addObject:@"xMaxYMid slice"];
[attributeTypeArray addObject:@"xMaxYMax slice"];
*/
[self addValue:@"none" toArray:attributeTypeArray];
[self addValue:@"xMinYMin meet" toArray:attributeTypeArray];
[self addValue:@"xMinYMid meet" toArray:attributeTypeArray];
[self addValue:@"xMinYMax meet" toArray:attributeTypeArray];
[self addValue:@"xMidYMin meet" toArray:attributeTypeArray];
[self addValue:@"xMidYMid meet" toArray:attributeTypeArray];
[self addValue:@"xMidYMax meet" toArray:attributeTypeArray];
[self addValue:@"xMaxYMin meet" toArray:attributeTypeArray];
[self addValue:@"xMaxYMid meet" toArray:attributeTypeArray];
[self addValue:@"xMaxYMax meet" toArray:attributeTypeArray];
[self addValue:@"xMinYMin slice" toArray:attributeTypeArray];
[self addValue:@"xMinYMid slice" toArray:attributeTypeArray];
[self addValue:@"xMinYMax slice" toArray:attributeTypeArray];
[self addValue:@"xMidYMin slice" toArray:attributeTypeArray];
[self addValue:@"xMidYMid slice" toArray:attributeTypeArray];
[self addValue:@"xMidYMax slice" toArray:attributeTypeArray];
[self addValue:@"xMaxYMin slice" toArray:attributeTypeArray];
[self addValue:@"xMaxYMid slice" toArray:attributeTypeArray];
[self addValue:@"xMaxYMax slice" toArray:attributeTypeArray];
aAttributeDictionary[@"attribute_type"] = attributeTypeArray;
NSMutableArray * defaultValuesArray = [NSMutableArray arrayWithObject:@"xMidYMid meet"];
@@ -794,7 +828,10 @@
{
NSArray * existingAttributeTypeArray = aAttributeDictionary[@"attribute_type"];
NSMutableArray * attributeTypeArray = [NSMutableArray arrayWithArray:existingAttributeTypeArray];
[attributeTypeArray addObject:@"none"];
//[attributeTypeArray addObject:@"none"];
[self addValue:@"none" toArray:attributeTypeArray];
aAttributeDictionary[@"attribute_type"] = attributeTypeArray;
NSMutableArray * defaultValuesArray = [NSMutableArray arrayWithObject:@"0s"];
aAttributeDictionary[@"default_value"] = defaultValuesArray;
@@ -806,23 +843,27 @@
// add several fill attribute defined values for all elements where fill is a valid attribute
for (NSString * aElementKey in allElementKeys)
{
NSDictionary * aElementDictionary = (self.elementsDictionary)[aElementKey];
NSDictionary * attributesDictionary = aElementDictionary[@"attributes"];
NSMutableDictionary * aElementDictionary = (self.elementsDictionary)[aElementKey];
NSMutableDictionary * attributesDictionary = aElementDictionary[@"attributes"];
BOOL isAnimateElement = NO;
if ([aElementKey isEqualToString:@"animate"] == YES)
if ([aElementKey isEqualToString:@"set"] == YES)
{
isAnimateElement = YES;
}
if ([aElementKey isEqualToString:@"animateColor"] == YES)
else if ([aElementKey isEqualToString:@"animate"] == YES)
{
isAnimateElement = YES;
}
if ([aElementKey isEqualToString:@"animateMotion"] == YES)
else if ([aElementKey isEqualToString:@"animateColor"] == YES)
{
isAnimateElement = YES;
}
if ([aElementKey isEqualToString:@"animateTransform"] == YES)
else if ([aElementKey isEqualToString:@"animateMotion"] == YES)
{
isAnimateElement = YES;
}
else if ([aElementKey isEqualToString:@"animateTransform"] == YES)
{
isAnimateElement = YES;
}
@@ -830,25 +871,36 @@
if (attributesDictionary != NULL)
{
NSArray * allAttributeKeys = attributesDictionary.allKeys;
BOOL fillAttributeFound = NO;
for (NSString * attributeKey in allAttributeKeys)
{
NSMutableDictionary * aAttributeDictionary = attributesDictionary[attributeKey];
NSString * attributeName = aAttributeDictionary[@"attribute_name"];
NSRange repeatCountRange = [attributeName rangeOfString:@"fill"];
if (repeatCountRange.location != NSNotFound)
NSRange fillRange = [attributeName rangeOfString:@"fill"];
if (fillRange.location == 0)
{
fillAttributeFound = YES;
NSArray * existingAttributeTypeArray = aAttributeDictionary[@"attribute_type"];
NSMutableArray * attributeTypeArray = [NSMutableArray arrayWithArray:existingAttributeTypeArray];
[attributeTypeArray addObject:@"none"];
//[attributeTypeArray addObject:@"none"];
[self addValue:@"none" toArray:attributeTypeArray];
if (isAnimateElement == YES)
{
[attributeTypeArray addObject:@"freeze"];
[attributeTypeArray addObject:@"remove"];
//[attributeTypeArray addObject:@"freeze"];
//[attributeTypeArray addObject:@"remove"];
[self addValue:@"freeze" toArray:attributeTypeArray];
[self addValue:@"remove" toArray:attributeTypeArray];
}
else
{
/*
[attributeTypeArray addObject:@"currentColor"];
[attributeTypeArray addObject:@"black"];
[attributeTypeArray addObject:@"white"];
@@ -860,6 +912,19 @@
[attributeTypeArray addObject:@"yellow"];
[attributeTypeArray addObject:@"#000000"];
[attributeTypeArray addObject:@"url(#aElementID)"];
*/
//[self addValue:@"currentColor" toArray:attributeTypeArray];
[self addValue:@"black" toArray:attributeTypeArray];
[self addValue:@"white" toArray:attributeTypeArray];
[self addValue:@"red" toArray:attributeTypeArray];
[self addValue:@"blue" toArray:attributeTypeArray];
[self addValue:@"green" toArray:attributeTypeArray];
[self addValue:@"cyan" toArray:attributeTypeArray];
[self addValue:@"magenta" toArray:attributeTypeArray];
[self addValue:@"#000000" toArray:attributeTypeArray];
//[self addValue:@"url(#aElementID)" toArray:attributeTypeArray];
}
aAttributeDictionary[@"attribute_type"] = attributeTypeArray;
@@ -883,10 +948,12 @@
NSString * attributeName = aAttributeDictionary[@"attribute_name"];
NSRange repeatCountRange = [attributeName rangeOfString:@"stroke"];
if (repeatCountRange.location != NSNotFound)
if (repeatCountRange.location == 0)
{
NSArray * existingAttributeTypeArray = aAttributeDictionary[@"attribute_type"];
NSMutableArray * attributeTypeArray = [NSMutableArray arrayWithArray:existingAttributeTypeArray];
/*
[attributeTypeArray addObject:@"none"];
[attributeTypeArray addObject:@"currentColor"];
[attributeTypeArray addObject:@"black"];
@@ -899,6 +966,19 @@
[attributeTypeArray addObject:@"yellow"];
[attributeTypeArray addObject:@"#000000"];
[attributeTypeArray addObject:@"url(#aElementID)"];
*/
[self addValue:@"none" toArray:attributeTypeArray];
//[self addValue:@"currentColor" toArray:attributeTypeArray];
[self addValue:@"black" toArray:attributeTypeArray];
[self addValue:@"white" toArray:attributeTypeArray];
[self addValue:@"red" toArray:attributeTypeArray];
[self addValue:@"blue" toArray:attributeTypeArray];
[self addValue:@"green" toArray:attributeTypeArray];
[self addValue:@"cyan" toArray:attributeTypeArray];
[self addValue:@"magenta" toArray:attributeTypeArray];
[self addValue:@"#000000" toArray:attributeTypeArray];
//[self addValue:@"url(#aElementID)" toArray:attributeTypeArray];
aAttributeDictionary[@"attribute_type"] = attributeTypeArray;
}
@@ -915,6 +995,27 @@
//NSLog(@"elementContentsDictionary = %@", elementContentsDictionary);
}
//==================================================================================
- (void)addValue:(NSString *)valueString toArray:(NSMutableArray *)aMutableArray
{
BOOL valueFound = NO;
for (NSString * aAttributeName in aMutableArray)
{
if ([aAttributeName isEqualToString:valueString] == YES)
{
valueFound = YES;
break;
}
}
if (valueFound == NO)
{
[aMutableArray addObject:[NSString stringWithString:valueString]];
}
}
//==================================================================================
//==================================================================================
//==================================================================================
+5 -5
View File
@@ -18,19 +18,19 @@
</svgElement>
<svgElement id="animate">
<docref>animate.html#AnimateElement</docref>
<prototype>animate attributeName="x" attributeType="XML" begin="0s" dur="1s" values="100;200;100;" repeatCount="indefinite" additive="replace" accumulate="none" fill="freeze"</prototype>
<prototype>animate attributeName="x" attributeType="XML" begin="0s" dur="1s" values="100;200;100;" repeatCount="indefinite" additive="replace" accumulate="none" fill="remove"</prototype>
</svgElement>
<svgElement id="animateColor">
<docref>animate.html#AnimateColorElement</docref>
<prototype>animateColor attributeName="fill" attributeType="XML" values="red;green;red;" begin="0s" dur="1s" repeatCount="indefinite" additive="replace" accumulate="none" fill="freeze"</prototype>
<prototype>animateColor attributeName="fill" attributeType="XML" values="red;green;red;" begin="0s" dur="1s" repeatCount="indefinite" additive="replace" accumulate="none" fill="remove"</prototype>
</svgElement>
<svgElement id="animateMotion">
<docref>animate.html#AnimateMotionElement</docref>
<prototype>animateMotion begin="0s" dur="3s" values="50 50;300 300;" repeatCount="indefinite" calcMode="" keyTimes="0;1" keySplines="0.5 0 0.5 1" additive="replace" accumulate="none" fill="freeze"</prototype>
<prototype>animateMotion begin="0s" dur="3s" values="50 50;300 300;" repeatCount="indefinite" calcMode="" keyTimes="0;1" keySplines="0.5 0 0.5 1" additive="replace" accumulate="none" fill="remove"</prototype>
</svgElement>
<svgElement id="animateTransform">
<docref>animate.html#AnimateTransformElement</docref>
<prototype>animateTransform attributeName="transform" attributeType="XML" type="rotate" values="0 320 372;360 320 372;" begin="0s" dur="6s" repeatCount="indefinite" additive="replace" accumulate="none" fill="freeze"</prototype>
<prototype>animateTransform attributeName="transform" attributeType="XML" type="rotate" values="0 320 372;360 320 372;" begin="0s" dur="6s" repeatCount="indefinite" additive="replace" accumulate="none" fill="remove"</prototype>
</svgElement>
<svgElement id="circle">
<docref>shapes.html#CircleElement</docref>
@@ -266,7 +266,7 @@
</svgElement>
<svgElement id="set">
<docref>animate.html#SetElement</docref>
<prototype>set attributeName="y" attributeType="XML" begin="0s" dur="1s" from="100" to="200" repeatCount="indefinite"</prototype>
<prototype>set attributeName="x" attributeType="XML" begin="0s" dur="1s" to="100" repeatCount="0" fill="remove"</prototype>
</svgElement>
<svgElement id="stop">
<docref>pservers.html#StopElement</docref>
@@ -511,7 +511,7 @@
else if ([prototypeElementName isEqualToString:@"script"])
{
NSXMLNode *cdataNode = [[NSXMLNode alloc] initWithKind:NSXMLTextKind options:NSXMLNodeIsCDATA];
cdataNode.stringValue = @"//JavaScript goes here";
cdataNode.stringValue = @"// JavaScript goes here";
[prototypeElement addChild:cdataNode];
resultString = [prototypeElement XMLStringWithOptions:NSXMLNodePreserveCDATA];
}