include/SDL_system.h
changeset 8535 e8ee0708ef5c
parent 8531 d481485a1b85
parent 7766 84b154b1ed71
child 8582 c3e9a2b93517
     1.1 --- a/include/SDL_system.h	Sun Oct 27 14:31:57 2013 -0400
     1.2 +++ b/include/SDL_system.h	Sun Oct 27 21:26:46 2013 -0400
     1.3 @@ -1,169 +1,185 @@
     1.4 -/*
     1.5 -  Simple DirectMedia Layer
     1.6 -  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
     1.7 -
     1.8 -  This software is provided 'as-is', without any express or implied
     1.9 -  warranty.  In no event will the authors be held liable for any damages
    1.10 -  arising from the use of this software.
    1.11 -
    1.12 -  Permission is granted to anyone to use this software for any purpose,
    1.13 -  including commercial applications, and to alter it and redistribute it
    1.14 -  freely, subject to the following restrictions:
    1.15 -
    1.16 -  1. The origin of this software must not be misrepresented; you must not
    1.17 -     claim that you wrote the original software. If you use this software
    1.18 -     in a product, an acknowledgment in the product documentation would be
    1.19 -     appreciated but is not required.
    1.20 -  2. Altered source versions must be plainly marked as such, and must not be
    1.21 -     misrepresented as being the original software.
    1.22 -  3. This notice may not be removed or altered from any source distribution.
    1.23 -*/
    1.24 -
    1.25 -/**
    1.26 - *  \file SDL_system.h
    1.27 - *
    1.28 - *  Include file for platform specific SDL API functions
    1.29 - */
    1.30 -
    1.31 -#ifndef _SDL_system_h
    1.32 -#define _SDL_system_h
    1.33 -
    1.34 -#include "SDL_stdinc.h"
    1.35 -
    1.36 -#if defined(__IPHONEOS__) && __IPHONEOS__
    1.37 -#include "SDL_video.h"
    1.38 -#include "SDL_keyboard.h"
    1.39 -#endif
    1.40 -
    1.41 -#include "begin_code.h"
    1.42 -/* Set up for C function definitions, even when using C++ */
    1.43 -#ifdef __cplusplus
    1.44 -extern "C" {
    1.45 -#endif
    1.46 -
    1.47 -/* Platform specific functions for iOS */
    1.48 -#if defined(__IPHONEOS__) && __IPHONEOS__
    1.49 -
    1.50 -extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
    1.51 -extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
    1.52 -
    1.53 -#endif /* __IPHONEOS__ */
    1.54 -
    1.55 -
    1.56 -/* Platform specific functions for Android */
    1.57 -#if defined(__ANDROID__) && __ANDROID__
    1.58 -
    1.59 -/* Get the JNI environment for the current thread
    1.60 -   This returns JNIEnv*, but the prototype is void* so we don't need jni.h
    1.61 - */
    1.62 -extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
    1.63 -
    1.64 -/* Get the SDL Activity object for the application
    1.65 -   This returns jobject, but the prototype is void* so we don't need jni.h
    1.66 -   The jobject returned by SDL_AndroidGetActivity is a local reference.
    1.67 -   It is the caller's responsibility to properly release it
    1.68 -   (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
    1.69 - */
    1.70 -extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
    1.71 -
    1.72 -/* See the official Android developer guide for more information:
    1.73 -   http://developer.android.com/guide/topics/data/data-storage.html
    1.74 -*/
    1.75 -#define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
    1.76 -#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
    1.77 -
    1.78 -/* Get the path used for internal storage for this application.
    1.79 -   This path is unique to your application and cannot be written to
    1.80 -   by other applications.
    1.81 - */
    1.82 -extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
    1.83 -
    1.84 -/* Get the current state of external storage, a bitmask of these values:
    1.85 -    SDL_ANDROID_EXTERNAL_STORAGE_READ
    1.86 -    SDL_ANDROID_EXTERNAL_STORAGE_WRITE
    1.87 -   If external storage is currently unavailable, this will return 0.
    1.88 -*/
    1.89 -extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
    1.90 -
    1.91 -/* Get the path used for external storage for this application.
    1.92 -   This path is unique to your application, but is public and can be
    1.93 -   written to by other applications.
    1.94 - */
    1.95 -extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
    1.96 -
    1.97 -#endif /* __ANDROID__ */
    1.98 -
    1.99 -
   1.100 -/* Platform specific functions for WinRT */
   1.101 -#if defined(__WINRT__) && __WINRT__
   1.102 -
   1.103 -/**
   1.104 - *  \brief WinRT / Windows Phone path types
   1.105 - */
   1.106 -typedef enum
   1.107 -{
   1.108 -    /** \brief The installed app's root directory.
   1.109 -        Files here are likely to be read-only. */
   1.110 -    SDL_WINRT_PATH_INSTALLED_LOCATION,
   1.111 -
   1.112 -    /** \brief The app's local data store.  Files may be written here */
   1.113 -    SDL_WINRT_PATH_LOCAL_FOLDER,
   1.114 -
   1.115 -    /** \brief The app's roaming data store.  Unsupported on Windows Phone.
   1.116 -        Files written here may be copied to other machines via a network
   1.117 -        connection.
   1.118 -    */
   1.119 -    SDL_WINRT_PATH_ROAMING_FOLDER,
   1.120 -
   1.121 -    /** \brief The app's temporary data store.  Unsupported on Windows Phone.
   1.122 -        Files written here may be deleted at any time. */
   1.123 -    SDL_WINRT_PATH_TEMP_FOLDER
   1.124 -} SDL_WinRT_Path;
   1.125 -
   1.126 -
   1.127 -/**
   1.128 - *  \brief Retrieves a WinRT defined path on the local file system
   1.129 - *
   1.130 - *  \note Documentation on most app-specific path types on WinRT
   1.131 - *      can be found on MSDN, at the URL:
   1.132 - *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.133 - *
   1.134 - *  \param pathType The type of path to retrieve.
   1.135 - *  \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL
   1.136 - *      if the path is not available for any reason.  Not all paths are
   1.137 - *      available on all versions of Windows.  This is especially true on
   1.138 - *      Windows Phone.  Check the documentation for the given
   1.139 - *      SDL_WinRT_Path for more information on which path types are
   1.140 - *      supported where.
   1.141 - */
   1.142 -extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
   1.143 -
   1.144 -/**
   1.145 - *  \brief Retrieves a WinRT defined path on the local file system
   1.146 - *
   1.147 - *  \note Documentation on most app-specific path types on WinRT
   1.148 - *      can be found on MSDN, at the URL:
   1.149 - *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.150 - *
   1.151 - *  \param pathType The type of path to retrieve.
   1.152 - *  \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
   1.153 - *      if the path is not available for any reason.  Not all paths are
   1.154 - *      available on all versions of Windows.  This is especially true on
   1.155 - *      Windows Phone.  Check the documentation for the given
   1.156 - *      SDL_WinRT_Path for more information on which path types are
   1.157 - *      supported where.
   1.158 - */
   1.159 -extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
   1.160 -
   1.161 -#endif /* __WINRT__ */
   1.162 -
   1.163 -
   1.164 -/* Ends C function definitions when using C++ */
   1.165 -#ifdef __cplusplus
   1.166 -}
   1.167 -#endif
   1.168 -#include "close_code.h"
   1.169 -
   1.170 -#endif /* _SDL_system_h */
   1.171 -
   1.172 -/* vi: set ts=4 sw=4 expandtab: */
   1.173 +/*
   1.174 +  Simple DirectMedia Layer
   1.175 +  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
   1.176 +
   1.177 +  This software is provided 'as-is', without any express or implied
   1.178 +  warranty.  In no event will the authors be held liable for any damages
   1.179 +  arising from the use of this software.
   1.180 +
   1.181 +  Permission is granted to anyone to use this software for any purpose,
   1.182 +  including commercial applications, and to alter it and redistribute it
   1.183 +  freely, subject to the following restrictions:
   1.184 +
   1.185 +  1. The origin of this software must not be misrepresented; you must not
   1.186 +     claim that you wrote the original software. If you use this software
   1.187 +     in a product, an acknowledgment in the product documentation would be
   1.188 +     appreciated but is not required.
   1.189 +  2. Altered source versions must be plainly marked as such, and must not be
   1.190 +     misrepresented as being the original software.
   1.191 +  3. This notice may not be removed or altered from any source distribution.
   1.192 +*/
   1.193 +
   1.194 +/**
   1.195 + *  \file SDL_system.h
   1.196 + *
   1.197 + *  Include file for platform specific SDL API functions
   1.198 + */
   1.199 +
   1.200 +#ifndef _SDL_system_h
   1.201 +#define _SDL_system_h
   1.202 +
   1.203 +#include "SDL_stdinc.h"
   1.204 +#include "SDL_keyboard.h"
   1.205 +#include "SDL_render.h"
   1.206 +#include "SDL_video.h"
   1.207 +
   1.208 +#include "begin_code.h"
   1.209 +/* Set up for C function definitions, even when using C++ */
   1.210 +#ifdef __cplusplus
   1.211 +extern "C" {
   1.212 +#endif
   1.213 +
   1.214 +
   1.215 +/* Platform specific functions for Windows */
   1.216 +#ifdef __WIN32__
   1.217 +
   1.218 +/* Returns the D3D9 adapter index that matches the specified display index.
   1.219 +   This adapter index can be passed to IDirect3D9::CreateDevice and controls
   1.220 +   on which monitor a full screen application will appear.
   1.221 +*/
   1.222 +extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
   1.223 +
   1.224 +/* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
   1.225 +   Once you are done using the device, you should release it to avoid a resource leak.
   1.226 + */
   1.227 +typedef struct IDirect3DDevice9 IDirect3DDevice9;
   1.228 +extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
   1.229 +
   1.230 +#endif /* __WIN32__ */
   1.231 +
   1.232 +
   1.233 +/* Platform specific functions for iOS */
   1.234 +#if defined(__IPHONEOS__) && __IPHONEOS__
   1.235 +
   1.236 +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
   1.237 +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
   1.238 +
   1.239 +#endif /* __IPHONEOS__ */
   1.240 +
   1.241 +
   1.242 +/* Platform specific functions for Android */
   1.243 +#if defined(__ANDROID__) && __ANDROID__
   1.244 +
   1.245 +/* Get the JNI environment for the current thread
   1.246 +   This returns JNIEnv*, but the prototype is void* so we don't need jni.h
   1.247 + */
   1.248 +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
   1.249 +
   1.250 +/* Get the SDL Activity object for the application
   1.251 +   This returns jobject, but the prototype is void* so we don't need jni.h
   1.252 +   The jobject returned by SDL_AndroidGetActivity is a local reference.
   1.253 +   It is the caller's responsibility to properly release it
   1.254 +   (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
   1.255 + */
   1.256 +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
   1.257 +
   1.258 +/* See the official Android developer guide for more information:
   1.259 +   http://developer.android.com/guide/topics/data/data-storage.html
   1.260 +*/
   1.261 +#define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
   1.262 +#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
   1.263 +
   1.264 +/* Get the path used for internal storage for this application.
   1.265 +   This path is unique to your application and cannot be written to
   1.266 +   by other applications.
   1.267 + */
   1.268 +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
   1.269 +
   1.270 +/* Get the current state of external storage, a bitmask of these values:
   1.271 +    SDL_ANDROID_EXTERNAL_STORAGE_READ
   1.272 +    SDL_ANDROID_EXTERNAL_STORAGE_WRITE
   1.273 +   If external storage is currently unavailable, this will return 0.
   1.274 +*/
   1.275 +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
   1.276 +
   1.277 +/* Get the path used for external storage for this application.
   1.278 +   This path is unique to your application, but is public and can be
   1.279 +   written to by other applications.
   1.280 + */
   1.281 +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
   1.282 +
   1.283 +#endif /* __ANDROID__ */
   1.284 +
   1.285 +/* Platform specific functions for WinRT */
   1.286 +#if defined(__WINRT__) && __WINRT__
   1.287 +
   1.288 +/**
   1.289 + *  \brief WinRT / Windows Phone path types
   1.290 + */
   1.291 +typedef enum
   1.292 +{
   1.293 +    /** \brief The installed app's root directory.
   1.294 +        Files here are likely to be read-only. */
   1.295 +    SDL_WINRT_PATH_INSTALLED_LOCATION,
   1.296 +
   1.297 +    /** \brief The app's local data store.  Files may be written here */
   1.298 +    SDL_WINRT_PATH_LOCAL_FOLDER,
   1.299 +
   1.300 +    /** \brief The app's roaming data store.  Unsupported on Windows Phone.
   1.301 +        Files written here may be copied to other machines via a network
   1.302 +        connection.
   1.303 +    */
   1.304 +    SDL_WINRT_PATH_ROAMING_FOLDER,
   1.305 +
   1.306 +    /** \brief The app's temporary data store.  Unsupported on Windows Phone.
   1.307 +        Files written here may be deleted at any time. */
   1.308 +    SDL_WINRT_PATH_TEMP_FOLDER
   1.309 +} SDL_WinRT_Path;
   1.310 +
   1.311 +
   1.312 +/**
   1.313 + *  \brief Retrieves a WinRT defined path on the local file system
   1.314 + *
   1.315 + *  \note Documentation on most app-specific path types on WinRT
   1.316 + *      can be found on MSDN, at the URL:
   1.317 + *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.318 + *
   1.319 + *  \param pathType The type of path to retrieve.
   1.320 + *  \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL
   1.321 + *      if the path is not available for any reason.  Not all paths are
   1.322 + *      available on all versions of Windows.  This is especially true on
   1.323 + *      Windows Phone.  Check the documentation for the given
   1.324 + *      SDL_WinRT_Path for more information on which path types are
   1.325 + *      supported where.
   1.326 + */
   1.327 +extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
   1.328 +
   1.329 +/**
   1.330 + *  \brief Retrieves a WinRT defined path on the local file system
   1.331 + *
   1.332 + *  \note Documentation on most app-specific path types on WinRT
   1.333 + *      can be found on MSDN, at the URL:
   1.334 + *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.335 + *
   1.336 + *  \param pathType The type of path to retrieve.
   1.337 + *  \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
   1.338 + *      if the path is not available for any reason.  Not all paths are
   1.339 + *      available on all versions of Windows.  This is especially true on
   1.340 + *      Windows Phone.  Check the documentation for the given
   1.341 + *      SDL_WinRT_Path for more information on which path types are
   1.342 + *      supported where.
   1.343 + */
   1.344 +extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
   1.345 +
   1.346 +#endif /* __WINRT__ */
   1.347 +
   1.348 +
   1.349 +/* Ends C function definitions when using C++ */
   1.350 +#ifdef __cplusplus
   1.351 +}
   1.352 +#endif
   1.353 +#include "close_code.h"
   1.354 +
   1.355 +#endif /* _SDL_system_h */
   1.356 +
   1.357 +/* vi: set ts=4 sw=4 expandtab: */