qemulator.h revision 3bbc919b70c78e0be6387d06faa90743deedb4dc
1/* Copyright (C) 2006-2010 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 13#ifndef QEMU_ANDROID_QEMULATOR_H 14#define QEMU_ANDROID_QEMULATOR_H 15 16#include "android/config.h" 17#include "android/skin/file.h" 18#include "android/skin/keyboard.h" 19#include "android/skin/window.h" 20#include "android/cmdline-option.h" 21 22typedef struct { 23 AConfig* aconfig; 24 SkinFile* layout_file; 25 SkinLayout* layout; 26 SkinKeyboard* keyboard; 27 SkinWindow* window; 28 int win_x; 29 int win_y; 30 int show_trackball; 31 SkinTrackBall* trackball; 32 int lcd_brightness; 33 SkinImage* onion; 34 SkinRotation onion_rotation; 35 int onion_alpha; 36 37 AndroidOptions opts[1]; /* copy of options */ 38} QEmulator; 39 40/* Gets a pointer to a QEmulator structure instance. */ 41QEmulator* 42qemulator_get(void); 43 44/* Initializes QEmulator structure instance. */ 45int 46qemulator_init( QEmulator* emulator, 47 AConfig* aconfig, 48 const char* basepath, 49 int x, 50 int y, 51 AndroidOptions* opts ); 52 53void 54qemulator_get_screen_size( QEmulator* emulator, 55 int *width, 56 int *height ); 57 58/* Uninitializes QEmulator structure instance on exit. */ 59void 60qemulator_done( QEmulator* emulator ); 61 62/* Sets title on the emulator's window. */ 63void 64qemulator_set_title( QEmulator* emulator ); 65 66/* Gets emulator's layout. */ 67SkinLayout* 68qemulator_get_layout( QEmulator* emulator ); 69 70/* Gets framebuffer for the first display. */ 71QFrameBuffer* 72qemulator_get_first_framebuffer(QEmulator* emulator); 73 74/* A helper routine for getting device DPI. */ 75int 76get_device_dpi( AndroidOptions* opts ); 77 78#endif // QEMU_ANDROID_QEMULATOR_H 79