Atlas - SDL_android.h

Home / ext / SDL2 / src / core / android Lines: 1 | Size: 4399 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2018 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#include "../../SDL_internal.h" 22 23/* Set up for C function definitions, even when using C++ */ 24#ifdef __cplusplus 25/* *INDENT-OFF* */ 26extern "C" { 27/* *INDENT-ON* */ 28#endif 29 30#include <EGL/eglplatform.h> 31#include <android/native_window_jni.h> 32 33#include "SDL_rect.h" 34 35/* Interface from the SDL library into the Android Java activity */ 36extern void Android_JNI_SetActivityTitle(const char *title); 37extern void Android_JNI_SetWindowStyle(SDL_bool fullscreen); 38extern void Android_JNI_SetOrientation(int w, int h, int resizable, const char *hint); 39 40extern SDL_bool Android_JNI_GetAccelerometerValues(float values[3]); 41extern void Android_JNI_ShowTextInput(SDL_Rect *inputRect); 42extern void Android_JNI_HideTextInput(void); 43extern SDL_bool Android_JNI_IsScreenKeyboardShown(void); 44extern ANativeWindow* Android_JNI_GetNativeWindow(void); 45 46extern int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi); 47 48/* Audio support */ 49extern int Android_JNI_OpenAudioDevice(int iscapture, int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames); 50extern void* Android_JNI_GetAudioBuffer(void); 51extern void Android_JNI_WriteAudioBuffer(void); 52extern int Android_JNI_CaptureAudioBuffer(void *buffer, int buflen); 53extern void Android_JNI_FlushCapturedAudio(void); 54extern void Android_JNI_CloseAudioDevice(const int iscapture); 55 56#include "SDL_rwops.h" 57 58int Android_JNI_FileOpen(SDL_RWops* ctx, const char* fileName, const char* mode); 59Sint64 Android_JNI_FileSize(SDL_RWops* ctx); 60Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence); 61size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, size_t size, size_t maxnum); 62size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer, size_t size, size_t num); 63int Android_JNI_FileClose(SDL_RWops* ctx); 64 65/* Environment support */ 66void Android_JNI_GetManifestEnvironmentVariables(void); 67 68/* Clipboard support */ 69int Android_JNI_SetClipboardText(const char* text); 70char* Android_JNI_GetClipboardText(void); 71SDL_bool Android_JNI_HasClipboardText(void); 72 73/* Power support */ 74int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent); 75 76/* Joystick support */ 77void Android_JNI_PollInputDevices(void); 78 79/* Haptic support */ 80void Android_JNI_PollHapticDevices(void); 81void Android_JNI_HapticRun(int device_id, int length); 82void Android_JNI_HapticStop(int device_id); 83 84/* Video */ 85void Android_JNI_SuspendScreenSaver(SDL_bool suspend); 86 87/* Touch support */ 88int Android_JNI_GetTouchDeviceIds(int **ids); 89void Android_JNI_SetSeparateMouseAndTouch(SDL_bool new_value); 90 91/* Threads */ 92#include <jni.h> 93JNIEnv *Android_JNI_GetEnv(void); 94int Android_JNI_SetupThread(void); 95 96/* Generic messages */ 97int Android_JNI_SendMessage(int command, int param); 98 99/* Init */ 100JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls); 101 102/* MessageBox */ 103#include "SDL_messagebox.h" 104int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); 105 106/* Cursor support */ 107int Android_JNI_CreateCustomCursor(SDL_Surface *surface, int hot_x, int hot_y); 108SDL_bool Android_JNI_SetCustomCursor(int cursorID); 109SDL_bool Android_JNI_SetSystemCursor(int cursorID); 110 111/* Relative mouse support */ 112SDL_bool Android_JNI_SupportsRelativeMouse(); 113SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled); 114 115/* Ends C function definitions when using C++ */ 116#ifdef __cplusplus 117/* *INDENT-OFF* */ 118} 119/* *INDENT-ON* */ 120#endif 121 122/* vi: set ts=4 sw=4 expandtab: */ 123
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.