diff options
author | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 18:35:00 +0000 |
---|---|---|
committer | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 18:35:00 +0000 |
commit | 812f6a70e4900cb641b3a72292a019eb2a765bce (patch) | |
tree | 5aa4ac8928e5c82b3ff1827fda206b2bd64c7ab9 /webkit | |
parent | b47cd7dde56912663cef30acc674a2edd31dcb30 (diff) | |
download | chromium_src-812f6a70e4900cb641b3a72292a019eb2a765bce.zip chromium_src-812f6a70e4900cb641b3a72292a019eb2a765bce.tar.gz chromium_src-812f6a70e4900cb641b3a72292a019eb2a765bce.tar.bz2 |
WebKit Merge 41807:41827, Chromium side.
R=tony
I made a few changes to our test plugin to match changes to the upstream's plugin. It now uses console instead of printf. You are just the guy (apparently) to review this :)
Review URL: http://codereview.chromium.org/50020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
14 files changed, 347 insertions, 53 deletions
diff --git a/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/fast/dom/getBoundingClientRect-expected.txt b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/fast/dom/getBoundingClientRect-expected.txt new file mode 100644 index 0000000..847975c --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/fast/dom/getBoundingClientRect-expected.txt @@ -0,0 +1,217 @@ +Client bounding rect for #1
+testRect.top 44
+testRect.left 8
+testRect.width 300
+testRect.height 100
+testRect.bottom 144
+testRect.right 308
+
+FAIL testRect.top should be 42. Was 44.
+PASS testRect.left is 8
+PASS testRect.width is 300
+PASS testRect.height is 100
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #2
+testRect.top 196
+testRect.left 8
+testRect.width 320
+testRect.height 120
+testRect.bottom 316
+testRect.right 328
+
+FAIL testRect.top should be 192. Was 196.
+PASS testRect.left is 8
+PASS testRect.width is 320
+PASS testRect.height is 120
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #3
+testRect.top 368
+testRect.left 18
+testRect.width 300
+testRect.height 100
+testRect.bottom 468
+testRect.right 318
+
+FAIL testRect.top should be 362. Was 368.
+PASS testRect.left is 18
+PASS testRect.width is 300
+PASS testRect.height is 100
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #4
+testRect.top 499
+testRect.left 37
+testRect.width 142
+testRect.height 142
+testRect.bottom 641
+testRect.right 179
+
+FAIL testRect.top should be 491. Was 499.
+PASS testRect.left is 37
+PASS testRect.width is 142
+PASS testRect.height is 142
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #5
+testRect.top 672
+testRect.left 8
+testRect.width 300
+testRect.height 260
+testRect.bottom 932
+testRect.right 308
+
+FAIL testRect.top should be 662. Was 672.
+PASS testRect.left is 8
+PASS testRect.width is 300
+FAIL testRect.height should be 234. Was 260.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #6
+Known failure. Skipping.
+
+Client bounding rect for #7
+testRect.top 1296
+testRect.left 8
+testRect.width 295
+testRect.height 199
+testRect.bottom 1495
+testRect.right 303
+
+FAIL testRect.top should be 1230. Was 1296.
+PASS testRect.left is 8
+FAIL testRect.width should be 299. Was 295.
+FAIL testRect.height should be 180. Was 199.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #8
+testRect.top 1548
+testRect.left 8
+testRect.width 300
+testRect.height 50
+testRect.bottom 1598
+testRect.right 308
+
+FAIL testRect.top should be 1460. Was 1548.
+PASS testRect.left is 8
+PASS testRect.width is 300
+FAIL testRect.height should be 46. Was 50.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #9
+testRect.top 1650
+testRect.left 8
+testRect.width 300
+testRect.height 70
+testRect.bottom 1720
+testRect.right 308
+
+FAIL testRect.top should be 1556. Was 1650.
+PASS testRect.left is 8
+PASS testRect.width is 300
+FAIL testRect.height should be 64. Was 70.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #10
+testRect.top 1774
+testRect.left 8
+testRect.width 300
+testRect.height 22
+testRect.bottom 1796
+testRect.right 308
+
+FAIL testRect.top should be 1672. Was 1774.
+PASS testRect.left is 8
+PASS testRect.width is 300
+FAIL testRect.height should be 20. Was 22.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #11
+testRect.top 1876
+testRect.left 10
+testRect.width 147
+testRect.height 22
+testRect.bottom 1898
+testRect.right 157
+
+FAIL testRect.top should be 1768. Was 1876.
+PASS testRect.left is 10
+PASS testRect.width is 147
+FAIL testRect.height should be 20. Was 22.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #12
+testRect.top 1976
+testRect.left 8
+testRect.width 100
+testRect.height 100
+testRect.bottom 2076
+testRect.right 108
+
+FAIL testRect.top should be 1862. Was 1976.
+PASS testRect.left is 8
+PASS testRect.width is 100
+PASS testRect.height is 100
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #13
+testRect.top 2213
+testRect.left 8
+testRect.width 175
+testRect.height 19
+testRect.bottom 2232
+testRect.right 183
+
+FAIL testRect.top should be 2098. Was 2213.
+PASS testRect.left is 8
+FAIL testRect.width should be 180. Was 175.
+FAIL testRect.height should be 18. Was 19.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #14
+testRect.top 2285
+testRect.left 8
+testRect.width 300
+testRect.height 239
+testRect.bottom 2524
+testRect.right 308
+
+FAIL testRect.top should be 2166. Was 2285.
+PASS testRect.left is 8
+FAIL testRect.width should be 200. Was 300.
+FAIL testRect.height should be 236. Was 239.
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+Client bounding rect for #15
+testRect.top 2577
+testRect.left 8
+testRect.width 0
+testRect.height 0
+testRect.bottom 2577
+testRect.right 8
+
+FAIL testRect.top should be 2452. Was 2577.
+PASS testRect.left is 8
+PASS testRect.width is 0
+PASS testRect.height is 0
+PASS testRect.bottom is testRect.top + testRect.height
+PASS testRect.right is testRect.left + testRect.width
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/mouse-events-expected.txt b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/mouse-events-expected.txt new file mode 100644 index 0000000..7ddb010 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/mouse-events-expected.txt @@ -0,0 +1,12 @@ +CONSOLE MESSAGE: line 16: PLUGIN: adjustCursorEvent
+CONSOLE MESSAGE: line 16: PLUGIN: adjustCursorEvent
+CONSOLE MESSAGE: line 17: PLUGIN: getFocusEvent
+CONSOLE MESSAGE: line 17: PLUGIN: mouseDown at (20, 20)
+CONSOLE MESSAGE: line 18: PLUGIN: mouseUp at (20, 20)
+CONSOLE MESSAGE: line 19: PLUGIN: adjustCursorEvent
+CONSOLE MESSAGE: line 20: PLUGIN: mouseDown at (30, 30)
+CONSOLE MESSAGE: line 22: PLUGIN: adjustCursorEvent
+CONSOLE MESSAGE: line 22: PLUGIN: mouseUp at (40, 30)
+CONSOLE MESSAGE: line 23: PLUGIN: adjustCursorEvent
+
+Test for bug 11517: Flash clicks/interactivity not working properly.
diff --git a/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-destroy-plugin-script-objects-expected.txt b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-destroy-plugin-script-objects-expected.txt new file mode 100644 index 0000000..fa26ccb --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-destroy-plugin-script-objects-expected.txt @@ -0,0 +1,4 @@ +CONSOLE MESSAGE: line 13: PLUGIN: NPP_Destroy
+This tests that accessing plug-in script objects from a destroyed plugin cause throws the right exceptions.
+SUCCESS
+
diff --git a/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-setwindow-size-2-expected.txt b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-setwindow-size-2-expected.txt new file mode 100644 index 0000000..3317d36 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-setwindow-size-2-expected.txt @@ -0,0 +1,2 @@ +CONSOLE MESSAGE: line 1: PLUGIN: NPP_SetWindow: 200 200
+This tests that a hidden plug-in gets a correct NPP_SetWindow the first time.
diff --git a/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-setwindow-size-expected.txt b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-setwindow-size-expected.txt new file mode 100644 index 0000000..7f29014 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-setwindow-size-expected.txt @@ -0,0 +1,3 @@ +CONSOLE MESSAGE: line 1: PLUGIN: NPP_SetWindow: 800 200
+
+This tests that a plug-in with a percentage width gets a correct NPP_SetWindow the first time.
diff --git a/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/open-and-close-window-with-plugin-expected.txt b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/open-and-close-window-with-plugin-expected.txt new file mode 100644 index 0000000..da6b767 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/open-and-close-window-with-plugin-expected.txt @@ -0,0 +1,2 @@ +CONSOLE MESSAGE: line 1: PLUGIN: NPP_Destroy
+This tests that opening a window with a WebView that contains a plugin, and then closing the window without calling -[WebView close] does not leak the window or the web view.
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/dom/getBoundingClientRect-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/dom/getBoundingClientRect-expected.txt index ba97c47..847975c 100644 --- a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/dom/getBoundingClientRect-expected.txt +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/dom/getBoundingClientRect-expected.txt @@ -197,15 +197,15 @@ PASS testRect.bottom is testRect.top + testRect.height PASS testRect.right is testRect.left + testRect.width
Client bounding rect for #15
-testRect.top 0
-testRect.left 0
+testRect.top 2577
+testRect.left 8
testRect.width 0
testRect.height 0
-testRect.bottom 0
-testRect.right 0
+testRect.bottom 2577
+testRect.right 8
-FAIL testRect.top should be 2452. Was 0.
-FAIL testRect.left should be 8. Was 0.
+FAIL testRect.top should be 2452. Was 2577.
+PASS testRect.left is 8
PASS testRect.width is 0
PASS testRect.height is 0
PASS testRect.bottom is testRect.top + testRect.height
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/mouse-events-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/mouse-events-expected.txt index fcd99b9..b613020 100644 --- a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/mouse-events-expected.txt +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/mouse-events-expected.txt @@ -1,12 +1,12 @@ -PLUGIN: adjustCursorEvent -PLUGIN: adjustCursorEvent -PLUGIN: getFocusEvent -PLUGIN: mouseDown at (20, 20) -PLUGIN: mouseUp at (20, 20) -PLUGIN: adjustCursorEvent -PLUGIN: mouseDown at (30, 30) -PLUGIN: adjustCursorEvent -PLUGIN: mouseUp at (40, 30) -PLUGIN: adjustCursorEvent +CONSOLE MESSAGE: line 16: PLUGIN: adjustCursorEvent +CONSOLE MESSAGE: line 16: PLUGIN: adjustCursorEvent +CONSOLE MESSAGE: line 17: PLUGIN: getFocusEvent +CONSOLE MESSAGE: line 17: PLUGIN: mouseDown at (20, 20) +CONSOLE MESSAGE: line 18: PLUGIN: mouseUp at (20, 20) +CONSOLE MESSAGE: line 19: PLUGIN: adjustCursorEvent +CONSOLE MESSAGE: line 20: PLUGIN: mouseDown at (30, 30) +CONSOLE MESSAGE: line 22: PLUGIN: adjustCursorEvent +CONSOLE MESSAGE: line 22: PLUGIN: mouseUp at (40, 30) +CONSOLE MESSAGE: line 23: PLUGIN: adjustCursorEvent Test for bug 11517: Flash clicks/interactivity not working properly. diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-destroy-plugin-script-objects-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-destroy-plugin-script-objects-expected.txt new file mode 100644 index 0000000..fa26ccb --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-destroy-plugin-script-objects-expected.txt @@ -0,0 +1,4 @@ +CONSOLE MESSAGE: line 13: PLUGIN: NPP_Destroy
+This tests that accessing plug-in script objects from a destroyed plugin cause throws the right exceptions.
+SUCCESS
+
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-setwindow-size-2-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-setwindow-size-2-expected.txt new file mode 100644 index 0000000..3317d36 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-setwindow-size-2-expected.txt @@ -0,0 +1,2 @@ +CONSOLE MESSAGE: line 1: PLUGIN: NPP_SetWindow: 200 200
+This tests that a hidden plug-in gets a correct NPP_SetWindow the first time.
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-setwindow-size-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-setwindow-size-expected.txt new file mode 100644 index 0000000..7f29014 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-setwindow-size-expected.txt @@ -0,0 +1,3 @@ +CONSOLE MESSAGE: line 1: PLUGIN: NPP_SetWindow: 800 200
+
+This tests that a plug-in with a percentage width gets a correct NPP_SetWindow the first time.
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/open-and-close-window-with-plugin-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/open-and-close-window-with-plugin-expected.txt new file mode 100644 index 0000000..da6b767 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/open-and-close-window-with-plugin-expected.txt @@ -0,0 +1,2 @@ +CONSOLE MESSAGE: line 1: PLUGIN: NPP_Destroy
+This tests that opening a window with a WebView that contains a plugin, and then closing the window without calling -[WebView close] does not leak the window or the web view.
diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index df0e96a..4051e8b 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -1876,3 +1876,7 @@ MAC : LayoutTests/fast/text/international/bidi-AN-after-empty-run.html = FAIL MAC : LayoutTests/fast/text/international/bidi-CS-after-AN.html = FAIL MAC : LayoutTests/fast/text/international/bidi-neutral-run.html = FAIL LINUX : LayoutTests/fast/text/international/rtl-white-space-pre-wrap.html = FAIL + +// Merge 41807:41827 New Tests +LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html = TIMEOUT +LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-post.html = CRASH diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp index c18ee6a..fcd21fd 100644 --- a/webkit/tools/npapi_layout_test_plugin/main.cpp +++ b/webkit/tools/npapi_layout_test_plugin/main.cpp @@ -50,6 +50,46 @@ #define NPAPI #endif +static void log(NPP instance, const char* format, ...) +{ + va_list args; + va_start(args, format); + char message[2048] = "PLUGIN: "; + vsprintf(message + strlen(message), format, args); + va_end(args); + + NPObject* windowObject = 0; + NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject); + if (error != NPERR_NO_ERROR) { + fprintf(stderr, "Failed to retrieve window object while logging: %s\n", message); + return; + } + + NPVariant consoleVariant; + if (!browser->getproperty(instance, windowObject, browser->getstringidentifier("console"), &consoleVariant)) { + fprintf(stderr, "Failed to retrieve console object while logging: %s\n", message); + browser->releaseobject(windowObject); + return; + } + + NPObject* consoleObject = NPVARIANT_TO_OBJECT(consoleVariant); + + NPVariant messageVariant; + STRINGZ_TO_NPVARIANT(message, messageVariant); + + NPVariant result; + if (!browser->invoke(instance, consoleObject, browser->getstringidentifier("log"), &messageVariant, 1, &result)) { + fprintf(stderr, "Failed to invoke console.log while logging: %s\n", message); + browser->releaseobject(consoleObject); + browser->releaseobject(windowObject); + return; + } + + browser->releasevariantvalue(&result); + browser->releaseobject(consoleObject); + browser->releaseobject(windowObject); +} + // Mach-o entry points extern "C" { NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs); @@ -126,7 +166,7 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) free(obj->onStreamDestroy); if (obj->logDestroy) - printf("PLUGIN: NPP_Destroy\n"); + log(instance, "NPP_Destroy"); browser->releaseobject(&obj->header); } @@ -142,7 +182,7 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) if (obj) { if (obj->logSetWindow) { - printf("PLUGIN: NPP_SetWindow: %d %d\n", (int)window->width, (int)window->height); + log(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); fflush(stdout); obj->logSetWindow = false; } @@ -227,45 +267,45 @@ int16 NPP_HandleEvent(NPP instance, void *event) short y = static_cast<short>(evt->lParam >> 16); switch (evt->event) { case WM_PAINT: - printf("PLUGIN: updateEvt\n"); + log(instance, "updateEvt"); break; case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: - printf("PLUGIN: mouseDown at (%d, %d)\n", x, y); + log(instance, "mouseDown at (%d, %d)", x, y); break; case WM_LBUTTONUP: case WM_MBUTTONUP: case WM_RBUTTONUP: - printf("PLUGIN: mouseUp at (%d, %d)\n", x, y); + log(instance, "mouseUp at (%d, %d)", x, y); break; case WM_LBUTTONDBLCLK: case WM_MBUTTONDBLCLK: case WM_RBUTTONDBLCLK: break; case WM_MOUSEMOVE: - printf("PLUGIN: adjustCursorEvent\n"); + log(instance, "adjustCursorEvent"); break; case WM_KEYUP: // TODO(tc): We need to convert evt->wParam from virtual-key code // to key code. - printf("NOTIMPLEMENTED PLUGIN: keyUp '%c'\n", ' '); + log(instance, "NOTIMPLEMENTED: keyUp '%c'", ' '); break; case WM_KEYDOWN: // TODO(tc): We need to convert evt->wParam from virtual-key code // to key code. - printf("NOTIMPLEMENTED PLUGIN: keyDown '%c'\n", ' '); + log(instance, "NOTIMPLEMENTED: keyDown '%c'", ' '); break; case WM_SETCURSOR: break; case WM_SETFOCUS: - printf("PLUGIN: getFocusEvent\n"); + log(instance, "getFocusEvent"); break; case WM_KILLFOCUS: - printf("PLUGIN: loseFocusEvent\n"); + log(instance, "loseFocusEvent"); break; default: - printf("PLUGIN: event %d\n", evt->event); + log(instance, "event %d", evt->event); } fflush(stdout); @@ -277,36 +317,36 @@ int16 NPP_HandleEvent(NPP instance, void *event) XButtonReleasedEvent* brelease_evt = reinterpret_cast<XButtonReleasedEvent*>(evt); switch (evt->type) { case ButtonPress: - printf("PLUGIN: mouseDown at (%d, %d)\n", bpress_evt->x, bpress_evt->y); + log(instance, "mouseDown at (%d, %d)", bpress_evt->x, bpress_evt->y); break; case ButtonRelease: - printf("PLUGIN: mouseUp at (%d, %d)\n", brelease_evt->x, brelease_evt->y); + log(instance, "mouseUp at (%d, %d)", brelease_evt->x, brelease_evt->y); break; case KeyPress: // TODO: extract key code - printf("NOTIMPLEMENTED PLUGIN: keyDown '%c'\n", ' '); + log(instance, "NOTIMPLEMENTED: keyDown '%c'", ' '); break; case KeyRelease: // TODO: extract key code - printf("NOTIMPLEMENTED PLUGIN: keyUp '%c'\n", ' '); + log(instance, "NOTIMPLEMENTED: keyUp '%c'", ' '); break; case GraphicsExpose: - printf("PLUGIN: updateEvt\n"); + log(instance, "updateEvt"); break; // NPAPI events case FocusIn: - printf("PLUGIN: getFocusEvent\n"); + log(instance, "getFocusEvent"); break; case FocusOut: - printf("PLUGIN: loseFocusEvent\n"); + log(instance, "loseFocusEvent"); break; case EnterNotify: case LeaveNotify: case MotionNotify: - printf("PLUGIN: adjustCursorEvent\n"); + log(instance, "adjustCursorEvent"); break; default: - printf("PLUGIN: event %d\n", evt->type); + log(instance, "event %d", evt->type); } fflush(stdout); @@ -321,58 +361,57 @@ int16 NPP_HandleEvent(NPP instance, void *event) break; case mouseDown: GlobalToLocal(&pt); - printf("PLUGIN: mouseDown at (%d, %d)\n", pt.h, pt.v); + log(instance, "mouseDown at (%d, %d)", pt.h, pt.v); break; case mouseUp: GlobalToLocal(&pt); - printf("PLUGIN: mouseUp at (%d, %d)\n", pt.h, pt.v); + log(instance, "mouseUp at (%d, %d)", pt.h, pt.v); break; case keyDown: - printf("PLUGIN: keyDown '%c'\n", (char)(evt->message & 0xFF)); + log(instance, "keyDown '%c'", (char)(evt->message & 0xFF)); break; case keyUp: - printf("PLUGIN: keyUp '%c'\n", (char)(evt->message & 0xFF)); + log(instance, "keyUp '%c'", (char)(evt->message & 0xFF)); break; case autoKey: - printf("PLUGIN: autoKey '%c'\n", (char)(evt->message & 0xFF)); + log(instance, "autoKey '%c'", (char)(evt->message & 0xFF)); break; case updateEvt: - printf("PLUGIN: updateEvt\n"); + log(instance, "updateEvt"); break; case diskEvt: - printf("PLUGIN: diskEvt\n"); + log(instance, "diskEvt"); break; case activateEvt: - printf("PLUGIN: activateEvt\n"); + log(instance, "activateEvt"); break; case osEvt: - printf("PLUGIN: osEvt - "); switch ((evt->message & 0xFF000000) >> 24) { case suspendResumeMessage: - printf("%s\n", (evt->message & 0x1) ? "resume" : "suspend"); + log(instance, "osEvt - %s", (evt->message & 0x1) ? "resume" : "suspend"); break; case mouseMovedMessage: - printf("mouseMoved\n"); + log(instance, "osEvt - mouseMoved"); break; default: - printf("%08lX\n", evt->message); + log(instance, "osEvt - %08lX", evt->message); } break; case kHighLevelEvent: - printf("PLUGIN: kHighLevelEvent\n"); + log(instance, "kHighLevelEvent"); break; // NPAPI events case getFocusEvent: - printf("PLUGIN: getFocusEvent\n"); + log(instance, "getFocusEvent"); break; case loseFocusEvent: - printf("PLUGIN: loseFocusEvent\n"); + log(instance, "loseFocusEvent"); break; case adjustCursorEvent: - printf("PLUGIN: adjustCursorEvent\n"); + log(instance, "adjustCursorEvent"); break; default: - printf("PLUGIN: event %d\n", evt->what); + log(instance, "event %d", evt->what); } #endif |