summaryrefslogtreecommitdiff
path: root/cocoa
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-02-17 12:12:51 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-02-17 12:12:51 +0000
commitabe3300ea16d46afa38411d5c2940bbb30607e57 (patch)
tree67f31ef4729898f8cfa06c4fdf14ff8fe02ce6e5 /cocoa
parent6bced73998312f7ddb68f5d572fef2214ddbe4f4 (diff)
downloadnetsurf-abe3300ea16d46afa38411d5c2940bbb30607e57.tar.gz
netsurf-abe3300ea16d46afa38411d5c2940bbb30607e57.tar.bz2
New local history panel with scrollbars. Still needs to resize itself to fit the history.
svn path=/trunk/netsurf/; revision=11705
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/ArrowBox.h34
-rw-r--r--cocoa/ArrowBox.m144
-rw-r--r--cocoa/ArrowWindow.h32
-rw-r--r--cocoa/ArrowWindow.m220
-rw-r--r--cocoa/BlackScroller.h20
-rw-r--r--cocoa/BlackScroller.m141
-rw-r--r--cocoa/BrowserView.h5
-rw-r--r--cocoa/BrowserView.m8
-rw-r--r--cocoa/BrowserWindowController.h3
-rw-r--r--cocoa/BrowserWindowController.m1
-rw-r--r--cocoa/HistoryView.h4
-rw-r--r--cocoa/HistoryView.m56
-rw-r--r--cocoa/LocalHistoryController.h36
-rw-r--r--cocoa/LocalHistoryController.m54
-rw-r--r--cocoa/Makefile.target8
-rw-r--r--cocoa/NetSurf.xcodeproj/project.pbxproj18
-rw-r--r--cocoa/res/BrowserWindow.xib50
-rw-r--r--cocoa/res/LocalHistoryPanel.xib357
18 files changed, 1110 insertions, 81 deletions
diff --git a/cocoa/ArrowBox.h b/cocoa/ArrowBox.h
new file mode 100644
index 000000000..c49fcb6e7
--- /dev/null
+++ b/cocoa/ArrowBox.h
@@ -0,0 +1,34 @@
+/* Copyright (c) 1011 Sven Weidauer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+
+#import <Cocoa/Cocoa.h>
+
+typedef enum {
+ ArrowNone,
+ ArrowTopEdge,
+ ArrowBottomEdge,
+ ArrowLeftEdge,
+ ArrowRightEdge
+} ArrowEdge;
+
+
+@interface ArrowBox : NSView {
+ CGFloat arrowPosition;
+ CGFloat arrowSize;
+ ArrowEdge arrowEdge;
+ CGFloat cornerRadius;
+ BOOL updateShadow;
+}
+
+@property (readwrite, assign, nonatomic) CGFloat arrowPosition;
+@property (readwrite, assign, nonatomic) CGFloat arrowSize;
+@property (readwrite, assign, nonatomic) ArrowEdge arrowEdge;
+@property (readwrite, assign, nonatomic) CGFloat cornerRadius;
+
+@end
diff --git a/cocoa/ArrowBox.m b/cocoa/ArrowBox.m
new file mode 100644
index 000000000..9cf0acbc6
--- /dev/null
+++ b/cocoa/ArrowBox.m
@@ -0,0 +1,144 @@
+/* Copyright (c) 1011 Sven Weidauer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+
+#import "ArrowBox.h"
+
+
+@implementation ArrowBox
+
+@synthesize arrowPosition;
+@synthesize arrowSize;
+@synthesize arrowEdge;
+@synthesize cornerRadius;
+
+- (void) setArrowEdge: (ArrowEdge)newEdge;
+{
+ if (arrowEdge == newEdge) return;
+
+ arrowEdge = newEdge;
+
+ [self setNeedsDisplay: YES];
+ updateShadow = YES;
+}
+
+- (void) setArrowSize: (CGFloat)newSize;
+{
+ arrowSize = newSize;
+ [self setNeedsDisplay: YES];
+ updateShadow = YES;
+}
+
+- (void) setCornerRadius: (CGFloat)newRadius;
+{
+ cornerRadius = newRadius;
+ [self setNeedsDisplay: YES];
+ updateShadow = YES;
+}
+
+- (void) setArrowPosition: (CGFloat)newPosition;
+{
+ arrowPosition = newPosition;
+
+ [self setNeedsDisplay: YES];
+ updateShadow = YES;
+}
+
+- (id)initWithFrame:(NSRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ arrowPosition = 50;
+ cornerRadius = 10;
+ arrowSize = 15;
+ }
+ return self;
+}
+
+- (void)drawRect:(NSRect)dirtyRect
+{
+ [[NSColor clearColor] set];
+ [NSBezierPath fillRect: dirtyRect];
+
+ NSBezierPath *path = [NSBezierPath bezierPath];
+
+ NSRect bounds = [self convertRectToBase: NSInsetRect( [self bounds], 2, 2 )];
+ bounds.origin.x = floor( bounds.origin.x );
+ bounds.origin.y = floor( bounds.origin.y );
+ bounds.size.width = floor( bounds.size.width );
+ bounds.size.height = floor( bounds.size.height );
+ bounds = [self convertRectFromBase: bounds];
+
+ const CGFloat right = bounds.size.width - arrowSize;
+ const CGFloat top = bounds.size.height - arrowSize;
+ const CGFloat left = arrowSize;
+ const CGFloat bottom = arrowSize;
+
+ [path setLineJoinStyle:NSRoundLineJoinStyle];
+
+ [path moveToPoint: NSMakePoint( right - cornerRadius, top )];
+
+ if (arrowEdge == ArrowTopEdge) {
+ [path lineToPoint: NSMakePoint( arrowPosition + arrowSize, top )];
+ [path lineToPoint: NSMakePoint( arrowPosition, top + arrowSize )];
+ [path lineToPoint: NSMakePoint( arrowPosition - arrowSize, top )];
+ }
+
+ [path appendBezierPathWithArcFromPoint: NSMakePoint( left, top )
+ toPoint: NSMakePoint( left, top - cornerRadius )
+ radius: cornerRadius];
+
+ if (arrowEdge == ArrowLeftEdge) {
+ [path lineToPoint: NSMakePoint( left, bottom + arrowPosition + arrowSize )];
+ [path lineToPoint: NSMakePoint( left - arrowSize, bottom + arrowPosition )];
+ [path lineToPoint: NSMakePoint( left, bottom + arrowPosition - arrowSize )];
+ }
+
+ [path appendBezierPathWithArcFromPoint: NSMakePoint( left, bottom )
+ toPoint: NSMakePoint( left + cornerRadius, bottom )
+ radius: cornerRadius];
+
+ if (arrowEdge == ArrowBottomEdge) {
+ [path lineToPoint: NSMakePoint( arrowPosition - arrowSize, bottom )];
+ [path lineToPoint: NSMakePoint( arrowPosition, bottom - arrowSize )];
+ [path lineToPoint: NSMakePoint( arrowPosition + arrowSize, bottom )];
+ }
+
+ [path appendBezierPathWithArcFromPoint: NSMakePoint( right, bottom )
+ toPoint: NSMakePoint( right, bottom + cornerRadius )
+ radius: cornerRadius];
+
+ if (arrowEdge == ArrowRightEdge) {
+ [path lineToPoint: NSMakePoint( right, bottom + arrowPosition - arrowSize )];
+ [path lineToPoint: NSMakePoint( right + arrowSize, bottom + arrowPosition )];
+ [path lineToPoint: NSMakePoint( right, bottom + arrowPosition + arrowSize )];
+ }
+
+ [path appendBezierPathWithArcFromPoint: NSMakePoint( right, top )
+ toPoint: NSMakePoint( right - cornerRadius, top )
+ radius: cornerRadius];
+ [path closePath];
+
+ [[NSColor colorWithDeviceWhite: 1.0 alpha: 0.4] set];
+ [[NSColor colorWithDeviceWhite: 0.0 alpha: 0.75] setFill];
+
+ NSAffineTransform *transform = [NSAffineTransform transform];
+ [transform translateXBy: bounds.origin.x yBy: bounds.origin.y];
+ [transform concat];
+
+ [path setLineWidth: 2.0];
+ [path fill];
+ [path stroke];
+
+ if (updateShadow) {
+ [[self window] invalidateShadow];
+ [[self window] update];
+ updateShadow = NO;
+ }
+}
+
+@end
diff --git a/cocoa/ArrowWindow.h b/cocoa/ArrowWindow.h
new file mode 100644
index 000000000..79f422f3e
--- /dev/null
+++ b/cocoa/ArrowWindow.h
@@ -0,0 +1,32 @@
+/* Copyright (c) 1011 Sven Weidauer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+
+#import <Cocoa/Cocoa.h>
+
+#import "ArrowBox.h"
+
+@interface ArrowWindow : NSWindow {
+ ArrowBox *box;
+ NSView *content;
+ BOOL acceptsKey;
+ NSWindow *attachedWindow;
+}
+
+@property (readwrite, assign, nonatomic) BOOL acceptsKey;
+
+@property (readwrite, assign, nonatomic) CGFloat arrowPosition;
+@property (readwrite, assign, nonatomic) CGFloat arrowSize;
+@property (readwrite, assign, nonatomic) ArrowEdge arrowEdge;
+@property (readwrite, assign, nonatomic) CGFloat cornerRadius;
+
+- (void) moveToPoint: (NSPoint) screenPoint;
+- (void) attachToView: (NSView *) view;
+- (void) detach;
+
+@end
diff --git a/cocoa/ArrowWindow.m b/cocoa/ArrowWindow.m
new file mode 100644
index 000000000..339902782
--- /dev/null
+++ b/cocoa/ArrowWindow.m
@@ -0,0 +1,220 @@
+/* Copyright (c) 1011 Sven Weidauer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#import "ArrowWindow.h"
+#import "ArrowBox.h"
+
+@implementation ArrowWindow
+
+@synthesize acceptsKey;
+
+- (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag
+{
+ if ((self = [super initWithContentRect: contentRect styleMask: NSBorderlessWindowMask backing: bufferingType defer: flag]) == nil) return nil;
+
+ [self setBackgroundColor: [NSColor clearColor]];
+ [self setOpaque: NO];
+ [self setHasShadow: YES];
+
+ return self;
+}
+
+- (void) setContentView: (NSView *)aView;
+{
+ if (aView == content) return;
+
+ [content removeFromSuperview];
+ content = aView;
+
+ if (content == nil) return;
+
+ if (box == nil) {
+ box = [[ArrowBox alloc] initWithFrame: NSZeroRect];
+ [box setArrowEdge: ArrowTopEdge];
+ [super setContentView: box];
+ [box release];
+ }
+
+ [box addSubview: content];
+
+ NSRect frame = [self contentRectForFrameRect: [self frame]];
+ frame.origin = [self convertScreenToBase: frame.origin];
+ frame = [box convertRect: frame fromView: nil];
+
+ [content setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
+ [content setFrame: frame];
+}
+
+- (void) setContentSize: (NSSize)aSize;
+{
+ NSRect frame = [content frame];
+ frame.size = aSize;
+
+ frame = [box convertRect: frame toView: nil];
+ frame.origin = [self convertBaseToScreen: frame.origin];
+ frame = [self frameRectForContentRect: frame];
+
+ [self setFrame: frame display: YES];
+}
+
+static const CGFloat padding = 4;
+
+- (NSRect) contentRectForFrameRect: (NSRect)frameRect;
+{
+ const CGFloat arrowSize = [box arrowSize];
+ const CGFloat offset = 2 * ( 2 + padding + arrowSize );
+
+ return NSInsetRect( frameRect, offset, offset );
+}
+
+- (NSRect) frameRectForContentRect: (NSRect)contentRect;
+{
+ const CGFloat arrowSize = [box arrowSize];
+ const CGFloat offset = -2 * ( 2 + padding + arrowSize );
+
+ return NSInsetRect( contentRect, offset, offset );
+}
+
++ (NSRect) frameRectForContentRect: (NSRect)cRect styleMask: (NSUInteger)aStyle;
+{
+ const CGFloat DefaultArrowSize = 15;
+ const CGFloat offset = -2 * (2 + padding + DefaultArrowSize);
+
+ return NSInsetRect( cRect, offset, offset );
+}
+
+- (id) contentView;
+{
+ return content;
+}
+
+- (BOOL) canBecomeKeyWindow;
+{
+ return acceptsKey;
+}
+
+- (void) moveToPoint: (NSPoint) screenPoint;
+{
+ switch ([box arrowEdge]) {
+ case ArrowNone:
+ screenPoint.x -= [box arrowSize];
+ screenPoint.y += [box arrowSize];
+ break;
+
+ case ArrowTopEdge:
+ screenPoint.x -= [box arrowPosition];
+ break;
+
+ case ArrowBottomEdge:
+ screenPoint.x -= [box arrowPosition];
+ screenPoint.y += NSHeight( [self frame] );
+ break;
+
+ case ArrowLeftEdge:
+ screenPoint.y += NSHeight( [self frame] ) - [box arrowPosition] - [box arrowSize];
+ break;
+
+ case ArrowRightEdge:
+ screenPoint.x -= NSWidth( [self frame] );
+ screenPoint.y += NSHeight( [self frame] ) - [box arrowPosition] - [box arrowSize];
+ break;
+ }
+
+ [self setFrameTopLeftPoint: screenPoint];
+}
+
+static NSRect ScreenRectForView( NSView *view )
+{
+ NSRect viewRect = [view bounds]; // in View coordinate system
+ viewRect = [view convertRect: viewRect toView: nil]; // translate to window coordinates
+ viewRect.origin = [[view window] convertBaseToScreen: viewRect.origin]; // translate to screen coordinates
+ return viewRect;
+}
+
+- (void) attachToView: (NSView *) view;
+{
+ if (nil != attachedWindow) [self detach];
+
+ NSRect viewRect = ScreenRectForView( view );
+ NSPoint arrowPoint;
+ switch ([box arrowEdge]) {
+ case ArrowNone:
+ case ArrowTopEdge:
+ arrowPoint = NSMakePoint( NSMidX( viewRect ), NSMinY( viewRect ) );
+ break;
+
+ case ArrowLeftEdge:
+ arrowPoint = NSMakePoint( NSMaxX( viewRect ), NSMidY( viewRect ) );
+ break;
+
+ case ArrowBottomEdge:
+ arrowPoint = NSMakePoint( NSMidX( viewRect ), NSMaxY( viewRect ) );
+ break;
+
+ case ArrowRightEdge:
+ arrowPoint = NSMakePoint( NSMinX( viewRect ), NSMidY( viewRect ) );
+ break;
+ }
+ attachedWindow = [view window];
+ [self moveToPoint: arrowPoint];
+ [attachedWindow addChildWindow: self ordered: NSWindowAbove];
+}
+
+- (void) detach;
+{
+ [attachedWindow removeChildWindow: self];
+ [self close];
+ attachedWindow = nil;
+}
+
+//MARK: -
+//MARK: Properties
+
+- (void) setArrowPosition: (CGFloat) newPosition;
+{
+ [box setArrowPosition: newPosition];
+}
+
+- (CGFloat) arrowPosition;
+{
+ return [box arrowPosition];
+}
+
+- (void) setArrowSize: (CGFloat)newSize;
+{
+ NSRect contentRect = [self contentRectForFrameRect: [self frame]];
+ [box setArrowSize: newSize];
+ [self setFrame: [self frameRectForContentRect: contentRect] display: [self isVisible]];
+}
+
+- (CGFloat) arrowSize;
+{
+ return [box arrowSize];
+}
+
+- (void) setArrowEdge: (ArrowEdge) newEdge;
+{
+ [box setArrowEdge: newEdge];
+}
+
+- (ArrowEdge) arrowEdge;
+{
+ return [box arrowEdge];
+}
+
+- (void) setCornerRadius: (CGFloat)newRadius;
+{
+ [box setCornerRadius: newRadius];
+}
+
+- (CGFloat) cornerRadius;
+{
+ return [box cornerRadius];
+}
+
+@end
diff --git a/cocoa/BlackScroller.h b/cocoa/BlackScroller.h
new file mode 100644
index 000000000..34110b035
--- /dev/null
+++ b/cocoa/BlackScroller.h
@@ -0,0 +1,20 @@
+/* Copyright (c) 1011 Sven Weidauer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface BlackScroller : NSScroller {
+ BOOL drawTrack;
+ NSTrackingRectTag tag;
+}
+
+@property (readonly, getter=isHorizontal) BOOL horizontal;
+
+@end
diff --git a/cocoa/BlackScroller.m b/cocoa/BlackScroller.m
new file mode 100644
index 000000000..3e711376c
--- /dev/null
+++ b/cocoa/BlackScroller.m
@@ -0,0 +1,141 @@
+/* Copyright (c) 1011 Sven Weidauer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+
+#import "BlackScroller.h"
+
+
+@implementation BlackScroller
+
+- (void) setFrame: (NSRect)frameRect;
+{
+ [super setFrame: frameRect];
+ if (tag != 0) [self removeTrackingRect: tag];
+ tag = [self addTrackingRect: [self bounds] owner: self userData: NULL assumeInside: NO];
+}
+
+- (void) drawRect: (NSRect)dirtyRect;
+{
+ [[NSColor clearColor] set];
+ [NSBezierPath fillRect: dirtyRect];
+
+ if (drawTrack) [self drawKnobSlotInRect: [self rectForPart: NSScrollerKnobSlot]
+ highlight: NO];
+ [self drawKnob];
+}
+
+- (void) drawKnobSlotInRect: (NSRect)slotRect highlight: (BOOL)flag;
+{
+ slotRect = NSInsetRect( slotRect, 2, 2 );
+ slotRect = [self convertRectToBase: slotRect];
+ slotRect.origin.x = floor( slotRect.origin.x ) + 0.5;
+ slotRect.origin.y = floor( slotRect.origin.y ) + 0.5;
+ slotRect.size.width = floor( slotRect.size.width );
+ slotRect.size.height = floor( slotRect.size.height );
+ slotRect = [self convertRectFromBase: slotRect];
+
+ NSGradient *gradient = [[[NSGradient alloc] initWithColorsAndLocations:
+ [NSColor clearColor], 0.0,
+ [NSColor clearColor], 0.4,
+ [NSColor whiteColor], 1.0,
+ nil] autorelease];
+ [[NSColor whiteColor] set];
+ const float radius = 0.5 * ([self isHorizontal] ? NSHeight( slotRect ) : NSWidth( slotRect ));
+ NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect: slotRect
+ xRadius: radius
+ yRadius: radius];
+ [gradient drawInBezierPath: path angle: [self isHorizontal] ? 90 : 0];
+
+ [path stroke];
+}
+
+
+- (NSUsableScrollerParts) usableParts;
+{
+ return NSScrollerKnob|NSScrollerKnobSlot;
+}
+
+- (void) drawKnob;
+{
+ NSRect rect = NSInsetRect( [self rectForPart: NSScrollerKnob], 2, 2 );
+
+ rect = [self convertRectToBase: rect];
+ rect.origin.x = floor( rect.origin.x ) + 0.5;
+ rect.origin.y = floor( rect.origin.y ) + 0.5;
+ rect.size.width = floor( rect.size.width );
+ rect.size.height = floor( rect.size.height );
+ rect = [self convertRectFromBase: rect];
+
+ [[NSColor colorWithDeviceWhite: 1.0 alpha: drawTrack ? 1.0 : 0.6] set];
+
+ const float radius = 0.5 * ([self isHorizontal] ? NSHeight( rect ) : NSWidth( rect ));
+ NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect: rect
+ xRadius: radius
+ yRadius: radius];
+ [path fill];
+ [path stroke];
+}
+
+- (NSRect) rectForPart: (NSScrollerPart)partCode;
+{
+ const bool horizontal = [self isHorizontal];
+
+ NSRect rect = horizontal ? NSInsetRect( [self bounds], 4, 0 ) : NSInsetRect( [self bounds], 0, 4 );
+
+ switch (partCode) {
+ case NSScrollerKnobSlot:
+ return rect;
+
+ case NSScrollerKnob: {
+ const CGFloat len = horizontal ? NSWidth( rect ) : NSHeight( rect );
+ CGFloat knobLen = [self knobProportion] * len;
+ const CGFloat minKnobLen = horizontal ? NSHeight( rect ) : NSWidth( rect );
+ if (knobLen < minKnobLen) knobLen = minKnobLen;
+
+ const CGFloat start = [self doubleValue] * (len - knobLen);
+
+ if (horizontal) {
+ rect.origin.x += start;
+ rect.size.width = knobLen;
+ } else {
+ rect.origin.y += start;
+ rect.size.height = knobLen;
+ }
+
+ return rect;
+ }
+
+ default:
+ return [super rectForPart: partCode];
+ }
+}
+
+- (BOOL) isOpaque;
+{
+ return NO;
+}
+
+- (BOOL) isHorizontal;
+{
+ NSRect bounds = [self bounds];
+ return NSWidth( bounds ) > NSHeight( bounds );
+}
+
+- (void) mouseEntered: (NSEvent *)theEvent;
+{
+ drawTrack = YES;
+ [self setNeedsDisplay: YES];
+}
+
+- (void) mouseExited: (NSEvent *)theEvent;
+{
+ drawTrack = NO;
+ [self setNeedsDisplay: YES];
+}
+
+@end
diff --git a/cocoa/BrowserView.h b/cocoa/BrowserView.h
index 604027569..ceccab47c 100644
--- a/cocoa/BrowserView.h
+++ b/cocoa/BrowserView.h
@@ -19,7 +19,8 @@
#import <Cocoa/Cocoa.h>
#import "cocoa/ScrollableView.h"
-@class HistoryView;
+
+@class LocalHistoryController;
@interface BrowserView : ScrollableView {
struct browser_window *browser;
@@ -33,8 +34,8 @@
BOOL isDragging;
NSPoint dragStart;
- HistoryView *history;
BOOL historyVisible;
+ LocalHistoryController *history;
}
@property (readwrite, assign, nonatomic) struct browser_window *browser;
diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m
index d968ed136..e70f19619 100644
--- a/cocoa/BrowserView.m
+++ b/cocoa/BrowserView.m
@@ -20,6 +20,8 @@
#import "cocoa/HistoryView.h"
#import "cocoa/font.h"
#import "cocoa/plotter.h"
+#import "cocoa/LocalHistoryController.h"
+#import "cocoa/BrowserWindowController.h"
#import "desktop/browser.h"
#import "desktop/history_core.h"
@@ -412,10 +414,10 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt )
historyVisible = newVisible;
if (historyVisible) {
- if (nil == history) history = [[HistoryView alloc] initWithBrowser: browser];
- [history fadeIntoView: self];
+ if (nil == history) history = [[LocalHistoryController alloc] initWithBrowser: browser];
+ [history attachToView: [(BrowserWindowController *)[[self window] windowController] historyButton]];
} else {
- [history fadeOut];
+ [history detach];
}
}
diff --git a/cocoa/BrowserWindowController.h b/cocoa/BrowserWindowController.h
index e10cd5a4c..17fc0bcd7 100644
--- a/cocoa/BrowserWindowController.h
+++ b/cocoa/BrowserWindowController.h
@@ -28,7 +28,7 @@
URLFieldCell *urlField;
NSObjectController *activeBrowserController;
NSSegmentedControl *navigationControl;
-
+ NSButton *historyButton;
BrowserViewController *activeBrowser;
}
@@ -37,6 +37,7 @@
@property (readwrite, retain, nonatomic) IBOutlet URLFieldCell *urlField;
@property (readwrite, retain, nonatomic) IBOutlet NSObjectController *activeBrowserController;
@property (readwrite, retain, nonatomic) IBOutlet NSSegmentedControl *navigationControl;
+@property (readwrite, assign, nonatomic) IBOutlet NSButton *historyButton;
@property (readwrite, assign, nonatomic) BrowserViewController *activeBrowser;
diff --git a/cocoa/BrowserWindowController.m b/cocoa/BrowserWindowController.m
index ebe4c370d..2701fecec 100644
--- a/cocoa/BrowserWindowController.m
+++ b/cocoa/BrowserWindowController.m
@@ -41,6 +41,7 @@
@synthesize tabView;
@synthesize urlField;
@synthesize navigationControl;
+@synthesize historyButton;
@synthesize activeBrowser;
@synthesize activeBrowserController;
diff --git a/cocoa/HistoryView.h b/cocoa/HistoryView.h
index 7b5ef80b9..33eb1b52d 100644
--- a/cocoa/HistoryView.h
+++ b/cocoa/HistoryView.h
@@ -26,10 +26,6 @@
@property (readwrite, assign, nonatomic) struct browser_window *browser;
-- (id) initWithBrowser: (struct browser_window *)bw;
- (void) updateHistory;
-- (void) fadeIntoView: (NSView *) superView;
-- (void) fadeOut;
-
@end
diff --git a/cocoa/HistoryView.m b/cocoa/HistoryView.m
index 3315d252d..d18f1eb50 100644
--- a/cocoa/HistoryView.m
+++ b/cocoa/HistoryView.m
@@ -29,76 +29,27 @@ static NSRect cocoa_history_rect( struct browser_window *bw )
{
int width, height;
history_size( bw->history, &width, &height );
- return cocoa_rect( 0, 0, width + 10, height + 10 );
+ return cocoa_rect( 0, 0, width, height );
}
@implementation HistoryView
@synthesize browser;
-- (id)initWithBrowser: (struct browser_window *)bw;
+- (void) setBrowser: (struct browser_window *) bw;
{
- NSParameterAssert( NULL != bw );
- if ((self = [super initWithFrame: cocoa_history_rect( bw )]) == nil) return nil;
-
browser = bw;
-
- return self;
+ [self updateHistory];
}
- (void) updateHistory;
{
[self setFrameSize: cocoa_history_rect( browser ).size];
-
- NSView *superView = [self superview];
- if (nil != superView) {
- NSRect visibleRect = [superView visibleRect];
- NSRect rect = [self frame];
- NSRect frame = [superView frame];
-
- rect.origin.x = visibleRect.origin.x + (NSWidth( visibleRect ) - NSWidth( rect )) / 2.0;
- rect.origin.x = MAX( rect.origin.x, frame.origin.x );
-
- rect.origin.y = visibleRect.origin.y + (NSHeight( visibleRect ) - NSHeight( rect )) / 2.0;
- rect.origin.y = MAX( rect.origin.y, frame.origin.y );
-
- [self setFrameOrigin: rect.origin];
- }
-
[self setNeedsDisplay: YES];
}
-- (void) fadeIntoView: (NSView *) superView;
-{
- [self setAlphaValue: 0];
- [superView addSubview: self];
- [[self animator] setAlphaValue: 1.0];
-}
-
-- (void) fadeOut;
-{
- [[self animator] setAlphaValue: 0.0];
- [self performSelector: @selector(removeFromSuperview) withObject: nil
- afterDelay: [[NSAnimationContext currentContext] duration]];
-}
-
-- (void) viewDidMoveToSuperview;
-{
- [self updateHistory];
-}
-
- (void) drawRect: (NSRect)rect;
{
- NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect: NSInsetRect( [self bounds], 5, 5 )
- xRadius: 10 yRadius: 10];
-
- [[NSColor colorWithDeviceWhite: 0 alpha: 0.8] setFill];
- [path fill];
-
- [path setLineWidth: 2.0];
- [[NSColor whiteColor] set];
- [path stroke];
-
cocoa_set_font_scale_factor( 1.0 );
cocoa_set_clip( rect );
@@ -119,5 +70,4 @@ static NSRect cocoa_history_rect( struct browser_window *bw )
return YES;
}
-
@end
diff --git a/cocoa/LocalHistoryController.h b/cocoa/LocalHistoryController.h
new file mode 100644
index 000000000..d84ab8317
--- /dev/null
+++ b/cocoa/LocalHistoryController.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011 Sven Weidauer <sven.weidauer@gmail.com>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf 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; version 2 of the License.
+ *
+ * NetSurf 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+@class HistoryView;
+
+@interface LocalHistoryController : NSWindowController {
+ HistoryView *history;
+ struct browser_window *browser;
+}
+
+@property (readwrite, assign, nonatomic) struct browser_window *browser;
+@property (readwrite, assign, nonatomic) IBOutlet HistoryView *history;
+
+- initWithBrowser: (struct browser_window *) bw;
+
+- (void) attachToView: (NSView *) view;
+- (void) detach;
+
+@end
diff --git a/cocoa/LocalHistoryController.m b/cocoa/LocalHistoryController.m
new file mode 100644
index 000000000..79f842b11
--- /dev/null
+++ b/cocoa/LocalHistoryController.m
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2011 Sven Weidauer <sven.weidauer@gmail.com>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf 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; version 2 of the License.
+ *
+ * NetSurf 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#import "cocoa/LocalHistoryController.h"
+
+#import "cocoa/HistoryView.h"
+#import "cocoa/ArrowWindow.h"
+
+@implementation LocalHistoryController
+
+@synthesize browser;
+@synthesize history;
+
+- initWithBrowser: (struct browser_window *) bw;
+{
+ if ((self = [super initWithWindowNibName: @"LocalHistoryPanel"]) == nil) return nil;
+
+ browser = bw;
+
+ return self;
+}
+
+- (void) attachToView: (NSView *) view;
+{
+ [history updateHistory];
+ [(ArrowWindow *)[self window] attachToView: view];
+}
+
+- (void) detach;
+{
+ [(ArrowWindow *)[self window] detach];
+}
+
+- (void) windowDidLoad;
+{
+ [history setBrowser: browser];
+}
+
+@end
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index 631d1385d..5a43c64a1 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -92,7 +92,11 @@ S_COCOA := \
url.m \
utf8.m \
utils.m \
- system_colour.m
+ system_colour.m \
+ ArrowBox.m \
+ ArrowWindow.m \
+ BlackScroller.m \
+ LocalHistoryController.m
S_TABBAR := \
NSBezierPath_AMShading.m \
@@ -119,7 +123,7 @@ SOURCES := $(addprefix $(shell pwd)/,$(SOURCES))
EXETARGET := NetSurf
S_XIBS := MainMenu.xib Browser.xib BrowserWindow.xib DownloadWindow.xib SearchWindow.xib PreferencesWindow.xib \
- HistoryWindow.xib BookmarksWindow.xib
+ HistoryWindow.xib BookmarksWindow.xib LocalHistoryPanel.xib
R_RESOURCES := default.css adblock.css quirks.css NetSurf.icns HomeTemplate.pdf
R_RESOURCES := $(addprefix cocoa/res/,$(R_RESOURCES))
diff --git a/cocoa/NetSurf.xcodeproj/project.pbxproj b/cocoa/NetSurf.xcodeproj/project.pbxproj
index ce4726c42..efa16c578 100644
--- a/cocoa/NetSurf.xcodeproj/project.pbxproj
+++ b/cocoa/NetSurf.xcodeproj/project.pbxproj
@@ -246,6 +246,15 @@
26AFEAEA12E04253005AD082 /* DownloadWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DownloadWindowController.m; sourceTree = "<group>"; };
26AFEAF012E042F9005AD082 /* DownloadWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DownloadWindow.xib; sourceTree = "<group>"; };
26AFED0312E09916005AD082 /* selection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = selection.m; sourceTree = "<group>"; };
+ 26B4E91A130D351F0003B527 /* ArrowBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowBox.h; sourceTree = "<group>"; };
+ 26B4E91B130D351F0003B527 /* ArrowBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrowBox.m; sourceTree = "<group>"; };
+ 26B4E91C130D351F0003B527 /* ArrowWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowWindow.h; sourceTree = "<group>"; };
+ 26B4E91D130D351F0003B527 /* ArrowWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrowWindow.m; sourceTree = "<group>"; };
+ 26B4E91E130D351F0003B527 /* BlackScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlackScroller.h; sourceTree = "<group>"; };
+ 26B4E91F130D351F0003B527 /* BlackScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlackScroller.m; sourceTree = "<group>"; };
+ 26B4E926130D36A90003B527 /* LocalHistoryPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LocalHistoryPanel.xib; sourceTree = "<group>"; };
+ 26B4E928130D37E50003B527 /* LocalHistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalHistoryController.h; sourceTree = "<group>"; };
+ 26B4E929130D37E50003B527 /* LocalHistoryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocalHistoryController.m; sourceTree = "<group>"; };
26CDCEB312E702D8004FC66B /* NSBezierPath_AMShading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSBezierPath_AMShading.h; sourceTree = "<group>"; };
26CDCEB412E702D8004FC66B /* NSBezierPath_AMShading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSBezierPath_AMShading.m; sourceTree = "<group>"; };
26CDCEB512E702D8004FC66B /* NSString_AITruncation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_AITruncation.h; sourceTree = "<group>"; };
@@ -587,6 +596,7 @@
2625095012F72A8F0090D236 /* PreferencesWindow.xib */,
26376A4112F7FA67000F45FE /* HistoryWindow.xib */,
26376BAC12F820D7000F45FE /* BookmarksWindow.xib */,
+ 26B4E926130D36A90003B527 /* LocalHistoryPanel.xib */,
);
name = Resources;
path = res;
@@ -701,6 +711,8 @@
2666DC5E12F6D2E70045E8B6 /* SearchWindowController.m */,
2666DD5012F706BC0045E8B6 /* BrowserWindow.h */,
2666DD5112F706BC0045E8B6 /* BrowserWindow.m */,
+ 26B4E928130D37E50003B527 /* LocalHistoryController.h */,
+ 26B4E929130D37E50003B527 /* LocalHistoryController.m */,
);
name = Browser;
sourceTree = "<group>";
@@ -708,6 +720,12 @@
26CDD26612E7441E004FC66B /* Views */ = {
isa = PBXGroup;
children = (
+ 26B4E91A130D351F0003B527 /* ArrowBox.h */,
+ 26B4E91B130D351F0003B527 /* ArrowBox.m */,
+ 26B4E91C130D351F0003B527 /* ArrowWindow.h */,
+ 26B4E91D130D351F0003B527 /* ArrowWindow.m */,
+ 26B4E91E130D351F0003B527 /* BlackScroller.h */,
+ 26B4E91F130D351F0003B527 /* BlackScroller.m */,
26AFE8E212DF4200005AD082 /* ScrollableView.h */,
26AFE8E312DF4200005AD082 /* ScrollableView.m */,
26EC3B6812ED62C0000A960C /* URLFieldCell.h */,
diff --git a/cocoa/res/BrowserWindow.xib b/cocoa/res/BrowserWindow.xib
index 868c1f632..377eadc02 100644
--- a/cocoa/res/BrowserWindow.xib
+++ b/cocoa/res/BrowserWindow.xib
@@ -79,11 +79,9 @@
<string key="NSToolbarItemPaletteLabel">History</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="229385913">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{8, 14}, {30, 25}}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="296571644">
<int key="NSCellFlags">67239424</int>
@@ -126,11 +124,9 @@
<string key="NSToolbarItemPaletteLabel">Homepage</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="518219892">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 14}, {30, 25}}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="413663381">
<int key="NSCellFlags">-2080244224</int>
@@ -169,11 +165,9 @@
<string key="NSToolbarItemPaletteLabel">Back/Forward</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSegmentedControl" key="NSToolbarItemView" id="692457026">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{7, 14}, {67, 25}}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="845979064">
<int key="NSCellFlags">67239424</int>
@@ -232,11 +226,9 @@
<string key="NSToolbarItemPaletteLabel">URL</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSTextField" key="NSToolbarItemView" id="77748234">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{0, 14}, {96, 22}}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1053649244">
<int key="NSCellFlags">-1804468671</int>
@@ -714,6 +706,14 @@
</object>
<int key="connectionID">86</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">historyButton</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="229385913"/>
+ </object>
+ <int key="connectionID">87</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -976,9 +976,9 @@
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>{{347, 86}, {774, 554}}</string>
+ <string>{{276, 86}, {774, 554}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{347, 86}, {774, 554}}</string>
+ <string>{{276, 86}, {774, 554}}</string>
<integer value="1"/>
<string>{196, 240}</string>
<string>{{202, 428}, {480, 270}}</string>
@@ -1002,7 +1002,7 @@
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDiwAAxAVAAA</bytes>
</object>
- <string>{{426, 640}, {616, 0}}</string>
+ <string>{{355, 640}, {616, 0}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1053,7 +1053,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">86</int>
+ <int key="maxID">87</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1061,6 +1061,17 @@
<object class="IBPartialClassDescription">
<string key="className">BrowserView</string>
<string key="superclassName">ScrollableView</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">historyButton</string>
+ <string key="NS.object.0">NSButton</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">historyButton</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">historyButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">BrowserView.h</string>
@@ -1221,6 +1232,7 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>activeBrowserController</string>
+ <string>historyButton</string>
<string>navigationControl</string>
<string>tabBar</string>
<string>tabView</string>
@@ -1229,6 +1241,7 @@
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSObjectController</string>
+ <string>NSButton</string>
<string>NSSegmentedControl</string>
<string>PSMTabBarControl</string>
<string>NSTabView</string>
@@ -1240,6 +1253,7 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>activeBrowserController</string>
+ <string>historyButton</string>
<string>navigationControl</string>
<string>tabBar</string>
<string>tabView</string>
@@ -1252,6 +1266,10 @@
<string key="candidateClassName">NSObjectController</string>
</object>
<object class="IBToOneOutletInfo">
+ <string key="name">historyButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
<string key="name">navigationControl</string>
<string key="candidateClassName">NSSegmentedControl</string>
</object>
diff --git a/cocoa/res/LocalHistoryPanel.xib b/cocoa/res/LocalHistoryPanel.xib
new file mode 100644
index 000000000..7832901f1
--- /dev/null
+++ b/cocoa/res/LocalHistoryPanel.xib
@@ -0,0 +1,357 @@
+<?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">10J567</string>
+ <string key="IBDocument.InterfaceBuilderVersion">804</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">462.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">804</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <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">LocalHistoryController</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">1618477056</int>
+ <string key="NSWindowTitle">Window</string>
+ <string key="NSWindowClass">ArrowWindow</string>
+ <nil key="NSViewClass"/>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</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="NSScrollView" id="488267087">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="753770525">
+ <reference key="NSNextResponder" ref="488267087"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomView" id="820702167">
+ <reference key="NSNextResponder" ref="753770525"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{480, 270}</string>
+ <reference key="NSSuperview" ref="753770525"/>
+ <string key="NSClassName">HistoryView</string>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 1}, {480, 270}}</string>
+ <reference key="NSSuperview" ref="488267087"/>
+ <reference key="NSNextKeyView" ref="820702167"/>
+ <reference key="NSDocView" ref="820702167"/>
+ <object class="NSColor" key="NSBGColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <int key="NScvFlags">2</int>
+ </object>
+ <object class="NSScroller" id="84195230">
+ <reference key="NSNextResponder" ref="488267087"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{470, 1}, {11, 255}}</string>
+ <reference key="NSSuperview" ref="488267087"/>
+ <int key="NSsFlags">256</int>
+ <int key="NSArrowsLoc">2</int>
+ <reference key="NSTarget" ref="488267087"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1</double>
+ <double key="NSPercent">0.96363627910614014</double>
+ </object>
+ <object class="NSScroller" id="645365106">
+ <reference key="NSNextResponder" ref="488267087"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{1, 260}, {465, 11}}</string>
+ <reference key="NSSuperview" ref="488267087"/>
+ <int key="NSsFlags">257</int>
+ <int key="NSArrowsLoc">2</int>
+ <reference key="NSTarget" ref="488267087"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">0.50602412223815918</double>
+ </object>
+ </object>
+ <string key="NSFrame">{{-1, -1}, {482, 272}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <reference key="NSNextKeyView" ref="753770525"/>
+ <int key="NSsFlags">562</int>
+ <reference key="NSVScroller" ref="84195230"/>
+ <reference key="NSHScroller" ref="645365106"/>
+ <reference key="NSContentView" ref="753770525"/>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 270}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</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">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">history</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="820702167"/>
+ </object>
+ <int key="connectionID">8</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="488267087"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="488267087"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="84195230"/>
+ <reference ref="645365106"/>
+ <reference ref="820702167"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="84195230"/>
+ <reference key="parent" ref="488267087"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="645365106"/>
+ <reference key="parent" ref="488267087"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="820702167"/>
+ <reference key="parent" ref="488267087"/>
+ </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.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>
+ <string>3.IBViewBoundsToFrameTransform</string>
+ <string>4.CustomClassName</string>
+ <string>4.IBPluginDependency</string>
+ <string>5.CustomClassName</string>
+ <string>5.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{489, 207}, {480, 270}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{489, 207}, {480, 270}}</string>
+ <boolean value="NO"/>
+ <string>{196, 240}</string>
+ <string>{{202, 428}, {480, 270}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAAC/gAAAw4aAAA</bytes>
+ </object>
+ <string>BlackScroller</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>BlackScroller</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</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">8</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ArrowWindow</string>
+ <string key="superclassName">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">ArrowWindow.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BlackScroller</string>
+ <string key="superclassName">NSScroller</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">BlackScroller.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">HistoryView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">HistoryView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">LocalHistoryController</string>
+ <string key="superclassName">NSWindowController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">history</string>
+ <string key="NS.object.0">HistoryView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">history</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">history</string>
+ <string key="candidateClassName">HistoryView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">LocalHistoryController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">PSMTabBarControl/PSMTabDragAssistant.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">PSMTabBarControl/PSMTabBarCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">PSMTabBarControl/PSMTabBarControl.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>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../NetSurf.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>