Create 'get_powerstate' function for frontend driver

This commit is contained in:
twinaphex 2015-04-18 13:56:26 +02:00
parent 6b15d7d2ea
commit b721389234
11 changed files with 20 additions and 0 deletions

View File

@ -869,5 +869,6 @@ const frontend_ctx_driver_t frontend_ctx_android = {
NULL, /* get_os */
frontend_android_get_rating, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"android",
};

View File

@ -312,5 +312,6 @@ const frontend_ctx_driver_t frontend_ctx_apple = {
frontend_apple_get_os, /* get_os */
frontend_apple_get_rating, /* get_rating */
frontend_apple_load_content, /* load_content */
NULL, /* get_powerstate */
"apple",
};

View File

@ -199,5 +199,6 @@ const frontend_ctx_driver_t frontend_ctx_ctr = {
NULL, /* get_os */
frontend_ctr_get_rating, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"ctr",
};

View File

@ -389,5 +389,6 @@ const frontend_ctx_driver_t frontend_ctx_gx = {
NULL, /* get_os */
frontend_gx_get_rating, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"gx",
};

View File

@ -34,5 +34,6 @@ const frontend_ctx_driver_t frontend_ctx_null = {
NULL, /* get_os */
NULL, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"null",
};

View File

@ -452,5 +452,6 @@ const frontend_ctx_driver_t frontend_ctx_ps3 = {
NULL, /* get_os */
frontend_ps3_get_rating, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"ps3",
};

View File

@ -249,5 +249,6 @@ const frontend_ctx_driver_t frontend_ctx_psp = {
NULL, /* get_os */
frontend_psp_get_rating, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"psp",
};

View File

@ -72,5 +72,6 @@ const frontend_ctx_driver_t frontend_ctx_qnx = {
NULL, /* get_os */
frontend_qnx_get_rating, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"qnx",
};

View File

@ -138,5 +138,6 @@ const frontend_ctx_driver_t frontend_ctx_win32 = {
frontend_win32_get_os, /* get_os */
NULL, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"win32",
};

View File

@ -380,5 +380,6 @@ const frontend_ctx_driver_t frontend_ctx_xdk = {
NULL, /* get_os */
frontend_xdk_get_rating, /* get_rating */
NULL, /* load_content */
NULL, /* get_powerstate */
"xdk",
};

View File

@ -28,6 +28,15 @@
extern "C" {
#endif
enum frontend_powerstate
{
FRONTEND_POWERSTATE_NONE = 0,
FRONTEND_POWERSTATE_NO_SOURCE,
FRONTEND_POWERSTATE_CHARGING,
FRONTEND_POWERSTATE_CHARGED,
FRONTEND_POWERSTATE_ON_POWER_SOURCE,
};
typedef void (*environment_get_t)(int *argc, char *argv[], void *args,
void *params_data);
typedef void (*process_args_t)(int *argc, char *argv[]);
@ -47,6 +56,7 @@ typedef struct frontend_ctx_driver
void (*get_os)(char *, size_t, int *major, int *minor);
int (*get_rating)(void);
void (*content_loaded)(void);
enum frontend_powerstate (*get_powerstate)(int *seconds, int *percent);
const char *ident;