summaryrefslogtreecommitdiffstats
path: root/gui/resources.hpp
diff options
context:
space:
mode:
authorthat <github@that.at>2015-02-14 20:23:16 +0100
committerthat <github@that.at>2015-02-15 20:36:40 +0100
commitf6ed8fc1f51e368bb76905d9f1d2d3735e70a644 (patch)
treeba66418d418869274d259ce35cca8d4021d8ce4e /gui/resources.hpp
parentRetain and display previous selection for image flashing (diff)
downloadandroid_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.gz
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.bz2
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.lz
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.xz
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.zst
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.zip
Diffstat (limited to 'gui/resources.hpp')
-rw-r--r--gui/resources.hpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/gui/resources.hpp b/gui/resources.hpp
index cc5e7b6ff..69d24279f 100644
--- a/gui/resources.hpp
+++ b/gui/resources.hpp
@@ -17,8 +17,8 @@ public:
virtual ~Resource() {}
public:
- virtual void* GetResource(void) = 0;
- std::string GetName(void) { return mName; }
+ std::string GetName() { return mName; }
+ virtual bool loadedOK() = 0;
private:
std::string mName;
@@ -44,7 +44,10 @@ public:
virtual ~FontResource();
public:
- virtual void* GetResource(void) { return mFont; }
+ void* GetResource() { return this ? mFont : NULL; }
+ int GetHeight() { return gr_getMaxFontHeight(this ? mFont : NULL); }
+
+ virtual bool loadedOK() { return mFont != NULL; }
protected:
void* mFont;
@@ -58,7 +61,11 @@ public:
virtual ~ImageResource();
public:
- virtual void* GetResource(void) { return mSurface; }
+ gr_surface GetResource() { return this ? mSurface : NULL; }
+ int GetWidth() { return gr_get_width(this ? mSurface : NULL); }
+ int GetHeight() { return gr_get_height(this ? mSurface : NULL); }
+
+ virtual bool loadedOK() { return mSurface != NULL; }
protected:
gr_surface mSurface;
@@ -71,9 +78,12 @@ public:
virtual ~AnimationResource();
public:
- virtual void* GetResource(void) { return mSurfaces.empty() ? NULL : mSurfaces.at(0); }
- virtual void* GetResource(int entry) { return mSurfaces.empty() ? NULL : mSurfaces.at(entry); }
- virtual int GetResourceCount(void) { return mSurfaces.size(); }
+ gr_surface GetResource() { return (!this || mSurfaces.empty()) ? NULL : mSurfaces.at(0); }
+ gr_surface GetResource(int entry) { return (!this || mSurfaces.empty()) ? NULL : mSurfaces.at(entry); }
+ int GetWidth() { return gr_get_width(this ? GetResource() : NULL); }
+ int GetHeight() { return gr_get_height(this ? GetResource() : NULL); }
+ int GetResourceCount() { return mSurfaces.size(); }
+ virtual bool loadedOK() { return !mSurfaces.empty(); }
protected:
std::vector<gr_surface> mSurfaces;