RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RADIO.h Source File

RADIO.h

00001 /*********************************************************************
00002 *                SEGGER Microcontroller GmbH & Co. KG                *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2016  SEGGER Microcontroller GmbH & Co. KG       *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.38 - 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  NXP Semiconductors USA, Inc.  whose
00019 registered  office  is  situated  at 411 E. Plumeria Drive, San  Jose,
00020 CA 95134, USA  solely for  the  purposes  of  creating  libraries  for
00021 NXPs M0, M3/M4 and  ARM7/9 processor-based  devices,  sublicensed  and
00022 distributed under the terms and conditions of the NXP 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 
00030 Licensor:                 SEGGER Microcontroller Systems LLC
00031 Licensed to:              NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA
00032 Licensed SEGGER software: emWin
00033 License number:           GUI-00186
00034 License model:            emWin License Agreement, dated August 20th 2011
00035 Licensed product:         -
00036 Licensed platform:        NXP's ARM 7/9, Cortex-M0,M3,M4
00037 Licensed number of seats: -
00038 ----------------------------------------------------------------------
00039 File        : RADIO.h
00040 Purpose     : RADIO include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef RADIO_H
00045 #define RADIO_H
00046 
00047 #include "WM.h"
00048 #include "DIALOG_Intern.h"      /* Req. for Create indirect data structure */
00049 #include "WIDGET.h"
00050 
00051 #if GUI_WINSUPPORT
00052 
00053 #if defined(__cplusplus)
00054   extern "C" {     /* Make sure we have C-declarations in C++ programs */
00055 #endif
00056 
00057 /*********************************************************************
00058 *
00059 *       Bitmap indices
00060 */
00061 #define RADIO_BI_INACTIV 0
00062 #define RADIO_BI_ACTIV   1
00063 #define RADIO_BI_CHECK   2
00064 
00065 /*********************************************************************
00066 *
00067 *       Skinning property indices
00068 */
00069 #define RADIO_SKINFLEX_PI_PRESSED     0
00070 #define RADIO_SKINFLEX_PI_UNPRESSED   1
00071 
00072 /*********************************************************************
00073 *
00074 *       Defaults for public configuration switches
00075 *
00076 **********************************************************************
00077 
00078 The following are defaults for config switches which affect the
00079 interface specified in this module
00080 */
00081 
00082 /*********************************************************************
00083 *
00084 *       Defines
00085 *
00086 **********************************************************************
00087 */
00088 #define RADIO_TEXTPOS_RIGHT       0
00089 #define RADIO_TEXTPOS_LEFT        WIDGET_STATE_USER0  /* Not implemented, TBD */
00090 
00091 /*********************************************************************
00092 *
00093 *       Public Types
00094 *
00095 **********************************************************************
00096 */
00097 typedef WM_HMEM RADIO_Handle;
00098 
00099 typedef struct {
00100   GUI_COLOR aColorButton[4];
00101   int       ButtonSize;
00102 } RADIO_SKINFLEX_PROPS;
00103 
00104 /*********************************************************************
00105 *
00106 *       Create functions
00107 *
00108 **********************************************************************
00109 */
00110 
00111 RADIO_Handle RADIO_Create        (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, unsigned Para);
00112 RADIO_Handle RADIO_CreateEx      (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumItems, int Spacing);
00113 RADIO_Handle RADIO_CreateUser    (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumItems, int Spacing, int NumExtraBytes);
00114 RADIO_Handle RADIO_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
00115 
00116 /*********************************************************************
00117 *
00118 *       The callback ...
00119 *
00120 * Do not call it directly ! It is only to be used from within an
00121 * overwritten callback.
00122 */
00123 void RADIO_Callback(WM_MESSAGE * pMsg);
00124 
00125 /*********************************************************************
00126 *
00127 *       Managing default values
00128 *
00129 **********************************************************************
00130 */
00131 
00132 void             RADIO_SetDefaultFont      (const GUI_FONT * pFont);
00133 GUI_COLOR        RADIO_SetDefaultFocusColor(GUI_COLOR Color);
00134 void             RADIO_SetDefaultImage     (const GUI_BITMAP * pBitmap, unsigned int Index);
00135 void             RADIO_SetDefaultTextColor (GUI_COLOR TextColor);
00136 const GUI_FONT * RADIO_GetDefaultFont      (void);
00137 GUI_COLOR        RADIO_GetDefaultTextColor (void);
00138 
00139 /*********************************************************************
00140 *
00141 *       Member functions
00142 *
00143 **********************************************************************
00144 */
00145 
00146 void      RADIO_AddValue     (RADIO_Handle hObj, int Add);
00147 void      RADIO_Dec          (RADIO_Handle hObj);
00148 int       RADIO_GetText      (RADIO_Handle hObj, unsigned Index, char * pBuffer, int MaxLen);
00149 int       RADIO_GetUserData  (RADIO_Handle hObj, void * pDest, int NumBytes);
00150 void      RADIO_Inc          (RADIO_Handle hObj);
00151 void      RADIO_SetBkColor   (RADIO_Handle hObj, GUI_COLOR Color);
00152 GUI_COLOR RADIO_SetFocusColor(RADIO_Handle hObj, GUI_COLOR Color);
00153 void      RADIO_SetFont      (RADIO_Handle hObj, const GUI_FONT * pFont);
00154 void      RADIO_SetGroupId   (RADIO_Handle hObj, U8 GroupId);
00155 void      RADIO_SetImage     (RADIO_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index);
00156 void      RADIO_SetText      (RADIO_Handle hObj, const char* pText, unsigned Index);
00157 void      RADIO_SetTextColor (RADIO_Handle hObj, GUI_COLOR Color);
00158 void      RADIO_SetValue     (RADIO_Handle hObj, int v);
00159 int       RADIO_SetUserData  (RADIO_Handle hObj, const void * pSrc, int NumBytes);
00160 
00161 const GUI_BITMAP * RADIO_GetImage(RADIO_Handle hObj, unsigned int Index);
00162 
00163 /*********************************************************************
00164 *
00165 *       Member functions: Skinning
00166 *
00167 **********************************************************************
00168 */
00169 void RADIO_GetSkinFlexProps     (RADIO_SKINFLEX_PROPS * pProps, int Index);
00170 void RADIO_SetSkinClassic       (RADIO_Handle hObj);
00171 void RADIO_SetSkin              (RADIO_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00172 int  RADIO_DrawSkinFlex         (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
00173 void RADIO_SetSkinFlexProps     (const RADIO_SKINFLEX_PROPS * pProps, int Index);
00174 void RADIO_SetDefaultSkinClassic(void);
00175 WIDGET_DRAW_ITEM_FUNC * RADIO_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
00176 
00177 #define RADIO_SKIN_FLEX    RADIO_DrawSkinFlex
00178 
00179 /*********************************************************************
00180 *
00181 *       Query state
00182 *
00183 **********************************************************************
00184 */
00185 int RADIO_GetValue(RADIO_Handle hObj);
00186 
00187 #if defined(__cplusplus)
00188   }
00189 #endif
00190 
00191 #endif  // GUI_WINSUPPORT
00192 #endif  // RADIO_H
00193 
00194 /*************************** End of file ****************************/