Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
FRAMEWIN.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.h 00041 Purpose : Frame window include 00042 --------------------END-OF-HEADER------------------------------------- 00043 */ 00044 00045 #ifndef FRAMEWIN_H 00046 #define FRAMEWIN_H 00047 00048 #include "WM.h" 00049 #include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */ 00050 #if GUI_WINSUPPORT 00051 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ 00052 00053 #if defined(__cplusplus) 00054 extern "C" { /* Make sure we have C-declarations in C++ programs */ 00055 #endif 00056 00057 /********************************************************************* 00058 * 00059 * Defines 00060 * 00061 ********************************************************************** 00062 */ 00063 /********************************************************************* 00064 * 00065 * Configuration 00066 */ 00067 #ifndef FRAMEWIN_ALLOW_DRAG_ON_FRAME 00068 #define FRAMEWIN_ALLOW_DRAG_ON_FRAME 1 00069 #endif 00070 00071 /********************************************************************* 00072 * 00073 * Color indices 00074 */ 00075 #define FRAMEWIN_CI_INACTIVE 0 00076 #define FRAMEWIN_CI_ACTIVE 1 00077 00078 /********************************************************************* 00079 * 00080 * Create / Status flags 00081 */ 00082 #define FRAMEWIN_CF_ACTIVE (1<<3) 00083 #define FRAMEWIN_CF_MOVEABLE (1<<4) 00084 #define FRAMEWIN_CF_TITLEVIS (1<<5) 00085 #define FRAMEWIN_CF_MINIMIZED (1<<6) 00086 #define FRAMEWIN_CF_MAXIMIZED (1<<7) 00087 #define FRAMEWIN_CF_DRAGGING (1<<8) 00088 00089 #define FRAMEWIN_SF_ACTIVE FRAMEWIN_CF_ACTIVE 00090 #define FRAMEWIN_SF_MOVEABLE FRAMEWIN_CF_MOVEABLE 00091 #define FRAMEWIN_SF_TITLEVIS FRAMEWIN_CF_TITLEVIS 00092 #define FRAMEWIN_SF_MINIMIZED FRAMEWIN_CF_MINIMIZED 00093 #define FRAMEWIN_SF_MAXIMIZED FRAMEWIN_CF_MAXIMIZED 00094 #define FRAMEWIN_SF_DRAGGING FRAMEWIN_CF_DRAGGING 00095 00096 /********************************************************************* 00097 * 00098 * BUTTON Flags 00099 */ 00100 #define FRAMEWIN_BUTTON_RIGHT (1<<0) 00101 #define FRAMEWIN_BUTTON_LEFT (1<<1) 00102 00103 /********************************************************************* 00104 * 00105 * Skinning property indices 00106 */ 00107 #define FRAMEWIN_SKINFLEX_PI_ACTIVE 0 00108 #define FRAMEWIN_SKINFLEX_PI_INACTIVE 1 00109 00110 /********************************************************************* 00111 * 00112 * Getting border size 00113 */ 00114 #define FRAMEWIN_BORDERSIZE_T 0 00115 #define FRAMEWIN_BORDERSIZE_L 1 00116 #define FRAMEWIN_BORDERSIZE_B 2 00117 #define FRAMEWIN_BORDERSIZE_R 3 00118 00119 /********************************************************************* 00120 * 00121 * Types 00122 * 00123 ********************************************************************** 00124 */ 00125 typedef WM_HMEM FRAMEWIN_Handle; 00126 00127 typedef struct { 00128 GUI_COLOR aColorFrame[3]; 00129 GUI_COLOR aColorTitle[2]; 00130 int Radius; 00131 int SpaceX; 00132 int BorderSizeL; 00133 int BorderSizeR; 00134 int BorderSizeT; 00135 int BorderSizeB; 00136 } FRAMEWIN_SKINFLEX_PROPS; 00137 00138 /********************************************************************* 00139 * 00140 * Create functions 00141 * 00142 ********************************************************************** 00143 */ 00144 FRAMEWIN_Handle FRAMEWIN_Create (const char * pTitle, WM_CALLBACK * cb, int Flags, int x0, int y0, int xSize, int ySize); 00145 FRAMEWIN_Handle FRAMEWIN_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, const char * pText, WM_CALLBACK * cb, int Flags); 00146 FRAMEWIN_Handle FRAMEWIN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pTitle, WM_CALLBACK * cb); 00147 FRAMEWIN_Handle FRAMEWIN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pTitle, WM_CALLBACK * cb, int NumExtraBytes); 00148 FRAMEWIN_Handle FRAMEWIN_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); 00149 00150 /********************************************************************* 00151 * 00152 * The callback ... 00153 * 00154 * Do not call it directly ! It is only to be used from within an 00155 * overwritten callback. 00156 */ 00157 void FRAMEWIN_Callback(WM_MESSAGE * pMsg); 00158 00159 /********************************************************************* 00160 * 00161 * Member functions: Set Properties 00162 * 00163 ********************************************************************** 00164 */ 00165 WM_HWIN FRAMEWIN_AddButton (FRAMEWIN_Handle hObj, int Flags, int Off, int Id); 00166 WM_HWIN FRAMEWIN_AddCloseButton(FRAMEWIN_Handle hObj, int Flags, int Off); 00167 WM_HWIN FRAMEWIN_AddMaxButton (FRAMEWIN_Handle hObj, int Flags, int Off); 00168 void FRAMEWIN_AddMenu (FRAMEWIN_Handle hObj, WM_HWIN hMenu); 00169 WM_HWIN FRAMEWIN_AddMinButton (FRAMEWIN_Handle hObj, int Flags, int Off); 00170 void FRAMEWIN_Minimize (FRAMEWIN_Handle hObj); 00171 void FRAMEWIN_Maximize (FRAMEWIN_Handle hObj); 00172 void FRAMEWIN_Restore (FRAMEWIN_Handle hObj); 00173 void FRAMEWIN_SetActive (FRAMEWIN_Handle hObj, int State); 00174 void FRAMEWIN_SetBarColor (FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color); 00175 void FRAMEWIN_SetBorderSize (FRAMEWIN_Handle hObj, unsigned Size); 00176 void FRAMEWIN_SetClientColor(FRAMEWIN_Handle hObj, GUI_COLOR Color); 00177 void FRAMEWIN_SetFont (FRAMEWIN_Handle hObj, const GUI_FONT * pFont); 00178 void FRAMEWIN_SetMoveable (FRAMEWIN_Handle hObj, int State); 00179 void FRAMEWIN_SetOwnerDraw (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); 00180 void FRAMEWIN_SetResizeable (FRAMEWIN_Handle hObj, int State); 00181 void FRAMEWIN_SetText (FRAMEWIN_Handle hObj, const char* s); 00182 void FRAMEWIN_SetTextAlign (FRAMEWIN_Handle hObj, int Align); 00183 void FRAMEWIN_SetTextColor (FRAMEWIN_Handle hObj, GUI_COLOR Color); 00184 void FRAMEWIN_SetTextColorEx(FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color); 00185 void FRAMEWIN_SetTitleVis (FRAMEWIN_Handle hObj, int Show); 00186 int FRAMEWIN_SetTitleHeight(FRAMEWIN_Handle hObj, int Height); 00187 int FRAMEWIN_SetUserData (FRAMEWIN_Handle hObj, const void * pSrc, int NumBytes); 00188 00189 /********************************************************************* 00190 * 00191 * Member functions: Skinning 00192 * 00193 ********************************************************************** 00194 */ 00195 void FRAMEWIN_GetSkinFlexProps (FRAMEWIN_SKINFLEX_PROPS * pProps, int Index); 00196 void FRAMEWIN_SetSkinClassic (FRAMEWIN_Handle hObj); 00197 void FRAMEWIN_SetSkin (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00198 int FRAMEWIN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); 00199 void FRAMEWIN_SetSkinFlexProps (const FRAMEWIN_SKINFLEX_PROPS * pProps, int Index); 00200 void FRAMEWIN_SetDefaultSkinClassic(void); 00201 WIDGET_DRAW_ITEM_FUNC * FRAMEWIN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); 00202 00203 #define FRAMEWIN_SKIN_FLEX FRAMEWIN_DrawSkinFlex 00204 00205 /********************************************************************* 00206 * 00207 * Member functions: Get Properties 00208 * 00209 ********************************************************************** 00210 */ 00211 const GUI_FONT * FRAMEWIN_GetFont(FRAMEWIN_Handle hObj); 00212 00213 int FRAMEWIN_GetActive (FRAMEWIN_Handle hObj); 00214 int FRAMEWIN_GetTitleHeight (FRAMEWIN_Handle hObj); 00215 GUI_COLOR FRAMEWIN_GetBarColor (FRAMEWIN_Handle hObj, unsigned Index); 00216 int FRAMEWIN_GetBorderSize (FRAMEWIN_Handle hObj); 00217 int FRAMEWIN_GetBorderSizeEx(FRAMEWIN_Handle hObj, unsigned Edge); 00218 void FRAMEWIN_GetText (FRAMEWIN_Handle hObj, char * pBuffer, int MaxLen); 00219 int FRAMEWIN_GetTextAlign (FRAMEWIN_Handle hObj); 00220 int FRAMEWIN_GetUserData (FRAMEWIN_Handle hObj, void * pDest, int NumBytes); 00221 int FRAMEWIN_IsMinimized (FRAMEWIN_Handle hObj); 00222 int FRAMEWIN_IsMaximized (FRAMEWIN_Handle hObj); 00223 00224 /********************************************************************* 00225 * 00226 * Managing default values 00227 * 00228 ********************************************************************** 00229 */ 00230 GUI_COLOR FRAMEWIN_GetDefaultBarColor (unsigned Index); 00231 int FRAMEWIN_GetDefaultBorderSize (void); 00232 int FRAMEWIN_GetDefaultTitleHeight(void); 00233 GUI_COLOR FRAMEWIN_GetDefaultClientColor(void); 00234 const GUI_FONT * FRAMEWIN_GetDefaultFont (void); 00235 GUI_COLOR FRAMEWIN_GetDefaultTextColor (unsigned Index); 00236 int FRAMEWIN_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); 00237 void FRAMEWIN_SetDefaultBarColor (unsigned Index, GUI_COLOR Color); 00238 void FRAMEWIN_SetDefaultBorderSize (int DefaultBorderSize); 00239 void FRAMEWIN_SetDefaultTitleHeight(int DefaultTitleHeight); 00240 void FRAMEWIN_SetDefaultClientColor(GUI_COLOR Color); 00241 void FRAMEWIN_SetDefaultFont (const GUI_FONT * pFont); 00242 int FRAMEWIN_SetDefaultTextAlign (int TextAlign); 00243 void FRAMEWIN_SetDefaultTextColor (unsigned Index, GUI_COLOR Color); 00244 00245 /********************************************************************* 00246 * 00247 * Macros for compatibility 00248 * 00249 ********************************************************************** 00250 */ 00251 #define FRAMEWIN_SetDefaultCaptionSize(Height) FRAMEWIN_SetDefaultTitleHeight(Height) 00252 #define FRAMEWIN_GetDefaultCaptionSize() FRAMEWIN_GetDefaultTitleHeight() 00253 #define FRAMEWIN_CreateButton(hObj, Flags, Off, Id) FRAMEWIN_AddButton(hObj, Flags, Off, Id) 00254 #define FRAMEWIN_CreateCloseButton(hObj, Flags, Off) FRAMEWIN_AddCloseButton(hObj, Flags, Off) 00255 #define FRAMEWIN_CreateMaxButton(hObj, Flags, Off) FRAMEWIN_AddMaxButton(hObj, Flags, Off) 00256 #define FRAMEWIN_CreateMinButton(hObj, Flags, Off) FRAMEWIN_AddMinButton(hObj, Flags, Off) 00257 00258 #if defined(__cplusplus) 00259 } 00260 #endif 00261 00262 #endif // GUI_WINSUPPORT 00263 #endif // FRAMEWIN_H 00264 00265 /*************************** End of file ****************************/
Generated on Thu Jul 14 2022 12:58:40 by
