summaryrefslogtreecommitdiffstats
path: root/minui/include
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-06-15 11:30:44 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-06-15 11:30:44 +0200
commit16cda5abbac102c1003ad88bb633f7c12e32df7e (patch)
tree9ae3f7e14f980805a70e7a639623f93afb7b0ee2 /minui/include
parentSnap for 4832164 from 821d03bb6f53ac4ef772fa39159a4beba103ffd5 to qt-release (diff)
parentMerge "updater_sample: add metadata mismatch error code" am: 9ed4b41478 am: c48f0b6923 (diff)
downloadandroid_bootable_recovery-16cda5abbac102c1003ad88bb633f7c12e32df7e.tar
android_bootable_recovery-16cda5abbac102c1003ad88bb633f7c12e32df7e.tar.gz
android_bootable_recovery-16cda5abbac102c1003ad88bb633f7c12e32df7e.tar.bz2
android_bootable_recovery-16cda5abbac102c1003ad88bb633f7c12e32df7e.tar.lz
android_bootable_recovery-16cda5abbac102c1003ad88bb633f7c12e32df7e.tar.xz
android_bootable_recovery-16cda5abbac102c1003ad88bb633f7c12e32df7e.tar.zst
android_bootable_recovery-16cda5abbac102c1003ad88bb633f7c12e32df7e.zip
Diffstat (limited to 'minui/include')
-rw-r--r--minui/include/minui/minui.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/minui/include/minui/minui.h b/minui/include/minui/minui.h
index e96b7ae08..ef4abe252 100644
--- a/minui/include/minui/minui.h
+++ b/minui/include/minui/minui.h
@@ -48,7 +48,13 @@ enum GRRotation {
ROTATION_LEFT = 3,
};
+// Initializes the graphics backend and loads font file. Returns 0 on success, or -1 on error. Note
+// that the font initialization failure would be non-fatal, as caller may not need to draw any text
+// at all. Caller can check the font initialization result via gr_sys_font() as needed.
int gr_init();
+
+// Frees the allocated resources. The function is idempotent, and safe to be called if gr_init()
+// didn't finish successfully.
void gr_exit();
int gr_fb_width();
@@ -57,7 +63,8 @@ int gr_fb_height();
void gr_flip();
void gr_fb_blank(bool blank);
-void gr_clear(); // clear entire surface to current color
+// Clears entire surface to current color.
+void gr_clear();
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);
@@ -66,16 +73,16 @@ void gr_texticon(int x, int y, GRSurface* icon);
const GRFont* gr_sys_font();
int gr_init_font(const char* name, GRFont** dest);
void gr_text(const GRFont* font, int x, int y, const char* s, bool bold);
-// Return -1 if font is nullptr.
+// Returns -1 if font is nullptr.
int gr_measure(const GRFont* font, const char* s);
-// Return -1 if font is nullptr.
+// Returns -1 if font is nullptr.
int gr_font_size(const GRFont* font, int* x, int* y);
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);
+unsigned int gr_get_width(const GRSurface* surface);
+unsigned int gr_get_height(const GRSurface* surface);
-// Set rotation, flips gr_fb_width/height if 90 degree rotation difference
+// Sets rotation, flips gr_fb_width/height if 90 degree rotation difference
void gr_rotate(GRRotation rotation);
//