From 6e3ce5d93bfab8ea0c83b2757144cd805f2388b2 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 22 Nov 2010 14:20:31 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20skeleton=20for=20displaying=20the?= =?UTF-8?q?=20result=20of=20Bundle=20commands=20in=20a=20separate=20HTML?= =?UTF-8?q?=20webkit=20window?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/English.lproj/BundleHTMLOutput.xib | 302 ++++++++++++++++++++++++++ Source/SPBundleHTMLOutputController.h | 38 ++++ Source/SPBundleHTMLOutputController.m | 71 ++++++ sequel-pro.xcodeproj/project.pbxproj | 18 ++ 4 files changed, 429 insertions(+) create mode 100644 Interfaces/English.lproj/BundleHTMLOutput.xib create mode 100644 Source/SPBundleHTMLOutputController.h create mode 100644 Source/SPBundleHTMLOutputController.m 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 @@ + + + + 1060 + 10H574 + 788 + 1038.35 + 461.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 788 + 788 + + + + YES + + + + YES + com.apple.WebKitIBPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + SPBundleHTMLOutputController + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{196, 240}, {480, 270}} + 544735232 + Window + NSWindow + + {3.40282e+38, 3.40282e+38} + + + 256 + + YES + + + 274 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + + {480, 270} + + + + + + + + YES + + YES + WebKitDefaultFixedFontSize + WebKitDefaultFontSize + WebKitMinimumFontSize + + + YES + + + + + + + YES + YES + + + {480, 270} + + + {{0, 0}, {1680, 1028}} + {3.40282e+38, 3.40282e+38} + + + + + YES + + + UIDelegate + + + + 8 + + + + wevView + + + + 9 + + + + delegate + + + + 10 + + + + window + + + + 12 + + + + policyDelegate + + + + 13 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + 3 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 2.IBPluginDependency + 3.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{99, 355}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + {{99, 355}, {480, 270}} + + {196, 240} + {{357, 418}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 13 + + + + YES + + SPBundleHTMLOutputController + NSWindowController + + wevView + id + + + wevView + + wevView + id + + + + IBDocumentRelativeSource + ../../Source/SPBundleHTMLOutputController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + 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 + +#import +#import + +@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 + + +#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)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 = ""; }; BC68BFC5128D4EAE004907D9 /* SPBundleEditorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPBundleEditorController.h; sourceTree = ""; }; BC68BFC6128D4EAE004907D9 /* SPBundleEditorController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPBundleEditorController.m; sourceTree = ""; }; + BC77C5E0129AA67F009AD832 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/BundleHTMLOutput.xib; sourceTree = ""; }; + BC77C5E2129AA69E009AD832 /* SPBundleHTMLOutputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPBundleHTMLOutputController.h; sourceTree = ""; }; + BC77C5E3129AA69E009AD832 /* SPBundleHTMLOutputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPBundleHTMLOutputController.m; sourceTree = ""; }; BC85F5CE12193B7D00E255B5 /* SPColorAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPColorAdditions.h; sourceTree = ""; }; BC85F5CF12193B7D00E255B5 /* SPColorAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPColorAdditions.m; sourceTree = ""; }; BC878A6F121A836F00AE5066 /* SPColorWellCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPColorWellCell.h; sourceTree = ""; }; @@ -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 = ""; }; + BC77C5DF129AA67F009AD832 /* BundleHTMLOutput.xib */ = { + isa = PBXVariantGroup; + children = ( + BC77C5E0129AA67F009AD832 /* English */, + ); + name = BundleHTMLOutput.xib; + sourceTree = ""; + }; BC8B0DAD104004F900FC02EC /* EncodingPopupView.xib */ = { isa = PBXVariantGroup; children = ( -- cgit v1.2.3