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 _SKIN_WINDOW_H 13 #define _SKIN_WINDOW_H 14 15 #include "android/skin/file.h" 16 #include "android/skin/trackball.h" 17 #include <SDL.h> 18 19 typedef struct SkinWindow SkinWindow; 20 21 /* Note: if scale is <= 0, we interpret this as 'auto-detect'. 22 * The behaviour is to use 1.0 by default, unless the resulting 23 * window is too large, in which case the window will automatically 24 * be resized to fit the screen. 25 */ 26 extern SkinWindow* skin_window_create( SkinLayout* layout, 27 int x, 28 int y, 29 double scale, 30 int no_display ); 31 32 extern void skin_window_enable_touch( SkinWindow* window, int enabled ); 33 extern void skin_window_enable_trackball( SkinWindow* window, int enabled ); 34 extern void skin_window_enable_dpad( SkinWindow* window, int enabled ); 35 extern void skin_window_enable_qwerty( SkinWindow* window, int enabled ); 36 37 extern int skin_window_reset ( SkinWindow* window, SkinLayout* layout ); 38 extern void skin_window_free ( SkinWindow* window ); 39 extern void skin_window_redraw( SkinWindow* window, SkinRect* rect ); 40 extern void skin_window_process_event( SkinWindow* window, SDL_Event* ev ); 41 42 extern void skin_window_set_onion( SkinWindow* window, 43 SkinImage* onion, 44 SkinRotation rotation, 45 int alpha ); 46 47 extern void skin_window_set_scale( SkinWindow* window, 48 double scale ); 49 50 extern void skin_window_set_title( SkinWindow* window, 51 const char* title ); 52 53 extern void skin_window_set_trackball( SkinWindow* window, SkinTrackBall* ball ); 54 extern void skin_window_show_trackball( SkinWindow* window, int enable ); 55 extern void skin_window_toggle_fullscreen( SkinWindow* window ); 56 57 /* change the brightness of the emulator LCD screen. 'brightness' will be clamped to 0..255 */ 58 extern void skin_window_set_lcd_brightness( SkinWindow* window, int brightness ); 59 60 typedef struct { 61 int width; 62 int height; 63 SkinRotation rotation; 64 void* data; 65 } ADisplayInfo; 66 67 extern void skin_window_get_display( SkinWindow* window, ADisplayInfo *info ); 68 extern void skin_window_update_display( SkinWindow* window, int x, int y, int w, int h ); 69 70 #endif /* _SKIN_WINDOW_H */ 71