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

« Back to documentation index

Show/hide line numbers FRAMEWIN_Private.h Source File

FRAMEWIN_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        : FRAMEWIN_Private.h
00041 Purpose     : FRAMEWIN private header file
00042 --------------------END-OF-HEADER-------------------------------------
00043 */
00044 
00045 #ifndef FRAMEWIN_PRIVATE_H
00046 #define FRAMEWIN_PRIVATE_H
00047 
00048 #include "WM.h"
00049 #include "FRAMEWIN.h"
00050 #include "WIDGET.h"
00051 #include "GUI_HOOK.h"
00052 
00053 #if GUI_WINSUPPORT
00054 
00055 /******************************************************************
00056 *
00057 *       Config defaults
00058 *
00059 *******************************************************************
00060 */
00061 //
00062 //Support for 3D effects
00063 //
00064 #ifndef FRAMEWIN_CLIENTCOLOR_DEFAULT
00065   #if WIDGET_USE_FLEX_SKIN
00066     #define FRAMEWIN_CLIENTCOLOR_DEFAULT GUI_WHITE
00067   #else
00068     #define FRAMEWIN_CLIENTCOLOR_DEFAULT GUI_GRAY_C0
00069   #endif
00070 #endif
00071 
00072 //
00073 // Default for top frame size
00074 //
00075 #ifndef FRAMEWIN_TITLEHEIGHT_DEFAULT
00076   #define FRAMEWIN_TITLEHEIGHT_DEFAULT 0
00077 #endif
00078 
00079 //
00080 // Default for left/right/top/bottom frame size
00081 //
00082 #ifndef FRAMEWIN_BORDER_DEFAULT
00083   #define FRAMEWIN_BORDER_DEFAULT 3
00084 #endif
00085 
00086 //
00087 // Default for inner frame size
00088 //
00089 #ifndef FRAMEWIN_IBORDER_DEFAULT
00090   #define FRAMEWIN_IBORDER_DEFAULT 1
00091 #endif
00092 
00093 //
00094 // Default font
00095 //
00096 #ifndef FRAMEWIN_DEFAULT_FONT
00097   #if WIDGET_USE_FLEX_SKIN
00098     #if   WIDGET_USE_SCHEME_SMALL
00099       #define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
00100     #elif WIDGET_USE_SCHEME_MEDIUM
00101       #define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
00102     #elif WIDGET_USE_SCHEME_LARGE
00103       #define FRAMEWIN_DEFAULT_FONT &GUI_Font24_1
00104     #endif
00105   #else
00106     #if   WIDGET_USE_SCHEME_SMALL
00107       #define FRAMEWIN_DEFAULT_FONT &GUI_Font8_1
00108     #elif WIDGET_USE_SCHEME_MEDIUM
00109       #define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
00110     #elif WIDGET_USE_SCHEME_LARGE
00111       #define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
00112     #endif
00113   #endif
00114 #endif
00115 
00116 //
00117 // Default bar color when framewin is active
00118 //
00119 #ifndef FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT
00120   #define FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT GUI_BLUE
00121 #endif
00122 
00123 //
00124 // Default bar color when framewin is inactive
00125 //
00126 #ifndef FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT
00127   #define FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT GUI_DARKGRAY
00128 #endif
00129 
00130 //
00131 // Default frame color
00132 //
00133 #ifndef FRAMEWIN_FRAMECOLOR_DEFAULT
00134   #define FRAMEWIN_FRAMECOLOR_DEFAULT GUI_GRAY_AA
00135 #endif
00136 
00137 //
00138 // Default text color when framewin is active
00139 //
00140 #ifndef FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT
00141   #if WIDGET_USE_FLEX_SKIN
00142     #define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_BLACK
00143   #else
00144     #define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_WHITE
00145   #endif
00146 #endif
00147 
00148 //
00149 // Default text color when framewin is inactive
00150 //
00151 #ifndef FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT
00152   #if WIDGET_USE_FLEX_SKIN
00153     #define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_BLACK
00154   #else
00155     #define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_WHITE
00156   #endif
00157 #endif
00158 
00159 //
00160 // Default text alignment
00161 //
00162 #ifndef FRAMEWIN_TEXTALIGN_DEFAULT
00163   #define FRAMEWIN_TEXTALIGN_DEFAULT GUI_TA_LEFT
00164 #endif
00165 
00166 /*********************************************************************
00167 *
00168 *       Object definition
00169 *
00170 **********************************************************************
00171 */
00172 typedef struct {
00173   unsigned              (* pfGetBordersize)(FRAMEWIN_Handle hObj, unsigned Index);
00174   WIDGET_DRAW_ITEM_FUNC  * pfDrawSkin;
00175 } FRAMEWIN_SKIN_PRIVATE;
00176 
00177 typedef struct {
00178   const GUI_FONT      * pFont;
00179   GUI_COLOR             aBarColor[2];
00180   GUI_COLOR             aTextColor[2];
00181   GUI_COLOR             ClientColor;
00182   FRAMEWIN_SKIN_PRIVATE SkinPrivate;
00183   I16                   TitleHeight;
00184   I16                   BorderSize;
00185   I16                   IBorderSize;
00186   I16                   TextAlign;
00187 } FRAMEWIN_PROPS;
00188 
00189 typedef struct {
00190   WIDGET                  Widget;
00191   FRAMEWIN_PROPS          Props;
00192   WIDGET_SKIN const     * pWidgetSkin;
00193   WIDGET_DRAW_ITEM_FUNC * pfDrawItem;      // Only for drawing the title bar...
00194   WM_CALLBACK           * cb;
00195   WM_HWIN                 hClient;
00196   WM_HWIN                 hMenu;
00197   WM_HWIN                 hText;
00198   GUI_RECT                rRestore;
00199   U16                     Flags;
00200   WM_HWIN                 hFocusedChild;   // Handle to focused child .. default none (0)
00201   WM_DIALOG_STATUS      * pDialogStatus;
00202   GUI_HOOK              * pFirstHook;
00203 } FRAMEWIN_Obj;
00204 
00205 typedef struct {
00206   I16      TitleHeight;
00207   I16      MenuHeight;
00208   GUI_RECT rClient;
00209   GUI_RECT rTitleText;
00210 } FRAMEWIN_POSITIONS;
00211 
00212 /*********************************************************************
00213 *
00214 *       Macros for internal use
00215 *
00216 **********************************************************************
00217 */
00218 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00219   #define FRAMEWIN_INIT_ID(p) (p->Widget.DebugId = FRAMEWIN_ID)
00220 #else
00221   #define FRAMEWIN_INIT_ID(p)
00222 #endif
00223 
00224 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00225   FRAMEWIN_Obj * FRAMEWIN_LockH(FRAMEWIN_Handle h);
00226   #define FRAMEWIN_LOCK_H(h)   FRAMEWIN_LockH(h)
00227 #else
00228   #define FRAMEWIN_LOCK_H(h)   (FRAMEWIN_Obj *)GUI_LOCK_H(h)
00229 #endif
00230 
00231 /*********************************************************************
00232 *
00233 *       Public data (internal defaults)
00234 *
00235 **********************************************************************
00236 */
00237 extern FRAMEWIN_PROPS      FRAMEWIN__DefaultProps;
00238 
00239 extern const WIDGET_SKIN   FRAMEWIN__SkinClassic;
00240 extern       WIDGET_SKIN   FRAMEWIN__Skin;
00241 
00242 extern const WIDGET_SKIN * FRAMEWIN__pSkinDefault;
00243 
00244 /*********************************************************************
00245 *
00246 *       Private functions
00247 *
00248 **********************************************************************
00249 */
00250 void     FRAMEWIN__CalcPositions  (FRAMEWIN_Handle hObj, FRAMEWIN_POSITIONS * pPos);
00251 int      FRAMEWIN__CalcTitleHeight(FRAMEWIN_Obj * pObj);
00252 void     FRAMEWIN__UpdatePositions(FRAMEWIN_Handle hObj);
00253 void     FRAMEWIN__UpdateButtons  (FRAMEWIN_Handle hObj, int OldHeight, int OldBorderSizeL, int OldBorderSizeR, int OldBorderSizeT);
00254 void     FRAMEWIN__GetTitleLimits (FRAMEWIN_Handle hObj, int * pxMin, int * pxMax);
00255 unsigned FRAMEWIN__GetBorderSize  (FRAMEWIN_Handle hObj, unsigned Index);
00256 
00257 #endif   // GUI_WINSUPPORT
00258 #endif   // FRAMEWIN_PRIVATE_H
00259 
00260 /*************************** End of file ****************************/