diff options
Diffstat (limited to 'minuitwrp/minui.h')
-rw-r--r-- | minuitwrp/minui.h | 18 |
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; |