NuMaker emWin HMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SCROLLBAR_Private.h Source File

SCROLLBAR_Private.h

00001 /*********************************************************************
00002 *                 SEGGER Software GmbH                               *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2018  SEGGER Microcontroller GmbH                *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.48 - 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 by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
00019 for the purposes  of  creating  libraries  for its 
00020 Arm Cortex-M and  Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
00021 under  the terms and conditions  of  an  End  User  
00022 License  Agreement  supplied  with  the libraries.
00023 Full source code is available at: www.segger.com
00024 
00025 We appreciate your understanding and fairness.
00026 ----------------------------------------------------------------------
00027 Licensing information
00028 Licensor:                 SEGGER Software GmbH
00029 Licensed to:              Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
00030 Licensed SEGGER software: emWin
00031 License number:           GUI-00735
00032 License model:            emWin License Agreement, signed February 27, 2018
00033 Licensed platform:        Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
00034 ----------------------------------------------------------------------
00035 Support and Update Agreement (SUA)
00036 SUA period:               2018-03-26 - 2019-03-27
00037 Contact to extend SUA:    sales@segger.com
00038 ----------------------------------------------------------------------
00039 File        : SCROLLBAR_Private.h
00040 Purpose     : SCROLLBAR internal header file
00041 ---------------------------END-OF-HEADER------------------------------
00042 */
00043 
00044 #ifndef SCROLLBAR_PRIVATE_H
00045 #define SCROLLBAR_PRIVATE_H
00046 
00047 #include "SCROLLBAR.h"
00048 #include "WIDGET.h"
00049 #include "GUI_Debug.h"
00050 
00051 #if GUI_WINSUPPORT
00052 
00053 /*********************************************************************
00054 *
00055 *       Defines
00056 *
00057 **********************************************************************
00058 */
00059 #define PRESSED_STATE_NONE  0
00060 #define PRESSED_STATE_RIGHT 1
00061 #define PRESSED_STATE_LEFT  2
00062 #define PRESSED_STATE_THUMB 3
00063 
00064 /*********************************************************************
00065 *
00066 *       Private config defaults
00067 *
00068 **********************************************************************
00069 */
00070 
00071 /* Define colors */
00072 #ifndef   SCROLLBAR_COLOR_SHAFT_DEFAULT
00073   #define SCROLLBAR_COLOR_SHAFT_DEFAULT GUI_GRAY
00074 #endif
00075 
00076 #ifndef   SCROLLBAR_COLOR_ARROW_DEFAULT
00077   #define SCROLLBAR_COLOR_ARROW_DEFAULT GUI_BLACK
00078 #endif
00079 
00080 #ifndef   SCROLLBAR_COLOR_THUMB_DEFAULT
00081   #define SCROLLBAR_COLOR_THUMB_DEFAULT GUI_GRAY_C0
00082 #endif
00083 
00084 #ifndef   SCROLLBAR_THUMB_SIZE_MIN_DEFAULT
00085   #define SCROLLBAR_THUMB_SIZE_MIN_DEFAULT 4
00086 #endif
00087 
00088 #ifndef SCROLLBAR_DEFAULT_WIDTH
00089   #if   WIDGET_USE_SCHEME_SMALL
00090     #define SCROLLBAR_DEFAULT_WIDTH 11
00091   #elif WIDGET_USE_SCHEME_MEDIUM
00092     #define SCROLLBAR_DEFAULT_WIDTH 16
00093   #elif WIDGET_USE_SCHEME_LARGE
00094     #define SCROLLBAR_DEFAULT_WIDTH 22
00095   #endif
00096 #endif
00097 
00098 #define SCROLLBAR_TIMER_ID 1234
00099 
00100 /*********************************************************************
00101 *
00102 *       Module internal data
00103 *
00104 **********************************************************************
00105 */
00106 extern GUI_COLOR  SCROLLBAR__aDefaultBkColor[2];
00107 extern GUI_COLOR  SCROLLBAR__aDefaultColor[2];
00108 extern I16        SCROLLBAR__DefaultWidth;
00109 extern I16        SCROLLBAR__ThumbSizeMin;
00110 
00111 /*********************************************************************
00112 *
00113 *       Object definition
00114 *
00115 **********************************************************************
00116 */
00117 typedef struct {
00118   WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
00119 } SCROLLBAR_SKIN_PRIVATE;
00120 
00121 typedef struct {
00122   GUI_COLOR aColor[3];
00123   SCROLLBAR_SKIN_PRIVATE SkinPrivate;
00124 } SCROLLBAR_PROPS;
00125 
00126 typedef struct {
00127   int x0_LeftArrow;
00128   int x1_LeftArrow;
00129   int x0_Thumb;
00130   int x1_Thumb;
00131   int x0_RightArrow;
00132   int x1_RightArrow;
00133   int x1;
00134   int xSizeMoveable;
00135   int ThumbSize;
00136 } SCROLLBAR_POSITIONS;
00137 
00138 typedef struct SCROLLBAR_OBJ SCROLLBAR_OBJ;
00139 
00140 struct SCROLLBAR_OBJ {
00141   WIDGET Widget;
00142   SCROLLBAR_PROPS Props;
00143   WIDGET_SKIN const * pWidgetSkin;
00144   void (* pfCalcPositions)(SCROLLBAR_Handle hObj, SCROLLBAR_POSITIONS * pPos);
00145   int NumItems, v, PageSize;
00146   int State;
00147   int TimerStep;
00148   int TouchPos;
00149   WM_HMEM hTimer;
00150 };
00151 
00152 /*********************************************************************
00153 *
00154 *       Private macros
00155 *
00156 **********************************************************************
00157 */
00158 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00159   #define SCROLLBAR_INIT_ID(p) (p->Widget.DebugId = SCROLLBAR_ID)
00160 #else
00161   #define SCROLLBAR_INIT_ID(p)
00162 #endif
00163 
00164 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00165   SCROLLBAR_OBJ * SCROLLBAR_LockH(SCROLLBAR_Handle h);
00166   #define SCROLLBAR_LOCK_H(h)   SCROLLBAR_LockH(h)
00167 #else
00168   #define SCROLLBAR_LOCK_H(h)   (SCROLLBAR_OBJ *)GUI_LOCK_H(h)
00169 #endif
00170 
00171 /*********************************************************************
00172 *
00173 *       Private functions
00174 *
00175 **********************************************************************
00176 */
00177 void SCROLLBAR__InvalidatePartner(SCROLLBAR_Handle hObj);
00178 void SCROLLBAR__Rect2VRect       (const WIDGET * pWidget, GUI_RECT * pRect);
00179 
00180 /*********************************************************************
00181 *
00182 *       Private data
00183 *
00184 **********************************************************************
00185 */
00186 extern SCROLLBAR_PROPS SCROLLBAR__DefaultProps;
00187 
00188 extern const WIDGET_SKIN SCROLLBAR__SkinClassic;
00189 extern       WIDGET_SKIN SCROLLBAR__Skin;
00190 
00191 extern WIDGET_SKIN const * SCROLLBAR__pSkinDefault;
00192 
00193 #endif        /* GUI_WINSUPPORT */
00194 #endif        /* Avoid multiple inclusion */
00195 
00196 /*************************** End of file ****************************/