summaryrefslogtreecommitdiff
path: root/tikzit
diff options
context:
space:
mode:
authorJohan Paulsson <gonz@badcode.net>2014-03-25 17:30:35 +0000
committerJohan Paulsson <gonz@badcode.net>2014-03-25 17:30:35 +0000
commit4c3a82c9146aa0e147b49b429b49fefb0e785a17 (patch)
tree532436ec35f19d6de54579734df22c20a8d67ca5 /tikzit
parent5532f8878b7219720de6145eabbe57efb894957c (diff)
osx gui: custom nodes preference panel shows tikzit preview and tikz code for selected custom node.
Diffstat (limited to 'tikzit')
-rw-r--r--tikzit/English.lproj/CustomNodes.xib256
-rw-r--r--tikzit/TikZiT.xcodeproj/project.pbxproj26
-rw-r--r--tikzit/src/common/TikzShape.h3
-rw-r--r--tikzit/src/common/TikzShape.m4
-rw-r--r--tikzit/src/osx/CustomNodeCellView.m10
-rw-r--r--tikzit/src/osx/CustomNodeController.h6
-rw-r--r--tikzit/src/osx/CustomNodeController.m53
7 files changed, 307 insertions, 51 deletions
diff --git a/tikzit/English.lproj/CustomNodes.xib b/tikzit/English.lproj/CustomNodes.xib
new file mode 100644
index 0000000..33f6e3a
--- /dev/null
+++ b/tikzit/English.lproj/CustomNodes.xib
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+ <dependencies>
+ <deployment defaultVersion="1070" identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5053"/>
+ </dependencies>
+ <objects>
+ <customObject id="-2" userLabel="File's Owner" customClass="CustomNodeController">
+ <connections>
+ <outlet property="customNodeTable" destination="ieg-vU-MzM" id="nrO-zt-zY0"/>
+ <outlet property="graphicsView" destination="3MT-Yc-Dhv" id="9gg-fS-oBl"/>
+ <outlet property="tikzSourceController" destination="il5-cQ-3oh" id="Wny-jd-sKZ"/>
+ <outlet property="view" destination="1" id="sH5-DU-xwB"/>
+ </connections>
+ </customObject>
+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+ <customObject id="-3" userLabel="Application"/>
+ <arrayController objectClassName="NodeStyle" id="iyU-U5-XAU" userLabel="Node Style Array Controller">
+ <declaredKeys>
+ <string>name</string>
+ <string>strokeThickness</string>
+ <string>strokeColor</string>
+ <string>fillColor</string>
+ <string>strokeColorIsKnown</string>
+ <string>fillColorIsKnown</string>
+ <string>representedObject.name</string>
+ <string>shapeName</string>
+ <string>scale</string>
+ <string>@distinctUnionOfObjects.category</string>
+ <string>category</string>
+ </declaredKeys>
+ <connections>
+ <binding destination="-2" name="contentArray" keyPath="customNodeStyles" id="eXd-NF-dvR"/>
+ </connections>
+ </arrayController>
+ <customObject id="il5-cQ-3oh" customClass="TikzSourceController">
+ <connections>
+ <outlet property="errorMessage" destination="6rJ-4b-syy" id="cin-Wb-6uD"/>
+ <outlet property="errorNotification" destination="R3k-mz-hMn" id="jtn-fQ-Amk"/>
+ <outlet property="graphicsView" destination="3MT-Yc-Dhv" id="hK1-h1-Dsr"/>
+ <outlet property="sourceView" destination="QXu-0d-uF0" id="SEj-FL-5Ac"/>
+ <outlet property="status" destination="6rJ-4b-syy" id="lVN-cK-3Cb"/>
+ </connections>
+ </customObject>
+ <customView id="1">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <subviews>
+ <splitView dividerStyle="thin" vertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DO1-FS-fZd">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <subviews>
+ <scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="33" horizontalPageScroll="10" verticalLineScroll="33" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="Ry0-48-577">
+ <rect key="frame" x="0.0" y="0.0" width="135" height="272"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <clipView key="contentView" id="9D3-br-lEi">
+ <rect key="frame" x="1" y="1" width="133" height="270"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="31" rowSizeStyle="automatic" viewBased="YES" id="ieg-vU-MzM">
+ <rect key="frame" x="0.0" y="0.0" width="133" height="270"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <size key="intercellSpacing" width="3" height="2"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+ <tableColumns>
+ <tableColumn width="130" minWidth="40" maxWidth="1000" id="k91-pc-nbl">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
+ </tableHeaderCell>
+ <customCell key="dataCell" alignment="left" id="iBr-Zx-inI"/>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ <prototypeCellViews>
+ <tableCellView id="FFd-Cu-kI9" customClass="CustomNodeCellView">
+ <rect key="frame" x="1" y="1" width="130" height="31"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ao2-4F-rlt">
+ <rect key="frame" x="0.0" y="7" width="130" height="17"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+ <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="QkT-4g-5Qq">
+ <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="ao2-4F-rlt" id="zq7-cf-ZXq"/>
+ </connections>
+ </tableCellView>
+ </prototypeCellViews>
+ </tableColumn>
+ </tableColumns>
+ <connections>
+ <binding destination="iyU-U5-XAU" name="content" keyPath="arrangedObjects" id="Sdh-7p-80z"/>
+ <outlet property="dataSource" destination="iyU-U5-XAU" id="t5B-c8-e0k"/>
+ <outlet property="delegate" destination="-2" id="M05-fU-pjz"/>
+ </connections>
+ </tableView>
+ </subviews>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </clipView>
+ <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="QIL-7j-JmC">
+ <rect key="frame" x="1" y="256" width="36" height="15"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="ElP-ub-Uwa">
+ <rect key="frame" x="-14" y="-7" width="15" height="0.0"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ </scrollView>
+ <view id="F5P-T2-9eB">
+ <rect key="frame" x="136" y="0.0" width="344" height="272"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <splitView translatesAutoresizingMaskIntoConstraints="NO" id="KKi-SZ-dS6">
+ <rect key="frame" x="0.0" y="0.0" width="344" height="272"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <customView id="d61-FR-v2c">
+ <rect key="frame" x="0.0" y="0.0" width="344" height="156"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <customView wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3MT-Yc-Dhv" customClass="GraphicsView">
+ <rect key="frame" x="0.0" y="0.0" width="344" height="155"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ </customView>
+ <customView wantsLayer="YES" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="R3k-mz-hMn" customClass="ParseErrorView">
+ <rect key="frame" x="0.0" y="113" width="343" height="42"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+ <subviews>
+ <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6rJ-4b-syy">
+ <rect key="frame" x="5" y="10" width="336" height="27"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" placeholderString="parser information" allowsEditingTextAttributes="YES" id="3y1-Zn-Hv4">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <button wantsLayer="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Et8-Cc-Xac">
+ <rect key="frame" x="322" y="21" width="17" height="19"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
+ <buttonCell key="cell" type="squareTextured" bezelStyle="texturedSquare" image="NSStopProgressFreestandingTemplate" imagePosition="only" alignment="center" state="on" imageScaling="proportionallyDown" id="7vB-Le-tP4">
+ <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="system"/>
+ </buttonCell>
+ <connections>
+ <action selector="closeParseError:" target="il5-cQ-3oh" id="jdZ-7K-cwe"/>
+ </connections>
+ </button>
+ </subviews>
+ </customView>
+ </subviews>
+ <constraints>
+ <constraint firstAttribute="bottom" secondItem="3MT-Yc-Dhv" secondAttribute="bottom" id="DEy-EJ-EeA"/>
+ <constraint firstItem="R3k-mz-hMn" firstAttribute="leading" secondItem="d61-FR-v2c" secondAttribute="leading" id="FDF-4e-3R4"/>
+ <constraint firstItem="3MT-Yc-Dhv" firstAttribute="top" secondItem="d61-FR-v2c" secondAttribute="top" constant="1" id="TXv-kR-OA6"/>
+ <constraint firstItem="3MT-Yc-Dhv" firstAttribute="leading" secondItem="d61-FR-v2c" secondAttribute="leading" id="TzA-tT-Vdh"/>
+ <constraint firstItem="R3k-mz-hMn" firstAttribute="top" secondItem="d61-FR-v2c" secondAttribute="top" constant="1" id="a7a-Y8-O1K"/>
+ <constraint firstAttribute="trailing" secondItem="3MT-Yc-Dhv" secondAttribute="trailing" id="tEn-7r-xa3"/>
+ <constraint firstAttribute="trailing" secondItem="R3k-mz-hMn" secondAttribute="trailing" constant="1" id="tpa-mG-DNu"/>
+ </constraints>
+ </customView>
+ <customView id="Fal-9S-dwR">
+ <rect key="frame" x="0.0" y="165" width="344" height="107"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yLp-gf-r49">
+ <rect key="frame" x="0.0" y="0.0" width="344" height="107"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <clipView key="contentView" id="qOT-id-lqk">
+ <rect key="frame" x="1" y="1" width="327" height="105"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <textView importsGraphics="NO" richText="NO" findStyle="panel" allowsUndo="YES" usesRuler="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" spellingCorrection="YES" smartInsertDelete="YES" id="QXu-0d-uF0">
+ <rect key="frame" x="0.0" y="0.0" width="327" height="105"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <size key="minSize" width="327" height="105"/>
+ <size key="maxSize" width="877" height="10000000"/>
+ <attributedString key="textStorage">
+ <fragment>
+ <string key="content">\begin{tikzpicture}
+
+\end{tikzpicture}</string>
+ <attributes>
+ <font key="NSFont" metaFont="toolTip"/>
+ <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural"/>
+ </attributes>
+ </fragment>
+ </attributedString>
+ <color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <size key="minSize" width="327" height="105"/>
+ <size key="maxSize" width="877" height="10000000"/>
+ <connections>
+ <binding destination="il5-cQ-3oh" name="attributedString" keyPath="source" id="15z-o3-4ni"/>
+ <outlet property="delegate" destination="il5-cQ-3oh" id="9Mr-J3-zvR"/>
+ </connections>
+ </textView>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ </clipView>
+ <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="BYM-Xm-JpT">
+ <rect key="frame" x="-100" y="-100" width="87" height="18"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="0.90909090909090906" horizontal="NO" id="SEU-Jq-fwu">
+ <rect key="frame" x="328" y="1" width="15" height="105"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ </scrollView>
+ </subviews>
+ <constraints>
+ <constraint firstAttribute="bottom" secondItem="yLp-gf-r49" secondAttribute="bottom" id="3Zg-sl-ndb"/>
+ <constraint firstItem="yLp-gf-r49" firstAttribute="leading" secondItem="Fal-9S-dwR" secondAttribute="leading" id="MoY-ha-w7Q"/>
+ <constraint firstItem="yLp-gf-r49" firstAttribute="top" secondItem="Fal-9S-dwR" secondAttribute="top" id="rmR-5R-FQ1"/>
+ <constraint firstAttribute="trailing" secondItem="yLp-gf-r49" secondAttribute="trailing" id="z6B-m5-ePl"/>
+ </constraints>
+ </customView>
+ </subviews>
+ <holdingPriorities>
+ <real value="250"/>
+ <real value="250"/>
+ </holdingPriorities>
+ </splitView>
+ </subviews>
+ <constraints>
+ <constraint firstAttribute="trailing" secondItem="KKi-SZ-dS6" secondAttribute="trailing" id="Nae-MC-igi"/>
+ <constraint firstAttribute="bottom" secondItem="KKi-SZ-dS6" secondAttribute="bottom" id="Tvy-gL-Wmv"/>
+ <constraint firstItem="KKi-SZ-dS6" firstAttribute="top" secondItem="F5P-T2-9eB" secondAttribute="top" id="gIg-p8-zOO"/>
+ <constraint firstItem="KKi-SZ-dS6" firstAttribute="leading" secondItem="F5P-T2-9eB" secondAttribute="leading" id="iHl-dm-VjB"/>
+ </constraints>
+ </view>
+ </subviews>
+ <holdingPriorities>
+ <real value="250"/>
+ <real value="250"/>
+ </holdingPriorities>
+ </splitView>
+ </subviews>
+ <constraints>
+ <constraint firstAttribute="trailing" secondItem="DO1-FS-fZd" secondAttribute="trailing" id="Bow-1P-jx4"/>
+ <constraint firstAttribute="bottom" secondItem="DO1-FS-fZd" secondAttribute="bottom" id="c94-eC-Rhp"/>
+ <constraint firstItem="DO1-FS-fZd" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="j1G-Ag-RLs"/>
+ <constraint firstItem="DO1-FS-fZd" firstAttribute="top" secondItem="1" secondAttribute="top" id="tBr-89-Ipp"/>
+ </constraints>
+ </customView>
+ </objects>
+ <resources>
+ <image name="NSStopProgressFreestandingTemplate" width="12" height="12"/>
+ </resources>
+</document>
diff --git a/tikzit/TikZiT.xcodeproj/project.pbxproj b/tikzit/TikZiT.xcodeproj/project.pbxproj
index 692181b..8e3e7c9 100644
--- a/tikzit/TikZiT.xcodeproj/project.pbxproj
+++ b/tikzit/TikZiT.xcodeproj/project.pbxproj
@@ -143,6 +143,8 @@
7F938530184D178B00FAED38 /* engine.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F93852F184D178B00FAED38 /* engine.png */; };
7F938532184D184700FAED38 /* preamble.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F938531184D184700FAED38 /* preamble.png */; };
7FB9BFEE16B57C2E00773146 /* TikzFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FB9BFED16B57C2E00773146 /* TikzFormatter.m */; };
+ 7FD5D44B18E1CB5300E2A930 /* CustomNodes.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7FD5D44918E1CB5300E2A930 /* CustomNodes.xib */; };
+ 7FD5D44D18E1CC0B00E2A930 /* customshape.png in Resources */ = {isa = PBXBuildFile; fileRef = 7FD5D44C18E1CC0B00E2A930 /* customshape.png */; };
7FEED45716B1A7C500B056CB /* StyleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FEED45616B1A7C500B056CB /* StyleManager.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
@@ -379,6 +381,8 @@
7F938531184D184700FAED38 /* preamble.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = preamble.png; sourceTree = "<group>"; };
7FB9BFEC16B57C2E00773146 /* TikzFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TikzFormatter.h; path = src/osx/TikzFormatter.h; sourceTree = "<group>"; };
7FB9BFED16B57C2E00773146 /* TikzFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TikzFormatter.m; path = src/osx/TikzFormatter.m; sourceTree = "<group>"; };
+ 7FD5D44A18E1CB5300E2A930 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/CustomNodes.xib; sourceTree = "<group>"; };
+ 7FD5D44C18E1CC0B00E2A930 /* customshape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = customshape.png; sourceTree = "<group>"; };
7FEED45516B1A7C400B056CB /* StyleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleManager.h; path = src/common/StyleManager.h; sourceTree = "<group>"; };
7FEED45616B1A7C500B056CB /* StyleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StyleManager.m; path = src/common/StyleManager.m; sourceTree = "<group>"; };
8D15AC360486D014006FF6A4 /* TikZiT-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TikZiT-Info.plist"; sourceTree = "<group>"; };
@@ -511,6 +515,7 @@
55D945701165904F0044178C /* tikzitdoc.icns */,
55D945711165904F0044178C /* tikzit.icns */,
7F90E88C16DD47540069EBCD /* Preferences.xib */,
+ 7FD5D44918E1CB5300E2A930 /* CustomNodes.xib */,
7F18A322184C599100BC3081 /* UpdatePreferencePanel.xib */,
55391AF713D3250F007DBE71 /* Preamble.xib */,
55391AF513D324FE007DBE71 /* Preview.xib */,
@@ -768,6 +773,7 @@
children = (
7F93852F184D178B00FAED38 /* engine.png */,
7F938531184D184700FAED38 /* preamble.png */,
+ 7FD5D44C18E1CC0B00E2A930 /* customshape.png */,
7F93852D184D176E00FAED38 /* updates.png */,
);
name = Icons;
@@ -865,6 +871,7 @@
1DDD582C0DA1D0D100B32029 /* TikzDocument.xib in Resources */,
7F938530184D178B00FAED38 /* engine.png in Resources */,
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */,
+ 7FD5D44D18E1CC0B00E2A930 /* customshape.png in Resources */,
55D945721165904F0044178C /* tikzitdoc.icns in Resources */,
55D945731165904F0044178C /* tikzit.icns in Resources */,
556979431168747B007E5703 /* StylePalette.xib in Resources */,
@@ -888,6 +895,7 @@
55397C8A1449AB91006942FB /* AH_none.png in Resources */,
55397C8B1449AB91006942FB /* AH_plain_tail.png in Resources */,
55397C8D1449ABFC006942FB /* AH_latex_tail.png in Resources */,
+ 7FD5D44B18E1CB5300E2A930 /* CustomNodes.xib in Resources */,
55397C901449AC7C006942FB /* AH_latex_head.png in Resources */,
55397C911449AC7C006942FB /* AH_plain_head.png in Resources */,
7F18A323184C599100BC3081 /* UpdatePreferencePanel.xib in Resources */,
@@ -909,11 +917,12 @@
);
name = "Run Flex";
outputPaths = (
- "$(SRCROOT)/src/common/tikzlexer.m",
+ "$(DERIVED_SOURCES_DIR)/tikzlexer.m",
+ "$(DERIVED_SOURCES_DIR)/tikzlexer.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "cd ${SRCROOT}/src/\nINPUT_FILE_BASE=`basename \"${SCRIPT_INPUT_FILE_0}\" .lm`\nflex -o common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.lm\nmv common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.h ${DERIVED_SOURCES_DIR}\n";
+ shellScript = "cd ${SRCROOT}/src/\nexport INPUT_FILE_BASE=`basename \"${SCRIPT_INPUT_FILE_0}\" .lm`\nflex -o common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.lm\nmv common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.h ${DERIVED_SOURCES_DIR}\n";
};
7F7B6DE118DE0A6E004F6CA8 /* Run Bison */ = {
isa = PBXShellScriptBuildPhase;
@@ -925,11 +934,12 @@
);
name = "Run Bison";
outputPaths = (
- "$(SRCROOT)/src/common/tikzparser.m",
+ "$(DERIVED_SOURCES_DIR)/tikzparser.m",
+ "$(DERIVED_SOURCES_DIR)/tikzparser.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "cd ${SRCROOT}/src/\nINPUT_FILE_BASE=`basename \"${SCRIPT_INPUT_FILE_0}\" .ym`\nflex -o common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.lm\nbison --defines=common/${INPUT_FILE_BASE}.h --output=common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.ym\nmv common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.h ${DERIVED_SOURCES_DIR}";
+ shellScript = "cd ${SRCROOT}/src/\nexport INPUT_FILE_BASE=`basename \"${SCRIPT_INPUT_FILE_0}\" .ym`\nbison --defines=common/${INPUT_FILE_BASE}.h --output=common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.ym\nmv common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.h ${DERIVED_SOURCES_DIR}";
};
/* End PBXShellScriptBuildPhase section */
@@ -1124,6 +1134,14 @@
name = UserDefaults.plist;
sourceTree = "<group>";
};
+ 7FD5D44918E1CB5300E2A930 /* CustomNodes.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 7FD5D44A18E1CB5300E2A930 /* English */,
+ );
+ name = CustomNodes.xib;
+ sourceTree = "<group>";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
diff --git a/tikzit/src/common/TikzShape.h b/tikzit/src/common/TikzShape.h
index 1ccf658..6a91f91 100644
--- a/tikzit/src/common/TikzShape.h
+++ b/tikzit/src/common/TikzShape.h
@@ -25,8 +25,11 @@
#import "Shape.h"
@interface TikzShape : Shape {
+ NSString *tikzSrc;
}
+@property (copy) NSString *tikzSrc;
+
- (id)initWithTikzFile:(NSString*)file;
@end
diff --git a/tikzit/src/common/TikzShape.m b/tikzit/src/common/TikzShape.m
index 9735371..c07c61e 100644
--- a/tikzit/src/common/TikzShape.m
+++ b/tikzit/src/common/TikzShape.m
@@ -26,6 +26,8 @@
@implementation TikzShape
+@synthesize tikzSrc;
+
- (id)initWithTikzFile:(NSString*)file {
self = [super init];
if (self) {
@@ -33,6 +35,8 @@
encoding:NSUTF8StringEncoding
error:NULL];
if (tikz == nil) return nil;
+
+ tikzSrc = [tikz copy];
Graph *graph = [Graph graphFromTikz:tikz];
if (graph == nil) return nil;
diff --git a/tikzit/src/osx/CustomNodeCellView.m b/tikzit/src/osx/CustomNodeCellView.m
index 57ef24a..612394b 100644
--- a/tikzit/src/osx/CustomNodeCellView.m
+++ b/tikzit/src/osx/CustomNodeCellView.m
@@ -31,8 +31,6 @@
}
-(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context {
- NSLog(@"drawing layer ^^");
-
if (nodeLayer!=nil) {
if (![[[self layer] sublayers] containsObject:nodeLayer]) {
[[self layer] addSublayer:nodeLayer];
@@ -56,17 +54,23 @@
}
- (void) setObjectValue:(id)objectValue{
- [[self textField] setStringValue:[(NodeStyle *)objectValue shapeName]];
+ if(objectValue == nil)
+ return;
+
nodeStyle = (NodeStyle *)objectValue;
+ [[self textField] setStringValue:[nodeStyle shapeName]];
if (nodeLayer == nil) {
nodeLayer = [[NodeLayer alloc] initWithNode:[Node node]
transformer:[Transformer defaultTransformer]];
[nodeLayer setRescale:NO];
}
+ [nodeStyle setName:[nodeStyle shapeName]];
[[nodeLayer node] setStyle:nodeStyle];
[nodeLayer updateFrame];
+
+ NSLog(@"asd");
}
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle {
diff --git a/tikzit/src/osx/CustomNodeController.h b/tikzit/src/osx/CustomNodeController.h
index 56cb74c..5553fcd 100644
--- a/tikzit/src/osx/CustomNodeController.h
+++ b/tikzit/src/osx/CustomNodeController.h
@@ -18,14 +18,16 @@
@interface CustomNodeController : NSViewController <NSTableViewDelegate>{
NSDictionary* __weak nodeStyles;
NSMutableArray* customNodeStyles;
- NSMutableArray* __weak onodeStyles;
GraphicsView *__weak graphicsView;
TikzSourceController *__weak tikzSourceController;
+ NSTableView *customNodeTable;
}
@property (weak, readonly) NSDictionary *nodeStyles;
-@property (weak, readonly) NSMutableArray* onodeStyles;
+@property NSMutableArray* customNodeStyles;
+
+@property IBOutlet NSTableView *customNodeTable;
@property (weak) IBOutlet GraphicsView *graphicsView;
@property (weak) IBOutlet TikzSourceController *tikzSourceController;
diff --git a/tikzit/src/osx/CustomNodeController.m b/tikzit/src/osx/CustomNodeController.m
index ef6b5bd..4f46acc 100644
--- a/tikzit/src/osx/CustomNodeController.m
+++ b/tikzit/src/osx/CustomNodeController.m
@@ -15,71 +15,40 @@
@implementation CustomNodeController
-@synthesize nodeStyles, onodeStyles;
+@synthesize nodeStyles, customNodeStyles;
@synthesize graphicsView, tikzSourceController;
+@synthesize customNodeTable;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
-// [SupportDir createUserSupportDir];
-// NSString *supportDir = [SupportDir userSupportDir];
-
-// NSString *ns = [supportDir stringByAppendingPathComponent:@"nodeStyles.plist"];
-// NSString *es = [supportDir stringByAppendingPathComponent:@"edgeStyles.plist"];
-// onodeStyles = (NSMutableArray*)[NSKeyedUnarchiver
-// unarchiveObjectWithFile:ns];
- // edgeStyles = (NSMutableArray*)[NSKeyedUnarchiver
-// unarchiveObjectWithFile:es];
-
- if (onodeStyles == nil) onodeStyles = [NSMutableArray array];
-// if (edgeStyles == nil) edgeStyles = [NSMutableArray array];
-
-// [[self window] setLevel:NSNormalWindowLevel];
-// [self showWindow:self];
-
- // Initialization code here.
-
- NSLog(@"Custom Node controller up and running!");
-
- nodeStyles= [Shape shapeDictionary];
-
+ nodeStyles = [Shape shapeDictionary];
customNodeStyles = [NSMutableArray array];
- NSLog(@"Got a shape dictionary?");
-
- NSString *meh;
-
for(id key in nodeStyles) {
Shape *value = [nodeStyles objectForKey:key];
if([value isKindOfClass:[TikzShape class]]){
- NSLog(@"Got a custom node shape!");
NodeStyle *newNodeStyle = [[NodeStyle alloc] init];
[newNodeStyle setShapeName:key];
[customNodeStyles addObject:newNodeStyle];
- [onodeStyles addObject:newNodeStyle];
-
-// meh = [(TikzShape *) value tikz];
}
}
-
- NSLog(@"Trying to display tikz.");
-
-// [tikzSourceController setTikz:meh];
-// [tikzSourceController parseTikz:self];
}
return self;
}
--(NSArray *)onodeStyles{
- return onodeStyles;
- //return [nodeStyles allValues];
-}
-
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification{
- NSLog(@"Changed selection!");
+ NSInteger selectedRow = [customNodeTable selectedRow];
+
+ NodeStyle* selectedNodeStyle = [customNodeStyles objectAtIndex:selectedRow];
+ TikzShape *tikzshape = (TikzShape *) [nodeStyles objectForKey:[selectedNodeStyle shapeName]];
+
+ [[tikzSourceController graphicsView] setEnabled:NO];
+ [tikzSourceController setTikz:[tikzshape tikzSrc]];
+ [tikzSourceController parseTikz:self];
}
- (id)valueForUndefinedKey:(NSString *)key{