Add "nodpi" density, and expose a bunch of density-related APIs.

Also update the DpiTest app to use nodpi images, and try to have a mode
where it turns off compatibility though it's not quite working.
This commit is contained in:
Dianne Hackborn 2009-07-17 11:13:48 -07:00 committed by Alex Ray
parent 2d8baa06b5
commit 5fcc03f9b2
2 changed files with 13 additions and 3 deletions

View File

@ -825,7 +825,8 @@ struct ResTable_config
};
enum {
DENSITY_ANY = 0
DENSITY_DEFAULT = 0,
DENSITY_NONE = 0xffff
};
union {

View File

@ -4007,7 +4007,16 @@ void ResTable::print(bool inclValues) const
printf(" NON-INTEGER ResTable_type ADDRESS: %p\n", type);
continue;
}
printf(" config %d lang=%c%c cnt=%c%c orien=%d touch=%d density=%d key=%d infl=%d nav=%d w=%d h=%d lyt=%d\n",
char density[16];
uint16_t dval = dtohs(type->config.density);
if (dval == ResTable_config::DENSITY_DEFAULT) {
strcpy(density, "def");
} else if (dval == ResTable_config::DENSITY_NONE) {
strcpy(density, "non");
} else {
sprintf(density, "%d", (int)dval);
}
printf(" config %d lang=%c%c cnt=%c%c orien=%d touch=%d density=%s key=%d infl=%d nav=%d w=%d h=%d lyt=%d\n",
(int)configIndex,
type->config.language[0] ? type->config.language[0] : '-',
type->config.language[1] ? type->config.language[1] : '-',
@ -4015,7 +4024,7 @@ void ResTable::print(bool inclValues) const
type->config.country[1] ? type->config.country[1] : '-',
type->config.orientation,
type->config.touchscreen,
dtohs(type->config.density),
density,
type->config.keyboard,
type->config.inputFlags,
type->config.navigation,