[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

voas voas at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:42:46 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a06aa03c21e39d66437c7968830fd14d08fa414f
Author: voas <voas at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 21 19:03:30 2003 +0000

    2003-05-21  Ed Voas <voas at apple.com>
    
    	- fixed 3262868: Update Carbon WebKit API prefixes
    	- fixed 3264980: Carbon support in WebKit needs to route mouse events properly
    
            Reviewed by Richard.
    
            * Carbon.subproj/CarbonUtils.h:
            * Carbon.subproj/CarbonUtils.m:
            (WebInitForCarbon):
            (WebConvertNSImageToCGImageRef):
            * Carbon.subproj/HIWebView.h:
            * Carbon.subproj/HIWebView.m:
            (HIWebViewGetWebView):
            (OwningWindowChanged):
            (WindowHandler):
            (HIWebViewEventHandler):
            * WebKit.exp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Carbon.subproj/CarbonUtils.h b/WebKit/Carbon.subproj/CarbonUtils.h
index d92bff8..298bdfa 100644
--- a/WebKit/Carbon.subproj/CarbonUtils.h
+++ b/WebKit/Carbon.subproj/CarbonUtils.h
@@ -14,8 +14,8 @@
 extern "C" {
 #endif
 
-extern void 		InitWebKitForCarbon( void );
-extern CGImageRef 	ConvertNSImageToCGImageRef( NSImage* inImage );
+extern void 		WebInitForCarbon( void );
+extern CGImageRef 	WebConvertNSImageToCGImageRef( NSImage* inImage );
 
 #ifdef __cplusplus
 }
diff --git a/WebKit/Carbon.subproj/CarbonUtils.m b/WebKit/Carbon.subproj/CarbonUtils.m
index 77bb3d8..e548f75 100644
--- a/WebKit/Carbon.subproj/CarbonUtils.m
+++ b/WebKit/Carbon.subproj/CarbonUtils.m
@@ -16,7 +16,7 @@ static void				PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage
 static NSAutoreleasePool*	sPool;
 
 void
-InitWebKitForCarbon()
+WebInitForCarbon()
 {
     static bool			sAppKitLoaded;
 
@@ -43,7 +43,7 @@ PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void
 }
 
 CGImageRef
-ConvertNSImageToCGImageRef(
+WebConvertNSImageToCGImageRef(
 	NSImage*         inImage )
 {
 	NSArray*				reps = [inImage representations];
diff --git a/WebKit/Carbon.subproj/HIWebView.h b/WebKit/Carbon.subproj/HIWebView.h
index 8e41291..51added 100644
--- a/WebKit/Carbon.subproj/HIWebView.h
+++ b/WebKit/Carbon.subproj/HIWebView.h
@@ -44,7 +44,7 @@ HIWebViewCreate(HIViewRef * outControl);
 
 
 /*
- *  HIWebViewGetNSView()
+ *  HIWebViewGetWebView()
  *  
  *  Summary:
  *    Returns the WebKit WebView for a given HIWebView.
@@ -63,7 +63,7 @@ HIWebViewCreate(HIViewRef * outControl);
  *    Non-Carbon CFM:   not available
  */
 extern WebView*
-HIWebViewGetNSView( HIViewRef inView );
+HIWebViewGetWebView( HIViewRef inView );
 
 #ifdef __cplusplus
 }
diff --git a/WebKit/Carbon.subproj/HIWebView.m b/WebKit/Carbon.subproj/HIWebView.m
index 7830610..f0e0a61 100644
--- a/WebKit/Carbon.subproj/HIWebView.m
+++ b/WebKit/Carbon.subproj/HIWebView.m
@@ -184,7 +184,7 @@ static void				RelinquishFocus( HIWebView* view, bool inAutodisplay );
 static WindowRef		GetWindowRef( HIWebView* inView );
 static void				SyncFrame( HIWebView* inView );
 
-static OSStatus			WindowCloseHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData );
+static OSStatus			WindowHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData );
 
 static void				StartUpdateObserver( HIWebView* view );
 static void				StopUpdateObserver( HIWebView* view );
@@ -215,11 +215,11 @@ HIWebViewCreate( HIViewRef* outControl )
 }
 
 //----------------------------------------------------------------------------------
-// HIWebViewGetNSView
+// HIWebViewGetWebView
 //----------------------------------------------------------------------------------
 //
 WebView*
-HIWebViewGetNSView( HIViewRef inView )
+HIWebViewGetWebView( HIViewRef inView )
 {
 	HIWebView* 	view = (HIWebView*)HIObjectDynamicCast( (HIObjectRef)inView, kHIWebViewClassID );
 	WebView*			result = NULL;
@@ -667,12 +667,18 @@ OwningWindowChanged(
     	OSStatus err = GetWindowProperty(newWindow, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &view->fKitWindow);
 		if ( err != noErr )
 		{
-			const EventTypeSpec kWindowEvents[] = { { kEventClassWindow, kEventWindowClosed } };
+			const EventTypeSpec kWindowEvents[] = {
+                { kEventClassWindow, kEventWindowClosed },
+                { kEventClassMouse, kEventMouseMoved },
+                { kEventClassMouse, kEventMouseUp },
+                { kEventClassMouse, kEventMouseDragged },
+                { kEventClassMouse, kEventMouseWheelMoved }
+            };
 
 			view->fKitWindow = [[CarbonWindowAdapter alloc] initWithCarbonWindowRef: newWindow takingOwnership: NO disableOrdering:NO carbon:YES];
     		SetWindowProperty(newWindow, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), &view->fKitWindow);
 		
-			InstallWindowEventHandler( newWindow, WindowCloseHandler, GetEventTypeCount( kWindowEvents ), kWindowEvents, newWindow, NULL );
+			InstallWindowEventHandler( newWindow, WindowHandler, GetEventTypeCount( kWindowEvents ), kWindowEvents, newWindow, NULL );
 		}
 		
 		[[view->fKitWindow contentView] addSubview:view->fWebView];
@@ -684,25 +690,98 @@ OwningWindowChanged(
 	}
 }
 
-//----------------------------------------------------------------------------------
-// WindowCloseHandler
-//----------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------------
+//	WindowHandler
+//-------------------------------------------------------------------------------------
+//	Redirect mouse events to the views beneath them. This is required for WebKit to work
+// 	properly. We install it once per window. We also tap into window close to release
+//	the NSWindow that shadows our Carbon window.
 //
 static OSStatus
-WindowCloseHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData )
+WindowHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData )
 {
 	WindowRef	window = (WindowRef)inUserData;
-	OSStatus	err;
-	NSWindow*	kitWindow;
+	OSStatus	result = eventNotHandledErr;
 
-	err = GetWindowProperty( window, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &kitWindow);
-	if ( err == noErr )
-	{
-		[kitWindow _removeWindowRef];
-		[kitWindow close];
-	}
+    switch( GetEventClass( inEvent ) )
+    {
+        case kEventClassWindow:
+            {
+                NSWindow*	kitWindow;
+                OSStatus	err;
+                
+                err = GetWindowProperty( window, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &kitWindow);
+                if ( err == noErr )
+                {
+                    [kitWindow _removeWindowRef];
+                    [kitWindow close];
+                }
 	
-	return noErr;
+                result = noErr;
+            }
+            break;
+        
+        case kEventClassMouse:
+            switch( GetEventKind( inEvent ) )
+            {
+                case kEventMouseMoved:
+                    {
+                        WindowRef		temp;
+                        Point			where;
+                        WindowPartCode	part;
+                        HIViewRef		view;
+                    
+                        GetEventParameter( inEvent, kEventParamMouseLocation, typeQDPoint, NULL,
+                                sizeof( Point ), NULL, &where );
+                                
+                        part = FindWindow( where, &temp );
+                        if ( temp == window )
+                        {
+                            Rect		bounds;
+                            ControlKind	kind;
+
+                            GetWindowBounds( window, kWindowStructureRgn, &bounds );
+                            where.h -= bounds.left;
+                            where.v -= bounds.top;
+                            SetEventParameter( inEvent, kEventParamWindowRef, typeWindowRef, sizeof( WindowRef ), &window );
+                            SetEventParameter( inEvent, kEventParamWindowMouseLocation, typeQDPoint, sizeof( Point ), &where );
+                            
+                            HIViewGetViewForMouseEvent( HIViewGetRoot( window ), inEvent, &view );
+                        
+                            GetControlKind( view, &kind );
+                            
+                            if ( kind.signature == 'appl' && kind.kind == 'wbvw' )
+                            {
+                                result = SendEventToEventTargetWithOptions( inEvent, HIObjectGetEventTarget( (HIObjectRef)view ),
+                                        kEventTargetDontPropagate );
+                            }
+                        }
+                    }
+                    break;
+                
+                case kEventMouseUp:
+                case kEventMouseDragged:
+                case kEventMouseWheelMoved:
+                    {
+                        HIViewRef	view;
+                        ControlKind	kind;
+                        
+                        HIViewGetViewForMouseEvent( HIViewGetRoot( window ), inEvent, &view );
+        
+                        GetControlKind( view, &kind );
+                        
+                        if ( kind.signature == 'appl' && kind.kind == 'wbvw' )
+                        {
+                            result = SendEventToEventTargetWithOptions( inEvent, HIObjectGetEventTarget( (HIObjectRef)view ),
+                                        kEventTargetDontPropagate );
+                        }
+                    }
+                    break;
+            }
+            break;
+    }
+
+	return result;
 }
 
 
@@ -1370,49 +1449,6 @@ HIWebViewEventHandler(
 						result = noErr;
 					}
 					break;
-/*					
-				case kEventControlDragEnter:
-				case kEventControlDragLeave:
-				case kEventControlDragWithin:
-					{
-						DragRef		drag;
-						bool		likesDrag;
-						
-						inEvent.GetParameter( kEventParamDragRef, &drag );
-
-						switch ( inEvent.GetKind() )
-						{
-							case kEventControlDragEnter:
-								likesDrag = DragEnter( drag );
-								
-								// Why only if likesDrag?  What if it doesn't?  No parameter?
-								if ( likesDrag )
-									result = inEvent.SetParameter( kEventParamControlLikesDrag, likesDrag );
-								break;
-							
-							case kEventControlDragLeave:
-								DragLeave( drag );
-								result = noErr;
-								break;
-							
-							case kEventControlDragWithin:
-								DragWithin( drag );
-								result = noErr;
-								break;
-						}
-					}
-					break;
-				
-				case kEventControlDragReceive:
-					{
-						DragRef		drag;
-						
-						inEvent.GetParameter( kEventParamDragRef, &drag );
-
-						result = DragReceive( drag );
-					}
-					break;
-*/
 
 				case kEventControlClick:
 					result = Click( view, inEvent );
@@ -1464,6 +1500,7 @@ MissingParameter:
 	return result;
 }
 
+
 static void
 StartUpdateObserver( HIWebView* view )
 {
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5b54541..586034a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2003-05-21  Ed Voas <voas at apple.com> 
+
+	- fixed 3262868: Update Carbon WebKit API prefixes
+	- fixed 3264980: Carbon support in WebKit needs to route mouse events properly
+	
+        Reviewed by Richard.
+
+        * Carbon.subproj/CarbonUtils.h:
+        * Carbon.subproj/CarbonUtils.m:
+        (WebInitForCarbon):
+        (WebConvertNSImageToCGImageRef):
+        * Carbon.subproj/HIWebView.h:
+        * Carbon.subproj/HIWebView.m:
+        (HIWebViewGetWebView):
+        (OwningWindowChanged):
+        (WindowHandler):
+        (HIWebViewEventHandler):
+        * WebKit.exp:
+
 2003-05-21  Vicki Murley  <vicki at apple.com>
 
         Reviewed by john 
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 1d005a6..05f7b01 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -70,8 +70,8 @@ _WebURLPboardType
 ## Carbon Support
 ##
 
-_HIWebViewGetNSView
+_HIWebViewGetWebView
 _HIWebViewCreate
-_ConvertNSImageToCGImageRef
-_InitWebKitForCarbon
+_WebConvertNSImageToCGImageRef
+_WebInitForCarbon
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list