1/* Copyright (C) 2009 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_USER_CONFIG_H 13#define _ANDROID_USER_CONFIG_H 14 15#include "android/avd/info.h" 16#include <stdint.h> 17 18/* a structure used to model the user-configuration settings 19 * 20 * At the moment, this is only used to store the last position 21 * of the emulator window and a unique 64-bit UUID. We might 22 * add more AVD-specific preferences here in the future. 23 * 24 * By definition, these settings should be optional and we 25 * should be able to work without them, unlike the AVD 26 * configuration information found in config.ini 27 */ 28typedef struct AUserConfig AUserConfig; 29 30/* Create a new AUserConfig object from a given AvdInfo */ 31AUserConfig* auserConfig_new( AvdInfo* info ); 32 33/* Retrieve the unique UID for this AVD */ 34uint64_t auserConfig_getUUID( AUserConfig* uconfig ); 35 36/* Retrieve the stored window position for this AVD */ 37void auserConfig_getWindowPos( AUserConfig* uconfig, int *pX, int *pY ); 38 39/* Change the stored window position for this AVD */ 40void auserConfig_setWindowPos( AUserConfig* uconfig, int x, int y ); 41 42/* Save the user configuration back to the content directory. 43 * Should be used in an atexit() handler. This will effectively 44 * only save the user configuration to disk if its content 45 * has changed. 46 */ 47void auserConfig_save( AUserConfig* uconfig ); 48 49/* */ 50 51#endif /* _ANDROID_USER_CONFIG_H */ 52