diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-05-21 14:51:59 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-05-21 14:51:59 +0100 |
commit | 72a688db732bca48969977b84a165d6d6a80e5af (patch) | |
tree | ae8b6c5bd7d3b1705a91c6f20f7ec32942cd7903 /vcl/android | |
parent | 43ad4c56fabe0304cf7aa133c7778996afbfae23 (diff) |
Remove more obsolete Android code: The 'AppSupport' stuff
Diffstat (limited to 'vcl/android')
-rw-r--r-- | vcl/android/androidinst.cxx | 161 |
1 files changed, 0 insertions, 161 deletions
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx index 6099536950ee..d1b760d5dd43 100644 --- a/vcl/android/androidinst.cxx +++ b/vcl/android/androidinst.cxx @@ -382,165 +382,4 @@ int AndroidSalSystem::ShowNativeDialog( const OUString& rTitle, return 0; } -// public static native void renderVCL(Bitmap bitmap); -extern "C" SAL_JNI_EXPORT void JNICALL -Java_org_libreoffice_android_AppSupport_renderVCL(JNIEnv *env, - jobject /* clazz */, - jobject bitmap) -{ - AndroidBitmapInfo info; - void* pixels; - int ret; - - if ((ret = AndroidBitmap_getInfo(env, bitmap, &info)) < 0) { - LOGI("AndroidBitmap_getInfo() failed ! error=%d", ret); - return; - } - - if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixels)) < 0) { - LOGI("AndroidBitmap_lockPixels() failed ! error=%d", ret); - } - -/* -typedef struct ANativeWindow_Buffer { - // The number of pixels that are show horizontally. - int32_t width; - - // The number of pixels that are shown vertically. - int32_t height; - - // The number of *pixels* that a line in the buffer takes in - // memory. This may be >= width. - int32_t stride; - - // The format of the buffer. One of WINDOW_FORMAT_* - int32_t format; - - // The actual bits. - void* bits; - - // Do not touch. - uint32_t reserved[6]; -} ANativeWindow_Buffer; -*/ - - ANativeWindow_Buffer dummyOut; // look like a window for now ... - dummyOut.width = info.width; - dummyOut.height = info.height; - dummyOut.stride = info.stride / 4; // sigh ! - dummyOut.format = info.format; - dummyOut.bits = pixels; - AndroidSalInstance::getInstance()->RedrawWindows (&dummyOut); - - AndroidBitmap_unlockPixels(env, bitmap); -} - -// public static native void registerForDamageCallback(Class destinationClass); -extern "C" SAL_JNI_EXPORT void JNICALL -Java_org_libreoffice_android_AppSupport_registerForDamageCallback(JNIEnv * env, - jobject /* clazz */, - jclass destinationClass) -{ - appClass = (jclass) env->NewGlobalRef(destinationClass); -} - -// public static native void setViewSize(int width, int height); -extern "C" SAL_JNI_EXPORT void JNICALL -Java_org_libreoffice_android_AppSupport_setViewSize(JNIEnv * /* env */, - jobject /* clazz */, - jint width, - jint height) -{ - // Horrible - viewWidth = width; - viewHeight = height; -} - -// public static native void key(char c); -extern "C" SAL_JNI_EXPORT void JNICALL -Java_org_libreoffice_android_AppSupport_key(JNIEnv * /* env */, - jobject /* clazz */, - jchar c) -{ - SalFrame *pFocus = AndroidSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - KeyEvent aEvent(c, c, 0); - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pFocus->GetWindow(), &aEvent); - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pFocus->GetWindow(), &aEvent); - } - else - LOGW("No focused frame to emit event on"); -} - -// public static native void touch(int action, int x, int y); -extern "C" SAL_JNI_EXPORT void JNICALL -Java_org_libreoffice_android_AppSupport_touch(JNIEnv * /* env */, - jobject /* clazz */, - jint action, - jint x, - jint y) -{ - SalFrame *pFocus = AndroidSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - MouseEvent aEvent; - sal_uLong nEvent; - - switch (action) { - case AMOTION_EVENT_ACTION_DOWN: - aEvent = MouseEvent(Point(x, y), 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT); - nEvent = VCLEVENT_WINDOW_MOUSEBUTTONDOWN; - break; - case AMOTION_EVENT_ACTION_UP: - aEvent = MouseEvent(Point(x, y), 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT); - nEvent = VCLEVENT_WINDOW_MOUSEBUTTONUP; - break; - case AMOTION_EVENT_ACTION_MOVE: - aEvent = MouseEvent(Point(x, y), 1, MouseEventModifiers::SIMPLEMOVE, MOUSE_LEFT); - nEvent = VCLEVENT_WINDOW_MOUSEMOVE; - break; - default: - LOGE("AppSupport.touch: Invalid action %d", action); - return; - } - Application::PostMouseEvent(nEvent, pFocus->GetWindow(), &aEvent); - } - else - LOGW("No focused frame to emit event on"); -} - -// public static native void zoom(float scale, int x, int y); -extern "C" SAL_JNI_EXPORT void JNICALL -Java_org_libreoffice_android_AppSupport_zoom(JNIEnv * /* env */, - jobject /* clazz */, - jfloat scale, - jint x, - jint y) -{ - SalFrame *pFocus = AndroidSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - SAL_INFO( "vcl.androidinst", "zoom: " << scale << "@(" << x << "," << y << ")" ); - ZoomEvent aEvent( Point( x, y ), scale); - Application::PostZoomEvent(VCLEVENT_WINDOW_ZOOM, pFocus->GetWindow(), &aEvent); - } - else - LOGW("No focused frame to emit event on"); -} - -// public static native void scroll(int x, int y); -extern "C" SAL_JNI_EXPORT void JNICALL -Java_org_libreoffice_android_AppSupport_scroll(JNIEnv * /* env */, - jobject /* clazz */, - jint x, - jint y) -{ - SalFrame *pFocus = AndroidSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - SAL_INFO( "vcl.androidinst", "scroll: " << "(" << x << "," << y << ")" ); - ScrollEvent aEvent( x, y ); - Application::PostScrollEvent(VCLEVENT_WINDOW_SCROLL, pFocus->GetWindow(), &aEvent); - } - else - LOGW("No focused frame to emit event on"); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |