skinclr.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef TATAKI_SKINCLR_H
  2. #define TATAKI_SKINCLR_H
  3. #include <tataki/export.h>
  4. #include "filteredcolor.h"
  5. // note: only pass in a const char *
  6. class TATAKIAPI SkinColor : public FilteredColor
  7. {
  8. public:
  9. explicit SkinColor(const wchar_t *name=NULL, const wchar_t *colorgroup=NULL);
  10. ~SkinColor();
  11. virtual void setColor(ARGB32 c);
  12. ARGB32 v(ARGB32 defaultColor=0xFFFF00FF);
  13. operator int() { return v(); }
  14. void setElementName(const wchar_t *name);
  15. const wchar_t *operator =(const wchar_t *name);
  16. virtual const wchar_t *getColorName();
  17. int iteratorValid(); // if FALSE, color might have changed
  18. // if you just need to do a one-off skin color query, use this function
  19. // because SkinColor class does some malloc'ing
  20. static ARGB32 GetColor(const wchar_t *name, const wchar_t *group = 0, ARGB32 defaultColor=0xFFFF00FF);
  21. static bool TryGetColor(ARGB32 *color, const wchar_t *name, const wchar_t *group = 0);
  22. private:
  23. wchar_t *name;
  24. ARGB32 *val;
  25. int latest_iteration;
  26. const wchar_t *ovr_grp;
  27. int color_override;
  28. int dooverride;
  29. };
  30. #endif