RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SWIPELIST_Private.h Source File

SWIPELIST_Private.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_PRIVATE_H
00045 #define SWIPELIST_PRIVATE_H
00046 
00047 #include "SWIPELIST.h"
00048 #include "GUI_Private.h"
00049 #include "GUI_ARRAY.h"
00050 
00051 #if GUI_WINSUPPORT
00052 
00053 /*********************************************************************
00054 *
00055 *       Object definition
00056 *
00057 **********************************************************************
00058 */
00059 typedef struct {
00060   WM_HWIN hWin;
00061   int     xPos;
00062   int     yPos;
00063 } SWIPELIST_WIN;
00064 
00065 typedef struct {
00066   GUI_ARRAY      WinArray;
00067   GUI_ARRAY      TextArray;
00068   int            TextSize;
00069   WM_HMEM        hDrawObj;
00070   GUI_COLOR      SepColor;
00071   int            SepSize;
00072   int            Pos;
00073   int            Size;
00074   int            BitmapAlign;
00075   int            TextAlign;
00076   U8             Flags;
00077   U32            UserData;
00078 } SWIPELIST_ITEM;
00079 
00080 typedef struct {
00081   const GUI_FONT * pSepFont;
00082   const GUI_FONT * pHeaderFont;
00083   const GUI_FONT * pTextFont;
00084   GUI_COLOR        aTextColor[5];
00085   GUI_COLOR        aBkColor[3];
00086   int              BitmapSpace;
00087   int              aBorderSize[4];
00088   U8               Flags;
00089   int              Threshold;
00090 } SWIPELIST_PROPS;
00091 
00092 typedef struct {
00093   WIDGET                  Widget;
00094   SWIPELIST_PROPS         Props;
00095   WIDGET_DRAW_ITEM_FUNC * pfDrawItem;
00096   GUI_ARRAY               ItemArray;
00097   int                     Pos;
00098   int                     Size;
00099   int                     FirstVisible;
00100   int                     LastVisible;
00101   int                     Sel;
00102   int                     ReleasedItem;
00103 } SWIPELIST_OBJ;
00104 
00105 /*********************************************************************
00106 *
00107 *       Macros for internal use
00108 *
00109 **********************************************************************
00110 */
00111 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00112   #define SWIPELIST_INIT_ID(p) p->Widget.DebugId = SWIPELIST_ID
00113 #else
00114   #define SWIPELIST_INIT_ID(p)
00115 #endif
00116 
00117 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00118   SWIPELIST_OBJ * SWIPELIST_LockH(SWIPELIST_Handle h);
00119   #define SWIPELIST_LOCK_H(h)   SWIPELIST_LockH(h)
00120 #else
00121   #define SWIPELIST_LOCK_H(h)   (SWIPELIST_OBJ *)GUI_LOCK_H(h)
00122 #endif
00123 
00124 /*********************************************************************
00125 *
00126 *       Module internal data
00127 *
00128 **********************************************************************
00129 */
00130 extern SWIPELIST_PROPS SWIPELIST__DefaultProps;
00131 extern GUI_COLOR       SWIPELIST__DefaultSepColor;
00132 extern int             SWIPELIST__DefaultSepSize;
00133 extern int             SWIPELIST__DefaultTextAlign;
00134 
00135 /*********************************************************************
00136 *
00137 *       Private functions
00138 *
00139 **********************************************************************
00140 */
00141 void SWIPELIST__SetDrawObj   (SWIPELIST_Handle hObj, int Index, int Align, GUI_DRAW_HANDLE hDrawObj);
00142 void SWIPELIST__CalcItemPos  (GUI_ARRAY ItemArray, int StartIndex, int EndIndex, int AddSize);
00143 int  SWIPELIST__CalcItemSize (SWIPELIST_Handle hObj, int ItemIndex);
00144 
00145 #endif   /* if GUI_WINSUPPORT */
00146 #endif   /* SWIPELIST_PRIVATE_H */