[Webkit-changes] cvs commit: WebKit/Carbon.subproj CarbonWindowAdapter.m

Darin darin at opensource.apple.com
Sun Jun 5 20:25:06 PDT 2005


darin       05/06/05 20:25:06

  Modified:    .        ChangeLog
               Carbon.subproj CarbonWindowAdapter.m
  Log:
          Reviewed by Hyatt.
  
  	- remove more SPI usage
  
          * Carbon.subproj/CarbonWindowAdapter.m: Remove a bunch of stuff.
          (+[CarbonWindowAdapter frameViewClassForStyleMask:]):
          (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]):
          (-[CarbonWindowAdapter reconcileToCarbonWindowBounds]):
          (-[CarbonWindowAdapter _oldPlaceWindow:]):
          (-[CarbonWindowAdapter _termWindowIfOwner]):
          (-[CarbonWindowAdapter _windowMovedToRect:]):
          (-[CarbonWindowAdapter makeKeyWindow]):
  
  Revision  Changes    Path
  1.3170    +15 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3169
  retrieving revision 1.3170
  diff -u -r1.3169 -r1.3170
  --- ChangeLog	6 Jun 2005 02:39:19 -0000	1.3169
  +++ ChangeLog	6 Jun 2005 03:25:03 -0000	1.3170
  @@ -1,3 +1,18 @@
  +2005-06-05  Darin Adler  <darin at apple.com>
  +
  +        Reviewed by Hyatt.
  +
  +	- remove more SPI usage
  +
  +        * Carbon.subproj/CarbonWindowAdapter.m: Remove a bunch of stuff.
  +        (+[CarbonWindowAdapter frameViewClassForStyleMask:]):
  +        (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]):
  +        (-[CarbonWindowAdapter reconcileToCarbonWindowBounds]):
  +        (-[CarbonWindowAdapter _oldPlaceWindow:]):
  +        (-[CarbonWindowAdapter _termWindowIfOwner]):
  +        (-[CarbonWindowAdapter _windowMovedToRect:]):
  +        (-[CarbonWindowAdapter makeKeyWindow]):
  +
   2005-06-05  Maciej Stachowiak  <mjs at apple.com>
   
           - remove another forgotten include
  
  
  
  1.15      +13 -71    WebKit/Carbon.subproj/CarbonWindowAdapter.m
  
  Index: CarbonWindowAdapter.m
  ===================================================================
  RCS file: /cvs/root/WebKit/Carbon.subproj/CarbonWindowAdapter.m,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- CarbonWindowAdapter.m	5 Jun 2005 17:54:21 -0000	1.14
  +++ CarbonWindowAdapter.m	6 Jun 2005 03:25:06 -0000	1.15
  @@ -26,33 +26,13 @@
    * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
   
  -//
  -//  CarbonWindowAdapter.m
  -//  Synergy
  -//
  -//  Created by Ed Voas on Fri Jan 17 2003.
  -//  Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  -//
  -
  -/*
  -	NSCarbonWindow.m
  -	Application Kit
  -	Copyright (c) 2000-2002, Apple Computer, Inc.
  -	All rights reserved.
  -	Original Author: Mark Piccirelli
  -	Responsibility: Mark Piccirelli
  -
  -The subclass of NSWindow that encapsulates a Carbon window, in such a manner that the encapsulated Carbon window can at least be shown as a app-modal dialog or document-modal sheet by the AppKit sheet-showing machinery.
  -*/
  -
  +// I don't think this class belongs in WebKit. Lets move it out.
   
   // Things that I've never bothered working out:
   // For non-sheet windows, handle Carbon WindowMove events so as to do the same things as -[NSWindow _windowMoved].
   // Check to see how this stuff deals with various screen size change scenarious.
   // M.P. Warning - 9/17/01
   
  -// Create an NSWindow(Private) to declare the private NSWindow methods we call from here, to do away with compiler warnings.  2776110.  M.P. To Do - 9/17/00
  -
   // There are some invariants I'm maintaining for objects of this class which have been successfully initialized but not deallocated.  These all make it easier to not override every single method of NSWindow.
   // _auxiliaryStorage->auxWFlags.hasShadow will always be false if the Carbon window has a kWindowNoShadowAttribute, and vice versa.
   // _auxiliaryStorage->_auxWFlags.minimized will always reflect the window's Carbon collapsed state.
  @@ -75,44 +55,23 @@
   
   // Some things would have to be made public if someone wanted to subclass this so as to support more menu item commands.  M.P. Warning - 9/19/00
   
  -
   #import "CarbonWindowAdapter.h"
  +
   #import "CarbonWindowFrame.h"
   #import "CarbonWindowContentView.h"
   #import "HIViewAdapter.h"
   
  +#import <WebKitSystemInterface.h>
  +
   #import <AppKit/AppKit.h>
  -#import <AppKit/NSWindow_Private.h>
  -#import <CoreGraphics/CGSWindow.h>
  +//#import <CoreGraphics/CGSWindow.h>
   #import <HIToolbox/CarbonEvents.h>
  -#import <HIToolbox/CarbonEventsPriv.h>
   #import <HIToolbox/Controls.h>
  -#import <HIToolbox/ControlsPriv.h>
  -#import <HIToolbox/WindowsPriv.h>
   #import <HIToolbox/HIView.h>
   #import <assert.h>
   
   #import "WebNSObjectExtras.h"
   
  -// Carbon SPI functions.
  -// The fact that these are declared here instead of in an HIToolbox header is a bad thing.  2776459.  M.P. To Do - 9/18/01
  -OSStatus _SetWindowCGOrderingEnabled(WindowRef inWindow, Boolean inEnableWindow);
  -OSStatus _SyncWindowWithCGAfterMove(WindowRef inWindow);
  -OSStatus SyncWindowToCGSWindow(WindowRef inWindow, CGSWindowID inWindowID);
  -
  -// Copied-and-pasted AppKit miscellany.
  -#define WINDOWSMENUWINDOW(w)   (!_wFlags.excludedFromWindowsMenu && \
  -                                [w _miniaturizedOrCanBecomeMain] && [w _isDocWindow])
  -extern float _NXScreenMaxYForRect(NSRect *rect);
  -extern void _NXOrderKeyAndMain( void );
  -extern void _NXShowKeyAndMain( void );
  -
  -// Constants that we use to fiddle with NSViewCarbonControls.
  -extern const ControlFocusPart NSViewCarbonControlMagicPartCode;
  -extern const OSType NSAppKitPropertyCreator;
  -extern const OSType NSViewCarbonControlViewPropertyTag;
  -extern const OSType NSCarbonWindowPropertyTag;
  -
   @interface NSWindow(HIWebFrameView)
   - _initContent:(const NSRect *)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag contentView:aView;
   - (void)_oldPlaceWindow:(NSRect)frameRect;
  @@ -121,7 +80,6 @@
   - (NSGraphicsContext *)_threadContext;
   - (void)_setFrame:(NSRect)newWindowFrameRect;
   - (void)_setVisible:(BOOL)flag;
  -- (NSRect)_growBoxRect;
   @end
   
   @interface NSApplication(HIWebFrameView)
  @@ -144,7 +102,7 @@
   + (Class)frameViewClassForStyleMask:(unsigned int)style {
   
       // There's only one appropriate window style, and only one appropriate window frame class.
  -    assert(style & _NSCarbonWindowMask);
  +    assert(style & WKCarbonWindowMask());
       return [CarbonWindowFrame class];
   
   }
  @@ -189,7 +147,7 @@
   	_carbon = inCarbon;
   
       // Find out the window's CoreGraphics window reference.
  -    nativeWindow = GetNativeWindowFromWindowRef(inWindowRef);
  +    nativeWindow = WKGetNativeWindowFromWindowRef(inWindowRef);
   
       // Find out the window's Carbon window attributes.
       GetWindowAttributes(inWindowRef, &windowAttributes);
  @@ -205,7 +163,7 @@
       backingStoreType = NSBackingStoreRetained;
   
       // Figure out the window's style mask.
  -    styleMask = _NSCarbonWindowMask;
  +    styleMask = WKCarbonWindowMask();
       if (windowAttributes & kWindowCloseBoxAttribute) styleMask |= NSClosableWindowMask;
       if (windowAttributes & kWindowResizableAttribute) styleMask |= NSResizableWindowMask;
       if (windowFeatures & kWindowCanCollapse) styleMask |= NSMiniaturizableWindowMask;
  @@ -268,7 +226,7 @@
       // Put a pointer to this Cocoa NSWindow in a Carbon window property tag.
       // Right now, this is just used by NSViewCarbonControl.  M.P. Notice - 10/9/00
       windowAsProperty = self;
  -    osStatus = SetWindowProperty(_windowRef, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), &windowAsProperty);
  +    osStatus = SetWindowProperty(_windowRef, WKCarbonWindowPropertyCreator(), WKCarbonWindowPropertyTag(), sizeof(NSWindow *), &windowAsProperty);
       if (osStatus!=noErr) {
           [self release];
           return nil;
  @@ -387,7 +345,7 @@
   
       // Set the frame rectangle of the border view and this window from the Carbon window's structure region bounds.
       newWindowFrameRect.origin.x = windowStructureBoundsRect.left;
  -    newWindowFrameRect.origin.y = _NXScreenMaxYForRect(NULL) - windowStructureBoundsRect.bottom;
  +    newWindowFrameRect.origin.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - windowStructureBoundsRect.bottom;
       newWindowFrameRect.size.width = windowStructureBoundsRect.right - windowStructureBoundsRect.left;
       newWindowFrameRect.size.height = windowStructureBoundsRect.bottom - windowStructureBoundsRect.top;
       if (!NSEqualRects(newWindowFrameRect, _frame)) {
  @@ -577,7 +535,7 @@
   
       // Tell Carbon to update its various regions.
       // Despite its name, this function should be called early and often, even if the window isn't visible yet.  2702648.  M.P. Notice - 7/24/01
  -    osStatus = _SyncWindowWithCGAfterMove(_windowRef);
  +    osStatus = WKSyncWindowWithCGAfterMove(_windowRef);
       if (osStatus!=noErr) NSLog(@"A Carbon window's bounds couldn't be synchronized (%i).", (int)osStatus);
   
   }
  @@ -610,7 +568,6 @@
   // Do what NSWindow would do, but for a Carbon window.
   // This function is mostly cut-and-pasted from -[NSWindow _termWindowIfOwner].  M.P. Notice - 8/7/00
   - (void)_termWindowIfOwner {
  -    assert([self _doesOwnRealWindow]);
       [self _setWindowNumber:-1];
       _wFlags.isTerminating = YES;
       if (_windowRef && _windowRefIsOwned) DisposeWindow(_windowRef);
  @@ -638,7 +595,7 @@
   
       // Let Carbon know that the window has been moved, unless this method is being called "early."
       if (_wFlags.visible) {
  -        osStatus = _SyncWindowWithCGAfterMove(_windowRef);
  +        osStatus = WKSyncWindowWithCGAfterMove(_windowRef);
           if (osStatus!=noErr) NSLog(@"A Carbon window's bounds couldn't be synchronized (%i).", (int)osStatus);
       }
   
  @@ -689,7 +646,7 @@
   	[NSApp _setMouseActivationInProgress:NO];
   	[NSApp setIsActive:YES];
   	[super makeKeyWindow];
  -	_NXShowKeyAndMain();
  +	WKShowKeyAndMain();
   }
   
   
  @@ -1070,19 +1027,4 @@
         return retRect;
   }
   
  -
  -/*
  -void _NSSetModalWindowClassLevel(int level) {
  -    WindowGroupRef groupRef;
  -    // Carbon will handle modality in its own way
  - //   if (_NSIsCarbonApp()) {
  -        return;
  -  //  }//
  -    groupRef = GetWindowGroupOfClass(kModalWindowClass);
  -//    if (groupRef) {
  -//        SetWindowGroupLevel(groupRef, level);
  -//    }
  -}
  -*/
  -
   @end // implementation CarbonWindowAdapter
  
  
  



More information about the webkit-changes mailing list