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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:53:55 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b44d9dffe7032808878d32a7bd36f9da8df8beb1
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 8 23:21:20 2002 +0000

    Fixed plug-in positioning
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@530 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/WKPlugin.h b/WebCore/kwq/WKPlugin.h
index fbbbe90..589ea90 100644
--- a/WebCore/kwq/WKPlugin.h
+++ b/WebCore/kwq/WKPlugin.h
@@ -41,6 +41,7 @@
 - (void)unload;
 
 - (NPP_NewProcPtr)NPP_New;
+- (NPP_DestroyProcPtr)NPP_Destroy;
 - (NPP_SetWindowProcPtr)NPP_SetWindow;
 - (NPP_NewStreamProcPtr)NPP_NewStream;
 - (NPP_WriteReadyProcPtr)NPP_WriteReady;
diff --git a/WebCore/kwq/WKPlugin.mm b/WebCore/kwq/WKPlugin.mm
index 23cd3f7..01927b3 100644
--- a/WebCore/kwq/WKPlugin.mm
+++ b/WebCore/kwq/WKPlugin.mm
@@ -144,8 +144,8 @@
 }
 
 - (void)unload{
-    // unload library here
     NPP_Shutdown();
+    // unload library here
 }
 
 - (NPP_SetWindowProcPtr)NPP_SetWindow{
@@ -156,6 +156,10 @@
     return NPP_New;
 }
 
+- (NPP_DestroyProcPtr)NPP_Destroy{
+    return NPP_Destroy;
+}
+
 - (NPP_NewStreamProcPtr)NPP_NewStream{
     return NPP_NewStream;
 }
diff --git a/WebCore/kwq/WKPluginView.h b/WebCore/kwq/WKPluginView.h
index 29c30bb..035b162 100644
--- a/WebCore/kwq/WKPluginView.h
+++ b/WebCore/kwq/WKPluginView.h
@@ -60,5 +60,6 @@ typedef struct EventRecord EventRecord;
 -(void)drawRect:(NSRect)rect;
 -(BOOL)acceptsFirstResponder;
 -(void)sendNullEvent;
+-(void)dealloc;
 
 @end
diff --git a/WebCore/kwq/WKPluginView.mm b/WebCore/kwq/WKPluginView.mm
index 7a73304..13134f6 100644
--- a/WebCore/kwq/WKPluginView.mm
+++ b/WebCore/kwq/WKPluginView.mm
@@ -28,13 +28,14 @@
     url = location;
     plugin = plug;
     NPP_New = 		[plugin NPP_New]; // copy function pointers
+    NPP_Destroy = 	[plugin NPP_Destroy];
     NPP_SetWindow = 	[plugin NPP_SetWindow];
     NPP_NewStream = 	[plugin NPP_NewStream];
     NPP_WriteReady = 	[plugin NPP_WriteReady];
     NPP_Write = 	[plugin NPP_Write];
     NPP_DestroyStream = [plugin NPP_DestroyStream];
     NPP_HandleEvent = 	[plugin NPP_HandleEvent];
-    
+
     [mime getCString:cMime];
     npErr = NPP_New(cMime, instance, NP_EMBED, 0, NULL, NULL, &saved); //need to pass parameters to plug-in
     KWQDebug("NPP_New: %d\n", npErr);
@@ -52,11 +53,13 @@
     frame = [self frame];
     
     nPort.port = [self qdPort];
-    nPort.portx = 0;
-    nPort.porty = 0;
+    nPort.portx = (int32)rect.origin.x;
+    nPort.porty = (int32)rect.origin.y;
     window.window = &nPort;
-    window.x = (uint32)frame.origin.x; //top-left corner of the plug-in relative to page
-    window.y = (uint32)frame.origin.y;
+    window.x = 0; 
+    window.y = 0;
+    //window.x = (uint32)frame.origin.x; //top-left corner of the plug-in relative to page
+    //window.y = (uint32)frame.origin.y;
     window.width = (uint32)frame.size.width;
     window.height = (uint32)frame.size.height;
     window.clipRect.top = (uint16)rect.origin.y; // clip rect
@@ -65,6 +68,10 @@
     window.clipRect.right = (uint16)rect.size.width;
     window.type = NPWindowTypeDrawable;
     
+    //SetPort(nPort.port);
+    //LineTo((int)frame.size.width, (int)frame.size.height);
+    //MoveTo(0,0);
+    
     npErr = NPP_SetWindow(instance, &window);
     KWQDebug("NPP_SetWindow: %d rect.size.height=%d rect.size.width=%d port=%d rect.origin.x=%f rect.origin.y=%f\n", npErr, (int)rect.size.height, (int)rect.size.width, (int)nPort.port, rect.origin.x, rect.origin.y);
     KWQDebug("frame.size.height=%d frame.size.width=%d frame.origin.x=%f frame.origin.y=%f\n", (int)frame.size.height, (int)frame.size.width, frame.origin.x, frame.origin.y);
@@ -131,4 +138,13 @@
     KWQDebug("NPP_HandleEvent: %d\n", NPP_HandleEvent(instance, &event));
 }
 
+-(void)dealloc
+{
+    NPError npErr;
+    
+    npErr = NPP_Destroy(instance, NULL);
+    KWQDebug("NPP_Destroy: %d\n", npErr);
+    [super dealloc];
+}
+
 @end
diff --git a/WebCore/src/kwq/WKPlugin.h b/WebCore/src/kwq/WKPlugin.h
index fbbbe90..589ea90 100644
--- a/WebCore/src/kwq/WKPlugin.h
+++ b/WebCore/src/kwq/WKPlugin.h
@@ -41,6 +41,7 @@
 - (void)unload;
 
 - (NPP_NewProcPtr)NPP_New;
+- (NPP_DestroyProcPtr)NPP_Destroy;
 - (NPP_SetWindowProcPtr)NPP_SetWindow;
 - (NPP_NewStreamProcPtr)NPP_NewStream;
 - (NPP_WriteReadyProcPtr)NPP_WriteReady;
diff --git a/WebCore/src/kwq/WKPlugin.mm b/WebCore/src/kwq/WKPlugin.mm
index 23cd3f7..01927b3 100644
--- a/WebCore/src/kwq/WKPlugin.mm
+++ b/WebCore/src/kwq/WKPlugin.mm
@@ -144,8 +144,8 @@
 }
 
 - (void)unload{
-    // unload library here
     NPP_Shutdown();
+    // unload library here
 }
 
 - (NPP_SetWindowProcPtr)NPP_SetWindow{
@@ -156,6 +156,10 @@
     return NPP_New;
 }
 
+- (NPP_DestroyProcPtr)NPP_Destroy{
+    return NPP_Destroy;
+}
+
 - (NPP_NewStreamProcPtr)NPP_NewStream{
     return NPP_NewStream;
 }
diff --git a/WebCore/src/kwq/WKPluginView.h b/WebCore/src/kwq/WKPluginView.h
index 29c30bb..035b162 100644
--- a/WebCore/src/kwq/WKPluginView.h
+++ b/WebCore/src/kwq/WKPluginView.h
@@ -60,5 +60,6 @@ typedef struct EventRecord EventRecord;
 -(void)drawRect:(NSRect)rect;
 -(BOOL)acceptsFirstResponder;
 -(void)sendNullEvent;
+-(void)dealloc;
 
 @end
diff --git a/WebCore/src/kwq/WKPluginView.mm b/WebCore/src/kwq/WKPluginView.mm
index 7a73304..13134f6 100644
--- a/WebCore/src/kwq/WKPluginView.mm
+++ b/WebCore/src/kwq/WKPluginView.mm
@@ -28,13 +28,14 @@
     url = location;
     plugin = plug;
     NPP_New = 		[plugin NPP_New]; // copy function pointers
+    NPP_Destroy = 	[plugin NPP_Destroy];
     NPP_SetWindow = 	[plugin NPP_SetWindow];
     NPP_NewStream = 	[plugin NPP_NewStream];
     NPP_WriteReady = 	[plugin NPP_WriteReady];
     NPP_Write = 	[plugin NPP_Write];
     NPP_DestroyStream = [plugin NPP_DestroyStream];
     NPP_HandleEvent = 	[plugin NPP_HandleEvent];
-    
+
     [mime getCString:cMime];
     npErr = NPP_New(cMime, instance, NP_EMBED, 0, NULL, NULL, &saved); //need to pass parameters to plug-in
     KWQDebug("NPP_New: %d\n", npErr);
@@ -52,11 +53,13 @@
     frame = [self frame];
     
     nPort.port = [self qdPort];
-    nPort.portx = 0;
-    nPort.porty = 0;
+    nPort.portx = (int32)rect.origin.x;
+    nPort.porty = (int32)rect.origin.y;
     window.window = &nPort;
-    window.x = (uint32)frame.origin.x; //top-left corner of the plug-in relative to page
-    window.y = (uint32)frame.origin.y;
+    window.x = 0; 
+    window.y = 0;
+    //window.x = (uint32)frame.origin.x; //top-left corner of the plug-in relative to page
+    //window.y = (uint32)frame.origin.y;
     window.width = (uint32)frame.size.width;
     window.height = (uint32)frame.size.height;
     window.clipRect.top = (uint16)rect.origin.y; // clip rect
@@ -65,6 +68,10 @@
     window.clipRect.right = (uint16)rect.size.width;
     window.type = NPWindowTypeDrawable;
     
+    //SetPort(nPort.port);
+    //LineTo((int)frame.size.width, (int)frame.size.height);
+    //MoveTo(0,0);
+    
     npErr = NPP_SetWindow(instance, &window);
     KWQDebug("NPP_SetWindow: %d rect.size.height=%d rect.size.width=%d port=%d rect.origin.x=%f rect.origin.y=%f\n", npErr, (int)rect.size.height, (int)rect.size.width, (int)nPort.port, rect.origin.x, rect.origin.y);
     KWQDebug("frame.size.height=%d frame.size.width=%d frame.origin.x=%f frame.origin.y=%f\n", (int)frame.size.height, (int)frame.size.width, frame.origin.x, frame.origin.y);
@@ -131,4 +138,13 @@
     KWQDebug("NPP_HandleEvent: %d\n", NPP_HandleEvent(instance, &event));
 }
 
+-(void)dealloc
+{
+    NPError npErr;
+    
+    npErr = NPP_Destroy(instance, NULL);
+    KWQDebug("NPP_Destroy: %d\n", npErr);
+    [super dealloc];
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list