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