2005-06-14 John Sullivan <sullivan@apple.com>
+ Changes by Devin Lane.
+ Reviewed by me.
+
+ - fixed <rdar://problem/3766909> PDF viewing could use a zoom control other than the one in the context menu
+
+ * WebView.subproj/WebPDFView.h:
+ now implements protocol _web_WebDocumentTextSizing
+ * WebView.subproj/WebPDFView.m:
+ (-[WebPDFView _updateScalingToReflectTextSize]):
+ new method, sets the PDF scaling from the text size multiplier
+ (-[WebPDFView setDataSource:]):
+ call _updateScalingToReflectTextSize
+ (-[WebPDFView _web_textSizeMultiplierChanged]):
+ implementation of protocol _web_WebDocumentTextSizing, calls _updateScalingToReflectTextSize
+
+2005-06-14 John Sullivan <sullivan@apple.com>
+
Reviewed by Dave Harrison.
* WebView.subproj/WebHTMLView.m:
@class PDFView;
@class WebDataSource;
-@interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching>
+@protocol _web_WebDocumentTextSizing;
+
+@interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching, _web_WebDocumentTextSizing>
{
PDFView *PDFSubview;
WebDataSource *dataSource;
#import <WebKit/WebAssertions.h>
#import <WebKit/WebDataSource.h>
+#import <WebKit/WebDocumentInternal.h>
+#import <WebKit/WebFrame.h>
#import <WebKit/WebLocalizableStrings.h>
#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebPDFView.h>
+#import <WebKit/WebView.h>
#import <Quartz/Quartz.h>
return menu;
}
+- (void)_updateScalingToReflectTextSize
+{
+ WebView *view = [[dataSource webFrame] webView];
+
+ // The scale factor and text size multiplier conveniently use the same units, so we can just
+ // treat the values as interchangeable.
+ if (view != nil) {
+ [PDFSubview setScaleFactor:[view textSizeMultiplier]];
+ }
+}
+
- (void)setDataSource:(WebDataSource *)ds
{
dataSource = ds;
[self setFrame:[[self superview] frame]];
+ [self _updateScalingToReflectTextSize];
}
- (void)dataSourceUpdated:(WebDataSource *)dataSource
}
}
+- (void)_web_textSizeMultiplierChanged
+{
+ [self _updateScalingToReflectTextSize];
+}
+
- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
{
int options = 0;