summaryrefslogtreecommitdiffstats
path: root/minuitwrp/minui.h
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2018-07-02 23:04:03 +0200
committerEthan Yonker <dees_troy@teamw.in>2019-03-18 17:39:38 +0100
commitd32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5 (patch)
treeb61769e4756a3500a7ccc1fe9399b7de0af4d47c /minuitwrp/minui.h
parentAB/Non AB Devices: updates for moving cache (diff)
downloadandroid_bootable_recovery-d32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5.tar
android_bootable_recovery-d32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5.tar.gz
android_bootable_recovery-d32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5.tar.bz2
android_bootable_recovery-d32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5.tar.lz
android_bootable_recovery-d32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5.tar.xz
android_bootable_recovery-d32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5.tar.zst
android_bootable_recovery-d32b7ebf20217f5053aaf0597cc1a7dcf86fc2a5.zip
Diffstat (limited to 'minuitwrp/minui.h')
-rw-r--r--minuitwrp/minui.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/minuitwrp/minui.h b/minuitwrp/minui.h
index 018f3274f..2c462e75f 100644
--- a/minuitwrp/minui.h
+++ b/minuitwrp/minui.h
@@ -58,7 +58,8 @@ int gr_getMaxFontHeight(void *font);
void *gr_ttf_loadFont(const char *filename, int size, int dpi);
void *gr_ttf_scaleFont(void *font, int max_width, int measured_width);
void gr_ttf_freeFont(void *font);
-int gr_ttf_textExWH(void *context, int x, int y, const char *s, void *pFont, int max_width, int max_height);
+int gr_ttf_textExWH(void *context, int x, int y, const char *s, void *pFont,
+ int max_width, int max_height, const gr_surface gr_draw);
int gr_ttf_measureEx(const char *s, void *font);
int gr_ttf_maxExW(const char *s, void *font, int max_width);
int gr_ttf_getMaxFontHeight(void *font);
@@ -73,6 +74,21 @@ int gr_free_surface(gr_surface surface);
// Functions in graphics_utils.c
int gr_save_screenshot(const char *dest);
+// Transform minuitwrp API coordinates into display coordinates,
+// for panels that are hardware-mounted in a rotated manner.
+#define ROTATION_X_DISP(x, y, surface) \
+ ((TW_ROTATION == 0) ? (x) : \
+ (TW_ROTATION == 90) ? ((surface)->width - (y) - 1) : \
+ (TW_ROTATION == 180) ? ((surface)->width - (x) - 1) : \
+ (TW_ROTATION == 270) ? (y) : -1)
+#define ROTATION_Y_DISP(x, y, surface) \
+ ((TW_ROTATION == 0) ? (y) : \
+ (TW_ROTATION == 90) ? (x) : \
+ (TW_ROTATION == 180) ? ((surface)->height - (y) - 1) : \
+ (TW_ROTATION == 270) ? ((surface)->height - (x) - 1) : -1)
+
+void surface_ROTATION_transform(gr_surface dst_ptr, const gr_surface src_ptr, size_t num_bytes_per_pixel);
+
// input event structure, include <linux/input.h> for the definition.
// see http://www.mjmwired.net/kernel/Documentation/input/ for info.
struct input_event;