src/video/android/SDL_androidclipboard.c
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Fri, 10 May 2013 21:14:13 +0200
changeset 7164 893f7ef37f3d
parent 7117 23c36c7533dd
child 8093 b43765095a6f
permissions -rw-r--r--
Added missing vi lines.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6888
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     1
/*
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     2
  Simple DirectMedia Layer
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     4
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     5
  This software is provided 'as-is', without any express or implied
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     7
  arising from the use of this software.
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     8
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    11
  freely, subject to the following restrictions:
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    12
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    14
     claim that you wrote the original software. If you use this software
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    16
     appreciated but is not required.
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    18
     misrepresented as being the original software.
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
e87e7a7b9d08 Added SDL license to Android clipboard implementation
Sam Lantinga <slouken@libsdl.org>
parents: 6464
diff changeset
    20
*/
6464
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
#include "SDL_config.h"
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
#if SDL_VIDEO_DRIVER_ANDROID
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
#include "SDL_androidvideo.h"
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    26
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
#include "../../core/android/SDL_android.h"
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
int
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
Android_SetClipboardText(_THIS, const char *text)
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
{
7117
23c36c7533dd Replaces tabs with four spaces in C source file.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 6888
diff changeset
    32
    return Android_JNI_SetClipboardText(text);
6464
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
}
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
char *
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
Android_GetClipboardText(_THIS)
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
{
7117
23c36c7533dd Replaces tabs with four spaces in C source file.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 6888
diff changeset
    38
    return Android_JNI_GetClipboardText();
6464
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
}
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
SDL_bool Android_HasClipboardText(_THIS)
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
{
7117
23c36c7533dd Replaces tabs with four spaces in C source file.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 6888
diff changeset
    43
    return Android_JNI_HasClipboardText();
6464
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    44
}
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
ab55284b389f Fixed bug 1573 - SDL does not support system clipboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
#endif /* SDL_VIDEO_DRIVER_ANDROID */
7164
893f7ef37f3d Added missing vi lines.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 7117
diff changeset
    47
893f7ef37f3d Added missing vi lines.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 7117
diff changeset
    48
/* vi: set ts=4 sw=4 expandtab: */