From cfc35549810d3a0fb5eeb866c9450417e48cd8a1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 31 Jan 2023 04:49:43 +0100 Subject: NEWT Soft-PixelScale (p1): WindowImpl: Separate window and pixel units for size and position via atomic-replacable int arrays NEWT's Soft-PixelScale supports software pixel-scale by multiplying the underlying surface pixel-size with the scale-factor and dividing the window position and size by same scale-factor. Hence the window position and size space is kept virtually steady at virtually assumed DPI 96 at higher actual screen DPI and the surface size is adjusted. +++ This window- and pixel-unit separation also includes all callbacks for the native driver implementations, hence the changes native code - allowing to determine whether window- or pixel-units were given. --- src/newt/native/bcm_vc_iv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/newt/native/bcm_vc_iv.c') diff --git a/src/newt/native/bcm_vc_iv.c b/src/newt/native/bcm_vc_iv.c index 9e6a41a1d..03a52c787 100644 --- a/src/newt/native/bcm_vc_iv.c +++ b/src/newt/native/bcm_vc_iv.c @@ -330,8 +330,8 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_bcm_vc_iv_ScreenDriver_initNative JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_bcm_vc_iv_WindowDriver_initIDs (JNIEnv *env, jclass clazz) { - sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(ZIIZ)V"); - positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(ZII)V"); + sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(ZZIIZ)Z"); + positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(ZZII)Z"); visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(Z)V"); windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "(Z)Z"); if (sizeChangedID == NULL || @@ -450,10 +450,10 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_bcm_vc_iv_WindowDriver_reconfigur bcm_moveTo( p->handle, p->layer, p->x, p->y, p->width, p->height); if( posChanged ) { - (*env)->CallVoidMethod(env, obj, positionChangedID, JNI_FALSE, x, y); + (*env)->CallBooleanMethod(env, obj, positionChangedID, JNI_FALSE, JNI_FALSE, x, y); } if( sizeChanged ) { - (*env)->CallVoidMethod(env, obj, sizeChangedID, JNI_FALSE, width, height, JNI_FALSE); + (*env)->CallBooleanMethod(env, obj, sizeChangedID, JNI_FALSE, JNI_FALSE, width, height, JNI_FALSE); } } -- cgit v1.2.3