main-common.h revision 74d7acec6643694132a127feb5ccadda7ea793d6
1/* Copyright (C) 2011 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_MAIN_COMMON_H 13#define ANDROID_MAIN_COMMON_H 14 15#include <stdint.h> 16#include "android/cmdline-option.h" 17#include "android/skin/keyset.h" 18#include "android/config.h" 19 20/* Common routines used by both android/main.c and android/main-ui.c */ 21 22/** Emulator user configuration (e.g. last window position) 23 **/ 24 25void emulator_config_init( void ); 26void emulator_config_done( void ); 27 28void emulator_config_get_window_pos( int *window_x, int *window_y ); 29 30#define ONE_MB (1024*1024) 31 32unsigned convertBytesToMB( uint64_t size ); 33uint64_t convertMBToBytes( unsigned megaBytes ); 34 35extern SkinKeyset* android_keyset; 36void parse_keyset(const char* keyset, AndroidOptions* opts); 37void write_default_keyset( void ); 38 39extern const char* skin_network_speed; 40extern const char* skin_network_delay; 41 42/* Find the skin corresponding to our options, and return an AConfig pointer 43 * and the base path to load skin data from 44 */ 45void parse_skin_files(const char* skinDirPath, 46 const char* skinName, 47 AndroidOptions* opts, 48 AConfig* *skinConfig, 49 char* *skinPath); 50 51/* Returns the amount of pixels used by the default display. */ 52int64_t get_screen_pixels(AConfig* skinConfig); 53 54void init_sdl_ui(AConfig* skinConfig, 55 const char* skinPath, 56 AndroidOptions* opts); 57 58#endif /* ANDROID_MAIN_COMMON_H */ 59