RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GRAPH_Private.h Source File

GRAPH_Private.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        : GRAPH_Private.h
00040 Purpose     : GRAPH private header file
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef GRAPH_PRIVATE_H
00045 #define GRAPH_PRIVATE_H
00046 
00047 #include "GRAPH.h"
00048 #include "GUI_ARRAY.h"
00049 #include "WIDGET.h"
00050 
00051 #if GUI_WINSUPPORT
00052 
00053 /*********************************************************************
00054 *
00055 *       Object definition
00056 *
00057 **********************************************************************
00058 */
00059 typedef struct GRAPH_OBJ        GRAPH_OBJ;
00060 typedef struct GRAPH_DATA_OBJ   GRAPH_DATA_OBJ;
00061 typedef struct GRAPH_SCALE_OBJ  GRAPH_SCALE_OBJ;
00062 typedef struct GRAPH_PAINT_OBJ  GRAPH_PAINT_OBJ;
00063 
00064 struct GRAPH_PAINT_OBJ {
00065   void    (* pfOnPaint)  (WM_HMEM hObj, GUI_RECT * pRectInvalid); /* Pointer to paint function */ 
00066   void    (* pfOnDelete) (WM_HMEM hObj);                          /* Pointer to delete function */
00067   WM_HWIN hGraph;                                                 /* Handle of graph widget */    
00068 };
00069 
00070 typedef struct {
00071   GUI_COLOR        TextColor;
00072   const GUI_FONT * pFont;
00073 } GRAPH_SCALE_PROPS;
00074 
00075 struct GRAPH_SCALE_OBJ {
00076   GRAPH_PAINT_OBJ   PaintObj;
00077   GRAPH_SCALE_PROPS Props;
00078   int               Pos;
00079   int               TextAlign;
00080   unsigned          TickDist;
00081   int               Off;
00082   U16               Flags;
00083   float             Factor;
00084   int               NumDecs;
00085 };
00086 
00087 struct GRAPH_DATA_OBJ {
00088   GRAPH_PAINT_OBJ PaintObj;
00089   void         (* pfInvalidateNewItem)(GRAPH_DATA_OBJ * pDataObj); /* Pointer to a function which can be used for invalidating the required area */
00090   unsigned        NumItems;
00091   unsigned        MaxNumItems;
00092   GUI_COLOR       Color;
00093   int             OffX, OffY;
00094 };
00095 
00096 typedef struct {
00097   GUI_COLOR aColor[4];
00098   unsigned  GridSpacingX;
00099   unsigned  GridSpacingY;
00100   unsigned  GridOffX;
00101   unsigned  GridOffY;
00102   unsigned  BorderL;
00103   unsigned  BorderT;
00104   unsigned  BorderR;
00105   unsigned  BorderB;
00106 } GRAPH_PROPS;
00107 
00108 struct GRAPH_OBJ {
00109   WIDGET          Widget;
00110   GRAPH_PROPS     Props;
00111   GUI_ARRAY       GraphArray;
00112   GUI_ARRAY       ScaleArray;
00113   U8              ShowGrid;
00114   unsigned        RangeX, RangeY;
00115   U16             Flags;
00116   U8              LineStyleV;
00117   U8              LineStyleH;
00118   WM_SCROLL_STATE ScrollStateV;
00119   WM_SCROLL_STATE ScrollStateH;
00120   void            (* pUserDraw)(WM_HWIN hObj, int Stage);
00121 };
00122 
00123 /*********************************************************************
00124 *
00125 *       Macros for internal use
00126 *
00127 **********************************************************************
00128 */
00129 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00130   #define GRAPH_INIT_ID(p) (p->Widget.DebugId = GRAPH_ID)
00131 #else
00132   #define GRAPH_INIT_ID(p)
00133 #endif
00134 
00135 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
00136   GRAPH_OBJ * GRAPH_LockH(GRAPH_Handle h);
00137   #define GRAPH_LOCK_H(h)   GRAPH_LockH(h)
00138 #else
00139   #define GRAPH_LOCK_H(h)   (GRAPH_OBJ *)GUI_LOCK_H(h)
00140 #endif
00141 
00142 /*********************************************************************
00143 *
00144 *       Public data (internal defaults)
00145 *
00146 **********************************************************************
00147 */
00148 extern GRAPH_PROPS GRAPH__DefaultProps;
00149 
00150 /*********************************************************************
00151 *
00152 *       Private functions
00153 *
00154 **********************************************************************
00155 */
00156 void GRAPH__AddValue       (GRAPH_DATA_OBJ * pDataObj, void * pData, void * pValue, int Size);
00157 int  GRAPH__GetValue       (GRAPH_DATA_OBJ * pDataObj, void * pData, void * pValue, int Size, U32 Index);
00158 void GRAPH__InvalidateGraph(GRAPH_Handle hObj);
00159 
00160 #endif /* GUI_WINSUPPORT */
00161 #endif /* GRAPH_PRIVATE_H */