diff options
author | trembovetski <[email protected]> | 2009-08-14 18:04:15 -0700 |
---|---|---|
committer | trembovetski <[email protected]> | 2009-08-14 18:04:15 -0700 |
commit | 176554545f88725a8dba5fdaa95ff1f1e48cdef5 (patch) | |
tree | cedadfb5855cac915c2673260390c4a034f9dab9 /src/newt/native | |
parent | af51e1b06228c44adbb40eff1529eda7a6e9e408 (diff) |
newt: added expose/paint event notification needed for passive rendering. Currently only implemented on Windows.
Diffstat (limited to 'src/newt/native')
-rwxr-xr-x | src/newt/native/WindowsWindow.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c index 67fbd3f07..5bd929ef7 100755 --- a/src/newt/native/WindowsWindow.c +++ b/src/newt/native/WindowsWindow.c @@ -103,6 +103,7 @@ static jmethodID windowDestroyNotifyID = NULL; static jmethodID windowDestroyedID = NULL; static jmethodID sendMouseEventID = NULL; static jmethodID sendKeyEventID = NULL; +static jmethodID sendPaintEventID = NULL; typedef struct { JNIEnv* jenv; @@ -761,6 +762,20 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, useDefWindowProc = 1; break; + case WM_PAINT: { + RECT r; + if (GetUpdateRect(wnd, &r, FALSE)) { + if ((r.right-r.left) > 0 && (r.bottom-r.top) > 0) { + (*env)->CallVoidMethod(env, window, sendPaintEventID, + 0, r.left, r.top, r.right-r.left, r.bottom-r.top); + } + ValidateRect(wnd, &r); + useDefWindowProc = 0; + } else { + useDefWindowProc = 1; + } + break; + } case WM_ERASEBKGND: // ignore erase background useDefWindowProc = 0; @@ -902,13 +917,16 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_initID windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V"); sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V"); sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V"); + sendPaintEventID = (*env)->GetMethodID(env, clazz, "sendPaintEvent", "(IIIII)V"); if (sizeChangedID == NULL || positionChangedID == NULL || focusChangedID == NULL || windowDestroyNotifyID == NULL || windowDestroyedID == NULL || sendMouseEventID == NULL || - sendKeyEventID == NULL) { + sendPaintEventID == NULL || + sendKeyEventID == NULL) + { return JNI_FALSE; } BuildDynamicKeyMapTable(); |