The official µGFX library repository.

gfx.h 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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 gfx.h
  9. * @brief GFX system header file.
  10. *
  11. * @addtogroup GFX
  12. *
  13. * @brief Main module to glue all the others together
  14. *
  15. * @{
  16. */
  17. #ifndef _GFX_H
  18. #define _GFX_H
  19. /**
  20. * These two definitions below are required before anything else so that we can
  21. * turn module definitions off and on.
  22. */
  23. /**
  24. * @brief Generic 'false' boolean constant.
  25. */
  26. #if !defined(FALSE) || defined(__DOXYGEN__)
  27. #define FALSE 0
  28. #endif
  29. /**
  30. * @brief Generic 'true' boolean constant.
  31. */
  32. #if !defined(TRUE) || defined(__DOXYGEN__)
  33. #define TRUE -1
  34. #endif
  35. /* gfxconf.h is the user's project configuration for the GFX system. */
  36. #include "gfxconf.h"
  37. /* Include Compiler and CPU support */
  38. #include "src/gfx_compilers.h"
  39. /**
  40. * @name GFX sub-systems that can be turned on
  41. * @{
  42. */
  43. /**
  44. * @brief GFX Driver API
  45. * @details Defaults to TRUE
  46. * @note Not much useful can be done without a driver
  47. */
  48. #ifndef GFX_USE_GDRIVER
  49. #define GFX_USE_GDRIVER TRUE
  50. #endif
  51. /**
  52. * @brief GFX Graphics Display Basic API
  53. * @details Defaults to FALSE
  54. * @note Also add the specific hardware driver to your makefile.
  55. * Eg. include $(GFXLIB)/drivers/gdisp/Nokia6610/driver.mk
  56. */
  57. #ifndef GFX_USE_GDISP
  58. #define GFX_USE_GDISP FALSE
  59. #endif
  60. /**
  61. * @brief GFX Graphics Windowing API
  62. * @details Defaults to FALSE
  63. * @details Extends the GDISP API to add the concept of graphic windows.
  64. * @note Also supports high-level "window" objects such as console windows,
  65. * buttons, graphing etc
  66. */
  67. #ifndef GFX_USE_GWIN
  68. #define GFX_USE_GWIN FALSE
  69. #endif
  70. /**
  71. * @brief GFX Event API
  72. * @details Defaults to FALSE
  73. * @details Defines the concept of a "Source" that can send "Events" to "Listeners".
  74. */
  75. #ifndef GFX_USE_GEVENT
  76. #define GFX_USE_GEVENT FALSE
  77. #endif
  78. /**
  79. * @brief GFX Timer API
  80. * @details Defaults to FALSE
  81. * @details Provides thread context timers - both one-shot and periodic.
  82. */
  83. #ifndef GFX_USE_GTIMER
  84. #define GFX_USE_GTIMER FALSE
  85. #endif
  86. /**
  87. * @brief GFX Queue API
  88. * @details Defaults to FALSE
  89. * @details Provides queue management.
  90. */
  91. #ifndef GFX_USE_GQUEUE
  92. #define GFX_USE_GQUEUE FALSE
  93. #endif
  94. /**
  95. * @brief GFX Input Device API
  96. * @details Defaults to FALSE
  97. * @note Also add the specific hardware drivers to your makefile.
  98. * Eg.
  99. * include $(GFXLIB)/drivers/ginput/toggle/Pal/driver.mk
  100. * and...
  101. * include $(GFXLIB)/drivers/ginput/touch/MCU/driver.mk
  102. */
  103. #ifndef GFX_USE_GINPUT
  104. #define GFX_USE_GINPUT FALSE
  105. #endif
  106. /**
  107. * @brief GFX Generic Periodic ADC API
  108. * @details Defaults to FALSE
  109. */
  110. #ifndef GFX_USE_GADC
  111. #define GFX_USE_GADC FALSE
  112. #endif
  113. /**
  114. * @brief GFX Audio API
  115. * @details Defaults to FALSE
  116. * @note Also add the specific hardware drivers to your makefile.
  117. * Eg.
  118. * include $(GFXLIB)/drivers/gaudio/GADC/driver.mk
  119. */
  120. #ifndef GFX_USE_GAUDIO
  121. #define GFX_USE_GAUDIO FALSE
  122. #endif
  123. /**
  124. * @brief GFX Miscellaneous Routines API
  125. * @details Defaults to FALSE
  126. * @note Turning this on without turning on any GMISC_NEED_xxx macros will result
  127. * in no extra code being compiled in. GMISC is made up from the sum of its
  128. * parts.
  129. */
  130. #ifndef GFX_USE_GMISC
  131. #define GFX_USE_GMISC FALSE
  132. #endif
  133. /**
  134. * @brief GFX File API
  135. * @details Defaults to FALSE
  136. */
  137. #ifndef GFX_USE_GFILE
  138. #define GFX_USE_GFILE FALSE
  139. #endif
  140. /**
  141. * @brief GFX Translation Support API
  142. * @details Defaults to FALSE
  143. */
  144. #ifndef GFX_USE_GTRANS
  145. #define GFX_USE_GTRANS FALSE
  146. #endif
  147. /** @} */
  148. /**
  149. * Get all the options for each sub-system.
  150. *
  151. */
  152. #include "src/gos/gos_options.h"
  153. #include "src/gdriver/gdriver_options.h"
  154. #include "src/gfile/gfile_options.h"
  155. #include "src/gmisc/gmisc_options.h"
  156. #include "src/gtrans/gtrans_options.h"
  157. #include "src/gqueue/gqueue_options.h"
  158. #include "src/gevent/gevent_options.h"
  159. #include "src/gtimer/gtimer_options.h"
  160. #include "src/gdisp/gdisp_options.h"
  161. #include "src/gwin/gwin_options.h"
  162. #include "src/ginput/ginput_options.h"
  163. #include "src/gadc/gadc_options.h"
  164. #include "src/gaudio/gaudio_options.h"
  165. /**
  166. * Interdependency safety checks on the sub-systems.
  167. * These must be in dependency order.
  168. *
  169. */
  170. #ifndef GFX_DISPLAY_RULE_WARNINGS
  171. #define GFX_DISPLAY_RULE_WARNINGS FALSE
  172. #endif
  173. #include "src/gwin/gwin_rules.h"
  174. #include "src/ginput/ginput_rules.h"
  175. #include "src/gdisp/gdisp_rules.h"
  176. #include "src/gaudio/gaudio_rules.h"
  177. #include "src/gadc/gadc_rules.h"
  178. #include "src/gevent/gevent_rules.h"
  179. #include "src/gtimer/gtimer_rules.h"
  180. #include "src/gqueue/gqueue_rules.h"
  181. #include "src/gmisc/gmisc_rules.h"
  182. #include "src/gtrans/gtrans_rules.h"
  183. #include "src/gfile/gfile_rules.h"
  184. #include "src/gdriver/gdriver_rules.h"
  185. #include "src/gos/gos_rules.h"
  186. /**
  187. * Include the sub-system header files
  188. */
  189. #include "src/gos/gos.h"
  190. //#include "src/gdriver/gdriver.h" // This module is only included by source that needs it.
  191. #include "src/gfile/gfile.h"
  192. #include "src/gmisc/gmisc.h"
  193. #include "src/gtrans/gtrans.h"
  194. #include "src/gqueue/gqueue.h"
  195. #include "src/gevent/gevent.h"
  196. #include "src/gtimer/gtimer.h"
  197. #include "src/gdisp/gdisp.h"
  198. #include "src/gwin/gwin.h"
  199. #include "src/ginput/ginput.h"
  200. #include "src/gadc/gadc.h"
  201. #include "src/gaudio/gaudio.h"
  202. #ifdef __cplusplus
  203. extern "C" {
  204. #endif
  205. /**
  206. * @brief The one call to start it all
  207. *
  208. * @note This will initialise each sub-system that has been turned on.
  209. * For example, if GFX_USE_GDISP is defined then display will be initialised
  210. * and cleared to black.
  211. * @note If you define GFX_OS_NO_INIT as TRUE in your gfxconf.h file then ugfx doesn't try to
  212. * initialise the operating system for you when you call @p gfxInit().
  213. * @note If you define GFX_OS_EXTRA_INIT_FUNCTION in your gfxconf.h file the macro is the
  214. * name of a void function with no parameters that is called immediately after
  215. * operating system initialisation (whether or not GFX_OS_NO_INIT is set).
  216. * @note If you define GFX_OS_EXTRA_DEINIT_FUNCTION in your gfxconf.h file the macro is the
  217. * name of a void function with no parameters that is called immediately before
  218. * operating system de-initialisation (as ugfx is exiting).
  219. *
  220. * @api
  221. */
  222. void gfxInit(void);
  223. /**
  224. * @brief The one call to end it all
  225. *
  226. * @note This will de-initialise each sub-system that has been turned on.
  227. *
  228. * @api
  229. */
  230. void gfxDeinit(void);
  231. #ifdef __cplusplus
  232. }
  233. #endif
  234. #endif /* _GFX_H */
  235. /** @} */