µGFX library fork

gdisp_rules.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * This file is subject to the terms of the GFX License. If a copy of
  3. * the license was not distributed with this file, you can obtain one at:
  4. *
  5. * http://ugfx.org/license.html
  6. */
  7. /**
  8. * @file src/gdisp/gdisp_rules.h
  9. * @brief GDISP safety rules header file.
  10. *
  11. * @addtogroup GDISP
  12. * @{
  13. */
  14. #ifndef _GDISP_RULES_H
  15. #define _GDISP_RULES_H
  16. #if GFX_USE_GDISP
  17. #if !GFX_USE_GDRIVER
  18. #if GFX_DISPLAY_RULE_WARNINGS
  19. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  20. #warning "GDISP: GFX_USE_GDRIVER is required. GFX_USE_GDRIVER has turned on for you."
  21. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  22. COMPILER_WARNING("GDISP: GFX_USE_GDRIVER is required. GFX_USE_GDRIVER has turned on for you.")
  23. #endif
  24. #endif
  25. #undef GFX_USE_GDRIVER
  26. #define GFX_USE_GDRIVER TRUE
  27. #endif
  28. #if defined(GDISP_DRIVER_LIST)
  29. #if GDISP_TOTAL_DISPLAYS != 1
  30. #error "GDISP Multiple Drivers: You can't specify both GDISP_TOTAL_DISPLAYS and GDISP_DRIVER_LIST"
  31. #endif
  32. #ifndef GDISP_PIXELFORMAT
  33. #error "GDISP Multiple Drivers: You must specify a value for GDISP_PIXELFORMAT when using GDISP_DRIVER_LIST"
  34. #endif
  35. #endif
  36. #if GDISP_NEED_AUTOFLUSH && GDISP_NEED_TIMERFLUSH
  37. #if GFX_DISPLAY_RULE_WARNINGS
  38. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  39. #warning "GDISP: Both GDISP_NEED_AUTOFLUSH and GDISP_NEED_TIMERFLUSH has been set. GDISP_NEED_TIMERFLUSH has been disabled for you."
  40. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  41. COMPILER_WARNING("GDISP: Both GDISP_NEED_AUTOFLUSH and GDISP_NEED_TIMERFLUSH has been set. GDISP_NEED_TIMERFLUSH has been disabled for you.")
  42. #endif
  43. #endif
  44. #undef GDISP_NEED_TIMERFLUSH
  45. #define GDISP_NEED_TIMERFLUSH FALSE
  46. #endif
  47. #if GDISP_NEED_TIMERFLUSH
  48. #if GDISP_NEED_TIMERFLUSH < 50 || GDISP_NEED_TIMERFLUSH > 1200
  49. #error "GDISP: GDISP_NEED_TIMERFLUSH has been set to an invalid value (FALSE, 50-1200)."
  50. #endif
  51. #if !GFX_USE_GTIMER
  52. #if GFX_DISPLAY_RULE_WARNINGS
  53. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  54. #warning "GDISP: GDISP_NEED_TIMERFLUSH has been set but GFX_USE_GTIMER has not been set. It has been turned on for you."
  55. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  56. COMPILER_WARNING("GDISP: GDISP_NEED_TIMERFLUSH has been set but GFX_USE_GTIMER has not been set. It has been turned on for you.")
  57. #endif
  58. #endif
  59. #undef GFX_USE_GTIMER
  60. #define GFX_USE_GTIMER TRUE
  61. #undef GDISP_NEED_MULTITHREAD
  62. #define GDISP_NEED_MULTITHREAD TRUE
  63. #endif
  64. #endif
  65. #if GDISP_NEED_ANTIALIAS && !GDISP_NEED_PIXELREAD
  66. #if GDISP_HARDWARE_PIXELREAD
  67. #if GFX_DISPLAY_RULE_WARNINGS
  68. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  69. #warning "GDISP: GDISP_NEED_ANTIALIAS has been set but GDISP_NEED_PIXELREAD has not. It has been turned on for you."
  70. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  71. COMPILER_WARNING("GDISP: GDISP_NEED_ANTIALIAS has been set but GDISP_NEED_PIXELREAD has not. It has been turned on for you.")
  72. #endif
  73. #endif
  74. #undef GDISP_NEED_PIXELREAD
  75. #define GDISP_NEED_PIXELREAD TRUE
  76. #else
  77. #if GFX_DISPLAY_RULE_WARNINGS
  78. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  79. #warning "GDISP: GDISP_NEED_ANTIALIAS has been set but your hardware does not support reading back pixels. Anti-aliasing will only occur for filled characters."
  80. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  81. COMPILER_WARNING("GDISP: GDISP_NEED_ANTIALIAS has been set but your hardware does not support reading back pixels. Anti-aliasing will only occur for filled characters.")
  82. #endif
  83. #endif
  84. #endif
  85. #endif
  86. #if (defined(GDISP_INCLUDE_FONT_SMALL) && GDISP_INCLUDE_FONT_SMALL) || (defined(GDISP_INCLUDE_FONT_LARGER) && GDISP_INCLUDE_FONT_LARGER)
  87. #if GFX_DISPLAY_RULE_WARNINGS
  88. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  89. #warning "GDISP: An old font (Small or Larger) has been defined. A single default font of UI2 has been added instead."
  90. #warning "GDISP: Please see <$(GFXLIB)/include/gdisp/fonts/fonts.h> for a list of available font names."
  91. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  92. COMPILER_WARNING("GDISP: An old font (Small or Larger) has been defined. A single default font of UI2 has been added instead.")
  93. COMPILER_WARNING("GDISP: Please see <$(GFXLIB)/include/gdisp/fonts/fonts.h> for a list of available font names.")
  94. #endif
  95. #endif
  96. #undef GDISP_INCLUDE_FONT_UI2
  97. #define GDISP_INCLUDE_FONT_UI2 TRUE
  98. #endif
  99. #if GDISP_NEED_IMAGE
  100. #if !GFX_USE_GFILE
  101. #if GFX_DISPLAY_RULE_WARNINGS
  102. #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
  103. #warning "GDISP: GFX_USE_GFILE is required when GDISP_NEED_IMAGE is TRUE. It has been turned on for you."
  104. #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
  105. COMPILER_WARNING("GDISP: GFX_USE_GFILE is required when GDISP_NEED_IMAGE is TRUE. It has been turned on for you.")
  106. #endif
  107. #endif
  108. #undef GFX_USE_GFILE
  109. #define GFX_USE_GFILE TRUE
  110. #endif
  111. #endif
  112. #endif
  113. #endif /* _GDISP_RULES_H */
  114. /** @} */