hgui.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef HGUI_H
  2. #define HGUI_H
  3. #include "hdef.h"
  4. typedef uint32 HColor; // 0xAARRGGBB
  5. #define CLR_B(c) ( c & 0xff)
  6. #define CLR_G(c) ((c >> 8) & 0xff)
  7. #define CLR_R(c) ((c >> 16) & 0xff)
  8. #define CLR_A(c) ((c >> 24) & 0xff)
  9. #define ARGB(a, r, g, b) MAKE_FOURCC(a,r,g,b)
  10. typedef struct hpoint_s{
  11. int x;
  12. int y;
  13. #ifdef __cplusplus
  14. hpoint_s(){
  15. x = y = 0;
  16. }
  17. hpoint_s(int x, int y){
  18. this->x = x;
  19. this->y = y;
  20. }
  21. #endif
  22. }HPoint;
  23. typedef struct hsize_s{
  24. int w;
  25. int h;
  26. #ifdef __cplusplus
  27. hsize_s(){
  28. w = h = 0;
  29. }
  30. hsize_s(int w, int h){
  31. this->w = w;
  32. this->h = h;
  33. }
  34. #endif
  35. }HSize;
  36. typedef struct hrect_s{
  37. int x;
  38. int y;
  39. int w;
  40. int h;
  41. #ifdef __cplusplus
  42. hrect_s(){
  43. x = y = w = h = 0;
  44. }
  45. hrect_s(int x, int y, int w, int h){
  46. this->x = x;
  47. this->y = y;
  48. this->w = w;
  49. this->h = h;
  50. }
  51. int left() {return x;}
  52. int right() {return x+w;}
  53. int top() {return y;}
  54. int bottom() {return y+h;}
  55. #endif
  56. }HRect;
  57. #endif // HGUI_H