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

« Back to documentation index

Show/hide line numbers SPINBOX_Private.h Source File

SPINBOX_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        : SPINBOX_Private.h
00041 Purpose     : Private SPINBOX include
00042 --------------------END-OF-HEADER-------------------------------------
00043 */
00044 
00045 #ifndef SPINBOX_PRIVATE_H
00046 #define SPINBOX_PRIVATE_H
00047 
00048 #include "SPINBOX.h"
00049 #include "EDIT.h"
00050 #include "GUI_Private.h"
00051 
00052 #if GUI_WINSUPPORT
00053 
00054 /*********************************************************************
00055 *
00056 *       Private config defaults
00057 *
00058 **********************************************************************
00059 */
00060 
00061 /*********************************************************************
00062 *
00063 *       Object definition
00064 *
00065 **********************************************************************
00066 */
00067 typedef struct {
00068   WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
00069 } SPINBOX_SKIN_PRIVATE;
00070 
00071 typedef struct {
00072   GUI_COLOR            aButtonBkColor[3];    // Button background color for the states (disabled, pressed, unpressed).
00073   GUI_COLOR            aButtonUpperColor[3]; // Upper color for the button states (disabled, pressed, unpressed).
00074   GUI_COLOR            aButtonLowerColor[3]; // Lower color for the button states (disabled, pressed, unpressed).
00075   GUI_COLOR            aButtonOuterColor[3]; // Outer color for the button states (disabled, pressed, unpressed).
00076   GUI_COLOR            aTriangleColor[3];    // Color of the triangle for the button states (disabled, pressed, unpressed).
00077   GUI_COLOR            aBkColor[2];          // Background color for the states (enabled, disabled).
00078   GUI_COLOR            aTextColor[2];        // Text       color for the states (enabled, disabled).
00079   I32                  Min;                  // Minimum allowed value.
00080   I32                  Max;                  // Maximum allowed value.
00081   U16                  Step;                 // Value will be increased/decreased by this amount when a button is clicked.
00082   U16                  ButtonSize;           // Size of the button depending on the orientation.
00083   U8                   Edge;                 // Buttons reside on the left or right edge of the widget.
00084   SPINBOX_SKIN_PRIVATE SkinPrivate;          // Structure containing a pointer to the used DrawSkin-function.
00085 } SPINBOX_PROPS;
00086 
00087 typedef struct {
00088   WIDGET              Widget;
00089   SPINBOX_PROPS       Props;
00090   const WIDGET_SKIN * pWidgetSkin;
00091   EDIT_Handle         hEdit;
00092   GUI_TIMER_HANDLE    hTimer;
00093   I8                  TimerButton;
00094   I8                  LastButton;
00095   I8                  NoAction;
00096   U8                  State;       // Pressed state
00097 } SPINBOX_OBJ;
00098 
00099 /*********************************************************************
00100 *
00101 *       Macros for internal use
00102 *
00103 **********************************************************************
00104 */
00105 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00106   #define SPINBOX_INIT_ID(p) (p->Widget.DebugId = SPINBOX_ID)
00107 #else
00108   #define SPINBOX_INIT_ID(p)
00109 #endif
00110 
00111 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00112   SPINBOX_OBJ * SPINBOX_LockH(SPINBOX_Handle h);
00113   #define SPINBOX_LOCK_H(h)   SPINBOX_LockH(h)
00114 #else
00115   #define SPINBOX_LOCK_H(h)   (SPINBOX_OBJ *)GUI_LOCK_H(h)
00116 #endif
00117 
00118 #define SPINBOX_BUTTON_NONE     -1
00119 #define SPINBOX_BUTTON_0         0
00120 #define SPINBOX_BUTTON_1         1
00121 
00122 #define SPINBOX_TIMER_ID         1234
00123 
00124 /*********************************************************************
00125 *
00126 *       Private function prototypes
00127 *
00128 **********************************************************************
00129 */
00130 void SPINBOX__ApplyProps     (SPINBOX_Handle hObj, SPINBOX_SKINFLEX_PROPS * const * ppProps);
00131 void SPINBOX__DrawBk         (SPINBOX_Handle hObj, GUI_COLOR   Color);
00132 void SPINBOX__GetButtonRect  (SPINBOX_Handle hObj, GUI_RECT  * pButtonRect, U8  ButtonIndex);
00133 void SPINBOX__GetButtonRectEx(SPINBOX_Handle hObj, WIDGET_ITEM_DRAW_INFO * ItemInfo);
00134 int  SPINBOX__GetDefaultMax  (void);
00135 int  SPINBOX__GetDefaultMin  (void);
00136 
00137 /*********************************************************************
00138 *
00139 *       Module internal data
00140 *
00141 **********************************************************************
00142 */
00143 /*********************************************************************
00144 *
00145 *       Public data (internal defaults)
00146 *
00147 **********************************************************************
00148 */
00149 extern       SPINBOX_PROPS   SPINBOX__DefaultProps;
00150 extern const WIDGET_SKIN     SPINBOX__SkinClassic;
00151 extern       WIDGET_SKIN     SPINBOX__Skin;
00152 extern const WIDGET_SKIN   * SPINBOX__pSkinDefault;
00153 
00154 #endif  // GUI_WINSUPPORT
00155 #endif  // SPINBOX_PRIVATE_H
00156 
00157 /*************************** End of file ****************************/