1 /* Copyright (C) 2007-2008 The Android Open Source Project 2 ** 3 ** This software is licensed under the terms of the GNU General Public 4 ** License version 2, as published by the Free Software Foundation, and 5 ** may be copied, distributed, and modified under those terms. 6 ** 7 ** This program is distributed in the hope that it will be useful, 8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 ** GNU General Public License for more details. 11 */ 12 #ifndef _android_hw_control_h 13 #define _android_hw_control_h 14 15 #include "qemu-common.h" 16 17 /* a callback function called when the system wants to change the brightness 18 * of a given light. 'light' is a string which can be one of: 19 * 'lcd_backlight', 'button_backlight' or 'Keyboard_backlight' 20 * 21 * brightness is an integer (acceptable range are 0..255), however the 22 * default is around 105, and we probably don't want to dim the emulator's 23 * output at that level. 24 */ 25 typedef void (*AndroidHwLightBrightnessFunc)( void* opaque, 26 const char* light, 27 int brightness ); 28 29 /* used to record a hw control 'client' */ 30 typedef struct { 31 AndroidHwLightBrightnessFunc light_brightness; 32 } AndroidHwControlFuncs; 33 34 /* used to initialize the hardware control support */ 35 extern void android_hw_control_init( void ); 36 37 /* used to register a new hw-control back-end */ 38 extern void android_hw_control_set( void* opaque, 39 const AndroidHwControlFuncs* funcs ); 40 41 #endif /* _android_hw_control_h */ 42