michael@0: // GENERATED CODE michael@0: // Generated by the Java program at /build/annotationProcessors at compile time from michael@0: // annotations on Java methods. To update, change the annotations on the corresponding Java michael@0: // methods and rerun the build. Manually updating this file will cause your build to fail. michael@0: michael@0: #include "GeneratedJNIWrappers.h" michael@0: #include "AndroidBridgeUtilities.h" michael@0: #include "nsXPCOMStrings.h" michael@0: #include "AndroidBridge.h" michael@0: michael@0: namespace mozilla { michael@0: namespace widget { michael@0: namespace android { michael@0: jclass GeckoAppShell::mGeckoAppShellClass = 0; michael@0: jmethodID GeckoAppShell::jAcknowledgeEvent = 0; michael@0: jmethodID GeckoAppShell::jAddPluginViewWrapper = 0; michael@0: jmethodID GeckoAppShell::jAlertsProgressListener_OnProgress = 0; michael@0: jmethodID GeckoAppShell::jCancelVibrate = 0; michael@0: jmethodID GeckoAppShell::jCheckURIVisited = 0; michael@0: jmethodID GeckoAppShell::jClearMessageList = 0; michael@0: jmethodID GeckoAppShell::jCloseCamera = 0; michael@0: jmethodID GeckoAppShell::jCloseNotification = 0; michael@0: jmethodID GeckoAppShell::jCreateMessageListWrapper = 0; michael@0: jmethodID GeckoAppShell::jCreateShortcut = 0; michael@0: jmethodID GeckoAppShell::jDeleteMessageWrapper = 0; michael@0: jmethodID GeckoAppShell::jDisableBatteryNotifications = 0; michael@0: jmethodID GeckoAppShell::jDisableNetworkNotifications = 0; michael@0: jmethodID GeckoAppShell::jDisableScreenOrientationNotifications = 0; michael@0: jmethodID GeckoAppShell::jDisableSensor = 0; michael@0: jmethodID GeckoAppShell::jEnableBatteryNotifications = 0; michael@0: jmethodID GeckoAppShell::jEnableLocation = 0; michael@0: jmethodID GeckoAppShell::jEnableLocationHighAccuracy = 0; michael@0: jmethodID GeckoAppShell::jEnableNetworkNotifications = 0; michael@0: jmethodID GeckoAppShell::jEnableScreenOrientationNotifications = 0; michael@0: jmethodID GeckoAppShell::jEnableSensor = 0; michael@0: jmethodID GeckoAppShell::jGetContext = 0; michael@0: jmethodID GeckoAppShell::jGetCurrentBatteryInformationWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetCurrentNetworkInformationWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetDensity = 0; michael@0: jmethodID GeckoAppShell::jGetDpiWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetExtensionFromMimeTypeWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetHandlersForMimeTypeWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetHandlersForURLWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetIconForExtensionWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetMessageWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetMimeTypeFromExtensionsWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetNextMessageInListWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetProxyForURIWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetScreenDepthWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetScreenOrientationWrapper = 0; michael@0: jmethodID GeckoAppShell::jGetShowPasswordSetting = 0; michael@0: jmethodID GeckoAppShell::jGetSystemColoursWrapper = 0; michael@0: jmethodID GeckoAppShell::jHandleGeckoMessageWrapper = 0; michael@0: jmethodID GeckoAppShell::jHandleUncaughtException = 0; michael@0: jmethodID GeckoAppShell::jHideProgressDialog = 0; michael@0: jmethodID GeckoAppShell::jInitCameraWrapper = 0; michael@0: jmethodID GeckoAppShell::jIsNetworkLinkKnown = 0; michael@0: jmethodID GeckoAppShell::jIsNetworkLinkUp = 0; michael@0: jmethodID GeckoAppShell::jIsTablet = 0; michael@0: jmethodID GeckoAppShell::jKillAnyZombies = 0; michael@0: jmethodID GeckoAppShell::jLoadPluginClass = 0; michael@0: jmethodID GeckoAppShell::jLockScreenOrientation = 0; michael@0: jmethodID GeckoAppShell::jMarkURIVisited = 0; michael@0: jmethodID GeckoAppShell::jMoveTaskToBack = 0; michael@0: jmethodID GeckoAppShell::jNetworkLinkType = 0; michael@0: jmethodID GeckoAppShell::jNotifyDefaultPrevented = 0; michael@0: jmethodID GeckoAppShell::jNotifyIME = 0; michael@0: jmethodID GeckoAppShell::jNotifyIMEChange = 0; michael@0: jmethodID GeckoAppShell::jNotifyIMEContext = 0; michael@0: jmethodID GeckoAppShell::jNotifyWakeLockChanged = 0; michael@0: jmethodID GeckoAppShell::jNotifyXreExit = 0; michael@0: jmethodID GeckoAppShell::jOpenUriExternal = 0; michael@0: jmethodID GeckoAppShell::jPerformHapticFeedback = 0; michael@0: jmethodID GeckoAppShell::jPumpMessageLoop = 0; michael@0: jmethodID GeckoAppShell::jRegisterSurfaceTextureFrameListener = 0; michael@0: jmethodID GeckoAppShell::jRemovePluginView = 0; michael@0: jmethodID GeckoAppShell::jScanMedia = 0; michael@0: jmethodID GeckoAppShell::jScheduleRestart = 0; michael@0: jmethodID GeckoAppShell::jSendMessageWrapper = 0; michael@0: jmethodID GeckoAppShell::jSetFullScreen = 0; michael@0: jmethodID GeckoAppShell::jSetKeepScreenOn = 0; michael@0: jmethodID GeckoAppShell::jSetURITitle = 0; michael@0: jmethodID GeckoAppShell::jShowAlertNotificationWrapper = 0; michael@0: jmethodID GeckoAppShell::jShowInputMethodPicker = 0; michael@0: jmethodID GeckoAppShell::jUnlockProfile = 0; michael@0: jmethodID GeckoAppShell::jUnlockScreenOrientation = 0; michael@0: jmethodID GeckoAppShell::jUnregisterSurfaceTextureFrameListener = 0; michael@0: jmethodID GeckoAppShell::jVibrate1 = 0; michael@0: jmethodID GeckoAppShell::jVibrateA = 0; michael@0: void GeckoAppShell::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mGeckoAppShellClass = getClassGlobalRef("org/mozilla/gecko/GeckoAppShell"); michael@0: jAcknowledgeEvent = getStaticMethod("acknowledgeEvent", "()V"); michael@0: jAddPluginViewWrapper = getStaticMethod("addPluginView", "(Landroid/view/View;FFFFZ)V"); michael@0: jAlertsProgressListener_OnProgress = getStaticMethod("alertsProgressListener_OnProgress", "(Ljava/lang/String;JJLjava/lang/String;)V"); michael@0: jCancelVibrate = getStaticMethod("cancelVibrate", "()V"); michael@0: jCheckURIVisited = getStaticMethod("checkUriVisited", "(Ljava/lang/String;)V"); michael@0: jClearMessageList = getStaticMethod("clearMessageList", "(I)V"); michael@0: jCloseCamera = getStaticMethod("closeCamera", "()V"); michael@0: jCloseNotification = getStaticMethod("closeNotification", "(Ljava/lang/String;)V"); michael@0: jCreateMessageListWrapper = getStaticMethod("createMessageList", "(JJ[Ljava/lang/String;IIZI)V"); michael@0: jCreateShortcut = getStaticMethod("createShortcut", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); michael@0: jDeleteMessageWrapper = getStaticMethod("deleteMessage", "(II)V"); michael@0: jDisableBatteryNotifications = getStaticMethod("disableBatteryNotifications", "()V"); michael@0: jDisableNetworkNotifications = getStaticMethod("disableNetworkNotifications", "()V"); michael@0: jDisableScreenOrientationNotifications = getStaticMethod("disableScreenOrientationNotifications", "()V"); michael@0: jDisableSensor = getStaticMethod("disableSensor", "(I)V"); michael@0: jEnableBatteryNotifications = getStaticMethod("enableBatteryNotifications", "()V"); michael@0: jEnableLocation = getStaticMethod("enableLocation", "(Z)V"); michael@0: jEnableLocationHighAccuracy = getStaticMethod("enableLocationHighAccuracy", "(Z)V"); michael@0: jEnableNetworkNotifications = getStaticMethod("enableNetworkNotifications", "()V"); michael@0: jEnableScreenOrientationNotifications = getStaticMethod("enableScreenOrientationNotifications", "()V"); michael@0: jEnableSensor = getStaticMethod("enableSensor", "(I)V"); michael@0: jGetContext = getStaticMethod("getContext", "()Landroid/content/Context;"); michael@0: jGetCurrentBatteryInformationWrapper = getStaticMethod("getCurrentBatteryInformation", "()[D"); michael@0: jGetCurrentNetworkInformationWrapper = getStaticMethod("getCurrentNetworkInformation", "()[D"); michael@0: jGetDensity = getStaticMethod("getDensity", "()F"); michael@0: jGetDpiWrapper = getStaticMethod("getDpi", "()I"); michael@0: jGetExtensionFromMimeTypeWrapper = getStaticMethod("getExtensionFromMimeType", "(Ljava/lang/String;)Ljava/lang/String;"); michael@0: jGetHandlersForMimeTypeWrapper = getStaticMethod("getHandlersForMimeType", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;"); michael@0: jGetHandlersForURLWrapper = getStaticMethod("getHandlersForURL", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;"); michael@0: jGetIconForExtensionWrapper = getStaticMethod("getIconForExtension", "(Ljava/lang/String;I)[B"); michael@0: jGetMessageWrapper = getStaticMethod("getMessage", "(II)V"); michael@0: jGetMimeTypeFromExtensionsWrapper = getStaticMethod("getMimeTypeFromExtensions", "(Ljava/lang/String;)Ljava/lang/String;"); michael@0: jGetNextMessageInListWrapper = getStaticMethod("getNextMessageInList", "(II)V"); michael@0: jGetProxyForURIWrapper = getStaticMethod("getProxyForURI", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;"); michael@0: jGetScreenDepthWrapper = getStaticMethod("getScreenDepth", "()I"); michael@0: jGetScreenOrientationWrapper = getStaticMethod("getScreenOrientation", "()S"); michael@0: jGetShowPasswordSetting = getStaticMethod("getShowPasswordSetting", "()Z"); michael@0: jGetSystemColoursWrapper = getStaticMethod("getSystemColors", "()[I"); michael@0: jHandleGeckoMessageWrapper = getStaticMethod("handleGeckoMessage", "(Lorg/mozilla/gecko/util/NativeJSContainer;)V"); michael@0: jHandleUncaughtException = getStaticMethod("handleUncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V"); michael@0: jHideProgressDialog = getStaticMethod("hideProgressDialog", "()V"); michael@0: jInitCameraWrapper = getStaticMethod("initCamera", "(Ljava/lang/String;III)[I"); michael@0: jIsNetworkLinkKnown = getStaticMethod("isNetworkLinkKnown", "()Z"); michael@0: jIsNetworkLinkUp = getStaticMethod("isNetworkLinkUp", "()Z"); michael@0: jIsTablet = getStaticMethod("isTablet", "()Z"); michael@0: jKillAnyZombies = getStaticMethod("killAnyZombies", "()V"); michael@0: jLoadPluginClass = getStaticMethod("loadPluginClass", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class;"); michael@0: jLockScreenOrientation = getStaticMethod("lockScreenOrientation", "(I)V"); michael@0: jMarkURIVisited = getStaticMethod("markUriVisited", "(Ljava/lang/String;)V"); michael@0: jMoveTaskToBack = getStaticMethod("moveTaskToBack", "()V"); michael@0: jNetworkLinkType = getStaticMethod("networkLinkType", "()I"); michael@0: jNotifyDefaultPrevented = getStaticMethod("notifyDefaultPrevented", "(Z)V"); michael@0: jNotifyIME = getStaticMethod("notifyIME", "(I)V"); michael@0: jNotifyIMEChange = getStaticMethod("notifyIMEChange", "(Ljava/lang/String;III)V"); michael@0: jNotifyIMEContext = getStaticMethod("notifyIMEContext", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); michael@0: jNotifyWakeLockChanged = getStaticMethod("notifyWakeLockChanged", "(Ljava/lang/String;Ljava/lang/String;)V"); michael@0: jNotifyXreExit = getStaticMethod("onXreExit", "()V"); michael@0: jOpenUriExternal = getStaticMethod("openUriExternal", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z"); michael@0: jPerformHapticFeedback = getStaticMethod("performHapticFeedback", "(Z)V"); michael@0: jPumpMessageLoop = getStaticMethod("pumpMessageLoop", "()Z"); michael@0: jRegisterSurfaceTextureFrameListener = getStaticMethod("registerSurfaceTextureFrameListener", "(Ljava/lang/Object;I)V"); michael@0: jRemovePluginView = getStaticMethod("removePluginView", "(Landroid/view/View;Z)V"); michael@0: jScanMedia = getStaticMethod("scanMedia", "(Ljava/lang/String;Ljava/lang/String;)V"); michael@0: jScheduleRestart = getStaticMethod("scheduleRestart", "()V"); michael@0: jSendMessageWrapper = getStaticMethod("sendMessage", "(Ljava/lang/String;Ljava/lang/String;I)V"); michael@0: jSetFullScreen = getStaticMethod("setFullScreen", "(Z)V"); michael@0: jSetKeepScreenOn = getStaticMethod("setKeepScreenOn", "(Z)V"); michael@0: jSetURITitle = getStaticMethod("setUriTitle", "(Ljava/lang/String;Ljava/lang/String;)V"); michael@0: jShowAlertNotificationWrapper = getStaticMethod("showAlertNotification", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); michael@0: jShowInputMethodPicker = getStaticMethod("showInputMethodPicker", "()V"); michael@0: jUnlockProfile = getStaticMethod("unlockProfile", "()Z"); michael@0: jUnlockScreenOrientation = getStaticMethod("unlockScreenOrientation", "()V"); michael@0: jUnregisterSurfaceTextureFrameListener = getStaticMethod("unregisterSurfaceTextureFrameListener", "(Ljava/lang/Object;)V"); michael@0: jVibrate1 = getStaticMethod("vibrate", "(J)V"); michael@0: jVibrateA = getStaticMethod("vibrate", "([JI)V"); michael@0: } michael@0: michael@0: GeckoAppShell* GeckoAppShell::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: GeckoAppShell* ret = new GeckoAppShell(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoAppShell::AcknowledgeEvent() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jAcknowledgeEvent); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::AddPluginViewWrapper(jobject a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, bool a5) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[6]; michael@0: args[0].l = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: args[4].f = a4; michael@0: args[5].z = a5; michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jAddPluginViewWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::AlertsProgressListener_OnProgress(const nsAString& a0, int64_t a1, int64_t a2, const nsAString& a3) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].j = a1; michael@0: args[2].j = a2; michael@0: args[3].l = AndroidBridge::NewJavaString(env, a3); michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jAlertsProgressListener_OnProgress, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::CancelVibrate() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jCancelVibrate); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::CheckURIVisited(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jCheckURIVisited, j0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::ClearMessageList(int32_t a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jClearMessageList, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::CloseCamera() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseCamera); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::CloseNotification(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseNotification, j0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::CreateMessageListWrapper(int64_t a0, int64_t a1, jobjectArray a2, int32_t a3, int32_t a4, bool a5, int32_t a6) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[7]; michael@0: args[0].j = a0; michael@0: args[1].j = a1; michael@0: args[2].l = a2; michael@0: args[3].i = a3; michael@0: args[4].i = a4; michael@0: args[5].z = a5; michael@0: args[6].i = a6; michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateMessageListWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::CreateShortcut(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(4) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].l = AndroidBridge::NewJavaString(env, a1); michael@0: args[2].l = AndroidBridge::NewJavaString(env, a2); michael@0: args[3].l = AndroidBridge::NewJavaString(env, a3); michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateShortcut, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::DeleteMessageWrapper(int32_t a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jDeleteMessageWrapper, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::DisableBatteryNotifications() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableBatteryNotifications); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::DisableNetworkNotifications() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableNetworkNotifications); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::DisableScreenOrientationNotifications() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableScreenOrientationNotifications); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::DisableSensor(int32_t a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableSensor, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::EnableBatteryNotifications() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableBatteryNotifications); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::EnableLocation(bool a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocation, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::EnableLocationHighAccuracy(bool a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocationHighAccuracy, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::EnableNetworkNotifications() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableNetworkNotifications); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::EnableScreenOrientationNotifications() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableScreenOrientationNotifications); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::EnableSensor(int32_t a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableSensor, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jobject GeckoAppShell::GetContext() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetContext); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jdoubleArray GeckoAppShell::GetCurrentBatteryInformationWrapper() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentBatteryInformationWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jdoubleArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jdoubleArray GeckoAppShell::GetCurrentNetworkInformationWrapper() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentNetworkInformationWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jdoubleArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jfloat GeckoAppShell::GetDensity() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jfloat temp = env->CallStaticFloatMethod(mGeckoAppShellClass, jGetDensity); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: int32_t GeckoAppShell::GetDpiWrapper() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetDpiWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: jstring GeckoAppShell::GetExtensionFromMimeTypeWrapper(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetExtensionFromMimeTypeWrapper, j0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jstring ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jobjectArray GeckoAppShell::GetHandlersForMimeTypeWrapper(const nsAString& a0, const nsAString& a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(3) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: jstring j1 = AndroidBridge::NewJavaString(env, a1); michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForMimeTypeWrapper, j0, j1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobjectArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jobjectArray GeckoAppShell::GetHandlersForURLWrapper(const nsAString& a0, const nsAString& a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(3) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: jstring j1 = AndroidBridge::NewJavaString(env, a1); michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForURLWrapper, j0, j1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobjectArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jbyteArray GeckoAppShell::GetIconForExtensionWrapper(const nsAString& a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetIconForExtensionWrapper, j0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jbyteArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoAppShell::GetMessageWrapper(int32_t a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jGetMessageWrapper, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jstring GeckoAppShell::GetMimeTypeFromExtensionsWrapper(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetMimeTypeFromExtensionsWrapper, j0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jstring ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoAppShell::GetNextMessageInListWrapper(int32_t a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jGetNextMessageInListWrapper, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jstring GeckoAppShell::GetProxyForURIWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, int32_t a3) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(4) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].l = AndroidBridge::NewJavaString(env, a1); michael@0: args[2].l = AndroidBridge::NewJavaString(env, a2); michael@0: args[3].i = a3; michael@0: michael@0: jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jGetProxyForURIWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jstring ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: int32_t GeckoAppShell::GetScreenDepthWrapper() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetScreenDepthWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: int16_t GeckoAppShell::GetScreenOrientationWrapper() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: int16_t temp = env->CallStaticShortMethod(mGeckoAppShellClass, jGetScreenOrientationWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: bool GeckoAppShell::GetShowPasswordSetting() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jGetShowPasswordSetting); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: jintArray GeckoAppShell::GetSystemColoursWrapper() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetSystemColoursWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jintArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoAppShell::HandleGeckoMessageWrapper(jobject a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleGeckoMessageWrapper, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::HandleUncaughtException(jobject a0, jthrowable a1) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: return; michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleUncaughtException, a0, a1); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::HideProgressDialog() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jHideProgressDialog); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jintArray GeckoAppShell::InitCameraWrapper(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].i = a1; michael@0: args[2].i = a2; michael@0: args[3].i = a3; michael@0: michael@0: jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jInitCameraWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jintArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: bool GeckoAppShell::IsNetworkLinkKnown() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkKnown); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: bool GeckoAppShell::IsNetworkLinkUp() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkUp); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: bool GeckoAppShell::IsTablet() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsTablet); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: void GeckoAppShell::KillAnyZombies() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jKillAnyZombies); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jclass GeckoAppShell::LoadPluginClass(const nsAString& a0, const nsAString& a1) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(3) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: jstring j1 = AndroidBridge::NewJavaString(env, a1); michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jLoadPluginClass, j0, j1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jclass ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoAppShell::LockScreenOrientation(int32_t a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jLockScreenOrientation, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::MarkURIVisited(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jMarkURIVisited, j0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::MoveTaskToBack() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jMoveTaskToBack); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: int32_t GeckoAppShell::NetworkLinkType() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jNetworkLinkType); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: void GeckoAppShell::NotifyDefaultPrevented(bool a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyDefaultPrevented, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::NotifyIME(int32_t a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyIME, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::NotifyIMEChange(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].i = a1; michael@0: args[2].i = a2; michael@0: args[3].i = a3; michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEChange, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::NotifyIMEContext(int32_t a0, const nsAString& a1, const nsAString& a2, const nsAString& a3) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(3) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].i = a0; michael@0: args[1].l = AndroidBridge::NewJavaString(env, a1); michael@0: args[2].l = AndroidBridge::NewJavaString(env, a2); michael@0: args[3].l = AndroidBridge::NewJavaString(env, a3); michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEContext, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::NotifyWakeLockChanged(const nsAString& a0, const nsAString& a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: jstring j1 = AndroidBridge::NewJavaString(env, a1); michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyWakeLockChanged, j0, j1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::NotifyXreExit() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyXreExit); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: bool GeckoAppShell::OpenUriExternal(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4, const nsAString& a5) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(6) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[6]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].l = AndroidBridge::NewJavaString(env, a1); michael@0: args[2].l = AndroidBridge::NewJavaString(env, a2); michael@0: args[3].l = AndroidBridge::NewJavaString(env, a3); michael@0: args[4].l = AndroidBridge::NewJavaString(env, a4); michael@0: args[5].l = AndroidBridge::NewJavaString(env, a5); michael@0: michael@0: bool temp = env->CallStaticBooleanMethodA(mGeckoAppShellClass, jOpenUriExternal, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: void GeckoAppShell::PerformHapticFeedback(bool a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jPerformHapticFeedback, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: bool GeckoAppShell::PumpMessageLoop() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jPumpMessageLoop); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: void GeckoAppShell::RegisterSurfaceTextureFrameListener(jobject a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jRegisterSurfaceTextureFrameListener, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::RemovePluginView(jobject a0, bool a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jRemovePluginView, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::ScanMedia(const nsAString& a0, const nsAString& a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: jstring j1 = AndroidBridge::NewJavaString(env, a1); michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jScanMedia, j0, j1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::ScheduleRestart() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jScheduleRestart); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::SendMessageWrapper(const nsAString& a0, const nsAString& a1, int32_t a2) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[3]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].l = AndroidBridge::NewJavaString(env, a1); michael@0: args[2].i = a2; michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jSendMessageWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::SetFullScreen(bool a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jSetFullScreen, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::SetKeepScreenOn(bool a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jSetKeepScreenOn, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::SetURITitle(const nsAString& a0, const nsAString& a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: jstring j1 = AndroidBridge::NewJavaString(env, a1); michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jSetURITitle, j0, j1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::ShowAlertNotificationWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(5) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[5]; michael@0: args[0].l = AndroidBridge::NewJavaString(env, a0); michael@0: args[1].l = AndroidBridge::NewJavaString(env, a1); michael@0: args[2].l = AndroidBridge::NewJavaString(env, a2); michael@0: args[3].l = AndroidBridge::NewJavaString(env, a3); michael@0: args[4].l = AndroidBridge::NewJavaString(env, a4); michael@0: michael@0: env->CallStaticVoidMethodA(mGeckoAppShellClass, jShowAlertNotificationWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::ShowInputMethodPicker() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jShowInputMethodPicker); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: bool GeckoAppShell::UnlockProfile() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jUnlockProfile); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: void GeckoAppShell::UnlockScreenOrientation() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::UnregisterSurfaceTextureFrameListener(jobject a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jUnregisterSurfaceTextureFrameListener, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::Vibrate1(int64_t a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrate1, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoAppShell::VibrateA(jlongArray a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrateA, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: jclass JavaDomKeyLocation::mDomKeyLocationClass = 0; michael@0: jmethodID JavaDomKeyLocation::jvalueOf = 0; michael@0: jmethodID JavaDomKeyLocation::jvalues = 0; michael@0: jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_JOYSTICK = 0; michael@0: jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_LEFT = 0; michael@0: jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_MOBILE = 0; michael@0: jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_NUMPAD = 0; michael@0: jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_RIGHT = 0; michael@0: jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_STANDARD = 0; michael@0: jfieldID JavaDomKeyLocation::jvalue = 0; michael@0: void JavaDomKeyLocation::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mDomKeyLocationClass = getClassGlobalRef("org/mozilla/gecko/GeckoEvent$DomKeyLocation"); michael@0: jvalueOf = getStaticMethod("valueOf", "(Ljava/lang/String;)Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jvalues = getStaticMethod("values", "()[Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jDOM_KEY_LOCATION_JOYSTICK = getStaticField("DOM_KEY_LOCATION_JOYSTICK", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jDOM_KEY_LOCATION_LEFT = getStaticField("DOM_KEY_LOCATION_LEFT", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jDOM_KEY_LOCATION_MOBILE = getStaticField("DOM_KEY_LOCATION_MOBILE", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jDOM_KEY_LOCATION_NUMPAD = getStaticField("DOM_KEY_LOCATION_NUMPAD", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jDOM_KEY_LOCATION_RIGHT = getStaticField("DOM_KEY_LOCATION_RIGHT", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jDOM_KEY_LOCATION_STANDARD = getStaticField("DOM_KEY_LOCATION_STANDARD", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;"); michael@0: jvalue = getField("value", "I"); michael@0: } michael@0: michael@0: JavaDomKeyLocation* JavaDomKeyLocation::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: JavaDomKeyLocation* ret = new JavaDomKeyLocation(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: jobject JavaDomKeyLocation::valueOf(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mDomKeyLocationClass, jvalueOf, j0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jobjectArray JavaDomKeyLocation::values() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mDomKeyLocationClass, jvalues); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobjectArray ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_JOYSTICK() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_JOYSTICK)); michael@0: } michael@0: michael@0: jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_LEFT() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_LEFT)); michael@0: } michael@0: michael@0: jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_MOBILE() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_MOBILE)); michael@0: } michael@0: michael@0: jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_NUMPAD() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_NUMPAD)); michael@0: } michael@0: michael@0: jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_RIGHT() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_RIGHT)); michael@0: } michael@0: michael@0: jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_STANDARD() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_STANDARD)); michael@0: } michael@0: michael@0: int32_t JavaDomKeyLocation::getvalue() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetIntField(wrapped_obj, jvalue); michael@0: } michael@0: jclass GeckoJavaSampler::mGeckoJavaSamplerClass = 0; michael@0: jmethodID GeckoJavaSampler::jGetFrameNameJavaProfilingWrapper = 0; michael@0: jmethodID GeckoJavaSampler::jGetSampleTimeJavaProfiling = 0; michael@0: jmethodID GeckoJavaSampler::jGetThreadNameJavaProfilingWrapper = 0; michael@0: jmethodID GeckoJavaSampler::jPauseJavaProfiling = 0; michael@0: jmethodID GeckoJavaSampler::jStartJavaProfiling = 0; michael@0: jmethodID GeckoJavaSampler::jStopJavaProfiling = 0; michael@0: jmethodID GeckoJavaSampler::jUnpauseJavaProfiling = 0; michael@0: void GeckoJavaSampler::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mGeckoJavaSamplerClass = getClassGlobalRef("org/mozilla/gecko/GeckoJavaSampler"); michael@0: jGetFrameNameJavaProfilingWrapper = getStaticMethod("getFrameName", "(III)Ljava/lang/String;"); michael@0: jGetSampleTimeJavaProfiling = getStaticMethod("getSampleTime", "(II)D"); michael@0: jGetThreadNameJavaProfilingWrapper = getStaticMethod("getThreadName", "(I)Ljava/lang/String;"); michael@0: jPauseJavaProfiling = getStaticMethod("pause", "()V"); michael@0: jStartJavaProfiling = getStaticMethod("start", "(II)V"); michael@0: jStopJavaProfiling = getStaticMethod("stop", "()V"); michael@0: jUnpauseJavaProfiling = getStaticMethod("unpause", "()V"); michael@0: } michael@0: michael@0: GeckoJavaSampler* GeckoJavaSampler::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: GeckoJavaSampler* ret = new GeckoJavaSampler(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: jstring GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(int32_t a0, int32_t a1, int32_t a2) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[3]; michael@0: args[0].i = a0; michael@0: args[1].i = a1; michael@0: args[2].i = a2; michael@0: michael@0: jobject temp = env->CallStaticObjectMethodA(mGeckoJavaSamplerClass, jGetFrameNameJavaProfilingWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jstring ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jdouble GeckoJavaSampler::GetSampleTimeJavaProfiling(int32_t a0, int32_t a1) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jdouble temp = env->CallStaticDoubleMethod(mGeckoJavaSamplerClass, jGetSampleTimeJavaProfiling, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: jstring GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(int32_t a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mGeckoJavaSamplerClass, jGetThreadNameJavaProfilingWrapper, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jstring ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoJavaSampler::PauseJavaProfiling() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jPauseJavaProfiling); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoJavaSampler::StartJavaProfiling(int32_t a0, int32_t a1) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStartJavaProfiling, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoJavaSampler::StopJavaProfiling() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStopJavaProfiling); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoJavaSampler::UnpauseJavaProfiling() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jUnpauseJavaProfiling); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: jclass SurfaceBits::mSurfaceBitsClass = 0; michael@0: jmethodID SurfaceBits::jSurfaceBits = 0; michael@0: jfieldID SurfaceBits::jbuffer = 0; michael@0: jfieldID SurfaceBits::jformat = 0; michael@0: jfieldID SurfaceBits::jheight = 0; michael@0: jfieldID SurfaceBits::jwidth = 0; michael@0: void SurfaceBits::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mSurfaceBitsClass = getClassGlobalRef("org/mozilla/gecko/SurfaceBits"); michael@0: jSurfaceBits = getMethod("", "()V"); michael@0: jbuffer = getField("buffer", "Ljava/nio/ByteBuffer;"); michael@0: jformat = getField("format", "I"); michael@0: jheight = getField("height", "I"); michael@0: jwidth = getField("width", "I"); michael@0: } michael@0: michael@0: SurfaceBits* SurfaceBits::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: SurfaceBits* ret = new SurfaceBits(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: SurfaceBits::SurfaceBits() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: Init(env->NewObject(mSurfaceBitsClass, jSurfaceBits), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jobject SurfaceBits::getbuffer() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetObjectField(wrapped_obj, jbuffer)); michael@0: } michael@0: michael@0: void SurfaceBits::setbuffer(jobject a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetObjectField(wrapped_obj, jbuffer, a0); michael@0: } michael@0: michael@0: int32_t SurfaceBits::getformat() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetIntField(wrapped_obj, jformat); michael@0: } michael@0: michael@0: void SurfaceBits::setformat(int32_t a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetIntField(wrapped_obj, jformat, a0); michael@0: } michael@0: michael@0: int32_t SurfaceBits::getheight() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetIntField(wrapped_obj, jheight); michael@0: } michael@0: michael@0: void SurfaceBits::setheight(int32_t a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetIntField(wrapped_obj, jheight, a0); michael@0: } michael@0: michael@0: int32_t SurfaceBits::getwidth() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetIntField(wrapped_obj, jwidth); michael@0: } michael@0: michael@0: void SurfaceBits::setwidth(int32_t a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetIntField(wrapped_obj, jwidth, a0); michael@0: } michael@0: jclass ThumbnailHelper::mThumbnailHelperClass = 0; michael@0: jmethodID ThumbnailHelper::jSendThumbnail = 0; michael@0: void ThumbnailHelper::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mThumbnailHelperClass = getClassGlobalRef("org/mozilla/gecko/ThumbnailHelper"); michael@0: jSendThumbnail = getStaticMethod("notifyThumbnail", "(Ljava/nio/ByteBuffer;IZ)V"); michael@0: } michael@0: michael@0: ThumbnailHelper* ThumbnailHelper::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: ThumbnailHelper* ret = new ThumbnailHelper(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: void ThumbnailHelper::SendThumbnail(jobject a0, int32_t a1, bool a2) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[3]; michael@0: args[0].l = a0; michael@0: args[1].i = a1; michael@0: args[2].z = a2; michael@0: michael@0: env->CallStaticVoidMethodA(mThumbnailHelperClass, jSendThumbnail, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: jclass DisplayPortMetrics::mDisplayPortMetricsClass = 0; michael@0: jmethodID DisplayPortMetrics::jDisplayPortMetrics = 0; michael@0: jfieldID DisplayPortMetrics::jMPosition = 0; michael@0: jfieldID DisplayPortMetrics::jResolution = 0; michael@0: void DisplayPortMetrics::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mDisplayPortMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/DisplayPortMetrics"); michael@0: jDisplayPortMetrics = getMethod("", "(FFFFF)V"); michael@0: jMPosition = getField("mPosition", "Landroid/graphics/RectF;"); michael@0: jResolution = getField("resolution", "F"); michael@0: } michael@0: michael@0: DisplayPortMetrics* DisplayPortMetrics::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: DisplayPortMetrics* ret = new DisplayPortMetrics(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: DisplayPortMetrics::DisplayPortMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[5]; michael@0: args[0].f = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: args[4].f = a4; michael@0: michael@0: Init(env->NewObjectA(mDisplayPortMetricsClass, jDisplayPortMetrics, args), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jobject DisplayPortMetrics::getMPosition() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return static_cast(env->GetObjectField(wrapped_obj, jMPosition)); michael@0: } michael@0: michael@0: jfloat DisplayPortMetrics::getResolution() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jResolution); michael@0: } michael@0: jclass GLController::mGLControllerClass = 0; michael@0: jmethodID GLController::jCreateEGLSurfaceForCompositorWrapper = 0; michael@0: void GLController::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mGLControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/GLController"); michael@0: jCreateEGLSurfaceForCompositorWrapper = getMethod("createEGLSurfaceForCompositor", "()Ljavax/microedition/khronos/egl/EGLSurface;"); michael@0: } michael@0: michael@0: GLController* GLController::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: GLController* ret = new GLController(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: jobject GLController::CreateEGLSurfaceForCompositorWrapper() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallObjectMethod(wrapped_obj, jCreateEGLSurfaceForCompositorWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: jclass GeckoLayerClient::mGeckoLayerClientClass = 0; michael@0: jmethodID GeckoLayerClient::jActivateProgram = 0; michael@0: jmethodID GeckoLayerClient::jContentDocumentChanged = 0; michael@0: jmethodID GeckoLayerClient::jCreateFrame = 0; michael@0: jmethodID GeckoLayerClient::jDeactivateProgram = 0; michael@0: jmethodID GeckoLayerClient::jGetDisplayPort = 0; michael@0: jmethodID GeckoLayerClient::jIsContentDocumentDisplayed = 0; michael@0: jmethodID GeckoLayerClient::jProgressiveUpdateCallback = 0; michael@0: jmethodID GeckoLayerClient::jSetFirstPaintViewport = 0; michael@0: jmethodID GeckoLayerClient::jSetPageRect = 0; michael@0: jmethodID GeckoLayerClient::jSyncFrameMetrics = 0; michael@0: jmethodID GeckoLayerClient::jSyncViewportInfo = 0; michael@0: void GeckoLayerClient::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mGeckoLayerClientClass = getClassGlobalRef("org/mozilla/gecko/gfx/GeckoLayerClient"); michael@0: jActivateProgram = getMethod("activateProgram", "()V"); michael@0: jContentDocumentChanged = getMethod("contentDocumentChanged", "()V"); michael@0: jCreateFrame = getMethod("createFrame", "()Lorg/mozilla/gecko/gfx/LayerRenderer$Frame;"); michael@0: jDeactivateProgram = getMethod("deactivateProgram", "()V"); michael@0: jGetDisplayPort = getMethod("getDisplayPort", "(ZZILorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)Lorg/mozilla/gecko/gfx/DisplayPortMetrics;"); michael@0: jIsContentDocumentDisplayed = getMethod("isContentDocumentDisplayed", "()Z"); michael@0: jProgressiveUpdateCallback = getMethod("progressiveUpdateCallback", "(ZFFFFFZ)Lorg/mozilla/gecko/gfx/ProgressiveUpdateData;"); michael@0: jSetFirstPaintViewport = getMethod("setFirstPaintViewport", "(FFFFFFF)V"); michael@0: jSetPageRect = getMethod("setPageRect", "(FFFF)V"); michael@0: jSyncFrameMetrics = getMethod("syncFrameMetrics", "(FFFFFFFZIIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;"); michael@0: jSyncViewportInfo = getMethod("syncViewportInfo", "(IIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;"); michael@0: } michael@0: michael@0: GeckoLayerClient* GeckoLayerClient::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: GeckoLayerClient* ret = new GeckoLayerClient(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoLayerClient::ActivateProgram() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jActivateProgram); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoLayerClient::ContentDocumentChanged() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jContentDocumentChanged); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jobject GeckoLayerClient::CreateFrame() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallObjectMethod(wrapped_obj, jCreateFrame); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoLayerClient::DeactivateProgram() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jDeactivateProgram); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jobject GeckoLayerClient::GetDisplayPort(bool a0, bool a1, int32_t a2, jobject a3) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].z = a0; michael@0: args[1].z = a1; michael@0: args[2].i = a2; michael@0: args[3].l = a3; michael@0: michael@0: jobject temp = env->CallObjectMethodA(wrapped_obj, jGetDisplayPort, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: bool GeckoLayerClient::IsContentDocumentDisplayed() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallBooleanMethod(wrapped_obj, jIsContentDocumentDisplayed); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: jobject GeckoLayerClient::ProgressiveUpdateCallback(bool a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, bool a6) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[7]; michael@0: args[0].z = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: args[4].f = a4; michael@0: args[5].f = a5; michael@0: args[6].z = a6; michael@0: michael@0: jobject temp = env->CallObjectMethodA(wrapped_obj, jProgressiveUpdateCallback, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: void GeckoLayerClient::SetFirstPaintViewport(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[7]; michael@0: args[0].f = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: args[4].f = a4; michael@0: args[5].f = a5; michael@0: args[6].f = a6; michael@0: michael@0: env->CallVoidMethodA(wrapped_obj, jSetFirstPaintViewport, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void GeckoLayerClient::SetPageRect(jfloat a0, jfloat a1, jfloat a2, jfloat a3) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[4]; michael@0: args[0].f = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: michael@0: env->CallVoidMethodA(wrapped_obj, jSetPageRect, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jobject GeckoLayerClient::SyncFrameMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6, bool a7, int32_t a8, int32_t a9, int32_t a10, int32_t a11, jfloat a12, bool a13) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[14]; michael@0: args[0].f = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: args[4].f = a4; michael@0: args[5].f = a5; michael@0: args[6].f = a6; michael@0: args[7].z = a7; michael@0: args[8].i = a8; michael@0: args[9].i = a9; michael@0: args[10].i = a10; michael@0: args[11].i = a11; michael@0: args[12].f = a12; michael@0: args[13].z = a13; michael@0: michael@0: jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncFrameMetrics, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: jobject GeckoLayerClient::SyncViewportInfo(int32_t a0, int32_t a1, int32_t a2, int32_t a3, jfloat a4, bool a5) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[6]; michael@0: args[0].i = a0; michael@0: args[1].i = a1; michael@0: args[2].i = a2; michael@0: args[3].i = a3; michael@0: args[4].f = a4; michael@0: args[5].z = a5; michael@0: michael@0: jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncViewportInfo, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: jclass ImmutableViewportMetrics::mImmutableViewportMetricsClass = 0; michael@0: jmethodID ImmutableViewportMetrics::jImmutableViewportMetrics = 0; michael@0: void ImmutableViewportMetrics::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mImmutableViewportMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/ImmutableViewportMetrics"); michael@0: jImmutableViewportMetrics = getMethod("", "(FFFFFFFFFFFFF)V"); michael@0: } michael@0: michael@0: ImmutableViewportMetrics* ImmutableViewportMetrics::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: ImmutableViewportMetrics* ret = new ImmutableViewportMetrics(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: ImmutableViewportMetrics::ImmutableViewportMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6, jfloat a7, jfloat a8, jfloat a9, jfloat a10, jfloat a11, jfloat a12) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[13]; michael@0: args[0].f = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: args[4].f = a4; michael@0: args[5].f = a5; michael@0: args[6].f = a6; michael@0: args[7].f = a7; michael@0: args[8].f = a8; michael@0: args[9].f = a9; michael@0: args[10].f = a10; michael@0: args[11].f = a11; michael@0: args[12].f = a12; michael@0: michael@0: Init(env->NewObjectA(mImmutableViewportMetricsClass, jImmutableViewportMetrics, args), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: jclass LayerView::mLayerViewClass = 0; michael@0: jmethodID LayerView::jRegisterCompositorWrapper = 0; michael@0: void LayerView::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mLayerViewClass = getClassGlobalRef("org/mozilla/gecko/gfx/LayerView"); michael@0: jRegisterCompositorWrapper = getStaticMethod("registerCxxCompositor", "()Lorg/mozilla/gecko/gfx/GLController;"); michael@0: } michael@0: michael@0: LayerView* LayerView::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: LayerView* ret = new LayerView(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: jobject LayerView::RegisterCompositorWrapper() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mLayerViewClass, jRegisterCompositorWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: jclass NativePanZoomController::mNativePanZoomControllerClass = 0; michael@0: jmethodID NativePanZoomController::jPostDelayedCallbackWrapper = 0; michael@0: jmethodID NativePanZoomController::jRequestContentRepaintWrapper = 0; michael@0: void NativePanZoomController::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mNativePanZoomControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/NativePanZoomController"); michael@0: jPostDelayedCallbackWrapper = getMethod("postDelayedCallback", "(J)V"); michael@0: jRequestContentRepaintWrapper = getMethod("requestContentRepaint", "(FFFFF)V"); michael@0: } michael@0: michael@0: NativePanZoomController* NativePanZoomController::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: NativePanZoomController* ret = new NativePanZoomController(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: void NativePanZoomController::PostDelayedCallbackWrapper(int64_t a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jPostDelayedCallbackWrapper, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void NativePanZoomController::RequestContentRepaintWrapper(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[5]; michael@0: args[0].f = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: args[3].f = a3; michael@0: args[4].f = a4; michael@0: michael@0: env->CallVoidMethodA(wrapped_obj, jRequestContentRepaintWrapper, args); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: jclass ProgressiveUpdateData::mProgressiveUpdateDataClass = 0; michael@0: jmethodID ProgressiveUpdateData::jProgressiveUpdateData = 0; michael@0: jmethodID ProgressiveUpdateData::jsetViewport = 0; michael@0: jfieldID ProgressiveUpdateData::jabort = 0; michael@0: jfieldID ProgressiveUpdateData::jheight = 0; michael@0: jfieldID ProgressiveUpdateData::jscale = 0; michael@0: jfieldID ProgressiveUpdateData::jwidth = 0; michael@0: jfieldID ProgressiveUpdateData::jx = 0; michael@0: jfieldID ProgressiveUpdateData::jy = 0; michael@0: void ProgressiveUpdateData::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mProgressiveUpdateDataClass = getClassGlobalRef("org/mozilla/gecko/gfx/ProgressiveUpdateData"); michael@0: jProgressiveUpdateData = getMethod("", "()V"); michael@0: jsetViewport = getMethod("setViewport", "(Lorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)V"); michael@0: jabort = getField("abort", "Z"); michael@0: jheight = getField("height", "F"); michael@0: jscale = getField("scale", "F"); michael@0: jwidth = getField("width", "F"); michael@0: jx = getField("x", "F"); michael@0: jy = getField("y", "F"); michael@0: } michael@0: michael@0: ProgressiveUpdateData* ProgressiveUpdateData::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: ProgressiveUpdateData* ret = new ProgressiveUpdateData(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: ProgressiveUpdateData::ProgressiveUpdateData() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: Init(env->NewObject(mProgressiveUpdateDataClass, jProgressiveUpdateData), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void ProgressiveUpdateData::setViewport(jobject a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jsetViewport, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: bool ProgressiveUpdateData::getabort() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetBooleanField(wrapped_obj, jabort); michael@0: } michael@0: michael@0: void ProgressiveUpdateData::setabort(bool a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetBooleanField(wrapped_obj, jabort, a0); michael@0: } michael@0: michael@0: jfloat ProgressiveUpdateData::getheight() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jheight); michael@0: } michael@0: michael@0: void ProgressiveUpdateData::setheight(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jheight, a0); michael@0: } michael@0: michael@0: jfloat ProgressiveUpdateData::getscale() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jscale); michael@0: } michael@0: michael@0: void ProgressiveUpdateData::setscale(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jscale, a0); michael@0: } michael@0: michael@0: jfloat ProgressiveUpdateData::getwidth() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jwidth); michael@0: } michael@0: michael@0: void ProgressiveUpdateData::setwidth(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jwidth, a0); michael@0: } michael@0: michael@0: jfloat ProgressiveUpdateData::getx() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jx); michael@0: } michael@0: michael@0: void ProgressiveUpdateData::setx(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jx, a0); michael@0: } michael@0: michael@0: jfloat ProgressiveUpdateData::gety() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jy); michael@0: } michael@0: michael@0: void ProgressiveUpdateData::sety(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jy, a0); michael@0: } michael@0: jclass ViewTransform::mViewTransformClass = 0; michael@0: jmethodID ViewTransform::jViewTransform = 0; michael@0: jfieldID ViewTransform::jfixedLayerMarginBottom = 0; michael@0: jfieldID ViewTransform::jfixedLayerMarginLeft = 0; michael@0: jfieldID ViewTransform::jfixedLayerMarginRight = 0; michael@0: jfieldID ViewTransform::jfixedLayerMarginTop = 0; michael@0: jfieldID ViewTransform::joffsetX = 0; michael@0: jfieldID ViewTransform::joffsetY = 0; michael@0: jfieldID ViewTransform::jscale = 0; michael@0: jfieldID ViewTransform::jx = 0; michael@0: jfieldID ViewTransform::jy = 0; michael@0: void ViewTransform::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mViewTransformClass = getClassGlobalRef("org/mozilla/gecko/gfx/ViewTransform"); michael@0: jViewTransform = getMethod("", "(FFF)V"); michael@0: jfixedLayerMarginBottom = getField("fixedLayerMarginBottom", "F"); michael@0: jfixedLayerMarginLeft = getField("fixedLayerMarginLeft", "F"); michael@0: jfixedLayerMarginRight = getField("fixedLayerMarginRight", "F"); michael@0: jfixedLayerMarginTop = getField("fixedLayerMarginTop", "F"); michael@0: joffsetX = getField("offsetX", "F"); michael@0: joffsetY = getField("offsetY", "F"); michael@0: jscale = getField("scale", "F"); michael@0: jx = getField("x", "F"); michael@0: jy = getField("y", "F"); michael@0: } michael@0: michael@0: ViewTransform* ViewTransform::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: ViewTransform* ret = new ViewTransform(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: ViewTransform::ViewTransform(jfloat a0, jfloat a1, jfloat a2) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jvalue args[3]; michael@0: args[0].f = a0; michael@0: args[1].f = a1; michael@0: args[2].f = a2; michael@0: michael@0: Init(env->NewObjectA(mViewTransformClass, jViewTransform, args), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jfloat ViewTransform::getfixedLayerMarginBottom() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jfixedLayerMarginBottom); michael@0: } michael@0: michael@0: void ViewTransform::setfixedLayerMarginBottom(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jfixedLayerMarginBottom, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::getfixedLayerMarginLeft() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jfixedLayerMarginLeft); michael@0: } michael@0: michael@0: void ViewTransform::setfixedLayerMarginLeft(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jfixedLayerMarginLeft, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::getfixedLayerMarginRight() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jfixedLayerMarginRight); michael@0: } michael@0: michael@0: void ViewTransform::setfixedLayerMarginRight(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jfixedLayerMarginRight, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::getfixedLayerMarginTop() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jfixedLayerMarginTop); michael@0: } michael@0: michael@0: void ViewTransform::setfixedLayerMarginTop(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jfixedLayerMarginTop, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::getoffsetX() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, joffsetX); michael@0: } michael@0: michael@0: void ViewTransform::setoffsetX(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, joffsetX, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::getoffsetY() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, joffsetY); michael@0: } michael@0: michael@0: void ViewTransform::setoffsetY(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, joffsetY, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::getscale() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jscale); michael@0: } michael@0: michael@0: void ViewTransform::setscale(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jscale, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::getx() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jx); michael@0: } michael@0: michael@0: void ViewTransform::setx(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jx, a0); michael@0: } michael@0: michael@0: jfloat ViewTransform::gety() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetFloatField(wrapped_obj, jy); michael@0: } michael@0: michael@0: void ViewTransform::sety(jfloat a0) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: env->SetFloatField(wrapped_obj, jy, a0); michael@0: } michael@0: jclass NativeZip::mNativeZipClass = 0; michael@0: jmethodID NativeZip::jCreateInputStream = 0; michael@0: void NativeZip::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mNativeZipClass = getClassGlobalRef("org/mozilla/gecko/mozglue/NativeZip"); michael@0: jCreateInputStream = getMethod("createInputStream", "(Ljava/nio/ByteBuffer;I)Ljava/io/InputStream;"); michael@0: } michael@0: michael@0: NativeZip* NativeZip::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: NativeZip* ret = new NativeZip(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: jobject NativeZip::CreateInputStream(jobject a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(2) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallObjectMethod(wrapped_obj, jCreateInputStream, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jobject ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: jclass MatrixBlobCursor::mMatrixBlobCursorClass = 0; michael@0: jmethodID MatrixBlobCursor::jMatrixBlobCursor = 0; michael@0: jmethodID MatrixBlobCursor::jMatrixBlobCursor0 = 0; michael@0: jmethodID MatrixBlobCursor::jAddRow = 0; michael@0: jmethodID MatrixBlobCursor::jAddRow1 = 0; michael@0: jmethodID MatrixBlobCursor::jAddRow2 = 0; michael@0: void MatrixBlobCursor::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mMatrixBlobCursorClass = getClassGlobalRef("org/mozilla/gecko/sqlite/MatrixBlobCursor"); michael@0: jMatrixBlobCursor = getMethod("", "([Ljava/lang/String;)V"); michael@0: jMatrixBlobCursor0 = getMethod("", "([Ljava/lang/String;I)V"); michael@0: jAddRow = getMethod("addRow", "(Ljava/lang/Iterable;)V"); michael@0: jAddRow1 = getMethod("addRow", "(Ljava/util/ArrayList;I)V"); michael@0: jAddRow2 = getMethod("addRow", "([Ljava/lang/Object;)V"); michael@0: } michael@0: michael@0: MatrixBlobCursor* MatrixBlobCursor::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: MatrixBlobCursor* ret = new MatrixBlobCursor(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor, a0), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor0, a0, a1), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void MatrixBlobCursor::AddRow(jobject a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jAddRow, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void MatrixBlobCursor::AddRow(jobject a0, int32_t a1) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jAddRow1, a0, a1); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void MatrixBlobCursor::AddRow(jobjectArray a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallVoidMethod(wrapped_obj, jAddRow2, a0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: jclass SQLiteBridgeException::mSQLiteBridgeExceptionClass = 0; michael@0: jmethodID SQLiteBridgeException::jSQLiteBridgeException = 0; michael@0: jmethodID SQLiteBridgeException::jSQLiteBridgeException0 = 0; michael@0: jfieldID SQLiteBridgeException::jserialVersionUID = 0; michael@0: void SQLiteBridgeException::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mSQLiteBridgeExceptionClass = getClassGlobalRef("org/mozilla/gecko/sqlite/SQLiteBridgeException"); michael@0: jSQLiteBridgeException = getMethod("", "()V"); michael@0: jSQLiteBridgeException0 = getMethod("", "(Ljava/lang/String;)V"); michael@0: jserialVersionUID = getStaticField("serialVersionUID", "J"); michael@0: } michael@0: michael@0: SQLiteBridgeException* SQLiteBridgeException::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: SQLiteBridgeException* ret = new SQLiteBridgeException(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: SQLiteBridgeException::SQLiteBridgeException() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: SQLiteBridgeException::SQLiteBridgeException(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException0, j0), env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: int64_t SQLiteBridgeException::getserialVersionUID() { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: return env->GetStaticLongField(mSQLiteBridgeExceptionClass, jserialVersionUID); michael@0: } michael@0: jclass Clipboard::mClipboardClass = 0; michael@0: jmethodID Clipboard::jClearText = 0; michael@0: jmethodID Clipboard::jGetClipboardTextWrapper = 0; michael@0: jmethodID Clipboard::jHasText = 0; michael@0: jmethodID Clipboard::jSetClipboardText = 0; michael@0: void Clipboard::InitStubs(JNIEnv *jEnv) { michael@0: initInit(); michael@0: michael@0: mClipboardClass = getClassGlobalRef("org/mozilla/gecko/util/Clipboard"); michael@0: jClearText = getStaticMethod("clearText", "()V"); michael@0: jGetClipboardTextWrapper = getStaticMethod("getText", "()Ljava/lang/String;"); michael@0: jHasText = getStaticMethod("hasText", "()Z"); michael@0: jSetClipboardText = getStaticMethod("setText", "(Ljava/lang/CharSequence;)V"); michael@0: } michael@0: michael@0: Clipboard* Clipboard::Wrap(jobject obj) { michael@0: JNIEnv *env = GetJNIForThread(); michael@0: Clipboard* ret = new Clipboard(obj, env); michael@0: env->DeleteLocalRef(obj); michael@0: return ret; michael@0: } michael@0: michael@0: void Clipboard::ClearText() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: env->CallStaticVoidMethod(mClipboardClass, jClearText); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: jstring Clipboard::GetClipboardTextWrapper() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jobject temp = env->CallStaticObjectMethod(mClipboardClass, jGetClipboardTextWrapper); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: jstring ret = static_cast(env->PopLocalFrame(temp)); michael@0: return ret; michael@0: } michael@0: michael@0: bool Clipboard::HasText() { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(0) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: bool temp = env->CallStaticBooleanMethod(mClipboardClass, jHasText); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: return temp; michael@0: } michael@0: michael@0: void Clipboard::SetClipboardText(const nsAString& a0) { michael@0: JNIEnv *env = AndroidBridge::GetJNIEnv(); michael@0: if (env->PushLocalFrame(1) != 0) { michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: MOZ_ASSUME_UNREACHABLE("Exception should have caused crash."); michael@0: } michael@0: michael@0: jstring j0 = AndroidBridge::NewJavaString(env, a0); michael@0: michael@0: env->CallStaticVoidMethod(mClipboardClass, jSetClipboardText, j0); michael@0: AndroidBridge::HandleUncaughtException(env); michael@0: env->PopLocalFrame(nullptr); michael@0: } michael@0: michael@0: void InitStubs(JNIEnv *jEnv) { michael@0: GeckoAppShell::InitStubs(jEnv); michael@0: JavaDomKeyLocation::InitStubs(jEnv); michael@0: GeckoJavaSampler::InitStubs(jEnv); michael@0: SurfaceBits::InitStubs(jEnv); michael@0: ThumbnailHelper::InitStubs(jEnv); michael@0: DisplayPortMetrics::InitStubs(jEnv); michael@0: GLController::InitStubs(jEnv); michael@0: GeckoLayerClient::InitStubs(jEnv); michael@0: ImmutableViewportMetrics::InitStubs(jEnv); michael@0: LayerView::InitStubs(jEnv); michael@0: NativePanZoomController::InitStubs(jEnv); michael@0: ProgressiveUpdateData::InitStubs(jEnv); michael@0: ViewTransform::InitStubs(jEnv); michael@0: NativeZip::InitStubs(jEnv); michael@0: MatrixBlobCursor::InitStubs(jEnv); michael@0: SQLiteBridgeException::InitStubs(jEnv); michael@0: Clipboard::InitStubs(jEnv); michael@0: } michael@0: } /* android */ michael@0: } /* widget */ michael@0: } /* mozilla */