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