diff options
-rw-r--r-- | Interfaces/English.lproj/BundleHTMLOutput.xib | 302 | ||||
-rw-r--r-- | Source/SPBundleHTMLOutputController.h | 38 | ||||
-rw-r--r-- | Source/SPBundleHTMLOutputController.m | 71 | ||||
-rw-r--r-- | sequel-pro.xcodeproj/project.pbxproj | 18 |
4 files changed, 429 insertions, 0 deletions
diff --git a/Interfaces/English.lproj/BundleHTMLOutput.xib b/Interfaces/English.lproj/BundleHTMLOutput.xib new file mode 100644 index 00000000..152463dc --- /dev/null +++ b/Interfaces/English.lproj/BundleHTMLOutput.xib @@ -0,0 +1,302 @@ +<?xml version="1.0" encoding="UTF-8"?> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> + <data> + <int key="IBDocument.SystemTarget">1060</int> + <string key="IBDocument.SystemVersion">10H574</string> + <string key="IBDocument.InterfaceBuilderVersion">788</string> + <string key="IBDocument.AppKitVersion">1038.35</string> + <string key="IBDocument.HIToolboxVersion">461.00</string> + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.WebKitIBPlugin</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>788</string> + <string>788</string> + </object> + </object> + <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> + <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="2"/> + </object> + <object class="NSArray" key="IBDocument.PluginDependencies"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>com.apple.WebKitIBPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + </object> + <object class="NSMutableDictionary" key="IBDocument.Metadata"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys" id="0"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSCustomObject" id="1001"> + <string key="NSClassName">SPBundleHTMLOutputController</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, 240}, {480, 270}}</string> + <int key="NSWTFlags">544735232</int> + <string key="NSWindowTitle">Window</string> + <string key="NSWindowClass">NSWindow</string> + <nil key="NSViewClass"/> + <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <object class="NSView" key="NSWindowView" id="1006"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">256</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="WebView" id="472558256"> + <reference key="NSNextResponder" ref="1006"/> + <int key="NSvFlags">274</int> + <object class="NSMutableSet" key="NSDragTypes"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="set.sortedObjects"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>Apple HTML pasteboard type</string> + <string>Apple PDF pasteboard type</string> + <string>Apple PICT pasteboard type</string> + <string>Apple URL pasteboard type</string> + <string>Apple Web Archive pasteboard type</string> + <string>NSColor pasteboard type</string> + <string>NSFilenamesPboardType</string> + <string>NSStringPboardType</string> + <string>NeXT RTFD pasteboard type</string> + <string>NeXT Rich Text Format v1.0 pasteboard type</string> + <string>NeXT TIFF v4.0 pasteboard type</string> + <string>WebURLsWithTitlesPboardType</string> + <string>public.png</string> + <string>public.url</string> + <string>public.url-name</string> + </object> + </object> + <string key="NSFrameSize">{480, 270}</string> + <reference key="NSSuperview" ref="1006"/> + <reference key="NSNextKeyView"/> + <string key="FrameName"/> + <string key="GroupName"/> + <object class="WebPreferences" key="Preferences"> + <string key="Identifier"/> + <object class="NSMutableDictionary" key="Values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>WebKitDefaultFixedFontSize</string> + <string>WebKitDefaultFontSize</string> + <string>WebKitMinimumFontSize</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="12"/> + <integer value="12"/> + <integer value="1"/> + </object> + </object> + </object> + <bool key="UseBackForwardList">YES</bool> + <bool key="AllowsUndo">YES</bool> + </object> + </object> + <string key="NSFrameSize">{480, 270}</string> + <reference key="NSSuperview"/> + </object> + <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string> + <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + </object> + </object> + <object class="IBObjectContainer" key="IBDocument.Objects"> + <object class="NSMutableArray" key="connectionRecords"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">UIDelegate</string> + <reference key="source" ref="472558256"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">8</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">wevView</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="472558256"/> + </object> + <int key="connectionID">9</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="1005"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">10</int> + </object> + <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">12</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">policyDelegate</string> + <reference key="source" ref="472558256"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">13</int> + </object> + </object> + <object class="IBMutableOrderedSet" key="objectRecords"> + <object class="NSArray" key="orderedObjects"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBObjectRecord"> + <int key="objectID">0</int> + <reference key="object" ref="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"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="1006"/> + </object> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">2</int> + <reference key="object" ref="1006"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="472558256"/> + </object> + <reference key="parent" ref="1005"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">3</int> + <reference key="object" ref="472558256"/> + <reference key="parent" ref="1006"/> + </object> + </object> + </object> + <object class="NSMutableDictionary" key="flattenedProperties"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>-1.IBPluginDependency</string> + <string>-2.IBPluginDependency</string> + <string>-3.IBPluginDependency</string> + <string>1.IBEditorWindowLastContentRect</string> + <string>1.IBPluginDependency</string> + <string>1.IBWindowTemplateEditedContentRect</string> + <string>1.NSWindowTemplate.visibleAtLaunch</string> + <string>1.WindowOrigin</string> + <string>1.editorWindowContentRectSynchronizationRect</string> + <string>2.IBPluginDependency</string> + <string>3.IBPluginDependency</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{99, 355}, {480, 270}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{99, 355}, {480, 270}}</string> + <boolean value="NO"/> + <string>{196, 240}</string> + <string>{{357, 418}, {480, 270}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.WebKitIBPlugin</string> + </object> + </object> + <object class="NSMutableDictionary" key="unlocalizedProperties"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference key="dict.sortedKeys" ref="0"/> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <nil key="activeLocalization"/> + <object class="NSMutableDictionary" key="localizations"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference key="dict.sortedKeys" ref="0"/> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <nil key="sourceID"/> + <int key="maxID">13</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"> + <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBPartialClassDescription"> + <string key="className">SPBundleHTMLOutputController</string> + <string key="superclassName">NSWindowController</string> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">wevView</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">wevView</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">wevView</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBDocumentRelativeSource</string> + <string key="minorKey">../../Source/SPBundleHTMLOutputController.h</string> + </object> + </object> + </object> + </object> + <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> + <integer value="3000" key="NS.object.0"/> + </object> + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> + <nil key="IBDocument.LastKnownRelativeProjectPath"/> + <int key="IBDocument.defaultPropertyAccessControl">3</int> + </data> +</archive> diff --git a/Source/SPBundleHTMLOutputController.h b/Source/SPBundleHTMLOutputController.h new file mode 100644 index 00000000..9965aec9 --- /dev/null +++ b/Source/SPBundleHTMLOutputController.h @@ -0,0 +1,38 @@ +// +// $Id$ +// +// SPBundleHTMLOutputController.h +// sequel-pro +// +// Created by Hans-Jörg Bibiko on November 22, 2010 +// +// This program 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 2 of the License, or +// (at your option) any later version. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at <http://code.google.com/p/sequel-pro/> + +#import <Cocoa/Cocoa.h> +#import <WebKit/WebKit.h> + +@interface SPBundleHTMLOutputController : NSWindowController { + + IBOutlet WebView *webView; + + WebPreferences *webPreferences; + +} + +- (void)displayHTMLContent:(NSString *)content withOptions:(NSDictionary *)displayOptions; + +@end diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m new file mode 100644 index 00000000..3b10380d --- /dev/null +++ b/Source/SPBundleHTMLOutputController.m @@ -0,0 +1,71 @@ +// +// $Id$ +// +// SPBundleHTMLOutputController.m +// sequel-pro +// +// Created by Hans-Jörg Bibiko on November 22, 2010 +// +// This program 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 2 of the License, or +// (at your option) any later version. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at <http://code.google.com/p/sequel-pro/> + + +#import "SPBundleHTMLOutputController.h" + + +@implementation SPBundleHTMLOutputController + +/** + * Initialisation + */ +- (id)init +{ + + if ((self = [super initWithWindowNibName:@"BundleHTMLOutput"])) { + + ; + + } + + return self; + +} + +- (void)displayHTMLContent:(NSString *)content withOptions:(NSDictionary *)displayOptions +{ + NSString *fullContent = @"%@"; + fullContent = [NSString stringWithFormat:fullContent, content]; + [[webView mainFrame] loadHTMLString:fullContent baseURL:nil]; + [[self window] makeKeyAndOrderFront:nil]; + +} + +// - (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener +// { +// } +// +// - (void)webView:(WebView*)sender didFinishLoadForFrame:(WebFrame*)frame; +// { +// } + +- (void)dealloc +{ + [webView release]; + if(webPreferences) [webPreferences release]; + [super dealloc]; +} + +@end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index d03f394d..230530df 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -401,6 +401,8 @@ BC68BFC7128D4EAE004907D9 /* SPBundleEditorController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC68BFC6128D4EAE004907D9 /* SPBundleEditorController.m */; }; BC6D709D120C4C97008027B5 /* SPEditorTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 179F15040F7C433C00579954 /* SPEditorTokens.h */; }; BC6D709E120C4C9F008027B5 /* SPEditorTokens.l in Sources */ = {isa = PBXBuildFile; fileRef = 179F15050F7C433C00579954 /* SPEditorTokens.l */; }; + BC77C5E1129AA67F009AD832 /* BundleHTMLOutput.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC77C5DF129AA67F009AD832 /* BundleHTMLOutput.xib */; }; + BC77C5E4129AA69E009AD832 /* SPBundleHTMLOutputController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC77C5E3129AA69E009AD832 /* SPBundleHTMLOutputController.m */; }; BC85F5D012193B7D00E255B5 /* SPColorAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC85F5CF12193B7D00E255B5 /* SPColorAdditions.m */; }; BC878A71121A836F00AE5066 /* SPColorWellCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BC878A70121A836F00AE5066 /* SPColorWellCell.m */; }; BC8B0DAF104004F900FC02EC /* EncodingPopupView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC8B0DAD104004F900FC02EC /* EncodingPopupView.xib */; }; @@ -1121,6 +1123,9 @@ BC675A16107203BA00C5ACD4 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/ContentFilterManager.xib; sourceTree = "<group>"; }; BC68BFC5128D4EAE004907D9 /* SPBundleEditorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPBundleEditorController.h; sourceTree = "<group>"; }; BC68BFC6128D4EAE004907D9 /* SPBundleEditorController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPBundleEditorController.m; sourceTree = "<group>"; }; + BC77C5E0129AA67F009AD832 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/BundleHTMLOutput.xib; sourceTree = "<group>"; }; + BC77C5E2129AA69E009AD832 /* SPBundleHTMLOutputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPBundleHTMLOutputController.h; sourceTree = "<group>"; }; + BC77C5E3129AA69E009AD832 /* SPBundleHTMLOutputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPBundleHTMLOutputController.m; sourceTree = "<group>"; }; BC85F5CE12193B7D00E255B5 /* SPColorAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPColorAdditions.h; sourceTree = "<group>"; }; BC85F5CF12193B7D00E255B5 /* SPColorAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPColorAdditions.m; sourceTree = "<group>"; }; BC878A6F121A836F00AE5066 /* SPColorWellCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPColorWellCell.h; sourceTree = "<group>"; }; @@ -1912,6 +1917,8 @@ 17E641470EF01EB8001BC333 /* Controllers */ = { isa = PBXGroup; children = ( + BC77C5E2129AA69E009AD832 /* SPBundleHTMLOutputController.h */, + BC77C5E3129AA69E009AD832 /* SPBundleHTMLOutputController.m */, BC68BFC5128D4EAE004907D9 /* SPBundleEditorController.h */, BC68BFC6128D4EAE004907D9 /* SPBundleEditorController.m */, 17E6414A0EF01EF6001BC333 /* SPAppController.h */, @@ -2097,6 +2104,7 @@ 17E642050EF020A3001BC333 /* Interfaces */ = { isa = PBXGroup; children = ( + BC77C5DF129AA67F009AD832 /* BundleHTMLOutput.xib */, BCCB7478128D4FD100339E25 /* BundleEditor.xib */, 1761FD460EF03A6F00331368 /* MainMenu.xib */, 58A8A72611A0149100B95749 /* MainWindow.xib */, @@ -2832,6 +2840,7 @@ 58E205FC1234FE4F00A97059 /* KeyTemplate.pdf in Resources */, 58A137CD123ED5E6000B1B75 /* titlebarlock.png in Resources */, BCCB747A128D4FD100339E25 /* BundleEditor.xib in Resources */, + BC77C5E1129AA67F009AD832 /* BundleHTMLOutput.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3107,6 +3116,7 @@ 17D3C6D3128B1C900047709F /* SPFavoritesOutlineView.m in Sources */, BC68BFC7128D4EAE004907D9 /* SPBundleEditorController.m in Sources */, BC1944D01297291800A236CD /* SPBundleCommandTextView.m in Sources */, + BC77C5E4129AA69E009AD832 /* SPBundleHTMLOutputController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3395,6 +3405,14 @@ name = ContentFilterManager.xib; sourceTree = "<group>"; }; + BC77C5DF129AA67F009AD832 /* BundleHTMLOutput.xib */ = { + isa = PBXVariantGroup; + children = ( + BC77C5E0129AA67F009AD832 /* English */, + ); + name = BundleHTMLOutput.xib; + sourceTree = "<group>"; + }; BC8B0DAD104004F900FC02EC /* EncodingPopupView.xib */ = { isa = PBXVariantGroup; children = ( |