Headers for emWin lib

Dependents:   DISCO-F746NG_rtos_test

Committer:
redbird
Date:
Sat Mar 26 22:49:50 2016 +0000
Revision:
0:1bf8f02b0770
new code integration

Who changed what in which revision?

UserRevisionLine numberNew contents of line
redbird 0:1bf8f02b0770 1 /*********************************************************************
redbird 0:1bf8f02b0770 2 * SEGGER Microcontroller GmbH & Co. KG *
redbird 0:1bf8f02b0770 3 * Solutions for real time microcontroller applications *
redbird 0:1bf8f02b0770 4 **********************************************************************
redbird 0:1bf8f02b0770 5 * *
redbird 0:1bf8f02b0770 6 * (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG *
redbird 0:1bf8f02b0770 7 * *
redbird 0:1bf8f02b0770 8 * Internet: www.segger.com Support: support@segger.com *
redbird 0:1bf8f02b0770 9 * *
redbird 0:1bf8f02b0770 10 **********************************************************************
redbird 0:1bf8f02b0770 11
redbird 0:1bf8f02b0770 12 ** emWin V5.24 - Graphical user interface for embedded applications **
redbird 0:1bf8f02b0770 13 All Intellectual Property rights in the Software belongs to SEGGER.
redbird 0:1bf8f02b0770 14 emWin is protected by international copyright laws. Knowledge of the
redbird 0:1bf8f02b0770 15 source code may not be used to write a similar product. This file may
redbird 0:1bf8f02b0770 16 only be used in accordance with the following terms:
redbird 0:1bf8f02b0770 17
redbird 0:1bf8f02b0770 18 The software has been licensed to NXP Semiconductors USA, Inc. whose
redbird 0:1bf8f02b0770 19 registered office is situated at 411 E. Plumeria Drive, San Jose,
redbird 0:1bf8f02b0770 20 CA 95134, USA solely for the purposes of creating libraries for
redbird 0:1bf8f02b0770 21 NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and
redbird 0:1bf8f02b0770 22 distributed under the terms and conditions of the NXP End User License
redbird 0:1bf8f02b0770 23 Agreement.
redbird 0:1bf8f02b0770 24 Full source code is available at: www.segger.com
redbird 0:1bf8f02b0770 25
redbird 0:1bf8f02b0770 26 We appreciate your understanding and fairness.
redbird 0:1bf8f02b0770 27 ----------------------------------------------------------------------
redbird 0:1bf8f02b0770 28 File : TREEVIEW.h
redbird 0:1bf8f02b0770 29 Purpose : TREEVIEW include
redbird 0:1bf8f02b0770 30 --------------------END-OF-HEADER-------------------------------------
redbird 0:1bf8f02b0770 31 */
redbird 0:1bf8f02b0770 32
redbird 0:1bf8f02b0770 33 #ifndef TREEVIEW_H
redbird 0:1bf8f02b0770 34 #define TREEVIEW_H
redbird 0:1bf8f02b0770 35
redbird 0:1bf8f02b0770 36 #include "WM.h"
redbird 0:1bf8f02b0770 37 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
redbird 0:1bf8f02b0770 38 #include "WIDGET.h"
redbird 0:1bf8f02b0770 39
redbird 0:1bf8f02b0770 40 #if GUI_WINSUPPORT
redbird 0:1bf8f02b0770 41
redbird 0:1bf8f02b0770 42 #if defined(__cplusplus)
redbird 0:1bf8f02b0770 43 extern "C" { /* Make sure we have C-declarations in C++ programs */
redbird 0:1bf8f02b0770 44 #endif
redbird 0:1bf8f02b0770 45
redbird 0:1bf8f02b0770 46 /*********************************************************************
redbird 0:1bf8f02b0770 47 *
redbird 0:1bf8f02b0770 48 * Defines
redbird 0:1bf8f02b0770 49 *
redbird 0:1bf8f02b0770 50 **********************************************************************
redbird 0:1bf8f02b0770 51 */
redbird 0:1bf8f02b0770 52 /* Status- and create flags */
redbird 0:1bf8f02b0770 53 #define TREEVIEW_CF_HIDELINES (1 << 0)
redbird 0:1bf8f02b0770 54 #define TREEVIEW_CF_ROWSELECT (1 << 1)
redbird 0:1bf8f02b0770 55 #define TREEVIEW_CF_AUTOSCROLLBAR_H (1 << 2)
redbird 0:1bf8f02b0770 56 #define TREEVIEW_CF_AUTOSCROLLBAR_V (1 << 3)
redbird 0:1bf8f02b0770 57 #define TREEVIEW_SF_HIDELINES TREEVIEW_CF_HIDELINES
redbird 0:1bf8f02b0770 58 #define TREEVIEW_SF_ROWSELECT TREEVIEW_CF_ROWSELECT
redbird 0:1bf8f02b0770 59 #define TREEVIEW_SF_AUTOSCROLLBAR_H TREEVIEW_CF_AUTOSCROLLBAR_H
redbird 0:1bf8f02b0770 60 #define TREEVIEW_SF_AUTOSCROLLBAR_V TREEVIEW_CF_AUTOSCROLLBAR_V
redbird 0:1bf8f02b0770 61
redbird 0:1bf8f02b0770 62 /* Bitmap indices */
redbird 0:1bf8f02b0770 63 #define TREEVIEW_BI_CLOSED 0
redbird 0:1bf8f02b0770 64 #define TREEVIEW_BI_OPEN 1
redbird 0:1bf8f02b0770 65 #define TREEVIEW_BI_LEAF 2
redbird 0:1bf8f02b0770 66 #define TREEVIEW_BI_PLUS 3
redbird 0:1bf8f02b0770 67 #define TREEVIEW_BI_MINUS 4
redbird 0:1bf8f02b0770 68 #define TREEVIEW_BI_PM 5
redbird 0:1bf8f02b0770 69
redbird 0:1bf8f02b0770 70 /* Color indices */
redbird 0:1bf8f02b0770 71 #define TREEVIEW_CI_UNSEL 0
redbird 0:1bf8f02b0770 72 #define TREEVIEW_CI_SEL 1
redbird 0:1bf8f02b0770 73 #define TREEVIEW_CI_DISABLED 2
redbird 0:1bf8f02b0770 74
redbird 0:1bf8f02b0770 75 /* Relative positions (create) */
redbird 0:1bf8f02b0770 76 #define TREEVIEW_INSERT_ABOVE 0
redbird 0:1bf8f02b0770 77 #define TREEVIEW_INSERT_BELOW 1
redbird 0:1bf8f02b0770 78 #define TREEVIEW_INSERT_FIRST_CHILD 2
redbird 0:1bf8f02b0770 79
redbird 0:1bf8f02b0770 80 /* Relative positions (retrieve) */
redbird 0:1bf8f02b0770 81 #define TREEVIEW_GET_FIRST 0
redbird 0:1bf8f02b0770 82 #define TREEVIEW_GET_LAST 1
redbird 0:1bf8f02b0770 83 #define TREEVIEW_GET_NEXT_SIBLING 2
redbird 0:1bf8f02b0770 84 #define TREEVIEW_GET_PREV_SIBLING 3
redbird 0:1bf8f02b0770 85 #define TREEVIEW_GET_FIRST_CHILD 4
redbird 0:1bf8f02b0770 86 #define TREEVIEW_GET_PARENT 5
redbird 0:1bf8f02b0770 87
redbird 0:1bf8f02b0770 88 /* Item flags */
redbird 0:1bf8f02b0770 89 #define TREEVIEW_ITEM_TYPE_LEAF (0 << 0)
redbird 0:1bf8f02b0770 90 #define TREEVIEW_ITEM_TYPE_NODE (1 << 0)
redbird 0:1bf8f02b0770 91
redbird 0:1bf8f02b0770 92 /* Selection mode */
redbird 0:1bf8f02b0770 93 #define TREEVIEW_SELMODE_ROW 1
redbird 0:1bf8f02b0770 94 #define TREEVIEW_SELMODE_TEXT 0
redbird 0:1bf8f02b0770 95
redbird 0:1bf8f02b0770 96 /************************************************************
redbird 0:1bf8f02b0770 97 *
redbird 0:1bf8f02b0770 98 * Types
redbird 0:1bf8f02b0770 99 *
redbird 0:1bf8f02b0770 100 *************************************************************
redbird 0:1bf8f02b0770 101 */
redbird 0:1bf8f02b0770 102 typedef WM_HMEM TREEVIEW_Handle;
redbird 0:1bf8f02b0770 103 typedef WM_HMEM TREEVIEW_ITEM_Handle;
redbird 0:1bf8f02b0770 104
redbird 0:1bf8f02b0770 105 typedef struct {
redbird 0:1bf8f02b0770 106 int IsNode;
redbird 0:1bf8f02b0770 107 int IsExpanded;
redbird 0:1bf8f02b0770 108 int HasLines;
redbird 0:1bf8f02b0770 109 int HasRowSelect;
redbird 0:1bf8f02b0770 110 int Level;
redbird 0:1bf8f02b0770 111 } TREEVIEW_ITEM_INFO;
redbird 0:1bf8f02b0770 112
redbird 0:1bf8f02b0770 113 typedef struct {
redbird 0:1bf8f02b0770 114 GUI_COLOR ColorBk;
redbird 0:1bf8f02b0770 115 GUI_COLOR ColorText;
redbird 0:1bf8f02b0770 116 GUI_COLOR ColorTextBk;
redbird 0:1bf8f02b0770 117 GUI_COLOR ColorLines;
redbird 0:1bf8f02b0770 118 GUI_RECT rText;
redbird 0:1bf8f02b0770 119 TREEVIEW_ITEM_Handle hItem;
redbird 0:1bf8f02b0770 120 const GUI_FONT * pFont;
redbird 0:1bf8f02b0770 121 char * pText;
redbird 0:1bf8f02b0770 122 U8 NumLines;
redbird 0:1bf8f02b0770 123 I16 ax0[3];
redbird 0:1bf8f02b0770 124 I16 ay0[3];
redbird 0:1bf8f02b0770 125 I16 ax1[3];
redbird 0:1bf8f02b0770 126 I16 ay1[3];
redbird 0:1bf8f02b0770 127 U8 NumConnectors;
redbird 0:1bf8f02b0770 128 I16 axc[16];
redbird 0:1bf8f02b0770 129 const GUI_BITMAP * pBmPM;
redbird 0:1bf8f02b0770 130 const GUI_BITMAP * pBmOCL;
redbird 0:1bf8f02b0770 131 I16 xPosPM, xPosOCL;
redbird 0:1bf8f02b0770 132 U8 IndexPM;
redbird 0:1bf8f02b0770 133 U8 IndexOCL;
redbird 0:1bf8f02b0770 134 } TREEVIEW_ITEM_DRAW_INFO;
redbird 0:1bf8f02b0770 135
redbird 0:1bf8f02b0770 136 /*********************************************************************
redbird 0:1bf8f02b0770 137 *
redbird 0:1bf8f02b0770 138 * Create functions
redbird 0:1bf8f02b0770 139 *
redbird 0:1bf8f02b0770 140 **********************************************************************
redbird 0:1bf8f02b0770 141 */
redbird 0:1bf8f02b0770 142 TREEVIEW_Handle TREEVIEW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
redbird 0:1bf8f02b0770 143 TREEVIEW_Handle TREEVIEW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
redbird 0:1bf8f02b0770 144 TREEVIEW_Handle TREEVIEW_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
redbird 0:1bf8f02b0770 145
redbird 0:1bf8f02b0770 146 /*********************************************************************
redbird 0:1bf8f02b0770 147 *
redbird 0:1bf8f02b0770 148 * The callback ...
redbird 0:1bf8f02b0770 149 *
redbird 0:1bf8f02b0770 150 * Do not call it directly ! It is only to be used from within an
redbird 0:1bf8f02b0770 151 * overwritten callback.
redbird 0:1bf8f02b0770 152 */
redbird 0:1bf8f02b0770 153 void TREEVIEW_Callback(WM_MESSAGE * pMsg);
redbird 0:1bf8f02b0770 154
redbird 0:1bf8f02b0770 155 /*********************************************************************
redbird 0:1bf8f02b0770 156 *
redbird 0:1bf8f02b0770 157 * Common functions
redbird 0:1bf8f02b0770 158 *
redbird 0:1bf8f02b0770 159 **********************************************************************
redbird 0:1bf8f02b0770 160 */
redbird 0:1bf8f02b0770 161 int TREEVIEW_AttachItem (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem, TREEVIEW_ITEM_Handle hItemAt, int Position);
redbird 0:1bf8f02b0770 162 void TREEVIEW_DecSel (TREEVIEW_Handle hObj);
redbird 0:1bf8f02b0770 163 TREEVIEW_ITEM_Handle TREEVIEW_GetItem (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem, int Flags);
redbird 0:1bf8f02b0770 164 TREEVIEW_ITEM_Handle TREEVIEW_GetSel (TREEVIEW_Handle hObj);
redbird 0:1bf8f02b0770 165 int TREEVIEW_GetUserData (TREEVIEW_Handle hObj, void * pDest, int NumBytes);
redbird 0:1bf8f02b0770 166 void TREEVIEW_IncSel (TREEVIEW_Handle hObj);
redbird 0:1bf8f02b0770 167 TREEVIEW_ITEM_Handle TREEVIEW_InsertItem (TREEVIEW_Handle hObj, int IsNode, TREEVIEW_ITEM_Handle hItemPrev, int Position, const char * s);
redbird 0:1bf8f02b0770 168 int TREEVIEW_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
redbird 0:1bf8f02b0770 169 void TREEVIEW_ScrollToSel (TREEVIEW_Handle hObj);
redbird 0:1bf8f02b0770 170 void TREEVIEW_SetAutoScrollH (TREEVIEW_Handle hObj, int State);
redbird 0:1bf8f02b0770 171 void TREEVIEW_SetAutoScrollV (TREEVIEW_Handle hObj, int State);
redbird 0:1bf8f02b0770 172 void TREEVIEW_SetBitmapOffset(TREEVIEW_Handle hObj, int Index, int xOff, int yOff);
redbird 0:1bf8f02b0770 173 void TREEVIEW_SetBkColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color);
redbird 0:1bf8f02b0770 174 void TREEVIEW_SetFont (TREEVIEW_Handle hObj, const GUI_FONT * pFont);
redbird 0:1bf8f02b0770 175 void TREEVIEW_SetHasLines (TREEVIEW_Handle hObj, int State);
redbird 0:1bf8f02b0770 176 void TREEVIEW_SetImage (TREEVIEW_Handle hObj, int Index, const GUI_BITMAP * pBitmap);
redbird 0:1bf8f02b0770 177 int TREEVIEW_SetIndent (TREEVIEW_Handle hObj, int Indent);
redbird 0:1bf8f02b0770 178 void TREEVIEW_SetLineColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color);
redbird 0:1bf8f02b0770 179 void TREEVIEW_SetOwnerDraw (TREEVIEW_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
redbird 0:1bf8f02b0770 180 void TREEVIEW_SetSel (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 181 void TREEVIEW_SetSelMode (TREEVIEW_Handle hObj, int Mode);
redbird 0:1bf8f02b0770 182 void TREEVIEW_SetTextColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color);
redbird 0:1bf8f02b0770 183 int TREEVIEW_SetTextIndent (TREEVIEW_Handle hObj, int TextIndent);
redbird 0:1bf8f02b0770 184 int TREEVIEW_SetUserData (TREEVIEW_Handle hObj, const void * pSrc, int NumBytes);
redbird 0:1bf8f02b0770 185
redbird 0:1bf8f02b0770 186
redbird 0:1bf8f02b0770 187 /*********************************************************************
redbird 0:1bf8f02b0770 188 *
redbird 0:1bf8f02b0770 189 * Treeview item related functions
redbird 0:1bf8f02b0770 190 *
redbird 0:1bf8f02b0770 191 **********************************************************************
redbird 0:1bf8f02b0770 192 */
redbird 0:1bf8f02b0770 193 void TREEVIEW_ITEM_Collapse (TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 194 void TREEVIEW_ITEM_CollapseAll(TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 195 TREEVIEW_ITEM_Handle TREEVIEW_ITEM_Create (int IsNode, const char * s, U32 UserData);
redbird 0:1bf8f02b0770 196 void TREEVIEW_ITEM_Delete (TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 197 void TREEVIEW_ITEM_Detach (TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 198 void TREEVIEW_ITEM_Expand (TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 199 void TREEVIEW_ITEM_ExpandAll (TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 200 void TREEVIEW_ITEM_GetInfo (TREEVIEW_ITEM_Handle hItem, TREEVIEW_ITEM_INFO * pInfo);
redbird 0:1bf8f02b0770 201 void TREEVIEW_ITEM_GetText (TREEVIEW_ITEM_Handle hItem, U8 * pBuffer, int MaxNumBytes);
redbird 0:1bf8f02b0770 202 U32 TREEVIEW_ITEM_GetUserData(TREEVIEW_ITEM_Handle hItem);
redbird 0:1bf8f02b0770 203 void TREEVIEW_ITEM_SetImage (TREEVIEW_ITEM_Handle hItem, int Index, const GUI_BITMAP * pBitmap);
redbird 0:1bf8f02b0770 204 TREEVIEW_ITEM_Handle TREEVIEW_ITEM_SetText (TREEVIEW_ITEM_Handle hItem, const char * s);
redbird 0:1bf8f02b0770 205 void TREEVIEW_ITEM_SetUserData(TREEVIEW_ITEM_Handle hItem, U32 UserData);
redbird 0:1bf8f02b0770 206
redbird 0:1bf8f02b0770 207 /*********************************************************************
redbird 0:1bf8f02b0770 208 *
redbird 0:1bf8f02b0770 209 * Managing default values
redbird 0:1bf8f02b0770 210 *
redbird 0:1bf8f02b0770 211 **********************************************************************
redbird 0:1bf8f02b0770 212 */
redbird 0:1bf8f02b0770 213 GUI_COLOR TREEVIEW_GetDefaultBkColor (int Index);
redbird 0:1bf8f02b0770 214 const GUI_FONT * TREEVIEW_GetDefaultFont (void);
redbird 0:1bf8f02b0770 215 GUI_COLOR TREEVIEW_GetDefaultLineColor(int Index);
redbird 0:1bf8f02b0770 216 GUI_COLOR TREEVIEW_GetDefaultTextColor(int Index);
redbird 0:1bf8f02b0770 217 void TREEVIEW_SetDefaultBkColor (int Index, GUI_COLOR Color);
redbird 0:1bf8f02b0770 218 void TREEVIEW_SetDefaultFont (const GUI_FONT * pFont);
redbird 0:1bf8f02b0770 219 void TREEVIEW_SetDefaultLineColor(int Index, GUI_COLOR Color);
redbird 0:1bf8f02b0770 220 void TREEVIEW_SetDefaultTextColor(int Index, GUI_COLOR Color);
redbird 0:1bf8f02b0770 221
redbird 0:1bf8f02b0770 222 #if defined(__cplusplus)
redbird 0:1bf8f02b0770 223 }
redbird 0:1bf8f02b0770 224 #endif
redbird 0:1bf8f02b0770 225
redbird 0:1bf8f02b0770 226 #endif // GUI_WINSUPPORT
redbird 0:1bf8f02b0770 227 #endif // TREEVIEW_H
redbird 0:1bf8f02b0770 228
redbird 0:1bf8f02b0770 229 /*************************** End of file ****************************/