RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SWIPELIST.h Source File

SWIPELIST.h

00001 /*********************************************************************
00002 *                SEGGER Microcontroller GmbH & Co. KG                *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2016  SEGGER Microcontroller GmbH & Co. KG       *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.38 - Graphical user interface for embedded applications **
00013 All  Intellectual Property rights  in the Software belongs to  SEGGER.
00014 emWin is protected by  international copyright laws.  Knowledge of the
00015 source code may not be used to write a similar product.  This file may
00016 only be used in accordance with the following terms:
00017 
00018 The software has been licensed to  NXP Semiconductors USA, Inc.  whose
00019 registered  office  is  situated  at 411 E. Plumeria Drive, San  Jose,
00020 CA 95134, USA  solely for  the  purposes  of  creating  libraries  for
00021 NXPs M0, M3/M4 and  ARM7/9 processor-based  devices,  sublicensed  and
00022 distributed under the terms and conditions of the NXP End User License
00023 Agreement.
00024 Full source code is available at: www.segger.com
00025 
00026 We appreciate your understanding and fairness.
00027 ----------------------------------------------------------------------
00028 Licensing information
00029 
00030 Licensor:                 SEGGER Microcontroller Systems LLC
00031 Licensed to:              NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA
00032 Licensed SEGGER software: emWin
00033 License number:           GUI-00186
00034 License model:            emWin License Agreement, dated August 20th 2011
00035 Licensed product:         -
00036 Licensed platform:        NXP's ARM 7/9, Cortex-M0,M3,M4
00037 Licensed number of seats: -
00038 ----------------------------------------------------------------------
00039 File        : SWIPELIST.h
00040 Purpose     : SWIPELIST include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef SWIPELIST_H
00045 #define SWIPELIST_H
00046 
00047 #include "WM.h"
00048 #include "DIALOG_Intern.h"      // Req. for Create indirect data structure
00049 #include "WIDGET.h"
00050 #include "GUI_Debug.h"
00051 
00052 #if GUI_WINSUPPORT
00053 
00054 #if defined(__cplusplus)
00055   extern "C" {                  // Make sure we have C-declarations in C++ programs
00056 #endif
00057 
00058 /*********************************************************************
00059 *
00060 *       Create flags
00061 *
00062 **********************************************************************
00063 */
00064 #define SWIPELIST_CF_HORIZONTAL (0 << 0)
00065 #define SWIPELIST_CF_VERTICAL   (1 << 0)
00066 
00067 /*********************************************************************
00068 *
00069 *       Getting border size
00070 */
00071 #define SWIPELIST_BI_LEFT   0
00072 #define SWIPELIST_BI_RIGHT  1
00073 #define SWIPELIST_BI_TOP    2
00074 #define SWIPELIST_BI_BOTTOM 3
00075 
00076 /*********************************************************************
00077 *
00078 *       Getting font
00079 */
00080 #define SWIPELIST_FI_SEP_ITEM    0
00081 #define SWIPELIST_FI_ITEM_HEADER 1
00082 #define SWIPELIST_FI_ITEM_TEXT   2
00083 
00084 /*********************************************************************
00085 *
00086 *       Getting color
00087 */
00088 #define SWIPELIST_CI_ITEM_HEADER_UNSEL 0
00089 #define SWIPELIST_CI_ITEM_HEADER_SEL   1
00090 #define SWIPELIST_CI_ITEM_TEXT_UNSEL   2
00091 #define SWIPELIST_CI_ITEM_TEXT_SEL     3
00092 #define SWIPELIST_CI_SEP_ITEM_TEXT     4
00093 
00094 #define SWIPELIST_CI_BK_ITEM_UNSEL     0
00095 #define SWIPELIST_CI_BK_ITEM_SEL       1
00096 #define SWIPELIST_CI_BK_SEP_ITEM       2
00097 
00098 /*********************************************************************
00099 *
00100 *       Bitmap align
00101 */
00102 #define SWIPELIST_BA_LEFT      (0<<0)
00103 #define SWIPELIST_BA_RIGHT     (1<<0)
00104 #define SWIPELIST_BA_HCENTER     (2<<0)
00105 
00106 #define SWIPELIST_BA_VCENTER   (3<<2)
00107 #define SWIPELIST_BA_TOP         (0<<2)
00108 #define SWIPELIST_BA_BOTTOM    (1<<2)
00109 
00110 
00111 /*********************************************************************
00112 *
00113 *       Public Types
00114 *
00115 **********************************************************************
00116 */
00117 typedef WM_HMEM SWIPELIST_Handle;
00118 
00119 /*********************************************************************
00120 *
00121 *       Create functions
00122 *
00123 **********************************************************************
00124 */
00125 SWIPELIST_Handle SWIPELIST_CreateAsChild  (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags);
00126 SWIPELIST_Handle SWIPELIST_CreateEx       (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
00127 SWIPELIST_Handle SWIPELIST_CreateIndirect (const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
00128 SWIPELIST_Handle SWIPELIST_CreateUser     (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
00129 
00130 /*********************************************************************
00131 *
00132 *       The callback ...
00133 *
00134 * Do not call it directly ! It is only to be used from within an
00135 * overwritten callback.
00136 */
00137 void SWIPELIST_Callback(WM_MESSAGE * pMsg);
00138 
00139 /*********************************************************************
00140 *
00141 *       Member functions
00142 *
00143 **********************************************************************
00144 */
00145 
00146 
00147 int                SWIPELIST_AddItem                 (SWIPELIST_Handle hObj, const char * sText, int ItemSize);
00148 int                SWIPELIST_AddItemText             (SWIPELIST_Handle hObj, unsigned ItemIndex, const char * sText);
00149 int                SWIPELIST_AddSepItem              (SWIPELIST_Handle hObj, const char * sText, int ItemSize);
00150 void               SWIPELIST_DeleteItem              (SWIPELIST_Handle hObj, unsigned ItemIndex);
00151 
00152 const GUI_BITMAP * SWIPELIST_GetBitmap               (SWIPELIST_Handle hObj, unsigned ItemIndex);
00153 int                SWIPELIST_GetBitmapSpace          (SWIPELIST_Handle hObj);
00154 GUI_COLOR          SWIPELIST_GetBkColor              (SWIPELIST_Handle hObj, unsigned Index);
00155 int                SWIPELIST_GetBorderSize           (SWIPELIST_Handle hObj, unsigned Index);
00156 const GUI_FONT *   SWIPELIST_GetFont                 (SWIPELIST_Handle hObj, unsigned Index);
00157 int                SWIPELIST_GetItemSize             (SWIPELIST_Handle hObj, unsigned ItemIndex);
00158 U32                SWIPELIST_GetItemUserData         (SWIPELIST_Handle hObj, unsigned ItemIndex);
00159 int                SWIPELIST_GetNumItems             (SWIPELIST_Handle hObj);
00160 int                SWIPELIST_GetNumText              (SWIPELIST_Handle hObj, unsigned ItemIndex);
00161 int                SWIPELIST_GetReleasedItem         (SWIPELIST_Handle hObj);
00162 int                SWIPELIST_GetScrollPos            (SWIPELIST_Handle hObj);
00163 int                SWIPELIST_GetSelItem              (SWIPELIST_Handle hObj);
00164 GUI_COLOR          SWIPELIST_GetSepColor             (SWIPELIST_Handle hObj, unsigned ItemIndex);
00165 int                SWIPELIST_GetSepSize              (SWIPELIST_Handle hObj, unsigned ItemIndex);
00166 void               SWIPELIST_GetText                 (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned TextIndex, char * pBuffer, int MaxSize);
00167 int                SWIPELIST_GetTextAlign            (SWIPELIST_Handle hObj, unsigned ItemIndex);
00168 GUI_COLOR          SWIPELIST_GetTextColor            (SWIPELIST_Handle hObj, unsigned Index);
00169 int                SWIPELIST_GetThreshold            (SWIPELIST_Handle hObj);
00170 int                SWIPELIST_GetUserData             (SWIPELIST_Handle hObj, void * pDest, int NumBytes);
00171 
00172 int                SWIPELIST_ItemAttachWindow        (SWIPELIST_Handle hObj, unsigned ItemIndex, WM_HWIN hWin, int x0, int y0);
00173 void               SWIPELIST_ItemDetachWindow        (SWIPELIST_Handle hObj, WM_HWIN hWin);
00174 int                SWIPELIST_OwnerDraw               (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
00175 
00176 void               SWIPELIST_SetAttachedWindowPos    (SWIPELIST_Handle hObj, WM_HWIN hWin, int x0, int y0);
00177 void               SWIPELIST_SetBitmap               (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align, const GUI_BITMAP * pBitmap);
00178 void               SWIPELIST_SetBitmapEx             (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align, const GUI_BITMAP * pBitmap, int x, int y);
00179 void               SWIPELIST_SetBitmapSpace          (SWIPELIST_Handle hObj, unsigned Size);
00180 void               SWIPELIST_SetBkColor              (SWIPELIST_Handle hObj, unsigned Index, GUI_COLOR Color);
00181 void               SWIPELIST_SetBorderSize           (SWIPELIST_Handle hObj, unsigned Index, unsigned Size);
00182 void               SWIPELIST_SetFont                 (SWIPELIST_Handle hObj, unsigned Index, const GUI_FONT * pFont);
00183 void               SWIPELIST_SetItemSize             (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned Size);
00184 void               SWIPELIST_SetItemUserData         (SWIPELIST_Handle hObj, unsigned ItemIndex, U32 UserData);
00185 void               SWIPELIST_SetOwnerDraw            (SWIPELIST_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
00186 void               SWIPELIST_SetScrollPos            (SWIPELIST_Handle hObj, int Pos);
00187 void               SWIPELIST_SetScrollPosItem        (SWIPELIST_Handle hObj, unsigned ItemIndex);
00188 void               SWIPELIST_SetSepColor             (SWIPELIST_Handle hObj, unsigned ItemIndex, GUI_COLOR Color);
00189 void               SWIPELIST_SetSepSize              (SWIPELIST_Handle hObj, unsigned ItemIndex, int Size);
00190 void               SWIPELIST_SetText                 (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned TextIndex, char * sText);
00191 void               SWIPELIST_SetTextAlign            (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align);
00192 void               SWIPELIST_SetTextColor            (SWIPELIST_Handle hObj, unsigned Index, GUI_COLOR Color);
00193 int                SWIPELIST_SetThreshold            (SWIPELIST_Handle hObj, int Threshold);
00194 int                SWIPELIST_SetUserData             (SWIPELIST_Handle hObj, const void * pSrc, int NumBytes);
00195 
00196 /*********************************************************************
00197 *
00198 *       Global functions
00199 *
00200 **********************************************************************
00201 */
00202 int              SWIPELIST_GetDefaultBitmapSpace     (void);
00203 GUI_COLOR        SWIPELIST_GetDefaultBkColor         (unsigned Index);
00204 int              SWIPELIST_GetDefaultBorderSize      (unsigned Index);
00205 const GUI_FONT * SWIPELIST_GetDefaultFont            (unsigned Index);
00206 GUI_COLOR        SWIPELIST_GetDefaultSepColor        (void);
00207 unsigned         SWIPELIST_GetDefaultSepSize         (void);
00208 GUI_COLOR        SWIPELIST_GetDefaultTextColor       (unsigned Index);
00209 int              SWIPELIST_GetDefaultTextAlign       (void);
00210 int              SWIPELIST_GetDefaultThreshold       (void);
00211 
00212 void             SWIPELIST_SetDefaultBitmapSpace     (unsigned Size);
00213 void             SWIPELIST_SetDefaultBkColor         (unsigned Index, GUI_COLOR Color);
00214 void             SWIPELIST_SetDefaultBorderSize      (unsigned Index, unsigned Size);
00215 void             SWIPELIST_SetDefaultFont            (unsigned Index, const GUI_FONT * pFont);
00216 void             SWIPELIST_SetDefaultSepColor        (GUI_COLOR Color);
00217 void             SWIPELIST_SetDefaultSepSize         (unsigned Size);
00218 void             SWIPELIST_SetDefaultTextColor       (unsigned Index, GUI_COLOR Color);
00219 void             SWIPELIST_SetDefaultTextAlign       (int Align);
00220 void             SWIPELIST_SetDefaultThreshold       (int Threshold);
00221 
00222 #if defined(__cplusplus)
00223   }
00224 #endif
00225 
00226 #endif  // GUI_WINSUPPORT
00227 #endif  // SWIPELIST_H
00228 
00229 /*************************** End of file ****************************/