aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-control.h
blob: 67a9bc7d2f9996b4f67f195413026740e466337c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* Copyright (C) 2007-2008 The Android Open Source Project
**
** This software is licensed under the terms of the GNU General Public
** License version 2, as published by the Free Software Foundation, and
** may be copied, distributed, and modified under those terms.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
*/
#ifndef _android_hw_control_h
#define _android_hw_control_h

#include "qemu-common.h"

/* a callback function called when the system wants to change the brightness
 * of a given light. 'light' is a string which can be one of:
 * 'lcd_backlight', 'button_backlight' or 'Keyboard_backlight'
 *
 * brightness is an integer (acceptable range are 0..255), however the
 * default is around 105, and we probably don't want to dim the emulator's
 * output at that level.
 */
typedef void  (*AndroidHwLightBrightnessFunc)( void*       opaque,
                                               const char* light,
                                               int         brightness );

/* used to record a hw control 'client' */
typedef struct {
    AndroidHwLightBrightnessFunc  light_brightness;
} AndroidHwControlFuncs;

/* used to initialize the hardware control support */
extern void  android_hw_control_init( void );

/* used to register a new hw-control back-end */
extern void  android_hw_control_set( void*                         opaque,
                                      const AndroidHwControlFuncs*  funcs );

#endif /* _android_hw_control_h */