summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk1
-rw-r--r--device.cpp18
-rw-r--r--device.h6
-rw-r--r--minui/graphics.cpp4
-rw-r--r--minui/graphics.h6
-rw-r--r--minui/graphics_adf.cpp8
-rw-r--r--minui/graphics_fbdev.cpp8
-rw-r--r--minui/minui.h23
-rw-r--r--minui/resources.cpp36
-rw-r--r--recovery.cpp14
-rw-r--r--screen_ui.cpp98
-rw-r--r--screen_ui.h29
12 files changed, 126 insertions, 125 deletions
diff --git a/Android.mk b/Android.mk
index a34c2659d..0484065a1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -72,6 +72,7 @@ LOCAL_STATIC_LIBRARIES := \
libminui \
libpng \
libfs_mgr \
+ libbase \
libcutils \
liblog \
libselinux \
diff --git a/device.cpp b/device.cpp
index 024fc3465..fd1a9875b 100644
--- a/device.cpp
+++ b/device.cpp
@@ -16,20 +16,6 @@
#include "device.h"
-static const char* REGULAR_HEADERS[] = {
- "Volume up/down move highlight.",
- "Power button activates.",
- "",
- NULL
-};
-
-static const char* LONG_PRESS_HEADERS[] = {
- "Any button cycles highlight.",
- "Long-press activates.",
- "",
- NULL
-};
-
static const char* MENU_ITEMS[] = {
"Reboot system now",
"Reboot to bootloader",
@@ -43,10 +29,6 @@ static const char* MENU_ITEMS[] = {
NULL
};
-const char* const* Device::GetMenuHeaders() {
- return ui_->HasThreeButtons() ? REGULAR_HEADERS : LONG_PRESS_HEADERS;
-}
-
const char* const* Device::GetMenuItems() {
return MENU_ITEMS;
}
diff --git a/device.h b/device.h
index 150718359..dad8ccd56 100644
--- a/device.h
+++ b/device.h
@@ -70,12 +70,6 @@ class Device {
MOUNT_SYSTEM = 10,
};
- // Return the headers (an array of strings, one per line,
- // NULL-terminated) for the main menu. Typically these tell users
- // what to push to move the selection and invoke the selected
- // item.
- virtual const char* const* GetMenuHeaders();
-
// Return the list of menu items (an array of strings,
// NULL-terminated). The menu_position passed to InvokeMenuItem
// will correspond to the indexes into this array.
diff --git a/minui/graphics.cpp b/minui/graphics.cpp
index d7d6e8d5a..f09f1c6b0 100644
--- a/minui/graphics.cpp
+++ b/minui/graphics.cpp
@@ -103,7 +103,7 @@ static void text_blend(unsigned char* src_p, int src_row_bytes,
}
}
-void gr_text(int x, int y, const char *s, int bold)
+void gr_text(int x, int y, const char *s, bool bold)
{
GRFont* font = gr_font;
@@ -326,7 +326,7 @@ static void gr_test() {
gr_clear();
gr_color(255, 0, 0, 255);
- gr_surface frame = images[x%frames];
+ GRSurface* frame = images[x%frames];
gr_blit(frame, 0, 0, frame->width, frame->height, x, 0);
gr_color(255, 0, 0, 128);
diff --git a/minui/graphics.h b/minui/graphics.h
index ed229a0c8..81a923383 100644
--- a/minui/graphics.h
+++ b/minui/graphics.h
@@ -21,13 +21,13 @@
// TODO: lose the function pointers.
struct minui_backend {
- // Initializes the backend and returns a gr_surface to draw into.
- gr_surface (*init)(minui_backend*);
+ // Initializes the backend and returns a GRSurface* to draw into.
+ GRSurface* (*init)(minui_backend*);
// Causes the current drawing surface (returned by the most recent
// call to flip() or init()) to be displayed, and returns a new
// drawing surface.
- gr_surface (*flip)(minui_backend*);
+ GRSurface* (*flip)(minui_backend*);
// Blank (or unblank) the screen.
void (*blank)(minui_backend*, bool);
diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp
index ea7c0abe1..5d0867f58 100644
--- a/minui/graphics_adf.cpp
+++ b/minui/graphics_adf.cpp
@@ -47,7 +47,7 @@ struct adf_pdata {
adf_surface_pdata surfaces[2];
};
-static gr_surface adf_flip(minui_backend *backend);
+static GRSurface* adf_flip(minui_backend *backend);
static void adf_blank(minui_backend *backend, bool blank);
static int adf_surface_init(adf_pdata *pdata, drm_mode_modeinfo *mode, adf_surface_pdata *surf) {
@@ -134,12 +134,12 @@ static int adf_device_init(adf_pdata *pdata, adf_device *dev)
return err;
}
-static gr_surface adf_init(minui_backend *backend)
+static GRSurface* adf_init(minui_backend *backend)
{
adf_pdata *pdata = (adf_pdata *)backend;
adf_id_t *dev_ids = NULL;
ssize_t n_dev_ids, i;
- gr_surface ret;
+ GRSurface* ret;
#if defined(RECOVERY_ABGR)
pdata->format = DRM_FORMAT_ABGR8888;
@@ -193,7 +193,7 @@ static gr_surface adf_init(minui_backend *backend)
return ret;
}
-static gr_surface adf_flip(minui_backend *backend)
+static GRSurface* adf_flip(minui_backend *backend)
{
adf_pdata *pdata = (adf_pdata *)backend;
adf_surface_pdata *surf = &pdata->surfaces[pdata->current_surface];
diff --git a/minui/graphics_fbdev.cpp b/minui/graphics_fbdev.cpp
index 9dbdde810..997e9cac2 100644
--- a/minui/graphics_fbdev.cpp
+++ b/minui/graphics_fbdev.cpp
@@ -33,8 +33,8 @@
#include "minui.h"
#include "graphics.h"
-static gr_surface fbdev_init(minui_backend*);
-static gr_surface fbdev_flip(minui_backend*);
+static GRSurface* fbdev_init(minui_backend*);
+static GRSurface* fbdev_flip(minui_backend*);
static void fbdev_blank(minui_backend*, bool);
static void fbdev_exit(minui_backend*);
@@ -79,7 +79,7 @@ static void set_displayed_framebuffer(unsigned n)
displayed_buffer = n;
}
-static gr_surface fbdev_init(minui_backend* backend) {
+static GRSurface* fbdev_init(minui_backend* backend) {
int fd = open("/dev/graphics/fb0", O_RDWR);
if (fd == -1) {
perror("cannot open fb0");
@@ -174,7 +174,7 @@ static gr_surface fbdev_init(minui_backend* backend) {
return gr_draw;
}
-static gr_surface fbdev_flip(minui_backend* backend __unused) {
+static GRSurface* fbdev_flip(minui_backend* backend __unused) {
if (double_buffered) {
#if defined(RECOVERY_BGRA)
// In case of BGRA, do some byte swapping
diff --git a/minui/minui.h b/minui/minui.h
index eca3a5030..bdde083f3 100644
--- a/minui/minui.h
+++ b/minui/minui.h
@@ -33,9 +33,6 @@ struct GRSurface {
unsigned char* data;
};
-// TODO: remove this.
-typedef GRSurface* gr_surface;
-
int gr_init();
void gr_exit();
@@ -48,14 +45,14 @@ void gr_fb_blank(bool blank);
void gr_clear(); // clear entire surface to current color
void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
void gr_fill(int x1, int y1, int x2, int y2);
-void gr_text(int x, int y, const char *s, int bold);
-void gr_texticon(int x, int y, gr_surface icon);
+void gr_text(int x, int y, const char *s, bool bold);
+void gr_texticon(int x, int y, GRSurface* icon);
int gr_measure(const char *s);
void gr_font_size(int *x, int *y);
-void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy);
-unsigned int gr_get_width(gr_surface surface);
-unsigned int gr_get_height(gr_surface surface);
+void gr_blit(GRSurface* source, int sx, int sy, int w, int h, int dx, int dy);
+unsigned int gr_get_width(GRSurface* surface);
+unsigned int gr_get_height(GRSurface* surface);
//
// Input events.
@@ -98,17 +95,17 @@ int ev_get_epollfd();
// All these functions load PNG images from "/res/images/${name}.png".
// Load a single display surface from a PNG image.
-int res_create_display_surface(const char* name, gr_surface* pSurface);
+int res_create_display_surface(const char* name, GRSurface** pSurface);
// Load an array of display surfaces from a single PNG image. The PNG
// should have a 'Frames' text chunk whose value is the number of
// frames this image represents. The pixel data itself is interlaced
// by row.
int res_create_multi_display_surface(const char* name,
- int* frames, gr_surface** pSurface);
+ int* frames, GRSurface*** pSurface);
// Load a single alpha surface from a grayscale PNG image.
-int res_create_alpha_surface(const char* name, gr_surface* pSurface);
+int res_create_alpha_surface(const char* name, GRSurface** pSurface);
// Load part of a grayscale PNG image that is the first match for the
// given locale. The image is expected to be a composite of multiple
@@ -117,10 +114,10 @@ int res_create_alpha_surface(const char* name, gr_surface* pSurface);
// development/tools/recovery_l10n for an app that will generate these
// specialized images from Android resources.
int res_create_localized_alpha_surface(const char* name, const char* locale,
- gr_surface* pSurface);
+ GRSurface** pSurface);
// Free a surface allocated by any of the res_create_*_surface()
// functions.
-void res_free_surface(gr_surface surface);
+void res_free_surface(GRSurface* surface);
#endif
diff --git a/minui/resources.cpp b/minui/resources.cpp
index fa413b608..5e4789277 100644
--- a/minui/resources.cpp
+++ b/minui/resources.cpp
@@ -36,11 +36,11 @@ extern char* locale;
#define SURFACE_DATA_ALIGNMENT 8
-static gr_surface malloc_surface(size_t data_size) {
+static GRSurface* malloc_surface(size_t data_size) {
size_t size = sizeof(GRSurface) + data_size + SURFACE_DATA_ALIGNMENT;
unsigned char* temp = reinterpret_cast<unsigned char*>(malloc(size));
if (temp == NULL) return NULL;
- gr_surface surface = (gr_surface) temp;
+ GRSurface* surface = reinterpret_cast<GRSurface*>(temp);
surface->data = temp + sizeof(GRSurface) +
(SURFACE_DATA_ALIGNMENT - (sizeof(GRSurface) % SURFACE_DATA_ALIGNMENT));
return surface;
@@ -138,12 +138,10 @@ static int open_png(const char* name, png_structp* png_ptr, png_infop* info_ptr,
// framebuffer pixel format; they need to be modified if the
// framebuffer format changes (but nothing else should).
-// Allocate and return a gr_surface sufficient for storing an image of
+// Allocate and return a GRSurface* sufficient for storing an image of
// the indicated size in the framebuffer pixel format.
-static gr_surface init_display_surface(png_uint_32 width, png_uint_32 height) {
- gr_surface surface;
-
- surface = malloc_surface(width * height * 4);
+static GRSurface* init_display_surface(png_uint_32 width, png_uint_32 height) {
+ GRSurface* surface = malloc_surface(width * height * 4);
if (surface == NULL) return NULL;
surface->width = width;
@@ -199,8 +197,8 @@ static void transform_rgb_to_draw(unsigned char* input_row,
}
}
-int res_create_display_surface(const char* name, gr_surface* pSurface) {
- gr_surface surface = NULL;
+int res_create_display_surface(const char* name, GRSurface** pSurface) {
+ GRSurface* surface = NULL;
int result = 0;
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
@@ -239,8 +237,8 @@ int res_create_display_surface(const char* name, gr_surface* pSurface) {
return result;
}
-int res_create_multi_display_surface(const char* name, int* frames, gr_surface** pSurface) {
- gr_surface* surface = NULL;
+int res_create_multi_display_surface(const char* name, int* frames, GRSurface*** pSurface) {
+ GRSurface** surface = NULL;
int result = 0;
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
@@ -275,7 +273,7 @@ int res_create_multi_display_surface(const char* name, int* frames, gr_surface**
goto exit;
}
- surface = reinterpret_cast<gr_surface*>(malloc(*frames * sizeof(gr_surface)));
+ surface = reinterpret_cast<GRSurface**>(malloc(*frames * sizeof(GRSurface*)));
if (surface == NULL) {
result = -8;
goto exit;
@@ -302,7 +300,7 @@ int res_create_multi_display_surface(const char* name, int* frames, gr_surface**
}
free(p_row);
- *pSurface = (gr_surface*) surface;
+ *pSurface = reinterpret_cast<GRSurface**>(surface);
exit:
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
@@ -318,8 +316,8 @@ exit:
return result;
}
-int res_create_alpha_surface(const char* name, gr_surface* pSurface) {
- gr_surface surface = NULL;
+int res_create_alpha_surface(const char* name, GRSurface** pSurface) {
+ GRSurface* surface = NULL;
int result = 0;
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
@@ -384,8 +382,8 @@ static int matches_locale(const char* loc, const char* locale) {
int res_create_localized_alpha_surface(const char* name,
const char* locale,
- gr_surface* pSurface) {
- gr_surface surface = NULL;
+ GRSurface** pSurface) {
+ GRSurface* surface = NULL;
int result = 0;
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
@@ -440,7 +438,7 @@ int res_create_localized_alpha_surface(const char* name,
memcpy(surface->data + i*w, row, w);
}
- *pSurface = (gr_surface) surface;
+ *pSurface = reinterpret_cast<GRSurface*>(surface);
break;
} else {
int i;
@@ -456,6 +454,6 @@ exit:
return result;
}
-void res_free_surface(gr_surface surface) {
+void res_free_surface(GRSurface* surface) {
free(surface);
}
diff --git a/recovery.cpp b/recovery.cpp
index f7ae5e71b..4dd827919 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -629,7 +629,7 @@ static char* browse_directory(const char* path, Device* device) {
z_size += d_size;
zips[z_size] = NULL;
- const char* headers[] = { "Choose a package to install:", path, "", NULL };
+ const char* headers[] = { "Choose a package to install:", path, NULL };
char* result;
int chosen_item = 0;
@@ -668,7 +668,7 @@ static char* browse_directory(const char* path, Device* device) {
}
static bool yes_no(Device* device, const char* question1, const char* question2) {
- const char* headers[] = { question1, question2, "", NULL };
+ const char* headers[] = { question1, question2, NULL };
const char* items[] = { " No", " Yes", NULL };
int chosen_item = get_menu_selection(headers, items, 1, 0, device);
@@ -743,7 +743,7 @@ static void choose_recovery_file(Device* device) {
entries[n++] = filename;
}
- const char* headers[] = { "Select file to view", "", NULL };
+ const char* headers[] = { "Select file to view", NULL };
while (true) {
int chosen_item = get_menu_selection(headers, entries, 1, 0, device);
@@ -791,8 +791,6 @@ static int apply_from_sdcard(Device* device, bool* wipe_cache) {
// on if the --shutdown_after flag was passed to recovery.
static Device::BuiltinAction
prompt_and_wait(Device* device, int status) {
- const char* const* headers = device->GetMenuHeaders();
-
for (;;) {
finish_recovery(NULL);
switch (status) {
@@ -808,7 +806,7 @@ prompt_and_wait(Device* device, int status) {
}
ui->SetProgressType(RecoveryUI::EMPTY);
- int chosen_item = get_menu_selection(headers, device->GetMenuItems(), 0, 0, device);
+ int chosen_item = get_menu_selection(nullptr, device->GetMenuItems(), 0, 0, device);
// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
@@ -1038,10 +1036,6 @@ main(int argc, char **argv) {
property_list(print_property, NULL);
printf("\n");
- char recovery_build[PROPERTY_VALUE_MAX];
- property_get("ro.build.display.id", recovery_build, "");
-
- ui->Print("%s\n", recovery_build);
ui->Print("Supported API: %d\n", RECOVERY_API_VERSION);
int status = INSTALL_SUCCESS;
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 76793350a..5e73d37c4 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -30,6 +30,8 @@
#include <vector>
+#include "base/strings.h"
+#include "cutils/properties.h"
#include "common.h"
#include "device.h"
#include "minui/minui.h"
@@ -66,7 +68,6 @@ ScreenRecoveryUI::ScreenRecoveryUI() :
show_text_ever(false),
menu(nullptr),
show_menu(false),
- menu_top(0),
menu_items(0),
menu_sel(0),
animation_fps(20),
@@ -88,11 +89,11 @@ void ScreenRecoveryUI::draw_background_locked(Icon icon) {
gr_clear();
if (icon) {
- gr_surface surface = backgroundIcon[icon];
+ GRSurface* surface = backgroundIcon[icon];
if (icon == INSTALLING_UPDATE || icon == ERASING) {
surface = installation[installingFrame];
}
- gr_surface text_surface = backgroundText[icon];
+ GRSurface* text_surface = backgroundText[icon];
int iconWidth = gr_get_width(surface);
int iconHeight = gr_get_height(surface);
@@ -131,7 +132,7 @@ void ScreenRecoveryUI::draw_progress_locked() {
if (currentIcon == ERROR) return;
if (currentIcon == INSTALLING_UPDATE || currentIcon == ERASING) {
- gr_surface icon = installation[installingFrame];
+ GRSurface* icon = installation[installingFrame];
gr_blit(icon, 0, 0, gr_get_width(icon), gr_get_height(icon), iconX, iconY);
}
@@ -174,6 +175,9 @@ void ScreenRecoveryUI::draw_progress_locked() {
void ScreenRecoveryUI::SetColor(UIElement e) {
switch (e) {
+ case INFO:
+ gr_color(249, 194, 0, 255);
+ break;
case HEADER:
gr_color(247, 0, 6, 255);
break;
@@ -188,7 +192,7 @@ void ScreenRecoveryUI::SetColor(UIElement e) {
gr_color(255, 255, 255, 255);
break;
case LOG:
- gr_color(249, 194, 0, 255);
+ gr_color(196, 196, 196, 255);
break;
case TEXT_FILL:
gr_color(0, 0, 0, 160);
@@ -203,9 +207,31 @@ void ScreenRecoveryUI::DrawHorizontalRule(int* y) {
SetColor(MENU);
*y += 4;
gr_fill(0, *y, gr_fb_width(), *y + 2);
- *y += 8;
+ *y += 4;
+}
+
+void ScreenRecoveryUI::DrawTextLine(int* y, const char* line, bool bold) {
+ gr_text(4, *y, line, bold);
+ *y += char_height + 4;
}
+void ScreenRecoveryUI::DrawTextLines(int* y, const char* const* lines) {
+ for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) {
+ DrawTextLine(y, lines[i], false);
+ }
+}
+
+static const char* REGULAR_HELP[] = {
+ "Use volume up/down and power.",
+ NULL
+};
+
+static const char* LONG_PRESS_HELP[] = {
+ "Any button cycles highlight.",
+ "Long-press activates.",
+ NULL
+};
+
// Redraw everything on the screen. Does not flip pages.
// Should only be called with updateMutex locked.
void ScreenRecoveryUI::draw_screen_locked() {
@@ -218,39 +244,49 @@ void ScreenRecoveryUI::draw_screen_locked() {
int y = 0;
if (show_menu) {
- SetColor(HEADER);
+ char recovery_fingerprint[PROPERTY_VALUE_MAX];
+ property_get("ro.bootimage.build.fingerprint", recovery_fingerprint, "");
+
+ SetColor(INFO);
+ DrawTextLine(&y, "Android Recovery", true);
+ for (auto& chunk : android::base::Split(recovery_fingerprint, ":")) {
+ DrawTextLine(&y, chunk.c_str(), false);
+ }
+ DrawTextLines(&y, HasThreeButtons() ? REGULAR_HELP : LONG_PRESS_HELP);
- for (int i = 0; i < menu_top + menu_items; ++i) {
- if (i == menu_top) DrawHorizontalRule(&y);
+ SetColor(HEADER);
+ DrawTextLines(&y, menu_headers);
- if (i == menu_top + menu_sel) {
- // draw the highlight bar
+ SetColor(MENU);
+ DrawHorizontalRule(&y);
+ y += 4;
+ for (int i = 0; i < menu_items; ++i) {
+ if (i == menu_sel) {
+ // Draw the highlight bar.
SetColor(IsLongPress() ? MENU_SEL_BG_ACTIVE : MENU_SEL_BG);
- gr_fill(0, y-2, gr_fb_width(), y+char_height+2);
- // white text of selected item
+ gr_fill(0, y - 2, gr_fb_width(), y + char_height + 2);
+ // Bold white text for the selected item.
SetColor(MENU_SEL_FG);
- if (menu[i][0]) gr_text(4, y, menu[i], 1);
+ gr_text(4, y, menu[i], true);
SetColor(MENU);
} else {
- if (menu[i][0]) gr_text(4, y, menu[i], i < menu_top);
+ gr_text(4, y, menu[i], false);
}
- y += char_height+4;
+ y += char_height + 4;
}
-
DrawHorizontalRule(&y);
}
- SetColor(LOG);
-
// display from the bottom up, until we hit the top of the
// screen, the bottom of the menu, or we've displayed the
// entire text buffer.
+ SetColor(LOG);
int row = (text_top+text_rows-1) % text_rows;
size_t count = 0;
for (int ty = gr_fb_height() - char_height;
ty >= y && count < text_rows;
ty -= char_height, ++count) {
- gr_text(0, ty, text[row], 0);
+ gr_text(0, ty, text[row], false);
--row;
if (row < 0) row = text_rows-1;
}
@@ -321,21 +357,21 @@ void ScreenRecoveryUI::ProgressThreadLoop() {
}
}
-void ScreenRecoveryUI::LoadBitmap(const char* filename, gr_surface* surface) {
+void ScreenRecoveryUI::LoadBitmap(const char* filename, GRSurface** surface) {
int result = res_create_display_surface(filename, surface);
if (result < 0) {
LOGE("missing bitmap %s\n(Code %d)\n", filename, result);
}
}
-void ScreenRecoveryUI::LoadBitmapArray(const char* filename, int* frames, gr_surface** surface) {
+void ScreenRecoveryUI::LoadBitmapArray(const char* filename, int* frames, GRSurface*** surface) {
int result = res_create_multi_display_surface(filename, frames, surface);
if (result < 0) {
LOGE("missing bitmap %s\n(Code %d)\n", filename, result);
}
}
-void ScreenRecoveryUI::LoadLocalizedBitmap(const char* filename, gr_surface* surface) {
+void ScreenRecoveryUI::LoadLocalizedBitmap(const char* filename, GRSurface** surface) {
int result = res_create_localized_alpha_surface(filename, locale, surface);
if (result < 0) {
LOGE("missing bitmap %s\n(Code %d)\n", filename, result);
@@ -580,19 +616,13 @@ void ScreenRecoveryUI::StartMenu(const char* const * headers, const char* const
int initial_selection) {
pthread_mutex_lock(&updateMutex);
if (text_rows > 0 && text_cols > 0) {
- size_t i;
- for (i = 0; i < text_rows; ++i) {
- if (headers[i] == nullptr) break;
- strncpy(menu[i], headers[i], text_cols-1);
- menu[i][text_cols-1] = '\0';
- }
- menu_top = i;
- for (; i < text_rows; ++i) {
- if (items[i-menu_top] == nullptr) break;
- strncpy(menu[i], items[i-menu_top], text_cols-1);
+ menu_headers = headers;
+ size_t i = 0;
+ for (; i < text_rows && items[i] != nullptr; ++i) {
+ strncpy(menu[i], items[i], text_cols-1);
menu[i][text_cols-1] = '\0';
}
- menu_items = i - menu_top;
+ menu_items = i;
show_menu = true;
menu_sel = initial_selection;
update_screen_locked();
diff --git a/screen_ui.h b/screen_ui.h
index 50a456425..46165d90c 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -61,7 +61,9 @@ class ScreenRecoveryUI : public RecoveryUI {
void Redraw();
- enum UIElement { HEADER, MENU, MENU_SEL_BG, MENU_SEL_BG_ACTIVE, MENU_SEL_FG, LOG, TEXT_FILL };
+ enum UIElement {
+ HEADER, MENU, MENU_SEL_BG, MENU_SEL_BG_ACTIVE, MENU_SEL_FG, LOG, TEXT_FILL, INFO
+ };
void SetColor(UIElement e);
private:
@@ -71,13 +73,13 @@ class ScreenRecoveryUI : public RecoveryUI {
bool rtl_locale;
pthread_mutex_t updateMutex;
- gr_surface backgroundIcon[5];
- gr_surface backgroundText[5];
- gr_surface *installation;
- gr_surface progressBarEmpty;
- gr_surface progressBarFill;
- gr_surface stageMarkerEmpty;
- gr_surface stageMarkerFill;
+ GRSurface* backgroundIcon[5];
+ GRSurface* backgroundText[5];
+ GRSurface** installation;
+ GRSurface* progressBarEmpty;
+ GRSurface* progressBarFill;
+ GRSurface* stageMarkerEmpty;
+ GRSurface* stageMarkerFill;
ProgressType progressBarType;
@@ -95,8 +97,9 @@ class ScreenRecoveryUI : public RecoveryUI {
bool show_text_ever; // has show_text ever been true?
char** menu;
+ const char* const* menu_headers;
bool show_menu;
- int menu_top, menu_items, menu_sel;
+ int menu_items, menu_sel;
pthread_t progress_thread_;
@@ -121,10 +124,12 @@ class ScreenRecoveryUI : public RecoveryUI {
void ClearText();
void DrawHorizontalRule(int* y);
+ void DrawTextLine(int* y, const char* line, bool bold);
+ void DrawTextLines(int* y, const char* const* lines);
- void LoadBitmap(const char* filename, gr_surface* surface);
- void LoadBitmapArray(const char* filename, int* frames, gr_surface** surface);
- void LoadLocalizedBitmap(const char* filename, gr_surface* surface);
+ void LoadBitmap(const char* filename, GRSurface** surface);
+ void LoadBitmapArray(const char* filename, int* frames, GRSurface*** surface);
+ void LoadLocalizedBitmap(const char* filename, GRSurface** surface);
};
#endif // RECOVERY_UI_H