From f6ed8fc1f51e368bb76905d9f1d2d3735e70a644 Mon Sep 17 00:00:00 2001 From: that Date: Sat, 14 Feb 2015 20:23:16 +0100 Subject: gui: make resources type safe - add string, int, color and resource loading helpers - use typed resource classes, and some cleanup in loading code - remove abstract GetResource() to enforce type safe access - add height and width query methods to resources and use them - minor cleanup - simplify LoadPlacement Change-Id: I9b81785109a80b3806ad6b50cba4d893b87b0db1 --- gui/pages.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gui/pages.hpp') diff --git a/gui/pages.hpp b/gui/pages.hpp index b042c0db8..31ccadb51 100644 --- a/gui/pages.hpp +++ b/gui/pages.hpp @@ -17,12 +17,15 @@ enum TOUCH_STATE { TOUCH_REPEAT = 4 }; -typedef struct { +struct COLOR { unsigned char red; unsigned char green; unsigned char blue; unsigned char alpha; -} COLOR; + COLOR() : red(0), green(0), blue(0), alpha(0) {} + COLOR(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 255) + : red(r), green(g), blue(b), alpha(a) {} +}; // Utility Functions int ConvertStrToColor(std::string str, COLOR* color); -- cgit v1.2.3