Nuvoton / Mbed OS NuMaker-mbed-emWin-example
Committer:
csyang2
Date:
Wed Feb 27 14:34:09 2019 +0800
Revision:
1:c0f972361605
Add emWin related materials

Who changed what in which revision?

UserRevisionLine numberNew contents of line
csyang2 1:c0f972361605 1 /*********************************************************************
csyang2 1:c0f972361605 2 * SEGGER Software GmbH *
csyang2 1:c0f972361605 3 * Solutions for real time microcontroller applications *
csyang2 1:c0f972361605 4 **********************************************************************
csyang2 1:c0f972361605 5 * *
csyang2 1:c0f972361605 6 * (c) 1996 - 2018 SEGGER Microcontroller GmbH *
csyang2 1:c0f972361605 7 * *
csyang2 1:c0f972361605 8 * Internet: www.segger.com Support: support@segger.com *
csyang2 1:c0f972361605 9 * *
csyang2 1:c0f972361605 10 **********************************************************************
csyang2 1:c0f972361605 11
csyang2 1:c0f972361605 12 ** emWin V5.48 - Graphical user interface for embedded applications **
csyang2 1:c0f972361605 13 All Intellectual Property rights in the Software belongs to SEGGER.
csyang2 1:c0f972361605 14 emWin is protected by international copyright laws. Knowledge of the
csyang2 1:c0f972361605 15 source code may not be used to write a similar product. This file may
csyang2 1:c0f972361605 16 only be used in accordance with the following terms:
csyang2 1:c0f972361605 17
csyang2 1:c0f972361605 18 The software has been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
csyang2 1:c0f972361605 19 for the purposes of creating libraries for its
csyang2 1:c0f972361605 20 Arm Cortex-M and Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
csyang2 1:c0f972361605 21 under the terms and conditions of an End User
csyang2 1:c0f972361605 22 License Agreement supplied with the libraries.
csyang2 1:c0f972361605 23 Full source code is available at: www.segger.com
csyang2 1:c0f972361605 24
csyang2 1:c0f972361605 25 We appreciate your understanding and fairness.
csyang2 1:c0f972361605 26 ----------------------------------------------------------------------
csyang2 1:c0f972361605 27 Licensing information
csyang2 1:c0f972361605 28 Licensor: SEGGER Software GmbH
csyang2 1:c0f972361605 29 Licensed to: Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
csyang2 1:c0f972361605 30 Licensed SEGGER software: emWin
csyang2 1:c0f972361605 31 License number: GUI-00735
csyang2 1:c0f972361605 32 License model: emWin License Agreement, signed February 27, 2018
csyang2 1:c0f972361605 33 Licensed platform: Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
csyang2 1:c0f972361605 34 ----------------------------------------------------------------------
csyang2 1:c0f972361605 35 Support and Update Agreement (SUA)
csyang2 1:c0f972361605 36 SUA period: 2018-03-26 - 2019-03-27
csyang2 1:c0f972361605 37 Contact to extend SUA: sales@segger.com
csyang2 1:c0f972361605 38 ----------------------------------------------------------------------
csyang2 1:c0f972361605 39 File : GRAPH_Private.h
csyang2 1:c0f972361605 40 Purpose : GRAPH private header file
csyang2 1:c0f972361605 41 --------------------END-OF-HEADER-------------------------------------
csyang2 1:c0f972361605 42 */
csyang2 1:c0f972361605 43
csyang2 1:c0f972361605 44 #ifndef GRAPH_PRIVATE_H
csyang2 1:c0f972361605 45 #define GRAPH_PRIVATE_H
csyang2 1:c0f972361605 46
csyang2 1:c0f972361605 47 #include "GRAPH.h"
csyang2 1:c0f972361605 48 #include "GUI_ARRAY.h"
csyang2 1:c0f972361605 49 #include "WIDGET.h"
csyang2 1:c0f972361605 50
csyang2 1:c0f972361605 51 #if GUI_WINSUPPORT
csyang2 1:c0f972361605 52
csyang2 1:c0f972361605 53 /*********************************************************************
csyang2 1:c0f972361605 54 *
csyang2 1:c0f972361605 55 * Object definition
csyang2 1:c0f972361605 56 *
csyang2 1:c0f972361605 57 **********************************************************************
csyang2 1:c0f972361605 58 */
csyang2 1:c0f972361605 59 typedef struct GRAPH_OBJ GRAPH_OBJ;
csyang2 1:c0f972361605 60 typedef struct GRAPH_DATA_OBJ GRAPH_DATA_OBJ;
csyang2 1:c0f972361605 61 typedef struct GRAPH_SCALE_OBJ GRAPH_SCALE_OBJ;
csyang2 1:c0f972361605 62 typedef struct GRAPH_PAINT_OBJ GRAPH_PAINT_OBJ;
csyang2 1:c0f972361605 63
csyang2 1:c0f972361605 64 struct GRAPH_PAINT_OBJ {
csyang2 1:c0f972361605 65 void (* pfOnPaint) (WM_HMEM hObj, GUI_RECT * pRectInvalid); /* Pointer to paint function */
csyang2 1:c0f972361605 66 void (* pfOnDelete) (WM_HMEM hObj); /* Pointer to delete function */
csyang2 1:c0f972361605 67 WM_HWIN hGraph; /* Handle of graph widget */
csyang2 1:c0f972361605 68 };
csyang2 1:c0f972361605 69
csyang2 1:c0f972361605 70 typedef struct {
csyang2 1:c0f972361605 71 GUI_COLOR TextColor;
csyang2 1:c0f972361605 72 const GUI_FONT * pFont;
csyang2 1:c0f972361605 73 } GRAPH_SCALE_PROPS;
csyang2 1:c0f972361605 74
csyang2 1:c0f972361605 75 struct GRAPH_SCALE_OBJ {
csyang2 1:c0f972361605 76 GRAPH_PAINT_OBJ PaintObj;
csyang2 1:c0f972361605 77 GRAPH_SCALE_PROPS Props;
csyang2 1:c0f972361605 78 int Pos;
csyang2 1:c0f972361605 79 int TextAlign;
csyang2 1:c0f972361605 80 unsigned TickDist;
csyang2 1:c0f972361605 81 int Off;
csyang2 1:c0f972361605 82 U16 Flags;
csyang2 1:c0f972361605 83 float Factor;
csyang2 1:c0f972361605 84 int NumDecs;
csyang2 1:c0f972361605 85 };
csyang2 1:c0f972361605 86
csyang2 1:c0f972361605 87 struct GRAPH_DATA_OBJ {
csyang2 1:c0f972361605 88 GRAPH_PAINT_OBJ PaintObj;
csyang2 1:c0f972361605 89 void (* pfInvalidateNewItem)(GRAPH_DATA_OBJ * pDataObj); /* Pointer to a function which can be used for invalidating the required area */
csyang2 1:c0f972361605 90 unsigned NumItems;
csyang2 1:c0f972361605 91 unsigned MaxNumItems;
csyang2 1:c0f972361605 92 GUI_COLOR Color;
csyang2 1:c0f972361605 93 int OffX, OffY;
csyang2 1:c0f972361605 94 };
csyang2 1:c0f972361605 95
csyang2 1:c0f972361605 96 typedef struct {
csyang2 1:c0f972361605 97 GUI_COLOR aColor[4];
csyang2 1:c0f972361605 98 unsigned GridSpacingX;
csyang2 1:c0f972361605 99 unsigned GridSpacingY;
csyang2 1:c0f972361605 100 unsigned GridOffX;
csyang2 1:c0f972361605 101 unsigned GridOffY;
csyang2 1:c0f972361605 102 unsigned BorderL;
csyang2 1:c0f972361605 103 unsigned BorderT;
csyang2 1:c0f972361605 104 unsigned BorderR;
csyang2 1:c0f972361605 105 unsigned BorderB;
csyang2 1:c0f972361605 106 } GRAPH_PROPS;
csyang2 1:c0f972361605 107
csyang2 1:c0f972361605 108 struct GRAPH_OBJ {
csyang2 1:c0f972361605 109 WIDGET Widget;
csyang2 1:c0f972361605 110 GRAPH_PROPS Props;
csyang2 1:c0f972361605 111 GUI_ARRAY GraphArray;
csyang2 1:c0f972361605 112 GUI_ARRAY ScaleArray;
csyang2 1:c0f972361605 113 U8 ShowGrid;
csyang2 1:c0f972361605 114 unsigned RangeX, RangeY;
csyang2 1:c0f972361605 115 U16 Flags;
csyang2 1:c0f972361605 116 U8 LineStyleV;
csyang2 1:c0f972361605 117 U8 LineStyleH;
csyang2 1:c0f972361605 118 WM_SCROLL_STATE ScrollStateV;
csyang2 1:c0f972361605 119 WM_SCROLL_STATE ScrollStateH;
csyang2 1:c0f972361605 120 void (* pUserDraw)(WM_HWIN hObj, int Stage);
csyang2 1:c0f972361605 121 };
csyang2 1:c0f972361605 122
csyang2 1:c0f972361605 123 /*********************************************************************
csyang2 1:c0f972361605 124 *
csyang2 1:c0f972361605 125 * Macros for internal use
csyang2 1:c0f972361605 126 *
csyang2 1:c0f972361605 127 **********************************************************************
csyang2 1:c0f972361605 128 */
csyang2 1:c0f972361605 129 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
csyang2 1:c0f972361605 130 #define GRAPH_INIT_ID(p) (p->Widget.DebugId = GRAPH_ID)
csyang2 1:c0f972361605 131 #else
csyang2 1:c0f972361605 132 #define GRAPH_INIT_ID(p)
csyang2 1:c0f972361605 133 #endif
csyang2 1:c0f972361605 134
csyang2 1:c0f972361605 135 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
csyang2 1:c0f972361605 136 GRAPH_OBJ * GRAPH_LockH(GRAPH_Handle h);
csyang2 1:c0f972361605 137 #define GRAPH_LOCK_H(h) GRAPH_LockH(h)
csyang2 1:c0f972361605 138 #else
csyang2 1:c0f972361605 139 #define GRAPH_LOCK_H(h) (GRAPH_OBJ *)GUI_LOCK_H(h)
csyang2 1:c0f972361605 140 #endif
csyang2 1:c0f972361605 141
csyang2 1:c0f972361605 142 /*********************************************************************
csyang2 1:c0f972361605 143 *
csyang2 1:c0f972361605 144 * Public data (internal defaults)
csyang2 1:c0f972361605 145 *
csyang2 1:c0f972361605 146 **********************************************************************
csyang2 1:c0f972361605 147 */
csyang2 1:c0f972361605 148 extern GRAPH_PROPS GRAPH__DefaultProps;
csyang2 1:c0f972361605 149
csyang2 1:c0f972361605 150 /*********************************************************************
csyang2 1:c0f972361605 151 *
csyang2 1:c0f972361605 152 * Private functions
csyang2 1:c0f972361605 153 *
csyang2 1:c0f972361605 154 **********************************************************************
csyang2 1:c0f972361605 155 */
csyang2 1:c0f972361605 156 void GRAPH__AddValue (GRAPH_DATA_OBJ * pDataObj, void * pData, void * pValue, int Size);
csyang2 1:c0f972361605 157 int GRAPH__GetValue (GRAPH_DATA_OBJ * pDataObj, void * pData, void * pValue, int Size, U32 Index);
csyang2 1:c0f972361605 158 void GRAPH__InvalidateGraph(GRAPH_Handle hObj);
csyang2 1:c0f972361605 159
csyang2 1:c0f972361605 160 #endif /* GUI_WINSUPPORT */
csyang2 1:c0f972361605 161 #endif /* GRAPH_PRIVATE_H */
csyang2 1:c0f972361605 162
csyang2 1:c0f972361605 163 /*************************** End of file ****************************/