summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Paulsson <gonz@Akita.local>2013-11-30 19:32:09 -0800
committerJohan Paulsson <gonz@Akita.local>2013-11-30 19:32:09 -0800
commit2c0baccbe99f52c402d6c0f9882192477c9b5246 (patch)
treee7f41047a1464b836325e8c524f9f8361351431c
parentf054e040a12df4160c632039289b925b251fc81d (diff)
osx gui: Added dragging of the preview pdf to other applications.
The preview area can be dragged as a pasteboard pdf to other applications rich text editor views. Notably, this means that small images can be made and emailed as PDFs. This is not dragging the PDFs as files so dragging to the finder for saving doesn’t work.
-rw-r--r--tikzit/English.lproj/Preview.xib499
-rw-r--r--tikzit/TikZiT.xcodeproj/project.pbxproj6
-rw-r--r--tikzit/src/osx/DraggablePDFView.h28
-rw-r--r--tikzit/src/osx/DraggablePDFView.m56
-rw-r--r--tikzit/src/osx/PreviewController.h3
5 files changed, 162 insertions, 430 deletions
diff --git a/tikzit/English.lproj/Preview.xib b/tikzit/English.lproj/Preview.xib
index 46d3521..cb1e82c 100644
--- a/tikzit/English.lproj/Preview.xib
+++ b/tikzit/English.lproj/Preview.xib
@@ -1,429 +1,70 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
- <data>
- <int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">11B26</string>
- <string key="IBDocument.InterfaceBuilderVersion">1617</string>
- <string key="IBDocument.AppKitVersion">1138</string>
- <string key="IBDocument.HIToolboxVersion">566.00</string>
- <dictionary class="NSMutableDictionary" key="IBDocument.PluginVersions">
- <string key="com.apple.InterfaceBuilder.CocoaPlugin">1617</string>
- <string key="com.apple.pdfkit.ibplugin">518</string>
- </dictionary>
- <array key="IBDocument.IntegratedClassDependencies">
- <string>NSView</string>
- <string>NSProgressIndicator</string>
- <string>NSScrollView</string>
- <string>NSWindowTemplate</string>
- <string>NSTextView</string>
- <string>PDFView</string>
- <string>NSScroller</string>
- <string>NSCustomObject</string>
- </array>
- <array key="IBDocument.PluginDependencies">
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.pdfkit.ibplugin</string>
- </array>
- <dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
- <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
- <object class="NSCustomObject" id="1001">
- <string key="NSClassName">PreviewController</string>
- </object>
- <object class="NSCustomObject" id="1003">
- <string key="NSClassName">FirstResponder</string>
- </object>
- <object class="NSCustomObject" id="1004">
- <string key="NSClassName">NSApplication</string>
- </object>
- <object class="NSWindowTemplate" id="1005">
- <int key="NSWindowStyleMask">15</int>
- <int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{196, 138}, {480, 380}}</string>
- <int key="NSWTFlags">536870912</int>
- <string key="NSWindowTitle">Preview</string>
- <string key="NSWindowClass">NSWindow</string>
- <nil key="NSViewClass"/>
- <nil key="NSUserInterfaceItemIdentifier"/>
- <object class="NSView" key="NSWindowView" id="1006">
- <reference key="NSNextResponder"/>
- <int key="NSvFlags">256</int>
- <array class="NSMutableArray" key="NSSubviews">
- <object class="PDFView" id="559995612">
- <reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">18</int>
- <set class="NSMutableSet" key="NSDragTypes">
- <string>NSFilenamesPboardType</string>
- </set>
- <string key="NSFrameSize">{480, 380}</string>
- <reference key="NSSuperview" ref="1006"/>
- <reference key="NSWindow"/>
- <int key="DisplayMode">0</int>
- <bool key="PageBreaks">NO</bool>
- <float key="ScaleFactor">0.47979798913002014</float>
- <bool key="AutoScale">YES</bool>
- </object>
- <object class="NSScrollView" id="85317206">
- <reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">-2147483374</int>
- <array class="NSMutableArray" key="NSSubviews">
- <object class="NSClipView" id="1008228920">
- <reference key="NSNextResponder" ref="85317206"/>
- <int key="NSvFlags">2304</int>
- <array class="NSMutableArray" key="NSSubviews">
- <object class="NSTextView" id="149903598">
- <reference key="NSNextResponder" ref="1008228920"/>
- <int key="NSvFlags">2322</int>
- <string key="NSFrameSize">{478, 14}</string>
- <reference key="NSSuperview" ref="1008228920"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="855264569"/>
- <object class="NSTextContainer" key="NSTextContainer" id="312066238">
- <object class="NSLayoutManager" key="NSLayoutManager">
- <object class="NSTextStorage" key="NSTextStorage">
- <object class="NSMutableString" key="NSString">
- <characters key="NS.bytes"/>
- </object>
- <nil key="NSDelegate"/>
- </object>
- <array class="NSMutableArray" key="NSTextContainers">
- <reference ref="312066238"/>
- </array>
- <int key="NSLMFlags">134</int>
- <nil key="NSDelegate"/>
- </object>
- <reference key="NSTextView" ref="149903598"/>
- <double key="NSWidth">478</double>
- <int key="NSTCFlags">1</int>
- </object>
- <object class="NSTextViewSharedData" key="NSSharedData">
- <int key="NSFlags">12129</int>
- <int key="NSTextCheckingTypes">0</int>
- <nil key="NSMarkedAttributes"/>
- <object class="NSColor" key="NSBackgroundColor" id="579751116">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MQA</bytes>
- </object>
- <dictionary key="NSSelectedAttributes">
- <object class="NSColor" key="NSBackgroundColor">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">selectedTextBackgroundColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
- </object>
- </object>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">selectedTextColor</string>
- <object class="NSColor" key="NSColor" id="420089075">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MAA</bytes>
- </object>
- </object>
- </dictionary>
- <reference key="NSInsertionColor" ref="420089075"/>
- <dictionary key="NSLinkAttributes">
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">1</int>
- <bytes key="NSRGB">MCAwIDEAA</bytes>
- </object>
- <object class="NSCursor" key="NSCursor">
- <string key="NSHotSpot">{8, -8}</string>
- <int key="NSCursorType">13</int>
- </object>
- <integer value="1" key="NSUnderline"/>
- </dictionary>
- <nil key="NSDefaultParagraphStyle"/>
- <nil key="NSTextFinder"/>
- <int key="NSPreferredTextFinderStyle">1</int>
- </object>
- <int key="NSTVFlags">6</int>
- <string key="NSMaxSize">{493, 10000000}</string>
- <string key="NSMinize">{223, 0}</string>
- <nil key="NSDelegate"/>
- </object>
- </array>
- <string key="NSFrame">{{1, 1}, {478, 378}}</string>
- <reference key="NSSuperview" ref="85317206"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="149903598"/>
- <reference key="NSDocView" ref="149903598"/>
- <reference key="NSBGColor" ref="579751116"/>
- <object class="NSCursor" key="NSCursor">
- <string key="NSHotSpot">{4, 5}</string>
- <object class="NSImage" key="NSImage">
- <int key="NSImageFlags">12582912</int>
- <array class="NSMutableArray" key="NSReps">
- <array>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym
-SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA
-AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA
-AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA
-AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
- </object>
- </object>
- </array>
- </array>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MCAwAA</bytes>
- </object>
- </object>
- </object>
- <int key="NScvFlags">4</int>
- </object>
- <object class="NSScroller" id="1068233475">
- <reference key="NSNextResponder" ref="85317206"/>
- <int key="NSvFlags">256</int>
- <string key="NSFrame">{{464, 1}, {15, 378}}</string>
- <reference key="NSSuperview" ref="85317206"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="683216700"/>
- <reference key="NSTarget" ref="85317206"/>
- <string key="NSAction">_doScroller:</string>
- <double key="NSPercent">0.99248120300751874</double>
- </object>
- <object class="NSScroller" id="855264569">
- <reference key="NSNextResponder" ref="85317206"/>
- <int key="NSvFlags">-2147483392</int>
- <string key="NSFrame">{{-100, -100}, {463, 15}}</string>
- <reference key="NSSuperview" ref="85317206"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="1008228920"/>
- <int key="NSsFlags">1</int>
- <reference key="NSTarget" ref="85317206"/>
- <string key="NSAction">_doScroller:</string>
- <double key="NSCurValue">1</double>
- <double key="NSPercent">0.94565218687057495</double>
- </object>
- </array>
- <string key="NSFrameSize">{480, 380}</string>
- <reference key="NSSuperview" ref="1006"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="1008228920"/>
- <int key="NSsFlags">133138</int>
- <reference key="NSVScroller" ref="1068233475"/>
- <reference key="NSHScroller" ref="855264569"/>
- <reference key="NSContentView" ref="1008228920"/>
- </object>
- <object class="NSProgressIndicator" id="683216700">
- <reference key="NSNextResponder" ref="1006"/>
- <int key="NSvFlags">1292</int>
- <object class="NSPSMatrix" key="NSDrawMatrix"/>
- <string key="NSFrame">{{7, 342}, {32, 32}}</string>
- <reference key="NSSuperview" ref="1006"/>
- <reference key="NSWindow"/>
- <int key="NSpiFlags">28682</int>
- <double key="NSMaxValue">100</double>
- </object>
- </array>
- <string key="NSFrameSize">{480, 380}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="559995612"/>
- </object>
- <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
- <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
- <bool key="NSWindowIsRestorable">YES</bool>
- </object>
- </array>
- <object class="IBObjectContainer" key="IBDocument.Objects">
- <array class="NSMutableArray" key="connectionRecords">
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">window</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="1005"/>
- </object>
- <int key="connectionID">4</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">pdfView</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="559995612"/>
- </object>
- <int key="connectionID">5</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">progressIndicator</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="683216700"/>
- </object>
- <int key="connectionID">7</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">errorText</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="149903598"/>
- </object>
- <int key="connectionID">12</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">errorTextView</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="85317206"/>
- </object>
- <int key="connectionID">13</int>
- </object>
- </array>
- <object class="IBMutableOrderedSet" key="objectRecords">
- <array key="orderedObjects">
- <object class="IBObjectRecord">
- <int key="objectID">0</int>
- <array key="object" id="0"/>
- <reference key="children" ref="1000"/>
- <nil key="parent"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-2</int>
- <reference key="object" ref="1001"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">File's Owner</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-1</int>
- <reference key="object" ref="1003"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">First Responder</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-3</int>
- <reference key="object" ref="1004"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">Application</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">1</int>
- <reference key="object" ref="1005"/>
- <array class="NSMutableArray" key="children">
- <reference ref="1006"/>
- </array>
- <reference key="parent" ref="0"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">2</int>
- <reference key="object" ref="1006"/>
- <array class="NSMutableArray" key="children">
- <reference ref="559995612"/>
- <reference ref="683216700"/>
- <reference ref="85317206"/>
- </array>
- <reference key="parent" ref="1005"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">3</int>
- <reference key="object" ref="559995612"/>
- <reference key="parent" ref="1006"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">6</int>
- <reference key="object" ref="683216700"/>
- <reference key="parent" ref="1006"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">8</int>
- <reference key="object" ref="85317206"/>
- <array class="NSMutableArray" key="children">
- <reference ref="1068233475"/>
- <reference ref="855264569"/>
- <reference ref="149903598"/>
- </array>
- <reference key="parent" ref="1006"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">9</int>
- <reference key="object" ref="1068233475"/>
- <reference key="parent" ref="85317206"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">10</int>
- <reference key="object" ref="855264569"/>
- <reference key="parent" ref="85317206"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">11</int>
- <reference key="object" ref="149903598"/>
- <reference key="parent" ref="85317206"/>
- </object>
- </array>
- </object>
- <dictionary class="NSMutableDictionary" key="flattenedProperties">
- <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="1.IBWindowTemplateEditedContentRect">{{162, 413}, {480, 380}}</string>
- <integer value="1" key="1.NSWindowTemplate.visibleAtLaunch"/>
- <string key="10.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="3.IBPluginDependency">com.apple.pdfkit.ibplugin</string>
- <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
- <nil key="activeLocalization"/>
- <dictionary class="NSMutableDictionary" key="localizations"/>
- <nil key="sourceID"/>
- <int key="maxID">13</int>
- </object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <array class="NSMutableArray" key="referencedPartialClassDescriptions">
- <object class="IBPartialClassDescription">
- <string key="className">PreviewController</string>
- <string key="superclassName">NSWindowController</string>
- <dictionary class="NSMutableDictionary" key="outlets">
- <string key="errorText">NSTextView</string>
- <string key="errorTextView">NSScrollView</string>
- <string key="pdfView">PDFView</string>
- <string key="progressIndicator">NSProgressIndicator</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
- <object class="IBToOneOutletInfo" key="errorText">
- <string key="name">errorText</string>
- <string key="candidateClassName">NSTextView</string>
- </object>
- <object class="IBToOneOutletInfo" key="errorTextView">
- <string key="name">errorTextView</string>
- <string key="candidateClassName">NSScrollView</string>
- </object>
- <object class="IBToOneOutletInfo" key="pdfView">
- <string key="name">pdfView</string>
- <string key="candidateClassName">PDFView</string>
- </object>
- <object class="IBToOneOutletInfo" key="progressIndicator">
- <string key="name">progressIndicator</string>
- <string key="candidateClassName">NSProgressIndicator</string>
- </object>
- </dictionary>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/PreviewController.h</string>
- </object>
- </object>
- </array>
- </object>
- <int key="IBDocument.localizationMode">0</int>
- <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <integer value="1050" key="NS.object.0"/>
- </object>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
- <real value="3200" key="NS.object.0"/>
- </object>
- <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <int key="IBDocument.defaultPropertyAccessControl">3</int>
- </data>
-</archive>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+ <dependencies>
+ <deployment defaultVersion="1070" identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
+ <plugIn identifier="com.apple.pdfkit.ibplugin" version="3338"/>
+ </dependencies>
+ <objects>
+ <customObject id="-2" userLabel="File's Owner" customClass="PreviewController">
+ <connections>
+ <outlet property="errorText" destination="11" id="12"/>
+ <outlet property="errorTextView" destination="8" id="13"/>
+ <outlet property="pdfView" destination="3" id="5"/>
+ <outlet property="progressIndicator" destination="6" id="7"/>
+ <outlet property="window" destination="1" id="4"/>
+ </connections>
+ </customObject>
+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+ <customObject id="-3" userLabel="Application"/>
+ <window title="Preview" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" wantsToBeColor="NO" animationBehavior="default" id="1">
+ <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+ <windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
+ <rect key="contentRect" x="196" y="138" width="480" height="380"/>
+ <rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
+ <view key="contentView" id="2">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="380"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <pdfView autoresizesSubviews="NO" wantsLayer="YES" displayMode="singlePage" displaysPageBreaks="NO" autoScales="YES" id="3" customClass="DraggablePDFView">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="380"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ </pdfView>
+ <scrollView hidden="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="8">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="380"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <clipView key="contentView" id="5CZ-eC-gQr">
+ <rect key="frame" x="1" y="1" width="463" height="378"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <textView editable="NO" importsGraphics="NO" richText="NO" findStyle="panel" allowsUndo="YES" usesRuler="YES" usesFontPanel="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" spellingCorrection="YES" smartInsertDelete="YES" id="11">
+ <rect key="frame" x="0.0" y="0.0" width="463" height="378"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <size key="minSize" width="463" height="378"/>
+ <size key="maxSize" width="493" height="10000000"/>
+ <color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <size key="minSize" width="463" height="378"/>
+ <size key="maxSize" width="493" height="10000000"/>
+ </textView>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ </clipView>
+ <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="10">
+ <rect key="frame" x="-100" y="-100" width="463" height="15"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="9">
+ <rect key="frame" x="464" y="1" width="15" height="378"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ </scrollView>
+ <progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" style="spinning" id="6">
+ <rect key="frame" x="7" y="342" width="32" height="32"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ </progressIndicator>
+ </subviews>
+ </view>
+ </window>
+ </objects>
+</document> \ No newline at end of file
diff --git a/tikzit/TikZiT.xcodeproj/project.pbxproj b/tikzit/TikZiT.xcodeproj/project.pbxproj
index 01e63c7..8b4df9b 100644
--- a/tikzit/TikZiT.xcodeproj/project.pbxproj
+++ b/tikzit/TikZiT.xcodeproj/project.pbxproj
@@ -129,6 +129,7 @@
7F6E2C8916B0091300BFE20D /* maths.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F6E2C8716B0091300BFE20D /* maths.m */; };
7F6E2C8A16B0096000BFE20D /* SupportDir.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652DF813E1F2030023F4C6 /* SupportDir.m */; };
7F6E2C8C16B00ABA00BFE20D /* SFBInspectors.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 55CA98D412EF8FCE008F0368 /* SFBInspectors.framework */; };
+ 7F73438A184AC559002897D0 /* DraggablePDFView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F734389184AC559002897D0 /* DraggablePDFView.m */; };
7F781C1A16B5DE1400239826 /* ParseErrorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F781C1916B5DE1400239826 /* ParseErrorView.m */; };
7F90E88616DD29600069EBCD /* NSString+Tikz.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F90E88516DD29600069EBCD /* NSString+Tikz.m */; };
7F90E88D16DD47540069EBCD /* PreferenceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F90E88B16DD47540069EBCD /* PreferenceController.m */; };
@@ -370,6 +371,8 @@
55F9E04411FF54F000F5659E /* NSString+LatexConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+LatexConstants.m"; path = "src/common/NSString+LatexConstants.m"; sourceTree = "<group>"; };
55FF4E64116A401B000C22B4 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
7F6E2C8716B0091300BFE20D /* maths.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = maths.m; path = src/common/test/maths.m; sourceTree = "<group>"; };
+ 7F734388184AC559002897D0 /* DraggablePDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DraggablePDFView.h; path = src/osx/DraggablePDFView.h; sourceTree = "<group>"; };
+ 7F734389184AC559002897D0 /* DraggablePDFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DraggablePDFView.m; path = src/osx/DraggablePDFView.m; sourceTree = "<group>"; };
7F781C1816B5DE1400239826 /* ParseErrorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ParseErrorView.h; path = src/osx/ParseErrorView.h; sourceTree = "<group>"; };
7F781C1916B5DE1400239826 /* ParseErrorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ParseErrorView.m; path = src/osx/ParseErrorView.m; sourceTree = "<group>"; };
7F90E88416DD29600069EBCD /* NSString+Tikz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+Tikz.h"; path = "src/common/NSString+Tikz.h"; sourceTree = "<group>"; };
@@ -573,6 +576,8 @@
5573B8BF11D9FD1800B5DC5D /* Preview */ = {
isa = PBXGroup;
children = (
+ 7F734388184AC559002897D0 /* DraggablePDFView.h */,
+ 7F734389184AC559002897D0 /* DraggablePDFView.m */,
5573B8C011D9FD3200B5DC5D /* PreviewController.h */,
5573B8C111D9FD3200B5DC5D /* PreviewController.m */,
);
@@ -902,6 +907,7 @@
558F18F7117B043C009863B2 /* AppDelegate.m in Sources */,
558F18F9117B043C009863B2 /* EdgeControlLayer.m in Sources */,
558F18FA117B043C009863B2 /* GraphicsView.m in Sources */,
+ 7F73438A184AC559002897D0 /* DraggablePDFView.m in Sources */,
558F18FB117B043C009863B2 /* Grid.m in Sources */,
558F18FC117B043C009863B2 /* NodeLayer.m in Sources */,
558F18FD117B043C009863B2 /* NodeSelectionLayer.m in Sources */,
diff --git a/tikzit/src/osx/DraggablePDFView.h b/tikzit/src/osx/DraggablePDFView.h
new file mode 100644
index 0000000..9e53c44
--- /dev/null
+++ b/tikzit/src/osx/DraggablePDFView.h
@@ -0,0 +1,28 @@
+//
+// PreviewController.h
+// TikZiT
+//
+// Copyright 2010 Aleks Kissinger. All rights reserved.
+//
+//
+// This file is part of TikZiT.
+//
+// TikZiT is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TikZiT is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TikZiT. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#import <Quartz/Quartz.h>
+
+@interface DraggablePDFView : PDFView
+
+@end
diff --git a/tikzit/src/osx/DraggablePDFView.m b/tikzit/src/osx/DraggablePDFView.m
new file mode 100644
index 0000000..ce57473
--- /dev/null
+++ b/tikzit/src/osx/DraggablePDFView.m
@@ -0,0 +1,56 @@
+//
+// PreviewController.h
+// TikZiT
+//
+// Copyright 2010 Aleks Kissinger. All rights reserved.
+//
+//
+// This file is part of TikZiT.
+//
+// TikZiT is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// TikZiT is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with TikZiT. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#import "DraggablePDFView.h"
+
+@implementation DraggablePDFView
+
+- (id)initWithFrame:(NSRect)frame
+{
+ self = [super initWithFrame:frame];
+ return self;
+}
+
+- (void)drawRect:(NSRect)dirtyRect
+{
+ [super drawRect:dirtyRect];
+}
+
+- (void)mouseDown:(NSEvent *)theEvent
+{
+ NSPasteboard *pboard;
+
+ NSRect pageBox = [[[self document] pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox];
+ NSRect pageRect= [self convertRect:pageBox fromPage:[[self document] pageAtIndex:0]];
+
+ pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
+ [pboard declareTypes:[NSArray arrayWithObject:NSPasteboardTypePDF] owner:self];
+ [pboard setData:[[self document] dataRepresentation] forType:NSPasteboardTypePDF];
+
+ [self dragImage:[[NSImage alloc] initWithData:[[self document] dataRepresentation]] at:pageRect.origin offset:pageRect.size
+ event:theEvent pasteboard:pboard source:self slideBack:YES];
+
+ return;
+}
+
+@end
diff --git a/tikzit/src/osx/PreviewController.h b/tikzit/src/osx/PreviewController.h
index d6d855e..6c51a23 100644
--- a/tikzit/src/osx/PreviewController.h
+++ b/tikzit/src/osx/PreviewController.h
@@ -23,12 +23,13 @@
#import <Cocoa/Cocoa.h>
+#import "DraggablePDFView.h"
@class PDFView;
@class PreambleController;
@interface PreviewController : NSWindowController {
- IBOutlet PDFView *pdfView;
+ IBOutlet DraggablePDFView *pdfView;
IBOutlet NSProgressIndicator *progressIndicator;
IBOutlet NSScrollView *errorTextView;
IBOutlet NSTextView *errorText;