GUIDEMO.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. /*********************************************************************
  2. * Portions COPYRIGHT 2016 STMicroelectronics *
  3. * Portions SEGGER Microcontroller GmbH & Co. KG *
  4. * Solutions for real time microcontroller applications *
  5. **********************************************************************
  6. * *
  7. * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
  8. * *
  9. * Internet: www.segger.com Support: support@segger.com *
  10. * *
  11. **********************************************************************
  12. ** emWin V5.32 - Graphical user interface for embedded applications **
  13. All Intellectual Property rights in the Software belongs to SEGGER.
  14. emWin is protected by international copyright laws. Knowledge of the
  15. source code may not be used to write a similar product. This file may
  16. only be used in accordance with the following terms:
  17. The software has been licensed to STMicroelectronics International
  18. N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
  19. les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
  20. purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
  21. troller products commercialized by Licensee only, sublicensed and dis_
  22. tributed under the terms and conditions of the End User License Agree_
  23. ment supplied by STMicroelectronics International N.V.
  24. Full source code is available at: www.segger.com
  25. We appreciate your understanding and fairness.
  26. ----------------------------------------------------------------------
  27. File : GUIDEMO.h
  28. Purpose : Configuration file of GUIDemo
  29. ----------------------------------------------------------------------
  30. */
  31. /**
  32. ******************************************************************************
  33. * @file GUIDEMO.c
  34. * @author MCD Application Team
  35. * @version V1.2.0
  36. * @date 22-September-2016
  37. * @brief Configuration file of GUIDemo
  38. ******************************************************************************
  39. * @attention
  40. *
  41. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  42. * You may not use this file except in compliance with the License.
  43. * You may obtain a copy of the License at:
  44. *
  45. * http://www.st.com/software_license_agreement_liberty_v2
  46. *
  47. * Unless required by applicable law or agreed to in writing, software
  48. * distributed under the License is distributed on an "AS IS" BASIS,
  49. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  50. * See the License for the specific language governing permissions and
  51. * limitations under the License.
  52. *
  53. ******************************************************************************
  54. */
  55. #ifndef GUIDEMO_H
  56. #define GUIDEMO_H
  57. #if defined(__cplusplus)
  58. extern "C" { /* Make sure we have C-declarations in C++ programs */
  59. #endif
  60. #include "GUI.h"
  61. #if GUI_WINSUPPORT
  62. #include "WM.h"
  63. #include "CHECKBOX.h"
  64. #include "FRAMEWIN.h"
  65. #include "PROGBAR.h"
  66. #include "TEXT.h"
  67. #include "BUTTON.h"
  68. #include "SLIDER.h"
  69. #include "HEADER.h"
  70. #include "GRAPH.h"
  71. #include "ICONVIEW.h"
  72. #include "LISTVIEW.h"
  73. #include "TREEVIEW.h"
  74. #endif
  75. /*********************************************************************
  76. *
  77. * Defines
  78. *
  79. **********************************************************************
  80. */
  81. #define CONTROL_SIZE_X 80
  82. #define CONTROL_SIZE_Y 61
  83. #define INFO_SIZE_Y 65
  84. #define BUTTON_SIZE_X 36
  85. #define BUTTON_SIZE_Y 22
  86. #define PROGBAR_SIZE_X 74
  87. #define PROGBAR_SIZE_Y 12
  88. #define TEXT_SIZE_X 69
  89. #define TEXT_SIZE_Y 7
  90. #define SHOW_PROGBAR_AT 100
  91. #define GUI_ID_HALT (GUI_ID_USER + 0)
  92. #define GUI_ID_NEXT (GUI_ID_USER + 1)
  93. #define BK_COLOR_0 GUI_MAKE_COLOR(0xFF5555)
  94. #define BK_COLOR_1 GUI_MAKE_COLOR(0x880000)
  95. #define NUMBYTES_NEEDED 0x200000UL
  96. #define CIRCLE_RADIUS 100
  97. #define LOGO_DIST_BORDER 5
  98. #define CHAR_READING_TIME 80
  99. #define XSIZE_MIN 320
  100. #define YSIZE_MIN 240
  101. //
  102. // Use an or-combination of the following flags to configure the
  103. // GUIDemo container for the current application.
  104. //
  105. #define GUIDEMO_SHOW_CURSOR (1 << 0)
  106. #define GUIDEMO_SHOW_INFO (1 << 1)
  107. #define GUIDEMO_SHOW_CONTROL (1 << 2)
  108. #define SHIFT_RIGHT_16(x) ((x) / 65536)
  109. /*********************************************************************
  110. *
  111. * Configuration of modules to be used
  112. *
  113. **********************************************************************
  114. */
  115. #ifndef SHOW_GUIDEMO_BITMAP
  116. #define SHOW_GUIDEMO_BITMAP (1)
  117. #endif
  118. #ifndef SHOW_GUIDEMO_COLORBAR
  119. #define SHOW_GUIDEMO_COLORBAR (1)
  120. #endif
  121. #ifndef SHOW_GUIDEMO_CURSOR
  122. #define SHOW_GUIDEMO_CURSOR (1)
  123. #endif
  124. #ifndef SHOW_GUIDEMO_GRAPH
  125. #define SHOW_GUIDEMO_GRAPH (1)
  126. #endif
  127. #ifndef SHOW_GUIDEMO_LISTVIEW
  128. #define SHOW_GUIDEMO_LISTVIEW (1)
  129. #endif
  130. #ifndef SHOW_GUIDEMO_SPEED
  131. #define SHOW_GUIDEMO_SPEED (1)
  132. #endif
  133. #ifndef SHOW_GUIDEMO_TREEVIEW
  134. #define SHOW_GUIDEMO_TREEVIEW (1)
  135. #endif
  136. #ifndef SHOW_GUIDEMO_ICONVIEW
  137. #define SHOW_GUIDEMO_ICONVIEW (1)
  138. #endif
  139. #ifndef SHOW_GUIDEMO_RADIALMENU
  140. #define SHOW_GUIDEMO_RADIALMENU (1)
  141. #endif
  142. #ifndef SHOW_GUIDEMO_VSCREEN
  143. #define SHOW_GUIDEMO_VSCREEN (1)
  144. #endif
  145. #ifndef SHOW_GUIDEMO_AUTOMOTIVE
  146. #define SHOW_GUIDEMO_AUTOMOTIVE (1)
  147. #endif
  148. #ifndef SHOW_GUIDEMO_TRANSPARENTDIALOG
  149. #define SHOW_GUIDEMO_TRANSPARENTDIALOG (1)
  150. #endif
  151. #ifndef SHOW_GUIDEMO_AATEXT
  152. #define SHOW_GUIDEMO_AATEXT (0)
  153. #endif
  154. #ifndef SHOW_GUIDEMO_BARGRAPH
  155. #define SHOW_GUIDEMO_BARGRAPH (0)
  156. #endif
  157. #ifndef SHOW_GUIDEMO_FADING
  158. #define SHOW_GUIDEMO_FADING (0)
  159. #endif
  160. #ifndef SHOW_GUIDEMO_SKINNING
  161. #define SHOW_GUIDEMO_SKINNING (0)
  162. #endif
  163. #ifndef SHOW_GUIDEMO_SPEEDOMETER
  164. #define SHOW_GUIDEMO_SPEEDOMETER (0)
  165. #endif
  166. #ifndef SHOW_GUIDEMO_IMAGEFLOW
  167. #define SHOW_GUIDEMO_IMAGEFLOW (0)
  168. #endif
  169. /*********************************************************************
  170. *
  171. * Configuration macros
  172. *
  173. **********************************************************************
  174. */
  175. #ifndef GUIDEMO_SHOW_SPRITES
  176. #define GUIDEMO_SHOW_SPRITES (1)
  177. #endif
  178. #ifndef GUIDEMO_USE_VNC
  179. #define GUIDEMO_USE_VNC (0)
  180. #endif
  181. #ifndef GUIDEMO_USE_AUTO_BK
  182. #define GUIDEMO_USE_AUTO_BK (1)
  183. #endif
  184. #ifndef GUIDEMO_SUPPORT_TOUCH
  185. #define GUIDEMO_SUPPORT_TOUCH (1)
  186. #endif
  187. #ifndef GUIDEMO_SUPPORT_CURSOR
  188. #define GUIDEMO_SUPPORT_CURSOR (GUI_SUPPORT_CURSOR && GUI_SUPPORT_TOUCH)
  189. #endif
  190. #ifndef GUIDEMO_CF_SHOW_SPRITES
  191. #define GUIDEMO_CF_SHOW_SPRITES (GUIDEMO_SHOW_SPRITES << 0)
  192. #endif
  193. #ifndef GUIDEMO_CF_USE_VNC
  194. #define GUIDEMO_CF_USE_VNC (GUIDEMO_USE_VNC << 1)
  195. #endif
  196. #ifndef GUIDEMO_CF_USE_AUTO_BK
  197. #define GUIDEMO_CF_USE_AUTO_BK (GUIDEMO_USE_AUTO_BK << 2)
  198. #endif
  199. #ifndef GUIDEMO_CF_SUPPORT_TOUCH
  200. #define GUIDEMO_CF_SUPPORT_TOUCH (GUI_WINSUPPORT ? GUIDEMO_SUPPORT_TOUCH << 3 : 0)
  201. #endif
  202. /*********************************************************************
  203. *
  204. * GUIDEMO_CONFIG
  205. */
  206. typedef struct GUIDEMO_CONFIG {
  207. void (* * apFunc)(void);
  208. int NumDemos;
  209. U16 Flags;
  210. #if GUIDEMO_USE_VNC
  211. int (* pGUI_VNC_X_StartServer)(int LayerIndex, int ServerIndex);
  212. #endif
  213. } GUIDEMO_CONFIG;
  214. #if (GUI_WINSUPPORT == 0)
  215. #define GUIDEMO_NotifyStartNext GUIDEMO_ClearHalt
  216. #define GUIDEMO_Delay GUI_Delay
  217. #else
  218. void GUIDEMO_NotifyStartNext (void);
  219. void GUIDEMO_Delay (int Time);
  220. #endif
  221. /*********************************************************************
  222. *
  223. * Internal functions
  224. *
  225. **********************************************************************
  226. */
  227. void GUIDEMO_AddIntToString (char * pText, U32 Number);
  228. void GUIDEMO_AddStringToString(char * pText, const char * pAdd);
  229. int GUIDEMO_CheckCancel (void);
  230. int GUIDEMO_CheckCancelDelay (int Delay);
  231. void GUIDEMO_ClearHalt (void);
  232. void GUIDEMO_ClearText (char * pText);
  233. void GUIDEMO_Config (GUIDEMO_CONFIG * pConfig);
  234. void GUIDEMO_ConfigureDemo (char * pTitle, char * pDescription, unsigned Flags);
  235. void GUIDEMO_DispHint (char * pHint);
  236. void GUIDEMO_DispTitle (char * pTitle);
  237. void GUIDEMO_DrawBk (void);
  238. U16 GUIDEMO_GetConfFlag (U16 Flag);
  239. int GUIDEMO_GetTime (void);
  240. int GUIDEMO_GetTitleSizeY (void);
  241. void GUIDEMO_HideCursor (void);
  242. void GUIDEMO_Intro (void);
  243. void GUIDEMO_Main (void);
  244. GUI_COLOR GUIDEMO_MixColors (GUI_COLOR Color0, GUI_COLOR Color1, U8 Intens);
  245. void GUIDEMO_SetInfoText (const char * pInfo);
  246. int GUIDEMO_ShiftRight (int Value, U8 NumBits);
  247. void GUIDEMO_ShowCursor (void);
  248. void GUIDEMO_Wait (int TimeWait);
  249. /*********************************************************************
  250. *
  251. * Demo modules
  252. *
  253. **********************************************************************
  254. */
  255. void GUIDEMO_AntialiasedText (void);
  256. void GUIDEMO_Automotive (void);
  257. void GUIDEMO_BarGraph (void);
  258. void GUIDEMO_Bitmap (void);
  259. void GUIDEMO_ColorBar (void);
  260. void GUIDEMO_Cursor (void);
  261. void GUIDEMO_Fading (void);
  262. void GUIDEMO_Graph (void);
  263. void GUIDEMO_IconView (void);
  264. void GUIDEMO_ImageFlow (void);
  265. void GUIDEMO_Listview (void);
  266. void GUIDEMO_RadialMenu (void);
  267. void GUIDEMO_Skinning (void);
  268. void GUIDEMO_Speed (void);
  269. void GUIDEMO_Speedometer (void);
  270. void GUIDEMO_TransparentDialog(void);
  271. void GUIDEMO_Treeview (void);
  272. void GUIDEMO_VScreen (void);
  273. void GUIDEMO_WashingMachine (void);
  274. void GUIDEMO_ZoomAndRotate (void);
  275. /*********************************************************************
  276. *
  277. * Externs
  278. *
  279. **********************************************************************
  280. */
  281. extern GUI_CONST_STORAGE GUI_BITMAP bmSTLogo;
  282. extern GUI_CONST_STORAGE GUI_BITMAP bmSeggerLogo;
  283. extern GUI_CONST_STORAGE GUI_BITMAP bmSeggerLogo70x35;
  284. extern GUI_CONST_STORAGE GUI_BITMAP bmSTLogo70x35;
  285. extern GUI_CONST_STORAGE GUI_BITMAP bmplay;
  286. extern GUI_CONST_STORAGE GUI_BITMAP bmforward;
  287. extern GUI_CONST_STORAGE GUI_BITMAP bmstop;
  288. extern GUI_CONST_STORAGE GUI_BITMAP bmbutton_1;
  289. extern GUI_CONST_STORAGE GUI_BITMAP bmbutton_0;
  290. extern GUI_CONST_STORAGE GUI_BITMAP bmgrad_32x16;
  291. extern GUI_CONST_STORAGE GUI_FONT GUI_FontRounded16;
  292. extern GUI_CONST_STORAGE GUI_FONT GUI_FontRounded22;
  293. extern GUI_CONST_STORAGE GUI_FONT GUI_FontSouvenir18;
  294. extern GUI_CONST_STORAGE GUI_FONT GUI_FontD6x8;
  295. extern GUI_CONST_STORAGE GUI_FONT GUI_FontAA2_32;
  296. extern GUI_CONST_STORAGE GUI_FONT GUI_FontAA4_32;
  297. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_00;
  298. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_01;
  299. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_02;
  300. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_03;
  301. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_04;
  302. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_10;
  303. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_11;
  304. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_12;
  305. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_13;
  306. extern GUI_CONST_STORAGE GUI_BITMAP bmDolphin_14;
  307. #if defined(__cplusplus)
  308. }
  309. #endif
  310. #endif // Avoid multiple inclusion
  311. /*************************** End of file ****************************/