[webkit-changes] cvs commit: WebKit/WebView.subproj WebPDFView.h WebPDFView.m

John sullivan at opensource.apple.com
Tue Jun 14 11:06:00 PDT 2005


sullivan    05/06/14 11:06:00

  Modified:    .        ChangeLog
               WebView.subproj WebPDFView.h WebPDFView.m
  Log:
          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
  
  Revision  Changes    Path
  1.3195    +17 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3194
  retrieving revision 1.3195
  diff -u -r1.3194 -r1.3195
  --- ChangeLog	14 Jun 2005 17:36:30 -0000	1.3194
  +++ ChangeLog	14 Jun 2005 18:05:58 -0000	1.3195
  @@ -1,5 +1,22 @@
   2005-06-14  John Sullivan  <sullivan at 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 at apple.com>
  +
           Reviewed by Dave Harrison.
   
           * WebView.subproj/WebHTMLView.m:
  
  
  
  1.7       +3 -1      WebKit/WebView.subproj/WebPDFView.h
  
  Index: WebPDFView.h
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebPDFView.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WebPDFView.h	5 Jun 2005 17:54:48 -0000	1.6
  +++ WebPDFView.h	14 Jun 2005 18:06:00 -0000	1.7
  @@ -31,7 +31,9 @@
   @class PDFView;
   @class WebDataSource;
   
  - at interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching>
  + at protocol _web_WebDocumentTextSizing;
  +
  + at interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching, _web_WebDocumentTextSizing>
   {
       PDFView *PDFSubview;
       WebDataSource *dataSource;
  
  
  
  1.13      +20 -0     WebKit/WebView.subproj/WebPDFView.m
  
  Index: WebPDFView.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebPDFView.m,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WebPDFView.m	5 Jun 2005 17:54:48 -0000	1.12
  +++ WebPDFView.m	14 Jun 2005 18:06:00 -0000	1.13
  @@ -30,9 +30,12 @@
   
   #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>
   
  @@ -188,10 +191,22 @@
       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
  @@ -231,6 +246,11 @@
       }
   }
   
  +- (void)_web_textSizeMultiplierChanged
  +{
  +    [self _updateScalingToReflectTextSize];
  +}
  +
   - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
   {
       int options = 0;
  
  
  



More information about the webkit-changes mailing list