src/video/android/SDL_androidclipboard.c
author Sam Lantinga <slouken@libsdl.org>
Wed, 26 Sep 2012 20:14:37 -0700
changeset 6464 ab55284b389f
child 6888 e87e7a7b9d08
permissions -rw-r--r--
Fixed bug 1573 - SDL does not support system clipboard on Android.

Philipp Wiesemann 2012-08-18 14:09:47 PDT

there is currently no way in SDL to interact with the system clipboard on
Android.

I attached a patch which tries to implement the three clipboard functions for
Android. It does not add the CLIPBOARDUPDATE event because this seems to
require Android API 11 or polling.
slouken@6464
     1
#include "SDL_config.h"
slouken@6464
     2
slouken@6464
     3
#if SDL_VIDEO_DRIVER_ANDROID
slouken@6464
     4
slouken@6464
     5
#include "SDL_androidvideo.h"
slouken@6464
     6
slouken@6464
     7
#include "../../core/android/SDL_android.h"
slouken@6464
     8
slouken@6464
     9
int
slouken@6464
    10
Android_SetClipboardText(_THIS, const char *text)
slouken@6464
    11
{
slouken@6464
    12
	return Android_JNI_SetClipboardText(text);
slouken@6464
    13
}
slouken@6464
    14
slouken@6464
    15
char *
slouken@6464
    16
Android_GetClipboardText(_THIS)
slouken@6464
    17
{
slouken@6464
    18
	return Android_JNI_GetClipboardText();
slouken@6464
    19
}
slouken@6464
    20
slouken@6464
    21
SDL_bool Android_HasClipboardText(_THIS)
slouken@6464
    22
{
slouken@6464
    23
	return Android_JNI_HasClipboardText();
slouken@6464
    24
}
slouken@6464
    25
slouken@6464
    26
#endif /* SDL_VIDEO_DRIVER_ANDROID */