Committed at the owner's request while the work continues. - Detect unchanged GTK painter surfaces by exact byte comparison, clear and copy them in bulk, and reuse resolved GTK style metrics and CSS layers within a style generation. - Present desktop frames before publishing accessibility changes. - Context menu widget, keyboard and canvas input updates with tests.
116 lines
3.7 KiB
Ziran
116 lines
3.7 KiB
Ziran
#import, file "ziran_context_menu_widget_host.zi";
|
|
#import, file "system_clipboard_host.zi";
|
|
// Host stubs for the Android device behavior test: the renderer JNI surface
|
|
// stays absent and the platform keyboard effect records calls instead of
|
|
// reaching Java.
|
|
#import "android_jni"
|
|
#import "android_surface"
|
|
#import "android_native"
|
|
#import "session"
|
|
#import "byte_text_linux"
|
|
|
|
keyboard_calls: s32;
|
|
keyboard_visible: bool;
|
|
|
|
#program_export
|
|
SetPlatformTextKeyboardVisible :: (session: Session, visible: bool) {
|
|
unused session
|
|
keyboard_calls += 1
|
|
keyboard_visible = visible
|
|
}
|
|
|
|
activity_finish_calls: s32;
|
|
|
|
#program_export
|
|
ANativeActivity_finish :: (activity: *void) {
|
|
unused activity
|
|
activity_finish_calls += 1
|
|
}
|
|
|
|
#program_export
|
|
ANativeWindow_getFormat :: (window: *void) -> s32 {
|
|
unused window
|
|
return 1
|
|
}
|
|
|
|
#program_export
|
|
ANativeWindow_setBuffersGeometry :: (window: *void, width: s32,
|
|
height: s32, format: s32) -> s32 {
|
|
unused window
|
|
unused width
|
|
unused height
|
|
unused format
|
|
return 0
|
|
}
|
|
|
|
#program_export
|
|
ANativeWindow_getWidth :: (window: *void) -> s32 {
|
|
unused window
|
|
return 1080
|
|
}
|
|
|
|
#program_export
|
|
ANativeWindow_getHeight :: (window: *void) -> s32 {
|
|
unused window
|
|
return 1920
|
|
}
|
|
|
|
// A minimal Java VM records orientation requests and exception cleanup.
|
|
orientation_vm_ready: bool;
|
|
orientation_api: JniFunctions;
|
|
orientation_vm_api: JniVmFunctions;
|
|
orientation_env: JniEnv;
|
|
orientation_vm: JniVm;
|
|
orientation_activity: NativeActivity;
|
|
orientation_app: NativeAndroidApp;
|
|
orientation_calls: s32;
|
|
orientation_value: s32;
|
|
orientation_frames: s32;
|
|
orientation_throws: bool;
|
|
orientation_exception: u8;
|
|
orientation_method_valid: bool;
|
|
|
|
OrientationGetEnv :: (vm: *JniVm, output: **JniEnv, version: s32) -> s32 {
|
|
output[0] = *orientation_env
|
|
return 0
|
|
}
|
|
OrientationPush :: (env: *JniEnv, capacity: s32) -> s32 { orientation_frames += 1; return 0 }
|
|
OrientationPop :: (env: *JniEnv, result: *void) -> *void { orientation_frames -= 1; return result }
|
|
OrientationException :: (env: *JniEnv) -> u8 { return orientation_exception }
|
|
OrientationClear :: (env: *JniEnv) { orientation_exception = 0 }
|
|
OrientationDescribe :: (env: *JniEnv) {}
|
|
OrientationClass :: (env: *JniEnv, object: *void) -> *void { return object }
|
|
OrientationMethod :: (env: *JniEnv, klass: *void, name: *u8, signature: *u8) -> *void {
|
|
orientation_method_valid = TextFromCString(name) == "requestOrientation" && TextFromCString(signature) == "(I)V"
|
|
return klass
|
|
}
|
|
OrientationCall :: (env: *JniEnv, object: *void, method: *void, arguments: *JniValue) {
|
|
orientation_calls += 1
|
|
orientation_value = arguments[0].integer
|
|
if orientation_throws { orientation_exception = 1 }
|
|
}
|
|
OrientationVmOpen :: () {
|
|
orientation_env.functions = *orientation_api
|
|
orientation_vm.functions = *orientation_vm_api
|
|
orientation_activity.vm = *orientation_vm
|
|
orientation_activity.activity = cast(*void)*orientation_activity
|
|
orientation_app.activity = *orientation_activity
|
|
jni_android_app = *orientation_app
|
|
orientation_vm_api.GetEnv = OrientationGetEnv
|
|
orientation_api.PushLocalFrame = OrientationPush
|
|
orientation_api.PopLocalFrame = OrientationPop
|
|
orientation_api.ExceptionCheck = OrientationException
|
|
orientation_api.ExceptionClear = OrientationClear
|
|
orientation_api.ExceptionDescribe = OrientationDescribe
|
|
orientation_api.GetObjectClass = OrientationClass
|
|
orientation_api.GetMethodID = OrientationMethod
|
|
orientation_api.CallVoidMethodA = OrientationCall
|
|
orientation_vm_ready = true
|
|
}
|
|
|
|
device_surface_app: NativeAndroidApp;
|
|
DeviceSurfaceOpen :: () {
|
|
device_surface_app.window = cast(*void)(*device_surface_app)
|
|
android_native_app = *device_surface_app
|
|
}
|