[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:53 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit d9242bf904b43329713e0ba8885ebd6f569dafbd
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 8 20:17:54 2002 +0000
Now passing drawing coordinates to plug-in instances
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/kwq/WKPluginView.mm b/WebCore/kwq/WKPluginView.mm
index e59e52f..b62f80e 100644
--- a/WebCore/kwq/WKPluginView.mm
+++ b/WebCore/kwq/WKPluginView.mm
@@ -19,8 +19,7 @@
NPSavedData saved;
[super initWithFrame: r];
- widget = w;
- isFlipped = YES;
+
instance = &instanceStruct;
stream = &streamStruct;
streamOffset = 0;
@@ -37,7 +36,7 @@
NPP_HandleEvent = [plugin NPP_HandleEvent];
[mime getCString:cMime];
- npErr = NPP_New(cMime, instance, NP_EMBED, 0, NULL, NULL, &saved);
+ npErr = NPP_New(cMime, instance, NP_EMBED, 0, NULL, NULL, &saved); //need to pass parameters to plug-in
KWQDebug("NPP_New: %d\n", npErr);
transferred = FALSE;
return self;
@@ -47,30 +46,35 @@
NPError npErr;
NPWindow window;
NP_Port nPort;
- // Point pt;
char cMime[200], cURL[800];
uint16 stype;
id <WCURICache> cache;
+ NSRect frame;
+
+ frame = [self frame];
nPort.port = [self qdPort];
nPort.portx = 0;
nPort.porty = 0;
-
window.window = &nPort;
- window.x = 20;
- window.y = 20;
- window.width = 640;
- window.height = 450;
- window.clipRect.top = 0;
- window.clipRect.left = 0;
- window.clipRect.bottom = 450;
- window.clipRect.right = 640;
+ 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
+ window.clipRect.left = (uint16)rect.origin.x;
+ window.clipRect.bottom = (uint16)rect.size.height;
+ window.clipRect.right = (uint16)rect.size.width;
window.type = NPWindowTypeDrawable;
- /*SetPort(nPort.port);
+
+ SetPort(nPort.port);
LineTo((int)rect.size.width, (int)rect.size.height);
- MoveTo(0,0);*/
+ MoveTo(0,0);
+
npErr = NPP_SetWindow(instance, &window);
- KWQDebug("NPP_SetWindow: %d rect.size.height=%d rect.size.width=%d port=%d\n", npErr, (int)rect.size.height, (int)rect.size.width, (int)nPort.port);
+ 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);
+ KWQDebug("bounds.size.height=%d bounds.size.width=%d bounds.origin.x=%f bounds.origin.y=%f\n\n", (int)bounds.size.height, (int)bounds.size.width, bounds.origin.x, bounds.origin.y);
if(!transferred){
[url getCString:cURL];
diff --git a/WebCore/src/kwq/WKPluginView.mm b/WebCore/src/kwq/WKPluginView.mm
index e59e52f..b62f80e 100644
--- a/WebCore/src/kwq/WKPluginView.mm
+++ b/WebCore/src/kwq/WKPluginView.mm
@@ -19,8 +19,7 @@
NPSavedData saved;
[super initWithFrame: r];
- widget = w;
- isFlipped = YES;
+
instance = &instanceStruct;
stream = &streamStruct;
streamOffset = 0;
@@ -37,7 +36,7 @@
NPP_HandleEvent = [plugin NPP_HandleEvent];
[mime getCString:cMime];
- npErr = NPP_New(cMime, instance, NP_EMBED, 0, NULL, NULL, &saved);
+ npErr = NPP_New(cMime, instance, NP_EMBED, 0, NULL, NULL, &saved); //need to pass parameters to plug-in
KWQDebug("NPP_New: %d\n", npErr);
transferred = FALSE;
return self;
@@ -47,30 +46,35 @@
NPError npErr;
NPWindow window;
NP_Port nPort;
- // Point pt;
char cMime[200], cURL[800];
uint16 stype;
id <WCURICache> cache;
+ NSRect frame;
+
+ frame = [self frame];
nPort.port = [self qdPort];
nPort.portx = 0;
nPort.porty = 0;
-
window.window = &nPort;
- window.x = 20;
- window.y = 20;
- window.width = 640;
- window.height = 450;
- window.clipRect.top = 0;
- window.clipRect.left = 0;
- window.clipRect.bottom = 450;
- window.clipRect.right = 640;
+ 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
+ window.clipRect.left = (uint16)rect.origin.x;
+ window.clipRect.bottom = (uint16)rect.size.height;
+ window.clipRect.right = (uint16)rect.size.width;
window.type = NPWindowTypeDrawable;
- /*SetPort(nPort.port);
+
+ SetPort(nPort.port);
LineTo((int)rect.size.width, (int)rect.size.height);
- MoveTo(0,0);*/
+ MoveTo(0,0);
+
npErr = NPP_SetWindow(instance, &window);
- KWQDebug("NPP_SetWindow: %d rect.size.height=%d rect.size.width=%d port=%d\n", npErr, (int)rect.size.height, (int)rect.size.width, (int)nPort.port);
+ 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);
+ KWQDebug("bounds.size.height=%d bounds.size.width=%d bounds.origin.x=%f bounds.origin.y=%f\n\n", (int)bounds.size.height, (int)bounds.size.width, bounds.origin.x, bounds.origin.y);
if(!transferred){
[url getCString:cURL];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list