diff options
author | Sven Gothel <[email protected]> | 2023-01-31 04:49:43 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-01-31 04:49:43 +0100 |
commit | cfc35549810d3a0fb5eeb866c9450417e48cd8a1 (patch) | |
tree | a6a513d134c9a4157d7fc3f47f1ecfda45d27f1c /src/newt/native/IOSNewtUIWindow.m | |
parent | ef206c881a9fd462e52241fac506bee5441902ad (diff) |
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.
Diffstat (limited to 'src/newt/native/IOSNewtUIWindow.m')
-rw-r--r-- | src/newt/native/IOSNewtUIWindow.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newt/native/IOSNewtUIWindow.m b/src/newt/native/IOSNewtUIWindow.m index 1900882d7..6e3e362a7 100644 --- a/src/newt/native/IOSNewtUIWindow.m +++ b/src/newt/native/IOSNewtUIWindow.m @@ -219,7 +219,7 @@ static jmethodID windowRepaintID = NULL; CGRect viewFrame = [self frame]; - (*env)->CallVoidMethod(env, javaWindowObject, windowRepaintID, JNI_TRUE, // defer .. + (*env)->CallVoidMethod(env, javaWindowObject, windowRepaintID, JNI_TRUE /* defer */, (int)dirtyRect.origin.x, (int)viewFrame.size.height - (int)dirtyRect.origin.y, (int)dirtyRect.size.width, (int)dirtyRect.size.height); @@ -441,10 +441,10 @@ static jmethodID windowRepaintID = NULL; + (BOOL) initNatives: (JNIEnv*) env forClass: (jclass) clazz { sendTouchScreenEventID = (*env)->GetMethodID(env, clazz, "sendTouchScreenEvent", "(SI[I[S[I[I[I[FF)V"); - sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(ZIIZ)V"); + sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(ZZIIZ)Z"); updatePixelScaleID = (*env)->GetMethodID(env, clazz, "updatePixelScale", "(ZFFFZ)V"); visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(Z)V"); - insetsChangedID = (*env)->GetMethodID(env, clazz, "insetsChanged", "(IIII)V"); + insetsChangedID = (*env)->GetMethodID(env, clazz, "insetsChanged", "(ZIIII)V"); sizeScreenPosInsetsChangedID = (*env)->GetMethodID(env, clazz, "sizeScreenPosInsetsChanged", "(ZIIIIIIIIZZ)V"); screenPositionChangedID = (*env)->GetMethodID(env, clazz, "screenPositionChanged", "(ZII)V"); focusChangedID = (*env)->GetMethodID(env, clazz, "focusChanged", "(ZZ)V"); @@ -691,7 +691,7 @@ static jmethodID windowRepaintID = NULL; DBG_PRINT( "updateInsets: [ l %d, r %d, t %d, b %d ]\n", cachedInsets[0], cachedInsets[1], cachedInsets[2], cachedInsets[3]); if( NULL != env && NULL != javaWin ) { - (*env)->CallVoidMethod(env, javaWin, insetsChangedID, cachedInsets[0], cachedInsets[1], cachedInsets[2], cachedInsets[3]); + (*env)->CallVoidMethod(env, javaWin, insetsChangedID, JNI_FALSE, cachedInsets[0], cachedInsets[1], cachedInsets[2], cachedInsets[3]); } } |