Nuvoton
/
NuMaker-mbed-emWin-example
NuMaker emWin HMI
emWin/Include/LISTVIEW_Private.h@10:c8165817d92a, 7 months ago (annotated)
- Committer:
- csyang2
- Date:
- Mon Mar 04 15:47:41 2024 +0800
- Revision:
- 10:c8165817d92a
- Parent:
- 1:c0f972361605
Support NuMaker-IoT-M467
Who changed what in which revision?
User | Revision | Line number | New 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 : LISTVIEW_Private.h |
csyang2 |
1:c0f972361605 | 40 | Purpose : Private LISTVIEW include |
csyang2 |
1:c0f972361605 | 41 | --------------------END-OF-HEADER------------------------------------- |
csyang2 |
1:c0f972361605 | 42 | */ |
csyang2 |
1:c0f972361605 | 43 | |
csyang2 |
1:c0f972361605 | 44 | #ifndef LISTVIEW_PRIVATE_H |
csyang2 |
1:c0f972361605 | 45 | #define LISTVIEW_PRIVATE_H |
csyang2 |
1:c0f972361605 | 46 | |
csyang2 |
1:c0f972361605 | 47 | #include "WM.h" |
csyang2 |
1:c0f972361605 | 48 | |
csyang2 |
1:c0f972361605 | 49 | #if GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 50 | |
csyang2 |
1:c0f972361605 | 51 | #include <stddef.h> |
csyang2 |
1:c0f972361605 | 52 | |
csyang2 |
1:c0f972361605 | 53 | #include "LISTVIEW.h" |
csyang2 |
1:c0f972361605 | 54 | #include "GUI_ARRAY.h" |
csyang2 |
1:c0f972361605 | 55 | |
csyang2 |
1:c0f972361605 | 56 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 57 | * |
csyang2 |
1:c0f972361605 | 58 | * Defines |
csyang2 |
1:c0f972361605 | 59 | * |
csyang2 |
1:c0f972361605 | 60 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 61 | */ |
csyang2 |
1:c0f972361605 | 62 | #define SORT_TYPE U16 |
csyang2 |
1:c0f972361605 | 63 | |
csyang2 |
1:c0f972361605 | 64 | #define LISTVIEW_CELL_INFO_COLORS (1 << 0) |
csyang2 |
1:c0f972361605 | 65 | #define LISTVIEW_CELL_INFO_BITMAP (1 << 1) |
csyang2 |
1:c0f972361605 | 66 | |
csyang2 |
1:c0f972361605 | 67 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 68 | * |
csyang2 |
1:c0f972361605 | 69 | * Object definition |
csyang2 |
1:c0f972361605 | 70 | * |
csyang2 |
1:c0f972361605 | 71 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 72 | */ |
csyang2 |
1:c0f972361605 | 73 | |
csyang2 |
1:c0f972361605 | 74 | typedef struct { |
csyang2 |
1:c0f972361605 | 75 | GUI_COLOR aBkColor[4]; |
csyang2 |
1:c0f972361605 | 76 | GUI_COLOR aTextColor[4]; |
csyang2 |
1:c0f972361605 | 77 | GUI_COLOR GridColor; |
csyang2 |
1:c0f972361605 | 78 | const GUI_FONT * pFont; |
csyang2 |
1:c0f972361605 | 79 | U16 ScrollStepH; |
csyang2 |
1:c0f972361605 | 80 | GUI_WRAPMODE WrapMode; |
csyang2 |
1:c0f972361605 | 81 | int DefaultAlign; |
csyang2 |
1:c0f972361605 | 82 | } LISTVIEW_PROPS; |
csyang2 |
1:c0f972361605 | 83 | |
csyang2 |
1:c0f972361605 | 84 | typedef struct { |
csyang2 |
1:c0f972361605 | 85 | void (* pfDraw)(LISTVIEW_Handle hObj, unsigned Column, unsigned Row, GUI_RECT * pRect); |
csyang2 |
1:c0f972361605 | 86 | void * pData; |
csyang2 |
1:c0f972361605 | 87 | GUI_COLOR aBkColor[4]; |
csyang2 |
1:c0f972361605 | 88 | GUI_COLOR aTextColor[4]; |
csyang2 |
1:c0f972361605 | 89 | I16 xOff, yOff; |
csyang2 |
1:c0f972361605 | 90 | U8 Flags; |
csyang2 |
1:c0f972361605 | 91 | } LISTVIEW_CELL_INFO; |
csyang2 |
1:c0f972361605 | 92 | |
csyang2 |
1:c0f972361605 | 93 | typedef struct { |
csyang2 |
1:c0f972361605 | 94 | WM_HMEM hCellInfo; // Optional cell info. If 0, there is no cell info. (Defaults used) |
csyang2 |
1:c0f972361605 | 95 | char acText[1]; |
csyang2 |
1:c0f972361605 | 96 | } LISTVIEW_CELL; |
csyang2 |
1:c0f972361605 | 97 | |
csyang2 |
1:c0f972361605 | 98 | typedef struct { |
csyang2 |
1:c0f972361605 | 99 | GUI_ARRAY hCellArray; |
csyang2 |
1:c0f972361605 | 100 | char Disabled; |
csyang2 |
1:c0f972361605 | 101 | U32 UserData; |
csyang2 |
1:c0f972361605 | 102 | } LISTVIEW_ROW; |
csyang2 |
1:c0f972361605 | 103 | |
csyang2 |
1:c0f972361605 | 104 | typedef struct { |
csyang2 |
1:c0f972361605 | 105 | U8 Align; |
csyang2 |
1:c0f972361605 | 106 | int (* fpCompare) (const void * p0, const void * p1); // User function to be called to compare the contents of 2 cells |
csyang2 |
1:c0f972361605 | 107 | } LISTVIEW_COLUMN; |
csyang2 |
1:c0f972361605 | 108 | |
csyang2 |
1:c0f972361605 | 109 | typedef struct LISTVIEW_Obj LISTVIEW_Obj; |
csyang2 |
1:c0f972361605 | 110 | |
csyang2 |
1:c0f972361605 | 111 | typedef struct { |
csyang2 |
1:c0f972361605 | 112 | WM_HMEM hSortArray; |
csyang2 |
1:c0f972361605 | 113 | SORT_TYPE SortArrayNumItems; |
csyang2 |
1:c0f972361605 | 114 | int (* fpSort)(LISTVIEW_Handle hObj); // Function to be called to get a sorted array |
csyang2 |
1:c0f972361605 | 115 | void (* fpFree)(WM_HMEM hObj); // Function to be called to free the sort object |
csyang2 |
1:c0f972361605 | 116 | U8 Reverse; |
csyang2 |
1:c0f972361605 | 117 | } LISTVIEW_SORT; |
csyang2 |
1:c0f972361605 | 118 | |
csyang2 |
1:c0f972361605 | 119 | struct LISTVIEW_Obj { |
csyang2 |
1:c0f972361605 | 120 | WIDGET Widget; |
csyang2 |
1:c0f972361605 | 121 | HEADER_Handle hHeader; |
csyang2 |
1:c0f972361605 | 122 | WIDGET_DRAW_ITEM_FUNC * pfDrawItem; |
csyang2 |
1:c0f972361605 | 123 | GUI_ARRAY hRowArray; // Each entry is a handle of LISTVIEW_ROW structure. |
csyang2 |
1:c0f972361605 | 124 | GUI_ARRAY hColumnArray; // Each entry is a handle of LISTVIEW_COLUMN structure. |
csyang2 |
1:c0f972361605 | 125 | LISTVIEW_PROPS Props; |
csyang2 |
1:c0f972361605 | 126 | int Sel; |
csyang2 |
1:c0f972361605 | 127 | int SelCol; |
csyang2 |
1:c0f972361605 | 128 | int ShowGrid; |
csyang2 |
1:c0f972361605 | 129 | int SortIndex; // Column for sorting |
csyang2 |
1:c0f972361605 | 130 | unsigned RowDistY; |
csyang2 |
1:c0f972361605 | 131 | unsigned LBorder; |
csyang2 |
1:c0f972361605 | 132 | unsigned RBorder; |
csyang2 |
1:c0f972361605 | 133 | unsigned Fixed; |
csyang2 |
1:c0f972361605 | 134 | WM_SCROLL_STATE ScrollStateV; |
csyang2 |
1:c0f972361605 | 135 | WM_SCROLL_STATE ScrollStateH; |
csyang2 |
1:c0f972361605 | 136 | WM_HMEM hSort; |
csyang2 |
1:c0f972361605 | 137 | U8 IsSorted; |
csyang2 |
1:c0f972361605 | 138 | U8 IsPresorted; |
csyang2 |
1:c0f972361605 | 139 | U8 ReverseSort; // Set to 1 if reverse sorting is required |
csyang2 |
1:c0f972361605 | 140 | U8 Flags; |
csyang2 |
1:c0f972361605 | 141 | }; |
csyang2 |
1:c0f972361605 | 142 | |
csyang2 |
1:c0f972361605 | 143 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 144 | * |
csyang2 |
1:c0f972361605 | 145 | * Macros for internal use |
csyang2 |
1:c0f972361605 | 146 | * |
csyang2 |
1:c0f972361605 | 147 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 148 | */ |
csyang2 |
1:c0f972361605 | 149 | #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL |
csyang2 |
1:c0f972361605 | 150 | #define LISTVIEW_INIT_ID(p) (p->Widget.DebugId = LISTVIEW_ID) |
csyang2 |
1:c0f972361605 | 151 | #else |
csyang2 |
1:c0f972361605 | 152 | #define LISTVIEW_INIT_ID(p) |
csyang2 |
1:c0f972361605 | 153 | #endif |
csyang2 |
1:c0f972361605 | 154 | |
csyang2 |
1:c0f972361605 | 155 | #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL |
csyang2 |
1:c0f972361605 | 156 | LISTVIEW_Obj * LISTVIEW_LockH(LISTVIEW_Handle h); |
csyang2 |
1:c0f972361605 | 157 | #define LISTVIEW_LOCK_H(h) LISTVIEW_LockH(h) |
csyang2 |
1:c0f972361605 | 158 | #else |
csyang2 |
1:c0f972361605 | 159 | #define LISTVIEW_LOCK_H(h) (LISTVIEW_Obj *)GUI_LOCK_H(h) |
csyang2 |
1:c0f972361605 | 160 | #endif |
csyang2 |
1:c0f972361605 | 161 | |
csyang2 |
1:c0f972361605 | 162 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 163 | * |
csyang2 |
1:c0f972361605 | 164 | * Private (module internal) data |
csyang2 |
1:c0f972361605 | 165 | * |
csyang2 |
1:c0f972361605 | 166 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 167 | */ |
csyang2 |
1:c0f972361605 | 168 | extern LISTVIEW_PROPS LISTVIEW_DefaultProps; |
csyang2 |
1:c0f972361605 | 169 | |
csyang2 |
1:c0f972361605 | 170 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 171 | * |
csyang2 |
1:c0f972361605 | 172 | * Private (module internal) functions |
csyang2 |
1:c0f972361605 | 173 | * |
csyang2 |
1:c0f972361605 | 174 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 175 | */ |
csyang2 |
1:c0f972361605 | 176 | LISTVIEW_CELL_INFO * LISTVIEW__CreateCellInfoLocked (LISTVIEW_Handle hObj, unsigned Column, unsigned Row); |
csyang2 |
1:c0f972361605 | 177 | unsigned LISTVIEW__GetNumColumns (LISTVIEW_Obj * pObj); |
csyang2 |
1:c0f972361605 | 178 | unsigned LISTVIEW__GetNumRows (LISTVIEW_Obj * pObj); |
csyang2 |
1:c0f972361605 | 179 | LISTVIEW_CELL_INFO * LISTVIEW__GetpCellInfo (LISTVIEW_Handle hObj, unsigned Column, unsigned Row); |
csyang2 |
1:c0f972361605 | 180 | LISTVIEW_ROW * LISTVIEW__GetpRow (LISTVIEW_Handle hObj, int Row); |
csyang2 |
1:c0f972361605 | 181 | unsigned LISTVIEW__GetRowDistY (LISTVIEW_Obj * pObj); |
csyang2 |
1:c0f972361605 | 182 | unsigned LISTVIEW__GetRowSorted (LISTVIEW_Handle hObj, int Row); |
csyang2 |
1:c0f972361605 | 183 | void LISTVIEW__InvalidateInsideArea (LISTVIEW_Handle hObj); |
csyang2 |
1:c0f972361605 | 184 | void LISTVIEW__InvalidateRow (LISTVIEW_Handle hObj, int Sel); |
csyang2 |
1:c0f972361605 | 185 | void LISTVIEW__InvalidateRowAndBelow(LISTVIEW_Handle hObj, int Sel); |
csyang2 |
1:c0f972361605 | 186 | void LISTVIEW__SetSel (LISTVIEW_Handle hObj, int NewSel); |
csyang2 |
1:c0f972361605 | 187 | void LISTVIEW__SetSelCol (LISTVIEW_Handle hObj, int NewSelCol); |
csyang2 |
1:c0f972361605 | 188 | int LISTVIEW__UpdateScrollParas (LISTVIEW_Handle hObj); |
csyang2 |
1:c0f972361605 | 189 | |
csyang2 |
1:c0f972361605 | 190 | #endif // GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 191 | #endif // LISTVIEW_PRIVATE_H |
csyang2 |
1:c0f972361605 | 192 | |
csyang2 |
1:c0f972361605 | 193 | /*************************** End of file ****************************/ |