diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-03-16 12:25:23 -0700 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-03-19 08:29:19 -0700 |
commit | 863d1010d9c8fa4342b1b0ea860bcfb096806acc (patch) | |
tree | 6e6bb1fa3e508f9633586b2a4b9db73ffb97d647 /android | |
parent | a342edc996e079f2d1a913ec19d25fd1c118af4e (diff) | |
download | external_qemu-863d1010d9c8fa4342b1b0ea860bcfb096806acc.zip external_qemu-863d1010d9c8fa4342b1b0ea860bcfb096806acc.tar.gz external_qemu-863d1010d9c8fa4342b1b0ea860bcfb096806acc.tar.bz2 |
Cleanup harware properties.
1. Remove unused hw.camera.maxHorizontalPixels, and hw.camera.maxVerticalPixels parameters.
2. Combine hw.touchScreen, and hw.multiTouch under one property: hw.screen
Change-Id: I3cdf64f7d7e46486110cbc0769f9d98a61f0bea5
Diffstat (limited to 'android')
-rw-r--r-- | android/avd/hardware-properties.ini | 29 | ||||
-rw-r--r-- | android/avd/hw-config.c | 18 | ||||
-rw-r--r-- | android/avd/hw-config.h | 7 | ||||
-rw-r--r-- | android/help.c | 2 | ||||
-rw-r--r-- | android/main.c | 26 | ||||
-rw-r--r-- | android/qemulator.c | 4 |
6 files changed, 42 insertions, 44 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini index 241bf54..fdabcb5 100644 --- a/android/avd/hardware-properties.ini +++ b/android/avd/hardware-properties.ini @@ -46,19 +46,12 @@ default = 0 abstract = Device ram size description = The amount of physical RAM on the device, in megabytes. -# Touch screen support -name = hw.touchScreen -type = boolean -default = yes -abstract = Touch-screen support -description = Whether there is a touch screen or not on the device. - -# Multi-touch screen support -name = hw.multiTouch -type = boolean -default = no -abstract = Multi-touch screen support -description = Whether there is a multi-touch screen or not on the device. +# Touch screen type +name = hw.screen +type = string +default = touch +abstract = Touch screen type +description = Defines type of the screen. Can be 'touch', 'multi-touch', or 'no-touch'. # Hardware main keys (back/home) name = hw.mainKeys @@ -128,16 +121,6 @@ default = yes abstract = Camera support description = Whether the device has a camera. -name = hw.camera.maxHorizontalPixels -type = integer -default = 640 -abstract = Maximum horizontal camera pixels - -name = hw.camera.maxVerticalPixels -type = integer -default = 480 -abstract = Maximum vertical camera pixels - # GPS support name = hw.gps type = boolean diff --git a/android/avd/hw-config.c b/android/avd/hw-config.c index 65796d9..2d50ef7 100644 --- a/android/avd/hw-config.c +++ b/android/avd/hw-config.c @@ -125,3 +125,21 @@ androidHwConfig_done( AndroidHwConfig* config ) #include "android/avd/hw-config-defs.h" } + +int +androidHwConfig_isScreenNoTouch( AndroidHwConfig* config ) +{ + return strcmp(config->hw_screen, "no-touch") == 0; +} + +int +androidHwConfig_isScreenTouch( AndroidHwConfig* config ) +{ + return strcmp(config->hw_screen, "touch") == 0; +} + +int +androidHwConfig_isScreenMultiTouch( AndroidHwConfig* config ) +{ + return strcmp(config->hw_screen, "multi-touch") == 0; +} diff --git a/android/avd/hw-config.h b/android/avd/hw-config.h index 3c2480a..fd99e45 100644 --- a/android/avd/hw-config.h +++ b/android/avd/hw-config.h @@ -57,4 +57,11 @@ int androidHwConfig_write( AndroidHwConfig* hwConfig, /* Finalize a given hardware configuration */ void androidHwConfig_done( AndroidHwConfig* config ); +/* Checks if screen doesn't support touch, or multi-touch */ +int androidHwConfig_isScreenNoTouch( AndroidHwConfig* config ); +/* Checks if screen supports touch (but not multi-touch). */ +int androidHwConfig_isScreenTouch( AndroidHwConfig* config ); +/* Checks if screen supports multi-touch. */ +int androidHwConfig_isScreenMultiTouch( AndroidHwConfig* config ); + #endif /* _ANDROID_AVD_HW_CONFIG_H */ diff --git a/android/help.c b/android/help.c index db46d21..db630e0 100644 --- a/android/help.c +++ b/android/help.c @@ -1497,7 +1497,7 @@ help_screen(stralloc_t* out) " touch -> emulate a touch screen\n" " multi-touch -> emulate a multi-touch screen\n" - " off -> disable touch and multi-touch screen emulation\n\n" + " no-touch -> disable touch and multi-touch screen emulation\n\n" " Default mode for screen emulation is 'touch'.\n\n" ); diff --git a/android/main.c b/android/main.c index 5aaf65e..f8ad54b 100644 --- a/android/main.c +++ b/android/main.c @@ -1273,26 +1273,16 @@ int main(int argc, char **argv) /* Setup screen emulation */ if (opts->screen) { - if (!strcmp(opts->screen, "touch")) { - hw->hw_touchScreen = 1; - hw->hw_multiTouch = 0; - } else if (!strcmp(opts->screen, "multi-touch")) { - hw->hw_multiTouch = 1; - hw->hw_touchScreen = 0; - } else if (!strcmp(opts->screen, "off")) { - hw->hw_touchScreen = 0; - hw->hw_multiTouch = 0; - } else { - derror("Invalid value for -screen <mode> parameter: %s\n", opts->screen); - derror("Valid values are: touch, multi-touch, or off\n"); + if (strcmp(opts->screen, "touch") && + strcmp(opts->screen, "multi-touch") && + strcmp(opts->screen, "no-touch")) { + + derror("Invalid value for -screen <mode> parameter: %s\n" + "Valid values are: touch, multi-touch, or no-touch\n", + opts->screen); exit(1); } - } else { - /* If both, touch and multitouch are set in hw.ini, choose multi-touch - * for screen emulation. */ - if (hw->hw_touchScreen && hw->hw_multiTouch) { - hw->hw_touchScreen = 0; - } + hw->hw_screen = ASTRDUP(opts->screen); } while(argc-- > 0) { diff --git a/android/qemulator.c b/android/qemulator.c index cd97510..eb3b59e 100644 --- a/android/qemulator.c +++ b/android/qemulator.c @@ -81,8 +81,8 @@ qemulator_setup( QEmulator* emulator ) qemulator_set_title(emulator); - skin_window_enable_touch ( emulator->window, android_hw->hw_touchScreen != 0 || - android_hw->hw_multiTouch != 0); + skin_window_enable_touch ( emulator->window, + !androidHwConfig_isScreenNoTouch(android_hw)); skin_window_enable_dpad ( emulator->window, android_hw->hw_dPad != 0 ); skin_window_enable_qwerty( emulator->window, android_hw->hw_keyboard != 0 ); skin_window_enable_trackball( emulator->window, android_hw->hw_trackBall != 0 ); |