- removed more SPI
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2005 12:16:15 +0000 (12:16 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2005 12:16:15 +0000 (12:16 +0000)
        * Carbon.subproj/CarbonUtils.m:
        (WebInitForCarbon):
        (PoolCleaner):
        * WebView.subproj/WebHTMLView.m:
        (+[WebHTMLView _postFlagsChangedEvent:]):
        (-[WebHTMLView _autoscroll]):
        (-[WebHTMLView addMouseMovedObserver]):
        (-[WebHTMLView removeMouseMovedObserver]):
        (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
        (-[WebHTMLView _interceptEditingKeyEvent:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/Carbon.subproj/CarbonUtils.m
WebKit/ChangeLog
WebKit/WebView.subproj/WebHTMLView.m

index aec48b95d85d326b8c28899c45083dfd25159e34..661b8fcc4e24cd98a920943662a8638dc7e4dce5 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <AppKit/NSBitmapImageRep_Private.h>
-#import <Foundation/NSPrivateDecls.h>
-
 #include "CarbonUtils.h"
+#import <WebKitSystemInterface.h>
 
 extern CGImageRef _NSCreateImageRef( unsigned char *const bitmapData[5], int pixelsWide, int pixelsHigh, int bitsPerSample, int samplesPerPixel, int bitsPerPixel, int bytesPerRow, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, CGColorSpaceRef customColorSpace, id sourceObj);
 
@@ -39,13 +37,6 @@ static NSAutoreleasePool*    sPool;
 static unsigned numPools;
 static EventLoopRef poolLoop;
 
-static unsigned getNumPools()
-{
-    void *v = NSPushAutoreleasePool(0);
-    unsigned numPools = (unsigned)(v);
-    NSPopAutoreleasePool (v);
-    return numPools;
-}
 
 void                    HIWebViewRegisterClass( void );
 
@@ -64,16 +55,14 @@ WebInitForCarbon()
         NSApplicationLoad();
                 
         sPool = [[NSAutoreleasePool allocWithZone:NULL] init];
-        numPools = getNumPools();
+        numPools = WKGetNSAutoreleasePoolCount();
         
         poolLoop = GetCurrentEventLoop ();
 
         InstallEventLoopIdleTimer( GetMainEventLoop(), 1.0, 0, PoolCleaner, 0, NULL );
         
-        sAppKitLoaded = true;     
-
-        [NSBitmapImageRep _setEnableFlippedImageFix:YES];
-        
+        sAppKitLoaded = true;
+                
         HIWebViewRegisterClass();
     }
 }
@@ -93,12 +82,12 @@ PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void
         CFStringRef mode = CFRunLoopCopyCurrentMode( (CFRunLoopRef)GetCFRunLoopFromEventLoop( GetCurrentEventLoop() ));
         EventLoopRef thisLoop = GetCurrentEventLoop ();
         if ( CFEqual( mode, kCFRunLoopDefaultMode ) && thisLoop == poolLoop) {
-            unsigned currentNumPools = getNumPools()-1;            
+            unsigned currentNumPools = WKGetNSAutoreleasePoolCount()-1;            
             if (currentNumPools == numPools){
                 [sPool release];
                 
                 sPool = [[NSAutoreleasePool allocWithZone:NULL] init];
-                numPools = getNumPools();
+                numPools = WKGetNSAutoreleasePoolCount();
             }
         }
         CFRelease( mode );
index 383ae4e8fae32c37b292534163876b3ebf503f1d..a01f305edebc365a5e2e4c05e23e35dd19d08420 100644 (file)
@@ -1,3 +1,18 @@
+2005-06-06  Maciej Stachowiak  <mjs@apple.com>
+
+        - removed more SPI
+
+        * Carbon.subproj/CarbonUtils.m:
+        (WebInitForCarbon):
+        (PoolCleaner):
+        * WebView.subproj/WebHTMLView.m:
+        (+[WebHTMLView _postFlagsChangedEvent:]):
+        (-[WebHTMLView _autoscroll]):
+        (-[WebHTMLView addMouseMovedObserver]):
+        (-[WebHTMLView removeMouseMovedObserver]):
+        (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
+        (-[WebHTMLView _interceptEditingKeyEvent:]):
+
 2005-06-06  Maciej Stachowiak  <mjs@apple.com>
 
         - more SPI use removal
index 15c1450bc34e1a1232fee3f9d77eab60a853f357..ecb7a87e935cbe09f9a8eb58a45260269faffa41 100644 (file)
 #import <WebKitSystemInterface.h>
 
 #import <AppKit/NSAccessibility.h>
-#import <AppKit/NSGraphicsContextPrivate.h>
-#import <AppKit/NSResponder_Private.h>
-
-#import <CoreGraphics/CGContextGState.h>
-
-// Included to help work around this bug:
-// <rdar://problem/3630640>: "Calling interpretKeyEvents: in a custom text view can fail to process keys right after app startup"
-#import <AppKit/NSKeyBindingManager.h>
 
 // Included so usage of _NSSoftLinkingGetFrameworkFuncPtr will compile
 #import <mach-o/dyld.h> 
@@ -675,7 +667,7 @@ void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
 
     // Pretend it's a mouse move.
     [[NSNotificationCenter defaultCenter]
-        postNotificationName:NSMouseMovedNotification object:self
+        postNotificationName:WKMouseMovedNotification() object:self
         userInfo:[NSDictionary dictionaryWithObject:fakeEvent forKey:@"NSEvent"]];
 }
 
@@ -1448,11 +1440,9 @@ static WebHTMLView *lastHitView = nil;
 
 - (void)_autoscroll
 {
-    int isStillDown;
-    
     // Guarantee that the autoscroll timer is invalidated, even if we don't receive
     // a mouse up event.
-    PSstilldown([_private->autoscrollTriggerEvent eventNumber], &isStillDown);
+       BOOL isStillDown = WKMouseIsDown();   
     if (!isStillDown){
         [self _stopAutoscrollTimer];
         return;
@@ -2068,7 +2058,7 @@ static WebHTMLView *lastHitView = nil;
     if (([[self window] isKeyWindow] && ![self _insideAnotherHTMLView]) ||
         [[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows]){
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mouseMovedNotification:)
-            name:NSMouseMovedNotification object:nil];
+            name:WKMouseMovedNotification() object:nil];
         [self _frameOrBoundsChanged];
     }
 }
@@ -2081,7 +2071,7 @@ static WebHTMLView *lastHitView = nil;
         
     [[self _webView] _mouseDidMoveOverElement:nil modifierFlags:0];
     [[NSNotificationCenter defaultCenter] removeObserver:self
-        name:NSMouseMovedNotification object:nil];
+        name:WKMouseMovedNotification() object:nil];
 }
 
 - (void)updateFocusState
@@ -2285,7 +2275,7 @@ static WebHTMLView *lastHitView = nil;
     
     // Ensure that we will receive mouse move events.  Is this the best place to put this?
     [[self window] setAcceptsMouseMovedEvents: YES];
-    [[self window] _setShouldPostEventNotifications: YES];
+       WKSetNSWindowShouldPostEventNotifications([self window], YES);
 
     if (!_private->needsLayout) {
         return;
@@ -3234,10 +3224,6 @@ static WebHTMLView *lastHitView = nil;
 
 - (BOOL)_interceptEditingKeyEvent:(NSEvent *)event
 {   
-    // Work around this bug:
-    // <rdar://problem/3630640>: "Calling interpretKeyEvents: in a custom text view can fail to process keys right after app startup"
-    [NSKeyBindingManager sharedKeyBindingManager];
-    
     // Use the isEditable state to determine whether or not to process tab key events.
     // The idea here is that isEditable will be NO when this WebView is being used
     // in a browser, and we desire the behavior where tab moves to the next element