Fix up the mess around fonts and defines.

Change-Id: I3df3dae482ac6f8e9ddcbe2946dba43428bf46b1
This commit is contained in:
Koushik Dutta 2012-01-26 16:49:33 -08:00
parent b20a4812ba
commit 18e3f62ad2
5 changed files with 19 additions and 53 deletions

View File

@ -40,7 +40,16 @@ LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_MDPI_RECOVERY BOARD_HDPI_RECOVERY BOARD_XHDPI_RECOVERY BOARD_UMS_LUNFILE BOARD_RECOVERY_ALWAYS_WIPES BOARD_RECOVERY_HANDLES_MOUNT BOARD_USE_CUSTOM_FONT
ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
BOARD_RECOVERY_CHAR_WIDTH := $(shell echo $(BOARD_USE_CUSTOM_RECOVERY_FONT) | cut -d _ -f 2 | cut -d . -f 1 | cut -d x -f 1)
BOARD_RECOVERY_CHAR_HEIGHT := $(shell echo $(BOARD_USE_CUSTOM_RECOVERY_FONT) | cut -d _ -f 2 | cut -d . -f 1 | cut -d x -f 2)
else
BOARD_RECOVERY_CHAR_WIDTH := 10
BOARD_RECOVERY_CHAR_HEIGHT := 18
endif
LOCAL_CFLAGS += -DBOARD_RECOVERY_CHAR_WIDTH=$(BOARD_RECOVERY_CHAR_WIDTH) -DBOARD_RECOVERY_CHAR_HEIGHT=$(BOARD_RECOVERY_CHAR_HEIGHT)
BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_UMS_LUNFILE BOARD_RECOVERY_ALWAYS_WIPES BOARD_RECOVERY_HANDLES_MOUNT
$(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
$(if $($(board_define)), \

View File

@ -21,20 +21,8 @@ ifeq ($(TARGET_RECOVERY_PIXEL_FORMAT),"BGRA_8888")
LOCAL_CFLAGS += -DRECOVERY_BGRA
endif
ifeq ($(BOARD_XHDPI_RECOVERY),true)
LOCAL_CFLAGS += -DBOARD_XHDPI_RECOVERY
endif
ifeq ($(BOARD_HDPI_RECOVERY),true)
LOCAL_CFLAGS += -DBOARD_HDPI_RECOVERY
endif
ifeq ($(BOARD_MDPI_RECOVERY),true)
LOCAL_CFLAGS += -DBOARD_MDPI_RECOVERY
endif
ifeq ($(BOARD_LDPI_RECOVERY),true)
LOCAL_CFLAGS += -DBOARD_LDPI_RECOVERY
endif
ifeq ($(BOARD_USE_CUSTOM_FONT),true)
LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_FONT
ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT)
endif
include $(BUILD_STATIC_LIBRARY)

View File

@ -23,6 +23,7 @@
#include <linux/input.h>
#include "minui.h"
#include "cutils/log.h"
#define MAX_DEVICES 16
#define MAX_MISC_FDS 16
@ -69,7 +70,7 @@ int ev_init(ev_callback input_cb, void *data)
/* TODO: add ability to specify event masks. For now, just assume
* that only EV_KEY and EV_REL event types are ever needed. */
if (!test_bit(EV_KEY, ev_bits) && !test_bit(EV_REL, ev_bits)) {
if (!test_bit(EV_KEY, ev_bits) && !test_bit(EV_REL, ev_bits) && !test_bit(EV_ABS, ev_bits)) {
close(fd);
continue;
}

View File

@ -30,26 +30,10 @@
#include <pixelflinger/pixelflinger.h>
#if defined(BOARD_XHDPI_RECOVERY)
#ifdef BOARD_USE_CUSTOM_FONT
#include "roboto_15x24.h"
#else
#include "font_10x18.h" // only use the big font if we want custom
#endif
#elif defined(BOARD_HDPI_RECOVERY)
#ifdef BOARD_USE_CUSTOM_FONT
#include "roboto_10x18.h"
#else
#include "font_10x18.h"
#endif
#elif defined(BOARD_LDPI_RECOVERY)
#include "font_7x16.h"
#ifdef BOARD_USE_CUSTOM_RECOVERY_FONT
#include BOARD_USE_CUSTOM_RECOVERY_FONT
#else
#ifdef BOARD_USE_CUSTOM_FONT
#include "roboto_10x18.h"
#else
#include "font_10x18.h"
#endif
#include "font_10x18.h"
#endif
#include "minui.h"

20
ui.c
View File

@ -47,24 +47,8 @@ static int gShowBackButton = 0;
#define MENU_MAX_COLS 64
#define MENU_MAX_ROWS 250
#if defined(BOARD_XHDPI_RECOVERY)
#ifdef BOARD_USE_CUSTOM_FONT // only use big font if we want custom
#define CHAR_WIDTH 15
#define CHAR_HEIGHT 24
#else
#define CHAR_WIDTH 10
#define CHAR_HEIGHT 18
#endif
#elif defined(BOARD_HDPI_RECOVERY)
#define CHAR_WIDTH 10
#define CHAR_HEIGHT 18
#elif defined(BOARD_LDPI_RECOVERY)
#define CHAR_WIDTH 7
#define CHAR_HEIGHT 16
#else
#define CHAR_WIDTH 10
#define CHAR_HEIGHT 18
#endif
#define CHAR_WIDTH BOARD_RECOVERY_CHAR_WIDTH
#define CHAR_HEIGHT BOARD_RECOVERY_CHAR_HEIGHT
#define UI_WAIT_KEY_TIMEOUT_SEC 3600