Andrew Reed / Mbed OS CITY1082-i2c_master_wifi_mqtt
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SCROLLBAR_Private.h Source File

SCROLLBAR_Private.h

00001 /*********************************************************************
00002 *                SEGGER Microcontroller 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 to  Cypress Semiconductor Corporation,
00019 whose registered  office is situated  at 198 Champion Ct. San Jose, CA 
00020 95134 USA  solely for the  purposes of creating  libraries for Cypress
00021 PSoC3 and  PSoC5 processor-based devices,  sublicensed and distributed
00022 under  the  terms  and  conditions  of  the  Cypress  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 Licensor:                 SEGGER Microcontroller Systems LLC
00030 Licensed to:              Cypress Semiconductor Corp, 198 Champion Ct., San Jose, CA 95134, USA
00031 Licensed SEGGER software: emWin
00032 License number:           GUI-00319
00033 License model:            Services and License Agreement, signed June 10th, 2009
00034 Licensed platform:        Any Cypress platform (Initial targets are: PSoC3, PSoC5)
00035 ----------------------------------------------------------------------
00036 Support and Update Agreement (SUA)
00037 SUA period:               2009-06-12 - 2022-07-27
00038 Contact to extend SUA:    sales@segger.com
00039 ----------------------------------------------------------------------
00040 File        : SCROLLBAR_Private.h
00041 Purpose     : SCROLLBAR internal header file
00042 ---------------------------END-OF-HEADER------------------------------
00043 */
00044 
00045 #ifndef SCROLLBAR_PRIVATE_H
00046 #define SCROLLBAR_PRIVATE_H
00047 
00048 #include "SCROLLBAR.h"
00049 #include "WIDGET.h"
00050 #include "GUI_Debug.h"
00051 
00052 #if GUI_WINSUPPORT
00053 
00054 /*********************************************************************
00055 *
00056 *       Defines
00057 *
00058 **********************************************************************
00059 */
00060 #define PRESSED_STATE_NONE  0
00061 #define PRESSED_STATE_RIGHT 1
00062 #define PRESSED_STATE_LEFT  2
00063 #define PRESSED_STATE_THUMB 3
00064 
00065 /*********************************************************************
00066 *
00067 *       Private config defaults
00068 *
00069 **********************************************************************
00070 */
00071 
00072 /* Define colors */
00073 #ifndef   SCROLLBAR_COLOR_SHAFT_DEFAULT
00074   #define SCROLLBAR_COLOR_SHAFT_DEFAULT GUI_GRAY
00075 #endif
00076 
00077 #ifndef   SCROLLBAR_COLOR_ARROW_DEFAULT
00078   #define SCROLLBAR_COLOR_ARROW_DEFAULT GUI_BLACK
00079 #endif
00080 
00081 #ifndef   SCROLLBAR_COLOR_THUMB_DEFAULT
00082   #define SCROLLBAR_COLOR_THUMB_DEFAULT GUI_GRAY_C0
00083 #endif
00084 
00085 #ifndef   SCROLLBAR_THUMB_SIZE_MIN_DEFAULT
00086   #define SCROLLBAR_THUMB_SIZE_MIN_DEFAULT 4
00087 #endif
00088 
00089 #ifndef SCROLLBAR_DEFAULT_WIDTH
00090   #if   WIDGET_USE_SCHEME_SMALL
00091     #define SCROLLBAR_DEFAULT_WIDTH 11
00092   #elif WIDGET_USE_SCHEME_MEDIUM
00093     #define SCROLLBAR_DEFAULT_WIDTH 16
00094   #elif WIDGET_USE_SCHEME_LARGE
00095     #define SCROLLBAR_DEFAULT_WIDTH 22
00096   #endif
00097 #endif
00098 
00099 #define SCROLLBAR_TIMER_ID 1234
00100 
00101 /*********************************************************************
00102 *
00103 *       Module internal data
00104 *
00105 **********************************************************************
00106 */
00107 extern GUI_COLOR  SCROLLBAR__aDefaultBkColor[2];
00108 extern GUI_COLOR  SCROLLBAR__aDefaultColor[2];
00109 extern I16        SCROLLBAR__DefaultWidth;
00110 extern I16        SCROLLBAR__ThumbSizeMin;
00111 
00112 /*********************************************************************
00113 *
00114 *       Object definition
00115 *
00116 **********************************************************************
00117 */
00118 typedef struct {
00119   WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
00120 } SCROLLBAR_SKIN_PRIVATE;
00121 
00122 typedef struct {
00123   GUI_COLOR aColor[3];
00124   SCROLLBAR_SKIN_PRIVATE SkinPrivate;
00125 } SCROLLBAR_PROPS;
00126 
00127 typedef struct {
00128   int x0_LeftArrow;
00129   int x1_LeftArrow;
00130   int x0_Thumb;
00131   int x1_Thumb;
00132   int x0_RightArrow;
00133   int x1_RightArrow;
00134   int x1;
00135   int xSizeMoveable;
00136   int ThumbSize;
00137 } SCROLLBAR_POSITIONS;
00138 
00139 typedef struct SCROLLBAR_OBJ SCROLLBAR_OBJ;
00140 
00141 struct SCROLLBAR_OBJ {
00142   WIDGET Widget;
00143   SCROLLBAR_PROPS Props;
00144   WIDGET_SKIN const * pWidgetSkin;
00145   void (* pfCalcPositions)(SCROLLBAR_Handle hObj, SCROLLBAR_POSITIONS * pPos);
00146   int NumItems, v, PageSize;
00147   int State;
00148   int TimerStep;
00149   int TouchPos;
00150   WM_HMEM hTimer;
00151 };
00152 
00153 /*********************************************************************
00154 *
00155 *       Private macros
00156 *
00157 **********************************************************************
00158 */
00159 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00160   #define SCROLLBAR_INIT_ID(p) (p->Widget.DebugId = SCROLLBAR_ID)
00161 #else
00162   #define SCROLLBAR_INIT_ID(p)
00163 #endif
00164 
00165 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00166   SCROLLBAR_OBJ * SCROLLBAR_LockH(SCROLLBAR_Handle h);
00167   #define SCROLLBAR_LOCK_H(h)   SCROLLBAR_LockH(h)
00168 #else
00169   #define SCROLLBAR_LOCK_H(h)   (SCROLLBAR_OBJ *)GUI_LOCK_H(h)
00170 #endif
00171 
00172 /*********************************************************************
00173 *
00174 *       Private functions
00175 *
00176 **********************************************************************
00177 */
00178 void SCROLLBAR__InvalidatePartner(SCROLLBAR_Handle hObj);
00179 void SCROLLBAR__Rect2VRect       (const WIDGET * pWidget, GUI_RECT * pRect);
00180 
00181 /*********************************************************************
00182 *
00183 *       Private data
00184 *
00185 **********************************************************************
00186 */
00187 extern SCROLLBAR_PROPS SCROLLBAR__DefaultProps;
00188 
00189 extern const WIDGET_SKIN SCROLLBAR__SkinClassic;
00190 extern       WIDGET_SKIN SCROLLBAR__Skin;
00191 
00192 extern WIDGET_SKIN const * SCROLLBAR__pSkinDefault;
00193 
00194 #endif        /* GUI_WINSUPPORT */
00195 #endif        /* Avoid multiple inclusion */
00196 
00197 /*************************** End of file ****************************/