STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
GRAPH.h
Go to the documentation of this file.
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH & Co. KG *
3 * Solutions for real time microcontroller applications *
4 **********************************************************************
5 * *
6 * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
7 * *
8 * Internet: www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 
12 ** emWin V5.28 - 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 
18 The software has been licensed to STMicroelectronics International
19 N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
20 les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
21 purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
22 troller products commercialized by Licensee only, sublicensed and dis_
23 tributed under the terms and conditions of the End User License Agree_
24 ment supplied by STMicroelectronics International N.V.
25 Full source code is available at: www.segger.com
26 
27 We appreciate your understanding and fairness.
28 ----------------------------------------------------------------------
29 File : GRAPH.h
30 Purpose : GRAPH include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef GRAPH_H
35 #define GRAPH_H
36 
37 #include "WM.h"
38 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
39 #include "WIDGET.h"
40 
41 #if GUI_WINSUPPORT
42 
43 #if defined(__cplusplus)
44  extern "C" { /* Make sure we have C-declarations in C++ programs */
45 #endif
46 
47 /*********************************************************************
48 *
49 * Defines
50 *
51 **********************************************************************
52 */
53 #define GRAPH_CI_BK 0
54 #define GRAPH_CI_BORDER 1
55 #define GRAPH_CI_FRAME 2
56 #define GRAPH_CI_GRID 3
57 
58 #define GRAPH_SCALE_CF_HORIZONTAL (0 << 0)
59 #define GRAPH_SCALE_CF_VERTICAL (1 << 0)
60 
61 #define GRAPH_SCALE_SF_HORIZONTAL GRAPH_SCALE_CF_HORIZONTAL
62 #define GRAPH_SCALE_SF_VERTICAL GRAPH_SCALE_CF_VERTICAL
63 
64 #define GRAPH_DRAW_FIRST 0
65 #define GRAPH_DRAW_AFTER_BORDER 1
66 #define GRAPH_DRAW_LAST 2
67 
68 #define GRAPH_ALIGN_RIGHT (0 << 0)
69 #define GRAPH_ALIGN_LEFT (1 << 0)
70 
71 //
72 // Creation flags (ExFlags)
73 //
74 #define GRAPH_CF_GRID_FIXED_X (1 << 0)
75 #define GRAPH_CF_AVOID_SCROLLBAR_H (1 << 1)
76 #define GRAPH_CF_AVOID_SCROLLBAR_V (1 << 2)
77 
78 //
79 // Status flags
80 //
81 #define GRAPH_SF_AVOID_SCROLLBAR_H GRAPH_CF_AVOID_SCROLLBAR_H
82 #define GRAPH_SF_AVOID_SCROLLBAR_V GRAPH_CF_AVOID_SCROLLBAR_V
83 
84 /*********************************************************************
85 *
86 * Public Types
87 *
88 **********************************************************************
89 */
90 typedef WM_HMEM GRAPH_Handle;
91 typedef WM_HMEM GRAPH_DATA_Handle;
92 typedef WM_HMEM GRAPH_SCALE_Handle;
93 
94 /*********************************************************************
95 *
96 * Create functions
97 *
98 **********************************************************************
99 */
100 
101 GRAPH_Handle GRAPH_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
102 GRAPH_Handle GRAPH_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
103 GRAPH_Handle GRAPH_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
104 
105 GRAPH_DATA_Handle GRAPH_DATA_XY_Create(GUI_COLOR Color, unsigned MaxNumItems, GUI_POINT * pData, unsigned NumItems);
106 GRAPH_DATA_Handle GRAPH_DATA_YT_Create(GUI_COLOR Color, unsigned MaxNumItems, I16 * pData, unsigned NumItems);
107 GRAPH_SCALE_Handle GRAPH_SCALE_Create (int Pos, int TextAlign, unsigned Flags, unsigned TickDist);
108 
109 /*********************************************************************
110 *
111 * The callback ...
112 *
113 * Do not call it directly ! It is only to be used from within an
114 * overwritten callback.
115 */
116 void GRAPH_Callback(WM_MESSAGE * pMsg);
117 
118 /*********************************************************************
119 *
120 * Standard member functions
121 *
122 **********************************************************************
123 */
124 
125 /*********************************************************************
126 *
127 * Member functions
128 *
129 **********************************************************************
130 */
131 void GRAPH_AttachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData);
132 void GRAPH_AttachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale);
133 void GRAPH_DetachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData);
134 void GRAPH_DetachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale);
135 I32 GRAPH_GetScrollValue (GRAPH_Handle hObj, U8 Coord);
136 int GRAPH_GetUserData (GRAPH_Handle hObj, void * pDest, int NumBytes);
137 void GRAPH_SetAutoScrollbar (GRAPH_Handle hObj, U8 Coord, U8 OnOff);
138 void GRAPH_SetBorder (GRAPH_Handle hObj, unsigned BorderL, unsigned BorderT, unsigned BorderR, unsigned BorderB);
139 GUI_COLOR GRAPH_SetColor (GRAPH_Handle hObj, GUI_COLOR Color, unsigned Index);
140 unsigned GRAPH_SetGridFixedX (GRAPH_Handle hObj, unsigned OnOff);
141 unsigned GRAPH_SetGridOffY (GRAPH_Handle hObj, unsigned Value);
142 unsigned GRAPH_SetGridVis (GRAPH_Handle hObj, unsigned OnOff);
143 unsigned GRAPH_SetGridDistX (GRAPH_Handle hObj, unsigned Value);
144 unsigned GRAPH_SetGridDistY (GRAPH_Handle hObj, unsigned Value);
145 U8 GRAPH_SetLineStyleH (GRAPH_Handle hObj, U8 Value);
146 U8 GRAPH_SetLineStyleV (GRAPH_Handle hObj, U8 Value);
147 void GRAPH_SetLineStyle (GRAPH_Handle hObj, U8 Value);
148 void GRAPH_SetScrollValue (GRAPH_Handle hObj, U8 Coord, U32 Value);
149 unsigned GRAPH_SetVSizeX (GRAPH_Handle hObj, unsigned Value);
150 unsigned GRAPH_SetVSizeY (GRAPH_Handle hObj, unsigned Value);
151 int GRAPH_SetUserData (GRAPH_Handle hObj, const void * pSrc, int NumBytes);
152 void GRAPH_SetUserDraw (GRAPH_Handle hObj, void (* pOwnerDraw)(WM_HWIN, int));
153 
154 void GRAPH_DATA_YT_AddValue (GRAPH_DATA_Handle hDataObj, I16 Value);
155 void GRAPH_DATA_YT_Clear (GRAPH_DATA_Handle hDataObj);
156 void GRAPH_DATA_YT_Delete (GRAPH_DATA_Handle hDataObj);
157 void GRAPH_DATA_YT_SetAlign (GRAPH_DATA_Handle hDataObj, int Align);
158 void GRAPH_DATA_YT_SetOffY (GRAPH_DATA_Handle hDataObj, int Off);
159 void GRAPH_DATA_YT_MirrorX (GRAPH_DATA_Handle hDataObj, int OnOff);
160 
161 void GRAPH_DATA_XY_AddPoint (GRAPH_DATA_Handle hDataObj, GUI_POINT * pPoint);
162 void GRAPH_DATA_XY_Clear (GRAPH_DATA_Handle hDataObj);
163 void GRAPH_DATA_XY_Delete (GRAPH_DATA_Handle hDataObj);
164 unsigned GRAPH_DATA_XY_GetLineVis (GRAPH_DATA_Handle hDataObj);
165 unsigned GRAPH_DATA_XY_GetPointVis (GRAPH_DATA_Handle hDataObj);
166 void GRAPH_DATA_XY_SetLineStyle (GRAPH_DATA_Handle hDataObj, U8 LineStyle);
167 unsigned GRAPH_DATA_XY_SetLineVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff);
168 void GRAPH_DATA_XY_SetOffX (GRAPH_DATA_Handle hDataObj, int Off);
169 void GRAPH_DATA_XY_SetOffY (GRAPH_DATA_Handle hDataObj, int Off);
170 void GRAPH_DATA_XY_SetPenSize (GRAPH_DATA_Handle hDataObj, U8 PenSize);
171 void GRAPH_DATA_XY_SetPointSize (GRAPH_DATA_Handle hDataObj, unsigned PointSize);
172 unsigned GRAPH_DATA_XY_SetPointVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff);
173 void GRAPH_DATA_XY_SetOwnerDraw (GRAPH_DATA_Handle hDataObj, WIDGET_DRAW_ITEM_FUNC * pOwnerDraw);
174 
175 void GRAPH_SCALE_Delete (GRAPH_SCALE_Handle hScaleObj);
176 float GRAPH_SCALE_SetFactor (GRAPH_SCALE_Handle hScaleObj, float Factor);
177 const GUI_FONT * GRAPH_SCALE_SetFont (GRAPH_SCALE_Handle hScaleObj, const GUI_FONT * pFont);
178 int GRAPH_SCALE_SetNumDecs (GRAPH_SCALE_Handle hScaleObj, int NumDecs);
179 int GRAPH_SCALE_SetOff (GRAPH_SCALE_Handle hScaleObj, int Off);
180 int GRAPH_SCALE_SetPos (GRAPH_SCALE_Handle hScaleObj, int Pos);
181 GUI_COLOR GRAPH_SCALE_SetTextColor(GRAPH_SCALE_Handle hScaleObj, GUI_COLOR Color);
182 unsigned GRAPH_SCALE_SetTickDist (GRAPH_SCALE_Handle hScaleObj, unsigned Value);
183 
184 #if defined(__cplusplus)
185  }
186 #endif
187 
188 #endif // GUI_WINSUPPORT
189 #endif // GRAPH_H
190 
191 /*************************** End of file ****************************/
#define U32
Definition: Global.h:50
Definition: LCD.h:101
LCD Drawing point (pixel) geometric definition.
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define I16
Definition: Global.h:56
#define I32
Definition: Global.h:59
#define U8
Definition: Global.h:44