include/SDL_config_android.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 23 Sep 2012 01:37:44 -0700
changeset 6448 64a6297a8b93
parent 6138 4c64952a58fb
child 6885 700f1b25f77f
permissions -rw-r--r--
Fixed bug 1606 - SDL does not implement SDL_GetPowerInfo() for Android.

Philipp Wiesemann 2012-09-22 05:26:11 PDT

currently SDL (HG) does not implement the power management functionality of
SDL_GetPowerInfo() for Android.

I attached a patch which tries to implement this functionality (JNI only, API
5). It supports plugged state and battery percent return values but not
remaining seconds (which are not available on Android).
paul@4700
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6138
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
paul@4700
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
paul@4700
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
paul@4700
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
paul@4700
    20
*/
paul@4700
    21
paul@4700
    22
#ifndef _SDL_config_android_h
paul@4700
    23
#define _SDL_config_android_h
paul@4700
    24
paul@4700
    25
#include "SDL_platform.h"
paul@4700
    26
paul@4700
    27
/**
paul@4700
    28
 *  \file SDL_config_android.h
paul@4700
    29
 *  
paul@4700
    30
 *  This is a configuration that can be used to build SDL for Android
paul@4700
    31
 */
paul@4700
    32
paul@4700
    33
#include <stdarg.h>
paul@4700
    34
paul@4720
    35
#define HAVE_ALLOCA_H		1
paul@4720
    36
#define HAVE_SYS_TYPES_H	1
paul@4720
    37
#define HAVE_STDIO_H	1
paul@4720
    38
#define STDC_HEADERS	1
paul@4720
    39
#define HAVE_STRING_H	1
paul@4720
    40
#define HAVE_INTTYPES_H	1
paul@4720
    41
#define HAVE_STDINT_H	1
paul@4720
    42
#define HAVE_CTYPE_H	1
paul@4720
    43
#define HAVE_MATH_H	1
paul@4720
    44
#define HAVE_SIGNAL_H	1
paul@4720
    45
paul@4720
    46
/* C library functions */
paul@4720
    47
#define HAVE_MALLOC	1
paul@4720
    48
#define HAVE_CALLOC	1
paul@4720
    49
#define HAVE_REALLOC	1
paul@4720
    50
#define HAVE_FREE	1
paul@4720
    51
#define HAVE_ALLOCA	1
paul@4720
    52
#define HAVE_GETENV	1
paul@4720
    53
#define HAVE_SETENV	1
paul@4720
    54
#define HAVE_PUTENV	1
paul@4720
    55
#define HAVE_SETENV	1
paul@4720
    56
#define HAVE_UNSETENV	1
paul@4720
    57
#define HAVE_QSORT	1
paul@4720
    58
#define HAVE_ABS	1
paul@4720
    59
#define HAVE_BCOPY	1
paul@4720
    60
#define HAVE_MEMSET	1
paul@4720
    61
#define HAVE_MEMCPY	1
paul@4720
    62
#define HAVE_MEMMOVE	1
paul@4720
    63
#define HAVE_MEMCMP	1
paul@4720
    64
#define HAVE_STRLEN	1
paul@4720
    65
#define HAVE_STRLCPY	1
paul@4720
    66
#define HAVE_STRLCAT	1
paul@4720
    67
#define HAVE_STRDUP	1
paul@4720
    68
#define HAVE_STRCHR	1
paul@4720
    69
#define HAVE_STRRCHR	1
paul@4720
    70
#define HAVE_STRSTR	1
paul@4720
    71
#define HAVE_STRTOL	1
paul@4720
    72
#define HAVE_STRTOUL	1
paul@4720
    73
#define HAVE_STRTOLL	1
paul@4720
    74
#define HAVE_STRTOULL	1
paul@4720
    75
#define HAVE_STRTOD	1
paul@4720
    76
#define HAVE_ATOI	1
paul@4720
    77
#define HAVE_ATOF	1
paul@4720
    78
#define HAVE_STRCMP	1
paul@4720
    79
#define HAVE_STRNCMP	1
paul@4720
    80
#define HAVE_STRCASECMP	1
paul@4720
    81
#define HAVE_STRNCASECMP 1
paul@4720
    82
#define HAVE_SSCANF	1
paul@4720
    83
#define HAVE_SNPRINTF	1
paul@4720
    84
#define HAVE_VSNPRINTF	1
slouken@4960
    85
#define HAVE_M_PI	1
slouken@4960
    86
#define HAVE_ATAN	1
slouken@4960
    87
#define HAVE_ATAN2	1
paul@4720
    88
#define HAVE_CEIL	1
paul@4720
    89
#define HAVE_COPYSIGN	1
paul@4720
    90
#define HAVE_COS	1
paul@4720
    91
#define HAVE_COSF	1
paul@4720
    92
#define HAVE_FABS	1
paul@4720
    93
#define HAVE_FLOOR	1
paul@4720
    94
#define HAVE_LOG	1
paul@4720
    95
#define HAVE_POW	1
paul@4720
    96
#define HAVE_SCALBN	1
paul@4720
    97
#define HAVE_SIN	1
paul@4720
    98
#define HAVE_SINF	1
paul@4720
    99
#define HAVE_SQRT	1
paul@4720
   100
#define HAVE_SIGACTION	1
paul@4720
   101
#define HAVE_SETJMP	1
paul@4720
   102
#define HAVE_NANOSLEEP	1
paul@4720
   103
#define HAVE_SYSCONF	1
paul@4720
   104
paul@4700
   105
#define SIZEOF_VOIDP 4
paul@4700
   106
slouken@4960
   107
/* Enable various audio drivers */
paul@4719
   108
#define SDL_AUDIO_DRIVER_ANDROID	1
slouken@4960
   109
#define SDL_AUDIO_DRIVER_DUMMY	1
paul@4700
   110
slouken@4960
   111
/* Enable various input drivers */
slouken@4960
   112
#define SDL_JOYSTICK_ANDROID	1
slouken@4960
   113
#define SDL_HAPTIC_DUMMY	1
paul@4700
   114
slouken@4960
   115
/* Enable various shared object loading systems */
slouken@4964
   116
#define SDL_LOADSO_DLOPEN	1
paul@4700
   117
paul@4720
   118
/* Enable various threading systems */
paul@4720
   119
#define SDL_THREAD_PTHREAD	1
paul@4720
   120
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX	1
paul@4700
   121
paul@4720
   122
/* Enable various timer systems */
paul@4720
   123
#define SDL_TIMER_UNIX	1
paul@4700
   124
slouken@4960
   125
/* Enable various video drivers */
paul@4701
   126
#define SDL_VIDEO_DRIVER_ANDROID 1
paul@4700
   127
slouken@4960
   128
/* Enable OpenGL ES */
slouken@4960
   129
#define SDL_VIDEO_OPENGL_ES	1
slouken@4960
   130
#define SDL_VIDEO_RENDER_OGL_ES	1
slouken@5204
   131
#define SDL_VIDEO_RENDER_OGL_ES2	1
paul@4701
   132
slouken@6448
   133
/* Enable system power support */
slouken@6448
   134
#define SDL_POWER_ANDROID 1
slouken@6448
   135
slouken@6448
   136
#endif /* _SDL_config_android_h */