common.h 648 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef COMMON_H
  2. #define COMMON_H
  3. #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
  4. #define MIN(X,Y) (X) < (Y) ? (X) : (Y)
  5. #define MAX(X,Y) (X) > (Y) ? (X) : (Y)
  6. struct Size{
  7. int width;
  8. int height;
  9. };
  10. struct Rect{
  11. int x;
  12. int y;
  13. int width;
  14. int height;
  15. };
  16. struct Point{
  17. int x;
  18. int y;
  19. };
  20. enum ScreenPowerMode {
  21. // see <https://android.googlesource.com/platform/frameworks/base.git/+/pie-release-2/core/java/android/view/SurfaceControl.java#305>
  22. SPM_OFF = 0,
  23. SPM_NORMAL = 2,
  24. };
  25. enum MirrorMode {
  26. MIRROR_OFF = 0,
  27. MIRROR_ON = 1,
  28. };
  29. class common
  30. {
  31. public:
  32. common();
  33. };
  34. #endif // COMMON_H